Module: Yuki::Berries

Defined in:
docs/4_Systems_003_Map_Engine.rb

Overview

Module that manage the growth of berries. The berry informations are stored in PFM.game_state.berries, a 2D Array of berry information PFM.game_state.berries[event_id] = [berry_id, stage, timer, stage_time, water_timer, water_time, water_counter, info_fertilizer]

Author:

  • Nuri Yuri

Constant Summary collapse

PLANTED_CHAR =

The base name of berry character

'Z_BP'

Class Method Summary collapse

Class Method Details

.data

Return the berry data



1802
1803
# File 'docs/4_Systems_003_Map_Engine.rb', line 1802

def data
end

.event_direction(stage)

Retrieve the event direction based on the berry stage

Parameters:

  • stage (Integer) —

    the growth stage of the berry



1795
1796
# File 'docs/4_Systems_003_Map_Engine.rb', line 1795

def event_direction(stage)
end

.find_berry_data(map_id)

Search the Berry data of the map

Parameters:

  • map_id (Integer) —

    id of the Map



1799
1800
# File 'docs/4_Systems_003_Map_Engine.rb', line 1799

def find_berry_data(map_id)
end

.get_berry_id(event_id) ⇒ Integer

Retrieve the ID of the berry that is planted on an event

Parameters:

  • event_id (Integer) —

    ID of the event

Returns:

  • (Integer)


1751
1752
# File 'docs/4_Systems_003_Map_Engine.rb', line 1751

def get_berry_id(event_id)
end

.get_berry_internal_id(event_id) ⇒ Integer

Retrieve the Internal ID of the berry (text_id)

Parameters:

  • event_id (Integer) —

    ID of the event

Returns:

  • (Integer)


1756
1757
# File 'docs/4_Systems_003_Map_Engine.rb', line 1756

def get_berry_internal_id(event_id)
end

.get_stage(event_id) ⇒ Integer

Retrieve the stage of a berry

Parameters:

  • event_id (Integer) —

    ID of the event

Returns:

  • (Integer)


1761
1762
# File 'docs/4_Systems_003_Map_Engine.rb', line 1761

def get_stage(event_id)
end

.here?(event_id) ⇒ Boolean

Test if a berry is on an event

Parameters:

  • event_id (Integer) —

    ID of the event

Returns:

  • (Boolean)


1746
1747
# File 'docs/4_Systems_003_Map_Engine.rb', line 1746

def here?(event_id)
end

.init

Initialization of the Berry management



1783
1784
# File 'docs/4_Systems_003_Map_Engine.rb', line 1783

def init
end

.init_berry(map_id, event_id, berry_id, state = 4)

Init a berry tree

Parameters:

  • map_id (Integer) —

    id of the map where the berry tree is

  • event_id (Integer) —

    id of the event where the berry tree is shown

  • berry_id (Symbol, Integer) —

    db_symbol or ID of the berry Item in the database

  • state (Integer) (defaults to: 4) —

    the growth state of the berry



1741
1742
# File 'docs/4_Systems_003_Map_Engine.rb', line 1741

def init_berry(map_id, event_id, berry_id, state = 4)
end

.plant(event_id, berry_id)

Plant a berry

Parameters:

  • event_id (Integer) —

    ID of the event

  • berry_id (Integer) —

    ID of the berry Item in the database



1775
1776
# File 'docs/4_Systems_003_Map_Engine.rb', line 1775

def plant(event_id, berry_id)
end

.take(event_id) ⇒ Integer

Take the berries from the berry tree

Parameters:

  • event_id (Integer) —

    ID of the event

Returns:

  • (Integer) —

    the number of berry taken from the tree



1780
1781
# File 'docs/4_Systems_003_Map_Engine.rb', line 1780

def take(event_id)
end

.update

Update of the berry management



1786
1787
# File 'docs/4_Systems_003_Map_Engine.rb', line 1786

def update
end

.update_event(event_id, data)

Update of the berry event graphics

Parameters:

  • event_id (Integer) —

    id of the event where the berry tree is shown

  • data (Array) —

    berry data



1791
1792
# File 'docs/4_Systems_003_Map_Engine.rb', line 1791

def update_event(event_id, data)
end

.water(event_id)

Water a berry

Parameters:

  • event_id (Integer) —

    ID of the event



1770
1771
# File 'docs/4_Systems_003_Map_Engine.rb', line 1770

def water(event_id)
end

.watered?(event_id) ⇒ Boolean

Tell if the berry is watered

Parameters:

  • event_id (Integer) —

    ID of the event

Returns:

  • (Boolean)


1766
1767
# File 'docs/4_Systems_003_Map_Engine.rb', line 1766

def watered?(event_id)
end