neutale

ARPG Number Popup

Jan 13th, 2021
776
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #encoding:utf-8
  2.  
  3. =begin
  4. *******************************************************************************************
  5.  
  6.    * ARPG Number Popup *
  7.  
  8.                        for RGSS3
  9.  
  10.         Ver 1.00   2013.03.31
  11.  
  12.    Author:魂(Lctseng),Bahamut Forum ID:play123
  13.    
  14.  
  15.    Please keep this label reprinted
  16.  
  17.    Home link :http://home.gamer.com.tw/homeindex.php?owner=play123
  18.  
  19.    Description:
  20.    Display number popup for ARPG,
  21.    Please check the project file for detailed examples
  22.                        
  23.  
  24.    Update log:
  25.     Ver 1.00 :
  26.     Date:2013.03.31
  27.  
  28.     I. This script modifies or redefines the following categories:                           ■ Game_System
  29.                            ■ Game_Interpreter
  30.                            ■ Scene_Map
  31.                          
  32.     II. This script newly defines the following categories and modules:
  33.                            ■ Lctseng_Arpg_Damage_Number_Store_Settings
  34.                            ■ Game_ArpgDamageNumberCollecter
  35.                            ■ Sprite_ArpgDamageNumber
  36.                            ■ Sprite_EnemyDamageNumber
  37.                            ■ Sprite_PlayerDamageNumber
  38.                            ■ Sprite_ExpNumber
  39.                            
  40.                          
  41.    III. Modules available for setting:
  42.                            ■ Lctseng_Arpg_Damage_Number_Settings
  43.                            
  44.                            
  45. *******************************************************************************************
  46.  
  47. =end
  48.  
  49.  
  50. module Lctseng_Arpg_Damage_Number_Settings
  51.   #--------------------------------------------------------------------------
  52.   # ● Number Assigned Variables
  53.   #--------------------------------------------------------------------------
  54.   Number_Assign_Variable_ID_List = [5,6]
  55.   #--------------------------------------------------------------------------
  56.   # ● Character Type Setting
  57.   #--------------------------------------------------------------------------
  58.   ## Damage Number on Enemy
  59.   Enemy_Draw_Font = Font.new
  60.   Enemy_Draw_Font.name = 'VL Gothic' #Font name
  61.   Enemy_Draw_Font.size = 24 #Font size
  62.   Enemy_Draw_Font.color = (Color.new(255,222,38,255)) #Font color (RGB, red, green, blue, opacity)
  63.   Enemy_Draw_Font.bold = true #Set bold
  64.   Enemy_Draw_Font.italic = true #Set italic
  65.   Enemy_Draw_Font.outline = true #Set outline
  66.   Enemy_Draw_Font.shadow = true #Set shadow
  67.   Enemy_Draw_Font.out_color = (Color.new(100,100,100,255)) #Outline color (RGB, red, green, blue, opacity)
  68.  
  69.   ## Damage Number on Player
  70.   Player_Draw_Font = Font.new
  71.   Player_Draw_Font.name = 'VL Gothic' #Font name
  72.   Player_Draw_Font.size = 24 #Font size
  73.   Player_Draw_Font.color = (Color.new(255,0,0,255)) #Font color (RGB, red, green, blue, opacity)
  74.   Player_Draw_Font.bold = true #Set bold
  75.   Player_Draw_Font.italic = true #Set italic
  76.   Player_Draw_Font.outline = true #Set outline
  77.   Player_Draw_Font.shadow = true #Set shadow
  78.   Player_Draw_Font.out_color = (Color.new(100,100,100,255)) #Outline color (RGB, red, green, blue, opacity)
  79.  
  80.   ## HP Recovery Number
  81.   Font_Recovery_Hp = Font.new
  82.   Font_Recovery_Hp.name = 'VL Gothic' #Font name
  83.   Font_Recovery_Hp.size = 24 #Font size
  84.   Font_Recovery_Hp.color = (Color.new(0,204,0,255)) #Font color (RGB, red, green, blue, opacity)
  85.   Font_Recovery_Hp.bold = true #Set bold
  86.   Font_Recovery_Hp.italic = true #Set italic
  87.   Font_Recovery_Hp.outline = true #Set outline
  88.   Font_Recovery_Hp.shadow = true #Set shadow
  89.   Font_Recovery_Hp.out_color = (Color.new(0,147,0,255)) #Outline color (RGB, red, green, blue, opacity)
  90.  
  91.   ## MP Recovery Number
  92.   Font_Recovery_Mp = Font.new
  93.   Font_Recovery_Mp.name = 'VL Gothic' #Font name
  94.   Font_Recovery_Mp.size = 24 #Font size
  95.   Font_Recovery_Mp.color = (Color.new(0,166,254,255)) #Font color (RGB, red, green, blue, opacity)
  96.   Font_Recovery_Mp.bold = true #Set bold
  97.   Font_Recovery_Mp.italic = true #Set italic
  98.   Font_Recovery_Mp.outline = true #Set outline
  99.   Font_Recovery_Mp.shadow = true #Set shadow
  100.   Font_Recovery_Mp.out_color = (Color.new(0,0,230,255)) #Outline color (RGB, red, green, blue, opacity)
  101.  
  102.   ## Experience Number
  103.   Font_Exp_Gain = Font.new
  104.   Font_Exp_Gain.name = 'VL Gothic' #Font name
  105.   Font_Exp_Gain.size = 24 #Font size
  106.   Font_Exp_Gain.color = (Color.new(255,174,201,255)) #Font color (RGB, red, green, blue, opacity)
  107.   Font_Exp_Gain.bold = true #Set bold
  108.   Font_Exp_Gain.italic = true #Set italic
  109.   Font_Exp_Gain.outline = true #Set outline
  110.   Font_Exp_Gain.shadow = true #Set shadow
  111.   Font_Exp_Gain.out_color = (Color.new(100,100,100,255)) #Outline color (RGB, red, green, blue, opacity)
  112.  
  113.   #--------------------------------------------------------------------------
  114.   # ● Maximum width limit
  115.   #--------------------------------------------------------------------------
  116.   Field_Width_Limit = 100
  117.  
  118.   #--------------------------------------------------------------------------
  119.   # ● Position adjustment
  120.   #--------------------------------------------------------------------------
  121.   Show_X_Adjust = 0 #X coordinate
  122.   Show_Y_Adjust = 0 #Y coordinate
  123.   Show_Z_Adjust = 0 #Z coordinate
  124.  
  125.  
  126.  
  127.  
  128. end
  129.  
  130. #*******************************************************************************************
  131. #
  132. #   請勿修改從這裡以下的程式碼,除非你知道你在做什麼!
  133. #   DO NOT MODIFY UNLESS YOU KNOW WHAT TO DO !
  134. #
  135. #*******************************************************************************************
  136.  
  137. #--------------------------------------------------------------------------
  138. # ★ 紀錄腳本資訊
  139. #--------------------------------------------------------------------------
  140. if !$lctseng_scripts  
  141.   $lctseng_scripts = {}
  142. end
  143.  
  144.  
  145. $lctseng_scripts[:arpg_damage_number] = "1.00"
  146.  
  147. puts "Loading script: Lctseng - ARPG Number Popup,version:#{$lctseng_scripts[:arpg_damage_number]}"
  148.  
  149.  
  150.  
  151.  
  152.  
  153. #==============================================================================
  154. # ■ Lctseng_Arpg_Damage_Number_Store_Settings
  155. #------------------------------------------------------------------------------
  156. #  傷害數字儲存設定
  157. #==============================================================================
  158. module Lctseng_Arpg_Damage_Number_Store_Settings
  159.   #--------------------------------------------------------------------------
  160.   # ● 傷害數字儲存物件
  161.   #--------------------------------------------------------------------------
  162.   def lctseng_arpg_damage_number_object
  163.     $game_system.arpg_damage_number_object
  164.   end
  165.  
  166.  
  167. end
  168.  
  169.  
  170. #encoding:utf-8
  171. #==============================================================================
  172. # ■ Game_System
  173. #------------------------------------------------------------------------------
  174. #  處理系統附屬數據的類。保存存檔和菜單的禁止狀態之類的數據。
  175. #   本類的實例請參考 $game_system 。
  176. #==============================================================================
  177.  
  178. class Game_System
  179.   #--------------------------------------------------------------------------
  180.   # ★ 方法重新定義
  181.   #--------------------------------------------------------------------------
  182.   unless @lctseng_for_drop_item_window_alias
  183.     alias lctseng_for_drop_item_window_Initialize initialize # 初始化對象
  184.     @lctseng_for_drop_item_window_alias = true
  185.   end
  186.   #--------------------------------------------------------------------------
  187.   # ● 定義實例變量
  188.   #--------------------------------------------------------------------------
  189.   attr_accessor :arpg_damage_number_object            #  傷害數字物件
  190.   #--------------------------------------------------------------------------
  191.   # ● 初始化對象
  192.   #--------------------------------------------------------------------------
  193.   def initialize
  194.     lctseng_for_drop_item_window_Initialize
  195.     @arpg_damage_number_object  = Game_ArpgDamageNumberCollecter.new
  196.   end
  197.   #--------------------------------------------------------------------------
  198.   # ● 重新讀取額外資訊,若不存在的話
  199.   #--------------------------------------------------------------------------
  200.   def reload_extra_data
  201.     @arpg_damage_number_object  = Game_ArpgDamageNumberCollecter.new unless @arpg_damage_number_object
  202.   end
  203. end
  204.  
  205. #==============================================================================
  206. # ■ Game_Interpreter
  207. #==============================================================================
  208.  
  209. class Game_Interpreter
  210.   #--------------------------------------------------------------------------
  211.   # ● 混入設定模組
  212.   #--------------------------------------------------------------------------
  213.   include Lctseng_Arpg_Damage_Number_Store_Settings
  214.   #--------------------------------------------------------------------------
  215.   # ● 事件顯示玩家傷害數字(以角色實例為目標)
  216.   #--------------------------------------------------------------------------
  217.   def show_arpg_damage_number_player(number,character = $game_player,type = 0)
  218.     lctseng_arpg_damage_number_object.create_player_damage_number_with_event(character,number,type)
  219.   end
  220.   #--------------------------------------------------------------------------
  221.   # ● 事件顯示敵人傷害數字(以角色實例為目標)
  222.   #--------------------------------------------------------------------------
  223.   def show_arpg_damage_number_enemy(number,character = $game_player,type = 0)
  224.     lctseng_arpg_damage_number_object.create_enemy_damage_number_with_event(character,number,type)
  225.   end
  226.   #--------------------------------------------------------------------------
  227.   # ● 事件顯示恢復HP數字(以角色實例為目標)
  228.   #--------------------------------------------------------------------------
  229.   def show_arpg_recover_hp_number(number,character = $game_player)
  230.     lctseng_arpg_damage_number_object.create_player_damage_number_with_event(character,number*-1,0)
  231.   end
  232.   #--------------------------------------------------------------------------
  233.   # ● 事件顯示恢復MP數字(以角色實例為目標)
  234.   #--------------------------------------------------------------------------
  235.   def show_arpg_recover_mp_number(number,character = $game_player)
  236.     lctseng_arpg_damage_number_object.create_player_damage_number_with_event(character,number*-1,1)
  237.   end
  238.   #--------------------------------------------------------------------------
  239.   # ● 事件顯示增加EXP數字(以角色實例為目標)
  240.   #--------------------------------------------------------------------------
  241.   def show_arpg_gain_exp_number(number,character = $game_player)
  242.     lctseng_arpg_damage_number_object.create_player_exp_number_with_character(character,number)
  243.   end
  244.  
  245.   #--------------------------------------------------------------------------
  246.   # ● 事件顯示玩家傷害數字(以角色ID為目標)
  247.   #--------------------------------------------------------------------------
  248.   def show_player_damage(number,character_id = -1,type = 0)
  249.     character = get_character(character_id)
  250.     number = adjust_number(number)
  251.     if character
  252.       if number < 0
  253.         lctseng_arpg_damage_number_object.create_player_damage_number_with_event(character,1,2)
  254.       else
  255.         lctseng_arpg_damage_number_object.create_player_damage_number_with_event(character,number,type)
  256.       end
  257.  
  258.     end
  259.   end
  260.   #--------------------------------------------------------------------------
  261.   # ● 事件顯示敵人傷害數字(以角色ID為目標)
  262.   #--------------------------------------------------------------------------
  263.   def show_enemy_damage(number,character_id = -1,type = 0)
  264.     character = get_character(character_id)
  265.     number = adjust_number(number)
  266.     if character
  267.       if number < 0
  268.         lctseng_arpg_damage_number_object.create_enemy_damage_number_with_event(character,1,2)
  269.       else
  270.         lctseng_arpg_damage_number_object.create_enemy_damage_number_with_event(character,number,type)
  271.       end
  272.     end
  273.   end
  274.   #--------------------------------------------------------------------------
  275.   # ● 事件顯示恢復HP數字(以角色ID為目標)
  276.   #--------------------------------------------------------------------------
  277.   def show_hp(number,character_id = -1)
  278.     character = get_character(character_id)
  279.     if character
  280.       lctseng_arpg_damage_number_object.create_player_damage_number_with_event(character,number*-1,0)
  281.     end
  282.   end
  283.   #--------------------------------------------------------------------------
  284.   # ● 事件顯示恢復MP數字(以角色ID為目標)
  285.   #--------------------------------------------------------------------------
  286.   def show_mp(number,character_id = -1)
  287.     character = get_character(character_id)
  288.     if character
  289.       lctseng_arpg_damage_number_object.create_player_damage_number_with_event(character,number*-1,1)
  290.     end
  291.   end
  292.   #--------------------------------------------------------------------------
  293.   # ● 事件顯示增加EXP數字(以角色ID為目標)
  294.   #--------------------------------------------------------------------------
  295.   def show_exp(number,character_id = -1)
  296.     character = get_character(character_id)
  297.     if character
  298.       lctseng_arpg_damage_number_object.create_player_exp_number_with_character(character,number)
  299.     end
  300.   end
  301.   #--------------------------------------------------------------------------
  302.   # ● 利用全域變數調整數值
  303.   #--------------------------------------------------------------------------
  304.   def adjust_number(ori_value)
  305.     Lctseng_Arpg_Damage_Number_Settings::Number_Assign_Variable_ID_List.each do |var_id|
  306.       if $game_variables[var_id] != 0
  307.         value = $game_variables[var_id]
  308.         $game_variables[var_id] = 0
  309.         return value
  310.       end
  311.     end
  312.     return ori_value
  313.   end
  314.   #
  315.  
  316. end##end class
  317.  
  318.  
  319. #encoding:utf-8
  320. #==============================================================================
  321. # ■Game_ArpgDamageNumberCollecter
  322. #==============================================================================
  323.  
  324. class Game_ArpgDamageNumberCollecter
  325.   #--------------------------------------------------------------------------
  326.   # ● 初始化對象
  327.   #--------------------------------------------------------------------------
  328.   def initialize
  329.     @damage_sprites = []
  330.   end
  331.   #--------------------------------------------------------------------------
  332.   # ● 儲存實例,重定義使得Marshal 寫入時不會將精靈寫入檔案
  333.   #--------------------------------------------------------------------------
  334.   def marshal_dump
  335.     []
  336.   end
  337.   #--------------------------------------------------------------------------
  338.   # ● 讀取實例
  339.   #--------------------------------------------------------------------------
  340.   def marshal_load(obj)
  341.     @damage_sprites = []
  342.   end
  343.   #--------------------------------------------------------------------------
  344.   # ● 更新
  345.   #--------------------------------------------------------------------------
  346.   def update
  347.     update_all_sprites
  348.   end
  349.   #--------------------------------------------------------------------------
  350.   # ● 更新所有精靈
  351.   #--------------------------------------------------------------------------
  352.   def update_all_sprites
  353.     @damage_sprites.each_with_index do|sprite,index|
  354.       if !sprite || sprite.disposed?
  355.         @damage_sprites.delete_at(index)
  356.       else
  357.         sprite.update
  358.       end
  359.     end
  360.   end
  361.   #--------------------------------------------------------------------------
  362.   # ● 產生敵方傷害數字精靈 - 指定敵方角色(number: 傷害數值參數,type:傷害類型 )
  363.   #--------------------------------------------------------------------------
  364.   def create_enemy_damage_number_with_event(event,number,type)
  365.     create_enemy_damage_number_with_xy(event.x,event.y,number,type)
  366.   end
  367.   #--------------------------------------------------------------------------
  368.   # ● 產生敵方傷害數字精靈 - 指定地圖座標(number: 傷害數值參數,type:傷害類型 )
  369.   #--------------------------------------------------------------------------
  370.   def create_enemy_damage_number_with_xy(x,y,number,type)
  371.     @damage_sprites.push(Sprite_EnemyDamageNumber.new(x,y,number,type))
  372.   end
  373.   #--------------------------------------------------------------------------
  374.   # ● 產生我方傷害數字精靈 - 指定我方角色(number: 傷害數值參數,type:傷害類型 )
  375.   #--------------------------------------------------------------------------
  376.   def create_player_damage_number_with_event(character,number,type)
  377.     create_player_damage_number_with_xy(character.x,character.y,number,type)
  378.   end
  379.   #--------------------------------------------------------------------------
  380.   # ● 產生我方傷害數字精靈 - 指定地圖座標(number: 傷害數值參數,type:傷害類型 )
  381.   #--------------------------------------------------------------------------
  382.   def create_player_damage_number_with_xy(x,y,number,type)
  383.     @damage_sprites.push(Sprite_PlayerDamageNumber.new(x,y,number,type))
  384.   end
  385.   #--------------------------------------------------------------------------
  386.   # ● 產生我方經驗值數字精靈 - 指定我方角色(number: 經驗值參數 )
  387.   #--------------------------------------------------------------------------
  388.   def create_player_exp_number_with_character(character,number)
  389.     create_player_exp_number_with_xy(character.x,character.y,number)
  390.   end
  391.   #--------------------------------------------------------------------------
  392.   # ● 產生我方經驗值數字精靈 - 指定地圖座標(number: 經驗值參數 )
  393.   #--------------------------------------------------------------------------
  394.   def create_player_exp_number_with_xy(x,y,number)
  395.     @damage_sprites.push(Sprite_ExpNumber.new(x,y,number))
  396.   end
  397.   #--------------------------------------------------------------------------
  398.   # ● 強制釋放所有精靈
  399.   #--------------------------------------------------------------------------
  400.   def dispose_all
  401.     @damage_sprites.compact.each {|sprite| sprite.dispose }
  402.   end
  403.  
  404.  
  405. end
  406.  
  407. #encoding:utf-8
  408. #==============================================================================
  409. # ■ Sprite_ArpgDamageNumber
  410. #==============================================================================
  411.  
  412. class Sprite_ArpgDamageNumber < Sprite
  413.   #--------------------------------------------------------------------------
  414.   # ● 混入設定模組
  415.   #--------------------------------------------------------------------------
  416.   include Lctseng_Arpg_Damage_Number_Settings
  417.   #--------------------------------------------------------------------------
  418.   # ● 初始化對象 event :  Game_Event
  419.   #             type特殊意涵:0:正常
  420.   #                                      1:暴擊
  421.   #                                      2:迴避
  422.   #                                      3:格擋
  423.   #--------------------------------------------------------------------------
  424.   def initialize(x,y,number,type = 0,viewport = nil)
  425.     super(viewport)
  426.     @type = type
  427.     @font = get_normal_font
  428.     @sub_string = ''
  429.     @wide_reserve = 0
  430.     @flow_y = 0.0
  431.     @main_string =  convert_to_string(number)
  432.     @main_width = @main_string.size*@font.size * 0.75
  433.     if @main_width > Field_Width_Limit
  434.       @main_width = Field_Width_Limit
  435.     end
  436.     self.visible = false
  437.     @fix_x = x
  438.     @fix_y = y
  439.     @flow_count = 60
  440.     create_bitmap
  441.     @total_x_adjust  = ( self.bitmap.width - @wide_reserve ) / -2  - @wide_reserve  +  Show_X_Adjust + rand(10) - 5
  442.     @total_y_adjust =  rand(10) - 5
  443.   end
  444.   #--------------------------------------------------------------------------
  445.   # ● 轉換為字串
  446.   #--------------------------------------------------------------------------
  447.   def convert_to_string(number)
  448.     if number < 0
  449.       convert_to_string_recovery(number)
  450.     else
  451.       convert_to_string_damage(number)
  452.     end
  453.    
  454.   end
  455.   #--------------------------------------------------------------------------
  456.   # ● 轉換為字串 - 處理恢復 0:回HP、1:回MP
  457.   #--------------------------------------------------------------------------
  458.   def convert_to_string_recovery(number)
  459.     number = number.abs
  460.     case @type
  461.     when 0
  462.       @font = Font_Recovery_Hp
  463.       @flow_y -= @font.size
  464.     when 1
  465.       @font = Font_Recovery_Mp
  466.     end
  467.     number.to_s
  468.   end
  469.   #--------------------------------------------------------------------------
  470.   # ● 轉換為字串 - 處理傷害
  471.   #--------------------------------------------------------------------------
  472.   def convert_to_string_damage(number)
  473.     case @type
  474.     when 0
  475.       @font = get_normal_font
  476.       number.to_s
  477.     when 1
  478.       @font = get_critical_font
  479.       @sub_string = ''#"Critical"
  480.       @wide_reserve = @font.size * @sub_string.size
  481.       number.to_s
  482.     when 2
  483.       @font = get_miss_font
  484.       return "Miss"
  485.     when 3
  486.       @font = get_block_font
  487.       return "Blocked"
  488.     end  
  489.   end
  490.   #--------------------------------------------------------------------------
  491.   # ● 釋放
  492.   #--------------------------------------------------------------------------
  493.   def dispose
  494.     self.bitmap.dispose
  495.     super
  496.   end
  497.   #--------------------------------------------------------------------------
  498.   # ● 取得普通字型物件
  499.   #--------------------------------------------------------------------------
  500.   def get_normal_font
  501.     return @font if @font
  502.   end
  503.   #--------------------------------------------------------------------------
  504.   # ● 取得暴擊字型物件
  505.   #--------------------------------------------------------------------------
  506.   def get_critical_font
  507.     font = get_normal_font.clone
  508.     font.color = Color.new(255,104,32)
  509.     font.out_color = Color.new(155,0,0)
  510.     font
  511.   end
  512.   #--------------------------------------------------------------------------
  513.   # ● 取得迴避字型物件
  514.   #--------------------------------------------------------------------------
  515.   def get_miss_font
  516.     font = get_normal_font.clone
  517.     font.color = Color.new(255,255,255)
  518.     font
  519.   end
  520.   #--------------------------------------------------------------------------
  521.   # ● 取得格擋字型物件
  522.   #--------------------------------------------------------------------------
  523.   def get_block_font
  524.     font = get_normal_font.clone
  525.     font.color = Color.new(0,255,255)
  526.     font
  527.   end
  528.   #--------------------------------------------------------------------------
  529.   # ● 生成位圖
  530.   #--------------------------------------------------------------------------
  531.   def create_bitmap
  532.     self.bitmap = Bitmap.new(@wide_reserve+@main_width,@font.size)
  533.     self.bitmap.font = @font
  534.     main_rect = self.bitmap.rect.clone
  535.     main_rect.x += @wide_reserve
  536.     main_rect.width  -= @wide_reserve
  537.     sub_rect = self.bitmap.rect.clone
  538.     #sub_rect.x = @wide_reserve
  539.     sub_rect.width = @wide_reserve
  540.     self.bitmap.draw_text(sub_rect,@sub_string, 0)
  541.     self.bitmap.draw_text(main_rect,@main_string, 1)
  542.    
  543.   end
  544.   #--------------------------------------------------------------------------
  545.   # ● 更新畫面
  546.   #--------------------------------------------------------------------------
  547.   def update
  548.     super
  549.     update_visibility
  550.     update_position
  551.     update_fadeout
  552.    
  553.    
  554.   end
  555.   #--------------------------------------------------------------------------
  556.   # ● 更新檢查並重繪
  557.   #--------------------------------------------------------------------------
  558.   def update_fadeout
  559.     if @flow_count > 0
  560.       @flow_y -= 0.5
  561.       @flow_count -= 1
  562.     else
  563.       dispose
  564.     end
  565.   end
  566.   #--------------------------------------------------------------------------
  567.   # ● 更新位置
  568.   #--------------------------------------------------------------------------
  569.   def update_position
  570.     self.x = screen_x  + @total_x_adjust
  571.     self.y = screen_y- 30 + Show_Y_Adjust + @flow_y + @total_y_adjust
  572.     self.z = 200 + Show_Z_Adjust
  573.   end
  574.   #--------------------------------------------------------------------------
  575.   # ● 更新可視狀態
  576.   #--------------------------------------------------------------------------
  577.   def update_visibility
  578.     self.visible = true
  579.   end
  580.   #--------------------------------------------------------------------------
  581.   # ● 獲取畫面 X 坐標
  582.   #--------------------------------------------------------------------------
  583.   def screen_x
  584.     $game_map.adjust_x(@fix_x) * 32 + 16
  585.   end
  586.   #--------------------------------------------------------------------------
  587.   # ● 獲取畫面 Y 坐標
  588.   #--------------------------------------------------------------------------
  589.   def screen_y
  590.     $game_map.adjust_y(@fix_y) * 32
  591.   end
  592.  
  593. end
  594.  
  595. #encoding:utf-8
  596. #==============================================================================
  597. # ■ Sprite_EnemyDamageNumber
  598. #==============================================================================
  599.  
  600. class Sprite_EnemyDamageNumber < Sprite_ArpgDamageNumber
  601.   #--------------------------------------------------------------------------
  602.   # ● 取得普通字型物件
  603.   #--------------------------------------------------------------------------
  604.   def get_normal_font
  605.     super
  606.     Enemy_Draw_Font
  607.   end
  608. end
  609.  
  610.  
  611. #encoding:utf-8
  612. #==============================================================================
  613. # ■ Sprite_PlayerDamageNumber
  614. #==============================================================================
  615.  
  616. class Sprite_PlayerDamageNumber < Sprite_ArpgDamageNumber
  617.   #--------------------------------------------------------------------------
  618.   # ● 取得普通字型物件
  619.   #--------------------------------------------------------------------------
  620.   def get_normal_font
  621.     super
  622.     Player_Draw_Font
  623.   end
  624. end
  625.  
  626.  
  627. #encoding:utf-8
  628. #==============================================================================
  629. # ■ Sprite_ExpNumber
  630. #==============================================================================
  631.  
  632. class Sprite_ExpNumber < Sprite_ArpgDamageNumber
  633.   #--------------------------------------------------------------------------
  634.   # ● 取得普通字型物件
  635.   #--------------------------------------------------------------------------
  636.   def get_normal_font
  637.     super
  638.     Font_Exp_Gain
  639.   end
  640.   #--------------------------------------------------------------------------
  641.   # ● 轉換為字串 - 處理傷害
  642.   #--------------------------------------------------------------------------
  643.   def convert_to_string_damage(number)
  644.     @sub_string = "Exp"
  645.     @wide_reserve = (@font.size * @sub_string.size * 0.5).round
  646.     sprintf("%+d",number)
  647.   end
  648. end
  649.  
  650. #==============================================================================
  651. # ■ Scene_Map
  652. #==============================================================================
  653.  
  654. class Scene_Map < Scene_Base
  655.   #--------------------------------------------------------------------------
  656.   # ● 混入設定模組
  657.   #--------------------------------------------------------------------------
  658.   include Lctseng_Arpg_Damage_Number_Store_Settings
  659.   #--------------------------------------------------------------------------
  660.   # ● 方法重新定義別名
  661.   #--------------------------------------------------------------------------
  662.   unless @lctsneg_for_arpg_alias
  663.     alias lctseng_for_arpg_Update_for_fade update_for_fade
  664.     alias lctseng_for_aprg_Update update
  665.     alias lctseng_for_arpg_Terminate terminate
  666.     @lctsneg_for_arpg_alias = true
  667.   end
  668.   #--------------------------------------------------------------------------
  669.   # ● 更新畫面(消退用) - 重新定義
  670.   #--------------------------------------------------------------------------
  671.   def update_for_fade
  672.     lctseng_for_arpg_Update_for_fade
  673.     update_arpg_damage_number
  674.   end
  675.   #--------------------------------------------------------------------------
  676.   # ● 更新傷害數字收集物件
  677.   #--------------------------------------------------------------------------
  678.   def update_arpg_damage_number
  679.     lctseng_arpg_damage_number_object.update
  680.   end ##end def  
  681.   #--------------------------------------------------------------------------
  682.   # ● 結束處理 - 重新定義
  683.   #--------------------------------------------------------------------------
  684.   def terminate
  685.     dispose_damage_number_object
  686.     lctseng_for_arpg_Terminate
  687.   end
  688.   #--------------------------------------------------------------------------
  689.   # ● 釋放傷害數字物件精靈組
  690.   #--------------------------------------------------------------------------
  691.   def dispose_damage_number_object
  692.     lctseng_arpg_damage_number_object.dispose_all
  693.   end
  694.   #--------------------------------------------------------------------------
  695.   # ● 更新畫面-ARPG重新定義
  696.   #--------------------------------------------------------------------------
  697.   def update
  698.     lctseng_for_aprg_Update #執行原來的更新方法
  699.     update_arpg_damage_number    
  700.   end
  701.  
  702.  
  703. end ##end class
RAW Paste Data