Exemplo n.º 1
0
def _apply_health(game_state: GameState):
    if not game_state.player_state.health_resource.is_at_max():
        create_potion_visual_effect_at_player(game_state)
        player_receive_healing(HEALING_AMOUNT, game_state)
        return ConsumableWasConsumed()
    else:
        return ConsumableFailedToBeConsumed("Already at full health!")
Exemplo n.º 2
0
 def apply_middle_effect(self, game_state: GameState,
                         buffed_entity: WorldEntity,
                         buffed_npc: NonPlayerCharacter,
                         time_passed: Millis):
     if self.timer.update_and_check_if_ready(time_passed):
         player_receive_healing(3, game_state)
         player_receive_mana(3, game_state)
 def item_handle_event(self, event: Event, game_state: GameState):
     if isinstance(event, PlayerBlockedEvent):
         player_receive_healing(self.healing_amount, game_state)
Exemplo n.º 4
0
 def item_handle_event(self, event: Event, game_state: GameState):
     if isinstance(event, EnemyDiedEvent):
         if random.random() < PROC_CHANCE:
             game_state.player_state.gain_buff_effect(get_buff_effect(BUFF_TYPE), DURATION)
             player_receive_healing(HEALTH_ON_KILL_AMOUNT, game_state)
Exemplo n.º 5
0
 def item_handle_event(self, event: Event, game_state: GameState):
     if isinstance(event, PlayerBlockedEvent):
         player_receive_healing(HEALING_AMOUNT, game_state)
Exemplo n.º 6
0
 def item_handle_event(self, event: Event, game_state: GameState):
     if isinstance(event, EnemyDiedEvent):
         if random.random() < PROC_CHANCE:
             player_receive_healing(HEALTH_ON_KILL_AMOUNT, game_state)
Exemplo n.º 7
0
 def item_handle_event(self, event: Event, game_state: GameState):
     if isinstance(event, PlayerLostHealthEvent):
         absorb_amount = event.amount * 0.25
         if absorb_amount <= game_state.player_state.mana_resource.value:
             game_state.player_state.mana_resource.lose(absorb_amount)
             player_receive_healing(absorb_amount, game_state)