查看: 1749|回复: 6

[已经过期] 超好用的技能消耗物品怎么同时消耗多样不同数量的物品?

[复制链接]
梦石
0
星屑
50
在线时间
1019 小时
注册时间
2012-4-25
回帖
693
发表于 2015-5-4 14:14:42 | 显示全部楼层 |阅读模式

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

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

×
[pre lang="ruby"]module IISNOW_ITEM_CONSUME_SKILL
  
  PATTERN = /.*I:ID(\d+)N(\d+)(.*)/m  
  # 非专业人士请勿修改,正则匹配式,修改后注意备注写法的改变,下同
  PATTERN_E = /.*EQU:ID(\d+).*/m
  PATTERN_A = /.*ARM:ID(\d+).*/m
  STR_UN_CONSUM = "UN" # 物品不消耗标识
  
  TP_ICON = 189  # 你说你懂的
  MP_ICON = 188
  
  STYLE = 2 # 界面风格(支持1,2,3,4效果自己体会,不推荐4)
  STYLE_A = 2 # 提示风格(支持1,2,3,同上)
  PLACE = 3 # 消耗物品的图标与数目间的间距
  PLACE_E = 2 # 不同消耗物品间的间距
  ORDER = [0,1,2]     # 从右往左的消耗显示顺序(0,TP;1,MP;2,物品)
  
  COLOR_ITEM = Color.new(255,255,255) # 物品消耗数目的字的颜色
  COLOR_WE_L = Color.new(255,0,0) # 具体限定武器的框的颜色
  COLOR_WE_A = Color.new(255,0,0) # 具体限定防具的框的颜色
  COLOR_UN_I = Color.new(0,255,0) # 物品限定但不消耗的提示框的颜色
  
  TRAN_DE = 100 # 风格_A2下的透明度再次降低(最大为160)
end

class Window_SkillList
  
  include IISNOW_ITEM_CONSUME_SKILL
  
  def col_max
    case STYLE
    when 1,3,4
      return 2
    when 2
      return 1
    end
  end
  
  def item_height
    case STYLE
    when 3
      line_height * 2
    when 1,2,4
      line_height + 1
    end
  end
  
  def draw_item(index)
    skill = @data[index]
    if skill
      rect = item_rect(index)
      rect.width -= 4
      draw_item_name(skill, rect.x, rect.y, enable?(skill))
      draw_skill_cost(rect, skill)
    end
  end
  
  alias :iisnow_draw_item_name :draw_item_name
  def draw_item_name(item, x, y, enabled = true, width = 172)
    iisnow_draw_item_name(item, x, y, enabled,width)
    rect_temp = text_size(item.name)
    if @actor.skill_eq_limt(item)
      draw_kuang(x + 24 + PLACE  + rect_temp.width,y,24,24,COLOR_WE_L,enabled)
      draw_icon(@actor.skill_eq_limt(item).icon_index,x + 24 + PLACE + rect_temp.width,y,enabled)
      rect_temp.width += (24 + PLACE_E)
    end
    if @actor.skill_ar_limt(item)
      draw_kuang(x + 24 + PLACE + rect_temp.width,y,24,24,COLOR_WE_A,enabled)
      draw_icon(@actor.skill_ar_limt(item).icon_index,x + 24 + PLACE + rect_temp.width,y,enabled)
    end
  end
  
  def draw_skill_cost(rect, skill)
    str = create_string(skill)
    color = [tp_cost_color,mp_cost_color,COLOR_ITEM]
    str.each_with_index do |str,i|
      next unless str
      change_color(color[ORDER], enable?(skill))
      kuang = false
      case i
      when ORDER.index(2)
        icon_index = str[0].icon_index
        kuang = true if str[2]
        str = str[1]
      when ORDER.index(1)
        icon_index = MP_ICON
      when ORDER.index(0)
        icon_index = TP_ICON
      end
      contents.font.size = STYLE == 1 ? Font.default_size - 6 : Font.default_size
      draw_style(icon_index,rect,str,skill,kuang)
    end
    contents.font.size = Font.default_size
  end
  
  def draw_style(icon_index,rect,str,skill,kuang)
    case STYLE
    when 1
      draw_kuang(rect.width - 24 + rect.x,rect.y,24,24,COLOR_UN_I,enable?(skill)) if kuang
      draw_icon(icon_index,rect.width - 24 + rect.x,rect.y,enable?(skill))
      draw_text(Rect.new(rect.x + rect.width - 24,rect.y + 8,24,16),str,2) if str.to_i != 1
      rect.width -= (24 + PLACE_E)
    when 2,4
      draw_text(rect,str,2) if str.to_i != 1
      rect.width -= (text_size(str).width + PLACE) if str.to_i != 1
      draw_kuang(rect.width - 24 + rect.x,rect.y,24,24,COLOR_UN_I,enable?(skill)) if kuang
      draw_icon(icon_index,rect.width - 24 + rect.x,rect.y,enable?(skill))
      rect.width -= (24 + PLACE_E)
    when 3
      rect_temp = rect.clone
      rect_temp.y += (rect_temp.height / 2)
      rect_temp.height /= 2
      draw_text(rect_temp,str,2) if str.to_i != 1
      rect.width -= (text_size(str).width + PLACE) if str.to_i != 1
      draw_kuang(rect.width - 24 + rect.x,rect_temp.y,24,24,COLOR_UN_I,enable?(skill)) if kuang
      draw_icon(icon_index,rect.width - 24 + rect.x,rect_temp.y,enable?(skill))
      rect.width -= (24 + PLACE_E)
    end
  end
  
  def draw_kuang(x,y,w,h,c,fl)
    c.alpha = fl ? 255 : translucent_alpha - (STYLE_A == 2 ? TRAN_DE : 0)
    case STYLE_A
    when 1
      contents.fill_rect(x,y,w,1,c)
      contents.fill_rect(x,y + 1,1,h - 1,c)
      contents.fill_rect(x + 1,y + h - 1,w - 1,1,c)
      contents.fill_rect(x + w -1,y + 1,1,h - 2,c)
    when 2
      contents.fill_rect(x,y,w,h,c)
    end
  end
  
  def create_string(skill)
    str1 = @actor.skill_tp_cost(skill)
    str2 = @actor.skill_mp_cost(skill)
    str3 = @actor.skill_it_cost(skill)
    str1 = str1 > 0 ?  str1.to_s : nil
    str2 = str2 > 0 ?  str2.to_s : nil
    str3 = str3[1] > 0 ? [str3[0],str3[1].to_s,str3[2]] : nil
    str = [str1,str2,str3]
    iisnow = [str[ORDER[0]],str[ORDER[1]],str[ORDER[2]]]
    iisnow
  end
  
end

class Game_BattlerBase
  
  include IISNOW_ITEM_CONSUME_SKILL
  
  def skill_it_cost(skill)
    skill.note.match(PATTERN)
    item = $data_items[$1.to_i] if $1 != 0
    num = $2.to_i
    flag = $3.match(/^#{STR_UN_CONSUM}/) if $3
    return [item,num,flag]
  end
  
  def skill_eq_limt(skill)
    skill.note.match(PATTERN_E)
    eq = $data_weapons[$1.to_i] if $1 != 0
    return eq
  end
  
  def skill_ar_limt(skill)
    skill.note.match(PATTERN_A)
    eq = $data_armors[$1.to_i] if $1 != 0
    return eq
  end
  
  alias :iisnow_skill_cost_payable? :skill_cost_payable?
  def skill_cost_payable?(skill)
    result1 = iisnow_skill_cost_payable?(skill)
    if skill_it_cost(skill)[0]
      result2 = $game_party.item_number(skill_it_cost(skill)[0]) >= skill_it_cost(skill)[1]
      return result1 && result2
    end
    return result1
  end
  
  alias :iisnow_pay_skill_cost :pay_skill_cost
  def pay_skill_cost(skill)
    iisnow_pay_skill_cost(skill)
    if skill_it_cost(skill)[0] && !skill_it_cost(skill)[2]
      $game_party.gain_item(skill_it_cost(skill)[0],-skill_it_cost(skill)[1])
    end
  end

end

class Game_Actor
  
  alias :iisnow_skill_wtype_ok? :skill_wtype_ok?
  def skill_wtype_ok?(skill)
    result1 = iisnow_skill_wtype_ok?(skill)
    result2 = skill_eq_limt(skill) ? weapons.include?(skill_eq_limt(skill)) : true
    result3 = skill_ar_limt(skill) ? armors.include?(skill_ar_limt(skill)) : true
    return result1 && result2 && result3
  end
  
end[/pre]

其实,我是打算用来做生活技能用的。虽然我也知道有一些制作的脚本,但是我是不希望有材料有钱就能无限做,我的设定是每次使用会消耗魔法和时间(游戏中的),由于涉及变量比较多,需要每个生产都会有不同的变量,以我的能力不大可能大规模修改那些脚本,于是我就相出了一个办法。通过技能计算公式给变量。然后由公共事件来执行。

这个脚本很适合,但是,目前这个脚本只能消耗一种物品,没办法同时消耗多种不同数量的物品,而那个帖子也有许多人问同样的问题。我之所以不再等是因为上述考虑要涉及到不少变量开关,如果真的没办法我也得花上不少时间去找其他可能的方法,所以才到这里问了。

梦石
0
星屑
50
在线时间
1019 小时
注册时间
2012-4-25
回帖
693
 楼主| 发表于 2015-5-5 15:53:35 | 显示全部楼层
本帖最后由 lirn 于 2015-5-5 15:55 编辑

由于我是不懂脚本,我想到一个笨办法,但乱改可能有很大麻烦,所以我来问问。

就上述脚本同类的只能读取一个,那我选择增加备注栏的数目应该可以吧。

比如一开始的

[pre lang="ruby"]PATTERN = /.*I:ID(\d+)N(\d+)(.*)/m  [/pre]

我再添加一个
[pre lang="ruby"]PATTERN_1= /.*I1:ID(\d+)N(\d+)(.*)/m  [/pre]



[pre lang="ruby"]  def skill_it_cost(skill)
    skill.note.match(PATTERN)
    item = $data_items[$1.to_i] if $1 != 0
    num = $2.to_i
    flag = $3.match(/^#{STR_UN_CONSUM}/) if $3
    return [item,num,flag]
    skill.note.match(PATTERN_1)
    item = $data_items[$1.to_i] if $1 != 0
    num = $2.to_i
    flag = $3.match(/^#{STR_UN_CONSUM}/) if $3
    return [item,num,flag]
  end
  [/pre]

然后这样行不?

点评

相关部分改成数组就行了  发表于 2017-11-30 14:57
回复

使用道具 举报

梦石
0
星屑
50
在线时间
1019 小时
注册时间
2012-4-25
回帖
693
 楼主| 发表于 2015-5-8 01:20:59 | 显示全部楼层
  1. module IISNOW_ITEM_CONSUME_SKILL
  2.   
  3.   PATTERN = /.*I0:I(\d+)N(\d+)(.*)/m  
  4.   # 非专业人士请勿修改,正则匹配式,修改后注意备注写法的改变,下同
  5.   PATTERN_1 = /.*I1:I(\d+)N(\d+)(.*)/m
  6.   PATTERN_2 = /.*I2:I(\d+)N(\d+)(.*)/m
  7.   PATTERN_3 = /.*I3:I(\d+)N(\d+)(.*)/m
  8.   PATTERN_4 = /.*I4:I(\d+)N(\d+)(.*)/m
  9.   PATTERN_5 = /.*I5:I(\d+)N(\d+)(.*)/m
  10.   PATTERN_E = /.*EQU:ID(\d+).*/m
  11.   PATTERN_A = /.*ARM:ID(\d+).*/m
  12.   STR_UN_CONSUM = "UN" # 物品不消耗标识
  13.   
  14.   TP_ICON = 189  # 你说你懂的
  15.   MP_ICON = 188
  16.   
  17.   STYLE = 2 # 界面风格(支持1,2,3,4效果自己体会,不推荐4)
  18.   STYLE_A = 2 # 提示风格(支持1,2,3,同上)
  19.   PLACE = 3 # 消耗物品的图标与数目间的间距
  20.   PLACE_E = 2 # 不同消耗物品间的间距
  21.   ORDER = [0,1,2]     # 从右往左的消耗显示顺序(0,TP;1,MP;2,物品)
  22.   
  23.   COLOR_ITEM = Color.new(255,255,255) # 物品消耗数目的字的颜色
  24.   COLOR_WE_L = Color.new(255,0,0) # 具体限定武器的框的颜色
  25.   COLOR_WE_A = Color.new(255,0,0) # 具体限定防具的框的颜色
  26.   COLOR_UN_I = Color.new(0,255,0) # 物品限定但不消耗的提示框的颜色
  27.   
  28.   TRAN_DE = 100 # 风格_A2下的透明度再次降低(最大为160)
  29. end

  30. class Window_SkillList
  31.   
  32.   include IISNOW_ITEM_CONSUME_SKILL
  33.   
  34.   def col_max
  35.     case STYLE
  36.     when 1,3,4
  37.       return 2
  38.     when 2
  39.       return 1
  40.     end
  41.   end
  42.   
  43.   def item_height
  44.     case STYLE
  45.     when 3
  46.       line_height * 2
  47.     when 1,2,4
  48.       line_height + 1
  49.     end
  50.   end
  51.   
  52.   def draw_item(index)
  53.     skill = @data[index]
  54.     if skill
  55.       rect = item_rect(index)
  56.       rect.width -= 4
  57.       draw_item_name(skill, rect.x, rect.y, enable?(skill))
  58.       draw_skill_cost(rect, skill)
  59.     end
  60.   end
  61.   
  62.   alias :iisnow_draw_item_name :draw_item_name
  63.   def draw_item_name(item, x, y, enabled = true, width = 172)
  64.     iisnow_draw_item_name(item, x, y, enabled,width)
  65.     rect_temp = text_size(item.name)
  66.     if @actor.skill_eq_limt(item)
  67.       draw_kuang(x + 24 + PLACE  + rect_temp.width,y,24,24,COLOR_WE_L,enabled)
  68.       draw_icon(@actor.skill_eq_limt(item).icon_index,x + 24 + PLACE + rect_temp.width,y,enabled)
  69.       rect_temp.width += (24 + PLACE_E)
  70.     end
  71.     if @actor.skill_ar_limt(item)
  72.       draw_kuang(x + 24 + PLACE + rect_temp.width,y,24,24,COLOR_WE_A,enabled)
  73.       draw_icon(@actor.skill_ar_limt(item).icon_index,x + 24 + PLACE + rect_temp.width,y,enabled)
  74.     end
  75.   end
  76.   
  77.   def draw_skill_cost(rect, skill)
  78.     str = create_string(skill)
  79.     color = [tp_cost_color,mp_cost_color,COLOR_ITEM]
  80.     str.each_with_index do |str,i|
  81.       next unless str
  82.       change_color(color[ORDER[i]], enable?(skill))
  83.       kuang = false
  84.       case i
  85.       when ORDER.index(2)
  86.         icon_index = str[0].icon_index
  87.         kuang = true if str[2]
  88.         str = str[1]
  89.       when ORDER.index(1)
  90.         icon_index = MP_ICON
  91.       when ORDER.index(0)
  92.         icon_index = TP_ICON
  93.       end
  94.       contents.font.size = STYLE == 1 ? Font.default_size - 6 : Font.default_size
  95.       draw_style(icon_index,rect,str,skill,kuang)
  96.     end
  97.     contents.font.size = Font.default_size
  98.   end
  99.   
  100.   def draw_style(icon_index,rect,str,skill,kuang)
  101.     case STYLE
  102.     when 1
  103.       draw_kuang(rect.width - 24 + rect.x,rect.y,24,24,COLOR_UN_I,enable?(skill)) if kuang
  104.       draw_icon(icon_index,rect.width - 24 + rect.x,rect.y,enable?(skill))
  105.       draw_text(Rect.new(rect.x + rect.width - 24,rect.y + 8,24,16),str,2) if str.to_i != 1
  106.       rect.width -= (24 + PLACE_E)
  107.     when 2,4
  108.       draw_text(rect,str,2) if str.to_i != 1
  109.       rect.width -= (text_size(str).width + PLACE) if str.to_i != 1
  110.       draw_kuang(rect.width - 24 + rect.x,rect.y,24,24,COLOR_UN_I,enable?(skill)) if kuang
  111.       draw_icon(icon_index,rect.width - 24 + rect.x,rect.y,enable?(skill))
  112.       rect.width -= (24 + PLACE_E)
  113.     when 3
  114.       rect_temp = rect.clone
  115.       rect_temp.y += (rect_temp.height / 2)
  116.       rect_temp.height /= 2
  117.       draw_text(rect_temp,str,2) if str.to_i != 1
  118.       rect.width -= (text_size(str).width + PLACE) if str.to_i != 1
  119.       draw_kuang(rect.width - 24 + rect.x,rect_temp.y,24,24,COLOR_UN_I,enable?(skill)) if kuang
  120.       draw_icon(icon_index,rect.width - 24 + rect.x,rect_temp.y,enable?(skill))
  121.       rect.width -= (24 + PLACE_E)
  122.     end
  123.   end
  124.   
  125.   def draw_kuang(x,y,w,h,c,fl)
  126.     c.alpha = fl ? 255 : translucent_alpha - (STYLE_A == 2 ? TRAN_DE : 0)
  127.     case STYLE_A
  128.     when 1
  129.       contents.fill_rect(x,y,w,1,c)
  130.       contents.fill_rect(x,y + 1,1,h - 1,c)
  131.       contents.fill_rect(x + 1,y + h - 1,w - 1,1,c)
  132.       contents.fill_rect(x + w -1,y + 1,1,h - 2,c)
  133.     when 2
  134.       contents.fill_rect(x,y,w,h,c)
  135.     end
  136.   end
  137.   
  138.   def create_string(skill)
  139.     str1 = @actor.skill_tp_cost(skill)
  140.     str2 = @actor.skill_mp_cost(skill)
  141.     str3 = @actor.skill_it_cost(skill)
  142.     str4 = @actor.skill_it1_cost(skill)
  143.     str1 = str1 > 0 ?  str1.to_s : nil
  144.     str2 = str2 > 0 ?  str2.to_s : nil
  145.     str3 = str3[1] > 0 ? [str3[0],str3[1].to_s,str3[2]] : nil
  146.     str4 = str4[1] > 0 ? [str4[0],str4[1].to_s,str4[2]] : nil#4
  147.     str = [str1,str2,str3,str4]
  148.     iisnow = [str[ORDER[0]],str[ORDER[1]],str[ORDER[2]]]
  149.     iisnow
  150.   end
  151.   
  152. end

  153. class Game_BattlerBase
  154.   
  155.   include IISNOW_ITEM_CONSUME_SKILL
  156.   
  157.   def skill_it_cost(skill)
  158.     skill.note.match(PATTERN)
  159.     item = $data_items[$1.to_i] if $1 != 0
  160.     num = $2.to_i
  161.     flag = $3.match(/^#{STR_UN_CONSUM}/) if $3
  162.     return [item,num,flag]
  163.   end
  164.   
  165.     def skill_it1_cost(skill)#加
  166.     skill.note.match(PATTERN_1)
  167.     item = $data_items[$1.to_i] if $1 != 0
  168.     num = $2.to_i
  169.     flag = $3.match(/^#{STR_UN_CONSUM}/) if $3
  170.     return [item,num,flag]
  171.   end#加
  172.       def skill_it2_cost(skill)#加
  173.     skill.note.match(PATTERN_2)
  174.     item = $data_items[$1.to_i] if $1 != 0
  175.     num = $2.to_i
  176.     flag = $3.match(/^#{STR_UN_CONSUM}/) if $3
  177.     return [item,num,flag]
  178.   end#加
  179.       def skill_it3_cost(skill)#加
  180.     skill.note.match(PATTERN_3)
  181.     item = $data_items[$1.to_i] if $1 != 0
  182.     num = $2.to_i
  183.     flag = $3.match(/^#{STR_UN_CONSUM}/) if $3
  184.     return [item,num,flag]
  185.   end#加
  186.   
  187.   def skill_it4_cost(skill)#加
  188.     skill.note.match(PATTERN_4)
  189.     item = $data_items[$1.to_i] if $1 != 0
  190.     num = $2.to_i
  191.     flag = $3.match(/^#{STR_UN_CONSUM}/) if $3
  192.     return [item,num,flag]
  193.   end#加
  194.       
  195.   def skill_it5_cost(skill)#加
  196.     skill.note.match(PATTERN_5)
  197.     item = $data_items[$1.to_i] if $1 != 0
  198.     num = $2.to_i
  199.     flag = $3.match(/^#{STR_UN_CONSUM}/) if $3
  200.     return [item,num,flag]
  201.   end#加
  202.   
  203.   def skill_eq_limt(skill)
  204.     skill.note.match(PATTERN_E)
  205.     eq = $data_weapons[$1.to_i] if $1 != 0
  206.     return eq
  207.   end
  208.   
  209.   def skill_ar_limt(skill)
  210.     skill.note.match(PATTERN_A)
  211.     eq = $data_armors[$1.to_i] if $1 != 0
  212.     return eq
  213.   end
  214.   
  215.   alias :iisnow_skill_cost_payable? :skill_cost_payable?
  216.   def skill_cost_payable?(skill)
  217.     result1 = iisnow_skill_cost_payable?(skill)
  218.     if skill_it_cost(skill)[0]
  219.       result2 = $game_party.item_number(skill_it_cost(skill)[0]) >= skill_it_cost(skill)[1]
  220.       return result1 && result2
  221.       elsif  skill_it1_cost(skill)[0] #加
  222.       result4 = $game_party.item_number(skill_it1_cost(skill)[0]) >= skill_it1_cost(skill)[1]
  223.       return result1 && result4
  224.       elsif skill_it2_cost(skill)[0] #加
  225.       result5 = $game_party.item_number(skill_it2_cost(skill)[0]) >= skill_it2_cost(skill)[1]
  226.       return result1 && result5
  227.       elsif skill_it3_cost(skill)[0] #加
  228.       result6 = $game_party.item_number(skill_it3_cost(skill)[0]) >= skill_it3_cost(skill)[1]
  229.       return result1 && result6
  230.       elsif skill_it4_cost(skill)[0] #加
  231.       result7 = $game_party.item_number(skill_it4_cost(skill)[0]) >= skill_it4_cost(skill)[1]
  232.       return result1 && result7
  233.       elsif skill_it5_cost(skill)[0] #加
  234.       result8 = $game_party.item_number(skill_it5_cost(skill)[0]) >= skill_it5_cost(skill)[1]
  235.       return result1 && result8
  236.     end
  237.     return result1
  238.   end
  239.   
  240.   alias :iisnow_pay_skill_cost :pay_skill_cost
  241.   def pay_skill_cost(skill)
  242.     iisnow_pay_skill_cost(skill)
  243.     if skill_it_cost(skill)[0] && !skill_it_cost(skill)[2]
  244.       $game_party.gain_item(skill_it_cost(skill)[0],-skill_it_cost(skill)[1])
  245.     end
  246.     if skill_it1_cost(skill)[0] && !skill_it1_cost(skill)[2]#加
  247.       $game_party.gain_item(skill_it1_cost(skill)[0],-skill_it1_cost(skill)[1])
  248.     end #加
  249.     if skill_it2_cost(skill)[0] && !skill_it2_cost(skill)[2]#加
  250.       $game_party.gain_item(skill_it2_cost(skill)[0],-skill_it2_cost(skill)[1])
  251.     end #加
  252.     if skill_it3_cost(skill)[0] && !skill_it3_cost(skill)[2]#加
  253.       $game_party.gain_item(skill_it3_cost(skill)[0],-skill_it3_cost(skill)[1])
  254.     end #加
  255.     if skill_it4_cost(skill)[0] && !skill_it4_cost(skill)[2]#加
  256.       $game_party.gain_item(skill_it4_cost(skill)[0],-skill_it4_cost(skill)[1])
  257.     end #加
  258.     if skill_it5_cost(skill)[0] && !skill_it5_cost(skill)[2]#加
  259.       $game_party.gain_item(skill_it5_cost(skill)[0],-skill_it5_cost(skill)[1])
  260.     end #加
  261.   end

  262. end

  263. class Game_Actor
  264.   
  265.   alias :iisnow_skill_wtype_ok? :skill_wtype_ok?
  266.   def skill_wtype_ok?(skill)
  267.     result1 = iisnow_skill_wtype_ok?(skill)
  268.     result2 = skill_eq_limt(skill) ? weapons.include?(skill_eq_limt(skill)) : true
  269.     result3 = skill_ar_limt(skill) ? armors.include?(skill_ar_limt(skill)) : true
  270.     return result1 && result2 && result3
  271.   end
  272.   
  273. end
复制代码
我想了一个笨办法,通过添加这些来增加这些。目前来说确实做到了消耗多样问题,但还有几个个问题。图标没描绘是小事,大问题那就是能否使用技能这里。
  1. alias :iisnow_skill_cost_payable? :skill_cost_payable?
  2.   def skill_cost_payable?(skill)
  3.     result1 = iisnow_skill_cost_payable?(skill)
  4.     if skill_it_cost(skill)[0]
  5.       result2 = $game_party.item_number(skill_it_cost(skill)[0]) >= skill_it_cost(skill)[1]
  6.       return result1 && result2
  7.       elsif  skill_it1_cost(skill)[0] #加
  8.       result4 = $game_party.item_number(skill_it1_cost(skill)[0]) >= skill_it1_cost(skill)[1]
  9.       return result1 && result4
  10.       elsif skill_it2_cost(skill)[0] #加
  11.       result5 = $game_party.item_number(skill_it2_cost(skill)[0]) >= skill_it2_cost(skill)[1]
  12.       return result1 && result5
  13.       elsif skill_it3_cost(skill)[0] #加
  14.       result6 = $game_party.item_number(skill_it3_cost(skill)[0]) >= skill_it3_cost(skill)[1]
  15.       return result1 && result6
  16.       elsif skill_it4_cost(skill)[0] #加
  17.       result7 = $game_party.item_number(skill_it4_cost(skill)[0]) >= skill_it4_cost(skill)[1]
  18.       return result1 && result7
  19.       elsif skill_it5_cost(skill)[0] #加
  20.       result8 = $game_party.item_number(skill_it5_cost(skill)[0]) >= skill_it5_cost(skill)[1]
  21.       return result1 && result8
  22.     end
  23.     return result1
  24.   end
复制代码
没猜错的话,应该是这段有问题。因为只要有了其中一种物品,就会return result1,技能就可以使用,请问应该要怎么做?
回复

使用道具 举报

闇吼者の災悪眷族

梦石
0
星屑
1366
在线时间
2881 小时
注册时间
2014-7-29
回帖
6408
发表于 2015-5-9 02:31:21 | 显示全部楼层
本帖最后由 三途亚梦 于 2015-5-9 02:36 编辑

脚本我还没细看,话说既然提到要消耗“时间”你,你想要如何达成呢?

如果单纯的是作为生活技能看待的话,我更建议你找一个物品选择扩张的脚本,然后纯事件做这样的生活技能。

点评

估计是经过回合数  发表于 2017-11-30 14:56
回复

使用道具 举报

梦石
0
星屑
50
在线时间
1019 小时
注册时间
2012-4-25
回帖
693
 楼主| 发表于 2015-5-9 15:16:28 | 显示全部楼层
三途亚梦 发表于 2015-5-9 02:31
脚本我还没细看,话说既然提到要消耗“时间”你,你想要如何达成呢?

如果单纯的是作为生活技能 ...

消耗时间一类的可以用公共事件完成。

我在计算公式里写的就是输入变量,然后根本变量执行相关事件。

目前我的朋友已经帮我完成了,只要其中一个不满足就返回0。

现在就差技能描绘,不过这算是小事情了。
回复

使用道具 举报

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

本版积分规则

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

在本版发帖返回顶部