Advertisement
Dekita

dbug

Jan 15th, 2013
648
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 9.50 KB | None | 0 0
  1. =begin =========================================================================
  2. Dekita's v1.1
  3. ★ Débug Functions™ ★
  4.  
  5. ================================================================================
  6. Script Information:
  7. ====================
  8. This script creates some new debug functions.
  9.  
  10. ================================================================================
  11. ★☆★☆★☆★☆★☆★☆★☆★ TERMS AND CONDITIONS: ☆★☆★☆★☆★☆★☆★☆★☆★☆
  12. ================================================================================
  13. 1. You must give credit to "Dekita"
  14. 2. You are NOT allowed to repost this script.(or modified versions)
  15. 3. You are NOT allowed to convert this script.(into other game engines e.g RGSS2)
  16. 4. You are NOT allowed to use this script for Commercial games.
  17. 5. ENJOY!
  18.  
  19. "FINE PRINT"
  20. By using this script you hereby agree to the above terms and conditions,
  21. if any violation of the above terms occurs "legal action" may be taken.
  22. Not understanding the above terms and conditions does NOT mean that
  23. they do not apply to you.
  24. If you wish to discuss the terms and conditions in further detail you can
  25. contact me at http://dekitarpg.wordpress.com/ or DekitaRPG@gmail.com
  26.  
  27. ================================================================================
  28. History:
  29. =========
  30. D /M /Y
  31. 10/01/2o13 - Added More Features,
  32. 07/01/2o13 - Started && Finished,
  33.  
  34. ================================================================================
  35. INSTRUCTIONS:
  36. ==============
  37. Place this script UNDER "▼ Materials" and ABOVE "▼ Main" in your script editor.
  38.  
  39. =end #==========================================================================#
  40. module Debug_Functions
  41.  
  42. # Format of arrays :
  43. # Effect = [ key, [ array of scenes the feature can be used ] ]
  44. # e.g
  45. # S_D_Key = [ :F7 , [ Scene_Map , Scene_Battle ] ]
  46. # This means that this feature is useable by pressing F7 key while
  47. # on the map or in battle
  48.  
  49. # Possible Keys :
  50. # note : F9 usually calls the debug scene if used on the map.
  51. #:F5, :F6, :F7, :F8, :F9, :SHIFT, :CTRL, :ALT
  52. #:X = (A Key), :Y = (S Key), :Z = (D Key), :L = (Q Key), :R = (W Key)
  53.  
  54. # The Key To Press for "Instant Battle" ( if battle can be triggered )
  55. I_B_Key = [ :F5 , [ Scene_Map ] ]
  56.  
  57. # The Key To Press for "Instant Game Shutdown"
  58. S_D_Key = [ :F9 , [ Scene_Map , Scene_Battle ] ]
  59.  
  60. # Key(s) for Instant Heal(s)
  61. Heal_ALL_Key = [ :F6 , [ Scene_Map , Scene_Battle ] ]
  62.  
  63. Heal_HP_Key = [ :X , [ Scene_Map , Scene_Battle ] ]
  64.  
  65. Heal_MP_Key = [ :Y , [ Scene_Map , Scene_Battle ] ]
  66.  
  67. Fill_TP_Key = [ :Z , [ Scene_Map , Scene_Battle ] ]
  68.  
  69. # Key to make all alive party members hp = 1, mp = 0, tp = 0
  70. Hurt_Pty_Key = [ :F6 , [ Scene_Map , Scene_Battle ] ]
  71.  
  72. # Key to kill all enemies
  73. Enemy_Wipe_Key = [ :F7 ] # Only works in scene battle
  74.  
  75. # BIG NOTE :
  76. # The above only works with scenes that inherit from scene base.
  77. # Therefor it *may* not work in some custom scenes made by other scripts .
  78. # unless you put the input method into the scene update yourself ;P
  79.  
  80. # Skip Title Scene ?
  81. Skip_Title = false#true
  82.  
  83.  
  84. end #####################
  85. # CUSTOMISATION END #
  86. #####################
  87. #===============================================================================#
  88. #☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★#
  89. # #
  90. # http://dekitarpg.wordpress.com/ #
  91. # #
  92. #★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆#
  93. #===============================================================================#
  94. # ARE YOU MODIFYING BEYOND THIS POINT? \.\. #
  95. # YES?\.\. #
  96. # OMG, REALLY? \| #
  97. # WELL SLAP MY FACE AND CALL ME A DRAGONITE.\..\.. #
  98. # I REALLY DIDN'T THINK YOU HAD IT IN YOU.\..\.. #
  99. #===============================================================================#
  100.  
  101. $imported = {} if $imported.nil?
  102. $imported[:Dekita_Debug_Functions] = true
  103.  
  104. #==============================================================================
  105. module SceneManager
  106. #==============================================================================
  107.  
  108. def self.scene_is_one_of(scenes)
  109. scenes.each { |pos_scene| @scene.instance_of?(pos_scene) }
  110. end
  111.  
  112. end
  113.  
  114. #==============================================================================
  115. class Game_Player < Game_Character
  116. #==============================================================================
  117.  
  118. def encounter_by_key
  119. return if Input.press?(:CTRL)
  120. return if $game_party.encounter_none?
  121. return if in_airship?
  122. return if @move_route_forcing
  123. @encounter_count = 0
  124. end
  125.  
  126. end
  127.  
  128. #==============================================================================
  129. class Scene_Base
  130. #==============================================================================
  131.  
  132. include Debug_Functions
  133.  
  134. alias :up_fir_ib_SB :update
  135. def update
  136. up_fir_ib_SB
  137. update_dekitas_debug
  138. end
  139.  
  140. def update_dekitas_debug
  141. return unless $TEST || $BTEST
  142. shutdown_game_now if Input.trigger?(S_D_Key[0]) && SceneManager.scene_is_one_of(S_D_Key[1])
  143. instant_fight if Input.trigger?(I_B_Key[0]) && SceneManager.scene_is_one_of(I_B_Key[1])
  144. heal_everyfuckingthing if Input.trigger?(Heal_ALL_Key[0]) && SceneManager.scene_is_one_of(Heal_ALL_Key[1])
  145. heal_all_hp_dam if Input.trigger?(Heal_HP_Key[0]) && SceneManager.scene_is_one_of(Heal_HP_Key[1])
  146. heal_all_mp_dam if Input.trigger?(Heal_MP_Key[0]) && SceneManager.scene_is_one_of(Heal_MP_Key[1])
  147. fill_all_tp if Input.trigger?(Fill_TP_Key[0]) && SceneManager.scene_is_one_of(Fill_TP_Key[1])
  148. hurt_party_via_key if Input.trigger?(Hurt_Pty_Key[0]) && SceneManager.scene_is_one_of(Hurt_Pty_Key[1])
  149. kill_all_enemies if Input.trigger?(Enemy_Wipe_Key[0]) && SceneManager.scene_is?(Scene_Battle)
  150. end
  151.  
  152. def shutdown_game_now
  153. SceneManager.exit
  154. end
  155.  
  156. def instant_fight
  157. $game_player.encounter_by_key
  158. end
  159.  
  160. def heal_everyfuckingthing
  161. Sound.play_recovery
  162. $game_party.members.each {|memb| memb.recover_all}
  163. end
  164.  
  165. def hurt_party_via_key
  166. Sound.play_actor_damage
  167. $game_party.alive_members.each {|m| m.hp = 1 ; m.mp = 0 ; m.tp = 0 }
  168. end
  169.  
  170. def heal_all_hp_dam
  171. Sound.play_recovery
  172. $game_party.members.each {|memb| memb.hp = memb.mhp}
  173. end
  174.  
  175. def heal_all_mp_dam
  176. Sound.play_recovery
  177. $game_party.alive_members.each {|memb| memb.mp = memb.mmp}
  178. end
  179.  
  180. def fill_all_tp
  181. Sound.play_recovery
  182. $game_party.alive_members.each {|memb| memb.tp = memb.max_tp}
  183. end
  184.  
  185. def kill_all_enemies
  186. end
  187.  
  188. end
  189.  
  190. #===============================================================================
  191. class Scene_Title < Scene_Base
  192. #===============================================================================
  193.  
  194. if Debug_Functions::Skip_Title && $TEST
  195.  
  196. def start
  197. super
  198. SceneManager.clear
  199. Graphics.freeze
  200. instant_game
  201. end
  202.  
  203. def instant_game
  204. if DataManager.save_file_exists?
  205. index = DataManager.last_savefile_index
  206. DataManager.load_game(index)
  207. else
  208. DataManager.setup_new_game
  209. end
  210. $game_map.autoplay
  211. SceneManager.goto(Scene_Map)
  212. end
  213.  
  214. def dispose_background
  215. end
  216.  
  217. def dispose_foreground
  218. end
  219.  
  220. end
  221.  
  222. end
  223.  
  224. #==============================================================================
  225. class Scene_Battle < Scene_Base
  226. #==============================================================================
  227.  
  228. alias :heft_battle :heal_everyfuckingthing
  229. alias :hpvk_battle :hurt_party_via_key
  230. alias :hahd_battle :heal_all_hp_dam
  231. alias :hamd_battle :heal_all_mp_dam
  232. alias :fat_battle :fill_all_tp
  233. alias :kae_battle :kill_all_enemies
  234.  
  235. def heal_everyfuckingthing
  236. heft_battle
  237. @status_window.refresh
  238. end
  239.  
  240. def hurt_party_via_key
  241. hpvk_battle
  242. @status_window.refresh
  243. end
  244.  
  245. def heal_all_hp_dam
  246. hahd_battle
  247. @status_window.refresh
  248. end
  249.  
  250. def heal_all_mp_dam
  251. hamd_battle
  252. @status_window.refresh
  253. end
  254.  
  255. def fill_all_tp
  256. fat_battle
  257. @status_window.refresh
  258. end
  259.  
  260. def kill_all_enemies
  261. kae_battle
  262. $game_troop.alive_members.each {|enemy|
  263. enemy.hp = 0 ; enemy.perform_collapse_effect }
  264. BattleManager.judge_win_loss
  265. @log_window.wait
  266. @log_window.wait_for_effect
  267. end
  268.  
  269. end
  270.  
  271. #==============================================================================#
  272. # - SCRIPT END - #
  273. #==============================================================================#
  274. # http://dekitarpg.wordpress.com/ #
  275. #==============================================================================#
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement