Skip to reading
Adventure Mechanics & Effects

Check the glove and update the readout

Edition 0.86.3.4

Build authored boxing, camera moves, weather, attachments, inspectable objects, a radio and two-object puzzles using the existing adventure tools and scripts.

Download PDFView PDF page

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.

Code example
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.power
Code example
func 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.

Page 26 of 29Permalink
Go to page