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

Project1

 找回密码
 注册会员
搜索
查看: 1308|回复: 3
打印 上一主题 下一主题

[已经过期] 一个关于脚本的问题

[复制链接]

Lv1.梦旅人

梦石
0
星屑
50
在线时间
20 小时
注册时间
2012-2-20
帖子
40
跳转到指定楼层
1
发表于 2013-8-21 19:27:21 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式

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

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

x
  1. =begin
  2. #==============================================================================
  3. # ■ 天赋加点系统
  4. #------------------------------------------------------------------------------
  5. #    By 轮回者
  6. #==============================================================================

  7. #==============================================================================
  8. #一些介绍:
  9. #==============================================================================
  10.   转职后天赋加点还原
  11.   降级减退点,没点减最后加的那个天赋
  12.   加天赋的时候有限制:除了某些天赋单独的限制以外,你在这一类加的天赋的总点数必
  13.   须不小于(所选天赋的行数 * 5 - 5)
  14.   Part1是数据库,即需要使用者设定的部分,分3小块。
  15.   Part2是处理部分,全部新建。
  16.   Part3是所有修改原定义的处理部分,可搜索“=修改=”。
  17.   想扩充天赋效果种类的请搜索"扩充",可找到一个需要注意的地方。
  18.   调用方法:$scene = Scene_Genius.new
  19.   想设定天赋效果的请搜索"天赋效果000"
  20.   
  21.   差不多就这些。

  22. ================================================================================
  23. #一些废话:
  24. #==============================================================================

  25. 虽然这个脚本略做修改可以做技能树,但带有的数据库应用的范围不是很大,因为想做魔
  26. 兽那类游戏的人大概不多,所以天赋的效果都没设,也因此,关于天赋效果的问题尚不清
  27. 楚,只对各项功能做了些测试,有些BUG已经修正。
  28. 数据库是直接从新浪的一个老版的天赋模拟器上弄下来的,转成了RGSS可用的格式,有些
  29. 没用的东西没删,嗯,由于某些原因……
  30. 感觉上这个脚本还有很大扩充余地,不过最近脑袋比较木,扩充就麻烦各位自己动手了。
  31. 想改脚本的可以看"Scripts_拆分版",嗯,舒服一点。
  32. 脚本17号就做完了,不过测试今天才做,感觉没有太大问题,所以就发了。

  33. 有错误的话请联系我(最好是PM),谢了!
  34.                                                                         轮回者
  35.                                                                       2006.9.19
  36. ================================================================================
  37. =end


  38. #====================================Part1======================================
  39. =begin
  40. 技能介绍、要求的数据库
  41. 增加方法:
  42. $talents[职业ID][天赋ID] = ["名称",类型ID, "类型", 纵列, 横行, "图标",Coords(不知道是干什么的-_-b)
  43.                             详细资料, 介绍, 信息(按级别不同), 需求]
  44. 可对照Main下面的'RGSS化数据库'。

  45. 注意!!

  46. 不同职业不可有相同的天赋ID!!
  47. "名称"中'@'以后的部分会自动屏蔽!
  48. 纵列, 横行不是具体坐标值!
  49. '介绍'中只可插入一个'@',脚本会将'@'替换为本级天赋的'信息'!
  50. 图标在本脚本中未应用,若需使用,图标在"Graphics\WOW\"中。
  51. =end
  52. $talents = [nil,[],[],[],[],[],[],[],[],[]]
  53.       $talents[1][1] = [ "九阴真经[第一层]", 1, "九阴真经", 1, 1, "Ability_GhoulFrenzy_sm.png", nil, nil, "九阴真经第一层,需消耗1修为点,习得可增长50气血50内力.",[], []]
  54.       $talents[1][2] = [ "九阴真经[第二层]", 1, "九阴真经", 1, 2, "Ability_GhoulFrenzy_sm.png", nil, nil, "九阴真经第二层,需消耗2修为点,习得可增长60气血60内力.",[], []]
  55.       $talents[1][3] = [ "九阴真经[第三层]", 1, "九阴真经", 2, 3, "Ability_GhoulFrenzy_sm.png", nil, nil, "九阴真经第三层,需消耗3修为点,习得可增长70气血70内力.",[], []]
  56.       $talents[1][4] = [ "九阴真经[第四层]", 1, "九阴真经", 3, 3, "Ability_GhoulFrenzy_sm.png", nil, nil, "九阴真经第四层,需消耗1修为点,习得可增长80气血80内力.",[], []]
  57.       $talents[1][5] = [ "九阴真经[第五层]", 1, "九阴真经", 4, 3, "Ability_GhoulFrenzy_sm.png", nil, nil, "九阴真经第五层,需消耗1修为点,习得可增长100气血100内力.",[], []]
  58.       $talents[1][6] = [ "九阴真经[第六层]", 1, "九阴真经", 4, 2, "Ability_GhoulFrenzy_sm.png", nil, nil, "九阴真经第六层,需消耗1修为点,习得可增长150气血150内力.",[], []]
  59.       $talents[1][7] = [ "九阴真经[第七层]", 1, "九阴真经", 6, 2, "Ability_GhoulFrenzy_sm.png", nil, nil, "九阴真经第七层,需消耗2修为点,习得可增长200气血200内力,并且会习得九阴白骨爪.",[], []]
  60.                         $talents[1][8] = [ "九阴真经[第八层]", 1, "九阴真经", 6, 4, "Ability_GhoulFrenzy_sm.png", nil, nil, "九阴真经第八层,需消耗1修为点,习得可增长300气血300内力.",[], []]
  61.       $talents[1][9] = [ "九阴真经[第九层]", 1, "九阴真经", 7, 3, "Ability_GhoulFrenzy_sm.png", nil, nil, "九阴真经第九层,需消耗3修为点,习得可增长500气血500内力.",[], []]

  62.                
  63.                
  64.                         #$talents[职业ID][天赋ID][9][天赋等级] = [耗费技能点, "描述", nil, ""]
  65. $talents[1][1][9][0] = [1, "", nil, ""]
  66. $talents[1][2][9][0] = [1, "", nil, ""]
  67. $talents[1][2][9][1] = [2, "", nil, ""]

  68. $talents[1][3][9][0] = [1, "", nil, ""]
  69. $talents[1][3][9][1] = [2, "", nil, ""]
  70. $talents[1][3][9][2] = [3, "", nil, ""]

  71. $talents[1][4][9][0] = [1, "", nil, ""]
  72. $talents[1][4][9][1] = [2, "", nil, ""]
  73. $talents[1][4][9][2] = [3, "", nil, ""]

  74. $talents[1][5][9][0] = [1, "", nil, ""]
  75. $talents[1][5][9][1] = [2, "", nil, ""]
  76. $talents[1][5][9][2] = [3, "", nil, ""]
  77. $talents[1][6][9][0] = [1, "", nil, ""]
  78. $talents[1][6][9][1] = [2, "", nil, ""]
  79. $talents[1][6][9][2] = [3, "", nil, ""]
  80. $talents[1][7][9][0] = [1, "", nil, ""]
  81. $talents[1][7][9][1] = [2, "", nil, ""]
  82. $talents[1][7][9][2] = [3, "", nil, ""]
  83. $talents[1][8][9][0] = [1, "", nil, ""]
  84. $talents[1][8][9][1] = [2, "", nil, ""]
  85. $talents[1][8][9][2] = [3, "", nil, ""]
  86. $talents[1][9][9][0] = [1, "", nil, ""]


  87.                         #天赋等级与效果和技能点的耗费$talents[职业ID][9][天赋等级] = [耗费技能点, "效果", nil, ""]
  88.                
  89.                        
  90. $talents[1][7][9][0] = [1, "", nil, ""]
  91. $talents[1][7][9][1] = [2, "", nil, ""]

  92. $talents[1][8][9][0] = [1, "", nil, ""]
  93. $talents[1][8][9][0] = [1, "", nil, ""]
  94. $talents[1][9][9][0] = [1, "", nil, ""]
  95. $talents[1][9][9][0] = [1, "", nil, ""]
  96. $talents[1][9][9][1] = [2, "", nil, ""]


  97.         #天赋等级与效果和技能点的耗费$talents[天赋ID][9][天赋等级] = [耗费技能点, "效果", nil, ""]

  98.                         #天赋等级与效果和技能点的耗费$talents[职业ID][9][天赋等级] = [耗费技能点, "效果", nil, ""]
  99.                        
  100.                         #$talents[职业ID][天赋ID][9][天赋等级] = [耗费技能点, "描述", nil, ""]
  101.                
  102.       #save_data($talents, "Talents.rxdata")
  103.       
  104. #===============================================================================
  105. =begin
  106. 天赋效果000

  107. 格式:
  108. 作用于人物:
  109. $talents_2[天赋的ID] = [0]
  110. $talents_2[天赋的ID][天赋等级] = [MAXHP百分比,MAXSP百分比,力量百分比,灵巧百分比,速度百分比,魔力百分比,物防百分比,魔方百分比,回避百分比,攻击力百分比, 命中率百分比,
  111.                                   MAXHP增加值,MAXSP增加值,力量增加值,灵巧增加值,速度增加值,魔力增加值,物防增加值,魔方增加值,回避增加值, 攻击力增加值, 命中率增加值]
  112. 或:
  113. $talents_2[天赋的ID] = [0]
  114. $talents_2[天赋的ID][天赋等级] = []
  115. $talents_2[天赋的ID][天赋等级][效果序号] = 你要的效果

  116. 序号:
  117.     0:MAXHP百分比
  118.     1:MAXSP百分比
  119.     2:力量百分比
  120.     3:灵巧百分比
  121.     4:速度百分比
  122.     5:魔力百分比
  123.     6:物防百分比
  124.     7:魔防百分比
  125.     8:回避百分比
  126.     9:攻击力百分比
  127.     10:命中率百分比
  128.     11:MAXHP增加值
  129.     12:MAXSP增加值
  130.     13:力量增加值
  131.     14:灵巧增加值
  132.     15:速度增加值
  133.     16:魔力增加值
  134.     17:物防增加值
  135.     18:魔防增加值
  136.     19:回避增加值
  137.     20:攻击力增加值
  138.     21:命中率增加值
  139. 如:

  140. 41号技能作用于自身
  141. $talents_2[41] = [0]

  142. 41号等级为1时
  143. 格式
  144. $talents_2[41][1] = []
  145. 自身MAXHP * 1.2
  146. $talents_2[41][1][0] = 120
  147. 自身MAXSP * 1.4
  148. $talents_2[41][1][1] = 140
  149. 自身命中率 + 5%
  150. $talents_2[41][1][21] = 5

  151. 41号等级为1时
  152. 格式
  153. $talents_2[41][2] = []
  154. 自身MAXHP * 1.4
  155. $talents_2[41][2][0] = 140
  156. 自身MAXSP * 1.6
  157. $talents_2[41][2][1] = 160
  158. 自身命中率 + 10%
  159. $talents_2[41][2][21] = 10

  160. -------------------------------------------------------------
  161. 作用于技能
  162. $talents_2[天赋的ID] = [1]
  163. $talents_2[天赋的ID][天赋等级] = [学会的技能ID,作用的技能ID,消费SP百分比,威力百分比,命中率百分比,消费SP减少值,威力增加值,命中率增加值]


  164. $talents_2[天赋的ID] = [1]
  165. $talents_2[天赋的ID][天赋等级] = []
  166. $talents_2[天赋的ID][天赋等级][效果序号] = 你要的效果
  167. 序号:
  168.     0:学会的技能ID
  169.     1:作用的技能ID   #注意:这一项统领下面6项!不可缺少!!!!!
  170.     2:消费SP百分比
  171.     3:威力百分比
  172.     4:命中率百分比
  173.     5:消费SP减少值
  174.     6:威力增加值
  175.     7:命中率增加值
  176.    

  177. 不需要的项设为nil,也可不设

  178. 请按需要自行追加

  179. =end
  180. #-------------不可删--------------
  181. $talents_2 = []
  182. for i in 0..999
  183.   $talents_2[i] = [nil]
  184. end
  185. #---------------------------------
  186. #-------------测试档--------------
  187. $talents_2[373] = [1]
  188. $talents_2[373][1] = []
  189. $talents_2[373][1][0] = 4
  190. $talents_2[373][2] = []
  191. $talents_2[373][2][1] = 4
  192. for i in 2..4
  193. $talents_2[373][2][i] = 200
  194. end
  195. $talents_2[373][3] = []
  196. $talents_2[373][3][1] = 4
  197. for i in 2..4
  198. $talents_2[373][3][i + 3] = 200
  199. end
  200. #---------------------------------
  201. #===============================================================================

  202. #天赋窗口的底图,将直接对应到'Graphics\WOW2'下
  203. #注意!职业不可变,暂不支持变更职业!
  204. #格式:$backgenius[] = ["","",""]
  205. $backgenius = {}
  206. #德鲁伊
  207. $backgenius[1] = ["jiuyinzhenjing","talent_druidferalcombat_r1","talent_druidrestoration_r1"]
  208. #猎人
  209. $backgenius[2] = ["talent_hunterbeastmastery_r1","talent_huntermarksmanship_r1","talent_huntersurvival_r1"]
  210. #法师
  211. $backgenius[3] = ["talent_magearcane_r1","talent_magefrost_r1","talent_magefire_r1"]
  212. #圣骑士
  213. $backgenius[4] = ["talent_paladinholy_r1","talent_paladinprotection_r1","talent_paladinretribution_r1"]
  214. #牧师
  215. $backgenius[5] = ["talent_priestdiscipline_r1","talent_priestholy_r1","talent_priestshadow_r1"]
  216. #盗贼
  217. $backgenius[6] = ["talent_rogueassassination_r1","talent_roguecombat_r1","talent_roguesubtlety_r1"]
  218. #萨满
  219. $backgenius[7] = ["talent_shamanelementalcombat_r1","talent_shamanenhancement_r1","talent_shamanrestoration_r1"]
  220. #术士
  221. $backgenius[8] = ["talent_warlockaffliction_r1","talent_warlockdemonology_r1","talent_warlockdestruction_r1"]
  222. #战士
  223. $backgenius[9] = ["talent_warriorarms_r1", "talent_warriorfury_r1", "talent_warriorprotection_r1"]



  224. #====================================Part2======================================
  225. #==============================================================================
  226. # ■ Genius_Restart
  227. #------------------------------------------------------------------------------
  228. #  洗点
  229. #==============================================================================

  230. class Genius_Restart
  231.   def initialize(actor_a)
  232.     actor_b = []
  233.     if actor_a == "all"
  234.       for actor in $game_party.actors
  235.         actor_b.push(actor)
  236.       end
  237.     else
  238.       actor_b.push(actor_a)
  239.     end
  240.     for actor in actor_b
  241.       $Genius_rs_x[actor.id] += 1
  242.       $Genius_Point[actor.id][0] = $Genius_Point[actor.id][1]
  243.       $Genius_Point_note_1[actor.id] = {}
  244.       $Genius_Point_note_2[actor.id] = {}
  245.       $talents_3[actor.id] = [100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100]
  246.       $talents_4[actor.id] = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]
  247.       $talents_5[actor.id] = []
  248.       $talents_6[actor.id] = []
  249.       for i_X in 1..$data_skills.size - 1
  250.       $talents_5[actor.id][i_X] = [100,100,100]
  251.       $talents_6[actor.id][i_X] = [0,0,0]
  252.       end
  253.       $Genius_Point_note_3[actor.id] = [0,0,0]
  254.     end
  255.   end
  256. end
  257. #==============================================================================
  258. # ■ Game_Genius
  259. #------------------------------------------------------------------------------
  260. #  天赋加点 效果处理
  261. #==============================================================================
  262. #Game_Genius.new(actor)
  263. class Game_Genius
  264.   #attr_accessor :g
  265.   #--------------------------------------------------------------------------
  266.   # ● 初始化对像
  267.   #--------------------------------------------------------------------------
  268.   def initialize(actor)
  269.     #防错
  270.     if actor != nil
  271.     #初始化技能效果
  272.     $talents_3[actor.id] = [100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100]
  273.     $talents_4[actor.id] = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]
  274.       $talents_5[actor.id] = []
  275.       $talents_6[actor.id] = []
  276.       for i_X in 1..$data_skills.size - 1
  277.       $talents_5[actor.id][i_X] = [100,100,100]
  278.       $talents_6[actor.id][i_X] = [0,0,0]
  279.       end
  280.     if $Genius_Point_note_1[actor.id] != nil
  281.       for g in $Genius_Point_note_1[actor.id]
  282.         #获取天赋等级
  283.         if g[1] >0
  284.           #获取天赋ID
  285.           i_a = $talents[actor.class_id].index(g[0])
  286.           #获取天赋效果
  287.           i = $talents_2[i_a]
  288.           case i[0]
  289.           when 0
  290.             #扩充天赋效果请注意"a"
  291.             if i[g[1]] != nil
  292.               for a in 0..10
  293.                 if i[g[1]][a] != nil
  294.                   if $talents_3[actor.id][a] == nil
  295.                      $talents_3[actor.id][a] = 100
  296.                   end
  297.                   $talents_3[actor.id][a] *= i[g[1]][a]
  298.                   $talents_3[actor.id][a] /= 100
  299.                 end
  300.                 if i[g[1]][a + 11] != nil
  301.                   if $talents_4[actor.id][a] == nil
  302.                      $talents_4[actor.id][a] = 0
  303.                   end
  304.                   $talents_4[actor.id][a] += i[g[1]][a + 11]
  305.                 end
  306.               end
  307.             end
  308.           when 1
  309.             #学会技能判断
  310.             if i[g[1]][0] != nil
  311.               skill_id = i[g[1]][0]
  312.               if !actor.skill_learn?(skill_id)
  313.                 actor.learn_skill(skill_id)
  314.               end
  315.             end
  316.             skill_id_2 = i[g[1]][1]
  317.             #扩充天赋效果请注意"a"
  318.             if skill_id_2 != nil
  319.               for a in 0..2
  320.                 if i[g[1]][a + 2] != nil
  321.                   if $talents_5[actor.id][skill_id_2][a] == nil
  322.                      $talents_5[actor.id][skill_id_2][a] = 100
  323.                   end
  324.                   $talents_5[actor.id][skill_id_2][a] *= i[g[1]][a + 2]
  325.                   $talents_5[actor.id][skill_id_2][a] /= 100
  326.                 end
  327.                 if i[g[1]][a + 5] != nil
  328.                   if $talents_6[actor.id][skill_id_2][a] == nil
  329.                      $talents_6[actor.id][skill_id_2][a] = 0
  330.                   end
  331.                   $talents_6[actor.id][skill_id_2][a] += i[g[1]][a + 5]
  332.                 end
  333.               end
  334.             end
  335.           else
  336.             next
  337.           end
  338.         end
  339.       end  
  340.     end
  341.     end
  342.   end
  343. end
  344. #==============================================================================
  345. # ■ Window_Selectable_Genius
  346. #------------------------------------------------------------------------------
  347. #  W_Genius的父类。
  348. #==============================================================================

  349. class Window_Selectable_Genius < Window_Base
  350.   #--------------------------------------------------------------------------
  351.   # ● 定义实例变量
  352.   #--------------------------------------------------------------------------
  353.   attr_reader   :x_index                  # 光标位置x(不是具体坐标值)
  354.   attr_reader   :y_index                  # 光标位置y(不是具体坐标值)
  355.   attr_reader   :help_window              # 帮助窗口
  356.   #--------------------------------------------------------------------------
  357.   # ● 初始画对像
  358.   #     x      : 窗口的 X 坐标
  359.   #     y      : 窗口的 Y 坐标
  360.   #     width  : 窗口的宽
  361.   #     height : 窗口的高
  362.   #--------------------------------------------------------------------------
  363.   def initialize(x, y, width, height)
  364.     super(x, y, width, height)
  365.     @x_index = 1
  366.     @y_index = 1
  367.     @x_index_max = 4
  368.     @y_index_max = 7
  369.     @x0 = 35
  370.     @y0 = 5
  371.     @cursor_width = 50
  372.     @cursor_height = 50
  373.     @cursor_width_2 = 66
  374.     @cursor_height_2 = 63
  375.     @item_max = 1
  376.     @column_max = 1
  377.     @index = -1
  378.   end
  379.   #--------------------------------------------------------------------------
  380.   # ● 设置光标的位置
  381.   #     x_index : 新的光标位置的X值
  382.   #--------------------------------------------------------------------------
  383.   def x_index=(x_index)
  384.     @x_index = x_index
  385.     # 刷新帮助文本 (update_help 定义了继承目标)
  386.     if self.active and @help_window != nil
  387.       update_help
  388.     end
  389.     # 刷新光标矩形
  390.     update_cursor_rect
  391.   end
  392.   #--------------------------------------------------------------------------
  393.   # ● 设置光标的位置
  394.   #     y_index : 新的光标位置的Y值
  395.   #--------------------------------------------------------------------------
  396.   def y_index=(y_index)
  397.     @y_index = y_index
  398.     # 刷新帮助文本 (update_help 定义了继承目标)
  399.     if self.active and @help_window != nil
  400.       update_help
  401.     end
  402.     # 刷新光标矩形
  403.     update_cursor_rect
  404.   end
  405.   #--------------------------------------------------------------------------
  406.   # ● 更新光标举行
  407.   #--------------------------------------------------------------------------
  408.   def update_cursor_rect
  409.     # 光标位置不满 0 的情况下
  410.     if @x_index < 0 or @y_index < 0
  411.       self.cursor_rect.empty
  412.       return
  413.     end
  414.     x = @x0 + (@x_index - 1) * @cursor_width_2
  415.     y = @y0 + (@y_index - 1) * @cursor_height_2
  416.     # 更新国标矩形
  417.     self.cursor_rect.set(x, y, @cursor_width, @cursor_height)
  418.   end
  419.   #--------------------------------------------------------------------------
  420.   # ● 帮助窗口的设置
  421.   #     help_window : 新的帮助窗口
  422.   #--------------------------------------------------------------------------
  423.   def help_window=(help_window)
  424.     @help_window = help_window
  425.     # 刷新帮助文本 (update_help 定义了继承目标)
  426.     if self.active and @help_window != nil
  427.       update_help
  428.     end
  429.   end
  430.   #--------------------------------------------------------------------------
  431.   # ● 刷新画面
  432.   #--------------------------------------------------------------------------
  433.   def update
  434.     super
  435.     # 可以移动光标的情况下
  436.     if self.active
  437.       # 方向键下被按下的情况下
  438.       if Input.repeat?(Input::DOWN)
  439.         if @y_index_max > @y_index
  440.           # 光标向下移动
  441.           $game_system.se_play($data_system.cursor_se)
  442.           @y_index += 1
  443.         end
  444.       end
  445.       # 方向键上被按下的情况下
  446.       if Input.repeat?(Input::UP)
  447.         if @y_index > 1
  448.           # 光标向上移动
  449.           $game_system.se_play($data_system.cursor_se)
  450.           @y_index -= 1
  451.         end
  452.       end
  453.       # 方向键右被按下的情况下
  454.       if Input.repeat?(Input::RIGHT)
  455.         if @x_index < @x_index_max
  456.           # 光标向右移动
  457.           $game_system.se_play($data_system.cursor_se)
  458.           @x_index += 1
  459.         end
  460.       end
  461.       # 方向键左被按下的情况下
  462.       if Input.repeat?(Input::LEFT)
  463.         if @x_index > 1
  464.           # 光标向左移动
  465.           $game_system.se_play($data_system.cursor_se)
  466.           @x_index -= 1
  467.         end
  468.       end
  469.     end
  470.     # 刷新帮助文本 (update_help 定义了继承目标)
  471.     if self.active and @help_window != nil
  472.       update_help
  473.     end
  474.     # 刷新光标矩形
  475.     update_cursor_rect
  476.   end
  477. end
  478. #==============================================================================
  479. # ■ Window_Genius
  480. #------------------------------------------------------------------------------
  481. #  天赋加点 窗口
  482. #==============================================================================

  483. class Window_Genius < Window_Selectable_Genius
  484.   #--------------------------------------------------------------------------
  485.   # ● 初始化窗口
  486.   #--------------------------------------------------------------------------
  487.   def initialize(x, y, width, height)
  488.     super(x, y, width, height)
  489.     self.contents = Bitmap.new(width - 32, height - 32)
  490.     self.back_opacity = 0
  491.     refresh
  492.   end
  493.   #--------------------------------------------------------------------------
  494.   # ● 刷新
  495.   #--------------------------------------------------------------------------
  496.   def refresh
  497.     #p [@a,@b,@c]
  498.     self.contents.clear
  499.     j = $talents[$scene.actor.class_id]
  500.     for i in j
  501.       if i != nil
  502.         if $Genius_Point_note_1[$scene.actor.id][i] == nil
  503.           $Genius_Point_note_1[$scene.actor.id][i] = 0
  504.         end
  505.         if i[1] == ($scene.list_window.index + 1)
  506.           text = $Genius_Point_note_1[$scene.actor.id][i]
  507.           x = 35 + 38 + (i[4] - 1) * 66
  508.           y = 5 + 35 + (i[3] - 1) * 63
  509.           if text == i[9].size
  510.             self.contents.font.color = text_color(0)
  511.           else
  512.             self.contents.font.color = text_color(3)
  513.           end
  514.           if i[10].size != 0
  515.             g_r = $Genius_Point_note_1[$scene.actor.id][$talents[$scene.actor.class_id][i[10][0]]]
  516.             if i[10][1] > g_r
  517.               self.contents.font.color = text_color(2)
  518.             end
  519.           end
  520.           if $Genius_Point_note_3[$scene.actor.id][i[1] - 1] < (i[3] - 1) * 3
  521.             self.contents.font.color = text_color(2)
  522.           end
  523.           text = text.to_s
  524.           self.contents.draw_text(x, y, 20, 20,text)
  525.         end
  526.       end
  527.     end
  528.   end
  529. end
  530. #==============================================================================
  531. # ■ Window_Genius_Base
  532. #------------------------------------------------------------------------------
  533. #  天赋加点 窗口 背景
  534. #   应该改为Window_Genius_Back,懒得改了
  535. #==============================================================================

  536. class Window_Genius_Base < Window_Base
  537. #--------------------------------------------------------------------------
  538. # ● 初始化窗口
  539. #--------------------------------------------------------------------------
  540. def initialize
  541.    super(296,0,344,480)
  542.    self.contents = Bitmap.new(width - 32, height - 32)
  543.    refresh
  544. end
  545. #--------------------------------------------------------------------------
  546. # ● 刷新
  547. #--------------------------------------------------------------------------
  548. def refresh
  549. end
  550. #--------------------------------------------------------------------------
  551. # ● 刷新
  552. #--------------------------------------------------------------------------
  553. def refresh_db(filename)
  554.    self.contents.clear
  555.    bitmap = Bitmap.new("Graphics/武功系统2/#{filename}")
  556.    cw = bitmap.width
  557.    ch = bitmap.height
  558.    src_rect = Rect.new(0, 0, cw, ch)
  559.    self.contents.blt( 0, 0, bitmap, src_rect)
  560. end
  561. end
  562. #==============================================================================
  563. # ■ Window_Genius_Info
  564. #------------------------------------------------------------------------------
  565. #  天赋加点 天赋介绍
  566. #==============================================================================

  567. class Window_Genius_Info < Window_Base
  568.   #--------------------------------------------------------------------------
  569.   # ● 初始化窗口
  570.   #--------------------------------------------------------------------------
  571.   def initialize(y, h)
  572.     super(0, y, 296, h)
  573.     self.contents = Bitmap.new(width - 32, height - 32)
  574.     refresh
  575.   end
  576.   #--------------------------------------------------------------------------
  577.   # ● 刷新
  578.   #--------------------------------------------------------------------------
  579.   def refresh
  580.     self.contents.clear
  581.   end
  582.   #--------------------------------------------------------------------------
  583.   # ● 刷新帮助文本
  584.   #--------------------------------------------------------------------------
  585.   def update_info(g)
  586.     self.contents.clear
  587.     if g != nil
  588.       x = 0
  589.       y = 0
  590.       text_a = g[0].to_s
  591.       text_b = text_a.split(/@/)[0]
  592.       self.contents.draw_text(x, y, 255, 32, text_b,1)
  593.       text_c = text_a.split(/@/)[1]

  594.       if g[8] == nil
  595.         text_d = ""
  596.         text_e = ""
  597.       else
  598.         text_d = g[8].split(/@/)[0] != nil ? g[8].split(/@/)[0] : ""
  599.         text_e = g[8].split(/@/)[1] != nil ? g[8].split(/@/)[1] : ""
  600.       end
  601.       k = $Genius_Point_note_1[$scene.actor.id][g]
  602.       if k > 0
  603.         k -= 1
  604.       else
  605.         k = 0
  606.       end
  607.       text_f = g[9][k][3] != "" ? g[9][k][3] : g[9][k][1]
  608.       text_y = text_d.to_s + text_f.to_s + text_e.to_s
  609.       text_x = [""]
  610.       while ((c = text_y.slice!(/./m)) != nil)
  611.         text_x[text_x.length - 1] += c.to_s
  612.         if text_x[text_x.length - 1].size >= 36
  613.           self.contents.draw_text(x, y + 64 + text_x.length * 32, 264 * text_x[text_x.length - 1].size / 36, 32, text_x[text_x.length - 1],0)
  614.           text_x[text_x.length] = ""
  615.         end
  616.       end
  617.       self.contents.draw_text(x, y + 64 + text_x.length * 32, 264 * text_x[text_x.length - 1].size / 36, 32, text_x[text_x.length - 1],0)
  618.     end
  619.   end
  620. end
  621. #==============================================================================
  622. # ■ Window_Genius_Info_Back
  623. #------------------------------------------------------------------------------
  624. #  天赋加点 天赋介绍
  625. #==============================================================================

  626. class Window_Genius_Info_Back < Window_Base
  627.   #--------------------------------------------------------------------------
  628.   # ● 初始化窗口
  629.   #--------------------------------------------------------------------------
  630.   def initialize(y, h)
  631.     super(0, y, 296, h)
  632.     self.contents = Bitmap.new(width - 32, height - 32)
  633.     self.contents.clear
  634.   end
  635.   #--------------------------------------------------------------------------
  636.   # ● 刷新角色战斗图
  637.   #--------------------------------------------------------------------------
  638.   def update_actor(a)
  639.     b = RPG::Cache.battler(a.battler_name, a.battler_hue)
  640.     src_rect = Rect.new(0, 0, b.width, b.height)
  641.     self.contents.blt((self.contents.width - b.width)/2, (self.contents.height - b.height)/2, b, src_rect, 100)
  642.   end
  643. end
  644. #==============================================================================
  645. # ■ Window_Actor
  646. #------------------------------------------------------------------------------
  647. #  天赋加点左上第二个
  648. #==============================================================================

  649. class Window_Actor < Window_Base
  650. attr_accessor :actor
  651. attr_accessor :actor_old
  652. attr_accessor :point_old
  653. #--------------------------------------------------------------------------
  654. # ● 初始化窗口
  655. #--------------------------------------------------------------------------
  656. def initialize(h, actor)
  657.    @actor = actor
  658.    super(140,0,156,h)
  659.    self.contents = Bitmap.new(width - 32, height - 32)
  660.    refresh
  661. end
  662. #--------------------------------------------------------------------------
  663. # ● 刷新
  664. #--------------------------------------------------------------------------
  665. def refresh
  666.    if @actor_old !=  @actor or $Genius_Point[@actor.id][0] != @point_old
  667.      @actor_old = @actor
  668.      @point_old = $Genius_Point[@actor.id][0]
  669.      self.contents.clear
  670.      x = 0
  671.      y = 0
  672.      self.contents.draw_text(x+10, y, 120, 30, @actor.name)
  673.      y += 30
  674.      self.contents.draw_text(x+10, y, 140, 30, "修为点")
  675.      y += 30
  676.      text = "点数:" + $Genius_Point[@actor.id][0].to_s + "点"
  677.      self.contents.draw_text(x+10, y, 80, 30, text)
  678.    end
  679. end
  680. end
  681. #==============================================================================
  682. # ■ Scene_Genius
  683. #------------------------------------------------------------------------------
  684. #  天赋加点 画面
  685. #==============================================================================
  686. class Scene_Genius
  687.   attr_accessor :list_window
  688.   attr_accessor :content_window
  689.   attr_accessor :actor
  690.   attr_accessor :genius_on_elect
  691.   #--------------------------------------------------------------------------
  692.   #   actor_index :角色编号
  693.   #--------------------------------------------------------------------------
  694.   def initialize(actor_index = 0, equip_index = 0)
  695. #    p $Genius_Point[$game_party.actors[actor_index].id]
  696.     @actor_index = actor_index
  697.     @genius_on_elect = nil
  698.   end
  699. #------------------------------------------------------------
  700. # 主循环
  701. #------------------------------------------------------------
  702. def main
  703.    @actor = $game_party.actors[@actor_index]
  704.    command = self.command_set
  705.    #选择窗口
  706.    @list_window = Window_Command.new(140,command)
  707.    @list_window.active = true
  708.    #信息窗口
  709.     @info_window = Window_Genius_Info.new(@list_window.height, 480 - @list_window.height)
  710.     @info_window.back_opacity = 0
  711.     @info_window_back = Window_Genius_Info_Back.new(@list_window.height, 480 - @list_window.height)
  712.     @info_window_back.update_actor(@actor)
  713.     @info_window_back.z = @info_window.z - 100
  714.    #前景窗口
  715.    @content_window = Window_Genius.new(296,0,344,480)
  716.    @content_window.active = false
  717.    @content_window.cursor_rect.empty
  718.    @content_window.x_index = -1
  719.    @content_window.y_index = -1
  720.    @content_window.refresh
  721.    #@content_window.help_window = @help_window
  722.    #背景窗口
  723.    @content_window_base = Window_Genius_Base.new
  724.    @content_window_base.z = @content_window.z - 100
  725.    @content_window_base.refresh_db($backgenius[@actor.class_id][0])
  726.    
  727.    #角色窗口
  728.    @actor_window = Window_Actor.new(@list_window.height, @actor)
  729.    # 执行过渡(格式,不用管)
  730.    Graphics.transition
  731.    # 主循环(格式,不用管)
  732.    loop do
  733.      # 刷新游戏画面(格式,不用管)
  734.      Graphics.update
  735.      # 刷新键盘按键的情报(格式,不用管)
  736.      Input.update
  737.      
  738.      
  739.      # 刷新内容
  740.      update
  741.      
  742.      
  743.      # 如果画面被切换的话就中断循环(格式,不用管)
  744.      if $scene != self
  745.        break
  746.      end
  747.    end
  748.    # 过渡(格式,不用管)
  749.    Graphics.freeze   
  750.    # 释放内存
  751.    @list_window.dispose
  752.    @content_window.dispose
  753.    @content_window_base.dispose
  754.    @actor_window.dispose
  755.    @info_window.dispose
  756.    @info_window_back.dispose
  757. #  @help_window.dispose
  758. end
  759. #------------------------------------------
  760. # 天赋类别选项
  761. #------------------------------------------   
  762. def command_set
  763.     case @actor.class_id
  764.    when 1
  765.     return ["九阴真经","易筋经", "降龙十八掌"]


  766.    end
  767. end
  768. #---------------
  769. # 刷新
  770. #---------------  
  771. def update
  772.    # 光标控制功能
  773.    @list_window.update
  774.    @content_window.update
  775.    @actor_window.refresh
  776.    
  777.    # 指令窗口激活的情况下: 调用 update_list
  778.    if @list_window.active
  779.      update_list
  780.      return
  781.    end
  782.    # 指令窗口激活的情况下: 调用 update_content
  783.    if @content_window.active
  784.      update_content
  785.      return
  786.    end
  787. end
  788. #-------------------------------------------
  789. # 刷新画面 (指令窗口激活的情况下)
  790. #-------------------------------------------
  791. def update_list
  792.     if Input.trigger?(Input::B)
  793.       $game_system.se_play($data_system.cancel_se)
  794.       $scene = Scene_Map.new
  795.       return
  796.     end
  797.     if Input.trigger?(Input::R)
  798.       $game_system.se_play($data_system.cursor_se)
  799.       @actor_index += 1
  800.       @actor_index %= $game_party.actors.size
  801.       $scene = Scene_Genius.new(@actor_index)
  802.       return
  803.     end
  804.     if Input.trigger?(Input::L)
  805.       $game_system.se_play($data_system.cursor_se)
  806.       @actor_index += $game_party.actors.size - 1
  807.       @actor_index %= $game_party.actors.size
  808.       $scene = Scene_Genius.new(@actor_index)
  809.       return
  810.     end
  811.     if Input.trigger?(Input::DOWN) or Input.trigger?(Input::UP)
  812.       $game_system.se_play($data_system.cursor_se)
  813.       @actor_genius_class = @list_window.index
  814.       @content_window_base.refresh_db($backgenius[@actor.class_id][@actor_genius_class])
  815.       @content_window.refresh
  816.       return
  817.     end
  818.    # 如果按下C的时候
  819.    if Input.trigger?(Input::C)
  820.      # 播放“嘟”的一声
  821.      $game_system.se_play($data_system.decision_se)
  822.      @list_window.active = false
  823.      @content_window.active = true
  824.      @content_window.x_index = 1
  825.      @content_window.y_index = 1
  826.      # 完毕
  827.      return
  828.    end
  829. end
  830. #-------------------------------------------
  831. # 刷新画面 (天赋窗口激活的情况下)
  832. #-------------------------------------------
  833. def update_content
  834.    genius_elect
  835.    @info_window.update_info(@genius_on_elect)
  836.    # 如果按下ESC的时候
  837.    if Input.trigger?(Input::B)
  838.      # 播放“嘟”的一声
  839.      $game_system.se_play($data_system.cancel_se)
  840.        #返回选择窗口
  841.        @list_window.active = true
  842.        @content_window.active = false
  843.        @content_window.x_index = -1
  844.        @content_window.y_index = -1
  845.      # 完毕
  846.      return
  847.    end
  848.    
  849.    # 如果按下C的时候
  850.    if Input.trigger?(Input::C)
  851.      if genius_up?
  852.        #效果应用
  853.       Game_Genius.new(@actor)
  854.      # 播放“嘟”的一声
  855.        $game_system.se_play($data_system.decision_se)
  856.        @info_window.update_info(@genius_on_elect)
  857.        @content_window.refresh
  858.      else
  859.      # 播放“嘟”的一声
  860.        $game_system.se_play($data_system.cancel_se)
  861.      end
  862.      # 完毕
  863.      return
  864.    end
  865. end
  866. #-------------------------------------------
  867. # 天赋增加
  868. #-------------------------------------------
  869.   def genius_up?
  870.     g = @genius_on_elect
  871.     if g == nil
  872.       return false
  873.     end
  874.     if $Genius_Point_note_1[@actor.id][g] == nil
  875.       $Genius_Point_note_1[@actor.id][g] = 10
  876.     end
  877.     if $Genius_Point[@actor.id][0] < 1
  878.       return false
  879.     end
  880.     if $Genius_Point_note_3[@actor.id][g[1] - 1] < (g[3] - 1) * 3
  881.       return false
  882.     end
  883.     if $Genius_Point_note_1[@actor.id][g] == g[9].size
  884.       return false
  885.     end
  886.     if g[10][0] != nil
  887.       g_r = $Genius_Point_note_1[@actor.id][$talents[@actor.class_id][g[10][0]]]
  888.       if g_r == nil
  889.         return false
  890.       end
  891.       if g_r < g[10][1]
  892.         return false
  893.       end
  894.     end
  895.     $Genius_Point_note_1[@actor.id][g] += 1
  896.     $Genius_Point_note_2[@actor.id][$Genius_Point_note_2[@actor.id].length] = $talents[@actor.class_id].index(g)
  897.     $Genius_Point_note_3[@actor.id][g[1] - 1] += 1
  898. #    p $Genius_Point_note_3[@actor.id][g[1] - 1]
  899. #    p $talents[@actor.class_id].index(g)
  900.     $Genius_Point[@actor.id][0] -= 1
  901.   end
  902. #-------------------------------------------
  903. # 光标选中的天赋
  904. #-------------------------------------------
  905.   def genius_elect
  906.     j = $talents[@actor.class_id]
  907.     s_k = false
  908.     for i in j
  909.       if i != nil
  910.         if i[1] == (@list_window.index + 1)
  911.           x = i[4] == @content_window.x_index
  912.           y = i[3] == @content_window.y_index
  913.           if x and y
  914.             @genius_on_elect = i
  915.             s_k = true
  916.             break
  917.           end
  918.         end
  919.       end
  920.     end
  921.     if !s_k
  922.       @genius_on_elect = nil
  923.     end
  924.   end
  925. end


  926. #====================================Part3======================================
  927. #==============================================================================
  928. # ■ Game_Battler
  929. #------------------------------------------------------------------------------
  930. #  7处修改
  931. #==============================================================================

  932. class Game_Battler
  933.   #--------------------------------------------------------------------------
  934.   # ● 获取命中率
  935.   #--------------------------------------------------------------------------
  936.   def hit
  937.     n = 100
  938.     for i in @states
  939.       n *= $data_states[i].hit_rate / 100.0
  940.     end
  941.     #====================修改========================
  942.     n *= $talents_3[self.id][10] / 100
  943.     n += $talents_4[self.id][10]
  944.     #================================================
  945.     return Integer(n)
  946.   end

  947.   #--------------------------------------------------------------------------
  948.   # ● 可以使用特技的判定
  949.   #     skill_id : 特技 ID
  950.   #--------------------------------------------------------------------------
  951.   def skill_can_use?(skill_id)
  952.     # SP 不足的情况下不能使用
  953.     #====================修改========================
  954.     sp_cost = $data_skills[skill_id].sp_cost * $talents_5[self.id][skill_id][0] / 100
  955.     sp_cost -= $talents_6[self.id][skill_id][0]
  956.     if sp_cost > self.sp
  957.       return false
  958.     end
  959.     #================================================
  960.     # 战斗不能的情况下不能使用
  961.     if dead?
  962.       return false
  963.     end
  964.     # 沉默状态的情况下、物理特技以外的特技不能使用
  965.     if $data_skills[skill_id].atk_f == 0 and self.restriction == 1
  966.       return false
  967.     end
  968.     # 获取可以使用的时机
  969.     occasion = $data_skills[skill_id].occasion
  970.     # 战斗中的情况下
  971.     if $game_temp.in_battle
  972.       # [平时] 或者是 [战斗中] 可以使用
  973.       return (occasion == 0 or occasion == 1)
  974.     # 不是战斗中的情况下
  975.     else
  976.       # [平时] 或者是 [菜单中] 可以使用
  977.       return (occasion == 0 or occasion == 2)
  978.     end
  979.   end
  980.   #--------------------------------------------------------------------------
  981.   # ● 应用特技效果
  982.   #     user  : 特技的使用者 (battler)
  983.   #     skill : 特技
  984.   #--------------------------------------------------------------------------
  985.   def skill_effect(user, skill)
  986.     #=======================修改==============================
  987.     if user.is_a?(Game_Actor)
  988.       skill_power = skill.power * $talents_5[user.id][skill.id][1] / 100
  989.       skill_power += $talents_6[user.id][skill.id][1]
  990.       skill_hit = skill.hit * $talents_5[user.id][skill.id][20] / 100
  991.       skill_hit += $talents_6[user.id][skill.id][2]
  992.     else
  993.       skill_power = skill.power
  994.       skill_hit = skill.hit
  995.     end
  996.     #=========================================================
  997.     # 清除会心一击标志
  998.     self.critical = false
  999.     # 特技的效果范围是 HP 1 以上的己方、自己的 HP 为 0、
  1000.     # 或者特技的效果范围是 HP 0 的己方、自己的 HP 为 1 以上的情况下
  1001.     if ((skill.scope == 3 or skill.scope == 4) and self.hp == 0) or
  1002.        ((skill.scope == 5 or skill.scope == 6) and self.hp >= 1)
  1003.       # 过程结束
  1004.       return false
  1005.     end
  1006.     # 清除有效标志
  1007.     effective = false
  1008.     # 公共事件 ID 是有效的情况下,设置为有效标志
  1009.     effective |= skill.common_event_id > 0
  1010.     # 第一命中判定
  1011.     #========================修改=============================
  1012.     hit = skill_hit
  1013.     #=========================================================
  1014.     if skill.atk_f > 0
  1015.       hit *= user.hit / 100
  1016.     end
  1017.     hit_result = (rand(100) < hit)
  1018.     # 不确定的特技的情况下设置为有效标志
  1019.     effective |= hit < 100
  1020.     # 命中的情况下
  1021.     if hit_result == true
  1022.       # 计算威力
  1023.       #=====================修改================================
  1024.       power = skill_power + user.atk * skill.atk_f / 100
  1025.       #=========================================================
  1026.       if power > 0
  1027.         power -= self.pdef * skill.pdef_f / 200
  1028.         power -= self.mdef * skill.mdef_f / 200
  1029.         power = [power, 0].max
  1030.       end
  1031.       # 计算倍率
  1032.       rate = 20
  1033.       rate += (user.str * skill.str_f / 100)
  1034.       rate += (user.dex * skill.dex_f / 100)
  1035.       rate += (user.agi * skill.agi_f / 100)
  1036.       rate += (user.int * skill.int_f / 100)
  1037.       # 计算基本伤害
  1038.       self.damage = power * rate / 20
  1039.       # 属性修正
  1040.       self.damage *= elements_correct(skill.element_set)
  1041.       self.damage /= 100
  1042.       # 伤害符号正确的情况下
  1043.       if self.damage > 0
  1044.         # 防御修正
  1045.         if self.guarding?
  1046.           self.damage /= 2
  1047.         end
  1048.       end
  1049.       # 分散
  1050.       if skill.variance > 0 and self.damage.abs > 0
  1051.         amp = [self.damage.abs * skill.variance / 100, 1].max
  1052.         self.damage += rand(amp+1) + rand(amp+1) - amp
  1053.       end
  1054.       # 第二命中判定
  1055.       eva = 8 * self.agi / user.dex + self.eva
  1056.       hit = self.damage < 0 ? 100 : 100 - eva * skill.eva_f / 100
  1057.       hit = self.cant_evade? ? 100 : hit
  1058.       hit_result = (rand(100) < hit)
  1059.       # 不确定的特技的情况下设置为有效标志
  1060.       effective |= hit < 100
  1061.     end
  1062.     # 命中的情况下
  1063.     if hit_result == true
  1064.       # 威力 0 以外的物理攻击的情况下
  1065.       #======================修改===============================
  1066.       if skill_power != 0 and skill.atk_f > 0
  1067.       #=========================================================
  1068.         # 状态冲击解除
  1069.         remove_states_shock
  1070.         # 设置有效标志
  1071.         effective = true
  1072.       end
  1073.       # HP 的伤害减法运算
  1074.       last_hp = self.hp
  1075.       self.hp -= self.damage
  1076.       effective |= self.hp != last_hp
  1077.       # 状态变化
  1078.       @state_changed = false
  1079.       effective |= states_plus(skill.plus_state_set)
  1080.       effective |= states_minus(skill.minus_state_set)
  1081.       # 威力为 0 的场合
  1082.       #======================修改===============================
  1083.       if skill_power == 0
  1084.       #=========================================================
  1085.         # 伤害设置为空的字串
  1086.         self.damage = ""
  1087.         # 状态没有变化的情况下
  1088.         unless @state_changed
  1089.           # 伤害设置为 "Miss"
  1090.           self.damage = "Miss"
  1091.         end
  1092.       end
  1093.     # Miss 的情况下
  1094.     else
  1095.       # 伤害设置为 "Miss"
  1096.       self.damage = "Miss"
  1097.     end
  1098.     # 不在战斗中的情况下
  1099.     unless $game_temp.in_battle
  1100.       # 伤害设置为 nil
  1101.       self.damage = nil
  1102.     end
  1103.     # 过程结束
  1104.     return effective
  1105.   end
  1106. end

  1107. #==============================================================================
  1108. # ■ Game_Actor
  1109. #------------------------------------------------------------------------------
  1110. #  6处修改
  1111. #==============================================================================

  1112. class Game_Actor < Game_Battler
  1113.   #--------------------------------------------------------------------------
  1114.   # ● 设置
  1115.   #     actor_id : 角色 ID
  1116.   #--------------------------------------------------------------------------
  1117.   def setup(actor_id)
  1118.     actor = $data_actors[actor_id]
  1119.     #===============修改=========================================
  1120.     Genius_Restart.new(actor)
  1121.     $Genius_rs_x[actor.id] = 0
  1122.     #===============修改=========================================
  1123.     @actor_id = actor_id
  1124.     @name = actor.name
  1125.     @character_name = actor.character_name
  1126.     @character_hue = actor.character_hue
  1127.     @battler_name = actor.battler_name
  1128.     @battler_hue = actor.battler_hue
  1129.     @class_id = actor.class_id
  1130.     @weapon_id = actor.weapon_id
  1131.     @armor1_id = actor.armor1_id
  1132.     @armor2_id = actor.armor2_id
  1133.     @armor3_id = actor.armor3_id
  1134.     @armor4_id = actor.armor4_id
  1135.     @level = actor.initial_level
  1136.       #===============修改=========================================
  1137.       if @level > 9 and @level <61
  1138.         $Genius_Point[self.id][0] = @level - 9
  1139.         $Genius_Point[self.id][1] = @level - 9
  1140.       elsif @level > 60
  1141.         $Genius_Point[self.id][0] = 51
  1142.         $Genius_Point[self.id][1] = 51
  1143.       else
  1144.         $Genius_Point[self.id][0] = 0
  1145.         $Genius_Point[self.id][1] = 0
  1146.       end
  1147.       #============================================================
  1148.     @exp_list = Array.new(101)
  1149.     make_exp_list
  1150.     @exp = @exp_list[@level]
  1151.     @skills = []
  1152.     @hp = maxhp
  1153.     @sp = maxsp
  1154.     @states = []
  1155.     @states_turn = {}
  1156.     @maxhp_plus = 0
  1157.     @maxsp_plus = 0
  1158.     @str_plus = 0
  1159.     @dex_plus = 0
  1160.     @agi_plus = 0
  1161.     @int_plus = 0
  1162.     # 学会特技
  1163.     for i in 1..@level
  1164.       for j in $data_classes[@class_id].learnings
  1165.         if j.level == i
  1166.           learn_skill(j.skill_id)
  1167.         end
  1168.       end
  1169.     end
  1170.     # 刷新自动状态
  1171.     update_auto_state(nil, $data_armors[@armor1_id])
  1172.     update_auto_state(nil, $data_armors[@armor2_id])
  1173.     update_auto_state(nil, $data_armors[@armor3_id])
  1174.     update_auto_state(nil, $data_armors[@armor4_id])
  1175.   end
  1176. #==================================修改===========================================
  1177.   #--------------------------------------------------------------------------
  1178.   # ● 获取 MaxHP
  1179.   #--------------------------------------------------------------------------
  1180.   def maxhp
  1181.     n = [[base_maxhp + @maxhp_plus, 1].max, 9999].min
  1182.     for i in @states
  1183.       n *= $data_states[i].maxhp_rate / 100.0
  1184.     end
  1185.     n = [[Integer(n), 1].max, 9999].min
  1186.     return n
  1187.   end
  1188.   #--------------------------------------------------------------------------
  1189.   # ● 获取基本 MaxHP
  1190.   #--------------------------------------------------------------------------
  1191.   def base_maxhp
  1192.     n = $data_actors[@actor_id].parameters[0, @level]
  1193.     n *= $talents_3[self.id][0] / 100
  1194.     n += $talents_4[self.id][0]
  1195.     return n
  1196.   end
  1197.   #--------------------------------------------------------------------------
  1198.   # ● 获取基本 MaxSP
  1199.   #--------------------------------------------------------------------------
  1200.   def base_maxsp
  1201.     n = $data_actors[@actor_id].parameters[1, @level]
  1202.     n *= $talents_3[self.id][1] / 100
  1203.     n += $talents_4[self.id][1]
  1204.     return n
  1205.   end
  1206.   #--------------------------------------------------------------------------
  1207.   # ● 获取基本力量
  1208.   #--------------------------------------------------------------------------
  1209.   def base_str
  1210.     n = $data_actors[@actor_id].parameters[2, @level]
  1211.     weapon = $data_weapons[@weapon_id]
  1212.     armor1 = $data_armors[@armor1_id]
  1213.     armor2 = $data_armors[@armor2_id]
  1214.     armor3 = $data_armors[@armor3_id]
  1215.     armor4 = $data_armors[@armor4_id]
  1216.     n += weapon != nil ? weapon.str_plus : 0
  1217.     n += armor1 != nil ? armor1.str_plus : 0
  1218.     n += armor2 != nil ? armor2.str_plus : 0
  1219.     n += armor3 != nil ? armor3.str_plus : 0
  1220.     n += armor4 != nil ? armor4.str_plus : 0
  1221.     n *= $talents_3[self.id][2] / 100
  1222.     n += $talents_4[self.id][2]
  1223.     return [[n, 1].max, 999].min
  1224.   end
  1225.   #--------------------------------------------------------------------------
  1226.   # ● 获取基本灵巧
  1227.   #--------------------------------------------------------------------------
  1228.   def base_dex
  1229.     n = $data_actors[@actor_id].parameters[3, @level]
  1230.     weapon = $data_weapons[@weapon_id]
  1231.     armor1 = $data_armors[@armor1_id]
  1232.     armor2 = $data_armors[@armor2_id]
  1233.     armor3 = $data_armors[@armor3_id]
  1234.     armor4 = $data_armors[@armor4_id]
  1235.     n += weapon != nil ? weapon.dex_plus : 0
  1236.     n += armor1 != nil ? armor1.dex_plus : 0
  1237.     n += armor2 != nil ? armor2.dex_plus : 0
  1238.     n += armor3 != nil ? armor3.dex_plus : 0
  1239.     n += armor4 != nil ? armor4.dex_plus : 0
  1240.     n *= $talents_3[self.id][3] / 100
  1241.     n += $talents_4[self.id][3]
  1242.     return [[n, 1].max, 999].min
  1243.   end
  1244.   #--------------------------------------------------------------------------
  1245.   # ● 获取基本速度
  1246.   #--------------------------------------------------------------------------
  1247.   def base_agi
  1248.     n = $data_actors[@actor_id].parameters[4, @level]
  1249.     weapon = $data_weapons[@weapon_id]
  1250.     armor1 = $data_armors[@armor1_id]
  1251.     armor2 = $data_armors[@armor2_id]
  1252.     armor3 = $data_armors[@armor3_id]
  1253.     armor4 = $data_armors[@armor4_id]
  1254.     n += weapon != nil ? weapon.agi_plus : 0
  1255.     n += armor1 != nil ? armor1.agi_plus : 0
  1256.     n += armor2 != nil ? armor2.agi_plus : 0
  1257.     n += armor3 != nil ? armor3.agi_plus : 0
  1258.     n += armor4 != nil ? armor4.agi_plus : 0
  1259.     n *= $talents_3[self.id][4] / 100
  1260.     n += $talents_4[self.id][4]
  1261.     return [[n, 1].max, 999].min
  1262.   end
  1263.   #--------------------------------------------------------------------------
  1264.   # ● 获取基本魔力
  1265.   #--------------------------------------------------------------------------
  1266.   def base_int
  1267.     n = $data_actors[@actor_id].parameters[5, @level]
  1268.     weapon = $data_weapons[@weapon_id]
  1269.     armor1 = $data_armors[@armor1_id]
  1270.     armor2 = $data_armors[@armor2_id]
  1271.     armor3 = $data_armors[@armor3_id]
  1272.     armor4 = $data_armors[@armor4_id]
  1273.     n += weapon != nil ? weapon.int_plus : 0
  1274.     n += armor1 != nil ? armor1.int_plus : 0
  1275.     n += armor2 != nil ? armor2.int_plus : 0
  1276.     n += armor3 != nil ? armor3.int_plus : 0
  1277.     n += armor4 != nil ? armor4.int_plus : 0
  1278.     n *= $talents_3[self.id][5] / 100
  1279.     n += $talents_4[self.id][5]
  1280.     return [[n, 1].max, 999].min
  1281.   end
  1282.   #--------------------------------------------------------------------------
  1283.   # ● 获取基本攻击力
  1284.   #--------------------------------------------------------------------------
  1285.   def base_atk
  1286.     weapon = $data_weapons[@weapon_id]
  1287.     atk = weapon != nil ? weapon.atk : 0
  1288.     return (atk) * $talents_3[self.id][9] + $talents_4[self.id][9]
  1289.   end
  1290.   #--------------------------------------------------------------------------
  1291.   # ● 获取基本物理防御
  1292.   #--------------------------------------------------------------------------
  1293.   def base_pdef
  1294.     weapon = $data_weapons[@weapon_id]
  1295.     armor1 = $data_armors[@armor1_id]
  1296.     armor2 = $data_armors[@armor2_id]
  1297.     armor3 = $data_armors[@armor3_id]
  1298.     armor4 = $data_armors[@armor4_id]
  1299.     pdef1 = weapon != nil ? weapon.pdef : 0
  1300.     pdef2 = armor1 != nil ? armor1.pdef : 0
  1301.     pdef3 = armor2 != nil ? armor2.pdef : 0
  1302.     pdef4 = armor3 != nil ? armor3.pdef : 0
  1303.     pdef5 = armor4 != nil ? armor4.pdef : 0
  1304.     return (pdef1 + pdef2 + pdef3 + pdef4 + pdef5) * $talents_3[self.id][6] / 100 + $talents_4[self.id][6]
  1305.   end
  1306.   #--------------------------------------------------------------------------
  1307.   # ● 获取基本魔法防御
  1308.   #--------------------------------------------------------------------------
  1309.   def base_mdef
  1310.     weapon = $data_weapons[@weapon_id]
  1311.     armor1 = $data_armors[@armor1_id]
  1312.     armor2 = $data_armors[@armor2_id]
  1313.     armor3 = $data_armors[@armor3_id]
  1314.     armor4 = $data_armors[@armor4_id]
  1315.     mdef1 = weapon != nil ? weapon.mdef : 0
  1316.     mdef2 = armor1 != nil ? armor1.mdef : 0
  1317.     mdef3 = armor2 != nil ? armor2.mdef : 0
  1318.     mdef4 = armor3 != nil ? armor3.mdef : 0
  1319.     mdef5 = armor4 != nil ? armor4.mdef : 0
  1320.     return (mdef1 + mdef2 + mdef3 + mdef4 + mdef5) * $talents_3[self.id][7] / 100 + $talents_4[self.id][7]
  1321.   end
  1322.   #--------------------------------------------------------------------------
  1323.   # ● 获取基本回避修正
  1324.   #--------------------------------------------------------------------------
  1325.   def base_eva
  1326.     armor1 = $data_armors[@armor1_id]
  1327.     armor2 = $data_armors[@armor2_id]
  1328.     armor3 = $data_armors[@armor3_id]
  1329.     armor4 = $data_armors[@armor4_id]
  1330.     eva1 = armor1 != nil ? armor1.eva : 0
  1331.     eva2 = armor2 != nil ? armor2.eva : 0
  1332.     eva3 = armor3 != nil ? armor3.eva : 0
  1333.     eva4 = armor4 != nil ? armor4.eva : 0
  1334.     return (eva1 + eva2 + eva3 + eva4) * $talents_3[self.id][8] / 100 + $talents_4[self.id][8]
  1335.   end
  1336. #===============================================================================
  1337.   #--------------------------------------------------------------------------
  1338.   # ● 更改 EXP
  1339.   #     exp : 新的 EXP
  1340.   #--------------------------------------------------------------------------
  1341.   def exp=(exp)
  1342.     @exp = [[exp, 9999999].min, 0].max
  1343.     # 升级
  1344.     while @exp >= @exp_list[@level+1] and @exp_list[@level+1] > 0
  1345.       @level += 0.3
  1346.       #===============修改=========================================
  1347.       if @level > 9 and @level <61
  1348.         $Genius_Point[self.id][0] += 1
  1349.         $Genius_Point[self.id][1] = @level - 9
  1350.       end
  1351.       #============================================================
  1352.       # 学会特技
  1353.       for j in $data_classes[@class_id].learnings
  1354.         if j.level == @level
  1355.           learn_skill(j.skill_id)
  1356.         end
  1357.       end
  1358.     end
  1359.     # 降级
  1360.     while @exp < @exp_list[@level]
  1361.       @level -= 1
  1362.       #===============修改=========================================
  1363.       $Genius_Point[self.id][1] = @level - 8
  1364.       if level > 8 and level <60
  1365.         if $Genius_Point[self.id][0] < 1
  1366.           i_n = $Genius_Point_note_2[self.id].length - 1
  1367.           for i in 0..i_n
  1368.             if $Genius_Point_note_2[self.id].length == $Genius_Point[self.id][1]
  1369.               break
  1370.             end            
  1371.             j = $Genius_Point_note_2[self.id].length - 11
  1372.             g = $Genius_Point_note_2[self.id][j]
  1373.             #p j
  1374.             #p g
  1375.             #p self
  1376.             $Genius_Point_note_1[self.id][$talents[self.class_id][g]] -= 1
  1377.             $Genius_Point_note_3[self.id][$talents[self.class_id][g][1] - 1] -= 1
  1378.             $Genius_Point_note_2[self.id].delete(j)
  1379.           end
  1380.           Game_Genius.new(self)
  1381.         else
  1382.           $Genius_Point[self.id][0] -= 1
  1383.         end
  1384.       end
  1385.       
  1386.       #============================================================
  1387.     end
  1388.     # 修正当前的 HP 与 SP 超过最大值
  1389.     @hp = [@hp, self.maxhp].min
  1390.     @sp = [@sp, self.maxsp].min
  1391.   end
  1392.   #--------------------------------------------------------------------------
  1393.   # ● 更改职业 ID
  1394.   #     class_id : 新的职业 ID
  1395.   #--------------------------------------------------------------------------
  1396.   def class_id=(class_id)
  1397.     if $data_classes[class_id] != nil
  1398.       @class_id = class_id
  1399.       #===============修改=========================================
  1400.       #初始化天赋
  1401.       Genius_Restart.new(self)
  1402.       #============================================================
  1403.       # 避开无法装备的物品
  1404.       unless equippable?($data_weapons[@weapon_id])
  1405.         equip(0, 0)
  1406.       end
  1407.       unless equippable?($data_armors[@armor1_id])
  1408.         equip(1, 0)
  1409.       end
  1410.       unless equippable?($data_armors[@armor2_id])
  1411.         equip(2, 0)
  1412.       end
  1413.       unless equippable?($data_armors[@armor3_id])
  1414.         equip(3, 0)
  1415.       end
  1416.       unless equippable?($data_armors[@armor4_id])
  1417.         equip(4, 0)
  1418.       end
  1419.     end
  1420.   end
  1421. end

  1422. #==============================================================================
  1423. # ■ Window_Skill
  1424. #------------------------------------------------------------------------------
  1425. #  1处修改
  1426. #==============================================================================

  1427. class Window_Skill < Window_Selectable
  1428.   #--------------------------------------------------------------------------
  1429.   # ● 描绘项目
  1430.   #     index : 项目编号
  1431.   #--------------------------------------------------------------------------
  1432.   def draw_item(index)
  1433.     skill = @data[index]
  1434.     if @actor.skill_can_use?(skill.id)
  1435.       self.contents.font.color = normal_color
  1436.     else
  1437.       self.contents.font.color = disabled_color
  1438.     end
  1439.     x = 4 + index % 2 * (288 + 32)
  1440.     y = index / 2 * 32
  1441.     rect = Rect.new(x, y, self.width / @column_max - 32, 32)
  1442.     self.contents.fill_rect(rect, Color.new(0, 0, 0, 0))
  1443.     bitmap = RPG::Cache.icon(skill.icon_name)
  1444.     opacity = self.contents.font.color == normal_color ? 255 : 128
  1445.     self.contents.blt(x, y + 4, bitmap, Rect.new(0, 0, 24, 24), opacity)
  1446.     self.contents.draw_text(x + 28, y, 204, 32, skill.name, 0)
  1447.     #===================修改=========================
  1448.     sp_cost = skill.sp_cost * $talents_5[@actor.id][skill.id][0] / 100
  1449.     sp_cost -= $talents_6[@actor.id][skill.id][0]
  1450.     self.contents.draw_text(x + 232, y, 48, 32, sp_cost.to_s, 2)
  1451.     #================================================
  1452.   end
  1453. end

  1454. #==============================================================================
  1455. # ■ Scene_Title
  1456. #------------------------------------------------------------------------------
  1457. #  两处修改
  1458. #==============================================================================

  1459. class Scene_Title
  1460.   #--------------------------------------------------------------------------
  1461.   # ● 命令 : 新游戏
  1462.   #--------------------------------------------------------------------------
  1463.   def command_new_game
  1464.     # 演奏确定 SE
  1465.     $game_system.se_play($data_system.decision_se)
  1466.     # 停止 BGM
  1467.     Audio.bgm_stop
  1468.     # 重置测量游戏时间用的画面计数器
  1469.     Graphics.frame_count = 0
  1470.     # 生成各种游戏对像
  1471.     $game_temp          = Game_Temp.new
  1472.     $game_system        = Game_System.new
  1473.     $game_switches      = Game_Switches.new
  1474.     $game_variables     = Game_Variables.new
  1475.     $game_self_switches = Game_SelfSwitches.new
  1476.     $game_screen        = Game_Screen.new
  1477.     $game_actors        = Game_Actors.new
  1478.     $game_party         = Game_Party.new
  1479.     $game_troop         = Game_Troop.new
  1480.     $game_map           = Game_Map.new
  1481.     $game_player        = Game_Player.new
  1482. #=================================修改=========================================
  1483.     #初始化天赋剩余点数
  1484.     $Genius_Point       = []
  1485.     $Genius_rs_x        = []
  1486.       $talents_3 = {}
  1487.       $talents_4 = {}
  1488.       $talents_5 = {}
  1489.       $talents_6 = {}
  1490.       $Genius_Point_note_1 = []
  1491.       $Genius_Point_note_2 = []
  1492.       $Genius_Point_note_3 = []
  1493.     for actor in $data_actors
  1494.       $Genius_Point[actor.id] = [0,0]
  1495.       $talents_3[actor.id] = [100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100]
  1496.       $talents_4[actor.id] = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]
  1497.       $talents_5[actor.id] = []
  1498.       $talents_6[actor.id] = []
  1499.       for i_X in 1..$data_skills.size - 1
  1500.       $talents_5[actor.id][i_X] = [100,100,100]
  1501.       $talents_6[actor.id][i_X] = [0,0,0]
  1502.       end
  1503.       $Genius_rs_x[actor.id] = 0
  1504.       $Genius_Point_note_1[actor.id] = {}
  1505.       $Genius_Point_note_2[actor.id] = {}
  1506.       $Genius_Point_note_3[actor.id] = [0,0,0]
  1507.     end
  1508.    
  1509.    
  1510. #==============================================================================
  1511.     # 设置初期同伴位置
  1512.     $game_party.setup_starting_members
  1513.     # 设置初期位置的地图
  1514.     $game_map.setup($data_system.start_map_id)
  1515.     # 主角向初期位置移动
  1516.     $game_player.moveto($data_system.start_x, $data_system.start_y)
  1517.     # 刷新主角
  1518.     $game_player.refresh
  1519.     # 执行地图设置的 BGM 与 BGS 的自动切换
  1520.     $game_map.autoplay
  1521.     # 刷新地图 (执行并行事件)
  1522.     $game_map.update
  1523.     # 切换地图画面
  1524.     $scene = Scene_Map.new
  1525.   end
  1526.   #--------------------------------------------------------------------------
  1527.   # ● 战斗测试
  1528.   #--------------------------------------------------------------------------
  1529.   def battle_test
  1530.     # 载入数据库 (战斗测试用)
  1531.     $data_actors        = load_data("Data/BT_Actors.rxdata")
  1532.     $data_classes       = load_data("Data/BT_Classes.rxdata")
  1533.     $data_skills        = load_data("Data/BT_Skills.rxdata")
  1534.     $data_items         = load_data("Data/BT_Items.rxdata")
  1535.     $data_weapons       = load_data("Data/BT_Weapons.rxdata")
  1536.     $data_armors        = load_data("Data/BT_Armors.rxdata")
  1537.     $data_enemies       = load_data("Data/BT_Enemies.rxdata")
  1538.     $data_troops        = load_data("Data/BT_Troops.rxdata")
  1539.     $data_states        = load_data("Data/BT_States.rxdata")
  1540.     $data_animations    = load_data("Data/BT_Animations.rxdata")
  1541.     $data_tilesets      = load_data("Data/BT_Tilesets.rxdata")
  1542.     $data_common_events = load_data("Data/BT_CommonEvents.rxdata")
  1543.     $data_system        = load_data("Data/BT_System.rxdata")
  1544.     # 重置测量游戏时间用的画面计数器
  1545.     Graphics.frame_count = 0
  1546.     # 生成各种游戏对像
  1547.     $game_temp          = Game_Temp.new
  1548.     $game_system        = Game_System.new
  1549.     $game_switches      = Game_Switches.new
  1550.     $game_variables     = Game_Variables.new
  1551.     $game_self_switches = Game_SelfSwitches.new
  1552.     $game_screen        = Game_Screen.new
  1553.     $game_actors        = Game_Actors.new
  1554.     $game_party         = Game_Party.new
  1555.     $game_troop         = Game_Troop.new
  1556.     $game_map           = Game_Map.new
  1557.     $game_player        = Game_Player.new
  1558. #=================================修改=========================================
  1559.     #初始化天赋剩余点数
  1560.     $Genius_Point       = []
  1561.     $Genius_rs_x        = []
  1562.     $Genius_Point_note_1 = []
  1563.     $Genius_Point_note_2 = []
  1564.     $Genius_Point_note_3 = []
  1565.     for actor in $data_actors
  1566.       $Genius_Point[actor.id] = [0,0]
  1567.       $Genius_rs_x[actor.id] = 0
  1568.       $Genius_Point_note_1[actor.id] = {}
  1569.       $Genius_Point_note_2[actor.id] = {}
  1570.       $Genius_Point_note_3[actor.id] = [0,0,0]
  1571.     end

  1572. #==============================================================================
  1573.     # 设置战斗测试用同伴
  1574.     $game_party.setup_battle_test_members
  1575.     # 设置队伍 ID、可以逃走标志、战斗背景
  1576.     $game_temp.battle_troop_id = $data_system.test_troop_id
  1577.     $game_temp.battle_can_escape = true
  1578.     $game_map.battleback_name = $data_system.battleback_name
  1579.     # 演奏战斗开始 BGM
  1580.     $game_system.se_play($data_system.battle_start_se)
  1581.     # 演奏战斗 BGM
  1582.     $game_system.bgm_play($game_system.battle_bgm)
  1583.     # 切换到战斗画面
  1584.     $scene = Scene_Battle.new
  1585.   end
  1586. end

  1587. #==============================================================================
  1588. # ■ Scene_Skill
  1589. #------------------------------------------------------------------------------
  1590. #  两处修改
  1591. #==============================================================================

  1592. class Scene_Skill
  1593.   #--------------------------------------------------------------------------
  1594.   # ● 刷新画面 (特技窗口被激活的情况下)
  1595.   #--------------------------------------------------------------------------
  1596.   def update_skill
  1597.     # 按下 B 键的情况下
  1598.     if Input.trigger?(Input::B)
  1599.       # 演奏取消 SE
  1600.       $game_system.se_play($data_system.cancel_se)
  1601.       # 切换到菜单画面
  1602.       $scene = Scene_Menu.new(1)
  1603.       return
  1604.     end
  1605.     # 按下 C 键的情况下
  1606.     if Input.trigger?(Input::C)
  1607.       # 获取特技窗口现在选择的特技的数据
  1608.       @skill = @skill_window.skill
  1609.       # 不能使用的情况下
  1610.       if @skill == nil or not @actor.skill_can_use?(@skill.id)
  1611.         # 演奏冻结 SE
  1612.         $game_system.se_play($data_system.buzzer_se)
  1613.         return
  1614.       end
  1615.       # 演奏确定 SE
  1616.       $game_system.se_play($data_system.decision_se)
  1617.       # 效果范围是我方的情况下
  1618.       if @skill.scope >= 3
  1619.         # 激活目标窗口
  1620.         @skill_window.active = false
  1621.         @target_window.x = (@skill_window.index + 1) % 2 * 304
  1622.         @target_window.visible = true
  1623.         @target_window.active = true
  1624.         # 设置效果范围 (单体/全体) 的对应光标位置
  1625.         if @skill.scope == 4 || @skill.scope == 6
  1626.           @target_window.index = -1
  1627.         elsif @skill.scope == 7
  1628.           @target_window.index = @actor_index - 10
  1629.         else
  1630.           @target_window.index = 0
  1631.         end
  1632.       # 效果在我方以外的情况下
  1633.       else
  1634.         # 公共事件 ID 有效的情况下
  1635.         if @skill.common_event_id > 0
  1636.           # 预约调用公共事件
  1637.           $game_temp.common_event_id = @skill.common_event_id
  1638.           # 演奏特技使用时的 SE
  1639.           $game_system.se_play(@skill.menu_se)
  1640.           #====================修改========================
  1641.           # 消耗 SP
  1642.           sp_cost = @skill.sp_cost * $talents_5[@actor.id][@skill.id][0] / 100
  1643.           sp_cost -= $talents_6[@actor.id][@skill.id][0]
  1644.           @actor.sp -= sp_cost
  1645.           #================================================
  1646.           # 再生成各窗口的内容
  1647.           @status_window.refresh
  1648.           @skill_window.refresh
  1649.           @target_window.refresh
  1650.           # 切换到地图画面
  1651.           $scene = Scene_Map.new
  1652.           return
  1653.         end
  1654.       end
  1655.       return
  1656.     end
  1657.     # 按下 R 键的情况下
  1658.     if Input.trigger?(Input::R)
  1659.       # 演奏光标 SE
  1660.       $game_system.se_play($data_system.cursor_se)
  1661.       # 移至下一位角色
  1662.       @actor_index += 1
  1663.       @actor_index %= $game_party.actors.size
  1664.       # 切换到别的特技画面
  1665.       $scene = Scene_Skill.new(@actor_index)
  1666.       return
  1667.     end
  1668.     # 按下 L 键的情况下
  1669.     if Input.trigger?(Input::L)
  1670.       # 演奏光标 SE
  1671.       $game_system.se_play($data_system.cursor_se)
  1672.       # 移至上一位角色
  1673.       @actor_index += $game_party.actors.size - 1
  1674.       @actor_index %= $game_party.actors.size
  1675.       # 切换到别的特技画面
  1676.       $scene = Scene_Skill.new(@actor_index)
  1677.       return
  1678.     end
  1679.   end
  1680.   #--------------------------------------------------------------------------
  1681.   # ● 刷新画面 (目标窗口被激活的情况下)
  1682.   #--------------------------------------------------------------------------
  1683.   def update_target
  1684.     # 按下 B 键的情况下
  1685.     if Input.trigger?(Input::B)
  1686.       # 演奏取消 SE
  1687.       $game_system.se_play($data_system.cancel_se)
  1688.       # 删除目标窗口
  1689.       @skill_window.active = true
  1690.       @target_window.visible = false
  1691.       @target_window.active = false
  1692.       return
  1693.     end
  1694.     # 按下 C 键的情况下
  1695.     if Input.trigger?(Input::C)
  1696.       # 因为 SP 不足而无法使用的情况下
  1697.       unless @actor.skill_can_use?(@skill.id)
  1698.         # 演奏冻结 SE
  1699.         $game_system.se_play($data_system.buzzer_se)
  1700.         return
  1701.       end
  1702.       # 目标是全体的情况下
  1703.       if @target_window.index == -1
  1704.         # 对同伴全体应用特技使用效果
  1705.         used = false
  1706.         for i in $game_party.actors
  1707.           used |= i.skill_effect(@actor, @skill)
  1708.         end
  1709.       end
  1710.       # 目标是使用者的情况下
  1711.       if @target_window.index <= -2
  1712.         # 对目标角色应用特技的使用效果
  1713.         target = $game_party.actors[@target_window.index + 10]
  1714.         used = target.skill_effect(@actor, @skill)
  1715.       end
  1716.       # 目标是单体的情况下
  1717.       if @target_window.index >= 0
  1718.         # 对目标角色应用特技的使用效果
  1719.         target = $game_party.actors[@target_window.index]
  1720.         used = target.skill_effect(@actor, @skill)
  1721.       end
  1722.       # 使用特技的情况下
  1723.       if used
  1724.         # 演奏特技使用时的 SE
  1725.         $game_system.se_play(@skill.menu_se)
  1726.         #====================修改========================
  1727.           # 消耗 SP
  1728.           sp_cost = @skill.sp_cost * $talents_5[@actor.id][@skill.id][0] / 100
  1729.           sp_cost -= $talents_6[@actor.id][@skill.id][0]
  1730.           @actor.sp -= sp_cost
  1731.         #================================================
  1732.         # 再生成各窗口内容
  1733.         @status_window.refresh
  1734.         @skill_window.refresh
  1735.         @target_window.refresh
  1736.         # 全灭的情况下
  1737.         if $game_party.all_dead?
  1738.           # 切换到游戏结束画面
  1739.           $scene = Scene_Gameover.new
  1740.           return
  1741.         end
  1742.         # 公共事件 ID 有效的情况下
  1743.         if @skill.common_event_id > 0
  1744.           # 预约调用公共事件
  1745.           $game_temp.common_event_id = @skill.common_event_id
  1746.           # 切换到地图画面
  1747.           $scene = Scene_Map.new
  1748.           return
  1749.         end
  1750.       end
  1751.       # 无法使用特技的情况下
  1752.       unless used
  1753.         # 演奏冻结 SE
  1754.         $game_system.se_play($data_system.buzzer_se)
  1755.       end
  1756.       return
  1757.     end
  1758.   end
  1759. end

  1760. #==============================================================================
  1761. # ■ Scene_Save
  1762. #------------------------------------------------------------------------------
  1763. #  一处修改
  1764. #==============================================================================

  1765. class Scene_Save < Scene_File
  1766.   #--------------------------------------------------------------------------
  1767.   # ● 写入存档数据
  1768.   #     file : 写入用文件对像 (已经打开)
  1769.   #--------------------------------------------------------------------------
  1770.   def write_save_data(file)
  1771.     # 生成描绘存档文件用的角色图形
  1772.     characters = []
  1773.     for i in 0...$game_party.actors.size
  1774.       actor = $game_party.actors[i]
  1775.       characters.push([actor.character_name, actor.character_hue])
  1776.     end
  1777.     # 写入描绘存档文件用的角色数据
  1778.     Marshal.dump(characters, file)
  1779.     # 写入测量游戏时间用画面计数
  1780.     Marshal.dump(Graphics.frame_count, file)
  1781.     # 增加 1 次存档次数
  1782.     $game_system.save_count += 1
  1783.     # 保存魔法编号
  1784.     # (将编辑器保存的值以随机值替换)
  1785.     $game_system.magic_number = $data_system.magic_number
  1786.     # 写入各种游戏对像
  1787.     Marshal.dump($game_system, file)
  1788.     Marshal.dump($game_switches, file)
  1789.     Marshal.dump($game_variables, file)
  1790.     Marshal.dump($game_self_switches, file)
  1791.     Marshal.dump($game_screen, file)
  1792.     Marshal.dump($game_actors, file)
  1793.     Marshal.dump($game_party, file)
  1794.     Marshal.dump($game_troop, file)
  1795.     Marshal.dump($game_map, file)
  1796.     Marshal.dump($game_player, file)
  1797. #=================================修改=========================================
  1798.     Marshal.dump($Genius_Point, file)
  1799.     Marshal.dump($Genius_rs_x, file)
  1800.     Marshal.dump($talents_3, file)
  1801.     Marshal.dump($talents_4, file)
  1802.     Marshal.dump($talents_5, file)
  1803.     Marshal.dump($talents_6, file)
  1804. #==============================================================================
  1805.   end
  1806. end

  1807. #==============================================================================
  1808. # ■ Scene_Load
  1809. #------------------------------------------------------------------------------
  1810. #  一处修改
  1811. #==============================================================================

  1812. class Scene_Load < Scene_File
  1813.   #--------------------------------------------------------------------------
  1814.   # ● 读取存档数据
  1815.   #     file : 读取用文件对像 (已经打开)
  1816.   #--------------------------------------------------------------------------
  1817.   def read_save_data(file)
  1818.     # 读取描绘存档文件用的角色数据
  1819.     characters = Marshal.load(file)
  1820.     # 读取测量游戏时间用画面计数
  1821.     Graphics.frame_count = Marshal.load(file)
  1822.     # 读取各种游戏对像
  1823.     $game_system        = Marshal.load(file)
  1824.     $game_switches      = Marshal.load(file)
  1825.     $game_variables     = Marshal.load(file)
  1826.     $game_self_switches = Marshal.load(file)
  1827.     $game_screen        = Marshal.load(file)
  1828.     $game_actors        = Marshal.load(file)
  1829.     $game_party         = Marshal.load(file)
  1830.     $game_troop         = Marshal.load(file)
  1831.     $game_map           = Marshal.load(file)
  1832.     $game_player        = Marshal.load(file)
  1833. #=================================修改=========================================
  1834.     $Genius_Point       = Marshal.load(file)
  1835.     $Genius_rs_x        = Marshal.load(file)
  1836.     $talents_3          = Marshal.load(file)
  1837.     $talents_4          = Marshal.load(file)
  1838.     $talents_5          = Marshal.load(file)
  1839.     $talents_6          = Marshal.load(file)
  1840. #==============================================================================
  1841.     # 魔法编号与保存时有差异的情况下
  1842.     # (加入编辑器的编辑过的数据)
  1843.     if $game_system.magic_number != $data_system.magic_number
  1844.       # 重新装载地图
  1845.       $game_map.setup($game_map.map_id)
  1846.       $game_player.center($game_player.x, $game_player.y)
  1847.     end
  1848.     # 刷新同伴成员
  1849.     $game_party.refresh
  1850.   end
  1851. end

  1852. #==============================================================================
  1853. # ■ Scene_Battle
  1854. #------------------------------------------------------------------------------
  1855. #  一处修改
  1856. #==============================================================================

  1857. class Scene_Battle
  1858.   #--------------------------------------------------------------------------
  1859.   # ● 生成特技行动结果
  1860.   #--------------------------------------------------------------------------
  1861.   def make_skill_action_result
  1862.     # 获取特技
  1863.     @skill = $data_skills[@active_battler.current_action.skill_id]
  1864.     # 如果不是强制行动
  1865.     unless @active_battler.current_action.forcing
  1866.       # 因为 SP 耗尽而无法使用的情况下
  1867.       unless @active_battler.skill_can_use?(@skill.id)
  1868.         # 清除强制行动对像的战斗者
  1869.         $game_temp.forcing_battler = nil
  1870.         # 移至步骤 1
  1871.         @phase4_step = 1
  1872.         return
  1873.       end
  1874.     end
  1875.     #====================修改========================
  1876.       # 消耗 SP
  1877.       if
  1878.       sp_cost = @skill.sp_cost * $talents_5[@active_battler.id][@skill.id][0] / 100
  1879.       sp_cost -= $talents_6[@active_battler.id][@skill.id][0]
  1880.       else
  1881.       
  1882.       end
  1883.   
  1884.     #================================================
  1885.     # 刷新状态窗口
  1886.     @status_window.refresh
  1887.     # 在帮助窗口显示特技名
  1888.     @help_window.set_text(@skill.name, 1)
  1889.     # 设置动画 ID
  1890.     @animation1_id = @skill.animation1_id
  1891.     @animation2_id = @skill.animation2_id
  1892.     # 设置公共事件 ID
  1893.     @common_event_id = @skill.common_event_id
  1894.     # 设置对像侧战斗者
  1895.     set_target_battlers(@skill.scope)
  1896.     # 应用特技效果
  1897.     for target in @target_battlers
  1898.       target.skill_effect(@active_battler, @skill)
  1899.     end
  1900.   end
  1901. end
复制代码
这是天赋加点系统
调用是$scene = Scene_Genius.new
请问怎样改一下调用的脚本? 换成别的

Lv3.寻梦者

梦石
0
星屑
3846
在线时间
1966 小时
注册时间
2013-1-3
帖子
9536
2
发表于 2013-8-21 19:30:37 | 只看该作者
换成别的脚本吗?LZ写一个新的定义就行了…
《宿愿·寻剑篇》正式版已经发布!快去看看!点击进入论坛发布贴
回复 支持 反对

使用道具 举报

Lv1.梦旅人

梦石
0
星屑
50
在线时间
20 小时
注册时间
2012-2-20
帖子
40
3
 楼主| 发表于 2013-8-21 19:34:00 | 只看该作者
紫英晓狼1130 发表于 2013-8-21 19:30
换成别的脚本吗?LZ写一个新的定义就行了…

不是。。原来的调用方法是$scene = Scene_Genius.new
我想改一下 调用方法 请问可以实现吗
我不太懂脚本

点评

为什么?  发表于 2013-8-21 19:40
回复 支持 反对

使用道具 举报

Lv1.梦旅人

梦石
0
星屑
50
在线时间
20 小时
注册时间
2012-2-20
帖子
40
4
 楼主| 发表于 2013-8-21 19:58:35 | 只看该作者
@satgo1546   这个脚本有职业区分 我想把职业去掉  可是不太会。。 我想做金庸类的游戏 要学习的心法太多了
因此我想到多弄几个这种脚本 有多少种武功就添加多少个这种脚本 前提是每个脚本调用不同  做好了之后然后使用某物品如九阴真经秘籍 就可以切换到九阴真经武功修炼界面

点评

就个调用 也要大改啊。。  发表于 2013-8-21 23:37
那可能要大改什么的……  发表于 2013-8-21 21:31
回复 支持 反对

使用道具 举报

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

本版积分规则

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

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

GMT+8, 2024-9-21 12:37

Powered by Discuz! X3.1

© 2001-2013 Comsenz Inc.

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