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

Project1

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

[已经解决] 【VX】关于在柜子里调查物品问题

[复制链接]

Lv1.梦旅人

梦石
0
星屑
60
在线时间
182 小时
注册时间
2009-4-22
帖子
208
跳转到指定楼层
1
发表于 2012-1-3 17:44:49 | 只看该作者 |只看大图 回帖奖励 |倒序浏览 |阅读模式
本帖最后由 gz29767562 于 2012-1-3 17:45 编辑

怎么才能在游戏进行的时候在井里调查得到物品呢?

该怎么设置啊

Lv2.观梦者

梦石
0
星屑
448
在线时间
628 小时
注册时间
2011-9-27
帖子
3996
2
发表于 2012-1-3 17:51:56 | 只看该作者
本帖最后由 小白玩家 于 2012-1-3 18:03 编辑

没明白~不就是物品得失提示脚本吗?地图上画个水井,用宝箱事件,图形改成无呗,事件放到水井上面~
确定键触发,和你图里那样也可以啊,第一页结尾加个独立开关,第二页空白,触发条件独立开关打开(不然按一次确定键,增加一次物品~


  1. #==============================================================================
  2. # 本脚本来自www.66RPG.com,使用和转载请保留此信息
  3. #==============================================================================

  4. class Game_Interpreter
  5. UnShowSwitch = 5 #禁止显示提示开关
  6. GainSe = "Audio/SE/Recovery.ogg"
  7. LoseSe = "Audio/SE/Raise2.ogg"

  8.   #--------------------------------------------------------------------------
  9.   # ● 增减金钱
  10.   #--------------------------------------------------------------------------
  11.   def command_125
  12.     value = operate_value(@params[0], @params[1], @params[2])
  13.     $game_party.gain_gold(value)
  14.     show_window(0,value) unless $game_switches[UnShowSwitch]
  15.     return true
  16.   end
  17.   #--------------------------------------------------------------------------
  18.   # ● 增减物品
  19.   #--------------------------------------------------------------------------
  20.   def command_126
  21.     value = operate_value(@params[1], @params[2], @params[3])
  22.     $game_party.gain_item($data_items[@params[0]], value)
  23.     $game_map.need_refresh = true
  24.     show_window(1,value,@params[0]) unless $game_switches[UnShowSwitch]
  25.     return true
  26.   end
  27.   #--------------------------------------------------------------------------
  28.   # ● 增减武器
  29.   #--------------------------------------------------------------------------
  30.   def command_127
  31.     value = operate_value(@params[1], @params[2], @params[3])
  32.     $game_party.gain_item($data_weapons[@params[0]], value, @params[4])
  33.     show_window(2,value,@params[0]) unless $game_switches[UnShowSwitch]
  34.     return true
  35.   end
  36.   #--------------------------------------------------------------------------
  37.   # ● 增减防具
  38.   #--------------------------------------------------------------------------
  39.   def command_128
  40.     value = operate_value(@params[1], @params[2], @params[3])
  41.     $game_party.gain_item($data_armors[@params[0]], value, @params[4])
  42.     show_window(3,value,@params[0]) unless $game_switches[UnShowSwitch]
  43.     return true
  44.   end

  45.   def show_window(type,value,id = 0)  
  46.     if type == 0
  47.       item = "gold"
  48.     else #物品,武器,防具
  49.       if type == 1
  50.       item = $data_items[id]
  51.       elsif type == 2
  52.       item = $data_weapons[id]
  53.       else
  54.       item = $data_armors[id]
  55.       end
  56.     end      
  57.       width = 150 + (type == 0 ? value.to_s.size * 7 - 16 : item.name.size * 7)
  58.       w = Window_Base.new((640-width)/2 - 85 ,110,width,64)
  59.       w.windowskin = Cache.system("Window")
  60.       w.contents = Bitmap.new(w.width - 32, w.height - 32)
  61.       w.contents.font.color = w.text_color(1)
  62.       w.contents.fill_rect(w.contents.rect,w.text_color(0))
  63.       w.opacity = w.contents_opacity =0   
  64.       for i in 0..10
  65.         w.opacity += 26
  66.         w.contents_opacity += 26
  67.         w.x += 3
  68.         Graphics.update
  69.       end      
  70.       if value >= 0
  71.         w.contents.draw_text(0,4,48,24,"得到")   
  72.         Audio.se_play(GainSe)
  73.       else
  74.         w.contents.draw_text(0,4,48,24,"失去")   
  75.         Audio.se_play(LoseSe)
  76.       end
  77.         if type != 0
  78.         w.draw_item_name_c(item,50, 4 ,type + 23)
  79.         w.opacity = w.back_opacity = 255
  80.         w.contents.font.color = w.text_color(14)
  81.         w.contents.draw_text(width - 72 , 4, 40, 24, "× " + value.abs.to_s ,2)
  82.         else  
  83.         bitmap = Cache.system("gold")
  84.         w.contents.blt(50, 4 ,bitmap , bitmap.rect)
  85.         w.contents.font.color = w.text_color(14)  
  86.         w.contents.draw_text(width - 112 , 4, 72, 24, " " + value.abs.to_s ,2)
  87.         end
  88.       for i in 0..50
  89.         Graphics.update
  90.       end
  91.       for i in 0..20
  92.         w.opacity -= 13
  93.         w.contents_opacity -= 13
  94.         w.x += 2
  95.         Graphics.update
  96.       end
  97.       w.dispose
  98.   end

  99. end


  100. class Window_Base
  101.   def draw_item_name_c(item, x, y , color)
  102.     if item != nil
  103.       draw_icon(item.icon_index, x, y, true)
  104.       self.contents.font.color = self.text_color(color)
  105.       self.contents.draw_text(x + 24, y, 172, WLH, item.name)
  106.     end
  107.   end
  108. end

  109. #==============================================================================
  110. # 本脚本来自www.66RPG.com,使用和转载请保留此信息
  111. #==============================================================================
复制代码

点评

会了,原来要把优先级改成 与人物同层,谢谢  发表于 2012-1-3 18:07
回复

使用道具 举报

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

本版积分规则

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

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

GMT+8, 2025-7-18 06:12

Powered by Discuz! X3.1

© 2001-2013 Comsenz Inc.

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