Module: PFM::Text
- Included in:
- Battle::Message
- Defined in:
- docs/4_Systems_000_General_1_PFM.rb
Overview
The text parser of PSDK (retrieve text from Studio::Text)
Constant Summary collapse
- PKNICK =
Pokemon Nickname var catcher
Array.new(7) { |i| "[VAR PKNICK(000#{i})]" }
- PKNAME =
Pokemon name var catcher
Array.new(7) { |i| "[VAR PKNAME(000#{i})]" }
- TRNAME =
Trainer name var catcher
Array.new(7) { |i| "[VAR TRNAME(000#{i})]" }
- ITEM2 =
Item var catcher
['[VAR ITEM2(0000)]', '[VAR ITEM2(0001)]', '[VAR ITEM2(0002)]', '[VAR ITEM2(0003)]']
- ITEMPLUR1 =
Definite article catcher
['[VAR ITEMPLUR1]']
- MOVE =
Move var catcher
['[VAR MOVE(0000)]', '[VAR MOVE(0001)]', '[VAR MOVE(0002)]']
- NUMB =
Number var catcher
[nil.to_s, '[VAR NUM1(0000)]', '[VAR NUM1(0001)]']
- NUM3 =
Number 3 var catcher
['[VAR NUM3(0000)]', '[VAR NUM3(0001)]', '[VAR NUM3(0002)]']
- NUM2 =
Number 2 var catcher
['[VAR NUM2(0000)]', '[VAR NUM2(0001)]', '[VAR NUM2(0002)]', '[VAR NUM2(0003)]']
- NUM7R =
Number 7 var catcher regexp
/\[VAR NUM7[^\]]*\]/- NUMXR =
Number x var catcher regexp
/\[VAR NUM.[^\]]*\]/- BERRY =
Berry var catcher
[nil.to_s, nil.to_s, nil.to_s, nil.to_s, nil.to_s, nil.to_s, nil.to_s, '[VAR BERRY(0007)]']
- COLOR =
Color var catcher
['[VAR COLOR(0000)]', '[VAR COLOR(0001)]', '[VAR COLOR(0002)]', '[VAR COLOR(0003)]']
- LOCATION =
Location var catcher
['[VAR LOCATION(0000)]', '[VAR LOCATION(0001)]', '[VAR LOCATION(0002)]', '[VAR LOCATION(0003)]', '[VAR LOCATION(0004)]']
- ABILITY =
Ability var catcher
['[VAR ABILITY(0002)]', '[VAR ABILITY(0001)]', '[VAR ABILITY(0002)]']
- KAPHOTICS_Clean =
Kaphotics decoded var clean regexp
/\[VAR [^\]]+\]/- NUMBRNCH_Reg =
/[VAR .[A-Z,()a-z0-9]+]/ Nummeric branch regexp catcher
/\[VAR NUMBRNCH\(....,....\)\][^\[]+/- GENDBR_Reg =
Gender branch regexp catcher
/\[VAR GENDBR\(....,....\)\][^\[]+/- BELL_Reg =
Bell detector
/\[VAR BE05\(([0-9]+)\)\]/- S_Empty =
TODO! Empty string (remove stuff)
nil.to_s
- NBSP_B =
Non breaking space '!' detector
/ !/- NBSP_R =
Non breaking space '!' remplacement
' !'- Dot =
Automatic replacement of ... with the correct char
['...', '…']
- Money =
Automatic replacement of the $ with a non breaking space $
[' $', ' $']
- S_000 =
The \ temporary replacement
"\x00"- GameKeys =
The InGame key name to their key value association
{0 => 'KeyError', 'a' => :A, 'b' => :B, 'x' => :X, 'y' => :Y, 'l' => :L, 'r' => :R, 'l2' => :L2, 'r2' => :R2, 'select' => :SELECT, 'start' => :START, 'l3' => :L3, 'r3' => :R3, 'down' => :DOWN, 'left' => :LEFT, 'right' => :RIGHT, 'up' => :UP, 'home' => :HOME}
Class Method Summary collapse
-
.define_const(obj)
Define generic constants adder to an object (Get var catcher easier).
-
.detect_dialog(text)
Detect a dialog text from message and return it instead of text.
-
.enemy_pokemon?(pokemon) ⇒ Boolean
Detect if a Pokemon is an enemy Pokemon.
-
.get_key_name(name) ⇒ String
Return the real keyboard key name.
-
.parse(file_id, text_id, additionnal_var = nil) ⇒ String
Parse a text from the text database with specific informations.
-
.parse_additional_variables(text, pokemon, additionnal_var = nil) ⇒ Text
Parse the additional variables from the CSV text.
-
.parse_gendbr(text)
Parse the GENDBR (gender of the player, I didn't see other case).
-
.parse_numbrnch(text)
Parse the NUMBRNCH (pural).
-
.parse_rest_of_thing(text)
Perform the rest of the automatic parse (factorization).
-
.parse_string_for_messages(text) ⇒ String
Parse a string for a message.
-
.parse_with_2pokemon(file_id, text_id, pokemon1, pokemon2, additionnal_var) ⇒ String
Parse a text from the text database with 2 pokemon & specific information.
-
.parse_with_pokemon(file_id, text_id, pokemon, additionnal_var = nil) ⇒ String
Parse a text from the text database with specific informations and a pokemon.
-
.parse_with_pokemons(file_id, text_id, pokemon, pokemon2, additionnal_var = nil) ⇒ String
Parse a text from the text database with specific informations and two Pokemon.
-
.reset_variables
Remove every automatic var catcher defined.
-
.set_ability_name(value, index = 0)
Set the ability name variable.
-
.set_item_name(value, index = 0)
Set the item name variable.
-
.set_move_name(value, index = 0)
Set the move name variable.
-
.set_num1(value, index = 1)
Set the number1 variable.
-
.set_num2(value, index = 0)
Set the number2 variable.
-
.set_num3(value, index = 0)
Set the number2 variable.
-
.set_pkname(value, index = 0)
Set the Pokemon Name variable.
-
.set_pknick(value, index = 0)
Set the Pokemon Nickname variable.
-
.set_plural(value_or_index = true, value = true)
Set the numbranches to plural state.
-
.set_variable(expr, value)
Define an automatic var catcher with its value.
-
.unset_variable(expr)
Remove an automatic var catcher with its value.
Class Method Details
.define_const(obj)
Define generic constants adder to an object (Get var catcher easier)
60 61 |
# File 'docs/4_Systems_000_General_1_PFM.rb', line 60 def define_const(obj) end |
.detect_dialog(text)
Detect a dialog text from message and return it instead of text
147 148 |
# File 'docs/4_Systems_000_General_1_PFM.rb', line 147 def detect_dialog(text) end |
.enemy_pokemon?(pokemon) ⇒ Boolean
Detect if a Pokemon is an enemy Pokemon
87 88 |
# File 'docs/4_Systems_000_General_1_PFM.rb', line 87 def enemy_pokemon?(pokemon) end |
.get_key_name(name) ⇒ String
Return the real keyboard key name
154 155 |
# File 'docs/4_Systems_000_General_1_PFM.rb', line 154 def get_key_name(name) end |
.parse(file_id, text_id, additionnal_var = nil) ⇒ String
Parse a text from the text database with specific informations
67 68 |
# File 'docs/4_Systems_000_General_1_PFM.rb', line 67 def parse(file_id, text_id, additionnal_var = nil) end |
.parse_additional_variables(text, pokemon, additionnal_var = nil) ⇒ Text
Parse the additional variables from the CSV text
82 83 |
# File 'docs/4_Systems_000_General_1_PFM.rb', line 82 def parse_additional_variables(text, pokemon, additionnal_var = nil) end |
.parse_gendbr(text)
Sorry for the code, when I did that I wasn't in the "clear" period ^^'
Parse the GENDBR (gender of the player, I didn't see other case)
115 116 |
# File 'docs/4_Systems_000_General_1_PFM.rb', line 115 def parse_gendbr(text) end |
.parse_numbrnch(text)
Sorry for the code, when I did that I wasn't in the "clear" period ^^'
Parse the NUMBRNCH (pural)
110 111 |
# File 'docs/4_Systems_000_General_1_PFM.rb', line 110 def parse_numbrnch(text) end |
.parse_rest_of_thing(text)
Perform the rest of the automatic parse (factorization)
119 120 |
# File 'docs/4_Systems_000_General_1_PFM.rb', line 119 def parse_rest_of_thing(text) end |
.parse_string_for_messages(text) ⇒ String
Parse a string for a message
143 144 |
# File 'docs/4_Systems_000_General_1_PFM.rb', line 143 def (text) end |
.parse_with_2pokemon(file_id, text_id, pokemon1, pokemon2, additionnal_var) ⇒ String
Parse a text from the text database with 2 pokemon & specific information
96 97 |
# File 'docs/4_Systems_000_General_1_PFM.rb', line 96 def parse_with_2pokemon(file_id, text_id, pokemon1, pokemon2, additionnal_var) end |
.parse_with_pokemon(file_id, text_id, pokemon, additionnal_var = nil) ⇒ String
Parse a text from the text database with specific informations and a pokemon
75 76 |
# File 'docs/4_Systems_000_General_1_PFM.rb', line 75 def parse_with_pokemon(file_id, text_id, pokemon, additionnal_var = nil) end |
.parse_with_pokemons(file_id, text_id, pokemon, pokemon2, additionnal_var = nil) ⇒ String
Parse a text from the text database with specific informations and two Pokemon
105 106 |
# File 'docs/4_Systems_000_General_1_PFM.rb', line 105 def parse_with_pokemons(file_id, text_id, pokemon, pokemon2, additionnal_var = nil) end |
.reset_variables
Remove every automatic var catcher defined
131 132 |
# File 'docs/4_Systems_000_General_1_PFM.rb', line 131 def reset_variables end |
.set_ability_name(value, index = 0)
Set the ability name variable
179 180 |
# File 'docs/4_Systems_000_General_1_PFM.rb', line 179 def set_ability_name(value, index = 0) end |
.set_item_name(value, index = 0)
Set the item name variable
169 170 |
# File 'docs/4_Systems_000_General_1_PFM.rb', line 169 def set_item_name(value, index = 0) end |
.set_move_name(value, index = 0)
Set the move name variable
174 175 |
# File 'docs/4_Systems_000_General_1_PFM.rb', line 174 def set_move_name(value, index = 0) end |
.set_num1(value, index = 1)
Set the number1 variable
184 185 |
# File 'docs/4_Systems_000_General_1_PFM.rb', line 184 def set_num1(value, index = 1) end |
.set_num2(value, index = 0)
Set the number2 variable
189 190 |
# File 'docs/4_Systems_000_General_1_PFM.rb', line 189 def set_num2(value, index = 0) end |
.set_num3(value, index = 0)
Set the number2 variable
194 195 |
# File 'docs/4_Systems_000_General_1_PFM.rb', line 194 def set_num3(value, index = 0) end |
.set_pkname(value, index = 0)
Set the Pokemon Name variable
159 160 |
# File 'docs/4_Systems_000_General_1_PFM.rb', line 159 def set_pkname(value, index = 0) end |
.set_pknick(value, index = 0)
Set the Pokemon Nickname variable
164 165 |
# File 'docs/4_Systems_000_General_1_PFM.rb', line 164 def set_pknick(value, index = 0) end |
.set_plural(value_or_index = true, value = true)
Set the numbranches to plural state
136 137 |
# File 'docs/4_Systems_000_General_1_PFM.rb', line 136 def set_plural(value_or_index = true, value = true) end |
.set_variable(expr, value)
Define an automatic var catcher with its value
124 125 |
# File 'docs/4_Systems_000_General_1_PFM.rb', line 124 def set_variable(expr, value) end |
.unset_variable(expr)
Remove an automatic var catcher with its value
128 129 |
# File 'docs/4_Systems_000_General_1_PFM.rb', line 128 def unset_variable(expr) end |