Project1
标题:
这个Bug是怎么回事……
[打印本页]
作者:
Wind2010
时间:
2010-12-4 22:45
标题:
这个Bug是怎么回事……
http://u.115.com/file/f03d3f1c9d
论坛貌似不能上传附件……
打开1号开关后按Z键可以进入隐身模式,移动时有幻影特效。当MP(屏幕最下方的一小条)为0时,恢复为正常模式。
在行走时由隐身模式恢复为正常模式,幻影会出现一个奇怪的现象——16个行走图全部显示
这是怎么回事?有人可以帮忙修复这个Bug么?0 0
作者:
一柳阴风
时间:
2010-12-4 23:00
本帖最后由 一柳阴风 于 2010-12-4 23:46 编辑
现在可以下了,貌似家里网络问题...
顺便问一下,这个脚本貌似是楼主自己写的吧
SORRY...我搞不定
作者:
Wind2010
时间:
2010-12-5 09:50
呃……没有人可以帮忙么0 0
没有人不是一个人!
作者:
fux2
时间:
2010-12-5 10:17
回复
Wind2010
的帖子
首先……你的代码写的好乱。
问题在if Input.press?(Input::A)的else里,立马关闭刷新会导致切割图片效果消失
作者:
烁灵
时间:
2010-12-5 15:23
本帖最后由 烁灵 于 2010-12-5 15:23 编辑
前辈试试这个能用不,替换你的幻影脚本
class Game_Player < Game_Character
def mirage(opacity)
if $game_switches[2] == true
$scene.spriteset.mirage(self, opacity)
end
end
alias update_naiyoudadangao update
def update
update_naiyoudadangao
if moving?#Input.dir8 != 0
mirage(120)
end
end
end
class Sprite_MirageCharacter < RPG::Sprite
attr_accessor :character
attr_reader :character_direction
def initialize(viewport, opacity, character = nil)
super(viewport)
@character = character
self.opacity = opacity
update
end
def update
super
if @tile_id != @character.tile_id or
@character_name != @character.character_name or
@character_hue != @character.character_hue
@tile_id = @character.tile_id
@character_name = @character.character_name
@character_hue = @character.character_hue
if @tile_id >= 384
self.bitmap = RPG::Cache.tile($game_map.tileset_name,
@tile_id, @character.character_hue)
self.src_rect.set(0, 0, 32, 32)
self.ox = 16
self.oy = 32
else
self.bitmap = RPG::Cache.character(@character.character_name,
@character.character_hue)
@cw = bitmap.width / 4
@ch = bitmap.height / 4
self.ox = @cw / 2
self.oy = @ch
self.x = @character.screen_x
self.y = @character.screen_y
end
end
self.visible = (not @character.transparent)
if @tile_id == 0 and !@t
sx = @character.pattern * @cw
sy = (@character.direction - 2) / 2 * @ch
self.src_rect.set(sx, sy, @cw, @ch)
@t = true
end
character_direction = @character.direction
if @character.direction == 8
self.z = @character.screen_z(@ch)
else
self.z = @character.screen_z(@ch) - 2
end
if $game_variables[1] == 0
self.color.set(50,50,255)
self.blend_type = 1
elsif $game_variables[1] == 1
self.color.set(255,50,50)
self.blend_type = 1
elsif $game_variables[1] == 2
self.color.set(50,255,50)
self.blend_type = 1
elsif $game_variables[1] == 3
self.color.set(50,255,255)
self.blend_type = 1
elsif $game_variables[1] == 4
self.color.set(255,255,255)
self.blend_type = 1
elsif $game_variables[1] == 5
self.color.set(0,0,170,120)
self.blend_type = 1
elsif $game_variables[1] == 6
self.blend_type = 0
elsif $game_variables[1] == 7
self.blend_type = 2
elsif $game_variables[1] == 8
self.blend_type = 1
elsif $game_variables[1] == 9
self.tone.set(-255,-255,-255,166)
self.blend_type = 0
else
self.color.set(255,255,50)
self.blend_type = 1
end
self.opacity -= 8
self.bush_depth = @character.bush_depth
if @character.animation_id != 0
animation = $data_animations[@character.animation_id]
animation(animation, true)
@character.animation_id = 0
end
end
end
class Spriteset_Map
alias initialize_naiyoudadangao initialize
def initialize
@mirage = {}
initialize_naiyoudadangao
end
def mirage(obj, opacity)
@mirage[obj] ||= []
smc = Sprite_MirageCharacter.new(@viewport1, opacity, obj)
@mirage[obj] << Mirage.new(obj.real_x, obj.real_y, smc)#(Sprite_MirageCharacter.new(@viewport1, opacity, obj))
end
alias update_naiyoudadangao update
def update
update_naiyoudadangao
###########################################################
if $game_switches[2]
for value in @mirage.values
for v in value
v.smc.x = (v.x - $game_map.display_x + 3) / 4 + 16
v.smc.y = (v.y - $game_map.display_y + 3) / 4 + 32
v.smc.update
if v.smc.opacity <= 0
v.smc.dispose
value.delete(v)
end
end
end
else
for value in @mirage.values
for v in value
v.smc.x = (v.x - $game_map.display_x + 3) / 4 + 16
v.smc.y = (v.y - $game_map.display_y + 3) / 4 + 32
v.smc.update
v.smc.dispose
value.delete(v)
end
end
end
###########################################################
end
end
class Scene_Map
attr_reader :spriteset
end
Mirage = Struct.new(:x, :y, :smc)
复制代码
欢迎光临 Project1 (https://rpg.blue/)
Powered by Discuz! X3.1