Several new item abilities and one new monster ability

- Range augment ability for missiles
- Seeking ability for missiles (can strike an adjacent space if targeted space lacks a target, including chance of hitting invisible monsters)
- Weapon that calls node when attacking with it (works both in range and melee; the cases can be distinguished by the node with IF_CONTEXT)
- Armour that calls node when attacked while wearing (works both in range and melee; the cases can be distinguished by the node with IF_CONTEXT)
- Monster ability that calls node when monster attacked (works both in range and melee; the cases can be distinguished by the node with IF_CONTEXT)
- The above three only apply to non-magical attacks - some things don't trigger it, like spells, monster rays and breath weapons, possible a few others
- Armour that protects from all melee damage (including demon/undead, though less)
- Armour that decreases chance to be hit (both in range and melee, against non-magical attacks only)
- Armour that behaves like to the martyr's shield effect but also has a chance of adding some extra bonus damage
- Armour that's more encumbering than advertised (best for cursed items with concealed ability)
- Multiple items with the accuracy ability now stack
- Fix nephilim not getting their racial bonus to missile weapons
- In specials called as part of an attack, the reserved pointer -20 contains the target in a form ready to pass to a SELECT_TARGET node, while -21 and -22 contain the location of the target. This includes the new cases added in this commit plus the monster ability to call a special node on its turn. It does not include specials called in the spell targeting context (to do so would break legacy scenarios), nor specials called after a targeting node.
- If a PC is carrying more than their max weight, they gain encumbrance equal to one-tenth of the excess.
- Add some missing context cases to IF_CONTEXT node
This commit is contained in:
2015-01-20 21:10:21 -05:00
parent 7837459177
commit 74ed88f2f3
10 changed files with 216 additions and 22 deletions

View File

@@ -898,6 +898,7 @@ static bool edit_monst_abil_detail(cDialog& me, std::string hit, cMonster& monst
param = choose_text(STRT_MONST, 0, &me, "Summon which monster?");
break;
case eMonstAbilTemplate::SPECIAL:
case eMonstAbilTemplate::HIT_TRIGGERS:
case eMonstAbilTemplate::DEATH_TRIGGERS:
param = get_fresh_spec(0);
if(param < 0) {
@@ -1052,7 +1053,7 @@ static bool edit_monst_abil_detail(cDialog& me, std::string hit, cMonster& monst
return true;
});
} else if(cat == eMonstAbilCat::SPECIAL) {
if(abil == eMonstAbil::SPECIAL || abil == eMonstAbil::DEATH_TRIGGER)
if(abil == eMonstAbil::SPECIAL || abil == eMonstAbil::HIT_TRIGGER || abil == eMonstAbil::DEATH_TRIGGER)
abil_dlg["pick-extra1"].attachClickHandler([&](cDialog& me,std::string,eKeyMod) -> bool {
short spec = me["extra1"].getTextAsNum();
if(spec < 0 || spec > 255) {