查看: 3484|回复: 1

[已经过期] 关于“无敌”状态的修改。

[复制链接]
梦石
0
星屑
3181
在线时间
1439 小时
注册时间
2009-7-27
回帖
1187
发表于 2015-8-19 01:52:02 | 显示全部楼层 |阅读模式

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

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

×
  就是说这个无敌状态脚本,如何修改成对 某些 属性的敌人才有效?比如说,1号敌人属性为没有或者其他的,攻击角色才有伤害。2号角色属性为某某某,攻击角色就没有伤害了。也就是说一些我设置了特殊的敌人攻击我方附有 无敌 状态的角色才没有伤害。请问这样说能懂吗?而且我方附有 无敌 状态时被特殊属性的敌人攻击时显示某个动画。请高手帮忙修改一下。

  1. #_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/
  2. #_/  ◆无敌状态 - KGC_Invincible◆
  3. #_/----------------------------------------------------------------------------
  4. #_/ 在状态中设置个“无敌”二字的状态即可使用。
  5. #_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/

  6. $imported = {} if $imported == nil
  7. $imported["Invincible"] = true

  8. if $game_special_states == nil
  9.   $game_special_states = {}
  10.   $data_states = load_data("Data/States.rxdata")
  11. end
  12. # 無敵状態ステートIDa取得
  13. state = $data_states.compact.find { |s| s.name == "无敌" }
  14. $game_special_states["invincible"] = state != nil ? state.id : 0

  15. #==============================================================================
  16. # ■ Game_Battler (分割定義 2)
  17. #==============================================================================

  18. class Game_Battler
  19.   #--------------------------------------------------------------------------
  20.   # ● ステート [無敵] 判定
  21.   #     act : 処理対象
  22.   #--------------------------------------------------------------------------
  23.   def invincible?(act = nil)
  24.     # ステート[無敵]が付加されている場合
  25.     if self.states.include?($game_special_states["invincible"])
  26.       # 処理対象で分岐
  27.       case act
  28.       when RPG::Skill
  29.         return true if act.scope == 1 || act.scope == 2
  30.       when RPG::Item
  31.         return true if act.scope == 1 || act.scope == 2
  32.       when nil
  33.         return true
  34.       end
  35.     end
  36.     return false
  37.   end
  38. end

  39. #★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★

  40. #==============================================================================
  41. # ■ Game_Battler (分割定義 3)
  42. #==============================================================================

  43. class Game_Battler
  44.   #--------------------------------------------------------------------------
  45.   # ● 通常攻撃の効果適用
  46.   #--------------------------------------------------------------------------
  47.   alias attack_effect_KGC_Invincible attack_effect
  48.   def attack_effect(attacker)
  49.     # 無敵状態の場合
  50.     if self.invincible?
  51.       # ダメージに "Miss" を設定
  52.       self.damage = "Miss"
  53.       # クリティカルフラグをクリア
  54.       self.critical = false
  55.       # 偽を返す
  56.       return false
  57.     end

  58.     # 元の処理を実行
  59.     return attack_effect_KGC_Invincible(attacker)
  60.   end
  61.   #--------------------------------------------------------------------------
  62.   # ● スキルの効果適用
  63.   #--------------------------------------------------------------------------
  64.   alias skill_effect_KGC_Invincible skill_effect
  65.   def skill_effect(user, skill)
  66.     # 無敵状態の場合
  67.     if self.invincible?(skill)
  68.       # ダメージに "Miss" を設定
  69.       self.damage = "Miss"
  70.       # クリティカルフラグをクリア
  71.       self.critical = false
  72.       # 偽を返す
  73.       return false
  74.     end

  75.     # 元の処理を実行
  76.     return skill_effect_KGC_Invincible(user, skill)
  77.   end
  78.   #--------------------------------------------------------------------------
  79.   # ● アイテムの効果適用
  80.   #--------------------------------------------------------------------------
  81.   alias item_effect_KGC_Invincible item_effect
  82.   def item_effect(item)
  83.     # 無敵状態の場合
  84.     if self.invincible?(item)
  85.       # ダメージに "Miss" を設定
  86.       self.damage = "Miss"
  87.       # クリティカルフラグをクリア
  88.       self.critical = false
  89.       # 偽を返す
  90.       return false
  91.     end

  92.     # 元の処理を実行
  93.     return item_effect_KGC_Invincible(item)
  94.   end
  95. end
复制代码

博客:我的博客
梦石
0
星屑
946
在线时间
61 小时
注册时间
2019-12-10
回帖
89
发表于 2021-5-6 11:34:04 | 显示全部楼层
用上了,真的无敌了
想玩我做的游戏加我qq947128749
回复

使用道具 举报

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

本版积分规则

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

在本版发帖返回顶部