def _apply_mana(game_state: GameState): if not game_state.player_state.mana_resource.is_at_max(): create_potion_visual_effect_at_player(game_state) player_receive_mana(MANA_AMOUNT, game_state) return ConsumableWasConsumed() else: return ConsumableFailedToBeConsumed("Already at full mana!")
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, PlayerDodgedEvent): player_receive_mana(MANA_ON_DODGE_AMOUNT, game_state)
def item_handle_event(self, event: Event, game_state: GameState): if isinstance(event, EnemyDiedEvent): player_receive_mana(self.mana_on_kill, game_state)
def item_handle_event(self, event: Event, game_state: GameState): if isinstance(event, EnemyDiedEvent): player_receive_mana(MANA_ON_KILL, game_state)