Advertisement
Dekita

rtef 1.1

Jan 1st, 2013
905
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 24.29 KB | None | 0 0
  1. =begin =========================================================================
  2. Dekita's v1.1
  3. ★ Pokémon RealTime Effects™ ★
  4.  
  5. ================================================================================
  6. Script Information:
  7. ====================
  8. This script replicates the time system from pokemon,
  9. e.g in game time is determined by real life time.
  10.  
  11. This script enables screen tint changes according to real time,
  12. not only that is can change weather effects, $game_switches, $game_variables,
  13. trigger common events and even your own custom "time" effects.
  14. You can set up different seasons (as many as you want)
  15. You can give each month its own unique season if you wish, turning on
  16. different swicthes and controling different variables on a month to month
  17. rotation.
  18.  
  19. now you can simply control a switch / a variable / the weather / Screen Tint
  20. and whatever else you can code in realtime with minimal effort.
  21.  
  22. COMPATIBLE WITH :
  23. Khas Awesome Light Effects,(change advanced lighting effects using real time)
  24. MOG Weather EX, (change mog weather effects using real time)
  25.  
  26. AND
  27.  
  28. other features will be available with the use of other pokemon style scripts
  29. e.g Capture add-on : Pokeball Effects ^_^
  30.  
  31. ================================================================================
  32. ★☆★☆★☆★☆★☆★☆★☆★ TERMS AND CONDITIONS: ☆★☆★☆★☆★☆★☆★☆★☆★☆
  33. ================================================================================
  34. 1. You must give credit to "Dekita"
  35. 2. You are NOT allowed to repost this script.(or modified versions)
  36. 3. You are NOT allowed to convert this script.(into other game engines e.g RGSS2)
  37. 4. You are NOT allowed to use this script for Commercial games.
  38. 5. ENJOY!
  39.  
  40. "FINE PRINT"
  41. By using this script you hereby agree to the above terms and conditions,
  42. if any violation of the above terms occurs "legal action" may be taken.
  43. Not understanding the above terms and conditions does NOT mean that
  44. they do not apply to you.
  45. If you wish to discuss the terms and conditions in further detail you can
  46. contact me at http://dekitarpg.wordpress.com/ or DekitaRPG@gmail.com
  47.  
  48. ================================================================================
  49. History:
  50. =========
  51. D /M /Y
  52. 01/01/2o12 - fixed effects triggering too often.
  53. 23/12/2o12 - finished,
  54. 15/12/2o12 - started,
  55.  
  56. ================================================================================
  57. Credit and Thanks to :
  58. =======================
  59. Tsukihime - for helping me solve my menu problem :D
  60.  
  61. ================================================================================
  62. Known Bugs:
  63. ============
  64. N/A
  65.  
  66. =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  67. If a new bug is found please contact me at
  68. http://dekitarpg.wordpress.com/
  69.  
  70. ================================================================================
  71. INSTRUCTIONS:
  72. ==============
  73. Place this script UNDER "▼ Materials" and ABOVE "▼ Main" in your script editor.
  74.  
  75. ================================================================================
  76. NoteTags:
  77. ==========
  78.  
  79. <no tint>
  80. put the above notetag into map noteboxes for maps that do not get tinted
  81. by real time, this would be buildings and things of that nature.
  82.  
  83. <no weather>
  84. put this in map noteboxes for maps that arent effected by the weather at
  85. the current time. ONLY IF USING A WEATHER EFFECT.
  86.  
  87. <tint:red,blue,green,grey>
  88. make sure there is no space's " " when using this notetag !
  89. This is for maps that have a unique tint, e.g caves
  90.  
  91. =end #==========================================================================#
  92.  
  93. module Dekita_RealTime_Clock
  94.  
  95. Using_Khas_Awesome_Lights_Script = false#true
  96.  
  97. T_Color ={# << Do Not Delete
  98.  
  99.  
  100. # Switch Examples.
  101. #[:switch, switch id, boolean]
  102. # e.g
  103. #[:switch, 1, true]
  104. #[:switch, 8, false]
  105.  
  106. # Variable Examples.
  107. #[:variable, variable id, effect type, value]
  108. # e.g
  109. #[:variable, 1, :set, 3]
  110. #[:variable, 1, :add, 3]
  111. #[:variable, 1, :sub, 3]
  112. #[:variable, 1, :div, 3]
  113. #[:variable, 1, :mul, 3]
  114.  
  115. # Weather Examples.
  116. #[weather type, power, sound]
  117. # e.g
  118. #[:none]
  119. #[:rain, 9, "Rain"]
  120. #[:storm, 1, "Storm"]
  121. #[:snow, 5, "Wind"]
  122.  
  123. # Mog Weather Examples.
  124. #[:mog_weather, type, power, name, sound]
  125. # e.g
  126. #[:mog_weather, 5, 6, "Light_02A", "Rain"]
  127. #[:mog_weather, 0, 6, "Rain_01A", "Rain"]
  128.  
  129. # Common Event Example.
  130. #[:common, common event id]
  131. # e.g
  132. #[:common, 15]
  133.  
  134. # Examples:
  135. # :_01_30am => [100, 0, 0, 0, true, [:rain, 6], [:switch, 1, true] ],
  136. # this will make it rain and switch 1 will be true(active) at 1:30 am till 2am
  137. # and the screen tint will be red .
  138.  
  139. # :_18_30pm => [ 0, 100, 0, 100, true, [:snow, 6], [:switch, 1, false] ],
  140. # this will make it snow and switch 1 will be false(inactive) at
  141. # 6:30 pm till 7pm
  142.  
  143.  
  144. # Time => [red,green,blue,grey,nighttime?,[effect 1],[effect 2],[effect 3],[effect 4] ]
  145.  
  146. ## SEASON BEGIN
  147. :season_1 => { # Season 1 settings
  148. # Midnight -> Noon
  149. :_00_00am => [ 0, 0, 0, 200, true, [:none], [nil], [nil], [nil] ],
  150. :_00_30am => [ 0, 0, 0, 200, true, [:none], [nil], [nil], [nil] ],
  151. :_01_00am => [ 0, 0, 0, 200, true, [:none], [nil],[nil], [nil] ],
  152. :_01_30am => [ 0, 0, 0, 200, true, [:none],[nil], [nil], [nil] ],
  153. :_02_00am => [ 0, 0, 0, 200, true, [:rain, 5, "Rain"],[nil], [nil], [nil] ],
  154. :_02_30am => [ 0, 0, 0, 200, true, [:rain, 9, "Rain"],[nil], [nil], [nil] ],
  155. :_03_00am => [ 0, 0, 0, 200, true, [:storm, 7, "Storm"],[nil], [nil], [nil] ],
  156. :_03_30am => [ 0, 0, 0, 200, true, [:storm, 9, "Storm"],[nil], [nil], [nil] ],
  157. :_04_00am => [ 0, 0, 0, 200, true, [:rain, 9, "Rain"],[nil], [nil], [nil] ],
  158. :_04_30am => [ 0, 0, 0, 200, true, [:rain, 5, "Rain"],[nil], [nil], [nil] ],
  159. :_05_00am => [ 0, 0, 0, 200, true, [:none],[nil], [nil], [nil] ],
  160. :_05_30am => [ 0, 0, 0, 200, true, [:none],[nil], [nil], [nil] ],
  161. :_06_00am => [ 0, 0, 0, 200, true, [:snow, 9, "Wind"],[nil], [nil], [nil] ],
  162. :_06_30am => [ 0, 0, 0, 200, true, [:snow, 9, "Wind"],[nil], [nil], [nil] ],
  163. :_07_00am => [ 0, 0, 0, 100, false,[:rain, 5, "Rain"],[nil], [nil], [nil] ],
  164. :_07_30am => [ 0, 0, 0, 100, false,[:storm, 9, "Storm"],[nil], [nil], [nil] ],
  165. :_08_00am => [ 0, 0, 0, 100, false,[:storm, 5, "Storm"],[nil], [nil], [nil] ],
  166. :_08_30am => [ 0, 0, 0, 100, false,[:rain, 5, "Rain"],[nil], [nil], [nil] ],
  167. :_09_00am => [ 0, 0, 0, 100, false,[:none],[nil], [nil], [nil] ],
  168. :_09_30am => [ 0, 0, 0, 100, false,[:none],[nil], [nil], [nil] ],
  169. :_10_00am => [ 0, 0, 0, 100, false,[:none],[nil], [nil], [nil] ],
  170. :_10_30am => [ 0, 0, 0, 100, false,[:none],[nil], [nil], [nil] ],
  171. :_11_00am => [ 0, 0, 0, 100, false,[:none],[nil], [nil], [nil] ],
  172. :_11_30am => [ 0, 0, 0, 100, false,[:none],[nil], [nil], [nil] ],
  173. # Noon -> Midnight
  174. :_12_00pm => [ 0, 0, 0, 100, false,[:rain, 2, "Rain"],[nil], [nil], [nil] ],
  175. :_12_30pm => [ 0, 0, 0, 100, false,[:rain, 1, "Rain"],[nil], [nil], [nil] ],
  176. :_13_00pm => [ 0, 0, 0, 100, false,[:none],[nil], [nil], [nil] ],
  177. :_13_30pm => [ 0, 0, 0, 100, false,[:snow, 9, "Wind"],[nil], [nil], [nil] ],
  178. :_14_00pm => [ 0, 0, 0, 100, false,[:none],[:switch, 1, true], [:variable, 1, :add, 3], [:common, 1] ],
  179. :_14_30pm => [ 0, 0, 0, 100, false,[:snow, 9, "Wind"],[nil], [nil], [nil] ],
  180. :_15_00pm => [ 0, 0, 0, 100, false,[:rain, 9, "Rain"],[nil], [nil], [nil] ],
  181. :_15_30pm => [ 0, 0, 0, 100, false,[:none],[nil], [nil], [nil] ],
  182. :_16_00pm => [ 0, 0, 0, 100, false,[:none],[nil], [nil], [nil] ],
  183. :_16_30pm => [ 0, 0, 0, 100, false,[:none],[nil], [nil], [nil] ],
  184. :_17_00pm => [ 0, 0, 0, 100, false,[:none],[nil], [nil], [nil] ],
  185. :_17_30pm => [ 0, 0, 0, 100, false,[:none],[nil], [nil], [nil] ],
  186. :_18_00pm => [ 0, 0, 0, 100, false,[:rain, 9, "Rain"], [:switch, 1, true], [nil], [nil] ],
  187. :_18_30pm => [ 0, 0, 0, 100, false,[:snow, 9, "Rain"], [:switch, 1, false], [nil], [nil] ],
  188. :_19_00pm => [ 0, 0, 0, 100, false,[:none], [nil], [nil], [nil] ],
  189. :_19_30pm => [ 0, 0, 0, 100, false,[:none], [nil], [nil], [nil] ],
  190. :_20_00pm => [ 0, 0, 0, 200, true, [:mog_weather, 5, 6, "Light_02A", "Rain"], [nil], [nil], [nil] ],
  191. :_20_30pm => [ 0, 0, 0, 200, true, [:mog_weather, 1, 9, "Light_02A", "Rain"], [nil], [nil], [nil] ],
  192. :_21_00pm => [ 0, 0, 0, 200, true, [:mog_weather, 0, 6, "Rain_01A", "Rain"], [nil], [nil], [nil] ],
  193. :_21_30pm => [ 0, 0, 0, 200, true, [:mog_weather, 1, 9, "Light_02A", "Rain"], [nil], [nil], [nil] ],
  194. :_22_00pm => [ 0, 0, 0, 200, true, [:mog_weather, 0, 6, "Light_02A", "Rain"], [:switch, 1, true], [nil], [nil] ],
  195. :_22_30pm => [ 0, 0, 0, 200, true, [:mog_weather, 0, 6, "Light_02A", "Rain"], [:switch, 1, true], [nil], [nil] ],
  196. :_23_00pm => [ 0, 0, 0, 200, true, [:rain, 9, "Rain"],[nil], [nil], [nil] ],
  197. :_23_30pm => [ 0, 0, 0, 200, true, [:none],[nil], [nil], [nil] ],
  198.  
  199. }, # Do Not Delete
  200. ## SEASON END
  201.  
  202. # If you wish to add more than 1 season simply follow these instructions.
  203. # 1 - Copy from SEASON BEGIN (around line 109) upto and including..
  204. # - SEASON END(around line 163)
  205. # 2 - Paste a new "season" below SEASON END
  206. # 3 - directly under SEASON BEGIN (of the season you just pasted)
  207. # - find the line that says " :season_1 => { # Season 1 settings "
  208. # 4 - change " :season_1 " to whatever you want to call it
  209. # 5 - look below and you will find the "Months" section, simply rename
  210. # - the season in here for the months you wish to use for your new season
  211. # e.g
  212. # 1 => [:season_1],
  213. # 2 => [:season_2],
  214. # 3 => [:season_3],
  215.  
  216. } # << ALL SEASONS END
  217.  
  218. Months ={
  219. 1 => [:season_1], # January
  220. 2 => [:season_1], # Febuary
  221. 3 => [:season_1], # March
  222. 4 => [:season_1], # April
  223. 5 => [:season_1], # May
  224. 6 => [:season_1], # June
  225. 7 => [:season_1], # July
  226. 8 => [:season_1], # August
  227. 9 => [:season_1], # September
  228. 10 => [:season_1], # October
  229. 11 => [:season_1], # November
  230. 12 => [:season_1], # December
  231. }
  232.  
  233. #####################################
  234. # * YOUR OWN CUSTOM EFFECTS BELOW * #
  235. #####################################
  236.  
  237. def self.custom_time_effects(condition) # < !!
  238. case condition[0] # DO NOT DELETE THESE < !!
  239. # the condition that gets passed is the condition slot
  240. # for the current time period eg. " [:snow, 6, "Wind"] "
  241. #--------------------------------------------------------------------------
  242. # * change_weather(type, power, duration)
  243. # type = :none, :rain, :storm, :snow
  244. # power = 0 - 9 # 0 = weak | 9 = strong
  245. # duration = 0 # for instant change upon transfer
  246. #--------------------------------------------------------------------------
  247. when :none
  248. $game_map.screen.change_weather(:none, 0, 0)
  249. if $mog_rgss3_weather_ex == true
  250. $game_temp.weather_fade = false
  251. $game_system.weather.clear
  252. $game_system.weather = [-1,0,""]
  253. $game_system.weather_restore = [-1,0,""]
  254. $game_system.weather_temp = [-1,0,""]
  255. end
  256. Audio.bgs_fade(30)
  257. when :rain, :storm, :snow
  258. if $game_map.can_weather
  259. $game_map.screen.change_weather(condition[0], condition[1], 0)
  260. Audio.bgs_play("Audio/BGS/" + condition[2], 10 * condition[1], 100)
  261. else
  262. $game_map.screen.change_weather(:none, 0, 0)
  263. Audio.bgs_play("Audio/BGS/" + condition[2], 7 * condition[1], 100)
  264. end
  265. when :mog_weather # [:mog_weather, type, power, name, sound]
  266. return unless $mog_rgss3_weather_ex == true
  267. if $game_map.can_weather
  268. $game_temp.weather_fade = false
  269. if $game_system.weather != [condition[1],condition[2],condition[3]]
  270. $game_system.weather.clear
  271. end
  272. $game_system.weather = [condition[1],condition[2],condition[3]]
  273. Audio.bgs_play("Audio/BGS/" + condition[4], 10 * condition[2], 100)
  274. else
  275. $game_temp.weather_fade = false
  276. $game_system.weather.clear
  277. $game_system.weather = [-1,0,""]
  278. $game_system.weather_restore = [-1,0,""]
  279. $game_system.weather_temp = [-1,0,""]
  280. Audio.bgs_play("Audio/BGS/" + condition[4], 7 * condition[2], 100)
  281. end
  282. #--------------------------------------------------------------------------
  283. # * YOUR OWN CUSTOM EFFECTS
  284. # Here you can create you own custom effects, (with some scripting knowladge)
  285. # you can then call the effect by putting [:custom] into the condition slot
  286. # for each time period. make sure " :custom " matches the effect you want.
  287. # Above is how i set up the basic weather effects for an example.
  288. #--------------------------------------------------------------------------
  289. when :custom
  290. #---
  291. # insert code here
  292. #---
  293. when :custom_2
  294. #---
  295. # insert code here
  296. #---
  297.  
  298. #===============================================================================#
  299. ############################# CUSTOMISATION END #################################
  300. #===============================================================================#
  301. #☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★#
  302. # #
  303. # http://dekitarpg.wordpress.com/ #
  304. # #
  305. #★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆#
  306. #===============================================================================#
  307. # ARE YOU MODIFYING BEYOND THIS POINT? \.\. #
  308. # YES?\.\. #
  309. # OMG, REALLY? \| #
  310. # WELL SLAP MY FACE AND CALL ME A DITTO.\..\.. #
  311. # I REALLY DIDN'T THINK YOU HAD IT IN YOU.\..\.. #
  312. #===============================================================================#
  313.  
  314. end# << DO NOT DELETE THESE
  315. end # <<
  316.  
  317.  
  318. end
  319.  
  320. $imported = {} if $imported.nil?
  321. $imported[:Dekita_Pokémon_RealTime_Clock] = true
  322.  
  323. #===============================================================================#
  324. class RPG::Map
  325. #===============================================================================#
  326.  
  327. attr_reader :can_tint
  328. attr_reader :can_weather_effects
  329. attr_reader :has_unique_tint
  330.  
  331. def get_tint_info
  332. @can_tint = true
  333. @can_weather_effects = true
  334. @has_unique_tint = [false, nil, nil, nil, nil]
  335. self.note.split(/[\r\n]+/).each { |line|
  336. case line
  337. when /<no tint>/i
  338. @can_tint = false
  339. #---
  340. when /<no weather>/i
  341. @can_weather_effects = false
  342. #---
  343. when /<tint:(.*),(.*),(.*),(.*)>/i
  344. @has_unique_tint = [true, $1.to_i, $2.to_i, $3.to_i, $4.to_i]
  345. #---
  346. end
  347. } # self.note.split
  348. end
  349.  
  350. end
  351.  
  352. #==============================================================================
  353. class Game_Temp
  354. #==============================================================================
  355.  
  356. attr_accessor :last_used__restricted_tint_effect
  357.  
  358. alias dekitarealtimesystemgt initialize
  359. def initialize
  360. dekitarealtimesystemgt
  361. @last_used__restricted_tint_effect = [[nil],[nil],[nil],[nil]]
  362. end
  363.  
  364. end
  365.  
  366. #==============================================================================
  367. class Game_System
  368. #==============================================================================
  369. if !$imported[:Dekita__Pokémon_CORE] ; attr_accessor :night_time ; end
  370.  
  371. attr_accessor :refresh_the_map_for_tint
  372. attr_accessor :screen_tint
  373.  
  374. alias :init_de_map_tintzz :initialize
  375. def initialize
  376. init_de_map_tintzz
  377. @screen_tint = get_time_light
  378. @refresh_the_map_for_tint = false
  379. @night_time = false if !$imported[:Dekita__Pokémon_CORE]
  380. end
  381.  
  382. def get_time_sym
  383. case Time.now.hour
  384. when 0 ; sym = Time.now.min < 30 ? :_00_00am : :_00_30am
  385. when 1 ; sym = Time.now.min < 30 ? :_01_00am : :_01_30am
  386. when 2 ; sym = Time.now.min < 30 ? :_02_00am : :_02_30am
  387. when 3 ; sym = Time.now.min < 30 ? :_03_00am : :_03_30am
  388. when 4 ; sym = Time.now.min < 30 ? :_04_00am : :_04_30am
  389. when 5 ; sym = Time.now.min < 30 ? :_05_00am : :_05_30am
  390. when 6 ; sym = Time.now.min < 30 ? :_06_00am : :_06_30am
  391. when 7 ; sym = Time.now.min < 30 ? :_07_00am : :_07_30am
  392. when 8 ; sym = Time.now.min < 30 ? :_08_00am : :_08_30am
  393. when 9 ; sym = Time.now.min < 30 ? :_09_00am : :_09_30am
  394. when 10 ; sym = Time.now.min < 30 ? :_10_00am : :_10_30am
  395. when 11 ; sym = Time.now.min < 30 ? :_11_00am : :_11_30am
  396. when 12 ; sym = Time.now.min < 30 ? :_12_00pm : :_12_30pm
  397. when 13 ; sym = Time.now.min < 30 ? :_13_00pm : :_13_30pm
  398. when 14 ; sym = Time.now.min < 30 ? :_14_00pm : :_14_30pm
  399. when 15 ; sym = Time.now.min < 30 ? :_15_00pm : :_15_30pm
  400. when 16 ; sym = Time.now.min < 30 ? :_16_00pm : :_16_30pm
  401. when 17 ; sym = Time.now.min < 30 ? :_17_00pm : :_17_30pm
  402. when 18 ; sym = Time.now.min < 30 ? :_18_00pm : :_18_30pm
  403. when 19 ; sym = Time.now.min < 30 ? :_19_00pm : :_19_30pm
  404. when 20 ; sym = Time.now.min < 30 ? :_20_00pm : :_20_30pm
  405. when 21 ; sym = Time.now.min < 30 ? :_21_00pm : :_21_30pm
  406. when 22 ; sym = Time.now.min < 30 ? :_22_00pm : :_22_30pm
  407. when 23 ; sym = Time.now.min < 30 ? :_23_00pm : :_23_30pm
  408. end ; return sym
  409. end
  410.  
  411. def get_time_light
  412. sym = get_time_sym
  413. season = Dekita_RealTime_Clock::Months[Time.now.mon][0]
  414. tset = Dekita_RealTime_Clock::T_Color[season][sym]
  415. if SceneManager.scene != Scene_Map || Scene_Battle
  416. return [tset[0], tset[1], tset[2], tset[3]]
  417. elsif $game_map.has_unique_tint[0]
  418. gmt = $game_map.has_unique_tint
  419. return [gmt[1], gmt[2], gmt[3], gmt[4]]
  420. else
  421. return [tset[0], tset[1], tset[2], tset[3]]
  422. end
  423. end
  424.  
  425. def update_time_light
  426. sym = get_time_sym
  427. season = Dekita_RealTime_Clock::Months[Time.now.mon][0]
  428. tset = Dekita_RealTime_Clock::T_Color[season][sym]
  429. if tset[5] != nil ; update_unique_effects(tset[5], sym, 0) ; end
  430. if tset[6] != nil ; update_unique_effects(tset[6], sym, 1) ; end
  431. if tset[7] != nil ; update_unique_effects(tset[7], sym, 2) ; end
  432. if tset[8] != nil ; update_unique_effects(tset[8], sym, 3) ; end
  433. if SceneManager.scene != Scene_Map || Scene_Battle
  434. return [tset[0], tset[1], tset[2], tset[3]]
  435. elsif $game_map.has_unique_tint[0]
  436. gmt = $game_map.has_unique_tint
  437. return [gmt[1], gmt[2], gmt[3], gmt[4]]
  438. else
  439. return [tset[0], tset[1], tset[2], tset[3]]
  440. end
  441. end
  442.  
  443. def update_unique_effects(tset, sym, gt_id)
  444. last_effect = $game_temp.last_used__restricted_tint_effect[gt_id]
  445. case tset[0]#[0]
  446. when :switch
  447. return if last_effect == [:switch, sym]
  448. $game_temp.last_used__restricted_tint_effect[gt_id] = [:switch, sym]
  449. $game_switches[ tset[1] ] = tset[2]
  450. when :variable
  451. case tset[2]
  452. when :set
  453. return if last_effect == [:set, sym]
  454. $game_temp.last_used__restricted_tint_effect[gt_id] = [:set, sym]
  455. $game_variables[tset[1]] = tset[3]
  456. when :add
  457. return if last_effect == [:add, sym]
  458. $game_temp.last_used__restricted_tint_effect[gt_id] = [:add, sym]
  459. $game_variables[tset[1]] = ($game_variables[tset[1]]+tset[3]).to_i
  460. when :sub
  461. return if last_effect == [:sub, sym]
  462. $game_temp.last_used__restricted_tint_effect[gt_id] = [:sub, sym]
  463. $game_variables[tset[1]] = ($game_variables[tset[1]]-tset[3]).to_i
  464. when :div
  465. return if last_effect == [:div, sym]
  466. $game_temp.last_used__restricted_tint_effect[gt_id] = [:div, sym]
  467. $game_variables[tset[1]] = ($game_variables[tset[1]]/tset[3]).to_i
  468. when :mul
  469. return if last_effect == [:mul, sym]
  470. $game_temp.last_used__restricted_tint_effect[gt_id] = [:mul, sym]
  471. $game_variables[tset[1]] = ($game_variables[tset[1]]*tset[3]).to_i
  472. end
  473. when :common
  474. return if last_effect == [:common, sym]
  475. $game_temp.last_used__restricted_tint_effect[gt_id] = [:common, sym]
  476. $game_temp.reserve_common_event(tset[1])
  477. else
  478. Dekita_RealTime_Clock.custom_time_effects(tset)
  479. end
  480. end
  481.  
  482. end
  483.  
  484. #===============================================================================#
  485. class Game_Map
  486. #===============================================================================#
  487.  
  488. attr_reader :map_tintable
  489. attr_reader :can_weather
  490. attr_reader :has_unique_tint
  491.  
  492. alias mapsetupforpkmntimesys setup
  493. def setup(map_id)
  494. mapsetupforpkmntimesys(map_id)
  495. @map.get_tint_info
  496. @map_tintable = @map.can_tint
  497. @can_weather = @map.can_weather_effects
  498. @has_unique_tint = @map.has_unique_tint
  499. end
  500.  
  501. end
  502.  
  503. #===============================================================================#
  504. module Time_Tint
  505. #===============================================================================#
  506.  
  507. def self.updt
  508. $game_system.screen_tint = $game_system.update_time_light
  509. if $game_map.map_tintable == false
  510. rc = 0 ; gc = 0 ; bc = 0 ; al = 0
  511. elsif $game_map.has_unique_tint[0]
  512. rc = $game_map.has_unique_tint[1]
  513. gc = $game_map.has_unique_tint[2]
  514. bc = $game_map.has_unique_tint[3]
  515. al = $game_map.has_unique_tint[4]
  516. else
  517. rc = $game_system.screen_tint[0]
  518. gc = $game_system.screen_tint[1]
  519. bc = $game_system.screen_tint[2]
  520. al = $game_system.screen_tint[3]
  521. end
  522. if Dekita_RealTime_Clock::Using_Khas_Awesome_Lights_Script
  523. # tone = Tone.new(rc,gc,bc,al/4)
  524. $game_map.effect_surface.change_color(0,rc,gc,bc)
  525. $game_map.effect_surface.set_alpha(al)
  526. # $game_map.screen.start_tone_change(tone, 0)
  527. else
  528. tone = Tone.new(rc,gc,bc,al)
  529. $game_map.screen.start_tone_change(tone, 0)
  530. end
  531. end
  532.  
  533. end
  534.  
  535. #==============================================================================
  536. class Scene_Map < Scene_Base
  537. #==============================================================================
  538.  
  539. alias realtimestartthatshit start
  540. def start
  541. realtimestartthatshit
  542. start_de_sprttone
  543. end
  544.  
  545. def start_de_sprttone
  546. Time_Tint.updt
  547. @time_tint_min = Time.now.min#sec
  548. end
  549.  
  550. alias realtimeupdatetime update
  551. def update
  552. realtimeupdatetime
  553. update_DPBz_effects if @time_tint_min != Time.now.min#sec
  554. end
  555.  
  556. def update_DPBz_effects
  557. @time_tint_min = Time.now.min
  558. Time_Tint.updt
  559. end
  560.  
  561. end
  562.  
  563. #==============================================================================
  564. class Scene_Load < Scene_File
  565. #==============================================================================
  566.  
  567. alias ols_on_load_success on_load_success
  568. def on_load_success
  569. ols_on_load_success
  570. add_load_time_fix
  571. end
  572.  
  573. def add_load_time_fix
  574. $game_system.screen_tint = $game_system.update_time_light
  575. $game_system.refresh_the_map_for_tint = true
  576. if !Dekita_RealTime_Clock::Using_Khas_Awesome_Lights_Script
  577. end
  578.  
  579. end
  580.  
  581. end
  582.  
  583. #==============================================================================
  584. class Game_Interpreter
  585. #==============================================================================
  586.  
  587. alias com201pkmnrt_transfer_fade_ALIAS command_201
  588. def command_201
  589. return if $game_party.in_battle
  590. $game_map.screen.start_fadeout(30)
  591. if $mog_rgss3_weather_ex == true ; $game_system.weather.clear ; end
  592. com201pkmnrt_transfer_fade_ALIAS
  593. $game_system.screen_tint = $game_system.update_time_light
  594. $game_system.refresh_the_map_for_tint = true
  595. $game_map.screen.start_fadein(30)
  596. end
  597.  
  598. end
  599.  
  600. #===============================================================================#
  601. # - SCRIPT END - #
  602. #===============================================================================#
  603. # http://dekitarpg.wordpress.com/ #
  604. #===============================================================================#
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement