創作內容

0 GP

[RMVA][XAS]自製簡單升空系統

作者:妹奈│2017-07-23 21:06:25│巴幣:0│人氣:253
這是根據XAS系統,依樣畫葫蘆寫的補充系統。
在技能欄打上<Jump = (跳躍高度)>,就擁有讓怪物擊往空中的效果。
跳躍高度建議設置在10~20左右,當然調個999讓他轟到畫面外也是可以的。
插建放在XAS系統後面即可。
#--------------------------------------------------------------------------
# ● 技能補充-升空     by吉爾
#     使用時請勿刪除此欄
#--------------------------------------------------------------------------
class Game_Action_XAS
  
  attr_accessor   :user
  attr_accessor   :id                    
  attr_accessor   :attack_id            
  attr_accessor   :attack_range
  attr_accessor   :attack_range_type
  attr_accessor   :hit_events
  attr_accessor   :now_count
  attr_accessor   :pre_now_count
  attr_accessor   :duration
  attr_accessor   :blow_power
  attr_accessor   :jump_height
  attr_accessor   :piercing
  attr_accessor   :ignore_knockback_invincible
  attr_accessor   :target_invunerable_duration
  attr_accessor   :multi_hit
  attr_accessor   :ally_damage
  attr_accessor   :all_damage
  attr_accessor   :sunflag
  attr_accessor   :self_motion
  attr_accessor   :second_animation_id
  attr_accessor   :third_animation_id
  attr_accessor   :attack_range_type
  attr_accessor   :attack_range_plan
  attr_accessor   :blow_power
  attr_accessor   :jump_height
  attr_accessor   :ignore_guard
  attr_accessor   :user_invincible  
  attr_accessor   :short_range
  attr_accessor   :first_impact_time
  attr_accessor   :animation_time
  attr_accessor   :duration
  attr_accessor   :item_cost
  attr_accessor   :hit_shake
  attr_accessor   :hit_hold_target
  attr_accessor   :hit_bounce
  attr_accessor   :sticky
  attr_accessor   :reflectable
  attr_accessor   :can_reflect
  attr_accessor   :attack_id_plan
  attr_accessor   :hit_action
  attr_accessor   :fake_id
  attr_accessor   :impact
  
  #--------------------------------------------------------------------------
  # ● initialize
  #--------------------------------------------------------------------------
  def initialize(user, action_id)
      @user        = user
      @id          = action_id
      @now_count   = 0
      @duration    = nil
      @attack_id   = 0
      @attack_range = 0
      @hit_events  = []
      @blow_power  = 0
      @skill = $data_skills[action_id]
      @ignore_knockback_invincible = false
      @multi_hit = false
      @piercing = false
      @all_damage = false
      @ally_damage = false
      @ignore_guard = false
      @sunflag = 10
      @duration = 10
      @self_motion = ""
      @attack_range_type = 1
      @attack_range_plan = 1
      @blow_power = 1
      @jump_height = 0
      @first_impact_time  = 0
      @animation_time = []
      @target_invunerable_duration = 10
      @second_animation_id = 0
      @third_animation_id = 0
      @user_invincible = false
      @short_range = false
      @item_cost = 0
      @hit_shake = false
      @hit_hold_target = false
      @hit_bounce = false
      @sticky = false
      @reflectable = false
      @can_reflect = false
      @hit_action = 0
      @fake_id = false
      @impact = true
  end
  #--------------------------------------------------------------------------
  # ● attachment (修改 BY W.S)
  #--------------------------------------------------------------------------
  def attachment(action_id)
      @attack_id_plan = [action_id]
      if @skill.note =~ /<Sunflag = (\d+)>/ or /<动作时间 = (\d+)>/
         @sunflag = $1.to_i
      end
      if @skill.note =~ /<Duration = (\d+)>/ or  @skill.note =~ /<存在时间 = (\d+)>/
         @duration = $1.to_i
       end
      if @skill.note =~ /<Pose = (\S+)>/ or @skill.note =~ /<行走图 = (\S+)>/
         @self_motion = $1.to_s
      end
      if @skill.note =~ /<Area = (\w+)>/
         case $1
            when "CROSS"   
               area = 7
            when "WALL"
               area = 6        
            when "FRONTRHOMBUS"  
               area = 5
            when "FRONTSQUARE"
               area = 4
            when "LINE"
               area = 3
            when "SQUARE"
               area = 2               
            else   
               area = 1
             end    
      elsif @skill.note =~ /<区域 = (\w+)>/
         case $1
            when "十字"   
               area = 7
            when "墙"
               area = 6        
            when "半菱形"  
               area = 5
            when "半矩形"
               area = 4
            when "直线"
               area = 3
            when "矩形"
               area = 2               
            else   
               area = 1
         end     
         @attack_range_type = area
       end
      if @skill.note =~ /<Range = (\d+)>/ or  @skill.note =~ /<范围 = (\d+)>/
         @attack_range_plan = [$1.to_i]
      end
      if @skill.note =~ /<Blow Power = (\d+)>/  or @skill.note =~ /<击退格数 = (\d+)>/
         @blow_power = $1.to_i
       end   
      if @skill.note =~ /<Jump = (\d+)>/  
         @jump_height = $1.to_i
      end
      if @skill.note =~ /<Impact Time = (\d+)>/ or   @skill.note =~ /<影响时间 = (\d+)>/ or @skill.note =~  /<Impact Time  = (\d+)>/  
         @first_impact_time = $1.to_i

       end   
      if @skill.note =~ /<Animation Time = (\d+) - (\d+)>/ or @skill.note =~ /<动画时间 = (\d+) - (\d+)>/
         @animation_time[0] = $1.to_i
         @animation_time[1] = $2.to_i
      end
      if @skill.note =~ /<Target Invunerable = (\d+)>/ or @skill.note =~ /<伤害间隔 = (\d+)>/
         @target_invunerable_duration = $1.to_i
      end  
      if @skill.note =~ /<Tool Hit Ani = (\d+)>/ or @skill.note =~ /<击中动画 = (\d+)>/      
         @second_animation_id = $1.to_i
      end         
      if @skill.note =~ /<User Hit Ani = (\d+)>/ or @skill.note =~ /<使用动画 = (\d+)>/       
         @third_animation_id = $1.to_i
      end   
      if @skill.note =~ /<Item Cost = (\d+)>/  or   @skill.note =~ /<消耗道具 = (\d+)>/
         @item_cost = $1.to_i
      end         
      if @skill.note =~ /<Link Action ID = (\d+)>/  or @skill.note =~ /<连接技能ID = (\d+)>/ or @skill.note =~ /<连接技能 = (\d+)>/
         if user.battler != nil
            user.battler.x_combo[0] = $1.to_i
            user.battler.x_combo[2] = @sunflag + 20
         end
      else     
         if user.battler != nil
            user.battler.x_combo[0] = 0
            user.battler.x_combo[1] = 0
            user.battler.x_combo[2] = 0
         end            
      end   
      if @skill.note =~ /<Hit Action ID = (\d+)>/ or @skill.note =~ /<攻击动作ID = (\d+)>/
         @hit_action = $1.to_i
      end
      if @skill.note =~ /<Ignore Knockback>/ or @skill.note =~ /<忽略击倒>/ or @skill.note =~ /<忽略击破>/
         @ignore_knockback_invincible = true
      end       
      if @skill.note =~ /<Multi Hit>/ or @skill.note =~ /<多次连击>/ or @skill.note =~ /<多重连击>/
         @multi_hit = true  
      end         
      if @skill.note =~ /<Piercing>/ or @skill.note =~ /<贯穿>/
         @piercing = true
      end
      if @skill.note =~ /<All Damage>/ or @skill.note =~ /<全域化>/
         @all_damage = true
      end
      if @skill.note =~ /<Ally Damage>/ or @skill.note =~ /<己方伤害>/
         @ally_damage = true
      end       
      if @skill.note =~ /<User Invincible>/ or @skill.note =~ /<使用者无敌>/
         @user_invincible = true
      end       
      if @skill.note =~ /<Ignore Guard>/ or @skill.note =~ /<忽略防御>/
         @ignore_guard = true
      end       
      if @skill.note =~ /<One Action>/ or @skill.note =~ /<等待结束>/ or @skill.note =~ /<等待完成>/
         unless $game_system.tools_on_map.include?(action_id)   
                $game_system.tools_on_map.push(action_id)
         end
      end       
      if @skill.note =~ /<Shake>/ or @skill.note =~ /<震动>/ or @skill.note =~ /<地震>/
         @hit_shake = true
      end
      if @skill.note =~ /<User Range>/ or @skill.note =~ /<使用者属性>/
         @short_range = true
      end      
      if @skill.note =~ /<Hit Hold Target>/ or @skill.note =~ /<按键持续>/
         @hit_hold_target = true
      end        
      if @skill.note =~ /<Hit Sticky Target>/ or @skill.note =~ /<追踪>/
         @sticky = true
      end        
      if @skill.note =~ /<Hit Bounce Direction>/ or @skill.note =~ /<击中转向>/
         @hit_bounce = true
      end   
      if @skill.note =~ /<Reflectable>/ or @skill.note =~ /<允许反射>/
         @reflectable = true
      end        
      if @skill.note =~ /<Can Reflect>/ or @skill.note =~ /<允许反击>/
         @can_reflect = true
      end  
      if @skill.note =~ /<Disable Hit>/ or @skill.note =~ /<不计入连击>/
         @impact = false
      end
      @sunflag = 1 if @sunflag <= 0
  end
end
#--------------------------------------------------------------------------
# ● 模塊擴充
#--------------------------------------------------------------------------    
module XRXS_BattlerAttachment
  #--------------------------------------------------------------------------
  # ● Execute Jump Effect
  #--------------------------------------------------------------------------      
  def execute_jump_effect(skill,bullet)
      if bullet.action.hit_hold_target and self.temp_id == 0     
         self.temp_id = bullet.id
         self.pre_move_speed = self.move_speed         
      end   
      p = bullet.action.jump_height.to_i     
      return if self.battler.damage.to_i <= 0
      return if p < 0
      self.jump2(p)  
  end
end

module XRXS_BattlerAttachment
  #--------------------------------------------------------------------------
  # ● Execute Jump Effect
  #--------------------------------------------------------------------------      
  def execute_jump_effect(skill,bullet)
      if bullet.action.hit_hold_target and self.temp_id == 0     
         self.temp_id = bullet.id
         self.pre_move_speed = self.move_speed         
      end   
      p = bullet.action.jump_height.to_i     
      return if self.battler.damage.to_i <= 0
      return if p < 0
      self.jump2(p)  
  end
end

module XRXS_BattlerAttachment
  #--------------------------------------------------------------------------
  # ● Execute Hit Effect
  #--------------------------------------------------------------------------      
  def execute_hit_effect(attacker,skill, bullet , user, tar_invu)
      shoot_effect_before_damage(skill, bullet, user)
      execute_battler_skill_effect(attacker ,skill, user)
      if target_missed?(attacker)
         self.battler.invunerable_duration = 30
         return
      end            
      execute_damage_pop(attacker,skill)
      shoot_effect_after_damage(skill, bullet, user) if can_damage_after_effect?
      execute_state_effect(skill, user,  bullet)    
      bullet.action.duration = 1 if remove_tool_after_hit?(skill, bullet, user)
      self.battler.invunerable_duration = tar_invu
      execute_blow_effect(skill,bullet) if can_blow_effect?
      execute_jump_effect(skill,bullet) if can_jump_effect?
      execute_animation(skill, bullet, user)
      execute_tool_effects(skill, bullet , user)
  end
end

    
引用網址:https://home.gamer.com.tw/TrackBack.php?sn=3655104
All rights reserved. 版權所有,保留一切權利

相關創作

留言共 0 篇留言

我要留言提醒:您尚未登入,請先登入再留言

喜歡★brian200077 可決定是否刪除您的留言,請勿發表違反站規文字。

前一篇:公會成員報到... 後一篇:自製遊戲-南極的星空20...

追蹤私訊切換新版閱覽

作品資料夾

kkll7952巴友們
+ 3月-4月遊戲製作進度+簡報分享 + https://home.gamer.com.tw/creationDetail.php?sn=5919640看更多我要大聲說3小時前


face基於日前微軟官方表示 Internet Explorer 不再支援新的網路標準,可能無法使用新的應用程式來呈現網站內容,在瀏覽器支援度及網站安全性的雙重考量下,為了讓巴友們有更好的使用體驗,巴哈姆特即將於 2019年9月2日 停止支援 Internet Explorer 瀏覽器的頁面呈現和功能。
屆時建議您使用下述瀏覽器來瀏覽巴哈姆特:
。Google Chrome(推薦)
。Mozilla Firefox
。Microsoft Edge(Windows10以上的作業系統版本才可使用)

face我們了解您不想看到廣告的心情⋯ 若您願意支持巴哈姆特永續經營,請將 gamer.com.tw 加入廣告阻擋工具的白名單中,謝謝 !【教學】