Class: Object

Inherits:
BasicObject
Defined in:
docs/3_Studio.rb,
docs/000_a_root.rb,
docs/0_Dependencies.rb,
docs/4_Systems_000_General.rb

Constant Summary collapse

EMPTY_OPTIONAL =

Array representing an empty optional key hash

[].freeze
VALIDATE_PARAM_ERROR =

Default error message

'Parameter %<param_name>s sent to %<method_name>s is incorrect : %<reason>s'
EXC_MSG =

Exception message

'Invalid param value passed to %s#%s, see previous errors to know what are the invalid params'

Instance Method Summary collapse

Instance Method Details

#_clean_name_utf8(arr) ⇒ arr

Clean an array containing object responding to #name (force utf-8)

Parameters:

  • arr (Array<#name>)

Returns:

  • (arr)


40
41
# File 'docs/4_Systems_000_General.rb', line 40

def _clean_name_utf8(arr)
end

#bchance?(rate, logic = nil) ⇒ Boolean

Attempt to get for the battles

Parameters:

  • rate (Float)

    number between 0 & 1 telling how much chance we have

  • logic (Battle::Logic) (defaults to: nil)

Returns:

  • (Boolean)


85
86
# File 'docs/4_Systems_000_General.rb', line 85

def bchance?(rate, logic = nil)
end

#ext_text(file_id, text_id) ⇒ String

Get a text front the external text database

Parameters:

  • file_id (Integer)

    ID of the text file

  • text_id (Integer)

    ID of the text in the file

Returns:



46
47
# File 'docs/4_Systems_000_General.rb', line 46

def ext_text(file_id, text_id)
end

#parse_text(file_id, text_id, additionnal_var = nil) ⇒ String

Parse a text from the text database with specific informations

Parameters:

  • file_id (Integer)

    ID of the text file

  • text_id (Integer)

    ID of the text in the file

  • additionnal_var (nil, Hash{String => String}) (defaults to: nil)

    additional remplacements in the text

Returns:

  • (String)

    the text parsed and ready to be displayed



24
25
# File 'docs/4_Systems_000_General.rb', line 24

def parse_text(file_id, text_id, additionnal_var = nil)
end

#parse_text_with_2pokemon(file_id, text_id, pokemon1, pokemon2, additionnal_var = nil) ⇒ String

Parse a text from the text database with 2 pokemon & specific information

Parameters:

  • file_id (Integer)

    ID of the text file

  • text_id (Integer)

    ID of the text in the file

  • pokemon1 (PFM::Pokemon)

    pokemon we’re talking about

  • pokemon2 (PFM::Pokemon)

    pokemon who originated the “problem” (eg. bind)

  • additionnal_var (nil, Hash{String => String}) (defaults to: nil)

    additional remplacements in the text

Returns:

  • (String)

    the text parsed and ready to be displayed



17
18
# File 'docs/4_Systems_000_General.rb', line 17

def parse_text_with_2pokemon(file_id, text_id, pokemon1, pokemon2, additionnal_var = nil)
end

#parse_text_with_pokemon(file_id, text_id, pokemon, additionnal_var = nil) ⇒ String

Parse a text from the text database with specific informations and a pokemon

Parameters:

  • file_id (Integer)

    ID of the text file

  • text_id (Integer)

    ID of the text in the file

  • pokemon (PFM::Pokemon)

    pokemon that will introduce an offset on text_id (its name is also used)

  • additionnal_var (nil, Hash{String => String}) (defaults to: nil)

    additional remplacements in the text

Returns:

  • (String)

    the text parsed and ready to be displayed



8
9
# File 'docs/4_Systems_000_General.rb', line 8

def parse_text_with_pokemon(file_id, text_id, pokemon, additionnal_var = nil)
end

#play_actor_collapse_se

Play the Actor collapse SE



76
77
# File 'docs/4_Systems_000_General.rb', line 76

def play_actor_collapse_se
end

#play_buzzer_se

Play buzzer SE



55
56
# File 'docs/4_Systems_000_General.rb', line 55

def play_buzzer_se
end

#play_cancel_se

Play cancel SE



58
59
# File 'docs/4_Systems_000_General.rb', line 58

def play_cancel_se
end

#play_cursor_se

Play cursor SE



52
53
# File 'docs/4_Systems_000_General.rb', line 52

def play_cursor_se
end

#play_decision_se

Play decision SE



49
50
# File 'docs/4_Systems_000_General.rb', line 49

def play_decision_se
end

#play_enemy_collapse_se

Play the Enemy collapse SE



79
80
# File 'docs/4_Systems_000_General.rb', line 79

def play_enemy_collapse_se
end

#play_equip_se

Play the Equip SE



61
62
# File 'docs/4_Systems_000_General.rb', line 61

def play_equip_se
end

#play_escape_se

Play the Escape SE



73
74
# File 'docs/4_Systems_000_General.rb', line 73

def play_escape_se
end

#play_load_se

Play the Load SE



70
71
# File 'docs/4_Systems_000_General.rb', line 70

def play_load_se
end

#play_save_se

Play the Save SE



67
68
# File 'docs/4_Systems_000_General.rb', line 67

def play_save_se
end

#play_shop_se

Play the Shop SE



64
65
# File 'docs/4_Systems_000_General.rb', line 64

def play_shop_se
end

#text_file_get(file_id) ⇒ Array<String>

Get a list of text from the text database

Parameters:

  • file_id (Integer)

    ID of the text file

Returns:

  • (Array<String>)

    the list of text contained in the file.



35
36
# File 'docs/4_Systems_000_General.rb', line 35

def text_file_get(file_id)
end

#text_get(file_id, text_id) ⇒ String

Get a text front the text database

Parameters:

  • file_id (Integer)

    ID of the text file

  • text_id (Integer)

    ID of the text in the file

Returns:



30
31
# File 'docs/4_Systems_000_General.rb', line 30

def text_get(file_id, text_id)
end

#validate_param(method_name, *param_names, param_values)

Note:

To use a custom message, define a validate_param_message

Function that validate the input paramters

Examples:

Param with a static type

validate_param(:meth, :param, param => Type)

Param with various allowed types

validate_param(:meth, :param, param => [Type1, Type2])

Param using a validation method

validate_param(:meth, :param, param => :validation_method)

Param using a complex structure (Array of String)

validate_param(:meth, :param, param => { Array => String })

Param using a complex structure (Array of Symbol, Integer, String, repetetive)

validate_param(:meth, :param, param => { Array => [Symbol, Integer, String], :cyclic => true, min: 3, max: 9})

Param using a complex structure (Hash)

validate_param(:meth, :param, param => { Hash => { key1: Type, key2: Type2, key3: [String, Symbol] },
                                         :optional => [:key2] })

Parameters:

  • method_name (Symbol)

    name of the method which its param are being validated

  • param_names (Array<Symbol>)

    list of the names of the params

  • param_values (Hash)

    hash associating a param value to the expected type (description)



26
27
# File 'docs/0_Dependencies.rb', line 26

def validate_param(method_name, *param_names, param_values)
end

#void(*args)

Function that does nothing and return nil

Examples:

alias function_to_disable void


31
32
# File 'docs/0_Dependencies.rb', line 31

def void(*args)
end

#void0(*args)

Function that does nothing and return 0

Examples:

alias function_to_disable void0


46
47
# File 'docs/0_Dependencies.rb', line 46

def void0(*args)
end

#void_array(*args)

Function that does nothing and return []

Examples:

alias function_to_disable void_array


51
52
# File 'docs/0_Dependencies.rb', line 51

def void_array(*args)
end

#void_false(*args)

Function that does nothing and return false

Examples:

alias function_to_disable void_false


41
42
# File 'docs/0_Dependencies.rb', line 41

def void_false(*args)
end

#void_string(*args)

Function that does nothing and return “”

Examples:

alias function_to_disable void_array


56
57
# File 'docs/0_Dependencies.rb', line 56

def void_string(*args)
end

#void_true(*args)

Function that does nothing and return true

Examples:

alias function_to_disable void_true


36
37
# File 'docs/0_Dependencies.rb', line 36

def void_true(*args)
end