Guest User

Untitled

a guest
May 22nd, 2018
84
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 7.84 KB | None | 0 0
  1. #===============================================================================
  2. # N.A.S.T.Y. EZ Select Summon
  3. # Nelderson's Awesome Scripts To You
  4. #
  5. # By: Nelderson
  6. # Last Updated: 1/13/2012
  7. # Version 1.0 - 1/13/2012
  8. #===============================================================================
  9. # Update History:
  10. # - Version 1.0 - Initial release, made for EZaxess
  11. #===============================================================================
  12. # *Notes:
  13. # - You need to fill Out the different sections for this to work.
  14. #
  15. # - At first there will be no summons availible, make sure to add some!
  16. #
  17. # Script Calls:
  18. #
  19. # - add_summon_id(id)
  20. #
  21. # Where id is the Summon ID in the SUMMONS Hash. (Left Side Number)
  22. #
  23. # - change_xy_summon_hud(x, y)
  24. #
  25. # Change the location of where the icons show up on the screen.
  26. # This also changes the Picture starting points.
  27. #===============================================================================
  28. # Credits:
  29. # -Nelderson
  30. #===============================================================================
  31.  
  32. module NEL
  33.  
  34. #Summon ID => ["Name", Icon_ID, Common Event ID, "Picture_Name"]
  35. #Pictures should be in Graphics > System Folder
  36. SUMMONS = {
  37. 0 => ["Bahamut", 20, 10,"Summ_Hud0" ],
  38. 1 => ["Bahl", 21, 11,"Summ_Hud1"],
  39. 2 => ["Bahwtwe", 22, 12, "Summ_Hud2"],
  40. 3 => ["Rryqahl", 23, 13, "Summ_Hud3"],
  41. 4 => ["BTWe", 24, 14, "Summ_Hud4"],
  42. 5 => ["HFfqw", 25, 15, "Summ_Hud5"],
  43. 6 => ["Bahl", 26, 16, "Summ_Hud6"],
  44. 7 => ["Bahl", 27, 17, "Summ_Hud7"],
  45. 8 => ["GOFUCKYOURSELF", 28, 18, "Summ_Hud8"],
  46. }
  47. #Icon_ID of the Icon that is used when actors don't have summons.
  48. NO_SUMMON_ICON = 54
  49.  
  50. #Left is 0, Right is 7 - This is where the selection starts.
  51. STARTING_INDEX = 4
  52.  
  53. #SUMMON_VAR is the variable that stores the currently active Summon ID
  54. SUMMON_VAR = 13
  55.  
  56. end
  57.  
  58. #==============================================================================
  59. # ** Window_Selectable_Summon
  60. #------------------------------------------------------------------------------
  61. # This window contains cursor movement and scroll functions.
  62. #==============================================================================
  63.  
  64. class Window_Selectable_Summon < Window_Selectable
  65. #--------------------------------------------------------------------------
  66. # * Update cursor
  67. #--------------------------------------------------------------------------
  68. def update_cursor
  69. if @index < 0 # If the cursor position is less than 0
  70. self.cursor_rect.empty # Empty cursor
  71. else # If the cursor position is 0 or more
  72. row = @index / @column_max # Get current row
  73. if row < top_row # If before the currently displayed
  74. self.top_row = row # Scroll up
  75. end
  76. if row > bottom_row # If after the currently displayed
  77. self.bottom_row = row # Scroll down
  78. end
  79. rect = item_rect(@index) # Get rectangle of selected item
  80. rect.y -= self.oy # Match rectangle to scroll position
  81. self.x = item_rect(@item_max - (@index + 1)).x
  82. self.cursor_rect = rect # Refresh cursor rectangle
  83. end
  84. end
  85. end
  86. #==============================================================================
  87. # ** Window_Summon
  88. #------------------------------------------------------------------------------
  89. # This window displays a list of usable skills on the skill screen, etc.
  90. #==============================================================================
  91.  
  92. class Window_Summon < Window_Selectable_Summon
  93. #--------------------------------------------------------------------------
  94. # * Object Initialization
  95. # x : window x-coordinate
  96. # y : window y-coordinate
  97. # width : window width
  98. # height : window height
  99. #--------------------------------------------------------------------------
  100. def initialize(x, y, width, height)
  101. super(x, y, width, height)
  102. @column_max = 9
  103. @spacing -= 24
  104. self.opacity = 0
  105. self.index = NEL::STARTING_INDEX
  106. refresh
  107. end
  108. #--------------------------------------------------------------------------
  109. # * Get Summons
  110. #--------------------------------------------------------------------------
  111. def summons
  112. return NEL::SUMMONS
  113. end
  114. #--------------------------------------------------------------------------
  115. # * Refresh
  116. #--------------------------------------------------------------------------
  117. def refresh
  118. @data = []
  119. for summon in summons
  120. @data.push(summon)
  121. end
  122. @item_max = @data.size
  123. create_contents
  124. for i in 0...@item_max
  125. draw_item(i)
  126. end
  127. end
  128. #--------------------------------------------------------------------------
  129. # * Draw Item
  130. # index : item number
  131. #--------------------------------------------------------------------------
  132. def draw_item(index)
  133. rect = item_rect(index)
  134. self.contents.clear_rect(rect)
  135. summ = summons[index]
  136. if summ != nil
  137. enabled = $game_system.summons_learned.include?(index)
  138. if enabled
  139. draw_icon(summ[1], rect.x, rect.y, true)
  140. else
  141. draw_icon(NEL::NO_SUMMON_ICON, rect.x, rect.y, true)
  142. end
  143. end
  144. end
  145. end
  146.  
  147. class Game_System
  148. attr_accessor :summons_learned
  149. attr_accessor :sumhud_x
  150. attr_accessor :sumhud_y
  151. alias nel_summo_initi initialize
  152. def initialize
  153. nel_summo_initi
  154. @summons_learned = []
  155. @sumhud_x = 110
  156. @sumhud_y = 16
  157. end
  158. end
  159.  
  160. class Game_Interpreter
  161. def add_summon_id(id)
  162. $game_system.summons_learned.push(id)
  163. end
  164.  
  165. def change_xy_summon_hud(x = 110, y = 16)
  166. $game_system.sumhud_x = x
  167. $game_system.sumhud_y = y
  168. end
  169. end
  170.  
  171. class Scene_Battle < Scene_Base
  172. #--------------------------------------------------------------------------
  173. # * Start processing
  174. #--------------------------------------------------------------------------
  175. alias nel_battl_summo_startil start
  176. def start
  177. make_and_hide_summon_pics
  178. nel_battl_summo_startil
  179. end
  180.  
  181. def make_and_hide_summon_pics
  182. @summon_pic = {}
  183. for i in 0...NEL::SUMMONS.keys.size
  184. bitmap = Cache.system(NEL::SUMMONS[i][3])
  185. @summon_pic[i] = Sprite_Base.new
  186. @summon_pic[i].bitmap = bitmap
  187. @summon_pic[i].x = $game_system.sumhud_x
  188. @summon_pic[i].y = $game_system.sumhud_y
  189. @summon_pic[i].z = 1000
  190. @summon_pic[i].visible = false
  191. end
  192. return
  193. end
  194. #--------------------------------------------------------------------------
  195. # * Post-Start processing
  196. #--------------------------------------------------------------------------
  197. alias nel_battl_summo_starting post_start
  198. def post_start
  199. nel_battl_summo_starting
  200. @summon_trig = false
  201. process_summon_scene
  202. end
  203.  
  204. def process_summon_scene
  205. x, y = $game_system.sumhud_x, $game_system.sumhud_y
  206. @nel_summ_win = Window_Summon.new(x, y, 324, 56)#(x, y, 288, 56)
  207. loop do
  208. Graphics.update
  209. Input.update
  210. update_summ_scene
  211. for pic in @summon_pic.keys.each{ |x|
  212. if @nel_summ_win.index == x
  213. @summon_pic[x].visible = true unless @summon_pic[x].disposed?
  214. else
  215. @summon_pic[x].visible = false unless @summon_pic[x].disposed?
  216. end
  217. }
  218. end
  219. break if @summon_trig == true
  220. end
  221. $game_temp.common_event_id = @summ_evid
  222. end
  223.  
  224. def update_summ_scene
  225. @nel_summ_win.update
  226. if Input.trigger?(Input::C)
  227. $game_variables[NEL::SUMMON_VAR] = @nel_summ_win.index
  228. for pic in @summon_pic.keys.each{ |x|; @summon_pic[x].dispose}; end
  229. @summ_evid = NEL::SUMMONS[@nel_summ_win.index][2]
  230. @nel_summ_win.dispose
  231. @summon_trig = true
  232. elsif Input.trigger?(Input::B)
  233. Sound.play_buzzer
  234. end
  235. end
  236. end
Add Comment
Please, Sign In to add comment