赞 | 19 |
VIP | 0 |
好人卡 | 0 |
积分 | 1 |
经验 | 7757 |
最后登录 | 2017-9-25 |
在线时间 | 68 小时 |
Lv1.梦旅人
- 梦石
- 0
- 星屑
- 50
- 在线时间
- 68 小时
- 注册时间
- 2011-11-12
- 帖子
- 92
|
2楼
楼主 |
发表于 2017-8-6 17:45:31
|
只看该作者
本帖最后由 Nil2011 于 2017-8-6 17:46 编辑
这个是吗??
。#==============================================================================
#
# ¥ Yami Script Ace - Simple Anti-lag Event
# -- Last Updated: 2012.01.07
# -- Level: Easy
# -- Requires: none
#
#==============================================================================
$imported = {} if $imported.nil?
$imported["YSA-AntiLagEvent"] = true
#==============================================================================
# ¥ Updates
# =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
# 2012.01.07 - Started and Finished script.
#
#==============================================================================
# ¥ Instructions
# =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
# To install this script, open up your script editor and copy/paste this script
# to an open slot below ¥ Materials/‘fÞ but above ¥ Main. Remember to save.
#
# -----------------------------------------------------------------------------
# Event's Name.
# -----------------------------------------------------------------------------
# Name: Effect:
# ALWAYS_UPDATE_NAME - This event always be updated, although it's out of screen.
# NEVER_UPDATE_NAME - This event never be updated.
#
#==============================================================================
# ¥ Compatibility
# =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
# This script is made strictly for RPG Maker VX Ace. It is highly unlikely that
# it will run with RPG Maker VX without adjusting.
#
#==============================================================================
module YSA
module ANTI_LAG
ALWAYS_UPDATE_NAME = "UPDATE_A" # Use for special event, which always need update sprite.
NEVER_UPDATE_NAME = "UPDATE_N" # Use for decorate event.
UPDATE_OUT_OF_SCREEN = false # If set this to true, all event on the map will be updated, except with NEVER_UPDATE_NAME
TILE_BUFFER = 1 # The smaller, the better. 1 or 2 is the best.
end
end
#==============================================================================
# ¥ Editting anything past this point may potentially result in causing
# computer damage, incontinence, explosion of user's head, coma, death, and/or
# halitosis so edit at your own risk.
#==============================================================================
#==============================================================================
# ¡ Game_Character
#==============================================================================
class Game_Character < Game_CharacterBase
#--------------------------------------------------------------------------
# new method: event?
#--------------------------------------------------------------------------
def event?
return false
end
end # Game_Character
#==============================================================================
# ¡ Game_Event
#==============================================================================
class Game_Event < Game_Character
#--------------------------------------------------------------------------
# new method: event?
#--------------------------------------------------------------------------
def event?
return true
end
#--------------------------------------------------------------------------
# new method: event
#--------------------------------------------------------------------------
def event
return @event
end
end # Game_Event
#==============================================================================
# ¡ Game_Map
#==============================================================================
class Game_Map
#--------------------------------------------------------------------------
# overwrite method: update_events
#--------------------------------------------------------------------------
def update_events
@events.each_value {|event|
event.update if event.event.name != YSA::ANTI_LAG::NEVER_UPDATE_NAME
}
@common_events.each {|event| event.update }
end
end # Game_Map
#==============================================================================
# ¡ Sprite_Character
#==============================================================================
class Sprite_Character < Sprite_Base
#--------------------------------------------------------------------------
# new method: need_update?
#--------------------------------------------------------------------------
def need_update?
return true if character.event? && character.event.name == YSA::ANTI_LAG::ALWAYS_UPDATE_NAME
if YSA::ANTI_LAG::UPDATE_OUT_OF_SCREEN == false
buffer_x = character.screen_x + YSA::ANTI_LAG::TILE_BUFFER * 32
buffer_y = character.screen_y + YSA::ANTI_LAG::TILE_BUFFER * 32
check = (buffer_x >= 0 && buffer_x <= (Graphics.width + YSA::ANTI_LAG::TILE_BUFFER * 32 * 4)) && (buffer_y >= 0 && buffer_y <= (Graphics.height + YSA::ANTI_LAG::TILE_BUFFER * 32 * 4))
return check if character.event?
end
return true
end
end # Sprite_Character
#==============================================================================
# ¡ Spriteset_Map
#==============================================================================
class Spriteset_Map
#--------------------------------------------------------------------------
# overwrite method: update_characters
#--------------------------------------------------------------------------
def update_characters
refresh_characters if @map_id != $game_map.map_id
@character_sprites.each {|sprite|
if sprite.need_update?
sprite.update
else
sprite.visible = false
end
}
end
end # Spriteset_Map
#==============================================================================
#
# ¥ End of File
#
#============================================================================== |
|