设为首页收藏本站|繁體中文

Project1

 找回密码
 注册会员
搜索

XAS 的 敌人图标显示

查看数: 2654 | 评论数: 3 | 收藏 0
关灯 | 提示:支持键盘翻页<-左 右->
    组图打开中,请稍候......
发布时间: 2012-5-20 14:31

正文摘要:

本帖最后由 ilmynasan 于 2012-5-20 08:28 编辑 现在制作的游戏用了XAS系统 准备自己做一套界面,然后想在 敌人血条那里显示敌人的图标 界面是这样的 想在用红框圈起来的地方再加一个的图标 图标的要求是 1. ...

回复

仲秋启明 发表于 2012-5-20 21:23:32
那个,提问人要以1000经验作为提问资金,然后误加到3000了
ilmynasan 发表于 2012-5-20 21:15:50


PHP 代码复制
  1. #==============================================================================#
  2.  
  3. module MOG_XAS_ENEMY_HP
  4.  
  5. # Switch ID to disable the Enemy HP meter...............................[SWITCH]
  6.   INFO_DISABLE_SWITCH_ID = 9  
  7. # Time info is displayed on-screen for............................[TIME_SECONDS]
  8.   ENEMY_INFO_FADE_TIME = 2 #(s)
  9. # Position of the Enemy HP (X,Y)............................
  10. # Position of the Boss HP number (X,Y).........................[HUD_POSITIONING]
  11.   E_NUMBER_BOSS_POS = [210,22]
  12. # Position of the Boss HP meter (X,Y)..........................[HUD_POSITIONING]
  13.   E_METER_BOSS_POS = [2,18]
  14. # Position of the Boss' name (X,Y).............................[HUD_POSITIONING]
  15.   E_NAME_BOSS_POS = [70,-10]
  16. # Speed animation
  17.   E_METER_FLOW_SPEED = 3
  18. end
  19.  
  20. #==============================================================================
  21. # ■ Game_Temp
  22. #==============================================================================
  23. class Game_Temp
  24.   attr_accessor :enemy_hp
  25.   attr_accessor :enemy_maxhp
  26.   attr_accessor :enemy_oldhp
  27.   attr_accessor :enemy_name
  28.   attr_accessor :enemy_hud_x
  29.   attr_accessor :enemy_hud_y
  30.   attr_accessor :enemy_hud_opa
  31.   attr_accessor :enemy_hud_shake
  32.   attr_accessor :enemy_info_ref
  33.   attr_accessor :enemy_refresh_old
  34.   attr_accessor :enemy_number_refresh
  35.   attr_accessor :enemy_hud_need_refresh
  36.  
  37. #--------------------------------------------------------------------------
  38. # ● Initialize
  39. #--------------------------------------------------------------------------
  40. alias enemy_hud_initialize initialize
  41. def initialize
  42.      enemy_hud_initialize  
  43.      @enemy_hp = 0
  44.      @enemy_maxhp = 1
  45.      @enemy_oldhp = 0
  46.      @enemy_name = ""
  47.      @enemy_hud_x = 0
  48.      @enemy_hud_y = 0
  49.      @enemy_hud_opa = 0
  50.      @enemy_hud_shake = 0
  51.      @enemy_refresh_old = false
  52.      @enemy_number_refresh = false
  53.      @enemy_info_ref = 0
  54.      @enemy_hud_need_refresh = false
  55.      $xas_enemy_boss_wind_x = 130
  56.      $xas_enemy_boss_wind_y = 30     
  57. end
  58.  
  59. #--------------------------------------------------------------------------
  60. # ● Enemy Hud Opa
  61. #--------------------------------------------------------------------------
  62. def enemy_hud_opa
  63.    return [[@enemy_hud_opa, 0].max,255].min   
  64. end
  65.  
  66. #--------------------------------------------------------------------------
  67. # ● Enemy Info Ref
  68. #--------------------------------------------------------------------------
  69. def enemy_info_ref
  70.     n = 40 * MOG_XAS_ENEMY_HP::ENEMY_INFO_FADE_TIME
  71.     return [[@enemy_info_ref, 0].max,n].min   
  72. end   
  73.  
  74. #--------------------------------------------------------------------------
  75. # ● Enemy Hud Shake
  76. #--------------------------------------------------------------------------
  77. def enemy_hud_shake
  78.     return [[@enemy_hud_shake, 0].max,30].min   
  79. end  
  80. end
  81.  
  82. #===============================================================================
  83. # ■ XRXS_BattlerAttachment
  84. #==============================================================================
  85. module XRXS_BattlerAttachment
  86.  
  87.   #--------------------------------------------------------------------------
  88.   # ● Action Effect Before
  89.   #--------------------------------------------------------------------------  
  90.   alias x_ehp_shoot_effect_before_damage shoot_effect_before_damage
  91.   def shoot_effect_before_damage(skill, bullet, user)
  92.       check_enemy_hp_before(skill)
  93.       x_ehp_shoot_effect_before_damage(skill, bullet, user)
  94.   end
  95.  
  96.   #--------------------------------------------------------------------------
  97.   # ● Action Effect After
  98.   #--------------------------------------------------------------------------  
  99.   alias x_ehp_shoot_effect_after_damage shoot_effect_after_damage
  100.   def shoot_effect_after_damage(skill, bullet, user)
  101.       check_enemy_hp_after(skill)
  102.       x_ehp_shoot_effect_after_damage(skill, bullet, user)
  103.   end  
  104.  
  105.   #--------------------------------------------------------------------------
  106.   # ● Check Enemy HP before
  107.   #--------------------------------------------------------------------------   
  108.   def check_enemy_hp_before(skill)
  109.       return if self.battler.is_a?(Game_Actor)
  110.       return if self.battler.no_damage_pop
  111.       return if skill.damage.to_mp?
  112.       $game_temp.enemy_oldhp = self.battler.hp
  113.       $game_temp.enemy_refresh_old = true              
  114.       $game_temp.enemy_hp = self.battler.hp
  115.       $game_temp.enemy_maxhp = self.battler.mhp
  116.       $game_temp.enemy_name = $data_enemies[self.battler.enemy_id].name   
  117.   end  
  118.  
  119.   #--------------------------------------------------------------------------
  120.   # ● Check Enemy HP After
  121.   #--------------------------------------------------------------------------   
  122.   def check_enemy_hp_after(skill)
  123.       return if self.battler.is_a?(Game_Actor)
  124.       return if self.battler.no_damage_pop
  125.       return if skill.damage.to_mp?
  126.       $game_temp.enemy_hp = self.battler.hp
  127.       $game_temp.enemy_maxhp = self.battler.mhp
  128.       $game_temp.enemy_name = $data_enemies[self.battler.enemy_id].name
  129.       $game_temp.enemy_hud_shake = 30 if self.battler.damage > 0
  130.       $game_temp.enemy_hud_need_refresh = true      
  131.   end      
  132.  
  133. end  
  134.  
  135.  
  136. #==============================================================================
  137. # ■ Game_Character
  138. #==============================================================================
  139. class Game_Character < Game_CharacterBase
  140.  
  141. #--------------------------------------------------------------------------
  142. # ● Execute States Slip Damage
  143. #--------------------------------------------------------------------------        
  144. alias x_ehp_execute_state_slip_damage execute_state_slip_damage
  145. def execute_state_slip_damage(damage)
  146.      x_ehp_execute_state_slip_damage(damage)
  147.      check_enemy_hp_slip_damage
  148. end
  149.  
  150. #--------------------------------------------------------------------------
  151. # ● Check Enemy HP Slip Damage
  152. #--------------------------------------------------------------------------         
  153. def check_enemy_hp_slip_damage
  154.      return unless $game_switches[MOG_XAS_ENEMY_HP::BOSS_INFO_SWITCH_ID]
  155.      return if self.battler.is_a?(Game_Actor)
  156.      return if self.battler.no_damage_pop   
  157.      $game_temp.enemy_hp = self.battler.hp
  158.      $game_temp.enemy_maxhp = self.battler.mhp
  159.      $game_temp.enemy_name = $data_enemies[self.battler.enemy_id].name
  160.      $game_temp.enemy_hud_shake = 30 if self.battler.damage > 0
  161.      $game_temp.enemy_hud_need_refresh = true            
  162. end  
  163. end
  164.  
  165. #==============================================================================
  166. # ■ Enemy_HP_Sprite
  167. #==============================================================================
  168. class Enemy_HP_Sprite   
  169.   include MOG_XAS_ENEMY_HP
  170.  
  171. #--------------------------------------------------------------------------
  172. # ● Initialize
  173. #--------------------------------------------------------------------------
  174. def initialize
  175.       @name = $game_temp.enemy_name
  176.       @hp = $game_temp.enemy_hp
  177.       @maxhp = $game_temp.enemy_maxhp
  178.       @hp_ref = @hp
  179.       @boss_mode = $game_switches[BOSS_INFO_SWITCH_ID]
  180.       @visible_mode = $game_switches[INFO_DISABLE_SWITCH_ID]
  181.       create_layout
  182.       create_hp_number
  183.       create_hp_meter        
  184.       create_name
  185.       hp_flow_update
  186.       e_hud_pos
  187.       e_hud_visible
  188. end
  189.  
  190. #--------------------------------------------------------------------------
  191. # ● Create Layout
  192. #--------------------------------------------------------------------------
  193. def create_layout
  194.     if @boss_mode == true
  195.         @layout_image = Cache.system("XAS_E_Layout_BOSS")
  196.         @layout_bitmap = Bitmap.new(@layout_image.width,@layout_image.height)
  197.         @layout_sprite = Sprite.new
  198.         @layout_sprite.bitmap = @layout_bitmap
  199.         @layout_src_rect_back = Rect.new(0, 0,@layout_image.width, @layout_image.height)
  200.         @layout_bitmap.blt(0,0, @layout_image, @layout_src_rect_back)      
  201.         @layout_sprite.z = 7 + MOG_XAS_ENEMY_HP::E_WINDOWS_PRIORITY_Z
  202.         @layout_sprite.x = E_HUD_POS[0] + $xas_enemy_boss_wind_x
  203.         @layout_sprite.y = E_HUD_POS[1] + $xas_enemy_boss_wind_y      
  204.         @layout_sprite.opacity = $game_temp.enemy_hud_opa           
  205.     else
  206.         @layout_image = Cache.system("XAS_E_Layout")
  207.         @layout_bitmap = Bitmap.new(@layout_image.width,@layout_image.height)
  208.         @layout_sprite = Sprite.new
  209.         @layout_sprite.bitmap = @layout_bitmap
  210.         @layout_src_rect_back = Rect.new(0, 0,@layout_image.width, @layout_image.height)
  211.         @layout_bitmap.blt(0,0, @layout_image, @layout_src_rect_back)      
  212.         @layout_sprite.z = 7 + MOG_XAS_ENEMY_HP::E_WINDOWS_PRIORITY_Z
  213.         @layout_sprite.x = E_HUD_POS[0] + E_LAYOUT_POS[0] + $game_temp.enemy_hud_x
  214.         @layout_sprite.y = E_HUD_POS[1] + E_LAYOUT_POS[1] + $game_temp.enemy_hud_y      
  215.         @layout_sprite.opacity = $game_temp.enemy_hud_opa
  216.     end  
  217. end
  218.  
  219. #--------------------------------------------------------------------------
  220. # ● Create HP Number
  221. #--------------------------------------------------------------------------
  222. def create_hp_number
  223.      @hp_number_image = Cache.system("XAS_E_HP_Number")
  224.      @hp_number_bitmap = Bitmap.new(@hp_number_image.width,@hp_number_image.height)
  225.      @hp_number_sprite = Sprite.new
  226.      @hp_number_sprite.bitmap = @hp_number_bitmap
  227.      @hp_number_sprite.z = 9 + MOG_XAS_ENEMY_HP::E_WINDOWS_PRIORITY_Z
  228.      @hp_number_sprite.x = E_HUD_POS[0] + E_NUMBER_POS[0] + $game_temp.enemy_hud_x
  229.      @hp_number_sprite.y = E_HUD_POS[1] + E_NUMBER_POS[1] + $game_temp.enemy_hud_y
  230.      @hp_number_sprite.opacity = $game_temp.enemy_hud_opa
  231.      @im_cw = @hp_number_image.width / 10
  232.      @im_ch = @hp_number_image.height
  233.      @hp_src_rect = Rect.new(@im_cw,0, @im_cw, @im_ch)
  234.      @hp_number_text = @hp.abs.to_s.split(//)
  235.      for r in [email]0..@hp_number_text.size[/email] - 1         
  236.          @hp_number_abs = @hp_number_text[r].to_i
  237.          @hp_src_rect = Rect.new(@im_cw * @hp_number_abs, 0, @im_cw, @im_ch)
  238.          @hp_number_bitmap.blt(@im_cw *  r, 0, @hp_number_image, @hp_src_rect)        
  239.      end   
  240. end
  241.  
  242. #--------------------------------------------------------------------------
  243. # ● Create HP Meter
  244. #--------------------------------------------------------------------------
  245. def create_hp_meter
  246.      @hp_flow = 0
  247.      @hp_damage_flow = 0   
  248.      if @boss_mode
  249.         @hp_image = Cache.system("XAS_E_HP_BOSS")
  250.         @hp_bitmap = Bitmap.new(@hp_image.width,@hp_image.height)
  251.         @hp_range = @hp_image.width / 3
  252.         @hp_width = @hp_range  * @hp / @maxhp
  253.         @hp_height = @hp_image.height / 2
  254.         @hp_width_old = @hp_width
  255.         @hp_src_rect = Rect.new(@hp_range, 0, @hp_width, @hp_height)
  256.         @hp_bitmap.blt(0,0, @hp_image, @hp_src_rect)
  257.         @hp_sprite = Sprite.new
  258.         @hp_sprite.bitmap = @hp_bitmap
  259.         @hp_sprite.z = 8 + MOG_XAS_ENEMY_HP::E_WINDOWS_PRIORITY_Z
  260.         @hp_sprite.x = E_METER_BOSS_POS[0] + $xas_enemy_boss_wind_x
  261.         @hp_sprite.x = E_METER_BOSS_POS[1]+ $xas_enemy_boss_wind_y
  262.         @hp_sprite.opacity = $game_temp.enemy_hud_opa      
  263.       else   
  264.         @hp_image = Cache.system("XAS_E_HP")
  265.         @hp_bitmap = Bitmap.new(@hp_image.width,@hp_image.height)
  266.         @hp_range = @hp_image.width / 3
  267.         @hp_width = @hp_range  * @hp / @maxhp
  268.         @hp_height = @hp_image.height / 2
  269.         @hp_width_old = @hp_width
  270.         @hp_src_rect = Rect.new(@hp_range, 0, @hp_width, @hp_height)
  271.         @hp_bitmap.blt(0,0, @hp_image, @hp_src_rect)
  272.         @hp_sprite = Sprite.new
  273.         @hp_sprite.bitmap = @hp_bitmap
  274.         @hp_sprite.z = 8 + MOG_XAS_ENEMY_HP::E_WINDOWS_PRIORITY_Z
  275.         @hp_sprite.x = E_HUD_POS[0] + E_METER_POS[0] + $game_temp.enemy_hud_x
  276.         @hp_sprite.y = E_HUD_POS[1] + E_METER_POS[1] + $game_temp.enemy_hud_y
  277.         @hp_sprite.opacity = $game_temp.enemy_hud_opa
  278.       end      
  279. end
  280.  
  281. #--------------------------------------------------------------------------
  282. # ● Create Name
  283. #--------------------------------------------------------------------------
  284. def create_name
  285.       @ename = Sprite.new
  286.       @ename.bitmap = Bitmap.new(160,100)
  287.       @ename.x = E_HUD_POS[0] + E_NAME_POS[0] + $game_temp.enemy_hud_x
  288.       @ename.y = E_HUD_POS[1] + E_NAME_POS[1] + $game_temp.enemy_hud_y
  289.       @ename.opacity = $game_temp.enemy_hud_opa
  290.       @ename.z = 9 + MOG_XAS_ENEMY_HP::E_WINDOWS_PRIORITY_Z
  291.       @ename.bitmap.font.size = 14
  292.       @ename.bitmap.font.bold = true
  293.       @ename.bitmap.font.italic = true
  294.       @ename.bitmap.draw_text(0, 0, 100, 32, @name,0)   
  295. end
  296.  
  297. #--------------------------------------------------------------------------
  298. # ● Dispose
  299. #--------------------------------------------------------------------------
  300.   def dispose
  301.       @hp_number_sprite.bitmap.dispose
  302.       @hp_number_sprite.dispose
  303.       @hp_number_bitmap.dispose
  304.       @hp_sprite.bitmap.dispose
  305.       @hp_sprite.dispose
  306.       @hp_bitmap.dispose
  307.       @ename.bitmap.dispose
  308.       @ename.dispose
  309.       @layout_sprite.bitmap.dispose
  310.       @layout_sprite.dispose
  311.       @layout_bitmap.dispose
  312.       @layout_image.dispose
  313.       @hp_number_image.dispose
  314.       @hp_image.dispose      
  315.   end
  316.  
  317. #--------------------------------------------------------------------------
  318. # ● E Boss Mode Check
  319. #--------------------------------------------------------------------------
  320.   def e_boss_mode_check
  321.       @boss_mode = $game_switches[MOG_XAS_ENEMY_HP::BOSS_INFO_SWITCH_ID]
  322.       dispose         
  323.       create_layout
  324.       create_hp_number
  325.       create_hp_meter        
  326.       create_name
  327.       hp_flow_update   
  328.       hp_number_refresh
  329.       e_hud_pos      
  330.       $game_temp.enemy_hud_opa = 0
  331.       $game_temp.enemy_info_ref = 0
  332.       $game_temp.enemy_hud_x = 0
  333.       $game_temp.enemy_hud_need_refresh = true
  334.   end
  335.  
  336. #--------------------------------------------------------------------------
  337. # ● Update
  338. #--------------------------------------------------------------------------
  339.   def update
  340.      e_hud_visible #if @visible_mode != $game_switches[INFO_DISABLE_SWITCH_ID]
  341.      name_refresh if @name != $game_temp.enemy_name
  342.      hp_number_refresh if $game_temp.enemy_hud_need_refresh
  343.      e_boss_mode_check if @boss_mode != $game_switches[MOG_XAS_ENEMY_HP::BOSS_INFO_SWITCH_ID]
  344.      if $game_temp.enemy_hud_opa <= 0
  345.         @layout_sprite.opacity = $game_temp.enemy_hud_opa
  346.         @ename.opacity = $game_temp.enemy_hud_opa
  347.         @hp_sprite.opacity = $game_temp.enemy_hud_opa
  348.         @hp_number_sprite.opacity = $game_temp.enemy_hud_opa         
  349.         return
  350.      end   
  351.      hp_flow_update
  352.      e_hud_pos
  353.      e_hud_slide     
  354.   end
  355.  
  356. #--------------------------------------------------------------------------
  357. # ● E Hud Visible
  358. #--------------------------------------------------------------------------
  359.   def e_hud_visible
  360.       if $game_message.visible or $game_system.hud_visible == false
  361.          visible = false
  362.       else  
  363.          visible = true
  364.       end  
  365.       @ename.visible = visible
  366.       @hp_sprite.visible = visible
  367.       @hp_number_sprite.visible = visible
  368.       @layout_sprite.visible = visible
  369.   end
  370.  
  371. #--------------------------------------------------------------------------
  372. # ● E Hud Slide
  373. #--------------------------------------------------------------------------
  374.   def e_hud_slide
  375.     $game_temp.enemy_info_ref -= 1
  376.     $game_temp.enemy_hud_shake -= 1
  377.     if $game_temp.enemy_info_ref == 0 and
  378.        $game_switches[MOG_XAS_ENEMY_HP::BOSS_INFO_SWITCH_ID] == false
  379.        $game_temp.enemy_hud_x += 1
  380.        $game_temp.enemy_hud_opa -= 10
  381.     elsif $game_temp.enemy_info_ref > 0 or
  382.        $game_switches[MOG_XAS_ENEMY_HP::BOSS_INFO_SWITCH_ID] == true
  383.        $game_temp.enemy_hud_opa += 10
  384.        $game_temp.enemy_hud_x += 1 if  $game_temp.enemy_hud_x < 0
  385.     end
  386.   end
  387.  
  388. #--------------------------------------------------------------------------
  389. # ● E Hud Pos
  390. #--------------------------------------------------------------------------
  391.   def e_hud_pos
  392.     if $game_switches[MOG_XAS_ENEMY_HP::BOSS_INFO_SWITCH_ID]   
  393.        if $game_temp.enemy_hud_shake > 0
  394.           @layout_sprite.x = E_LAYOUT_BOSS_POS[0] + $xas_enemy_boss_wind_x
  395.           @layout_sprite.y = E_LAYOUT_BOSS_POS[1] + $xas_enemy_boss_wind_y + rand(4)
  396.           @hp_sprite.x = E_METER_BOSS_POS[0] + $xas_enemy_boss_wind_x
  397.           @hp_sprite.y = E_METER_BOSS_POS[1] + $xas_enemy_boss_wind_y + rand(4)
  398.        else
  399.           @layout_sprite.x = E_LAYOUT_BOSS_POS[0] + $xas_enemy_boss_wind_x
  400.           @layout_sprite.y = E_LAYOUT_BOSS_POS[1] + $xas_enemy_boss_wind_y
  401.           @hp_sprite.x = E_METER_BOSS_POS[0] + $xas_enemy_boss_wind_x
  402.           @hp_sprite.y = E_METER_BOSS_POS[1] + $xas_enemy_boss_wind_y
  403.        end
  404.        @hp_number_sprite.x = E_NUMBER_BOSS_POS[0] + $xas_enemy_boss_wind_x
  405.        @hp_number_sprite.y = E_NUMBER_BOSS_POS[1] + $xas_enemy_boss_wind_y
  406.        @ename.x = E_NAME_BOSS_POS[0] + $xas_enemy_boss_wind_x
  407.        @ename.y = E_NAME_BOSS_POS[1] + $xas_enemy_boss_wind_y
  408.     else
  409.        @layout_sprite.x = E_HUD_POS[0] + E_LAYOUT_POS[0] + $game_temp.enemy_hud_x
  410.        @layout_sprite.y = E_HUD_POS[1] + E_LAYOUT_POS[1] + $game_temp.enemy_hud_y
  411.        @hp_number_sprite.x = E_HUD_POS[0] + E_NUMBER_POS[0] + $game_temp.enemy_hud_x
  412.        @hp_number_sprite.y = E_HUD_POS[1] + E_NUMBER_POS[1] + $game_temp.enemy_hud_y
  413.        @hp_sprite.x = E_HUD_POS[0] + E_METER_POS[0] + $game_temp.enemy_hud_x
  414.        @hp_sprite.y = E_HUD_POS[1] + E_METER_POS[1] + $game_temp.enemy_hud_y
  415.        @ename.x = E_HUD_POS[0] + E_NAME_POS[0] + $game_temp.enemy_hud_x
  416.        @ename.y = E_HUD_POS[1] + E_NAME_POS[1] + $game_temp.enemy_hud_y
  417.     end
  418.     @layout_sprite.opacity = $game_temp.enemy_hud_opa
  419.     @ename.opacity = $game_temp.enemy_hud_opa
  420.     @hp_sprite.opacity = $game_temp.enemy_hud_opa
  421.     @hp_number_sprite.opacity = $game_temp.enemy_hud_opa
  422.   end  
  423.  
  424. #--------------------------------------------------------------------------
  425. # ● Name Refresh
  426. #--------------------------------------------------------------------------
  427.   def name_refresh
  428.       @ename.bitmap.clear
  429.       @name = $game_temp.enemy_name
  430.       @ename.bitmap.draw_text(0, 0, 100, 32, @name)
  431.   end
  432.  
  433. #--------------------------------------------------------------------------
  434. # ● HP Number Refresh
  435. #--------------------------------------------------------------------------
  436.   def hp_number_refresh      
  437.       if $game_temp.enemy_hud_need_refresh
  438.          $game_temp.enemy_hud_need_refresh = false
  439.          $game_temp.enemy_hud_opa = 255
  440.       end
  441.       if $game_temp.enemy_hud_opa < 100
  442.          $game_temp.enemy_hud_x = -20
  443.       else
  444.          $game_temp.enemy_hud_x = 0
  445.       end
  446.       $game_temp.enemy_info_ref = 40 * ENEMY_INFO_FADE_TIME
  447.       @hp_number_sprite.bitmap.clear
  448.       if @hp > $game_temp.enemy_hp
  449.          $game_temp.enemy_hud_shake = 30
  450.       end
  451.       @hp = $game_temp.enemy_hp
  452.       @maxhp = $game_temp.enemy_maxhp      
  453.       @hp_number_text = @hp.abs.to_s.split(//)
  454.       for r in [email]0..@hp_number_text.size[/email] - 1         
  455.          @hp_number_abs = @hp_number_text[r].to_i
  456.          @hp_src_rect = Rect.new(@im_cw * @hp_number_abs, 0, @im_cw, @im_ch)
  457.          @hp_number_bitmap.blt(@im_cw *  r , 0, @hp_number_image, @hp_src_rect)        
  458.        end  
  459.   end   
  460.  
  461. #--------------------------------------------------------------------------
  462. # ● HP Old
  463. #--------------------------------------------------------------------------
  464.   def hp_old
  465.       @hp_width_old = @hp_range  * $game_temp.enemy_oldhp / $game_temp.enemy_maxhp
  466.       $game_temp.enemy_refresh_old = false
  467.   end
  468.  
  469. #--------------------------------------------------------------------------
  470. # ● HP Flow Update
  471. #--------------------------------------------------------------------------
  472.   def hp_flow_update
  473.       @hp_sprite.bitmap.clear
  474.       @hp_width = @hp_range  * $game_temp.enemy_hp / $game_temp.enemy_maxhp
  475.       hp_old if $game_temp.enemy_refresh_old == true
  476.       #HP Damage---------------------------------
  477.           if @hp_width_old != @hp_width
  478.              valor = (@hp_width_old - @hp_width) * 3 / 100
  479.              valor = 0.2 if valor < 1
  480.           @hp_width_old -= valor if @hp_width_old > @hp_width  
  481.             if @hp_width_old < @hp_width
  482.                @hp_width_old = @hp_width
  483.             end      
  484.           @hp_src_rect_old = Rect.new(@hp_flow, @hp_height,@hp_width_old, @hp_height)
  485.           @hp_bitmap.blt(0,0, @hp_image, @hp_src_rect_old)      
  486.           end        
  487.       #HP Real------------------------------------
  488.       @hp_src_rect = Rect.new(@hp_flow, 0,@hp_width, @hp_height)
  489.       @hp_bitmap.blt(0,0, @hp_image, @hp_src_rect)         
  490.       @hp_flow += E_METER_FLOW_SPEED
  491.       if @hp_flow >= @hp_image.width - @hp_range
  492.          @hp_flow = 0  
  493.       end
  494.     end   
  495.    
  496. end  
  497.  
  498. #==============================================================================
  499. # ■ Spriteset_Map
  500. #==============================================================================
  501. class Spriteset_Map
  502.  
  503.   #--------------------------------------------------------------------------
  504.   # ● initialize  
  505.   #--------------------------------------------------------------------------
  506.   alias xas_enemyhp_initialize initialize
  507.   def initialize  
  508.       @enemy_hp = Enemy_HP_Sprite.new
  509.       xas_enemyhp_initialize
  510.   end
  511.  
  512.   #--------------------------------------------------------------------------
  513.   # ● Dispose
  514.   #--------------------------------------------------------------------------
  515.   alias xas_enemyhp_dispose dispose
  516.   def dispose   
  517.       @enemy_hp.dispose
  518.       xas_enemyhp_dispose
  519.   end
  520.  
  521.   #--------------------------------------------------------------------------
  522.   # ● update   
  523.   #--------------------------------------------------------------------------
  524.   alias xas_enemyhp_update update
  525.   def update   
  526.       @enemy_hp.update
  527.       xas_enemyhp_update
  528.   end
  529. end   
  530.  
  531. $mog_rgss3_xas_enemy_hp = true
Luciffer 发表于 2012-5-20 19:22:40
看不见帖子内容。。。求修改。。。
拿上你的纸笔,建造一个属于你的梦想世界,加入吧。
 注册会员
找回密码

站长信箱:[email protected]|手机版|小黑屋|无图版|Project1游戏制作

GMT+8, 2024-11-23 07:44

Powered by Discuz! X3.1

© 2001-2013 Comsenz Inc.

快速回复 返回顶部 返回列表