Example #1
0
def setup_suppress_afflictions():
    with open(AFFLICTION_DETAILS_JSON) as f:
        aff_details = json.load(f)

    triggers = []
    for aff in aff_details:
        cure_msg = get_cure_msg(aff)
        triggers.append(
            (r"^{}$".format(re.escape(cure_msg)), lambda m: c.delete_line()))

        aff_msg = get_aff_msg(aff)
        triggers.append(
            (r"^{}$".format(re.escape(aff_msg)), lambda m: c.delete_line()))

    c.add_triggers(triggers)
Example #2
0
    fighting(msg)
    party_announce(msg, "jester")


pranks_triggers = [
    (
        r"^You reach out and bop (.*) on the nose with your blackjack.$",
        # bop'd someone!
        lambda m: fighting(f"BOP'D {m[0]}"),
    ),
    (
        r"^You quickly slip (.*) a mickey.$",
        lambda m: fighting_pann(f"MICKEY'd {m[0]}"),
    ),
]
c.add_triggers(pranks_triggers)


tarot_triggers = [
    (
        r"^Standing the Aeon on your open palm, you blow it lightly at (.*) and watch as it seems to slow .* movement through the time stream.$",
        lambda m: fighting_pann(f"AEON'd {m[0]}"),
    ),
]
c.add_triggers(tarot_triggers)


puppetry_triggers = [
    (
        r"^With a little laugh, you sink your fingers into the wood and shape it into the rough semblance of a humanoid.$",
        lambda m: fighting(f"FASHION'd (1) {s.target}"),
#Naoko says in a poised, euphonious voice, "I give you attune, madness, and hypochondria as three passive sources of affliction, and timeloop which doubles the amount of afflictions I can give."
#You say, "That's what did all that damage to me."
#Naoko says in a poised, euphonious voice, "You also have nausea and masochism hurting you."
#Naoko says in a poised, euphonious voice, "The idea is not to let me properly establish my source of passive affliction income."
#Naoko says in a poised, euphonious voice, "My momentum isn't amazing until that point."
#You say, "Sounds... easy..."
#
#
#"""


def littany(matches):
    fighting(f"Eek! {matches[0]} is !")
    echo(f"Eek! {matches[0]} is !")
    send("writhe;writhe;writhe;sit")


depthswalker_triggers = [
    (
        r"^You have been afflicted with timeloop.$",
        # timeloop is bad!
        lambda m: echo("Eek! Timeloop!"),
    ),
    (
        r"^The ominously haunting sound of (.*) suddenly fills your head, threatening to drown out all other sound.$",
        # timeloop is bad!
        lambda m: littany(m),
    ),
]
c.add_triggers(depthswalker_triggers)
Example #4
0
wielding_triggers = [
    (
        r"^(\w+\d+): (.*) in your left hand.$",
        # getting what's being wielded
        lambda m: wielding("left", m[0], m[1]),
    ),
    (
        r"^(\w+\d+): (.*) in your right hand.$",
        # getting what's being wielded
        lambda m: wielding("right", m[0], m[1]),
    ),
    (
        r"^(Left|Right) hand:\s+(\w+\d+)\s+(\w.*)$",
        # getting what's being wielded
        lambda m: wielding(m[0].lower(), m[1], m[2]),
    ),
    # You cease wielding a puppet roughly resembling Lynair in your left hand.
    # You begin to wield a small blackjack in your left hand.
]
c.add_triggers(wielding_triggers)

inventory_aliases = [
    # (   "^i$",
    #    "get inventory from achaea",
    #    lambda m: c.gmcp_send("Char.Items.Inv \"\"")
    # ),
    ("^wl (.*)$", "wield left item", lambda m: wield("left", m[0])),
    ("^wr (.*)$", "wield right item", lambda m: wield("right", m[0])),
]
c.add_aliases("inventory", inventory_aliases)
Example #5
0
    flags=re.MULTILINE | re.DOTALL)


def parse_enemies(current_chunk):
    """
    You have the following enemies:
    Farrah
    Mezghar
    You have currently used 2 enemy slots of your 20 maximum.
    """
    global enemies
    global frenemy
    current_chunk = strip_ansi(current_chunk)
    m = re_enemies.search(current_chunk)
    enemies = m.groups()[0].split("\r\n")
    c.echo(f"enemies: {' '.join(enemies)}")
    frenemy.notify("enemies", enemies)


frenemy_triggers = [
    (
        r"^You have the following allies:$",
        lambda _: parse_allies(c.current_chunk),
    ),
    (
        r"^You have the following enemies:$",
        lambda _: parse_enemies(c.current_chunk),
    ),
]
c.add_triggers(frenemy_triggers)
Example #6
0
        r"^\[System\]: Running queued equilibrium command: (.*)",
        # catch lines for system eqbal
        running_equilib_trig,
    ),
    (
        r"^You must regain equilibrium first.$",
        # catch lines for system eqbal
        no_eq_bal_trig,
    ),
    (
        r"^\[System\]: Running queued eqbal command: (.*)$",
        # catch lines for system eqbal
        running_eqbal_trig,
    ),
]
c.add_triggers(queue_triggers)


def curebal(cure):
    send(f"curing queue add {cure}")


def eat_herb(herb, mud=None, matches=None):
    send(f"outr {herb};eat {herb}")


def highlight_current_line(color, pattern=".*", flags=0):

    # this will highlight whatever matched the above pattern
    # it screws up any color/style that was before our highlight :(
    def replacer(match):
Example #7
0
from achaea.basic import highlight_current_line
from achaea.fighting_log import fighting
from achaea.state import s
from client import c, echo, send


def being_grove_summoned(matches):
    highlight_current_line(Fore.RED)

    if matches:
        echo(f"{matches[0].upper()} IS BEING GROVE SUMMONED!!!!")
        fighting(f"{matches[0].upper()} IS BEING GROVE SUMMONED!!")
    else:
        echo("YOU'RE BEING GROVE SUMMONED!!!! SHIELD!!!")
        fighting(f"YOU'RE BEING GROVE SUMMONED!! SHIELD!!!")


druid_triggers = [
    (
        r"^The forest leaves rustle about you menacingly as the undergrowth appears to close in on you.$",
        # you're being grove summoned!
        being_grove_summoned,
    ),
    (
        r"^The forest undergrowth seems to move menacingly closer towards (.*).$",
        # you're being grove summoned!
        being_grove_summoned,
    ),
]
c.add_triggers(druid_triggers)
def count_strike(matches):
    echo("Calling count_strike")
    strike_type = strike_map[matches[0]]
    person_hit = matches[1]
    limb = matches[2]
    echo(f"{strike_type} strike to {person_hit}'s {limb}")

    # need to check to see if I rebounded!
    # echo(f"current_chunk: '{c.current_chunk}'")
    if "The attack rebounds back onto you!" in c.current_chunk:
        echo("You fool!  You rebounded!")


# end of timeflux:
# Limea appears far less sluggish all of a sudden.
"""
You call upon Garash and unleash a forceful blow towards Limea's left leg with your trusty staff.
The attack rebounds onto you!
The element of earth shakes you to the core, breaking your left arm.
"""

limb_counter_triggers = [
    (
        r"^You call upon (\w+) and unleash a forceful blow towards (\w+)'s (.*) with your trusty staff.$",
        # staffstrike to limb
        # lambda m:echo("limb_counter")
        lambda m: count_strike(m),
    ),
]
c.add_triggers(limb_counter_triggers)
Example #9
0
    if direction == "":
        direction = "at ground"

    c.echo(f"throw_bomb type: {bomb_type} dir: {direction}")

    if bomb_type == "":
        c.echo(THROW_BOMB_HELP)
    elif bomb_type.startswith("c"):
        eqbal(_throw_bomb("concussionbomb", direction))
    elif bomb_type.startswith("b"):
        eqbal(_throw_bomb("butterflybomb", direction))
    elif bomb_type.startswith("s"):
        eqbal(_throw_bomb("smokebomb", direction))
    elif bomb_type.startswith("w"):
        eqbal(_throw_bomb("webbomb", direction))
    elif bomb_type.startswith("d"):
        eqbal(_throw_bomb("dustbomb", direction))
    else:
        c.echo(f"HMMMMM???? throw_bomb type: {bomb_type} dir: {direction}")


bomb_triggers = [
    (
        "^The mouse sees the cheese and cautiously approaches it, taking a little nibble at first, but increasingly taking larger bites.$",
        # get that mouse!
        lambda m: send("reel in mouse;educate mouse"),
    ),
]
c.add_triggers(bomb_triggers)
Example #10
0
        # someone is prisming in!
        lambda _: incoming_prism(),
    ),
    (
        "^The beginnings of a fiery portal appear before you.$",
        # someone is portaling in!
        lambda _: incoming_portal("fiery_1"),
    ),
    (
        "^A fiery portal opens in the air before you.$",
        # someone is portaling in!
        lambda _: incoming_portal("fiery_2"),
    ),
    (
        "^A piercing sound cleaves through the air.$",
        # someone is portaling in!
        lambda _: incoming_portal("sonic_1"),
    ),
    (
        "^A sonic portal opens in the air, edges vibrating slightly.$",
        # someone is portaling in!
        lambda _: incoming_portal("sonic_2"),
    ),
    (
        "^A gateway of light blazes into existence before your eyes.$",
        # someone is portaling in!
        lambda _: incoming_portal("forestal_gate"),
    ),
]
c.add_triggers(portal_triggers)
Example #11
0
from .state import s


def stop_bleeding(matches):
    amt = int(matches[0])
    clots = []
    if (amt >= 50) and (s.mp >= 3800):
        clots.append("clot")
    if (amt >= 100) and (s.mp >= 3700):
        clots.append("clot")
    if (amt >= 200) and (s.mp >= 3600):
        clots.append("clot")
    if (amt >= 300) and (s.mp >= 3500):
        clots.append("clot")
    if (amt >= 400) and (s.mp >= 3400):
        clots.append("clot")
    if clots:
        echo(f"Clotting {len(clots)}x!")
        send(";".join(clots))


bleeding_triggers = [
    (
        r"^You bleed (\d+) health.$",
        # bleeding!
        stop_bleeding,
    ),
]
c.add_triggers(bleeding_triggers)
Example #12
0
    start_index = 0
    chunk_lines = c.current_chunk.split("\n")
    for i, line in enumerate(chunk_lines):
        if line == current_line:
            start_index = i
            end_index = start_index
            stuff = chunk_lines[i:i + 5]
        elif (line.count(":") >= 2) and (line.count("-") >= 6):
            end_index = i
            break

    stuff = chunk_lines[start_index:end_index + 1]
    c.delete_lines(stuff)
    echo("\n".join(stuff))


map_triggers = [
    (
        r"^--- (.*) -*---$",
        # beginning of map
        lambda m: parse_map(c.current_line),
    ),
    (
        r"^----+ (.*) -*---$",
        # beginning of map
        lambda m: echo(f"end of map: {m[0]}"),
    ),
]
c.add_triggers(map_triggers)
Example #13
0
        r"^A dizzying beam of energy strikes you as your attack rebounds off of (.*)'s shield.$",
        # someone (probably my target) is shielded!
        lambda m: raze_target(m[0]),
    ),
    (
        r"^You suddenly perceive the vague outline of an aura of rebounding around (\w+?).$",
        # someone (probably my target) is shielded!
        lambda m: raze_target(m[0]),
    ),
    (
        r"^(.*)'s aura of weapons rebounding disappears.$",
        # someone (probably my target) is shielded!
        lambda m: stop_raze(m[0]),
    ),
]
c.add_triggers(shielding_triggers)

weaponmastery_aliases = [
    (
        "^m$",
        "stand;combination &tar slice smash",
        lambda m: eqbal("stand;combination &tar slice smash"),
    ),
    (
        "^ra$",
        "stand;combination &tar raze smash mid",
        lambda m: eqbal("stand;combination &tar raze smash mid"),
    ),
    (
        "^sh$",
        "stand;shieldstrike &tar high",
Example #14
0
    ),
    (
        "^ban$",
        "litter floor with peels",
        lambda matches: eqbal(f"stand;litter floor with peels"),
    ),
    (
        "^it(?: (.+))?$",
        "slip t/[] itchpowder",
        lambda matches: eqbal(f"slip {matches[0] or s.target} itchpowder"),
    ),
    (
        "^fishmice$",
        "fish for mice",
        lambda matches: eqbal(
            f"stand;outr rope;outr cheese;tie cheese to rope;fish for mice"
        ),
    ),
]
c.add_aliases("ab_pranks", pranks_aliases)


pranks_triggers = [
    (
        "^The mouse sees the cheese and cautiously approaches it, taking a little nibble at first, but increasingly taking larger bites.$",
        # get that mouse!
        lambda m: send("reel in mouse;educate mouse"),
    ),
]
c.add_triggers(pranks_triggers)
Example #15
0

bopalopia_triggers = [
    (
        "^(Fernando|Junior) Moo",
        # multiply stuff
        lambda m: echo(f"bop {m[0]}"),
    ),
    (
        r"^(Fernando Moo|Junior Moo|Clarence Cudchew) says, \"If (.*) eggs were lain each by (.*) chickens, how many eggs would that make total?",
        # multiply stuff
        bopalopia_mult,
    ),
    (
        r"^(Fernando Moo|Junior Moo|Clarence Cudchew) says, \"If (.*) nuts were saved for winter storage and (.*) squirrels had to share, how many nuts would that be per squirrel?",
        # divide stuff
        bopalopia_div,
    ),
    (
        r"^(Fernando Moo|Junior Moo|Clarence Cudchew) says, \"If (.*) beavers and (.*) beavers got together with (.*) beavers, how many beavers would that be total?",
        # add stuff
        bopalopia_add,
    ),
    (
        r"^(Fernando Moo|Junior Moo|Clarence Cudchew) says, \"If (\d+) cows jumped into Runaway River and (\d+) drowned, how many cows would be left?",
        # subtract stuff
        bopalopia_sub,
    ),
]
c.add_triggers(bopalopia_triggers)
Example #16
0
        # rewear it!
        lambda m: send(
            "wear splintmail;put splintmail in pack;put coins in pack;selfishness"
        ),
    ),
    (
        r"^You remove a blackened suit of Hashani full plate.$",
        # rewear it!
        lambda m: send(
            "wear fullplate;put fullplate in kitbag;put sovereigns in kitbag;selfishness"
        ),
    ),
    # (   r"^You cease wielding a small blackjack",
    #    # rewear it!
    #    lambda m: send("wield blackjack;selfishness")
    # ),
    # (   r"^You cease wielding a lightweight barbed banded shield",
    #    # rewear it!
    #    lambda m: send("wield shield;put shield in pack;selfishness")
    # ),
    # (   r"^You cease wielding a Mhaldorian banded shield",
    #    # rewear it!
    #    lambda m: send("wield shield;put shield in pack;selfishness")
    # ),
    # (   r"^You remove a simple suit of lightweight field plate.$",
    #    # rewear it!
    #    lambda m: send("wear fieldplate;put fieldplate in pack;put coins in pouch;selfishness")
    # ),
]
c.add_triggers(anti_theft_triggers)
Example #17
0
        r"^You begin to juggle (.+), (.+), and (.+) with your free hand.$",
        # starting to juggle something
        lambda m: begin_juggling(m),
    ),
    (
        r"^You c**k back your arm and throw (.+) at (.+).$",
        # threw something at someone
        lambda m: threw_something(m),
    ),
    (
        r"Running queued eqbal command: (.*)THROW DAGGER AT (\w+) (\w+)",
        # threw something at someone
        lambda m: queued_throw_dagger(c.current_chunk),
    ),
]
c.add_triggers(juggling_triggers)


#Running queued eqbal command: STAND;GET DAGGER;THROW DAGGER AT RASAHI ACONITE\r\nYou are not fallen or kneeling.\r\nI see no \"dagger\" to take.\r\nYou rub some aconite on an obsidian dagger.\r\nYou c**k back your arm and throw an obsidian dagger at Rasahi.

#Running queued eqbal command: STAND;GET DAGGER;THROW DAGGER AT RASAHI ACONITE\r\nYou are not fallen or kneeling.\r\nYou pick up an obsidian dagger.\r\nYou must have whatever you wish to throw wielded.

#Running queued eqbal command: STAND;GET DAGGER;GET DAGGER;GET DAGGER;UNWIELD LEFT;JUGGLE DAGGER DAGGER DAGGER;WIELD BLACKJACK\r\nYou are not fallen or kneeling.\r\nI see no \"dagger\" to take.\r\nI see no \"dagger\" to take.\r\nI see no \"dagger\" to take.\r\nYou cease wielding a small blackjack in your left hand.\r\nYou begin to juggle an obsidian dagger, an obsidian dagger, and an obsidian dagger with your free hand.

#Running queued eqbal command: STAND;GET DAGGER;GET DAGGER;GET DAGGER;UNWIELD LEFT;JUGGLE DAGGER DAGGER DAGGER;WIELD BLACKJACK\r\nYou must regain balance first.\r\nYou must regain balance first.\r\nYou must regain balance first.\r\nYou must regain balance first.\r\nYou must regain balance first.\r\nYou must have one empty hand to juggle.

#Running queued eqbal command: STAND;GET DAGGER;GET DAGGER;GET DAGGER;UNWIELD LEFT;JUGGLE DAGGER DAGGER DAGGER;WIELD BLACKJACK\r\nYou are not fallen or kneeling.\r\nYou pick up an obsidian dagger.\r\nI see no \"dagger\" to take.\r\nI see no \"dagger\" to take.\r\nYou cease wielding a small blackjack in your left hand.\r\nYou begin to juggle an obsidian dagger, an obsidian dagger, and an obsidian dagger with your free hand.

#Running queued eqbal command: STAND;GET DAGGER;GET DAGGER;GET DAGGER;UNWIELD LEFT;JUGGLE DAGGER DAGGER DAGGER;WIELD BLACKJACK\r\nYou are not fallen or kneeling.\r\nYou pick up an obsidian dagger.\r\nI see no \"dagger\" to take.\r\nI see no \"dagger\" to take.\r\nYou aren't wielding that.\r\nYou cannot juggle more than three things.\r\nYou start to wield a small blackjack in your left hand.

    (
        "^sap(?: (.+))?$",
        "angel sap t/[]",
        lambda matches: eqbal(f"angel sap {matches[0] or '&tar'}"),
    ),
    (
        "^care(?: (.+))?$",
        "angel care []",
        lambda matches: eqbal(f"angel care {matches[0]}"),
    ),
    ("^refuge$", "angel refuge", lambda _: eqbal("angel refuge")),
    (
        "^emp(?: (.+))?$",
        "angel empathy []",
        lambda matches: eqbal(f"angel empathy {matches[0] or ''}"),
    ),
    ("^cont$", "contemplate t", lambda _: eqbal(f"contemplate &tar")),
    ("^sacri$", "angel sacrifice", lambda _: eqbal("angel sacrifice")),
    ("^absolve$", "angel absolve t", lambda _: eqbal(f"angel absolve &tar")),
]
c.add_aliases("ab_spirituality", spirituality_aliases)

spirituality_triggers = [
    (
        "^White strands of light weave themselves together before your eyes, and within seconds you hold a spiritual mace within your grasp.$",
        # you're mace is here! wield it!
        lambda _: eqbal("wield mace;attach fist to mace"),
    ),
]
c.add_triggers(spirituality_triggers)
Example #19
0
from client import c, echo, send
from client.timers import timers


def reject_lust(luster):
    echo(f"{luster} LUSTED YOU!!! REJECT {luster}")
    timers.add(
        f"reject_{luster}1",
        lambda luster: echo(f"{luster} LUSTED YOU!!! REJECT {luster}"),
        1,
    )
    timers.add(
        f"reject_{luster}2",
        lambda luster: echo(f"{luster} LUSTED YOU!!! REJECT {luster}"),
        3,
    )
    timers.add(
        f"reject_{luster}3",
        lambda luster: echo(f"{luster} LUSTED YOU!!! REJECT {luster}"),
        6,
    )


jester_triggers = [
    (
        r"^(\w+) quickly flings a tarot card at you, and you feel unreasonable lust for \w+.",
        lambda m: reject_lust(m[0]),
    ),
]
c.add_triggers(jester_triggers)
Example #20
0
        r"exhales loudly.$",
        # don't need to see this!
        lambda m: c.delete_line(),
    ),
    (
        r"inhales and begins holding (\w+) breath.$",
        # don't need to see this!
        lambda m: c.delete_line(),
    ),
    (
        r"has been slain by",
        # don't need to see this!
        lambda m: someone_died,
    ),
    (
        r"You begin to tumble agilely to the (.*).$",
        # tumbling!
        lambda m: fighting(f"tumbling {m[0]}"),
    ),
    (
        r"The barrier around Torrid Rakia, the magma wyvern melts through the ground, and she rushes through to attack.$",
        # tumbling!
        lambda m: rakia(),
    ),
    (
        r"^You are already wielding that.$",
        lambda m: c.delete_line(),
    ),
]
c.add_triggers(generic_triggers)
Example #21
0
from client import c, echo, send

from ..state import s

"""
for serpents, watch out for darkshade:
Nephiny says in Cyrenese in a boyish, purring voice, "So, what you need to do against serpents.."
Nephiny says in Cyrenese in a boyish, purring voice, "Switch the darkshade priority to the highest priority when you're at four ticks, or so."
Nephiny says in Cyrenese in a boyish, purring voice, "Then switch it back."
Nephiny says in Cyrenese in a boyish, purring voice, "Then you only have to worry about the lock."

The sun has rendered you too weak to move a muscle.

Sunlight shines down upon you mercilessly, rippling across your skin like fire.

"""

serpent_triggers = []
c.add_triggers(serpent_triggers)
Example #22
0
def parse_who_here(current_chunk):
    current_chunk = strip_ansi(current_chunk)
    found_start = False
    for line in current_chunk.split("\r\n"):
        if "You see the following people here:" in line:
            found_start = True
        elif found_start:
            people_here = line.split(", ")
            break
    echo(f"people here: {people_here}")


who_here_triggers = [
    (
        r"^You see the following people here:$",
        # who here
        lambda _: parse_who_here(c.current_chunk),
    ),
]
c.add_triggers(who_here_triggers)

who_here_aliases = [
    (
        "^wh$",
        "who here",
        lambda _: c.send("who here"),
    ),
]
c.add_aliases("who_here", who_here_aliases)
Example #23
0

ratting_triggers = [
    (
        r"^You have slain a baby rat, retrieving the corpse.$",
        # killed a rat!
        lambda _: dead_rat(),
    ),
    (
        r"^You have slain a young rat, retrieving the corpse.$",
        # killed a rat!
        lambda _: dead_rat(),
    ),
    (
        r"^You have slain a rat, retrieving the corpse.$",
        # killed a rat!
        lambda _: dead_rat(),
    ),
    (
        r"^You have slain an old rat, retrieving the corpse.$",
        # killed a rat!
        lambda _: dead_rat(),
    ),
    (
        r"^You have slain a black rat, retrieving the corpse.$",
        # killed a rat!
        lambda _: dead_rat(),
    ),
]
c.add_triggers(ratting_triggers)
Example #24
0
from client import c, echo, send

from ..basic import eqbal
from ..state import s

elementalism_triggers = [
    (
        "^You grow still and begin to silently pray for preservation of your soul while",
        # you're leaving so detach the fist sigil!
        lambda _: eqbal("detach fist from staff"),
    ),
]
c.add_triggers(elementalism_triggers)


def stormhammer(matches):
    echo(matches)
    try:
        if matches is None:
            peeps = s.target
        else:
            peeps = " and ".join([s.target, *matches.split(" ")])
        echo(peeps)
        eqbal(f"stand;cast stormhammer at {peeps}")
    except Exception as e:
        echo(f"stormhammer: {e}")


elementalism_aliases = [
    (
        "^light$",
Example #25
0
from client import c, echo, send

alchemist_triggers = [
    (
        r"^You feel a sudden jerk, and the air immediately surrounding you comes",
        # EEK about to be summoned!
        lambda m: echo("Eek! ALCHEMIST DISPLACE!!!\nMOVE!\nMOVE!"),
    ),
    (
        r"^The etheric light around you abruptly fades, and you feel a sudden release of",
        lambda m: echo(
            "Phew! ALCHEMIST DISPLACE is over!!!\nYou can go back in!"),
    ),
]
c.add_triggers(alchemist_triggers)
Example #26
0
        r"^You eat (.*).$",
        # herb lost
        lambda matches: lost_herb(matches[0]),
    ),
    (
        r"^You take out some salve and quickly rub it on your skin.$",
        # salve lost
        lost_salve,
    ),
    (
        r"^You may apply another salve to yourself.$",
        # salve back
        recovered_salve,
    ),
]
c.add_triggers(balance_triggers)


def gmcp_bal_eq(gmcp_data):
    bal = gmcp_data.get("bal")
    eq = gmcp_data.get("eq")

    if bal == "1" and s.bal == "0":
        # echo("Got back balance!")
        pass
    elif bal == "0" and s.bal == "1":
        # echo("Lost balance!")

        # time how long it takes
        if s.show_balance_times:
            end_msg = r"^You have recovered balance on all limbs.$"
    ),
    (
        "^ens(?: (.+))?$",
        "ensconce firecracker on t/[]",
        lambda matches: send("ensconce firecracker on {matches[0] or '&tar'}"),
    ),
]
c.add_aliases("ab_battlerage", jester_battlerage_aliases)


def shatter_target():
    # not checking for shielder == target because it might be a long mob name
    c.echo(f"rage: {s.rage}")
    if s.rage >= 17:
        c.send("throw jacks at &tar"),


battlerage_triggers = [
    (
        r"^A nearly invisible magical shield forms around (.*?).$",
        # someone just shielded!
        lambda matches: shatter_target(),
    ),
    (
        r"^A dizzying beam of energy strikes you as your attack rebounds off of (.*)'s shield.$",
        # someone (probably my target) is shielded!
        lambda matches: shatter_target(),
    ),
]
c.add_triggers(battlerage_triggers)