Class: Battle::Logic::ExpHandler

Inherits:
Object
  • Object
show all
Includes:
Hooks
Defined in:
docs/01600_Alpha_25_Battle_Engine_00200_Battle_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:



2102
2103
# File 'docs/01600_Alpha_25_Battle_Engine_00200_Battle_Logic.rb', line 2102

def initialize(logic)
end

Instance Attribute Details

#logicBattle::Logic (readonly)

Get the logic object

Returns:



2099
2100
2101
# File 'docs/01600_Alpha_25_Battle_Engine_00200_Battle_Logic.rb', line 2099

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:



2187
2188
# File 'docs/01600_Alpha_25_Battle_Engine_00200_Battle_Logic.rb', line 2187

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:



2112
2113
# File 'docs/01600_Alpha_25_Battle_Engine_00200_Battle_Logic.rb', line 2112

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:



2107
2108
# File 'docs/01600_Alpha_25_Battle_Engine_00200_Battle_Logic.rb', line 2107

def distribute_exp_grouped(enemies)
end