Class: Battle::Scene
- Inherits:
-
GamePlay::Base
- Object
- GamePlay::Base
- Battle::Scene
- 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
-
.current ⇒ Battle::Scene
writeonly
Set the current battle scene.
Instance Attribute Summary collapse
- #artificial_intelligences ⇒ Array<AI::Base> readonly
- #battle_info ⇒ Battle::Logic::BattleInfo readonly
- #logic ⇒ Battle::Logic readonly
- #message_window ⇒ UI::Message::Window readonly
-
#next_update ⇒ Symbol
Set the next update from outside (flee).
- #player_actions ⇒ Array readonly
- #visual ⇒ Battle::Visual readonly
Attributes inherited from GamePlay::Base
#__last_scene, #__result_process, #running, #viewport
Class Method Summary collapse
-
.register_event(name, &block)
Register an event for the battle.
Instance Method Summary collapse
-
#dispose
Dispose the battle scene.
-
#force_ia_switch? ⇒ Boolean
Tell if the ia should force a switch in case of no foe alive.
-
#initialize(battle_info) ⇒ Scene
constructor
Create a new Battle Scene.
-
#main_begin
Disable the Graphics.transition.
-
#next_update_process
Process the next update method.
-
#on_after_attack(launcher, move)
Call the after_attack Battle Event This event is called at the end of each attack.
-
#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).
-
#on_pre_battle_begin
Call the pre_battle_begin Battle Event This event is called right after the “Trainer wants to battle” text.
-
#snap_to_bitmap ⇒ Texture
Take a snapshot of the scene.
-
#to_s
(also: #inspect)
Safe to_s & inspect.
-
#update
Update the scene.
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
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
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
176 177 178 |
# File 'docs/5_Battle_01_Scene.rb', line 176 def current=(value) @current = value end |
Instance Attribute Details
#artificial_intelligences ⇒ Array<AI::Base> (readonly)
17 18 19 |
# File 'docs/5_Battle_01_Scene.rb', line 17 def artificial_intelligences @artificial_intelligences end |
#battle_info ⇒ Battle::Logic::BattleInfo (readonly)
11 12 13 |
# File 'docs/5_Battle_01_Scene.rb', line 11 def battle_info @battle_info end |
#logic ⇒ Battle::Logic (readonly)
9 10 11 |
# File 'docs/5_Battle_01_Scene.rb', line 9 def logic @logic end |
#message_window ⇒ UI::Message::Window (readonly)
13 14 15 |
# File 'docs/5_Battle_01_Scene.rb', line 13 def @message_window end |
#next_update ⇒ Symbol
Set the next update from outside (flee)
20 21 22 |
# File 'docs/5_Battle_01_Scene.rb', line 20 def next_update @next_update end |
#player_actions ⇒ Array (readonly)
15 16 17 |
# File 'docs/5_Battle_01_Scene.rb', line 15 def player_actions @player_actions end |
#visual ⇒ Battle::Visual (readonly)
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
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
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
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_bitmap ⇒ Texture
You have to dispose the bitmap you got from this function
Take a snapshot of the scene
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 |