Class: Battle::Logic::CatchHandler

Inherits:
ChangeHandlerBase show all
Includes:
Hooks
Defined in:
docs/01600_Alpha_25_Battle_Engine_00200_Battle_Logic.rb

Overview

Handler responsive of answering properly Pokemon catching requests

Constant Summary collapse

STATUS_MODIFIER =

Modifier applied to the formula depending of the Status

Returns:

  • (Hash{ Symbol => Integer })
{poison: 1.5, paralysis: 1.5, burn: 1.5, sleep: 2.5, freeze: 2.5, toxic: 1.5}
BALL_RATE_CALCULATION =

List all the special ball rate calculation block

{}
TEXT_CATCH =

ID of the catching text in the text database

Returns:

  • (Array<Array<Integer>>)
[[18, 63], [18, 64], [18, 65], [18, 66], [18, 67], [18, 68]]
ULTRA_BEAST =

DB_Symbol of each Ultra-Beast

Returns:

  • (Array<Symbol>)
%i[nihilego buzzwole pheromosa xurkitree celesteela kartana guzzlord poipole naganadel stakataka blacephalon]

Instance Attribute Summary

Attributes inherited from ChangeHandlerBase

#logic, #pre_checked_effects, #scene

Class Method Summary collapse

Instance Method Summary collapse

Methods included from Hooks

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

Methods inherited from ChangeHandlerBase

#initialize, #prevent_change, #process_prevention_reason, #reset_prevention_reason

Constructor Details

This class inherits a constructor from Battle::Logic::ChangeHandlerBase

Class Method Details

.add_ball_rate_calculation(ball_name) {|target, pkm_ally| ... }

Define a new ball rate calculation in BALL_RATE_CALCULATION

Parameters:

  • ball_name (Symbol)

    the DB_symbol of the ball

Yield Parameters:

Yield Returns:

  • (Integer)

    the new catch_rate



1542
1543
# File 'docs/01600_Alpha_25_Battle_Engine_00200_Battle_Logic.rb', line 1542

def add_ball_rate_calculation(ball_name, &block)
end

Instance Method Details

#caught?Boolean

Tells if the Pokemon is caught

Returns:

  • (Boolean)


1534
1535
# File 'docs/01600_Alpha_25_Battle_Engine_00200_Battle_Logic.rb', line 1534

def caught?
end

#try_to_catch_pokemon(target, pkm_ally, ball)

Function that try to catch the targeted Pokemon

Parameters:



1530
1531
# File 'docs/01600_Alpha_25_Battle_Engine_00200_Battle_Logic.rb', line 1530

def try_to_catch_pokemon(target, pkm_ally, ball)
end