1 /** 2 * \file obj-power.h 3 * \brief calculation of object power and value 4 * 5 * Copyright (c) 2001 Chris Carr, Chris Robertson 6 * Revised in 2009-11 by Chris Carr, Peter Denison 7 * 8 * This work is free software; you can redistribute it and/or modify it 9 * under the terms of either: 10 * 11 * a) the GNU General Public License as published by the Free Software 12 * Foundation, version 2, or 13 * 14 * b) the "Angband licence": 15 * This software may be copied and distributed for educational, research, 16 * and not for profit purposes provided that this copyright and statement 17 * are included in all such copies. Other copyrights may also apply. 18 */ 19 20 #ifndef OBJECT_POWER_H 21 #define OBJECT_POWER_H 22 23 /** 24 * Constants for the power algorithm: 25 * - fudge factor for extra damage from rings etc. (used if extra blows) 26 * - assumed damage for off-weapon brands 27 * - base power for jewelry 28 * - base power for armour items (for halving acid damage) 29 * - power per point of damage 30 * - power per point of +to_hit 31 * - power per point of base AC 32 * - power per point of +to_ac 33 * (these four are all halved in the algorithm) 34 * - assumed max blows 35 * - inhibiting values for +blows/might/shots/immunities (max is one less) 36 */ 37 #define NONWEAP_DAMAGE 15 /* fudge to boost extra blows */ 38 #define WEAP_DAMAGE 12 /* and for off-weapon combat flags */ 39 #define BASE_JEWELRY_POWER 4 40 #define BASE_ARMOUR_POWER 1 41 #define DAMAGE_POWER 5 /* i.e. 2.5 */ 42 #define TO_HIT_POWER 3 /* i.e. 1.5 */ 43 #define BASE_AC_POWER 2 /* i.e. 1 */ 44 #define TO_AC_POWER 2 /* i.e. 1 */ 45 #define MAX_BLOWS 5 46 47 /** 48 * Some constants used in randart generation and power calculation 49 * - thresholds for limiting to_hit, to_dam and to_ac 50 * - fudge factor for rescaling ammo cost 51 * (a stack of this many equals a weapon of the same damage output) 52 */ 53 #define INHIBIT_POWER 20000 54 #define INHIBIT_BLOWS 3 55 #define INHIBIT_MIGHT 4 56 #define INHIBIT_SHOTS 21 57 #define HIGH_TO_AC 26 58 #define VERYHIGH_TO_AC 36 59 #define INHIBIT_AC 56 60 #define HIGH_TO_HIT 16 61 #define VERYHIGH_TO_HIT 26 62 #define HIGH_TO_DAM 16 63 #define VERYHIGH_TO_DAM 26 64 #define AMMO_RESCALER 20 /* this value is also used for torches */ 65 66 67 68 /*** Functions ***/ 69 70 s32b object_power(const struct object *obj, bool verbose, ang_file *log_file); 71 int object_value_real(const struct object *obj, int qty); 72 int object_value(const struct object *obj, int qty); 73 74 75 #endif /* OBJECT_POWER_H */ 76