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

Project1

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

[已经过期] 脚本冲突问题

[复制链接]

Lv5.捕梦者

梦石
0
星屑
30765
在线时间
607 小时
注册时间
2014-7-18
帖子
729

开拓者

跳转到指定楼层
1
发表于 2015-2-10 19:36:52 | 只看该作者 |只看大图 回帖奖励 |倒序浏览 |阅读模式

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

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

x
本帖最后由 xjzsq 于 2015-2-12 18:35 编辑

RUBY 代码复制
  1. #==============================================================================
  2. #
  3. # ¥ Yami Engine Symphony - Skill Equip
  4. # -- Last Updated: 2013.01.02
  5. # -- Level: Easy
  6. # -- Requires: n/a
  7. #
  8. #==============================================================================
  9. $imported = {} if $imported.nil?
  10. $imported["YES-SkillEquip"] = true
  11. #==============================================================================
  12. # ¥ Updates
  13. # =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  14. # 2013.01.02 - Fixed: Added Skills.
  15. # - Added: Non equip skill, notetag: <non equip skill>.
  16. # Non equip skills will always be usable in battle.
  17. # 2012.12.17 - Fixed: Big slots list.
  18. # 2012.12.12 - Fixed: Reverting slots issue.
  19. # 2012.12.08 - Compatible with: YEA - Victory Aftermath.
  20. # 2012.12.05 - Finished Script.
  21. # 2012.12.03 - Started Script.
  22. #
  23. #==============================================================================
  24. # ¥ Introduction
  25. # =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  26. # This script requires the player to make decisions as to which skills to bring
  27. # into battle for each character.
  28. #
  29. #==============================================================================
  30. # ¥ Instructions
  31. # =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  32. # To install this script, open up your script editor and copy/paste this script
  33. # to an open slot below ¥ Materials/‘fÞ but above ¥ Main. Remember to save.
  34. #
  35. #==============================================================================
  36. # ¥ Compatibility
  37. # =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  38. # This script is made strictly for RPG Maker VX Ace. It is highly unlikely that
  39. # it will run with RPG Maker VX without adjustments.
  40. #
  41. #==============================================================================
  42. #==============================================================================
  43. # ¡ Configuration
  44. #==============================================================================
  45. module YES
  46. module SKILL_EQUIP
  47. #===========================================================================
  48. # - Basic Settings -
  49. #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  50. # The following below will adjust the basic ruleset that the skill equip
  51. # system will use. Visual settings will also be adjusted here.
  52. #===========================================================================
  53. COMMAND = "Equip Skill" # This is the category title that appears for
  54. # the skill equip option.
  55. EQUIP_SKILL_SWITCH = 43 # This switch must be enabled in order for the
  56. # Equip Skill command to appear in the skill menu.
  57. # These are the visual settings used when a skill isn't equipped.
  58. EMPTY_SKILL_HELP = "No skill is equipped in this slot.\n
  59. Press Enter to assign skill."
  60. EMPTY_SKILL_TEXT = "<Empty Slot>" # Text used for no skill equipped.
  61. EMPTY_SKILL_ICON = 185 # Icon used for no skill equipped.
  62. # This constant adjusts the default maximum amount of equipped skills that
  63. # an actor can have without modifications.
  64. DEFAULT_MAX_EQUIPS = 6
  65. #===========================================================================
  66. # - Description Settings -
  67. #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  68. # The following below will adjust the description window, which includes
  69. # skill's properties and description.
  70. # Here's the list of default properties:
  71. # -------------------------------------------------------------------------
  72. # :symbol Description
  73. # -------------------------------------------------------------------------
  74. # :stype Skill Type.
  75. # :cost Skill Cost.
  76. # :speed Speed Fix.
  77. # :success Success Rate.
  78. #===========================================================================
  79. # Default displayed properties of each skill.
  80. DEFAULT_PROPERTIES = [ # Start.
  81. :stype, # Skill Type
  82. :cost, # Mana/TP Cost
  83. :speed, # Speed Fix
  84. :success, # Success Rate
  85. ] # End.
  86. # Default displaying texts for properties.
  87. PROPERTIES = { # Start.
  88. :stype => "分類",
  89. :cost => "PP",
  90. :speed => "速度修正",
  91. :success => "命中率",
  92. } # End.
  93. end
  94. end
  95. #==============================================================================
  96. # ¥ Editting anything past this point may potentially result in causing
  97. # computer damage, incontinence, explosion of user's head, coma, death, and/or
  98. # halitosis so edit at your own risk.
  99. #==============================================================================
  100. #==============================================================================
  101. # ¡ Regular Expression
  102. #==============================================================================
  103. module REGEXP
  104. module SKILL_EQUIP
  105. MAX_EQUIPS = /<(?:SKILL_SLOTS|skill slots):[ ]*(\d+)>/i
  106. CHANGE_EQUIPS = /<(?:CHANGE_SLOTS|change slots):[ ]*([\+\-]?\d+)>/i
  107. VALUE_DESCRIPTION = /<(?:SKILL_INFO|skill info)[ ](.*):[ ]*(.*)>/i
  108. NON_EQUIP = /<(?:NON_EQUIP_SKILL|non equip skill)>/i
  109. end # SKILL_EQUIP
  110. end # REGEXP
  111. #==============================================================================
  112. # ¡ DataManager
  113. #==============================================================================
  114. module DataManager
  115. #--------------------------------------------------------------------------
  116. # alias method: load_database
  117. #--------------------------------------------------------------------------
  118. class <<self; alias load_database_skill_equip load_database; end
  119. def self.load_database
  120. load_database_skill_equip
  121. initialize_skill_equip
  122. end
  123. #--------------------------------------------------------------------------
  124. # alias method: create_game_objects
  125. #--------------------------------------------------------------------------
  126. class <<self; alias create_game_objects_skill_equip create_game_objects; end
  127. def self.create_game_objects
  128. create_game_objects_skill_equip
  129. $game_switches[YES::SKILL_EQUIP::EQUIP_SKILL_SWITCH] = true
  130. end
  131. #--------------------------------------------------------------------------
  132. # new method: initialize_skill_equip
  133. #--------------------------------------------------------------------------
  134. def self.initialize_skill_equip
  135. groups = [$data_actors, $data_classes, $data_weapons, $data_armors, $data_skills]
  136. groups.each { |group|
  137. group.each { |obj|
  138. next if obj.nil?
  139. obj.initialize_skill_equip
  140. }
  141. }
  142. end
  143. end # DataManager
  144. #==============================================================================
  145. # ¡ RPG::BaseItem
  146. #==============================================================================
  147. class RPG::BaseItem
  148. #--------------------------------------------------------------------------
  149. # * Public Instance Variables
  150. #--------------------------------------------------------------------------
  151. attr_accessor :skill_slots
  152. attr_accessor :change_slots
  153. attr_accessor :slot_properties
  154. attr_accessor :non_equip_skill
  155. #--------------------------------------------------------------------------
  156. # new method: initialize_skill_equip
  157. #--------------------------------------------------------------------------
  158. def initialize_skill_equip
  159. @change_slots = 0
  160. @slot_properties = []
  161. self.note.split(/[\r\n]+/).each { |line|
  162. case line
  163. when REGEXP::SKILL_EQUIP::MAX_EQUIPS
  164. @skill_slots = $1.to_i
  165. when REGEXP::SKILL_EQUIP::CHANGE_EQUIPS
  166. @change_slots = $1.to_i
  167. when REGEXP::SKILL_EQUIP::VALUE_DESCRIPTION
  168. @slot_properties.push([$1.to_s, $2.to_s])
  169. when REGEXP::SKILL_EQUIP::NON_EQUIP
  170. @non_equip_skill = true
  171. end
  172. }
  173. end
  174. end # RPG::BaseItem
  175. #==============================================================================
  176. # ¡ Game_Actor
  177. #==============================================================================
  178. class Game_Actor < Game_Battler
  179. #--------------------------------------------------------------------------
  180. # * Public Instance Variables
  181. #--------------------------------------------------------------------------
  182. attr_reader :equip_skills
  183. #--------------------------------------------------------------------------
  184. # alias method: setup
  185. #--------------------------------------------------------------------------
  186. alias yes_skill_equip_setup setup
  187. def setup(actor_id)
  188. yes_skill_equip_setup(actor_id)
  189. correct_equip_skills
  190. end
  191. #--------------------------------------------------------------------------
  192. # alias method: refresh
  193. #--------------------------------------------------------------------------
  194. alias yes_skill_equip_refresh refresh
  195. def refresh
  196. yes_skill_equip_refresh
  197. correct_equip_skills
  198. correct_skill_slots
  199. end
  200. #--------------------------------------------------------------------------
  201. # new method: base_skill_slots
  202. #--------------------------------------------------------------------------
  203. def base_skill_slots
  204. array = [self.class.skill_slots, self.actor.skill_slots]
  205. default = YES::SKILL_EQUIP::DEFAULT_MAX_EQUIPS
  206. array.compact.size > 0 ? array.compact[0] : default
  207. end
  208. #--------------------------------------------------------------------------
  209. # new method: change_slots
  210. #--------------------------------------------------------------------------
  211. def change_slots
  212. array = self.equips + [self.class, self.actor]
  213. array.compact.inject(0) { |r, o| r += o.change_slots }
  214. end
  215. #--------------------------------------------------------------------------
  216. # new method: skill_slots
  217. #--------------------------------------------------------------------------
  218. def skill_slots
  219. [base_skill_slots + change_slots, 0].max
  220. end
  221. #--------------------------------------------------------------------------
  222. # new method: correct_skill_slots
  223. #--------------------------------------------------------------------------
  224. def correct_skill_slots
  225. if @equip_skills.size < skill_slots
  226. @equip_skills = @equip_skills + Array.new(skill_slots - @equip_skills.size, 0)
  227. else
  228. @equip_skills = @equip_skills[0, skill_slots]
  229. end
  230. end
  231. #--------------------------------------------------------------------------
  232. # new method: correct_equip_skills
  233. #--------------------------------------------------------------------------
  234. def correct_equip_skills
  235. if @equip_skills.nil?
  236. @equip_skills = Array.new(skill_slots, 0)
  237. #---
  238. j = 0
  239. all_skills.each_index { |i|
  240. break if i == @equip_skills.size
  241. while all_skills[j] && $data_skills[all_skills[j]].non_equip_skill
  242. j += 1
  243. end
  244. @equip_skills[i] = all_skills[j]
  245. j += 1
  246. }
  247. end
  248. #---
  249. @equip_skills.each_index { |i|
  250. id = @equip_skills[i]
  251. next if id == 0
  252. @equip_skills[i] = 0 unless all_skills.include?(id)
  253. }
  254. end
  255. #--------------------------------------------------------------------------
  256. # new method: all_skills
  257. #--------------------------------------------------------------------------
  258. def all_skills
  259. (@skills | added_skills).sort
  260. end
  261. #--------------------------------------------------------------------------
  262. # new method: equip_skill
  263. #--------------------------------------------------------------------------
  264. def equip_skill(index, id)
  265. return false unless skill_equippable?(id)
  266. if @equip_skills.include?(id) && id != 0
  267. @equip_skills[@equip_skills.index(id)] = @equip_skills[index]
  268. end
  269. @equip_skills[index] = id
  270. end
  271. #--------------------------------------------------------------------------
  272. # new method: skill_equippable?
  273. #--------------------------------------------------------------------------
  274. def skill_equippable?(id)
  275. return true
  276. end
  277. #--------------------------------------------------------------------------
  278. # new method: equipped_skills
  279. #--------------------------------------------------------------------------
  280. def equipped_skills
  281. @equip_skills.select{|id|id != 0}.collect{|id|$data_skills[id]}
  282. end
  283. #--------------------------------------------------------------------------
  284. # alias method: skills
  285. # Overwrite in Battle
  286. #--------------------------------------------------------------------------
  287. alias yes_skill_equip_skills skills
  288. def skills
  289. if $game_party.in_battle && !$game_troop.all_dead?
  290. return equipped_skills + yes_skill_equip_skills.select{|s|s.non_equip_skill}
  291. else
  292. return yes_skill_equip_skills
  293. end
  294. end
  295. end # Game_Actor
  296. #==============================================================================
  297. # ¡ Window_SkillSlots
  298. #==============================================================================
  299. class Window_SkillSlots < Window_Selectable
  300. #--------------------------------------------------------------------------
  301. # initialize
  302. #--------------------------------------------------------------------------
  303. def initialize(x, y, height)
  304. super(x, y, Graphics.width / 2, height)
  305. self.index = 0
  306. self.hide
  307. end
  308. #--------------------------------------------------------------------------
  309. # item_max
  310. #--------------------------------------------------------------------------
  311. def item_max
  312. @actor.nil? ? 1 : @actor.skill_slots
  313. end
  314. #--------------------------------------------------------------------------
  315. # current_item_enabled?
  316. #--------------------------------------------------------------------------
  317. def current_item_enabled?
  318. @actor && @actor.skill_slots > 0
  319. end
  320. #--------------------------------------------------------------------------
  321. # actor=
  322. #--------------------------------------------------------------------------
  323. def actor=(actor)
  324. return if @actor == actor
  325. @actor = actor
  326. update_padding
  327. create_contents
  328. refresh
  329. self.oy = 0
  330. @index = 0
  331. end
  332. #--------------------------------------------------------------------------
  333. # draw_item
  334. #--------------------------------------------------------------------------
  335. def draw_item(index)
  336. skill_id = @actor.equip_skills[index]
  337. #---
  338. return if skill_id.nil?
  339. reset_font_settings
  340. draw_item_none(index) if skill_id <= 0
  341. draw_item_name(index, skill_id) if skill_id > 0
  342. end
  343. #--------------------------------------------------------------------------
  344. # draw_item_none
  345. #--------------------------------------------------------------------------
  346. def draw_item_none(index)
  347. rect = item_rect(index)
  348. #---
  349. change_color(normal_color, false)
  350. draw_icon(YES::SKILL_EQUIP::EMPTY_SKILL_ICON, rect.x, rect.y, false)
  351. rect.x += 24
  352. draw_text(rect, YES::SKILL_EQUIP::EMPTY_SKILL_TEXT, 0)
  353. end
  354. #--------------------------------------------------------------------------
  355. # draw_item_name
  356. #--------------------------------------------------------------------------
  357. def draw_item_name(index, skill_id, enabled = true)
  358. rect = item_rect(index)
  359. item = $data_skills[skill_id]
  360. #---
  361. change_color(normal_color, enabled)
  362. draw_icon(item.icon_index, rect.x, rect.y, enabled)
  363. rect.x += 24
  364. draw_text(rect, item.name, 0)
  365. end
  366. #--------------------------------------------------------------------------
  367. # propertise_window=
  368. #--------------------------------------------------------------------------
  369. def properties_window=(properties_window)
  370. @properties_window = properties_window
  371. id = @actor.equip_skills[index]
  372. item = id.nil? ? nil : $data_skills[id]
  373. @properties_window.set_item(item)
  374. end
  375. #--------------------------------------------------------------------------
  376. # update_help
  377. #--------------------------------------------------------------------------
  378. def update_help
  379. id = @actor.equip_skills[index]
  380. item = id.nil? ? nil : $data_skills[id]
  381. empty_text = YES::SKILL_EQUIP::EMPTY_SKILL_HELP
  382. item.nil? ? @help_window.set_text(empty_text) : @help_window.set_item(item)
  383. @properties_window.set_item(item) if @properties_window
  384. end
  385. end # Window_SkillSlots
  386. #==============================================================================
  387. # ¡ Window_SkillList_Equip
  388. #==============================================================================
  389. class Window_SkillList_Equip < Window_SkillList
  390. #--------------------------------------------------------------------------
  391. # initialize
  392. #--------------------------------------------------------------------------
  393. def initialize(x, y, width, height)
  394. super
  395. self.hide
  396. self.index = 0
  397. end
  398. #--------------------------------------------------------------------------
  399. # col_max
  400. #--------------------------------------------------------------------------
  401. def col_max
  402. return 1
  403. end
  404. #--------------------------------------------------------------------------
  405. # enable?
  406. #--------------------------------------------------------------------------
  407. def enable?(item)
  408. @actor
  409. end
  410. #--------------------------------------------------------------------------
  411. # include?
  412. #--------------------------------------------------------------------------
  413. def include?(item)
  414. item
  415. end
  416. #--------------------------------------------------------------------------
  417. # make_item_list
  418. #--------------------------------------------------------------------------
  419. def make_item_list
  420. super
  421. @data = [0] + @data.select{|s|!s.non_equip_skill}
  422. end
  423. #--------------------------------------------------------------------------
  424. # draw_item
  425. #--------------------------------------------------------------------------
  426. def draw_item(index)
  427. skill = @data[index]
  428. if skill && skill.is_a?(RPG::Skill)
  429. rect = item_rect(index)
  430. rect.width -= 4
  431. draw_item_name(skill, rect.x, rect.y, enable?(skill))
  432. else
  433. rect = item_rect(index)
  434. rect.width -= 4
  435. change_color(normal_color, false)
  436. draw_icon(YES::SKILL_EQUIP::EMPTY_SKILL_ICON, rect.x, rect.y, false)
  437. rect.x += 24
  438. draw_text(rect, YES::SKILL_EQUIP::EMPTY_SKILL_TEXT, 0)
  439. end
  440. end
  441. #--------------------------------------------------------------------------
  442. # item
  443. #--------------------------------------------------------------------------
  444. def item
  445. @data && @data[index] == 0 ? @data[index] : super
  446. end
  447. #--------------------------------------------------------------------------
  448. # properties_window=
  449. #--------------------------------------------------------------------------
  450. def properties_window=(properties_window)
  451. @properties_window = properties_window
  452. end
  453. #--------------------------------------------------------------------------
  454. # update_help
  455. #--------------------------------------------------------------------------
  456. def update_help
  457. empty_text = YES::SKILL_EQUIP::EMPTY_SKILL_HELP
  458. item == 0 ? @help_window.set_text(empty_text) : @help_window.set_item(item)
  459. @properties_window.set_item(item) if @properties_window
  460. end
  461. end # Window_SkillList_Equip
  462. #==============================================================================
  463. # ¡ Window_Properties_Slot
  464. #==============================================================================
  465. class Window_Properties_Slot < Window_Base
  466. #--------------------------------------------------------------------------
  467. # initialize
  468. #--------------------------------------------------------------------------
  469. def initialize(x, y, width, height)
  470. super(x, y, width, height)
  471. @item = nil
  472. @actor = nil
  473. self.hide
  474. refresh
  475. end
  476. #--------------------------------------------------------------------------
  477. # refresh
  478. #--------------------------------------------------------------------------
  479. def refresh
  480. contents.clear
  481. return unless @actor
  482. if @item.nil? || @item == 0
  483. reset_font_settings
  484. change_color(normal_color, false)
  485. draw_icon(YES::SKILL_EQUIP::EMPTY_SKILL_ICON, 0, 0, false)
  486. draw_text(24, 0, contents.width, line_height, YES::SKILL_EQUIP::EMPTY_SKILL_TEXT)
  487. end
  488. return if @item.nil? || @item == 0
  489. reset_font_settings
  490. #---
  491. draw_item_name(@item, 0, 0)
  492. #---
  493. i = 0; hash = YES::SKILL_EQUIP::DEFAULT_PROPERTIES
  494. contents.font.size -= 2
  495. hash.each { |p| h = (i + 1) * line_height
  496. case p
  497. when :stype
  498. draw_skill_type(h)
  499. when :cost
  500. draw_skill_cost(h)
  501. when :speed
  502. draw_skill_speed(h)
  503. when :success
  504. draw_skill_rate(h)
  505. end
  506. i += 1
  507. }
  508. #---
  509. i = hash.size
  510. @item.slot_properties.each { |a| h = (i + 1) * line_height
  511. draw_skill_properties(a, h)
  512. i += 1 }
  513. end
  514. #--------------------------------------------------------------------------
  515. # draw_skill_type
  516. #--------------------------------------------------------------------------
  517. def draw_skill_type(y)
  518. w = contents.width
  519. change_color(system_color)
  520. draw_text(0, y, w, line_height, YES::SKILL_EQUIP::PROPERTIES[:stype])
  521. change_color(normal_color)
  522. draw_text(0, y, w, line_height, $data_system.skill_types[@item.stype_id], 2)
  523. end
  524. #--------------------------------------------------------------------------
  525. # draw_skill_cost
  526. #--------------------------------------------------------------------------
  527. def draw_skill_cost(h)
  528. if $imported["YEA-SkillCostManager"]
  529. draw_skill_cost_advanced(h)
  530. else
  531. rect = Rect.new(0,h,contents.width,line_height)
  532. #---
  533. change_color(system_color)
  534. draw_text(rect, YES::SKILL_EQUIP::PROPERTIES[:cost])
  535. #---
  536. if @actor.skill_tp_cost(@item) > 0
  537. change_color(tp_cost_color)
  538. text = @actor.skill_tp_cost(@item).to_s + Vocab.tp_a
  539. draw_text(rect, text, 2)
  540. rect.width -= text_size(text).width + 4
  541. end
  542. #---
  543. if @actor.skill_mp_cost(@item) > 0
  544. change_color(mp_cost_color)
  545. text = @actor.skill_mp_cost(@item).to_s + Vocab.mp_a
  546. draw_text(rect, text, 2)
  547. end
  548. end
  549. end
  550. #--------------------------------------------------------------------------
  551. # draw_skill_cost_advanced
  552. #--------------------------------------------------------------------------
  553. def draw_skill_cost_advanced(h)
  554. rect = Rect.new(0,h,contents.width,line_height)
  555. #---
  556. change_color(system_color)
  557. draw_text(rect, YES::SKILL_EQUIP::PROPERTIES[:cost])
  558. #---
  559. draw_tp_skill_cost(rect, @item) unless $imported["YEA-BattleEngine"]
  560. draw_mp_skill_cost(rect, @item)
  561. draw_tp_skill_cost(rect, @item) if $imported["YEA-BattleEngine"]
  562. draw_hp_skill_cost(rect, @item)
  563. draw_gold_skill_cost(rect, @item)
  564. draw_custom_skill_cost(rect, @item)
  565. end
  566. #--------------------------------------------------------------------------
  567. # draw_skill_speed
  568. #--------------------------------------------------------------------------
  569. def draw_skill_speed(y)
  570. w = contents.width
  571. change_color(system_color)
  572. draw_text(0, y, w, line_height, YES::SKILL_EQUIP::PROPERTIES[:speed])
  573. change_color(normal_color)
  574. draw_text(0, y, w, line_height, @item.speed.to_s, 2)
  575. end
  576. #--------------------------------------------------------------------------
  577. # draw_skill_rate
  578. #--------------------------------------------------------------------------
  579. def draw_skill_rate(y)
  580. w = contents.width
  581. change_color(system_color)
  582. draw_text(0, y, w, line_height, YES::SKILL_EQUIP::PROPERTIES[:success])
  583. change_color(normal_color)
  584. draw_text(0, y, w, line_height, @item.success_rate.to_s + "%", 2)
  585. end
  586. #--------------------------------------------------------------------------
  587. # draw_skill_properties
  588. #--------------------------------------------------------------------------
  589. def draw_skill_properties(a, y)
  590. w = contents.width
  591. change_color(system_color)
  592. draw_text(0, y, w, line_height, a[0])
  593. change_color(normal_color)
  594. draw_text(0, y, w, line_height, a[1], 2)
  595. end
  596. #--------------------------------------------------------------------------
  597. # set_item
  598. #--------------------------------------------------------------------------
  599. def set_item(item)
  600. if @item != item
  601. @item = item
  602. refresh
  603. end
  604. end
  605. #--------------------------------------------------------------------------
  606. # actor=
  607. #--------------------------------------------------------------------------
  608. def actor=(actor)
  609. @actor = actor
  610. end
  611. #--------------------------------------------------------------------------
  612. # Yanfly Engine Ace - Skill Cost Manager
  613. #--------------------------------------------------------------------------
  614. if $imported["YEA-SkillCostManager"]
  615. #--------------------------------------------------------------------------
  616. # new method: draw_mp_skill_cost
  617. #--------------------------------------------------------------------------
  618. def draw_mp_skill_cost(rect, skill)
  619. return unless @actor.skill_mp_cost(skill) > 0
  620. contents.font.size -= 2
  621. change_color(mp_cost_color)
  622. #---
  623. icon = Icon.mp_cost
  624. if icon > 0
  625. draw_icon(icon, rect.x + rect.width-24, rect.y)
  626. rect.width -= 24
  627. end
  628. #---
  629. contents.font.size = YEA::SKILL_COST::MP_COST_SIZE
  630. cost = @actor.skill_mp_cost(skill)
  631. text = sprintf(YEA::SKILL_COST::MP_COST_SUFFIX, cost.group)
  632. draw_text(rect, text, 2)
  633. cx = text_size(text).width + 4
  634. rect.width -= cx
  635. reset_font_settings
  636. end
  637. #--------------------------------------------------------------------------
  638. # new method: draw_tp_skill_cost
  639. #--------------------------------------------------------------------------
  640. def draw_tp_skill_cost(rect, skill)
  641. return unless @actor.skill_tp_cost(skill) > 0
  642. contents.font.size -= 2
  643. change_color(tp_cost_color)
  644. #---
  645. icon = Icon.tp_cost
  646. if icon > 0
  647. draw_icon(icon, rect.x + rect.width-24, rect.y)
  648. rect.width -= 24
  649. end
  650. #---
  651. contents.font.size = YEA::SKILL_COST::TP_COST_SIZE
  652. cost = @actor.skill_tp_cost(skill)
  653. text = sprintf(YEA::SKILL_COST::TP_COST_SUFFIX, cost.group)
  654. draw_text(rect, text, 2)
  655. cx = text_size(text).width + 4
  656. rect.width -= cx
  657. reset_font_settings
  658. end
  659. #--------------------------------------------------------------------------
  660. # new method: draw_hp_skill_cost
  661. #--------------------------------------------------------------------------
  662. def draw_hp_skill_cost(rect, skill)
  663. return unless @actor.skill_hp_cost(skill) > 0
  664. contents.font.size -= 2
  665. change_color(hp_cost_color)
  666. #---
  667. icon = Icon.hp_cost
  668. if icon > 0
  669. draw_icon(icon, rect.x + rect.width-24, rect.y)
  670. rect.width -= 24
  671. end
  672. #---
  673. contents.font.size = YEA::SKILL_COST::HP_COST_SIZE
  674. cost = @actor.skill_hp_cost(skill)
  675. text = sprintf(YEA::SKILL_COST::HP_COST_SUFFIX, cost.group)
  676. draw_text(rect, text, 2)
  677. cx = text_size(text).width + 4
  678. rect.width -= cx
  679. reset_font_settings
  680. end
  681. #--------------------------------------------------------------------------
  682. # new method: draw_gold_skill_cost
  683. #--------------------------------------------------------------------------
  684. def draw_gold_skill_cost(rect, skill)
  685. return unless @actor.skill_gold_cost(skill) > 0
  686. contents.font.size -= 2
  687. change_color(gold_cost_color)
  688. #---
  689. icon = Icon.gold_cost
  690. if icon > 0
  691. draw_icon(icon, rect.x + rect.width-24, rect.y)
  692. rect.width -= 24
  693. end
  694. #---
  695. contents.font.size = YEA::SKILL_COST::GOLD_COST_SIZE
  696. cost = @actor.skill_gold_cost(skill)
  697. text = sprintf(YEA::SKILL_COST::GOLD_COST_SUFFIX, cost.group)
  698. draw_text(rect, text, 2)
  699. cx = text_size(text).width + 4
  700. rect.width -= cx
  701. reset_font_settings
  702. end
  703. #--------------------------------------------------------------------------
  704. # new method: draw_custom_skill_cost
  705. #--------------------------------------------------------------------------
  706. def draw_custom_skill_cost(rect, skill)
  707. return unless skill.use_custom_cost
  708. contents.font.size -= 2
  709. change_color(text_color(skill.custom_cost_colour))
  710. icon = skill.custom_cost_icon
  711. if icon > 0
  712. draw_icon(icon, rect.x + rect.width-24, rect.y)
  713. rect.width -= 24
  714. end
  715. contents.font.size = skill.custom_cost_size
  716. text = skill.custom_cost_text
  717. draw_text(rect, text, 2)
  718. cx = text_size(text).width + 4
  719. rect.width -= cx
  720. reset_font_settings
  721. end
  722. end
  723. end # Window_Properties_Slot
  724. #==============================================================================
  725. # ¡ Window_SkillCommand
  726. #==============================================================================
  727. class Window_SkillCommand < Window_Command
  728. #--------------------------------------------------------------------------
  729. # alias method: make_command_list
  730. #--------------------------------------------------------------------------
  731. unless $imported["YEA-SkillMenu"]
  732. alias yes_skill_equip_make_command_list make_command_list
  733. def make_command_list
  734. yes_skill_equip_make_command_list
  735. add_command(YES::SKILL_EQUIP::COMMAND, :equip_skill, $game_switches[YES::SKILL_EQUIP::EQUIP_SKILL_SWITCH])
  736. end
  737. end
  738. end # Window_SkillCommand
  739. #==============================================================================
  740. # ¡ Scene_Skill
  741. #==============================================================================
  742. class Scene_Skill < Scene_ItemBase
  743. #--------------------------------------------------------------------------
  744. # alias method: start
  745. #--------------------------------------------------------------------------
  746. alias yes_skill_equip_start start
  747. def start
  748. yes_skill_equip_start
  749. create_slots_window
  750. create_skill_equip_window
  751. create_properties_window
  752. end
  753. #--------------------------------------------------------------------------
  754. # alias method: create_command_window
  755. #--------------------------------------------------------------------------
  756. alias yes_skill_equip_create_command_window create_command_window
  757. def create_command_window
  758. yes_skill_equip_create_command_window
  759. @command_window.set_handler(:equip_skill, method(:command_equip_skill))
  760. end
  761. #--------------------------------------------------------------------------
  762. # new method: create_slots_window
  763. #--------------------------------------------------------------------------
  764. def create_slots_window
  765. wx = 0
  766. wy = @status_window.y + @status_window.height
  767. wh = Graphics.height - wy
  768. @slots_window = Window_SkillSlots.new(wx, wy, wh)
  769. @slots_window.viewport = @viewport
  770. @slots_window.help_window = @help_window
  771. @slots_window.actor = @actor
  772. @slots_window.set_handler(:ok, method(:on_slot_ok))
  773. @slots_window.set_handler(:cancel, method(:on_slot_cancel))
  774. end
  775. #--------------------------------------------------------------------------
  776. # new method: create_skill_equip_window
  777. #--------------------------------------------------------------------------
  778. def create_skill_equip_window
  779. wx = 0
  780. wy = @status_window.y + @status_window.height
  781. ww = Graphics.width / 2
  782. wh = Graphics.height - wy
  783. @skill_equip = Window_SkillList_Equip.new(wx, wy, ww, wh)
  784. @skill_equip.viewport = @viewport
  785. @skill_equip.help_window = @help_window
  786. @skill_equip.actor = @actor
  787. @skill_equip.set_handler(:ok, method(:on_skill_equip_ok))
  788. @skill_equip.set_handler(:cancel, method(:on_skill_equip_cancel))
  789. end
  790. #--------------------------------------------------------------------------
  791. # new method: create_properties_window
  792. #--------------------------------------------------------------------------
  793. def create_properties_window
  794. wx = @slots_window.width
  795. wy = @status_window.y + @status_window.height
  796. ww = Graphics.width / 2
  797. wh = Graphics.height - wy
  798. @properties_window = Window_Properties_Slot.new(wx, wy, ww, wh)
  799. @properties_window.viewport = @viewport
  800. @properties_window.actor = @actor
  801. @slots_window.properties_window = @properties_window
  802. @skill_equip.properties_window = @properties_window
  803. end
  804. #--------------------------------------------------------------------------
  805. # new method: command_equip_skill
  806. #--------------------------------------------------------------------------
  807. def command_equip_skill
  808. @slots_window.activate
  809. end
  810. #--------------------------------------------------------------------------
  811. # new method: on_slot_ok
  812. #--------------------------------------------------------------------------
  813. def on_slot_ok
  814. @slots_window.deactivate.hide
  815. @skill_equip.show.activate
  816. end
  817. #--------------------------------------------------------------------------
  818. # new method: on_slot_cancel
  819. #--------------------------------------------------------------------------
  820. def on_slot_cancel
  821. @slots_window.deactivate
  822. @command_window.activate
  823. end
  824. #--------------------------------------------------------------------------
  825. # new method: on_skill_equip_ok
  826. #--------------------------------------------------------------------------
  827. def on_skill_equip_ok
  828. id = @skill_equip.item == 0 ? 0 : @skill_equip.item.id
  829. @actor.equip_skill(@slots_window.index, id)
  830. @slots_window.refresh
  831. @skill_equip.deactivate.hide
  832. @slots_window.show.activate
  833. end
  834. #--------------------------------------------------------------------------
  835. # new method: on_skill_equip_cancel
  836. #--------------------------------------------------------------------------
  837. def on_skill_equip_cancel
  838. @skill_equip.deactivate.hide
  839. @slots_window.show.activate
  840. end
  841. #--------------------------------------------------------------------------
  842. # super method: update
  843. #--------------------------------------------------------------------------
  844. def update
  845. super
  846. if @command_window.active
  847. if @command_window.current_symbol == :equip_skill
  848. @item_window.hide
  849. @slots_window.show
  850. @properties_window.show
  851. else
  852. @slots_window.hide
  853. @properties_window.hide
  854. @item_window.show
  855. end
  856. end
  857. end
  858. #--------------------------------------------------------------------------
  859. # alias method: on_actor_change
  860. #--------------------------------------------------------------------------
  861. alias yes_skill_equip_on_actor_change on_actor_change
  862. def on_actor_change
  863. yes_skill_equip_on_actor_change
  864. @slots_window.index = 0
  865. @skill_equip.index = 0
  866. @slots_window.actor = @actor
  867. @skill_equip.actor = @actor
  868. @properties_window.actor = @actor
  869. @slots_window.properties_window = @properties_window
  870. end
  871. end # Scene_Skill
  872. #==============================================================================
  873. #
  874. # ¥ End of File
  875. #
  876. #==============================================================================
RUBY 代码复制
  1. $脸图战斗 = true
  2. $imported = {} if $imported.nil?
  3. module YEA
  4.   module BATTLE
  5.     SKIP_PARTY_COMMAND = true
  6.     BATTLESTATUS_NAME_FONT_SIZE = 20
  7.     BATTLESTATUS_TEXT_FONT_SIZE = 16
  8.     BATTLESTATUS_NO_ACTION_ICON = 185
  9.     BATTLESTATUS_HPGAUGE_Y_PLUS = 11
  10.     BATTLESTATUS_CENTER_FACES   = false
  11.     HELP_TEXT_ALL_FOES        = "全体敌人"
  12.     HELP_TEXT_ONE_RANDOM_FOE  = "单个敌人"
  13.     HELP_TEXT_MANY_RANDOM_FOE = "%d个随机敌人"
  14.     HELP_TEXT_ALL_ALLIES      = "全体队友"
  15.     HELP_TEXT_ALL_DEAD_ALLIES = "全体死亡队友"
  16.     HELP_TEXT_ONE_RANDOM_ALLY = "单个随机队友"
  17.     HELP_TEXT_RANDOM_ALLIES   = "%d个随机队友"
  18.   end
  19. end
  20. class Game_Battler
  21.   def can_collapse?
  22.     return false unless dead?
  23.     unless actor?
  24.       return false unless sprite.battler_visible
  25.       array = [:collapse, :boss_collapse, :instant_collapse]
  26.       return false if array.include?(sprite.effect_type)
  27.     end
  28.     return true
  29.   end
  30.   def draw_mp?
  31.     return true
  32.   end
  33.   def draw_tp?
  34.     return $data_system.opt_display_tp
  35.   end
  36. end
  37. module Icon
  38.   def self.no_action; return YEA::BATTLE::BATTLESTATUS_NO_ACTION_ICON; end
  39. end
  40. class Game_Temp
  41.   attr_accessor :battle_aid
  42.   attr_accessor :evaluating
  43. end
  44. class Game_Action
  45.   alias evaluate_item_with_target_abe evaluate_item_with_target
  46.   def evaluate_item_with_target(target)
  47.     $game_temp.evaluating = true
  48.     result = evaluate_item_with_target_abe(target)
  49.     $game_temp.evaluating = false
  50.     return result
  51.   end
  52. end
  53. class Game_Actor < Game_Battler
  54.   def draw_mp?
  55.     return true unless draw_tp?
  56.     for skill in skills
  57.       next unless added_skill_types.include?(skill.stype_id)
  58.       return true if skill.mp_cost > 0
  59.     end
  60.     return false
  61.   end
  62.   def draw_tp?
  63.     return false unless $data_system.opt_display_tp
  64.     for skill in skills
  65.       next unless added_skill_types.include?(skill.stype_id)
  66.       return true if skill.tp_cost > 0
  67.     end
  68.     return false
  69.   end
  70. end
  71. class Window_BattleStatus < Window_Selectable
  72.   def initialize
  73.     super(0, 0, window_width, window_height)
  74.     self.openness = 0
  75.     @party = $game_party.battle_members.clone
  76.   end
  77.   def col_max; return $game_party.max_battle_members; end
  78.   def battle_members; return $game_party.battle_members; end
  79.   def actor; return battle_members[@index]; end
  80.   def update
  81.     super
  82.     return if @party == $game_party.battle_members
  83.     @party = $game_party.battle_members.clone
  84.     refresh
  85.   end
  86.   def draw_item(index)
  87.     return if index.nil?
  88.     clear_item(index)
  89.     actor = battle_members[index]
  90.     rect = item_rect(index)
  91.     return if actor.nil?
  92.     draw_actor_face(actor, rect.x+2, rect.y+2, actor.alive?)
  93.     draw_actor_name(actor, rect.x, rect.y, rect.width-8)
  94.     draw_actor_action(actor, rect.x, rect.y)
  95.     draw_actor_icons(actor, rect.x, line_height*1, rect.width)
  96.     gx = YEA::BATTLE::BATTLESTATUS_HPGAUGE_Y_PLUS
  97.     contents.font.size = YEA::BATTLE::BATTLESTATUS_TEXT_FONT_SIZE
  98.     draw_actor_hp(actor, rect.x+2, line_height*2+gx, rect.width-4)
  99.     if draw_tp?(actor) && draw_mp?(actor)
  100.       dw = rect.width/2-2
  101.       dw += 1 if $imported["YEA-CoreEngine"] && YEA::CORE::GAUGE_OUTLINE
  102.       draw_actor_tp(actor, rect.x+2, line_height*3, dw)
  103.       dw = rect.width - rect.width/2 - 2
  104.       draw_actor_mp(actor, rect.x+rect.width/2, line_height*3, dw)
  105.     elsif draw_tp?(actor) && !draw_mp?(actor)
  106.       draw_actor_tp(actor, rect.x+2, line_height*3, rect.width-4)
  107.     else
  108.       draw_actor_mp(actor, rect.x+2, line_height*3, rect.width-4)
  109.     end
  110.   end
  111.   def item_rect(index)
  112.     rect = Rect.new
  113.     rect.width = contents.width / $game_party.max_battle_members
  114.     rect.height = contents.height
  115.     rect.x = index * rect.width
  116.     if YEA::BATTLE::BATTLESTATUS_CENTER_FACES
  117.       rect.x += (contents.width - $game_party.members.size * rect.width) / 2
  118.     end
  119.     rect.y = 0
  120.     return rect
  121.   end
  122.   def draw_face(face_name, face_index, dx, dy, enabled = true)
  123.     bitmap = Cache.face(face_name)
  124.     fx = [(96 - item_rect(0).width + 1) / 2, 0].max
  125.     fy = face_index / 4 * 96 + 2
  126.     fw = [item_rect(0).width - 4, 92].min
  127.     rect = Rect.new(fx, fy, fw, 92)
  128.     rect = Rect.new(face_index % 4 * 96 + fx, fy, fw, 92)
  129.     contents.blt(dx, dy, bitmap, rect, enabled ? 255 : translucent_alpha)
  130.     bitmap.dispose
  131.   end
  132.   def draw_actor_name(actor, dx, dy, dw = 112)
  133.     reset_font_settings
  134.     contents.font.size = YEA::BATTLE::BATTLESTATUS_NAME_FONT_SIZE
  135.     change_color(hp_color(actor))
  136.     draw_text(dx+24, dy, dw-24, line_height, actor.name)
  137.   end
  138.   def draw_actor_action(actor, dx, dy)
  139.     draw_icon(action_icon(actor), dx, dy)
  140.   end
  141.   def action_icon(actor)
  142.     return Icon.no_action if actor.current_action.nil?
  143.     return Icon.no_action if actor.current_action.item.nil?
  144.     return actor.current_action.item.icon_index
  145.   end
  146.   def draw_tp?(actor)
  147.     return actor.draw_tp?
  148.   end
  149.   def draw_mp?(actor)
  150.     return actor.draw_mp?
  151.   end
  152.   def draw_current_and_max_values(dx, dy, dw, current, max, color1, color2)
  153.     change_color(color1)
  154.     draw_text(dx, dy, dw, line_height, current.to_s, 2)
  155.   end
  156.   def draw_actor_hp(actor, dx, dy, width = 124)
  157.     draw_gauge(dx, dy, width, actor.hp_rate, hp_gauge_color1, hp_gauge_color2)
  158.     change_color(system_color)
  159.     cy = (Font.default_size - contents.font.size) / 2 + 1
  160.     draw_text(dx+2, dy+cy, 30, line_height, Vocab::hp_a)
  161.     draw_current_and_max_values(dx, dy+cy, width, actor.hp, actor.mhp,
  162.       hp_color(actor), normal_color)
  163.     end
  164.   def draw_actor_mp(actor, dx, dy, width = 124)
  165.     draw_gauge(dx, dy, width, actor.mp_rate, mp_gauge_color1, mp_gauge_color2)
  166.     change_color(system_color)
  167.     cy = (Font.default_size - contents.font.size) / 2 + 1
  168.     draw_text(dx+2, dy+cy, 30, line_height, Vocab::mp_a)
  169.     draw_current_and_max_values(dx, dy+cy, width, actor.mp, actor.mmp,
  170.       mp_color(actor), normal_color)
  171.     end
  172.   def draw_actor_tp(actor, dx, dy, width = 124)
  173.     draw_gauge(dx, dy, width, actor.tp_rate, tp_gauge_color1, tp_gauge_color2)
  174.     change_color(system_color)
  175.     cy = (Font.default_size - contents.font.size) / 2 + 1
  176.     draw_text(dx+2, dy+cy, 30, line_height, Vocab::tp_a)
  177.     change_color(tp_color(actor))
  178.     draw_text(dx + width - 42, dy+cy, 42, line_height, actor.tp.to_i, 2)
  179.   end
  180. end
  181. class Window_BattleActor < Window_BattleStatus
  182.   def show
  183.     create_flags
  184.     super
  185.   end
  186.   def create_flags
  187.     set_select_flag(:any)
  188.     select(0)
  189.     return if $game_temp.battle_aid.nil?
  190.     if $game_temp.battle_aid.need_selection?
  191.       select(0)
  192.       set_select_flag(:dead) if $game_temp.battle_aid.for_dead_friend?
  193.     elsif $game_temp.battle_aid.for_user?
  194.       battler = BattleManager.actor
  195.       id = battler.nil? ? 0 : $game_party.battle_members.index(battler)
  196.       select(id)
  197.       set_select_flag(:user)
  198.     elsif $game_temp.battle_aid.for_all?
  199.       select(0)
  200.       set_select_flag(:all)
  201.       set_select_flag(:all_dead) if $game_temp.battle_aid.for_dead_friend?
  202.     elsif $game_temp.battle_aid.for_random?
  203.       select(0)
  204.       set_select_flag(:random) if $game_temp.battle_aid.for_random?
  205.     end
  206.   end
  207.   def set_select_flag(flag)
  208.     @select_flag = flag
  209.     case @select_flag
  210.     when :all, :all_dead, :random
  211.       @cursor_all = true
  212.     else
  213.       @cursor_all = false
  214.     end
  215.   end
  216.   def update_cursor
  217.     if @cursor_all
  218.       cursor_rect.set(0, 0, contents.width, contents.height)
  219.       self.top_row = 0
  220.     elsif @index < 0
  221.       cursor_rect.empty
  222.     else
  223.       ensure_cursor_visible
  224.       cursor_rect.set(item_rect(@index))
  225.     end
  226.   end
  227.   def cursor_movable?
  228.     return false if @select_flag == :user
  229.     return super
  230.   end
  231.   def current_item_enabled?
  232.     return true if $game_temp.battle_aid.nil?
  233.     if $game_temp.battle_aid.need_selection?
  234.       member = $game_party.battle_members[@index]
  235.       return member.dead? if $game_temp.battle_aid.for_dead_friend?
  236.     elsif $game_temp.battle_aid.for_dead_friend?
  237.       for member in $game_party.battle_members
  238.         return true if member.dead?
  239.       end
  240.       return false
  241.     end
  242.     return true
  243.   end
  244. end
  245. class Window_BattleStatusAid < Window_BattleStatus
  246.   attr_accessor :status_window
  247.   def initialize
  248.     super
  249.     self.visible = false
  250.     self.openness = 255
  251.   end
  252.   def window_width; return 128; end
  253.   def show
  254.     super
  255.     refresh
  256.   end
  257.   def refresh
  258.     contents.clear
  259.     return if @status_window.nil?
  260.     draw_item(@status_window.index)
  261.   end
  262.   def item_rect(index)
  263.     return Rect.new(0, 0, contents.width, contents.height)
  264.   end
  265. end
  266. class Window_BattleEnemy < Window_Selectable
  267.   def initialize(info_viewport)
  268.     super(0, Graphics.height, window_width, fitting_height(1))
  269.     refresh
  270.     self.visible = false
  271.     @info_viewport = info_viewport
  272.   end
  273.   def col_max; return item_max; end
  274.   def show
  275.     create_flags
  276.     super
  277.   end
  278.   def create_flags
  279.     set_select_flag(:any)
  280.     select(0)
  281.     return if $game_temp.battle_aid.nil?
  282.     if $game_temp.battle_aid.need_selection?
  283.       select(0)
  284.     elsif $game_temp.battle_aid.for_all?
  285.       select(0)
  286.       set_select_flag(:all)
  287.     elsif $game_temp.battle_aid.for_random?
  288.       select(0)
  289.       set_select_flag(:random)
  290.     end
  291.   end
  292.   def set_select_flag(flag)
  293.     @select_flag = flag
  294.     case @select_flag
  295.     when :all, :random
  296.       @cursor_all = true
  297.     else
  298.       @cursor_all = false
  299.     end
  300.   end
  301.   def select_all?
  302.     return true if @select_flag == :all
  303.     return true if @select_flag == :random
  304.     return false
  305.   end
  306.   def update_cursor
  307.     if @cursor_all
  308.       cursor_rect.set(0, 0, contents.width, contents.height)
  309.       self.top_row = 0
  310.     elsif @index < 0
  311.       cursor_rect.empty
  312.     else
  313.       ensure_cursor_visible
  314.       cursor_rect.set(item_rect(@index))
  315.     end
  316.   end
  317.   def cursor_movable?
  318.     return false if @select_flag == :user
  319.     return super
  320.   end
  321.   def current_item_enabled?
  322.     return true if $game_temp.battle_aid.nil?
  323.     if $game_temp.battle_aid.need_selection?
  324.       member = $game_party.battle_members[@index]
  325.       return member.dead? if $game_temp.battle_aid.for_dead_friend?
  326.     elsif $game_temp.battle_aid.for_dead_friend?
  327.       for member in $game_party.battle_members
  328.         return true if member.dead?
  329.       end
  330.       return false
  331.     end
  332.     return true
  333.   end
  334.   def enemy; @data[index]; end
  335.   def refresh
  336.     make_item_list
  337.     create_contents
  338.     draw_all_items
  339.   end
  340.   def make_item_list
  341.     @data = $game_troop.alive_members
  342.     @data.sort! { |a,b| a.screen_x <=> b.screen_x }
  343.   end
  344.   def draw_item(index); return; end
  345.   def update
  346.     super
  347.     return unless active
  348.     enemy.sprite_effect_type = :whiten
  349.     return unless select_all?
  350.     for enemy in $game_troop.alive_members
  351.       enemy.sprite_effect_type = :whiten
  352.     end
  353.   end
  354. end
  355. class Window_BattleHelp < Window_Help
  356.   attr_accessor :actor_window
  357.   attr_accessor :enemy_window
  358.   def update
  359.     super
  360.     if !self.visible and @text != ""
  361.       @text = ""
  362.       return refresh
  363.     end
  364.     update_battler_name
  365.   end
  366.   def update_battler_name
  367.     return unless @actor_window.active || @enemy_window.active
  368.     if @actor_window.active
  369.       battler = $game_party.battle_members[@actor_window.index]
  370.     elsif @enemy_window.active
  371.       battler = @enemy_window.enemy
  372.     end
  373.     if special_display?
  374.       refresh_special_case(battler)
  375.     else
  376.       refresh_battler_name(battler) if battler_name(battler) != @text
  377.     end
  378.   end
  379.   def battler_name(battler)
  380.     text = battler.name.clone
  381.     return text
  382.   end
  383.   def refresh_battler_name(battler)
  384.     contents.clear
  385.     reset_font_settings
  386.     change_color(normal_color)
  387.     @text = battler_name(battler)
  388.     icons = battler.state_icons + battler.buff_icons
  389.     dy = icons.size <= 0 ? line_height / 2 : 0
  390.     draw_text(0, dy, contents.width, line_height, @text, 1)
  391.     dx = (contents.width - (icons.size * 24)) / 2
  392.     draw_actor_icons(battler, dx, line_height, contents.width)
  393.   end
  394.   def special_display?
  395.     return false if $game_temp.battle_aid.nil?
  396.     return false if $game_temp.battle_aid.for_user?
  397.     return !$game_temp.battle_aid.need_selection?
  398.   end
  399.   def refresh_special_case(battler)
  400.     if $game_temp.battle_aid.for_opponent?
  401.       if $game_temp.battle_aid.for_all?
  402.         text = YEA::BATTLE::HELP_TEXT_ALL_FOES
  403.       else
  404.         case $game_temp.battle_aid.number_of_targets
  405.         when 1
  406.           text = YEA::BATTLE::HELP_TEXT_ONE_RANDOM_FOE
  407.         else
  408.           number = $game_temp.battle_aid.number_of_targets
  409.           text = sprintf(YEA::BATTLE::HELP_TEXT_MANY_RANDOM_FOE, number)
  410.         end
  411.       end
  412.     else
  413.       if $game_temp.battle_aid.for_dead_friend?
  414.         text = YEA::BATTLE::HELP_TEXT_ALL_DEAD_ALLIES
  415.       elsif $game_temp.battle_aid.for_random?
  416.         case $game_temp.battle_aid.number_of_targets
  417.         when 1
  418.           text = YEA::BATTLE::HELP_TEXT_ONE_RANDOM_ALLY
  419.         else
  420.           number = $game_temp.battle_aid.number_of_targets
  421.           text = sprintf(YEA::BATTLE::HELP_TEXT_RANDOM_ALLIES, number)
  422.         end
  423.       else
  424.         text = YEA::BATTLE::HELP_TEXT_ALL_ALLIES
  425.       end
  426.     end
  427.     return if text == @text
  428.     @text = text
  429.     contents.clear
  430.     reset_font_settings
  431.     draw_text(0, 0, contents.width, line_height*2, @text, 1)
  432.   end
  433. end
  434. class Window_SkillList < Window_Selectable
  435.   def spacing
  436.     return 8 if $game_party.in_battle
  437.     return super
  438.   end
  439. end
  440. class Window_ItemList < Window_Selectable
  441.   def spacing
  442.     return 8 if $game_party.in_battle
  443.     return super
  444.   end
  445. end
  446. class Scene_Battle < Scene_Base
  447.   attr_accessor :enemy_window
  448.   attr_accessor :info_viewport
  449.   attr_accessor :spriteset
  450.   attr_accessor :status_window
  451.   attr_accessor :status_aid_window
  452.   attr_accessor :subject
  453.   alias scene_battle_create_all_windows_abe create_all_windows
  454.   def create_all_windows
  455.     scene_battle_create_all_windows_abe
  456.     create_battle_status_aid_window
  457.     set_help_window
  458.   end
  459.   alias scene_battle_create_info_viewport_abe create_info_viewport
  460.   def create_info_viewport
  461.     scene_battle_create_info_viewport_abe
  462.     @status_window.refresh
  463.   end
  464.   def create_battle_status_aid_window
  465.     @status_aid_window = Window_BattleStatusAid.new
  466.     @status_aid_window.status_window = @status_window
  467.     @status_aid_window.x = Graphics.width - @status_aid_window.width
  468.     @status_aid_window.y = Graphics.height - @status_aid_window.height
  469.   end
  470.   def create_help_window
  471.     @help_window = Window_BattleHelp.new
  472.     @help_window.hide
  473.   end
  474.   def set_help_window
  475.     @help_window.actor_window = @actor_window
  476.     @help_window.enemy_window = @enemy_window
  477.   end
  478.   alias scene_battle_create_skill_window_abe create_skill_window
  479.   def create_skill_window
  480.     scene_battle_create_skill_window_abe
  481.     @skill_window.height = @info_viewport.rect.height
  482.     @skill_window.width = Graphics.width - @actor_command_window.width
  483.     @skill_window.y = Graphics.height - @skill_window.height
  484.   end
  485.   alias scene_battle_create_item_window_abe create_item_window
  486.   def create_item_window
  487.     scene_battle_create_item_window_abe
  488.     @item_window.height = @skill_window.height
  489.     @item_window.width = @skill_window.width
  490.     @item_window.y = Graphics.height - @item_window.height
  491.   end
  492.   alias scene_battle_next_command_abe next_command
  493.   def next_command
  494.     @status_window.show
  495.     redraw_current_status
  496.     @actor_command_window.show
  497.     @status_aid_window.hide
  498.     scene_battle_next_command_abe
  499.   end
  500.   alias scene_battle_prior_command_abe prior_command
  501.   def prior_command
  502.     redraw_current_status
  503.     scene_battle_prior_command_abe
  504.   end
  505.   def redraw_current_status
  506.     return if @status_window.index < 0
  507.     @status_window.draw_item(@status_window.index)
  508.   end
  509.   alias scene_battle_command_attack_abe command_attack
  510.   def command_attack
  511.     $game_temp.battle_aid = $data_skills[BattleManager.actor.attack_skill_id]
  512.     scene_battle_command_attack_abe
  513.   end
  514.   alias scene_battle_command_skill_abe command_skill
  515.   def command_skill
  516.     scene_battle_command_skill_abe
  517.     @status_window.hide
  518.     @actor_command_window.hide
  519.     @status_aid_window.show
  520.   end
  521.   alias scene_battle_command_item_abe command_item
  522.   def command_item
  523.     scene_battle_command_item_abe
  524.     @status_window.hide
  525.     @actor_command_window.hide
  526.     @status_aid_window.show
  527.   end
  528.   def on_skill_ok
  529.     @skill = @skill_window.item
  530.     $game_temp.battle_aid = @skill
  531.     BattleManager.actor.input.set_skill(@skill.id)
  532.     BattleManager.actor.last_skill.object = @skill
  533.     if @skill.for_opponent?
  534.       select_enemy_selection
  535.     elsif @skill.for_friend?
  536.       select_actor_selection
  537.     else
  538.       @skill_window.hide
  539.       next_command
  540.       $game_temp.battle_aid = nil
  541.     end
  542.   end
  543.   alias scene_battle_on_skill_cancel_abe on_skill_cancel
  544.   def on_skill_cancel
  545.     scene_battle_on_skill_cancel_abe
  546.     @status_window.show
  547.     @actor_command_window.show
  548.     @status_aid_window.hide
  549.   end
  550.   def on_item_ok
  551.     @item = @item_window.item
  552.     $game_temp.battle_aid = @item
  553.     BattleManager.actor.input.set_item(@item.id)
  554.     if @item.for_opponent?
  555.       select_enemy_selection
  556.     elsif @item.for_friend?
  557.       select_actor_selection
  558.     else
  559.       @item_window.hide
  560.       next_command
  561.       $game_temp.battle_aid = nil
  562.     end
  563.     $game_party.last_item.object = @item
  564.   end
  565.   alias scene_battle_on_item_cancel_abe on_item_cancel
  566.   def on_item_cancel
  567.     scene_battle_on_item_cancel_abe
  568.     @status_window.show
  569.     @actor_command_window.show
  570.     @status_aid_window.hide
  571.   end
  572.   alias scene_battle_select_actor_selection_abe select_actor_selection
  573.   def select_actor_selection
  574.     @status_aid_window.refresh
  575.     scene_battle_select_actor_selection_abe
  576.     @status_window.hide
  577.     @skill_window.hide
  578.     @item_window.hide
  579.     @help_window.show
  580.   end
  581.   alias scene_battle_on_actor_ok_abe on_actor_ok
  582.   def on_actor_ok
  583.     $game_temp.battle_aid = nil
  584.     scene_battle_on_actor_ok_abe
  585.     @status_window.show
  586.     if $imported["YEA-BattleCommandList"] && !@confirm_command_window.nil?
  587.       @actor_command_window.visible = !@confirm_command_window.visible
  588.     else
  589.       @actor_command_window.show
  590.     end
  591.     @status_aid_window.hide
  592.   end
  593.   alias scene_battle_on_actor_cancel_abe on_actor_cancel
  594.   def on_actor_cancel
  595.     BattleManager.actor.input.clear
  596.     @status_aid_window.refresh
  597.     $game_temp.battle_aid = nil
  598.     scene_battle_on_actor_cancel_abe
  599.     case @actor_command_window.current_symbol
  600.     when :skill
  601.       @skill_window.show
  602.     when :item
  603.       @item_window.show
  604.     end
  605.   end
  606.   alias scene_battle_select_enemy_selection_abe select_enemy_selection
  607.   def select_enemy_selection
  608.     @status_aid_window.refresh
  609.     scene_battle_select_enemy_selection_abe
  610.     @help_window.show
  611.   end
  612.   alias scene_battle_on_enemy_ok_abe on_enemy_ok
  613.   def on_enemy_ok
  614.     $game_temp.battle_aid = nil
  615.     scene_battle_on_enemy_ok_abe
  616.   end
  617.   alias scene_battle_on_enemy_cancel_abe on_enemy_cancel
  618.   def on_enemy_cancel
  619.     BattleManager.actor.input.clear
  620.     @status_aid_window.refresh
  621.     $game_temp.battle_aid = nil
  622.     scene_battle_on_enemy_cancel_abe
  623.     if @skill_window.visible || @item_window.visible
  624.       @help_window.show
  625.     else
  626.       @help_window.hide
  627.     end
  628.   end
  629.   def end_battle_conditions?
  630.     return true if $game_party.members.empty?
  631.     return true if $game_party.all_dead?
  632.     return true if $game_troop.all_dead?
  633.     return true if BattleManager.aborting?
  634.     return false
  635.   end
  636.   def refresh_status
  637.     #如果你是程序员,请顺手帮忙优化下这里,谢谢。
  638.     @status_window.refresh
  639.     for i in $game_party.battle_members
  640.       @status_window.draw_item($game_party.battle_members.index(i))
  641.     end
  642.   end
  643. end

就是这两个脚本冲突!!!
提示这个:(如图)好歹来个人回答!!!

提示.jpg (5.49 KB, 下载次数: 16)

提示

提示

Lv5.捕梦者

梦石
0
星屑
30765
在线时间
607 小时
注册时间
2014-7-18
帖子
729

开拓者

2
 楼主| 发表于 2015-2-16 18:14:30 | 只看该作者
自顶一下...
回复 支持 反对

使用道具 举报

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

本版积分规则

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

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

GMT+8, 2024-11-2 12:29

Powered by Discuz! X3.1

© 2001-2013 Comsenz Inc.

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