Class: Battle::Scene

Inherits:
GamePlay::Base show all
Includes:
Hooks
Defined in:
docs/5_Battle_01_Scene.rb

Overview

Base classe of all the battle scene

Defined Under Namespace

Classes: Message

Constant Summary

Constants inherited from GamePlay::Base

GamePlay::Base::DEFAULT_TRANSITION, GamePlay::Base::DEFAULT_TRANSITION_PARAMETER

Constants included from Input

Input::ALIAS_KEYS, Input::AXIS_MAPPING, Input::AXIS_SENSITIVITY, Input::DEAD_ZONE, Input::Keyboard, Input::Keys, Input::NON_TRIGGER_ZONE, Input::REPEAT_COOLDOWN, Input::REPEAT_SPACE

Constants included from GamePlay::DisplayMessage

GamePlay::DisplayMessage::MESSAGE_ERROR, GamePlay::DisplayMessage::MESSAGE_PROCESS_ERROR

Class Attribute Summary collapse

Instance Attribute Summary collapse

Attributes inherited from GamePlay::Base

#__last_scene, #__result_process, #running, #viewport

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 GamePlay::Base

#add_disposable, #call_scene, #find_parent, #main, #return_to_scene, #visible, #visible=

Methods included from Input

dir4, dir8, get_text, joy_axis_position, press?, register_events, released?, repeat?, swap_states, trigger?

Methods included from GamePlay::DisplayMessage

#can_display_message_be_called?, #close_message_window, #display_message, #display_message_and_wait, #message_processing?, #message_visible, #message_visible=

Constructor Details

#initialize(battle_info) ⇒ Scene

Note:

This method create the banks, the AI, the pokemon battlers and the battle logic It should call the logic_init event

Create a new Battle Scene

Parameters:



25
26
# File 'docs/5_Battle_01_Scene.rb', line 25

def initialize(battle_info)
end

Class Attribute Details

.current=(value) ⇒ Battle::Scene (writeonly)

Set the current battle scene

Returns:



176
177
178
# File 'docs/5_Battle_01_Scene.rb', line 176

def current=(value)
  @current = value
end

Instance Attribute Details

#artificial_intelligencesArray<AI::Base> (readonly)

Returns:



17
18
19
# File 'docs/5_Battle_01_Scene.rb', line 17

def artificial_intelligences
  @artificial_intelligences
end

#battle_infoBattle::Logic::BattleInfo (readonly)



11
12
13
# File 'docs/5_Battle_01_Scene.rb', line 11

def battle_info
  @battle_info
end

#logicBattle::Logic (readonly)

Returns:



9
10
11
# File 'docs/5_Battle_01_Scene.rb', line 9

def logic
  @logic
end

#message_windowUI::Message::Window (readonly)

Returns:



13
14
15
# File 'docs/5_Battle_01_Scene.rb', line 13

def message_window
  @message_window
end

#next_updateSymbol

Set the next update from outside (flee)

Returns:

  • (Symbol)


20
21
22
# File 'docs/5_Battle_01_Scene.rb', line 20

def next_update
  @next_update
end

#player_actionsArray (readonly)

Returns:

  • (Array)


15
16
17
# File 'docs/5_Battle_01_Scene.rb', line 15

def player_actions
  @player_actions
end

#visualBattle::Visual (readonly)

Returns:



7
8
9
# File 'docs/5_Battle_01_Scene.rb', line 7

def visual
  @visual
end

Class Method Details

.register_event(name, &block)

Register an event for the battle

Parameters:

  • name (Symbol)

    name of the event

  • block (Proc)

    code of the event



180
181
# File 'docs/5_Battle_01_Scene.rb', line 180

def register_event(name, &block)
end

Instance Method Details

#dispose

Dispose the battle scene



41
42
# File 'docs/5_Battle_01_Scene.rb', line 41

def dispose
end

#force_ia_switch?Boolean

Tell if the ia should force a switch in case of no foe alive

Returns:

  • (Boolean)


81
82
# File 'docs/5_Battle_01_Scene.rb', line 81

def force_ia_switch?
end

#main_begin

Disable the Graphics.transition



32
33
# File 'docs/5_Battle_01_Scene.rb', line 32

def main_begin()
end

#next_update_process

Process the next update method



38
39
# File 'docs/5_Battle_01_Scene.rb', line 38

def next_update_process
end

#on_after_attack(launcher, move)

Call the after_attack Battle Event This event is called at the end of each attack

Parameters:



187
188
# File 'docs/5_Battle_01_Scene.rb', line 187

def on_after_attack(launcher, move)
end

#on_battle_turn_end

Call the battle_phase_end Battle Event This event is called at the very end of a turn (after the switching in of new mons)



195
196
# File 'docs/5_Battle_01_Scene.rb', line 195

def on_battle_turn_end
end

#on_pre_battle_begin

Call the pre_battle_begin Battle Event This event is called right after the “Trainer wants to battle” text



191
192
# File 'docs/5_Battle_01_Scene.rb', line 191

def on_pre_battle_begin
end

#snap_to_bitmapTexture

Note:

You have to dispose the bitmap you got from this function

Take a snapshot of the scene

Returns:



46
47
# File 'docs/5_Battle_01_Scene.rb', line 46

def snap_to_bitmap
end

#to_s Also known as: inspect

Safe to_s & inspect



28
29
# File 'docs/5_Battle_01_Scene.rb', line 28

def to_s
end

#update

Update the scene



35
36
# File 'docs/5_Battle_01_Scene.rb', line 35

def update
end