Exemple #1
0
 def start(action, element):
     channels_up = [char.status(e + '_channel') for e in char.available_elements()].count(True)
     if (channels_up < 3 and char.skill_available('simultaneity')
             and actions.simultaneity.possible()):
         p.act(actions.simultaneity)
     else:
         p.act(actions.open_channel, element)
     p.finish_action(action)
Exemple #2
0
 def prereqs(obj):
     if status('anorexia'):
         return False
     if obj in achaea.known_herbs:
         if obj in ['moss', 'irid']:
             return balance('irid')
         return balance('herb')
     return True
Exemple #3
0
def autosip():
    if actions.drink_potion.possible():
        if (char.max_health - char.health > 500 or char.status('blackout')):
            if s.available_potions['health']:
                p.act(actions.drink_potion, 'health')
        elif char.max_mana - char.mana > 500:
            if s.available_potions['mana']:
                p.act(actions.drink_potion, 'mana')
    if char.health < (char.max_health * 0.65) and char.balance('irid') and actions.eat.possible('irid'):
        p.act(actions.eat, 'irid')
Exemple #4
0
def apply_defences():
    for defence in sorted_defences:
        if not char.status(defence['name']) and defence.get('autoapply', True):
            apply_defence(defence)
            
#@OnEvent('PromptLine')
#def on_prompt_line():
#    if char.autodef:
#        apply_defences()
            
Exemple #5
0
def choose_offensive_action(target):
    if char.race == 'Dragon':
        return (actions.gut, target)
    elif char.class_ == 'Sylvan':
        return (actions.thornrend if char.status('viridian')
                else actions.firelash, target)
    elif char.class_ == 'Serpent':
        if char.skill_available('garrote'):
            return (actions.garrote, target)
        else:
            assert char.skill_available('bite')
            venom = 'sumac' if not char.skill_available('camus', 'venom') else 'camus'
            return (actions.venom_bite, venom, target)
    elif char.class_ == 'Shaman':
        return (actions.curse, 'bleed', target)
    elif char.class_ == 'Blademaster':
        return (actions.drawslash, target)
    elif char.class_ == 'Alchemist':
        return (actions.educe_iron, target)
    return None
Exemple #6
0
 def leg_cripple(action):
     if not char.status('crippled_leg_1'):
         char.set_status('crippled_leg_1', True)
     else:
         char.set_status('crippled_leg_2', True)
Exemple #7
0
 def arm_cripple(action):
     if not char.status('crippled_arm_1'):
         char.set_status('crippled_arm_1', True)
     else:
         char.set_status('crippled_arm_2', True)
Exemple #8
0
def attacked_with_freeze(match):
    if char.status('shivers'):
        char.set_status('freeze', True)
    if not char.status('caloric'):
        char.set_status('shivers', True)
    char.set_status('caloric', False)
Exemple #9
0
def leg_broken(match):
    if not char.status('crippled_leg_1'):
        char.set_status('crippled_leg_1', True)
    else:
        char.set_status('crippled_leg_2', True)
Exemple #10
0
def arm_broken(match):
    if not char.status('crippled_arm_1'):
        char.set_status('crippled_arm_1', True)
    else:
        char.set_status('crippled_arm_2', True)
Exemple #11
0
def cure_afflictions():
    for affliction in sorted_afflictions:
        if char.status(affliction['name']) and affliction.get('autocure', True):
            cure_affliction(affliction)
Exemple #12
0
def panacea_tick(match):
    if not status('panacea'):
        p.echo('Illusion alert: panacea tick.')
        return
    p.raise_event('PanaceaTick')
Exemple #13
0
def cure():
    if char.status('loki'):
        if actions.diagnose.possible():
            p.act(actions.diagnose)
Exemple #14
0
def leg_mended(match, event_args):
    assert event_args["salve"] == "mending"
    if status("crippled_leg_2"):
        set_status("crippled_leg_2", False)
    else:
        set_status("crippled_leg_1", False)