查看: 1499|回复: 3

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

[复制链接]
梦石
0
星屑
50
在线时间
20 小时
注册时间
2012-2-20
回帖
22
发表于 2013-8-21 19:27:21 | 显示全部楼层 |阅读模式

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

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

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

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

  179. 请按需要自行追加

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

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



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

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

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

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

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

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

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

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

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


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


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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

  1858. class Scene_Battle
  1859.   #--------------------------------------------------------------------------
  1860.   # ● 生成特技行动结果
  1861.   #--------------------------------------------------------------------------
  1862.   def make_skill_action_result
  1863.     # 获取特技
  1864.     @skill = $data_skills[@active_battler.current_action.skill_id]
  1865.     # 如果不是强制行动
  1866.     unless @active_battler.current_action.forcing
  1867.       # 因为 SP 耗尽而无法使用的情况下
  1868.       unless @active_battler.skill_can_use?(@skill.id)
  1869.         # 清除强制行动对像的战斗者
  1870.         $game_temp.forcing_battler = nil
  1871.         # 移至步骤 1
  1872.         @phase4_step = 1
  1873.         return
  1874.       end
  1875.     end
  1876.     #====================修改========================
  1877.       # 消耗 SP
  1878.       if
  1879.       sp_cost = @skill.sp_cost * $talents_5[@active_battler.id][@skill.id][0] / 100
  1880.       sp_cost -= $talents_6[@active_battler.id][@skill.id][0]
  1881.       else
  1882.       
  1883.       end
  1884.   
  1885.     #================================================
  1886.     # 刷新状态窗口
  1887.     @status_window.refresh
  1888.     # 在帮助窗口显示特技名
  1889.     @help_window.set_text(@skill.name, 1)
  1890.     # 设置动画 ID
  1891.     @animation1_id = @skill.animation1_id
  1892.     @animation2_id = @skill.animation2_id
  1893.     # 设置公共事件 ID
  1894.     @common_event_id = @skill.common_event_id
  1895.     # 设置对像侧战斗者
  1896.     set_target_battlers(@skill.scope)
  1897.     # 应用特技效果
  1898.     for target in @target_battlers
  1899.       target.skill_effect(@active_battler, @skill)
  1900.     end
  1901.   end
  1902. end
复制代码
这是天赋加点系统
调用是$scene = Scene_Genius.new
请问怎样改一下调用的脚本? 换成别的
梦石
0
星屑
3905
在线时间
1972 小时
注册时间
2013-1-3
回帖
9146
发表于 2013-8-21 19:30:37 | 显示全部楼层
换成别的脚本吗?LZ写一个新的定义就行了…
《宿愿·寻剑篇》正式版已经发布!快去看看!点击进入论坛发布贴
回复

使用道具 举报

梦石
0
星屑
50
在线时间
20 小时
注册时间
2012-2-20
回帖
22
 楼主| 发表于 2013-8-21 19:34:00 | 显示全部楼层
紫英晓狼1130 发表于 2013-8-21 19:30
换成别的脚本吗?LZ写一个新的定义就行了…

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

点评

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

使用道具 举报

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

点评

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

使用道具 举报

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

本版积分规则

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

在本版发帖返回顶部