Class: Battle::Logic::BattleInfo
- Defined in:
- docs/01600_Alpha_25_Battle_Engine_00200_Battle_Logic.rb
Overview
Class describing the informations about the battle
Constant Summary collapse
- MONEY_ITEMS =
List of item decupling money
%i[amulet_coin luck_incense]
- AI_LEVELS_BASE_MONEY =
List of base money giving AI levels (if strictly below the value)
[16, 20, 36, 48, 80, 100, 200, Float::INFINITY]
- BASE_TRAINER_BATTLE_BGM =
Information of the base trainer battle bgm
['audio/bgm/xy_trainer_battle', 100, 100]
- BASE_WILD_BATTLE_BGM =
Information of the base wild battle bgm
['audio/bgm/rosa_wild_battle', 100, 100]
- BASE_TRAINER_DEFEAT_BGM =
Information of the base trainer defeat bgm
['audio/bgm/xy_trainer_battle_victory', 100, 100]
- BASE_WILD_DEFEAT_BGM =
Information of the base wild defeat bgm
['audio/bgm/xy_wild_battle_victory.ogg', 100, 100]
- BACKGROUND_NAMES =
Name of the background according to their processed zone_type
['back_building', 'back_grass', 'back_tall_grass', 'back_taller_grass', 'back_cave', 'back_mount', 'back_sand', 'back_pond', 'back_sea', 'back_under_water', 'back_ice', 'back_snow']
- TIMED_BACKGROUND_SUFFIXES =
List of of suffix for the timed background. Order is morning, day, sunset, night.
[['morning', 'day'], ['day'], ['sunset', 'night'], ['night']]
Instance Attribute Summary collapse
-
#additional_money ⇒ Integer
Get the additionnal money.
- #ai_levels ⇒ Array<Array<Integer>>
-
#background_name ⇒ String
Get the background name.
-
#bags ⇒ Array<Array<PFM::Bag>>
List of the bags of the battlers according to the bank.
-
#base_moneys ⇒ Array<Array<Integer>>
List of the base money of the battlers according to the bank.
-
#battle_id ⇒ Integer
ID of the battle (for event loading).
-
#battlers ⇒ Array<Array<String>>
List of the battler (image) name of the battlers according to the bank.
-
#caught_pokemon ⇒ PFM::PokemonBattler
Get the caught Pokemon.
-
#classes ⇒ Array<Array<String>>
List of the classes of the battlers according to the bank & their position.
-
#defeat_texts ⇒ Array<String>
Get the defeat text of the enemy trainers.
-
#fishing ⇒ Boolean
Tell if the battle follows a fishing attempt.
-
#flee_attempt_count ⇒ Integer
Get the number of time the player tried to flee.
-
#max_level ⇒ Integer?
Maximum level allowed for the battle.
-
#names ⇒ Array<Array<String>>
List of the name of the battlers according to the bank & their position.
-
#parties ⇒ Array<Array<Array<PFM::Pokemon>>>
List of the “Party” of the battlers according to the bank & their position.
-
#trainer_is_couple ⇒ Boolean
If the trainer battle is a “couple” battle.
-
#victory_bgm ⇒ String
Get the victory BGM (victory of the enemies).
-
#victory_texts ⇒ Array<String>
Get the victory texts of the enemy trainers.
-
#vs_type ⇒ Integer
Number of Pokemon fighting at the same time.
-
#wild_battle_reason ⇒ Integer
Reason of the wild battle.
Class Method Summary collapse
-
.add_trainer(battle_info, bank, id_trainer)
Add a trainer to the battle_info object.
-
.ai_level(base_money) ⇒ Integer
Guess the AI level based on the base money (or a variable).
-
.change_battle_bgms(battle_info, trainer)
Give the new BGMs to the Battle_Info if the current BGMs are the guessed one This means the first trainer added will give its info to the Battle_Info.
-
.from_old_psdk_settings(id_trainer1, id_trainer2 = 0, id_friend = 0) ⇒ Battle::Logic::BattleInfo
Configure a PSDK battle from old settings.
Instance Method Summary collapse
-
#add_party(bank, party, name = nil, klass = nil, battler = nil, bag = nil, base_money = nil, ai_level = nil, victory_text = nil, defeat_text = nil)
Add a party to a bank.
-
#bag(battler) ⇒ PFM::Bag
Get the bag of a battler.
-
#base_money(battler) ⇒ Integer
Get the base money of a battler.
-
#battle_bgm ⇒ String, Array
Get the battle bgm music.
-
#battle_bgm=(bgm)
Set the battle_bgm.
-
#defeat_bgm ⇒ String, Array
Get the defeat bgm music.
-
#defeat_bgm=(bgm)
Set the defeat_bgm.
-
#determine_battler(resources) ⇒ String
Determine the battler that should be sent back.
-
#disallow_exp? ⇒ Boolean
Tell if the battle allow exp.
-
#find_background_name_to_display(prefix = nil, &block) {|background_name| ... } ⇒ String
Get the correct background name to display.
-
#guess_battle_bgm ⇒ Array, String
Function that guess the battle bgm.
-
#guess_defeat_bgm ⇒ Array, String
Function that guess the defeat bgm (defeat of the enemy trainer/wild Pokemon).
-
#initialize(hash = {}) ⇒ BattleInfo
constructor
Create a new Battle Info.
-
#money_item_multiplier?(logic) ⇒ Boolean
Tell if the money item multiplier is active.
-
#party(battler) ⇒ Array<PFM::Pokemon>
Get the party of a battler.
-
#player_basic_info ⇒ Array
Return the basic info about the player.
-
#total_money(logic)
Get the total money.
-
#trainer_battle? ⇒ Boolean
Tell if the battle is a trainer battle.
-
#trainer_class(battler) ⇒ String
Get the trainer class of a battler.
-
#trainer_name(battler) ⇒ String
Get the trainer name of a battler.
Constructor Details
#initialize(hash = {}) ⇒ BattleInfo
Create a new Battle Info
521 522 |
# File 'docs/01600_Alpha_25_Battle_Engine_00200_Battle_Logic.rb', line 521 def initialize(hash = {}) end |
Instance Attribute Details
#additional_money ⇒ Integer
Get the additionnal money
512 513 514 |
# File 'docs/01600_Alpha_25_Battle_Engine_00200_Battle_Logic.rb', line 512 def additional_money @additional_money end |
#ai_levels ⇒ Array<Array<Integer>>
485 486 487 |
# File 'docs/01600_Alpha_25_Battle_Engine_00200_Battle_Logic.rb', line 485 def ai_levels @ai_levels end |
#background_name ⇒ String
Get the background name
653 654 655 |
# File 'docs/01600_Alpha_25_Battle_Engine_00200_Battle_Logic.rb', line 653 def background_name @background_name end |
#bags ⇒ Array<Array<PFM::Bag>>
Returns List of the bags of the battlers according to the bank.
481 482 483 |
# File 'docs/01600_Alpha_25_Battle_Engine_00200_Battle_Logic.rb', line 481 def bags @bags end |
#base_moneys ⇒ Array<Array<Integer>>
Returns List of the base money of the battlers according to the bank.
487 488 489 |
# File 'docs/01600_Alpha_25_Battle_Engine_00200_Battle_Logic.rb', line 487 def base_moneys @base_moneys end |
#battle_id ⇒ Integer
Returns ID of the battle (for event loading).
497 498 499 |
# File 'docs/01600_Alpha_25_Battle_Engine_00200_Battle_Logic.rb', line 497 def battle_id @battle_id end |
#battlers ⇒ Array<Array<String>>
Returns List of the battler (image) name of the battlers according to the bank.
479 480 481 |
# File 'docs/01600_Alpha_25_Battle_Engine_00200_Battle_Logic.rb', line 479 def battlers @battlers end |
#caught_pokemon ⇒ PFM::PokemonBattler
Get the caught Pokemon
506 507 508 |
# File 'docs/01600_Alpha_25_Battle_Engine_00200_Battle_Logic.rb', line 506 def caught_pokemon @caught_pokemon end |
#classes ⇒ Array<Array<String>>
Returns List of the classes of the battlers according to the bank & their position.
477 478 479 |
# File 'docs/01600_Alpha_25_Battle_Engine_00200_Battle_Logic.rb', line 477 def classes @classes end |
#defeat_texts ⇒ Array<String>
Get the defeat text of the enemy trainers
518 519 520 |
# File 'docs/01600_Alpha_25_Battle_Engine_00200_Battle_Logic.rb', line 518 def defeat_texts @defeat_texts end |
#fishing ⇒ Boolean
Tell if the battle follows a fishing attempt
503 504 505 |
# File 'docs/01600_Alpha_25_Battle_Engine_00200_Battle_Logic.rb', line 503 def fishing @fishing end |
#flee_attempt_count ⇒ Integer
Get the number of time the player tried to flee
500 501 502 |
# File 'docs/01600_Alpha_25_Battle_Engine_00200_Battle_Logic.rb', line 500 def flee_attempt_count @flee_attempt_count end |
#max_level ⇒ Integer?
Returns Maximum level allowed for the battle.
489 490 491 |
# File 'docs/01600_Alpha_25_Battle_Engine_00200_Battle_Logic.rb', line 489 def max_level @max_level end |
#names ⇒ Array<Array<String>>
Returns List of the name of the battlers according to the bank & their position.
475 476 477 |
# File 'docs/01600_Alpha_25_Battle_Engine_00200_Battle_Logic.rb', line 475 def names @names end |
#parties ⇒ Array<Array<Array<PFM::Pokemon>>>
Returns List of the “Party” of the battlers according to the bank & their position.
483 484 485 |
# File 'docs/01600_Alpha_25_Battle_Engine_00200_Battle_Logic.rb', line 483 def parties @parties end |
#trainer_is_couple ⇒ Boolean
Returns if the trainer battle is a “couple” battle.
495 496 497 |
# File 'docs/01600_Alpha_25_Battle_Engine_00200_Battle_Logic.rb', line 495 def trainer_is_couple @trainer_is_couple end |
#victory_bgm ⇒ String
Get the victory BGM (victory of the enemies)
509 510 511 |
# File 'docs/01600_Alpha_25_Battle_Engine_00200_Battle_Logic.rb', line 509 def victory_bgm @victory_bgm end |
#victory_texts ⇒ Array<String>
Get the victory texts of the enemy trainers
515 516 517 |
# File 'docs/01600_Alpha_25_Battle_Engine_00200_Battle_Logic.rb', line 515 def victory_texts @victory_texts end |
#vs_type ⇒ Integer
Returns Number of Pokemon fighting at the same time.
491 492 493 |
# File 'docs/01600_Alpha_25_Battle_Engine_00200_Battle_Logic.rb', line 491 def vs_type @vs_type end |
#wild_battle_reason ⇒ Integer
Returns Reason of the wild battle.
493 494 495 |
# File 'docs/01600_Alpha_25_Battle_Engine_00200_Battle_Logic.rb', line 493 def wild_battle_reason @wild_battle_reason end |
Class Method Details
.add_trainer(battle_info, bank, id_trainer)
Add a trainer to the battle_info object
539 540 |
# File 'docs/01600_Alpha_25_Battle_Engine_00200_Battle_Logic.rb', line 539 def add_trainer(battle_info, bank, id_trainer) end |
.ai_level(base_money) ⇒ Integer
Guess the AI level based on the base money (or a variable)
544 545 |
# File 'docs/01600_Alpha_25_Battle_Engine_00200_Battle_Logic.rb', line 544 def ai_level(base_money) end |
.change_battle_bgms(battle_info, trainer)
Give the new BGMs to the Battle_Info if the current BGMs are the guessed one This means the first trainer added will give its info to the Battle_Info
550 551 |
# File 'docs/01600_Alpha_25_Battle_Engine_00200_Battle_Logic.rb', line 550 def change_battle_bgms(battle_info, trainer) end |
.from_old_psdk_settings(id_trainer1, id_trainer2 = 0, id_friend = 0) ⇒ Battle::Logic::BattleInfo
Configure a PSDK battle from old settings
533 534 |
# File 'docs/01600_Alpha_25_Battle_Engine_00200_Battle_Logic.rb', line 533 def from_old_psdk_settings(id_trainer1, id_trainer2 = 0, id_friend = 0) end |
Instance Method Details
#add_party(bank, party, name = nil, klass = nil, battler = nil, bag = nil, base_money = nil, ai_level = nil, victory_text = nil, defeat_text = nil)
Add a party to a bank
570 571 |
# File 'docs/01600_Alpha_25_Battle_Engine_00200_Battle_Logic.rb', line 570 def add_party(bank, party, name = nil, klass = nil, battler = nil, bag = nil, base_money = nil, ai_level = nil, victory_text = nil, defeat_text = nil) end |
#bag(battler) ⇒ PFM::Bag
Get the bag of a battler
590 591 |
# File 'docs/01600_Alpha_25_Battle_Engine_00200_Battle_Logic.rb', line 590 def bag(battler) end |
#base_money(battler) ⇒ Integer
Get the base money of a battler
600 601 |
# File 'docs/01600_Alpha_25_Battle_Engine_00200_Battle_Logic.rb', line 600 def base_money(battler) end |
#battle_bgm ⇒ String, Array
Get the battle bgm music
625 626 |
# File 'docs/01600_Alpha_25_Battle_Engine_00200_Battle_Logic.rb', line 625 def battle_bgm end |
#battle_bgm=(bgm)
Set the battle_bgm
629 630 |
# File 'docs/01600_Alpha_25_Battle_Engine_00200_Battle_Logic.rb', line 629 def battle_bgm=(bgm) end |
#defeat_bgm ⇒ String, Array
Get the defeat bgm music
613 614 |
# File 'docs/01600_Alpha_25_Battle_Engine_00200_Battle_Logic.rb', line 613 def defeat_bgm end |
#defeat_bgm=(bgm)
Set the defeat_bgm
617 618 |
# File 'docs/01600_Alpha_25_Battle_Engine_00200_Battle_Logic.rb', line 617 def defeat_bgm=(bgm) end |
#determine_battler(resources) ⇒ String
Determine the battler that should be sent back
575 576 |
# File 'docs/01600_Alpha_25_Battle_Engine_00200_Battle_Logic.rb', line 575 def determine_battler(resources) end |
#disallow_exp? ⇒ Boolean
Tell if the battle allow exp
525 526 |
# File 'docs/01600_Alpha_25_Battle_Engine_00200_Battle_Logic.rb', line 525 def disallow_exp? end |
#find_background_name_to_display(prefix = nil, &block) {|background_name| ... } ⇒ String
Get the correct background name to display
660 661 |
# File 'docs/01600_Alpha_25_Battle_Engine_00200_Battle_Logic.rb', line 660 def find_background_name_to_display(prefix = nil, &block) end |
#guess_battle_bgm ⇒ Array, String
Function that guess the battle bgm
633 634 |
# File 'docs/01600_Alpha_25_Battle_Engine_00200_Battle_Logic.rb', line 633 def guess_battle_bgm end |
#guess_defeat_bgm ⇒ Array, String
Function that guess the defeat bgm (defeat of the enemy trainer/wild Pokemon)
637 638 |
# File 'docs/01600_Alpha_25_Battle_Engine_00200_Battle_Logic.rb', line 637 def guess_defeat_bgm end |
#money_item_multiplier?(logic) ⇒ Boolean
Tell if the money item multiplier is active
609 610 |
# File 'docs/01600_Alpha_25_Battle_Engine_00200_Battle_Logic.rb', line 609 def money_item_multiplier?(logic) end |
#party(battler) ⇒ Array<PFM::Pokemon>
Get the party of a battler
595 596 |
# File 'docs/01600_Alpha_25_Battle_Engine_00200_Battle_Logic.rb', line 595 def party(battler) end |
#player_basic_info ⇒ Array
Return the basic info about the player
559 560 |
# File 'docs/01600_Alpha_25_Battle_Engine_00200_Battle_Logic.rb', line 559 def player_basic_info end |
#total_money(logic)
Get the total money
604 605 |
# File 'docs/01600_Alpha_25_Battle_Engine_00200_Battle_Logic.rb', line 604 def total_money(logic) end |
#trainer_battle? ⇒ Boolean
Tell if the battle is a trainer battle
555 556 |
# File 'docs/01600_Alpha_25_Battle_Engine_00200_Battle_Logic.rb', line 555 def trainer_battle? end |
#trainer_class(battler) ⇒ String
Get the trainer class of a battler
585 586 |
# File 'docs/01600_Alpha_25_Battle_Engine_00200_Battle_Logic.rb', line 585 def trainer_class(battler) end |
#trainer_name(battler) ⇒ String
Get the trainer name of a battler
580 581 |
# File 'docs/01600_Alpha_25_Battle_Engine_00200_Battle_Logic.rb', line 580 def trainer_name(battler) end |