Advertisement
Dekita

rteffz

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