查看: 6078|回复: 10

[RMVA发布] EAS半事件ARPG战斗系统发布,完美支持空连

[复制链接]
梦石
0
星屑
49
在线时间
491 小时
注册时间
2012-1-27
回帖
399

整合系统大赛RMVA达人

发表于 2013-8-31 21:58:56 | 显示全部楼层 |阅读模式

加入我们,或者,欢迎回来。

您需要 登录 才可以下载或查看,没有账号?注册会员

×
本帖最后由 狱冥幻翼 于 2013-9-1 19:26 编辑

从放暑假开始做的,断断续续做了两个月,前几天看到论坛提问区有人想做arpg就发出来分享下,支持空连,暂不支持空斩,空斩的方法已经有了,不过太麻烦,以后会更新的,具体用法见范例
普攻可以连3次,第3次有上挑效果,绝对不卡!!
有bug请直接回复或加我q760055313
范例下载地址pan.baidu.com/share/link?shareid=1353404674&uk=4010369150
3.png
QQ截图20130831212637.png
QQ截图20130831212644.png
2.png
1.png
QQ截图20130831212659.png
代码
  1. #==============================================================================
  2. # 本脚本来自[url]www.66RPG.com[/url],使用和转载请保留此信息
  3. #==============================================================================
  4. #============================================================================
  5. # ■ events action system
  6. #----------------------------------------------------------------------------
  7. #   By: 狱冥幻翼
  8. #   Date: 31/08/13
  9. #   Version 1.0
  10. #============================================================================
  11. #============================================================================
  12. #   使用到的脚本
  13. #   全键盘脚本  By: Cybersam
  14. #   MOG_Damage_Popup,MOG_Hud  By: Moghunter  
  15. #============================================================================
  16. #============================================================================
  17. #此系统使用了100-126号开关,100-120号变量,41-55号公共事件,460-508号动画
  18. #添加技能请修改第197-239行
  19. #============================================================================
  20. #============================================================================
  21. #  全键盘脚本用法
  22. # ★、Kboard.keyboard(键位)  返回是否按下这个键的判断。
  23. #     比如条件分歧:Kboard.keyboard($R_Key_H)
  24. #                   则当按下键盘H键的时候条件分歧成立
  25. #
  26. # ★、Kboard.keyb(键位) == 1 当连续按住某键返回真,否则为false
  27. #     比如条件分歧:Kboard.keyb($R_Key_U) == 1
  28. #                   则当持续按下键盘U的时候条件分歧成立
  29. #
  30. # ★、Kboard.key(键位,1) 似乎可以做开关用。按下一次变为true,再按变false
  31. module Kboard
  32.   #==========================================================================
  33.   # 以下是全键盘按键列表
  34.   #--------------------------------------------------------------------------
  35.   $Rmouse_BUTTON_L = 0x01        # left mouse button
  36.   $Rmouse_BUTTON_R = 0x02        # right mouse button
  37.   $Rmouse_BUTTON_M = 0x04        # middle mouse button
  38.   $Rmouse_BUTTON_4 = 0x05        # 4th mouse button
  39.   $Rmouse_BUTTON_5 = 0x06        # 5th mouse button
  40.   #--------------------------------------------------------------------------
  41.   $R_Key_BACK      = 0x08        # BACKSPACE key
  42.   $R_Key_TAB       = 0x09        # TAB key
  43.   $R_Key_RETURN    = 0x0D        # ENTER key
  44.   $R_Key_SHIFT     = 0x10        # SHIFT key
  45.   $R_Key_CTLR      = 0x11        # CTLR key
  46.   $R_Key_ALT       = 0x12        # ALT key
  47.   $R_Key_PAUSE     = 0x13        # PAUSE key
  48.   $R_Key_CAPITAL   = 0x14        # CAPS LOCK key
  49.   $R_Key_ESCAPE    = 0x1B        # ESC key
  50.   $R_Key_SPACE     = 0x20        # SPACEBAR
  51.   $R_Key_PRIOR     = 0x21        # PAGE UP key
  52.   $R_Key_NEXT      = 0x22        # PAGE DOWN key
  53.   $R_Key_END       = 0x23        # END key
  54.   $R_Key_HOME      = 0x24        # HOME key
  55.   $R_Key_LEFT      = 0x25        # LEFT ARROW key
  56.   $R_Key_UP        = 0x26        # UP ARROW key
  57.   $R_Key_RIGHT     = 0x27        # RIGHT ARROW key
  58.   $R_Key_DOWN      = 0x28        # DOWN ARROW key
  59.   $R_Key_SELECT    = 0x29        # SELECT key
  60.   $R_Key_PRINT     = 0x2A        # PRINT key
  61.   $R_Key_SNAPSHOT  = 0x2C        # PRINT SCREEN key
  62.   $R_Key_INSERT    = 0x2D        # INS key
  63.   $R_Key_DELETE    = 0x2E        # DEL key
  64.   #--------------------------------------------------------------------------
  65.   $R_Key_0         = 0x30        # 0 key
  66.   $R_Key_1         = 0x31        # 1 key
  67.   $R_Key_2         = 0x32        # 2 key
  68.   $R_Key_3         = 0x33        # 3 key
  69.   $R_Key_4         = 0x34        # 4 key
  70.   $R_Key_5         = 0x35        # 5 key
  71.   $R_Key_6         = 0x36        # 6 key
  72.   $R_Key_7         = 0x37        # 7 key
  73.   $R_Key_8         = 0x38        # 8 key
  74.   $R_Key_9         = 0x39        # 9 key
  75.   #--------------------------------------------------------------------------
  76.   $R_Key_A         = 0x41        # A key
  77.   $R_Key_B         = 0x42        # B key
  78.   $R_Key_C         = 0x43        # C key
  79.   $R_Key_D         = 0x44        # D key
  80.   $R_Key_E         = 0x45        # E key
  81.   $R_Key_F         = 0x46        # F key
  82.   $R_Key_G         = 0x47        # G key
  83.   $R_Key_H         = 0x48        # H key
  84.   $R_Key_I         = 0x49        # I key
  85.   $R_Key_J         = 0x4A        # J key
  86.   $R_Key_K         = 0x4B        # K key
  87.   $R_Key_L         = 0x4C        # L key
  88.   $R_Key_M         = 0x4D        # M key
  89.   $R_Key_N         = 0x4E        # N key
  90.   $R_Key_O         = 0x4F        # O key
  91.   $R_Key_P         = 0x50        # P key
  92.   $R_Key_Q         = 0x51        # Q key
  93.   $R_Key_R         = 0x52        # R key
  94.   $R_Key_S         = 0x53        # S key
  95.   $R_Key_T         = 0x54        # T key
  96.   $R_Key_U         = 0x55        # U key
  97.   $R_Key_V         = 0x56        # V key
  98.   $R_Key_W         = 0x57        # W key
  99.   $R_Key_X         = 0x58        # X key
  100.   $R_Key_Y         = 0x59        # Y key
  101.   $R_Key_Z         = 0x5A        # Z key
  102.   #--------------------------------------------------------------------------
  103.   $R_Key_LWIN      = 0x5B        # Left Windows key (Microsoft Natural keyboard)
  104.   $R_Key_RWIN      = 0x5C        # Right Windows key (Natural keyboard)
  105.   $R_Key_APPS      = 0x5D        # Applications key (Natural keyboard)
  106.   #--------------------------------------------------------------------------
  107.   $R_Key_NUMPAD0   = 0x60        # Numeric keypad 0 key
  108.   $R_Key_NUMPAD1   = 0x61        # Numeric keypad 1 key
  109.   $R_Key_NUMPAD2   = 0x62        # Numeric keypad 2 key
  110.   $R_Key_NUMPAD3   = 0x63        # Numeric keypad 3 key
  111.   $R_Key_NUMPAD4   = 0x64        # Numeric keypad 4 key
  112.   $R_Key_NUMPAD5   = 0x65        # Numeric keypad 5 key
  113.   $R_Key_NUMPAD6   = 0x66        # Numeric keypad 6 key
  114.   $R_Key_NUMPAD7   = 0x67        # Numeric keypad 7 key
  115.   $R_Key_NUMPAD8   = 0x68        # Numeric keypad 8 key
  116.   $R_Key_NUMPAD9  = 0x69        # Numeric keypad 9 key
  117.   $R_Key_MULTIPLY  = 0x6A        # Multiply key (*)
  118.   $R_Key_ADD       = 0x6B        # Add key (+)
  119.   $R_Key_SEPARATOR = 0x6C        # Separator key
  120.   $R_Key_SUBTRACT  = 0x6D        # Subtract key (-)
  121.   $R_Key_DECIMAL   = 0x6E        # Decimal key
  122.   $R_Key_DIVIDE    = 0x6F        # Divide key (/)
  123.   #--------------------------------------------------------------------------
  124.   $R_Key_F1        = 0x70        # F1 key
  125.   $R_Key_F2        = 0x71        # F2 key
  126.   $R_Key_F3        = 0x72        # F3 key
  127.   $R_Key_F4        = 0x73        # F4 key
  128.   $R_Key_F5        = 0x74        # F5 key
  129.   $R_Key_F6        = 0x75        # F6 key
  130.   $R_Key_F7        = 0x76        # F7 key
  131.   $R_Key_F8        = 0x77        # F8 key
  132.   $R_Key_F9        = 0x78        # F9 key
  133.   $R_Key_F10       = 0x79        # F10 key
  134.   $R_Key_F11       = 0x7A        # F11 key
  135.   $R_Key_F12       = 0x7B        # F12 key
  136.   #--------------------------------------------------------------------------
  137.   $R_Key_NUMLOCK   = 0x90        # NUM LOCK key
  138.   $R_Key_SCROLL    = 0x91        # SCROLL LOCK key
  139.   #--------------------------------------------------------------------------
  140.   $R_Key_LSHIFT    = 0xA0        # Left SHIFT key
  141.   $R_Key_RSHIFT    = 0xA1        # Right SHIFT key
  142.   $R_Key_LCONTROL  = 0xA2        # Left CONTROL key
  143.   $R_Key_RCONTROL  = 0xA3        # Right CONTROL key
  144.   $R_Key_L_ALT    = 0xA4        # Left ALT key
  145.   $R_Key_R_ALT    = 0xA5        # Right ALT key
  146.   #--------------------------------------------------------------------------
  147.   $R_Key_SEP      = 0xBC        # , key
  148.   $R_Key_DASH      = 0xBD        # - key
  149.   $R_Key_DOTT      = 0xBE        # . Key
  150.   #--------------------------------------------------------------------------
  151.   GetKeyState = Win32API.new("user32","GetAsyncKeyState",['I'],'I')
  152.   GetKeyboardState = Win32API.new("user32","GetKeyState",['I'],'I')
  153.   GetSetKeyState = Win32API.new("user32","SetKeyboardState",['I'],'I')
  154.   #--------------------------------------------------------------------------
  155.   module_function
  156.   #--------------------------------------------------------------------------
  157.   def keyb(rkey)
  158.     if GetKeyState.call(rkey) != 0
  159.       return 1
  160.     end
  161.     return 0
  162.   end
  163.   #--------------------------------------------------------------------------
  164.   def keyboard(rkey)
  165.     GetKeyState.call(rkey) & 0x01 == 1  #
  166.   end
  167.   #--------------------------------------------------------------------------
  168.   def key(rkey, key = 0)
  169.     GetKeyboardState.call(rkey) & 0x01 == key #
  170.   end
  171. end
  172. #四方向改二方向
  173. class Game_CharacterBase
  174.    def set_direction(d)
  175.      if $game_switches[101] == true
  176.        @direction = d if !@direction_fix && d != 0|2 && d != 8
  177.        @stop_count = 0
  178.      else
  179.       @direction = d if !@direction_fix && d != 0
  180.       @stop_count = 0
  181.      end
  182.    end
  183. end
  184. #连击相关
  185. class Scene_Map
  186.   alias hys_input_update update
  187.   def update      
  188.     hys_input_update
  189.     if $game_switches[101] == true
  190.       if $game_variables[111] != 0
  191.          $game_variables[111] -= 1
  192.       end  
  193.     end
  194.   end
  195. end
  196. class Game_Player
  197.   #--------------------------------------------------------------------------
  198.   # ● 判定是否跑步状态
  199.   #--------------------------------------------------------------------------
  200.   def dash?
  201.     return false if @move_route_forcing
  202.     return false if $game_map.disable_dash?
  203.     return false if vehicle
  204.     return !(Input.press?(:A))
  205.       
  206.   end
  207. end
  208. #input_update
  209. class Scene_Map
  210. alias eas_input_update update
  211. def update
  212. eas_input_update
  213. if $game_switches[101] == true
  214.    if Kboard.keyboard($R_Key_W)
  215.       $game_temp.reserve_common_event(42)
  216.    end

  217.    if Kboard.keyboard($R_Key_A)
  218.       if $game_switches[104] == false && $game_switches[106] == false
  219.          $game_temp.reserve_common_event(47)
  220.        end
  221.     end
  222.    if Kboard.keyboard($R_Key_S)
  223.       if $game_switches[104] == false && $game_switches[106] == false
  224.          $game_temp.reserve_common_event(48)
  225.       end
  226.    end
  227.    if Kboard.keyboard($R_Key_D)
  228.      if $game_switches[104] == false && $game_switches[106] == false
  229.          $game_temp.reserve_common_event(49)
  230.      end               
  231.    end
  232.    if Kboard.keyboard($R_Key_Z)
  233.        if $game_switches[104] == false#判定是否施放技能
  234.           if $game_switches[106] == false#判定是否跳跃
  235.             $game_temp.reserve_common_event(53)
  236.           end
  237.        end
  238.    end
  239.    if Kboard.keyboard($R_Key_X)
  240.       if $game_switches[104] == false
  241.          if $game_switches[106] == false
  242.             $game_temp.reserve_common_event(54)
  243.           else
  244.             $easdiscuss = 1
  245.           end
  246.       end
  247.    end
  248. end
  249. end
  250. end
  251. #==============================================================================
  252. # +++ MOG - DAMAGEPOPUP  (v2.0) +++
  253. #==============================================================================
  254. module MOG_DAMAGEPOP
  255.   #Definição do espaço entre a palavra MP/TP e o numero de dano.
  256.   MP_TP_STRING_SPACE = 32
  257.   #Correção da posição do dano.
  258.   DAMAGE_POSITION_CORRECTION = [0 ,0]
  259.   #Apresentar a exp e ouro do inimigo.
  260.   EXP_POPUP = true
  261.   #Definição da prioridade do dano na tela.
  262.   DAMAGE_Z = 60
  263. end
  264. #==============================================================================
  265. # ■ Damage Sprite
  266. #==============================================================================
  267. class Damage_Sprite < Sprite
  268.    include MOG_DAMAGEPOP
  269.    attr_accessor :duration
  270.   
  271.   #--------------------------------------------------------------------------
  272.   # ● Initialize
  273.   #--------------------------------------------------------------------------      
  274.   def initialize(viewport = nil,x = 0,y = 0,value = 0,index)
  275.       super(viewport)
  276.       dispose
  277.       @image = Cache.system("Damage_Number")      
  278.       @x = x
  279.       @y = y
  280.       @value = value[0]
  281.       @type = value[1]
  282.       @critical = (value[2] and @value.to_i >= 0) ? true : false
  283.       @state_index = value[3]
  284.       @duration = 80 + (10 * index)
  285.       @cw = @image.width / 10
  286.       @ch = @image.height / 7
  287.       @center_x = 0
  288.       @mp_space = (@type == "MP" or @type == "TP") ? MP_TP_STRING_SPACE : 0      
  289.       if @value.is_a?(Numeric)
  290.          create_damage_number
  291.       elsif @value == "Missed" or  @value == "Evaded"  
  292.          create_damage_miss
  293.       else   
  294.          create_damage_string
  295.       end
  296.       self.x =  @x - (@center_x * (@cw / 2)) + DAMAGE_POSITION_CORRECTION[0]
  297.       self.y = @y + DAMAGE_POSITION_CORRECTION[1]
  298.       self.opacity = 1
  299.       zx = self.viewport != nil ? self.viewport.z : 0
  300.       self.z = DAMAGE_Z + zx
  301.       self.visible = false
  302.       damage_dir = rand(2)
  303.       @speed_x = straight_pop? ? 0 : damage_dir == 1 ? -rand(2) : rand(2)
  304.       @speed_y = 0
  305.   end
  306.   
  307.   #--------------------------------------------------------------------------
  308.   # ● Straight Pop
  309.   #--------------------------------------------------------------------------               
  310.   def straight_pop?
  311.       case @type
  312.          when "Gold";        return true
  313.          when "Exp";         return true
  314.          when "Level_UP";    return true
  315.       end
  316.       return false
  317.   end  
  318.   
  319.   #--------------------------------------------------------------------------
  320.   # ● Create Damage Number
  321.   #--------------------------------------------------------------------------            
  322.   def create_damage_miss
  323.       dam = @value == "Missed" ? 5 : 6
  324.       self.bitmap = Bitmap.new(@cw * 5, @ch)  
  325.       src_rect = Rect.new(0, dam * @ch,  @cw * 10, @ch)
  326.       self.bitmap.blt(0, 0, @image, src_rect)
  327.       @center_x += 5
  328.   end
  329.   
  330.   #--------------------------------------------------------------------------
  331.   # ● Create Damage Number
  332.   #--------------------------------------------------------------------------           
  333.   def create_damage_number
  334.       dam = @critical ? @ch * 2 : @value >= 0 ? 0 : @ch
  335.       f = @value >= 0 ? 0 : 1
  336.       number_value = @value.to_s.split(//)
  337.       self.bitmap = Bitmap.new(@mp_space + (@cw * number_value.size),@ch * 4)     
  338.       for r in f...number_value.size        
  339.          number_value_abs = number_value[r].to_i
  340.          src_rect = Rect.new(@cw * number_value_abs, dam, @cw, @ch)
  341.          self.bitmap.blt(@mp_space + (@cw *  r), 0, @image, src_rect)
  342.          @center_x += 1
  343.       end
  344.       if @type == "MP" or @type == "TP"
  345.          ty = @type == "MP" ? 3 : 4
  346.          src_rect = Rect.new(0, @ch * ty, @cw * 10, @ch)
  347.          self.bitmap.blt(0, 0, @image, src_rect)         
  348.          @center_x += 2
  349.       end
  350.       @center_x += 1 if @value < 0
  351.   end  
  352.   
  353.   #--------------------------------------------------------------------------
  354.   # ● Create Damage String
  355.   #--------------------------------------------------------------------------            
  356.   def create_damage_string
  357.       string_size = @value.to_s.split(//)
  358.       @stg_size = string_size.size > 0 ? ((1 + string_size.size) * 24) : 32      
  359.       self.bitmap = Bitmap.new(@stg_size,32)
  360.       self.bitmap.font.size = 25
  361.       self.bitmap.font.bold = true
  362.       @center_x = 2 + (string_size.size / 2)
  363.       if @state_index != nil
  364.          draw_states
  365.        else
  366.          execute_font_color
  367.          damage_string = @value.to_s         
  368.          self.bitmap.draw_text(0, 0, @stg_size, 32, damage_string,0)
  369.       end
  370.   end  
  371.   
  372.   #--------------------------------------------------------------------------
  373.   # ● Execute Font Color
  374.   #--------------------------------------------------------------------------               
  375.   def execute_font_color
  376.       case @type
  377.            when "Gold"
  378.                @duration = 160
  379.                self.bitmap.font.color = Color.new(255,255,100)
  380.            when "Exp"
  381.                @duration = 120
  382.                self.bitmap.font.color = Color.new(0,255,100)
  383.            when "Level_UP"   
  384.                self.bitmap.font.color = Color.new(50,155,255)  
  385.            else  
  386.                self.bitmap.font.color = Color.new(255,255,255)
  387.       end
  388.   end
  389.   
  390.   #--------------------------------------------------------------------------
  391.   # ● Draw States
  392.   #--------------------------------------------------------------------------               
  393.   def draw_states
  394.       icon_image = Cache.system("Iconset")
  395.       if @type == "States Plus"
  396.          self.bitmap.font.color = Color.new(200,150,50)
  397.          damage_string = "+ " + @value.to_s
  398.       elsif @type == "States Minus"
  399.           self.bitmap.font.color = Color.new(100,100,100)   
  400.          damage_string = "- " + @value.to_s
  401.       end        
  402.       rect = Rect.new(@state_index % 16 * 24, @state_index / 16 * 24, 24, 24)
  403.       self.bitmap.blt(0, 0, icon_image, rect)  
  404.       self.bitmap.draw_text(26, 0, @stg_size - 24, 32, damage_string,0)
  405.       @center_x += 5
  406.       icon_image.dispose
  407.       icon_image = nil
  408.   end  
  409.   
  410.   #--------------------------------------------------------------------------
  411.   # ● Dispose
  412.   #--------------------------------------------------------------------------         
  413.   def dispose
  414.       return if @image == nil
  415.       @image.dispose
  416.       @image = nil
  417.       self.bitmap.dispose
  418.       self.bitmap = nil
  419.       @duration = -1
  420.   end  
  421.   
  422.   #--------------------------------------------------------------------------
  423.   # ● Update
  424.   #--------------------------------------------------------------------------         
  425.   def update
  426.       return if self.bitmap == nil   
  427.       @duration -= 1 if @duration > 0
  428.       self.visible = @duration > 80 ? false : true
  429.       case @duration
  430.          when 65..80
  431.             self.opacity += 5
  432.             self.x += @speed_x
  433.             self.y -= 5
  434.             critical_effect(0.05)
  435.          when 50..65  
  436.              self.opacity = 255
  437.              self.y -= 3
  438.              self.x += @speed_x
  439.              critical_effect(0.05)
  440.          when 35..50
  441.              self.opacity = 255
  442.              self.y += 3
  443.              critical_effect(-0.05)
  444.          when 0..35  
  445.              self.opacity -= 7
  446.              self.y -= 1
  447.              critical_effect(-0.05)
  448.       end
  449.       dispose if self.opacity <= 0  
  450.   end
  451.    
  452.   #--------------------------------------------------------------------------
  453.   # ● Critical Effect
  454.   #--------------------------------------------------------------------------           
  455.   def critical_effect(value)
  456.       return if !@critical
  457.       self.zoom_x += value
  458.       self.zoom_y = self.zoom_x      
  459.   end
  460.   
  461. end


  462. #==============================================================================
  463. # ■ Game Interpreter
  464. #==============================================================================
  465. class Game_Interpreter
  466.   
  467.   #--------------------------------------------------------------------------
  468.   # ● damage Popup
  469.   #--------------------------------------------------------------------------      
  470.   def damage_popup(value,type = nil, critical = false)
  471.       type = (type == nil and value.is_a?(Numeric)) ? "HP" : type
  472.       $game_map.events[@event_id].damage.push([value,type,critical]) if same_map? && @event_id > 0
  473.     end      
  474. end  
  475. #==============================================================================
  476. # ■ Game Character
  477. #==============================================================================
  478. class Game_CharacterBase
  479.   
  480.   attr_accessor :damage
  481.   
  482.   #--------------------------------------------------------------------------
  483.   # ● Initialize
  484.   #--------------------------------------------------------------------------   
  485.   alias mog_damage_popup_initialize initialize
  486.   def initialize
  487.       @damage = []
  488.       mog_damage_popup_initialize
  489.   end
  490.   
  491.   #--------------------------------------------------------------------------
  492.   # ● damage Popup
  493.   #--------------------------------------------------------------------------      
  494.   def damage_popup(value,type = nil, critical = false)
  495.       type = (type == nil and value.is_a?(Numeric)) ? "HP" : type
  496.       @damage.push([value,type,critical])
  497.   end
  498.   
  499. end  

  500. #==============================================================================
  501. # ■ Sprite Character
  502. #==============================================================================
  503. class Sprite_Character < Sprite_Base

  504.   #--------------------------------------------------------------------------
  505.   # ● Initialize
  506.   #--------------------------------------------------------------------------  
  507.   alias mog_damage_popup_initialize initialize
  508.   def initialize(viewport, character = nil)
  509.       mog_damage_popup_initialize(viewport, character)
  510.       create_damage_sprite
  511.   end

  512.   #--------------------------------------------------------------------------
  513.   # ● Create Damage Sprite
  514.   #--------------------------------------------------------------------------           
  515.   def create_damage_sprite
  516.       dispose_damage_sprite
  517.       @damage_sprites = []
  518.   end
  519.   
  520.   #--------------------------------------------------------------------------
  521.   # ● Dispose
  522.   #--------------------------------------------------------------------------
  523.   alias mog_damage_popup_dispose dispose
  524.   def dispose
  525.       mog_damage_popup_dispose
  526.       dispose_damage_sprite
  527.   end  
  528.   
  529.   #--------------------------------------------------------------------------
  530.   # ● Dispose Damage Sprite
  531.   #--------------------------------------------------------------------------               
  532.   def dispose_damage_sprite
  533.       return if @damage_sprites == nil
  534.       @damage_sprites.each {|sprite| sprite.dispose }
  535.       @damage_sprites.clear
  536.       @character.damage.clear
  537.       $game_temp.dispose_damage_sprite = false
  538.   end   
  539.   
  540.   #--------------------------------------------------------------------------
  541.   # ● Update
  542.   #--------------------------------------------------------------------------  
  543.   alias mog_damage_popup_update update
  544.   def update
  545.       mog_damage_popup_update
  546.       update_damage_sprite
  547.   end
  548.   
  549.   #--------------------------------------------------------------------------
  550.   # ● Create Damage
  551.   #--------------------------------------------------------------------------                    
  552.   def create_damage
  553.       index = 0
  554.       sx = self.x
  555.       sy = self.y + @ch
  556.       @damage_sprites = [] if @damage_sprites == nil
  557.       for i in @character.damage
  558.           @damage_sprites.push(Damage_Sprite.new(nil,sx,sy,i,index))
  559.           index += 1
  560.       end
  561.       @character.damage.clear
  562.   end
  563.   
  564.   #--------------------------------------------------------------------------
  565.   # ● Update Damage Sprite
  566.   #--------------------------------------------------------------------------                  
  567.   def update_damage_sprite
  568.       return if @damage_sprites == nil
  569.       if @initial_damage == nil
  570.          @initial_damage = true
  571.          @character.damage.clear
  572.          return
  573.       end      
  574.       create_damage if !@character.damage.empty?
  575.       if !@damage_sprites.empty?
  576.           clear = 0
  577.           for sprite in @damage_sprites
  578.               sprite.update
  579.               if sprite.duration == 0
  580.                  sprite.dispose
  581.               end   
  582.               clear += 1 if sprite.duration > 0
  583.           end
  584.           clear_damage if clear == 0
  585.       end
  586.   end   
  587.   
  588.   #--------------------------------------------------------------------------
  589.   # ● Update Damage Sprite
  590.   #--------------------------------------------------------------------------                     
  591.   def clear_damage
  592.       @damage_sprites.each {|sprite| sprite.dispose }
  593.       @damage_sprites.clear
  594.       @character.damage.clear
  595.   end   
  596.   
  597. end

  598. #=============================================================================
  599. # ■ Game_Temp
  600. #=============================================================================
  601. class Game_Temp
  602.   
  603.   attr_accessor :dispose_damage_sprite
  604.   
  605.   #--------------------------------------------------------------------------
  606.   # ● Initialize
  607.   #--------------------------------------------------------------------------           
  608.   alias mog_dispose_damage_initialize initialize
  609.   def initialize
  610.       @dispose_damage_sprite = true
  611.       mog_dispose_damage_initialize
  612.   end
  613.    
  614. end

  615. #=============================================================================
  616. # ■ Scene Manager
  617. #=============================================================================
  618. class << SceneManager
  619.   
  620.   #--------------------------------------------------------------------------
  621.   # ● Call
  622.   #--------------------------------------------------------------------------         
  623.   alias mog_damage_pop_call call
  624.   def call(scene_class)
  625.       $game_temp.dispose_damage_sprite = true
  626.       mog_damage_pop_call(scene_class)
  627.   end
  628.   
  629. end

  630. #=============================================================================
  631. # ■ Scene Map
  632. #=============================================================================
  633. class Scene_Map < Scene_Base

  634.   #--------------------------------------------------------------------------
  635.   # ● Update Scene
  636.   #--------------------------------------------------------------------------           
  637.   alias mog_dispose_damage_sprites_update update_scene
  638.   def update_scene
  639.       @spriteset.dispose_damage_sprites
  640.       mog_dispose_damage_sprites_update
  641.   end

  642. end

  643. #=============================================================================
  644. # ■ Spriteset Map
  645. #=============================================================================
  646. class Spriteset_Map
  647.   
  648.   #--------------------------------------------------------------------------
  649.   # ● Dispose Damage Sprites
  650.   #--------------------------------------------------------------------------            
  651.   def dispose_damage_sprites
  652.       return if !$game_temp.dispose_damage_sprite   
  653.       return if @character_sprites == nil
  654.       @character_sprites.each {|sprite| sprite.dispose_damage_sprite }
  655.       $game_temp.dispose_damage_sprite = false
  656.   end
  657. end
  658. $mog_rgss3_damage_pop = true
  659. module MOG_I_HUD
  660.   #Posição geral da HUD.
  661.   IHUD_POS = [10,345]
  662.   #Switch que desativa a HUD.
  663.   DISABLE_IHUD_SWITCH_ID = 5
  664.   #HP ------------------------------------
  665.   #Posição do ícone de HP.
  666.   HP_ICON_POS = [40,0]
  667.   #Posição do numero de HP.
  668.   H_NUMBER_POS = [0,10]
  669.   #Quantidade maxima de icones de HP.
  670.   ICON_HP_MAX = 12
  671.   #Espaço entre um icone e o outro.
  672.   ICON_HP_SPACE = 14
  673.   #SP -------------------------------------
  674.   #Posição do ícone de MP.
  675.   MP_ICON_POS = [50,32]  
  676.   #Posição do numero de MP.
  677.   MP_NUMBER_POS = [65,48]
  678.   #Quantidade maxima de icones de MP.
  679.   ICON_MP_MAX = 8
  680.   #Espaço entre um icone e o outro.
  681.   ICON_MP_SPACE = 14
  682.   #Definição da prioridade da hud na tela.
  683.   HUD_Z = 105
  684. end

  685. #==============================================================================
  686. # ■ Game_Temp
  687. #==============================================================================
  688. class Game_System

  689.   attr_accessor :hud_visible  

  690.   #--------------------------------------------------------------------------
  691.   # ● Initialize
  692.   #--------------------------------------------------------------------------        
  693.   alias active_ihud_initialize initialize
  694.   def initialize
  695.       active_ihud_initialize
  696.       @hud_visible = true
  697.   end  
  698. end

  699. #==============================================================================
  700. # ■ Ihud
  701. #==============================================================================
  702. class Ihud
  703.   include MOG_I_HUD
  704.   
  705.   #--------------------------------------------------------------------------
  706.   # ●  Initialize
  707.   #--------------------------------------------------------------------------
  708.   def initialize
  709.       [url=home.php?mod=space&uid=95897]@actor[/url] = $game_party.members[0]
  710.       dispose
  711.       return if [url=home.php?mod=space&uid=95897]@actor[/url] == nil
  712.       @pre_leader_id = $game_party.members[0].id
  713.       create_layout
  714.       create_hp
  715.       create_hp_number
  716.       create_mp
  717.       create_mp_number      
  718.   end  
  719.    
  720.   #--------------------------------------------------------------------------
  721.   # ●  Initialize
  722.   #--------------------------------------------------------------------------  
  723.   def create_layout
  724.       @layout_sprite = Sprite.new
  725.       @layout_sprite.bitmap = Cache.system("IHud_Layout")
  726.       @layout_sprite.z = HUD_Z
  727.       @layout_sprite.x = IHUD_POS[0]
  728.       @layout_sprite.y = IHUD_POS[1]   
  729.   end

  730.   #--------------------------------------------------------------------------
  731.   # ●  Create HP
  732.   #--------------------------------------------------------------------------   
  733.   def create_hp
  734.       @hp = @actor.hp
  735.       @maxhp = @actor.mhp
  736.       @hp_maxicon = ICON_HP_MAX   
  737.       @hp_iconmax = ICON_HP_MAX   
  738.       @hp_iconmax = 1 if @hp_iconmax <= 0      
  739.       @hp2 = @actor.hp / @hp_iconmax     
  740.       @hp_icon_image = Cache.system("IHud_HP")
  741.       @hp_icon_cw = @hp_icon_image.width / 2
  742.       @hp_icon_ch = @hp_icon_image.height      
  743.       b_width = @hp_icon_cw * @hp_iconmax
  744.       @hp_icon_sprite = Sprite.new
  745.       @hp_icon_sprite.bitmap = Bitmap.new(b_width,@hp_icon_ch)
  746.       @hp_icon_sprite.z = 2 + HUD_Z   
  747.       @hp_icon_sprite.x = HP_ICON_POS[0] + IHUD_POS[0]
  748.       @hp_icon_sprite.y = HP_ICON_POS[1] + IHUD_POS[1]
  749.       hp_refresh
  750.   end  
  751.   
  752.   #--------------------------------------------------------------------------
  753.   # ● Create HP Number
  754.   #--------------------------------------------------------------------------      
  755.   def create_hp_number
  756.       @hp_number_image = Cache.system("Ihud_HP_Number")
  757.       @im_cw = @hp_number_image.width / 10
  758.       @im_ch = @hp_number_image.height
  759.       @hp_number_sprite = Sprite.new
  760.       @hp_number_sprite.bitmap = Bitmap.new(@hp_number_image.width,@hp_number_image.height)
  761.       @hp_number_sprite.z = 3 + HUD_Z
  762.       @hp_number_sprite.y = H_NUMBER_POS[1] + IHUD_POS[1]
  763.       hp_number_refresh
  764.   end
  765.   
  766.   #--------------------------------------------------------------------------
  767.   # ●  Create MP
  768.   #--------------------------------------------------------------------------   
  769.   def create_mp
  770.       @mp = @actor.mp
  771.       @maxmp = @actor.mmp
  772.       @mp_maxicon = ICON_MP_MAX   
  773.       @mp_iconmax = ICON_MP_MAX   
  774.       @mp_iconmax = 1 if @mp_iconmax <= 0      
  775.       @mp2 = @actor.hp / @mp_iconmax     
  776.       @mp_icon_image = Cache.system("IHud_MP")
  777.       @mp_icon_cw = @mp_icon_image.width / 2
  778.       @mp_icon_ch = @mp_icon_image.height      
  779.       b_width = @mp_icon_cw * @mp_iconmax
  780.       @mp_icon_sprite = Sprite.new
  781.       @mp_icon_sprite.bitmap = Bitmap.new(b_width,@mp_icon_ch)
  782.       @mp_icon_sprite.z = 2 + HUD_Z
  783.       @mp_icon_sprite.x = MP_ICON_POS[0] + IHUD_POS[0]
  784.       @mp_icon_sprite.y = MP_ICON_POS[1] + IHUD_POS[1]
  785.       mp_refresh
  786.   end   
  787.   
  788.   #--------------------------------------------------------------------------
  789.   # ● Create MP Number
  790.   #--------------------------------------------------------------------------      
  791.   def create_mp_number
  792.       @mp_number_image = Cache.system("Ihud_MP_Number")
  793.       @im_cw2 = @mp_number_image.width / 10
  794.       @im_ch2 = @mp_number_image.height
  795.       @mp_number_sprite = Sprite.new
  796.       @mp_number_sprite.bitmap = Bitmap.new(@mp_number_image.width,@mp_number_image.height)
  797.       @mp_number_sprite.z = 3 + HUD_Z
  798.       @mp_number_sprite.y = MP_NUMBER_POS[1] + IHUD_POS[1]
  799.       mp_number_refresh
  800.   end  
  801.   
  802.   #--------------------------------------------------------------------------
  803.   # ● Dispose
  804.   #--------------------------------------------------------------------------   
  805.   def dispose
  806.       return if @layout_sprite == nil
  807.       @layout_sprite.bitmap.dispose
  808.       @layout_sprite.dispose
  809.       @layout_sprite = nil
  810.       @hp_icon_image.dispose
  811.       @hp_icon_sprite.bitmap.dispose
  812.       @hp_icon_sprite.dispose
  813.       @hp_number_image.dispose
  814.       @hp_number_sprite.bitmap.dispose
  815.       @hp_number_sprite.dispose
  816.       @mp_icon_image.dispose
  817.       @mp_icon_sprite.bitmap.dispose
  818.       @mp_icon_sprite.dispose
  819.       @mp_number_image.dispose
  820.       @mp_number_sprite.bitmap.dispose
  821.       @mp_number_sprite.dispose      
  822.   end  
  823.   
  824.   #--------------------------------------------------------------------------
  825.   # ●  refresh_actor
  826.   #--------------------------------------------------------------------------  
  827.   def refresh_actor
  828.       dispose
  829.       initialize
  830.   end  
  831.   
  832.   #--------------------------------------------------------------------------
  833.   # ●  Update
  834.   #--------------------------------------------------------------------------   
  835.   def update
  836.       if @actor == nil
  837.          refresh_actor if $game_party.members[0] != nil
  838.          return
  839.       end
  840.       update_visible
  841.       if can_refresh_hp?
  842.          hp_refresh
  843.          hp_number_refresh
  844.       end
  845.       if can_refresh_mp?
  846.          mp_refresh
  847.          mp_number_refresh
  848.       end
  849.       refresh_actor if can_refresh_hud?
  850.   end
  851.   
  852.   #--------------------------------------------------------------------------
  853.   # ● Update Visible
  854.   #--------------------------------------------------------------------------
  855.   def update_visible
  856.       #Visible
  857.       if $game_message.visible or $game_system.hud_visible == false
  858.          vis = false
  859.       else
  860.          vis = true
  861.       end  
  862.       @layout_sprite.visible = vis
  863.       @hp_icon_sprite.visible = vis
  864.       @hp_number_sprite.visible = vis
  865.       @mp_icon_sprite.visible = vis
  866.       @mp_number_sprite.visible = vis
  867.   end  
  868.   
  869.   #--------------------------------------------------------------------------
  870.   # ● Can Refresh HP?
  871.   #--------------------------------------------------------------------------      
  872.   def can_refresh_hp?
  873.       return false if $game_party.members[0] == nil
  874.       return true if @hp != $game_party.members[0].hp
  875.       return true if @maxhp != $game_party.members[0].mhp
  876.       return false
  877.   end  
  878.   
  879.   #--------------------------------------------------------------------------
  880.   # ● Can Refresh MP?
  881.   #--------------------------------------------------------------------------      
  882.   def can_refresh_mp?
  883.       return false if $game_party.members[0] == nil
  884.       return true if @mp != $game_party.members[0].mp
  885.       return true if @maxmp != $game_party.members[0].mmp
  886.       return false
  887.   end   
  888.   
  889.   #--------------------------------------------------------------------------
  890.   # ● HP Refresh
  891.   #--------------------------------------------------------------------------
  892.   def hp_refresh
  893.       @hp_icon_sprite.bitmap.clear
  894.       @hp = @actor.hp
  895.       @maxhp = @actor.mhp
  896.       @hp2 = @actor.hp / @hp_iconmax   
  897.       @hp3 = @actor.hp - (@hp2 * @hp_iconmax)
  898.       for i in 0...@hp_iconmax
  899.           @hp_icon_src_rect = Rect.new(0,0, @hp_icon_cw, @hp_icon_ch)
  900.           @hp_icon_sprite.bitmap.blt(i * ICON_HP_SPACE , 0, @hp_icon_image, @hp_icon_src_rect)        
  901.       end
  902.       @hp2 = @hp2 - 1 if @hp3 == 0 and @actor.hp > 0
  903.       @hp3 = @hp_iconmax if @hp3 == 0 and @actor.hp > 0
  904.       for i in 0...@hp3
  905.           @hp_icon_src_rect = Rect.new(@hp_icon_cw,0, @hp_icon_cw, @hp_icon_ch)
  906.           @hp_icon_sprite.bitmap.blt(i * ICON_HP_SPACE , 0, @hp_icon_image, @hp_icon_src_rect)        
  907.       end      
  908.   end   

  909.   #--------------------------------------------------------------------------
  910.   # ● HP Number Refresh
  911.   #--------------------------------------------------------------------------
  912.   def hp_number_refresh
  913.       @hp_number_sprite.bitmap.clear
  914.       @hp_number_text = @hp2.abs.to_s.split(//)
  915.       ex = 0
  916.       for r in [email]0..@hp_number_text.size[/email] - 1
  917.           ex += 1
  918.           @hp_number_abs = @hp_number_text[r].to_i
  919.           @hp_src_rect = Rect.new(@im_cw * @hp_number_abs, 0, @im_cw, @im_ch)
  920.           @hp_number_sprite.bitmap.blt(@im_cw *  r, 0, @hp_number_image, @hp_src_rect)        
  921.       end
  922.       x_correction = (@im_cw / 2) * ex   
  923.       @hp_number_sprite.x = MP_NUMBER_POS[0] + IHUD_POS[0] - x_correction
  924.    end
  925.   
  926.   #--------------------------------------------------------------------------
  927.   # ● MP Refresh
  928.   #--------------------------------------------------------------------------
  929.   def mp_refresh
  930.       @mp_icon_sprite.bitmap.clear
  931.       @mp = @actor.mp
  932.       @maxmp = @actor.mmp
  933.       @mp2 = @actor.mp / @mp_iconmax   
  934.       @mp3 = @actor.mp - (@mp2 * @mp_iconmax)
  935.       for i in 0...@mp_iconmax
  936.           @mp_icon_src_rect = Rect.new(0,0, @mp_icon_cw, @mp_icon_ch)
  937.           @mp_icon_sprite.bitmap.blt(i * ICON_MP_SPACE , 0, @mp_icon_image, @mp_icon_src_rect)        
  938.       end
  939.       @mp2 = @mp2 - 1 if @mp3 == 0 and @actor.mp > 0
  940.       @mp3 = @mp_iconmax if @mp3 == 0 and @actor.mp > 0
  941.       for i in 0...@mp3
  942.           @mp_icon_src_rect = Rect.new(@mp_icon_cw,0, @mp_icon_cw, @mp_icon_ch)
  943.           @mp_icon_sprite.bitmap.blt(i * ICON_HP_SPACE , 0, @mp_icon_image, @mp_icon_src_rect)        
  944.       end      
  945.   end   

  946.   #--------------------------------------------------------------------------
  947.   # ● MP Number Refresh
  948.   #--------------------------------------------------------------------------
  949.   def mp_number_refresh
  950.       @mp_number_sprite.bitmap.clear
  951.       @mp_number_text = @mp2.abs.to_s.split(//)
  952.       ex = 0
  953.       for r in [email]0..@mp_number_text.size[/email] - 1
  954.           ex += 1
  955.           @mp_number_abs = @mp_number_text[r].to_i
  956.           @mp_src_rect = Rect.new(@im_cw2 * @mp_number_abs, 0, @im_cw2, @im_ch2)
  957.           @mp_number_sprite.bitmap.blt(@im_cw2 *  r, 0, @mp_number_image, @mp_src_rect)        
  958.       end
  959.       x_correction = (@im_cw2 / 2) * ex   
  960.       @mp_number_sprite.x = MP_NUMBER_POS[0] + IHUD_POS[0] - x_correction
  961.    end   
  962.    
  963.   #--------------------------------------------------------------------------
  964.   # ● Can Refresh Hud
  965.   #--------------------------------------------------------------------------   
  966.   def can_refresh_hud?
  967.       if $game_party.members[0] == nil
  968.          return true if @pre_leader_id != nil
  969.       elsif $game_party.members[0] != nil   
  970.          return true if @pre_leader_id == nil
  971.          return true if @pre_leader_id != $game_party.members[0].id
  972.       end  
  973.       return false
  974.   end
  975.    
  976. end


  977. #==============================================================================
  978. # ■ Spriteset_Map
  979. #==============================================================================
  980. class Spriteset_Map
  981.   
  982.   #--------------------------------------------------------------------------
  983.   # ● initialize  
  984.   #--------------------------------------------------------------------------
  985.   alias mog_ihud_initialize initialize
  986.   def initialize  
  987.       @ihud = Ihud.new
  988.       mog_ihud_initialize
  989.   end
  990.   
  991.   #--------------------------------------------------------------------------
  992.   # ● dispose
  993.   #--------------------------------------------------------------------------
  994.   alias mog_ihud_dispose dispose
  995.   def dispose   
  996.       @ihud.dispose
  997.       mog_ihud_dispose
  998.   end
  999.   
  1000.   #--------------------------------------------------------------------------
  1001.   # ● update   
  1002.   #--------------------------------------------------------------------------
  1003.   alias mog_ihud_update update
  1004.   def update   
  1005.       @ihud.update
  1006.       mog_ihud_update
  1007.   end

  1008. end

  1009. $mog_rgss3_ihud = true

  1010. module MOG_S_HUD
  1011.   #Posição geral da HUD.
  1012.   S_HUD_POS = [0,-54]
  1013.   #Posição do layout de HP
  1014.   S_LAYOUT_HP_POS = [-22,3]
  1015.   #Posição do medidor de HP
  1016.   S_METER_HP_POS = [-20,5]
  1017.   #Posição do layout de MP
  1018.   S_LAYOUT_MP_POS = [-20,16]
  1019.   #Posição do medidor de MP
  1020.   S_METER_MP_POS = [-20,16]
  1021.   #Velocidade da animação do medidor
  1022.   METER_FLOW_SPEED = 2
  1023.   #Prioridade da Hud na tela.
  1024.   HUD_Z = 100
  1025. end

  1026. #==============================================================================
  1027. # ■ Game_System
  1028. #==============================================================================
  1029. class Game_System

  1030.   attr_accessor :hud_visible  

  1031.   #--------------------------------------------------------------------------
  1032.   # ● Initialize
  1033.   #--------------------------------------------------------------------------        
  1034.   alias active_shud_initialize initialize
  1035.   def initialize
  1036.       active_shud_initialize
  1037.       @hud_visible = false
  1038.   end  
  1039. end

  1040. #==============================================================================
  1041. # ■ S HUD
  1042. #==============================================================================
  1043. class S_HUD
  1044.   include MOG_S_HUD
  1045.   
  1046.   #--------------------------------------------------------------------------
  1047.   # ●  Initialize
  1048.   #--------------------------------------------------------------------------
  1049.   def initialize
  1050.       @actor = $game_party.members[0]
  1051.       dispose
  1052.       return if @actor == nil
  1053.       @pre_leader_id = $game_party.members[0].id
  1054.       create_layout
  1055.       create_hp
  1056.       create_mp
  1057.       update_position
  1058.   end  
  1059.    
  1060.   #--------------------------------------------------------------------------
  1061.   # ●  Initialize
  1062.   #--------------------------------------------------------------------------  
  1063.   def create_layout
  1064.       @layout_sprite = Sprite.new
  1065.       @layout_sprite.bitmap = Cache.system("S_Hud_Layout")
  1066.       @layout_sprite.z = HUD_Z
  1067.       @layout_sprite2 = Sprite.new
  1068.       @layout_sprite2.bitmap = Cache.system("S_Hud_Layout2")
  1069.       @layout_sprite2.z = HUD_Z  
  1070.      
  1071.   end

  1072.   #--------------------------------------------------------------------------
  1073.   # ●  Create HP
  1074.   #--------------------------------------------------------------------------   
  1075.   def create_hp
  1076.       @hp = @actor.hp
  1077.       @hp_flow = 0
  1078.       @hp_damage_flow = 0  
  1079.       @hp_old = @actor.hp
  1080.       @hp_ref = @hp_old
  1081.       @hp_image = Cache.system("S_Hud_HP_Meter")
  1082.       @hp_range = @hp_image.width / 3
  1083.       @hp_height = @hp_image.height / 2
  1084.       @hp_width = @hp_range  * @actor.hp / @actor.mhp
  1085.       @hp_width_old = @hp_width   
  1086.       @hp_sprite = Sprite.new
  1087.       @hp_sprite.bitmap = Bitmap.new(@hp_image.width,@hp_image.height)
  1088.       @hp_sprite.z = HUD_Z + 2
  1089.       update_hp
  1090.   end  
  1091.   
  1092.   #--------------------------------------------------------------------------
  1093.   # ●  Create MP
  1094.   #--------------------------------------------------------------------------   
  1095.   def create_mp
  1096.       @mp = @actor.mp
  1097.       @mp_flow = 0
  1098.       @mp_damage_flow = 0  
  1099.       @mp_old = @actor.mp
  1100.       @mp_ref = @mp_old
  1101.       @mp_image = Cache.system("S_Hud_MP_Meter")
  1102.       @mp_range = @mp_image.width / 3
  1103.       @mp_height = @mp_image.height
  1104.       @mp_width = @mp_range  * @actor.mp / @actor.mhp
  1105.       @mp_width_old = @mp_width   
  1106.       @mp_sprite = Sprite.new
  1107.       @mp_sprite.bitmap = Bitmap.new(@mp_image.width,@mp_image.height)
  1108.       @mp_sprite.z = HUD_Z + 2
  1109.       update_mp
  1110.   end   
  1111.   

  1112.   #--------------------------------------------------------------------------
  1113.   # ● Dispose
  1114.   #--------------------------------------------------------------------------   
  1115.   def dispose
  1116.       return if @layout_sprite == nil
  1117.       @layout_sprite.bitmap.dispose
  1118.       @layout_sprite.dispose
  1119.       @layout_sprite = nil
  1120.       @layout_sprite2.bitmap.dispose
  1121.       @layout_sprite2.dispose
  1122.       @hp_image.dispose
  1123.       @hp_sprite.bitmap.dispose
  1124.       @hp_sprite.dispose
  1125.       @mp_image.dispose
  1126.       @mp_sprite.bitmap.dispose
  1127.       @mp_sprite.dispose         
  1128.   end  
  1129.   
  1130.   #--------------------------------------------------------------------------
  1131.   # ●  refresh_actor
  1132.   #--------------------------------------------------------------------------  
  1133.   def refresh_actor
  1134.       dispose
  1135.       initialize
  1136.   end  
  1137.   
  1138.   #--------------------------------------------------------------------------
  1139.   # ●  Update
  1140.   #--------------------------------------------------------------------------   
  1141.   def update
  1142.       if @actor == nil
  1143.          refresh_actor if $game_party.members[0] != nil
  1144.          return
  1145.       end
  1146.       update_visible
  1147.       update_position
  1148.       update_hp
  1149.       update_mp
  1150.       refresh_actor if can_refresh_hud?
  1151.   end

  1152.   #--------------------------------------------------------------------------
  1153.   # ● Update Position
  1154.   #--------------------------------------------------------------------------      
  1155.   def update_position
  1156.       px = $game_player.screen_x + S_HUD_POS[0]
  1157.       py = $game_player.screen_y + S_HUD_POS[1]
  1158.       @layout_sprite.x = px + S_LAYOUT_HP_POS[0]
  1159.       @layout_sprite.y = py + S_LAYOUT_HP_POS[1]
  1160.       @layout_sprite2.x = px + S_LAYOUT_MP_POS[0]
  1161.       @layout_sprite2.y = py + S_LAYOUT_MP_POS[1]
  1162.       @hp_sprite.x = px + S_METER_HP_POS[0]
  1163.       @hp_sprite.y = py + S_METER_HP_POS[1]
  1164.       @mp_sprite.x = px + S_METER_MP_POS[0]
  1165.       @mp_sprite.y = py + S_METER_MP_POS[1]      
  1166.   end
  1167.   
  1168.   #--------------------------------------------------------------------------
  1169.   # ● Update Visible
  1170.   #--------------------------------------------------------------------------
  1171.   def update_visible
  1172.       #Visible
  1173.       if $game_message.visible or $game_system.hud_visible == false
  1174.          vis = false
  1175.       else
  1176.          vis = true
  1177.       end  
  1178.       @layout_sprite.visible = vis
  1179.       @layout_sprite2.visible = vis
  1180.       @hp_sprite.visible = vis
  1181.       @mp_sprite.visible = vis
  1182.   end  
  1183.   
  1184.   
  1185.   #--------------------------------------------------------------------------
  1186.   # ● Update HP
  1187.   #--------------------------------------------------------------------------
  1188.   def update_hp
  1189.       @hp_sprite.bitmap.clear
  1190.       @hp_width = @hp_range  * @actor.hp / @actor.mhp  
  1191.           #HP Damage---------------------------------
  1192.           if @hp_width_old != @hp_width
  1193.           valor = (@hp_width_old - @hp_width) * 3 / 100
  1194.           valor = 0.5 if valor < 1                                
  1195.           @hp_width_old -= valor if @hp_width_old > @hp_width  
  1196.           if @hp_width_old < @hp_width
  1197.              @hp_width_old = @hp_width
  1198.           end      
  1199.           @hp_src_rect_old = Rect.new(@hp_flow, @hp_height,@hp_width_old, @hp_height)
  1200.           @hp_sprite.bitmap.blt(0,0, @hp_image, @hp_src_rect_old)      
  1201.           end        
  1202.       #HP Real------------------------------------
  1203.       @hp_src_rect = Rect.new(@hp_flow, 0,@hp_width, @hp_height)
  1204.       @hp_sprite.bitmap.blt(0,0, @hp_image, @hp_src_rect)         
  1205.       @hp_flow += METER_FLOW_SPEED  
  1206.       if @hp_flow >= @hp_image.width - @hp_range
  1207.          @hp_flow = 0  
  1208.       end      
  1209.   end   
  1210.   
  1211.   #--------------------------------------------------------------------------
  1212.   # ● Update MP
  1213.   #--------------------------------------------------------------------------
  1214.   def update_mp
  1215.       @mp_sprite.bitmap.clear
  1216.       @mp_width = @mp_range  * @actor.mp / @actor.mmp rescue 1
  1217.       @mp_src_rect = Rect.new(@mp_flow, 0,@mp_width, @mp_height)
  1218.       @mp_sprite.bitmap.blt(0,0, @mp_image, @mp_src_rect)         
  1219.       @mp_flow += METER_FLOW_SPEED  
  1220.       if @mp_flow >= @mp_image.width - @mp_range
  1221.          @mp_flow = 0  
  1222.       end   
  1223.   end   

  1224.   #--------------------------------------------------------------------------
  1225.   # ● Can Refresh Hud
  1226.   #--------------------------------------------------------------------------   
  1227.   def can_refresh_hud?
  1228.       if $game_party.members[0] == nil
  1229.          return true if @pre_leader_id != nil
  1230.       elsif $game_party.members[0] != nil   
  1231.          return true if @pre_leader_id == nil
  1232.          return true if @pre_leader_id != $game_party.members[0].id
  1233.       end  
  1234.       return false
  1235.   end
  1236.    
  1237. end


  1238. #==============================================================================
  1239. # ■ Spriteset_Map
  1240. #==============================================================================
  1241. class Spriteset_Map
  1242.   
  1243.   #--------------------------------------------------------------------------
  1244.   # ● initialize  
  1245.   #--------------------------------------------------------------------------
  1246.   alias mog_shud_initialize initialize
  1247.   def initialize  
  1248.       @shud = S_HUD.new
  1249.       mog_shud_initialize
  1250.   end
  1251.   
  1252.   #--------------------------------------------------------------------------
  1253.   # ● dispose
  1254.   #--------------------------------------------------------------------------
  1255.   alias mog_shud_dispose dispose
  1256.   def dispose   
  1257.       @shud.dispose
  1258.       mog_shud_dispose
  1259.   end
  1260.   
  1261.   #--------------------------------------------------------------------------
  1262.   # ● update   
  1263.   #--------------------------------------------------------------------------
  1264.   alias mog_shud_update update
  1265.   def update   
  1266.       @shud.update
  1267.       mog_shud_update
  1268.   end

  1269. end

  1270. $mog_rgss3_s_hud = true
复制代码

评分

参与人数 4星屑 +354 收起 理由
1091160905 + 14 dnf的素材??
47731089 + 140 请继续加油哦
feizhaodan + 180 奖赏条例
jklpgh + 20 大爱,求楼主继续开发啊

查看全部评分

梦石
1
星屑
7574
在线时间
2650 小时
注册时间
2013-8-23
回帖
2152

开拓者

发表于 2013-8-31 22:26:44 | 显示全部楼层
楼主辛苦了!

不过好像 行走图有点小的样子
回复

使用道具 举报

梦石
0
星屑
49
在线时间
491 小时
注册时间
2012-1-27
回帖
399

整合系统大赛RMVA达人

 楼主| 发表于 2013-8-31 22:29:33 | 显示全部楼层
鑫晴 发表于 2013-8-31 22:26
楼主辛苦了!

不过好像 行走图有点小的样子

这是按rm标准行走图的大小弄的,考虑到大部分人都用自带素材,这样换主角的时候方便点
回复

使用道具 举报

梦石
1
星屑
7574
在线时间
2650 小时
注册时间
2013-8-23
回帖
2152

开拓者

发表于 2013-8-31 22:35:22 | 显示全部楼层
狱冥幻翼 发表于 2013-8-31 22:29
这是按rm标准行走图的大小弄的,考虑到大部分人都用自带素材,这样换主角的时候方便点 ...

嘿嘿,左上角可以显示血量,右上角还可以加一个迷你地图,

点评

对了,我一开始发的版本忘加减敌人血的事件了,现已修复,你看你打敌人要是不减血的话就在公共事件里加上  发表于 2013-8-31 22:46
回复

使用道具 举报

梦石
0
星屑
50
在线时间
492 小时
注册时间
2013-6-15
回帖
164
发表于 2013-9-5 17:33:57 | 显示全部楼层
弱弱的问一句,你的敌人减血事件是怎样计算的?
回复

使用道具 举报

梦石
0
星屑
49
在线时间
491 小时
注册时间
2012-1-27
回帖
399

整合系统大赛RMVA达人

 楼主| 发表于 2013-9-5 20:57:12 | 显示全部楼层
渝川 发表于 2013-9-5 17:33
弱弱的问一句,你的敌人减血事件是怎样计算的?

首先读取主角的物理攻击,存入damage这个变量然后随机加减数字,都在公共事件里
回复

使用道具 举报

梦石
0
星屑
9292
在线时间
2504 小时
注册时间
2011-5-20
回帖
14521

开拓者

发表于 2013-9-6 17:30:44 | 显示全部楼层
好东西,但是敌人多了会不会卡?

点评

没试过,应该会卡  发表于 2013-9-6 21:23
[img]http://service.t.sina.com.cn/widget/qmd/5339802982/c02e16bd/7.png
回复

使用道具 举报

发表于 2013-9-7 07:22:24 | 显示全部楼层
同为事件党,大赞,不过我想知道“EAS”和XAS相比有什么优点,
XAS设置简便,效果也比这个好,这个"EAS"完全是拼美工,美工
不好效果就完了。再一点,设置及其复杂,而且只能做横版,传
统俯视45°ARPG根本就做不出来,因为主角敌人的每个技能都要
再绘制前方和后方的,可能是EAS相比XAS唯一优点的扩展性强就
没了。效果看起来的确不错,但我以前也用VX做过一个类似的"EAS"
加上一堆敌人和技能状态并行Overlay根本就没法玩,巨卡,而且
做敌人时敌人和主角的攻击频率很难掌握,一旦稍有偏差游戏平衡
就毁了。还有蛋疼的一点,鼠标系统完全是个鸡肋,下面的技能栏
我还以为能拖动或者点击释放......现在看来只有引路功能,而且键盘
完全可以代替,鼠标系统加上实在是毫无意义......
效果很完美,神级事件,但希望能简化一下
我是砖家我自豪!
回复

使用道具 举报

梦石
0
星屑
49
在线时间
491 小时
注册时间
2012-1-27
回帖
399

整合系统大赛RMVA达人

 楼主| 发表于 2013-9-7 13:43:29 | 显示全部楼层
吐槽砖家 发表于 2013-9-7 07:22
同为事件党,大赞,不过我想知道“EAS”和XAS相比有什么优点,
XAS设置简便,效果也比这个好,这个"EAS"完 ...

我这个和xas分别属于双方向和四方向arpg
双方向arpg优势在于可以空连,华丽度大一点,比如dnf  qq封神记
四方向arpg优势为操控简单,不需要怎么连招,比如泽诺尼亚
至于传统俯视45°ARPG,RM应该是实现不了的,2d引擎应该不能做出3d效果吧……
在制作敌人技能的时候没必要用并行一帧调用一次,10-30帧调用一次即可,要设置为敌人僵直和浮空不执行
不过要为敌人设置连招,不然平衡就毁了

点评

好蛋疼= =  发表于 2013-9-7 16:51
回复

使用道具 举报

梦石
0
星屑
369
在线时间
133 小时
注册时间
2008-8-23
回帖
54
发表于 2013-9-16 09:05:53 | 显示全部楼层
跳跃系统能搞好一点就好了
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 注册会员

本版积分规则

Powered by Discuz! X5.0 © 2001-2026 Discuz! Team.

在本版发帖返回顶部