Spell: Coward’s Lament
Code:
<thing id="pS2CowaLam" name="Cowards Lament" description="You compel an opponent to face you in combat, or suffer for its cowardice. Each round that the target fails to attack you in melee, it receives a cumulative -1 penalty to its Armor Class, attack rolls, and saving throws (maximum penalty -5). Each round at the end of its turn, the target may attempt a Will saving throw to prevent the penalties from increasing for that round. All penalties reset to zero when the target attacks you in melee, but increase again if it stops attacking. If the target is prevented from attacking you by physical restraint, magic, or impassable terrain, the penalties do not increase. If you move away from the target, the spell ends." compset="InPlay">
<fieldval field="pMinimum" value="-5"/>
<fieldval field="pMaximum" value="0"/>
<fieldval field="pDuration" value="1 round/level"/>
<usesource source="APG"/>
<tag group="Helper" tag="AdjSpell" name="Spell Adjustment" abbrev="Spell Adjustment"/>
<eval phase="PreLevel" priority="10000"><![CDATA[
~ If we're not enabled, get out now
doneif (field[pIsOn].value = 0)
~ Give a penalty to all saves
hero.child[svFort].field[Penalty].value += field[pAdjust].value
hero.child[svRef].field[Penalty].value += field[pAdjust].value
hero.child[svWill].field[Penalty].value += field[pAdjust].value
~ Give a penalty to AC
hero.child[ArmorClass].field[Penalty].value += field[pAdjust].value
~ Give a penalty to hit to all weapons
hero.child[Attack].field[Penalty].value += field[pAdjust].value]]></eval>
</thing>