Class: Battle::Logic::ExpHandler

Inherits:
Object
  • Object
show all
Includes:
Hooks
Defined in:
docs/5_Battle_04_Logic.rb

Overview

Class responsive of calculating experience & EV of Pokemon when a Pokemon faints

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Methods included from Hooks

#exec_hooks, #force_return, included, register, remove, remove_without_name

Constructor Details

#initialize(logic) ⇒ ExpHandler

Create the exp handler

Parameters:



2124
2125
# File 'docs/5_Battle_04_Logic.rb', line 2124

def initialize(logic)
end

Instance Attribute Details

#logicBattle::Logic (readonly)

Get the logic object

Returns:



2121
2122
2123
# File 'docs/5_Battle_04_Logic.rb', line 2121

def logic
  @logic
end

Class Method Details

.register_power_ev_bonus(reason) {|receiver, enemy, handler| ... }

Register a hook allowing a pokemon to receive a power_ev bonus

Parameters:

  • reason (String)

    reason of the power_ev_bonus call

Yield Parameters:



2209
2210
# File 'docs/5_Battle_04_Logic.rb', line 2209

def register_power_ev_bonus(reason)
end

Instance Method Details

#distribute_exp_for(enemy) ⇒ Hash{ PFM::PokemonBattler => Integer }

Distribute the experience for a single pokemon

Parameters:

Returns:



2134
2135
# File 'docs/5_Battle_04_Logic.rb', line 2134

def distribute_exp_for(enemy)
end

#distribute_exp_grouped(enemies) ⇒ Hash{ PFM::PokemonBattler => Integer }

Distribute the experience for several pokemon and merge them

Parameters:

Returns:



2129
2130
# File 'docs/5_Battle_04_Logic.rb', line 2129

def distribute_exp_grouped(enemies)
end