Class: Oakdex::Pokemon::GrowthEvents::IncreasePp

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

Overview

When pokemon increases pp for a move

Instance Method Summary collapse

Methods inherited from Base

#initialize, #read_only?, #to_h

Constructor Details

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

Instance Method Details

#execute(action) ⇒ Object



15
16
17
18
19
20
# File 'lib/oakdex/pokemon/growth_events/increase_pp.rb', line 15

def execute(action)
  @pokemon.add_growth_event(GrowthEvents::IncreaseMovePp,
                            move_id: action,
                            change_by: @options[:moves][action])
  remove_event
end

#messageObject



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

def message
  "Please choose a move of #{@pokemon.name} that should increase its PP."
end

#possible_actionsObject



11
12
13
# File 'lib/oakdex/pokemon/growth_events/increase_pp.rb', line 11

def possible_actions
  @options[:moves].keys
end