幻想森林

 找回密码
 立即注册
搜索
热搜: 活动 交友 discuz
12
返回列表 发新帖
楼主: 酆城浪子

[RM2K&2K3] 求助!来个帮忙看看是否能实现

[复制链接]

550

主题

9116

帖子

214748万

积分

超级版主

如同神一般的存在,腿神!拖后腿的神~~

Rank: 8Rank: 8

积分
2147483647
发表于 2009-11-30 20:51:24 | 显示全部楼层
Window_Item 93行 self.contents.draw_text(x + 28, y, 212, 32, item.name, 0)
改成
self.contents.draw_text(x + 28, y, 212, 32, item.name.split('@')[0], 0)
物品栏里面也要变化颜色么?
我就是你们的神,庶民们,追随我吧!跟着我一起拖后腿!
回复 支持 反对

使用道具 举报

550

主题

9116

帖子

214748万

积分

超级版主

如同神一般的存在,腿神!拖后腿的神~~

Rank: 8Rank: 8

积分
2147483647
发表于 2009-11-30 20:55:40 | 显示全部楼层
#--------------------------------------------------------------------------
  # ● 项目的描绘
  #     index : 项目符号
  #--------------------------------------------------------------------------
  def draw_item(index)
    item = @data[index]
    x = 4 + index % 2 * (288 + 32)
    y = index / 2 * 32
    case item
    when RPG::Weapon
      number = $game_party.weapon_number(item.id)
    when RPG::Armor
      number = $game_party.armor_number(item.id)
    end
    bitmap = RPG::Cache.icon(item.icon_name)
    self.contents.blt(x, y + 4, bitmap, Rect.new(0, 0, 24, 24))
    if item.name.split('@')[1]
      self.contents.font.color = text_color(item.name.split('@')[1].to_i)
    else
      self.contents.font.color = normal_color
    end
    self.contents.draw_text(x + 28, y, 212, 32, item.name.split('@')[0],  0)
    self.contents.font.color = normal_color
    self.contents.draw_text(x + 240, y, 16, 32, ":", 1)
    self.contents.draw_text(x + 256, y, 24, 32, number.to_s, 2)
  end

替换

Window_EquipItem
的 同名的def draw_item(index)
我就是你们的神,庶民们,追随我吧!跟着我一起拖后腿!
回复 支持 反对

使用道具 举报

15

主题

271

帖子

2198

积分

⑥精研

我要疯狂积累活跃度!

积分
2198
QQ
 楼主| 发表于 2009-12-1 15:39:46 | 显示全部楼层
腿神,谢了。搞定了。。。所有必要系统都有了。。。。
紫月光流奈河畔, 孤影独行笑苍天。 酆都倒比人间好, 从此慕鬼不羡仙!
回复 支持 反对

使用道具 举报

15

主题

271

帖子

2198

积分

⑥精研

我要疯狂积累活跃度!

积分
2198
QQ
 楼主| 发表于 2009-12-1 15:58:57 | 显示全部楼层
腿神我又回来了。。。商店买卖里面还是有:武器名@1 。。。

在那个买东西的右下面窗口,人物名称和现在装备的物品
紫月光流奈河畔, 孤影独行笑苍天。 酆都倒比人间好, 从此慕鬼不羡仙!
回复 支持 反对

使用道具 举报

15

主题

271

帖子

2198

积分

⑥精研

我要疯狂积累活跃度!

积分
2198
QQ
 楼主| 发表于 2009-12-1 16:44:01 | 显示全部楼层
改了好久都改不好啊。。。腿神,显灵吧
这应该是最后一步了。。。
紫月光流奈河畔, 孤影独行笑苍天。 酆都倒比人间好, 从此慕鬼不羡仙!
回复 支持 反对

使用道具 举报

550

主题

9116

帖子

214748万

积分

超级版主

如同神一般的存在,腿神!拖后腿的神~~

Rank: 8Rank: 8

积分
2147483647
发表于 2009-12-1 17:43:42 | 显示全部楼层
Window_ShopStatus 覆盖同名方法

  #--------------------------------------------------------------------------
  # ● 刷新
  #--------------------------------------------------------------------------
  def refresh
    self.contents.clear
    if @item == nil
      return
    end
    case @item
    when RPG::Item
      number = $game_party.item_number(@item.id)
    when RPG::Weapon
      number = $game_party.weapon_number(@item.id)
    when RPG::Armor
      number = $game_party.armor_number(@item.id)
    end
    self.contents.font.color = system_color
    self.contents.draw_text(4, 0, 200, 32, "所持数")
    self.contents.font.color = normal_color
    self.contents.draw_text(204, 0, 32, 32, number.to_s, 2)
    if @item.is_a?(RPG::Item)
      return
    end
    # 添加装备品信息
    for i in 0...$game_party.actors.size
      # 获取角色
      actor = $game_party.actors
      # 可以装备为普通文字颜色、不能装备设置为无效文字颜色
      if actor.equippable?(@item)
        self.contents.font.color = normal_color
      else
        self.contents.font.color = disabled_color
      end
      # 描绘角色名字
      self.contents.draw_text(4, 64 + 64 * i, 120, 32, actor.name)
      # 获取当前的装备品
      if @item.is_a?(RPG::Weapon)
        item1 = $data_weapons[actor.weapon_id]
      elsif @item.kind == 0
        item1 = $data_armors[actor.armor1_id]
      elsif @item.kind == 1
        item1 = $data_armors[actor.armor2_id]
      elsif @item.kind == 2
        item1 = $data_armors[actor.armor3_id]
      else
        item1 = $data_armors[actor.armor4_id]
      end
      # 可以装备的情况
      if actor.equippable?(@item)
        # 武器的情况
        if @item.is_a?(RPG::Weapon)
          atk1 = item1 != nil ? item1.atk : 0
          atk2 = @item != nil ? @item.atk : 0
          change = atk2 - atk1
        end
        # 防具的情况
        if @item.is_a?(RPG::Armor)
          pdef1 = item1 != nil ? item1.pdef : 0
          mdef1 = item1 != nil ? item1.mdef : 0
          pdef2 = @item != nil ? @item.pdef : 0
          mdef2 = @item != nil ? @item.mdef : 0
          change = pdef2 - pdef1 + mdef2 - mdef1
        end
        # 描绘能力值变化
        self.contents.draw_text(124, 64 + 64 * i, 112, 32,
          sprintf("%+d", change), 2)
      end
      # 描绘物品
      if item1 != nil
        x = 4
        y = 64 + 64 * i + 32
        bitmap = RPG::Cache.icon(item1.icon_name)
        opacity = self.contents.font.color == normal_color ? 255 : 128
        self.contents.blt(x, y + 4, bitmap, Rect.new(0, 0, 24, 24), opacity)
        if item1.name.split('@')[1]
          self.contents.font.color = text_color(item1.name.split('@')[1].to_i)
        end
        self.contents.draw_text(x + 28, y, 212, 32, item1.name.split('@')[0])
      end
    end
  end

Window_ShopSell 覆盖同名方法


  #--------------------------------------------------------------------------
  # ● 描绘项目
  #     index : 项目标号
  #--------------------------------------------------------------------------
  def draw_item(index)
    item = @data[index]
    case item
    when RPG::Item
      number = $game_party.item_number(item.id)
    when RPG::Weapon
      number = $game_party.weapon_number(item.id)
    when RPG::Armor
      number = $game_party.armor_number(item.id)
    end
    # 可以卖掉的显示为普通文字颜色、除此之外设置成无效文字颜色
    if item.price > 0
      self.contents.font.color = normal_color
    else
      self.contents.font.color = disabled_color
    end
    x = 4 + index % 2 * (288 + 32)
    y = index / 2 * 32
    rect = Rect.new(x, y, self.width / @column_max - 32, 32)
    self.contents.fill_rect(rect, Color.new(0, 0, 0, 0))
    bitmap = RPG::Cache.icon(item.icon_name)
    opacity = self.contents.font.color == normal_color ? 255 : 128
    self.contents.blt(x, y + 4, bitmap, Rect.new(0, 0, 24, 24), opacity)
    self.contents.draw_text(x + 240, y, 16, 32, ":", 1)
    self.contents.draw_text(x + 256, y, 24, 32, number.to_s, 2)
    if item.name.split('@')[1]
      self.contents.font.color = text_color(item.name.split('@')[1].to_i)
    end
    self.contents.draw_text(x + 28, y, 212, 32, item.name.split('@')[0], 0)
  end

Window_ShopBuy  覆盖同名方法


  #--------------------------------------------------------------------------
  # ● 描绘羡慕
  #     index : 项目编号
  #--------------------------------------------------------------------------
  def draw_item(index)
    item = @data[index]
    # 获取物品所持数
    case item
    when RPG::Item
      number = $game_party.item_number(item.id)
    when RPG::Weapon
      number = $game_party.weapon_number(item.id)
    when RPG::Armor
      number = $game_party.armor_number(item.id)
    end
    # 价格在所持金以下、并且所持数不是 99 的情况下为普通文字颜色
    # 除此之外的情况设置为无效文字色
    if item.price <= $game_party.gold and number < 99
      self.contents.font.color = normal_color
    else
      self.contents.font.color = disabled_color
    end
    x = 4
    y = index * 32
    rect = Rect.new(x, y, self.width - 32, 32)
    self.contents.fill_rect(rect, Color.new(0, 0, 0, 0))
    bitmap = RPG::Cache.icon(item.icon_name)
    opacity = self.contents.font.color == normal_color ? 255 : 128
    self.contents.blt(x, y + 4, bitmap, Rect.new(0, 0, 24, 24), opacity)
    self.contents.draw_text(x + 240, y, 88, 32, item.price.to_s, 2)
    if item.name.split('@')[1]
      self.contents.font.color = text_color(item.name.split('@')[1].to_i)
    end
    self.contents.draw_text(x + 28, y, 212, 32, item.name.split('@')[0], 0)
  end
我就是你们的神,庶民们,追随我吧!跟着我一起拖后腿!
回复 支持 反对

使用道具 举报

15

主题

271

帖子

2198

积分

⑥精研

我要疯狂积累活跃度!

积分
2198
QQ
 楼主| 发表于 2009-12-2 16:22:07 | 显示全部楼层
Window_ShopStatus  第45行出错,不过我上面没动直接从
     # 描绘物品
      if item1 != nil
这里往下覆盖的,问题解决了,还有ShopSell和ShopBuy那里在之前我仔细看了看你的脚本已经改好了   
现在所有问题都解决了谢谢腿神!!!
紫月光流奈河畔, 孤影独行笑苍天。 酆都倒比人间好, 从此慕鬼不羡仙!
回复 支持 反对

使用道具 举报

550

主题

9116

帖子

214748万

积分

超级版主

如同神一般的存在,腿神!拖后腿的神~~

Rank: 8Rank: 8

积分
2147483647
发表于 2009-12-2 19:09:35 | 显示全部楼层
Window_ShopStatus  第45行出错,不过我上面没动直接从
     # 描绘物品
      if item1 != nil


MS我没有改Window_ShopStatus。。。。也没有这个报错啊

到底是解决了还是没解决。。。。

另外啊。。。

Window_Base中  def text_color(index)  这个是一个颜色合集,事件指令显示文章的颜色从这里调的
你可以自己仿照着做一个   
def equip_color(index)
  case index
  when 1
    return Color.new()...参数写成紫色的。。。
  end
end
就这样。。然后把我叫你改的地方
text_color 都改成  equip_color就可以了。。。这样你就自己拥有了一个装备颜色的合集。。。不用去调用 文章的颜色了。。。不知道说的明不明白
我就是你们的神,庶民们,追随我吧!跟着我一起拖后腿!
回复 支持 反对

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

Archiver|手机版|小黑屋|幻想森林

GMT+8, 2024-5-2 18:31 , Processed in 0.021680 second(s), 18 queries .

Powered by Discuz! X3.4

© 2001-2017 Comsenz Inc.

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