Module: Yuki::TJN

Defined in:
docs/4_Systems_003_Map_Engine.rb

Overview

PSDK DayNightSystem v2

This script manage the day night tint & hour calculation

It’s inputs are :

- $game_switches[Sw::TJN_NoTime] (8) : Telling not to update time
- $game_switches[Sw::TJN_RealTime] (7) : Telling to use the real time (computer clock)
- $game_variables[Var::TJN_Month] (15) : Month of the year (1~13 in virtual time)
- $game_variables[Var::TJN_MDay] (16) : Day of the month (1~28 in virtual time)
- $game_variables[Var::TJN_Week] (14) : Week since the begining (0~65535)
- $game_variables[Var::TJN_WDay] (13) : Day of the week (1~7 in virtual time)
- $game_variables[Var::TJN_Hour] (10) : Hour of the day (0~23)
- $game_variables[Var::TJN_Min] (11) : Minute of the hour (0~59)
- $game_switches[Sw::TJN_Enabled] (10) : If tone change is enabled
- $game_switches[Sw::Env_CanFly] (20) : If the tone can be applied (player outside)
- Yuki::TJN.force_update_tone : Calling this method will force the system to update the tint
- PFM.game_state.tint_time_set : Name of the time set (symbol) to use in order to get the tone

It’s outputs are :

- All the time variables (15, 16, 14, 13, 10, 11)
- $game_variables[Var::TJN_Tone] : The current applied tone
    - 0 = Night
    - 1 = Sunset
    - 2 = Morning
    - 3 = Day time

Author:

  • Nuri Yuri

Constant Summary collapse

NEUTRAL_TONE =

Neutral tone

Tone.new(0, 0, 0, 0)
TONE_SETS =

The different tones according to the time set

{default: [Tone.new(-85, -85, -20, 0), Tone.new(-17, -51, -34, 0), Tone.new(-75, -75, -10, 0), NEUTRAL_TONE, Tone.new(17, -17, -34, 0)], winter: [Tone.new(-75, -75, -10, 0), Tone.new(-80, -80, -10, 0), Tone.new(-85, -85, -10, 0), Tone.new(-80, -80, -12, 0), Tone.new(-75, -75, -15, 0), Tone.new(-65, -65, -18, 0), Tone.new(-55, -55, -20, 0), Tone.new(-25, -35, -22, 0), Tone.new(-20, -25, -25, 0), Tone.new(-15, -20, -30, 0), Tone.new(-10, -17, -34, 0), Tone.new(5, -8, -15, 0), Tone.new(0, 0, -5, 0), Tone.new(0, 0, 0, 0), Tone.new(0, 0, 0, 0), Tone.new(-10, -25, -10, 0), Tone.new(-17, -51, -34, 0), Tone.new(-20, -43, -30, 0), Tone.new(-35, -35, -25, 0), Tone.new(-45, -45, -20, 0), Tone.new(-55, -55, -15, 0), Tone.new(-60, -60, -14, 0), Tone.new(-65, -65, -13, 0), Tone.new(-70, -70, -10, 0)], platinum_daynight: [Tone.new(-52, -50, -5, 90), Tone.new(-52, -50, -5, 90), Tone.new(-52, -50, -5, 90), Tone.new(-52, -50, -5, 90), Tone.new(-40, -37, -5, 80), Tone.new(-15, -25, 0, 50), Tone.new(-15, -25, 0, 50), Tone.new(28, 16, -25, 25), Tone.new(0, 0, 0, 0), Tone.new(0, 0, 0, 0), Tone.new(0, 0, 0, 0), Tone.new(0, 0, 0, 0), Tone.new(0, 0, 0, 0), Tone.new(0, 0, 0, 0), Tone.new(0, 0, 0, 0), Tone.new(0, 0, 0, 0), Tone.new(0, 0, 0, 0), Tone.new(0, -10, -35, 20), Tone.new(0, -38, -58, 45), Tone.new(-35, -40, -32, 75), Tone.new(-48, -46, -12, 90), Tone.new(-48, -46, -12, 90), Tone.new(-48, -46, -12, 90), Tone.new(-48, -46, -12, 90)]}
TONE =

The different tones

TIME_SETS =

The different time sets according to the time set

{default: summer = [22, 19, 11, 7], summer: summer, winter: [17, 16, 12, 10], fall: fall = [19, 17, 11, 9], spring: fall}
TIME =

The time when the tone changes

MIN_FRAMES =

The number of frame that makes 1 minute in Game time

600
REGULAR_TRANSITION_TIME =

Regular number of frame the tint change has to be performed

20

Class Method Summary collapse

Class Method Details

.current_toneTone

Return the current tone

Returns:



694
695
# File 'docs/4_Systems_003_Map_Engine.rb', line 694

def current_tone
end

.force_update_tone(value = true)

Force the next update to update the tone

Parameters:

  • value (Boolean) (defaults to: true)

    true to force the next update to update the tone



690
691
# File 'docs/4_Systems_003_Map_Engine.rb', line 690

def force_update_tone(value = true)
end

.init_variables

Function that init the TJN variables



683
684
# File 'docs/4_Systems_003_Map_Engine.rb', line 683

def init_variables
end

.update

Update the tone of the screen and the game time



686
687
# File 'docs/4_Systems_003_Map_Engine.rb', line 686

def update
end

.update_timed_events(map_id = $game_map.map_id)

Function that scan all the timed event for the current map in order to update them

Parameters:

  • map_id (Integer) (defaults to: $game_map.map_id)

    ID of the map where to update the timed events



698
699
# File 'docs/4_Systems_003_Map_Engine.rb', line 698

def update_timed_events(map_id = $game_map.map_id)
end