Check the glove and update the readout
LIVE BOXING SCRIPT / F OF G
Append both functions. A 2D drawing uses a separate reach mark for each height. A rigged 3D hand carries a single mark. In both cases the defending body mark is the badge or the belt.
func damage(i):
var f = fighters[i]
if f.spent or f.age < WIND or f.age >= END_HIT:
return 0
var other = 1 - i
var hand = "glove_" + f.lane if dimension == 2 else "glove"
var pair = {"entityId":IDS[i], "point":hand, "targetId":IDS[other],
"targetPoint":"badge" if f.lane == "high" else "belt"}
if Runtime.adventure_extensions.attach_points.contacts(pair).is_empty():
return 0
f.spent = true
var blocked = fighters[other].guard == f.lane
report = IDS[other].capitalize() + " blocks " + f.lane + "."
if not blocked:
report = IDS[i].capitalize() + " lands " + f.lane + "."
return 0 if blocked else f.powerfunc hud():
var you = fighters[0]
var rival = fighters[1]
var cue = rival.lane if rival.age < WIND else ""
var line = "You %d/6 Porter %d/6 Power %d%%" % [
you.hp, rival.hp, int(you.charge * 10) * 10]
line += "\n" + ("Incoming " + cue + "!" if cue != "" else report)
if line != drawn:
drawn = line
Runtime.change_gui_element_property("spar", "status", "text", line)The label shows both health totals even when a simultaneous hit produces two results on one tick. The short message describes the last contact. Power displays in ten-percent steps.
