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7UJRLGUM5SAC Y35JUXHENHI4INSFP2UO4ZJLJJFC7WDDC7LR4HZZHR73FKQB4DXQC JI4NDSOXGGZ7QHXXFB3ZTHAKHABXYBZXPDGLUFV5SKYEOL5FT7JQC KAOE5HB3THUKVGFZRO5EZESHEB3Q34WUO5DFMLWIKOBF47LZTIYAC 7YUGK5Q64KG5O7GJGTUBRRLHAHBCJ5YOE23YUPT6UBKUSB67CYAQC PR2XIEELO6UJWT3EXDHWCJZGIZCCF3D6KF6LC67R6RWWAVNWEHWAC 52FEQPZJXSIC2RBEQDRP4CW56AQTFKQ434GI6PBMEOUGM6KUMHMAC PI5BATR2SER3RFE76IUGHM2AGXVFOUM3PLU7WC2K2Q2BA5K2E73QC 4FQAKUKUO6PCAZ3N4HUR5XL6E4VA5UQUZ3AEDGRBLVY7W2LMWI7QC QEUSVFA6MSROOLK5TVDHKOGIDXRUHJ4CA5FP22EVYKEQF66KJPXQC RK6RL6JBZZ2DFPWAT5UFLB5X5F7V6MXKM5YRZ2JLTRELZ43XJ6UQC 4CIYU7SAAGQJ6BH2WWS4EJWUS6GX25IV24GLYSPGDNWNASVJSIYAC WG2IBEY4INAZZL3XJXC4PHLH36TRYZAP5CEZGXMJ5BLEJM7LEOKQC YMJQTOLVRYBNHPE6RVL6YB6O5E7TNNGTIBYSQHMR4PHSA233TT4QC PKR7JPAXDEL6NSRX5OO45BXOMJL7IQ3L4JV4O5CF2DQJFBEC2NJAC LDBTCT5WIPLJPZWXS2RUQ26QKISCUUTLO77M464WOE6VSYSNPKYAC bool can_slice = you.attribute[ATTR_TRANSFORMATION] == TRAN_BLADE_HANDS|| you.equip[EQ_WEAPON] != -1&& can_cut_meat(you.inv[you.equip[EQ_WEAPON]]);
bool can_slice =(you.attribute[ATTR_TRANSFORMATION] == TRAN_BLADE_HANDS)|| (you.weapon() && can_cut_meat(*you.weapon()));
if (you.equip[EQ_WEAPON] != -1&& item_is_staff( you.inv[you.equip[EQ_WEAPON]] )){maybe_identify_staff(you.inv[you.equip[EQ_WEAPON]], spell);}
if (you.weapon() && item_is_staff(*you.weapon()))maybe_identify_staff(*you.weapon(), spell);
// Special "wield slot" case - see if you can figure out why {dlb}:// ... because only cursed *weapons* in hand count as cursed -- bwrif (you.equip[EQ_WEAPON] != -1&& you.inv[you.equip[EQ_WEAPON]].base_type == OBJ_WEAPONS)
// Only cursed *weapons* in hand count as cursed -- bwrif (you.weapon()&& you.weapon()->base_type == OBJ_WEAPONS&& item_cursed(*you.weapon()))
if (item_cursed( you.inv[you.equip[EQ_WEAPON]] )){// Also sets wield_change.do_uncurse_item( you.inv[you.equip[EQ_WEAPON]] );success = true;}
// Also sets wield_change.do_uncurse_item(*you.weapon());success = true;
if (you.inv[loopy].quantity&& (you.inv[loopy].base_type == OBJ_WEAPONS|| you.inv[loopy].base_type == OBJ_ARMOUR|| you.inv[loopy].base_type == OBJ_JEWELLERY))
item_def& item = you.inv[i];if (is_valid_item(item)&& (item.base_type == OBJ_WEAPONS|| item.base_type == OBJ_ARMOUR|| item.base_type == OBJ_JEWELLERY))
const bool friendly = (!item_cursed(you.inv[wpn]));const beh_type beha = (friendly) ? BEH_FRIENDLY: BEH_HOSTILE;const unsigned short hitting = (friendly) ? you.pet_target: MHITYOU;
const bool friendly = (!item_cursed(wpn));const beh_type beha = (friendly) ? BEH_FRIENDLY : BEH_HOSTILE;const unsigned short hitting = (friendly) ? you.pet_target : MHITYOU;
if (you.inv[wpn].base_type == OBJ_WEAPONS&& (you.inv[wpn].sub_type == WPN_CLUB|| you.inv[wpn].sub_type == WPN_SPEAR|| you.inv[wpn].sub_type == WPN_QUARTERSTAFF|| you.inv[wpn].sub_type == WPN_SCYTHE|| you.inv[wpn].sub_type == WPN_GIANT_CLUB|| you.inv[wpn].sub_type == WPN_GIANT_SPIKED_CLUB|| you.inv[wpn].sub_type == WPN_BOW|| you.inv[wpn].sub_type == WPN_LONGBOW|| you.inv[wpn].sub_type == WPN_ANKUS|| you.inv[wpn].sub_type == WPN_HALBERD|| you.inv[wpn].sub_type == WPN_GLAIVE|| you.inv[wpn].sub_type == WPN_BLOWGUN))
if (wpn.base_type == OBJ_WEAPONS&& (wpn.sub_type == WPN_CLUB|| wpn.sub_type == WPN_SPEAR|| wpn.sub_type == WPN_QUARTERSTAFF|| wpn.sub_type == WPN_SCYTHE|| wpn.sub_type == WPN_GIANT_CLUB|| wpn.sub_type == WPN_GIANT_SPIKED_CLUB|| wpn.sub_type == WPN_BOW|| wpn.sub_type == WPN_LONGBOW|| wpn.sub_type == WPN_ANKUS|| wpn.sub_type == WPN_HALBERD|| wpn.sub_type == WPN_GLAIVE|| wpn.sub_type == WPN_BLOWGUN))
if (you.equip[EQ_WEAPON] != -1&& item_is_staff( you.inv[you.equip[EQ_WEAPON]] )){maybe_identify_staff(you.inv[you.equip[EQ_WEAPON]]);}
if (you.weapon() && item_is_staff( *you.weapon() ))maybe_identify_staff(*you.weapon());
if (you.equip[EQ_WEAPON] != -1&& you.inv[you.equip[EQ_WEAPON]].base_type == OBJ_WEAPONS&& you.inv[you.equip[EQ_WEAPON]].sub_type == sub_type)
if (you.weapon()&& you.weapon()->base_type == OBJ_WEAPONS&& you.weapon()->sub_type == sub_type)
// Like above, but must be magical stave.if (you.equip[EQ_WEAPON] != -1&& you.inv[you.equip[EQ_WEAPON]].base_type == OBJ_STAVES&& you.inv[you.equip[EQ_WEAPON]].sub_type == sub_type&& (calc_unid|| item_type_known( you.inv[you.equip[EQ_WEAPON]] )))
// Like above, but must be magical staff.if (you.weapon()&& you.weapon()->base_type == OBJ_STAVES&& you.weapon()->sub_type == sub_type&& (calc_unid || item_type_known(*you.weapon())))
if (you.equip[EQ_WEAPON] != -1&& you.inv[you.equip[EQ_WEAPON]].base_type == OBJ_WEAPONS&& is_random_artefact( you.inv[you.equip[EQ_WEAPON]] ))
if (you.weapon()&& you.weapon()->base_type == OBJ_WEAPONS&& is_random_artefact(*you.weapon()))
if (you.equip[EQ_WEAPON] != -1&& you.inv[you.equip[EQ_WEAPON]].base_type == OBJ_WEAPONS&& you.inv[you.equip[EQ_WEAPON]].special == SPWPN_STAFF_OF_OLGREB)
if (you.weapon()&& you.weapon()->base_type == OBJ_WEAPONS&& you.weapon()->special == SPWPN_STAFF_OF_OLGREB)
if (you.equip[EQ_WEAPON] != -1&& you.inv[you.equip[EQ_WEAPON]].base_type == OBJ_WEAPONS&& you.inv[you.equip[EQ_WEAPON]].special == SPWPN_STAFF_OF_OLGREB)
if (you.weapon()&& you.weapon()->base_type == OBJ_WEAPONS&& you.weapon()->special == SPWPN_STAFF_OF_OLGREB)
set_ident_type( OBJ_STAVES, item.sub_type, ID_KNOWN_TYPE );set_ident_flags( item, ISFLAG_IDENT_MASK );
set_ident_type(OBJ_STAVES, item.sub_type, ID_KNOWN_TYPE);set_ident_flags(item, ISFLAG_IDENT_MASK);
// GDL: note that rangeMax is set to 0, which means that max range is// equal to range. This is OK, since rangeMax really only matters for// stuff monsters throw/zap.// All of the following settings might be changed by _zappy().
// pbolt needs to be initialized for tracing: with the the maximum range,// and the flavour to allow for completely resistant monsters.static void _get_max_range( zap_type z_type, int power, bolt &pbolt ){// sorted by rangeswitch (z_type){case ZAP_SMALL_SANDBLAST:pbolt.flavour = BEAM_FRAG;break;case ZAP_SANDBLAST:pbolt.flavour = BEAM_FRAG;break;case ZAP_FLAME_TONGUE:if (power > 25)power = 25;pbolt.flavour = BEAM_FIRE;break;case ZAP_CLEANSING_FLAME:pbolt.name = "golden flame";pbolt.flavour = BEAM_HOLY;pbolt.is_explosion = true;break;case ZAP_MAGMA:pbolt.flavour = BEAM_LAVA;pbolt.is_beam = true;break;case ZAP_IRON_BOLT:pbolt.flavour = BEAM_MMISSILE; // unresistablebreak;case ZAP_CRYSTAL_SPEAR:pbolt.flavour = BEAM_MMISSILE; // unresistablebreak;case ZAP_SPIT_POISON:if (power > 50)power = 50;pbolt.flavour = BEAM_POISON;break;case ZAP_BREATHE_FIRE:if (power > 50)power = 50;pbolt.flavour = BEAM_FIRE;pbolt.is_beam = true;break;case ZAP_BREATHE_FROST:if (power > 50)power = 50;pbolt.flavour = BEAM_COLD;pbolt.is_beam = true;break;case ZAP_BREATHE_ACID:if (power > 50)power = 50;pbolt.flavour = BEAM_ACID;pbolt.is_beam = true;break;case ZAP_BREATHE_POISON: // leaves clouds of gasif (power > 50)power = 50;pbolt.flavour = BEAM_POISON;pbolt.is_beam = true;break;case ZAP_BREATHE_POWER:if (power > 50)power = 50;pbolt.flavour = BEAM_MMISSILE; // unresistablepbolt.is_beam = true;break;case ZAP_BREATHE_STEAM:pbolt.flavour = BEAM_STEAM;pbolt.is_beam = true;break;case ZAP_STRIKING:case ZAP_MAGIC_DARTS:case ZAP_STONE_ARROW:case ZAP_MYSTIC_BLAST:pbolt.flavour = BEAM_MMISSILE; // unresistablebreak;case ZAP_STING:case ZAP_POISON_ARROW:pbolt.flavour = BEAM_POISON;break;case ZAP_FLAME:case ZAP_STICKY_FLAME:pbolt.flavour = BEAM_FIRE;break;case ZAP_FROST:pbolt.flavour = BEAM_COLD;break;case ZAP_ICE_BOLT:pbolt.flavour = BEAM_ICE; // half resistablebreak;
case ZAP_ELECTRICITY:pbolt.flavour = BEAM_ELECTRICITY; // beams & reflectspbolt.is_beam = true;break;case ZAP_DISRUPTION:case ZAP_DISINTEGRATION:pbolt.name = "0";pbolt.flavour = BEAM_DISINTEGRATION;break;case ZAP_PAIN:pbolt.name = "0";pbolt.flavour = BEAM_PAIN;break;case ZAP_DISPEL_UNDEAD:pbolt.name = "0";pbolt.flavour = BEAM_DISPEL_UNDEAD;break;case ZAP_FIRE:pbolt.flavour = BEAM_FIRE;pbolt.is_beam = true;break;case ZAP_BONE_SHARDS:pbolt.flavour = BEAM_MAGIC; // unresistedpbolt.is_beam = true;break;case ZAP_COLD:pbolt.flavour = BEAM_COLD;pbolt.is_beam = true;break;case ZAP_NEGATIVE_ENERGY:pbolt.flavour = BEAM_NEG; // drains levelspbolt.is_beam = true;break;case ZAP_BEAM_OF_ENERGY: // bolt of innacuracypbolt.flavour = BEAM_ENERGY; // unresistedpbolt.is_beam = true;break;case ZAP_VENOM_BOLT:pbolt.flavour = BEAM_POISON;pbolt.is_beam = true;break;case ZAP_LIGHTNING:pbolt.flavour = BEAM_ELECTRICITY; // beams & reflectspbolt.is_beam = true;break;// enchantmentscase ZAP_ENSLAVEMENT:pbolt.name = "0";pbolt.flavour = BEAM_CHARM;break;case ZAP_BANISHMENT:pbolt.name = "0";pbolt.flavour = BEAM_BANISH;break;case ZAP_DEGENERATION:pbolt.name = "0";pbolt.flavour = BEAM_DEGENERATE;break;case ZAP_ENSLAVE_UNDEAD:pbolt.name = "0";pbolt.flavour = BEAM_ENSLAVE_UNDEAD;break;case ZAP_CONTROL_DEMON:pbolt.name = "0";pbolt.flavour = BEAM_ENSLAVE_DEMON;break;case ZAP_SLEEP:pbolt.name = "0";pbolt.flavour = BEAM_SLEEP;break;case ZAP_BACKLIGHT:pbolt.name = "0";pbolt.flavour = BEAM_BACKLIGHT;break;case ZAP_SLOWING:pbolt.name = "0";pbolt.flavour = BEAM_SLOW;break;case ZAP_HASTING:pbolt.name = "0";pbolt.flavour = BEAM_HASTE;break;case ZAP_PARALYSIS:pbolt.name = "0";pbolt.flavour = BEAM_PARALYSIS;break;case ZAP_PETRIFY:pbolt.name = "0";pbolt.flavour = BEAM_PETRIFY;break;case ZAP_CONFUSION:pbolt.name = "0";pbolt.flavour = BEAM_CONFUSION;break;case ZAP_INVISIBILITY:pbolt.name = "0";pbolt.flavour = BEAM_INVISIBILITY;break;case ZAP_HEALING:pbolt.name = "0";pbolt.flavour = BEAM_HEALING;break;case ZAP_TELEPORTATION:pbolt.name = "0";pbolt.flavour = BEAM_TELEPORT;break;case ZAP_POLYMORPH_OTHER:pbolt.name = "0";pbolt.flavour = BEAM_POLYMORPH;break;case ZAP_AGONY:pbolt.name = "0agony";pbolt.flavour = BEAM_PAIN;break;case ZAP_DIGGING:pbolt.name = "0";pbolt.flavour = BEAM_DIGGING;pbolt.is_beam = true;break;// explosionscase ZAP_FIREBALL:pbolt.name = "fireball";pbolt.flavour = BEAM_FIRE; // firepbolt.is_explosion = true;break;case ZAP_ICE_STORM:pbolt.name = "great blast of cold";pbolt.ench_power = power; // used for radiuspbolt.flavour = BEAM_ICE; // half resistedpbolt.is_explosion = true;break;case ZAP_ORB_OF_FRAGMENTATION: // cap 150pbolt.name = "metal orb";pbolt.flavour = BEAM_FRAG; // extra AC resistpbolt.is_explosion = true;break;case ZAP_HELLFIRE:pbolt.flavour = BEAM_HELLFIRE;pbolt.is_explosion = true;break;case ZAP_ORB_OF_ELECTRICITY: // cap 150pbolt.name = "orb of electricity";pbolt.flavour = BEAM_ELECTRICITY;pbolt.is_explosion = true;break;case ZAP_DEBUGGING_RAY:default: // buggy beampbolt.flavour = BEAM_MMISSILE; // unresistablebreak;}}
// Need to see zapping() for default values not set within this function {dlb}static void _zappy( zap_type z_type, int power, bolt &pbolt )
template<typename T>struct power_deducer
// Note: The incoming power is not linear in the case of spellcasting.// The power curve currently allows for the character to reasonably// get up to a power level of about a 100, but more than that will// be very hard (and the maximum is 200). The low level power caps// provide the useful feature in that they allow for low level spells// to have quick advancement, but don't cause them to obsolete the// higher level spells. -- bwr//// I've added some example characters below to show how little// people should be concerned about the power caps.//// The example characters are simplified to three stats://// - Intelligence: This magnifies power, it's very useful.//// - Skills: This represents the character having Spellcasting// and the average of the component skills at this level.// Although, Spellcasting probably isn't quite as high as// other spell skills for a lot of characters, note that it// contributes much less to the total power (about 20%).//// - Enhancers: These are equipment that the player can use to// apply additional magnifiers (x1.5) to power. There are// also inhibitors that reduce power (/2.0), but we're not// concerned about those here. Anyways, the character can// currently have up to 3 levels (for x1.5, x2.25, x3.375).// The lists below should help to point out the difficulty// and cost of getting more than one level of enhancement.//// Here's a list of current magnifiers://// - rings of fire/cold// - staff of fire/cold/air/earth/poison/death/conjure/enchant/summon// - staff of Olgreb (poison)// - robe of the Archmagi (necro, conjure, enchant, summon)// - Mummy intrinsic (+1 necromancy at level 13, +2 at level 26)// - Necromutation (+1 to necromancy -- note: undead can't use this)// - Ring of Fire (+1 to fire)//// The maximum enhancement, by school (but capped at 3)://// - Necromancy: 4 (Mummies), 3 (others)// - Fire: 4// - Cold: 3// - Conjuration: 2// - Enchantment: 2// - Summoning: 2// - Air: 1// - Earth: 1// - Poison: 1// - Translocations, Transmigrations, Divinations intentionally 0
typedef power_deducer<int> tohit_deducer;
// level 1//// This cap is to keep these easy and very cheap spells from// becoming too powerful.//// Example characters with about 25 power://// - int 5, skills 20, 0 enhancers// - int 5, skills 14, 1 enhancer// - int 10, skills 10, 0 enhancers// - int 10, skills 7, 1 enhancers// - int 15, skills 7, 0 enhancers// - int 20, skills 6, 0 enhancerscase ZAP_STRIKING:case ZAP_MAGIC_DARTS:case ZAP_STING:case ZAP_ELECTRICITY:case ZAP_FLAME_TONGUE:case ZAP_SMALL_SANDBLAST:case ZAP_DISRUPTION: // ench_power boosted belowcase ZAP_PAIN: // ench_power boosted belowif (power > 25)power = 25;break;
return adder + (pow * mult_num) / mult_denom;}};
// level 2/3//// The following examples should make it clear that in the// early game this cap is only limiting to serious spellcasters// (they could easily reach the 20-10-0 example).//// Example characters with about 50 power://// - int 10, skills 20, 0 enhancers// - int 10, skills 14, 1 enhancer// - int 15, skills 14, 0 enhancers// - int 15, skills 10, 1 enhancer// - int 20, skills 10, 0 enhancers// - int 20, skills 7, 1 enhancer// - int 25, skills 8, 0 enhancerscase ZAP_SANDBLAST:case ZAP_FLAME: // also ability (pow = lev * 2)case ZAP_FROST: // also ability (pow = lev * 2)case ZAP_STONE_ARROW:if (power > 50)power = 50;break;
typedef power_deducer<dice_def> dam_deducer;
// Here are some examples that show that its fairly safe to assume// that a high level character can easily have 75 power.//// Example characters with about 75 power://// - int 10, skills 27, 1 enhancer// - int 15, skills 27, 0 enhancers// - int 15, skills 16, 1 enhancer// - int 20, skills 20, 0 enhancers// - int 20, skills 14, 1 enhancer// - int 25, skills 16, 0 enhancers
template<int numdice, int adder, int mult_num, int mult_denom>struct dicedef_calculator : public dam_deducer{dice_def operator()(int pow) const{return dice_def(numdice, adder + (pow * mult_num) / mult_denom);}};
// level 4//// The following examples should make it clear that this is the// effective maximum power. Its not easy to get to 100 power,// but 20-20-1 or 25-16-1 is certainly attainable by a high level// spellcaster. As you can see from the examples at 150 and 200,// getting much power beyond this is very difficult.//// Level 3 and 4 spells cannot be overpowered.//// Example characters with about 100 power://// - int 10, skills 27, 2 enhancers// - int 15, skills 27, 1 enhancer// - int 20, skills 20, 1 enhancer// - int 25, skills 24, 0 enhancers// - int 25, skills 16, 1 enhancercase ZAP_MYSTIC_BLAST:case ZAP_STICKY_FLAME:case ZAP_ICE_BOLT:case ZAP_DISPEL_UNDEAD: // ench_power raised belowif (power > 100)power = 100;break;
template<int numdice, int adder, int mult_num, int mult_denom>struct calcdice_calculator : public dam_deducer{dice_def operator()(int pow) const{return calc_dice(numdice, adder + (pow * mult_num) / mult_denom);}};
// levels 5-7//// These spells used to be capped, but its very hard to raise// power over 100, and these examples should show that.// Only the twinkiest of characters are expected to get to 150.//// Example characters with about 150 power://// - int 15, skills 27, 3 enhancers (actually, only 146)// - int 20, skills 27, 2 enhancers (actually, only 137)// - int 20, skills 21, 3 enhancers// - int 25, skills 26, 2 enhancers// - int 30, skills 21, 2 enhancers// - int 40, skills 24, 1 enhancer// - int 70, skills 20, 0 enhancerscase ZAP_FIRE:case ZAP_COLD:case ZAP_VENOM_BOLT:case ZAP_MAGMA:case ZAP_AGONY:case ZAP_LIGHTNING: // also invoc * 6 or lev * 2 (abils)case ZAP_NEGATIVE_ENERGY: // also ability (pow = lev * 6)case ZAP_IRON_BOLT:case ZAP_DISINTEGRATION:case ZAP_FIREBALL:case ZAP_ORB_OF_ELECTRICITY:case ZAP_ORB_OF_FRAGMENTATION:case ZAP_POISON_ARROW:// if (power > 150)// power = 150;break;
struct zap_info{zap_type ztype;const char* name; // NULL means handled speciallyint power_cap;dam_deducer* damage;tohit_deducer* tohit; // Enchantments have power modifier hereint colour;bool is_enchantment;beam_type flavour;dungeon_char_type glyph;bool always_obvious;bool can_beam;bool is_explosion;};
// levels 8-9//// These spells are capped at 200 (which is the cap in calc_spell_power).// As an example of how little of a cap that is, consider the fact// that a 70-27-3 character has an uncapped power of 251. Characters// are never expected to get to this cap.//// Example characters with about 200 power://// - int 30, skills 27, 3 enhancers (actually, only 190)// - int 40, skills 27, 2 enhancers (actually, only 181)// - int 40, skills 23, 3 enhancers// - int 70, skills 27, 0 enhancers (actually, only 164)// - int 70, skills 27, 1 enhancers (actually, only 194)// - int 70, skills 20, 2 enhancers// - int 70, skills 13, 3 enhancerscase ZAP_CRYSTAL_SPEAR:case ZAP_HELLFIRE:case ZAP_ICE_STORM:case ZAP_CLEANSING_FLAME:// if (power > 200)// power = 200;break;
const zap_info zap_data[] = {
// unlimited power (needs a good reason)case ZAP_BONE_SHARDS: // incoming power is modified for masscase ZAP_BEAM_OF_ENERGY: // inaccuracy (only on staff, hardly hits)break;
{ZAP_FLAME,"puff of flame",50,new dicedef_calculator<2, 4, 1, 10>,new tohit_calculator<8, 1, 10>,RED,false,BEAM_FIRE,DCHAR_FIRED_ZAP,true,false,false},
// natural/mutant breath/spit powers (power ~= characer level)case ZAP_SPIT_POISON: // lev + mut * 5case ZAP_BREATHE_FIRE: // lev + mut * 4 + 12 (if dragonform)case ZAP_BREATHE_FROST: // levcase ZAP_BREATHE_ACID: // lev (or invoc * 3 from minor destr)case ZAP_BREATHE_POISON: // levcase ZAP_BREATHE_POWER: // levcase ZAP_BREATHE_STEAM: // levif (power > 50)power = 50;break;
{ZAP_FROST,"puff of frost",50,new dicedef_calculator<2, 4, 1, 10>,new tohit_calculator<8, 1, 10>,WHITE,false,BEAM_COLD,DCHAR_FIRED_ZAP,true,false,false},
// enchantments and other resistable effectscase ZAP_SLOWING:case ZAP_HASTING:case ZAP_PARALYSIS:case ZAP_PETRIFY:case ZAP_BACKLIGHT:case ZAP_SLEEP:case ZAP_CONFUSION:case ZAP_INVISIBILITY:case ZAP_ENSLAVEMENT:case ZAP_TELEPORTATION:case ZAP_DIGGING:case ZAP_POLYMORPH_OTHER:case ZAP_DEGENERATION:case ZAP_BANISHMENT:// This is the only power that matters. We magnify it apparently// to get values that work better with magic resistance checks...// those checks will scale down this value and max it out at 120.pbolt.ench_power *= 3;pbolt.ench_power /= 2;break;
{ZAP_SLOWING,"0",100,NULL,NULL,BLACK,true,BEAM_SLOW,DCHAR_SPACE,false,false,false},
// Note: I'm only displaying the top damage and such here, that's// because it's really not been known before (since the above caps// didn't exist), so they were all pretty much unlimited before.// Also note, that the high end damage occurs at the cap, only// players that are that powerful can get that damage... and// although these numbers might seem small, you should remember// that Dragons in this game are 60-90 hp monsters, and very// few monsters have more than 100 hp (and that 1d5 damage is// still capable of taking a good sized chunk (and possibly killing)// any monster you're likely to meet in the first three levels). -- bwr
{ZAP_MAGIC_DARTS,"magic dart",25,new dicedef_calculator<1, 3, 1, 5>,new tohit_calculator<AUTOMATIC_HIT>,LIGHTMAGENTA,false,BEAM_MMISSILE,DCHAR_FIRED_ZAP,true,false,false},{ZAP_HEALING,"0",100,new dicedef_calculator<1, 7, 1, 3>,NULL,BLACK,true,BEAM_HEALING,DCHAR_SPACE,false,false,false},
case ZAP_STRIKING: // cap 25pbolt.name = "force bolt";pbolt.colour = BLACK;pbolt.damage = dice_def( 1, 5 ); // dam: 5pbolt.hit = 8 + power / 10; // 25: 10pbolt.type = dchar_glyph(DCHAR_SPACE);pbolt.flavour = BEAM_MMISSILE; // unresistablepbolt.obvious_effect = true;break;
ZAP_PARALYSIS,"0",100,NULL,NULL,BLACK,true,BEAM_PARALYSIS,DCHAR_SPACE,false,false,false},
case ZAP_MAGIC_DARTS: // cap 25pbolt.name = "magic dart";pbolt.colour = LIGHTMAGENTA;pbolt.damage = dice_def( 1, 3 + power / 5 ); // 25: 1d8pbolt.hit = AUTOMATIC_HIT; // hits alwayspbolt.type = dchar_glyph(DCHAR_FIRED_ZAP);pbolt.flavour = BEAM_MMISSILE; // unresistablepbolt.obvious_effect = true;break;
{ZAP_FIRE,"bolt of fire",200,new calcdice_calculator<6, 18, 2, 3>,new tohit_calculator<10, 1, 25>,RED,false,BEAM_FIRE,DCHAR_FIRED_ZAP,true,true,false},{ZAP_COLD,"bolt of cold",200,new calcdice_calculator<6, 18, 2, 3>,new tohit_calculator<10, 1, 25>,WHITE,false,BEAM_COLD,DCHAR_FIRED_ZAP,true,true,false},{ZAP_CONFUSION,"0",100,NULL,NULL,BLACK,true,BEAM_CONFUSION,DCHAR_SPACE,false,false,false},
case ZAP_STING: // cap 25pbolt.name = "sting";pbolt.colour = GREEN;pbolt.damage = dice_def( 1, 3 + power / 5 ); // 25: 1d8pbolt.hit = 8 + power / 5; // 25: 13pbolt.type = dchar_glyph(DCHAR_FIRED_ZAP);pbolt.flavour = BEAM_POISON; // extra damagepbolt.obvious_effect = true;break;
{ZAP_INVISIBILITY,"0",100,NULL,NULL,BLACK,true,BEAM_INVISIBILITY,DCHAR_SPACE,false,false,false},
case ZAP_ELECTRICITY: // cap 20pbolt.name = "zap";pbolt.colour = LIGHTCYAN;pbolt.damage = dice_def( 1, 3 + random2(power) / 2 );// 25: 1d11pbolt.hit = 8 + power / 7; // 25: 11pbolt.type = dchar_glyph(DCHAR_FIRED_ZAP);pbolt.flavour = BEAM_ELECTRICITY; // beams & reflectspbolt.obvious_effect = true;pbolt.is_beam = true;break;
{ZAP_DIGGING,"0",100,NULL,NULL,BLACK,true,BEAM_DIGGING,DCHAR_SPACE,false,true,false},
case ZAP_DISRUPTION: // cap 25pbolt.name = "0";pbolt.flavour = BEAM_DISINTEGRATION;pbolt.damage = dice_def( 1, 4 + power / 5 ); // 25: 1d9pbolt.ench_power *= 3;break;
{ZAP_FIREBALL,"fireball",200,new calcdice_calculator<3, 10, 1, 2>,new tohit_calculator<40>,RED,false,BEAM_FIRE,DCHAR_FIRED_ZAP,false,false,true},
case ZAP_PAIN: // cap 25pbolt.name = "0";pbolt.flavour = BEAM_PAIN;pbolt.damage = dice_def( 1, 4 + power / 5 ); // 25: 1d9pbolt.ench_power *= 7;pbolt.ench_power /= 2;break;
{ZAP_TELEPORTATION,"0",100,NULL,NULL,BLACK,true,BEAM_TELEPORT,DCHAR_SPACE,false,false,false},
case ZAP_FLAME_TONGUE: // cap 25pbolt.name = "flame";pbolt.colour = RED;pbolt.damage = dice_def( 1, 8 + power / 4 ); // 25: 1d14pbolt.hit = 7 + power / 6; // 25: 11pbolt.type = dchar_glyph(DCHAR_FIRED_BOLT);pbolt.flavour = BEAM_FIRE;pbolt.obvious_effect = true;break;
{ZAP_LIGHTNING,"bolt of lightning",200,new calcdice_calculator<1, 10, 3, 5>,new tohit_calculator<7, 1, 40>,LIGHTCYAN,false,BEAM_ELECTRICITY,DCHAR_FIRED_ZAP,true,true,false},
temp_rand = random2(4);pbolt.name += (temp_rand == 0) ? "dust" :(temp_rand == 1) ? "dirt" :(temp_rand == 2) ? "grit" : "sand";
{ZAP_VENOM_BOLT,"bolt of poison",200,new calcdice_calculator<4, 15, 1, 2>,new tohit_calculator<8, 1, 20>,LIGHTGREEN,false,BEAM_POISON,DCHAR_FIRED_ZAP,true,true,false},{ZAP_NEGATIVE_ENERGY,"bolt of negative energy",200,new calcdice_calculator<4, 15, 3, 5>,new tohit_calculator<8, 1, 20>,DARKGREY,false,BEAM_NEG,DCHAR_FIRED_ZAP,true,true,false},
pbolt.colour = BROWN;pbolt.damage = dice_def( 1, 8 + power / 4 ); // 25: 1d14pbolt.hit = 8 + power / 5; // 25: 13pbolt.type = dchar_glyph(DCHAR_FIRED_BOLT);pbolt.flavour = BEAM_FRAG; // extra AC resistpbolt.obvious_effect = true;break;
{ZAP_CRYSTAL_SPEAR,"crystal spear",200,new calcdice_calculator<10, 23, 1, 1>,new tohit_calculator<10, 1, 15>,WHITE,false,BEAM_MMISSILE,DCHAR_FIRED_MISSILE,true,false,false},
case ZAP_SANDBLAST: // cap 50pbolt.name = coinflip() ? "blast of rock" : "rocky blast";pbolt.colour = BROWN;pbolt.damage = dice_def( 2, 4 + power / 3 ); // 25: 2d12pbolt.hit = 13 + power / 10; // 25: 15pbolt.type = dchar_glyph(DCHAR_FIRED_BOLT);pbolt.flavour = BEAM_FRAG; // extra AC resistpbolt.obvious_effect = true;break;
{ZAP_BEAM_OF_ENERGY,"narrow beam of energy",1000,new calcdice_calculator<12, 40, 3, 2>,new tohit_calculator<1>,YELLOW,false,BEAM_ENERGY,DCHAR_FIRED_ZAP,true,true,false},
case ZAP_BONE_SHARDS:pbolt.name = "spray of bone shards";pbolt.colour = LIGHTGREY;
{ZAP_MYSTIC_BLAST,"orb of energy",100,new calcdice_calculator<2, 15, 2, 5>,new tohit_calculator<10, 1, 7>,LIGHTMAGENTA,false,BEAM_MMISSILE,DCHAR_FIRED_ZAP,true,false,false},
// Incoming power is highly dependant on mass (see spells3.cc).// Basic function is power * 15 + mass... with the largest// available mass (3000) we get a power of 4500 at a power// level of 100 (for 3d20).pbolt.damage = dice_def( 3, 2 + (power / 250) );pbolt.hit = 8 + (power / 100); // max hit: 53pbolt.type = dchar_glyph(DCHAR_FIRED_ZAP);pbolt.flavour = BEAM_MAGIC; // unresistedpbolt.obvious_effect = true;pbolt.is_beam = true;break;
{ZAP_ENSLAVEMENT,"0",100,NULL,NULL,BLACK,true,BEAM_CHARM,DCHAR_SPACE,false,false,false},
case ZAP_FLAME: // cap 50pbolt.name = "puff of flame";pbolt.colour = RED;pbolt.damage = dice_def( 2, 4 + power / 10 );// 25: 2d6 50: 2d9pbolt.hit = 8 + power / 10; // 25: 10 50: 13pbolt.type = dchar_glyph(DCHAR_FIRED_ZAP);pbolt.flavour = BEAM_FIRE;pbolt.obvious_effect = true;break;
{ZAP_PAIN,"0",100,new dicedef_calculator<1, 4, 1,5>,new tohit_calculator<0, 7, 2>,BLACK,true,BEAM_PAIN,DCHAR_SPACE,false,false,false},
case ZAP_FROST: // cap 50pbolt.name = "puff of frost";pbolt.colour = WHITE;pbolt.damage = dice_def( 2, 4 + power / 10 );// 25: 2d6 50: 2d9pbolt.hit = 8 + power / 10; // 25: 10 50: 13pbolt.type = dchar_glyph(DCHAR_FIRED_ZAP);pbolt.flavour = BEAM_COLD;pbolt.obvious_effect = true;break;
{ZAP_STICKY_FLAME,"sticky flame",100,new dicedef_calculator<2, 3, 1, 12>,new tohit_calculator<11, 1, 10>,RED,false,BEAM_FIRE,DCHAR_FIRED_ZAP,true,false,false},
case ZAP_STONE_ARROW: // cap 100pbolt.name = "stone arrow";pbolt.colour = LIGHTGREY;pbolt.damage = dice_def( 2, 5 + power / 7 );// 25: 2d8 50: 2d12pbolt.hit = 8 + power / 10; // 25: 10 50: 13pbolt.type = dchar_glyph(DCHAR_FIRED_MISSILE);pbolt.flavour = BEAM_MMISSILE; // irresistiblepbolt.obvious_effect = true;break;
{ZAP_DISPEL_UNDEAD,"0",100,new calcdice_calculator<3, 20, 3, 4>,new tohit_calculator<0, 3, 2>,BLACK,true,BEAM_DISPEL_UNDEAD,DCHAR_SPACE,false,false,false},
case ZAP_STICKY_FLAME: // cap 100pbolt.name = "sticky flame"; // extra damagepbolt.colour = RED;// 50: 2d7 100: 2d11pbolt.damage = dice_def( 2, 3 + power / 12 );// 50: 16 100: 21pbolt.hit = 11 + power / 10;pbolt.type = dchar_glyph(DCHAR_FIRED_ZAP);pbolt.flavour = BEAM_FIRE;pbolt.obvious_effect = true;break;
case ZAP_MYSTIC_BLAST: // cap 100pbolt.name = "orb of energy";pbolt.colour = LIGHTMAGENTA;pbolt.damage = calc_dice( 2, 15 + (power * 2) / 5 );pbolt.hit = 10 + power / 7; // 50: 17 100: 24pbolt.type = dchar_glyph(DCHAR_FIRED_ZAP);pbolt.flavour = BEAM_MMISSILE; // unresistablepbolt.obvious_effect = true;break;
{ZAP_CLEANSING_FLAME,"golden flame",200,new calcdice_calculator<2, 20, 2, 3>,new tohit_calculator<150>,YELLOW,false,BEAM_HOLY,DCHAR_FIRED_ZAP,true,true,false},
case ZAP_ICE_BOLT: // cap 100pbolt.name = "bolt of ice";pbolt.colour = WHITE;pbolt.damage = calc_dice( 3, 10 + power / 2 );pbolt.hit = 9 + power / 12; // 50: 13 100: 17pbolt.type = dchar_glyph(DCHAR_FIRED_ZAP);pbolt.flavour = BEAM_ICE; // half resistablebreak;
case ZAP_DISPEL_UNDEAD: // cap 100pbolt.name = "0";pbolt.flavour = BEAM_DISPEL_UNDEAD;pbolt.damage = calc_dice( 3, 20 + (power * 3) / 4 );pbolt.ench_power *= 3;pbolt.ench_power /= 2;break;
{ZAP_BONE_SHARDS,"spray of bone shards",// Incoming power is highly dependant on mass (see spells3.cc).// Basic function is power * 15 + mass... with the largest// available mass (3000) we get a power of 4500 at a power// level of 100 (for 3d20).10000,new dicedef_calculator<3, 2, 1, 250>,new tohit_calculator<8, 1, 100>,LIGHTGREY,false,BEAM_MAGIC,DCHAR_FIRED_ZAP,true,true,false},
case ZAP_MAGMA: // cap 150pbolt.name = "bolt of magma";pbolt.colour = RED;pbolt.damage = calc_dice( 4, 10 + (power * 3) / 5 );pbolt.hit = 8 + power / 25; // 50: 10 100: 14pbolt.type = dchar_glyph(DCHAR_FIRED_ZAP);pbolt.flavour = BEAM_LAVA;pbolt.obvious_effect = true;pbolt.is_beam = true;break;
{ZAP_BANISHMENT,"0",100,NULL,NULL,BLACK,true,BEAM_BANISH,DCHAR_SPACE,false,false,false},
case ZAP_FIRE: // cap 150pbolt.name = "bolt of fire";pbolt.colour = RED;pbolt.damage = calc_dice( 6, 18 + power * 2 / 3 );pbolt.hit = 10 + power / 25; // 50: 12 100: 14pbolt.type = dchar_glyph(DCHAR_FIRED_ZAP);pbolt.flavour = BEAM_FIRE;pbolt.obvious_effect = true;pbolt.is_beam = true;break;
case ZAP_COLD: // cap 150pbolt.name = "bolt of cold";pbolt.colour = WHITE;pbolt.damage = calc_dice( 6, 18 + power * 2 / 3 );pbolt.hit = 10 + power / 25; // 50: 12 100: 14pbolt.type = dchar_glyph(DCHAR_FIRED_ZAP);pbolt.flavour = BEAM_COLD;pbolt.obvious_effect = true;pbolt.is_beam = true;break;
{ZAP_DEGENERATION,"0",100,NULL,NULL,BLACK,true,BEAM_DEGENERATE,DCHAR_SPACE,false,false,false},
case ZAP_VENOM_BOLT: // cap 150pbolt.name = "bolt of poison";pbolt.colour = LIGHTGREEN;pbolt.damage = calc_dice( 4, 15 + power / 2 );pbolt.hit = 8 + power / 20; // 50: 10 100: 13pbolt.type = dchar_glyph(DCHAR_FIRED_ZAP);pbolt.flavour = BEAM_POISON; // extra damagepbolt.obvious_effect = true;pbolt.is_beam = true;break;
case ZAP_NEGATIVE_ENERGY: // cap 150// These always auto-identify, so no generic name.pbolt.name = "bolt of negative energy";pbolt.colour = DARKGREY;pbolt.damage = calc_dice( 4, 15 + (power * 3) / 5 );pbolt.hit = 8 + power / 20; // 50: 10 100: 13pbolt.type = dchar_glyph(DCHAR_FIRED_ZAP);pbolt.flavour = BEAM_NEG; // drains levelspbolt.obvious_effect = true;pbolt.is_beam = true;break;
{ZAP_STING,"sting",25,new dicedef_calculator<1, 3, 1, 5>,new tohit_calculator<8, 1, 5>,GREEN,false,BEAM_POISON,DCHAR_FIRED_ZAP,true,false,false},
case ZAP_IRON_BOLT: // cap 150pbolt.name = "iron bolt";pbolt.colour = LIGHTCYAN;pbolt.damage = calc_dice( 9, 15 + (power * 3) / 4 );pbolt.hit = 7 + power / 15; // 50: 10 100: 13pbolt.type = dchar_glyph(DCHAR_FIRED_MISSILE);pbolt.flavour = BEAM_MMISSILE; // unresistablepbolt.obvious_effect = true;break;
case ZAP_POISON_ARROW: // cap 150pbolt.name = "poison arrow";pbolt.colour = LIGHTGREEN;pbolt.damage = calc_dice( 4, 15 + power );pbolt.hit = 5 + power / 10; // 50: 10 100: 15pbolt.type = dchar_glyph(DCHAR_FIRED_MISSILE);pbolt.flavour = BEAM_POISON_ARROW; // extra damagepbolt.obvious_effect = true;break;
{ZAP_HELLFIRE,"hellfire",200,new calcdice_calculator<3, 10, 3, 4>,new tohit_calculator<20, 1, 10>,RED,false,BEAM_HELLFIRE,DCHAR_FIRED_ZAP,true,false,true},
case ZAP_DISINTEGRATION: // cap 150pbolt.name = "0";pbolt.flavour = BEAM_DISINTEGRATION;pbolt.damage = calc_dice( 3, 15 + (power * 3) / 4 );pbolt.ench_power *= 5;pbolt.ench_power /= 2;pbolt.is_beam = true;break;
{ZAP_STRIKING,"force bolt",25,new dicedef_calculator<1, 5, 0, 1>,new tohit_calculator<8, 1, 10>,BLACK,false,BEAM_MMISSILE,DCHAR_SPACE,true,false,false},
case ZAP_LIGHTNING: // cap 150// also for breath (at pow = lev * 2; max dam: 33)pbolt.name = "bolt of lightning";pbolt.colour = LIGHTCYAN;pbolt.damage = calc_dice( 1, 10 + (power * 3) / 5 );pbolt.hit = 7 + random2(power) / 20; // 50: 7-9 100: 7-12pbolt.type = dchar_glyph(DCHAR_FIRED_ZAP);pbolt.flavour = BEAM_ELECTRICITY; // beams & reflectspbolt.obvious_effect = true;pbolt.is_beam = true;break;
{ZAP_STONE_ARROW,"stone arrow",50,new dicedef_calculator<2, 5, 1, 7>,new tohit_calculator<8, 1, 10>,LIGHTGREY,false,BEAM_MMISSILE,DCHAR_FIRED_MISSILE,true,false,false},
case ZAP_FIREBALL: // cap 150pbolt.name = "fireball";pbolt.colour = RED;pbolt.damage = calc_dice( 3, 10 + power / 2 );pbolt.hit = 40; // hit: 40pbolt.type = dchar_glyph(DCHAR_FIRED_ZAP);pbolt.flavour = BEAM_FIRE; // firepbolt.is_explosion = true;break;
{ZAP_ELECTRICITY,"zap",25,new dicedef_calculator<1, 3, 1, 4>,new tohit_calculator<8, 1, 7>,LIGHTCYAN,false,BEAM_ELECTRICITY, // beams & reflectsDCHAR_FIRED_ZAP,true,true,false},
case ZAP_ORB_OF_ELECTRICITY: // cap 150pbolt.name = "orb of electricity";pbolt.colour = LIGHTBLUE;pbolt.damage = calc_dice( 1, 15 + (power * 4) / 5 );pbolt.damage.num = 0; // only does explosion damagepbolt.hit = 40; // hit: 40pbolt.type = dchar_glyph(DCHAR_FIRED_ZAP);pbolt.flavour = BEAM_ELECTRICITY;pbolt.is_explosion = true;break;
{ZAP_ORB_OF_ELECTRICITY,"orb of electricity",200,new calcdice_calculator<0, 15, 4, 5>,new tohit_calculator<40>,LIGHTBLUE,false,BEAM_ELECTRICITY,DCHAR_FIRED_ZAP,true,false,true},
case ZAP_ORB_OF_FRAGMENTATION: // cap 150pbolt.name = "metal orb";pbolt.colour = CYAN;pbolt.damage = calc_dice( 3, 30 + (power * 3) / 4 );pbolt.hit = 20; // hit: 20pbolt.type = dchar_glyph(DCHAR_FIRED_ZAP);pbolt.flavour = BEAM_FRAG; // extra AC resistpbolt.is_explosion = true;break;
{ZAP_SPIT_POISON,"splash of poison",50,new dicedef_calculator<1, 4, 1, 2>,new tohit_calculator<5, 1, 6>,GREEN,false,BEAM_POISON,DCHAR_FIRED_ZAP,true,false,false},
case ZAP_CLEANSING_FLAME:pbolt.name = "golden flame";pbolt.colour = YELLOW;pbolt.damage = calc_dice( 2, 20 + (power * 2) / 3 );pbolt.hit = 150;pbolt.type = dchar_glyph(DCHAR_FIRED_ZAP);pbolt.flavour = BEAM_HOLY;pbolt.obvious_effect = true;pbolt.is_explosion = true;break;
{ZAP_DEBUGGING_RAY,"debugging ray",10000,new dicedef_calculator<1500, 1, 0, 1>,new tohit_calculator<1500>,WHITE,false,BEAM_MMISSILE,DCHAR_FIRED_DEBUG,true,false,false},
case ZAP_CRYSTAL_SPEAR: // cap 200pbolt.name = "crystal spear";pbolt.colour = WHITE;pbolt.damage = calc_dice( 10, 23 + power );pbolt.hit = 10 + power / 15; // 50: 13 100: 16pbolt.type = dchar_glyph(DCHAR_FIRED_MISSILE);pbolt.flavour = BEAM_MMISSILE; // unresistablepbolt.obvious_effect = true;break;
{ZAP_BREATHE_FIRE,"fiery breath",50,new dicedef_calculator<3, 4, 1, 3>,new tohit_calculator<8, 1, 6>,RED,false,BEAM_FIRE,DCHAR_FIRED_ZAP,true,true,false},
case ZAP_HELLFIRE: // cap 200pbolt.name = "hellfire";pbolt.colour = RED;pbolt.damage = calc_dice( 3, 10 + (power * 3) / 4 );pbolt.hit = 20 + power / 10; // 50: 25 100: 30pbolt.type = dchar_glyph(DCHAR_FIRED_ZAP);pbolt.flavour = BEAM_HELLFIRE;pbolt.obvious_effect = true;pbolt.is_explosion = true;break;
case ZAP_ICE_STORM: // cap 200pbolt.name = "great blast of cold";pbolt.colour = BLUE;pbolt.damage = calc_dice( 7, 22 + power );pbolt.hit = 20 + power / 10; // 50: 25 100: 30pbolt.ench_power = power; // used for radiuspbolt.type = dchar_glyph(DCHAR_FIRED_ZAP);pbolt.flavour = BEAM_ICE; // half resistedpbolt.is_explosion = true;break;
{ZAP_BREATHE_FROST,"freezing breath",50,new dicedef_calculator<3, 4, 1, 3>,new tohit_calculator<8, 1, 6>,WHITE,false,BEAM_COLD,DCHAR_FIRED_ZAP,true,true,false},
case ZAP_BEAM_OF_ENERGY: // bolt of innacuracypbolt.name = "narrow beam of energy";pbolt.colour = YELLOW;pbolt.damage = calc_dice( 12, 40 + (power * 3) / 2 );pbolt.hit = 1;pbolt.type = dchar_glyph(DCHAR_FIRED_ZAP);pbolt.flavour = BEAM_ENERGY; // unresistedpbolt.obvious_effect = true;pbolt.is_beam = true;break;
{ZAP_BREATHE_ACID,"acid",50,new dicedef_calculator<3, 3, 1, 3>,new tohit_calculator<5, 1, 6>,YELLOW,false,BEAM_ACID,DCHAR_FIRED_ZAP,true,true,false},
case ZAP_SPIT_POISON: // cap 50// max pow = lev + mut * 5 = 42pbolt.name = "splash of poison";pbolt.colour = GREEN;pbolt.damage = dice_def( 1, 4 + power / 2 ); // max dam: 25pbolt.hit = 5 + random2( 1 + power / 3 ); // max hit: 19pbolt.type = dchar_glyph(DCHAR_FIRED_ZAP);pbolt.flavour = BEAM_POISON;pbolt.obvious_effect = true;break;
{ZAP_BREATHE_POISON,"poison gas",50,new dicedef_calculator<3, 2, 1, 6>,new tohit_calculator<6, 1, 6>,GREEN,false,BEAM_POISON,DCHAR_FIRED_ZAP,true,true,false},
case ZAP_BREATHE_FIRE: // cap 50// max pow = lev + mut * 4 + 12 = 51 (capped to 50)pbolt.name = "fiery breath";pbolt.colour = RED;pbolt.damage = dice_def( 3, 4 + power / 3 ); // max dam: 60pbolt.hit = 8 + random2( 1 + power / 3 ); // max hit: 25pbolt.type = dchar_glyph(DCHAR_FIRED_ZAP);pbolt.flavour = BEAM_FIRE;pbolt.obvious_effect = true;pbolt.is_beam = true;break;
{ZAP_BREATHE_POWER,"bolt of energy",50,new dicedef_calculator<3, 3, 1, 3>,new tohit_calculator<5, 1, 6>,BLUE,false,BEAM_MMISSILE,DCHAR_FIRED_ZAP,true,true,false},
case ZAP_BREATHE_FROST: // cap 50// max power = lev = 27pbolt.name = "freezing breath";pbolt.colour = WHITE;pbolt.damage = dice_def( 3, 4 + power / 3 ); // max dam: 39pbolt.hit = 8 + random2( 1 + power / 3 );pbolt.type = dchar_glyph(DCHAR_FIRED_ZAP);pbolt.flavour = BEAM_COLD;pbolt.obvious_effect = true;pbolt.is_beam = true;break;
{ZAP_ENSLAVE_UNDEAD,"0",100,NULL,NULL,BLACK,true,BEAM_ENSLAVE_UNDEAD,DCHAR_SPACE,false,false,false},
case ZAP_BREATHE_ACID: // cap 50// max power = lev for ability, 50 for minor destruction (max dam: 57)pbolt.name = "acid";pbolt.colour = YELLOW;pbolt.damage = dice_def( 3, 3 + power / 3 ); // max dam: 36pbolt.hit = 5 + random2( 1 + power / 3 );pbolt.type = dchar_glyph(DCHAR_FIRED_ZAP);pbolt.flavour = BEAM_ACID;pbolt.obvious_effect = true;pbolt.is_beam = true;break;
{ZAP_AGONY,"0agony",100,NULL,new tohit_calculator<0, 5, 1>,BLACK,true,BEAM_PAIN,DCHAR_SPACE,false,false,false},
case ZAP_BREATHE_POISON: // leaves clouds of gas // cap 50// max power = lev = 27pbolt.name = "poison gas";pbolt.colour = GREEN;pbolt.damage = dice_def( 3, 2 + power / 6 ); // max dam: 18pbolt.hit = 6 + random2( 1 + power / 3 );pbolt.type = dchar_glyph(DCHAR_FIRED_ZAP);pbolt.flavour = BEAM_POISON;pbolt.obvious_effect = true;pbolt.is_beam = true;break;
case ZAP_BREATHE_POWER: // cap 50pbolt.name = "bolt of energy";// max power = lev = 27
{ZAP_DISRUPTION,"0",100,new dicedef_calculator<1, 4, 1, 5>,new tohit_calculator<0, 3, 1>,BLACK,true,BEAM_DISINTEGRATION,DCHAR_SPACE,false,false,false},
pbolt.colour = BLUE;if (random2(power) >= 8)pbolt.colour = LIGHTBLUE;if (random2(power) >= 12)pbolt.colour = MAGENTA;if (random2(power) >= 17)pbolt.colour = LIGHTMAGENTA;
{ZAP_DISINTEGRATION,"0",100,new calcdice_calculator<3, 15, 3, 4>,new tohit_calculator<0, 5, 2>,BLACK,true,BEAM_DISINTEGRATION,DCHAR_SPACE,false,true,false},{ZAP_BREATHE_STEAM,"ball of steam",50,new dicedef_calculator<3, 4, 1, 5>,new tohit_calculator<10, 1, 10>,LIGHTGREY,false,BEAM_STEAM,DCHAR_FIRED_ZAP,true,true,false},
pbolt.damage = dice_def( 3, 3 + power / 3 ); // max dam: 36pbolt.hit = 5 + random2( 1 + power / 3 );pbolt.type = dchar_glyph(DCHAR_FIRED_ZAP);pbolt.flavour = BEAM_MMISSILE; // unresistablepbolt.obvious_effect = true;pbolt.is_beam = true;break;case ZAP_BREATHE_STEAM: // cap 50// max power = lev = 27pbolt.name = "ball of steam";pbolt.colour = LIGHTGREY;pbolt.damage = dice_def( 3, 4 + power / 5 ); // max dam: 27pbolt.hit = 10 + random2( 1 + power / 5 );pbolt.type = dchar_glyph(DCHAR_FIRED_ZAP);pbolt.flavour = BEAM_STEAM;pbolt.obvious_effect = true;pbolt.is_beam = true;break;case ZAP_SLOWING:pbolt.name = "0";pbolt.flavour = BEAM_SLOW;// pbolt.is_beam = true;break;case ZAP_HASTING:pbolt.name = "0";pbolt.flavour = BEAM_HASTE;// pbolt.is_beam = true;break;
{ZAP_CONTROL_DEMON,"0",100,NULL,new tohit_calculator<0, 3, 2>,BLACK,true,BEAM_ENSLAVE_DEMON,DCHAR_SPACE,false,false,false},
case ZAP_PARALYSIS:pbolt.name = "0";pbolt.flavour = BEAM_PARALYSIS;// pbolt.is_beam = true;break;
{ZAP_ORB_OF_FRAGMENTATION,"metal orb",200,new calcdice_calculator<3, 30, 3, 4>,new tohit_calculator<20>,CYAN,false,BEAM_FRAG,DCHAR_FIRED_ZAP,false,false,true},
case ZAP_PETRIFY:pbolt.name = "0";pbolt.flavour = BEAM_PETRIFY;// pbolt.is_beam = true;break;
{ZAP_ICE_BOLT,"bolt of ice",100,new calcdice_calculator<3, 10, 1, 2>,new tohit_calculator<9, 1, 12>,WHITE,false,BEAM_ICE,DCHAR_FIRED_ZAP,false,false,false},
case ZAP_CONFUSION:pbolt.name = "0";pbolt.flavour = BEAM_CONFUSION;// pbolt.is_beam = true;break;
{ // ench_power controls radiusZAP_ICE_STORM,"great blast of cold",200,new calcdice_calculator<7, 22, 1, 1>,new tohit_calculator<20, 1, 10>,BLUE,false,BEAM_ICE,DCHAR_FIRED_ZAP,true,false,true},
case ZAP_INVISIBILITY:pbolt.name = "0";pbolt.flavour = BEAM_INVISIBILITY;// pbolt.is_beam = true;break;
{ZAP_BACKLIGHT,"0",100,NULL,NULL,BLUE,true,BEAM_BACKLIGHT,DCHAR_SPACE,false,false,false},
case ZAP_HEALING:pbolt.name = "0";pbolt.flavour = BEAM_HEALING;pbolt.damage = dice_def( 1, 7 + power / 3 );// pbolt.is_beam = true;break;
{ZAP_SLEEP,"0",100,NULL,NULL,BLACK,true,BEAM_SLEEP,DCHAR_SPACE,false,false,false},
case ZAP_DIGGING:pbolt.name = "0";pbolt.flavour = BEAM_DIGGING;// not ordinary "0" beam range {dlb}pbolt.is_beam = true;break;
{ZAP_FLAME_TONGUE,"flame",25,new dicedef_calculator<1, 8, 1, 4>,new tohit_calculator<7, 1, 6>,RED,false,BEAM_FIRE,DCHAR_FIRED_BOLT,true,false,false},
case ZAP_TELEPORTATION:pbolt.name = "0";pbolt.flavour = BEAM_TELEPORT;// pbolt.is_beam = true;break;
{ZAP_SANDBLAST,"rocky blast",50,new dicedef_calculator<2, 4, 1, 3>,new tohit_calculator<13, 1, 10>,BROWN,false,BEAM_FRAG,DCHAR_FIRED_BOLT,true,false,false},
case ZAP_POLYMORPH_OTHER:pbolt.name = "0";pbolt.flavour = BEAM_POLYMORPH;// pbolt.is_beam = true;break;
{ZAP_SMALL_SANDBLAST,"blast of sand",25,new dicedef_calculator<1, 8, 1, 4>,new tohit_calculator<8, 1, 5>,BROWN,false,BEAM_FRAG,DCHAR_FIRED_BOLT,true,false,false},
case ZAP_ENSLAVEMENT:pbolt.name = "0";pbolt.flavour = BEAM_CHARM;// pbolt.is_beam = true;break;
{ZAP_MAGMA,"bolt of magma",200,new calcdice_calculator<4, 10, 3, 5>,new tohit_calculator<8, 1, 25>,RED,false,BEAM_LAVA,DCHAR_FIRED_ZAP,true,true,false},
case ZAP_BANISHMENT:pbolt.name = "0";pbolt.flavour = BEAM_BANISH;// pbolt.is_beam = true;break;
{ZAP_POISON_ARROW,"poison arrow",200,new calcdice_calculator<4, 15, 1, 1>,new tohit_calculator<5, 1, 10>,LIGHTGREEN,false,BEAM_POISON_ARROW, // extra damageDCHAR_FIRED_MISSILE,true,false,false},
case ZAP_DEGENERATION:pbolt.name = "0";pbolt.flavour = BEAM_DEGENERATE;// pbolt.is_beam = true;break;
{ZAP_PETRIFY,"0",100,NULL,NULL,BLACK,true,BEAM_PETRIFY,DCHAR_SPACE,false,false,false}};
case ZAP_ENSLAVE_UNDEAD:pbolt.name = "0";pbolt.flavour = BEAM_ENSLAVE_UNDEAD;// pbolt.is_beam = true;break;
case ZAP_AGONY:pbolt.name = "0agony";pbolt.flavour = BEAM_PAIN;pbolt.ench_power *= 5;// pbolt.is_beam = true;break;
// Need to see zapping() for default values not set within this function {dlb}static void _zappy( zap_type z_type, int power, bolt &pbolt ){const zap_info* zinfo = NULL;
case ZAP_CONTROL_DEMON:pbolt.name = "0";pbolt.flavour = BEAM_ENSLAVE_DEMON;pbolt.ench_power *= 3;pbolt.ench_power /= 2;// pbolt.is_beam = true;break;
// Find the appropriate zap info.for (unsigned int i = 0; i < ARRAYSZ(zap_data); ++i){if (zap_data[i].ztype == z_type){zinfo = &zap_data[i];break;}}
case ZAP_SLEEP: //jmf: addedpbolt.name = "0";pbolt.flavour = BEAM_SLEEP;// pbolt.is_beam = true;break;
// None found?if (zinfo == NULL){#ifdef DEBUG_DIAGNOSTICSmprf(MSGCH_ERROR, "Couldn't find zap type %d", z_type);#endifreturn;}// Fillpbolt.name = zinfo->name;pbolt.flavour = zinfo->flavour;pbolt.colour = zinfo->colour;pbolt.type = dchar_glyph(zinfo->glyph);pbolt.obvious_effect = zinfo->always_obvious;pbolt.is_beam = zinfo->can_beam;pbolt.is_explosion = zinfo->is_explosion;
case ZAP_BACKLIGHT: //jmf: addedpbolt.name = "0";pbolt.flavour = BEAM_BACKLIGHT;pbolt.colour = BLUE;// pbolt.is_beam = true;break;
if (zinfo->power_cap > 0)power = std::min(zinfo->power_cap, power);
case ZAP_DEBUGGING_RAY:pbolt.name = "debugging ray";pbolt.colour = random_colour();pbolt.damage = dice_def( 1500, 1 ); // dam: 1500pbolt.hit = 1500; // hit: 1500pbolt.type = dchar_glyph(DCHAR_FIRED_DEBUG);pbolt.flavour = BEAM_MMISSILE; // unresistablepbolt.obvious_effect = true;break;
ASSERT(zinfo->is_enchantment == pbolt.is_enchantment());
default:pbolt.name = "buggy beam";pbolt.colour = random_colour();pbolt.damage = dice_def( 1, 0 );pbolt.hit = 60;pbolt.type = dchar_glyph(DCHAR_FIRED_DEBUG);pbolt.flavour = BEAM_MMISSILE; // unresistablepbolt.obvious_effect = true;break;
if (zinfo->is_enchantment){pbolt.ench_power = (zinfo->tohit ? (*zinfo->tohit)(power) : power);pbolt.hit = AUTOMATIC_HIT;}else{pbolt.hit = (*zinfo->tohit)(power);if (wearing_amulet(AMU_INACCURACY))pbolt.hit = std::max(0, pbolt.hit - 5);
if (wearing_amulet(AMU_INACCURACY))pbolt.hit = std::max(0, pbolt.hit - 5);
if (zinfo->damage)pbolt.damage = (*zinfo->damage)(power);// One special caseif (z_type == ZAP_ICE_STORM)pbolt.ench_power = power; // used for radius
{switch(beam.flavour){case BEAM_SLOW:case BEAM_HASTE:case BEAM_HEALING:case BEAM_PARALYSIS:case BEAM_PETRIFY:case BEAM_CONFUSION:case BEAM_INVISIBILITY:case BEAM_TELEPORT:case BEAM_POLYMORPH:case BEAM_CHARM:case BEAM_BANISH:case BEAM_PAIN:case BEAM_DISINTEGRATION:case BEAM_DEGENERATE:case BEAM_DISPEL_UNDEAD:case BEAM_ENSLAVE_UNDEAD:case BEAM_ENSLAVE_DEMON:case BEAM_SLEEP:case BEAM_BACKLIGHT:return (BEAM_STOP);default:break;}return (0);}
return (beam.flavour == BEAM_DIGGING ? 0 : BEAM_STOP);
set_item_ego_type( you.inv[wpn], OBJ_WEAPONS, SPWPN_NORMAL );std::string msg = you.inv[wpn].name(DESC_CAP_YOUR);
set_item_ego_type( weapon, OBJ_WEAPONS, SPWPN_NORMAL );std::string msg = weapon.name(DESC_CAP_YOUR);