查看: 1796|回复: 3

[已经解决] 关于增加最大HP的状态

[复制链接]
梦石
0
星屑
97
在线时间
2462 小时
注册时间
2011-12-18
回帖
1419
发表于 2012-6-13 11:09:56 | 显示全部楼层 |阅读模式

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

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

×
怎么做一个状态,在该状态下角色的最大HP增加30%?
这是一个深不见底的坑,这是一个广袤无边的坑,我才刚刚放上了一抔泥土……

《六道·陈国篇》开坑了……↓点我
梦石
0
星屑
80
在线时间
290 小时
注册时间
2012-6-8
回帖
101
发表于 2012-6-13 12:25:46 | 显示全部楼层
本帖最后由 UdlDruid 于 2012-6-13 12:28 编辑

好吧我没听懂。。。
原来VX不能弄成HP,MP上限的。。。
白弄刚才的帖子和截图了{:2_271:}
↓已经作废。。。
1.jpg
2.jpg
3.jpg

评分

参与人数 1星屑 +100 收起 理由
Luciffer + 100 我很赞同

查看全部评分

冰龙龙我最喜欢了~~快快点击让他们更强壮吧
回复

使用道具 举报

梦·贤者

梦石
0
星屑
50
在线时间
1141 小时
注册时间
2007-12-15
回帖
4075
发表于 2012-6-13 18:47:22 | 显示全部楼层
本帖最后由 tommay 于 2012-6-13 20:37 编辑

Game_Battler里修改下面的方法:
  def maxhp
    maxhp = base_maxhp + @maxhp_plus
    maxhp = Integer(1.3 * maxhp) if state?(999)
    return [[maxhp, 1].max, maxhp_limit].min
  end

注:999号状态就是最大HP增加30%的状态(可更改序号)

点评

修改了,可是不行哦  发表于 2012-6-13 22:43
感谢楼上的点评,疏忽了抱歉。  发表于 2012-6-13 20:37
额……脚本第3行的maphp应该改成maxhp。  发表于 2012-6-13 20:36

评分

参与人数 1星屑 +160 收起 理由
Luciffer + 160 我很赞同

查看全部评分

http://rpg.blue/home.php?mod=space&uid=34951&do=blog&id=12799
回复

使用道具 举报

梦石
0
星屑
50
在线时间
181 小时
注册时间
2010-7-20
回帖
288
发表于 2012-6-13 23:25:43 | 显示全部楼层
  1. #_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/
  2. #_/    ◆ 200x/XP 機能再現 - KGC_ReproduceFunctions ◆ VX ◆
  3. #_/    ◇ Last update : 2009/01/02 ◇
  4. #_/----------------------------------------------------------------------------
  5. #_/  200x/XP の機能を再現します。
  6. #_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/

  7. #==============================================================================
  8. # ★ カスタマイズ項目 - Customize BEGIN ★
  9. #==============================================================================

  10. module KGC
  11. module ReproduceFunctions
  12.   # ◆ MP 消費武器使用時、消費した MP を表示する
  13.   SHOW_WEAPON_MP_COST_ON_ATTACK = true

  14.   # ◆ 「武器属性」と見なす属性の範囲
  15.   #  この属性を持つスキルは、同じ属性を持つ武器を装備していないと
  16.   #  使用できなくなります。
  17.   #   ※素手は 1(格闘)扱いです。
  18.   #  範囲オブジェクト(1..6 など)または整数の配列で指定します。
  19.   WEAPON_ELEMENTS = []
  20.   # [1..6] は [1, 2, 3, 4, 5, 6] と書いてもOK。
  21.   # [1..4, 5, 6] のように、両方が混ざってもOK。
  22. end
  23. end

  24. #==============================================================================
  25. # ☆ カスタマイズ項目終了 - Customize END ☆
  26. #==============================================================================

  27. $imported = {} if $imported == nil
  28. $imported["ReproduceFunctions"] = true

  29. module KGC::ReproduceFunctions
  30.   #--------------------------------------------------------------------------
  31.   # ○ 武器属性を整数配列に変換
  32.   #--------------------------------------------------------------------------
  33.   def self.create_weapon_element_list
  34.     result = []
  35.     WEAPON_ELEMENTS.each { |e|
  36.       if e.is_a?(Range)
  37.         result |= e.to_a
  38.       elsif e.is_a?(Integer)
  39.         result |= [e]
  40.       end
  41.     }
  42.     return result.sort
  43.   end

  44.   # 武器属性配列
  45.   WEAPON_ELEMENT_ID_LIST = create_weapon_element_list

  46.   # 正規表現を定義
  47.   module Regexp
  48.     # ベースアイテム
  49.     module BaseItem
  50.       # オートステート
  51.       AUTO_STATE = /<(?:AUTO_STATE|オートステート)\s*(\d+(?:\s*,\s*\d+)*)>/i
  52.       # 全体攻撃
  53.       WHOLE_ATTACK = /<(?:WHOLE_ATTACK|全体攻撃)>/i
  54.       # 回避率無視
  55.       IGNORE_EVA = /<(?:IGNORE_EVA|回避率無視)>/i
  56.       # 消費MP
  57.       MP_COST = /<(?:MP_COST|消費MP)\s*([\-]?\d+)>/i
  58.       # クリティカル率
  59.       CRITICAL = /<(?:CRITICAL|クリティカル率)\s*(\-?\d+)>/i
  60.     end

  61.     # アイテム
  62.     module Item
  63.       # アイテム使用回数
  64.       MULTI_USABLE = /<(?:MULTI_USABLE|使用回数)\s*(\d+)>/i
  65.       # スキル発動アイテム
  66.       EXEC_SKILL = /<(?:EXEC_SKILL|スキル発動)\s*(\d+)>/i
  67.     end

  68.     # エネミー
  69.     module Enemy
  70.       # 半透明
  71.       TRANSLUCENT = /<(?:TRANSLUCENT|半透明)>/i
  72.       # クリティカル率
  73.       CRITICAL = /<(?:CRITICAL|クリティカル率)\s*(\d+)>/i
  74.     end

  75.     # ステート
  76.     module State
  77.       # パラメータ名
  78.       PARAMETER_NAME = {
  79.         "maxhp"=>"MAXHP_RATE|最大HP",
  80.         "maxmp"=>"MAXMP_RATE|最大MP"
  81.       }
  82.       # 打撃関係度で封印 (日本語)
  83.       SEAL_ATK_F_JP = /<打撃関係度\s*(\d+)\s*以上封印>/
  84.       # 打撃関係度で封印 (英語)
  85.       SEAL_ATK_F_EN = /<SEAL_ATK_F\s*(\d+)>/i
  86.       # 精神関係度で封印 (日本語)
  87.       SEAL_SPI_F_JP = /<精神関係度\s*(\d+)\s*以上封印>/
  88.       # 精神関係度で封印 (英語)
  89.       SEAL_SPI_F_EN = /<SEAL_SPI_F\s*(\d+)>/i
  90.       # 付加ステート
  91.       PLUS_STATE = /<(?:PLUS_STATE|付加ステート)\s*(\d+(?:\s*,\s*\d+)*)>/i
  92.     end
  93.   end
  94. end

  95. #★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★

  96. #==============================================================================
  97. # ■ RPG::BaseItem
  98. #==============================================================================

  99. class RPG::BaseItem
  100.   #--------------------------------------------------------------------------
  101.   # ○ 再現機能のキャッシュ生成
  102.   #--------------------------------------------------------------------------
  103.   def create_reproduce_functions_cache
  104.     @__whole_attack = false
  105.     @__ignore_eva = false
  106.     @__mp_cost = 0
  107.     @__cri = 0

  108.     self.note.each_line { |line|
  109.       case line
  110.       when KGC::ReproduceFunctions::Regexp::BaseItem::WHOLE_ATTACK
  111.         # 全体攻撃
  112.         @__whole_attack = true
  113.       when KGC::ReproduceFunctions::Regexp::BaseItem::IGNORE_EVA
  114.         # 回避率無視
  115.         @__ignore_eva = true
  116.       when KGC::ReproduceFunctions::Regexp::BaseItem::MP_COST
  117.         # 通常攻撃消費 MP
  118.         @__mp_cost += $1.to_i
  119.       when KGC::ReproduceFunctions::Regexp::BaseItem::CRITICAL
  120.         # クリティカル修正
  121.         @__cri += $1.to_i
  122.       end
  123.     }

  124.     create_auto_state_cache
  125.   end
  126.   #--------------------------------------------------------------------------
  127.   # ○ オートステートのキャッシュ生成
  128.   #--------------------------------------------------------------------------
  129.   def create_auto_state_cache
  130.     # ID のキャッシュ生成
  131.     @__auto_state_ids = []
  132.     @__auto_state_ids_battle = []
  133.     self.note.each_line { |line|
  134.       next unless line =~ KGC::ReproduceFunctions::Regexp::BaseItem::AUTO_STATE
  135.       $1.scan(/\d+/).each { |num|
  136.         if (state = $data_states[num.to_i]) != nil
  137.           @__auto_state_ids_battle << state.id
  138.           unless state.battle_only
  139.             @__auto_state_ids << state.id
  140.           end
  141.         end
  142.       }
  143.     }

  144.     # オブジェクトのキャッシュ作成
  145.     @__auto_states = []
  146.     @__auto_state_ids.each { |i|
  147.       @__auto_states << $data_states[i]
  148.     }
  149.     @__auto_states_battle = []
  150.     @__auto_state_ids_battle.each { |i|
  151.       @__auto_states_battle << $data_states[i]
  152.     }
  153.   end
  154.   #--------------------------------------------------------------------------
  155.   # ○ 全体攻撃判定
  156.   #--------------------------------------------------------------------------
  157.   def whole_attack
  158.     create_reproduce_functions_cache if @__whole_attack == nil
  159.     return @__whole_attack
  160.   end
  161.   #--------------------------------------------------------------------------
  162.   # ○ 回避無視判定
  163.   #--------------------------------------------------------------------------
  164.   def ignore_eva
  165.     create_reproduce_functions_cache if @__ignore_eva == nil
  166.     return @__ignore_eva
  167.   end
  168.   #--------------------------------------------------------------------------
  169.   # ○ 通常攻撃消費 MP
  170.   #--------------------------------------------------------------------------
  171.   def mp_cost
  172.     create_reproduce_functions_cache if @__mp_cost == nil
  173.     return @__mp_cost
  174.   end
  175.   #--------------------------------------------------------------------------
  176.   # ○ クリティカル修正
  177.   #--------------------------------------------------------------------------
  178.   def cri
  179.     create_reproduce_functions_cache if @__cri == nil
  180.     return @__cri
  181.   end
  182.   #--------------------------------------------------------------------------
  183.   # ○ オートステート ID
  184.   #--------------------------------------------------------------------------
  185.   def auto_state_ids
  186.     return ($game_temp.in_battle ? auto_state_ids_battle : auto_state_ids_always)
  187.   end
  188.   #--------------------------------------------------------------------------
  189.   # ○ オートステート ID (常時)
  190.   #--------------------------------------------------------------------------
  191.   def auto_state_ids_always
  192.     create_reproduce_functions_cache if @__auto_state_ids == nil
  193.     return @__auto_state_ids
  194.   end
  195.   #--------------------------------------------------------------------------
  196.   # ○ オートステート ID (戦闘時)
  197.   #--------------------------------------------------------------------------
  198.   def auto_state_ids_battle
  199.     create_reproduce_functions_cache if @__auto_state_ids_battle == nil
  200.     return @__auto_state_ids_battle
  201.   end
  202.   #--------------------------------------------------------------------------
  203.   # ○ オートステート
  204.   #--------------------------------------------------------------------------
  205.   def auto_states
  206.     return ($game_temp.in_battle ? auto_states_battle : auto_states_always)
  207.   end
  208.   #--------------------------------------------------------------------------
  209.   # ○ オートステート (常時)
  210.   #--------------------------------------------------------------------------
  211.   def auto_states_always
  212.     create_reproduce_functions_cache if @__auto_states == nil
  213.     return @__auto_states
  214.   end
  215.   #--------------------------------------------------------------------------
  216.   # ○ オートステート (戦闘時)
  217.   #--------------------------------------------------------------------------
  218.   def auto_states_battle
  219.     create_reproduce_functions_cache if @__auto_states_battle == nil
  220.     return @__auto_states_battle
  221.   end
  222. end

  223. #★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★

  224. #==============================================================================
  225. # ■ RPG::Item
  226. #==============================================================================

  227. class RPG::Item < RPG::UsableItem
  228.   #--------------------------------------------------------------------------
  229.   # ○ 再現機能のキャッシュ生成
  230.   #--------------------------------------------------------------------------
  231.   def create_reproduce_functions_cache
  232.     super
  233.     @__usable_count = 1
  234.     @__skill_id = 0

  235.     self.note.each_line { |line|
  236.       case line
  237.       when KGC::ReproduceFunctions::Regexp::Item::MULTI_USABLE
  238.         # 使用可能回数
  239.         @__usable_count = $1.to_i
  240.       when KGC::ReproduceFunctions::Regexp::Item::EXEC_SKILL
  241.         # 発動スキル ID
  242.         @__skill_id = $1.to_i
  243.       end
  244.     }
  245.   end
  246.   #--------------------------------------------------------------------------
  247.   # ● アニメーション ID
  248.   #--------------------------------------------------------------------------
  249.   def animation_id
  250.     if exec_skill?
  251.       return $data_skills[skill_id].animation_id
  252.     else
  253.       return @animation_id
  254.     end
  255.   end
  256.   #--------------------------------------------------------------------------
  257.   # ○ 使用可能回数
  258.   #--------------------------------------------------------------------------
  259.   def usable_count
  260.     create_reproduce_functions_cache if @__usable_count == nil
  261.     return @__usable_count
  262.   end
  263.   #--------------------------------------------------------------------------
  264.   # ○ スキル発動判定
  265.   #--------------------------------------------------------------------------
  266.   def exec_skill?
  267.     return (skill_id > 0)
  268.   end
  269.   #--------------------------------------------------------------------------
  270.   # ○ 発動スキル ID
  271.   #--------------------------------------------------------------------------
  272.   def skill_id
  273.     create_reproduce_functions_cache if @__skill_id == nil
  274.     return @__skill_id
  275.   end
  276. end

  277. #★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★

  278. #==============================================================================
  279. # ■ RPG::Skill
  280. #==============================================================================

  281. class RPG::Skill < RPG::UsableItem
  282.   #--------------------------------------------------------------------------
  283.   # ○ 再現機能のキャッシュ生成
  284.   #--------------------------------------------------------------------------
  285.   def create_reproduce_functions_cache
  286.     super

  287.     @__weapon_element_set =
  288.       self.element_set & KGC::ReproduceFunctions::WEAPON_ELEMENT_ID_LIST
  289.   end
  290.   #--------------------------------------------------------------------------
  291.   # ○ 使用時に必要な武器属性を取得
  292.   #--------------------------------------------------------------------------
  293.   def weapon_element_set
  294.     create_reproduce_functions_cache if @__weapon_element_set == nil
  295.     return @__weapon_element_set
  296.   end
  297. end

  298. #★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★

  299. #==============================================================================
  300. # ■ RPG::Enemy
  301. #==============================================================================

  302. class RPG::Enemy
  303.   #--------------------------------------------------------------------------
  304.   # ○ 再現機能のキャッシュ生成
  305.   #--------------------------------------------------------------------------
  306.   def create_reproduce_functions_cache
  307.     @__translucent = false
  308.     @__cri = 0

  309.     self.note.each_line { |line|
  310.       case line
  311.       when KGC::ReproduceFunctions::Regexp::Enemy::TRANSLUCENT
  312.         # 半透明
  313.         @__translucent = true
  314.       when KGC::ReproduceFunctions::Regexp::Enemy::CRITICAL
  315.         # クリティカル修正
  316.         @__cri += $1.to_i
  317.       end
  318.     }
  319.   end
  320.   #--------------------------------------------------------------------------
  321.   # ○ 半透明
  322.   #--------------------------------------------------------------------------
  323.   def translucent?
  324.     create_reproduce_functions_cache if @__translucent == nil
  325.     return @__translucent
  326.   end
  327.   #--------------------------------------------------------------------------
  328.   # ○ クリティカル修正
  329.   #--------------------------------------------------------------------------
  330.   def cri
  331.     create_reproduce_functions_cache if @__cri == nil
  332.     return @__cri
  333.   end
  334. end

  335. #★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★

  336. #==============================================================================
  337. # ■ RPG::State
  338. #==============================================================================

  339. class RPG::State
  340.   #--------------------------------------------------------------------------
  341.   # ○ 再現機能のキャッシュ生成
  342.   #--------------------------------------------------------------------------
  343.   def create_reproduce_functions_cache
  344.     @__seal_atk_f = 999
  345.     @__seal_spi_f = 999
  346.     @__plus_state_set = []

  347.     self.note.each_line { |line|
  348.       case line
  349.       when KGC::ReproduceFunctions::Regexp::State::SEAL_ATK_F_JP,
  350.            KGC::ReproduceFunctions::Regexp::State::SEAL_ATK_F_EN
  351.         # 封印するスキルの打撃関係度
  352.         @__seal_atk_f = $1.to_i
  353.       when KGC::ReproduceFunctions::Regexp::State::SEAL_SPI_F_JP,
  354.            KGC::ReproduceFunctions::Regexp::State::SEAL_SPI_F_EN
  355.         # 封印するスキルの精神関係度
  356.         @__seal_spi_f = $1.to_i
  357.       when KGC::ReproduceFunctions::Regexp::State::PLUS_STATE
  358.         # 付加ステート
  359.         $1.scan(/\d+/).each { |num|
  360.           if (state = $data_states[num.to_i]) != nil
  361.             @__plus_state_set << state.id
  362.           end
  363.         }
  364.       end
  365.     }

  366.     create_parameter_rate_cache
  367.   end
  368.   #--------------------------------------------------------------------------
  369.   # ○ パラメータ修正値のキャッシュ生成
  370.   #--------------------------------------------------------------------------
  371.   def create_parameter_rate_cache
  372.     @__parameter_rate = {}
  373.     # 初期化
  374.     KGC::ReproduceFunctions::Regexp::State::PARAMETER_NAME.each_key { |k|
  375.       @__parameter_rate[k] = 100
  376.     }
  377.     # メモ反映
  378.     self.note.each_line { |line|
  379.       KGC::ReproduceFunctions::Regexp::State::PARAMETER_NAME.each { |k, v|
  380.         if line =~ /<(?:#{v})[ ]*(\d+)[%%]>/i
  381.           @__parameter_rate[k] = @__parameter_rate[k] * $1.to_i / 100
  382.           break
  383.         end
  384.       }
  385.     }
  386.   end
  387.   #--------------------------------------------------------------------------
  388.   # ○ MaxHP 修正
  389.   #--------------------------------------------------------------------------
  390.   def maxhp_rate
  391.     create_reproduce_functions_cache if @__parameter_rate == nil
  392.     return @__parameter_rate["maxhp"]
  393.   end
  394.   #--------------------------------------------------------------------------
  395.   # ○ MaxMP 修正
  396.   #--------------------------------------------------------------------------
  397.   def maxmp_rate
  398.     create_reproduce_functions_cache if @__parameter_rate == nil
  399.     return @__parameter_rate["maxmp"]
  400.   end
  401.   #--------------------------------------------------------------------------
  402.   # ○ 封印するスキルの打撃関係度
  403.   #--------------------------------------------------------------------------
  404.   def seal_atk_f
  405.     create_reproduce_functions_cache if @__seal_atk_f == nil
  406.     return @__seal_atk_f
  407.   end
  408.   #--------------------------------------------------------------------------
  409.   # ○ 封印するスキルの精神関係度
  410.   #--------------------------------------------------------------------------
  411.   def seal_spi_f
  412.     create_reproduce_functions_cache if @__seal_spi_f == nil
  413.     return @__seal_spi_f
  414.   end
  415.   #--------------------------------------------------------------------------
  416.   # ○ 付加ステート
  417.   #--------------------------------------------------------------------------
  418.   def plus_state_set
  419.     create_reproduce_functions_cache if @__plus_state_set == nil
  420.     return @__plus_state_set
  421.   end
  422. end

  423. #★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★

  424. #==============================================================================
  425. # ■ Game_Temp
  426. #==============================================================================

  427. class Game_Temp
  428.   #--------------------------------------------------------------------------
  429.   # ● 公開インスタンス変数
  430.   #--------------------------------------------------------------------------
  431.   attr_accessor :exec_skill_on_item       # アイテムによるスキル発動フラグ
  432.   #--------------------------------------------------------------------------
  433.   # ● オブジェクト初期化
  434.   #--------------------------------------------------------------------------
  435.   alias initialize_KGC_ReproduceFunctions initialize
  436.   def initialize
  437.     initialize_KGC_ReproduceFunctions

  438.     @exec_skill_on_item = false
  439.   end
  440. end

  441. #★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★

  442. #==============================================================================
  443. # ■ Game_Battler
  444. #==============================================================================

  445. class Game_Battler
  446.   #--------------------------------------------------------------------------
  447.   # ● 現在のステートをオブジェクトの配列で取得
  448.   #--------------------------------------------------------------------------
  449.   alias states_KGC_ReproduceFunctions states
  450.   def states
  451.     result = states_KGC_ReproduceFunctions + auto_states
  452.     result.sort! { |a, b| b.priority <=> a.priority }
  453.     return result
  454.   end
  455.   #--------------------------------------------------------------------------
  456.   # ● MaxHP の取得
  457.   #--------------------------------------------------------------------------
  458.   alias maxhp_KGC_ReproduceFunctions maxhp
  459.   def maxhp
  460.     n = maxhp_KGC_ReproduceFunctions
  461.     states.each { |state| n *= state.maxhp_rate / 100.0 }
  462.     return [[Integer(n), 1].max, maxhp_limit].min
  463.   end
  464.   #--------------------------------------------------------------------------
  465.   # ● MaxMP の取得
  466.   #--------------------------------------------------------------------------
  467.   alias maxmp_KGC_ReproduceFunctions maxmp
  468.   def maxmp
  469.     n = maxmp_KGC_ReproduceFunctions
  470.     states.each { |state| n *= state.maxmp_rate / 100.0 }
  471.     limit = (defined?(maxmp_limit) ? maxmp_limit : 9999)
  472.     return [[Integer(n), 0].max, limit].min
  473.   end
  474.   #--------------------------------------------------------------------------
  475.   # ● HP の取得
  476.   #--------------------------------------------------------------------------
  477.   alias hp_KGC_ReproduceFunctions_Battler hp
  478.   def hp
  479.     @hp = maxhp if @hp > maxhp
  480.     return hp_KGC_ReproduceFunctions_Battler
  481.   end
  482.   #--------------------------------------------------------------------------
  483.   # ● MP の取得
  484.   #--------------------------------------------------------------------------
  485.   alias mp_KGC_ReproduceFunctions_Battler mp
  486.   def mp
  487.     @mp = maxmp if @mp > maxmp
  488.     return mp_KGC_ReproduceFunctions_Battler
  489.   end
  490.   #--------------------------------------------------------------------------
  491.   # ○ オートステートの ID を取得
  492.   #--------------------------------------------------------------------------
  493.   def auto_state_ids
  494.     return auto_states(true)
  495.   end
  496.   #--------------------------------------------------------------------------
  497.   # ○ オートステートの配列を取得
  498.   #     id_only : ID のみを取得
  499.   #--------------------------------------------------------------------------
  500.   def auto_states(id_only = false)
  501.     return []
  502.   end
  503.   #--------------------------------------------------------------------------
  504.   # ● ステートの検査
  505.   #     state_id : ステート ID
  506.   #    該当するステートが付加されていれば true を返す。
  507.   #--------------------------------------------------------------------------
  508.   alias state_KGC_ReproduceFunctions? state?
  509.   def state?(state_id)
  510.     return (state_KGC_ReproduceFunctions?(state_id) || auto_state?(state_id))
  511.   end
  512.   #--------------------------------------------------------------------------
  513.   # ● ステートの付加
  514.   #     state_id : ステート ID
  515.   #--------------------------------------------------------------------------
  516.   alias add_state_KGC_ReproduceFunctions add_state
  517.   def add_state(state_id)
  518.     last_states = @states.dup

  519.     add_state_KGC_ReproduceFunctions(state_id)

  520.     if (@states - last_states).include?(state_id)  # ステートが付加された場合
  521.       state = $data_states[state_id]
  522.       # [付加するステート] を適用
  523.       state.plus_state_set.each { |i|
  524.         add_state(i)
  525.       }
  526.     end
  527.   end
  528.   #--------------------------------------------------------------------------
  529.   # ○ オートステートの検査
  530.   #     state_id : ステート ID
  531.   #    該当するステートが付加されていれば true を返す。
  532.   #--------------------------------------------------------------------------
  533.   def auto_state?(state_id)
  534.     return auto_state_ids.include?(state_id)
  535.   end
  536.   #--------------------------------------------------------------------------
  537.   # ● ステートの解除
  538.   #     state_id : ステート ID
  539.   #--------------------------------------------------------------------------
  540.   alias remove_state_KGC_ReproduceFunctions remove_state
  541.   def remove_state(state_id)
  542.     if auto_state?(state_id)  # オートステートは解除しない
  543.       return
  544.     end

  545.     remove_state_KGC_ReproduceFunctions(state_id)
  546.   end
  547.   #--------------------------------------------------------------------------
  548.   # ○ 半透明化判定
  549.   #--------------------------------------------------------------------------
  550.   def translucent?
  551.     # エネミーの場合は Game_Enemy で再定義
  552.     return false
  553.   end
  554.   #--------------------------------------------------------------------------
  555.   # ○ 装備オプション [全体攻撃] の取得
  556.   #--------------------------------------------------------------------------
  557.   def whole_attack
  558.     return false
  559.   end
  560.   #--------------------------------------------------------------------------
  561.   # ○ 装備オプション [回避無視] の取得
  562.   #--------------------------------------------------------------------------
  563.   def ignore_eva
  564.     return false
  565.   end
  566.   #--------------------------------------------------------------------------
  567.   # ○ MP ダメージ加算
  568.   #     value : 加算する値
  569.   #--------------------------------------------------------------------------
  570.   def add_mp_damage(value)
  571.     @mp_damage += value
  572.   end
  573.   #--------------------------------------------------------------------------
  574.   # ○ 通常攻撃の消費 MP 計算
  575.   #--------------------------------------------------------------------------
  576.   def calc_attack_mp_cost
  577.     return 0
  578.   end
  579.   #--------------------------------------------------------------------------
  580.   # ● スキルの使用可能判定
  581.   #     skill : スキル
  582.   #--------------------------------------------------------------------------
  583.   alias skill_can_use_KGC_ReproduceFunctions? skill_can_use?
  584.   def skill_can_use?(skill)
  585.     return false unless skill.is_a?(RPG::Skill)
  586.     unless $imported["CooperationSkill"] && $game_temp.judging_cooperation_skill
  587.       return false if skill_seal?(skill)
  588.       return false unless skill_satisfied_weapon_element?(skill)
  589.     end

  590.     return skill_can_use_KGC_ReproduceFunctions?(skill)
  591.   end
  592.   #--------------------------------------------------------------------------
  593.   # ○ スキル封印判定
  594.   #--------------------------------------------------------------------------
  595.   def skill_seal?(skill)
  596.     return (seal_atk_f <= skill.atk_f || seal_spi_f <= skill.spi_f)
  597.   end
  598.   #--------------------------------------------------------------------------
  599.   # ○ 封印する打撃関係度を取得
  600.   #--------------------------------------------------------------------------
  601.   def seal_atk_f
  602.     n = 999
  603.     states.each { |state| n = [n, state.seal_atk_f].min }
  604.     return n
  605.   end
  606.   #--------------------------------------------------------------------------
  607.   # ○ 封印する精神関係度を取得
  608.   #--------------------------------------------------------------------------
  609.   def seal_spi_f
  610.     n = 999
  611.     states.each { |state| n = [n, state.seal_spi_f].min }
  612.     return n
  613.   end
  614.   #--------------------------------------------------------------------------
  615.   # ○ 必要な武器属性を満たしているか判定
  616.   #--------------------------------------------------------------------------
  617.   def skill_satisfied_weapon_element?(skill)
  618.     return true
  619.   end
  620.   #--------------------------------------------------------------------------
  621.   # ● 最終回避率の計算
  622.   #     user : 攻撃者、スキルまたはアイテムの使用者
  623.   #     obj  : スキルまたはアイテム (通常攻撃の場合は nil)
  624.   #--------------------------------------------------------------------------
  625.   alias calc_eva_KGC_ReproduceFunctions calc_eva
  626.   def calc_eva(user, obj = nil)
  627.     eva = calc_eva_KGC_ReproduceFunctions(user, obj)

  628.     if obj == nil && user.ignore_eva  # 通常攻撃かつ回避無視の場合
  629.       eva = 0
  630.     end
  631.     return eva
  632.   end
  633.   #--------------------------------------------------------------------------
  634.   # ● アイテムの効果適用
  635.   #     user : アイテムの使用者
  636.   #     item : アイテム
  637.   #--------------------------------------------------------------------------
  638.   alias item_effect_KGC_ReproduceFunctions item_effect
  639.   def item_effect(user, item)
  640.     # スキル発動判定
  641.     if item.exec_skill?
  642.       $game_temp.exec_skill_on_item = true
  643.       skill_effect(user, $data_skills[item.skill_id])
  644.       $game_temp.exec_skill_on_item = false
  645.     else
  646.       item_effect_KGC_ReproduceFunctions(user, item)
  647.     end
  648.   end
  649. end

  650. #★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★

  651. #==============================================================================
  652. # ■ Game_BattleAction
  653. #==============================================================================

  654. class Game_BattleAction
  655.   #--------------------------------------------------------------------------
  656.   # ● 通常攻撃のターゲット作成
  657.   #--------------------------------------------------------------------------
  658.   alias make_attack_targets_KGC_ReproduceFunctions make_attack_targets
  659.   def make_attack_targets
  660.     unless battler.whole_attack  # 全体攻撃でない
  661.       return make_attack_targets_KGC_ReproduceFunctions
  662.     end

  663.     targets = []
  664.     if battler.confusion?
  665.       targets += friends_unit.existing_members
  666.     else
  667.       targets += opponents_unit.existing_members
  668.     end
  669.     if battler.dual_attack      # 連続攻撃
  670.       targets += targets
  671.     end
  672.     return targets.compact
  673.   end
  674. end

  675. #★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★

  676. #==============================================================================
  677. # ■ Game_Actor
  678. #==============================================================================

  679. class Game_Actor < Game_Battler
  680.   #--------------------------------------------------------------------------
  681.   # ● クリティカル率の取得
  682.   #--------------------------------------------------------------------------
  683.   alias cri_KGC_ReproduceFunctions cri
  684.   def cri
  685.     n = cri_KGC_ReproduceFunctions

  686.     equips.compact.each { |item| n += item.cri }
  687.     return n
  688.   end
  689.   #--------------------------------------------------------------------------
  690.   # ○ オートステートの配列を取得
  691.   #     id_only : ID のみを取得
  692.   #--------------------------------------------------------------------------
  693.   def auto_states(id_only = false)
  694.     result = []
  695.     equips.compact.each { |item|
  696.       result |= (id_only ? item.auto_state_ids : item.auto_states)
  697.     }
  698.     return result
  699.   end
  700.   #--------------------------------------------------------------------------
  701.   # ○ 装備オプション [全体攻撃] の取得
  702.   #--------------------------------------------------------------------------
  703.   def whole_attack
  704.     equips.compact.each { |item|
  705.       return true if item.whole_attack
  706.     }
  707.     return false
  708.   end
  709.   #--------------------------------------------------------------------------
  710.   # ○ 装備オプション [回避無視] の取得
  711.   #--------------------------------------------------------------------------
  712.   def ignore_eva
  713.     equips.compact.each { |item|
  714.       return true if item.ignore_eva
  715.     }
  716.     return false
  717.   end
  718.   #--------------------------------------------------------------------------
  719.   # ○ 通常攻撃の消費 MP 計算
  720.   #--------------------------------------------------------------------------
  721.   def calc_attack_mp_cost
  722.     n = 0
  723.     equips.compact.each { |item|
  724.       n += item.mp_cost
  725.     }
  726.     return n
  727.   end
  728.   #--------------------------------------------------------------------------
  729.   # ○ 必要な武器属性を満たしているか判定
  730.   #--------------------------------------------------------------------------
  731.   def skill_satisfied_weapon_element?(skill)
  732.     elements = skill.weapon_element_set
  733.     return (self.element_set & elements) == elements
  734.   end
  735. end

  736. #★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★

  737. #==============================================================================
  738. # ■ Game_Enemy
  739. #==============================================================================

  740. class Game_Enemy < Game_Battler
  741.   #--------------------------------------------------------------------------
  742.   # ○ 半透明化判定
  743.   #--------------------------------------------------------------------------
  744.   def translucent?
  745.     return enemy.translucent?
  746.   end
  747.   #--------------------------------------------------------------------------
  748.   # ● クリティカル率の取得
  749.   #--------------------------------------------------------------------------
  750.   alias cri_KGC_ReproduceFunctions cri
  751.   def cri
  752.     n = cri_KGC_ReproduceFunctions
  753.     if enemy.has_critical && enemy.cri != 0
  754.       n += enemy.cri - 10
  755.     end
  756.     return n
  757.   end
  758. end

  759. #★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★

  760. #==============================================================================
  761. # ■ Game_Party
  762. #==============================================================================

  763. class Game_Party < Game_Unit
  764.   #--------------------------------------------------------------------------
  765.   # ● オブジェクト初期化
  766.   #--------------------------------------------------------------------------
  767.   alias initialize_KGC_ReproduceFunctions initialize
  768.   def initialize
  769.     initialize_KGC_ReproduceFunctions

  770.     @item_use_count = {}  # 所持品使用回数ハッシュ (アイテム ID)
  771.   end
  772.   #--------------------------------------------------------------------------
  773.   # ● アイテムの減少
  774.   #     item          : アイテム
  775.   #     n             : 個数
  776.   #     include_equip : 装備品も含める
  777.   #--------------------------------------------------------------------------
  778.   alias lose_item_KGC_ReproduceFunctions lose_item
  779.   def lose_item(item, n, include_equip = false)
  780.     lose_item_KGC_ReproduceFunctions(item, n, include_equip)

  781.     # アイテムが無くなったら使用回数をリセット
  782.     if item.is_a?(RPG::Item) && item.consumable && item_number(item) == 0
  783.       @item_use_count[item.id] = 0
  784.     end
  785.   end
  786.   #--------------------------------------------------------------------------
  787.   # ● アイテムの消耗
  788.   #     item : アイテム
  789.   #--------------------------------------------------------------------------
  790.   alias consume_item_KGC_ReproduceFunctions consume_item
  791.   def consume_item(item)
  792.     if item.is_a?(RPG::Item) && item.consumable
  793.       update_use_count(item)

  794.       # 使用回数が 0 の場合のみ消耗
  795.       if @item_use_count[item.id] == 0
  796.         consume_item_KGC_ReproduceFunctions(item)
  797.       end
  798.     else
  799.       consume_item_KGC_ReproduceFunctions(item)
  800.     end
  801.   end
  802.   #--------------------------------------------------------------------------
  803.   # ○ 使用回数の更新
  804.   #     item : アイテム
  805.   #    指定アイテムの使用回数を 1 増やす。
  806.   #    使用後に消耗する場合は、使用回数を 0 にする。
  807.   #--------------------------------------------------------------------------
  808.   def update_use_count(item)
  809.     if @item_use_count == nil
  810.       @item_use_count = {}
  811.     end

  812.     unless @item_use_count.has_key?(item.id)
  813.       @item_use_count[item.id] = 0
  814.     end
  815.     @item_use_count[item.id] += 1
  816.     # 使用可能回数に達したら、使用回数を 0 にする
  817.     if @item_use_count[item.id] >= item.usable_count
  818.       @item_use_count[item.id] = 0
  819.     end
  820.   end
  821. end

  822. #★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★

  823. #==============================================================================
  824. # ■ Sprite_Battler
  825. #==============================================================================

  826. class Sprite_Battler < Sprite_Base
  827.   #--------------------------------------------------------------------------
  828.   # ● エフェクトの更新
  829.   #--------------------------------------------------------------------------
  830.   alias update_effect_KGC_ReproduceFunctions update_effect
  831.   def update_effect
  832.     # エフェクト実行前に半透明化判定をしておく
  833.     trans_flag = (@effect_duration > 0 && @battler.translucent?)

  834.     update_effect_KGC_ReproduceFunctions

  835.     if trans_flag
  836.       self.opacity /= 2
  837.     end
  838.   end
  839. end

  840. #★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★

  841. #==============================================================================
  842. # ■ Scene_Battle
  843. #==============================================================================

  844. class Scene_Battle < Scene_Base
  845.   #--------------------------------------------------------------------------
  846.   # ● 対象敵キャラ選択の開始
  847.   #--------------------------------------------------------------------------
  848.   alias start_target_enemy_selection_KGC_ReproduceFunctions start_target_enemy_selection
  849.   def start_target_enemy_selection
  850.     # 全体通常攻撃なら選択をスキップ
  851.     if @active_battler.action.kind == 0 &&
  852.         @active_battler.action.basic == 0 &&
  853.         @active_battler.whole_attack
  854.       next_actor
  855.       return
  856.     end

  857.     start_target_enemy_selection_KGC_ReproduceFunctions
  858.   end
  859.   #--------------------------------------------------------------------------
  860.   # ● 戦闘行動の実行 : 攻撃
  861.   #--------------------------------------------------------------------------
  862.   alias execute_action_attack_KGC_ReproduceFunctions execute_action_attack
  863.   def execute_action_attack
  864.     execute_action_attack_KGC_ReproduceFunctions

  865.     # 攻撃者の MP 消費
  866.     mp_cost = @active_battler.calc_attack_mp_cost
  867.     return if mp_cost == 0
  868.     @active_battler.mp -= mp_cost
  869.     if KGC::ReproduceFunctions::SHOW_WEAPON_MP_COST_ON_ATTACK
  870.       @active_battler.add_mp_damage(mp_cost)
  871.       display_mp_damage(@active_battler)
  872.     end
  873.   end
  874. end
复制代码


在状态的备注中写入 <maxhp_rate 150%>  为增加最大HP的150%
回复

使用道具 举报

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

本版积分规则

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

在本版发帖返回顶部