查看: 1709|回复: 2

[已经过期] 人物加點和技能加點的衝突

[复制链接]
梦石
0
星屑
185
在线时间
373 小时
注册时间
2013-10-10
回帖
56
发表于 2016-12-3 18:40:19 | 显示全部楼层 |阅读模式

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

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

×
本帖最后由 liu5417 于 2016-12-3 23:17 编辑

人物加點導致技能加點的被動技部份無效, 該怎麼解決呢?

人物加點本身沒問題, 置於技能加點腳本之下(放上面會有問題)

技能不可使用 =  被動技 (沒效果)

技能可使用 = 主動技 (沒問題)

附上範例

Project5.rar (322.02 KB, 下载次数: 58)





技能加點
  1. #encoding:utf-8
  2. #===========================================================================
  3. #          RMVA 豪華型技能加點|技能被動效果:   v1.05
  4. #                       By希憶 66rpg.com
  5. #                                                 轉載或修改請保留此類信息
  6. #===========================================================================
  7. #     升級獲得技能點用以學習和提升技能等級,增加技能威力和技能被動效果強度。
  8. #     狀態也可以與技能等級綁定,並根據等級不同獲得不同程度的加成效果[類dnf]
  9. #
  10. #     技能的備註:
  11. #     使用場合為"無法使用" 的技能均默認為被動技能,不在戰鬥時出現。
  12. #------------------------------------------------------------------------------------------------------------------------------------
  13. #     <param_add 0,11>
  14. #         0: 被動提升的屬性編號『0:mhp 1:mmp 2:atk 3:def 4:mat 5:mdf 6:agi 7:luk』
  15. #        11:提升量的計算公式編號,在模塊SkillLevel的self.formula方法中定義
  16. #           可根據需要擴展 when 8 when 9 什麼的
  17. #           這個是按加法提升。和下面那個一起寫就是先加後乘。

  18. #     <param_rate 0,31>
  19. #         0:被動提升的屬性編號『0:mhp 1:mmp 2:atk 3:def 4:mat 5:mdf 6:agi 7:luk』
  20. #        31:提升量的計算公式編號,在模塊SkillLevel的self.formula方法中定義
  21. #           這個是按乘法提升。

  22. #     <xparam 0,21>
  23. #         0:被動提升的屬性編號『0:物理命中 1:物理閃避 2:必殺機率 3:必殺閃避
  24. #               4:魔法閃避 5:魔法反射 6:物理反擊 7:體力再生8:魔力再生 9:TP再生 』
  25. #        21:提升量的計算公式編號,在模塊SkillLevel的self.formula方法中定義
  26. #           這個是按加法提升。

  27. #     <sparam 0,31>
  28. #         0:被動提升的屬性編號『0:受擊幾率 1:防禦比率 2:恢復效果 3:藥理知識
  29. #                4:魔力消耗 5:特技補充 6:所受物理傷害 7:所受魔法傷害  8:地形傷害 9:獲得經驗值比率 』                           
  30. #        31:提升量的計算公式編號,在模塊SkillLevel的self.formula方法中定義
  31. #           這個是按乘法提升。
  32. #------------------------------------------------------------------------------------------------------------------------------------
  33. #     <critical_rate 33>
  34. #        33:被動技能提升暴擊傷害的公式,在模塊SkillLevel的self.formula方法中定義
  35. #            按照乘法疊加提升【每個角色職業都有默認的初始值為1.5】
  36. #------------------------------------------------------------------------------------------------------------------------------------
  37. #     <element_rate 3,31>
  38. #         3:被動技能屬性修正的屬性id
  39. #        31:被動技能屬性修正的公式,模塊SkillLevel的self.formula方法中定義
  40. #            按照乘法疊加減少或增加。

  41. #     <element_damage 3,31>
  42. #        31:被動技能提升屬性傷害的公式,提升屬性傷害(就是屬性強化啦)
  43. #            模塊SkillLevel的self.formula方法中定義
  44. #            按照乘法疊加減少或增加。
  45. #------------------------------------------------------------------------------------------------------------------------------------
  46. #     <mp_type 111>
  47. #       111:主動技能的使用時的mp消耗隨著等級變化的公式編號,
  48. #            在模塊SkillLevel的self.formula方法中定義

  49. #     <damage_convert 51>
  50. #        被動獲得hp傷害一部分轉移給mp的效果,同時有兩個以上這種技能或狀態則取最大
  51. #        51:在模塊SkillLevel的self.formula方法中定義的計算轉換比率的公式編號

  52. #     <sp_cost 5>        
  53. #        學習升級一級此技能需要5sp

  54. #     <max_learn 10>
  55. #        技能等級學習上限10級(加點的等級上限)
  56. #        在技能加點欄中技能的基礎等級只能加到10,
  57. #        但是可以通過裝備加技能的裝備來提升到11,12以上

  58. #     <max_level 15>
  59. #        技能等級堆積上限15級(包括了裝備增加的堆積上限),
  60. #        就是說你裝備了一堆加技能等級的裝備,但這個技能到了15級就沒法再加上去。

  61. #     <type 2>
  62. #        主動技能的技能威力成長類型為第二種(平均增長型)也可以在模塊中自己定義
  63. #        增長類型 self.formula 方法中添加 when 4 when 5 什麼的,然後寫一通公式
  64. #        這裡當然是乘法計算了

  65. #     <learn 10,4>  
  66. #        從10級開始可以學習1級技能,14級可以學到2級,18級可學3級技能
  67. #------------------------------------------------------------------------------------------------------------------------------------
  68. #       前置技能的設置:『學習該技能需要先學習其它的技能到若干級』
  69. #     <former 31,5>  <former 33,1>
  70. #       需要等級5的31號技能和等級1的33號技能作為前置技能
  71. #       前置一行只能設一個,同時設多個請迴車換行
  72. #       前置技能可設可不設,同時設,無上限,搞出個複雜技能樹愉快地玩耍吧
  73. #------------------------------------------------------------------------------------------------------------------------------------
  74. #     <link_skill 24>
  75. #        這個技能鏈接上24號技能,此技能的技能等級將強制等於24號技能的技能等級
  76. #       (無視其它限制,裝備增強無效)
  77. #        小心別連著連著連成循環了,這是給一些特殊的“馬甲技能-實效技能”對應用的。
  78. #        一般情況下別用。

  79. #      <lock_level 4>
  80. #         這個技能的技能等級將強制等於4,優先度高於link_skill
  81. #         主要用於裝備附帶的技能等特殊情況下的技能
  82. #         還有敵方使用的技能,如果需要不為1的話可以這樣設置。

  83. #===========================================================================
  84. #     狀態的備註:

  85. #     <param_add 0,11>
  86. #     <param_rate 0,31>
  87. #     <xparam 0,21>
  88. #     <sparam 0,31>
  89. #     <critical_rate 33>
  90. #     <element_rate 3,31>
  91. #     <element_damage 3,31>
  92. #     <damage_convert 51>
  93. #     同技能,只不過是變成狀態附加時生效並和狀態等級相關

  94. #     <link_skill 122>如果狀態有明確的來源的話狀態的等級將等於來源的122號技能的等級。

  95. #     <chance 43>主要用於debuff,額外的附加幾率修正的公式編號,老規矩

  96. #===========================================================================
  97. #     裝備的備註:
  98. #     <add_skill 10,3>    10號技能等級+3

  99. #    (以下下備註條目也可以備註在角色,職業上,可以為負數(只有以下兩個可以))
  100. #     <critical_rate 10>   必殺傷害 +10%  
  101. #       多個裝備將和職業,角色基礎等乘法疊加
  102. #       基礎暴擊傷害為1.5倍,提升10%就是1.65倍。
  103. #     <element_damage 3,30> 裝備者對敵人使用3號屬性(炎屬性)的攻擊造成的傷害+30%

  104. #===========================================================================
  105. #     職業的備註:
  106. #     <auto_sp>  自動升級技能的職業【不設sp,啥技能都無視前置隨著等級能有多高就多高】
  107. #
  108. #===========================================================================
复制代码
  1. #encoding:utf-8
  2. #===========================================================================
  3. #          RMVA 豪华型技能加点|技能被动效果:         v1.05
  4. #                       By希忆 66rpg.com
  5. #                                                 转载或修改请保留此类信息
  6. #===========================================================================
  7. # 模块的设定和被动技能等的实现
  8. #
  9. # 完工??
  10. #===========================================================================
  11. module SkillLevel
  12.   
  13.   MENUNAME   = "技能书"                       #菜单栏名称
  14.   
  15.   INITIALSP  = 40                             #初始技能点(lv1时的SP点)
  16.   LEVELUPSP  = 30                             #每升一级所获得的技能点
  17.   
  18.   RESETITEM = 23                             #洗点水的物品编号
  19.                                               #洗点水要求目标单个队友,仅菜单可用
  20.   
  21.   def self.formula(level,type)
  22.     case type
  23.   #=========================================================================
  24.   #  这里设定各种乱七八糟的公式,技能威力的成长公式和被动技能属性增加的公式都可以
  25.   #  在这里设定,不过由于计算方式的不同,需要注意别设定错了,数据库里诸如
  26.   #  <param_add 0,11> <type 1> 等都会根据编号(这里分别是11、1)跳转到对应的
  27.   #  when 进行计算,你也可以自己添加分歧,when 65536 什么的。
  28.   #  注意,看清分清乘算加算哦。我写了简单的几个例子。
  29.   #=========================================================================
  30.     when 111
  31.       return 1.00+0.2*level
  32.              #这里写的是默认的技能mp消耗随着等级增加而变化的公式(当然也可以自己写)
  33.     when 0      
  34.       return 0     #加法结算的默认
  35.     when -1
  36.       return 1     #乘法结算的默认
  37.     when 1
  38.       return 1.1**(level-1)                     
  39.                       #可怕的晚成后期神技能  lv5:1.46 lv10:2.358 lv15:3.7975
  40.     when 2
  41.       return 1.00 + 0.15*(level-1)               
  42.                       #普通的平均增长型技能  lv5:1.60 lv10:2.350 lv15:3.1000
  43.     when 3
  44.       return 1.00 + 3.5*(level-1)/(13.7+level)   
  45.                       #早熟的后期低成长技能  lv5:1.75 lv10:2.329 lv15:2.7073
  46.     when 4
  47.       return 1.00 + 0.2*(level-1)   
  48.       
  49.     when 11
  50.       return 20*level                           
  51.       #比较适用于param_add,
  52.       # <param_add 1,11> 每升一级技能等级,MP上限+20
  53.     when 12
  54.       return 4*level
  55.     when 13
  56.       return 3*level
  57.       
  58.     when 21
  59.       return 0.01*level                          
  60.       #比较适用于xparam
  61.       # <xparam 2,21>   每升一级技能等级,必杀机率+1%
  62.     when 22
  63.       return 0.05+0.03*level  
  64.    
  65.     when 23
  66.       return 0 if level == 0
  67.       return 0.005*(level+1)
  68.    
  69.     when 24
  70.       return 0.024*level
  71.       
  72.     when 31
  73.       return 1+0.01*level                        
  74.       #比较适用于param_rate或sparam
  75.       # <param_rate 0,31> 每升一级技能等级,maxhp+1%
  76.       # <sparam :9,31>      每升一级技能等级,所得经验值+1%
  77.     when 32
  78.       return 1-0.01*level   
  79.     when 33
  80.       return 1+0.04*level
  81.     when 34
  82.       return 1-0.02*level
  83.     when 41
  84.       return 0.02*level
  85.     when 43
  86.       return 0 if level == 0
  87.       return 0.07+0.03*level
  88.     when 51
  89.       return 0 if level == 0
  90.       return [1,0.06+level*0.04].min
  91.     when 52
  92.       return level*0.05
  93.     end
  94.    
  95.     return 1                                   
  96.    
  97.   end
  98.   
  99. end


  100. #有关技能的各种正则匹配,注意未匹配时的返回值
  101. class RPG::Skill < RPG::UsableItem

  102.   def sp_cost
  103.     return 0 if auto_levelup
  104.     @note =~ /\<(?:sp_cost) (\d+)\>/ ? $1.to_i : 0
  105.   end
  106.   
  107.   def mp_type
  108.     @note =~ /\<(?:mp_type) (\d+)\>/ ? $1.to_i : 111
  109.   end
  110.   
  111.   def max_learn
  112.     @note =~ /\<(?:max_learn) (\d+)\>/ ? $1.to_i : 0
  113.   end
  114.   
  115.   def max_level
  116.     @note =~ /\<(?:max_level) (\d+)\>/ ? $1.to_i : 1
  117.   end
  118.   
  119.   def damage_increase_type
  120.     @note =~ /\<(?:type) (\d+)\>/ ? $1.to_i : 2
  121.   end
  122.   
  123.   def learn_level
  124.     @note =~ /\<(?:learn) (\d+),(\d+)\>/ ? [$1.to_i,$2.to_i] : [1,1]
  125.   end
  126.   
  127.   def param_add(param_id)
  128.     @note =~ /\<(?:param_add) #{param_id},(\d+)\>/ ? $1.to_i : 0
  129.   end
  130.   
  131.   def param_rate(param_id)
  132.     @note =~ /\<(?:param_rate) #{param_id},(\d+)\>/ ? $1.to_i : -1
  133.   end
  134.   
  135.   def xparam(xp_id)
  136.      @note =~ /\<(?:xparam) #{xp_id},(\d+)\>/ ? $1.to_i : 0
  137.   end
  138.   
  139.   def sparam(sparam_id)
  140.     @note =~ /\<(?:sparam) #{sparam_id},(\d+)\>/ ? $1.to_i : -1
  141.   end
  142.   
  143.   def critical_rate
  144.     @note =~ /\<(?:critical_rate) (\d+)\>/ ? $1.to_i : -1
  145.   end
  146.   
  147.   def element_rate(element_id)
  148.     @note =~ /\<(?:element_rate) #{element_id},(\d+)\>/ ? $1.to_i : -1
  149.   end
  150.   
  151.   def element_damage(element_id)
  152.     @note =~ /\<(?:element_damage) #{element_id},(\d+)\>/ ? $1.to_i : -1
  153.   end
  154.   
  155.   def damage_convert
  156.     @note =~ /\<(?:damage_convert) (\d+)\>/ ? $1.to_i : 0
  157.   end
  158.   
  159.   def link_skill
  160.     @note =~ /\<(?:link_skill) (\d+)\>/ ? $1.to_i : 0
  161.   end
  162.   
  163.   def lock_level
  164.     @note =~ /\<(?:lock_level) (\d+)\>/ ? $1.to_i : 0
  165.   end
  166.   
  167.   def auto_levelup
  168.     @note =~ /\<auto_levelup\>/
  169.   end
  170.   
  171.   def former
  172.     val = []
  173.     insert = false
  174.     @note.each_line do |line|
  175.       case line
  176.       when /\<(?:former[1-9]?) (\d+),(\d+)\>/
  177.         val.push([$1.to_i,$2.to_i])
  178.         insert = true
  179.       end
  180.     end
  181.     insert ? val : [[0,0]]
  182.   end
  183.   
  184.   #是否被动技能的标准,使用场合:无法使用
  185.   def passive
  186.     @occasion == 3
  187.   end
  188.   
  189. end

  190. #暴击伤害和属性强化(可以写在数据库的角色备注和职业备注里,也可以写在敌人打到备注里)
  191. class RPG::BaseItem
  192.   
  193.   def critical_rate
  194.     @note =~ /\<(?:critical_rate) (-?[0-9]*)\>/ ? $1.to_i : 0
  195.   end
  196.   
  197.   def element_damage(element_id)
  198.     @note =~ /\<(?:element_rate) #{element_id},(-?[0-9]*)\>/ ? $1.to_i : 0
  199.   end

  200. end

  201. #装备技能等级+x
  202. class RPG::EquipItem

  203.   def add_skill(skill_id)
  204.     @note =~ /\<(?:add_skill) #{skill_id},(\d+)\>/ ? $1.to_i : 0
  205.   end
  206.   
  207. end

  208. #自动升级技能
  209. class RPG::Class < RPG::BaseItem
  210.   def auto_sp
  211.     @note =~ /\<auto_sp\>/
  212.   end
  213. end



  214. class RPG::State < RPG::BaseItem
  215.   
  216.   #这里的link_skill是指状态的对应技能,
  217.   #如果状态有明确的技能来源的话状态的等级将等于
  218.   #来源技能使用者的该id技能的等级。
  219.   def link_skill
  220.     @note =~ /\<(?:link_skill) (\d+)\>/ ? $1.to_i : 0
  221.   end
  222.   
  223.   #额外的几率修正的公式
  224.   #老规矩SkillLevel 的 formula
  225.   def chance
  226.     @note =~ /\<(?:chance) (\d+)\>/ ? $1.to_i : -1
  227.   end
  228.   
  229.   #和技能类似
  230.   def param_add(param_id)
  231.     @note =~ /\<(?:param_add) #{param_id},(\d+)\>/ ? $1.to_i : 0
  232.   end
  233.   
  234.   def param_rate(param_id)
  235.     @note =~ /\<(?:param_rate) #{param_id},(\d+)\>/ ? $1.to_i : -1
  236.   end
  237.   
  238.   def xparam(xp_id)
  239.      @note =~ /\<(?:xparam) #{xp_id},(\d+)\>/ ? $1.to_i : 0
  240.   end
  241.   
  242.   def sparam(sparam_id)
  243.     @note =~ /\<(?:sparam) #{sparam_id},(\d+)\>/ ? $1.to_i : -1
  244.   end
  245.   
  246.   def critical_rate
  247.     @note =~ /\<(?:critical_rate) (\d+)\>/ ? $1.to_i : -1
  248.   end
  249.   
  250.   def element_rate(element_id)
  251.     @note =~ /\<(?:element_rate) #{element_id},(\d+)\>/ ? $1.to_i : -1
  252.   end
  253.   
  254.   def element_damage(element_id)
  255.     @note =~ /\<(?:element_damage) #{element_id},(\d+)\>/ ? $1.to_i : -1
  256.   end
  257.   
  258.   def damage_convert
  259.     @note =~ /\<(?:damage_convert) (\d+)\>/ ? $1.to_i : 0
  260.   end
  261.   
  262. end
  263. #正则匹配篇结束
  264. #=======================================================================





复制代码
  1. #encoding:utf-8

  2. #===========================================================================
  3. #          RMVA 豪华型技能加点|技能被动效果:        v1.05
  4. #                       By希忆 66rpg.com
  5. #                                                 转载或修改请保留此类信息
  6. #===========================================================================
  7. # 在游戏系统类的实现
  8. #
  9. # 完工了,大概
  10. #===========================================================================
  11. #角色类,新增一堆方法。
  12. class Game_Actor < Game_Battler
  13.   
  14.   #初始化角色
  15.   #@skill_level:存放技能等级数据的哈希表,技能id=>技能等级
  16.   #@sp:剩余技能点
  17.   alias setup_201410131453 setup
  18.   def setup(actor_id)
  19.     @skill_level=Hash.new(0)
  20.     setup_201410131453(actor_id)
  21.     @sp = (@level-1) * SkillLevel::LEVELUPSP + SkillLevel::INITIALSP
  22.     auto_skill_levelup if self.class.auto_sp
  23.   end
  24.   
  25.   #读取技能点的方法,如果是自动升级技能的职业,则没必要有技能点
  26.   def sp
  27.     return 0 if self.class.auto_sp
  28.     @sp
  29.   end
  30.   
  31.   #读取技能基础等级,
  32.   #锁定技能等级优先度最高,
  33.   #链接技能等级次之,这个我好像在计算技能最终等级的方法里面又来了一遍。
  34.   #主要是技能基础等级是升级技能的窗口看到的等级,最终等级是使用技能的窗口。
  35.   def skill_basic_level(skill_id)
  36.     return 0 if skill_id == 0
  37.     lock = $data_skills[skill_id].lock_level
  38.     return lock if lock != 0
  39.     lnk = $data_skills[skill_id].link_skill
  40.     return skill_basic_level(lnk) if lnk != 0
  41.     @skill_level[skill_id]
  42.   end
  43.   
  44.   #获取装备增加技能的等级之和
  45.   def skill_plus_level(skill_id)
  46.     self.equips.compact.inject(0){|skl,eqp| skl+eqp.add_skill(skill_id)}
  47.   end
  48.   
  49.   #读取技能最终等级,如果技能基础等级为零,则不加装备提升直接等于零。
  50.   #最后返回基础等级+装备附加与技能最大等级中的小值
  51.   def skill_level(skill_id)
  52.     return 0 if skill_id == 0
  53.     lock = $data_skills[skill_id].lock_level
  54.     return lock if lock != 0
  55.     lnk = $data_skills[skill_id].link_skill
  56.     return skill_level(lnk) if lnk != 0
  57.     return 0 unless @skills.include?(skill_id)
  58.     return 0 if skill_basic_level(skill_id) == 0
  59.     [skill_basic_level(skill_id) + skill_plus_level(skill_id) ,\
  60.     $data_skills[skill_id].max_level].min
  61.   end
  62.   
  63.   #升一级技能技能能升级就升级,返回成功,否则返回失败
  64.   def level_up_skill(skill_id)
  65.     skl = $data_skills[skill_id]
  66.     if skill_can_levelup?(skl)
  67.       @sp -= skl.sp_cost
  68.       @skill_level[skill_id] += 1
  69.       return true
  70.     else
  71.       return false
  72.     end
  73.   end
  74.   
  75.   #初始化角色时初始化技能的方法,
  76.   #这里是不管默认的技能设定直接加载能学到的所有技能,也就是职业列表下的那些。
  77.   def init_skills
  78.     @skills = []
  79.     self.class.learnings.each do |learning|
  80.       @skills.push(learning.skill_id)
  81.     end
  82.     @skills.sort!
  83.   end
  84.   
  85.   #主要用在技能列表的窗口里的。确保只有技能等级为1级及以上的技能才能显示。
  86.   def has_skill?(skill)
  87.     skills.include?(skill) && skill_basic_level(skill.id) > 0
  88.   end
  89.   
  90.   #判断是否学习了技能,同样要确保只有技能等级为1级及以上的技能才能显示。
  91.   #和上面的区别是上面的可以有装备附带,状态附带的技能等级不为0的技能
  92.   #这里只能是职业列表下“领悟”的技能,装备状态附带的都不算
  93.   def skill_learn?(skill)
  94.     skill.is_a?(RPG::Skill) && @skills.include?(skill.id) && skill_basic_level(skill.id) > 0
  95.   end
  96.   
  97.   #判断前置技能是否都满足
  98.   def skill_former_match?(skill)
  99.     skill.former.each do |former|
  100.       return false unless skill_basic_level(former[0]) >= former[1]
  101.     end
  102.     true
  103.   end
  104.   
  105.   #判断技能是否已经学到精通了、
  106.   def skill_max_learn?(skill)
  107.     skill_basic_level(skill.id) == skill.max_learn
  108.   end
  109.   
  110.   #计算学习下一等级的技能所需要的人物等级
  111.   #如果精通了return false【感觉好像有点奇葩。。。】
  112.   def skill_next_level(skill)
  113.     return false if skill_max_learn?(skill)
  114.     skill.learn_level[0] + skill_basic_level(skill.id) * skill.learn_level[1]
  115.   end
  116.   
  117.   #技能能否升级?首先看是否锁定,是否链接,是否精通,
  118.   #再看等级是否符合学习下一级,sp是否足够,前置技能是否满足要求。
  119.   def skill_can_levelup?(skill)
  120.     return false if skill.lock_level != 0
  121.     return false if skill.link_skill != 0
  122.     return false if skill_max_learn?(skill)
  123.     @level >= skill_next_level(skill) && @sp >= skill.sp_cost && skill_former_match?(skill)
  124.   end
  125.   
  126.   #好像没什么用处。。。当初修改的用意是直接设置技能等级,后来觉得不好控制。。。
  127.   #反正就放着吧,不去管它好了
  128.   def learn_skill(skill_id,sk_level=0)
  129.     unless skill_learn?($data_skills[skill_id])
  130.       @skills.push(skill_id)
  131.       @skills.sort!
  132.       @skill_level[skill_id]=sk_level unless @skill_level.has_key?(skill_id)
  133.     end
  134.   end
  135.   
  136.   #自动升级技能。
  137.   def auto_skill_levelup
  138.     @skills.each do |skill|
  139.       skl=$data_skills[skill]
  140.       if self.class.auto_sp
  141.         while skill_next_level(skl) && skill_next_level(skl) <= @level do
  142.           @skill_level[skill] += 1
  143.         end
  144.       elsif skl.auto_levelup
  145.         while level_up_skill(skill) do
  146.         end
  147.       end
  148.     end
  149.   end
  150.   
  151.   #升级时发生的事情,等级+1,sp增加,如果是自动升级技能的职业则自动升级技能
  152.   def level_up
  153.     @level += 1
  154.     @sp += SkillLevel::LEVELUPSP
  155.     auto_skill_levelup
  156.   end
  157.   
  158.   #被动技能提升的基础属性(加法叠加的部分)
  159.   #SkillLevel.formula:带入公式计算。
  160.   def skill_plus(param_id)
  161.     skills.inject(0) do |plu,skl|
  162.       plu + SkillLevel.formula(self.skill_level(skl.id),skl.param_add(param_id))
  163.     end
  164.   end
  165.   
  166.   #被动技能提升的基础属性倍率(乘法叠加)
  167.   def skill_rate(param_id)
  168.     skills.inject(1.00) do |plu,skl|
  169.       plu * SkillLevel.formula(self.skill_level(skl.id),skl.param_rate(param_id))
  170.     end
  171.   end
  172.   
  173.   #被动技能影响的属性抗性(乘法叠加)
  174.   def skill_element_rate(element_id)
  175.     skills.inject(1.00) do |plu,skl|
  176.       plu * SkillLevel.formula(self.skill_level(skl.id),skl.element_rate(element_id))
  177.     end
  178.   end
  179.   
  180.   #状态提升的基础属性(加法叠加的部分)
  181.   def state_param_plus(param_id)
  182.     states.inject(0) do |plu,sta|
  183.       plu + SkillLevel.formula(@state_level[sta.id],sta.param_add(param_id))
  184.     end
  185.   end
  186.   #状态提升的基础属性倍率(乘法叠加)
  187.   def state_param_rate(param_id)
  188.     states.inject(1.00) do |plu,sta|
  189.       plu * SkillLevel.formula(@state_level[sta.id],sta.param_rate(param_id))
  190.     end
  191.   end
  192.   #状态额外影响的属性抗性(乘法叠加)
  193.   def state_element_rate(element_id)
  194.     states.inject(1.00) do |plu,sta|
  195.       plu * SkillLevel.formula(@state_level[sta.id],sta.element_rate(element_id))
  196.     end
  197.   end
  198.   
  199.   #基础属性的计算,添加了被动技能的提升,按默认的先加后乘
  200.   def param(param_id)
  201.     value = param_base(param_id) + param_plus(param_id) +
  202.             skill_plus(param_id) + state_param_plus(param_id)
  203.     value *= param_rate(param_id) * param_buff_rate(param_id) *
  204.              skill_rate(param_id) * state_param_rate(param_id)
  205.     [[value, param_max(param_id)].min, param_min(param_id)].max.to_i
  206.   end
  207.   
  208.   #状态影响的附加属性xparam
  209.   def state_xparam(xparam_id)
  210.     states.inject(0.0) do |plu,sta|
  211.       plu + SkillLevel.formula(@state_level[sta.id],sta.xparam(xparam_id))
  212.     end
  213.   end
  214.   #附加属性xparam的计算,命中暴击什么的,迭代加算。
  215.   def xparam(xparam_id)
  216.     state_xparam(xparam_id) + @skills.inject(super(xparam_id)) do |plu,skl|
  217.       plu + SkillLevel.formula(self.skill_level(skl),$data_skills[skl].xparam(xparam_id))
  218.     end
  219.   end
  220.   
  221.   #状态影响特殊属性sparam的计算
  222.   def state_sparam(sparam_id)
  223.     states.inject(1.0) do |plu,sta|
  224.       plu * SkillLevel.formula(@state_level[sta.id],sta.sparam(sparam_id))
  225.     end
  226.   end
  227.   #特殊属性sparam的计算,经验值比率什么的,迭代连乘计算。
  228.   def sparam(sparam_id)
  229.     state_sparam(sparam_id)*skills.inject(super(sparam_id)) do |plu,skl|
  230.       plu * SkillLevel.formula(self.skill_level(skl.id),skl.sparam(sparam_id))
  231.     end
  232.   end
  233.   
  234.   #技能消耗mp由于技能等级修正的倍率,
  235.   #反正就是到SkillLevel.formula找对应编号的公式。
  236.   def skill_mp_rate(skill)
  237.     SkillLevel.formula(skill_level(skill.id),skill.mp_type)
  238.   end
  239.   
  240.   #计算最终技能消耗mp的量
  241.   def skill_mp_cost(skill)
  242.     (skill.mp_cost * mcr * skill_mp_rate(skill)).to_i
  243.   end
  244.   
  245.   #计算暴击伤害倍率super:Game_Battler中的critical_rate,返回1.5
  246.   #人物提升,职业提升,被动技能修正和装备提升
  247.   def critical_rate
  248.     v = super
  249.     v *= (1.0 + self.actor.critical_rate/100.0)
  250.     v *= (1.0 + self.class.critical_rate/100.0)
  251.     v *= skills.inject(1.00) do |plu,skl|
  252.       plu * SkillLevel.formula(self.skill_level(skl.id),skl.critical_rate)
  253.     end
  254.     v*equips.compact.inject(1.00){ |rat,equip| rat*(1.00+equip.critical_rate/100.0) }
  255.   end
  256.   
  257.   #属性伤害修正。
  258.   def element_rate(element_id)
  259.     super(element_id) * skill_element_rate(element_id) * state_element_rate(element_id)
  260.   end
  261.   
  262.   #被动技能影响的属性强化效果。
  263.   def skill_element_damage(element_id)
  264.     skills.inject(1.00) do |plu,skl|
  265.       plu * SkillLevel.formula(self.skill_level(skl.id),skl.element_damage(element_id))
  266.     end
  267.   end
  268.   
  269.   def state_element_damage(element_id)
  270.     states.inject(1.00) do |plu,sta|
  271.       plu * SkillLevel.formula(@state_level[sta.id],sta.element_damage(element_id))
  272.     end
  273.   end
  274.   
  275.   #基础属性强化,角色备注和职业备注修正。
  276.   def basic_element_damage(element_id)
  277.     (1.0 + self.actor.element_damage(element_id)/100.0) *
  278.     (1.0 + self.class.element_damage(element_id)/100.0)
  279.   end
  280.   
  281.   #计算最终属性强化基础技能装备迭代连乘
  282.   def element_damage(element_id)
  283.     basic_element_damage(element_id) *
  284.     equips.compact.inject(skill_element_damage(element_id)) do |rat,equip|
  285.       rat*(1.00+equip.element_damage(element_id)/100.0)
  286.     end
  287.   end

  288.   #受到hp伤害转移给mp的比例,遍历计算并返回最大值
  289.   def damage_convert
  290.     skl = skills.collect{|sk| sk = SkillLevel.formula(self.skill_level(sk.id),sk.damage_convert)}
  291.     sta = states.collect{|st| st = SkillLevel.formula(@state_level[st.id],st.damage_convert)}
  292.     (skl+sta).max
  293.   end
  294.   
  295.   #洗技能了,
  296.   alias item_apply_201411181846 item_apply
  297.   def item_apply(user, item)
  298.     item_apply_201411181846(user, item)
  299.     if item.is_a?(RPG::Item) and item.id == SkillLevel::RESETITEM
  300.       if self.reset_skill
  301.         self.hp = [self.hp,self.mhp].min
  302.         self.mp = [self.mp,self.mmp].min
  303.       end
  304.     end
  305.   end
  306.   
  307.   #洗技能的方法
  308.   def reset_skill
  309.     return false if self.class.auto_sp
  310.     @sp = (@level-1) * SkillLevel::LEVELUPSP + SkillLevel::INITIALSP
  311.     @skills.each  { |skill| @skill_level[skill]=0 }
  312.     return true
  313.   end
  314.   
  315. end

  316. #有关洗点水的使用判断,想和上面洗点放在一起。于是没有放进场景相关。
  317. class Scene_ItemBase < Scene_MenuBase
  318.   def item_usable?
  319.     if item.id == SkillLevel::RESETITEM
  320.       return false if item_target_actors[0].class.auto_sp
  321.       return true
  322.     end
  323.     user.usable?(item) && item_effects_valid?
  324.   end
  325. end

  326. class Game_Enemy
  327.   #敌人属性强化
  328.   def element_damage(id)
  329.     1.0 + self.enemy.element_damage(id)/100.0
  330.   end
  331.   #敌人暴击倍率 super:Game_Battler定义的critical_rate,返回1.5
  332.   def critical_rate
  333.     super * (1+self.enemy.element_damage/100.0)
  334.   end
  335.   #敌人的技能等级,要么锁定,要么1
  336.   def skill_level(skill_id)
  337.     lock = $data_skills[skill_id].lock_level if $data_skills[skill_id]
  338.     return lock if lock != 0
  339.     return 1
  340.   end
  341.     #状态提升的基础属性(加法叠加的部分)
  342.   def state_param_plus(param_id)
  343.     states.inject(0) do |plu,sta|
  344.       plu + SkillLevel.formula(@state_level[sta.id],sta.param_add(param_id))
  345.     end
  346.   end
  347.   #状态提升的基础属性倍率(乘法叠加)
  348.   def state_param_rate(param_id)
  349.     states.inject(1.00) do |plu,sta|
  350.       plu * SkillLevel.formula(@state_level[sta.id],sta.param_rate(param_id))
  351.     end
  352.   end
  353.   #状态额外影响的属性抗性(乘法叠加)
  354.   def state_element_rate(element_id)
  355.     states.inject(1.00) do |plu,sta|
  356.       plu * SkillLevel.formula(@state_level[sta.id],sta.element_rate(element_id))
  357.     end
  358.   end
  359.   
  360.   #基础属性的计算,添加了被动技能的提升,按默认的先加后乘
  361.   def param(param_id)
  362.     value = param_base(param_id) + param_plus(param_id) +
  363.             state_param_plus(param_id)
  364.     value *= param_rate(param_id) * param_buff_rate(param_id) *
  365.              state_param_rate(param_id)
  366.     [[value, param_max(param_id)].min, param_min(param_id)].max.to_i
  367.   end
  368.   
  369.   #状态影响的附加属性xparam
  370.   def state_xparam(xparam_id)
  371.     states.inject(0.0) do |plu,sta|
  372.       plu + SkillLevel.formula(@state_level[sta.id],sta.xparam(xparam_id))
  373.     end
  374.   end
  375.   #附加属性xparam的计算,命中暴击什么的,迭代加算。
  376.   def xparam(xparam_id)
  377.     state_xparam(xparam_id) + super(xparam_id)
  378.   end
  379.   
  380.   #状态影响特殊属性sparam的计算
  381.   def state_sparam(sparam_id)
  382.     states.inject(1.0) do |plu,sta|
  383.       plu * SkillLevel.formula(@state_level[sta.id],sta.sparam(sparam_id))
  384.     end
  385.   end
  386.   #特殊属性sparam的计算,经验值比率什么的,迭代连乘计算。
  387.   def sparam(sparam_id)
  388.     super(sparam_id)*state_sparam(sparam_id)
  389.   end
  390.   def state_element_damage(element_id)
  391.     states.inject(1.00) do |plu,sta|
  392.       plu * SkillLevel.formula(@state_level[sta.id],sta.element_damage(element_id))
  393.     end
  394.   end
  395.   def element_rate(element_id)
  396.     super(element_id) * state_element_rate(element_id)
  397.   end
  398. end



  399. class Game_Battler < Game_BattlerBase
  400.   
  401.   #attr_reader :state_level
  402.   #@state_level 保存状态等级的数组
  403.   alias initialize_201410131453 initialize
  404.   def initialize
  405.     initialize_201410131453
  406.     @state_level = Hash.new(0)
  407.   end
  408.   
  409.   #属性修正的计算,将使用者属性强化也计算在内的
  410.   def item_element_rate(user, item)
  411.     if item.damage.element_id < 0
  412.       user.atk_elements.empty? ? 1.0 : elements_max_rate(user)
  413.     else
  414.       element_rate(item.damage.element_id)*user.element_damage(item.damage.element_id)
  415.     end
  416.   end
  417.   
  418.   #将使用者属性强化也计算在内的最有效属性。
  419.   def elements_max_rate(user)
  420.     user.atk_elements.inject([0.0]) {|r, i| r.push(element_rate(i)*user.element_damage(i)) }.max
  421.   end
  422.   
  423.   def damage_convert #受到hp伤害转移给mp的比例
  424.     0
  425.   end
  426.   
  427.   #计算伤害,SkillLevel.formula找公式算修正。
  428.   def make_damage_value(user, item)
  429.     value = item.damage.eval(user, self, $game_variables)
  430.     if item.is_a?(RPG::Skill)
  431.       value *= SkillLevel.formula(user.skill_level(item.id),item.damage_increase_type)
  432.     end
  433.    
  434.     value *= item_element_rate(user, item)
  435.     value *= pdr if item.physical?
  436.     value *= mdr if item.magical?
  437.     value *= rec if item.damage.recover?
  438.     value = apply_critical(value,user) if @result.critical
  439.     value = apply_variance(value, item.damage.variance)
  440.     value = apply_guard(value)
  441.    
  442.     if value > 0 && damage_convert > 0
  443.       valmp = [(value*damage_convert).to_i,self.mp].min
  444.       self.mp -= valmp
  445.       value -= valmp
  446.     end
  447.     @result.make_damage(value.to_i, item)
  448.   end
  449.   
  450.   #计算暴击修正,添加了参数user
  451.   def apply_critical(value,user)
  452.     value * user.critical_rate
  453.   end
  454.   
  455.   #基础暴击修正
  456.   def critical_rate
  457.     1.5
  458.   end
  459.   
  460.   #状态附加,添加参数user,写的有点奇怪。如果有明确的user,
  461.   #就提取技能等级user.skill_level($data_states[state_id].link_skill)
  462.   #然后按SkillLevel.formula公式算得到附加概率,如果随机数比概率大(算是失败)
  463.   #就直接返回,再下去按部就班如果没有状态就附加新状态,如果有明确的user,
  464.   #状态的等级就等于之前提取的技能等级,否则为1。
  465.   def add_state(state_id,user = nil)
  466.     if state_addable?(state_id)
  467.       if user != nil
  468.         lv = user.skill_level($data_states[state_id].link_skill)
  469.       else
  470.         lv = 1
  471.       end
  472.       return if rand > SkillLevel.formula(lv,$data_states[state_id].chance)
  473.       add_new_state(state_id) unless state?(state_id)
  474.       if user != nil
  475.         @state_level[state_id] = lv
  476.       else
  477.         @state_level[state_id] = 1
  478.       end
  479.       reset_state_counts(state_id)
  480.       @result.added_states.push(state_id).uniq!
  481.     end
  482.   end
  483.   
  484.   def item_effect_add_state_attack(user, item, effect)
  485.     user.atk_states.each do |state_id|
  486.       chance = effect.value1
  487.       chance *= state_rate(state_id)
  488.       chance *= user.atk_states_rate(state_id)
  489.       chance *= luk_effect_rate(user)
  490.       if rand < chance
  491.         add_state(state_id,user)
  492.         @result.success = true
  493.       end
  494.     end
  495.   end

  496.   def item_effect_add_state_normal(user, item, effect)
  497.     chance = effect.value1
  498.     chance *= state_rate(effect.data_id) if opposite?(user)
  499.     chance *= luk_effect_rate(user)      if opposite?(user)
  500.     if rand < chance
  501.       add_state(effect.data_id,user)
  502.       @result.success = true
  503.     end
  504.   end
  505.   
  506. end





复制代码
  1. #encoding:utf-8
  2. #===========================================================================
  3. #          RMVA 豪华型技能加点|技能被动效果:      v1.05
  4. #                       By希忆 66rpg.com
  5. #                                                 转载或修改请保留此类信息
  6. #===========================================================================
  7. # 所有和窗体有关的修改
  8. #
  9. # 大概没问题吧
  10. #===========================================================================


  11. class Window_BattleSkill < Window_SkillList
  12. # 戰鬥技能視窗顯示
  13.   def include?(item)
  14.     item && !item.passive && item.stype_id == @stype_id && @actor.has_skill?(item)
  15.   end
  16.   
  17. end

  18. class Window_SkillList < Window_Selectable
  19. #默認技能視窗顯示
  20.   def include?(item)
  21.     item && item.stype_id == @stype_id && @actor.has_skill?(item)
  22.   end
  23.   
  24.   def draw_item_name(item, x, y, enabled = true, width = 172)
  25.     return unless item
  26.     draw_icon(item.icon_index, x, y, enabled)
  27.     change_color(normal_color, enabled)
  28.     draw_text(x + 24, y, width, line_height, item.name + " Lv." + @actor.skill_level(item.id).to_s)
  29.   end
  30.   
  31. end

  32. class Window_AllSkill < Window_Selectable

  33.   def initialize(x, y, width, height)
  34.     super
  35.     @actor = nil
  36.     @stype_id = 0
  37.     @data = []
  38.   end
  39.   
  40.   def actor=(actor)
  41.     return if @actor == actor
  42.     @actor = actor
  43.     refresh
  44.     self.oy = 0
  45.   end

  46.   def stype_id=(stype_id)
  47.     return if @stype_id == stype_id
  48.     @stype_id = stype_id
  49.     refresh
  50.     self.oy = 0
  51.   end
  52.   
  53.   def col_max
  54.     return 1
  55.   end
  56.   
  57.   def item_max
  58.     @data ? @data.size : 1
  59.   end
  60.   
  61.   def item
  62.     @data && index >= 0 ? @data[index] : nil
  63.   end
  64.   
  65.   def current_item_enabled?
  66.     enable?(@data[index])
  67.   end
  68.   
  69.   def include?(item)
  70.     item && item.stype_id == @stype_id
  71.   end
  72.   
  73.   def enable?(item)
  74.     item != nil && @actor != nil && @actor.skill_can_levelup?(item)
  75.   end

  76.   def make_item_list
  77.     @data = @actor ? @actor.skills.select {|skill| include?(skill) } : []
  78.   end
  79.   
  80.   def select_last
  81.     select(@data.index(@actor.last_skill.object) || 0)
  82.   end
  83.   
  84.   def draw_item(index)
  85.     skill = @data[index]
  86.     if skill
  87.       rect = item_rect(index)
  88.       rect.width -= 4
  89.       draw_skill_name(skill, rect.x, rect.y, enable?(skill))
  90.       draw_skill_level(rect, skill)
  91.     end
  92.   end
  93.   
  94.   def draw_skill_name(skill, x, y, enabled = true, width = 172)
  95.     return unless skill
  96.     draw_icon(skill.icon_index, x, y, enabled)
  97.     change_color(normal_color, enabled)
  98.     text = skill.name
  99.     text += "<已精通>" if @actor.skill_max_learn?(skill)
  100.     draw_text(x + 24, y, width, line_height, text)
  101.   end
  102.   
  103.   def draw_skill_level(rect, skill)
  104.     draw_text(rect, @actor.skill_basic_level(skill.id).to_s, 2)
  105.     change_color(system_color, enable?(skill))
  106.     draw_text(rect, "Lv.     ", 2)
  107.   end
  108.   
  109.   def update_help
  110.     @help_window.set_item(item)
  111.   end
  112.   
  113.   def refresh
  114.     make_item_list
  115.     create_contents
  116.     draw_all_items
  117.   end
  118. end

  119. class Window_Base < Window

  120. #~ draw_text_ex的增强,使其可以自动换行  原作者:叶子 修改:wyongcan
  121.   #--------------------------------------------------------------------------
  122.   # ● 绘制带有控制符的文本内容
  123.   #   如果传递了width参数的话,会自动换行
  124.   #--------------------------------------------------------------------------
  125.   def draw_text_ex(x, y, text, width = nil,textwidth = nil,normalfont = true)
  126.     reset_font_settings if normalfont == true
  127.     text = convert_escape_characters(text)
  128.     pos = {:x => x, :y => y, :new_x => x, :height => calc_line_height(text)}
  129.     if width != nil
  130.       pos[:height] = contents.font.size
  131.       pos[:width] = width
  132.       pos[:textwidth] = textwidth
  133.     end
  134.     process_character(text.slice!(0, 1), text, pos) until text.empty?
  135.   end
  136.   #--------------------------------------------------------------------------
  137.   # ● 文字的处理
  138.   #     c    : 文字
  139.   #     text : 绘制处理中的字符串缓存(字符串可能会被修改)
  140.   #     pos  : 绘制位置 {:x, :y, :new_x, :height}
  141.   #--------------------------------------------------------------------------
  142.   def process_character(c, text, pos)
  143.     case c
  144.     when "\r"   # 回车
  145.       return
  146.     when "\n"   # 换行
  147.       process_new_line(text, pos)
  148.     when "\f"   # 翻页
  149.       process_new_page(text, pos)
  150.     when "\e"   # 控制符
  151.       process_escape_character(obtain_escape_code(text), text, pos)
  152.     else        # 普通文字
  153.       pos[:textwidth] == nil ? text_width = text_size(c).width : text_width = pos[:textwidth]
  154.       if pos[:width] != nil && pos[:x] - pos[:new_x] + text_width > pos[:width]
  155.         process_new_line(text, pos)
  156.       end
  157.       process_normal_character(c, pos)
  158.     end
  159.   end
  160. end

  161. class Window_SkillStatus < Window_Base
  162.   
  163.   def initialize(x, y)
  164.     super(x, y, window_width, fitting_height(4))
  165.     @actor = nil
  166.   end
  167.   
  168.   def window_width
  169.     Graphics.width - 160
  170.   end
  171.   
  172.   def actor=(actor)
  173.     return if @actor == actor
  174.     @actor = actor
  175.     refresh
  176.   end

  177.   def draw_actor_sp(actor,x,y)
  178.     change_color(system_color)
  179.     draw_text(x, y, 200, line_height, "SP:")
  180.     change_color(normal_color)
  181.     draw_text(x+48, y, 200, line_height, actor.sp)
  182.   end
  183.   
  184.   def refresh
  185.     contents.clear
  186.     return unless @actor
  187.     draw_actor_face(@actor, 0, 0)
  188.     draw_actor_simple_status(@actor, 108, line_height / 2)
  189.     draw_actor_sp(@actor,108,64)
  190.   end
  191. end



  192. class Window_AddHelp < Window_Base
  193.   def initialize(x, y, width, height)
  194.     super
  195.     @skill = nil
  196.     @actor = nil
  197.     refresh
  198.   end

  199.   def set_item(skill)
  200.     return if @skill == skill
  201.     @skill = skill
  202.     refresh
  203.   end
  204.   
  205.   def actor=(actor)
  206.     return if @actor == actor
  207.     @actor = actor
  208.     refresh
  209.   end
  210.   def line_width
  211.     Graphics.width/2-standard_padding*2
  212.   end
  213.   def draw_skill_name(skill,x,y)
  214.     draw_icon(skill.icon_index, x, y)
  215.     change_color(normal_color)
  216.     draw_text(x+24, y, line_width, line_height, skill.name)
  217.     if skill.passive
  218.       draw_text(x, y, line_width, line_height, "被動技能",2)
  219.     else
  220.       change_color(mp_cost_color)
  221.       draw_text(x, y, line_width, line_height, "MP "+@actor.skill_mp_cost(skill).to_s,2)
  222.     end
  223.   end
  224.   
  225.   def draw_skill_level(skill,x,y)
  226.     change_color(system_color)
  227.     draw_text(x, y, line_width, line_height,"Level ")
  228.     text =@actor.skill_basic_level(skill.id).to_s + "/"+skill.max_learn.to_s
  229.     change_color(normal_color)
  230.     draw_text(x+60, y, line_width-60, line_height,text)
  231.     draw_text(x, y, line_width, line_height,"升级所需SP: "+skill.sp_cost.to_s,2)
  232.   end
  233.   def draw_next_level(skill,x,y)
  234.     if skill.link_skill != 0
  235.       change_color(knockout_color)
  236.       draw_text(x, y, line_width, line_height,"绑定技能:"+$data_skills[skill.link_skill].name)
  237.       return
  238.     end
  239.     lvl = @actor.skill_next_level(skill)
  240.     if !lvl
  241.       change_color(system_color)
  242.       draw_text(x, y, line_width, line_height,"已精通。")
  243.     else
  244.       if @actor.level >= @actor.skill_next_level(skill)
  245.         change_color(normal_color)
  246.       else
  247.         change_color(crisis_color)
  248.       end
  249.       draw_text(x, y, line_width, line_height,"需要等级: "+lvl.to_s)
  250.     end
  251.   end
  252.   def draw_former_skill(skill,x,y)
  253.     line = 0
  254.     skill.former.each do |former|
  255.       if former[0] != 0
  256.         txt = "需要: " + $data_skills[former[0]].name + "|Lv.#{former[1]}"
  257.         @actor.skill_basic_level(former[0]) >= former[1] ? change_color(system_color) : change_color(crisis_color)
  258.         draw_text(x, y+line*line_height, line_width, line_height,txt)
  259.         line += 1
  260.       end
  261.     end
  262.     line
  263.   end
  264.   def refresh
  265.     contents.clear
  266.     return if @skill == nil or @actor == nil
  267.     draw_skill_name(@skill,0,0)
  268.     draw_skill_level(@skill,0,line_height)
  269.     draw_next_level(@skill,0,line_height*2)
  270.     n = draw_former_skill(@skill,0,line_height*3)
  271.     draw_text_ex(0, line_height*(3+n), @skill.description, line_width)
  272.   end
  273.   
  274. end



  275. #==============================================================================
  276. # ■ Window_AddCommand
  277. #------------------------------------------------------------------------------
  278. #  
  279. #==============================================================================
  280. class Window_AddCommand < Window_Command
  281.   
  282.   def initialize
  283.     super(100, 120)
  284.     self.visible = false
  285.     self.active = false
  286.     @index = 0
  287.   end
  288.   #--------------------------------------------------------------------------
  289.   # ● コマンドリストの作成
  290.   #--------------------------------------------------------------------------
  291.   def make_command_list
  292.     add_command("提升一级",   :add1)
  293.     add_command("提升满",    :addf)
  294.     add_command("取消",    :cancel)
  295.   end
  296.   #--------------------------------------------------------------------------
  297.   # ● 決定ボタンが押されたときの処理
  298.   #--------------------------------------------------------------------------
  299.   def process_ok
  300.     Input.update
  301.     call_ok_handler
  302.   end
  303.   #--------------------------------------------------------------------------
  304.   # ● 按下取消键时的处理
  305.   #--------------------------------------------------------------------------
  306.   def process_cancel
  307.     Input.update
  308.     call_cancel_handler
  309.   end
  310.   #--------------------------------------------------------------------------
  311.   # ● 启用窗口
  312.   #--------------------------------------------------------------------------
  313.   def activate
  314.     temp = self.y + self.height - Graphics.height
  315.     if temp > 0
  316.       self.y -= Graphics.height - self.height
  317.     end
  318.     self.active = true
  319.     self
  320.   end
  321. end
复制代码
  1. #encoding:utf-8
  2. #===========================================================================
  3. #      RMVA 豪华技能加点|技能被动效果:         v1.05
  4. #                       By希忆 66rpg.com
  5. #                                                 转载或修改请保留此类信息
  6. # 所有和场景相关的修改
  7. # 应该没啥要处理的了。
  8. #===========================================================================
  9. class Scene_AddSkill < Scene_MenuBase
  10.   #--------------------------------------------------------------------------
  11.   # ● 开始处理
  12.   #--------------------------------------------------------------------------
  13.   def start
  14.     super
  15.     create_command_window
  16.     create_status_window
  17.     create_help_window
  18.     create_item_window
  19.     @add_command = Window_AddCommand.new
  20.     @add_command.viewport = @viewport
  21.     @add_command.set_handler(:add1,    method(:command_add1))
  22.     @add_command.set_handler(:addf,    method(:command_addf))
  23.     @add_command.set_handler(:cancel,    method(:command_canc))
  24.   end
  25.   def create_help_window
  26.     wx = Graphics.width/2
  27.     wy = @status_window.height
  28.     wh = Graphics.height - wy
  29.     @help_window = Window_AddHelp.new(wx,wy,wx,wh)
  30.     @help_window.viewport = @viewport
  31.     @help_window.actor = @actor
  32.   end
  33.   #--------------------------------------------------------------------------
  34.   # ● 生成指令窗口
  35.   #--------------------------------------------------------------------------
  36.   def create_command_window
  37.     @command_window = Window_SkillCommand.new(0, 0)
  38.     @command_window.viewport = @viewport
  39.     @command_window.help_window = @help_window
  40.     @command_window.actor = @actor
  41.     @command_window.set_handler(:skill,    method(:command_skill))
  42.     @command_window.set_handler(:cancel,   method(:return_scene))
  43.     @command_window.set_handler(:pagedown, method(:next_actor))
  44.     @command_window.set_handler(:pageup,   method(:prev_actor))
  45.    
  46.   end
  47.   
  48.   def command_add1
  49.     @actor.level_up_skill(@item_window.item.id)
  50.     @item_window.refresh
  51.     @help_window.refresh
  52.     @status_window.refresh
  53.     Sound.play_ok
  54.     @add_command.hide
  55.     @add_command.deactivate
  56.     @item_window.activate
  57.     @item_window.index = @item_index
  58.   end
  59.   def command_addf
  60.     while @actor.level_up_skill(@item_window.item.id)
  61.     end
  62.     @item_window.refresh
  63.     @help_window.refresh
  64.     @status_window.refresh
  65.     Sound.play_ok
  66.     @add_command.hide
  67.     @add_command.deactivate
  68.     @item_window.activate
  69.     @item_window.index = @item_index
  70.   end
  71.   def command_canc
  72.     Sound.play_cancel
  73.     command_skill
  74.   end
  75.   
  76.   def update
  77.     super
  78.     @add_command.y =[120 + @item_window.index * 24,Graphics.height - @add_command.height].min
  79.   end
  80.   
  81.   #--------------------------------------------------------------------------
  82.   # ● 生成状态窗口
  83.   #--------------------------------------------------------------------------
  84.   def create_status_window
  85.     @status_window = Window_SkillStatus.new(@command_window.width, 0)
  86.     @status_window.viewport = @viewport
  87.     @status_window.actor = @actor
  88.   end
  89.   #--------------------------------------------------------------------------
  90.   # ● 生成物品窗口
  91.   #--------------------------------------------------------------------------
  92.   def create_item_window
  93.     wx = 0
  94.     wy = @status_window.height
  95.     ww = Graphics.width/2
  96.     wh = Graphics.height - wy
  97.     @item_window = Window_AllSkill.new(wx, wy, ww, wh)
  98.     @item_window.actor = @actor
  99.     @item_window.viewport = @viewport
  100.     @item_window.help_window = @help_window
  101.     @item_window.set_handler(:ok,     method(:on_item_ok))
  102.     @item_window.set_handler(:cancel, method(:on_item_cancel))
  103.     @command_window.skill_window = @item_window
  104.   end
  105.   #--------------------------------------------------------------------------
  106.   # ● 指令“技能”
  107.   #--------------------------------------------------------------------------
  108.   def command_skill
  109.     @add_command.hide
  110.     @add_command.deactivate
  111.     @item_window.activate
  112.     @item_window.select_last
  113.   end
  114.   #--------------------------------------------------------------------------
  115.   # ● 物品“确定”
  116.   #--------------------------------------------------------------------------
  117.   def on_item_ok
  118.     @item_index = @item_window.index
  119.     @add_command.show
  120.     @add_command.activate
  121.   end
  122.   #--------------------------------------------------------------------------
  123.   # ● 物品“取消”
  124.   #--------------------------------------------------------------------------
  125.   def on_item_cancel
  126.     @item_window.unselect
  127.     @command_window.activate
  128.   end

  129.   #--------------------------------------------------------------------------
  130.   # ● 切换角色
  131.   #--------------------------------------------------------------------------
  132.   def on_actor_change
  133.     @command_window.actor = @actor
  134.     @status_window.actor = @actor
  135.     @item_window.actor = @actor
  136.     @help_window.actor = @actor
  137.     @command_window.activate
  138.   end
  139. end



  140. #===========================================================================
  141. # 向菜单中添加
  142. #===========================================================================

  143. class Window_MenuCommand < Window_Command
  144.   alias add_original_commands_201411160131 add_original_commands
  145.   def add_original_commands
  146.     add_original_commands_201411160131
  147.     add_command(SkillLevel::MENUNAME, :addskill, main_commands_enabled)
  148.   end
  149. end


  150. class Scene_Menu < Scene_MenuBase
  151.   alias create_command_window_201411160131 create_command_window
  152.   def create_command_window
  153.     create_command_window_201411160131
  154.     @command_window.set_handler(:addskill,      method(:command_personal))
  155.   end
  156.   def on_personal_ok
  157.     case @command_window.current_symbol
  158.     when :skill
  159.       SceneManager.call(Scene_Skill)
  160.     when :equip
  161.       SceneManager.call(Scene_Equip)
  162.     when :status
  163.       SceneManager.call(Scene_Status)
  164.     when :addskill
  165.       SceneManager.call(Scene_AddSkill)
  166.     end
  167.   end
  168. end
复制代码


人物加點
  1. #encoding:utf-8
  2. #=============================================================================
  3. #-----------RMVA加点系统正常向-v1.03---By:救世小树--------转载请注明出处-------
  4. #=============================================================================

  5. module Point_Tree
  6.   
  7.   POINT_KIND     = 6     #设定加点种类
  8.   LEVEL_UP_POINT = 2       #每升一级自由属性点增加数
  9.   RESET_ITEM     = 29      #洗点水编号
  10.   
  11.   #$game_actors[n].point[0]+=x
  12.   #n为角色ID,x为增加的未分配点数
  13.   
  14.   STR_POINT        = ["生命","精神","力量","耐力","敏捷","抗性"]
  15.   
  16.   #分别对应增加       [MHP,MMP,物攻,物防,魔攻,魔防,敏捷,幸运]
  17.   POINT_ADD_PARAM = [
  18.                      [1 ,  0,   0,  0,   0,   0,   0,   0],     #体力
  19.                      [0  , 1,   0,  0,   0,   0,   0,   0],     #精神
  20.                      [0  ,  0,   1,  0,   1,   0,   0,   0],     #力量
  21.                      [0  , 0,   0,  1,   0,   1,   0,   0],     #耐力
  22.                      [0  ,  0,   0,  0,   0,   0,   1,   0],     #灵活
  23.                      [0  ,  0,   0,  0,   0,   0,   0,   1],     #韧性
  24.                      
  25.                      [0,0,0,0,0,0,0,0]]
  26.                      #可以按上面的格式添加下去,不过要改POINT_KIND,STR_ALL,不然加了也白加
  27.   
  28.   #分别对应增加       [物理命中,物理闪避,必杀,必杀闪避,魔法闪避,魔法反射,物理反击,HP再生,Mp再生,Tp再生]
  29.   POINT_ADD_XPARAM = [
  30.                       [0 , 0, 0, 0, 0, 0, 0, 5, 0, 0],  #体力
  31.                       [0 , 0, 0, 0, 0, 0, 0, 0, 5, 0],  #精神
  32.                       [0 , 0, 5, 0, 0, 0, 0, 0, 0, 0],  #力量
  33.                       [0 , 0, 0, 0, 0, 0, 0, 0, 0, 5],  #耐力
  34.                       [0 , 5, 0, 0, 0, 0, 0, 0, 0, 0],  #灵活
  35.                       [5 , 0, 0, 0, 0, 0, 0, 0, 0, 0],  #韧性
  36.                      
  37.                       [0,0,0,0,0,0,0,0,0,0]]
  38.                      #这里的单位是万分之一数值也就是0.01%,我随便填了下【别嫌小,够大了,有心情你可以算算看平衡性】
  39.   
  40.   #各种名称
  41.   
  42.   ADDPOINT       = "加點"     #菜单中选项
  43.   POINT_NAME     = "Ap"   #未分配点数
  44.   
  45.   XARAM_NAME     = ["命中率","迴避率","爆擊率","必杀闪避","魔法闪避","魔法反射","物理反击","HP再生","Mp再生","Tp再生"]

  46.   
  47.   def temp_all
  48.     r = 0
  49.     for i in 0 .. POINT_KIND-1
  50.       r+=$temp_point[i]
  51.     end
  52.     return r
  53.   end
  54.   
  55.   def reset(actor_id)
  56.     for i in 1..6
  57.       $game_actors[actor_id].point[0] += $game_actors[actor_id].point[i]
  58.       $game_actors[actor_id].point[i] =0
  59.     end
  60.   end
  61.   
  62. end

  63. $temp_point = []
  64. for i in 0 .. Point_Tree::POINT_KIND-1
  65.   $temp_point.push(0)
  66. end

  67. class Game_Actor < Game_Battler
  68.   include Point_Tree
  69.   attr_accessor :point
  70.   
  71.   alias setup_tre setup
  72.   def setup(actor_id)
  73.     @point = []
  74.     for i in 0 .. POINT_KIND
  75.       @point.push(0)
  76.     end
  77.     setup_tre(actor_id)
  78.   end
  79.   
  80.   
  81.   
  82.   
  83.   alias level_up_tre level_up
  84.   def level_up
  85.     level_up_tre
  86.     @hp += mhp
  87.     @mp += mmp
  88.     @point[0] += LEVEL_UP_POINT
  89.   end

  90.   
  91.   
  92.   def point_plus(param_id)
  93.     r=0
  94.     for i in 1 .. POINT_KIND
  95.       r+=@point[i]*POINT_ADD_PARAM[i-1][param_id]
  96.     end
  97.     return r
  98.   end

  99.   alias point_base_param param
  100.   
  101.   def param(param_id)
  102.     value = param_base(param_id) + param_plus(param_id) + point_plus(param_id)
  103.     value *= param_rate(param_id) * param_buff_rate(param_id)
  104.     [[value, param_max(param_id)].min, param_min(param_id)].max.to_i
  105.   end
  106.   def xparam(xparam_id,extra_add = 0)
  107.     xp = super(xparam_id)
  108.     for i in 0 .. POINT_KIND-1
  109.       xp+=(@point[i+1]*POINT_ADD_XPARAM[i][xparam_id]/10000.0)
  110.     end
  111.     return xp
  112.   end

  113.   def item_apply(user, item)
  114.     super(user, item)
  115.     if item.id == RESET_ITEM and item.is_a?(RPG::Item)
  116.       reset(@actor_id)
  117.       self.hp = [self.hp,self.mhp].min
  118.       self.mp = [self.mp,self.mmp].min
  119.     end
  120.   end
  121.   
  122. end

  123. class Window_Point_Command < Window_Command
  124.   
  125.   include Point_Tree
  126.   #--------------------------------------------------------------------------
  127.   # ● 初始化指令选择位置(类方法)
  128.   #--------------------------------------------------------------------------
  129.   def self.init_command_position
  130.     @@last_command_symbol = nil
  131.   end
  132.   #--------------------------------------------------------------------------
  133.   # ● 初始化对象
  134.   #--------------------------------------------------------------------------
  135.   def initialize(actor)
  136.     @status_window = nil
  137.     @actor = actor
  138.     super(0,0)
  139.     select_last
  140.   end
  141.   def actor=(actor)
  142.     return if @actor == actor
  143.     @actor = actor
  144.     refresh
  145.   end
  146.   def status_window=(status_window)
  147.     return if @status_window == status_window
  148.     @status_window = status_window
  149.   end
  150.   #--------------------------------------------------------------------------
  151.   # ● 获取窗口的宽度
  152.   #--------------------------------------------------------------------------
  153.   def window_width
  154.     return 160
  155.   end
  156.   #--------------------------------------------------------------------------
  157.   # ● 获取显示行数
  158.   #--------------------------------------------------------------------------
  159.   def visible_line_number
  160.     item_max
  161.   end
  162.   def get_actor_point(index)
  163.     s = @actor.point[index+1].to_s
  164.     return "("+s+")+"+$temp_point[index].to_s
  165.   end
  166.   #--------------------------------------------------------------------------
  167.   # ● 生成指令列表
  168.   #--------------------------------------------------------------------------
  169.   def make_command_list
  170.     for i in 0 .. POINT_KIND-1
  171.       add_command(STR_POINT[i]   + get_actor_point(i)  , :point_add  ,add_enabled)
  172.     end
  173.     add_command("确认",  :point_ok)
  174.     add_command("取消",  :point_cancle)
  175.   end
  176.   #--------------------------------------------------------------------------
  177.   # ● 按下确定键时的处理
  178.   #--------------------------------------------------------------------------
  179.   def process_ok
  180.     @@last_command_symbol = current_symbol
  181.     super
  182.   end
  183.   #--------------------------------------------------------------------------
  184.   # ● 返回最后一个选项的位置
  185.   #--------------------------------------------------------------------------
  186.   def select_last
  187.     select_symbol(@@last_command_symbol)
  188.   end
  189.   
  190.   def add_enabled
  191.     temp_all < @actor.point[0]
  192.   end

  193.   def update_help
  194.     @help_window.set_text(self.index+1) if @help_window
  195.     @status_window.index = self.index if @status_window
  196.   end
  197. end

  198. #帮助窗口
  199. class Window_Point_Help < Window_Base
  200.   include Point_Tree
  201.   def initialize(x,y,w,h)
  202.     super(x, y, w, h)
  203.    
  204.    
  205.   end
  206.   def set_text(id)
  207.     contents.clear
  208.     if id <= POINT_KIND
  209.       text = "\\}提升一点该属性"
  210.     elsif id == POINT_KIND+1
  211.       text = "\\}确认此次加点分配"
  212.     elsif  id == POINT_KIND+2
  213.       text = "\\}取消此次加点分配"
  214.     end
  215.     draw_text_ex(8, 8, text)
  216.   end
  217. end


  218. #角色状态窗口
  219. class Window_Point_Actor < Window_Base
  220.   include Point_Tree
  221.   
  222.   
  223.   def initialize(actor)
  224.     super(160, 0, Graphics.width - 160, Graphics.height)
  225.     @actor = actor
  226.     @index = 0
  227.     refresh
  228.   end
  229.   def actor=(actor)
  230.     return if @actor == actor
  231.     @actor = actor
  232.     refresh
  233.   end
  234.   def index=(index)
  235.     return if @index == index
  236.     @index = index
  237.     refresh
  238.   end
  239.   def line_height
  240.     return 24
  241.   end
  242.   def refresh
  243.     contents.clear
  244.     contents.font.size = 24
  245.     draw_actor_name(@actor, 100, 0)
  246.     draw_actor_class(@actor, 240, 0)
  247.     draw_actor_face(@actor, 2, 0)
  248.     contents.font.size = 20
  249.     draw_actor_level(@actor, 102,  24)
  250.     draw_actor_point(100,48)
  251.     contents.font.size = 16
  252.     draw_actor_param_point(8,16 * 6)
  253.     draw_actor_xparam_point(8,16 * 14)
  254.   end
  255.   def draw_actor_point(x,y)
  256.     draw_text(x,y,200,line_height,"  未分配"+POINT_NAME + ":" + @actor.point[0].to_s)
  257.     draw_text(x,y+line_height,200,line_height,"此次分配"+POINT_NAME + ":" + temp_all.to_s)
  258.   end
  259.   def draw_actor_param_point(x,y)
  260.     8.times {|i| draw_actor_param_to_s(x,y,i)}
  261.   end
  262.   def draw_actor_xparam_point(x,y)
  263.     10.times {|i| draw_actor_xparam_to_s(x,y,i)}
  264.   end
  265.   
  266.   def draw_actor_param_to_s(x,y,param_id)
  267.     a=0
  268.     for i in 0 .. POINT_KIND-1
  269.       a+=$temp_point[i]*POINT_ADD_PARAM[i][param_id]
  270.     end
  271.     s1 = Vocab::param(param_id)
  272.     s2 = @actor.param(param_id).to_s
  273.     s3 = (@actor.param(param_id)+a).to_s
  274.     if @index < POINT_KIND
  275.       if POINT_ADD_PARAM[@index][param_id]==0
  276.         s4 = ""
  277.       else
  278.         s4 = "+" + POINT_ADD_PARAM[@index][param_id].to_s
  279.       end
  280.     else
  281.       s4 = ""
  282.     end
  283.    
  284.     change_color(system_color)
  285.     draw_text(x,y+16*param_id,100,line_height,s1)
  286.     change_color(normal_color)
  287.     s2+= " →"
  288.     draw_text(x+82,y+16*param_id,120,line_height,s2,2)
  289.     change_color(system_color)
  290.     draw_text(x+150,y+16*param_id,100,line_height,s3,2)
  291.     change_color(normal_color)
  292.     contents.font.size = 14
  293.     draw_text(x+266,y+16*param_id,100,line_height,s4)
  294.     contents.font.size = 16
  295.   end
  296.   def draw_actor_xparam_to_s(x,y,xparam_id)
  297.     a=0.00
  298.     for i in 0 .. POINT_KIND-1
  299.       a+=($temp_point[i]*POINT_ADD_XPARAM[i][xparam_id]/10000.0)
  300.     end
  301.     s1 = XARAM_NAME[xparam_id]
  302.     s2 = sprintf("%02.2f%%",@actor.xparam(xparam_id)*100)
  303.     s3 = sprintf("%02.2f%%",(@actor.xparam(xparam_id) + a)*100)

  304.     if @index < POINT_KIND
  305.       if POINT_ADD_XPARAM[@index][xparam_id]==0
  306.         s4=""
  307.       else
  308.         s4 = sprintf("+%02.2f%%",POINT_ADD_XPARAM[@index][xparam_id]/100.0)
  309.       end
  310.     else
  311.       s4 = ""
  312.     end
  313.    
  314.     change_color(system_color)
  315.     draw_text(x,y+16*xparam_id,100,line_height,s1)
  316.     change_color(normal_color)
  317.     s2+= " →"
  318.     draw_text(x+82,y+16*xparam_id,120,line_height,s2,2)
  319.     change_color(system_color)
  320.     draw_text(x+150,y+16*xparam_id,100,line_height,s3,2)
  321.     change_color(normal_color)
  322.     contents.font.size = 14
  323.     draw_text(x+266,y+16*xparam_id,100,line_height,s4)
  324.     contents.font.size = 16
  325.    
  326.    
  327.   end
  328. end

  329. class Scene_Point < Scene_Base
  330.   include Point_Tree
  331.   def start
  332.     super
  333.     create_background
  334.     @actor = $game_party.menu_actor
  335.     create_command_window
  336.     create_status_window
  337.     create_help_window
  338.     @command_window.activate
  339.   end
  340.   def terminate
  341.     super
  342.     dispose_background
  343.   end
  344.   def create_background
  345.     @background_sprite = Sprite.new
  346.     @background_sprite.bitmap = SceneManager.background_bitmap
  347.     @background_sprite.color.set(16, 16, 16, 128)
  348.   end
  349.   def dispose_background
  350.     @background_sprite.dispose
  351.   end
  352.   
  353.   def create_command_window
  354.     @command_window = Window_Point_Command.new(@actor)
  355.     @command_window.set_handler(:cancel,      method(:return_scene))
  356.     @command_window.set_handler(:pagedown,    method(:next_actor))
  357.     @command_window.set_handler(:pageup,      method(:prev_actor))
  358.     @command_window.set_handler(:point_add,   method(:add_point))
  359.     @command_window.set_handler(:point_ok,    method(:add_ok))
  360.     @command_window.set_handler(:point_cancle,method(:add_cancle))
  361.    
  362.   end
  363.   def return_scene
  364.     add_cancle
  365.     SceneManager.return
  366.   end
  367.   def create_status_window
  368.     @status_window = Window_Point_Actor.new(@actor)
  369.     @command_window.status_window = @status_window
  370.   end
  371.   def create_help_window
  372.     @help_window = Window_Point_Help.new(0,@command_window.height,160,[email]Graphics.height-@command_window.height[/email])
  373.     #(0, 216, 160, 200)
  374.     @help_window.viewport = @viewport
  375.     @command_window.help_window = @help_window
  376.   end
  377.   
  378.   def add_point
  379.     if temp_all >= @actor.point[0]
  380.       @command_window.activate
  381.       return
  382.     end
  383.     $temp_point[@command_window.index] += 1
  384.     @status_window.refresh
  385.     @command_window.refresh
  386.     @command_window.activate
  387.   end
  388.   

  389.   def add_ok
  390.     for i in 0 .. POINT_KIND-1
  391.       @actor.point[i+1] += $temp_point[i]
  392.     end
  393.     @actor.point[0]-= temp_all
  394.     add_cancle
  395.   end
  396.   
  397.   def add_cancle
  398.     for i in 0 .. POINT_KIND-1
  399.       $temp_point[i]=0
  400.     end
  401.     @status_window.refresh
  402.     @command_window.refresh
  403.     @command_window.activate
  404.   end
  405.   
  406.   
  407.   def next_actor
  408.     @actor = $game_party.menu_actor_next
  409.     on_actor_change
  410.   end
  411.   #--------------------------------------------------------------------------
  412.   # ● 切换到上一个角色
  413.   #--------------------------------------------------------------------------
  414.   def prev_actor
  415.     @actor = $game_party.menu_actor_prev
  416.     on_actor_change
  417.   end
  418.   #--------------------------------------------------------------------------
  419.   # ● 切换角色
  420.   #--------------------------------------------------------------------------
  421.   def on_actor_change
  422.     add_cancle
  423.     @status_window.actor = @actor
  424.     @command_window.actor = @actor
  425.     @command_window.activate
  426.   end
  427.   
  428. end

  429. class Window_MenuCommand < Window_Command
  430.   alias add_original_commands_old add_original_commands
  431.   def add_original_commands
  432.     add_original_commands_old
  433.     add_command(Point_Tree::ADDPOINT,    :addpoint)
  434.   end
  435. end

  436. class Scene_Menu < Scene_MenuBase
  437.   alias create_command_window_old create_command_window
  438.   def create_command_window
  439.     create_command_window_old
  440.     @command_window.set_handler(:addpoint,method(:add_point))
  441.   end
  442.   def add_point
  443.     @status_window.select_last
  444.     @status_window.activate
  445.     @status_window.set_handler(:ok,     method(:on_ok))
  446.     @status_window.set_handler(:cancel, method(:on_personal_cancel))
  447.   end
  448.   def on_ok
  449.     SceneManager.call(Scene_Point)
  450.     Window_Point_Command::init_command_position
  451.   end
  452. end



  453. class Scene_ItemBase < Scene_MenuBase
  454.   def item_usable?
  455.     if item.id == Point_Tree::RESET_ITEM and item.is_a?(RPG::Item)
  456.       return true
  457.     end
  458.     user.usable?(item) && item_effects_valid?
  459.   end
  460. end




  461. #===============================================================
  462. #顯示在介面上
  463. #===============================================================
  464. =begin
  465. class Window_Status < Window_Selectable
  466.   include Point_Tree
  467.   alias draw_parameters_old draw_parameters
  468.   def draw_parameters(x, y)
  469.     draw_parameters_old(x,y)
  470.     draw_point(x,y)
  471.   end
  472.   def draw_point(x,y)
  473.     for i in 0..5
  474.       change_color(system_color)
  475.       draw_text(x+100, y+ line_height * i, 80, line_height, STR_POINT[i])
  476.       change_color(normal_color)
  477.       draw_text(x+180, y+ line_height * i, 36, line_height,@actor.point[i+1].to_s, 2)
  478.     end
  479.   end
  480.   
  481. end

  482. class Window_Base < Window
  483.   def draw_actor_param(actor, x, y, param_id)
  484.     change_color(system_color)
  485.     draw_text(x-30, y, 80, line_height, Vocab::param(param_id))
  486.     change_color(normal_color)
  487.     draw_text(x+ 50, y, 36, line_height, actor.param(param_id), 2)
  488.   end
  489. end
  490. =end
复制代码

点评

魂大那邊不行, 嗯 我再補上其他部份  发表于 2016-12-3 22:39
你的腳本發的不完全。怎麼不叫魂幫你看看呢 PS:現在伸手會被鍘哦,看一下新版規  发表于 2016-12-3 22:26
您需要登录后才可以回帖 登录 | 注册会员

本版积分规则

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

在本版发帖返回顶部