赞 | 0 |
VIP | 1 |
好人卡 | 28 |
积分 | 10 |
经验 | 59980 |
最后登录 | 2024-10-19 |
在线时间 | 1685 小时 |
Lv3.寻梦者
- 梦石
- 0
- 星屑
- 951
- 在线时间
- 1685 小时
- 注册时间
- 2009-7-25
- 帖子
- 534
|
本帖最后由 烁灵 于 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)
复制代码 |
评分
-
查看全部评分
|