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

Project1

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

如何设置两类商店

 关闭 [复制链接]
头像被屏蔽

Lv1.梦旅人 (禁止发言)

梦石
0
星屑
50
在线时间
0 小时
注册时间
2007-7-27
帖子
22
跳转到指定楼层
1
发表于 2007-8-4 19:56:08 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式
提示: 作者被禁止或删除 内容自动屏蔽
头像被屏蔽

Lv1.梦旅人 (禁止发言)

梦石
0
星屑
50
在线时间
0 小时
注册时间
2007-7-27
帖子
22
2
 楼主| 发表于 2007-8-4 19:56:08 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式
提示: 作者被禁止或删除 内容自动屏蔽

Lv1.梦旅人

梦石
0
星屑
60
在线时间
1 小时
注册时间
2006-8-31
帖子
52
3
发表于 2007-8-4 20:07:32 | 只看该作者
建议,使用柳柳的“真实商店脚本”,自己设制。
爱情是使理智的人失去理智的温柔,属于秋天的童话继续在这里延续~~~~~~
回复 支持 反对

使用道具 举报

头像被屏蔽

Lv1.梦旅人 (禁止发言)

梦石
0
星屑
50
在线时间
0 小时
注册时间
2007-7-27
帖子
22
4
 楼主| 发表于 2007-8-4 20:10:45 | 只看该作者
提示: 作者被禁止或删除 内容自动屏蔽
回复 支持 反对

使用道具 举报

Lv2.观梦者

梦石
0
星屑
431
在线时间
125 小时
注册时间
2006-11-2
帖子
1200
5
发表于 2007-8-4 21:42:10 | 只看该作者
  1. ########################################################
  2. =begin
  3. 作用 :只能卖出指定类型的商店。
  4. 物品类型的定义: 在物品说明后面加上 @真实 或者 @虚幻
  5. 每次商店处理前令1号变量等于 0 1 或者 2
  6. 0 : 可以卖出所有物品
  7. 1 : 只能卖出 @真实 的物品
  8. 2 : 只能卖出 @虚幻 的物品

  9. 修改的地方话 搜索 #kk

  10. =end
  11. #########################################################
  12. #==============================================================================
  13. # ■ RPG原装定义
  14. #==============================================================================
  15. module RPG
  16.   class Item
  17.     def description
  18.       description = @description.split(/@/)[0]
  19.       return  description != nil ?  description : ''
  20.     end
  21.     def k_kind
  22.       k_kind = @description.split(/@/)[1]
  23.       return k_kind  != nil ? k_kind : ''
  24.     end
  25.   end
  26.   
  27.   class Weapon
  28.     def description
  29.       description = @description.split(/@/)[0]
  30.       return  description != nil ?  description : ''
  31.     end
  32.     def k_kind
  33.       k_kind = @description.split(/@/)[1]
  34.       return k_kind  != nil ? k_kind : ''
  35.     end
  36.   end  
  37.   
  38.   
  39.   class Armor
  40.     def description
  41.       description = @description.split(/@/)[0]
  42.       return  description != nil ?  description : ''
  43.     end
  44.     def k_kind
  45.       k_kind = @description.split(/@/)[1]
  46.       return k_kind  != nil ? k_kind : ''
  47.     end
  48.   end   
  49. end

  50. class Window_ShopSell < Window_Selectable
  51.     #--------------------------------------------------------------------------
  52.   # ● 描绘项目
  53.   #     index : 项目标号
  54.   #--------------------------------------------------------------------------
  55.   def draw_item(index)
  56.     item = @data[index]
  57.     case item
  58.     when RPG::Item
  59.       number = $game_party.item_number(item.id)
  60.     when RPG::Weapon
  61.       number = $game_party.weapon_number(item.id)
  62.     when RPG::Armor
  63.       number = $game_party.armor_number(item.id)
  64.     end
  65.     # 可以卖掉的显示为普通文字颜色、除此之外设置成无效文字颜色
  66.    
  67.    
  68.     if item.price > 0
  69.       self.contents.font.color = normal_color
  70.     else
  71.       self.contents.font.color = disabled_color
  72.     end
  73.     #kk-----------------------------------------------------
  74.     case $game_variables[1]
  75.     when 1
  76.      self.contents.font.color = disabled_color if item.k_kind != "真实"
  77.     when 2  
  78.      self.contents.font.color = disabled_color if item.k_kind != "虚幻"
  79.     end
  80.     #kk-----------------------------------------------------
  81.     x = 4 + index % 2 * (288 + 32)
  82.     y = index / 2 * 32
  83.     rect = Rect.new(x, y, self.width / @column_max - 32, 32)
  84.     self.contents.fill_rect(rect, Color.new(0, 0, 0, 0))
  85.     bitmap = RPG::Cache.icon(item.icon_name)
  86.     opacity = self.contents.font.color == normal_color ? 255 : 128
  87.     self.contents.blt(x, y + 4, bitmap, Rect.new(0, 0, 24, 24), opacity)
  88.     self.contents.draw_text(x + 28, y, 212, 32, item.name, 0)
  89.     self.contents.draw_text(x + 240, y, 16, 32, ":", 1)
  90.     self.contents.draw_text(x + 256, y, 24, 32, number.to_s, 2)
  91.   end
  92.   
  93. end


  94. class Scene_Shop
  95.   
  96. def update_sell
  97.     # 按下 B 键的情况下
  98.     if Input.trigger?(Input::B)
  99.       # 演奏取消 SE
  100.       $game_system.se_play($data_system.cancel_se)
  101.       # 窗口状态转向初期模式
  102.       @command_window.active = true
  103.       @dummy_window.visible = true
  104.       @sell_window.active = false
  105.       @sell_window.visible = false
  106.       @status_window.item = nil
  107.       # 删除帮助文本
  108.       @help_window.set_text("")
  109.       return
  110.     end
  111.     # 按下 C 键的情况下
  112.     if Input.trigger?(Input::C)
  113.       # 获取物品
  114.       @item = @sell_window.item
  115.       # 设置状态窗口的物品
  116.       @status_window.item = @item
  117.       # 物品无效的情况下、或者价格为 0 (不能卖出) 的情况下
  118.       #kk----------------------------------------------------------
  119.       if @item == nil or @item.price == 0 or ($game_variables[1] == 1 and @item.k_kind != "真实" ) or ($game_variables[1] == 2 and @item.k_kind != "虚幻")
  120.       #kk----------------------------------------------------------   
  121.         # 演奏冻结 SE
  122.         $game_system.se_play($data_system.buzzer_se)
  123.         return
  124.       end
  125.       # 演奏确定 SE
  126.       $game_system.se_play($data_system.decision_se)
  127.       # 获取物品的所持数
  128.       case @item
  129.       when RPG::Item
  130.         number = $game_party.item_number(@item.id)
  131.       when RPG::Weapon
  132.         number = $game_party.weapon_number(@item.id)
  133.       when RPG::Armor
  134.         number = $game_party.armor_number(@item.id)
  135.       end
  136.       # 最大卖出个数 = 物品的所持数
  137.       max = number
  138.       # 窗口状态转向个数输入模式
  139.       @sell_window.active = false
  140.       @sell_window.visible = false
  141.       @number_window.set(@item, max, @item.price / 2)
  142.       @number_window.active = true
  143.       @number_window.visible = true
  144.       @status_window.visible = true
  145.     end
  146.   end
  147. end
复制代码


使用方法见开头帮助。
系统信息:本贴由楼主认可为正确答案,66RPG感谢您的热情解答~
和记忆一起封存着的ID...
回复 支持 反对

使用道具 举报

头像被屏蔽

Lv1.梦旅人 (禁止发言)

梦石
0
星屑
50
在线时间
0 小时
注册时间
2007-7-27
帖子
22
6
 楼主| 发表于 2007-8-4 22:18:41 | 只看该作者
提示: 作者被禁止或删除 内容自动屏蔽
回复 支持 反对

使用道具 举报

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

本版积分规则

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

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

GMT+8, 2026-6-29 10:44

Powered by Discuz! X3.1

© 2001-2013 Comsenz Inc.

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