General tidying up

This commit is contained in:
Maruno17
2020-12-28 15:46:08 +00:00
parent d3d7222fd3
commit fb29c6b760
44 changed files with 1822 additions and 2650 deletions

View File

@@ -634,195 +634,6 @@ end
#===============================================================================
# Events
#===============================================================================
class Game_Event
def cooledDown?(seconds)
return true if expired?(seconds) && tsOff?("A")
self.need_refresh = true
return false
end
def cooledDownDays?(days)
return true if expiredDays?(days) && tsOff?("A")
self.need_refresh = true
return false
end
end
module InterpreterFieldMixin
# Used in boulder events. Allows an event to be pushed. To be used in
# a script event command.
def pbPushThisEvent
event = get_character(0)
oldx = event.x
oldy = event.y
# Apply strict version of passable, which makes impassable
# tiles that are passable only from certain directions
return if !event.passableStrict?(event.x,event.y,$game_player.direction)
case $game_player.direction
when 2 then event.move_down
when 4 then event.move_left
when 6 then event.move_right
when 8 then event.move_up
end
$PokemonMap.addMovedEvent(@event_id) if $PokemonMap
if oldx!=event.x || oldy!=event.y
$game_player.lock
loop do
Graphics.update
Input.update
pbUpdateSceneMap
break if !event.moving?
end
$game_player.unlock
end
end
def pbPushThisBoulder
pbPushThisEvent if $PokemonMap.strengthUsed
return true
end
def pbSmashThisEvent
event = get_character(0)
pbSmashEvent(event) if event
@index += 1
return true
end
def pbTrainerIntro(symbol)
return true if $DEBUG && !GameData::TrainerType.exists?(symbol)
tr_type = GameData::TrainerType.get(symbol).id
pbGlobalLock
pbPlayTrainerIntroME(tr_type)
return true
end
def pbTrainerEnd
pbGlobalUnlock
e = get_character(0)
e.erase_route if e
end
def pbParams
(@parameters) ? @parameters : @params
end
def pbGetPokemon(id)
return $Trainer.party[pbGet(id)]
end
def pbSetEventTime(*arg)
$PokemonGlobal.eventvars = {} if !$PokemonGlobal.eventvars
time = pbGetTimeNow
time = time.to_i
pbSetSelfSwitch(@event_id,"A",true)
$PokemonGlobal.eventvars[[@map_id,@event_id]]=time
for otherevt in arg
pbSetSelfSwitch(otherevt,"A",true)
$PokemonGlobal.eventvars[[@map_id,otherevt]]=time
end
end
def getVariable(*arg)
if arg.length==0
return nil if !$PokemonGlobal.eventvars
return $PokemonGlobal.eventvars[[@map_id,@event_id]]
else
return $game_variables[arg[0]]
end
end
def setVariable(*arg)
if arg.length==1
$PokemonGlobal.eventvars = {} if !$PokemonGlobal.eventvars
$PokemonGlobal.eventvars[[@map_id,@event_id]]=arg[0]
else
$game_variables[arg[0]] = arg[1]
$game_map.need_refresh = true
end
end
def tsOff?(c)
get_character(0).tsOff?(c)
end
def tsOn?(c)
get_character(0).tsOn?(c)
end
alias isTempSwitchOn? tsOn?
alias isTempSwitchOff? tsOff?
def setTempSwitchOn(c)
get_character(0).setTempSwitchOn(c)
end
def setTempSwitchOff(c)
get_character(0).setTempSwitchOff(c)
end
# Must use this approach to share the methods because the methods already
# defined in a class override those defined in an included module
CustomEventCommands=<<_END_
def command_352
scene = PokemonSave_Scene.new
screen = PokemonSaveScreen.new(scene)
screen.pbSaveScreen
return true
end
def command_125
value = operate_value(pbParams[0], pbParams[1], pbParams[2])
$Trainer.money += value
return true
end
def command_132
($PokemonGlobal.nextBattleBGM = pbParams[0]) ? pbParams[0].clone : nil
return true
end
def command_133
($PokemonGlobal.nextBattleME = pbParams[0]) ? pbParams[0].clone : nil
return true
end
def command_353
pbBGMFade(1.0)
pbBGSFade(1.0)
pbFadeOutIn { pbStartOver(true) }
end
def command_314
pbHealAll if pbParams[0]==0
return true
end
_END_
end
class Interpreter
include InterpreterFieldMixin
eval(InterpreterFieldMixin::CustomEventCommands)
end
class Game_Interpreter
include InterpreterFieldMixin
eval(InterpreterFieldMixin::CustomEventCommands)
end
#===============================================================================
# Audio playing
#===============================================================================

View File

@@ -1,12 +1,6 @@
#===============================================================================
# Battle start animation
#===============================================================================
class Game_Temp
attr_accessor :background_bitmap
end
def pbSceneStandby
$scene.disposeSpritesets if $scene && $scene.is_a?(Scene_Map)
GC.start