Class: Oakdex::Pokemon::GrowthEvents::ForgotAndLearnedMove

Inherits:
Base
  • Object
show all
Defined in:
lib/oakdex/pokemon/growth_events/forgot_and_learned_move.rb

Overview

When move was learnt and other move was forgotten

Instance Method Summary collapse

Methods inherited from Base

#initialize, #possible_actions, #read_only?, #to_h

Constructor Details

This class inherits a constructor from Oakdex::Pokemon::GrowthEvents::Base

Instance Method Details

#executeObject



11
12
13
14
15
16
17
18
# File 'lib/oakdex/pokemon/growth_events/forgot_and_learned_move.rb', line 11

def execute
  if available_evolution
    @pokemon.add_growth_event(GrowthEvents::Evolution,
                              evolution: available_evolution,
                              after: self)
  end
  remove_event
end

#messageObject



7
8
9
# File 'lib/oakdex/pokemon/growth_events/forgot_and_learned_move.rb', line 7

def message
  "#{@pokemon.name} learned #{@options[:move_id]} and forgot #{@options[:forgot_move_id]}."
end