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

Project1

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

[转载] 【来地球村逛逛】守护精灵之神降系统

[复制链接]

Lv1.梦旅人

梦石
0
星屑
66
在线时间
140 小时
注册时间
2012-2-6
帖子
384
跳转到指定楼层
1
发表于 2012-3-16 10:29:29 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式

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

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

x
本帖最后由 杂兵天下 于 2012-3-16 14:33 编辑

来源yamiworld.wordpress.com
  1. #==============================================================================
  2. #
  3. # ¥ Yami Engine Ace - Basic Module
  4. # -- Last Updated: 2012.03.13
  5. # -- Level: Nothing
  6. # -- Requires: n/a
  7. #
  8. #==============================================================================

  9. $imported = {} if $imported.nil?
  10. $imported["YSE-BasicModule"] = true

  11. #==============================================================================
  12. # ¥ Updates
  13. # =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  14. # 2012.03.13 - Remove requirements mechanic.
  15. # 2012.03.11 - Change in requirements mechanic.
  16. # 2012.03.02 - Added Message Box.
  17. # 2012.03.01 - Started and Finished Script.
  18. #
  19. #==============================================================================
  20. # ¥ Introduction
  21. # =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  22. # This script provides many methods for Yami Engine Ace.
  23. #
  24. # * Feature:
  25. #   - Save and Load data files. (2012.03.01)
  26. #
  27. # * Misc:
  28. #   - Make random string.       (2012.03.01)
  29. #   - Make hash.                (2012.03.01)
  30. #   - Win32API Message Box.     (2012.03.02)
  31. #
  32. #==============================================================================
  33. # ¥ Instructions
  34. # =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  35. # To install this script, open up your script editor and copy/paste this script
  36. # to an open slot below ¥ Materials/‘fÞ but above ¥ Main. Remember to save.
  37. #
  38. #==============================================================================
  39. # ¥ Compatibility
  40. # =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  41. # This script is made strictly for RPG Maker VX Ace. It is highly unlikely that
  42. # it will run with RPG Maker VX without adjusting.
  43. #
  44. #==============================================================================

  45. #==============================================================================
  46. # ¥ Configuration
  47. #==============================================================================

  48. module YSE
  49.   
  50.   #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  51.   # - External Data Configuration -
  52.   #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  53.   DATA_CONFIGURATION = { # Start here.
  54.     :ext        =>  "rvdata2",  # Data File Extension.
  55.     :salt       =>  "D6*&wg7O",# Salt. Make an unique phrase here.
  56.                                  # Must be at least 2 characters.
  57.     :comp_level =>  9,           # Level from 1 to 9. Best Speed at 1, Best
  58.                                  # Compress at 9.
  59.   } # Do not delete this.
  60.   
  61. end

  62. #==============================================================================
  63. # ¥ Editting anything past this point may potentially result in causing
  64. # computer damage, incontinence, explosion of user's head, coma, death, and/or
  65. # halitosis so edit at your own risk.
  66. #==============================================================================

  67. #==============================================================================
  68. # ¡ YSE - Basic Module
  69. #==============================================================================

  70. module YSE
  71.   
  72.   #--------------------------------------------------------------------------
  73.   # message_box
  74.   #--------------------------------------------------------------------------
  75.   def self.message_box(title, message)
  76.     api = Win32API.new('user32','MessageBox',['L', 'P', 'P', 'L'],'I')  
  77.     api.call(0,message,title,0)  
  78.   end
  79.   
  80.   #--------------------------------------------------------------------------
  81.   # charset
  82.   #--------------------------------------------------------------------------
  83.   def self.charset
  84.     result = "abcdefghjkmnpqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ23456789"
  85.     result
  86.   end
  87.   
  88.   #--------------------------------------------------------------------------
  89.   # make_random_string
  90.   #--------------------------------------------------------------------------
  91.   def self.make_random_string(length = 6)
  92.     result = ""
  93.     while result.size < length
  94.       result << charset[rand(charset.size)]
  95.     end
  96.     result
  97.   end
  98.   
  99.   #--------------------------------------------------------------------------
  100.   # make_filename
  101.   #--------------------------------------------------------------------------
  102.   def self.make_filename(filename, dir = "")
  103.     ext = DATA_CONFIGURATION[:ext]
  104.     result = "#{dir}/#{filename}.#{ext}"
  105.     result
  106.   end
  107.   
  108.   #--------------------------------------------------------------------------
  109.   # compress_data
  110.   #--------------------------------------------------------------------------
  111.   def self.compress_data(data, comp_level = nil)
  112.     compress_level = comp_level.nil? ? DATA_CONFIGURATION[:comp_level] : comp_level
  113.     result = Zlib::Deflate.deflate(Marshal.dump(data), compress_level)
  114.     result
  115.   end
  116.   
  117.   #--------------------------------------------------------------------------
  118.   # decompress_data
  119.   #--------------------------------------------------------------------------
  120.   def self.decompress_data(data)
  121.     result = Zlib::Inflate.inflate(Marshal.load(data))
  122.     result
  123.   end
  124.   
  125.   #--------------------------------------------------------------------------
  126.   # make_hash
  127.   #--------------------------------------------------------------------------
  128.   def self.make_hash(string = "")
  129.     salt = DATA_CONFIGURATION[:salt]
  130.     if salt.size < 2; salt = make_random_string(8); end
  131.     result = string.crypt(salt)
  132.     result
  133.   end
  134.   
  135.   #--------------------------------------------------------------------------
  136.   # save_data
  137.   #--------------------------------------------------------------------------
  138.   def self.save_data(filename, data_hash)
  139.     File.open(filename, "wb") do |file|
  140.       Marshal.dump(compress_data(data_hash), file)
  141.     end
  142.     return true
  143.   end
  144.   
  145.   #--------------------------------------------------------------------------
  146.   # save_data
  147.   #--------------------------------------------------------------------------
  148.   def self.load_data(filename, method, index = 0)
  149.     File.open(filename, "rb") do |file|
  150.       index.times { Marshal.load(file) }
  151.       method.call(Marshal.load(decompress_data(file)))
  152.     end
  153.     return true
  154.   end
  155.   
  156.   #--------------------------------------------------------------------------
  157.   # save_data
  158.   #--------------------------------------------------------------------------
  159.   def self.patch_start
  160.     return unless $imported["YSE-PatchSystem"]
  161.     SceneManager.call(Scene_Patch_YSE)
  162.   end
  163.   
  164. end # YSE - Basic Module

  165. #==============================================================================
  166. # ¡ System Errors
  167. #==============================================================================

  168. if YSE::DATA_CONFIGURATION[:salt].size < 2
  169.   YSE.message_box("YSE - Basic Module", "Salt must have at least 2 characters.")
  170.   exit
  171. end

  172. #==============================================================================
  173. #
  174. # ¥ End of File
  175. #
  176. #==============================================================================
复制代码
必须以上脚本的支持才能运行!!!!
RUBY 代码复制
  1. #==============================================================================
  2. #
  3. # ▼ Yami Engine Ace - Guardian Series
  4. # -- Script: Guardian Basic
  5. # -- Last Updated: 2012.03.11
  6. # -- Level: Easy
  7. # -- Requires: n/a
  8. #
  9. #==============================================================================
  10.  
  11. $imported = {} if $imported.nil?
  12. $imported["YSE-GuardianBasic"] = true
  13.  
  14. #==============================================================================
  15. # ▼ Updates
  16. # =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  17. # 2012.03.11 - Finished Script.
  18. # 2012.03.05 - Started Script.
  19. #
  20. #==============================================================================
  21. # ▼ Introduction
  22. # =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  23. # This script gives you a notetag for Actors to make them be guardians. An actor
  24. # marked as guardian is not shown in default menu, battle, but will be available
  25. # for other scripts in Guardian Series.
  26. #
  27. # This script also contains two basic windows for Guardians:
  28. #   - Window Guardians List. Class Window_MenuGuardian
  29. #   - Window Guardian Small Status. Class Window_StatusGuardian
  30. #
  31. # -----------------------------------------------------------------------------
  32. # Actor Notetags - These notetags go in the actor notebox in the database.
  33. # -----------------------------------------------------------------------------
  34. # <guardian>
  35. # This notetag marks an actor as a guardian.
  36. #
  37. #==============================================================================
  38. # ▼ Instructions
  39. # =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  40. # To install this script, open up your script editor and copy/paste this script
  41. # to an open slot below ▼ Materials/素材 but above ▼ Main. Remember to save.
  42. #
  43. #==============================================================================
  44. # ▼ Compatibility
  45. # =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  46. # This script is made strictly for RPG Maker VX Ace. It is highly unlikely that
  47. # it will run with RPG Maker VX without adjusting.
  48. #
  49. #==============================================================================
  50.  
  51. module YSE
  52.   module GUARDIAN
  53.  
  54.     #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  55.     # - Mechanic Settings -
  56.     #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  57.     ALL_GUARDIAN_GAIN_EXP     = false
  58.  
  59.   end
  60. end
  61.  
  62. #==============================================================================
  63. # ▼ Editting anything past this point may potentially result in causing
  64. # computer damage, incontinence, explosion of user's head, coma, death, and/or
  65. # halitosis so edit at your own risk.
  66. #==============================================================================
  67.  
  68. #==============================================================================
  69. # ■ Regular Expression
  70. #==============================================================================
  71.  
  72. module YSE
  73.   module REGEXP
  74.     module ACTOR
  75.       GUARDIAN = /<(?:GUARDIAN)>/i
  76.     end # ACTOR
  77.   end # REGEXP
  78. end # YSE
  79.  
  80. #==============================================================================
  81. # ■ BattleManager
  82. #==============================================================================
  83.  
  84. module BattleManager
  85.  
  86.   #--------------------------------------------------------------------------
  87.   # alias method: gain_exp
  88.   #--------------------------------------------------------------------------
  89.   class <<self; alias yse_gain_exp_gb gain_exp; end
  90.   def self.gain_exp
  91.     $game_party.guardians.each do |guardian|
  92.       guardian.gain_exp($game_troop.exp_total) if YSE::GUARDIAN::ALL_GUARDIAN_GAIN_EXP
  93.     end
  94.     yse_gain_exp_gb
  95.   end
  96.  
  97. end # BattleManager
  98.  
  99. #==============================================================================
  100. # ■ Game_Temp
  101. #==============================================================================
  102.  
  103. class Game_Temp
  104.  
  105.   #--------------------------------------------------------------------------
  106.   # public instance variables
  107.   #--------------------------------------------------------------------------
  108.   attr_accessor :scene_gmenu_id
  109.  
  110.   #--------------------------------------------------------------------------
  111.   # alias method: initialize
  112.   #--------------------------------------------------------------------------
  113.   alias yse_initialize_gb initialize
  114.   def initialize
  115.     yse_initialize_gb
  116.     @scene_gmenu_id = 0
  117.   end
  118.  
  119. end # Game_Temp
  120.  
  121. #==============================================================================
  122. # ■ DataManager
  123. #==============================================================================
  124.  
  125. module DataManager
  126.  
  127.   #--------------------------------------------------------------------------
  128.   # alias method: load_database
  129.   #--------------------------------------------------------------------------
  130.   class <<self; alias load_database_ysegb load_database; end
  131.   def self.load_database
  132.     load_database_ysegb
  133.     load_notetags_ysegb
  134.   end
  135.  
  136.   #--------------------------------------------------------------------------
  137.   # new method: load_notetags_ysegb
  138.   #--------------------------------------------------------------------------
  139.   def self.load_notetags_ysegb
  140.     group = $data_actors
  141.     for obj in group
  142.       next if obj.nil?
  143.       obj.load_notetags_ysegb
  144.     end
  145.   end
  146.  
  147. end # DataManager
  148.  
  149. #==============================================================================
  150. # ■ RPG::Actor
  151. #==============================================================================
  152.  
  153. class RPG::Actor < RPG::BaseItem
  154.  
  155.   #--------------------------------------------------------------------------
  156.   # public instance variables
  157.   #--------------------------------------------------------------------------
  158.   attr_accessor :is_guardian
  159.  
  160.   #--------------------------------------------------------------------------
  161.   # new method: load_notetags_ysegb
  162.   #--------------------------------------------------------------------------
  163.   def load_notetags_ysegb
  164.     @is_guardian = false
  165.     #---
  166.     self.note.split(/[\r\n]+/).each { |line|
  167.       case line
  168.       #---
  169.       when YSE::REGEXP::ACTOR::GUARDIAN
  170.         @is_guardian = true
  171.       end
  172.     } # self.note.split
  173.     #---
  174.   end
  175.  
  176. end # RPG::Actor
  177.  
  178. #==============================================================================
  179. # ■ Game_Actor
  180. #==============================================================================
  181.  
  182. class Game_Actor < Game_Battler
  183.  
  184.   #--------------------------------------------------------------------------
  185.   # new method: guardian?
  186.   #--------------------------------------------------------------------------
  187.   def guardian?
  188.     return actor.is_guardian
  189.   end
  190.  
  191.   #--------------------------------------------------------------------------
  192.   # new method: guardian_index
  193.   #--------------------------------------------------------------------------
  194.   def guardian_index
  195.     $game_party.guardians.index(self)
  196.   end
  197.  
  198. end # Game_Actor
  199.  
  200. #==============================================================================
  201. # ■ Game_Party
  202. #==============================================================================
  203.  
  204. class Game_Party < Game_Unit
  205.  
  206.   #--------------------------------------------------------------------------
  207.   # alias method: initialize
  208.   #--------------------------------------------------------------------------  
  209.   alias yse_initialize_gb initialize
  210.   def initialize
  211.     yse_initialize_gb
  212.     @guardians = []
  213.   end
  214.  
  215.   #--------------------------------------------------------------------------
  216.   # alias method: all_members
  217.   #--------------------------------------------------------------------------
  218.   alias yse_all_members_gb all_members
  219.   def all_members
  220.     @actors.each {|id|
  221.       if $game_actors[id].guardian?; @actors.delete(id); add_actor(id); end
  222.     }
  223.     yse_all_members_gb
  224.   end
  225.  
  226.   #--------------------------------------------------------------------------
  227.   # new method: guardians
  228.   #--------------------------------------------------------------------------  
  229.   def guardians
  230.     @guardians.collect {|id| $game_actors[id] }
  231.   end
  232.  
  233.   #--------------------------------------------------------------------------
  234.   # alias method: add_actor
  235.   #--------------------------------------------------------------------------  
  236.   alias yse_add_actor_gb add_actor
  237.   def add_actor(actor_id)
  238.     if $game_actors[actor_id].guardian?
  239.       @guardians.push(actor_id) unless @guardians.include?(actor_id)
  240.       return
  241.     end
  242.     yse_add_actor_gb(actor_id)
  243.   end
  244.  
  245.   #--------------------------------------------------------------------------
  246.   # new method: menu_guardian
  247.   #--------------------------------------------------------------------------  
  248.   def menu_guardian
  249.     $game_actors[$game_temp.scene_gmenu_id].nil? ? guardians[0] : $game_actors[$game_temp.scene_gmenu_id]
  250.   end
  251.  
  252.   #--------------------------------------------------------------------------
  253.   # new method: menu_guardian_next
  254.   #--------------------------------------------------------------------------  
  255.   def menu_guardian_next
  256.     index = guardians.index(menu_actor) || -1
  257.     index = (index + 1) % guardians.size
  258.     self.menu_actor = guardians[index]
  259.   end
  260.  
  261.   #--------------------------------------------------------------------------
  262.   # new method: menu_guardian_prev
  263.   #--------------------------------------------------------------------------  
  264.   def menu_guardian_prev
  265.     index = guardians.index(menu_actor) || 1
  266.     index = (index + guardians.size - 1) % guardians.size
  267.     self.menu_actor = guardians[index]
  268.   end
  269.  
  270.   #--------------------------------------------------------------------------
  271.   # alias method: menu_actor_next
  272.   #--------------------------------------------------------------------------
  273.   alias yse_menu_actor_next_gb menu_actor_next
  274.   def menu_actor_next
  275.     if @guardians.include?(menu_actor.id)
  276.       menu_guardian_next
  277.     else
  278.       yse_menu_actor_next_gb
  279.     end
  280.   end
  281.  
  282.   #--------------------------------------------------------------------------
  283.   # alias method: menu_actor_prev
  284.   #--------------------------------------------------------------------------
  285.   alias yse_menu_actor_prev_gb menu_actor_prev
  286.   def menu_actor_prev
  287.     if @guardians.include?(menu_actor.id)
  288.       menu_guardian_prev
  289.     else
  290.       yse_menu_actor_prev_gb
  291.     end
  292.   end
  293.  
  294. end # Game_Party
  295.  
  296. #==============================================================================
  297. # ■ Window_MenuGuardian
  298. #==============================================================================
  299.  
  300. class Window_MenuGuardian < Window_Selectable
  301.  
  302.   #--------------------------------------------------------------------------
  303.   # initialize
  304.   #--------------------------------------------------------------------------
  305.   def initialize(x, y)
  306.     super(x, y, window_width, Graphics.height - y)
  307.     refresh
  308.   end
  309.  
  310.   #--------------------------------------------------------------------------
  311.   # window_width
  312.   #--------------------------------------------------------------------------
  313.   def window_width
  314.     Graphics.width
  315.   end
  316.  
  317.   #--------------------------------------------------------------------------
  318.   # item_max
  319.   #--------------------------------------------------------------------------
  320.   def item_max
  321.     $game_party.guardians.size
  322.   end
  323.  
  324.   #--------------------------------------------------------------------------
  325.   # col_max
  326.   #--------------------------------------------------------------------------
  327.   def col_max
  328.     2
  329.   end
  330.  
  331.   #--------------------------------------------------------------------------
  332.   # process_ok
  333.   #--------------------------------------------------------------------------
  334.   def process_ok
  335.     $game_party.menu_actor = $game_party.guardians[index]
  336.     $game_temp.scene_gmenu_id = $game_party.guardians[index].id
  337.     super
  338.   end
  339.  
  340.   #--------------------------------------------------------------------------
  341.   # draw_item
  342.   #--------------------------------------------------------------------------
  343.   def draw_item(index)
  344.     guardian = $game_party.guardians[index]
  345.     rect = item_rect(index)
  346.     face_rect = Rect.new(rect.x + 1, rect.y + 1, item_height - 2, item_height - 2)
  347.     draw_guardian_name(guardian, rect.x, rect.y, rect.width)
  348.     draw_thumb_face(guardian, face_rect)
  349.     draw_guardian_status(guardian, rect.x, rect.y, rect.width)
  350.   end
  351.  
  352.   #--------------------------------------------------------------------------
  353.   # draw_thumb_face
  354.   #--------------------------------------------------------------------------
  355.   def draw_thumb_face(actor, dest_rect)
  356.     bitmap = Cache.face(actor.face_name)
  357.     rect = Rect.new(actor.face_index % 4 * 96, actor.face_index / 4 * 96, 96, 96)
  358.     bitmap.blur
  359.     contents.stretch_blt(dest_rect, bitmap, rect, enable?(actor) ? 255 : translucent_alpha)
  360.     bitmap.dispose
  361.   end
  362.  
  363.   #--------------------------------------------------------------------------
  364.   # draw_guardian_name
  365.   #--------------------------------------------------------------------------
  366.   def draw_guardian_name(actor, dx, dy, dw)
  367.     colour = Color.new(0, 0, 0, translucent_alpha/2)
  368.     rect = Rect.new(dx+1, dy+1, dw-2, line_height-2)
  369.     contents.fill_rect(rect, colour)
  370.     change_color(system_color, enable?(actor))
  371.     draw_text(dx + item_height + 2, dy, dw, line_height, actor.name)
  372.   end
  373.  
  374.   #--------------------------------------------------------------------------
  375.   # draw_guardian_status
  376.   #--------------------------------------------------------------------------
  377.   def draw_guardian_status(actor, dx, dy, dw)
  378.     change_color(normal_color, enable?(actor))
  379.     draw_text(dx, dy, dw, line_height, Vocab::level_a + actor.level.to_s, 2)
  380.   end
  381.  
  382.   #--------------------------------------------------------------------------
  383.   # enabled
  384.   #--------------------------------------------------------------------------
  385.   def enable?(actor = nil)
  386.     return true
  387.   end
  388.  
  389.   #--------------------------------------------------------------------------
  390.   # update_help
  391.   #--------------------------------------------------------------------------
  392.   alias yse_call_update_help_gb call_update_help
  393.   def call_update_help
  394.     yse_call_update_help_gb
  395.     return if @status_window.nil?
  396.     return if $game_party.guardians.size == 0
  397.     item = index < 0 ? $game_party.menu_guardian : $game_party.guardians[index]
  398.     @status_window.guardian = item
  399.   end
  400.  
  401.   #--------------------------------------------------------------------------
  402.   # update_help
  403.   #--------------------------------------------------------------------------
  404.   def update_help
  405.     @help_window.clear
  406.     item = index < 0 ? $game_party.menu_guardian : $game_party.guardians[index]
  407.     @help_window.set_item(item)
  408.   end
  409.  
  410.   #--------------------------------------------------------------------------
  411.   # select_last
  412.   #--------------------------------------------------------------------------
  413.   def select_last
  414.     select($game_party.menu_guardian.guardian_index)
  415.   end
  416.  
  417.   #--------------------------------------------------------------------------
  418.   # status_window=
  419.   #--------------------------------------------------------------------------
  420.   def status_window=(status_window)
  421.     @status_window = status_window
  422.     item = index < 0 ? $game_party.menu_guardian : $game_party.guardians[index]
  423.     @status_window.guardian = item
  424.   end
  425.  
  426. end # Window_MenuGuardian
  427.  
  428. #==============================================================================
  429. # ■ Window_StatusGuardian
  430. #==============================================================================
  431.  
  432. class Window_StatusGuardian < Window_Base
  433.  
  434.   #--------------------------------------------------------------------------
  435.   # initialize
  436.   #--------------------------------------------------------------------------
  437.   def initialize(dx, dy)
  438.     @guardian = $game_party.menu_guardian
  439.     super(dx, dy, window_width, fitting_height(4))
  440.     refresh
  441.   end
  442.  
  443.   #--------------------------------------------------------------------------
  444.   # window_width
  445.   #--------------------------------------------------------------------------
  446.   def window_width; return Graphics.width - 160; end
  447.  
  448.   #--------------------------------------------------------------------------
  449.   # guardian=
  450.   #--------------------------------------------------------------------------
  451.   def guardian=(guardian)
  452.     return if @guardian == guardian
  453.     @guardian = guardian
  454.     refresh
  455.   end
  456.  
  457.   #--------------------------------------------------------------------------
  458.   # refresh
  459.   #--------------------------------------------------------------------------
  460.   def refresh
  461.     contents.clear
  462.     return unless @guardian
  463.     draw_actor_face(@guardian, 0, 0)
  464.     colour = Color.new(0, 0, 0, translucent_alpha / 2)
  465.     rect = Rect.new(0, line_height * 3 + 2, 106, line_height-2)
  466.     contents.fill_rect(rect, colour)
  467.     draw_actor_name(@guardian, 0, line_height * 3 + 1, 108)
  468.     dw = (contents.width - 108) / 2
  469.     dx = 108
  470.     draw_actor_param(0, dx, line_height * 0, dw)
  471.     draw_actor_param(1, dx + dw, line_height * 0, dw)
  472.     draw_actor_param(2, dx, line_height * 1, dw)
  473.     draw_actor_param(3, dx + dw, line_height * 1, dw)
  474.     draw_actor_param(4, dx, line_height * 2, dw)
  475.     draw_actor_param(5, dx + dw, line_height * 2, dw)
  476.     draw_actor_param(6, dx, line_height * 3, dw)
  477.     draw_actor_param(7, dx + dw, line_height * 3, dw)
  478.   end
  479.  
  480.   #--------------------------------------------------------------------------
  481.   # draw_actor_param
  482.   #--------------------------------------------------------------------------
  483.   def draw_actor_param(param_id, dx, dy, dw)
  484.     colour = Color.new(0, 0, 0, translucent_alpha/2)
  485.     rect = Rect.new(dx+1, dy+1, dw-2, line_height-2)
  486.     contents.fill_rect(rect, colour)
  487.     change_color(system_color)
  488.     draw_text(dx+4, dy, dw-8, line_height, Vocab::param(param_id))
  489.     change_color(normal_color)
  490.     draw_text(dx+4, dy, dw-8, line_height, @guardian.param(param_id).to_s, 2)
  491.   end
  492.  
  493. end # Window_StatusGuardian
  494.  
  495. #==============================================================================
  496. #
  497. # ▼ End of File
  498. #
  499. #==============================================================================
  500. #==============================================================================
  501. #
  502. # ▼ Yami Engine Ace - Guardian Series
  503. # -- Script: Guardian Menu
  504. # -- Last Updated: 2012.03.13
  505. # -- Level: Easy
  506. # -- Requires: YSE - Guardian Basic
  507. #
  508. #==============================================================================
  509.  
  510. $imported = {} if $imported.nil?
  511. $imported["YSE-GuardianMenu"] = true
  512.  
  513. #==============================================================================
  514. # ▼ Updates
  515. # =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  516. # 2012.03.13 - Finished Script.
  517. # 2012.03.11 - Started Script.
  518. #
  519. #==============================================================================
  520. # ▼ Introduction
  521. # =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  522. # Manages menu commands for Guardian. This Menu will be separate with Main Menu
  523. # for actor. Can be called by Main Menu.
  524. # If you have Yanfly Engine Ace - Menu Engine, You must add a custom command
  525. # which calls Handler Method :command_guardian.
  526. #
  527. #==============================================================================
  528. # ▼ Instructions
  529. # =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  530. # To install this script, open up your script editor and copy/paste this script
  531. # to an open slot below ▼ Materials/素材 but above ▼ Main. Remember to save.
  532. #
  533. #==============================================================================
  534. # ▼ Compatibility
  535. # =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  536. # This script is made strictly for RPG Maker VX Ace. It is highly unlikely that
  537. # it will run with RPG Maker VX without adjusting.
  538. #
  539. #==============================================================================
  540.  
  541. module YSE
  542.   module GUARDIAN_MENU
  543.  
  544.     #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  545.     # - Command Window Settings -
  546.     #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  547.     # This section adjusts the commands that appear in the command window used
  548.     # for the status screen. Rearrange the commands, add new ones, remove them
  549.     # as you see fit.
  550.     #
  551.     # -------------------------------------------------------------------------
  552.     # :command         Description
  553.     # -------------------------------------------------------------------------
  554.     # :status          Calls Scene_Status scene.
  555.     # :skill           Calls Scene_Skill scene.
  556.     # :equip           Calls Scene_Equip scene.
  557.     #
  558.     # :gpair           Calls Guardian Pairing.
  559.     #                  Require YSE - Guardian Pairing.
  560.     #
  561.     #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  562.     COMMANDS = [ # The order at which the menu items are shown.
  563.     # [    :command,    "Display"],
  564.       [    :status,      "状态"],
  565.       [    :skill,       "技能"],
  566.       [    :equip,       "装备"],
  567.       [    :gpair,       "神之降临"],
  568.     # [    :custom1,     "Custom"],
  569.     # [    :custom2,     "motsuC"],
  570.     ] # Do not remove this.
  571.  
  572.     #--------------------------------------------------------------------------
  573.     # - Menu Custom Commands -
  574.     # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  575.     # For those who use scripts to that may produce unique effects for the
  576.     # status menu, use this hash to manage the custom commands for the Status
  577.     # Command Window. You can disable certain commands or prevent them from
  578.     # appearing by using switches. If you don't wish to bind them to a switch,
  579.     # set the proper switch to 0 for it to have no impact.
  580.     #--------------------------------------------------------------------------
  581.     CUSTOM_STATUS_COMMANDS = {
  582.     # :command => [EnableSwitch, ShowSwitch, Handler Method],
  583.       :custom1 => [           0,          0, :command_name1],
  584.       :custom2 => [           0,          0, :command_name2],
  585.     } # Do not remove this.
  586.  
  587.     # These Configurations contain visual and vocab things.
  588.     VOCAB_MENU = "守护神"    # Command Display in Main Menu.
  589.     MENU_ENABLE_SWITCH = 0      # Set to 0 if don't wanna use this function.
  590.  
  591.   end
  592. end
  593.  
  594. #==============================================================================
  595. # ▼ Editting anything past this point may potentially result in causing
  596. # computer damage, incontinence, explosion of user's head, coma, death, and/or
  597. # halitosis so edit at your own risk.
  598. #==============================================================================
  599.  
  600. #==============================================================================
  601. # ■ Vocab
  602. #==============================================================================
  603.  
  604. module Vocab
  605.   GuardianMenu = YSE::GUARDIAN_MENU::VOCAB_MENU
  606. end
  607.  
  608. #==============================================================================
  609. # ■ Game_Temp
  610. #==============================================================================
  611.  
  612. class Game_Temp
  613.  
  614.   #--------------------------------------------------------------------------
  615.   # public instance variables
  616.   #--------------------------------------------------------------------------
  617.   attr_accessor :guardian_menu_command
  618.  
  619. end # Game_Temp
  620.  
  621. #==============================================================================
  622. # ■ Window_MenuCommand
  623. #==============================================================================
  624.  
  625. class Window_MenuCommand < Window_Command
  626.  
  627.   #--------------------------------------------------------------------------
  628.   # alias method: make_command_list
  629.   #--------------------------------------------------------------------------
  630.   alias yse_add_main_commands_gm add_main_commands
  631.   def add_main_commands
  632.     yse_add_main_commands_gm
  633.     add_guardian_commands unless $imported["YEA-AceMenuEngine"]
  634.   end
  635.  
  636.   #--------------------------------------------------------------------------
  637.   # new method: guardian_command_enabled
  638.   #--------------------------------------------------------------------------
  639.   def guardian_command_enabled
  640.     return false if $game_party.guardians.size == 0
  641.     return true if YSE::GUARDIAN_MENU::MENU_ENABLE_SWITCH <= 0
  642.     return $game_switches[YSE::GUARDIAN_MENU::MENU_ENABLE_SWITCH]
  643.   end
  644.  
  645.   #--------------------------------------------------------------------------
  646.   # new method: add_guardian_commands
  647.   #--------------------------------------------------------------------------
  648.   def add_guardian_commands
  649.     add_command(Vocab::GuardianMenu,   :guardian,   guardian_command_enabled)
  650.   end
  651.  
  652. end # Window_MenuCommand
  653.  
  654. #==============================================================================
  655. # ■ Scene_Menu
  656. #==============================================================================
  657.  
  658. class Scene_Menu < Scene_MenuBase
  659.  
  660.   #--------------------------------------------------------------------------
  661.   # alias method: create_command_window
  662.   #--------------------------------------------------------------------------
  663.   alias yse_create_command_window_gm create_command_window
  664.   def create_command_window
  665.     yse_create_command_window_gm
  666.     @command_window.set_handler(:guardian, method(:command_guardian))
  667.   end
  668.  
  669.   #--------------------------------------------------------------------------
  670.   # new method: command_guardian
  671.   #--------------------------------------------------------------------------
  672.   def command_guardian
  673.     SceneManager.call(Scene_GuardianMenu)
  674.   end
  675.  
  676. end # Scene_Menu
  677.  
  678. #==============================================================================
  679. # ■ Window_GuardianMenuCommand
  680. #==============================================================================
  681.  
  682. class Window_GuardianMenuCommand < Window_Command
  683.  
  684.   #--------------------------------------------------------------------------
  685.   # initialize
  686.   #--------------------------------------------------------------------------
  687.   def initialize(dx, dy)
  688.     super(dx, dy)
  689.   end
  690.  
  691.   #--------------------------------------------------------------------------
  692.   # window_width
  693.   #--------------------------------------------------------------------------
  694.   def window_width; return 160; end
  695.  
  696.   #--------------------------------------------------------------------------
  697.   # visible_line_number
  698.   #--------------------------------------------------------------------------
  699.   def visible_line_number; return 4; end
  700.  
  701.   #--------------------------------------------------------------------------
  702.   # alignment
  703.   #--------------------------------------------------------------------------
  704.   def alignment; return 1; end
  705.  
  706.   #--------------------------------------------------------------------------
  707.   # ok_enabled?
  708.   #--------------------------------------------------------------------------
  709.   def ok_enabled?
  710.     return handle?(current_symbol)
  711.   end
  712.  
  713.   #--------------------------------------------------------------------------
  714.   # process_ok
  715.   #--------------------------------------------------------------------------
  716.   def process_ok
  717.     $game_temp.guardian_menu_command = self.index
  718.     super
  719.   end
  720.  
  721.   #--------------------------------------------------------------------------
  722.   # make_command_list
  723.   #--------------------------------------------------------------------------
  724.   def make_command_list
  725.     for command in YSE::GUARDIAN_MENU::COMMANDS
  726.       case command[0]
  727.       #--- Default ---
  728.       when :status, :items, :skill, :equip
  729.         add_command(command[1], command[0], $game_party.guardians.size > 0)
  730.       #--- Imported ---
  731.       when :gpair
  732.         add_command(command[1], command[0], $game_party.guardians.size > 0)
  733.       #--- Custom Commands ---
  734.       else
  735.         process_custom_command(command)
  736.       end
  737.     end
  738.   end
  739.  
  740.   #--------------------------------------------------------------------------
  741.   # process_custom_command
  742.   #--------------------------------------------------------------------------
  743.   def process_custom_command(command)
  744.     return unless YSE::GUARDIAN_MENU::CUSTOM_STATUS_COMMANDS.include?(command[0])
  745.     show = YSE::GUARDIAN_MENU::CUSTOM_STATUS_COMMANDS[command[0]][1]
  746.     continue = show <= 0 ? true : $game_switches[show]
  747.     return unless continue
  748.     text = command[1]
  749.     switch = YSE::GUARDIAN_MENU::CUSTOM_STATUS_COMMANDS[command[0]][0]
  750.     enabled = switch <= 0 ? true : $game_switches[switch]
  751.     add_command(text, command[0], enabled)
  752.   end
  753.  
  754. end # Window_GuardianMenuCommand
  755.  
  756. #==============================================================================
  757. # ■ Scene_GuardianMenu
  758. #==============================================================================
  759.  
  760. class Scene_GuardianMenu < Scene_MenuBase
  761.  
  762.   #--------------------------------------------------------------------------
  763.   # start
  764.   #--------------------------------------------------------------------------
  765.   def start
  766.     super
  767.     create_help_window
  768.     create_command_window
  769.     create_status_window
  770.     create_guardian_window
  771.     create_actor_window
  772.   end
  773.  
  774.   #--------------------------------------------------------------------------
  775.   # create_command_window
  776.   #--------------------------------------------------------------------------
  777.   def create_command_window
  778.     wy = @help_window.height
  779.     @command_window = Window_GuardianMenuCommand.new(0, wy)
  780.     @command_window.viewport = @viewport
  781.     @command_window.set_handler(:cancel,   method(:return_scene))
  782.     @command_window.set_handler(:skill,     method(:command_personal))
  783.     @command_window.set_handler(:equip,     method(:command_personal))
  784.     @command_window.set_handler(:status,    method(:command_personal))
  785.     if $imported["YSE-GuardianPairing"]
  786.       @command_window.set_handler(:gpair, method(:command_personal_actor))
  787.     end
  788.     process_custom_status_commands
  789.     if $game_temp.guardian_menu_command
  790.       @command_window.index = $game_temp.guardian_menu_command
  791.       $game_temp.guardian_menu_command = nil
  792.     end
  793.   end
  794.  
  795.   #--------------------------------------------------------------------------
  796.   # create_status_window
  797.   #--------------------------------------------------------------------------
  798.   def create_status_window
  799.     wy = @help_window.height
  800.     @status_window = Window_StatusGuardian.new(@command_window.width, wy)
  801.     @status_window.viewport = @viewport
  802.   end
  803.  
  804.   #--------------------------------------------------------------------------
  805.   # create_guardian_window
  806.   #--------------------------------------------------------------------------
  807.   def create_guardian_window
  808.     wy = @command_window.height + @command_window.y
  809.     @guardian_window = Window_MenuGuardian.new(0, wy)
  810.     @guardian_window.viewport = @viewport
  811.     @guardian_window.help_window = @help_window
  812.     @guardian_window.update_help
  813.     @guardian_window.status_window = @status_window
  814.   end
  815.  
  816.   #--------------------------------------------------------------------------
  817.   # create_actor_window
  818.   #--------------------------------------------------------------------------
  819.   def create_actor_window
  820.     @actor_window = Window_MenuActor.new
  821.     @actor_window.viewport = @viewport
  822.     @actor_window.set_handler(:ok,     method(:on_actor_ok))
  823.     @actor_window.set_handler(:cancel, method(:on_actor_cancel))
  824.   end
  825.  
  826.   #--------------------------------------------------------------------------
  827.   # command_personal
  828.   #--------------------------------------------------------------------------
  829.   def command_personal
  830.     @guardian_window.activate
  831.     @guardian_window.select_last
  832.     @guardian_window.set_handler(:ok,     method(:on_personal_ok))
  833.     @guardian_window.set_handler(:cancel, method(:on_personal_cancel))
  834.   end
  835.  
  836.   #--------------------------------------------------------------------------
  837.   # command_personal_actor
  838.   #--------------------------------------------------------------------------
  839.   def command_personal_actor
  840.     @actor_window.x = Graphics.width - @actor_window.width
  841.     @actor_window.show.activate
  842.     @actor_window.select_last
  843.   end
  844.  
  845.   #--------------------------------------------------------------------------
  846.   # on_personal_ok
  847.   #--------------------------------------------------------------------------
  848.   def on_personal_ok
  849.     case @command_window.current_symbol
  850.     when :skill
  851.       SceneManager.call(Scene_Skill)
  852.     when :equip
  853.       SceneManager.call(Scene_Equip)
  854.     when :status
  855.       SceneManager.call(Scene_Status)
  856.     end
  857.   end
  858.  
  859.   #--------------------------------------------------------------------------
  860.   # on_personal_cancel
  861.   #--------------------------------------------------------------------------
  862.   def on_personal_cancel
  863.     @guardian_window.unselect
  864.     @command_window.activate
  865.   end
  866.  
  867.   #--------------------------------------------------------------------------
  868.   # on_actor_ok
  869.   #--------------------------------------------------------------------------
  870.   def on_actor_ok
  871.     case @command_window.current_symbol
  872.     #--- Imported ---
  873.     when :gpair
  874.       SceneManager.call(Scene_GuardianPairing)
  875.     end
  876.   end
  877.  
  878.   #--------------------------------------------------------------------------
  879.   # on_actor_cancel
  880.   #--------------------------------------------------------------------------
  881.   def on_actor_cancel
  882.     @actor_window.hide.deactivate
  883.     @command_window.activate
  884.   end
  885.  
  886.   #--------------------------------------------------------------------------
  887.   # process_custom_status_commands
  888.   #--------------------------------------------------------------------------
  889.   def process_custom_status_commands
  890.     commands = YSE::GUARDIAN_MENU::COMMANDS
  891.     custom_commands = YSE::GUARDIAN_MENU::CUSTOM_STATUS_COMMANDS
  892.     for command in commands
  893.       next unless custom_commands.include?(command[0])
  894.       called_method = custom_commands[command[0]][2]
  895.       @command_window.set_handler(command[0], method(called_method))
  896.     end
  897.   end
  898.  
  899.   #--------------------------------------------------------------------------
  900.   # new method: command_guardian_pairing
  901.   #--------------------------------------------------------------------------
  902.   def command_guardian_pairing
  903.     SceneManager.call(Scene_GuardianPairing)
  904.   end
  905.  
  906.   #--------------------------------------------------------------------------
  907.   # command_name1
  908.   #--------------------------------------------------------------------------
  909.   def command_name1
  910.     # Do nothing
  911.   end
  912.  
  913.   #--------------------------------------------------------------------------
  914.   # command_name2
  915.   #--------------------------------------------------------------------------
  916.   def command_name2
  917.     # Do nothing
  918.   end
  919.  
  920. end # Scene_GuardianMenu
  921.  
  922. #==============================================================================
  923. #
  924. # ▼ End of File
  925. #
  926. #==============================================================================
  927. #==============================================================================
  928. #
  929. # ▼ Yami Engine Ace - Guardian Series
  930. # -- Script: Guardian Pairing
  931. # -- Last Updated: 2012.03.15
  932. # -- Level: Easy
  933. # -- Requires: YSE - Guardian Basic
  934. #
  935. #==============================================================================
  936.  
  937. $imported = {} if $imported.nil?
  938. $imported["YSE-GuardianPairing"] = true
  939.  
  940. #==============================================================================
  941. # ▼ Updates
  942. # =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  943. # 2012.03.15 - Separated Boosting Attributes feature.
  944. #            - Changed a little in visuals.
  945. # 2012.03.14 - Finished Script.
  946. # 2012.03.13 - Started Script.
  947. #
  948. #==============================================================================
  949. # ▼ Introduction
  950. # =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  951. # This scripts provides "Equip Guardian to Actor" Feature for Guardians.
  952. # If you have YSE - Guardian Menu in scripts list, You must add :gpair to
  953. # Guardian Menu commands to show Pairing Menu.
  954. #
  955. #==============================================================================
  956. # ▼ Instructions
  957. # =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  958. # To install this script, open up your script editor and copy/paste this script
  959. # to an open slot below ▼ Materials/素材 but above ▼ Main. Remember to save.
  960. #
  961. #==============================================================================
  962. # ▼ Compatibility
  963. # =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  964. # This script is made strictly for RPG Maker VX Ace. It is highly unlikely that
  965. # it will run with RPG Maker VX without adjusting.
  966. #
  967. #==============================================================================
  968.  
  969. module YSE
  970.   module GUARDIAN_PAIRING
  971.  
  972.     # These Configurations contain visual and vocab things.
  973.     PAIRED_GUARDIAN = "%s"
  974.     NON_PAIRED = "没有神降"
  975.     VOCAB_MENU = "神之降临"    # Command Display in Main Menu.
  976.     MENU_ENABLE_SWITCH = 0      # Set to 0 if don't wanna use this function.
  977.  
  978.     COMMANDS = [ # The order at which the menu items are shown.
  979.       [    :pair,            "准备神降"], # Pairing command.
  980.       [    :unpair,       "解除神降"], # Un-Pairing command
  981.     ] # Do not remove this.
  982.  
  983.   end
  984. end
  985.  
  986. #==============================================================================
  987. # ▼ Editting anything past this point may potentially result in causing
  988. # computer damage, incontinence, explosion of user's head, coma, death, and/or
  989. # halitosis so edit at your own risk.
  990. #==============================================================================
  991.  
  992. #==============================================================================
  993. # ■ Vocab
  994. #==============================================================================
  995.  
  996. module Vocab
  997.   GuardianPairingMenu = YSE::GUARDIAN_PAIRING::VOCAB_MENU
  998.   PairedGuardian = YSE::GUARDIAN_PAIRING::PAIRED_GUARDIAN
  999.   NonPaired = YSE::GUARDIAN_PAIRING::NON_PAIRED
  1000. end
  1001.  
  1002. #==============================================================================
  1003. # ■ Game_Temp
  1004. #==============================================================================
  1005.  
  1006. class Game_Temp
  1007.  
  1008.   #--------------------------------------------------------------------------
  1009.   # public instance variables
  1010.   #--------------------------------------------------------------------------
  1011.   attr_accessor :guardian_pairing_menu_command
  1012.  
  1013. end # Game_Temp
  1014.  
  1015. #==============================================================================
  1016. # ■ Window_MenuCommand
  1017. #==============================================================================
  1018.  
  1019. class Window_MenuCommand < Window_Command
  1020.  
  1021.   #--------------------------------------------------------------------------
  1022.   # alias method: make_command_list
  1023.   #--------------------------------------------------------------------------
  1024.   alias yse_add_main_commands_gp add_main_commands
  1025.   def add_main_commands
  1026.     yse_add_main_commands_gp
  1027.     add_guardian_pairing_commands unless $imported["YEA-AceMenuEngine"]
  1028.   end
  1029.  
  1030.   #--------------------------------------------------------------------------
  1031.   # new method: guardian_command_enabled
  1032.   #--------------------------------------------------------------------------
  1033.   def guardian_pairing_command_enabled
  1034.     return false if $game_party.guardians.size == 0
  1035.     return true if YSE::GUARDIAN_PAIRING::MENU_ENABLE_SWITCH <= 0
  1036.     return $game_switches[YSE::GUARDIAN_PAIRING::MENU_ENABLE_SWITCH]
  1037.   end
  1038.  
  1039.   #--------------------------------------------------------------------------
  1040.   # new method: add_guardian_pairing_commands
  1041.   #--------------------------------------------------------------------------
  1042.   def add_guardian_pairing_commands
  1043.     return if $imported["YSE-GuardianMenu"]
  1044.     add_command(Vocab::GuardianPairingMenu,   :gpair,   guardian_pairing_command_enabled)
  1045.   end
  1046.  
  1047. end # Window_MenuCommand
  1048.  
  1049. #==============================================================================
  1050. # ■ Scene_Menu
  1051. #==============================================================================
  1052.  
  1053. class Scene_Menu < Scene_MenuBase
  1054.  
  1055.   #--------------------------------------------------------------------------
  1056.   # alias method: create_command_window
  1057.   #--------------------------------------------------------------------------
  1058.   alias yse_create_command_window_gp create_command_window
  1059.   def create_command_window
  1060.     yse_create_command_window_gp
  1061.     @command_window.set_handler(:gpair, method(:command_personal))
  1062.   end
  1063.  
  1064.   #--------------------------------------------------------------------------
  1065.   # alias method: on_personal_ok
  1066.   #--------------------------------------------------------------------------
  1067.   alias yse_on_personal_ok_gp on_personal_ok
  1068.   def on_personal_ok
  1069.     case @command_window.current_symbol
  1070.     when :gpair
  1071.       $game_party.target_actor = $game_party.members[@status_window.index]
  1072.       SceneManager.call(Scene_GuardianPairing)
  1073.     else
  1074.       yse_on_personal_ok_gp
  1075.     end
  1076.   end
  1077.  
  1078. end # Scene_Menu
  1079.  
  1080. #==============================================================================
  1081. # ■ Game_Actor
  1082. #==============================================================================
  1083.  
  1084. class Game_Actor < Game_Battler
  1085.  
  1086.   #--------------------------------------------------------------------------
  1087.   # public instance variables
  1088.   #--------------------------------------------------------------------------
  1089.   attr_accessor :pair_actor
  1090.  
  1091.   #--------------------------------------------------------------------------
  1092.   # alias method: setup
  1093.   #--------------------------------------------------------------------------
  1094.   alias yse_setup_gp setup
  1095.   def setup(actor_id)
  1096.     @guardians = []
  1097.     @pair_actor = nil
  1098.     yse_setup_gp(actor_id)
  1099.     clear_guardians
  1100.   end
  1101.  
  1102.   #--------------------------------------------------------------------------
  1103.   # new method: guardians
  1104.   #--------------------------------------------------------------------------
  1105.   def guardians
  1106.     @guardians.collect {|id| $game_actors[id] }
  1107.   end
  1108.  
  1109.   #--------------------------------------------------------------------------
  1110.   # new method: paired_actor
  1111.   #--------------------------------------------------------------------------
  1112.   def paired_actor
  1113.     @pair_actor.nil? ? nil : $game_actors[@pair_actor]
  1114.   end
  1115.  
  1116.   #--------------------------------------------------------------------------
  1117.   # new method: first_guardian
  1118.   #--------------------------------------------------------------------------
  1119.   def first_guardian
  1120.     guardians[0]
  1121.   end
  1122.  
  1123.   #--------------------------------------------------------------------------
  1124.   # new method: is_pair?
  1125.   #--------------------------------------------------------------------------
  1126.   def is_pair?
  1127.     guardian? ? !@pair_actor.nil? : guardians.size > 0
  1128.   end
  1129.  
  1130.   #--------------------------------------------------------------------------
  1131.   # new method: is_pair?
  1132.   #--------------------------------------------------------------------------
  1133.   def force_pair(guardian)
  1134.     @guardians.clear
  1135.     @guardians.push(guardian.id) if guardian
  1136.     @guardians.compact!
  1137.     refresh
  1138.   end
  1139.  
  1140.   #--------------------------------------------------------------------------
  1141.   # new method: is_pair?
  1142.   #--------------------------------------------------------------------------
  1143.   def pair(guardian)
  1144.     return if guardians.include?(guardian)
  1145.     clear_guardians
  1146.     @guardians.push(guardian.id)
  1147.     guardian.pair_actor = self.id
  1148.     refresh
  1149.   end
  1150.  
  1151.   #--------------------------------------------------------------------------
  1152.   # new method: clear_guardians
  1153.   #--------------------------------------------------------------------------
  1154.   def clear_guardians
  1155.     guardians.each { |g| g.pair_actor = nil }
  1156.     @guardians.clear
  1157.   end
  1158.  
  1159.   #--------------------------------------------------------------------------
  1160.   # alias method: gain_exp
  1161.   #--------------------------------------------------------------------------
  1162.   alias yse_gain_exp_gp gain_exp
  1163.   def gain_exp(exp)
  1164.     yse_gain_exp_gp(exp)
  1165.     return if guardian?
  1166.     guardians.each { |guardian|
  1167.       guardian.gain_guardian_exp(guardian, exp)
  1168.     }
  1169.   end
  1170.  
  1171.   #--------------------------------------------------------------------------
  1172.   # new method: gain_guardian_exp
  1173.   #--------------------------------------------------------------------------
  1174.   def gain_guardian_exp(guardian,exp)
  1175.     return if YSE::GUARDIAN::ALL_GUARDIAN_GAIN_EXP
  1176.     guardian.gain_exp(exp)
  1177.   end
  1178.  
  1179. end # Game_Actor
  1180.  
  1181. #==============================================================================
  1182. # ■ Window_Base
  1183. #==============================================================================
  1184.  
  1185. class Window_Base < Window
  1186.  
  1187.   #--------------------------------------------------------------------------
  1188.   # new method: draw_actor_guardian
  1189.   #--------------------------------------------------------------------------
  1190.   def draw_actor_guardian(actor, x, y, width = 180)
  1191.     change_color(normal_color)
  1192.     str = Vocab::PairedGuardian
  1193.     if actor.guardian?
  1194.       name = actor.paired_actor.nil? ? Vocab::NonPaired : actor.paired_actor.name
  1195.     else
  1196.       name = actor.first_guardian.nil? ? Vocab::NonPaired : actor.first_guardian.name
  1197.     end
  1198.     str =  sprintf(str, name)
  1199.     draw_text(x, y, width, line_height, str, 2)
  1200.   end
  1201.  
  1202. end # Window_Base
  1203.  
  1204. #==============================================================================
  1205. # ■ Window_GuardianPairingMenuCommand
  1206. #==============================================================================
  1207.  
  1208. class Window_GuardianPairingMenuCommand < Window_Command
  1209.  
  1210.   #--------------------------------------------------------------------------
  1211.   # initialize
  1212.   #--------------------------------------------------------------------------
  1213.   def initialize(dx, dy)
  1214.     super(dx, dy)
  1215.   end
  1216.  
  1217.   #--------------------------------------------------------------------------
  1218.   # window_width
  1219.   #--------------------------------------------------------------------------
  1220.   def window_width; return 160; end
  1221.  
  1222.   #--------------------------------------------------------------------------
  1223.   # visible_line_number
  1224.   #--------------------------------------------------------------------------
  1225.   def visible_line_number; return 4; end
  1226.  
  1227.   #--------------------------------------------------------------------------
  1228.   # alignment
  1229.   #--------------------------------------------------------------------------
  1230.   def alignment; return 1; end
  1231.  
  1232.   #--------------------------------------------------------------------------
  1233.   # ok_enabled?
  1234.   #--------------------------------------------------------------------------
  1235.   def ok_enabled?
  1236.     return handle?(current_symbol)
  1237.   end
  1238.  
  1239.   #--------------------------------------------------------------------------
  1240.   # process_ok
  1241.   #--------------------------------------------------------------------------
  1242.   def process_ok
  1243.     $game_temp.guardian_pairing_menu_command = self.index
  1244.     super
  1245.   end
  1246.  
  1247.   #--------------------------------------------------------------------------
  1248.   # make_command_list
  1249.   #--------------------------------------------------------------------------
  1250.   def make_command_list
  1251.     for command in YSE::GUARDIAN_PAIRING::COMMANDS
  1252.       enable = command[0] == :pair ? $game_party.guardians.size > 0 : $game_party.target_actor.is_pair?
  1253.       add_command(command[1], command[0], enable)
  1254.     end
  1255.   end
  1256.  
  1257. end # Window_GuardianPairingMenuCommand
  1258.  
  1259. #==============================================================================
  1260. # ■ Window_MenuGuardianPair
  1261. #==============================================================================
  1262.  
  1263. class Window_MenuGuardianPair < Window_MenuGuardian
  1264.  
  1265.   #--------------------------------------------------------------------------
  1266.   # window_width
  1267.   #--------------------------------------------------------------------------
  1268.   def window_width
  1269.     Graphics.width
  1270.   end
  1271.  
  1272.   #--------------------------------------------------------------------------
  1273.   # col_max
  1274.   #--------------------------------------------------------------------------
  1275.   def col_max
  1276.     2
  1277.   end
  1278.  
  1279.   #--------------------------------------------------------------------------
  1280.   # unpair=
  1281.   #--------------------------------------------------------------------------
  1282.   def unpair=(flag)
  1283.     @unpair = flag
  1284.     refresh
  1285.   end
  1286.  
  1287.   #--------------------------------------------------------------------------
  1288.   # enable?
  1289.   #--------------------------------------------------------------------------
  1290.   def enable?(actor)
  1291.     @unpair ? actor.is_pair? : !actor.is_pair?
  1292.   end
  1293.  
  1294.   #--------------------------------------------------------------------------
  1295.   # current_item_enabled?
  1296.   #--------------------------------------------------------------------------
  1297.   def current_item_enabled?
  1298.     enable?($game_party.guardians[index])
  1299.   end
  1300.  
  1301.   #--------------------------------------------------------------------------
  1302.   # draw_guardian_status
  1303.   #--------------------------------------------------------------------------
  1304.   def draw_guardian_status(actor, dx, dy, dw)
  1305.     change_color(normal_color)
  1306.     draw_actor_guardian(actor, dx, dy, dw)
  1307.   end
  1308.  
  1309. end # Window_MenuGuardianPair
  1310.  
  1311. #==============================================================================
  1312. # ■ Window_PairingStatus
  1313. #==============================================================================
  1314.  
  1315. class Window_PairingStatus < Window_SkillStatus
  1316.  
  1317.   #--------------------------------------------------------------------------
  1318.   # draw_actor_simple_status
  1319.   #--------------------------------------------------------------------------
  1320.   def draw_actor_simple_status(actor, dx, dy)
  1321.     draw_actor_name(actor, dx, dy)
  1322.     draw_actor_level(actor, dx, dy + line_height * 1)
  1323.     dw = contents.width - dx - 124
  1324.     draw_actor_guardian(actor, dx + 120, dy, dw)
  1325.     draw_actor_hp(actor, dx + 120, dy + line_height * 1, dw)
  1326.     draw_actor_mp(actor, dx + 120, dy + line_height * 2, dw)
  1327.   end
  1328.  
  1329. end # Window_PairingStatus
  1330.  
  1331. #==============================================================================
  1332. # ■ Scene_GuardianPairing
  1333. #==============================================================================
  1334.  
  1335. class Scene_GuardianPairing < Scene_MenuBase
  1336.  
  1337.   #--------------------------------------------------------------------------
  1338.   # start
  1339.   #--------------------------------------------------------------------------
  1340.   def start
  1341.     super
  1342.     create_help_window
  1343.     create_command_window
  1344.     create_status_window
  1345.     create_guardian_window
  1346.   end
  1347.  
  1348.   #--------------------------------------------------------------------------
  1349.   # create_command_window
  1350.   #--------------------------------------------------------------------------
  1351.   def create_command_window
  1352.     wy = @help_window.height
  1353.     @command_window = Window_GuardianPairingMenuCommand.new(0, wy)
  1354.     @command_window.viewport = @viewport
  1355.     @command_window.set_handler(:cancel,   method(:return_scene))
  1356.     @command_window.set_handler(:pair,   method(:command_pair))
  1357.     @command_window.set_handler(:unpair,   method(:command_unpair))
  1358.     if $game_temp.guardian_pairing_menu_command
  1359.       @command_window.index = $game_temp.guardian_pairing_menu_command
  1360.       $game_temp.guardian_pairing_menu_command = nil
  1361.     end
  1362.   end
  1363.  
  1364.   #--------------------------------------------------------------------------
  1365.   # create_status_window
  1366.   #--------------------------------------------------------------------------
  1367.   def create_status_window
  1368.     wy = @help_window.height
  1369.     @status_window = Window_PairingStatus.new(@command_window.width, wy)
  1370.     @status_window.viewport = @viewport
  1371.     @status_window.actor = $game_party.target_actor
  1372.   end
  1373.  
  1374.   #--------------------------------------------------------------------------
  1375.   # create_guardian_window
  1376.   #--------------------------------------------------------------------------
  1377.   def create_guardian_window
  1378.     wx = $imported["YSE-GuardianBoostStats"] ? 232 : 0
  1379.     wy = @command_window.height + @command_window.y
  1380.     @guardian_window = Window_MenuGuardianPair.new(wx, wy)
  1381.     @guardian_window.viewport = @viewport
  1382.     @guardian_window.help_window = @help_window
  1383.     @guardian_window.update_help
  1384.   end
  1385.  
  1386.   #--------------------------------------------------------------------------
  1387.   # command_actor
  1388.   #--------------------------------------------------------------------------
  1389.   def command_unpair
  1390.     process_unpair
  1391.   end
  1392.  
  1393.   #--------------------------------------------------------------------------
  1394.   # command_pair
  1395.   #--------------------------------------------------------------------------
  1396.   def command_pair
  1397.     @guardian_window.activate
  1398.     @guardian_window.select_last
  1399.     @guardian_window.set_handler(:ok,     method(:on_guardian_ok))
  1400.     @guardian_window.set_handler(:cancel, method(:on_guardian_cancel))
  1401.   end
  1402.  
  1403.   #--------------------------------------------------------------------------
  1404.   # on_guardian_ok
  1405.   #--------------------------------------------------------------------------
  1406.   def on_guardian_ok
  1407.     case @command_window.current_symbol
  1408.     when :pair
  1409.       if not $game_party.menu_actor.is_pair?
  1410.         process_pair
  1411.       else
  1412.         Sound.play_buzzer
  1413.       end
  1414.     when :unpair
  1415.       if $game_party.target_actor.is_pair?
  1416.         process_unpair
  1417.       else
  1418.         Sound.play_buzzer
  1419.       end
  1420.     end
  1421.     @guardian_window.unpair = false
  1422.   end
  1423.  
  1424.   #--------------------------------------------------------------------------
  1425.   # on_guardian_cancel
  1426.   #--------------------------------------------------------------------------
  1427.   def on_guardian_cancel
  1428.     @guardian_window.unselect
  1429.     @guardian_window.unpair = false
  1430.     @command_window.activate
  1431.   end
  1432.  
  1433.   #--------------------------------------------------------------------------
  1434.   # process_pair
  1435.   #--------------------------------------------------------------------------
  1436.   def process_pair
  1437.     $game_party.target_actor.pair($game_party.menu_actor)
  1438.     @command_window.refresh
  1439.     @guardian_window.activate
  1440.     @guardian_window.select_last
  1441.     @status_window.refresh
  1442.   end
  1443.  
  1444.   #--------------------------------------------------------------------------
  1445.   # process_unpair
  1446.   #--------------------------------------------------------------------------
  1447.   def process_unpair
  1448.     $game_party.target_actor.clear_guardians
  1449.     @command_window.refresh
  1450.     @command_window.activate
  1451.     @guardian_window.refresh
  1452.     @status_window.refresh
  1453.   end
  1454.  
  1455. end # Scene_GuardianPairing
  1456.  
  1457. #==============================================================================
  1458. #
  1459. # ▼ End of File
  1460. #
  1461. #==============================================================================
  1462. #==============================================================================
  1463. #
  1464. # ¥ Yami Engine Ace - Guardian Series
  1465. # -- Script: Guardian Boost Stats
  1466. # -- Last Updated: 2012.03.15
  1467. # -- Level: Easy
  1468. # -- Requires: YSE - Guardian Pairing
  1469. #
  1470. #==============================================================================
  1471.  
  1472. $imported = {} if $imported.nil?
  1473. $imported["YSE-GuardianBoostStats"] = true
  1474.  
  1475. #==============================================================================
  1476. # ¥ Updates
  1477. # =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  1478. # 2012.03.15 - Started and Finished Script.
  1479. #
  1480. #==============================================================================
  1481. # ¥ Introduction
  1482. # =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  1483. # This script provides a new feature for YSE - Guardian Pairing, which boost
  1484. # stats for an actor by Guardian's attributes.
  1485. #
  1486. #==============================================================================
  1487. # ¥ Instructions
  1488. # =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  1489. # To install this script, open up your script editor and copy/paste this script
  1490. # to an open slot below ¥ Materials/‘fÞ but above ¥ Main. Remember to save.
  1491. #
  1492. #==============================================================================
  1493. # ¥ Compatibility
  1494. # =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  1495. # This script is made strictly for RPG Maker VX Ace. It is highly unlikely that
  1496. # it will run with RPG Maker VX without adjusting.
  1497. #
  1498. #==============================================================================
  1499.  
  1500. module YSE
  1501.   module GUARDIAN_PAIRING
  1502.  
  1503.     #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  1504.     # - Attributes Settings -
  1505.     #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  1506.     # This section adjusts the stats plus and traits plus of actor who paired
  1507.     # with a guardian.
  1508.     #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  1509.     ATTRIBUTES = { # Start.
  1510.       :stats      =>  true, # Stats injection
  1511.       :traits     =>  true, # Traits injection
  1512.       :skills     =>  true, # Skills injection
  1513.     } # Done.
  1514.     PARAMVAR = 0.2
  1515.   end
  1516. end  
  1517.  
  1518. #==============================================================================
  1519. # ¥ Editting anything past this point may potentially result in causing
  1520. # computer damage, incontinence, explosion of user's head, coma, death, and/or
  1521. # halitosis so edit at your own risk.
  1522. #==============================================================================
  1523.  
  1524. #==============================================================================
  1525. # ¡ Game_Actor
  1526. #==============================================================================
  1527.  
  1528. class Game_Actor < Game_Battler
  1529.  
  1530.   #--------------------------------------------------------------------------
  1531.   # alias method: param_plus
  1532.   #--------------------------------------------------------------------------
  1533.   alias yse_param_plus_gbs param_plus
  1534.   def param_plus(param_id)
  1535.     return yse_param_plus_gbs(param_id) unless YSE::GUARDIAN_PAIRING::ATTRIBUTES[:stats]
  1536.     return yse_param_plus_gbs(param_id) if guardian?
  1537.     guardians.compact.inject(yse_param_plus_gbs(param_id)) {|r, item| r += item.param(param_id)*YSE::GUARDIAN_PAIRING::PARAMVAR }
  1538.   end
  1539.  
  1540.   #--------------------------------------------------------------------------
  1541.   # alias method: feature_objects
  1542.   #--------------------------------------------------------------------------
  1543.   alias yse_feature_objects_gbs feature_objects
  1544.   def feature_objects
  1545.     return yse_feature_objects_gbs unless YSE::GUARDIAN_PAIRING::ATTRIBUTES[:traits]
  1546.     return yse_feature_objects_gbs if guardian?
  1547.     result = yse_feature_objects_gbs
  1548.     guardians.each { |g| result += g.feature_objects }
  1549.     result
  1550.   end
  1551.  
  1552.   #--------------------------------------------------------------------------
  1553.   # alias method: skills
  1554.   #--------------------------------------------------------------------------
  1555.   alias yse_skills_gbs skills
  1556.   def skills
  1557.     return yse_skills_gbs unless YSE::GUARDIAN_PAIRING::ATTRIBUTES[:skills]
  1558.     return yse_skills_gbs if guardian?
  1559.     result = yse_skills_gbs
  1560.     guardians.each { |g| result = result | g.skills }
  1561.     result
  1562.   end
  1563.  
  1564. end # Game_Actor
  1565.  
  1566. #==============================================================================
  1567. # ¡ Window_MenuGuardianPair
  1568. #==============================================================================
  1569.  
  1570. class Window_MenuGuardianPair < Window_MenuGuardian
  1571.  
  1572.   #--------------------------------------------------------------------------
  1573.   # window_width
  1574.   #--------------------------------------------------------------------------
  1575.   def window_width
  1576.     Graphics.width - 232
  1577.   end
  1578.  
  1579.   #--------------------------------------------------------------------------
  1580.   # col_max
  1581.   #--------------------------------------------------------------------------
  1582.   def col_max
  1583.     1
  1584.   end
  1585.  
  1586.   #--------------------------------------------------------------------------
  1587.   # actor_status=
  1588.   #--------------------------------------------------------------------------
  1589.   def actor_status=(actor_status)
  1590.     @actor_status = actor_status
  1591.   end
  1592.  
  1593.   #--------------------------------------------------------------------------
  1594.   # update
  1595.   #--------------------------------------------------------------------------
  1596.   def update
  1597.     super
  1598.     update_actor_status
  1599.   end
  1600.  
  1601.   #--------------------------------------------------------------------------
  1602.   # update_actor_status
  1603.   #--------------------------------------------------------------------------
  1604.   def update_actor_status
  1605.     return unless @actor_status
  1606.     return unless $game_party.guardians[index]
  1607.     return @actor_status.clear_temp if index < 0
  1608.     item = $game_party.guardians[index]
  1609.     @actor_status.set_temp_actor(item)
  1610.   end
  1611.  
  1612. end # Window_MenuGuardianPair
  1613.  
  1614. #==============================================================================
  1615. # ¡ Window_GuardianPairStatus
  1616. #==============================================================================
  1617.  
  1618. class Window_GuardianPairStatus < Window_Base
  1619.  
  1620.   #--------------------------------------------------------------------------
  1621.   # initialize
  1622.   #--------------------------------------------------------------------------
  1623.   def initialize(x, y)
  1624.     super(x, y, window_width, Graphics.height - y)
  1625.     @actor = $game_party.target_actor
  1626.     temp_actor = Marshal.load(Marshal.dump(@actor))
  1627.     @temp_actor = temp_actor
  1628.     refresh
  1629.   end
  1630.  
  1631.   #--------------------------------------------------------------------------
  1632.   # window_width
  1633.   #--------------------------------------------------------------------------
  1634.   def window_width
  1635.     232
  1636.   end
  1637.  
  1638.   #--------------------------------------------------------------------------
  1639.   # visible_line_number
  1640.   #--------------------------------------------------------------------------
  1641.   def visible_line_number
  1642.     return 8
  1643.   end
  1644.  
  1645.   #--------------------------------------------------------------------------
  1646.   # actor
  1647.   #--------------------------------------------------------------------------
  1648.   def actor
  1649.     @actor
  1650.   end
  1651.  
  1652.   #--------------------------------------------------------------------------
  1653.   # set_temp_actor
  1654.   #--------------------------------------------------------------------------
  1655.   def set_temp_actor(guardian)
  1656.     return unless @temp_actor
  1657.     return if @temp_actor.guardians.include?(guardian)
  1658.     @temp_actor.force_pair(guardian)
  1659.     refresh
  1660.   end
  1661.  
  1662.   #--------------------------------------------------------------------------
  1663.   # clear_temp
  1664.   #--------------------------------------------------------------------------
  1665.   def clear_temp
  1666.     temp_actor = Marshal.load(Marshal.dump(@actor))
  1667.     @temp_actor = temp_actor
  1668.     refresh
  1669.   end
  1670.  
  1671.   #--------------------------------------------------------------------------
  1672.   # refresh
  1673.   #--------------------------------------------------------------------------
  1674.   def refresh
  1675.     contents.clear
  1676.     8.times { |i| draw_actor_param(i, 0, line_height * i, contents_width) }
  1677.   end
  1678.  
  1679.   #--------------------------------------------------------------------------
  1680.   # draw_actor_param
  1681.   #--------------------------------------------------------------------------
  1682.   def draw_actor_param(param_id, dx, dy, dw)
  1683.     colour = Color.new(0, 0, 0, translucent_alpha/2)
  1684.     rect = Rect.new(dx+1, dy+1, dw-2, line_height-2)
  1685.     contents.fill_rect(rect, colour)
  1686.     change_color(system_color)
  1687.     draw_text(dx+4, dy, dw-8, line_height, Vocab::param(param_id))
  1688.     change_color(normal_color)
  1689.     draw_text(dx+4, dy, dw-8, line_height, changed_param(param_id), 2)
  1690.   end
  1691.  
  1692.   #--------------------------------------------------------------------------
  1693.   # changed_param
  1694.   #--------------------------------------------------------------------------
  1695.   def changed_param(param_id)
  1696.     result = ""
  1697.     result += @actor.param(param_id).to_s
  1698.     return result if @temp_actor.nil?
  1699.     return result if @temp_actor.guardians == @actor.guardians
  1700.     result += "¨ " + @temp_actor.param(param_id).to_s
  1701.     return result
  1702.   end
  1703.  
  1704. end # Window_GuardianPairStatus
  1705.  
  1706. #==============================================================================
  1707. # ¡ Scene_GuardianPairing
  1708. #==============================================================================
  1709.  
  1710. class Scene_GuardianPairing < Scene_MenuBase
  1711.  
  1712.   #--------------------------------------------------------------------------
  1713.   # alias method: start
  1714.   #--------------------------------------------------------------------------
  1715.   alias yse_start_gbs start
  1716.   def start
  1717.     yse_start_gbs
  1718.     create_actor_status_window
  1719.   end
  1720.  
  1721.   #--------------------------------------------------------------------------
  1722.   # new method: create_actor_status_window
  1723.   #--------------------------------------------------------------------------
  1724.   def create_actor_status_window
  1725.     wx = 0
  1726.     wy = @command_window.height + @command_window.y
  1727.     @actor_status_window = Window_GuardianPairStatus.new(wx, wy)
  1728.     @actor_status_window.viewport = @viewport
  1729.     @guardian_window.actor_status = @actor_status_window
  1730.   end
  1731.  
  1732.   #--------------------------------------------------------------------------
  1733.   # alias method: process_pair
  1734.   #--------------------------------------------------------------------------
  1735.   alias yse_process_pair_gbs process_pair
  1736.   def process_pair
  1737.     yse_process_pair_gbs
  1738.     @actor_status_window.refresh
  1739.   end
  1740.  
  1741.   #--------------------------------------------------------------------------
  1742.   # alias method: process_unpair
  1743.   #--------------------------------------------------------------------------
  1744.   alias yse_process_unpair_gbs process_unpair
  1745.   def process_unpair
  1746.     yse_process_unpair_gbs
  1747.     @actor_status_window.refresh
  1748.   end
  1749.  
  1750. end # Scene_GuardianPairing
  1751.  
  1752. #==============================================================================
  1753. #
  1754. # ¥ End of File
  1755. #
  1756. #==============================================================================

以上是主模块!角色如果要设置为守护精灵,备注里写<guardian>
然后就可以进行神降了

点评

请问那个备注在哪里啊?  发表于 2012-3-20 17:52

评分

参与人数 1星屑 +40 收起 理由
无双sxa + 40 感谢分享。

查看全部评分

Lv1.梦旅人

梦石
0
星屑
64
在线时间
294 小时
注册时间
2011-7-31
帖子
687
2
发表于 2012-3-24 15:35:56 | 只看该作者
什么意思= =不明白

点评

就是召唤精灵或是神兽伙伴一起战斗吧。  发表于 2012-3-24 16:01
如果繁华被摧毁,让我好好地睡.....
回复 支持 反对

使用道具 举报

Lv1.梦旅人

梦石
0
星屑
45
在线时间
138 小时
注册时间
2011-11-15
帖子
216
3
发表于 2012-3-26 20:15:53 | 只看该作者
太狠了吧,这么长,看着就崩
具体能做点什么尼,英文看不懂
回复 支持 反对

使用道具 举报

Lv1.梦旅人

梦石
0
星屑
74
在线时间
12 小时
注册时间
2012-10-19
帖子
13
4
发表于 2013-3-16 11:33:25 | 只看该作者
不明白,是召唤伙伴吗???
不用这么费劲吧…………

点评

你挖坟了。  发表于 2013-3-17 09:29
回复 支持 反对

使用道具 举报

Lv1.梦旅人

彭格列I世

梦石
0
星屑
168
在线时间
566 小时
注册时间
2012-8-17
帖子
1614
5
发表于 2013-4-3 12:45:50 | 只看该作者
完全用事件就可以了吧?

赏金猎人 -- Bounty Hunter 预告贴(点击图片或者这里进入
交流群组:321810846

小刀的论坛!!点击这里!
小刀的论坛!!点击这里!
小刀的论坛!!点击这里!
小刀的论坛!!点击这里!
小刀的论坛!!点击这里!
小刀的论坛!!点击这里!
回复 支持 反对

使用道具 举报

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

本版积分规则

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

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

GMT+8, 2024-11-14 14:14

Powered by Discuz! X3.1

© 2001-2013 Comsenz Inc.

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