Class: PFM::Daycare

Inherits:
Object show all
Defined in:
docs/4_Systems_201_Daycare.rb

Overview

Daycare management system

The global Daycare manager is stored in $daycare and PFM.game_state.daycare Daycare data Hash format

pokemon: Array # The list of Pokemon in the daycare (PFM::Pokemon or nil)
level: Array # The list of level the Pokemon had when sent to the daycare
layable: Integer # ID of the Pokemon that can be in the egg
rate: Integer # Chance the egg can be layed
egg: Boolean # If an egg has been layed

Author:

  • Nuri Yuri

Defined Under Namespace

Classes: IncenseInfo

Constant Summary collapse

USE_FIRST_FORM_BREED_GROUPS =

Only use the FIRST FORM for breed groups

false
SPECIFIC_FORM_HANDLER =

Specific form handler (system that can force a for according to a code)

{myfakepokemon: proc { |_mother, _father| next((rand(10))) }}
NOT_BREEDING =

List of Pokemon that cannot breed (event if the conditions are valid)

%i[phione manaphy]
BREEDING_WITH_DITTO =

List of Pokemon that only breed with Ditto

%i[phione manaphy]
DITTO_GROUP =

ID of the Ditto group

13
NOT_BREEDING_GROUP =

ID of the breed group that forbid breeding

15
PRICE_RATE =

List of price rate for all daycare

Returns:

  • (Hash{Integer => Integer})
Hash.new(100)
EGG_RATE =

Egg rate according to the common group, common OT, oval_charm (dig(common_group?, common_OT?, oval_charm?))

[[[50, 80], [20, 40]], [[70, 88], [50, 80]]]
BABY_VARIATION =

“Female” breeder that can have different baby (non-incense condition)

Returns:

  • (Hash{Symbol => Array})
{nidoranf: nidoran = %i[nidoranf nidoranm], nidoranm: nidoran, volbeat: volbeat = %i[volbeat illumise], illumise: volbeat, tauros: tauros = %i[tauros miltank], miltank: tauros}
INCENSE_BABY =

“Female” that can have different baby if the male hold an incense

{marill: azurill = IncenseInfo.new(:sea_incense, :azurill), azumarill: azurill, wobbuffet: IncenseInfo.new(:lax_incense, :wynaut), roselia: budew = IncenseInfo.new(:rose_incense, :budew), roserade: budew, chimecho: IncenseInfo.new(:pure_incense, :chingling), sudowoodo: IncenseInfo.new(:rock_incense, :bonsly), mr_mime: mime_jr = IncenseInfo.new(:odd_incense, :mime_jr), mr_rime: mime_jr, chansey: happiny = IncenseInfo.new(:luck_incense, :happiny), blissey: happiny, snorlax: IncenseInfo.new(:full_incense, :munchlax), mantine: IncenseInfo.new(:wave_incense, :mantyke)}
NON_INHERITED_BALL =

Non inherite balls

%i[master_ball cherish_ball]
IV_SET =

IV setter list

%i[iv_hp= iv_dfe= iv_atk= iv_spd= iv_ats= iv_dfs=]
IV_GET =

IV getter list

%i[iv_hp iv_dfe iv_atk iv_spd iv_ats iv_dfs]
IV_POWER_ITEM =

List of power item that transmit IV in the same order than IV_GET/IV_SET

%i[power_weight power_belt power_bracer power_anklet power_lens power_band]

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(game_state = PFM.game_state) ⇒ Daycare

Create the daycare manager

Parameters:

  • game_state (PFM::GameState) (defaults to: PFM.game_state)

    variable responsive of containing the whole game state for easier access



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

def initialize(game_state = PFM.game_state)
end

Instance Attribute Details

#game_statePFM::GameState

Get the game state responsive of the whole game state

Returns:



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

def game_state
  @game_state
end

Instance Method Details

#empty?(id) ⇒ Boolean

If a daycare is empty

Parameters:

  • id (Integer)

    the ID of the daycare

Returns:

  • (Boolean)


111
112
# File 'docs/4_Systems_201_Daycare.rb', line 111

def empty?(id)
end

#full?(id) ⇒ Boolean

If a daycare is full

Parameters:

  • id (Integer)

    the ID of the daycare

Returns:

  • (Boolean)


106
107
# File 'docs/4_Systems_201_Daycare.rb', line 106

def full?(id)
end

#get_pokemon(id, index, prop, *args) ⇒ Object

Get a Pokemon information in the daycare

Parameters:

  • id (Integer)

    the ID of the daycare

  • index (Integer)

    the index of the Pokemon in the daycare

  • prop (Symbol)

    the method to call of PFM::Pokemon to get the information

  • args (Array)

    the list of arguments of the property

Returns:



75
76
# File 'docs/4_Systems_201_Daycare.rb', line 75

def get_pokemon(id, index, prop, *args)
end

#layed_egg?(id) ⇒ Boolean Also known as: has_egg?

If an egg was layed in this daycare

Parameters:

  • id (Integer)

    the ID of the daycare

Returns:

  • (Boolean)


100
101
# File 'docs/4_Systems_201_Daycare.rb', line 100

def layed_egg?(id)
end

#parse_poke(var_id, index)

Parse the daycare Pokemon text info

Parameters:

  • var_id (Integer)

    ID of the game variable where the ID of the daycare is stored

  • index (Integer)

    index of the Pokemon in the daycare



116
117
# File 'docs/4_Systems_201_Daycare.rb', line 116

def parse_poke(var_id, index)
end

#price(id, index) ⇒ Integer

Price to pay in order to withdraw a Pokemon

Parameters:

  • id (Integer)

    the ID of the daycare

  • index (Integer)

    the index of the Pokemon in the daycare

Returns:

  • (Integer)

    the price to pay



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

def price(id, index)
end

#retrieve_egg(id) ⇒ PFM::Pokemon Also known as: retreive_egg

Retrieve the egg layed

Parameters:

  • id (Integer)

    the ID of the daycare

Returns:



94
95
# File 'docs/4_Systems_201_Daycare.rb', line 94

def retrieve_egg(id)
end

#retrieve_egg_rate(id) ⇒ Integer Also known as: retreive_egg_rate

Get the egg rate of a daycare

Parameters:

  • id (Integer)

    the ID of the daycare

Returns:

  • (Integer)


88
89
# File 'docs/4_Systems_201_Daycare.rb', line 88

def retrieve_egg_rate(id)
end

#retrieve_pokemon(id, index) ⇒ PFM::Pokemon? Also known as: withdraw_pokemon, retreive_pokemon

Withdraw a Pokemon from a daycare

Parameters:

  • id (Integer)

    the ID of the daycare

  • index (Integer)

    the index of the Pokemon in the daycare

Returns:



81
82
# File 'docs/4_Systems_201_Daycare.rb', line 81

def retrieve_pokemon(id, index)
end

#store(id, pokemon) ⇒ Boolean

Store a Pokemon to a daycare

Parameters:

  • id (Integer)

    the ID of the daycare

  • pokemon (PFM::Pokemon)

    the pokemon to store in the daycare

Returns:

  • (Boolean)

    if the pokemon could be stored in the daycare



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

def store(id, pokemon)
end

#update

Update every daycare



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

def update
end