Class: Battle::Scene
- Inherits:
-
GamePlay::Base
- Object
- GamePlay::Base
- Battle::Scene
- Defined in:
- docs/5_Battle_01_Scene.rb
Overview
Base classe of all the battle scene
Direct Known Subclasses
Defined Under Namespace
Classes: Message
Constant Summary collapse
- SPEED_UP_ALLOWED =
Tell if speed up is allowed in battle
true- SPEED_UP_KEY =
Input key used for speed up
:HOME- SPEED_UP_FACTOR =
Speed up factor
4
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, #clock, #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 inherited from GamePlay::Base
#add_disposable, #call_scene, #find_parent, #main, #return_to_scene, #visible, #visible=
Methods included from Input
clear, close_virtual_keyboard, dir4, dir8, get_text, joy_axis_position, load_touch_screen, open_virtual_keyboard, 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
30 31 |
# File 'docs/5_Battle_01_Scene.rb', line 30 def initialize(battle_info) end |
Class Attribute Details
.current=(value) ⇒ Battle::Scene (writeonly)
Set the current battle scene
196 197 198 |
# File 'docs/5_Battle_01_Scene.rb', line 196 def current=(value) @current = value end |
Instance Attribute Details
#artificial_intelligences ⇒ Array<AI::Base> (readonly)
22 23 24 |
# File 'docs/5_Battle_01_Scene.rb', line 22 def artificial_intelligences @artificial_intelligences end |
#battle_info ⇒ Battle::Logic::BattleInfo (readonly)
16 17 18 |
# File 'docs/5_Battle_01_Scene.rb', line 16 def battle_info @battle_info end |
#logic ⇒ Battle::Logic (readonly)
14 15 16 |
# File 'docs/5_Battle_01_Scene.rb', line 14 def logic @logic end |
#message_window ⇒ UI::Message::Window (readonly)
18 19 20 |
# File 'docs/5_Battle_01_Scene.rb', line 18 def @message_window end |
#next_update ⇒ Symbol
Set the next update from outside (flee)
25 26 27 |
# File 'docs/5_Battle_01_Scene.rb', line 25 def next_update @next_update end |
#player_actions ⇒ Array (readonly)
20 21 22 |
# File 'docs/5_Battle_01_Scene.rb', line 20 def player_actions @player_actions end |
#visual ⇒ Battle::Visual (readonly)
12 13 14 |
# File 'docs/5_Battle_01_Scene.rb', line 12 def visual @visual end |
Class Method Details
.register_event(name, &block)
Register an event for the battle
200 201 |
# File 'docs/5_Battle_01_Scene.rb', line 200 def register_event(name, &block) end |
Instance Method Details
#dispose
Dispose the battle scene
46 47 |
# File 'docs/5_Battle_01_Scene.rb', line 46 def dispose end |
#force_ia_switch? ⇒ Boolean
Tell if the ia should force a switch in case of no foe alive
89 90 |
# File 'docs/5_Battle_01_Scene.rb', line 89 def force_ia_switch? end |
#main_begin
Disable the Graphics.transition
37 38 |
# File 'docs/5_Battle_01_Scene.rb', line 37 def main_begin() end |
#next_update_process
Process the next update method
43 44 |
# File 'docs/5_Battle_01_Scene.rb', line 43 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
207 208 |
# File 'docs/5_Battle_01_Scene.rb', line 207 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)
215 216 |
# File 'docs/5_Battle_01_Scene.rb', line 215 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
211 212 |
# File 'docs/5_Battle_01_Scene.rb', line 211 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
51 52 |
# File 'docs/5_Battle_01_Scene.rb', line 51 def snap_to_bitmap end |
#to_s Also known as: inspect
Safe to_s & inspect
33 34 |
# File 'docs/5_Battle_01_Scene.rb', line 33 def to_s end |
#update
Update the scene
40 41 |
# File 'docs/5_Battle_01_Scene.rb', line 40 def update end |