Module: BattleUI::PlayerChoiceAbstraction

Includes:
GenericChoice
Included in:
PlayerChoice, PlayerChoiceSafari
Defined in:
docs/5_Battle_01_Scene.rb

Overview

Abstraction helping to design player choice a way that complies to what Visual expect to handle

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#action ⇒ Battle::Actions::Base (readonly)

The possible action made by the player (other than choosing a sub action)



520
521
522
# File 'docs/5_Battle_01_Scene.rb', line 520

def action
  @action
end

#index ⇒ Integer (readonly)

Get the index

Returns:

  • (Integer)


523
524
525
# File 'docs/5_Battle_01_Scene.rb', line 523

def index
  @index
end

#result ⇒ Symbol? (readonly)

The result :attack, :bag, :pokemon, :flee, :cancel, :try_next, :action, :shift :attack = player chooses to attack :bag = player chooses to open the bag :pokemon = player chooses to open the party :flee = player wants to flee from battle :cancel = player cancels, wanting to try something else :action = when the player choice returns an action to use :shift = player wants to shift the current battler

Returns:

  • (Symbol, nil)


517
518
519
# File 'docs/5_Battle_01_Scene.rb', line 517

def result
  @result
end

Instance Method Details

#choice_bait ⇒ Boolean

Set the choice as wanting to throw a bait

Returns:

  • (Boolean) —

    if the operation was a success



581
582
# File 'docs/5_Battle_01_Scene.rb', line 581

def choice_bait
end

#choice_mud ⇒ Boolean

set the choice as wanting to throw mud

Returns:

  • (Boolean) —

    if the operation was a success



585
586
# File 'docs/5_Battle_01_Scene.rb', line 585

def choice_mud
end

#choice_safari_ball ⇒ Boolean

Set the choice as wanting to throw a Safari Ball

Returns:

  • (Boolean) —

    if the operation was a success



577
578
# File 'docs/5_Battle_01_Scene.rb', line 577

def choice_safari_ball
end

#reset

Reset the choice



525
526
# File 'docs/5_Battle_01_Scene.rb', line 525

def reset
end

#shift_pokemon ⇒ Boolean

Force the action to shift a Pokemon

Returns:

  • (Boolean)


537
538
# File 'docs/5_Battle_01_Scene.rb', line 537

def shift_pokemon
end

#use_item(item)

Force the action to use an item

Parameters:



533
534
# File 'docs/5_Battle_01_Scene.rb', line 533

def use_item(item)
end

#validated? ⇒ Boolean

If the player made a choice

Returns:

  • (Boolean)


529
530
# File 'docs/5_Battle_01_Scene.rb', line 529

def validated?
end