Here is my shield bash and heavy shield, respectively.
Code:
<thing id="wShldBash" name="Shield Bash" compset="Weapon">
<tag group="wCritMin" tag="20"/>
<tag group="wCritMult" tag="2"/>
<tag group="wCategory" tag="Melee"/>
<tag group="Helper" tag="Helper"/>
<tag group="wType" tag="B"/>
<tag group="wMain" tag="1d3_3"/>
<tag group="wProfReq" tag="Martial"/>
<eval phase="PreLevel" priority="10000"><![CDATA[~ If we are a heavy shield, we do 1d4 damage and one handed.
if (container.tagis[ShldClass.Heavy] <> 0) then
perform delete[wMain.?]
perform delete[wClass.?]
perform delete[Helper.Finesse]
perform assign[wMain.1d4_4]
perform assign[wClass.OneHanded]
endif]]></eval>
<exprreq message="Light Shield Proficiency required"><![CDATA[#hasfeat[fArmLgShld] + hero.tagis[Hero.ProfShield] <> 0]]></exprreq>
</thing>
Code:
<thing id="mShlHvSt2" name="Shield, Heavy Steel" description="You can't carry anything in your hand while using a Heavy Shield. You can Shield Bash with a heavy shield." compset="Armor" replaces="mShlHvStl">
<fieldval field="gWeight" value="15"/>
<fieldval field="gSizeCost" value="20"/>
<tag group="mAC" tag="2" name="2" abbrev="2"/>
<tag group="mArcFail" tag="15" name="15" abbrev="15"/>
<tag group="mArmorChk" tag="2" name="2" abbrev="2"/>
<tag group="mClass" tag="Shield" name="Shield" abbrev="Shield"/>
<tag group="mMaxDex" tag="1000" name="1000" abbrev="1000"/>
<tag group="EquipType" tag="Metal" name="Metal" abbrev="Metal"/>
<tag group="ShldClass" tag="Heavy" name="Heavy Shield" abbrev="Heavy"/>
<bootstrap thing="wShldBash">
<autotag group="Helper" tag="Proficient"/>
<autotag group="wClass" tag="OneHanded"/>
</bootstrap>
<eval phase="First"><![CDATA[~ 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]]></eval>
</thing>