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

Project1

 找回密码
 注册会员
搜索

MOG胜利结算,怎么相同物品合并起来?

查看数: 905 | 评论数: 1 | 收藏 0
关灯 | 提示:支持键盘翻页<-左 右->
    组图打开中,请稍候......
发布时间: 2015-8-27 21:13

正文摘要:

使用的是MOG胜利结算脚本,现在是战斗之后会掉一堆东西,怎么让同名的物品合并在一起,就是获得提示是 某某物品X2 这样的效果。 举列说就是如下图,让两个 暗之数据 直接显示 暗之数据X2,这样的效果。 以下是M ...

回复

gqxastg 发表于 2015-8-27 23:40:22
本帖最后由 gqxastg 于 2015-8-28 14:02 编辑

已测试
RUBY 代码复制
  1. class Window_Treasure
  2.   #--------------------------------------------------------------------------
  3.   # ● Draw_Treasure
  4.   #--------------------------------------------------------------------------
  5.   def draw_treasure
  6.       contents.clear
  7.       self.contents.font.size = 18
  8.       space_x = Graphics.width / 3
  9.     @item_index = 0
  10.     $game_troop.make_drop_items.group_by {|i| i }.each do |item, arr|
  11.       amount = arr.size
  12.       xi = (@item_index * space_x) - ((@item_index / 3) * (space_x * 3))        
  13.       yi = (@item_index / 3) * 32
  14.       $game_party.gain_item(item, amount)
  15.       draw_item_name(item,xi, yi, true, 140, amount)#140
  16.       @item_index += 1
  17.     end
  18.      @range_max = (@item_index / 3) * 32
  19.      @scroll = true if @item_index > 12
  20.      @item_index = 0
  21.   end  
  22.   #--------------------------------------------------------------------------
  23.   # ● 绘制物品名称
  24.   #     enabled : 有效的标志。false 的时候使用半透明效果绘制
  25.   #--------------------------------------------------------------------------
  26.   def draw_item_name(item, x, y, enabled = true, width = 172 , amount)
  27.     return unless item
  28.     draw_icon(item.icon_index, x, y, enabled)
  29.     change_color(normal_color, enabled)
  30.     draw_text(x + 24, y, width, line_height, "#{item.name}" + "×" + "#{amount}")
  31.   end
  32. end

点评

感谢雷君。。  发表于 2015-8-28 09:05

评分

参与人数 1梦石 +1 收起 理由
taroxd + 1 认可答案

查看全部评分

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

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

GMT+8, 2025-2-17 04:15

Powered by Discuz! X3.1

© 2001-2013 Comsenz Inc.

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