def failure_mending_no_affliction(line, time, backrefs): if player.last_salve != 'mending': core.disable_trigger('failure_mending_no_affliction', 'failures') return where = player.actions['applied_to'] if where == 'arms': afflictions = ( 'leftarm_lvl1', 'rightarm_lvl1', ) cures.remove_afflictions(afflictions) elif where == 'legs': afflictions = ( 'leftleg_lvl1', 'rightleg_lvl1', ) cures.remove_afflictions(afflictions) elif where in ('torso', 'body'): afflictions = ( 'ablaze', 'selarnia' ) cures.remove_afflictions(afflictions) core.disable_trigger('failure_mending_no_affliction', 'failures') # if you fail on mending you don't lose salve balance player.salve_balance = 1
def cure_enablers_free_asip(line, time, backrefs): player.afflictions['anorexia'] = False player.afflictions['amnesia'] = False player.actions['asip'] = True player.asip_balance = 1 player.waiting_for_aeon = 0 core.disable_trigger('cure_enablers_free_asip', 'cure_enablers')
def herb_balance(line, time, backrefs): if time - player.herb_lastate <= 1.3 and player.ate_offbal == False: core.debug("Herb balance restored too soon! Illusion?") return player.herb_balance = 1 player.ate_offbal = False core.disable_trigger('herb_balance', 'balances')
def restore_handling(line, time, backrefs): broken = ['cures_leftarm_lvl1', 'cures_rightarm_lvl1', 'cures_leftleg_lvl1', 'cures_rightleg_lvl1'] if player.restoring is True: for broke in broken: core.enable_trigger(broke, 'cures') core.disable_trigger('survival_restoration', 'survival') player.restoring = False
def sileris_balance(line, time, backrefs): player.waiting_for_sileris = 1 player.sileris_last = time herbs.herbs['sileris'].inv -= 1 core.disable_trigger('sileris_balance', 'balances') core.disable_trigger('failure_sileris_slickness', 'failures') core.enable_trigger('ondef_sileris', 'ondef')
def clean_queues(type, defence): if type == 'action': _truncate_queue(defence, action_queue) elif type == 'immediate': _truncate_queue(defence, immediate_queue) elif type == 'free': _truncate_queue(defence, free_queue) elif type == 'herb': if defence != 'deaf': _truncate_queue(defence, herb_queue) elif type == 'salve': _truncate_queue(defence, salve_queue) elif type == 'asip': _truncate_queue(defence, asip_queue) elif type == 'balance': _truncate_queue(defence, balance_queue) elif type == 'equilibrium': _truncate_queue(defence, equilibrium_queue) elif type == 'hmsip': _truncate_queue(defence, hmsip_queue) elif type == 'smoke': _truncate_queue(defence, smoke_queue) if defence == 'rebounding': player.rebounding_pending = False core.disable_trigger('failure_rebounding', 'failures') core.debug("ondef " + defence)
def register_defence(defence): global def_redundancy_ticks player.defences[defence] = 1 def_redundancy_ticks[defence] = 0 if player.mode == 'basic': if player.keepup_basic[defence] is True: player.keepup[defence] = True elif player.mode == 'combat': if player.keepup_combat[defence] is True: player.keepup[defence] = True core.disable_trigger('ondef_' + defence, 'ondef') type = defup_actions[defence][0] # Handle simultaneity if player.simultaneity: if defence in ('earth', 'water', 'fire', 'air', 'spirit'): # find simultaneity in queue... _truncate_queue('simultaneity', action_queue) _truncate_queue(defence, action_queue) core.line = core.line + ansi.color['magenta'] + " (+" + ansi.color['default'] + defence + ansi.color['magenta'] + ")" + ansi.color['default'] return if defence == 'insomnia': player.afflictions['hypersomnia'] = False # can't defup insomnia with hypersomnia elif defence == 'caloric': player.afflictions['frozen'] = False player.afflictions['shivering'] = False if defence == 'riding': action_queue.remove_by_name('riding') clean_queues(type, defence)
def no_clot(line, time, backrefs): global auto_clotting, clotting, clot_num core.disable_trigger('clot_tick', 'general_afflictions') core.disable_trigger('no_clot', 'general_afflictions') auto_clotting = False clotting = False clot_num = 0
def cure_enablers_moss_2(line, time, backrefs): player.moss_balance = 0 player.moss_lastfire = time core.enable_trigger('moss_balance', 'balances') core.disable_trigger('cure_enablers_moss', 'cure_enablers') core.disable_trigger('failure_moss', 'failures') core.disable_trigger('failure_eating', 'failures') core.disable_trigger('failure_eating_anorexia', 'failures') core.disable_trigger('failure_eating_mickey', 'failures')
def cure_enablers_elixirs(line, time, backrefs): player.afflictions['anorexia'] = False player.stunned = False player.afflictions['amnesia'] = False player.actions['asip'] = True player.asip_balance = 0 player.waiting_for_aeon = 0 core.disable_trigger('cure_enablers_elixirs', 'cure_enablers') core.enable_trigger('asip_balance', 'balances')
def pipe_full(line, time, backrefs): # Assume 10?? player.elm_puffs = 10 player.skullcap_puffs = 10 player.valerian_puffs = 10 player.waiting_for_aeon = 0 core.disable_trigger('pipe_full', 'pipes') core.disable_trigger('pipes_paralysis_nofill', 'pipes') core.enable_trigger_group('plist') core.write('plist')
def cure_enablers_webbed_roped(line, time, backrefs): core.disable_trigger('cure_enablers_webbed_roped', 'cure_enablers') core.enable_trigger('cures_roped', 'cures') core.enable_trigger('cures_webbed', 'cures') core.enable_trigger('cures_bound', 'cures') core.enable_trigger('cures_hoisted', 'cures') player.afflictions['amnesia'] = False player.waiting_for_aeon = 0 player.writhe_balance = 0
def ondef_sileris(line, time, backrefs): if player.waiting_for_sileris == 0: return # Bogus, too soon, had to be an illusion if time - player.sileris_last < 5.2: return core.disable_trigger('ondef_sileris', 'ondef') player.waiting_for_sileris = 0 defences.ondef('sileris') player.multi_flay = False
def focus(line, time, backrefs): core.disable_trigger('survival_focusing', 'survival') core.disable_trigger('failure_focus_offbal', 'failures') core.enable_trigger('focus_balance', 'balances') cures.enable_focusable_cures() player.focus_balance = 0 player.waiting_for_aeon = 0 player.focus_lastfire = time player.fire_focus = False player.actions['focus'] = True player.focus_on_impatience = False player.afflictions['impatience'] = False
def herbs_outr(line, time, backrefs): num = int(backrefs[0]) herb = backrefs[1] rift = int(backrefs[2]) valid_herbs = ( 'bayberry bark', 'bellwort flower', 'black cohosh', 'bloodroot leaf', 'echinacea', 'ginseng root', 'goldenseal root', 'hawthorn berry', 'irid moss', 'kelp', 'kola nut', 'lobelia seed', 'prickly ash bark', 'prickly pear', 'skullcap', 'slippery elm', 'valerian', 'sileris' ) if herb in valid_herbs: herb = herbs.rift_name_conversion[herb] herbs.herbs[herb].inv += num herbs.herbs[herb].rift = rift herbs.herbs[herb].wait_for_outr = False player.waiting_for_aeon = 0 core.disable_trigger('herbs_outr', 'herbs') player.stunned = False impossible_afflictions = ( 'webbed', 'transfixed', 'roped', 'impale', 'bound', ) for aff in impossible_afflictions: player.afflictions[aff] = False if player.can_outr() is False: impossible_afflictions = ( 'leftarm_lvl1', 'leftarm_lvl2', 'leftarm_lvl3', 'rightarm_lvl1', 'rightarm_lvl2', 'rightarm_lvl3' ) for aff in impossible_afflictions: player.afflictions[aff] = False
def toggle_heartseed(line, time, backrefs): if player.allow_heartseed: core.echo("Disabling Heartseed Trigger for 5 Minutes") player.allow_heartseed = False core.disable_trigger('elementalism_heartseed', 'elementalism') player.heartseed_timer = Timer(300, reenable_heartseed) player.heartseed_timer.start() else: core.echo("Enabling Heartseed Trigger") player.allow_heartseed = True player.heartseed_timer.cancel() core.enable_trigger('elementalism_heartseed', 'elementalism')
def cure_enablers_goldenseal(line, time, backrefs): player.afflictions['anorexia'] = False player.stunned = False player.afflictions['amnesia'] = False player.ate['goldenseal'] = True player.herb_balance = 0 player.herb_lastate = time player.waiting_for_aeon = 0 herbs.goldenseal.inv -= 1 core.enable_trigger('failure_eat_offbal', 'failures') core.triggers_pending_disable.append(['failure_eat_offbal', 'failures']) core.triggers_pending_disable.append(['failure_goldenseal_insomnia', 'failures']) core.disable_trigger('cure_enablers_goldenseal', 'cure_enablers') core.disable_trigger('failure_eating', 'failures') core.disable_trigger('failure_eating_anorexia', 'failures') core.disable_trigger('failure_eating_mickey', 'failures') enable = ( 'dizziness', 'epilepsy', 'impatience', 'shyness', 'stupidity', 'insomnia' ) _enable_cure_triggers(enable) core.call_later(core.config['herb_balance_delay'], _enable_herb_balance)
def cure_enablers_lobelia(line, time, backrefs): player.afflictions['anorexia'] = False player.stunned = False player.afflictions['amnesia'] = False player.ate['lobelia'] = True player.herb_balance = 0 player.herb_lastate = time player.waiting_for_aeon = 0 herbs.lobelia.inv -= 1 core.enable_trigger('failure_eat_offbal', 'failures') core.triggers_pending_disable.append(['failure_eat_offbal', 'failures']) core.disable_trigger('cure_enablers_lobelia', 'cure_enablers') core.disable_trigger('failure_eating', 'failures') core.disable_trigger('failure_eating_anorexia', 'failures') core.disable_trigger('failure_eating_mickey', 'failures') enable = ( 'agoraphobia', 'claustrophobia', 'loneliness', 'masochism', 'reckless', 'vertigo' ) _enable_cure_triggers(enable) core.call_later(core.config['herb_balance_delay'], _enable_herb_balance)
def cure_enablers_kelp(line, time, backrefs): player.afflictions['anorexia'] = False player.stunned = False player.afflictions['amnesia'] = False player.ate['kelp'] = True player.herb_balance = 0 player.herb_lastate = time player.waiting_for_aeon = 0 herbs.kelp.inv -= 1 core.enable_trigger('failure_eat_offbal', 'failures') core.triggers_pending_disable.append(['failure_eat_offbal', 'failures']) core.disable_trigger('cure_enablers_kelp', 'cure_enablers') core.disable_trigger('failure_eating', 'failures') core.disable_trigger('failure_eating_anorexia', 'failures') core.disable_trigger('failure_eating_mickey', 'failures') enable = ( 'asthma', 'clumsiness', 'healthleech', 'hypochondria', 'sensitivity', 'weariness' ) _enable_cure_triggers(enable) core.call_later(core.config['herb_balance_delay'], _enable_herb_balance)
def cure_enablers_ginseng(line, time, backrefs): player.afflictions['anorexia'] = False player.afflictions['amnesia'] = False player.stunned = False player.ate['ginseng'] = True player.herb_balance = 0 player.herb_lastate = time herbs.ginseng.inv -= 1 player.waiting_for_aeon = 0 core.enable_trigger('failure_eat_offbal', 'failures') core.triggers_pending_disable.append(['failure_eat_offbal', 'failures']) core.disable_trigger('cure_enablers_ginseng', 'cure_enablers') core.disable_trigger('failure_eating', 'failures') core.disable_trigger('failure_eating_anorexia', 'failures') core.disable_trigger('failure_eating_mickey', 'failures') enable = ( 'addiction', 'darkshade', 'haemophilia', 'lethargy', 'scytherus', 'nausea' ) _enable_cure_triggers(enable) core.call_later(core.config['herb_balance_delay'], _enable_herb_balance)
def toggle_retardation_mode(line, time, backrefs): if core.retardation_mode: core.disable_alias('retardation_cure', 'sage_internal_commands') core.disable_alias('retardation_autocure', 'sage_internal_commands') core.enable_trigger('symptoms_aeon', 'symptoms') core.echo("Disabling retardation mode") core.retardation_mode = False core.aeon_mode = False else: core.enable_alias('retardation_autocure', 'sage_internal_commands') core.enable_alias('retardation_cure', 'sage_internal_commands') core.disable_trigger('symptoms_aeon', 'symptoms') core.echo("Enabling retardation aeon mode") core.retardation_mode = True core.aeon_mode = True
def failure_eating_mickey(line, time, backrefs): player.herb_balance = 1 core.disable_trigger('failure_eating', 'failures') core.disable_trigger('failure_eating_anorexia', 'failures') core.disable_trigger('failure_eating_mickey', 'failures') herb = herb_queue.fire() core.disable_trigger('cure_enablers_' + herb, 'cure_enablers') cures.affliction('nausea')
def failure_eating(line, time, backrefs): player.herb_balance = 1 core.disable_trigger('failure_eating', 'failures') core.disable_trigger('failure_eating_anorexia', 'failures') core.disable_trigger('failure_eating_mickey', 'failures') # something isn't outrifted.. herb = herb_queue.fire() herb_queue.lastfire = 0 if herb is not None: core.disable_trigger('cure_enablers_' + herb, 'cure_enablers') herbs.herbs[herb].inv = 0
def cure_enablers_kola(line, time, backrefs): player.afflictions['anorexia'] = False player.stunned = False player.afflictions['amnesia'] = False player.ate['kola'] = True herbs.kola.inv -= 1 player.waiting_for_aeon = 0 # kola doesn't take herb balance core.disable_trigger('cure_enablers_kola', 'cure_enablers') core.disable_trigger('failure_eating', 'failures') core.disable_trigger('failure_eating_anorexia', 'failures') core.disable_trigger('failure_eating_mickey', 'failures') core.enable_trigger('ondef_kola', 'ondef')
def failure_epidermal_no_affliction(line, time, backrefs): if player.last_salve != 'epidermal': core.disable_trigger('failure_epidermal_no_affliction', 'failures') return where = player.actions['applied_to'] if where in ('torso', 'body'): afflictions = ( 'anorexia', 'itching' ) cures.remove_afflictions(afflictions) elif where == 'head': afflictions = ( 'laceration_lvl1', 'stuttering' ) cures.remove_afflictions(afflictions) core.disable_trigger('failure_epidermal_no_affliction', 'failures') player.salve_balance = 1
def failure_writhe(line, time, backrefs): player.writhe_balance == 1 writhe_queue.empty() triggers = ( 'cure_enablers_impale', 'cure_enablers_webbed_roped', 'cure_enablers_transfixed' ) for trigger in triggers: core.disable_trigger(trigger, 'cure_enablers') affs = ( 'webbed', 'impale', 'transfixed', 'roped', 'bound' ) for aff in affs: player.afflictions[aff] = False
def cure_enablers_skullcap(line, time, backrefs): player.afflictions['anorexia'] = False player.stunned = False player.afflictions['amnesia'] = False player.ate['skullcap'] = True herbs.skullcap.inv -= 1 player.waiting_for_aeon = 0 # skullcap doesn't take herb balance core.disable_trigger('cure_enablers_skullcap', 'cure_enablers') core.disable_trigger('failure_eating', 'failures') core.disable_trigger('failure_eating_anorexia', 'failures') core.disable_trigger('failure_eating_mickey', 'failures') core.enable_trigger('ondef_deathsight', 'ondef')
def disable_restro_break_triggers(): triggers = ( 'limb_breaks_leftarm_lvl2', 'limb_breaks_rightarm_lvl2', 'limb_breaks_leftleg_lvl2', 'limb_breaks_rightleg_lvl2', 'limb_breaks_rightleg_lvl2', 'limb_breaks_head_lvl1', 'limb_breaks_leftarm_lvl3', 'limb_breaks_rightarm_lvl3', 'limb_breaks_leftleg_lvl3', 'limb_breaks_rightleg_lvl3', 'limb_breaks_head_lvl2', 'limb_breaks_trample_crush', 'limb_breaks_trample_pulverise', 'limb_breaks_trample_smash', 'limb_breaks_trample_break' ) for trigger in triggers: core.disable_trigger(trigger, 'limb_breaks')
def unstun(line, time, backrefs): player.stunned = False player.stun_ticks = 0 core.disable_trigger('cures_stun', 'cures') core.disable_trigger('cures_unconciousness', 'cures') core.disable_trigger('ai_stun_check', 'anti-illusion') core.debug("unstunned")
def deflist_sileris(line, time, backrefs): player.waiting_for_sileris = 0 core.disable_trigger('ondef_sileris', 'ondef') core.disable_trigger('sileris_balance', 'balances') core.disable_trigger('failure_sileris_slickness', 'failures') player.pre_def.append('sileris') core.line = ansi.color['magenta'] + "(+" + ansi.color['default'] + 'sileris' + ansi.color['magenta'] + ")" + ansi.color['default']