Class: Battle::Logic::CatchHandler

Inherits:
ChangeHandlerBase show all
Includes:
Hooks
Defined in:
docs/5_Battle_04_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



1556
1557
# File 'docs/5_Battle_04_Logic.rb', line 1556

def add_ball_rate_calculation(ball_name, &block)
end

Instance Method Details

#caught?Boolean

Tells if the Pokemon is caught

Returns:

  • (Boolean)


1548
1549
# File 'docs/5_Battle_04_Logic.rb', line 1548

def caught?
end

#try_to_catch_pokemon(target, pkm_ally, ball)

Function that try to catch the targeted Pokemon

Parameters:



1544
1545
# File 'docs/5_Battle_04_Logic.rb', line 1544

def try_to_catch_pokemon(target, pkm_ally, ball)
end