def enter(self): global choice_display # Get the monster attack for this room this_rm = "Yellow Room" this_rm_code = toolz.get_code_for_rm(choice_display, this_rm) if this_rm_code == "": print "no code found for ", this_rm, "\nin here", choice_display monster_attack = choice_display[this_rm_code][desc] player_attack = player[power] # ------------------FIGHT TEXT battle.show_fight_text(monster_attack, player_attack) # ------------------RESOLUTION fight_result = battle.fight_resolution(player_attack, monster_attack) if fight_result == "win": reward_text = battle.yellow_prize(world[current_level], player[discard]) print "\n", arrow, "Win!" + reward_text elif fight_result == "half_win": reward_text = battle.yellow_prize(world[current_level], player[discard]) player[health] = toolz.take_damage(player[health], 1) toolz.text_take_damage(player[health], 1) print "\n", arrow, "Half-Win!" + reward_text + ", received damage (-1) hp" else: player[health] = battle.lose_fight(player[health]) print "\n", arrow, "Defeated! received damage (-1) hp" return 'choice'
def bloodlust(player): player[health] = toolz.take_damage(player[health], 1) # toolz.add_effect_to_power(player, "bloodlust") # print player[health], "bloodlust" player[current_effects] = toolz.add_current_effect(player, "bloodlust") print arrow, "BLOODLUST! lost (-1) hp, gain <+10> Power this turn only" return player
def forced_cycle(player): # global player_mana # if player[player_mana] <= 0: # print arrow, "Not enough mana to use Forced Cycle" # return # print dashes, "FORCED CYCLE!!!" toolz.dump_all(player[hand], player[discard]) toolz.dump_all(player[discard], player[deck]) toolz.draw_full_hand(player) # player_mana -= 1 print arrow, "FORCED CYCLE!!! All cards returned to deck, (-1) health" player[health] = toolz.take_damage(player[health], 1) player = toolz.set_total_power(player, skills_owned) # player[power] = toolz.get_hand_power(player) return player
def lose_fight(player_health): # global player_attack, player_health, current_level print "--->>The monster defeated you, you lose 1 health" player_health = toolz.take_damage(player_health, 1) return player_health