Code
if second of ram then fortifiedram; if second of repair then fortifiedrepair; ##fortifiedram: $health = $actor's health; $matvals = $actor's matvals; manipulate $matvals get fortified to $fortified; manipulate $fortified get exit to $nearexit by 2; manipulate $fortified get fort to $farfort by 2; $farexit = $nearexit's link; $farloc = $farfort's loc; if $actor's health > 0 then fortifiedbreak else fortifiedbroken; ##fortifiedbreak: $damage = $init_obj's health; multiply $damage by .1; take $damage from $health; set $second's health to $health; set $farfort's health to $health; if $health > 0 then fortifiedbreak1 else fortifiedbreak2; ##fortifiedbreak1: print "Pieces of [$actor] break off."; ##fortifiedbreak2: print "[$actor] is breached!"; multiset $nearexit = "loc='$loc',host='$actor',hosthow='in',pose='breached'"; multiset $farexit = "loc='$farloc',host='$farfort',hosthow='in',pose='breached'"; set $actor's health to 0; set $farfort's health to 0; relook $farloc; relook $loc; ##fortifiedbroken: print "[$actor] is already breached."; ##fortifiedrepair: $health = $actor's health; $matvals = $actor's matvals; manipulate $matvals get fortified to $fortified; manipulate $fortified get exit to $nearexit by 2; manipulate $fortified get fort to $farfort by 2; $farexit = $nearexit's link; $farloc = $farfort's loc; $healthmax = $actor's healthmax; if $actor's health < $healthmax then fortifiedfix else fortifiedfixed; ##fortifiedfix: $repair = $init_obj's health; multiply $repair by .1; add $repair to $health; set $second's health to $health; set $farfort's health to $health; if $health < $healthmax then fortifiedfix1 else fortifiedfix2; if $nearexit's loc == $loc then fortifiedfix3; ##fortifiedfix1: print "[$actor] is partially repaired."; ##fortifiedfix2: print "[$actor] is completely repaired."; set $actor's health to $healthmax; set $farfort's health to $healthmax; ##fortifiedfix3: multiset $nearexit = "loc='$actor',host='',hosthow='',pose='fortified'"; multiset $farexit = "loc='$farfort',host='',hosthow='',pose='fortified'"; relook $farloc; relook $loc; ##fortifiedfixed: print "[$actor] is already repaired.";