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

Project1

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

[已经过期] 麻煩下載過fxwd 大大腳本的人幫個忙

[复制链接]

Lv1.梦旅人

梦石
0
星屑
50
在线时间
116 小时
注册时间
2012-10-4
帖子
193
跳转到指定楼层
1
发表于 2012-11-11 09:42:13 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式

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

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

x
http://rpg.blue/thread-247817-1-1.html

fxwd 大大提供的腳本合集裡有BUG:

1.在技能升級的畫面,點選技能時會出現"NoMethodError。undefined method  'maxhp' for # <Game_Actor.0x9d10494>]"的錯誤訊息
這是腳本其中一段
# ● 获得评分
  #--------------------------------------------------------------------------
  def scpf(skill)
    g = skill.damage.formula.to_s
    a = @actor
    v = $game_variables
    g.gsub!(/b/,"a")
    return eval(g)
  end
end

紅字是出問題的部分,請問要怎麼修改?

2.不曉得是哪個腳本的關係,我顯示圖片時,圖片會自動淡出~~淡入~~淡出~~然後移除,請告訴我要改哪裡才會恢復正常?



另外有跟他的腳本無關的幾個問題,希望也可以幫忙解決
3.想拉開遊戲視窗一開始出現的位置,要從哪修改?

4.我想做新的狀態,狀態效果都設定好,也設好狀態圖示,但測試時圖示沒出來,明明預設的麻痺狀態不但有圖示,就麻痺的角色還會閃著黃光,但我作的狀態既沒出現圖示也沒有閃著其他顏色的光芒,也沒有中狀態的文字訊息,到底還有哪裡要改呢?

5.想製作會出現台詞跟圖片的招式,所以姑且先在公用事件放入台詞跟顯示圖片的事件,再讓主角的招式之一插入呼叫那個公用事件的功能,但測試時卻公用事件卻沒出來,請問這是為什麼?

点评

你没有说要发动公共事件啊,只是说报错了。发动不了公共事件那要拿原工程来看了,我没有下载,也不知道。你可以直接呼叫多拉菌寻求帮助。  发表于 2012-11-11 17:15
最好不要一帖多问,虽然现在VA区没有版规了,但是我记得以前的版规是禁止的。版主对回答者的认定也比较难,因为会出现部分正确的情况。  发表于 2012-11-11 16:44

Lv3.寻梦者 (版主)

八宝粥的基叔

梦石
0
星屑
4509
在线时间
5228 小时
注册时间
2009-4-29
帖子
14318

贵宾

2
发表于 2012-11-11 16:38:10 | 只看该作者
maxhp和maxmp是VX里面的提法,VA里面是叫mhp和mmp。目测是你的技能公式里面把mhp写成了maxhp。去检查一下你的技能设定,改过来应该就可以了。

点评

[url=home.php?mod=space&username=protosssonny]@protosssonny[/url]  发表于 2012-11-11 17:13
我改過了,可是還是沒有發動必殺技的公用事件,順便一提公式是這個a.atk * 1.25 - b.def * 0.6 + a.mhp * 0.01  发表于 2012-11-11 17:12
《逝去的回忆3:四叶草之梦》真情发布,欢迎点击图片下载试玩喵。

《逝去的回忆3》的讨论群:
一群:192885514
二群:200460747
回复 支持 反对

使用道具 举报

Lv1.梦旅人

梦石
0
星屑
50
在线时间
116 小时
注册时间
2012-10-4
帖子
193
3
 楼主| 发表于 2012-11-11 17:43:58 | 只看该作者
技能升級的腳本:
RUBY 代码复制
  1. # -----------------------------------------------------------------------------
  2. # ◆技能升级(SKILL_UP) By.Clov
  3. # -----------------------------------------------------------------------------
  4. # Ver:1.0.0 Date:2012.06.11
  5. # -1.0.0:完整版
  6. # 界面:SceneManager.call(Scene_SUP)
  7. # 角色切换:技能分类栏 L / R
  8. # -----------------------------------------------------------------------------
  9. module SUP
  10. #—————————————————————————————————————————
  11.   #·升级技能关联
  12.   #  技能ID => 升级后技能ID
  13.   UP = {
  14.   26=>27,    # 治愈 → 治愈Ⅱ
  15.   27=>28,    # 治愈Ⅱ → 治愈Ⅲ
  16.   28=>29,    # 治愈Ⅲ → 回复
  17.   29=>30,    # 回复 → 回复Ⅱ
  18.   30=>116,   # 回复Ⅱ → 精灵的叹息
  19.   80=>81,    # 强击 → 横扫
  20.   81=>82,    # 横扫 → 狂战士咆哮
  21.   82=>83,    # 狂战士咆哮 → 狂战士之舞
  22.   83=>84,    # 狂战士之舞 → 巨人的痛击
  23.   84=>127,    # 巨人的痛击 → 守护神兽:草泥马降临
  24.   }
  25. #—————————————————————————————————————————
  26.   #·各条件“符号”说明
  27.   #  【物品篇】
  28.   #  条件数组头部 :items  :weapons  :armors 符号分别为判断 道具、武器、防具
  29.   #  再在尾部输入物品ID即可
  30.   #  【变量、开关、对比篇】
  31.   #  条件数组尾部 :bit 符号为要显示图片的名字(尺寸24*24)
  32.   #  若省略的话,将不显示图片
  33.   #———————————————————————————————————————
  34.   #·默认条件
  35.   #  技能ID 0 的条件即为默认升级条件
  36.   #  以下4种条件类型都可以设置默认条件
  37.   #———————————————————————————————————————
  38.   #·升级条件-物品【变量消耗( a -= b)】
  39.   #  技能ID => [[:类别符号, 物品ID(a), 消耗数值(b)],[],[]…更多条件…]
  40.   #  例:1 => [[:items, 10,5], [……]]
  41.   IF_ITE = {
  42.   0 => [[:items, 19, 5]], #使用19号道具作为默认升级条件
  43.   30 => [[:items, 18, 1]], #升级 回复Ⅱ 需要18号道具1个
  44.   84 => [[:items, 17, 1],[:weapons, 62, 1],[:armors, 61, 1]] #升级 巨人的痛击
  45.   #需要17号道具1个、62号武器1个、61号防具1个
  46.   }
  47.   #———————————————————————————————————————
  48.   #·升级条件-变量【变量消耗( a -= b)】
  49.   #  技能ID => [["显示文字", "变量连接(a)", 消耗数值(b)],[],[]…更多条件…]
  50.   #  例:1 => [["脚本变量测试","$变量",10], [……]]
  51.   IF_VAR = {
  52.   0 => [["蓝宝石碎片","$game_variables[100]",5]], #使用游戏1号变量作为默认升级条件
  53.   # 恢复技能条件
  54.   28 => [["生命之光","$game_variables[1]",10]], #升级 治愈Ⅲ 需要消耗变量1 10数值
  55.   29 => [["生命之光","$game_variables[1]",20]], #升级 回复 需要消耗变量1 20数值
  56.   30 => [["生命之光","$game_variables[1]",50]], #升级 回复Ⅱ 需要消耗变量1 50数值
  57.   # 伤害技能条件
  58.   82 => [["力量之光","$game_variables[2]",10]], #升级 狂战士咆哮 需要消耗变量2 50数值
  59.   83 => [["力量之光","$game_variables[2]",20]], #升级 狂战士之舞 需要消耗变量2 50数值
  60.   84 => [["力量之光","$game_variables[2]",50], #升级 巨人的痛击 需要消耗变量2 50数值
  61.   ["巨大的蓝宝石","$game_variables[3]",10]] #升级 巨人的痛击 需要消耗变量3 10数值
  62.   }
  63.   #———————————————————————————————————————
  64.   #·升级条件-开关【开关判断( a == true )】
  65.   #  技能ID => [["显示文字", "开关连接(a)"],[],[]…更多条件…]
  66.   #  例:1 => [["脚本开关测试","$开关"], [……]]
  67.   IF_SWI = {
  68.   0 => [],   #默认升级开关条件
  69.   30 => [["获得好人卡","$好人卡",:好人卡]], #升级 回复Ⅱ 需要 $好人卡 为true
  70.   84 => [["作者允许草泥马降临","$草泥马降临",:草泥马]] #升级 巨人的痛击 需要 $草泥马降临 为true
  71.   }
  72.   #———————————————————————————————————————
  73.   #·升级条件-比较【比较相等( a == b )】
  74.   #  技能ID => [["显示文字", "比较连接1(a)", "比较连接2(b)"],[],[]…更多条件…]
  75.   #  例:1 => [["脚本比较测试","$比较1","$比较2"], [……]]
  76.   IF_COM = {
  77.   0 => [],   #默认升级对比条件
  78.   }
  79. #—————————————————————————————————————————
  80.   #·积极、消极值槽颜色
  81.   POS_COLOR1 = Color.new(214,233,83,255)
  82.   POS_COLOR2 = Color.new(255,255,255,255)
  83.   NEG_COLOR1 = Color.new(253,80,128,255)
  84.   NEG_COLOR2 = Color.new(255,255,255,255)
  85. #—————————————————————————————————————————
  86.   #·输出评分最大值
  87.   PFX = 9999
  88. #—————————————————————————————————————————
  89.   #·图标存放文件夹
  90.   FILE = "Graphics/Icon/"
  91. #—————————————————————————————————————————
  92.   #·效果范围显示文字
  93.   SCOPE = ["无",
  94.   "单个敌人","全体敌人",
  95.   "一个随机敌人","二个随机敌人","三个随机敌人","四个随机敌人",
  96.   "单个队友","全体队友",
  97.   "单个队友(无法战斗)","全体队友(无法战斗)",
  98.   "使用者"]
  99.   #·使用场合显示文字
  100.   OCCASION = ["随时可用","战斗可用","菜单可用","不可用"]
  101.   #·命中类型显示文字
  102.   HIT_TYPE = ["必定命中","物理攻击","魔法攻击"]
  103.   #·输出类型显示文字
  104.   DAMAGE_TYPE = ["无输出","HP伤害","MP伤害","HP恢复","MP恢复","HP吸收","MP吸收"]
  105. #—————————————————————————————————————————
  106. end
  107.  
  108. #==============================================================================
  109. # ■ SUP_Window_Command
  110. #------------------------------------------------------------------------------
  111. #  技能分类窗口
  112. #==============================================================================
  113.  
  114. class SUP_Window_Command < Window_Command
  115.   #--------------------------------------------------------------------------
  116.   # ● 定义实例变量
  117.   #--------------------------------------------------------------------------
  118.   attr_reader   :skill_window
  119.   #--------------------------------------------------------------------------
  120.   # ● 初始化对象
  121.   #--------------------------------------------------------------------------
  122.   def initialize(x, y)
  123.     super(x, y)
  124.     @actor = nil
  125.   end
  126.   #--------------------------------------------------------------------------
  127.   # ● 获取窗口的宽度
  128.   #--------------------------------------------------------------------------
  129.   def window_width
  130.     return 200
  131.   end
  132.   #--------------------------------------------------------------------------
  133.   # ● 设置角色
  134.   #--------------------------------------------------------------------------
  135.   def actor=(actor)
  136.     return if @actor == actor
  137.     @actor = actor
  138.     refresh
  139.     select_last
  140.   end
  141.   #--------------------------------------------------------------------------
  142.   # ● 获取显示行数
  143.   #--------------------------------------------------------------------------
  144.   def visible_line_number
  145.     return 4
  146.   end
  147.   #--------------------------------------------------------------------------
  148.   # ● 生成指令列表
  149.   #--------------------------------------------------------------------------
  150.   def make_command_list
  151.     return unless @actor
  152.     @actor.added_skill_types.sort.each do |stype_id|
  153.       name = $data_system.skill_types[stype_id]
  154.       add_command(name, :skill, true, stype_id)
  155.     end
  156.   end
  157.   #--------------------------------------------------------------------------
  158.   # ● 更新画面
  159.   #--------------------------------------------------------------------------
  160.   def update
  161.     super
  162.     @skill_window.stype_id = current_ext if @skill_window
  163.   end
  164.   #--------------------------------------------------------------------------
  165.   # ● 设置技能窗口
  166.   #--------------------------------------------------------------------------
  167.   def skill_window=(skill_window)
  168.     @skill_window = skill_window
  169.     update
  170.   end
  171.   #--------------------------------------------------------------------------
  172.   # ● 返回上一个选择的位置
  173.   #--------------------------------------------------------------------------
  174.   def select_last
  175.     skill = @actor.last_skill.object
  176.     if skill
  177.       select_ext(skill.stype_id)
  178.     else
  179.       select(0)
  180.     end
  181.   end
  182. end
  183.  
  184. #==============================================================================
  185. # ■ SUP_Window_Index
  186. #------------------------------------------------------------------------------
  187. #  技能列表窗口。
  188. #==============================================================================
  189.  
  190. class SUP_Window_Index < Window_Selectable
  191.   #--------------------------------------------------------------------------
  192.   # ● 初始化对象
  193.   #--------------------------------------------------------------------------
  194.   def initialize(x, y, width, height)
  195.     super
  196.     @actor = nil
  197.     @stype_id = 0
  198.     @data = []
  199.   end
  200.   #--------------------------------------------------------------------------
  201.   # ● 设置角色
  202.   #--------------------------------------------------------------------------
  203.   def actor=(actor)
  204.     return if @actor == actor
  205.     @actor = actor
  206.     refresh
  207.     self.oy = 0
  208.   end
  209.   #--------------------------------------------------------------------------
  210.   # ● 设置技能类型 ID
  211.   #--------------------------------------------------------------------------
  212.   def stype_id=(stype_id)
  213.     return if @stype_id == stype_id
  214.     @stype_id = stype_id
  215.     refresh
  216.     self.oy = 0
  217.   end
  218.   #--------------------------------------------------------------------------
  219.   # ● 获取列数
  220.   #--------------------------------------------------------------------------
  221.   def col_max
  222.     return 1
  223.   end
  224.   #--------------------------------------------------------------------------
  225.   # ● 获取项目数
  226.   #--------------------------------------------------------------------------
  227.   def item_max
  228.     @data ? @data.size : 1
  229.   end
  230.   #--------------------------------------------------------------------------
  231.   # ● 获取技能
  232.   #--------------------------------------------------------------------------
  233.   def item
  234.     @data && index >= 0 ? @data[index] : nil
  235.   end
  236.   #--------------------------------------------------------------------------
  237.   # ● 获取选择项目的有效状态
  238.   #--------------------------------------------------------------------------
  239.   def current_item_enabled?
  240.     enable?(@data[index])
  241.   end
  242.   #--------------------------------------------------------------------------
  243.   # ● 查询列表中是否含有此技能
  244.   #--------------------------------------------------------------------------
  245.   def include?(item)
  246.     item && item.stype_id == @stype_id
  247.   end
  248.   #--------------------------------------------------------------------------
  249.   # ● 查询此技能是否可用
  250.   #--------------------------------------------------------------------------
  251.   def enable?(item)
  252.     item && SUP::UP.has_key?(item.id)
  253.   end
  254.   #--------------------------------------------------------------------------
  255.   # ● 生成技能列表
  256.   #--------------------------------------------------------------------------
  257.   def make_item_list
  258.     @data = @actor ? @actor.skills.select {|skill| include?(skill) } : []
  259.   end
  260.   #--------------------------------------------------------------------------
  261.   # ● 返回上一个选择的位置
  262.   #--------------------------------------------------------------------------
  263.   def select_last
  264.     select(@data.index(@actor.last_skill.object) || 0)
  265.   end
  266.   #--------------------------------------------------------------------------
  267.   # ● 绘制项目
  268.   #--------------------------------------------------------------------------
  269.   def draw_item(index)
  270.     skill = @data[index]
  271.     if skill
  272.       rect = item_rect(index)
  273.       rect.width -= 4
  274.       draw_item_name(skill, rect.x, rect.y, enable?(skill))
  275.     end
  276.   end
  277.   #--------------------------------------------------------------------------
  278.   # ● 更新帮助内容
  279.   #--------------------------------------------------------------------------
  280.   def update_help
  281.     @help_window.set_item(item)
  282.   end
  283.   #--------------------------------------------------------------------------
  284.   # ● 刷新
  285.   #--------------------------------------------------------------------------
  286.   def refresh
  287.     make_item_list
  288.     create_contents
  289.     draw_all_items
  290.   end
  291. end
  292.  
  293. #==============================================================================
  294. # ■ SUP_Window_Info
  295. #------------------------------------------------------------------------------
  296. #  技能信息窗口
  297. #==============================================================================
  298.  
  299. class SUP_Window_Info < Window_Base
  300.   #--------------------------------------------------------------------------
  301.   # ● 初始化对象
  302.   #--------------------------------------------------------------------------
  303.   def initialize(x, y,w,h)
  304.     super(x, y, w, h)
  305.     @w = w ; @h = h
  306.     @yema = 1
  307.     @actor = nil
  308.     @skill = nil
  309.     @font_size = 20
  310.     @help_fill_color1 = Color.new(255,255,255,255)
  311.     @help_fill_color2 = Color.new(255,255,255,0)
  312.   end
  313.   #--------------------------------------------------------------------------
  314.   # ● 设置角色
  315.   #--------------------------------------------------------------------------
  316.   def actor=(val)
  317.     @actor = val
  318.   end
  319.   #--------------------------------------------------------------------------
  320.   # ● 取得技能
  321.   #--------------------------------------------------------------------------
  322.   def skill
  323.     @skill
  324.   end
  325.   #--------------------------------------------------------------------------
  326.   # ● 设置技能
  327.   #--------------------------------------------------------------------------
  328.   def skill=(val)
  329.     @skill = val
  330.     huanye(@yema)
  331.   end
  332.   #--------------------------------------------------------------------------
  333.   # ● 技能是否可升级
  334.   #--------------------------------------------------------------------------
  335.   def skill_up?
  336.     SUP::UP.has_key?(@skill.id)
  337.   end
  338.   #--------------------------------------------------------------------------
  339.   # ● 获得行高
  340.   #--------------------------------------------------------------------------
  341.   def line_height
  342.     @font_size
  343.   end
  344.   #--------------------------------------------------------------------------
  345.   # ● 获得页码
  346.   #--------------------------------------------------------------------------
  347.   def yema
  348.     @yema
  349.   end
  350.   #--------------------------------------------------------------------------
  351.   # ● 换页
  352.   #--------------------------------------------------------------------------
  353.   def huanye(y)
  354.     @yema = y
  355.     case @yema
  356.     when 1
  357.     @draw = method(:draw1)
  358.     @help_txt = ["技能状态信息", "升级技能状态信息", "A键换页(1/2)"]
  359.     when 2
  360.     @draw = method(:draw2)
  361.     @help_txt = ["技能数值信息", "升级技能数值信息", "A键换页(2/2)"]
  362.     end
  363.     refresh
  364.   end
  365.   #--------------------------------------------------------------------------
  366.   # ● 刷新
  367.   #--------------------------------------------------------------------------
  368.   def refresh
  369.     contents.clear
  370.     return if !@skill
  371.     #描绘帮助信息
  372.     contents.font.size = 16
  373.     help
  374.     #描绘技能信息
  375.     contents.font.size = line_height
  376.     #描绘选中的技能
  377.     @draw.call(@skill, 0, line_height)
  378.     #描绘升级后的技能
  379.     if skill_up?
  380.       @draw.call($data_skills[SUP::UP[@skill.id]], 0, line_height * 9)
  381.     else
  382.       draw_text(70, line_height * 9 + 65, 280, line_height,
  383.     "技能已经无法升级。")
  384.     end
  385.   end
  386.   #--------------------------------------------------------------------------
  387.   # ● 描绘帮助条
  388.   #--------------------------------------------------------------------------
  389.   def help
  390.     #第一条
  391.     contents.gradient_fill_rect(0, 0, @w, line_height,
  392.     @help_fill_color1, @help_fill_color2)
  393.     draw_text(2, 0, 280, line_height, @help_txt[0])
  394.     #第二条
  395.     contents.gradient_fill_rect(0, line_height * 8, @w, line_height,
  396.     @help_fill_color1, @help_fill_color2)
  397.     draw_text(2, line_height * 8, 280, line_height, @help_txt[1])
  398.     #换页
  399.     draw_text(225, 0, 280, line_height, @help_txt[2])
  400.   end
  401.   #--------------------------------------------------------------------------
  402.   # ● 描绘页1
  403.   #--------------------------------------------------------------------------
  404.   def draw1(skill,x,y)
  405.     #名称---------------------------------------------
  406.     draw_item_name(skill, x, y)
  407.     #属性---------------------------------------------
  408.     sx = $data_system.elements[skill.damage.element_id]
  409.     sx = sx=="" ? "无" : sx
  410.     draw_text(x, y + line_height, 280, line_height,
  411.     "属性:"+sx)
  412.     #使用场合-----------------------------------------
  413.     draw_text(x, y + line_height * 2, 280, line_height,
  414.     "使用场合:"+SUP::OCCASION[skill.occasion ])
  415.     #使用范围-----------------------------------------
  416.     draw_text(x, y + line_height * 3, 280, line_height,
  417.     "使用范围:"+SUP::SCOPE[skill.scope])
  418.     #命中类型-----------------------------------------
  419.     draw_text(x, y + line_height * 4, 280, line_height,
  420.     "命中类型:"+SUP::HIT_TYPE[skill.hit_type])
  421.     #输出类型-----------------------------------------
  422.     draw_text(x, y + line_height * 5, 280, line_height,
  423.     "输出类型:"+SUP::DAMAGE_TYPE[skill.damage.type])
  424.     #武器限制-----------------------------------------
  425.     w1 = $data_system.weapon_types[skill.required_wtype_id1]
  426.     w2 = $data_system.weapon_types[skill.required_wtype_id2]
  427.     w = "无武器限制" ; if w1 !="";w=w1;end ; if w2 != "";w+="与"+w2;end
  428.     draw_text(x, y + line_height * 6, 280, line_height,
  429.     "武器限制:"+w)
  430.   end
  431.   #--------------------------------------------------------------------------
  432.   # ● 描绘页2
  433.   #--------------------------------------------------------------------------
  434.   def draw2(skill,x,y)
  435.     #名称---------------------------------------------
  436.     draw_item_name(skill, x, y)
  437.     #魔力值消耗---------------------------------------
  438.     draw_text(x, y + line_height, 280, line_height,
  439.     "魔力值消耗:")
  440.     w = 200 ; h = 15
  441.     b = skill.mp_cost.to_f / 9999
  442.     c1 = Color.new(128,155,122,255)
  443.     c2 = Color.new(25,55,155,255)
  444.     flii(x+120, y + line_height + 3, w, h, b, SUP::NEG_COLOR1, SUP::NEG_COLOR2)
  445.     draw_current_and_max_values(x+40, y + line_height, 280, skill.mp_cost, 9999,
  446.     text_color(0), text_color(0))
  447.     #特技值消耗---------------------------------------
  448.     draw_text(x, y + line_height * 2, 280, line_height,
  449.     "特技值消耗:")
  450.     w = 200 ; h = 15
  451.     b = skill.tp_cost.to_f / 100
  452.     flii(x+120, y + line_height * 2 + 3, w, h, b, SUP::NEG_COLOR1, SUP::NEG_COLOR2)
  453.     draw_current_and_max_values(x+40, y + line_height * 2, 280, skill.tp_cost, 100,
  454.     text_color(0), text_color(0))
  455.     #特技值获得---------------------------------------
  456.     draw_text(x, y + line_height * 3, 280, line_height,
  457.     "特技值获得:")
  458.     w = 200 ; h = 15
  459.     b = skill.tp_gain.to_f / 100
  460.     flii(x+120, y + line_height * 3 + 3, w, h, b, SUP::POS_COLOR1, SUP::POS_COLOR2)
  461.     draw_current_and_max_values(x+40, y + line_height * 3, 280, skill.tp_gain, 100,
  462.     text_color(0), text_color(0))
  463.     #攻击次数-----------------------------------------
  464.     draw_text(x, y + line_height * 4, 280, line_height,
  465.     "攻击次数:")
  466.     w = 200 ; h = 15
  467.     b = skill.repeats.to_f / 9
  468.     flii(x+120, y + line_height * 4 + 3, w, h, b, SUP::POS_COLOR1, SUP::POS_COLOR2)
  469.     draw_current_and_max_values(x+40, y + line_height * 4, 280, skill.repeats, 9,
  470.     text_color(0), text_color(0))
  471.     #成功几率-----------------------------------------
  472.     draw_text(x, y + line_height * 5, 280, line_height,
  473.     "成功几率:")
  474.     w = 200 ; h = 15
  475.     b = skill.success_rate.to_f / 100
  476.     flii(x+120, y + line_height * 5 + 3, w, h, b, SUP::POS_COLOR1, SUP::POS_COLOR2)
  477.     draw_current_and_max_values(x+40, y + line_height * 5, 280, skill.success_rate, 100,
  478.     text_color(0), text_color(0))
  479.     #输出评分-----------------------------------------
  480.     draw_text(x, y + line_height * 6, 280, line_height,
  481.     "输出评分:")
  482.     pf = scpf(skill)
  483.     w = 200 ; h = 15
  484.     b = [pf.to_f / SUP::PFX, 1.0].min
  485.     type = skill.damage.type
  486.     case type
  487.     when 0
  488.       draw_text(x+150, y + line_height * 6, 280, line_height,
  489.     "此技能没有输出。")
  490.     when 1, 2, 5, 6
  491.       flii(x+120, y + line_height * 6 + 3, w, h, b, SUP::NEG_COLOR1, SUP::NEG_COLOR2)
  492.       draw_current_and_max_values(x+40, y + line_height * 6, 280, pf, SUP::PFX,
  493.       text_color(0), text_color(0))
  494.     when 3, 4
  495.       flii(x+120, y + line_height * 6 + 3, w, h, b, SUP::POS_COLOR1, SUP::POS_COLOR2)
  496.       draw_current_and_max_values(x+40, y + line_height * 6, 280, pf, SUP::PFX,
  497.       text_color(0), text_color(0))
  498.     end
  499.   end
  500.   #--------------------------------------------------------------------------
  501.   # ● 描绘值槽
  502.   #--------------------------------------------------------------------------
  503.   def flii(x, y, w, h, b, color1, color2)
  504.     contents.fill_rect(x, y, w, h, Color.new(0,0,0,64))
  505.     contents.gradient_fill_rect(x, y, w*b, h, color1, color2)
  506.   end
  507.   #--------------------------------------------------------------------------
  508.   # ● 获得评分
  509.   #--------------------------------------------------------------------------
  510.   def scpf(skill)
  511.     g = skill.damage.formula.to_s
  512.     a = @actor
  513.     v = $game_variables
  514.     g.gsub!(/b/,"a")
  515.     return eval(g)
  516.   end
  517. end
  518.  
  519. #==============================================================================
  520. # ■ SUP_Window_Choice
  521. #------------------------------------------------------------------------------
  522. #  技能升级条件及确认窗口
  523. #==============================================================================
  524.  
  525. class SUP_Window_Choice < Window_Command
  526.   #--------------------------------------------------------------------------
  527.   # ● 初始化对象
  528.   #--------------------------------------------------------------------------
  529.   def initialize(x, y)
  530.     @hx = -1
  531.     super(x, y)
  532.     @skill = nil
  533.     @actor = nil
  534.     @enabled = []
  535.     @txt = []
  536.     @ite = []
  537.     @pic = []
  538.     @xh = []
  539.   end
  540.   #--------------------------------------------------------------------------
  541.   # ● 设置角色
  542.   #--------------------------------------------------------------------------
  543.   def actor=(val)
  544.     @actor = val
  545.   end
  546.   #--------------------------------------------------------------------------
  547.   # ● 取得技能
  548.   #--------------------------------------------------------------------------
  549.   def skill
  550.     @skill
  551.   end
  552.   #--------------------------------------------------------------------------
  553.   # ● 设置技能
  554.   #--------------------------------------------------------------------------
  555.   def skill=(val)
  556.     @skill = val
  557.     refresh_draw
  558.   end
  559.   #--------------------------------------------------------------------------
  560.   # ● 取得全部指定条件
  561.   #--------------------------------------------------------------------------
  562.   def all_if(skill_id)
  563.     arr = Array.new
  564.     arr << SUP::IF_ITE[skill_id]
  565.     arr << SUP::IF_VAR[skill_id]
  566.     arr << SUP::IF_SWI[skill_id]
  567.     arr << SUP::IF_COM[skill_id]
  568.   end
  569.   #--------------------------------------------------------------------------
  570.   # ● 获取全部条件有效状态
  571.   #--------------------------------------------------------------------------
  572.   def all_enabled?
  573.     !@enabled.include?(false)
  574.   end
  575.   #--------------------------------------------------------------------------
  576.   # ● 获取物品、变量条件有效状态
  577.   #--------------------------------------------------------------------------
  578.   def ite_var_enabled?(y, s)
  579.     return false if not y
  580.     y >= s
  581.   end
  582.   #--------------------------------------------------------------------------
  583.   # ● 获取开关条件有效状态
  584.   #--------------------------------------------------------------------------
  585.   def swi_enabled?(y)
  586.     y
  587.   end
  588.   #--------------------------------------------------------------------------
  589.   # ● 获取对比条件有效状态
  590.   #--------------------------------------------------------------------------
  591.   def com_enabled?(y1, y2)
  592.     y1 == y2
  593.   end
  594.   #--------------------------------------------------------------------------
  595.   # ● 技能升级条件数据
  596.   #--------------------------------------------------------------------------
  597.   def skill_data
  598.     return if !@skill
  599.     @hx = -1 ; @enabled = [] ; @txt = [] ; @pic = [] ; @pid = [] ; @xh = []
  600.     l = all_if(@skill.id) ; n = l.compact
  601.     t = n == [] ? all_if(0) : l
  602.     t1 = t[0] ; t2 = t[1] ; t3 = t[2] ; t4 = t[3]
  603.     if t1
  604.       ite_data(t1)
  605.     end
  606.     if t2
  607.       var_data(t2)
  608.     end
  609.     if t3
  610.       swi_data(t3)
  611.     end
  612.     if t4
  613.       com_data(t4)
  614.     end
  615.   end
  616.   #--------------------------------------------------------------------------
  617.   # ● 技能条件进行描绘
  618.   #--------------------------------------------------------------------------
  619.   def skill_draw
  620.     @txt.each_with_index {|txt,i|
  621.     change_color(normal_color, @enabled[i])
  622.     pic = @pic[i]
  623.     if pic.is_a?(Symbol)
  624.       wx = window_width / 2 - text_size(txt).width / 2 - 24
  625.       if pic == :ite
  626.         draw_item_icon(@ite[i], wx, item_height * i)
  627.       else
  628.         draw_bit(pic.to_s, wx, item_height * i)
  629.       end
  630.     end
  631.     draw_text(0, item_height * i, window_width, item_height, txt, 1)
  632.     }
  633.   end
  634.   #--------------------------------------------------------------------------
  635.   # ● 绘制物品图标
  636.   #--------------------------------------------------------------------------
  637.   def draw_item_icon(item, x, y)
  638.     draw_icon(item.icon_index, x, y)
  639.   end
  640.   #--------------------------------------------------------------------------
  641.   # ● 绘制图片
  642.   #--------------------------------------------------------------------------
  643.   def draw_bit(name, x, y)
  644.     bitmap = Bitmap.new(SUP::FILE + name)
  645.     rect = Rect.new(0, 0, 24, 24)
  646.     contents.blt(x, y, bitmap, rect)
  647.   end
  648.   #--------------------------------------------------------------------------
  649.   # ● 对技能进行升级(变量、物品消耗)
  650.   #--------------------------------------------------------------------------
  651.   def skill_up
  652.     @actor.forget_skill(@skill.id)
  653.     @actor.learn_skill(SUP::UP[@skill.id])
  654.     @xh.each_with_index {|x, i|
  655.     if x.is_a?(String)
  656.       eval(x)
  657.     else
  658.       $game_party.gain_item(@ite[i], -x)
  659.     end}
  660.   end
  661.   #--------------------------------------------------------------------------
  662.   # ● 物品条件 数据
  663.   #--------------------------------------------------------------------------
  664.   def ite_data(si)
  665.     si.each {|i|
  666.     @hx += 1 ; t = i[0] ; b = i[1] ; s = i[2]
  667.     case t
  668.     when :items
  669.       item = $data_items[b]
  670.     when :weapons
  671.       item = $data_weapons[b]
  672.     when :armors
  673.       item = $data_armors[b]
  674.     end
  675.     y = $game_party.item_number(item)
  676.     enabled = ite_var_enabled?(y, s)
  677.     @enabled[@hx] = enabled
  678.     @txt[@hx] = item.name+"*"+ s.to_s
  679.     @ite[@hx] = item
  680.     @pic[@hx] = :ite
  681.     @xh[@hx] = s
  682.     }
  683.   end
  684.   #--------------------------------------------------------------------------
  685.   # ● 变量条件 数据
  686.   #--------------------------------------------------------------------------
  687.   def var_data(si)
  688.     si.each {|i|
  689.     @hx += 1 ; n = i[0] ; y = eval(i[1]) ; s = i[2]
  690.     enabled = ite_var_enabled?(y, s)
  691.     @enabled[@hx] = enabled
  692.     @txt[@hx] = n+"*"+ s.to_s
  693.     @pic[@hx] = i[-1]
  694.     @xh[@hx] = "#{i[1]} -= #{s.to_s}"
  695.     }
  696.   end
  697.   #--------------------------------------------------------------------------
  698.   # ● 开关条件 数据
  699.   #--------------------------------------------------------------------------
  700.   def swi_data(si)
  701.     si.each {|i|
  702.     @hx += 1 ; n = i[0] ; y = eval(i[1])
  703.     enabled = swi_enabled?(y)
  704.     @enabled[@hx] = enabled
  705.     @txt[@hx] = n
  706.     @pic[@hx] = i[-1]
  707.     }
  708.   end
  709.   #--------------------------------------------------------------------------
  710.   # ● 对比条件 数据
  711.   #--------------------------------------------------------------------------
  712.   def com_data(si)
  713.     si.each {|i|
  714.     @hx += 1 ; n = i[0] ; y1 = eval(i[1]) ; y2 = eval(i[2])
  715.     enabled = com_enabled?(y1,y2)
  716.     @enabled[@hx] = enabled
  717.     @txt[@hx] = n
  718.     @pic[@hx] = i[-1]
  719.     }
  720.   end
  721.   #--------------------------------------------------------------------------
  722.   # ● 获取窗口的宽度
  723.   #--------------------------------------------------------------------------
  724.   def window_width
  725.     return 300
  726.   end
  727.   #--------------------------------------------------------------------------
  728.   # ● 获取项目的高度
  729.   #--------------------------------------------------------------------------
  730.   def item_height
  731.     return 28
  732.   end
  733.   #--------------------------------------------------------------------------
  734.   # ● 获取对齐方向
  735.   #--------------------------------------------------------------------------
  736.   def alignment
  737.     return 1
  738.   end
  739.   #--------------------------------------------------------------------------
  740.   # ● 获取项目的绘制矩形
  741.   #--------------------------------------------------------------------------
  742.   alias x_item_rect item_rect
  743.   def item_rect(index)
  744.     rect = x_item_rect(index)
  745.     rect.y = rect.y + item_height * (@hx+1)
  746.     rect
  747.   end
  748.   #--------------------------------------------------------------------------
  749.   # ● 刷新(清除内容)
  750.   #--------------------------------------------------------------------------
  751.   def refresh
  752.     contents.clear
  753.   end
  754.   #--------------------------------------------------------------------------
  755.   # ● 刷新(取得数据、刷新窗口)
  756.   #--------------------------------------------------------------------------
  757.   def refresh2
  758.     skill_data
  759.     self.height = item_height * (@hx+3)
  760.     self.x = Graphics.width / 2 - window_width / 2
  761.     self.y = Graphics.height / 2 - self.height / 2
  762.     create_contents
  763.   end
  764.   #--------------------------------------------------------------------------
  765.   # ● 刷新(要描绘的内容)
  766.   #--------------------------------------------------------------------------
  767.   def refresh_draw
  768.     refresh
  769.     refresh2
  770.     skill_draw
  771.     clear_command_list
  772.     add_command("确认",   :ok, all_enabled?)
  773.     draw_all_items
  774.   end
  775. end
  776.  
  777. #==============================================================================
  778. # ■ Scene_SUP
  779. #------------------------------------------------------------------------------
  780. #  技能升级画面
  781. #==============================================================================
  782.  
  783. class Scene_SUP < Scene_MenuBase
  784.   #--------------------------------------------------------------------------
  785.   # ● 开始处理
  786.   #--------------------------------------------------------------------------
  787.   def start
  788.     super
  789.  
  790.     create_help_window
  791.     suv_window_command
  792.     suv_window_info
  793.     suv_window_index
  794.     suv_window_choice
  795.  
  796.   end
  797.   #--------------------------------------------------------------------------
  798.   # ● 帧更新
  799.   #--------------------------------------------------------------------------
  800.   def update
  801.     super
  802.     if Input.trigger?(:X)
  803.       case @suv_window_info.yema
  804.       when 1
  805.         @suv_window_info.huanye(2)
  806.       when 2
  807.         @suv_window_info.huanye(1)
  808.       end
  809.     end
  810.     if @suv_window_info.skill != @suv_window_index.item
  811.       @suv_window_info.skill = @suv_window_index.item
  812.     end
  813.   end
  814.   #--------------------------------------------------------------------------
  815.   # ● 生成确认窗口
  816.   #--------------------------------------------------------------------------
  817.   def suv_window_choice
  818.     @suv_window_choice = SUP_Window_Choice.new(0, 0)
  819.     @suv_window_choice.viewport = @viewport
  820.     @suv_window_choice.set_handler(:ok,    method(:confirm_ok))
  821.     @suv_window_choice.set_handler(:cancel,   method(:confirm_cancel))
  822.     @suv_window_choice.hide.deactivate
  823.     @suv_window_choice.actor = @actor
  824.   end
  825.   #--------------------------------------------------------------------------
  826.   # ● 生成分类窗口
  827.   #--------------------------------------------------------------------------
  828.   def suv_window_command
  829.     wy = @help_window.height
  830.     @suv_window_command = SUP_Window_Command.new(0, wy)
  831.     @suv_window_command.viewport = @viewport
  832.     @suv_window_command.help_window = @help_window
  833.     @suv_window_command.actor = @actor
  834.     @suv_window_command.set_handler(:skill,    method(:command_skill))
  835.     @suv_window_command.set_handler(:cancel,   method(:return_scene))
  836.     @suv_window_command.set_handler(:pagedown, method(:next_actor))
  837.     @suv_window_command.set_handler(:pageup,   method(:prev_actor))
  838.   end
  839.   #--------------------------------------------------------------------------
  840.   # ● 生成状态窗口
  841.   #--------------------------------------------------------------------------
  842.   def suv_window_info
  843.     y = @help_window.height
  844.     w = Graphics.width - @suv_window_command.width
  845.     h = Graphics.height - @help_window.height
  846.     @suv_window_info = SUP_Window_Info.new(@suv_window_command.width, y, w, h)
  847.     @suv_window_info.viewport = @viewport
  848.     @suv_window_info.actor = @actor
  849.   end
  850.   #--------------------------------------------------------------------------
  851.   # ● 生成列表窗口
  852.   #--------------------------------------------------------------------------
  853.   def suv_window_index
  854.     wx = 0
  855.     wy = @suv_window_command.y + @suv_window_command.height
  856.     ww = Graphics.width - @suv_window_info.width
  857.     wh = Graphics.height - wy
  858.     @suv_window_index = SUP_Window_Index.new(wx, wy, ww, wh)
  859.     @suv_window_index.actor = @actor
  860.     @suv_window_index.viewport = @viewport
  861.     @suv_window_index.help_window = @help_window
  862.     @suv_window_index.set_handler(:ok,     method(:on_item_ok))
  863.     @suv_window_index.set_handler(:cancel, method(:on_item_cancel))
  864.     @suv_window_command.skill_window = @suv_window_index
  865.   end
  866.   #--------------------------------------------------------------------------
  867.   # ● 技能分类里“确定”
  868.   #--------------------------------------------------------------------------
  869.   def command_skill
  870.     @suv_window_index.activate
  871.     @suv_window_index.select_last
  872.   end
  873.   #--------------------------------------------------------------------------
  874.   # ● 技能列表里“确定”
  875.   #--------------------------------------------------------------------------
  876.   def on_item_ok
  877.     skill = @suv_window_index.item
  878.     @suv_window_choice.skill = skill
  879.     @suv_window_choice.show.activate
  880.   end
  881.   #--------------------------------------------------------------------------
  882.   # ● 技能列表里“返回”
  883.   #--------------------------------------------------------------------------
  884.   def on_item_cancel
  885.     @suv_window_index.unselect
  886.     @suv_window_command.activate
  887.   end
  888.   #--------------------------------------------------------------------------
  889.   # ● 确认列表里“确认”
  890.   #--------------------------------------------------------------------------
  891.   def confirm_ok
  892.     @suv_window_choice.skill_up
  893.     @suv_window_index.refresh
  894.     @suv_window_choice.hide.deactivate
  895.     @suv_window_index.activate
  896.   end
  897.   #--------------------------------------------------------------------------
  898.   # ● 确认列表里“返回”
  899.   #--------------------------------------------------------------------------
  900.   def confirm_cancel
  901.     @suv_window_choice.hide.deactivate
  902.     @suv_window_index.activate
  903.   end
  904.   #--------------------------------------------------------------------------
  905.   # ● 切换角色
  906.   #--------------------------------------------------------------------------
  907.   def on_actor_change
  908.     @suv_window_command.actor = @actor
  909.     @suv_window_info.actor = @actor
  910.     @suv_window_index.actor = @actor
  911.     @suv_window_choice.actor = @actor
  912.     @suv_window_command.activate
  913.   end
  914. end


話說回來,請問後三個問題要怎麼解決?謝謝

点评

[url=home.php?mod=space&username=protosssonny]@protosssonny[/url]  发表于 2012-11-11 17:52
回复 支持 反对

使用道具 举报

Lv1.梦旅人

哆啦菌

梦石
0
星屑
46
在线时间
795 小时
注册时间
2010-7-24
帖子
3800
4
发表于 2012-11-11 19:45:36 手机端发表。 | 只看该作者
首先说声抱歉,最近一直用手机,许多短消息都看不到。。。
目前暂时不能用电脑,其他问题我暂时不好解答,先说第二点吧。
整合发布前我测试过许多次,也有很多冲突,但都有解决的办法(干脆过段时间发个冲突解决办法库好了。。。),但像LZ说的不报错光是图片乱动的情况我还真没遇到过。可能是以下几点吧。
一。你用了其他脚本。
二。整合系统中有个自动执行的事件,那个事件会对一些图片做出一些操作,看一下你的游戏中是否添加了那个事件。
还是说点实际的吧,解决办法:
一。把图片编号改一下,再试试。
二。将你游戏中所有的脚本备份,删除后再测试一下,如果没问题,说明就是脚本的原因。这时候就需要你的耐心了,你不知道是哪个脚本的问题所以你需要一个一个去测试。。。
如果以上都不对。。那么看看你的事件,公共事件设置有什么问题。
如果还不行。。。真心无能为力了。

点评

[url=home.php?mod=space&username=fxwd]@fxwd[/url]  发表于 2012-11-11 21:47
[url=home.php?mod=space&username=fxwd]@fxwd[/url]  发表于 2012-11-11 21:46
可以順便請教其他問題要怎麼解決嗎?  发表于 2012-11-11 21:45
剛才知道原因了,是因為被左上角的陽光圖片遮到才有圖片淡出的錯覺,抱歉是我搞錯了  发表于 2012-11-11 21:45
随便看看
回复 支持 反对

使用道具 举报

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

本版积分规则

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

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

GMT+8, 2024-5-8 09:03

Powered by Discuz! X3.1

© 2001-2013 Comsenz Inc.

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