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

Project1

 找回密码
 注册会员
搜索
查看: 1348|回复: 0

[已经过期] 求帮忙翻译脚本

[复制链接]

Lv3.寻梦者

梦石
0
星屑
1189
在线时间
249 小时
注册时间
2017-2-18
帖子
98

开拓者

发表于 2017-5-25 13:55:48 | 显示全部楼层 |阅读模式

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

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

x
本帖最后由 黯淡的流星 于 2017-5-25 13:57 编辑

请问哪位大神可以帮忙翻译一下这个脚本……
RUBY 代码复制
  1. #_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/
  2. #_/    ◆ 200x/XP 機能再現 - KGC_ReproduceFunctions ◆ VX ◆
  3. #_/    ◇ Last update : 2009/01/18 ◇
  4. #_/----------------------------------------------------------------------------
  5. #_/  200x/XP の機能を再現します。
  6. #_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/
  7.  
  8. #==============================================================================
  9. # ★ カスタマイズ項目 - Customize BEGIN ★
  10. #==============================================================================
  11.  
  12. module KGC
  13. module ReproduceFunctions
  14.   # ◆ MP 消費武器使用時、消費した MP を表示する
  15.   SHOW_WEAPON_MP_COST_ON_ATTACK = true
  16.  
  17.   # ◆ 「武器属性」と見なす属性の範囲
  18.   #  この属性を持つスキルは、同じ属性を持つ武器を装備していないと
  19.   #  使用できなくなります。
  20.   #   ※素手は 1(格闘)扱いです。
  21.   #  範囲オブジェクト(1..6 など)または整数の配列で指定します。
  22.   WEAPON_ELEMENTS = [2..4]
  23.   # [1..6] は [1, 2, 3, 4, 5, 6] と書いてもOK。
  24.   # [1..4, 5, 6] のように、両方が混ざってもOK。
  25. end
  26. end
  27.  
  28. #==============================================================================
  29. # ☆ カスタマイズ項目終了 - Customize END ☆
  30. #==============================================================================
  31.  
  32. $imported = {} if $imported == nil
  33. $imported["ReproduceFunctions"] = true
  34.  
  35. module KGC::ReproduceFunctions
  36.   #--------------------------------------------------------------------------
  37.   # ○ 武器属性を整数配列に変換
  38.   #--------------------------------------------------------------------------
  39.   def self.create_weapon_element_list
  40.     result = []
  41.     WEAPON_ELEMENTS.each { |e|
  42.       if e.is_a?(Range)
  43.         result |= e.to_a
  44.       elsif e.is_a?(Integer)
  45.         result |= [e]
  46.       end
  47.     }
  48.     return result.sort
  49.   end
  50.  
  51.   # 武器属性配列
  52.   WEAPON_ELEMENT_ID_LIST = create_weapon_element_list
  53.  
  54.   module Regexp
  55.     module BaseItem
  56.       # オートステート
  57.       AUTO_STATE = /<(?:AUTO_STATE|オートステート)\s*(\d+(?:\s*,\s*\d+)*)>/i
  58.       # 全体攻撃
  59.       WHOLE_ATTACK = /<(?:WHOLE_ATTACK|全体攻撃)>/i
  60.       # 回避率無視
  61.       IGNORE_EVA = /<(?:IGNORE_EVA|回避率?無視)>/i
  62.       # 消費MP
  63.       MP_COST = /<(?:MP_COST|消費MP)\s*([\-]?\d+)>/i
  64.       # クリティカル率
  65.       CRITICAL = /<(?:CRITICAL|クリティカル率)\s*(\-?\d+)>/i
  66.     end
  67.  
  68.     module Item
  69.       # アイテム使用回数
  70.       MULTI_USABLE = /<(?:MULTI_USABLE|使用回数)\s*(\d+)>/i
  71.       # スキル発動アイテム
  72.       EXEC_SKILL = /<(?:EXEC_SKILL|スキル発動)\s*(\d+)>/i
  73.     end
  74.  
  75.     module Enemy
  76.       # 半透明
  77.       TRANSLUCENT = /<(?:TRANSLUCENT|半透明)>/i
  78.       # クリティカル率
  79.       CRITICAL = /<(?:CRITICAL|クリティカル率)\s*(\d+)>/i
  80.     end
  81.  
  82.     module State
  83.       # パラメータ名
  84.       PARAMETER_NAME = {
  85.         "maxhp"=>"MAXHP_RATE|最大HP",
  86.         "maxmp"=>"MAXMP_RATE|最大MP"
  87.       }
  88.       # 打撃関係度で封印 (日本語)
  89.       SEAL_ATK_F_JP = /<打撃関係度\s*(\d+)\s*以上封印>/
  90.       # 打撃関係度で封印 (英語)
  91.       SEAL_ATK_F_EN = /<SEAL_ATK_F\s*(\d+)>/i
  92.       # 精神関係度で封印 (日本語)
  93.       SEAL_SPI_F_JP = /<精神関係度\s*(\d+)\s*以上封印>/
  94.       # 精神関係度で封印 (英語)
  95.       SEAL_SPI_F_EN = /<SEAL_SPI_F\s*(\d+)>/i
  96.       # 付加ステート
  97.       PLUS_STATE = /<(?:PLUS_STATE|付加ステート)\s*(\d+(?:\s*,\s*\d+)*)>/i
  98.     end
  99.   end
  100. end
  101.  
  102. #★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★
  103.  
  104. #==============================================================================
  105. # ■ RPG::BaseItem
  106. #==============================================================================
  107.  
  108. class RPG::BaseItem
  109.   #--------------------------------------------------------------------------
  110.   # ○ 再現機能のキャッシュ生成
  111.   #--------------------------------------------------------------------------
  112.   def create_reproduce_functions_cache
  113.     @__whole_attack = false
  114.     @__ignore_eva = false
  115.     @__mp_cost = 0
  116.     @__cri = 0
  117.  
  118.     self.note.each_line { |line|
  119.       case line
  120.       when KGC::ReproduceFunctions::Regexp::BaseItem::WHOLE_ATTACK
  121.         # 全体攻撃
  122.         @__whole_attack = true
  123.       when KGC::ReproduceFunctions::Regexp::BaseItem::IGNORE_EVA
  124.         # 回避率無視
  125.         @__ignore_eva = true
  126.       when KGC::ReproduceFunctions::Regexp::BaseItem::MP_COST
  127.         # 通常攻撃消費 MP
  128.         @__mp_cost += $1.to_i
  129.       when KGC::ReproduceFunctions::Regexp::BaseItem::CRITICAL
  130.         # クリティカル修正
  131.         @__cri += $1.to_i
  132.       end
  133.     }
  134.  
  135.     create_auto_state_cache
  136.   end
  137.   #--------------------------------------------------------------------------
  138.   # ○ オートステートのキャッシュ生成
  139.   #--------------------------------------------------------------------------
  140.   def create_auto_state_cache
  141.     # ID のキャッシュ生成
  142.     @__auto_state_ids = []
  143.     @__auto_state_ids_battle = []
  144.     self.note.each_line { |line|
  145.       next unless line =~ KGC::ReproduceFunctions::Regexp::BaseItem::AUTO_STATE
  146.       $1.scan(/\d+/).each { |num|
  147.         if (state = $data_states[num.to_i]) != nil
  148.           @__auto_state_ids_battle << state.id
  149.           unless state.battle_only
  150.             @__auto_state_ids << state.id
  151.           end
  152.         end
  153.       }
  154.     }
  155.  
  156.     # オブジェクトのキャッシュ作成
  157.     @__auto_states = []
  158.     @__auto_state_ids.each { |i|
  159.       @__auto_states << $data_states[i]
  160.     }
  161.     @__auto_states_battle = []
  162.     @__auto_state_ids_battle.each { |i|
  163.       @__auto_states_battle << $data_states[i]
  164.     }
  165.   end
  166.   #--------------------------------------------------------------------------
  167.   # ○ 全体攻撃判定
  168.   #--------------------------------------------------------------------------
  169.   def whole_attack
  170.     create_reproduce_functions_cache if @__whole_attack == nil
  171.     return @__whole_attack
  172.   end
  173.   #--------------------------------------------------------------------------
  174.   # ○ 回避無視判定
  175.   #--------------------------------------------------------------------------
  176.   def ignore_eva
  177.     create_reproduce_functions_cache if @__ignore_eva == nil
  178.     return @__ignore_eva
  179.   end
  180.   #--------------------------------------------------------------------------
  181.   # ○ 通常攻撃消費 MP
  182.   #--------------------------------------------------------------------------
  183.   def mp_cost
  184.     create_reproduce_functions_cache if @__mp_cost == nil
  185.     return @__mp_cost
  186.   end
  187.   #--------------------------------------------------------------------------
  188.   # ○ クリティカル修正
  189.   #--------------------------------------------------------------------------
  190.   def cri
  191.     create_reproduce_functions_cache if @__cri == nil
  192.     return @__cri
  193.   end
  194.   #--------------------------------------------------------------------------
  195.   # ○ オートステート ID
  196.   #--------------------------------------------------------------------------
  197.   def auto_state_ids
  198.     return ($game_temp.in_battle ? auto_state_ids_battle : auto_state_ids_always)
  199.   end
  200.   #--------------------------------------------------------------------------
  201.   # ○ オートステート ID (常時)
  202.   #--------------------------------------------------------------------------
  203.   def auto_state_ids_always
  204.     create_reproduce_functions_cache if @__auto_state_ids == nil
  205.     return @__auto_state_ids
  206.   end
  207.   #--------------------------------------------------------------------------
  208.   # ○ オートステート ID (戦闘時)
  209.   #--------------------------------------------------------------------------
  210.   def auto_state_ids_battle
  211.     create_reproduce_functions_cache if @__auto_state_ids_battle == nil
  212.     return @__auto_state_ids_battle
  213.   end
  214.   #--------------------------------------------------------------------------
  215.   # ○ オートステート
  216.   #--------------------------------------------------------------------------
  217.   def auto_states
  218.     return ($game_temp.in_battle ? auto_states_battle : auto_states_always)
  219.   end
  220.   #--------------------------------------------------------------------------
  221.   # ○ オートステート (常時)
  222.   #--------------------------------------------------------------------------
  223.   def auto_states_always
  224.     create_reproduce_functions_cache if @__auto_states == nil
  225.     return @__auto_states
  226.   end
  227.   #--------------------------------------------------------------------------
  228.   # ○ オートステート (戦闘時)
  229.   #--------------------------------------------------------------------------
  230.   def auto_states_battle
  231.     create_reproduce_functions_cache if @__auto_states_battle == nil
  232.     return @__auto_states_battle
  233.   end
  234. end
  235.  
  236. #★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★
  237.  
  238. #==============================================================================
  239. # ■ RPG::Item
  240. #==============================================================================
  241.  
  242. class RPG::Item < RPG::UsableItem
  243.   #--------------------------------------------------------------------------
  244.   # ○ 再現機能のキャッシュ生成
  245.   #--------------------------------------------------------------------------
  246.   def create_reproduce_functions_cache
  247.     super
  248.     @__usable_count = 1
  249.     @__skill_id = 0
  250.  
  251.     self.note.each_line { |line|
  252.       case line
  253.       when KGC::ReproduceFunctions::Regexp::Item::MULTI_USABLE
  254.         # 使用可能回数
  255.         @__usable_count = $1.to_i
  256.       when KGC::ReproduceFunctions::Regexp::Item::EXEC_SKILL
  257.         # 発動スキル ID
  258.         @__skill_id = $1.to_i
  259.       end
  260.     }
  261.   end
  262.   #--------------------------------------------------------------------------
  263.   # ● アニメーション ID
  264.   #--------------------------------------------------------------------------
  265.   def animation_id
  266.     if exec_skill?
  267.       return $data_skills[skill_id].animation_id
  268.     else
  269.       return @animation_id
  270.     end
  271.   end
  272.   #--------------------------------------------------------------------------
  273.   # ○ 使用可能回数
  274.   #--------------------------------------------------------------------------
  275.   def usable_count
  276.     create_reproduce_functions_cache if @__usable_count == nil
  277.     return @__usable_count
  278.   end
  279.   #--------------------------------------------------------------------------
  280.   # ○ スキル発動判定
  281.   #--------------------------------------------------------------------------
  282.   def exec_skill?
  283.     return (skill_id > 0)
  284.   end
  285.   #--------------------------------------------------------------------------
  286.   # ○ 発動スキル ID
  287.   #--------------------------------------------------------------------------
  288.   def skill_id
  289.     create_reproduce_functions_cache if @__skill_id == nil
  290.     return @__skill_id
  291.   end
  292. end
  293.  
  294. #★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★
  295.  
  296. #==============================================================================
  297. # ■ RPG::Skill
  298. #==============================================================================
  299.  
  300. class RPG::Skill < RPG::UsableItem
  301.   #--------------------------------------------------------------------------
  302.   # ○ 再現機能のキャッシュ生成
  303.   #--------------------------------------------------------------------------
  304.   def create_reproduce_functions_cache
  305.     super
  306.  
  307.     @__weapon_element_set =
  308.       self.element_set & KGC::ReproduceFunctions::WEAPON_ELEMENT_ID_LIST
  309.   end
  310.   #--------------------------------------------------------------------------
  311.   # ○ 使用時に必要な武器属性を取得
  312.   #--------------------------------------------------------------------------
  313.   def weapon_element_set
  314.     create_reproduce_functions_cache if @__weapon_element_set == nil
  315.     return @__weapon_element_set
  316.   end
  317. end
  318.  
  319. #★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★
  320.  
  321. #==============================================================================
  322. # ■ RPG::Enemy
  323. #==============================================================================
  324.  
  325. class RPG::Enemy
  326.   #--------------------------------------------------------------------------
  327.   # ○ 再現機能のキャッシュ生成
  328.   #--------------------------------------------------------------------------
  329.   def create_reproduce_functions_cache
  330.     @__translucent = false
  331.     @__cri = 0
  332.  
  333.     self.note.each_line { |line|
  334.       case line
  335.       when KGC::ReproduceFunctions::Regexp::Enemy::TRANSLUCENT
  336.         # 半透明
  337.         @__translucent = true
  338.       when KGC::ReproduceFunctions::Regexp::Enemy::CRITICAL
  339.         # クリティカル修正
  340.         @__cri += $1.to_i
  341.       end
  342.     }
  343.   end
  344.   #--------------------------------------------------------------------------
  345.   # ○ 半透明
  346.   #--------------------------------------------------------------------------
  347.   def translucent?
  348.     create_reproduce_functions_cache if @__translucent == nil
  349.     return @__translucent
  350.   end
  351.   #--------------------------------------------------------------------------
  352.   # ○ クリティカル修正
  353.   #--------------------------------------------------------------------------
  354.   def cri
  355.     create_reproduce_functions_cache if @__cri == nil
  356.     return @__cri
  357.   end
  358. end
  359.  
  360. #★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★
  361.  
  362. #==============================================================================
  363. # ■ RPG::State
  364. #==============================================================================
  365.  
  366. class RPG::State
  367.   #--------------------------------------------------------------------------
  368.   # ○ 再現機能のキャッシュ生成
  369.   #--------------------------------------------------------------------------
  370.   def create_reproduce_functions_cache
  371.     @__seal_atk_f = 999
  372.     @__seal_spi_f = 999
  373.     @__plus_state_set = []
  374.  
  375.     self.note.each_line { |line|
  376.       case line
  377.       when KGC::ReproduceFunctions::Regexp::State::SEAL_ATK_F_JP,
  378.            KGC::ReproduceFunctions::Regexp::State::SEAL_ATK_F_EN
  379.         # 封印するスキルの打撃関係度
  380.         @__seal_atk_f = $1.to_i
  381.       when KGC::ReproduceFunctions::Regexp::State::SEAL_SPI_F_JP,
  382.            KGC::ReproduceFunctions::Regexp::State::SEAL_SPI_F_EN
  383.         # 封印するスキルの精神関係度
  384.         @__seal_spi_f = $1.to_i
  385.       when KGC::ReproduceFunctions::Regexp::State::PLUS_STATE
  386.         # 付加ステート
  387.         $1.scan(/\d+/).each { |num|
  388.           if (state = $data_states[num.to_i]) != nil
  389.             @__plus_state_set << state.id
  390.           end
  391.         }
  392.       end
  393.     }
  394.  
  395.     create_parameter_rate_cache
  396.   end
  397.   #--------------------------------------------------------------------------
  398.   # ○ パラメータ修正値のキャッシュ生成
  399.   #--------------------------------------------------------------------------
  400.   def create_parameter_rate_cache
  401.     @__parameter_rate = {}
  402.     # 初期化
  403.     KGC::ReproduceFunctions::Regexp::State::PARAMETER_NAME.each_key { |k|
  404.       @__parameter_rate[k] = 100
  405.     }
  406.     # メモ反映
  407.     self.note.each_line { |line|
  408.       KGC::ReproduceFunctions::Regexp::State::PARAMETER_NAME.each { |k, v|
  409.         if line =~ /<(?:#{v})[ ]*(\d+)[%%]>/i
  410.           @__parameter_rate[k] = @__parameter_rate[k] * $1.to_i / 100
  411.           break
  412.         end
  413.       }
  414.     }
  415.   end
  416.   #--------------------------------------------------------------------------
  417.   # ○ MaxHP 修正
  418.   #--------------------------------------------------------------------------
  419.   def maxhp_rate
  420.     create_reproduce_functions_cache if @__parameter_rate == nil
  421.     return @__parameter_rate["maxhp"]
  422.   end
  423.   #--------------------------------------------------------------------------
  424.   # ○ MaxMP 修正
  425.   #--------------------------------------------------------------------------
  426.   def maxmp_rate
  427.     create_reproduce_functions_cache if @__parameter_rate == nil
  428.     return @__parameter_rate["maxmp"]
  429.   end
  430.   #--------------------------------------------------------------------------
  431.   # ○ 封印するスキルの打撃関係度
  432.   #--------------------------------------------------------------------------
  433.   def seal_atk_f
  434.     create_reproduce_functions_cache if @__seal_atk_f == nil
  435.     return @__seal_atk_f
  436.   end
  437.   #--------------------------------------------------------------------------
  438.   # ○ 封印するスキルの精神関係度
  439.   #--------------------------------------------------------------------------
  440.   def seal_spi_f
  441.     create_reproduce_functions_cache if @__seal_spi_f == nil
  442.     return @__seal_spi_f
  443.   end
  444.   #--------------------------------------------------------------------------
  445.   # ○ 付加ステート
  446.   #--------------------------------------------------------------------------
  447.   def plus_state_set
  448.     create_reproduce_functions_cache if @__plus_state_set == nil
  449.     return @__plus_state_set
  450.   end
  451. end
  452.  
  453. #★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★
  454.  
  455. #==============================================================================
  456. # ■ Game_Temp
  457. #==============================================================================
  458.  
  459. class Game_Temp
  460.   #--------------------------------------------------------------------------
  461.   # ● 公開インスタンス変数
  462.   #--------------------------------------------------------------------------
  463.   attr_accessor :exec_skill_on_item       # アイテムによるスキル発動フラグ
  464.   #--------------------------------------------------------------------------
  465.   # ● オブジェクト初期化
  466.   #--------------------------------------------------------------------------
  467.   alias initialize_KGC_ReproduceFunctions initialize
  468.   def initialize
  469.     initialize_KGC_ReproduceFunctions
  470.  
  471.     @exec_skill_on_item = false
  472.   end
  473. end
  474.  
  475. #★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★
  476.  
  477. #==============================================================================
  478. # ■ Game_Battler
  479. #==============================================================================
  480.  
  481. class Game_Battler
  482.   #--------------------------------------------------------------------------
  483.   # ● 現在のステートをオブジェクトの配列で取得
  484.   #--------------------------------------------------------------------------
  485.   alias states_KGC_ReproduceFunctions states
  486.   def states
  487.     result = states_KGC_ReproduceFunctions + auto_states
  488.     result.sort! { |a, b| b.priority <=> a.priority }
  489.     return result
  490.   end
  491.   #--------------------------------------------------------------------------
  492.   # ● MaxHP の取得
  493.   #--------------------------------------------------------------------------
  494.   alias maxhp_KGC_ReproduceFunctions maxhp
  495.   def maxhp
  496.     n = maxhp_KGC_ReproduceFunctions
  497.     states.each { |state| n *= state.maxhp_rate / 100.0 }
  498.     return [[Integer(n), 1].max, maxhp_limit].min
  499.   end
  500.   #--------------------------------------------------------------------------
  501.   # ● MaxMP の取得
  502.   #--------------------------------------------------------------------------
  503.   alias maxmp_KGC_ReproduceFunctions maxmp
  504.   def maxmp
  505.     n = maxmp_KGC_ReproduceFunctions
  506.     states.each { |state| n *= state.maxmp_rate / 100.0 }
  507.     limit = (defined?(maxmp_limit) ? maxmp_limit : 9999)
  508.     return [[Integer(n), 0].max, limit].min
  509.   end
  510.   #--------------------------------------------------------------------------
  511.   # ● HP の取得
  512.   #--------------------------------------------------------------------------
  513.   alias hp_KGC_ReproduceFunctions_Battler hp
  514.   def hp
  515.     @hp = maxhp if @hp > maxhp
  516.     return hp_KGC_ReproduceFunctions_Battler
  517.   end
  518.   #--------------------------------------------------------------------------
  519.   # ● MP の取得
  520.   #--------------------------------------------------------------------------
  521.   alias mp_KGC_ReproduceFunctions_Battler mp
  522.   def mp
  523.     @mp = maxmp if @mp > maxmp
  524.     return mp_KGC_ReproduceFunctions_Battler
  525.   end
  526.   #--------------------------------------------------------------------------
  527.   # ○ オートステートの ID を取得
  528.   #--------------------------------------------------------------------------
  529.   def auto_state_ids
  530.     return auto_states(true)
  531.   end
  532.   #--------------------------------------------------------------------------
  533.   # ○ オートステートの配列を取得
  534.   #     id_only : ID のみを取得
  535.   #--------------------------------------------------------------------------
  536.   def auto_states(id_only = false)
  537.     return []
  538.   end
  539.   #--------------------------------------------------------------------------
  540.   # ● ステートの検査
  541.   #     state_id : ステート ID
  542.   #    該当するステートが付加されていれば true を返す。
  543.   #--------------------------------------------------------------------------
  544.   alias state_KGC_ReproduceFunctions? state?
  545.   def state?(state_id)
  546.     return (state_KGC_ReproduceFunctions?(state_id) || auto_state?(state_id))
  547.   end
  548.   #--------------------------------------------------------------------------
  549.   # ● ステートの付加
  550.   #     state_id : ステート ID
  551.   #--------------------------------------------------------------------------
  552.   alias add_state_KGC_ReproduceFunctions add_state
  553.   def add_state(state_id)
  554.     last_states = @states.dup
  555.  
  556.     add_state_KGC_ReproduceFunctions(state_id)
  557.  
  558.     if (@states - last_states).include?(state_id)  # ステートが付加された場合
  559.       state = $data_states[state_id]
  560.       # [付加するステート] を適用
  561.       state.plus_state_set.each { |i|
  562.         add_state(i)
  563.       }
  564.     end
  565.   end
  566.   #--------------------------------------------------------------------------
  567.   # ○ オートステートの検査
  568.   #     state_id : ステート ID
  569.   #    該当するステートが付加されていれば true を返す。
  570.   #--------------------------------------------------------------------------
  571.   def auto_state?(state_id)
  572.     return auto_state_ids.include?(state_id)
  573.   end
  574.   #--------------------------------------------------------------------------
  575.   # ● ステートの解除
  576.   #     state_id : ステート ID
  577.   #--------------------------------------------------------------------------
  578.   alias remove_state_KGC_ReproduceFunctions remove_state
  579.   def remove_state(state_id)
  580.     if auto_state?(state_id)  # オートステートは解除しない
  581.       return
  582.     end
  583.  
  584.     remove_state_KGC_ReproduceFunctions(state_id)
  585.   end
  586.   #--------------------------------------------------------------------------
  587.   # ○ 半透明化判定
  588.   #--------------------------------------------------------------------------
  589.   def translucent?
  590.     # エネミーの場合は Game_Enemy で再定義
  591.     return false
  592.   end
  593.   #--------------------------------------------------------------------------
  594.   # ○ 装備オプション [全体攻撃] の取得
  595.   #--------------------------------------------------------------------------
  596.   def whole_attack
  597.     return false
  598.   end
  599.   #--------------------------------------------------------------------------
  600.   # ○ 装備オプション [回避無視] の取得
  601.   #--------------------------------------------------------------------------
  602.   def ignore_eva
  603.     return false
  604.   end
  605.   #--------------------------------------------------------------------------
  606.   # ○ MP ダメージ加算
  607.   #     value : 加算する値
  608.   #--------------------------------------------------------------------------
  609.   def add_mp_damage(value)
  610.     @mp_damage += value
  611.   end
  612.   #--------------------------------------------------------------------------
  613.   # ○ 通常攻撃の消費 MP 計算
  614.   #--------------------------------------------------------------------------
  615.   def calc_attack_mp_cost
  616.     return 0
  617.   end
  618.   #--------------------------------------------------------------------------
  619.   # ● スキルの使用可能判定
  620.   #     skill : スキル
  621.   #--------------------------------------------------------------------------
  622.   alias skill_can_use_KGC_ReproduceFunctions? skill_can_use?
  623.   def skill_can_use?(skill)
  624.     return false unless skill.is_a?(RPG::Skill)
  625.     unless $imported["CooperationSkill"] && $game_temp.judging_cooperation_skill
  626.       return false if skill_seal?(skill)
  627.       return false unless skill_satisfied_weapon_element?(skill)
  628.     end
  629.  
  630.     return skill_can_use_KGC_ReproduceFunctions?(skill)
  631.   end
  632.   #--------------------------------------------------------------------------
  633.   # ○ スキル封印判定
  634.   #--------------------------------------------------------------------------
  635.   def skill_seal?(skill)
  636.     return (seal_atk_f <= skill.atk_f || seal_spi_f <= skill.spi_f)
  637.   end
  638.   #--------------------------------------------------------------------------
  639.   # ○ 封印する打撃関係度を取得
  640.   #--------------------------------------------------------------------------
  641.   def seal_atk_f
  642.     n = 999
  643.     states.each { |state| n = [n, state.seal_atk_f].min }
  644.     return n
  645.   end
  646.   #--------------------------------------------------------------------------
  647.   # ○ 封印する精神関係度を取得
  648.   #--------------------------------------------------------------------------
  649.   def seal_spi_f
  650.     n = 999
  651.     states.each { |state| n = [n, state.seal_spi_f].min }
  652.     return n
  653.   end
  654.   #--------------------------------------------------------------------------
  655.   # ○ 必要な武器属性を満たしているか判定
  656.   #--------------------------------------------------------------------------
  657.   def skill_satisfied_weapon_element?(skill)
  658.     return true
  659.   end
  660.   #--------------------------------------------------------------------------
  661.   # ● 最終回避率の計算
  662.   #     user : 攻撃者、スキルまたはアイテムの使用者
  663.   #     obj  : スキルまたはアイテム (通常攻撃の場合は nil)
  664.   #--------------------------------------------------------------------------
  665.   alias calc_eva_KGC_ReproduceFunctions calc_eva
  666.   def calc_eva(user, obj = nil)
  667.     eva = calc_eva_KGC_ReproduceFunctions(user, obj)
  668.  
  669.     physical = (obj == nil || obj.physical_attack)
  670.     if physical && user.ignore_eva  # 物理攻撃かつ回避無視の場合
  671.       eva = 0
  672.     end
  673.     return eva
  674.   end
  675.   #--------------------------------------------------------------------------
  676.   # ● アイテムの効果適用
  677.   #     user : アイテムの使用者
  678.   #     item : アイテム
  679.   #--------------------------------------------------------------------------
  680.   alias item_effect_KGC_ReproduceFunctions item_effect
  681.   def item_effect(user, item)
  682.     # スキル発動判定
  683.     if item.exec_skill?
  684.       $game_temp.exec_skill_on_item = true
  685.       skill_effect(user, $data_skills[item.skill_id])
  686.       $game_temp.exec_skill_on_item = false
  687.     else
  688.       item_effect_KGC_ReproduceFunctions(user, item)
  689.     end
  690.   end
  691. end
  692.  
  693. #★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★
  694.  
  695. #==============================================================================
  696. # ■ Game_BattleAction
  697. #==============================================================================
  698.  
  699. class Game_BattleAction
  700.   #--------------------------------------------------------------------------
  701.   # ● 通常攻撃のターゲット作成
  702.   #--------------------------------------------------------------------------
  703.   alias make_attack_targets_KGC_ReproduceFunctions make_attack_targets
  704.   def make_attack_targets
  705.     unless battler.whole_attack  # 全体攻撃でない
  706.       return make_attack_targets_KGC_ReproduceFunctions
  707.     end
  708.  
  709.     targets = []
  710.     if battler.confusion?
  711.       targets += friends_unit.existing_members
  712.     else
  713.       targets += opponents_unit.existing_members
  714.     end
  715.     if battler.dual_attack      # 連続攻撃
  716.       targets += targets
  717.     end
  718.     return targets.compact
  719.   end
  720. end
  721.  
  722. #★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★
  723.  
  724. #==============================================================================
  725. # ■ Game_Actor
  726. #==============================================================================
  727.  
  728. class Game_Actor < Game_Battler
  729.   #--------------------------------------------------------------------------
  730.   # ● クリティカル率の取得
  731.   #--------------------------------------------------------------------------
  732.   alias cri_KGC_ReproduceFunctions cri
  733.   def cri
  734.     n = cri_KGC_ReproduceFunctions
  735.  
  736.     equips.compact.each { |item| n += item.cri }
  737.     return n
  738.   end
  739.   #--------------------------------------------------------------------------
  740.   # ○ オートステートの配列を取得
  741.   #     id_only : ID のみを取得
  742.   #--------------------------------------------------------------------------
  743.   def auto_states(id_only = false)
  744.     result = []
  745.     equips.compact.each { |item|
  746.       result |= (id_only ? item.auto_state_ids : item.auto_states)
  747.     }
  748.     return result
  749.   end
  750.   #--------------------------------------------------------------------------
  751.   # ○ 装備オプション [全体攻撃] の取得
  752.   #--------------------------------------------------------------------------
  753.   def whole_attack
  754.     equips.compact.each { |item|
  755.       return true if item.whole_attack
  756.     }
  757.     return false
  758.   end
  759.   #--------------------------------------------------------------------------
  760.   # ○ 装備オプション [回避無視] の取得
  761.   #--------------------------------------------------------------------------
  762.   def ignore_eva
  763.     equips.compact.each { |item|
  764.       return true if item.ignore_eva
  765.     }
  766.     return false
  767.   end
  768.   #--------------------------------------------------------------------------
  769.   # ○ 通常攻撃の消費 MP 計算
  770.   #--------------------------------------------------------------------------
  771.   def calc_attack_mp_cost
  772.     n = 0
  773.     equips.compact.each { |item|
  774.       n += item.mp_cost
  775.     }
  776.     return n
  777.   end
  778.   #--------------------------------------------------------------------------
  779.   # ○ 必要な武器属性を満たしているか判定
  780.   #--------------------------------------------------------------------------
  781.   def skill_satisfied_weapon_element?(skill)
  782.     elements = skill.weapon_element_set
  783.     return (self.element_set & elements) == elements
  784.   end
  785. end
  786.  
  787. #★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★
  788.  
  789. #==============================================================================
  790. # ■ Game_Enemy
  791. #==============================================================================
  792.  
  793. class Game_Enemy < Game_Battler
  794.   #--------------------------------------------------------------------------
  795.   # ○ 半透明化判定
  796.   #--------------------------------------------------------------------------
  797.   def translucent?
  798.     return enemy.translucent?
  799.   end
  800.   #--------------------------------------------------------------------------
  801.   # ● クリティカル率の取得
  802.   #--------------------------------------------------------------------------
  803.   alias cri_KGC_ReproduceFunctions cri
  804.   def cri
  805.     n = cri_KGC_ReproduceFunctions
  806.     if enemy.has_critical && enemy.cri != 0
  807.       n += enemy.cri - 10
  808.     end
  809.     return n
  810.   end
  811. end
  812.  
  813. #★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★
  814.  
  815. #==============================================================================
  816. # ■ Game_Party
  817. #==============================================================================
  818.  
  819. class Game_Party < Game_Unit
  820.   #--------------------------------------------------------------------------
  821.   # ● オブジェクト初期化
  822.   #--------------------------------------------------------------------------
  823.   alias initialize_KGC_ReproduceFunctions initialize
  824.   def initialize
  825.     initialize_KGC_ReproduceFunctions
  826.  
  827.     @item_use_count = {}  # 所持品使用回数ハッシュ (アイテム ID)
  828.   end
  829.   #--------------------------------------------------------------------------
  830.   # ● アイテムの減少
  831.   #     item          : アイテム
  832.   #     n             : 個数
  833.   #     include_equip : 装備品も含める
  834.   #--------------------------------------------------------------------------
  835.   alias lose_item_KGC_ReproduceFunctions lose_item
  836.   def lose_item(item, n, include_equip = false)
  837.     lose_item_KGC_ReproduceFunctions(item, n, include_equip)
  838.  
  839.     # アイテムが無くなったら使用回数をリセット
  840.     if item.is_a?(RPG::Item) && item.consumable && item_number(item) == 0
  841.       @item_use_count[item.id] = 0
  842.     end
  843.   end
  844.   #--------------------------------------------------------------------------
  845.   # ● アイテムの消耗
  846.   #     item : アイテム
  847.   #--------------------------------------------------------------------------
  848.   alias consume_item_KGC_ReproduceFunctions consume_item
  849.   def consume_item(item)
  850.     if item.is_a?(RPG::Item) && item.consumable
  851.       update_use_count(item)
  852.  
  853.       # 使用回数が 0 の場合のみ消耗
  854.       if @item_use_count[item.id] == 0
  855.         consume_item_KGC_ReproduceFunctions(item)
  856.       end
  857.     else
  858.       consume_item_KGC_ReproduceFunctions(item)
  859.     end
  860.   end
  861.   #--------------------------------------------------------------------------
  862.   # ○ 使用回数の更新
  863.   #     item : アイテム
  864.   #    指定アイテムの使用回数を 1 増やす。
  865.   #    使用後に消耗する場合は、使用回数を 0 にする。
  866.   #--------------------------------------------------------------------------
  867.   def update_use_count(item)
  868.     if @item_use_count == nil
  869.       @item_use_count = {}
  870.     end
  871.  
  872.     unless @item_use_count.has_key?(item.id)
  873.       @item_use_count[item.id] = 0
  874.     end
  875.     @item_use_count[item.id] += 1
  876.     # 使用可能回数に達したら、使用回数を 0 にする
  877.     if @item_use_count[item.id] >= item.usable_count
  878.       @item_use_count[item.id] = 0
  879.     end
  880.   end
  881. end
  882.  
  883. #★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★
  884.  
  885. #==============================================================================
  886. # ■ Sprite_Battler
  887. #==============================================================================
  888.  
  889. class Sprite_Battler < Sprite_Base
  890.   #--------------------------------------------------------------------------
  891.   # ● エフェクトの更新
  892.   #--------------------------------------------------------------------------
  893.   alias update_effect_KGC_ReproduceFunctions update_effect
  894.   def update_effect
  895.     # エフェクト実行前に半透明化判定をしておく
  896.     trans_flag = (@effect_duration > 0 && @battler.translucent?)
  897.  
  898.     update_effect_KGC_ReproduceFunctions
  899.  
  900.     if trans_flag
  901.       self.opacity /= 2
  902.     end
  903.   end
  904. end
  905.  
  906. #★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★
  907.  
  908. #==============================================================================
  909. # ■ Scene_Battle
  910. #==============================================================================
  911.  
  912. class Scene_Battle < Scene_Base
  913.   #--------------------------------------------------------------------------
  914.   # ● 対象敵キャラ選択の開始
  915.   #--------------------------------------------------------------------------
  916.   alias start_target_enemy_selection_KGC_ReproduceFunctions start_target_enemy_selection
  917.   def start_target_enemy_selection
  918.     # 全体通常攻撃なら選択をスキップ
  919.     if @active_battler.action.kind == 0 &&
  920.         @active_battler.action.basic == 0 &&
  921.         @active_battler.whole_attack
  922.       next_actor
  923.       return
  924.     end
  925.  
  926.     start_target_enemy_selection_KGC_ReproduceFunctions
  927.   end
  928.   #--------------------------------------------------------------------------
  929.   # ● 戦闘行動の実行 : 攻撃
  930.   #--------------------------------------------------------------------------
  931.   alias execute_action_attack_KGC_ReproduceFunctions execute_action_attack
  932.   def execute_action_attack
  933.     execute_action_attack_KGC_ReproduceFunctions
  934.  
  935.     # 攻撃者の MP 消費
  936.     mp_cost = @active_battler.calc_attack_mp_cost
  937.     return if mp_cost == 0
  938.     @active_battler.mp -= mp_cost
  939.     if KGC::ReproduceFunctions::SHOW_WEAPON_MP_COST_ON_ATTACK
  940.       @active_battler.add_mp_damage(mp_cost)
  941.       display_mp_damage(@active_battler)
  942.     end
  943.   end
  944. end
您需要登录后才可以回帖 登录 | 注册会员

本版积分规则

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

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

GMT+8, 2024-3-29 02:04

Powered by Discuz! X3.1

© 2001-2013 Comsenz Inc.

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