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

Project1

 找回密码
 注册会员
搜索
查看: 4865|回复: 10
打印 上一主题 下一主题

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

[复制链接]

Lv1.梦旅人

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

整合系统大赛RMVA达人

跳转到指定楼层
1
发表于 2013-8-31 21:58:56 | 只看该作者 |只看大图 回帖奖励 |倒序浏览 |阅读模式

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

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

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

从放暑假开始做的,断断续续做了两个月,前几天看到论坛提问区有人想做arpg就发出来分享下,支持空连,暂不支持空斩,空斩的方法已经有了,不过太麻烦,以后会更新的,具体用法见范例
普攻可以连3次,第3次有上挑效果,绝对不卡!!
有bug请直接回复或加我q760055313
范例下载地址pan.baidu.com/share/link?shareid=1353404674&uk=4010369150






代码
RUBY 代码复制
  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.  
  218.    if Kboard.keyboard($R_Key_A)
  219.       if $game_switches[104] == false && $game_switches[106] == false
  220.          $game_temp.reserve_common_event(47)
  221.        end
  222.     end
  223.    if Kboard.keyboard($R_Key_S)
  224.       if $game_switches[104] == false && $game_switches[106] == false
  225.          $game_temp.reserve_common_event(48)
  226.       end
  227.    end
  228.    if Kboard.keyboard($R_Key_D)
  229.      if $game_switches[104] == false && $game_switches[106] == false
  230.          $game_temp.reserve_common_event(49)
  231.      end               
  232.    end
  233.    if Kboard.keyboard($R_Key_Z)
  234.        if $game_switches[104] == false#判定是否施放技能
  235.           if $game_switches[106] == false#判定是否跳跃
  236.             $game_temp.reserve_common_event(53)
  237.           end
  238.        end
  239.    end
  240.    if Kboard.keyboard($R_Key_X)
  241.       if $game_switches[104] == false
  242.          if $game_switches[106] == false
  243.             $game_temp.reserve_common_event(54)
  244.           else
  245.             $easdiscuss = 1
  246.           end
  247.       end
  248.    end
  249. end
  250. end
  251. end
  252. #==============================================================================
  253. # +++ MOG - DAMAGEPOPUP  (v2.0) +++
  254. #==============================================================================
  255. module MOG_DAMAGEPOP
  256.   #Definição do espaço entre a palavra MP/TP e o numero de dano.
  257.   MP_TP_STRING_SPACE = 32
  258.   #Correção da posição do dano.
  259.   DAMAGE_POSITION_CORRECTION = [0 ,0]
  260.   #Apresentar a exp e ouro do inimigo.
  261.   EXP_POPUP = true
  262.   #Definição da prioridade do dano na tela.
  263.   DAMAGE_Z = 60
  264. end
  265. #==============================================================================
  266. # ■ Damage Sprite
  267. #==============================================================================
  268. class Damage_Sprite < Sprite
  269.    include MOG_DAMAGEPOP
  270.    attr_accessor :duration
  271.  
  272.   #--------------------------------------------------------------------------
  273.   # ● Initialize
  274.   #--------------------------------------------------------------------------      
  275.   def initialize(viewport = nil,x = 0,y = 0,value = 0,index)
  276.       super(viewport)
  277.       dispose
  278.       @image = Cache.system("Damage_Number")      
  279.       @x = x
  280.       @y = y
  281.       @value = value[0]
  282.       @type = value[1]
  283.       @critical = (value[2] and @value.to_i >= 0) ? true : false
  284.       @state_index = value[3]
  285.       @duration = 80 + (10 * index)
  286.       @cw = @image.width / 10
  287.       @ch = @image.height / 7
  288.       @center_x = 0
  289.       @mp_space = (@type == "MP" or @type == "TP") ? MP_TP_STRING_SPACE : 0      
  290.       if @value.is_a?(Numeric)
  291.          create_damage_number
  292.       elsif @value == "Missed" or  @value == "Evaded"  
  293.          create_damage_miss
  294.       else   
  295.          create_damage_string
  296.       end
  297.       self.x =  @x - (@center_x * (@cw / 2)) + DAMAGE_POSITION_CORRECTION[0]
  298.       self.y = @y + DAMAGE_POSITION_CORRECTION[1]
  299.       self.opacity = 1
  300.       zx = self.viewport != nil ? self.viewport.z : 0
  301.       self.z = DAMAGE_Z + zx
  302.       self.visible = false
  303.       damage_dir = rand(2)
  304.       @speed_x = straight_pop? ? 0 : damage_dir == 1 ? -rand(2) : rand(2)
  305.       @speed_y = 0
  306.   end
  307.  
  308.   #--------------------------------------------------------------------------
  309.   # ● Straight Pop
  310.   #--------------------------------------------------------------------------               
  311.   def straight_pop?
  312.       case @type
  313.          when "Gold";        return true
  314.          when "Exp";         return true
  315.          when "Level_UP";    return true
  316.       end
  317.       return false
  318.   end  
  319.  
  320.   #--------------------------------------------------------------------------
  321.   # ● Create Damage Number
  322.   #--------------------------------------------------------------------------            
  323.   def create_damage_miss
  324.       dam = @value == "Missed" ? 5 : 6
  325.       self.bitmap = Bitmap.new(@cw * 5, @ch)  
  326.       src_rect = Rect.new(0, dam * @ch,  @cw * 10, @ch)
  327.       self.bitmap.blt(0, 0, @image, src_rect)
  328.       @center_x += 5
  329.   end
  330.  
  331.   #--------------------------------------------------------------------------
  332.   # ● Create Damage Number
  333.   #--------------------------------------------------------------------------           
  334.   def create_damage_number
  335.       dam = @critical ? @ch * 2 : @value >= 0 ? 0 : @ch
  336.       f = @value >= 0 ? 0 : 1
  337.       number_value = @value.to_s.split(//)
  338.       self.bitmap = Bitmap.new(@mp_space + (@cw * number_value.size),@ch * 4)     
  339.       for r in f...number_value.size        
  340.          number_value_abs = number_value[r].to_i
  341.          src_rect = Rect.new(@cw * number_value_abs, dam, @cw, @ch)
  342.          self.bitmap.blt(@mp_space + (@cw *  r), 0, @image, src_rect)
  343.          @center_x += 1
  344.       end
  345.       if @type == "MP" or @type == "TP"
  346.          ty = @type == "MP" ? 3 : 4
  347.          src_rect = Rect.new(0, @ch * ty, @cw * 10, @ch)
  348.          self.bitmap.blt(0, 0, @image, src_rect)         
  349.          @center_x += 2
  350.       end
  351.       @center_x += 1 if @value < 0
  352.   end  
  353.  
  354.   #--------------------------------------------------------------------------
  355.   # ● Create Damage String
  356.   #--------------------------------------------------------------------------            
  357.   def create_damage_string
  358.       string_size = @value.to_s.split(//)
  359.       @stg_size = string_size.size > 0 ? ((1 + string_size.size) * 24) : 32      
  360.       self.bitmap = Bitmap.new(@stg_size,32)
  361.       self.bitmap.font.size = 25
  362.       self.bitmap.font.bold = true
  363.       @center_x = 2 + (string_size.size / 2)
  364.       if @state_index != nil
  365.          draw_states
  366.        else
  367.          execute_font_color
  368.          damage_string = @value.to_s         
  369.          self.bitmap.draw_text(0, 0, @stg_size, 32, damage_string,0)
  370.       end
  371.   end  
  372.  
  373.   #--------------------------------------------------------------------------
  374.   # ● Execute Font Color
  375.   #--------------------------------------------------------------------------               
  376.   def execute_font_color
  377.       case @type
  378.            when "Gold"
  379.                @duration = 160
  380.                self.bitmap.font.color = Color.new(255,255,100)
  381.            when "Exp"
  382.                @duration = 120
  383.                self.bitmap.font.color = Color.new(0,255,100)
  384.            when "Level_UP"   
  385.                self.bitmap.font.color = Color.new(50,155,255)  
  386.            else  
  387.                self.bitmap.font.color = Color.new(255,255,255)
  388.       end
  389.   end
  390.  
  391.   #--------------------------------------------------------------------------
  392.   # ● Draw States
  393.   #--------------------------------------------------------------------------               
  394.   def draw_states
  395.       icon_image = Cache.system("Iconset")
  396.       if @type == "States Plus"
  397.          self.bitmap.font.color = Color.new(200,150,50)
  398.          damage_string = "+ " + @value.to_s
  399.       elsif @type == "States Minus"
  400.           self.bitmap.font.color = Color.new(100,100,100)   
  401.          damage_string = "- " + @value.to_s
  402.       end        
  403.       rect = Rect.new(@state_index % 16 * 24, @state_index / 16 * 24, 24, 24)
  404.       self.bitmap.blt(0, 0, icon_image, rect)  
  405.       self.bitmap.draw_text(26, 0, @stg_size - 24, 32, damage_string,0)
  406.       @center_x += 5
  407.       icon_image.dispose
  408.       icon_image = nil
  409.   end  
  410.  
  411.   #--------------------------------------------------------------------------
  412.   # ● Dispose
  413.   #--------------------------------------------------------------------------         
  414.   def dispose
  415.       return if @image == nil
  416.       @image.dispose
  417.       @image = nil
  418.       self.bitmap.dispose
  419.       self.bitmap = nil
  420.       @duration = -1
  421.   end  
  422.  
  423.   #--------------------------------------------------------------------------
  424.   # ● Update
  425.   #--------------------------------------------------------------------------         
  426.   def update
  427.       return if self.bitmap == nil   
  428.       @duration -= 1 if @duration > 0
  429.       self.visible = @duration > 80 ? false : true
  430.       case @duration
  431.          when 65..80
  432.             self.opacity += 5
  433.             self.x += @speed_x
  434.             self.y -= 5
  435.             critical_effect(0.05)
  436.          when 50..65  
  437.              self.opacity = 255
  438.              self.y -= 3
  439.              self.x += @speed_x
  440.              critical_effect(0.05)
  441.          when 35..50
  442.              self.opacity = 255
  443.              self.y += 3
  444.              critical_effect(-0.05)
  445.          when 0..35  
  446.              self.opacity -= 7
  447.              self.y -= 1
  448.              critical_effect(-0.05)
  449.       end
  450.       dispose if self.opacity <= 0  
  451.   end
  452.  
  453.   #--------------------------------------------------------------------------
  454.   # ● Critical Effect
  455.   #--------------------------------------------------------------------------           
  456.   def critical_effect(value)
  457.       return if !@critical
  458.       self.zoom_x += value
  459.       self.zoom_y = self.zoom_x      
  460.   end
  461.  
  462. end
  463.  
  464.  
  465. #==============================================================================
  466. # ■ Game Interpreter
  467. #==============================================================================
  468. class Game_Interpreter
  469.  
  470.   #--------------------------------------------------------------------------
  471.   # ● damage Popup
  472.   #--------------------------------------------------------------------------      
  473.   def damage_popup(value,type = nil, critical = false)
  474.       type = (type == nil and value.is_a?(Numeric)) ? "HP" : type
  475.       $game_map.events[@event_id].damage.push([value,type,critical]) if same_map? && @event_id > 0
  476.     end      
  477. end  
  478. #==============================================================================
  479. # ■ Game Character
  480. #==============================================================================
  481. class Game_CharacterBase
  482.  
  483.   attr_accessor :damage
  484.  
  485.   #--------------------------------------------------------------------------
  486.   # ● Initialize
  487.   #--------------------------------------------------------------------------   
  488.   alias mog_damage_popup_initialize initialize
  489.   def initialize
  490.       @damage = []
  491.       mog_damage_popup_initialize
  492.   end
  493.  
  494.   #--------------------------------------------------------------------------
  495.   # ● damage Popup
  496.   #--------------------------------------------------------------------------      
  497.   def damage_popup(value,type = nil, critical = false)
  498.       type = (type == nil and value.is_a?(Numeric)) ? "HP" : type
  499.       @damage.push([value,type,critical])
  500.   end
  501.  
  502. end  
  503.  
  504. #==============================================================================
  505. # ■ Sprite Character
  506. #==============================================================================
  507. class Sprite_Character < Sprite_Base
  508.  
  509.   #--------------------------------------------------------------------------
  510.   # ● Initialize
  511.   #--------------------------------------------------------------------------  
  512.   alias mog_damage_popup_initialize initialize
  513.   def initialize(viewport, character = nil)
  514.       mog_damage_popup_initialize(viewport, character)
  515.       create_damage_sprite
  516.   end
  517.  
  518.   #--------------------------------------------------------------------------
  519.   # ● Create Damage Sprite
  520.   #--------------------------------------------------------------------------           
  521.   def create_damage_sprite
  522.       dispose_damage_sprite
  523.       @damage_sprites = []
  524.   end
  525.  
  526.   #--------------------------------------------------------------------------
  527.   # ● Dispose
  528.   #--------------------------------------------------------------------------
  529.   alias mog_damage_popup_dispose dispose
  530.   def dispose
  531.       mog_damage_popup_dispose
  532.       dispose_damage_sprite
  533.   end  
  534.  
  535.   #--------------------------------------------------------------------------
  536.   # ● Dispose Damage Sprite
  537.   #--------------------------------------------------------------------------               
  538.   def dispose_damage_sprite
  539.       return if @damage_sprites == nil
  540.       @damage_sprites.each {|sprite| sprite.dispose }
  541.       @damage_sprites.clear
  542.       @character.damage.clear
  543.       $game_temp.dispose_damage_sprite = false
  544.   end   
  545.  
  546.   #--------------------------------------------------------------------------
  547.   # ● Update
  548.   #--------------------------------------------------------------------------  
  549.   alias mog_damage_popup_update update
  550.   def update
  551.       mog_damage_popup_update
  552.       update_damage_sprite
  553.   end
  554.  
  555.   #--------------------------------------------------------------------------
  556.   # ● Create Damage
  557.   #--------------------------------------------------------------------------                    
  558.   def create_damage
  559.       index = 0
  560.       sx = self.x
  561.       sy = self.y + @ch
  562.       @damage_sprites = [] if @damage_sprites == nil
  563.       for i in @character.damage
  564.           @damage_sprites.push(Damage_Sprite.new(nil,sx,sy,i,index))
  565.           index += 1
  566.       end
  567.       @character.damage.clear
  568.   end
  569.  
  570.   #--------------------------------------------------------------------------
  571.   # ● Update Damage Sprite
  572.   #--------------------------------------------------------------------------                  
  573.   def update_damage_sprite
  574.       return if @damage_sprites == nil
  575.       if @initial_damage == nil
  576.          @initial_damage = true
  577.          @character.damage.clear
  578.          return
  579.       end      
  580.       create_damage if !@character.damage.empty?
  581.       if !@damage_sprites.empty?
  582.           clear = 0
  583.           for sprite in @damage_sprites
  584.               sprite.update
  585.               if sprite.duration == 0
  586.                  sprite.dispose
  587.               end   
  588.               clear += 1 if sprite.duration > 0
  589.           end
  590.           clear_damage if clear == 0
  591.       end
  592.   end   
  593.  
  594.   #--------------------------------------------------------------------------
  595.   # ● Update Damage Sprite
  596.   #--------------------------------------------------------------------------                     
  597.   def clear_damage
  598.       @damage_sprites.each {|sprite| sprite.dispose }
  599.       @damage_sprites.clear
  600.       @character.damage.clear
  601.   end   
  602.  
  603. end
  604.  
  605. #=============================================================================
  606. # ■ Game_Temp
  607. #=============================================================================
  608. class Game_Temp
  609.  
  610.   attr_accessor :dispose_damage_sprite
  611.  
  612.   #--------------------------------------------------------------------------
  613.   # ● Initialize
  614.   #--------------------------------------------------------------------------           
  615.   alias mog_dispose_damage_initialize initialize
  616.   def initialize
  617.       @dispose_damage_sprite = true
  618.       mog_dispose_damage_initialize
  619.   end
  620.  
  621. end
  622.  
  623. #=============================================================================
  624. # ■ Scene Manager
  625. #=============================================================================
  626. class << SceneManager
  627.  
  628.   #--------------------------------------------------------------------------
  629.   # ● Call
  630.   #--------------------------------------------------------------------------         
  631.   alias mog_damage_pop_call call
  632.   def call(scene_class)
  633.       $game_temp.dispose_damage_sprite = true
  634.       mog_damage_pop_call(scene_class)
  635.   end
  636.  
  637. end
  638.  
  639. #=============================================================================
  640. # ■ Scene Map
  641. #=============================================================================
  642. class Scene_Map < Scene_Base
  643.  
  644.   #--------------------------------------------------------------------------
  645.   # ● Update Scene
  646.   #--------------------------------------------------------------------------           
  647.   alias mog_dispose_damage_sprites_update update_scene
  648.   def update_scene
  649.       @spriteset.dispose_damage_sprites
  650.       mog_dispose_damage_sprites_update
  651.   end
  652.  
  653. end
  654.  
  655. #=============================================================================
  656. # ■ Spriteset Map
  657. #=============================================================================
  658. class Spriteset_Map
  659.  
  660.   #--------------------------------------------------------------------------
  661.   # ● Dispose Damage Sprites
  662.   #--------------------------------------------------------------------------            
  663.   def dispose_damage_sprites
  664.       return if !$game_temp.dispose_damage_sprite   
  665.       return if @character_sprites == nil
  666.       @character_sprites.each {|sprite| sprite.dispose_damage_sprite }
  667.       $game_temp.dispose_damage_sprite = false
  668.   end
  669. end
  670. $mog_rgss3_damage_pop = true
  671. module MOG_I_HUD
  672.   #Posição geral da HUD.
  673.   IHUD_POS = [10,345]
  674.   #Switch que desativa a HUD.
  675.   DISABLE_IHUD_SWITCH_ID = 5
  676.   #HP ------------------------------------
  677.   #Posição do ícone de HP.
  678.   HP_ICON_POS = [40,0]
  679.   #Posição do numero de HP.
  680.   H_NUMBER_POS = [0,10]
  681.   #Quantidade maxima de icones de HP.
  682.   ICON_HP_MAX = 12
  683.   #Espaço entre um icone e o outro.
  684.   ICON_HP_SPACE = 14
  685.   #SP -------------------------------------
  686.   #Posição do ícone de MP.
  687.   MP_ICON_POS = [50,32]  
  688.   #Posição do numero de MP.
  689.   MP_NUMBER_POS = [65,48]
  690.   #Quantidade maxima de icones de MP.
  691.   ICON_MP_MAX = 8
  692.   #Espaço entre um icone e o outro.
  693.   ICON_MP_SPACE = 14
  694.   #Definição da prioridade da hud na tela.
  695.   HUD_Z = 105
  696. end
  697.  
  698. #==============================================================================
  699. # ■ Game_Temp
  700. #==============================================================================
  701. class Game_System
  702.  
  703.   attr_accessor :hud_visible  
  704.  
  705.   #--------------------------------------------------------------------------
  706.   # ● Initialize
  707.   #--------------------------------------------------------------------------        
  708.   alias active_ihud_initialize initialize
  709.   def initialize
  710.       active_ihud_initialize
  711.       @hud_visible = true
  712.   end  
  713. end
  714.  
  715. #==============================================================================
  716. # ■ Ihud
  717. #==============================================================================
  718. class Ihud
  719.   include MOG_I_HUD
  720.  
  721.   #--------------------------------------------------------------------------
  722.   # ●  Initialize
  723.   #--------------------------------------------------------------------------
  724.   def initialize
  725.       [url=home.php?mod=space&uid=95897]@actor[/url] = $game_party.members[0]
  726.       dispose
  727.       return if [url=home.php?mod=space&uid=95897]@actor[/url] == nil
  728.       @pre_leader_id = $game_party.members[0].id
  729.       create_layout
  730.       create_hp
  731.       create_hp_number
  732.       create_mp
  733.       create_mp_number      
  734.   end  
  735.  
  736.   #--------------------------------------------------------------------------
  737.   # ●  Initialize
  738.   #--------------------------------------------------------------------------  
  739.   def create_layout
  740.       @layout_sprite = Sprite.new
  741.       @layout_sprite.bitmap = Cache.system("IHud_Layout")
  742.       @layout_sprite.z = HUD_Z
  743.       @layout_sprite.x = IHUD_POS[0]
  744.       @layout_sprite.y = IHUD_POS[1]   
  745.   end
  746.  
  747.   #--------------------------------------------------------------------------
  748.   # ●  Create HP
  749.   #--------------------------------------------------------------------------   
  750.   def create_hp
  751.       @hp = @actor.hp
  752.       @maxhp = @actor.mhp
  753.       @hp_maxicon = ICON_HP_MAX   
  754.       @hp_iconmax = ICON_HP_MAX   
  755.       @hp_iconmax = 1 if @hp_iconmax <= 0      
  756.       @hp2 = @actor.hp / @hp_iconmax     
  757.       @hp_icon_image = Cache.system("IHud_HP")
  758.       @hp_icon_cw = @hp_icon_image.width / 2
  759.       @hp_icon_ch = @hp_icon_image.height      
  760.       b_width = @hp_icon_cw * @hp_iconmax
  761.       @hp_icon_sprite = Sprite.new
  762.       @hp_icon_sprite.bitmap = Bitmap.new(b_width,@hp_icon_ch)
  763.       @hp_icon_sprite.z = 2 + HUD_Z   
  764.       @hp_icon_sprite.x = HP_ICON_POS[0] + IHUD_POS[0]
  765.       @hp_icon_sprite.y = HP_ICON_POS[1] + IHUD_POS[1]
  766.       hp_refresh
  767.   end  
  768.  
  769.   #--------------------------------------------------------------------------
  770.   # ● Create HP Number
  771.   #--------------------------------------------------------------------------      
  772.   def create_hp_number
  773.       @hp_number_image = Cache.system("Ihud_HP_Number")
  774.       @im_cw = @hp_number_image.width / 10
  775.       @im_ch = @hp_number_image.height
  776.       @hp_number_sprite = Sprite.new
  777.       @hp_number_sprite.bitmap = Bitmap.new(@hp_number_image.width,@hp_number_image.height)
  778.       @hp_number_sprite.z = 3 + HUD_Z
  779.       @hp_number_sprite.y = H_NUMBER_POS[1] + IHUD_POS[1]
  780.       hp_number_refresh
  781.   end
  782.  
  783.   #--------------------------------------------------------------------------
  784.   # ●  Create MP
  785.   #--------------------------------------------------------------------------   
  786.   def create_mp
  787.       @mp = @actor.mp
  788.       @maxmp = @actor.mmp
  789.       @mp_maxicon = ICON_MP_MAX   
  790.       @mp_iconmax = ICON_MP_MAX   
  791.       @mp_iconmax = 1 if @mp_iconmax <= 0      
  792.       @mp2 = @actor.hp / @mp_iconmax     
  793.       @mp_icon_image = Cache.system("IHud_MP")
  794.       @mp_icon_cw = @mp_icon_image.width / 2
  795.       @mp_icon_ch = @mp_icon_image.height      
  796.       b_width = @mp_icon_cw * @mp_iconmax
  797.       @mp_icon_sprite = Sprite.new
  798.       @mp_icon_sprite.bitmap = Bitmap.new(b_width,@mp_icon_ch)
  799.       @mp_icon_sprite.z = 2 + HUD_Z
  800.       @mp_icon_sprite.x = MP_ICON_POS[0] + IHUD_POS[0]
  801.       @mp_icon_sprite.y = MP_ICON_POS[1] + IHUD_POS[1]
  802.       mp_refresh
  803.   end   
  804.  
  805.   #--------------------------------------------------------------------------
  806.   # ● Create MP Number
  807.   #--------------------------------------------------------------------------      
  808.   def create_mp_number
  809.       @mp_number_image = Cache.system("Ihud_MP_Number")
  810.       @im_cw2 = @mp_number_image.width / 10
  811.       @im_ch2 = @mp_number_image.height
  812.       @mp_number_sprite = Sprite.new
  813.       @mp_number_sprite.bitmap = Bitmap.new(@mp_number_image.width,@mp_number_image.height)
  814.       @mp_number_sprite.z = 3 + HUD_Z
  815.       @mp_number_sprite.y = MP_NUMBER_POS[1] + IHUD_POS[1]
  816.       mp_number_refresh
  817.   end  
  818.  
  819.   #--------------------------------------------------------------------------
  820.   # ● Dispose
  821.   #--------------------------------------------------------------------------   
  822.   def dispose
  823.       return if @layout_sprite == nil
  824.       @layout_sprite.bitmap.dispose
  825.       @layout_sprite.dispose
  826.       @layout_sprite = nil
  827.       @hp_icon_image.dispose
  828.       @hp_icon_sprite.bitmap.dispose
  829.       @hp_icon_sprite.dispose
  830.       @hp_number_image.dispose
  831.       @hp_number_sprite.bitmap.dispose
  832.       @hp_number_sprite.dispose
  833.       @mp_icon_image.dispose
  834.       @mp_icon_sprite.bitmap.dispose
  835.       @mp_icon_sprite.dispose
  836.       @mp_number_image.dispose
  837.       @mp_number_sprite.bitmap.dispose
  838.       @mp_number_sprite.dispose      
  839.   end  
  840.  
  841.   #--------------------------------------------------------------------------
  842.   # ●  refresh_actor
  843.   #--------------------------------------------------------------------------  
  844.   def refresh_actor
  845.       dispose
  846.       initialize
  847.   end  
  848.  
  849.   #--------------------------------------------------------------------------
  850.   # ●  Update
  851.   #--------------------------------------------------------------------------   
  852.   def update
  853.       if @actor == nil
  854.          refresh_actor if $game_party.members[0] != nil
  855.          return
  856.       end
  857.       update_visible
  858.       if can_refresh_hp?
  859.          hp_refresh
  860.          hp_number_refresh
  861.       end
  862.       if can_refresh_mp?
  863.          mp_refresh
  864.          mp_number_refresh
  865.       end
  866.       refresh_actor if can_refresh_hud?
  867.   end
  868.  
  869.   #--------------------------------------------------------------------------
  870.   # ● Update Visible
  871.   #--------------------------------------------------------------------------
  872.   def update_visible
  873.       #Visible
  874.       if $game_message.visible or $game_system.hud_visible == false
  875.          vis = false
  876.       else
  877.          vis = true
  878.       end  
  879.       @layout_sprite.visible = vis
  880.       @hp_icon_sprite.visible = vis
  881.       @hp_number_sprite.visible = vis
  882.       @mp_icon_sprite.visible = vis
  883.       @mp_number_sprite.visible = vis
  884.   end  
  885.  
  886.   #--------------------------------------------------------------------------
  887.   # ● Can Refresh HP?
  888.   #--------------------------------------------------------------------------      
  889.   def can_refresh_hp?
  890.       return false if $game_party.members[0] == nil
  891.       return true if @hp != $game_party.members[0].hp
  892.       return true if @maxhp != $game_party.members[0].mhp
  893.       return false
  894.   end  
  895.  
  896.   #--------------------------------------------------------------------------
  897.   # ● Can Refresh MP?
  898.   #--------------------------------------------------------------------------      
  899.   def can_refresh_mp?
  900.       return false if $game_party.members[0] == nil
  901.       return true if @mp != $game_party.members[0].mp
  902.       return true if @maxmp != $game_party.members[0].mmp
  903.       return false
  904.   end   
  905.  
  906.   #--------------------------------------------------------------------------
  907.   # ● HP Refresh
  908.   #--------------------------------------------------------------------------
  909.   def hp_refresh
  910.       @hp_icon_sprite.bitmap.clear
  911.       @hp = @actor.hp
  912.       @maxhp = @actor.mhp
  913.       @hp2 = @actor.hp / @hp_iconmax   
  914.       @hp3 = @actor.hp - (@hp2 * @hp_iconmax)
  915.       for i in 0...@hp_iconmax
  916.           @hp_icon_src_rect = Rect.new(0,0, @hp_icon_cw, @hp_icon_ch)
  917.           @hp_icon_sprite.bitmap.blt(i * ICON_HP_SPACE , 0, @hp_icon_image, @hp_icon_src_rect)        
  918.       end
  919.       @hp2 = @hp2 - 1 if @hp3 == 0 and @actor.hp > 0
  920.       @hp3 = @hp_iconmax if @hp3 == 0 and @actor.hp > 0
  921.       for i in 0...@hp3
  922.           @hp_icon_src_rect = Rect.new(@hp_icon_cw,0, @hp_icon_cw, @hp_icon_ch)
  923.           @hp_icon_sprite.bitmap.blt(i * ICON_HP_SPACE , 0, @hp_icon_image, @hp_icon_src_rect)        
  924.       end      
  925.   end   
  926.  
  927.   #--------------------------------------------------------------------------
  928.   # ● HP Number Refresh
  929.   #--------------------------------------------------------------------------
  930.   def hp_number_refresh
  931.       @hp_number_sprite.bitmap.clear
  932.       @hp_number_text = @hp2.abs.to_s.split(//)
  933.       ex = 0
  934.       for r in [email]0..@hp_number_text.size[/email] - 1
  935.           ex += 1
  936.           @hp_number_abs = @hp_number_text[r].to_i
  937.           @hp_src_rect = Rect.new(@im_cw * @hp_number_abs, 0, @im_cw, @im_ch)
  938.           @hp_number_sprite.bitmap.blt(@im_cw *  r, 0, @hp_number_image, @hp_src_rect)        
  939.       end
  940.       x_correction = (@im_cw / 2) * ex   
  941.       @hp_number_sprite.x = MP_NUMBER_POS[0] + IHUD_POS[0] - x_correction
  942.    end
  943.  
  944.   #--------------------------------------------------------------------------
  945.   # ● MP Refresh
  946.   #--------------------------------------------------------------------------
  947.   def mp_refresh
  948.       @mp_icon_sprite.bitmap.clear
  949.       @mp = @actor.mp
  950.       @maxmp = @actor.mmp
  951.       @mp2 = @actor.mp / @mp_iconmax   
  952.       @mp3 = @actor.mp - (@mp2 * @mp_iconmax)
  953.       for i in 0...@mp_iconmax
  954.           @mp_icon_src_rect = Rect.new(0,0, @mp_icon_cw, @mp_icon_ch)
  955.           @mp_icon_sprite.bitmap.blt(i * ICON_MP_SPACE , 0, @mp_icon_image, @mp_icon_src_rect)        
  956.       end
  957.       @mp2 = @mp2 - 1 if @mp3 == 0 and @actor.mp > 0
  958.       @mp3 = @mp_iconmax if @mp3 == 0 and @actor.mp > 0
  959.       for i in 0...@mp3
  960.           @mp_icon_src_rect = Rect.new(@mp_icon_cw,0, @mp_icon_cw, @mp_icon_ch)
  961.           @mp_icon_sprite.bitmap.blt(i * ICON_HP_SPACE , 0, @mp_icon_image, @mp_icon_src_rect)        
  962.       end      
  963.   end   
  964.  
  965.   #--------------------------------------------------------------------------
  966.   # ● MP Number Refresh
  967.   #--------------------------------------------------------------------------
  968.   def mp_number_refresh
  969.       @mp_number_sprite.bitmap.clear
  970.       @mp_number_text = @mp2.abs.to_s.split(//)
  971.       ex = 0
  972.       for r in [email]0..@mp_number_text.size[/email] - 1
  973.           ex += 1
  974.           @mp_number_abs = @mp_number_text[r].to_i
  975.           @mp_src_rect = Rect.new(@im_cw2 * @mp_number_abs, 0, @im_cw2, @im_ch2)
  976.           @mp_number_sprite.bitmap.blt(@im_cw2 *  r, 0, @mp_number_image, @mp_src_rect)        
  977.       end
  978.       x_correction = (@im_cw2 / 2) * ex   
  979.       @mp_number_sprite.x = MP_NUMBER_POS[0] + IHUD_POS[0] - x_correction
  980.    end   
  981.  
  982.   #--------------------------------------------------------------------------
  983.   # ● Can Refresh Hud
  984.   #--------------------------------------------------------------------------   
  985.   def can_refresh_hud?
  986.       if $game_party.members[0] == nil
  987.          return true if @pre_leader_id != nil
  988.       elsif $game_party.members[0] != nil   
  989.          return true if @pre_leader_id == nil
  990.          return true if @pre_leader_id != $game_party.members[0].id
  991.       end  
  992.       return false
  993.   end
  994.  
  995. end
  996.  
  997.  
  998. #==============================================================================
  999. # ■ Spriteset_Map
  1000. #==============================================================================
  1001. class Spriteset_Map
  1002.  
  1003.   #--------------------------------------------------------------------------
  1004.   # ● initialize  
  1005.   #--------------------------------------------------------------------------
  1006.   alias mog_ihud_initialize initialize
  1007.   def initialize  
  1008.       @ihud = Ihud.new
  1009.       mog_ihud_initialize
  1010.   end
  1011.  
  1012.   #--------------------------------------------------------------------------
  1013.   # ● dispose
  1014.   #--------------------------------------------------------------------------
  1015.   alias mog_ihud_dispose dispose
  1016.   def dispose   
  1017.       @ihud.dispose
  1018.       mog_ihud_dispose
  1019.   end
  1020.  
  1021.   #--------------------------------------------------------------------------
  1022.   # ● update   
  1023.   #--------------------------------------------------------------------------
  1024.   alias mog_ihud_update update
  1025.   def update   
  1026.       @ihud.update
  1027.       mog_ihud_update
  1028.   end
  1029.  
  1030. end
  1031.  
  1032. $mog_rgss3_ihud = true
  1033.  
  1034. module MOG_S_HUD
  1035.   #Posição geral da HUD.
  1036.   S_HUD_POS = [0,-54]
  1037.   #Posição do layout de HP
  1038.   S_LAYOUT_HP_POS = [-22,3]
  1039.   #Posição do medidor de HP
  1040.   S_METER_HP_POS = [-20,5]
  1041.   #Posição do layout de MP
  1042.   S_LAYOUT_MP_POS = [-20,16]
  1043.   #Posição do medidor de MP
  1044.   S_METER_MP_POS = [-20,16]
  1045.   #Velocidade da animação do medidor
  1046.   METER_FLOW_SPEED = 2
  1047.   #Prioridade da Hud na tela.
  1048.   HUD_Z = 100
  1049. end
  1050.  
  1051. #==============================================================================
  1052. # ■ Game_System
  1053. #==============================================================================
  1054. class Game_System
  1055.  
  1056.   attr_accessor :hud_visible  
  1057.  
  1058.   #--------------------------------------------------------------------------
  1059.   # ● Initialize
  1060.   #--------------------------------------------------------------------------        
  1061.   alias active_shud_initialize initialize
  1062.   def initialize
  1063.       active_shud_initialize
  1064.       @hud_visible = false
  1065.   end  
  1066. end
  1067.  
  1068. #==============================================================================
  1069. # ■ S HUD
  1070. #==============================================================================
  1071. class S_HUD
  1072.   include MOG_S_HUD
  1073.  
  1074.   #--------------------------------------------------------------------------
  1075.   # ●  Initialize
  1076.   #--------------------------------------------------------------------------
  1077.   def initialize
  1078.       @actor = $game_party.members[0]
  1079.       dispose
  1080.       return if @actor == nil
  1081.       @pre_leader_id = $game_party.members[0].id
  1082.       create_layout
  1083.       create_hp
  1084.       create_mp
  1085.       update_position
  1086.   end  
  1087.  
  1088.   #--------------------------------------------------------------------------
  1089.   # ●  Initialize
  1090.   #--------------------------------------------------------------------------  
  1091.   def create_layout
  1092.       @layout_sprite = Sprite.new
  1093.       @layout_sprite.bitmap = Cache.system("S_Hud_Layout")
  1094.       @layout_sprite.z = HUD_Z
  1095.       @layout_sprite2 = Sprite.new
  1096.       @layout_sprite2.bitmap = Cache.system("S_Hud_Layout2")
  1097.       @layout_sprite2.z = HUD_Z  
  1098.  
  1099.   end
  1100.  
  1101.   #--------------------------------------------------------------------------
  1102.   # ●  Create HP
  1103.   #--------------------------------------------------------------------------   
  1104.   def create_hp
  1105.       @hp = @actor.hp
  1106.       @hp_flow = 0
  1107.       @hp_damage_flow = 0  
  1108.       @hp_old = @actor.hp
  1109.       @hp_ref = @hp_old
  1110.       @hp_image = Cache.system("S_Hud_HP_Meter")
  1111.       @hp_range = @hp_image.width / 3
  1112.       @hp_height = @hp_image.height / 2
  1113.       @hp_width = @hp_range  * @actor.hp / @actor.mhp
  1114.       @hp_width_old = @hp_width   
  1115.       @hp_sprite = Sprite.new
  1116.       @hp_sprite.bitmap = Bitmap.new(@hp_image.width,@hp_image.height)
  1117.       @hp_sprite.z = HUD_Z + 2
  1118.       update_hp
  1119.   end  
  1120.  
  1121.   #--------------------------------------------------------------------------
  1122.   # ●  Create MP
  1123.   #--------------------------------------------------------------------------   
  1124.   def create_mp
  1125.       @mp = @actor.mp
  1126.       @mp_flow = 0
  1127.       @mp_damage_flow = 0  
  1128.       @mp_old = @actor.mp
  1129.       @mp_ref = @mp_old
  1130.       @mp_image = Cache.system("S_Hud_MP_Meter")
  1131.       @mp_range = @mp_image.width / 3
  1132.       @mp_height = @mp_image.height
  1133.       @mp_width = @mp_range  * @actor.mp / @actor.mhp
  1134.       @mp_width_old = @mp_width   
  1135.       @mp_sprite = Sprite.new
  1136.       @mp_sprite.bitmap = Bitmap.new(@mp_image.width,@mp_image.height)
  1137.       @mp_sprite.z = HUD_Z + 2
  1138.       update_mp
  1139.   end   
  1140.  
  1141.  
  1142.   #--------------------------------------------------------------------------
  1143.   # ● Dispose
  1144.   #--------------------------------------------------------------------------   
  1145.   def dispose
  1146.       return if @layout_sprite == nil
  1147.       @layout_sprite.bitmap.dispose
  1148.       @layout_sprite.dispose
  1149.       @layout_sprite = nil
  1150.       @layout_sprite2.bitmap.dispose
  1151.       @layout_sprite2.dispose
  1152.       @hp_image.dispose
  1153.       @hp_sprite.bitmap.dispose
  1154.       @hp_sprite.dispose
  1155.       @mp_image.dispose
  1156.       @mp_sprite.bitmap.dispose
  1157.       @mp_sprite.dispose         
  1158.   end  
  1159.  
  1160.   #--------------------------------------------------------------------------
  1161.   # ●  refresh_actor
  1162.   #--------------------------------------------------------------------------  
  1163.   def refresh_actor
  1164.       dispose
  1165.       initialize
  1166.   end  
  1167.  
  1168.   #--------------------------------------------------------------------------
  1169.   # ●  Update
  1170.   #--------------------------------------------------------------------------   
  1171.   def update
  1172.       if @actor == nil
  1173.          refresh_actor if $game_party.members[0] != nil
  1174.          return
  1175.       end
  1176.       update_visible
  1177.       update_position
  1178.       update_hp
  1179.       update_mp
  1180.       refresh_actor if can_refresh_hud?
  1181.   end
  1182.  
  1183.   #--------------------------------------------------------------------------
  1184.   # ● Update Position
  1185.   #--------------------------------------------------------------------------      
  1186.   def update_position
  1187.       px = $game_player.screen_x + S_HUD_POS[0]
  1188.       py = $game_player.screen_y + S_HUD_POS[1]
  1189.       @layout_sprite.x = px + S_LAYOUT_HP_POS[0]
  1190.       @layout_sprite.y = py + S_LAYOUT_HP_POS[1]
  1191.       @layout_sprite2.x = px + S_LAYOUT_MP_POS[0]
  1192.       @layout_sprite2.y = py + S_LAYOUT_MP_POS[1]
  1193.       @hp_sprite.x = px + S_METER_HP_POS[0]
  1194.       @hp_sprite.y = py + S_METER_HP_POS[1]
  1195.       @mp_sprite.x = px + S_METER_MP_POS[0]
  1196.       @mp_sprite.y = py + S_METER_MP_POS[1]      
  1197.   end
  1198.  
  1199.   #--------------------------------------------------------------------------
  1200.   # ● Update Visible
  1201.   #--------------------------------------------------------------------------
  1202.   def update_visible
  1203.       #Visible
  1204.       if $game_message.visible or $game_system.hud_visible == false
  1205.          vis = false
  1206.       else
  1207.          vis = true
  1208.       end  
  1209.       @layout_sprite.visible = vis
  1210.       @layout_sprite2.visible = vis
  1211.       @hp_sprite.visible = vis
  1212.       @mp_sprite.visible = vis
  1213.   end  
  1214.  
  1215.  
  1216.   #--------------------------------------------------------------------------
  1217.   # ● Update HP
  1218.   #--------------------------------------------------------------------------
  1219.   def update_hp
  1220.       @hp_sprite.bitmap.clear
  1221.       @hp_width = @hp_range  * @actor.hp / @actor.mhp  
  1222.           #HP Damage---------------------------------
  1223.           if @hp_width_old != @hp_width
  1224.           valor = (@hp_width_old - @hp_width) * 3 / 100
  1225.           valor = 0.5 if valor < 1                                
  1226.           @hp_width_old -= valor if @hp_width_old > @hp_width  
  1227.           if @hp_width_old < @hp_width
  1228.              @hp_width_old = @hp_width
  1229.           end      
  1230.           @hp_src_rect_old = Rect.new(@hp_flow, @hp_height,@hp_width_old, @hp_height)
  1231.           @hp_sprite.bitmap.blt(0,0, @hp_image, @hp_src_rect_old)      
  1232.           end        
  1233.       #HP Real------------------------------------
  1234.       @hp_src_rect = Rect.new(@hp_flow, 0,@hp_width, @hp_height)
  1235.       @hp_sprite.bitmap.blt(0,0, @hp_image, @hp_src_rect)         
  1236.       @hp_flow += METER_FLOW_SPEED  
  1237.       if @hp_flow >= @hp_image.width - @hp_range
  1238.          @hp_flow = 0  
  1239.       end      
  1240.   end   
  1241.  
  1242.   #--------------------------------------------------------------------------
  1243.   # ● Update MP
  1244.   #--------------------------------------------------------------------------
  1245.   def update_mp
  1246.       @mp_sprite.bitmap.clear
  1247.       @mp_width = @mp_range  * @actor.mp / @actor.mmp rescue 1
  1248.       @mp_src_rect = Rect.new(@mp_flow, 0,@mp_width, @mp_height)
  1249.       @mp_sprite.bitmap.blt(0,0, @mp_image, @mp_src_rect)         
  1250.       @mp_flow += METER_FLOW_SPEED  
  1251.       if @mp_flow >= @mp_image.width - @mp_range
  1252.          @mp_flow = 0  
  1253.       end   
  1254.   end   
  1255.  
  1256.   #--------------------------------------------------------------------------
  1257.   # ● Can Refresh Hud
  1258.   #--------------------------------------------------------------------------   
  1259.   def can_refresh_hud?
  1260.       if $game_party.members[0] == nil
  1261.          return true if @pre_leader_id != nil
  1262.       elsif $game_party.members[0] != nil   
  1263.          return true if @pre_leader_id == nil
  1264.          return true if @pre_leader_id != $game_party.members[0].id
  1265.       end  
  1266.       return false
  1267.   end
  1268.  
  1269. end
  1270.  
  1271.  
  1272. #==============================================================================
  1273. # ■ Spriteset_Map
  1274. #==============================================================================
  1275. class Spriteset_Map
  1276.  
  1277.   #--------------------------------------------------------------------------
  1278.   # ● initialize  
  1279.   #--------------------------------------------------------------------------
  1280.   alias mog_shud_initialize initialize
  1281.   def initialize  
  1282.       @shud = S_HUD.new
  1283.       mog_shud_initialize
  1284.   end
  1285.  
  1286.   #--------------------------------------------------------------------------
  1287.   # ● dispose
  1288.   #--------------------------------------------------------------------------
  1289.   alias mog_shud_dispose dispose
  1290.   def dispose   
  1291.       @shud.dispose
  1292.       mog_shud_dispose
  1293.   end
  1294.  
  1295.   #--------------------------------------------------------------------------
  1296.   # ● update   
  1297.   #--------------------------------------------------------------------------
  1298.   alias mog_shud_update update
  1299.   def update   
  1300.       @shud.update
  1301.       mog_shud_update
  1302.   end
  1303.  
  1304. end
  1305.  
  1306. $mog_rgss3_s_hud = true
  

评分

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

查看全部评分

Lv4.逐梦者 (版主)

梦石
1
星屑
5801
在线时间
2649 小时
注册时间
2013-8-23
帖子
2315

开拓者

2
发表于 2013-8-31 22:26:44 | 只看该作者
楼主辛苦了!

不过好像 行走图有点小的样子
回复 支持 反对

使用道具 举报

Lv1.梦旅人

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

整合系统大赛RMVA达人

3
 楼主| 发表于 2013-8-31 22:29:33 | 只看该作者
鑫晴 发表于 2013-8-31 22:26
楼主辛苦了!

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

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

使用道具 举报

Lv4.逐梦者 (版主)

梦石
1
星屑
5801
在线时间
2649 小时
注册时间
2013-8-23
帖子
2315

开拓者

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

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

点评

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

使用道具 举报

Lv1.梦旅人

梦石
0
星屑
50
在线时间
492 小时
注册时间
2013-6-15
帖子
206
5
发表于 2013-9-5 17:33:57 | 只看该作者
弱弱的问一句,你的敌人减血事件是怎样计算的?
回复 支持 反对

使用道具 举报

Lv1.梦旅人

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

整合系统大赛RMVA达人

6
 楼主| 发表于 2013-9-5 20:57:12 | 只看该作者
渝川 发表于 2013-9-5 17:33
弱弱的问一句,你的敌人减血事件是怎样计算的?

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

使用道具 举报

Lv4.逐梦者

梦石
0
星屑
9275
在线时间
2504 小时
注册时间
2011-5-20
帖子
15389

开拓者

7
发表于 2013-9-6 17:30:44 | 只看该作者
好东西,但是敌人多了会不会卡?

点评

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

使用道具 举报

Lv1.梦旅人

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

使用道具 举报

Lv1.梦旅人

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

整合系统大赛RMVA达人

9
 楼主| 发表于 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
回复 支持 反对

使用道具 举报

Lv1.梦旅人

梦石
0
星屑
216
在线时间
123 小时
注册时间
2008-8-23
帖子
55
10
发表于 2013-9-16 09:05:53 | 只看该作者
跳跃系统能搞好一点就好了
回复 支持 反对

使用道具 举报

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

本版积分规则

拿上你的纸笔,建造一个属于你的梦想世界,加入吧。
 注册会员
找回密码

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

GMT+8, 2024-4-26 15:25

Powered by Discuz! X3.1

© 2001-2013 Comsenz Inc.

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