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

Project1

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

[已经过期] 关于地图显示血条的问题

 关闭 [复制链接]

Lv1.梦旅人

梦石
0
星屑
50
在线时间
68 小时
注册时间
2010-8-8
帖子
68
跳转到指定楼层
1
发表于 2011-8-2 10:57:40 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式
#==============================================================================
# 本脚本来自枪胜贤者游戏制作交流论坛,使用和转载请保留此信息     
#http://qsxzgame.5d6d.com
#==============================================================================
DT_SWITCH = 11
#有问题,找蚂蚁 redant修改
#_______________________________________________________________________________
# MOG_MPW HUD Elena V2.0           
#_______________________________________________________________________________
# By Moghunter
# http://www.atelier-rgss.com
#_______________________________________________________________________________
module MOG
#HUD Position.
STMAPX = 482 # X Pos
STMAPY = -16 # Y Pos
#Disable HUD Switch ID.  
STMAPVIS = 1
#Windowskin name.
STMAPSKIN = ""
#Window Opacity.
STMAPOPA = 0
end
$mogscript = {} if $mogscript == nil
$mogscript["mpstelen"] = true
###############
# Window_Base #
###############
class Window_Base < Window   

def draw_maphp2(actor, x, y)
text = RPG::Cache.picture("HP_Tx")   
cw = text.width
ch = text.height
src_rect = Rect.new(0, 0, cw, ch)
self.contents.blt( 0, 0, text, src_rect)

meter = RPG::Cache.picture("HP_Meter")   
cw = meter.width  * actor.hp / actor.maxhp
ch = meter.height
src_rect = Rect.new(0, 0, cw, ch)
self.contents.blt( 65 , 30, meter, src_rect)

end  

#def draw_mapsp2(actor, x, y)
#meter = RPG::Cache.picture("SP_Meter")   
#cw = meter.width  
#ch = meter.height *  actor.sp / actor.maxsp
#src_rect = Rect.new(0, 0,  cw, ch)
#self.contents.blt( 81, 2, meter,  src_rect)
#end

def draw_mapsp2(actor, x, y)
meter = RPG::Cache.picture("SP_Meter")   
cw = meter.width  
ch = 60 -meter.height *  actor.sp / actor.maxsp
src_rect = Rect.new(0, 0,  cw, ch)
self.contents.blt( 52, 16, meter,  src_rect)

end


def draw_mexp(actor, x, y)
actor = $game_party.actors[0]
if actor.next_exp != 0
rate = actor.now_exp.to_f / actor.next_exp
else
rate = 1
end
bitmap = RPG::Cache.picture("Exp_Meter")
#bitmap.z = 10
if actor.level < 99
cw = bitmap.width
else
cw = bitmap.width
end   
ch = bitmap.height - bitmap.height * rate
src_rect = Rect.new(0, 0, cw, ch)
self.contents.blt(60, 20, bitmap, src_rect)

end
def nada
face = RPG::Cache.picture("")
end  
def draw_heroface(actor,x,y) #"Graphics/system/menu/headp/" + actor.name + ".png"
face = RPG::Cache.picture("../system/menu/HeadP/"+actor.name+"【地图】.png" ) rescue nada
cw = face.width
ch = face.height
src_rect = Rect.new(0, 0, cw, ch)
self.contents.blt(0 , 0, face, src_rect)
end  

end
##############
# Game_Actor #
##############
class Game_Actor < Game_Battler
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
#####################
# Window_Status_Map #
#####################
class Window_Sthero < Window_Base
def initialize
super(0, 0, 310, 120)
self.contents = Bitmap.new(width - 32, height - 32)
self.windowskin = RPG::Cache.windowskin(MOG::STMAPSKIN)   
self.contents.font.bold = true
self.contents.font.size = 20
self.contents.font.name = "Georgia"
self.opacity = MOG::STMAPOPA

refresh
end  
def refresh
   if $game_switches[DT_SWITCH]
#actor = $game_party.actors[0]

#draw_maphp2(actor, 35, 35)
#draw_mapsp2(actor, - 40, 60)
#draw_mexp(actor, 100, 10)
#draw_heroface(actor, 0, 70) 游啊游
     self.contents.clear
actor = $game_party.actors[0]

draw_maphp2(actor, 35, 35)
draw_mapsp2(actor, -40, 60)
draw_mexp(actor, 100, 10)
draw_heroface(actor, 0, 70)
end

# draw_actor_statemap(actor, 200, 60, 70)
#draw_actor_levelmap(actor, 80, 10)   

end
end
###############
# Game_Player #
###############
class Game_Player < Game_Character
attr_accessor :wref
end
#############
# Scene_Map #
#############
class Scene_Map
alias mog11_main main
def main
@sthero = Window_Sthero.new
@sthero.x = MOG::STMAPX
@sthero.y = MOG::STMAPY
if $game_switches[MOG::STMAPVIS] == false
@sthero.visible = true  
else
@sthero.visible = false  
end  
mog11_main
@sthero.dispose
end
alias mog11_update update
def update
mog11_update
if $game_switches[MOG::STMAPVIS] == false
@sthero.visible = true  
else
@sthero.visible = false  
end
if $game_switches[DT_SWITCH]
    @sthero.visible = true
    if $game_player.wref == true
@sthero.refresh
$game_player.wref = false
end
    else
    @sthero.visible = false  
     $game_player.wref = false
  end
  
#if $game_switches[MOG::STMAPVIS] == false游啊游
#@sthero.visible = true  
#else
#@sthero.visible = false  
#end  
#if $game_player.wref == true
#@sthero.refresh
#$game_player.wref = false
#end
#else
# @sthero.visible = false  
  #$game_player.wref = false

#end

end
end  
##############
# Game_Party #
###############
class Game_Party
alias mog11_check_map_slip_damage check_map_slip_damage  
def check_map_slip_damage
for actor in @actors
if actor.hp > 0 and actor.slip_damage?
$game_player.wref = true
end
end
mog11_check_map_slip_damage  
end
end
###############
# Interpreter #
###############
class Interpreter
alias mog11_command_311 command_311
def command_311
mog11_command_311
$game_player.wref = true   
end   
alias mog11_command_312 command_312
def command_312
mog11_command_312
$game_player.wref = true   
end   
alias mog11_command_313 command_313
def command_313
mog11_command_313
$game_player.wref = true   
end   
alias mog11_command_314 command_314
def command_314
mog11_command_314
$game_player.wref = true   
end   
alias mog11_command_315 command_315
def command_315
mog11_command_315
$game_player.wref = true   
end   
end   
################
# Game_Battler #
################
class Game_Battler
alias mog11_attack_effect attack_effect
def attack_effect(attacker)
mog11_attack_effect(attacker)  
$game_player.wref = true
end
alias mog11_skill_effect skill_effect
def skill_effect(user, skill)
mog11_skill_effect(user, skill)
$game_player.wref = true  
end  
alias mog11_item_effect item_effect
def item_effect(item)
mog11_item_effect(item)
$game_player.wref = true  
end
alias mog11_add_state add_state
def add_state(state_id, force = false)
mog11_add_state(state_id, force = false)
$game_player.wref = true  
end
end
#==============================================================================
# 本脚本来自枪胜贤者游戏制作交流论坛,使用和转载请保留此信息     
#http://qsxzgame.5d6d.com
#==============================================================================



这个脚本在我11号开关开启的时候不能自动显示出来,要开启菜单画面再关闭然后才会显示出来,求助

点评

还有需要提问请自顶,有补充请回帖,已解决请认可0 0  发表于 2011-8-10 23:50

Lv1.梦旅人

梦石
0
星屑
50
在线时间
977 小时
注册时间
2011-5-13
帖子
292
2
发表于 2011-8-2 12:31:34 | 只看该作者
我只知道可能没refresh.
找到
  1.   @sthero.visible = true
复制代码
下面添加
  1. @sthero.refresh
复制代码
回复

使用道具 举报

Lv2.观梦者

铃铃塔的守护者

梦石
0
星屑
626
在线时间
961 小时
注册时间
2010-10-24
帖子
2768

贵宾

3
发表于 2011-8-2 12:48:37 | 只看该作者
貌似是因为这个在main中做的判定,所以只有切换$scene=Scene_Map.new
(也就是关掉菜单回到地图执行的操作)时才会判定开关问题。也就是说在地图上直接打开11号是不会有效果的..........
试试这么改:
  1. class Scene_Map
  2. alias mog11_main main
  3. def main
复制代码
改成:
  1. class Scene_Map
  2. alias mog11_main update
  3. def update
复制代码

魔法麻将独立游戏制作中,欢迎热情的测试员与UI设计师合作开发~
回复

使用道具 举报

Lv1.梦旅人

梦石
0
星屑
50
在线时间
68 小时
注册时间
2010-8-8
帖子
68
4
 楼主| 发表于 2011-8-11 15:18:55 | 只看该作者
px.凤翔九天 发表于 2011-8-2 12:48
貌似是因为这个在main中做的判定,所以只有切换$scene=Scene_Map.new
(也就是关掉菜单回到地图执行的操作) ...

改完之后测试游戏就出错了
回复

使用道具 举报

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

本版积分规则

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

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

GMT+8, 2025-2-19 03:50

Powered by Discuz! X3.1

© 2001-2013 Comsenz Inc.

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