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

Project1

 找回密码
 注册会员
搜索
查看: 3409|回复: 8

[已经解决] 求女神转生式能力架构及加点系统(RGSS3/VxAce),

[复制链接]

Lv1.梦旅人

梦石
0
星屑
114
在线时间
411 小时
注册时间
2020-1-11
帖子
253
发表于 2020-2-16 14:55:29 | 显示全部楼层 |阅读模式
200星屑
@author さば 的<振り分けステータス>的脚本我找到了,但这是(RGSS2/Vx)用的,我想求个(RGSS3/VxAce)版本的该脚本。
脚本本体或连接地址皆可,先拜谢了。

最佳答案

查看完整内容

http://ytomy.sakura.ne.jp/tkool/rpgtech/php/tech.php?tool=VXAce&cat=tech_vxace/special_system&tech=distribute_parameter

Lv5.捕梦者

梦石
0
星屑
33143
在线时间
10485 小时
注册时间
2009-3-15
帖子
4756
发表于 2020-2-16 14:55:30 | 显示全部楼层
回复

使用道具 举报

Lv1.梦旅人

梦石
0
星屑
114
在线时间
411 小时
注册时间
2020-1-11
帖子
253
 楼主| 发表于 2020-2-16 17:50:58 | 显示全部楼层
soulsaga殿下。真是太有用了,对了。这200星屑的悬赏要怎么给啊?
另外。这个@author さば 的脚本制作者有网站吗?有的话我也想去学习学习。

点评

联系版主或者等版主看到吧  发表于 2020-2-16 22:31
回复

使用道具 举报

Lv5.捕梦者

梦石
0
星屑
33143
在线时间
10485 小时
注册时间
2009-3-15
帖子
4756
发表于 2020-2-16 18:35:24 | 显示全部楼层
alianlord 发表于 2020-2-16 17:50
soulsaga殿下。真是太有用了,对了。这200星屑的悬赏要怎么给啊?
另外。这个@author さ ...

作者网站关站了..
回复

使用道具 举报

Lv1.梦旅人

梦石
0
星屑
114
在线时间
411 小时
注册时间
2020-1-11
帖子
253
 楼主| 发表于 2020-2-16 18:37:46 | 显示全部楼层
soulsaga 发表于 2020-2-16 18:35
作者网站关站了..

真遗憾真女神转生1vx中重要的脚本都有他的名字。
回复

使用道具 举报

Lv4.逐梦者

梦石
1
星屑
14503
在线时间
2086 小时
注册时间
2017-9-28
帖子
662
发表于 2020-2-23 22:33:13 | 显示全部楼层
补充个汉化
  1. #_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/
  2. #_/    ◆ 能力值加点 - KMS_DistributeParameter ◆ VXAce ◆
  3. #_/    ◇ Last update : 2012/08/05 (TOMY@Kamesoft) ◇
  4. #_/----------------------------------------------------------------------------
  5. #_/  创建能力值加点的功能。
  6. #_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/

  7. #==============================================================================
  8. # ★ 设定部分 - BEGIN Setting ★
  9. #==============================================================================

  10. module KMS_DistributeParameter
  11.   # ◆ 加点类型设定
  12.   #  设定加点类型,和影响能力值的大小
  13.   #   {
  14.   #     :key        => 标志,
  15.   #     :name       => "名称",
  16.   #     :limit      => 加点数上限,
  17.   #     :cost       => [消耗技能点, 消耗技能点修正],
  18.   #     :能力值     => [提升量, 提升量修正],
  19.   #     # 能力值的设定可以是任意数量的
  20.   #   },
  21.   #  在以下列表中添加加点类型。
  22.   #  再加点画面中、会按顺序显示。
  23.   #  对于「标志」、请设定一个不重复的能力值标志。
  24.   #  (用语设定加点类型显示的顺序。数值或字符串都OK)
  25.   #  「加点数上限」以外的设定都可以使用小数。
  26.   #  「加点数上限」设定为 0 时则没有上限。
  27.   #  「消耗技能点修正」和「提升量修正」可以被省略。省略时视为 0。
  28.   GAIN_PARAMETER = [
  29.     {
  30.       :key   => :health,
  31.       :name  => "体力",
  32.       :limit => 30,
  33.       :cost  => [ 1, 0.4],
  34.       :mhp   => [30, 2],
  35.       :def   => [ 1, 0.25],
  36.     },
  37.     {
  38.       :key   => :magic,
  39.       :name  => "魔力",
  40.       :limit => 30,
  41.       :cost  => [1, 0.4],
  42.       :mmp   => [5, 0.5],
  43.       :mat   => [2, 0.5],
  44.     },
  45.     {
  46.       :key   => :pow,
  47.       :name  => "力量",
  48.       :limit => 30,
  49.       :cost  => [1, 0.4],
  50.       :atk   => [2, 0.5],
  51.       :def   => [1, 0.25],
  52.     },
  53.     {
  54.       :key   => :dex,
  55.       :name  => "防御",
  56.       :limit => 30,
  57.       :cost  => [1, 0.4],
  58.       :agi   => [2, 0.5],
  59.       :hit   => [0.005],
  60.       :eva   => [0.005],
  61.     },
  62.     {
  63.       :key   => :mat,
  64.       :name  => "智力",
  65.       :limit => 30,
  66.       :cost  => [1, 0.4],
  67.       :mat   => [2, 0.5],
  68.     },
  69.     {
  70.       :key   => :mdf,
  71.       :name  => "信仰",
  72.       :limit => 30,
  73.       :cost  => [1, 0.4],
  74.       :mdf   => [2, 0.5],
  75.       :mmp   => [1, 0.5],
  76.     },
  77.     {
  78.       :key   => :agi,
  79.       :name  => "敏捷",
  80.       :limit => 20,
  81.       :cost  => [1, 0.5],
  82.       :agi   => [1]
  83.     },   
  84.     {
  85.       :key   => :luk,
  86.       :name  => "幸运",
  87.       :limit => 20,
  88.       :cost  => [1, 0.5],
  89.       :luk   => [1]
  90.     },
  91.     {
  92.       :key   => :hit,
  93.       :name  => "机警",
  94.       :limit => 20,
  95.       :cost  => [1, 0.5],
  96.       :hit   => [0.01],
  97.       :eva   => [0.01],
  98.     },
  99. #~     {
  100. #~       :key   => :eva,
  101. #~       :name  => "闪避率",
  102. #~       :limit => 20,
  103. #~       :cost  => [1, 0.5],
  104. #~       :eva   => [0.01],
  105. #~     },
  106.     {
  107.       :key   => :crt,
  108.       :name  => "爆发",
  109.       :limit => 20,
  110.       :cost  => [1, 0.7],
  111.       :cri   => [0.01],
  112.     },
  113.     {
  114.       :key         => :chant,
  115.       :name        => "咏唱速度",
  116.       :limit       => 0,
  117.       :cost        => [1, 0.5],
  118.       :skill_speed => [1],
  119.     },
  120.     {
  121.       :key        => :item,
  122.       :name       => "物品速度",
  123.       :limit      => 0,
  124.       :cost       => [1, 0.5],
  125.       :item_speed => [1],
  126.     },
  127.     {
  128.       :key   => :tgr,
  129.       :name  => "针对率", #受到攻击几率
  130.       :limit => 5,
  131.       :cost  => [1],
  132.       :tgr   => [0.2],
  133.     }
  134.   ]  # ← 这个 ] 别删掉了!

  135.   # ◆ 指定角色的加点变化
  136.   PERSONAL_GAIN_PARAMETER = []
  137.   #  以下、设定某角色的加点能力值变化,格式:
  138.   #   PERSONAL_GAIN_PARAMETER[角色ID] = [ 加点类型列表 ]
  139.   #
  140.   #  「加点类型列表」和 GAIN_PARAMETER 的设定格式相同。
  141.   #  如果某标志的设定与 GAIN_PARAMETER 的相同,则会覆盖 GAIN_PARAMETER 中的设定。
  142.   #
  143.   # <例> 单独设定1号角色的"体力"加点效果。
  144.   PERSONAL_GAIN_PARAMETER[1] = [
  145.     {
  146.       :key   => :health,
  147.       :name  => "体力",
  148.       :limit => 30,
  149.       :cost  => [ 1, 0.4],
  150.       :mhp   => [50, 3],
  151.       :def   => [ 1, 0.3],
  152.     },
  153.   ]

  154.   # ◆ 指定职业的加点变化
  155.   CLASS_GAIN_PARAMETER = []
  156.   #  以下、设定某职业的加点能力值变化,格式:
  157.   #   CLASS_GAIN_PARAMETER[职业ID] = [ 加点类型列表 ]
  158.   #
  159.   #  职业设定会覆盖以上两种设定。
  160.   #  (优先级  职业 > 角色 > 默认)
  161.   CLASS_GAIN_PARAMETER[1] = [
  162.       {
  163.       :key        => :item,
  164.       :name       => "物品速度",
  165.       :limit      => 0,
  166.       :cost       => [1, 0.5],
  167.       :item_speed => [2],
  168.     },
  169.                              ]
  170.                      


  171.   # ◆ 消耗点数的名称
  172.   VOCAB_RP   = "消耗"
  173.   # ◆ 属性点的缩写
  174.   VOCAB_RP_A = "属性点"

  175.   # ◆ 最大属性点的计算式
  176.   #   level .. 等级
  177.   #  计算结果是小数也OK(会自动替换成整数)。
  178.   MAXRP_EXP = "(level ** 0.25 + 2.0) * level"

  179.   # ◆ 能力值名
  180.   #  如果同时使用脚本 ?拡張装備画面? 、则优先使用下面的设定。
  181.   VOCAB_PARAM = {
  182.     :hit         => "命中率",        # 命中率
  183.     :eva         => "闪避率",        # 闪避率
  184.     :cri         => "暴击率",        # 暴击率
  185.     :skill_speed => "咏唱速度",      # 技能速度修正
  186.     :item_speed  => "物品速度",      # 物品速度補正
  187.     :tgr         => "针对率",        # 受到攻击几率
  188.   }  # ← 这个 } 别删了!

  189.   # ◆ 是否只显示已加点次数,而不显示加点上限
  190.   #  true  : 次数
  191.   #  false : 次数/---
  192.   HIDE_MAX_COUNT_INFINITE  = false

  193.   # ◆ 加点类型值槽的颜色
  194.   #  数值  : \C[n] 的颜色相同。
  195.   #  Color : 指定颜色。 ( Color.new(255, 128, 128) 等等 )
  196.   GAUGE_START_COLOR = 28  # 开始色
  197.   GAUGE_END_COLOR   = 29  # 结束色

  198.   # ◆ 是否显示"通用值槽图片效果"
  199.   #  使用脚本 ?汎用ゲージ描画? 时才有效。
  200.   ENABLE_GENERIC_GAUGE = true
  201.   # ◆ 值槽设定
  202.   #  图片放在 "Graphics/System" 里。
  203.   GAUGE_IMAGE  = "GaugeDist"  # 图片文件名
  204.   GAUGE_OFFSET = [-23, -2]    # 位置修正 [x, y]
  205.   GAUGE_LENGTH = -4           # 长度修正
  206.   GAUGE_SLOPE  = 30           # 倾角 (-89 ~ 89)

  207.   # ◆ 加点结束确认
  208.   CONFIRM_COMMANDS = [
  209.     " 确定",  # 确认加点
  210.     " 退出",  # 退出加点画面
  211.     " 取消",  # 取消
  212.   ]  # ← 这个 } 别删了!

  213.   # ◆ 确认指令帮助文本
  214.   CONFIRM_COMMAND_HELP = [
  215.     "应用加点。",                  # 确认加点
  216.     "撤回之前的加点并退出。",      # 退出加点画面
  217.     "返回加点画面。",              # 取消
  218.   ]  # ← 这个 } 别删了!

  219.   # ◆ 确认窗口的宽度
  220.   CONFIRM_WIDTH = 112

  221.   # ◆ 是否在菜单中添加"加点"的指令
  222.   #  true时,加点出现在菜单指令的最下方。
  223.   #  如果要改变位置、请使用脚本?カスタムメニューコマンド? 。
  224.   USE_MENU_DISTRIBUTE_PARAMETER_COMMAND = true
  225.   # ◆ 指令名称
  226.   VOCAB_MENU_DISTRIBUTE_PARAMETER       = "加点"

  227.   # ◆ 是否允许修改加点分配
  228.   #  true  : 就算确认加点后、也可以撤回加点并重新分配加点。
  229.   #  false : 一旦确认则不可修改。
  230.   ENABLE_REVERSE_DISTRIBUTE = true
  231. end

  232. #==============================================================================
  233. # ☆ 设定结束 - END Setting ☆
  234. #==============================================================================

  235. $kms_imported = {} if $kms_imported == nil
  236. $kms_imported["DistributeParameter"] = true


  237. module KMS_DistributeParameter
  238.   # 振り分け対象パラメータ
  239.   PARAMS = [:mhp, :mmp, :atk, :def, :mat, :mdf, :agi, :luk,
  240.     :hit, :eva, :cri, :skill_speed, :item_speed, :tgr]
  241.   PARAMS |= [:hit, :eva, :cri, :cev, :mev, :mrf, :cnt, :hrg, :mrg, :trg]
  242.   PARAMS |= [:tgr, :grd, :rec, :pha, :mcr, :tcr, :pdr, :mdr, :fdr, :exr]

  243.   # パラメータ増加量構造体
  244.   GainInfo  = Struct.new(:key, :name, :limit, :cost, :cost_rev, :params)
  245.   ParamInfo = Struct.new(:value, :value_rev)

  246.   # 振り分け情報構造体
  247.   DistInfo = Struct.new(:count, :hp, :mp)

  248.   #--------------------------------------------------------------------------
  249.   # ○ パラメータ増加量を構造体化
  250.   #--------------------------------------------------------------------------
  251.   def self.create_gain_param_structs(target)
  252.     result = []
  253.     target.each { |v|
  254.       info = GainInfo.new
  255.       info.key      = v[:key]
  256.       info.name     = v[:name]
  257.       info.limit    = v[:limit]
  258.       info.cost     = v[:cost][0]
  259.       info.cost_rev = (v[:cost][1] == nil ? 0 : v[:cost][1])
  260.       info.params   = {}

  261.       PARAMS.each { |param|
  262.         next unless v.has_key?(param)
  263.         pinfo = ParamInfo.new
  264.         pinfo.value     = v[param][0]
  265.         pinfo.value_rev = (v[param][1] == nil ? 0 : v[param][1])
  266.         info.params[param] = pinfo
  267.       }
  268.       result << info
  269.     }
  270.     return result
  271.   end
  272.   #--------------------------------------------------------------------------
  273.   # ○ パラメータ増加量を構造体化 (固有増加量用)
  274.   #--------------------------------------------------------------------------
  275.   def self.create_gain_param_structs_for_personal(target)
  276.     result = []
  277.     target.each { |list|
  278.       next if list == nil
  279.       result << create_gain_param_structs(list)
  280.     }
  281.     return result
  282.   end
  283.   #--------------------------------------------------------------------------
  284.   # ○ パラメータ増加量を併合
  285.   #--------------------------------------------------------------------------
  286.   def self.merge(list1, list2)
  287.     result = list1.clone
  288.     list2.each { |info2|
  289.       overwrite = false
  290.       list1.each_with_index { |info1, i|
  291.         if info1.key == info2.key
  292.           result[i] = info2
  293.           overwrite = true
  294.           break
  295.         end
  296.       }
  297.       result << info2 unless overwrite
  298.     }
  299.     return result
  300.   end

  301.   # パラメータ増加量を構造体化
  302.   GAIN_PARAMS = create_gain_param_structs(GAIN_PARAMETER)
  303.   PERSONAL_GAIN_PARAMS =
  304.     create_gain_param_structs_for_personal(PERSONAL_GAIN_PARAMETER)
  305.   CLASS_GAIN_PARAMS =
  306.     create_gain_param_structs_for_personal(CLASS_GAIN_PARAMETER)
  307. end

  308. #★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★

  309. #==============================================================================
  310. # ■ Vocab
  311. #==============================================================================

  312. module Vocab
  313.   # 命中率
  314.   def self.hit
  315.     return KMS_DistributeParameter::VOCAB_PARAM[:hit]
  316.   end

  317.   # 回避率
  318.   def self.eva
  319.     return KMS_DistributeParameter::VOCAB_PARAM[:eva]
  320.   end

  321.   # クリティカル率
  322.   def self.cri
  323.     return KMS_DistributeParameter::VOCAB_PARAM[:cri]
  324.   end

  325.   # スキル速度補正
  326.   def self.skill_speed
  327.     return KMS_DistributeParameter::VOCAB_PARAM[:skill_speed]
  328.   end

  329.   # アイテム速度補正
  330.   def self.item_speed
  331.     return KMS_DistributeParameter::VOCAB_PARAM[:item_speed]
  332.   end

  333.   # 狙われやすさ
  334.   def self.tgr
  335.     return KMS_DistributeParameter::VOCAB_PARAM[:tgr]
  336.   end

  337.   # RP
  338.   def self.rp
  339.     return KMS_DistributeParameter::VOCAB_RP
  340.   end

  341.   # RP (略)
  342.   def self.rp_a
  343.     return KMS_DistributeParameter::VOCAB_RP_A
  344.   end

  345.   # パラメータ振り分け
  346.   def self.distribute_parameter
  347.     return KMS_DistributeParameter::VOCAB_MENU_DISTRIBUTE_PARAMETER
  348.   end
  349. end

  350. #★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★

  351. #==============================================================================
  352. # ■ DataManager
  353. #==============================================================================

  354. module DataManager
  355.   module_function
  356.   #--------------------------------------------------------------------------
  357.   # ● セーブ内容の展開
  358.   #--------------------------------------------------------------------------
  359.   class << DataManager
  360.     unless method_defined?(:extract_save_contents_KMS_DistributeParameter)
  361.       alias extract_save_contents_KMS_DistributeParameter extract_save_contents
  362.     end
  363.   end
  364.   def extract_save_contents(contents)
  365.     extract_save_contents_KMS_DistributeParameter(contents)

  366.     KMS_Commands.check_distribution_values
  367.     Graphics.frame_reset
  368.   end
  369. end

  370. #★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★

  371. #==============================================================================
  372. # □ KMS_Commands
  373. #==============================================================================

  374. module KMS_Commands
  375.   module_function
  376.   #--------------------------------------------------------------------------
  377.   # ○ パラメータ振り分けに関する値をチェック
  378.   #--------------------------------------------------------------------------
  379.   def check_distribution_values
  380.     (1...$data_actors.size).each { |i|
  381.       actor = $game_actors[i]
  382.       actor.check_distribution_values
  383.       actor.restore_distribution_values
  384.     }
  385.   end
  386.   #--------------------------------------------------------------------------
  387.   # ○ RP の増減
  388.   #     actor_id : アクター ID
  389.   #     value    : 増減量
  390.   #--------------------------------------------------------------------------
  391.   def gain_rp(actor_id, value)
  392.     actor = $game_actors[actor_id]
  393.     return if actor == nil
  394.     actor.gain_rp(value)
  395.   end
  396.   #--------------------------------------------------------------------------
  397.   # ○ 振り分けの実行
  398.   #     actor_id : アクター ID
  399.   #     key      : 対象パラメータのキー
  400.   #     num      : 振り分け次数
  401.   #--------------------------------------------------------------------------
  402.   def distribute_param_actor(actor_id, key, num = 1)
  403.     actor = $game_actors[actor_id]
  404.     return if actor == nil

  405.     # 逆加算判定
  406.     reverse = false
  407.     if num < 0
  408.       reverse = true
  409.       num = num.abs
  410.     end

  411.     # 適用
  412.     num.times { |i| actor.rp_growth_effect(key, reverse) }
  413.   end
  414.   #--------------------------------------------------------------------------
  415.   # ○ 振り分け次数をリセット
  416.   #     actor_id : アクター ID
  417.   #--------------------------------------------------------------------------
  418.   def reset_distributed_count(actor_id)
  419.     actor = $game_actors[actor_id]
  420.     return if actor == nil
  421.     actor.clear_distribution_values
  422.     actor.restore_distribution_values
  423.   end
  424.   #--------------------------------------------------------------------------
  425.   # ○ パラメータ振り分け画面の呼び出し
  426.   #     actor_index : アクターインデックス
  427.   #--------------------------------------------------------------------------
  428.   def call_distribute_parameter(actor_index = 0)
  429.     return if $game_party.in_battle
  430.     $game_temp.call_distribute_parameter = true
  431.     $game_party.menu_actor = $game_party.members[actor_index]
  432.   end
  433. end

  434. class Game_Interpreter
  435.   include KMS_Commands
  436. end

  437. #★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★

  438. #==============================================================================
  439. # ■ Game_Temp
  440. #==============================================================================

  441. class Game_Temp
  442.   #--------------------------------------------------------------------------
  443.   # ● 公開インスタンス変数
  444.   #--------------------------------------------------------------------------
  445.   attr_accessor :call_distribute_parameter  # 振り分け画面呼び出しフラグ
  446.   attr_accessor :menu_actor_index           # 各種メニュー画面用のアクター index
  447.   #--------------------------------------------------------------------------
  448.   # ● オブジェクト初期化
  449.   #--------------------------------------------------------------------------
  450.   alias initialize_KMS_DistributeParameter initialize
  451.   def initialize
  452.     initialize_KMS_DistributeParameter

  453.     @call_distribute_parameter = false
  454.     @menu_actor_index = 0
  455.   end
  456. end

  457. #★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★

  458. #==============================================================================
  459. # ■ Game_BattlerBase
  460. #==============================================================================

  461. class Game_BattlerBase
  462.   #--------------------------------------------------------------------------
  463.   # ● 能力値に加算する値をクリア
  464.   #--------------------------------------------------------------------------
  465.   alias clear_param_plus_KMS_DistributeParameter clear_param_plus
  466.   def clear_param_plus
  467.     clear_param_plus_KMS_DistributeParameter

  468.     clear_distribution_values
  469.     calc_distribution_values
  470.   end
  471.   #--------------------------------------------------------------------------
  472.   # ○ パラメータ振り分けに関する値をクリア
  473.   #--------------------------------------------------------------------------
  474.   def clear_distribution_values
  475.     @distributed_count = {}
  476.     KMS_DistributeParameter::PARAMS.each { |param|
  477.       @distributed_count[param] = 0
  478.     }
  479.   end
  480.   #--------------------------------------------------------------------------
  481.   # ○ パラメータ振り分けに関する値をチェック
  482.   #--------------------------------------------------------------------------
  483.   def check_distribution_values
  484.     last_distributed_count = @distributed_count

  485.     clear_distribution_values

  486.     @distributed_count = last_distributed_count if last_distributed_count != nil
  487.   end
  488.   #--------------------------------------------------------------------------
  489.   # ○ 各種修正値を計算
  490.   #--------------------------------------------------------------------------
  491.   def calc_distribution_values
  492.     # 継承先で定義
  493.   end
  494.   #--------------------------------------------------------------------------
  495.   # ○ 振り分けによる上昇値を取得
  496.   #     param : パラメータの Symbol
  497.   #--------------------------------------------------------------------------
  498.   def distributed_param(param)
  499.     return 0
  500.   end
  501.   #--------------------------------------------------------------------------
  502.   # ○ 振り分けに関する情報を取得
  503.   #--------------------------------------------------------------------------
  504.   def distribution_info
  505.     info = KMS_DistributeParameter::DistInfo.new
  506.     info.count = @distributed_count.clone
  507.     info.hp    = self.hp
  508.     info.mp    = self.mp
  509.     return info
  510.   end
  511.   #--------------------------------------------------------------------------
  512.   # ○ 振り分けに関する情報を設定
  513.   #--------------------------------------------------------------------------
  514.   def set_distribution_info(info)
  515.     return unless info.is_a?(KMS_DistributeParameter::DistInfo)

  516.     @distributed_count = info.count
  517.     calc_distribution_values
  518.     self.hp = info.hp
  519.     self.mp = info.mp
  520.   end
  521. end

  522. #★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★

  523. #==============================================================================
  524. # ■ Game_Action
  525. #==============================================================================

  526. class Game_Action
  527.   #--------------------------------------------------------------------------
  528.   # ● 行動速度の計算
  529.   #--------------------------------------------------------------------------
  530.   alias speed_KMS_DistributeParameter speed
  531.   def speed
  532.     speed = speed_KMS_DistributeParameter
  533.     return speed if attack?

  534.     if item.is_a?(RPG::Skill) && item.speed < 0
  535.       n = [subject.distributed_param(:skill_speed), item.speed.abs].min
  536.       speed += n
  537.     elsif item.is_a?(RPG::Item) && item.speed < 0
  538.       n = [subject.distributed_param(:item_speed), item.speed.abs].min
  539.       speed += n
  540.     end

  541.     return speed
  542.   end
  543. end

  544. #★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★

  545. #==============================================================================
  546. # ■ Game_Actor
  547. #==============================================================================

  548. class Game_Actor < Game_Battler
  549.   #--------------------------------------------------------------------------
  550.   # ○ クラス変数
  551.   #--------------------------------------------------------------------------
  552.   @@__distribute_gain_params = {}
  553.   #--------------------------------------------------------------------------
  554.   # ● オブジェクト初期化
  555.   #     actor_id : アクター ID
  556.   #--------------------------------------------------------------------------
  557.   alias initialize_KMS_DistributeParameter initialize
  558.   def initialize(actor_id)
  559.     @actor_id = actor_id
  560.     @class_id = actor.class_id

  561.     initialize_KMS_DistributeParameter(actor_id)
  562.   end
  563.   #--------------------------------------------------------------------------
  564.   # ○ パラメータ増加量一覧を取得
  565.   #--------------------------------------------------------------------------
  566.   def gain_parameter_list
  567.     key = "#{@actor_id}_#{@class_id}"
  568.     unless @@__distribute_gain_params.has_key?(key)
  569.       result = KMS_DistributeParameter::GAIN_PARAMS

  570.       # アクター固有
  571.       list   = KMS_DistributeParameter::PERSONAL_GAIN_PARAMS[@actor_id]
  572.       result = KMS_DistributeParameter.merge(result, list) if list != nil

  573.       # 職業固有
  574.       list   = KMS_DistributeParameter::CLASS_GAIN_PARAMS[@class_id]
  575.       result = KMS_DistributeParameter.merge(result, list) if list != nil

  576.       @@__distribute_gain_params[key] = result
  577.     end

  578.     return @@__distribute_gain_params[key]
  579.   end
  580.   #--------------------------------------------------------------------------
  581.   # ○ パラメータ増加量を取得
  582.   #     key : 振り分けキー
  583.   #--------------------------------------------------------------------------
  584.   def gain_parameter(key)
  585.     return gain_parameter_list.find { |v| v.key == key }
  586.   end
  587.   #--------------------------------------------------------------------------
  588.   # ○ 各種修正値を計算
  589.   #--------------------------------------------------------------------------
  590.   def calc_distribution_values
  591.     @rp_cost = 0
  592.     @distributed_param = {}
  593.     KMS_DistributeParameter::PARAMS.each { |param|
  594.       @distributed_param[param] = 0
  595.     }

  596.     gain_parameter_list.each { |gain|
  597.       next if gain == nil
  598.       cost = 0
  599.       distributed_count(gain.key).times { |i|
  600.         cost += Integer(gain.cost + gain.cost_rev * i)
  601.         gain.params.each { |param, v|
  602.           @distributed_param[param] += v.value + v.value_rev * i
  603.         }
  604.       }
  605.       @rp_cost += [cost, 0].max
  606.     }

  607.     KMS_DistributeParameter::PARAMS.each { |param|
  608.       @distributed_param[param] = @distributed_param[param]
  609.     }
  610.   end
  611.   #--------------------------------------------------------------------------
  612.   # ○ 各種修正値を修復
  613.   #--------------------------------------------------------------------------
  614.   def restore_distribution_values
  615.     calc_distribution_values
  616.     self.hp = self.hp
  617.     self.mp = self.mp
  618.   end
  619.   #--------------------------------------------------------------------------
  620.   # ○ 振り分けによる上昇値を取得
  621.   #     param : パラメータの Symbol
  622.   #--------------------------------------------------------------------------
  623.   def distributed_param(param)
  624.     return 0 if @distributed_param == nil
  625.     return 0 if @distributed_param[param] == nil
  626.     return @distributed_param[param]
  627.   end
  628.   PARAM_SYMBOL  = [:mhp, :mmp, :atk, :def, :mat, :mdf, :agi, :luk]
  629.   XPARAM_SYMBOL = [:hit, :eva, :cri, :cev, :mev, :mrf, :cnt, :hrg, :mrg, :trg]
  630.   SPARAM_SYMBOL = [:tgr, :grd, :rec, :pha, :mcr, :tcr, :pdr, :mdr, :fdr, :exr]
  631.   #--------------------------------------------------------------------------
  632.   # ● 通常能力値の基本値取得
  633.   #--------------------------------------------------------------------------
  634.   alias param_base_KMS_DistributeParameter param_base
  635.   def param_base(param_id)
  636.     n = param_base_KMS_DistributeParameter(param_id)
  637.     if PARAM_SYMBOL[param_id] != nil
  638.       n += distributed_param(PARAM_SYMBOL[param_id])
  639.     end

  640.     return Integer(n)
  641.   end
  642.   #--------------------------------------------------------------------------
  643.   # ● 命中率の取得
  644.   #--------------------------------------------------------------------------
  645.   alias hit_KMS_DistributeParameter hit
  646.   def hit
  647.     n = hit_KMS_DistributeParameter + distributed_param(:hit)
  648.     return n
  649.   end
  650.   #--------------------------------------------------------------------------
  651.   # ● 回避率の取得
  652.   #--------------------------------------------------------------------------
  653.   alias eva_KMS_DistributeParameter eva
  654.   def eva
  655.     n = eva_KMS_DistributeParameter + distributed_param(:eva)
  656.     return n
  657.   end
  658.   #--------------------------------------------------------------------------
  659.   # ● クリティカル率の取得
  660.   #--------------------------------------------------------------------------
  661.   alias cri_KMS_DistributeParameter cri
  662.   def cri
  663.     n = cri_KMS_DistributeParameter + distributed_param(:cri)
  664.     return n
  665.   end
  666.   #--------------------------------------------------------------------------
  667.   # ● 狙われ率の取得
  668.   #--------------------------------------------------------------------------
  669.   alias tgr_KMS_DistributeParameter tgr
  670.   def tgr
  671.     n = tgr_KMS_DistributeParameter + distributed_param(:tgr)
  672.     return n
  673.   end
  674.   #--------------------------------------------------------------------------
  675.   # ○ MaxRP の取得
  676.   #--------------------------------------------------------------------------
  677.   def mrp
  678.     n = Integer(eval(KMS_DistributeParameter::MAXRP_EXP))
  679.     return [n + mrp_plus, 0].max
  680.   end
  681.   #--------------------------------------------------------------------------
  682.   # ○ MaxRP 補正値の取得
  683.   #--------------------------------------------------------------------------
  684.   def mrp_plus
  685.     @mrp_plus = 0 if @mrp_plus == nil
  686.     return @mrp_plus
  687.   end
  688.   #--------------------------------------------------------------------------
  689.   # ○ RP の取得
  690.   #--------------------------------------------------------------------------
  691.   def rp
  692.     return [mrp - @rp_cost, 0].max
  693.   end
  694.   #--------------------------------------------------------------------------
  695.   # ○ 振り分け次数の取得
  696.   #     param : 振り分け先パラメータ (キー)
  697.   #--------------------------------------------------------------------------
  698.   def distributed_count(param)
  699.     clear_distribution_values     if @distributed_count == nil
  700.     @distributed_count[param] = 0 if @distributed_count[param] == nil
  701.     return @distributed_count[param]
  702.   end
  703.   #--------------------------------------------------------------------------
  704.   # ○ RP の増減
  705.   #     value : 増減量
  706.   #--------------------------------------------------------------------------
  707.   def gain_rp(value)
  708.     @mrp_plus = mrp_plus + value
  709.   end
  710.   #--------------------------------------------------------------------------
  711.   # ○ 振り分け次数の増減
  712.   #     param : 振り分け先パラメータ (キー)
  713.   #     value : 増減量
  714.   #--------------------------------------------------------------------------
  715.   def gain_distributed_count(param, value = 1)
  716.     n = distributed_count(param)
  717.     @distributed_count[param] += value if n.is_a?(Integer)
  718.   end
  719.   #--------------------------------------------------------------------------
  720.   # ○ RP 振り分けによる成長効果適用
  721.   #     param   : 振り分け先パラメータ (キー)
  722.   #     reverse : 逆加算のときは true
  723.   #--------------------------------------------------------------------------
  724.   def rp_growth_effect(param, reverse = false)
  725.     gain = gain_parameter(param)
  726.     return if gain == nil  # 無効なパラメータ

  727.     if reverse
  728.       return if distributed_count(param) == 0  # 逆加算不可
  729.     else
  730.       return unless can_distribute?(param)
  731.     end

  732.     gain_distributed_count(param, reverse ? -1 : 1)
  733.     restore_distribution_values
  734.   end
  735.   #--------------------------------------------------------------------------
  736.   # ○ パラメータ振り分け可否判定
  737.   #     param : 振り分け先パラメータ (キー)
  738.   #--------------------------------------------------------------------------
  739.   def can_distribute?(param)
  740.     gain = gain_parameter(param)
  741.     return false if gain == nil                        # 無効なパラメータ
  742.     return false if self.rp < distribute_cost(param)   # RP 不足
  743.     if gain.limit > 0
  744.       return false if gain.limit <= distributed_count(param)  # 次数上限
  745.     end

  746.     return true
  747.   end
  748.   #--------------------------------------------------------------------------
  749.   # ○ パラメータ振り分けコスト計算
  750.   #     param : 振り分け先パラメータ (キー)
  751.   #--------------------------------------------------------------------------
  752.   def distribute_cost(param)
  753.     gain = gain_parameter(param)
  754.     return 0 if gain == nil  # 無効なパラメータ

  755.     n = gain.cost
  756.     count = distributed_count(param)
  757.     count = [count, gain.limit - 1].min if gain.limit > 0
  758.     n += gain.cost_rev * count
  759.     return [Integer(n), 0].max
  760.   end
  761.   #--------------------------------------------------------------------------
  762.   # ○ パラメータ振り分け後の増加量計算
  763.   #     param : 振り分け先パラメータ (キー)
  764.   #     amt   : 振り分け数
  765.   #--------------------------------------------------------------------------
  766.   def distribute_gain(param, amt = 1)
  767.     gain = gain_parameter(param)

  768.     # 無効なパラメータ
  769.     return 0 if gain == nil

  770.     result = {}
  771.     KMS_DistributeParameter::PARAMS.each { |par|
  772.       result[par] = distributed_param(par)
  773.     }

  774.     # 振り分け不可
  775.     if amt > 0
  776.       return result if gain.limit > 0 && gain.limit == distributed_count(param)
  777.     else
  778.       return result if distributed_count(param) + amt < 0
  779.     end

  780.     last_hp = self.hp
  781.     last_mp = self.mp
  782.     last_count = distributed_count(param)
  783.     rp_growth_effect(param)
  784.     KMS_DistributeParameter::PARAMS.each { |par|
  785.       result[par] = distributed_param(par) if gain.params.include?(par)
  786.     }
  787.     rp_growth_effect(param, true) if last_count < distributed_count(param)
  788.     self.hp = last_hp
  789.     self.mp = last_mp

  790.     return result
  791.   end
  792. end

  793. #★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★

  794. #==============================================================================
  795. # ■ Window_Base
  796. #==============================================================================

  797. class Window_Base < Window
  798.   #--------------------------------------------------------------------------
  799.   # ○ RP の文字色を取得
  800.   #     actor : アクター
  801.   #--------------------------------------------------------------------------
  802.   def rp_color(actor)
  803.     return (actor.rp == 0 ? knockout_color : normal_color)
  804.   end
  805.   #--------------------------------------------------------------------------
  806.   # ○ 振り分けゲージの色 1 の取得
  807.   #--------------------------------------------------------------------------
  808.   def distribute_gauge_color1
  809.     color = KMS_DistributeParameter::GAUGE_START_COLOR
  810.     return (color.is_a?(Integer) ? text_color(color) : color)
  811.   end
  812.   #--------------------------------------------------------------------------
  813.   # ○ 振り分けゲージの色 2 の取得
  814.   #--------------------------------------------------------------------------
  815.   def distribute_gauge_color2
  816.     color = KMS_DistributeParameter::GAUGE_END_COLOR
  817.     return (color.is_a?(Integer) ? text_color(color) : color)
  818.   end
  819.   #--------------------------------------------------------------------------
  820.   # ○ RP の描画
  821.   #     actor : アクター
  822.   #     x     : 描画先 X 座標
  823.   #     y     : 描画先 Y 座標
  824.   #     width : 幅
  825.   #--------------------------------------------------------------------------
  826.   def draw_actor_rp(actor, x, y, width = 124)
  827.     change_color(system_color)
  828.     draw_text(x, y, 30, line_height, Vocab::rp_a)
  829.     draw_current_and_max_values(x, y, width, actor.rp, actor.mrp,
  830.       rp_color(actor), normal_color)
  831.     change_color(normal_color)
  832.   end
  833.   #--------------------------------------------------------------------------
  834.   # ○ 振り分けゲージの描画
  835.   #     actor : アクター
  836.   #     param : パラメータ
  837.   #     x     : 描画先 X 座標
  838.   #     y     : 描画先 Y 座標
  839.   #     width : 幅
  840.   #--------------------------------------------------------------------------
  841.   def draw_actor_distribute_gauge(actor, param, x, y, width = 124)
  842.     gain = actor.gain_parameter(param)
  843.     return if gain == nil || gain.limit <= 0

  844.     rate = actor.distributed_count(param) * 1.0 / gain.limit
  845.     if $kms_imported["GenericGauge"] &&
  846.         KMS_DistributeParameter::ENABLE_GENERIC_GAUGE
  847.       # 汎用ゲージ
  848.       draw_generic_gauge(KMS_DistributeParameter::GAUGE_IMAGE,
  849.         x, y, width, rate,
  850.         KMS_DistributeParameter::GAUGE_OFFSET,
  851.         KMS_DistributeParameter::GAUGE_LENGTH,
  852.         KMS_DistributeParameter::GAUGE_SLOPE)
  853.     else
  854.       # デフォルトゲージ
  855.       gc1  = distribute_gauge_color1
  856.       gc2  = distribute_gauge_color2
  857.       draw_gauge(x, y, width, rate, gc1, gc2)
  858.     end
  859.   end
  860. end

  861. #★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★

  862. #==============================================================================
  863. # ■ Window_MenuCommand
  864. #==============================================================================

  865. class Window_MenuCommand < Window_Command
  866.   if KMS_DistributeParameter::USE_MENU_DISTRIBUTE_PARAMETER_COMMAND &&
  867.       !$kms_imported["CustomMenuCommand"]
  868.     #--------------------------------------------------------------------------
  869.     # ● コマンドリストの作成
  870.     #--------------------------------------------------------------------------
  871.     alias make_command_list_KMS_DistributeParameter make_command_list
  872.     def make_command_list
  873.       make_command_list_KMS_DistributeParameter

  874.       add_distribute_parameter_command
  875.     end
  876.   end
  877.   #--------------------------------------------------------------------------
  878.   # ○ 振り分けコマンドをリストに追加
  879.   #--------------------------------------------------------------------------
  880.   def add_distribute_parameter_command
  881.     add_command(Vocab::distribute_parameter,
  882.       :distribute_parameter,
  883.       distribute_parameter_enabled)
  884.   end
  885.   #--------------------------------------------------------------------------
  886.   # ○ パラメータ振り分けの有効状態を取得
  887.   #--------------------------------------------------------------------------
  888.   def distribute_parameter_enabled
  889.     return true
  890.   end
  891. end

  892. #★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★

  893. #==============================================================================
  894. # □ Window_DistributeParameterActor
  895. #------------------------------------------------------------------------------
  896. #   振り分け画面で、アクターの情報を表示するウィンドウです。
  897. #==============================================================================

  898. class Window_DistributeParameterActor < Window_Base
  899.   #--------------------------------------------------------------------------
  900.   # ○ 公開インスタンス変数
  901.   #--------------------------------------------------------------------------
  902.   attr_accessor :actor
  903.   #--------------------------------------------------------------------------
  904.   # ● オブジェクト初期化
  905.   #     x     : ウィンドウの X 座標
  906.   #     y     : ウィンドウの Y 座標
  907.   #     actor : アクター
  908.   #--------------------------------------------------------------------------
  909.   def initialize(x, y, actor)
  910.     super(x, y, Graphics.width, line_height + 32)
  911.     @actor = actor
  912.     refresh
  913.   end
  914.   #--------------------------------------------------------------------------
  915.   # ● リフレッシュ
  916.   #--------------------------------------------------------------------------
  917.   def refresh
  918.     contents.clear
  919.     draw_actor_name(@actor, 4, 0)
  920.     draw_actor_level(@actor, 140, 0)
  921.     draw_actor_rp(@actor, 240, 0)
  922.   end
  923. end

  924. #★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★

  925. #==============================================================================
  926. # □ Window_DistributeParameterList
  927. #------------------------------------------------------------------------------
  928. #   振り分け画面で、成長させるパラメータを選択するウィンドウです。
  929. #==============================================================================

  930. class Window_DistributeParameterList < Window_Selectable
  931.   #--------------------------------------------------------------------------
  932.   # ○ 公開インスタンス変数
  933.   #--------------------------------------------------------------------------
  934.   attr_accessor :actor
  935.   #--------------------------------------------------------------------------
  936.   # ● オブジェクト初期化
  937.   #     actor : アクター
  938.   #--------------------------------------------------------------------------
  939.   def initialize(actor)
  940.     off_h = line_height + 32
  941.     super(0, off_h, 286, Graphics.height - off_h)
  942.     @actor = actor
  943.     refresh
  944.     self.index = 0
  945.   end
  946.   #--------------------------------------------------------------------------
  947.   # ○ 選択中のパラメータの Symbol を取得
  948.   #--------------------------------------------------------------------------
  949.   def parameter_key
  950.     return @data[self.index]
  951.   end
  952.   #--------------------------------------------------------------------------
  953.   # ● 項目数の取得
  954.   #--------------------------------------------------------------------------
  955.   def item_max
  956.     return @data == nil ? 0 : @data.size
  957.   end
  958.   #--------------------------------------------------------------------------
  959.   # ● 1 ページに表示できる行数の取得
  960.   #--------------------------------------------------------------------------
  961.   def page_row_max
  962.     return super - 1
  963.   end
  964.   #--------------------------------------------------------------------------
  965.   # ● 項目を描画する矩形の取得
  966.   #     index : 項目番号
  967.   #--------------------------------------------------------------------------
  968.   def item_rect(index)
  969.     rect = super(index)
  970.     rect.y += line_height
  971.     return rect
  972.   end
  973.   #--------------------------------------------------------------------------
  974.   # ● カーソルを 1 ページ後ろに移動
  975.   #--------------------------------------------------------------------------
  976.   def cursor_pagedown
  977.     return if Input.repeat?(Input::R)
  978.     super
  979.   end
  980.   #--------------------------------------------------------------------------
  981.   # ● カーソルを 1 ページ前に移動
  982.   #--------------------------------------------------------------------------
  983.   def cursor_pageup
  984.     return if Input.repeat?(Input::L)
  985.     super
  986.   end
  987.   #--------------------------------------------------------------------------
  988.   # ● リフレッシュ
  989.   #--------------------------------------------------------------------------
  990.   def refresh
  991.     @gain_list = @actor.gain_parameter_list
  992.     @data = []
  993.     @gain_list.each { |gain| @data << gain.key }
  994.     @item_max = @data.size + 1
  995.     create_contents
  996.     @item_max -= 1
  997.     draw_caption
  998.     @item_max.times { |i| draw_item(i, @actor.can_distribute?(@data[i])) }
  999.   end
  1000.   #--------------------------------------------------------------------------
  1001.   # ○ 見出しの描画
  1002.   #--------------------------------------------------------------------------
  1003.   def draw_caption
  1004.     change_color(system_color)
  1005.     draw_text(  4, 0, 96, line_height, "加点类型")
  1006.     draw_text(120, 0, 40, line_height, Vocab.rp, 2)
  1007.     draw_text(170, 0, 80, line_height, "次数", 2)
  1008.     change_color(normal_color)
  1009.   end
  1010.   #--------------------------------------------------------------------------
  1011.   # ○ 項目の描画
  1012.   #     index   : 項目番号
  1013.   #     enabled : 有効フラグ
  1014.   #--------------------------------------------------------------------------
  1015.   def draw_item(index, enabled = true)
  1016.     rect = item_rect(index)
  1017.     contents.clear_rect(rect)
  1018.     item = @data[index]
  1019.     if item != nil
  1020.       draw_parameter(rect.x, rect.y, @data[index], enabled)
  1021.     end
  1022.   end
  1023.   #--------------------------------------------------------------------------
  1024.   # ○ 能力値の描画
  1025.   #     x       : 描画先 X 座標
  1026.   #     y       : 描画先 Y 座標
  1027.   #     param   : 振り分け先
  1028.   #     enabled : 有効フラグ
  1029.   #--------------------------------------------------------------------------
  1030.   def draw_parameter(x, y, param, enabled)
  1031.     gain = @gain_list.find { |v| v.key == param }
  1032.     return if gain == nil

  1033.     change_color(normal_color)
  1034.     contents.font.color.alpha = enabled ? 255 : 128
  1035.     draw_text(x + 4, y, 96, line_height, gain.name)

  1036.     # コスト描画
  1037.     value = @actor.distribute_cost(param)
  1038.     draw_text(x + 120, y, 40, line_height, value, 2)

  1039.     # 振り分け次数描画
  1040.     if gain.limit > 0
  1041.       value = sprintf("%3d/%3d", @actor.distributed_count(param), gain.limit)
  1042.     else
  1043.       value = sprintf("%3d%s", @actor.distributed_count(param),
  1044.         KMS_DistributeParameter::HIDE_MAX_COUNT_INFINITE ? "" : "/---")
  1045.     end
  1046.     draw_actor_distribute_gauge(@actor, param, x + 170, y, 80)
  1047.     draw_text(x + 170, y, 80, line_height, value, 2)

  1048.     change_color(normal_color)
  1049.   end
  1050.   #--------------------------------------------------------------------------
  1051.   # ● 決定やキャンセルなどのハンドリング処理
  1052.   #--------------------------------------------------------------------------
  1053.   def process_handling
  1054.     super
  1055.     call_handler(:increase) if handle?(:increase) && Input.repeat?(:RIGHT)
  1056.     call_handler(:decrease) if handle?(:decrease) && Input.repeat?(:LEFT)
  1057.     call_handler(:up)       if handle?(:up)       && Input.repeat?(:UP)
  1058.     call_handler(:down)     if handle?(:down)     && Input.repeat?(:DOWN)
  1059.   end
  1060. end

  1061. #★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★

  1062. #==============================================================================
  1063. # □ Window_DistributeParameterStatus
  1064. #------------------------------------------------------------------------------
  1065. #   振り分け画面で、アクターのステータスを表示するウィンドウです。
  1066. #==============================================================================

  1067. class Window_DistributeParameterStatus < Window_Base
  1068.   #--------------------------------------------------------------------------
  1069.   # ○ 公開インスタンス変数
  1070.   #--------------------------------------------------------------------------
  1071.   attr_accessor :actor
  1072.   #--------------------------------------------------------------------------
  1073.   # ● オブジェクト初期化
  1074.   #     actor : アクター
  1075.   #--------------------------------------------------------------------------
  1076.   def initialize(actor)
  1077.     dx = 286
  1078.     off_h = line_height + 32
  1079.     super(dx, off_h, Graphics.width - dx, Graphics.height - off_h)
  1080.     @actor = actor
  1081.     refresh(actor.gain_parameter_list[0].key)
  1082.   end
  1083.   #--------------------------------------------------------------------------
  1084.   # ● リフレッシュ
  1085.   #--------------------------------------------------------------------------
  1086.   def refresh(param = nil)
  1087.     @distribute_gain = nil
  1088.     if param != nil
  1089.       @distribute_gain = @actor.distribute_gain(param)
  1090.     end

  1091.     contents.clear
  1092. #    change_color(system_color)
  1093. #    draw_text(0, 0, width - 32, line_height, "パラメータ変化", 1)
  1094. #    change_color(normal_color)
  1095. #
  1096. #    dy = line_height
  1097.     dy = 0
  1098.     KMS_DistributeParameter::PARAMS.each { |param|
  1099.       draw_parameter(0, dy, param)
  1100.       dy += line_height
  1101.     }
  1102.   end
  1103.   #--------------------------------------------------------------------------
  1104.   # ○ 能力値の描画
  1105.   #     x    : 描画先 X 座標
  1106.   #     y    : 描画先 Y 座標
  1107.   #     type : 能力値の種類
  1108.   #--------------------------------------------------------------------------
  1109.   def draw_parameter(x, y, type)
  1110.     is_float = false

  1111.     case type
  1112.     when :mhp
  1113.       name  = Vocab.hp
  1114.       value = @actor.mhp
  1115.     when :mmp
  1116.       name  = Vocab.mp
  1117.       value = @actor.mmp
  1118.     when :atk
  1119.       name  = Vocab.param(2)
  1120.       value = @actor.atk
  1121.     when :def
  1122.       name  = Vocab.param(3)
  1123.       value = @actor.def
  1124.     when :mat
  1125.       name  = Vocab.param(4)
  1126.       value = @actor.mat
  1127.     when :mdf
  1128.       name  = Vocab.param(5)
  1129.       value = @actor.mdf
  1130.     when :agi
  1131.       name  = Vocab.param(6)
  1132.       value = @actor.agi
  1133.     when :luk
  1134.       name  = Vocab.param(7)
  1135.       value = @actor.luk
  1136.     when :hit
  1137.       name  = Vocab.hit
  1138.       value = @actor.hit
  1139.       is_float = true
  1140.     when :eva
  1141.       name  = Vocab.eva
  1142.       value = @actor.eva
  1143.       is_float = true
  1144.     when :cri
  1145.       name  = Vocab.cri
  1146.       value = @actor.cri
  1147.       is_float = true
  1148.     when :skill_speed
  1149.       name  = Vocab.skill_speed
  1150.       value = @actor.distributed_param(type)
  1151.     when :item_speed
  1152.       name  = Vocab.item_speed
  1153.       value = @actor.distributed_param(type)
  1154.     when :tgr
  1155.       name  = Vocab.tgr
  1156.       value = @actor.tgr
  1157.       is_float = true
  1158.     else
  1159.       return
  1160.     end

  1161.     # パラメータ名
  1162.     change_color(system_color)
  1163.     draw_text(x + 4, y, 96, line_height, name)
  1164.     change_color(normal_color)
  1165.     draw_text(x + 106, y, 48, line_height, convert_value(value, is_float), 2)

  1166.     return if @distribute_gain == nil

  1167.     # パラメータ変化
  1168.     draw_text(x + 154, y, 16, line_height, "→", 1)

  1169.     curr = @actor.distributed_param(type)
  1170.     gain = @distribute_gain[type]
  1171.     change_color(gain > curr ? text_color(3) : gain < curr ?
  1172.         text_color(2) : normal_color)
  1173.     new_value = value + (gain - curr)
  1174.     draw_text(x + 174, y, 48, line_height, convert_value(new_value, is_float), 2)

  1175.     change_color(normal_color)
  1176.   end
  1177.   def convert_value(value, is_float)
  1178.     if is_float
  1179.       return sprintf("%.2f", value)
  1180.     else
  1181.       return value.to_i.to_s
  1182.     end
  1183.   end
  1184. end

  1185. #★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★

  1186. #==============================================================================
  1187. # □ Window_DistributeParameterConfirm
  1188. #------------------------------------------------------------------------------
  1189. #   振り分け画面で、振り分けの確定/中止を選択するウィンドウです。
  1190. #==============================================================================

  1191. class Window_DistributeParameterConfirm < Window_Command
  1192.   #--------------------------------------------------------------------------
  1193.   # ● ウィンドウ幅の取得
  1194.   #--------------------------------------------------------------------------
  1195.   def window_width
  1196.     return KMS_DistributeParameter::CONFIRM_WIDTH
  1197.   end
  1198.   #--------------------------------------------------------------------------
  1199.   # ● コマンドリストの作成
  1200.   #--------------------------------------------------------------------------
  1201.   def make_command_list
  1202.     super
  1203.     add_command(KMS_DistributeParameter::CONFIRM_COMMANDS[0], :decide)
  1204.     add_command(KMS_DistributeParameter::CONFIRM_COMMANDS[1], :stop)
  1205.     add_command(KMS_DistributeParameter::CONFIRM_COMMANDS[2], :cancel)
  1206.   end
  1207.   #--------------------------------------------------------------------------
  1208.   # ● ヘルプテキスト更新
  1209.   #--------------------------------------------------------------------------
  1210.   def update_help
  1211.     text = index >= 0 ? KMS_DistributeParameter::CONFIRM_COMMAND_HELP[index] : nil
  1212.     @help_window.set_text(text)
  1213.   end
  1214. end

  1215. #★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★

  1216. #==============================================================================
  1217. # ■ Scene_Map
  1218. #==============================================================================

  1219. class Scene_Map < Scene_Base
  1220.   #--------------------------------------------------------------------------
  1221.   # ● シーン遷移に関連する更新
  1222.   #--------------------------------------------------------------------------
  1223.   alias update_scene_KMS_DistributeParameter update_scene
  1224.   def update_scene
  1225.     update_scene_KMS_DistributeParameter

  1226.     update_call_distribute_parameter unless scene_changing?
  1227.   end
  1228.   #--------------------------------------------------------------------------
  1229.   # ○ パラメータ振り分け画面呼び出し判定
  1230.   #--------------------------------------------------------------------------
  1231.   def update_call_distribute_parameter
  1232.     if $game_temp.call_distribute_parameter && !$game_player.moving?
  1233.       $game_temp.call_distribute_parameter = false
  1234.       call_distribute_parameter
  1235.     end
  1236.   end
  1237.   #--------------------------------------------------------------------------
  1238.   # ○ パラメータ振り分け画面への切り替え
  1239.   #--------------------------------------------------------------------------
  1240.   def call_distribute_parameter
  1241.     SceneManager.call(Scene_DistributeParameter)
  1242.   end
  1243. end

  1244. #★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★

  1245. #==============================================================================
  1246. # ■ Scene_Menu
  1247. #==============================================================================

  1248. class Scene_Menu < Scene_MenuBase
  1249.   #--------------------------------------------------------------------------
  1250.   # ● コマンドウィンドウの作成
  1251.   #--------------------------------------------------------------------------
  1252.   alias create_command_window_KMS_DistributeParameter create_command_window
  1253.   def create_command_window
  1254.     create_command_window_KMS_DistributeParameter

  1255.     @command_window.set_handler(:distribute_parameter, method(:command_personal))
  1256.   end
  1257.   #--------------------------------------------------------------------------
  1258.   # ○ コマンド [パラメータ振り分け]
  1259.   #--------------------------------------------------------------------------
  1260.   def command_distribute_parameter
  1261.     SceneManager.call(Scene_DistributeParameter)
  1262.   end
  1263.   #--------------------------------------------------------------------------
  1264.   # ● 個人コマンド[決定]
  1265.   #--------------------------------------------------------------------------
  1266.   alias on_personal_ok_KMS_DistributeParameter on_personal_ok
  1267.   def on_personal_ok
  1268.     on_personal_ok_KMS_DistributeParameter

  1269.     if @command_window.current_symbol == :distribute_parameter
  1270.       command_distribute_parameter
  1271.     end
  1272.   end
  1273. end

  1274. #★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★

  1275. #==============================================================================
  1276. # □ Scene_DistributeParameter
  1277. #------------------------------------------------------------------------------
  1278. #   パラメータ振り分け画面の処理を行うクラスです。
  1279. #==============================================================================

  1280. class Scene_DistributeParameter < Scene_MenuBase
  1281.   #--------------------------------------------------------------------------
  1282.   # ● 開始処理
  1283.   #--------------------------------------------------------------------------
  1284.   def start
  1285.     super
  1286.     @prev_actor = @actor
  1287.     @prev_info  = @actor.distribution_info
  1288.     create_help_window
  1289.     create_actor_window
  1290.     create_parameter_window
  1291.     create_status_window
  1292.     create_confirm_window
  1293.   end
  1294.   #--------------------------------------------------------------------------
  1295.   # ○ アクターウィンドウ作成
  1296.   #--------------------------------------------------------------------------
  1297.   def create_actor_window
  1298.     @actor_window = Window_DistributeParameterActor.new(0, 0, @actor)
  1299.     @actor_window.viewport = @viewport
  1300.   end
  1301.   #--------------------------------------------------------------------------
  1302.   # ○ パラメータリストウィンドウ作成
  1303.   #--------------------------------------------------------------------------
  1304.   def create_parameter_window
  1305.     @parameter_window = Window_DistributeParameterList.new(@actor)
  1306.     @parameter_window.viewport = @viewport
  1307.     @parameter_window.activate
  1308.     @parameter_window.set_handler(:ok,       method(:on_parameter_ok))
  1309.     @parameter_window.set_handler(:cancel,   method(:on_parameter_cancel))
  1310.     @parameter_window.set_handler(:increase, method(:on_parameter_increase))
  1311.     @parameter_window.set_handler(:decrease, method(:on_parameter_decrease))
  1312.     @parameter_window.set_handler(:down,     method(:update_status))
  1313.     @parameter_window.set_handler(:up,       method(:update_status))
  1314.     @parameter_window.set_handler(:pagedown, method(:next_actor))
  1315.     @parameter_window.set_handler(:pageup,   method(:prev_actor))
  1316.   end
  1317.   #--------------------------------------------------------------------------
  1318.   # ○ 振り分けステータスウィンドウ作成
  1319.   #--------------------------------------------------------------------------
  1320.   def create_status_window
  1321.     @status_window = Window_DistributeParameterStatus.new(@actor)
  1322.     @status_window.viewport = @viewport

  1323.     @help_window.z = @status_window.z + 100
  1324.     @help_window.openness = 0
  1325.   end
  1326.   #--------------------------------------------------------------------------
  1327.   # ○ 確認ウィンドウ作成
  1328.   #--------------------------------------------------------------------------
  1329.   def create_confirm_window
  1330.     @confirm_window = Window_DistributeParameterConfirm.new(0, 0)
  1331.     @confirm_window.x = (Graphics.width  - @confirm_window.width)  / 2
  1332.     @confirm_window.y = (Graphics.height - @confirm_window.height) / 2
  1333.     @confirm_window.z = @help_window.z
  1334.     @confirm_window.viewport    = @viewport
  1335.     @confirm_window.help_window = @help_window
  1336.     @confirm_window.openness    = 0
  1337.     @confirm_window.deactivate
  1338.     @confirm_window.set_handler(:decide, method(:on_confirm_decide))
  1339.     @confirm_window.set_handler(:stop,   method(:on_confirm_stop))
  1340.     @confirm_window.set_handler(:cancel, method(:on_confirm_cancel))
  1341.   end
  1342.   #--------------------------------------------------------------------------
  1343.   # ○ ウィンドウ再描画
  1344.   #--------------------------------------------------------------------------
  1345.   def refresh_window
  1346.     @actor_window.refresh
  1347.     @parameter_window.refresh
  1348.     @status_window.refresh(@parameter_window.parameter_key)
  1349.     Graphics.frame_reset
  1350.   end
  1351.   #--------------------------------------------------------------------------
  1352.   # ○ パラメータ選択 [決定]
  1353.   #--------------------------------------------------------------------------
  1354.   def on_parameter_ok
  1355.     command_confirm
  1356.   end
  1357.   #--------------------------------------------------------------------------
  1358.   # ○ パラメータ選択 [キャンセル]
  1359.   #--------------------------------------------------------------------------
  1360.   def on_parameter_cancel
  1361.     command_confirm
  1362.   end
  1363.   #--------------------------------------------------------------------------
  1364.   # ○ パラメータ選択 [加算]
  1365.   #--------------------------------------------------------------------------
  1366.   def on_parameter_increase
  1367.     param = @parameter_window.parameter_key
  1368.     unless @actor.can_distribute?(param)
  1369.       Sound.play_buzzer
  1370.       return
  1371.     end
  1372.     Sound.play_cursor
  1373.     @actor.rp_growth_effect(param)
  1374.     refresh_window
  1375.   end
  1376.   #--------------------------------------------------------------------------
  1377.   # ○ パラメータ選択 [減算]
  1378.   #--------------------------------------------------------------------------
  1379.   def on_parameter_decrease
  1380.     param = @parameter_window.parameter_key
  1381.     unless reversible?(param)
  1382.       Sound.play_buzzer
  1383.       return
  1384.     end
  1385.     Sound.play_cursor
  1386.     @actor.rp_growth_effect(param, true)
  1387.     refresh_window
  1388.   end
  1389.   #--------------------------------------------------------------------------
  1390.   # ○ ステータス更新
  1391.   #--------------------------------------------------------------------------
  1392.   def update_status
  1393.     @status_window.refresh(@parameter_window.parameter_key)
  1394.   end
  1395.   #--------------------------------------------------------------------------
  1396.   # ○ 減算可否判定
  1397.   #     param : 対象パラメータ
  1398.   #--------------------------------------------------------------------------
  1399.   def reversible?(param)
  1400.     return false if @actor.distributed_count(param) == 0
  1401.     return true  if KMS_DistributeParameter::ENABLE_REVERSE_DISTRIBUTE

  1402.     # 前回より減らなければ OK
  1403.     base = @prev_info.count[param]
  1404.     return ( base < @actor.distributed_count(param) )
  1405.   end
  1406.   #--------------------------------------------------------------------------
  1407.   # ○ パラメータウィンドウに切り替え
  1408.   #--------------------------------------------------------------------------
  1409.   def command_parameter
  1410.     @confirm_window.deactivate
  1411.     @confirm_window.close
  1412.     @help_window.close
  1413.     @parameter_window.activate
  1414.   end
  1415.   #--------------------------------------------------------------------------
  1416.   # ○ 確認ウィンドウに切り替え
  1417.   #--------------------------------------------------------------------------
  1418.   def command_confirm
  1419.     @status_window.refresh
  1420.     @confirm_window.index  = 0
  1421.     @confirm_window.activate
  1422.     @confirm_window.open
  1423.     @help_window.open
  1424.     @parameter_window.deactivate
  1425.   end
  1426.   #--------------------------------------------------------------------------
  1427.   # ○ 確認 [確定]
  1428.   #--------------------------------------------------------------------------
  1429.   def on_confirm_decide
  1430.     return_scene
  1431.   end
  1432.   #--------------------------------------------------------------------------
  1433.   # ○ 確認 [中止]
  1434.   #--------------------------------------------------------------------------
  1435.   def on_confirm_stop
  1436.     @actor.set_distribution_info(@prev_info)
  1437.     return_scene
  1438.   end
  1439.   #--------------------------------------------------------------------------
  1440.   # ○ 確認 [キャンセル]
  1441.   #--------------------------------------------------------------------------
  1442.   def on_confirm_cancel
  1443.     command_parameter
  1444.   end
  1445.   #--------------------------------------------------------------------------
  1446.   # ● アクターの切り替え
  1447.   #--------------------------------------------------------------------------
  1448.   def on_actor_change
  1449.     @prev_actor.set_distribution_info(@prev_info)
  1450.     @prev_info  = @actor.distribution_info
  1451.     @prev_actor = @actor

  1452.     @actor_window.actor     = @actor
  1453.     @parameter_window.actor = @actor
  1454.     @status_window.actor    = @actor
  1455.     @parameter_window.activate
  1456.     refresh_window
  1457.   end
  1458. end
复制代码

点评

求教下这个脚本可以用事件来重置点数吗?  发表于 2020-10-14 12:24

评分

参与人数 1星屑 +50 收起 理由
VIPArcher + 50 塞糖

查看全部评分

VA外站脚本汉化群:226308173   |    部分远古文件备份:https://wwzv.lanzoue.com/b02rac5pc  密码:acgm
回复

使用道具 举报

Lv1.梦旅人

梦石
0
星屑
114
在线时间
411 小时
注册时间
2020-1-11
帖子
253
 楼主| 发表于 2020-2-24 21:38:30 | 显示全部楼层

这篇翻译很有用,太感谢了。
回复

使用道具 举报

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

本版积分规则

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

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

GMT+8, 2024-4-19 03:40

Powered by Discuz! X3.1

© 2001-2013 Comsenz Inc.

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