Class: Contest::Logic
Overview
Logic part of Pokemon Contests
Defined Under Namespace
Classes: ContestInfo
Constant Summary collapse
- ADJACENT_CONDITION_MAPPING =
Adjacent conditions of each conditions
{cool: %i[beautiful tough], beautiful: %i[cool cute], cute: %i[beautiful clever], clever: %i[cute tough], tough: %i[clever cool]}
- ENTHOUSIASM_BOOST_EFFECTS =
Effects that boost the enthousiasm gain when the user is in a specific position
%i[very_exciting_first very_exciting_last]
- CONTEST_SCARVES =
Scarves boosting the score of each condition
{cool: :red_scarf, beautiful: :blue_scarf, cute: :pink_scarf, clever: :green_scarf, tough: :yellow_scarf}
- SINGLE_CONDITION_MAX_SCORE =
Maximum score that can be obtained from a single condition
255
Instance Attribute Summary collapse
- #contest_info ⇒ Contest::Logic::ContestInfo readonly
-
#contestants ⇒ Array<ContestCreature>
readonly
Get all the contestants in the current contest.
-
#current_contestant ⇒ ContestCreature
readonly
The contestant whose turn it is to play.
-
#current_round ⇒ Integer
Get the current round (0-5).
-
#enthousiasm_locked ⇒ Boolean
If the enthousiasm is locked for the round.
-
#messages ⇒ Array<Array>
readonly
List of messages to send to an interpreter (AI/Scene).
-
#moves_to_play ⇒ Array[Contest::Move]
Move chosen by the current contestant to be played.
-
#play_order ⇒ Array<ContestCreature>
readonly
Play order for the current round.
-
#randomize_next_turn ⇒ Boolean
Whether to randomize the next turn's order.
-
#rng ⇒ Random
readonly
Get the rng.
-
#scene ⇒ Contest::Scene
readonly
Get the scene used to instanciate this Logic instance.
Instance Method Summary collapse
-
#add_move_to_play(move)
Add a move to the list of moves to play this round.
-
#ai_for(contestant) ⇒ AI::Base
Get the AI linked to the current contestant.
-
#change_enthousiasm(move) ⇒ Integer
Change the enthousiasm based on the move used and its effects.
-
#contestant_after(contestant) ⇒ Array<ContestCreature>
Get the contestant that plays immediately after a contestant in the current round.
-
#contestant_before(contestant) ⇒ Array<ContestCreature>
Get the contestant that plays immediately before a contestant in the current round.
-
#contestant_play_order(contestant) ⇒ Integer
Get the current contestant's play order.
-
#contestants_after(contestant) ⇒ Array<ContestCreature>
Get the contestants that play after a contestant in the current round.
-
#contestants_before(contestant) ⇒ Array<ContestCreature>
Get the contestants that play before a contestant in the current round.
-
#current_contestant_index ⇒ Integer
get a contestant's index.
-
#determine_round_play_order
Determine the play order for the current round.
-
#give_score(contestant, score)
Give score to a contestant.
-
#initialize(scene) ⇒ Logic
constructor
Create a new Logic instance.
-
#load_contestants
Create the ContestCreature object for each contestant.
-
#next_contestant
Set the next contestant to play.
-
#player_creature ⇒ ContestCreature
Get the player's creature.
-
#player_creature?(creature) ⇒ Boolean
If the creature is the player's creature.
-
#rng_seed ⇒ Integer
Get the current RNG seed.
-
#score_primary_judging(contestant) ⇒ Integer
Calculate the score for the primary judging phase.
-
#to_s
(also: #inspect)
Safe to_s & inspect.
Constructor Details
#initialize(scene) ⇒ Logic
Create a new Logic instance
23 24 |
# File 'docs/6_Contest_04_Logic.rb', line 23 def initialize(scene) end |
Instance Attribute Details
#contest_info ⇒ Contest::Logic::ContestInfo (readonly)
8 9 10 |
# File 'docs/6_Contest_04_Logic.rb', line 8 def contest_info @contest_info end |
#contestants ⇒ Array<ContestCreature> (readonly)
Get all the contestants in the current contest
20 21 22 |
# File 'docs/6_Contest_04_Logic.rb', line 20 def contestants @contestants end |
#current_contestant ⇒ ContestCreature (readonly)
The contestant whose turn it is to play
65 66 67 |
# File 'docs/6_Contest_04_Logic.rb', line 65 def current_contestant @current_contestant end |
#current_round ⇒ Integer
Get the current round (0-5)
17 18 19 |
# File 'docs/6_Contest_04_Logic.rb', line 17 def current_round @current_round end |
#enthousiasm_locked ⇒ Boolean
If the enthousiasm is locked for the round
119 120 121 |
# File 'docs/6_Contest_04_Logic.rb', line 119 def enthousiasm_locked @enthousiasm_locked end |
#messages ⇒ Array<Array> (readonly)
List of messages to send to an interpreter (AI/Scene)
6 7 8 |
# File 'docs/6_Contest_04_Logic.rb', line 6 def @messages end |
#moves_to_play ⇒ Array[Contest::Move]
Move chosen by the current contestant to be played
59 60 61 |
# File 'docs/6_Contest_04_Logic.rb', line 59 def moves_to_play @moves_to_play end |
#play_order ⇒ Array<ContestCreature> (readonly)
Play order for the current round
62 63 64 |
# File 'docs/6_Contest_04_Logic.rb', line 62 def play_order @play_order end |
#randomize_next_turn ⇒ Boolean
Whether to randomize the next turn's order
68 69 70 |
# File 'docs/6_Contest_04_Logic.rb', line 68 def randomize_next_turn @randomize_next_turn end |
#rng ⇒ Random (readonly)
Get the rng
14 15 16 |
# File 'docs/6_Contest_04_Logic.rb', line 14 def rng @rng end |
#scene ⇒ Contest::Scene (readonly)
Get the scene used to instanciate this Logic instance
11 12 13 |
# File 'docs/6_Contest_04_Logic.rb', line 11 def scene @scene end |
Instance Method Details
#add_move_to_play(move)
Add a move to the list of moves to play this round
74 75 |
# File 'docs/6_Contest_04_Logic.rb', line 74 def add_move_to_play(move) end |
#ai_for(contestant) ⇒ AI::Base
Get the AI linked to the current contestant
40 41 |
# File 'docs/6_Contest_04_Logic.rb', line 40 def ai_for(contestant) end |
#change_enthousiasm(move) ⇒ Integer
Change the enthousiasm based on the move used and its effects
123 124 |
# File 'docs/6_Contest_04_Logic.rb', line 123 def change_enthousiasm(move) end |
#contestant_after(contestant) ⇒ Array<ContestCreature>
Get the contestant that plays immediately after a contestant in the current round
102 103 |
# File 'docs/6_Contest_04_Logic.rb', line 102 def contestant_after(contestant) end |
#contestant_before(contestant) ⇒ Array<ContestCreature>
Get the contestant that plays immediately before a contestant in the current round
92 93 |
# File 'docs/6_Contest_04_Logic.rb', line 92 def contestant_before(contestant) end |
#contestant_play_order(contestant) ⇒ Integer
Get the current contestant's play order
82 83 |
# File 'docs/6_Contest_04_Logic.rb', line 82 def contestant_play_order(contestant) end |
#contestants_after(contestant) ⇒ Array<ContestCreature>
Get the contestants that play after a contestant in the current round
97 98 |
# File 'docs/6_Contest_04_Logic.rb', line 97 def contestants_after(contestant) end |
#contestants_before(contestant) ⇒ Array<ContestCreature>
Get the contestants that play before a contestant in the current round
87 88 |
# File 'docs/6_Contest_04_Logic.rb', line 87 def contestants_before(contestant) end |
#current_contestant_index ⇒ Integer
get a contestant's index
44 45 |
# File 'docs/6_Contest_04_Logic.rb', line 44 def current_contestant_index end |
#determine_round_play_order
Determine the play order for the current round
70 71 |
# File 'docs/6_Contest_04_Logic.rb', line 70 def determine_round_play_order end |
#give_score(contestant, score)
Give score to a contestant
107 108 |
# File 'docs/6_Contest_04_Logic.rb', line 107 def give_score(contestant, score) end |
#load_contestants
Create the ContestCreature object for each contestant
52 53 |
# File 'docs/6_Contest_04_Logic.rb', line 52 def load_contestants end |
#next_contestant
Set the next contestant to play
77 78 |
# File 'docs/6_Contest_04_Logic.rb', line 77 def next_contestant end |
#player_creature ⇒ ContestCreature
Get the player's creature
35 36 |
# File 'docs/6_Contest_04_Logic.rb', line 35 def player_creature end |
#player_creature?(creature) ⇒ Boolean
If the creature is the player's creature
49 50 |
# File 'docs/6_Contest_04_Logic.rb', line 49 def player_creature?(creature) end |
#rng_seed ⇒ Integer
Get the current RNG seed
31 32 |
# File 'docs/6_Contest_04_Logic.rb', line 31 def rng_seed end |
#score_primary_judging(contestant) ⇒ Integer
Calculate the score for the primary judging phase
180 181 |
# File 'docs/6_Contest_04_Logic.rb', line 180 def score_primary_judging(contestant) end |
#to_s Also known as: inspect
Safe to_s & inspect
26 27 |
# File 'docs/6_Contest_04_Logic.rb', line 26 def to_s end |