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

Project1

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

[已经过期] 二刀流脚本只保留盾换成武器,不需要动画

[复制链接]

Lv3.寻梦者

梦石
0
星屑
3065
在线时间
1429 小时
注册时间
2009-7-27
帖子
1448
跳转到指定楼层
1
发表于 2018-11-16 01:56:23 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式

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

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

x
就是不需要显示第二次动画了,直接就是一次动画即可。其他不变。

RUBY 代码复制
  1. #1.main之前右键插入,全选RGSS代码后,粘贴即可.脚本名可自己取.
  2.  
  3. #2.在属性栏中创建或者修改一个属性的名字,命名为“二刀流”.
  4.  
  5. #3.在武器中,把可以用来装备双手武器的属性上,把二刀流打上勾.
  6.  
  7. #4,在职业中,把可以双手装备武器的职业的属性有效度设为A.
  8.  
  9. #5.状态显示副手武器Window_Status的
  10. #draw_item_name($data_armors[@actor.armor1_id], 320 + 16, 256)
  11. #上面加draw_item_name($data_weapons[@actor.weapon2_id], 320 + 16, 256)
  12.  
  13. #这样,只要你拥有了可以双手装备的武器,就可以装备在盾的位置而双手拿剑了.
  14.  
  15. #一开始副手装备着武器的方法:
  16. #查找@weapon2_id = 0下面加@weapon2_id = 武器id if actor_id ==角色id
  17. #这样id为角色id的角色2号武器便为武器id的武器
  18. #如:@weapon2_id = 1 if actor_id ==1 (代表一号角色和一号武器)
  19.  
  20. #如果需要改副手武器的攻击力率,搜索n = weapon2 != nil ? weapon2.atk / 2 : 0
  21.  
  22. class Special_Element
  23. #--------------------------------------------------------------------------
  24. # ● 特殊な属性を定義する定数
  25. #--------------------------------------------------------------------------
  26. TWO_WEAPONS = "二刀流"
  27.  
  28. #--------------------------------------------------------------------------
  29. # ● 特殊な属性をすべて取得
  30. #--------------------------------------------------------------------------
  31. def self.special_elements
  32. # 特殊な属性をすべて列挙
  33. elements = [
  34. TWO_WEAPONS
  35. ]
  36. return elements
  37. end
  38.  
  39. #--------------------------------------------------------------------------
  40. # ● 属性名からその属性のIDを得る
  41. #--------------------------------------------------------------------------
  42. def self.get_index(name)
  43. return $data_system.elements.index(name)
  44. end
  45.  
  46. #--------------------------------------------------------------------------
  47. # ● 正規表現にマッチするすべての属性のIDとマッチ情報を得る
  48. # 戻り値 : 二次元配列 [n][0]にID、[n][1]にマッチ情報(MatchData)
  49. #--------------------------------------------------------------------------
  50. def self.get_indices(regexp)
  51. indices = []
  52. for i in 1...$data_system.elements.size
  53. indices.push([i, $~]) if regexp =~ $data_system.elements[i]
  54. end
  55. end
  56.  
  57. #--------------------------------------------------------------------------
  58. # ● 特殊な属性を取り除く
  59. # element_set : 取り除く前の属性IDの配列
  60. # ignore_elements : 取り除きたい属性 ID?名前?正規表現で指定可能
  61. # 戻り値 : 取り除いた結果の属性IDの配列
  62. #--------------------------------------------------------------------------
  63. def self.delete(element_set)
  64. result = element_set.dup
  65. for ignore in Special_Element::special_elements
  66. case ignore
  67. when Integer
  68. result.delete(ignore)
  69. when String
  70. result.delete(Special_Element::get_index(ignore))
  71. when Regexp
  72. for i in result
  73. result[i] = nil if ignore =~ $data_system.elements[result[i]]
  74. end
  75. result.delete(nil)
  76. end
  77. end
  78. return result
  79. end
  80. end
  81.  
  82.  
  83.  
  84.  
  85.  
  86. class Game_Battler
  87. #--------------------------------------------------------------------------
  88. # ● 属性修正の計算
  89. # element_set : 属性
  90. #--------------------------------------------------------------------------
  91. def elements_correct(element_set)
  92. # --- ここから変更部分 ---
  93. element_set = Special_Element::delete(element_set)
  94. # --- 変更部分終わり ---
  95. # 無属性の場合
  96. if element_set == []
  97. # 100 を返す
  98. return 100
  99. end
  100. # 与えられた属性の中で最も弱いものを返す
  101. # ※メソッド element_rate は、このクラスから継承される Game_Actor
  102. # および Game_Enemy クラスで定義される
  103. weakest = -100
  104. for i in element_set
  105. weakest = [weakest, self.element_rate(i)].max
  106. end
  107. return weakest
  108. end
  109. end
  110.  
  111. class Game_Actor < Game_Battler
  112. #--------------------------------------------------------------------------
  113. # ● 公開インスタンス変数
  114. #--------------------------------------------------------------------------
  115. attr_reader :name # 名前
  116. attr_reader :character_name # キャラクター ファイル名
  117. attr_reader :character_hue # キャラクター 色相
  118. attr_reader :class_id # クラス ID
  119. attr_reader :weapon_id # 武器 ID
  120. # --- ここから追加部分 ---
  121. attr_reader :weapon2_id # 二刀流武器 ID
  122. # --- 追加部分終わり ---
  123. attr_reader :armor1_id # 盾 ID
  124. attr_reader :armor2_id # 頭防具 ID
  125. attr_reader :armor3_id # 体防具 ID
  126. attr_reader :armor4_id # 装飾品 ID
  127. attr_reader :level # レベル
  128. attr_reader :exp # EXP
  129. attr_reader :skills # スキル
  130.  
  131. #--------------------------------------------------------------------------
  132. # ● セットアップ
  133. # actor_id : アクター ID
  134. #--------------------------------------------------------------------------
  135. def setup(actor_id)
  136. actor = $data_actors[actor_id]
  137. @actor_id = actor_id
  138. @name = actor.name
  139. @character_name = actor.character_name
  140. @character_hue = actor.character_hue
  141. @battler_name = actor.battler_name
  142. @battler_hue = actor.battler_hue
  143. @class_id = actor.class_id
  144. @weapon_id = actor.weapon_id
  145. # --- ここから追加部分 ---
  146. @weapon2_id = 0
  147. # --- 追加部分終わり ---
  148. @armor1_id = actor.armor1_id
  149. @armor2_id = actor.armor2_id
  150. @armor3_id = actor.armor3_id
  151. @armor4_id = actor.armor4_id
  152. @level = actor.initial_level
  153. @exp_list = Array.new(101)
  154. make_exp_list
  155. @exp = @exp_list[@level]
  156. @skills = []
  157. @hp = maxhp
  158. @sp = maxsp
  159. @states = []
  160. @states_turn = {}
  161. @maxhp_plus = 0
  162. @maxsp_plus = 0
  163. @str_plus = 0
  164. @dex_plus = 0
  165. @agi_plus = 0
  166. @int_plus = 0
  167. # スキル習得
  168. for i in 1..@level
  169. for j in $data_classes[@class_id].learnings
  170. if j.level == i
  171. learn_skill(j.skill_id)
  172. end
  173. end
  174. end
  175. # オートステートを更新
  176. update_auto_state(nil, $data_armors[@armor1_id])
  177. update_auto_state(nil, $data_armors[@armor2_id])
  178. update_auto_state(nil, $data_armors[@armor3_id])
  179. update_auto_state(nil, $data_armors[@armor4_id])
  180. end
  181.  
  182. #--------------------------------------------------------------------------
  183. # ● 通常攻撃の属性取得
  184. #--------------------------------------------------------------------------
  185. def element_set
  186. weapon = $data_weapons[@weapon_id]
  187. # --- ここから変更部分 ---
  188. weapon2 = $data_weapons[@weapon2_id]
  189. result = []
  190. result.concat(weapon.element_set) if weapon != nil
  191. result.concat(weapon2.element_set) if weapon2 != nil
  192. return result
  193. # --- 変更部分終わり ---
  194. end
  195. #--------------------------------------------------------------------------
  196. # ● 通常攻撃のステート変化 (+) 取得
  197. #--------------------------------------------------------------------------
  198. def plus_state_set
  199. weapon = $data_weapons[@weapon_id]
  200. # --- ここから変更部分 ---
  201. weapon2 = $data_weapons[@weapon2_id]
  202. result = []
  203. result.concat(weapon.plus_state_set) if weapon != nil
  204. result.concat(weapon2.plus_state_set) if weapon2 != nil
  205. return result
  206. # --- 変更部分終わり ---
  207. end
  208. #--------------------------------------------------------------------------
  209. # ● 通常攻撃のステート変化 (-) 取得
  210. #--------------------------------------------------------------------------
  211. def minus_state_set
  212. weapon = $data_weapons[@weapon_id]
  213. # --- ここから変更部分 ---
  214. weapon2 = $data_weapons[@weapon2_id]
  215. result = []
  216. result.concat(weapon.minus_state_set) if weapon != nil
  217. result.concat(weapon2.minus_state_set) if weapon2 != nil
  218. return result
  219. # --- 変更部分終わり ---
  220. end
  221.  
  222. #--------------------------------------------------------------------------
  223. # ● 基本腕力の取得
  224. #--------------------------------------------------------------------------
  225. def base_str
  226. n = $data_actors[@actor_id].parameters[2, @level]
  227. weapon = $data_weapons[@weapon_id]
  228. armor1 = $data_armors[@armor1_id]
  229. armor2 = $data_armors[@armor2_id]
  230. armor3 = $data_armors[@armor3_id]
  231. armor4 = $data_armors[@armor4_id]
  232. # --- ここから追加部分 ---
  233. weapon2 = $data_weapons[@weapon2_id]
  234. # そのまま加算すると強すぎなので半分にしてみるテスト
  235. n += weapon2 != nil ? weapon2.str_plus / 2 : 0
  236. # --- 追加部分終わり ---
  237. n += weapon != nil ? weapon.str_plus : 0
  238. n += armor1 != nil ? armor1.str_plus : 0
  239. n += armor2 != nil ? armor2.str_plus : 0
  240. n += armor3 != nil ? armor3.str_plus : 0
  241. n += armor4 != nil ? armor4.str_plus : 0
  242. return [[n, 1].max, 999].min
  243. end
  244.  
  245. #--------------------------------------------------------------------------
  246. # ● 基本器用さの取得
  247. #--------------------------------------------------------------------------
  248. def base_dex
  249. n = $data_actors[@actor_id].parameters[3, @level]
  250. weapon = $data_weapons[@weapon_id]
  251. armor1 = $data_armors[@armor1_id]
  252. armor2 = $data_armors[@armor2_id]
  253. armor3 = $data_armors[@armor3_id]
  254. armor4 = $data_armors[@armor4_id]
  255. # --- ここから追加部分 ---
  256. weapon2 = $data_weapons[@weapon2_id]
  257. # そのまま加算すると強すぎなので半分にしてみるテスト
  258. n += weapon2 != nil ? weapon2.dex_plus / 2 : 0
  259. # --- 追加部分終わり ---
  260. n += weapon != nil ? weapon.dex_plus : 0
  261. n += armor1 != nil ? armor1.dex_plus : 0
  262. n += armor2 != nil ? armor2.dex_plus : 0
  263. n += armor3 != nil ? armor3.dex_plus : 0
  264. n += armor4 != nil ? armor4.dex_plus : 0
  265. return [[n, 1].max, 999].min
  266. end
  267.  
  268. #--------------------------------------------------------------------------
  269. # ● 基本素早さの取得
  270. #--------------------------------------------------------------------------
  271. def base_agi
  272. n = $data_actors[@actor_id].parameters[4, @level]
  273. weapon = $data_weapons[@weapon_id]
  274. armor1 = $data_armors[@armor1_id]
  275. armor2 = $data_armors[@armor2_id]
  276. armor3 = $data_armors[@armor3_id]
  277. armor4 = $data_armors[@armor4_id]
  278. # --- ここから追加部分 ---
  279. weapon2 = $data_weapons[@weapon2_id]
  280. # そのまま加算すると強すぎなので半分にしてみるテスト
  281. n += weapon2 != nil ? weapon2.agi_plus / 2 : 0
  282. # --- 追加部分終わり ---
  283. n += weapon != nil ? weapon.agi_plus : 0
  284. n += armor1 != nil ? armor1.agi_plus : 0
  285. n += armor2 != nil ? armor2.agi_plus : 0
  286. n += armor3 != nil ? armor3.agi_plus : 0
  287. n += armor4 != nil ? armor4.agi_plus : 0
  288. return [[n, 1].max, 999].min
  289. end
  290.  
  291. #--------------------------------------------------------------------------
  292. # ● 基本魔力の取得
  293. #--------------------------------------------------------------------------
  294. def base_int
  295. n = $data_actors[@actor_id].parameters[5, @level]
  296. weapon = $data_weapons[@weapon_id]
  297. armor1 = $data_armors[@armor1_id]
  298. armor2 = $data_armors[@armor2_id]
  299. armor3 = $data_armors[@armor3_id]
  300. armor4 = $data_armors[@armor4_id]
  301. # --- ここから追加部分 ---
  302. weapon2 = $data_weapons[@weapon2_id]
  303. # そのまま加算すると強すぎなので半分にしてみるテスト
  304. n += weapon2 != nil ? weapon2.int_plus / 2 : 0
  305. # --- 追加部分終わり ---
  306. n += weapon != nil ? weapon.int_plus : 0
  307. n += armor1 != nil ? armor1.int_plus : 0
  308. n += armor2 != nil ? armor2.int_plus : 0
  309. n += armor3 != nil ? armor3.int_plus : 0
  310. n += armor4 != nil ? armor4.int_plus : 0
  311. return [[n, 1].max, 999].min
  312. end
  313.  
  314. #--------------------------------------------------------------------------
  315. # ● 基本攻撃力の取得
  316. #--------------------------------------------------------------------------
  317. def base_atk
  318. weapon = $data_weapons[@weapon_id]
  319. # --- ここから変更部分 ---
  320. weapon2 = $data_weapons[@weapon2_id]
  321. # そのまま加算すると強すぎなので半分にしてみるテスト
  322. n = weapon2 != nil ? weapon2.atk / 2 : 0
  323. return weapon != nil ? weapon.atk + n : n
  324. # --- 変更部分終わり ---
  325. end
  326.  
  327. #--------------------------------------------------------------------------
  328. # ● 基本物理防御の取得
  329. #--------------------------------------------------------------------------
  330. def base_pdef
  331. weapon = $data_weapons[@weapon_id]
  332. armor1 = $data_armors[@armor1_id]
  333. armor2 = $data_armors[@armor2_id]
  334. armor3 = $data_armors[@armor3_id]
  335. armor4 = $data_armors[@armor4_id]
  336. pdef1 = weapon != nil ? weapon.pdef : 0
  337. pdef2 = armor1 != nil ? armor1.pdef : 0
  338. pdef3 = armor2 != nil ? armor2.pdef : 0
  339. pdef4 = armor3 != nil ? armor3.pdef : 0
  340. pdef5 = armor4 != nil ? armor4.pdef : 0
  341. # --- ここから追加部分 ---
  342. weapon2 = $data_weapons[@weapon2_id]
  343. # そのまま加算すると強すぎなので半分にしてみるテスト
  344. pdef1 += weapon2 != nil ? weapon2.pdef / 2 : 0
  345. # --- 追加部分終わり ---
  346. return pdef1 + pdef2 + pdef3 + pdef4 + pdef5
  347. end
  348.  
  349. #--------------------------------------------------------------------------
  350. # ● 基本魔法防御の取得
  351. #--------------------------------------------------------------------------
  352. def base_mdef
  353. weapon = $data_weapons[@weapon_id]
  354. armor1 = $data_armors[@armor1_id]
  355. armor2 = $data_armors[@armor2_id]
  356. armor3 = $data_armors[@armor3_id]
  357. armor4 = $data_armors[@armor4_id]
  358. mdef1 = weapon != nil ? weapon.mdef : 0
  359. mdef2 = armor1 != nil ? armor1.mdef : 0
  360. mdef3 = armor2 != nil ? armor2.mdef : 0
  361. mdef4 = armor3 != nil ? armor3.mdef : 0
  362. mdef5 = armor4 != nil ? armor4.mdef : 0
  363. # --- ここから追加部分 ---
  364. weapon2 = $data_weapons[@weapon2_id]
  365. # そのまま加算すると強すぎなので半分にしてみるテスト
  366. mdef1 += weapon2 != nil ? weapon2.mdef / 2 : 0
  367. # --- 追加部分終わり ---
  368. return mdef1 + mdef2 + mdef3 + mdef4 + mdef5
  369. end
  370.  
  371. #--------------------------------------------------------------------------
  372. # ● 通常攻撃 攻撃側アニメーション ID の取得
  373. #--------------------------------------------------------------------------
  374. def animation1_id
  375. weapon = $data_weapons[@weapon_id]
  376. # --- ここから変更部分 ---
  377. weapon2 = $data_weapons[@weapon2_id]
  378. animations = []
  379. animations.push(weapon.animation1_id) if weapon != nil
  380. animations.push(weapon2.animation1_id) if weapon2 != nil
  381. animations.delete(0)
  382. return animations.empty? ? 0 : animations
  383. # --- 変更部分終わり ---
  384. end
  385.  
  386. #--------------------------------------------------------------------------
  387. # ● 通常攻撃 対象側アニメーション ID の取得
  388. #--------------------------------------------------------------------------
  389. def animation2_id
  390. weapon = $data_weapons[@weapon_id]
  391. # --- ここから変更部分 ---
  392. weapon2 = $data_weapons[@weapon2_id]
  393. animations = []
  394. animations.push(weapon.animation2_id) if weapon != nil
  395. animations.push(weapon2.animation2_id) if weapon2 != nil
  396. animations.delete(0)
  397. return animations.empty? ? 0 : animations
  398. # --- 変更部分終わり ---
  399. end
  400.  
  401. #--------------------------------------------------------------------------
  402. # ● 装備の変更
  403. # equip_type : 装備タイプ(変更点:-1なら二刀流の盾部分の武器)
  404. # id : 武器 or 防具 ID (0 なら装備解除)
  405. #--------------------------------------------------------------------------
  406. def equip(equip_type, id)
  407. case equip_type
  408. when 0 # 武器
  409. if id == 0 or $game_party.weapon_number(id) > 0
  410. $game_party.gain_weapon(@weapon_id, 1)
  411. @weapon_id = id
  412. $game_party.lose_weapon(id, 1)
  413. # --- ここから追加部分 ---
  414. # 二刀武器じゃないものを装備した場合、盾の部分の二刀武器を外す
  415. if id != 0 and !$data_weapons[id].element_set.include?(Special_Element::get_index(Special_Element::TWO_WEAPONS))
  416. $game_party.gain_weapon(@weapon2_id, 1)
  417. @weapon2_id = 0
  418. end
  419. # --- 追加部分終わり ---
  420. end
  421. when 1 # 盾
  422. if id == 0 or $game_party.armor_number(id) > 0
  423. update_auto_state($data_armors[@armor1_id], $data_armors[id])
  424. $game_party.gain_armor(@armor1_id, 1)
  425. @armor1_id = id
  426. $game_party.lose_armor(id, 1)
  427. # --- ここから追加部分 ---
  428. # 二刀武器を装備していた場合は外す
  429. if id != 0
  430. $game_party.gain_weapon(@weapon2_id, 1)
  431. @weapon2_id = 0
  432. end
  433. # --- 追加部分終わり ---
  434. end
  435. when 2 # 頭
  436. if id == 0 or $game_party.armor_number(id) > 0
  437. update_auto_state($data_armors[@armor2_id], $data_armors[id])
  438. $game_party.gain_armor(@armor2_id, 1)
  439. @armor2_id = id
  440. $game_party.lose_armor(id, 1)
  441. end
  442. when 3 # 身体
  443. if id == 0 or $game_party.armor_number(id) > 0
  444. update_auto_state($data_armors[@armor3_id], $data_armors[id])
  445. $game_party.gain_armor(@armor3_id, 1)
  446. @armor3_id = id
  447. $game_party.lose_armor(id, 1)
  448. end
  449. when 4 # 装飾品
  450. if id == 0 or $game_party.armor_number(id) > 0
  451. update_auto_state($data_armors[@armor4_id], $data_armors[id])
  452. $game_party.gain_armor(@armor4_id, 1)
  453. @armor4_id = id
  454. $game_party.lose_armor(id, 1)
  455. end
  456. # --- ここから追加部分 ---
  457. when -1 # 二刀流の盾部分の武器
  458. if id == 0 or $game_party.weapon_number(id) > 0
  459. $game_party.gain_weapon(@weapon2_id, 1)
  460. @weapon2_id = id
  461. $game_party.lose_weapon(id, 1)
  462. # 盾を外す
  463. $game_party.gain_armor(@armor1_id, 1)
  464. @armor1_id = 0
  465. # 既に装備している武器が二刀武器じゃない場合は外す
  466. if id != 0 and @weapon_id != 0 and !$data_weapons[@weapon_id].element_set.include?(Special_Element::get_index(Special_Element::TWO_WEAPONS))
  467. $game_party.gain_weapon(@weapon_id, 1)
  468. @weapon_id = 0
  469. end
  470. end
  471. # --- 追加部分終わり ---
  472. end
  473. end
  474.  
  475. #--------------------------------------------------------------------------
  476. # ● 二刀流可能なアクターかどうか
  477. #--------------------------------------------------------------------------
  478. def can_two_weapons?
  479. return class_element_set.include?(Special_Element::get_index(Special_Element::TWO_WEAPONS))
  480. end
  481.  
  482. #--------------------------------------------------------------------------
  483. # ● アクターの所属クラスの属性がAのものを取得
  484. #--------------------------------------------------------------------------
  485. def class_element_set
  486. element_set = []
  487. for i in 1...$data_classes[@class_id].element_ranks.xsize
  488. element_set.push(i) if $data_classes[@class_id].element_ranks[i] == 1
  489. end
  490. return element_set
  491. end
  492. end
  493.  
  494.  
  495.  
  496.  
  497.  
  498. class Window_EquipRight < Window_Selectable
  499. #--------------------------------------------------------------------------
  500. # ● リフレッシュ
  501. #--------------------------------------------------------------------------
  502. def refresh
  503. self.contents.clear
  504. @data = []
  505. @data.push($data_weapons[@actor.weapon_id])
  506. # --- ここから変更部分 ---
  507. @data.push(@actor.weapon2_id != 0 ? $data_weapons[@actor.weapon2_id] : $data_armors[@actor.armor1_id])
  508. # --- 変更部分終わり ---
  509. @data.push($data_armors[@actor.armor2_id])
  510. @data.push($data_armors[@actor.armor3_id])
  511. @data.push($data_armors[@actor.armor4_id])
  512. @item_max = @data.size
  513. self.contents.font.color = system_color
  514. self.contents.draw_text(4, 32 * 0, 92, 32, $data_system.words.weapon)
  515. self.contents.draw_text(4, 32 * 1, 92, 32, $data_system.words.armor1)
  516. self.contents.draw_text(4, 32 * 2, 92, 32, $data_system.words.armor2)
  517. self.contents.draw_text(4, 32 * 3, 92, 32, $data_system.words.armor3)
  518. self.contents.draw_text(5, 32 * 4, 92, 32, $data_system.words.armor4)
  519. draw_item_name(@data[0], 92, 32 * 0)
  520. draw_item_name(@data[1], 92, 32 * 1)
  521. draw_item_name(@data[2], 92, 32 * 2)
  522. draw_item_name(@data[3], 92, 32 * 3)
  523. draw_item_name(@data[4], 92, 32 * 4)
  524. end
  525. end
  526.  
  527.  
  528.  
  529.  
  530.  
  531. class Window_EquipItem < Window_Selectable
  532. #--------------------------------------------------------------------------
  533. # ● リフレッシュ
  534. #--------------------------------------------------------------------------
  535. def refresh
  536. if self.contents != nil
  537. self.contents.dispose
  538. self.contents = nil
  539. end
  540. @data = []
  541. # 装備可能な武器を追加
  542. if @equip_type == 0
  543. weapon_set = $data_classes[@actor.class_id].weapon_set
  544. for i in 1...$data_weapons.size
  545. if $game_party.weapon_number(i) > 0 and weapon_set.include?(i)
  546. @data.push($data_weapons[i])
  547. end
  548. end
  549. end
  550. # --- ここから追加部分 ---
  551. # 二刀流可能なアクターの場合は、盾に二刀武器も表示
  552. if @equip_type == 1 and @actor.can_two_weapons?
  553. weapon_set = $data_classes[@actor.class_id].weapon_set
  554. for i in 1...$data_weapons.size
  555. if $game_party.weapon_number(i) > 0 and weapon_set.include?(i) and $data_weapons[i].element_set.include?(Special_Element::get_index(Special_Element::TWO_WEAPONS))
  556. @data.push($data_weapons[i])
  557. end
  558. end
  559. end
  560. # --- 追加部分終わり ---
  561. # 装備可能な防具を追加
  562. if @equip_type != 0
  563. armor_set = $data_classes[@actor.class_id].armor_set
  564. for i in 1...$data_armors.size
  565. if $game_party.armor_number(i) > 0 and armor_set.include?(i)
  566. if $data_armors[i].kind == @equip_type-1
  567. @data.push($data_armors[i])
  568. end
  569. end
  570. end
  571. end
  572. # 空白を追加
  573. @data.push(nil)
  574. # ビットマップを作成し、全項目を描画
  575. @item_max = @data.size
  576. self.contents = Bitmap.new(width - 32, row_max * 32)
  577. for i in 0...@item_max-1
  578. draw_item(i)
  579. end
  580. end
  581. end
  582.  
  583.  
  584.  
  585.  
  586.  
  587. class Scene_Equip
  588. #--------------------------------------------------------------------------
  589. # ● リフレッシュ
  590. #--------------------------------------------------------------------------
  591. def refresh
  592. # アイテムウィンドウの可視状態設定
  593. @item_window1.visible = (@right_window.index == 0)
  594. @item_window2.visible = (@right_window.index == 1)
  595. @item_window3.visible = (@right_window.index == 2)
  596. @item_window4.visible = (@right_window.index == 3)
  597. @item_window5.visible = (@right_window.index == 4)
  598. # 現在装備中のアイテムを取得
  599. item1 = @right_window.item
  600. # 現在のアイテムウィンドウを @item_window に設定
  601. case @right_window.index
  602. when 0
  603. @item_window = @item_window1
  604. when 1
  605. @item_window = @item_window2
  606. when 2
  607. @item_window = @item_window3
  608. when 3
  609. @item_window = @item_window4
  610. when 4
  611. @item_window = @item_window5
  612. end
  613. # ライトウィンドウがアクティブの場合
  614. if @right_window.active
  615. # 装備変更後のパラメータを消去
  616. @left_window.set_new_parameters(nil, nil, nil)
  617. end
  618. # アイテムウィンドウがアクティブの場合
  619. if @item_window.active
  620. # 現在選択中のアイテムを取得
  621. item2 = @item_window.item
  622. # 装備を変更
  623. last_hp = @actor.hp
  624. last_sp = @actor.sp
  625. # --- ここから変更部分 ---
  626. # 現在の装備を保存(装備の種類を増やしている場合はここを変更)
  627. equipments = [@actor.weapon2_id, @actor.weapon_id, @actor.armor1_id, @actor.armor2_id, @actor.armor3_id, @actor.armor4_id]
  628. index = equip_type(@right_window.index, item2);@actor.equip((index == -1 ? index : index.abs), item2 == nil ? 0 : item2.id)
  629. # --- 変更部分終わり ---
  630. # 装備変更後のパラメータを取得
  631. # 装備変更後のパラメータを取得
  632. new_atk = @actor.atk
  633. new_pdef = @actor.pdef
  634. new_mdef = @actor.mdef
  635. # --- ここから変更部分 ---
  636. # 装備を戻す
  637. for i in 0...equipments.size - 3
  638. @actor.equip(i - 1, equipments[i])
  639. end
  640. # --- 変更部分終わり ---
  641. @actor.hp = last_hp
  642. @actor.sp = last_sp
  643. # レフトウィンドウに描画
  644. @left_window.set_new_parameters(new_atk, new_pdef, new_mdef)
  645. end
  646. end
  647.  
  648. #--------------------------------------------------------------------------
  649. # ● フレーム更新 (アイテムウィンドウがアクティブの場合)
  650. #--------------------------------------------------------------------------
  651. def update_item
  652. # B ボタンが押された場合
  653. if Input.trigger?(Input::B)
  654. # キャンセル SE を演奏
  655. $game_system.se_play($data_system.cancel_se)
  656. # ライトウィンドウをアクティブ化
  657. @right_window.active = true
  658. @item_window.active = false
  659. @item_window.index = -1
  660. return
  661. end
  662. # C ボタンが押された場合
  663. if Input.trigger?(Input::C)
  664. # 装備 SE を演奏
  665. $game_system.se_play($data_system.equip_se)
  666. # アイテムウィンドウで現在選択されているデータを取得
  667. item = @item_window.item
  668. # --- ここから変更部分 ---
  669. # 装備を変更
  670. @actor.equip(equip_type(@right_window.index, item), item == nil ? 0 : item.id)
  671. # --- 変更部分終わり ---
  672. # ライトウィンドウをアクティブ化
  673. @right_window.active = true
  674. @item_window.active = false
  675. @item_window.index = -1
  676. # ライトウィンドウ、アイテムウィンドウの内容を再作成
  677. @right_window.refresh
  678. # --- ここから変更部分 ---
  679. # めんどくさいのですべてのウィンドウをリフレッシュ
  680. @item_window1.refresh
  681. @item_window2.refresh
  682. @item_window3.refresh
  683. @item_window4.refresh
  684. @item_window5.refresh
  685. # --- 変更部分終わり ---
  686. return
  687. end
  688. end
  689.  
  690. # --- ここから追加部分 ---
  691. #--------------------------------------------------------------------------
  692. # ● 二刀流用の装備部位取得
  693. #--------------------------------------------------------------------------
  694. def equip_type(index, item)
  695. return index * (item.is_a?(RPG::Armor) ? 1 : -1)
  696. end
  697. # --- 追加部分終わり ---
  698. end
  699.  
  700.  
  701.  
  702.  
  703.  
  704. class Scene_Battle
  705. #--------------------------------------------------------------------------
  706. # ● 基本アクション 結果作成
  707. #--------------------------------------------------------------------------
  708. def make_basic_action_result
  709. # 攻撃の場合
  710. if @active_battler.current_action.basic == 0
  711. # --- ここから変更部分 ---
  712. # アニメーション ID を設定
  713. @animation1_id = @active_battler.animation1_id.is_a?(Array) ? @active_battler.animation1_id.dup : @active_battler.animation1_id
  714. @animation2_id = @active_battler.animation2_id.is_a?(Array) ? @active_battler.animation2_id.dup : @active_battler.animation2_id
  715. # --- 変更部分終わり ---
  716. # 行動側バトラーがエネミーの場合
  717. if @active_battler.is_a?(Game_Enemy)
  718. if @active_battler.restriction == 3
  719. target = $game_troop.random_target_enemy
  720. elsif @active_battler.restriction == 2
  721. target = $game_party.random_target_actor
  722. else
  723. index = @active_battler.current_action.target_index
  724. target = $game_party.smooth_target_actor(index)
  725. end
  726. end
  727. # 行動側バトラーがアクターの場合
  728. if @active_battler.is_a?(Game_Actor)
  729. if @active_battler.restriction == 3
  730. target = $game_party.random_target_actor
  731. elsif @active_battler.restriction == 2
  732. target = $game_troop.random_target_enemy
  733. else
  734. index = @active_battler.current_action.target_index
  735. target = $game_troop.smooth_target_enemy(index)
  736. end
  737. end
  738. # 対象側バトラーの配列を設定
  739. @target_battlers = [target]
  740. # 通常攻撃の効果を適用
  741. for target in @target_battlers
  742. target.attack_effect(@active_battler)
  743. end
  744. return
  745. end
  746. # 防御の場合
  747. if @active_battler.current_action.basic == 1
  748. # ヘルプウィンドウに "防御" を表示
  749. @help_window.set_text($data_system.words.guard, 1)
  750. return
  751. end
  752. # 逃げるの場合
  753. if @active_battler.is_a?(Game_Enemy) and
  754. @active_battler.current_action.basic == 2
  755. # ヘルプウィンドウに "逃げる" を表示
  756. @help_window.set_text("逃げる", 1)
  757. # 逃げる
  758. @active_battler.escape
  759. return
  760. end
  761. # 何もしないの場合
  762. if @active_battler.current_action.basic == 3
  763. # アクション強制対象のバトラーをクリア
  764. $game_temp.forcing_battler = nil
  765. # ステップ 1 に移行
  766. @phase4_step = 1
  767. return
  768. end
  769. end
  770.  
  771. #--------------------------------------------------------------------------
  772. # ● フレーム更新 (メインフェーズ ステップ 3 : 行動側アニメーション)
  773. #--------------------------------------------------------------------------
  774. def update_phase4_step3
  775. # --- ここから変更部分 ---
  776. # アニメーションの配列の先頭を取り出す
  777. if @animation1_id.is_a?(Integer)
  778. @animation1_id = [@animation1_id]
  779. end
  780. animation = @animation1_id.shift
  781. # 行動側アニメーション (ID が 0 の場合は白フラッシュ)
  782. if animation == 0
  783. @active_battler.white_flash = true
  784. else
  785. @active_battler.animation_id = animation
  786. @active_battler.animation_hit = true
  787. end
  788. # アニメーションがなくなったらステップ 4 に移行
  789. @phase4_step = 4 if @animation1_id.empty?
  790. # --- 変更部分終わり ---
  791. end
  792.  
  793. #--------------------------------------------------------------------------
  794. # ● フレーム更新 (メインフェーズ ステップ 4 : 対象側アニメーション)
  795. #--------------------------------------------------------------------------
  796. def update_phase4_step4
  797. # --- ここから変更部分 ---
  798. # アニメーションの配列の先頭を取り出す
  799. if @animation2_id.is_a?(Integer)
  800. @animation2_id = [@animation2_id]
  801. end
  802. animation = @animation2_id.shift
  803. # 対象側アニメーション
  804. for target in @target_battlers
  805. target.animation_id = animation
  806. target.animation_hit = (target.damage != "Miss")
  807. end
  808. # アニメーションの長さにかかわらず、最低 8 フレーム待つ
  809. @wait_count = 8
  810. # アニメーションがなくなったらステップ 5 に移行
  811. @phase4_step = 5 if @animation2_id.empty?
  812. # --- 変更部分終わり ---
  813. end
  814. end

博客:我的博客

Lv5.捕梦者

梦石
0
星屑
34870
在线时间
4148 小时
注册时间
2007-12-15
帖子
9981
2
发表于 2018-11-16 06:07:41 | 只看该作者
本帖最后由 89444640 于 2018-11-16 06:10 编辑

soul,菜刀帮我改好的那个,直接给他能用吗?
职业有效度A什么的,好像是同一个。
好像是同一个脚本。
动画砍两下是比较好的解决方式,否则双刀本来就攻击力比别人高,再砍两次,四倍伤害,你要再有攻击加强Xx%的,平衡就没法做了。

点评

LZ的脚本删掉最下面的动画相关吧?  发表于 2018-11-16 11:54
回复 支持 反对

使用道具 举报

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

本版积分规则

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

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

GMT+8, 2024-4-24 01:23

Powered by Discuz! X3.1

© 2001-2013 Comsenz Inc.

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