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

Project1

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

请人帮下忙!把这个脚添加一个开关!

 关闭 [复制链接]

Lv1.梦旅人

梦石
0
星屑
50
在线时间
6 小时
注册时间
2006-12-18
帖子
118
跳转到指定楼层
1
发表于 2008-6-28 07:03:35 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式

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

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

x
class Window_Exp < Window_Base
def initialize
  super(0, 0, 160, 64)
  self.contents = Bitmap.new(width - 32, height - 32)
  refresh
end
def refresh
  self.contents.clear
    for i in 0...$game_party.actors.size
    x = 64
    y = i * 116
    actor = $game_party.actors[1]
     exp(actor,0,0)
  end
end

def exp(actor,x,y)
  self.contents.draw_text(100,360,32,32,"exp")
  self.contents.fill_rect(x,y,96,16,Color.new(255,255,255,255))
  self.contents.fill_rect(x+1,y+1,94,14,Color.new(0,0,0,255))
  w = 94*$game_actors[1].now_exp/$game_actors[1].next_exp
  self.contents.fill_rect(x+1,y+1,w,14,Color.new(50,255,50,255))
end
end
class Scene_Map
def initialize
  @o_exp = $game_actors[1].exp
end
alias old_main main
def main
  @exp = Window_Exp.new
  @exp.x = 140
  @exp.y = 360
  @exp.opacity = 0 # 255可见 0不可见
  old_main
  @exp.dispose
end
alias old_update update
def update
  if @o_exp != $game_actors[1].exp
    @o_exp = $game_actors[1].exp
    @exp.refresh
  else
    @exp.update
  end
  old_update
end
end
class Game_Actor
def now_exp
  return @exp - @exp_list[@level]
end
def next_exp
  return @exp_list[@level+1] > 0 ? @exp_list[@level+1] - @exp_list[@level] : 0
end
end


这个是在地图上显示EXP条的脚本!
谁能帮我把它加个开关
就是当X号开关开时这个EXP条才显示
否则不会显示

会的请帮下忙~谢谢!
版务信息:本贴由楼主自主结贴~
好象什么都忘记了!

Lv1.梦旅人

梦石
0
星屑
142
在线时间
264 小时
注册时间
2006-11-22
帖子
1057
2
发表于 2008-6-28 07:12:27 | 只看该作者
  1. def update
  2.   if @o_exp != $game_actors[1].exp
  3.     @o_exp = $game_actors[1].exp
  4.     @exp.refresh
  5.   else
  6.     @exp.update
  7.   end
  8.   if $game_switches[X]
  9.     @exp.visible = true
  10.   else
  11.     @exp.visible = false
  12.   end
  13.   old_update
  14. end
复制代码

取代掉:
def update
if @o_exp != $game_actors[1].exp
   @o_exp = $game_actors[1].exp
   @exp.refresh
else
   @exp.update
end
old_update
end

系统信息:本贴由楼主认可为正确答案,66RPG感谢您的热情解答~
回复 支持 反对

使用道具 举报

Lv1.梦旅人

梦石
0
星屑
50
在线时间
6 小时
注册时间
2006-12-18
帖子
118
3
 楼主| 发表于 2008-6-28 07:16:41 | 只看该作者
~弄好了!谢谢你~
好象什么都忘记了!
回复 支持 反对

使用道具 举报

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

本版积分规则

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

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

GMT+8, 2025-8-8 01:51

Powered by Discuz! X3.1

© 2001-2013 Comsenz Inc.

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