- Pokémon Essentials Version
- v16.2 ➖
This is a modification of the Fishing system to add in Consecutive Fishing to v16.2.
Consecutive fishing just allows you to get a slightly higher chance of getting a shiny pokemon if you manage to chain hooking pokemon (not battle/catch, just hook it). The default maximum streak is 20, meaning 40 more attempts at getting a shiny pokemon, but you can change that with the constant FISHINGMAXSTREAK. It also increases the chance of a bite if your bobber is surrounded by impassible tiles.
Consecutive fishing just allows you to get a slightly higher chance of getting a shiny pokemon if you manage to chain hooking pokemon (not battle/catch, just hook it). The default maximum streak is 20, meaning 40 more attempts at getting a shiny pokemon, but you can change that with the constant FISHINGMAXSTREAK. It also increases the chance of a bite if your bobber is surrounded by impassible tiles.
Lines with #edit are newly added. Methods and classes with edit are completely new. Just makes it easier to add if you don't have a clean v16.2, or want to port it or whatever.
Code:
class PokemonTemp #edit
attr_accessor :fishingSpot
attr_accessor :fishingStreak
end
FISHINGMAXSTREAK = 20 #edit
def pbFishing(hasencounter,rodtype=1)
speedup=($Trainer.firstParty && !$Trainer.firstParty.isEgg? &&
(isConst?($Trainer.firstParty.ability,PBAbilities,:STICKYHOLD) ||
isConst?($Trainer.firstParty.ability,PBAbilities,:SUCTIONCUPS)))
bitechance=20+(25*rodtype) # 45, 70, 95
bitechance*=1.00+(0.33*checkBordering) #edit (I don't have the exact numbers)
bitechance=100 if checkBordering == 3 #edit
bitechance*=1.5 if speedup
hookchance=100
oldpattern=$game_player.fullPattern
currentSpot=[$game_map.map_id,$game_player.x,$game_player.y,$game_player.direction] #edit
if !$PokemonTemp.fishingSpot || $PokemonTemp.fishingSpot != currentSpot #edit
$PokemonTemp.fishingSpot=currentSpot #edit
$PokemonTemp.fishingStreak=0 #edit
end #edit
pbFishingBegin
msgwindow=Kernel.pbCreateMessageWindow
loop do
time=2+rand(10)
time=[time,2+rand(10)].min if speedup
message=""
time.times do
message+=". "
end
if pbWaitMessage(msgwindow,time)
pbFishingEnd
$game_player.setDefaultCharName(nil,oldpattern)
Kernel.pbMessageDisplay(msgwindow,_INTL("Not even a nibble..."))
Kernel.pbDisposeMessageWindow(msgwindow)
$PokemonTemp.fishingStreak=0 #edit
return false
end
if (rand(100)<bitechance) && hasencounter
frames=rand(21)+20
if !pbWaitForInput(msgwindow,message+_INTL("\r\nOh! A bite!"),frames)
pbFishingEnd
$game_player.setDefaultCharName(nil,oldpattern)
Kernel.pbMessageDisplay(msgwindow,_INTL("The Pokémon got away..."))
Kernel.pbDisposeMessageWindow(msgwindow)
$PokemonTemp.fishingStreak=0 #edit
return false
end
if rand(100)<hookchance || FISHINGAUTOHOOK
Kernel.pbMessageDisplay(msgwindow,_INTL("Landed a Pokémon!"))
Kernel.pbDisposeMessageWindow(msgwindow)
pbFishingEnd
$game_player.setDefaultCharName(nil,oldpattern)
$PokemonTemp.fishingStreak+=1 #edit
$PokemonTemp.fishingStreak=[$PokemonTemp.fishingStreak,FISHINGMAXSTREAK].max #edit
return true
end
# bitechance+=15
# hookchance+=15
else
pbFishingEnd
$game_player.setDefaultCharName(nil,oldpattern)
Kernel.pbMessageDisplay(msgwindow,_INTL("Not even a nibble..."))
Kernel.pbDisposeMessageWindow(msgwindow)
$PokemonTemp.fishingStreak=0 #edit
return false
end
end
Kernel.pbDisposeMessageWindow(msgwindow)
return false
end
def checkBordering # of the bobber #edit
p=$game_player
ret=0
case p.direction
when 2 # down
ret+=1 if !p.passable?(p.x,p.y+1,4)
ret+=1 if !p.passable?(p.x,p.y+1,6)
ret+=1 if !p.passable?(p.x,p.y+1,8)
when 4 # left
ret+=1 if !p.passable?(p.x-1,p.y,2)
ret+=1 if !p.passable?(p.x-1,p.y,6)
ret+=1 if !p.passable?(p.x-1,p.y,8)
when 6 # right
ret+=1 if !p.passable?(p.x+1,p.y,2)
ret+=1 if !p.passable?(p.x+1,p.y,4)
ret+=1 if !p.passable?(p.x+1,p.y,8)
when 8 # up
ret+=1 if !p.passable?(p.x,p.y-1,2)
ret+=1 if !p.passable?(p.x,p.y-1,4)
ret+=1 if !p.passable?(p.x,p.y-1,6)
end
return ret
end
alias _fishing_pbGenerateWildPokemon pbGenerateWildPokemon #edit
def pbGenerateWildPokemon(*args) # Do the generating #edit
wildpoke=_fishing_pbGenerateWildPokemon(*args)
if $PokemonTemp.fishingStreak && $PokemonTemp.fishingStreak>0
for i in 0...(2*$PokemonTemp.fishingStreak)
break if wildpoke.isShiny?
wildpoke.personalID=rand(65536)|(rand(65536)<<16)
end
end
return wildpoke
end
- Credits
- Just me. Please credit a tiny bit, this was the worst thing to test ever, since it's random and rigging the RNG would defeat the purpose. The code was 30 minutes tops, but I spent the next 3 hours running streaks. Not fun.
I saw my first legit shiny though, so that's a plus.