mirror of
https://github.com/infinitefusion/infinitefusion-e18.git
synced 2025-12-09 14:14:59 +00:00
release 6.2
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user