Advertisement
Dekita

AMN v1.1

Jan 10th, 2013
248
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 26.26 KB | None | 0 0
  1. =begin =========================================================================
  2. Dekita's v1.1
  3. ★ Animatéd Map Namé™ ★
  4.  
  5. ================================================================================
  6. Script Information:
  7. ====================
  8. This script creates a highly dynamic and customisable map name "window"
  9. and gives the ability to remove the old (shit) one.
  10.  
  11. Features :~
  12. Multiple effect types,
  13. Each map can have its own unique map name display features, such as...
  14. Location, Icon, Font, Size, Effect, ect.
  15.  
  16. ================================================================================
  17. ★☆★☆★☆★☆★☆★☆★☆★ TERMS AND CONDITIONS: ☆★☆★☆★☆★☆★☆★☆★☆★☆
  18. ================================================================================
  19. 1. You must give credit to "Dekita"
  20. 2. You are NOT allowed to repost this script.(or modified versions)
  21. 3. You are NOT allowed to convert this script.(into other game engines e.g RGSS2)
  22. 4. You are NOT allowed to use this script for Commercial games.
  23. 5. ENJOY!
  24.  
  25. "FINE PRINT"
  26. By using this script you hereby agree to the above terms and conditions,
  27. if any violation of the above terms occurs "legal action" may be taken.
  28. Not understanding the above terms and conditions does NOT mean that
  29. they do not apply to you.
  30. If you wish to discuss the terms and conditions in further detail you can
  31. contact me at http://dekitarpg.wordpress.com/ or DekitaRPG@gmail.com
  32.  
  33. ================================================================================
  34. History:
  35. =========
  36. D /M /Y
  37. 09/01/2o13 - added 18 effects,
  38. 08/01/2o13 - added 8 effects,
  39. fixed bug, (typo)
  40. 06/01/2o13 - started && finished,
  41.  
  42. ================================================================================
  43. Known Bugs:
  44. ============
  45. N/A
  46.  
  47. =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  48. If a new bug is found please contact me at
  49. http://dekitarpg.wordpress.com/
  50.  
  51. ================================================================================
  52. INSTRUCTIONS:
  53. ==============
  54. Place this script UNDER "▼ Materials" and ABOVE "▼ Main" in your script editor.
  55.  
  56. ================================================================================
  57. SCRIPT CALLS:
  58. =============
  59. reset_map_name
  60. ^ Does what it says.
  61.  
  62. ================================================================================
  63. NOTETAGS: (map noteboxes)
  64. ==========
  65.  
  66. Font_Name_Tags :
  67. <FONT NAME: X>
  68. <FN: X>
  69. replace X with the Font_Name array index.
  70.  
  71. Font_Size_Tags :
  72. <FONT SIZE: X>
  73. <FS: X>
  74. replace X with the font size.
  75.  
  76. Font_Bold_Tags :
  77. <FONT BOLD: bool>
  78. <FB: bool>
  79. replace bool with true or false
  80.  
  81. Font-italic_Tags :
  82. <FONT ITALIC: bool>
  83. <FI: bool>
  84. replace bool with true or false
  85.  
  86. Font_Color_Tags :
  87. (main color tags)
  88. <FONT COLOR: red, grn, blu, alp>
  89. <FC: red, grn, blu, alp>
  90. (outline color tags)
  91. <FONT OUT COLOR: red, grn, blu, alp>
  92. <FOC: red, grn, blu, alp>
  93. red = the red value of the font
  94. grn = the green value of the font
  95. blu = the blue value of the font
  96. alp = the alpha value of the font
  97.  
  98. Icon_id_Tags :
  99. <NAME ICON: X>
  100. <ICON: X>
  101. <NI: X>
  102. replace x with the icon id from your iconset
  103.  
  104. Icon_Position_Tags :
  105. <ICON POS: x, y>
  106. <IP, x, y>
  107. x / y = the screen position.
  108.  
  109. Icon_Center_Tags :
  110. <ICON CENTER: bool_X, bool_Y>
  111. <ICEN: bool_X, bool_Y>
  112. bool_X / bool_Y should be replaced with true or false e.g <ICEN: true, false>
  113. this would center the icon's x value in the middle but not the y
  114.  
  115. Icon_Effect_Tags :
  116. <ICON EFFECT: bool>
  117. <IC: bool>
  118. bool = true or false
  119.  
  120. Map_Name_Effect_Tags :
  121. <NAME EFFECT: id>
  122. <NAME EFF: id>
  123. <NE: id>
  124. id = the effect id for this map.
  125.  
  126. <NO NAME EFFECT>
  127. <NO NAME EFF>
  128. <NO NE>
  129. makes this map have no name effect
  130.  
  131. Map_Name_Slide_Tags :
  132. <NAME SLIDE: dist>
  133. <NS DIST: dist>
  134. <NSD: dist>
  135. dist = the distance of the slide, eg. 180
  136.  
  137. Map_Name_Position_Tags :
  138. <NAME POS: x, y>
  139. <NP: x, y>
  140. x, y = the position of the map name
  141.  
  142. <NAME CENTER: bool_X, bool_Y>
  143. <NCEN: bool_X, bool_Y>
  144. bool_X / bool_Y should be replaced with true or false e.g <NCEN: true, false>
  145. this would center the name's x value in the middle but not the y
  146.  
  147. Map_Name_L_S_D_Tags :
  148. <NAME DELAY: val>
  149. <ND: val>
  150. val = the delay value from one letter showing till the next.
  151.  
  152. Single Huge Notetag :
  153. Tired of putting loads of litte '<' and '>' ? use this notetag .
  154. <MAP NAME>
  155. # -- notes go here
  156. <\MAP NAME>
  157. or
  158. <MNW>
  159. # -- notes go here
  160. <\MNW>
  161.  
  162. the notes for inside these notetags are the same as above without the '<' and '>'
  163. e.g
  164.  
  165. <MNW>
  166. FN: X
  167. FS: X
  168. FB: bool
  169. FI: bool
  170. FC: red, grn, blu, alp
  171. FOC: red, grn, blu, alp
  172. NI: X
  173. IP, x, y
  174. ICEN: bool_X, bool_Y
  175. IC: bool
  176. NE: id
  177. NO NE
  178. NSD: dist
  179. NP: x, y
  180. NCEN: bool_X, bool_Y
  181. ND: val
  182. </MNW>
  183.  
  184. =end #=========================================================================#
  185. module Map_Name_Window
  186. Font_Name=[]#Do Not Delete.
  187.  
  188. Remove_Default_Name_Window = true # obviously...
  189.  
  190. # Z value for the new map name "window"
  191. Map_Name_z = 100
  192.  
  193. # This adjusts the fonts used for your maps. If the font at the start of
  194. # the array doesn't exist on the player's computer, it'll use the next one.
  195. # the games default font will be used if a maps font name is unspecified.
  196. Font_Name[0] = ["VL Gothic" , Font.default_name]
  197. Font_Name[1] = ["Arial" , Font.default_name]
  198. Font_Name[2] = ["Xirod" , Font.default_name]
  199. Font_Name[3] = ["Comic Sans MS", Font.default_name]
  200. Font_Name[3] = ["Verdana" , Font.default_name]
  201. Font_Name[3] = ["Arial" , Font.default_name]
  202. Font_Name[3] = ["Courier" , Font.default_name]
  203.  
  204. Font_Size = 18
  205.  
  206. Font_Bold = true
  207.  
  208. Font_Italic = true
  209.  
  210. # Font_Color=[ red, grn, blu, alpha ]
  211. Font_Color = [ 255, 255, 255, 255 ]
  212. # Font outline color.
  213. Font_Out_Col=[ 0 , 0 , 0 , 128 ]
  214.  
  215. #Icon= [ use? , icon id ]
  216. Icon = [ true , 304 ] # Default iconset map icon = 231
  217.  
  218. Icon_Pos = [10, 10] # [x, y]
  219.  
  220. Icon_Has_Effects = true # Icon has the same effects as letters ?
  221.  
  222. Map_Name_Pos = [25, 5] # [x, y]
  223.  
  224. # The delay from entering the map till the name begins to show. (Frames)
  225. Delay_Timer = 30
  226.  
  227. # The delay between each letter showing, this results in a fade like effect.
  228. L_S_D_Timer = 10
  229.  
  230. Center_Name = [ false , false ]
  231.  
  232. Center_Icon = [ false , false ]
  233.  
  234. Slide_Distance = Graphics.width / 4
  235.  
  236. Letter_Effects = true
  237.  
  238. L_Effect_Type = 0
  239. # 0 = Basic Left Slide
  240. # 1 = Basic Right Slide
  241. # 2 = Top Drop Left Slide
  242. # 3 = Top Drop Right Slide
  243. # 4 = Bottoms up Left Slide
  244. # 5 = Bottoms up Right Slide
  245. # 6 = Basic Left Spin
  246. # 7 = Basic Right Spin
  247. # 8 = Basic Left Swirl Top
  248. # 9 = Basic Left Swirl Bottom
  249. # 10 = Basic Right Swirl Bottom
  250. # 11 = Basic Right Swirl Top
  251. # 12 = Slide Up
  252. # 13 = Slide Down
  253. # 14 = Slide Up & Left
  254. # 15 = Slide Up & Right
  255. # 16 = Slide Down & Left
  256. # 17 = Slide Down & Right
  257. # 18 = Slide Up & Left, Left Spin
  258. # 19 = Slide Up & Left, Right Spin
  259. # 20 = Slide Up & Right, Left Spin
  260. # 21 = Slide Up & Right, Right Spin
  261. # 22 = Slide Down & Left, Left Spin
  262. # 23 = Slide Down & Left, Right Spin
  263. # 24 = Slide Down & Right, Left Spin
  264. # 25 = Slide Down & Right, Right Spin
  265.  
  266. end # RegExp options below. only change these if you know what you are doing.
  267. module M_N_W_RegExp
  268. F_Name = /(?:FONT NAME|font name|FN|fn):[ ](\d+)/
  269. F_Size = /(?:FONT SIZE|FS):[ ](\d+)/i
  270. F_Bold = /(?:FONT BOLD|FB):[ ](.*)/i
  271. F_Ital = /(?:FONT ITALIC|FI):[ ](.*)/i
  272. F_Col_ = /(?:FONT COLOR|FC):[ ](.*),[ ](.*),[ ](.*),[ ](.*)/i
  273. F_OCol = /(?:FONT OUT COLOR|FOC):[ ](.*),[ ](.*),[ ](.*),[ ](.*)/i
  274. Icon = /(?:NAME ICON|ICON|NI):[ ](\d+)/i
  275. IPos = /(?:ICON POS|IP):[ ](\d+),[ ](\d+)/i
  276. ICent = /(?:ICON CENTER|ICEN):[ ](.*),[ ](.*)/i
  277. IEffs = /(?:ICON EFFECT|IEFF):[ ](.*)/i
  278. Eff = /(?:NAME EFFECT|NAME EFF|NE):[ ](\d+)/i
  279. NEff = /(?:NO NAME EFFECT|NO NAME EFF|NO NE)/i
  280. Slide = /(?:NAME SLIDE|NS DIST|NSD):[ ](\d+)/i
  281. Posi = /(?:NAME POS|NP):[ ](\d+),[ ](\d+)/i
  282. Pos2 = /(?:NAME CENTER|NCEN):[ ](.*),[ ](.*)/i
  283. LSD_ = /(?:NAME DELAY|ND):[ ](\d+)/i
  284. Large = /<(?:MAP NAME|MNW)>([^><]*)<\/(?:MAP NAME|MNW)>/im
  285. #####################
  286. # CUSTOMISATION END #
  287. end #####################
  288. #☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★#
  289. # #
  290. # http://dekitarpg.wordpress.com/ #
  291. # #
  292. #★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆#
  293. #===============================================================================#
  294. # ARE YOU MODIFYING BEYOND THIS POINT? \.\. #
  295. # YES?\.\. #
  296. # OMG, REALLY? \| #
  297. # WELL SLAP MY FACE AND CALL ME A DITTO.\..\.. #
  298. # I REALLY DIDN'T THINK YOU HAD IT IN YOU.\..\.. #
  299. #===============================================================================#
  300.  
  301. $imported = {} if $imported.nil?
  302. $imported[:Dekita_Anim_Map_Name] = true
  303.  
  304. #===============================================================================#
  305. class RPG::Map
  306. #===============================================================================#
  307.  
  308. attr_reader(:map_name_font_name)
  309. attr_reader(:map_name_font_size)
  310. attr_reader(:map_name_font_bold)
  311. attr_reader(:map_name_font_ital)
  312. attr_reader(:map_name_font_col_)
  313. attr_reader(:map_name_font_ocol)
  314. attr_reader(:map_name_icon)
  315. attr_reader(:map_name_icon_pos)
  316. attr_reader(:map_name_icon_pos_centered)
  317. attr_reader(:map_name_icon_gets_effects)
  318. attr_reader(:map_name_effect)
  319. attr_reader(:map_name_slide_dist)
  320. attr_reader(:map_name_letter_show_delay)
  321. attr_reader(:map_name_position)
  322. attr_reader(:map_name_position_centered)
  323.  
  324. def get_map_name_icon_info
  325. @map_name_font_name = Font.default_name
  326. @map_name_font_size = Map_Name_Window::Font_Size
  327. @map_name_font_bold = Map_Name_Window::Font_Bold
  328. @map_name_font_ital = Map_Name_Window::Font_Italic
  329. @map_name_font_col_ = Map_Name_Window::Font_Color
  330. @map_name_font_ocol = Map_Name_Window::Font_Out_Col
  331. @map_name_icon = Map_Name_Window::Icon
  332. @map_name_icon_pos = Map_Name_Window::Icon_Pos
  333. @map_name_icon_pos_centered = Map_Name_Window::Center_Icon
  334. @map_name_icon_gets_effects = Map_Name_Window::Icon_Has_Effects
  335. @map_name_effect = [Map_Name_Window::Letter_Effects,Map_Name_Window::L_Effect_Type]
  336. @map_name_slide_dist = Map_Name_Window::Slide_Distance
  337. @map_name_position = Map_Name_Window::Map_Name_Pos
  338. @map_name_position_centered = Map_Name_Window::Center_Name
  339. @map_name_letter_show_delay = Map_Name_Window::L_S_D_Timer
  340. self.note.split(/[\r\n]+/).each { |line| ; case line
  341. when /<#{M_N_W_RegExp::F_Name}>/ ; @map_name_font_name = Map_Name_Window::Font_Name[$1.to_i]
  342. when /<#{M_N_W_RegExp::F_Size}>/ ; @map_name_font_size = $1.to_i
  343. when /<#{M_N_W_RegExp::F_Bold}>/ ; @map_name_font_bold = $1.to_s
  344. when /<#{M_N_W_RegExp::F_Ital}>/ ; @map_name_font_ital = $1.to_s
  345. when /<#{M_N_W_RegExp::F_Col_}>/ ; @map_name_font_col_ = [$1.to_i,$2.to_i,$3.to_i,$4.to_i]
  346. when /<#{M_N_W_RegExp::F_OCol}>/ ; @map_name_font_ocol = [$1.to_i,$2.to_i,$3.to_i,$4.to_i,]
  347. when /<#{M_N_W_RegExp::Icon}>/ ; @map_name_icon = [true, $1.to_i]
  348. when /<#{M_N_W_RegExp::IPos}>/ ; @map_name_icon_pos = [$1.to_i, $2.to_i]
  349. when /<#{M_N_W_RegExp::ICent}>/ ; @map_name_icon_pos_centered = [$1.to_s.downcase, $2.to_s.downcase]
  350. when /<#{M_N_W_RegExp::IEffs}>/ ; @map_name_icon_gets_effects = $1.to_s.downcase
  351. when /<#{M_N_W_RegExp::Eff}>/ ; @map_name_effect = [true, $1.to_i]
  352. when /<#{M_N_W_RegExp::NEff}>/ ; @map_name_effect = [false, 0]
  353. when /<#{M_N_W_RegExp::Slide}>/ ; @map_name_slide_dist = $1.to_i
  354. when /<#{M_N_W_RegExp::Posi}>/ ; @map_name_position = [$1.to_i, $2.to_i]
  355. when /<#{M_N_W_RegExp::Pos2}>/ ; @map_name_position_centered = [$1.to_s.downcase, $2.to_s.downcase]
  356. when /<#{M_N_W_RegExp::LSD_}>/ ; @map_name_letter_show_delay = $1.to_i
  357. end ; } # self.note.split
  358. get_mni(self.note)
  359. end
  360.  
  361. def get_mni(note)
  362. note.scan(M_N_W_RegExp::Large) { setup_map_name_info($1) }
  363. end
  364.  
  365. def setup_map_name_info(info)
  366. @map_name_font_name = Map_Name_Window::Font_Name[$1.to_i] if info =~ M_N_W_RegExp::F_Name
  367. @map_name_font_size = $1.to_i if info =~ M_N_W_RegExp::F_Size
  368. @map_name_font_bold = $1.to_s.downcase if info =~ M_N_W_RegExp::F_Bold
  369. @map_name_font_ital = $1.to_s.downcase if info =~ M_N_W_RegExp::F_Ital
  370. @map_name_font_col_ = [$1.to_i,$2.to_i,$3.to_i,$4.to_i] if info =~ M_N_W_RegExp::F_Col_
  371. @map_name_font_ocol = [$1.to_i,$2.to_i,$3.to_i,$4.to_i] if info =~ M_N_W_RegExp::F_OCol
  372. @map_name_icon = [true,$1.to_i] if info =~ M_N_W_RegExp::Icon
  373. @map_name_icon_pos = [$1.to_i, $2.to_i] if info =~ M_N_W_RegExp::IPos
  374. @map_name_icon_pos_centered = [$1.to_s.downcase, $2.to_s.downcase] if info =~ M_N_W_RegExp::ICent
  375. @map_name_icon_gets_effects = $1.to_s.downcase if info =~ M_N_W_RegExp::IEffs
  376. @map_name_effect = [true,$1.to_i] if info =~ M_N_W_RegExp::Eff
  377. @map_name_effect = [false, 0] if info =~ M_N_W_RegExp::NEff
  378. @map_name_slide_dist = $1.to_i if info =~ M_N_W_RegExp::Slide
  379. @map_name_position = [$1.to_i,$2.to_i] if info =~ M_N_W_RegExp::Posi
  380. @map_name_position_centered = [$1.to_s.downcase, $2.to_s.downcase] if info =~ M_N_W_RegExp::Pos2
  381. @map_name_letter_show_delay = $1.to_i if info =~ M_N_W_RegExp::LSD_
  382. end
  383.  
  384. end
  385.  
  386. #==============================================================================
  387. class Game_Temp
  388. #==============================================================================
  389.  
  390. attr_accessor :mapname
  391.  
  392. alias :map_name_initialize_GT :initialize
  393. def initialize
  394. map_name_initialize_GT
  395. @mapname = nil
  396. end
  397.  
  398. end
  399.  
  400. #===============================================================================#
  401. class Game_Map
  402. #===============================================================================#
  403.  
  404. alias :map_nameGMsetup :setup
  405. def setup(map_id)
  406. map_nameGMsetup(map_id)
  407. @map.get_map_name_icon_info
  408. end
  409.  
  410. def map_name_icon
  411. @map.map_name_icon
  412. end
  413.  
  414. def map_name_icon_pos_x
  415. @map.map_name_icon_pos[0]
  416. end
  417.  
  418. def map_name_icon_pos_y
  419. @map.map_name_icon_pos[1]
  420. end
  421.  
  422. def map_name_icon_pos_x_center?
  423. @map.map_name_icon_pos_centered[0]
  424. end
  425.  
  426. def map_name_icon_pos_y_center?
  427. @map.map_name_icon_pos_centered[1]
  428. end
  429.  
  430. def map_name_icon_effects?
  431. @map.map_name_icon_gets_effects
  432. end
  433.  
  434. def map_name_effect
  435. @map.map_name_effect
  436. end
  437.  
  438. def map_name_slide
  439. @map.map_name_slide_dist
  440. end
  441.  
  442. def map_name_font_name
  443. @map.map_name_font_name
  444. end
  445.  
  446. def map_name_font_size
  447. @map.map_name_font_size
  448. end
  449.  
  450. def map_name_font_bold
  451. @map.map_name_font_bold
  452. end
  453.  
  454. def map_name_font_italic
  455. @map.map_name_font_ital
  456. end
  457.  
  458. def map_name_position_x
  459. @map.map_name_position[0]
  460. end
  461.  
  462. def map_name_position_y
  463. @map.map_name_position[1]
  464. end
  465.  
  466. def map_name_pos_center_x?
  467. @map.map_name_position_centered[0]
  468. end
  469.  
  470. def map_name_pos_center_y?
  471. @map.map_name_position_centered[1]
  472. end
  473.  
  474. def map_name_LSD
  475. @map.map_name_letter_show_delay
  476. end
  477.  
  478. def map_name_font_color
  479. c = @map.map_name_font_col_
  480. Color.new(c[0],c[1],c[2],c[3])
  481. end
  482.  
  483. def map_name_font_out_color
  484. c = @map.map_name_font_ocol
  485. Color.new(c[0],c[1],c[2],c[3])
  486. end
  487.  
  488. end
  489.  
  490. #==============================================================================
  491. class Game_Interpreter
  492. #==============================================================================
  493.  
  494. def reset_map_name
  495. $game_temp.mapname = nil
  496. end
  497.  
  498. end
  499.  
  500. #==============================================================================
  501. class Sprite_MapName < Sprite
  502. #==============================================================================
  503.  
  504. include Map_Name_Window
  505.  
  506. def initialize(letter, x = 0, y = 0, timer = 0, index = 0)
  507. super(nil)
  508. create_variables(timer, index)
  509. create_map_name(letter, x, y)
  510. get_letter_effects if @letter_effects[0]
  511. end
  512.  
  513. def create_variables(t, i)
  514. @open = true
  515. @slide_left = false
  516. @slide_right = false
  517. @slide_up = false
  518. @slide_down = false
  519. @timer = t
  520. @timer_val = 0
  521. @letter_index = i
  522. @angle_type = nil
  523. @letter_effects = $game_map.map_name_effect
  524. @slide_distance = $game_map.map_name_slide
  525. end
  526.  
  527. def create_map_name(letter, x, y)
  528. size = $game_map.map_name_font_size
  529. self.bitmap = Bitmap.new(size,size)
  530. self.bitmap.font.name = $game_map.map_name_font_name
  531. self.bitmap.font.size = size
  532. self.bitmap.font.bold = $game_map.map_name_font_bold
  533. self.bitmap.font.italic = $game_map.map_name_font_italic
  534. self.bitmap.font.color = $game_map.map_name_font_color
  535. self.bitmap.font.out_color = $game_map.map_name_font_out_color
  536. self.bitmap.draw_text(0, 0, size, size, letter.to_s)
  537. self.x = x
  538. self.y = y + (size / 2).to_i
  539. self.z = Map_Name_z #+ 1
  540. self.opacity = 0
  541. end
  542.  
  543. def get_letter_effects
  544. return if @icon && !$game_map.map_name_icon_effects?
  545. case @letter_effects[1]
  546. when 0 ; basic_left_slide
  547. when 1 ; basic_right_slide
  548. when 2 ; basic_left_slide ; get_angle_type(0)
  549. when 3 ; basic_right_slide ; get_angle_type(1)
  550. when 4 ; basic_left_slide ; get_angle_type(1)
  551. when 5 ; basic_right_slide ; get_angle_type(0)
  552. when 6 ; basic_left_spin ; get_angle_type(2)
  553. when 7 ; basic_right_spin ; get_angle_type(3)
  554. when 8 ; basic_right_slide ; get_angle_type(4)
  555. when 9 ; basic_left_slide ; get_angle_type(4)
  556. when 10 ; basic_right_slide ; get_angle_type(5)
  557. when 11 ; basic_left_slide ; get_angle_type(5)
  558. when 12; basic_up_slide
  559. when 13; basic_down_slide
  560. when 14; basic_up_slide ; basic_left_slide
  561. when 15; basic_up_slide ; basic_right_slide
  562. when 16; basic_down_slide ; basic_left_slide
  563. when 17; basic_down_slide ; basic_right_slide
  564. when 18; basic_up_slide ;basic_left_slide ; basic_left_spin ;get_angle_type(2)
  565. when 19; basic_up_slide ;basic_left_slide ; basic_right_spin ;get_angle_type(3)
  566. when 20; basic_up_slide ;basic_right_slide ; basic_left_spin ;get_angle_type(2)
  567. when 21; basic_up_slide ;basic_right_slide ; basic_right_spin ;get_angle_type(3)
  568. when 22; basic_down_slide ;basic_left_slide ; basic_left_spin ;get_angle_type(2)
  569. when 23; basic_down_slide ;basic_left_slide ; basic_right_spin ;get_angle_type(3)
  570. when 24; basic_down_slide ;basic_right_slide ; basic_left_spin ;get_angle_type(2)
  571. when 25; basic_down_slide ;basic_right_slide ; basic_right_spin ;get_angle_type(3)
  572. end
  573. end
  574.  
  575. def basic_left_slide
  576. @slide_left = true
  577. self.ox = -(@slide_distance).to_i
  578. end
  579.  
  580. def basic_right_slide
  581. @slide_right = true
  582. self.ox = (@slide_distance).to_i
  583. end
  584.  
  585. def basic_up_slide
  586. @slide_up = true
  587. self.oy = -(@slide_distance).to_i
  588. end
  589.  
  590. def basic_down_slide
  591. @slide_down = true
  592. self.oy = (@slide_distance).to_i
  593. end
  594.  
  595. def basic_left_spin
  596. @move_for_spin = true
  597. end
  598.  
  599. def basic_right_spin
  600. @move_for_spin = true
  601. end
  602.  
  603. def get_angle_type(angle_type)
  604. @angle_type = angle_type
  605. case angle_type
  606. when 0 ; self.angle = 50
  607. when 1 ; self.angle = -50
  608. when 2 ; self.angle = -360
  609. when 3 ; self.angle = 360
  610. when 4 ; self.angle = (50 * (@timer / (@letter_index+1)))
  611. when 5 ; self.angle = -(50 * (@timer / (@letter_index+1)))
  612. end
  613. end
  614.  
  615. def update
  616. return if self.disposed?
  617. super
  618. update_timer
  619. update_show
  620. update_slide if @open
  621. update_angle if @angle_type != nil
  622. end
  623.  
  624. def update_timer
  625. return if @timer_val >= @timer
  626. @timer_val += 1
  627. self.opacity = 1
  628. end
  629.  
  630. def update_show
  631. self.opacity += 1 if @open
  632. self.opacity -= 1 if !@open
  633. @open = false if self.opacity >= 255
  634. end
  635.  
  636. def update_slide
  637. self.ox += 1 if self.ox < 0 && @slide_left
  638. self.ox -= 1 if self.ox > 0 && @slide_right
  639. self.oy += 1 if self.oy < 0 && @slide_up
  640. self.oy -= 1 if self.oy > 0 && @slide_down
  641. end
  642.  
  643. def update_angle
  644. return if @angle_type == nil
  645. return if self.angle.between?(-0.5,0.5)
  646. case @angle_type
  647. when 0, 1 ; self.angle < 0 ? self.angle += 0.2 : self.angle -= 0.2
  648. when 2, 3 ; self.angle.between?(-5,5) ?
  649. self.angle < 0 ? self.angle += 0.5 : self.angle -= 0.5 :
  650. self.angle < 0 ? self.angle += 1.5 : self.angle -= 1.5
  651. when 4, 5 ; self.angle.between?(-10,10) ? self.angle.between?(-4,4) ?
  652. self.angle < 0 ? self.angle += 0.5 : self.angle -= 0.5 : # 2nd between
  653. self.angle < 0 ? self.angle += 1.5 : self.angle -= 1.5 : # 1st between
  654. self.angle < 0 ? self.angle += 2.5 : self.angle -= 2.5
  655. end
  656. end
  657.  
  658. def dispose
  659. super
  660. if self.bitmap != nil
  661. self.bitmap.dispose
  662. end
  663. end
  664.  
  665. end
  666.  
  667. #==============================================================================
  668. class Sprite_MapIcon < Sprite_MapName
  669. #==============================================================================
  670.  
  671. def initialize(icon, x = 0, y = 0)
  672. super(nil)
  673. self.bitmap = Cache.system("Iconset")
  674. rect = Rect.new(icon % 16 * 24, icon / 16 * 24, 24, 24)
  675. self.bitmap.blt(0, 0, self.bitmap, rect)
  676. self.src_rect.set(rect.x, rect.y, 24, 24)
  677. self.x = x
  678. self.y = y
  679. end
  680.  
  681. def update
  682. return if self.disposed?
  683. super
  684. end
  685.  
  686. def dispose
  687. super
  688. if self.bitmap != nil
  689. self.bitmap.dispose
  690. end
  691. end
  692.  
  693. end
  694.  
  695. #==============================================================================
  696. class Spriteset_Map_Name
  697. #==============================================================================
  698.  
  699. def initialize
  700. return if $game_temp.mapname == $game_map.display_name
  701. dispose
  702. create_map_name_BG
  703. create_map_name
  704. @delay_timer = 0
  705. end
  706.  
  707. def create_map_name_BG
  708. return unless $game_map.map_name_icon[0]
  709. x = $game_map.map_name_icon_pos_x
  710. y = $game_map.map_name_icon_pos_y
  711. x = (Graphics.width / 2) - (12) if $game_map.map_name_icon_pos_x_center?
  712. y = (Graphics.height / 2) - (12) if $game_map.map_name_icon_pos_y_center?
  713. icon = $game_map.map_name_icon[1]
  714. @map_icon.dispose if @map_icon != nil
  715. @map_icon = Sprite_MapIcon.new(icon, x, y)
  716. end
  717.  
  718. def create_map_name
  719. x = $game_map.map_name_position_x
  720. y = $game_map.map_name_position_y
  721. $game_temp.mapname = $game_map.display_name
  722. n = $game_map.display_name.to_s.split(//)
  723. @map_name = []
  724. timer = $game_map.map_name_LSD
  725. index = 0
  726. if $game_map.map_name_pos_center_x?
  727. fbvaal = $game_map.map_name_font_bold ? -4 : 0
  728. fbvaal -= $game_map.map_name_font_italic ? 4 : 0
  729. n_size = ($game_map.display_name.size+1) * ($game_map.map_name_font_size + fbvaal )
  730. x = (Graphics.width / 2) - (n_size / 2)
  731. end
  732. if $game_map.map_name_pos_center_y?
  733. fbvaal = $game_map.map_name_font_bold ? -4 : 0
  734. fbvaal -= $game_map.map_name_font_italic ? 4 : 0
  735. n_size = ($game_map.map_name_font_size + fbvaal )
  736. y = (Graphics.height / 2) - (n_size / 2)
  737. end
  738. for i in n
  739. @map_name.push( Sprite_MapName.new(i[0], x, y, timer, index))
  740. x += ($game_map.map_name_font_size / 4 * 3)
  741. timer += $game_map.map_name_LSD
  742. index += 1
  743. end
  744. end
  745.  
  746. def update
  747. initialize
  748. update_map_name
  749. end
  750.  
  751. def update_map_name
  752. return if @delay_timer == nil
  753. @delay_timer += 1
  754. return unless @delay_timer >= Map_Name_Window::Delay_Timer
  755. @map_icon.update if @map_icon != nil
  756. if @map_name != nil
  757. @map_name.each {|sprite|
  758. next unless sprite != nil
  759. sprite.update if !sprite.disposed?
  760. sprite.dispose if sprite != nil && !sprite.disposed? && sprite.opacity <= 0
  761. }
  762. end
  763. end
  764.  
  765. def dispose
  766. @map_icon.dispose if @map_icon != nil
  767. @map_name.each {|sprite| sprite.dispose } if @map_name != nil
  768. # @map_name.each {|sprite| sprite.dispose if sprite != nil &&
  769. # !sprite.disposed? } if @map_name != nil
  770. end
  771.  
  772. end
  773.  
  774. #==============================================================================
  775. class Spriteset_Map
  776. #==============================================================================
  777.  
  778. alias :initialize_map_name :initialize
  779. alias :dispose_map_name :dispose
  780. alias :update_map_name :update
  781.  
  782. def initialize
  783. initialize_map_name
  784. @mn = Spriteset_Map_Name.new
  785. end
  786.  
  787. def dispose
  788. dispose_map_name
  789. @mn.dispose if @mn != nil
  790. end
  791.  
  792. def update
  793. update_map_name
  794. @mn.update if @mn != nil
  795. end
  796.  
  797. end
  798.  
  799. #==============================================================================
  800. class Window_MapName < Window_Base
  801. #==============================================================================
  802.  
  803. if Map_Name_Window::Remove_Default_Name_Window
  804.  
  805. def refresh
  806. contents.clear
  807. end
  808.  
  809. end # if Map_Name_Window::Remove_Default_Name_Window
  810.  
  811. end
  812.  
  813. #==============================================================================#
  814. # - SCRIPT END - #
  815. #==============================================================================#
  816. # http://dekitarpg.wordpress.com/ #
  817. #==============================================================================#
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement