Thread: Shield Bash
View Single Post
Kendall-DM
Spy
 
Join Date: Jan 2011
Location: Van Nuys, California
Posts: 1,220

Old March 8th, 2014, 10:41 AM
As before, bootstrap the new (equippable) Shield Bash attack to the shields. Then add this code to shields (there's a better hierarchical way to apply this, but I'm going the easy route here).

@Final Phase (users) 5500
Code:
~ Work out if we're equipped, or, if we're the child of a magic item, 
~ if our parent is equipped.
var result as number
result = field[gIsEquip].value
if (container.ishero = 0) then
  result += container.parent.field[gIsEquip].value
endif

~ If shield bash is being used, allow for use of shield and bash.
~ Remove shield AC if equipped, unless Improved Shield Bash exists.
if (result <> 0) then
  var ac as number
  if (container.ishero = 0) then
    if (container.parent.gizmo.child[wShldBash].field[gIsEquip].value <> 0) then
      perform hero.assign[Hero.ShldOffOK]
      if (#hasfeat[fImpShBash] = 0) then
        ac = container.parent.field[mAC].value + container.parent.field[BonEnhance].value
      endif
      hero.child[ArmorClass].field[tACShield].value -= ac
    elseif (container.parent.gizmo.child[wShldBash].field[wIs2nd].value <> 0) then
      perform hero.assign[Hero.ShldOffOK]
      if (#hasfeat[fImpShBash] = 0) then
        ac = container.parent.field[mAC].value + container.parent.field[BonEnhance].value
      endif
      hero.child[ArmorClass].field[tACShield].value -= ac
    endif
  elseif (hero.child[wShldBash].field[gIsEquip].value <> 0) then
    perform hero.assign[Hero.ShldOffOK]
    if (#hasfeat[fImpShBash] = 0) then
      ac = field[mAC].value
    endif
    hero.child[ArmorClass].field[tACShield].value -= ac
  elseif (hero.child[wShldBash].field[wIs2nd].value <> 0) then
    perform hero.assign[Hero.ShldOffOK]
    if (#hasfeat[fImpShBash] = 0) then
      ac = field[mAC].value
    endif
    hero.child[ArmorClass].field[tACShield].value -= ac
  endif
endif
Let me know if that works.

Last edited by Kendall-DM; March 8th, 2014 at 10:46 AM.
Kendall-DM is offline   #8 Reply With Quote