mirror of
https://github.com/infinitefusion/infinitefusion-e18.git
synced 2026-01-24 07:16:00 +00:00
release 6.2
This commit is contained in:
@@ -306,18 +306,36 @@ Events.onMapChange += proc { |_sender, e|
|
||||
$game_screen.weather(new_weather[0], 9, 0) if rand(100) < new_weather[1]
|
||||
}
|
||||
|
||||
Events.onMapChange += proc { |_sender, e|
|
||||
next if !Settings::SEVII_ROAMING.include?($game_map.map_id)
|
||||
new_map_ID = e[0]
|
||||
new_map_metadata = GameData::MapMetadata.try_get(new_map_ID)
|
||||
next if new_map_metadata && new_map_metadata.weather
|
||||
feebas_map = $PokemonGlobal.roamPosition[4]
|
||||
if $game_map.map_id == feebas_map
|
||||
$game_screen.weather(:Rain, 4, 0)
|
||||
else
|
||||
$game_screen.weather(:None, 0, 0)
|
||||
end
|
||||
}
|
||||
# Events.onMapChange += proc { |_sender, e|
|
||||
# next if !Settings::SEVII_ROAMING.include?($game_map.map_id)
|
||||
# new_map_ID = e[0]
|
||||
# new_map_metadata = GameData::MapMetadata.try_get(new_map_ID)
|
||||
# next if new_map_metadata && new_map_metadata.weather
|
||||
# feebas_map = $PokemonGlobal.roamPosition[4]
|
||||
# if $game_map.map_id == feebas_map
|
||||
# $game_screen.weather(:Rain, 4, 0)
|
||||
# else
|
||||
# $game_screen.weather(:None, 0, 0)
|
||||
# end
|
||||
# }
|
||||
|
||||
# [:ENTEI, 50, 350, 1, "Legendary Birds",ROAMING_AREAS,:Sunny],
|
||||
# Events.onMapChange += proc { |_sender, e|
|
||||
# next if $game_screen.weather_type != :None
|
||||
# currently_roaming = $PokemonGlobal.roamPosition.keys
|
||||
# currently_roaming.each do |roamer_id|
|
||||
# roamerOnCurrentMap = $PokemonGlobal.roamPosition[roamer_id] == $game_map.map_id
|
||||
# echoln _INTL("{1} is on map {2}",roamer_id,$game_map.map_id)
|
||||
# echoln $PokemonGlobal.roamPokemon
|
||||
# if roamerOnCurrentMap
|
||||
# next if $PokemonGlobal.roamPokemonCaught[roamer_id]
|
||||
# weather = Settings::ROAMING_SPECIES[roamer_id][6]
|
||||
# $game_screen.weather(weather, 4, 0)
|
||||
# next
|
||||
# end
|
||||
#
|
||||
# end
|
||||
# }
|
||||
|
||||
Events.onMapSceneChange += proc { |_sender, e|
|
||||
scene = e[0]
|
||||
|
||||
@@ -153,6 +153,8 @@ def pbPrepareBattle(battle)
|
||||
battle.defaultWeather = :Sandstorm
|
||||
when :Sun
|
||||
battle.defaultWeather = :Sun
|
||||
when :StrongWinds
|
||||
battle.defaultWeather = :StrongWinds
|
||||
end
|
||||
else
|
||||
battle.defaultWeather = battleRules["defaultWeather"]
|
||||
|
||||
@@ -42,12 +42,12 @@ def pbBattleAnimation(bgm=nil,battletype=0,foe=nil)
|
||||
if $PokemonGlobal.surfing || $PokemonGlobal.diving
|
||||
location = 3
|
||||
elsif $PokemonTemp.encounterType &&
|
||||
GameData::EncounterType.get($PokemonTemp.encounterType).type == :fishing
|
||||
GameData::EncounterType.get($PokemonTemp.encounterType).type == :fishing
|
||||
location = 3
|
||||
elsif $PokemonEncounters.has_cave_encounters?
|
||||
location = 2
|
||||
elsif !GameData::MapMetadata.exists?($game_map.map_id) ||
|
||||
!GameData::MapMetadata.get($game_map.map_id).outdoor_map
|
||||
!GameData::MapMetadata.get($game_map.map_id).outdoor_map
|
||||
location = 1
|
||||
end
|
||||
anim = ""
|
||||
@@ -136,10 +136,16 @@ def pbBattleAnimationOverride(viewport,battletype=0,foe=nil)
|
||||
##### Tweaked by Maruno #####
|
||||
if (battletype==1 || battletype==3) && foe.length==1 # Against single trainer
|
||||
tr_type = foe[0].trainer_type
|
||||
tr_number= GameData::TrainerType.get(tr_type).id_number
|
||||
|
||||
|
||||
if tr_type
|
||||
tbargraphic = sprintf("vsBar_%s", tr_type.to_s) rescue nil
|
||||
tgraphic = sprintf("vsTrainer_%s", tr_type.to_s) rescue nil
|
||||
if pbResolveBitmap("Graphics/Transitions/" + tbargraphic) && pbResolveBitmap("Graphics/Transitions/" + tgraphic)
|
||||
#tgraphic = sprintf("vsTrainer_%s", tr_type.to_s) rescue nil
|
||||
tgraphic = sprintf("trainer%03d", tr_number) rescue nil
|
||||
|
||||
echoln tgraphic
|
||||
if pbResolveBitmap("Graphics/Transitions/" + tbargraphic) && pbResolveBitmap("Graphics/Characters/" + tgraphic)
|
||||
player_tr_type = $Trainer.trainer_type
|
||||
outfit = $Trainer.outfit
|
||||
# Set up
|
||||
@@ -156,11 +162,15 @@ def pbBattleAnimationOverride(viewport,battletype=0,foe=nil)
|
||||
overlay = Sprite.new(viewport)
|
||||
overlay.bitmap = Bitmap.new(Graphics.width,Graphics.height)
|
||||
pbSetSystemFont(overlay.bitmap)
|
||||
pbargraphic = sprintf("vsBar_%s_%d", player_tr_type.to_s, outfit) rescue nil
|
||||
#pbargraphic = sprintf("vsBar_%s_%d", player_tr_type.to_s, outfit) rescue nil
|
||||
pbargraphic = sprintf("vsBar_%s", player_tr_type.to_s) rescue nil
|
||||
if !pbResolveBitmap("Graphics/Transitions/" + pbargraphic)
|
||||
pbargraphic = sprintf("vsBar_%s", player_tr_type.to_s) rescue nil
|
||||
end
|
||||
# xoffset = ((Graphics.width/2)/10)*10
|
||||
xoffset = ((Graphics.width/2)/10)*10
|
||||
#xoffset = 0#((Graphics.width/2)/10)*10
|
||||
|
||||
bar1 = Sprite.new(viewplayer)
|
||||
bar1.bitmap = RPG::Cache.transition(pbargraphic)
|
||||
bar1.x = -xoffset
|
||||
@@ -179,6 +189,7 @@ def pbBattleAnimationOverride(viewport,battletype=0,foe=nil)
|
||||
flash.opacity = 0
|
||||
# Animate bars sliding in from either side
|
||||
slideInTime = (Graphics.frame_rate*0.25).floor
|
||||
|
||||
for i in 0...slideInTime
|
||||
bar1.x = xoffset*(i+1-slideInTime)/slideInTime
|
||||
bar2.x = xoffset*(slideInTime-i-1)/slideInTime
|
||||
@@ -195,17 +206,38 @@ def pbBattleAnimationOverride(viewport,battletype=0,foe=nil)
|
||||
bar1.bitmap = RPG::Cache.transition(pbargraphic)
|
||||
bar2 = AnimatedPlane.new(viewopp)
|
||||
bar2.bitmap = RPG::Cache.transition(tbargraphic)
|
||||
pgraphic = sprintf("vsTrainer_%s_%d", player_tr_type.to_s, outfit) rescue nil
|
||||
if !pbResolveBitmap("Graphics/Transitions/" + pgraphic)
|
||||
pgraphic = sprintf("vsTrainer_%s", player_tr_type.to_s) rescue nil
|
||||
end
|
||||
#pgraphic = sprintf("vsTrainer_%s_%d", player_tr_type.to_s, outfit) rescue nil
|
||||
#pgraphic = sprintf("vsTrainer_%s", player_tr_type.to_s) rescue nil
|
||||
|
||||
# pgraphic = generate_front_trainer_sprite_bitmap()#sprintf("trainer%03d", tr_number) rescue nil
|
||||
#
|
||||
# #if !pbResolveBitmap("Graphics/Transitions/" + pgraphic)
|
||||
# if !pbResolveBitmap("Graphics/Characters/" + pgraphic)
|
||||
# pgraphic = sprintf("vsTrainer_%s", player_tr_type.to_s) rescue nil
|
||||
# end
|
||||
player = Sprite.new(viewplayer)
|
||||
player.bitmap = RPG::Cache.transition(pgraphic)
|
||||
player.x = -xoffset
|
||||
#player.bitmap = RPG::Cache.transition(tgraphic)
|
||||
#
|
||||
playerSpriteWrapper = generate_front_trainer_sprite_bitmap()
|
||||
player.bitmap = playerSpriteWrapper.bitmap # RPG::Cache.load_bitmap("Graphics/Characters/", pgraphic) #RPG::Cache.transition(pgraphic)
|
||||
player.x = -250
|
||||
player.y = -30
|
||||
player.zoom_x = 2
|
||||
player.zoom_y = 2
|
||||
|
||||
player.mirror =true
|
||||
player_center_offset=-20
|
||||
|
||||
trainer = Sprite.new(viewopp)
|
||||
trainer.bitmap = RPG::Cache.transition(tgraphic)
|
||||
trainer.x = xoffset
|
||||
#trainer.bitmap = RPG::Cache.transition(tgraphic)
|
||||
trainer.bitmap =RPG::Cache.load_bitmap("Graphics/Characters/", tgraphic) #RPG::Cache.transition(pgraphic)
|
||||
trainer.x = xoffset+150
|
||||
trainer.tone = Tone.new(-255,-255,-255)
|
||||
trainer.zoom_x = 2
|
||||
trainer.zoom_y = 2
|
||||
trainer.y = -10
|
||||
trainer_center_offset=0
|
||||
|
||||
# Dim the flash and make the trainer sprites appear, while animating bars
|
||||
animTime = (Graphics.frame_rate*1.2).floor
|
||||
for i in 0...animTime
|
||||
@@ -213,13 +245,20 @@ def pbBattleAnimationOverride(viewport,battletype=0,foe=nil)
|
||||
bar1.ox -= 32*20/Graphics.frame_rate
|
||||
bar2.ox += 32*20/Graphics.frame_rate
|
||||
if i>=animTime/2 && i<slideInTime+animTime/2
|
||||
player.x = xoffset*(i+1-slideInTime-animTime/2)/slideInTime
|
||||
trainer.x = xoffset*(slideInTime-i-1+animTime/2)/slideInTime
|
||||
player.x = (xoffset*(i+1-slideInTime-animTime/2)/slideInTime)+player_center_offset
|
||||
trainer.x = xoffset*(slideInTime-i-1+animTime/2)/slideInTime+trainer_center_offset
|
||||
end
|
||||
pbWait(1)
|
||||
end
|
||||
player.x = 0
|
||||
trainer.x = 0
|
||||
|
||||
|
||||
echoln "VS flash"
|
||||
#player.x = -150
|
||||
#player.y=-75
|
||||
|
||||
#trainer.x = -20
|
||||
# trainer.y = -75
|
||||
|
||||
# Make whole screen flash white again
|
||||
flash.opacity = 255
|
||||
pbSEPlay("Vs sword")
|
||||
@@ -228,10 +267,10 @@ def pbBattleAnimationOverride(viewport,battletype=0,foe=nil)
|
||||
trainer.tone = Tone.new(0,0,0)
|
||||
trainername = foe[0].name
|
||||
textpos = [
|
||||
[$Trainer.name,Graphics.width/4,(Graphics.height/1.5)+4,2,
|
||||
Color.new(248,248,248),Color.new(12*6,12*6,12*6)],
|
||||
[trainername,(Graphics.width/4)+(Graphics.width/2),(Graphics.height/1.5)+4,2,
|
||||
Color.new(248,248,248),Color.new(12*6,12*6,12*6)]
|
||||
[$Trainer.name,Graphics.width/4,(Graphics.height/1.5)+4,2,
|
||||
Color.new(248,248,248),Color.new(12*6,12*6,12*6)],
|
||||
[trainername,(Graphics.width/4)+(Graphics.width/2),(Graphics.height/1.5)+4,2,
|
||||
Color.new(248,248,248),Color.new(12*6,12*6,12*6)]
|
||||
]
|
||||
pbDrawTextPositions(overlay.bitmap,textpos)
|
||||
# Fade out flash, shudder Vs logo and expand it, and then fade to black
|
||||
|
||||
@@ -32,6 +32,16 @@ def pbRoamingAreas(idxRoamer)
|
||||
return Settings::ROAMING_AREAS
|
||||
end
|
||||
|
||||
def getRoamingMap(roamingPokemon)
|
||||
possible_roamers = {}
|
||||
for roamer in Settings::ROAMING_SPECIES
|
||||
name = roamer[0]
|
||||
id =
|
||||
possible_roamers[name] = id
|
||||
|
||||
end
|
||||
end
|
||||
|
||||
# Puts a roamer in a completely random map available to it.
|
||||
def pbRandomRoam(index)
|
||||
return if !$PokemonGlobal.roamPosition
|
||||
@@ -55,6 +65,23 @@ def pbRoamPokemon
|
||||
for i in 0...Settings::ROAMING_SPECIES.length
|
||||
pbRoamPokemonOne(i)
|
||||
end
|
||||
|
||||
applyRoamWeather()
|
||||
end
|
||||
|
||||
|
||||
def applyRoamWeather()
|
||||
return if $game_screen.weather_type != :None
|
||||
currently_roaming = $PokemonGlobal.roamPosition.keys
|
||||
currently_roaming.each do |roamer_id|
|
||||
roamerOnCurrentMap = $PokemonGlobal.roamPosition[roamer_id] == $game_map.map_id
|
||||
if roamerOnCurrentMap
|
||||
return if $PokemonGlobal.roamPokemonCaught[roamer_id]
|
||||
weather = Settings::ROAMING_SPECIES[roamer_id][6]
|
||||
$game_screen.weather(weather, 4, 0)
|
||||
return
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
# Makes a single roaming Pokémon roam to another map. Doesn't roam if it isn't
|
||||
|
||||
@@ -338,6 +338,14 @@ def pbDive
|
||||
end
|
||||
if pbConfirmMessage(_INTL("The sea is deep here. Would you like to use Dive?"))
|
||||
speciesname = (movefinder) ? movefinder.name : $Trainer.name
|
||||
if movefinder
|
||||
$Trainer.surfing_pokemon= getSpecies(movefinder.species)
|
||||
|
||||
echoln movefinder.species
|
||||
echoln getSpecies(movefinder.species)
|
||||
else
|
||||
$Trainer.surfing_pokemon=nil
|
||||
end
|
||||
pbMessage(_INTL("{1} used {2}!", speciesname, GameData::Move.get(move).name))
|
||||
pbHiddenMoveAnimation(movefinder)
|
||||
pbFadeOutIn {
|
||||
@@ -349,6 +357,7 @@ def pbDive
|
||||
$PokemonGlobal.diving = true
|
||||
pbUpdateVehicle
|
||||
$scene.transfer_player(false)
|
||||
addWaterCausticsEffect()
|
||||
$game_map.autoplay
|
||||
$game_map.refresh
|
||||
}
|
||||
@@ -403,8 +412,10 @@ def pbTransferUnderwater(mapid, x, y, direction = $game_player.direction)
|
||||
$game_temp.player_new_direction = direction
|
||||
$PokemonGlobal.diving = true
|
||||
$PokemonGlobal.surfing = false
|
||||
pbUpdateVehicle
|
||||
$scene.transfer_player(false )
|
||||
addWaterCausticsEffect()
|
||||
|
||||
$scene.transfer_player(false)
|
||||
$game_map.autoplay
|
||||
$game_map.refresh
|
||||
}
|
||||
@@ -804,7 +815,8 @@ def pbSurf
|
||||
if $PokemonSystem.quicksurf == 1
|
||||
surfbgm = GameData::Metadata.get.surf_BGM
|
||||
pbCueBGM(surfbgm, 0.5) if surfbgm
|
||||
pbStartSurfing
|
||||
surfingPoke = movefinder.species if movefinder
|
||||
pbStartSurfing(surfingPoke)
|
||||
return true
|
||||
end
|
||||
if pbConfirmMessage(_INTL("The water is a deep blue...\nWould you like to surf on it?"))
|
||||
@@ -814,14 +826,21 @@ def pbSurf
|
||||
pbHiddenMoveAnimation(movefinder)
|
||||
surfbgm = GameData::Metadata.get.surf_BGM
|
||||
pbCueBGM(surfbgm, 0.5) if surfbgm && !Settings::MAPS_WITHOUT_SURF_MUSIC.include?($game_map.map_id)
|
||||
pbStartSurfing
|
||||
|
||||
surfingPoke = movefinder.species if movefinder
|
||||
pbStartSurfing(surfingPoke)
|
||||
return true
|
||||
end
|
||||
return false
|
||||
end
|
||||
|
||||
def pbStartSurfing
|
||||
def pbStartSurfing(speciesID=nil)
|
||||
pbCancelVehicles
|
||||
if speciesID
|
||||
$Trainer.surfing_pokemon=getSpecies(speciesID)
|
||||
else
|
||||
$Trainer.surfing_pokemon=nil
|
||||
end
|
||||
$PokemonEncounters.reset_step_count
|
||||
$PokemonGlobal.surfing = true
|
||||
pbUpdateVehicle
|
||||
@@ -949,7 +968,8 @@ HiddenMoveHandlers::UseMove.add(:SURF, proc { |move, pokemon|
|
||||
end
|
||||
surfbgm = GameData::Metadata.get.surf_BGM
|
||||
pbCueBGM(surfbgm, 0.5) if surfbgm
|
||||
pbStartSurfing
|
||||
surfingPoke = pokemon if pokemon
|
||||
pbStartSurfing(surfingPoke)
|
||||
next true
|
||||
})
|
||||
|
||||
|
||||
Reference in New Issue
Block a user