查看: 3410|回复: 5

[已经解决] 使用了装备显示增强与成就脚本

[复制链接]
梦石
0
星屑
50
在线时间
47 小时
注册时间
2012-12-13
回帖
22
发表于 2012-12-21 17:02:55 | 显示全部楼层 |阅读模式

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

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

×
本帖最后由 KyoCheng 于 2012-12-22 15:40 编辑

用了装备显示增强以后脚本将说明的框给去掉了,导致成就脚本只能看到名字,看不到说明了,能修改吗?
如果可以的话就只改成 只有在装备界面才去掉说明窗口,或者让成就介绍窗口也像装备窗口那样显示出来,再或者成就界面能显示介绍窗口
  1. #encoding:utf-8

  2. #==============================================================================

  3. # ■ 装备说明增强

  4. #------------------------------------------------------------------------------

  5. #  修改了说明窗口,增强了装备的说明 作者:wyongcan  发布于66RPG   转载请注明

  6. #==============================================================================

  7. module Help

  8.   CODE ={

  9.     11 => "属性抗性",

  10.     12 => "弱化抗性",

  11.     13 => "状态抗性",

  12.     14 => "状态免疫",

  13.     21 => "普通能力",

  14.     22 => "添加能力",

  15.     23 => "特殊能力",

  16.     31 => "攻击附带属性",

  17.     32 => "攻击附带状态",

  18.     33 => "修正攻击速度",

  19.     34 => "添加攻击次数",

  20.     41 => "添加技能类型",

  21.     42 => "禁用技能类型",

  22.     43 => "添加技能",

  23.     44 => "禁用技能",

  24.     51 => "可装备武器类型",

  25.     52 => "可装备护甲类型",

  26.     53 => "固定装备",

  27.     54 => "禁用装备",

  28.     55 => "装备风格",

  29.     61 => "添加行动次数",

  30.     62 => "特殊标志",

  31.     63 => "消失效果",

  32.     64 => "队伍能力"}

  33.   #特殊标志

  34.   FLAG ={

  35.                 0 => "自动战斗",

  36.                 1 => "擅长防御",

  37.                 2 => "保护弱者",

  38.                 3 => "特技专注"}

  39.   #普通能力

  40.         PARAM ={

  41.                 0 => "最大HP",

  42.                 1 => "最大MP",

  43.                 2 => "物理攻击",

  44.                 3 => "物理防御",

  45.                 4 => "精神",

  46.                 5 => "回复",

  47.                 6 => "敏 捷 值",

  48.                 7 => "幸 运 值"}

  49.   #添加能力

  50.         XPARAM ={

  51.                 0 => "物理命中几率:",

  52.                 1 => "物理闪避几率:",

  53.                 2 => "必杀几率:",

  54.                 3 => "必杀闪避几率:",

  55.                 4 => "魔法闪避几率:",

  56.                 5 => "魔法反射几率:",

  57.                 6 => "物理反击几率:",

  58.                 7 => "体力值再生速度:",

  59.                 8 => "魔力值再生速度:",

  60.                 9 => "特技值再生速度:"}

  61.   #特殊能力

  62.         SPARAM ={

  63.                 0 => "受到攻击的几率",

  64.                 1 => "防御效果比率",

  65.                 2 => "恢复效果比率",

  66.                 3 => "药理知识",

  67.                 4 => "MP消费率",

  68.                 5 => "TP消耗率",

  69.                 6 => "物理伤害加成",

  70.                 7 => "魔法伤害加成",

  71.                 8 => "地形伤害加成",

  72.                 9 => "经验获得加成"}

  73. #~   #效果范围

  74. #~         SCOPE ={

  75. #~                 0 => "特殊",

  76. #~                 1 => "单个敌人",

  77. #~                 2 => "全体敌人" ,

  78. #~                 3 => "一个随机敌人",

  79. #~                 4 => "两个随机敌人",

  80. #~                 5 => "三个随机敌人",

  81. #~                 6 => "四个随机敌人",

  82. #~                 7 => "单个队友",

  83. #~                 8 => "全体队友",

  84. #~                 9 => "单个队友(无法战斗)",

  85. #~                 10 => "全体队友(无法战斗)",

  86. #~                 11 => "使用者"}

  87.         @队伍能力 ={

  88.                 0 => "遇敌几率减半",

  89.                 1 => "随机遇敌无效",

  90.                 2 => "敌人偷袭无效",

  91.                 3 => "先制攻击几率上升",

  92.                 4 => "获得金钱数量双倍",

  93.                 5 => "物品掉落几率双倍"}

  94.   def self.ready

  95.     @状态 = {}

  96.     @武器类型 = {}

  97.     @防具类型 = {}

  98.     @属性 = {}

  99.     $data_states.each{|x| @状态[x.id] = x.name if x != nil}

  100.     elements = $data_system.elements

  101.     weapon_types = $data_system.weapon_types

  102.     armor_types = $data_system.armor_types

  103.     elements.each_with_index{|x,y| @属性[y] = x if x != ""}

  104.     weapon_types.each_with_index{|x,y| @武器类型[y] = x if x != ""}

  105.     armor_types.each_with_index{|x,y| @防具类型[y] = x if x != ""}

  106.   end

  107.   def self.getequiphelp(equip)

  108.     help = ""

  109.     param = []

  110.     equip.params.each_with_index{|x,y| param.push([PARAM[y],x])}

  111.     param = param.select{|x| x[1] != 0}

  112.     param.each{|x| help += x[0] + ":" + x[1].to_s + "\n"}

  113.     features = equip.features

  114.     features.select{|x| x.code == 55}.each{|x| help += CODE[x.code] + ":双持武器" + "\n"}

  115.     features.select{|x| x.code == 11}.each{|x| help += CODE[x.code] + ":" + @属性[x.data_id] + "*" + x.value.to_s + "\n"}

  116.     features.select{|x| x.code == 12}.each{|x| help += CODE[x.code] + ":" + PARAM[x.data_id] + "*" + x.value.to_s + "\n"}

  117.     features.select{|x| x.code == 13}.each{|x| help += CODE[x.code] + ":" + @状态[x.data_id] + "*" + x.value.to_s + "\n"}

  118.     features.select{|x| x.code == 14}.each{|x| help += CODE[x.code] + ":" + @状态[x.data_id] + "\n"}

  119.     features.select{|x| x.code == 31}.each{|x| help += CODE[x.code] + ":" + @属性[x.data_id] + "\n"}

  120.     features.select{|x| x.code == 32}.each{|x| help += CODE[x.code] + ":" + @状态[x.data_id] + "+" + x.value.to_s + "\n"}

  121.     features.select{|x| x.code == 33}.each{|x| help += CODE[x.code] + ":" + x.value.to_s + "\n"}

  122.     features.select{|x| x.code == 34}.each{|x| help += CODE[x.code] + ":" + x.value.to_s + "\n"}

  123.     features.select{|x| x.code == 41}.each{|x| help += CODE[x.code] + ":" + (x.data_id == 1 ? "特技" : "魔法")  + "\n"}

  124.     features.select{|x| x.code == 42}.each{|x| help += CODE[x.code] + ":" + (x.data_id == 1 ? "特技" : "魔法")  + "\n"}

  125.     features.select{|x| x.code == 43}.each{|x| help += CODE[x.code] + ":" + $data_skills[x.data_id].name  + "\n"}

  126.     features.select{|x| x.code == 44}.each{|x| help += CODE[x.code] + ":" + $data_skills[x.data_id].name  + "\n"}

  127.     features.select{|x| x.code == 51}.each{|x| help += CODE[x.code] + ":" + @武器类型[x.data_id]  + "\n"}

  128.     features.select{|x| x.code == 52}.each{|x| help += CODE[x.code] + ":" + @防具类型[x.data_id]  + "\n"}

  129.     features.select{|x| x.code == 61}.each{|x| help += CODE[x.code] + ":" + x.value.to_s  + "\n"}

  130.     features.select{|x| x.code == 62}.each{|x| help += CODE[x.code] + ":" + FLAG[x.data_id]  + "\n"}

  131.     features.select{|x| x.code == 64}.each{|x| help += CODE[x.code] + ":" + @队伍能力[x.data_id]  + "\n"}

  132.     featuresparam = []

  133.     featuresparam.push features.select{|x| x.code == 21}

  134.     featuresparam.push features.select{|x| x.code == 22}

  135.     featuresparam.push features.select{|x| x.code == 23}

  136.     featuresparam[0].each{|x| help += PARAM[x.data_id] + "*" + x.value.to_s + "\n"}

  137.     featuresparam[1].each{|x| help += XPARAM[x.data_id] + x.value.to_s + "\n"}

  138.     featuresparam[2].each{|x| help += SPARAM[x.data_id] + "*" + x.value.to_s + "\n"}

  139.     help

  140.   end

  141.   def self.getline(text,maxtext)

  142.     xtext = []

  143.     line = 0

  144.     text.each_line{|x| xtext.push x.sub(/\n/){}}

  145.     xtext.each{|x| x.size % maxtext != 0 ? line += x.size / maxtext + 1 : line += x.size / maxtext}

  146.     line

  147.   end

  148. end

  149. #==============================================================================

  150. # ■ Window_Help

  151. #------------------------------------------------------------------------------

  152. #  显示特技和物品等的说明、以及角色状态的窗口

  153. #==============================================================================


  154. class Window_Help < Window_Base

  155.   #--------------------------------------------------------------------------

  156.   # ● 初始化对象

  157.   #--------------------------------------------------------------------------

  158.   def initialize(line_number = 0)

  159.     super(0, 0, 210, fitting_height(line_number))

  160.     self.z = 150

  161.     contents.font.size = 18

  162.     hide

  163.   end

  164.   #--------------------------------------------------------------------------

  165.   # ● 设置内容

  166.   #--------------------------------------------------------------------------

  167.   def set_text(text)

  168.     if text != @text

  169.       @text = text

  170.       refresh

  171.     end

  172.   end

  173.   #--------------------------------------------------------------------------

  174.   # ● 清除

  175.   #--------------------------------------------------------------------------

  176.   def clear

  177.     set_text("")

  178.   end

  179.   #--------------------------------------------------------------------------

  180.   # ● 更新帮助位置

  181.   #--------------------------------------------------------------------------

  182.   def uppos(index,rect,window)

  183.     self.height = fitting_height2(Help.getline(@xtext,13))

  184.     create_contents

  185.     contents.font.size = 18

  186.     rect.x -= window.ox

  187.     rect.y -= window.oy

  188.     ax = rect.x + rect.width + 10

  189.     ax = rect.x - self.width + 10 if ax + self.width > window.width + 10

  190.     ax += window.x

  191.     ax = 0 if ax < 0

  192.     ay = rect.y + rect.height

  193.     ay = rect.y - self.height if ay + self.height > window.height

  194.     ay += window.y

  195.     ay = 0 if ay < 0

  196.     self.x = ax

  197.     self.y = ay

  198.     set_text(@xtext)

  199.     show

  200.   end

  201.   #--------------------------------------------------------------------------

  202.   # ● 设置物品

  203.   #     item : 技能、物品等

  204.   #--------------------------------------------------------------------------

  205.   def set_item(item)

  206.     if item == nil

  207.       set_text("")

  208.       return

  209.     end

  210.     @xtext = ""

  211.     @xtext = "名称:" + item.name + "\n"

  212.     @xtext += "介绍:" + item.description + "\n"

  213.     @xtext += "价格:" + item.price.to_s + "\n" if item.is_a?(RPG::EquipItem) || item.is_a?(RPG::Item)

  214.     @xtext += Help.getequiphelp(item) if item.is_a?(RPG::EquipItem)

  215.     @xtext = @xtext[0,@text.size - 2] if @xtext[@xtext.size - 2,2] == "\n"

  216.   end

  217.   #--------------------------------------------------------------------------

  218.   # ● 刷新

  219.   #--------------------------------------------------------------------------

  220.   def refresh

  221.     contents.clear

  222.     hide if @text == ""

  223.     draw_text_ex(4, 0, @text,width,40,false)

  224.   end

  225. end


  226. class Window_Base < Window

  227.   #--------------------------------------------------------------------------

  228.   # ● 计算窗口显示指定行数时的应用高度2*************************

  229.   #--------------------------------------------------------------------------

  230.   def fitting_height2(line_number)

  231.     line_number * contents.font.size + standard_padding * 2

  232.   end

  233. #~ draw_text_ex的增强,使其可以自动换行  原作者:叶子 修改:wyongcan

  234.   #--------------------------------------------------------------------------

  235.   # ● 绘制带有控制符的文本内容

  236.   #   如果传递了width参数的话,会自动换行

  237.   #--------------------------------------------------------------------------

  238.   def draw_text_ex(x, y, text, width = nil,textwidth = nil,normalfont = true)

  239.     reset_font_settings if normalfont == true

  240.     text = convert_escape_characters(text)

  241.     pos = {:x => x, :y => y, :new_x => x, :height => calc_line_height(text)}

  242.     if width != nil

  243.       pos[:height] = contents.font.size

  244.       pos[:width] = width

  245.       pos[:textwidth] = textwidth

  246.     end

  247.     process_character(text.slice!(0, 1), text, pos) until text.empty?

  248.   end

  249.   #--------------------------------------------------------------------------

  250.   # ● 文字的处理

  251.   #     c    : 文字

  252.   #     text : 绘制处理中的字符串缓存(字符串可能会被修改)

  253.   #     pos  : 绘制位置 {:x, :y, :new_x, :height}

  254.   #--------------------------------------------------------------------------

  255.   def process_character(c, text, pos)

  256.     case c

  257.     when "\r"   # 回车

  258.       return

  259.     when "\n"   # 换行

  260.       process_new_line(text, pos)

  261.     when "\f"   # 翻页

  262.       process_new_page(text, pos)

  263.     when "\e"   # 控制符

  264.       process_escape_character(obtain_escape_code(text), text, pos)

  265.     else        # 普通文字

  266.       pos[:textwidth] == nil ? text_width = text_size(c).width : text_width = pos[:textwidth]

  267.       if pos[:width] != nil && pos[:x] - pos[:new_x] + text_width > pos[:width]

  268.         process_new_line(text, pos)

  269.       end

  270.       process_normal_character(c, pos)

  271.     end

  272.   end

  273. end


  274. class Window_ItemList < Window_Selectable

  275.   #--------------------------------------------------------------------------

  276.   # ● 更新帮助内容

  277.   #--------------------------------------------------------------------------

  278.   def update_help

  279.     @help_window.set_item(item)

  280.     @help_window.uppos(index,item_rect(index),self) if index != -1 && item != nil
  281.   end

  282. end


  283. class Window_SkillList < Window_Selectable

  284.   #--------------------------------------------------------------------------

  285.   # ● 更新帮助内容

  286.   #--------------------------------------------------------------------------

  287.   def update_help

  288.     @help_window.set_item(item)

  289.     @help_window.uppos(index,item_rect(index),self) if index != -1 && item != nil
  290.   end

  291. end


  292. class Window_ShopBuy < Window_Selectable

  293.   #--------------------------------------------------------------------------

  294.   # ● 更新帮助内容

  295.   #--------------------------------------------------------------------------

  296.   def update_help

  297.     @help_window.set_item(item) if @help_window

  298.     @help_window.uppos(index,item_rect(index),self) if index != -1 && item != nil && @help_window

  299.     @status_window.item = item if @status_window

  300.   end

  301. end


  302. class Window_EquipSlot < Window_Selectable

  303.   #--------------------------------------------------------------------------

  304.   # ● 更新帮助内容

  305.   #--------------------------------------------------------------------------

  306.   def update_help

  307.     super

  308.     @help_window.set_item(item) if @help_window

  309.     @help_window.uppos(index,item_rect(index),self) if index != -1 && item != nil && @help_window

  310.     @status_window.set_temp_actor(nil) if @status_window

  311.   end

  312. end


  313. class Scene_Shop < Scene_MenuBase

  314.         alias on_sell_ok_old on_sell_ok

  315.         def on_sell_ok

  316.                 on_sell_ok_old

  317.                 @help_window.hide

  318.         end

  319.         alias on_buy_ok_old on_buy_ok

  320.         def on_buy_ok

  321.                 on_buy_ok_old

  322.                 @help_window.hide

  323.         end

  324.         alias on_number_ok_old on_number_ok

  325.         def on_number_ok

  326.                 on_number_ok_old

  327.     @help_window.refresh

  328.                 @help_window.show

  329.         end

  330.         alias on_number_cancel_old on_number_cancel

  331.         def on_number_cancel

  332.                 on_number_cancel_old

  333.     @help_window.refresh

  334.                 @help_window.show

  335.         end

  336. end


  337. class Scene_Title < Scene_Base

  338.   alias start_old start

  339.   def start

  340.     start_old

  341.     Help.ready

  342.   end

  343. end
  344. class Window_Base < Window

  345.         alias old_process_new_line process_new_line

  346.         def process_new_line(text, pos)

  347.     old_process_new_line(text, pos)

  348.                 pos[:height] = contents.font.size if pos[:width] != nil

  349.         end

  350. end

  351. class Scene_ItemBase < Scene_MenuBase

  352.         alias old_on_actor_cancel on_actor_cancel

  353.   def on_actor_cancel

  354.     old_on_actor_cancel

  355.         @help_window.refresh

  356.   end

  357.         alias old_on_actor_ok on_actor_ok

  358.   def on_actor_ok

  359.     old_on_actor_ok

  360.         @help_window.refresh

  361.   end

  362. end
复制代码


  1. #==============================================================================
  2. # ★ RGSS3_荣誉系统 Ver1.00
  3. #==============================================================================
  4. #尼玛啊!!!我讨厌日文啊
  5. #使用方法:
  6. #         gain_medal(0)
  7. #==============================================================================
  8. # □ 设定项目
  9. #==============================================================================
  10. module TMMEDAL
  11.   COMMAND_MEDAL = "成就"     # 菜单中的名字
  12.   
  13.   # 一个荣誉也没有时隐藏菜单(true隐藏;false不隐藏)
  14.   HIDE_COMMAND = false
  15.   
  16.   # 荣誉获得时的效果音
  17.   SE_GAIN_MEDAL = RPG::SE.new("Powerup", 90, 140)
  18.   
  19.   # 荣誉名称及简介的设置
  20.   #例如:MEDAL_DATA[0] = ["名字", 187, "简介"]
  21.   MEDAL_DATA = {}
  22.   MEDAL_DATA[0] = ["名字?", 187, "简介?"]
  23.   MEDAL_DATA[1] = ["【启程】", 188, "与诺亚镇告别。"]

  24. end

  25. #==============================================================================
  26. # ■ Game_Party
  27. #==============================================================================
  28. class Game_Party
  29.   #--------------------------------------------------------------------------
  30.   # ● 公開インスタンス変数
  31.   #--------------------------------------------------------------------------
  32.   attr_reader   :medals                   # 獲得済みメダル
  33.   attr_reader   :new_medals               # 新規獲得メダル
  34.   attr_accessor :medal_info_count         # メダル情報表示カウント
  35.   attr_accessor :medal_info_opacity       # メダル情報表示不透明度
  36.   #--------------------------------------------------------------------------
  37.   # ● オブジェクト初期化
  38.   #--------------------------------------------------------------------------
  39.   alias tmmedal_game_party_initialize initialize
  40.   def initialize
  41.     tmmedal_game_party_initialize
  42.     @medals = []
  43.     @new_medals = []
  44.     @medal_info_count = 0
  45.     @medal_info_opacity = 0
  46.   end
  47.   #--------------------------------------------------------------------------
  48.   # ○ メダルの獲得
  49.   #--------------------------------------------------------------------------
  50.   def gain_medal(medal_id)
  51.     return if @medals.any? {|medal| medal[0] == medal_id }
  52.     t = Time.now.strftime(" (%Y/%m/%d %H:%M)")
  53.     @medals.push([medal_id, t])
  54.     @new_medals.push([medal_id, t])
  55.   end
  56.   #--------------------------------------------------------------------------
  57.   # ○ 獲得メダル情報の消去
  58.   #--------------------------------------------------------------------------
  59.   def delete_new_medal
  60.     @new_medals.shift
  61.   end
  62. end

  63. #==============================================================================
  64. # ■ Game_Interpreter
  65. #==============================================================================
  66. class Game_Interpreter
  67.   #--------------------------------------------------------------------------
  68.   # ○ メダルの獲得
  69.   #--------------------------------------------------------------------------
  70.   def gain_medal(medal_id)
  71.     $game_party.gain_medal(medal_id)
  72.   end
  73. end

  74. #==============================================================================
  75. # ■ Window_MenuCommand
  76. #==============================================================================
  77. class Window_MenuCommand
  78.   #--------------------------------------------------------------------------
  79.   # ● 独自コマンドの追加用
  80.   #--------------------------------------------------------------------------
  81.   alias tmmedal_window_menucommand_add_original_commands add_original_commands
  82.   def add_original_commands
  83.     tmmedal_window_menucommand_add_original_commands
  84.     unless TMMEDAL::HIDE_COMMAND && !medal_enabled
  85.       add_command(TMMEDAL::COMMAND_MEDAL, :medal, medal_enabled)
  86.     end
  87.   end
  88.   #--------------------------------------------------------------------------
  89.   # ○ メダルの有効状態を取得
  90.   #--------------------------------------------------------------------------
  91.   def medal_enabled
  92.     !$game_party.medals.empty?
  93.   end
  94. end

  95. #==============================================================================
  96. # □ Window_MedalInfo
  97. #==============================================================================
  98. class Window_MedalInfo < Window_Base
  99.   #--------------------------------------------------------------------------
  100.   # ● オブジェクト初期化
  101.   #--------------------------------------------------------------------------
  102.   def initialize
  103.     super(Graphics.width - window_width, 0, window_width, fitting_height(1))
  104.     self.opacity = 0
  105.     self.contents_opacity = $game_party.medal_info_opacity
  106.     refresh
  107.   end
  108.   #--------------------------------------------------------------------------
  109.   # ● ウィンドウ幅の取得
  110.   #--------------------------------------------------------------------------
  111.   def window_width
  112.     return 240
  113.   end
  114.   #--------------------------------------------------------------------------
  115.   # ● フレーム更新
  116.   #--------------------------------------------------------------------------
  117.   def update
  118.     super
  119.     if $game_party.medal_info_count > 0
  120.       self.contents_opacity += 16
  121.       $game_party.medal_info_count -= 1
  122.       $game_party.delete_new_medal if $game_party.medal_info_count == 0
  123.     else
  124.       self.contents_opacity -= 16
  125.       if self.contents_opacity == 0
  126.         open unless $game_party.new_medals.empty?
  127.       end
  128.     end
  129.     $game_party.medal_info_opacity = self.contents_opacity
  130.   end
  131.   #--------------------------------------------------------------------------
  132.   # ● ウィンドウを開く
  133.   #--------------------------------------------------------------------------
  134.   def open
  135.     refresh
  136.     TMMEDAL::SE_GAIN_MEDAL.play
  137.     $game_party.medal_info_count = 150
  138.     self.contents_opacity = 0
  139.     self
  140.   end
  141.   #--------------------------------------------------------------------------
  142.   # ○ リフレッシュ
  143.   #--------------------------------------------------------------------------
  144.   def refresh
  145.     contents.clear
  146.     unless $game_party.new_medals.empty?
  147.       draw_background(contents.rect)
  148.       medal = TMMEDAL::MEDAL_DATA[$game_party.new_medals[0][0]]
  149.       rect = contents.rect.clone
  150.       draw_icon(medal[1], rect.x, rect.y)
  151.       rect.x += 24
  152.       rect.width -= 24
  153.       draw_text(rect, medal[0])
  154.     end
  155.   end
  156.   #--------------------------------------------------------------------------
  157.   # ○ 背景の描画
  158.   #--------------------------------------------------------------------------
  159.   def draw_background(rect)
  160.     temp_rect = rect.clone
  161.     temp_rect.width /= 2
  162.     contents.gradient_fill_rect(temp_rect, back_color2, back_color1)
  163.     temp_rect.x = temp_rect.width
  164.     contents.gradient_fill_rect(temp_rect, back_color1, back_color2)
  165.   end
  166.   #--------------------------------------------------------------------------
  167.   # ○ 背景色 1 の取得
  168.   #--------------------------------------------------------------------------
  169.   def back_color1
  170.     Color.new(0, 0, 0, 192)
  171.   end
  172.   #--------------------------------------------------------------------------
  173.   # ○ 背景色 2 の取得
  174.   #--------------------------------------------------------------------------
  175.   def back_color2
  176.     Color.new(0, 0, 0, 0)
  177.   end
  178. end

  179. #==============================================================================
  180. # □ Window_Medal
  181. #==============================================================================
  182. class Window_Medal < Window_Selectable
  183.   #--------------------------------------------------------------------------
  184.   # ● オブジェクト初期化
  185.   #--------------------------------------------------------------------------
  186.   def initialize(x, y, width, height)
  187.     super
  188.     refresh
  189.     select(0)
  190.     activate
  191.   end
  192.   #--------------------------------------------------------------------------
  193.   # ● 桁数の取得
  194.   #--------------------------------------------------------------------------
  195.   def col_max
  196.     return 1
  197.   end
  198.   #--------------------------------------------------------------------------
  199.   # ● 項目数の取得
  200.   #--------------------------------------------------------------------------
  201.   def item_max
  202.     @data ? @data.size : 1
  203.   end
  204.   #--------------------------------------------------------------------------
  205.   # ● アイテムの取得
  206.   #--------------------------------------------------------------------------
  207.   def item
  208.     @data && index >= 0 ? @data[index] : nil
  209.   end
  210.   #--------------------------------------------------------------------------
  211.   # ● アイテムリストの作成
  212.   #--------------------------------------------------------------------------
  213.   def make_item_list
  214.     @data = $game_party.medals
  215.   end
  216.   #--------------------------------------------------------------------------
  217.   # ● 項目の描画
  218.   #--------------------------------------------------------------------------
  219.   def draw_item(index)
  220.     item = @data[index]
  221.     medal = TMMEDAL::MEDAL_DATA[item[0]]
  222.     rect = item_rect(index)
  223.     draw_icon(medal[1], rect.x, rect.y)
  224.     rect.x += 24
  225.     rect.width -= 216
  226.     draw_text(rect, medal[0])
  227.     rect.x = contents.width - 192
  228.     rect.width = 192
  229.     draw_text(rect, item[1], 2)
  230.   end
  231.   #--------------------------------------------------------------------------
  232.   # ● ヘルプテキスト更新
  233.   #--------------------------------------------------------------------------
  234.   def update_help
  235.     if item
  236.       medal = TMMEDAL::MEDAL_DATA[item[0]]
  237.       text = medal[2]
  238.       @help_window.set_text(text)
  239.     end
  240.   end
  241.   #--------------------------------------------------------------------------
  242.   # ● リフレッシュ
  243.   #--------------------------------------------------------------------------
  244.   def refresh
  245.     make_item_list
  246.     create_contents
  247.     draw_all_items
  248.   end
  249. end

  250. #==============================================================================
  251. # ■ Scene_Map
  252. #==============================================================================
  253. class Scene_Map
  254.   #--------------------------------------------------------------------------
  255.   # ● 全ウィンドウの作成
  256.   #--------------------------------------------------------------------------
  257.   alias tmmedal_scene_map_create_all_windows create_all_windows
  258.   def create_all_windows
  259.     tmmedal_scene_map_create_all_windows
  260.     create_medal_window
  261.   end
  262.   #--------------------------------------------------------------------------
  263.   # ○ メダルウィンドウの作成
  264.   #--------------------------------------------------------------------------
  265.   def create_medal_window
  266.     @medal_window = Window_MedalInfo.new
  267.   end
  268. end

  269. #==============================================================================
  270. # ■ Scene_Menu
  271. #==============================================================================
  272. class Scene_Menu
  273.   #--------------------------------------------------------------------------
  274.   # ● コマンドウィンドウの作成
  275.   #--------------------------------------------------------------------------
  276.   alias tmmedal_scene_menu_create_command_window create_command_window
  277.   def create_command_window
  278.     tmmedal_scene_menu_create_command_window
  279.     @command_window.set_handler(:medal, method(:command_medal))
  280.   end
  281.   #--------------------------------------------------------------------------
  282.   # ○ コマンド[メダル]
  283.   #--------------------------------------------------------------------------
  284.   def command_medal
  285.     SceneManager.call(Scene_Medal)
  286.   end
  287. end

  288. #==============================================================================
  289. # □ Scene_Medal
  290. #==============================================================================
  291. class Scene_Medal < Scene_MenuBase
  292.   #--------------------------------------------------------------------------
  293.   # ● 開始処理
  294.   #--------------------------------------------------------------------------
  295.   def start
  296.     super
  297.     create_help_window
  298.     create_item_window
  299.   end
  300.   #--------------------------------------------------------------------------
  301.   # ○ アイテムウィンドウの作成
  302.   #--------------------------------------------------------------------------
  303.   def create_item_window
  304.     wy = @help_window.height
  305.     wh = Graphics.height - wy
  306.     @item_window = Window_Medal.new(0, wy, Graphics.width, wh)
  307.     @item_window.viewport = @viewport
  308.     @item_window.help_window = @help_window
  309.     @item_window.set_handler(:cancel, method(:return_scene))
  310.   end
  311. end


复制代码
梦石
0
星屑
50
在线时间
47 小时
注册时间
2012-12-13
回帖
22
 楼主| 发表于 2012-12-22 14:24:56 | 显示全部楼层
上个图,你们看没介绍了……
请问谁能帮我再在成就界面里增添个介绍……类似装备显示增强的那种窗口就可以了,或者原来的那种样子的,但是不要引起装备显示增强脚本冲突。
未命名.jpg
回复

使用道具 举报

梦石
0
星屑
1478
在线时间
993 小时
注册时间
2011-5-11
回帖
418
发表于 2012-12-22 15:10:53 | 显示全部楼层
替换成就中 Scene_Medal
  1. #encoding:utf-8
  2. #==============================================================================
  3. # ■ Window_Help
  4. #------------------------------------------------------------------------------
  5. #  顯示特技和物品等的說明、以及角色狀態的視窗
  6. #==============================================================================

  7. class Window_HelpA < Window_Base
  8.   #--------------------------------------------------------------------------
  9.   # ● 初始化物件
  10.   #--------------------------------------------------------------------------
  11.   def initialize(line_number = 2)
  12.     super(0, 0, Graphics.width, fitting_height(line_number))
  13.   end
  14.   #--------------------------------------------------------------------------
  15.   # ● 設定內容
  16.   #--------------------------------------------------------------------------
  17.   def set_text(text)
  18.     if text != @text
  19.       @text = text
  20.       refresh
  21.     end
  22.   end
  23.   #--------------------------------------------------------------------------
  24.   # ● 清除
  25.   #--------------------------------------------------------------------------
  26.   def clear
  27.     set_text("")
  28.   end
  29.   #--------------------------------------------------------------------------
  30.   # ● 設定物品
  31.   #     item : 技能、物品等
  32.   #--------------------------------------------------------------------------
  33.   def set_item(item)
  34.     set_text(item ? item.description : "")
  35.   end
  36.   #--------------------------------------------------------------------------
  37.   # ● 重新整理
  38.   #--------------------------------------------------------------------------
  39.   def refresh
  40.     contents.clear
  41.     draw_text_ex(4, 0, @text)
  42.   end
  43. end

  44. #==============================================================================
  45. # □ Scene_Medal
  46. #==============================================================================
  47. class Scene_Medal < Scene_MenuBase
  48.   #--------------------------------------------------------------------------
  49.   # ● 開始処理
  50.   #--------------------------------------------------------------------------
  51.   def start
  52.     super
  53.     create_help_window
  54.     create_item_window
  55.   end
  56.   def create_help_window
  57.     @help_window = Window_HelpA.new
  58.     @help_window.viewport = @viewport
  59.   end
  60.   #--------------------------------------------------------------------------
  61.   # ○ アイテムウィンドウの作成
  62.   #--------------------------------------------------------------------------
  63.   def create_item_window
  64.     wy = @help_window.height
  65.     wh = Graphics.height - wy
  66.     @item_window = Window_Medal.new(0, wy, Graphics.width, wh)
  67.     @item_window.viewport = @viewport
  68.     @item_window.help_window = @help_window
  69.     @item_window.set_handler(:cancel, method(:return_scene))
  70.   end
  71. end
复制代码

点评

成就介绍显示正常了,就是装备增强一查看就跳出  发表于 2012-12-22 15:25
http://rpg.blue/static/image/smiley/yct/A059.gif中国字认识都不到一半,哪的心情学英语呀!
回复

使用道具 举报

梦石
0
星屑
50
在线时间
47 小时
注册时间
2012-12-13
回帖
22
 楼主| 发表于 2012-12-22 15:19:12 | 显示全部楼层
345912390 发表于 2012-12-22 15:10
替换成就中 Scene_Medal

其他界面看东西是正常的增强窗口,但是每当调到装备查看里就直接跳出
QQ截图20121222151551.jpg
QQ截图20121222151811.jpg
回复

使用道具 举报

梦石
0
星屑
1478
在线时间
993 小时
注册时间
2011-5-11
回帖
418
发表于 2012-12-22 15:36:05 | 显示全部楼层
KyoCheng 发表于 2012-12-22 15:19
其他界面看东西是正常的增强窗口,但是每当调到装备查看里就直接跳出

那个是另外的问题
我测试没出错http://pan.baidu.com/share/link?shareid=191765&uk=3843192968&third=0

点评

感谢大大!其他问题的话我再自己查找好了!显示问题已解决!  发表于 2012-12-22 15:39
http://rpg.blue/static/image/smiley/yct/A059.gif中国字认识都不到一半,哪的心情学英语呀!
回复

使用道具 举报

梦石
0
星屑
50
在线时间
47 小时
注册时间
2012-12-13
回帖
22
 楼主| 发表于 2012-12-22 16:01:10 | 显示全部楼层
另外补一句,已经找到问题所在,如果有人使用装备显示增强和成就脚本使用以上“345912390”大大的方法即可,后来我显示出的错误是网页跳转脚本的冲突
回复

使用道具 举报

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

本版积分规则

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

在本版发帖返回顶部