Class: Battle::Logic::FTerrainChangeHandler

Inherits:
ChangeHandlerBase show all
Defined in:
docs/5_Battle_04_Logic.rb

Overview

Handler responsive of answering properly terrain changes requests

Constant Summary collapse

FTERRAIN_SYM_TO_MSG =

Weather thingies copiepasted, I don't think this is really useful right now

{none: {electric_terrain: 227, grassy_terrain: 223, misty_terrain: 225, psychic_terrain: 347}, electric_terrain: 226, grassy_terrain: 222, misty_terrain: 224, psychic_terrain: 346}

Instance Attribute Summary

Attributes inherited from ChangeHandlerBase

#logic, #pre_checked_effects, #scene

Instance Method Summary collapse

Methods inherited from ChangeHandlerBase

#initialize, #pass_change, #prevent_change, #process_reason, #reset_reason

Constructor Details

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

Instance Method Details

#fterrain_appliable?(fterrain_type) ⇒ Boolean

Function telling if a terrain can be applyied

Parameters:

  • fterrain_type (Symbol) —

    :none, :electric_terrain, :grassy_terrain, :misty_terrain, :psychic_terrain

Returns:

  • (Boolean)


1764
1765
# File 'docs/5_Battle_04_Logic.rb', line 1764

def fterrain_appliable?(fterrain_type)
end

#fterrain_change(fterrain_type, turn_count = 5, no_message: false)

Function that actually change the terrain

Parameters:

  • fterrain_type (Symbol) —

    :none, :electric_terrain, :grassy_terrain, :misty_terrain, :psychic_terrain

  • turn_count (Integer) (defaults to: 5) —

    INFINITY if last_fterrain == :none, turn_count else

  • no_message (Boolean) (defaults to: false) —

    if the message about terrain change should be shown



1770
1771
# File 'docs/5_Battle_04_Logic.rb', line 1770

def fterrain_change(fterrain_type, turn_count = 5, no_message: false)
end

#fterrain_change_with_process(fterrain_type, turn_count = 5, no_message: false)

Function that test if the change is possible and perform the change if so

Parameters:

  • fterrain_type (Symbol) —

    :none, :electric_terrain, :grassy_terrain, :misty_terrain, :psychic_terrain

  • turn_count (Integer) (defaults to: 5) —

    INFINITY if last_fterrain == :none, turn_count else

  • no_message (Boolean) (defaults to: false) —

    if the message about terrain change should be shown



1776
1777
# File 'docs/5_Battle_04_Logic.rb', line 1776

def fterrain_change_with_process(fterrain_type, turn_count = 5, no_message: false)
end