bugfixes 1.6, battle lag, event crashes, mt. silver event (wip)

This commit is contained in:
infinitefusion
2021-10-03 14:01:09 -04:00
parent b51c2afcae
commit 26cc4c20ce
38 changed files with 103 additions and 11 deletions

View File

@@ -97,18 +97,26 @@ class AnimatedBitmap
@bitmap.bitmap = new_bitmap
end
def mirror
for x in 0..@bitmap.bitmap.width / 2
for y in 0..@bitmap.bitmap.height - 2
temp = @bitmap.bitmap.get_pixel(x, y)
newPix = @bitmap.bitmap.get_pixel((@bitmap.bitmap.width - x), y)
# def mirror
# for x in 0..@bitmap.bitmap.width / 2
# for y in 0..@bitmap.bitmap.height - 2
# temp = @bitmap.bitmap.get_pixel(x, y)
# newPix = @bitmap.bitmap.get_pixel((@bitmap.bitmap.width - x), y)
#
# @bitmap.bitmap.set_pixel(x, y, newPix)
# @bitmap.bitmap.set_pixel((@bitmap.bitmap.width - x), y, temp)
# end
# end
# end
@bitmap.bitmap.set_pixel(x, y, newPix)
@bitmap.bitmap.set_pixel((@bitmap.bitmap.width - x), y, temp)
end
end
def mirror
@bitmap.bitmap
end
end
#===============================================================================

View File

@@ -322,6 +322,7 @@ class PokeBattle_Scene
back = !@battle.opposes?(idxBattler)
shadowSprite.setPokemonBitmap(pkmn)
pkmnSprite.setPokemonBitmap(pkmn,back)
pkmnSprite.mirror=true if back
# Set visibility of battler's shadow
shadowSprite.visible = pkmn.species_data.shows_shadow? if shadowSprite && !back
end

View File

@@ -612,7 +612,7 @@ end
def pbRockSmash
move = :ROCKSMASH
movefinder = $Trainer.get_pokemon_with_move(move)
if !pbCheckHiddenMoveBadge(Settings::BADGE_FOR_ROCKSMASH, false) || (!$DEBUG && !movefinder)
if !pbCheckHiddenMoveBadge(Settings::BADGE_FOR_ROCKSMASH, false) || (!$DEBUG && !movefinder) || $PokemonBag.pbQuantity(:PICKAXE)>0
pbMessage(_INTL("It's a rugged rock, but a Pokémon may be able to smash it."))
return false
end

View File

@@ -0,0 +1,82 @@
#===============================================================================
# Rock Smash
#===============================================================================
def pbRockSmashRandomEncounter
if rand(100)<30
if pbEncounter(:RockSmash)
return
else
pbDefaultRockSmashEncounter(5,15)
end
else
rockSmashItem(false)
end
end
def pbDefaultRockSmashEncounter(minLevel,maxLevel)
level =rand((maxLevel-minLevel).abs)+minLevel
pbWildBattle(:GEODUDE,level)
return true
end
#FOR ROCK TUNNEL AND CERULEAN CAVE (+diamond)
def pbRockSmashRandomEncounterSpecial
if rand(100)<35
pbEncounter(:RockSmash)
else
rockSmashItem(true)
end
end
def getRockSmashItemList(inclRareItems)
basicItems = [:ROCKGEM, :GROUNDGEM,:STEELGEM,
:HARDSTONE,:HARDSTONE,:HARDSTONE,:ROCKGEM,
:SMOOTHROCK,:STARDUST,:HEARTSCALE,:HEARTSCALE,
:HEARTSCALE,:SOFTSAND,:HEARTSCALE,:RAREBONE]
rareItems = [:RAREBONE,:STARDUST,:ETHER,
:REVIVE,:NUGGET,:DIAMOND]
fossilItems = [:ROOTFOSSIL,:CLAWFOSSIL,:DOMEFOSSIL,:HELIXFOSSIL,
:SKULLFOSSIL,:ARMORFOSSIL]
# Kernel.pbMessage(inclRareItems.to_s)
itemsList = inclRareItems ? basicItems + basicItems + rareItems : basicItems
#beaten league
if $game_switches[12]
itemsList += fossilItems
end
return itemsList
end
def rockSmashItem(isDark=false)
chance = 50
if rand(100)< chance
itemsList = getRockSmashItemList(isDark)
i = rand(itemsList.length)
Kernel.pbItemBall(itemsList[i],1,nil,false)
end
end
#Used in underwater maps
def pbRockSmashRandomEncounterDive
if rand(100)<25
pbEncounter(:RockSmash)
else
if rand(100)<20
itemsList = [:WATERGEM,:STEELGEM,
:HEARTSCALE,:HEARTSCALE,:HARDSTONE,:ROCKGEM,
:SMOOTHROCK,:WATERSTONE,:PEARL,:HEARTSCALE,
:HEARTSCALE,:HEARTSCALE,:SHOALSHELL,:BIGPEARL]
i = rand(itemsList.length)
Kernel.pbItemBall(itemsList[i],1,nil,false)
end
end
end