moonlight & morning sun field moves + fishing items

This commit is contained in:
infinitefusion
2022-04-23 18:22:42 -04:00
parent 2982a07b7e
commit 92e950d157
24 changed files with 91 additions and 379 deletions

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@@ -42,6 +42,7 @@ def pbFishingEnd
end
def pbFishing(hasEncounter,rodType=1)
autohook= Settings::FISHING_AUTO_HOOK || $game_switches[FISHING_AUTOHOOK_SWITCH]
speedup = ($Trainer.first_pokemon && [:STICKYHOLD, :SUCTIONCUPS].include?($Trainer.first_pokemon.ability_id))
biteChance = 20+(25*rodType) # 45, 70, 95
biteChance *= 1.5 if speedup # 67.5, 100, 100
@@ -70,9 +71,30 @@ def pbFishing(hasEncounter,rodType=1)
pbMessageDisplay(msgWindow,_INTL("The Pokémon got away..."))
break
end
if Settings::FISHING_AUTO_HOOK || rand(100) < hookChance
itemChance = rand((rodType)*4)
if itemChance<=1
#ITEM
items = [:PEARL,
:OLDBOOT,
:OLDBOOT,
:OLDBOOT,
:OLDBOOT,
:WATERGEM,
:PEARL,
:WATERGEM
]
Kernel.pbItemBall(items[rand(items.size)],1,nil,false)
Kernel.pbDisposeMessageWindow(msgWindow)
pbFishingEnd
pbMessageDisplay(msgWindow,_INTL("Landed a Pokémon!")) if !Settings::FISHING_AUTO_HOOK
$game_player.setDefaultCharName(nil,oldpattern)
return false
end
if autohook || rand(100) < hookChance
pbFishingEnd
pbMessageDisplay(msgWindow,_INTL("Landed a Pokémon!")) if !autohook
$game_player.setDefaultCharName(nil,oldpattern)
ret = true
break
@@ -111,6 +133,7 @@ end
# A Pokémon is biting, reflex test to reel it in
def pbWaitForInput(msgWindow,message,frames)
autohook= Settings::FISHING_AUTO_HOOK || $game_switches[FISHING_AUTOHOOK_SWITCH]
pbMessageDisplay(msgWindow,message,false)
numFrame = 0
twitchFrame = 0
@@ -131,7 +154,7 @@ def pbWaitForInput(msgWindow,message,frames)
$game_player.pattern = 0
return true
end
break if !Settings::FISHING_AUTO_HOOK && numFrame > frames
break if !autohook && numFrame > frames
numFrame += 1
end
return false

View File

@@ -154,7 +154,7 @@ end
def pbChooseMoveList(default = nil)
commands = []
GameData::Move.each { |i| commands.push([i.id_number, i.real_name, i.id]) }
return pbChooseList(commands, default, nil, -1)
return pbChooseList(commands, default, nil, 1)
end
def pbChooseMoveListForSpecies(species, defaultMoveID = nil)

View File

@@ -16,6 +16,8 @@ end
def pbWarpToMapFly
pbBetterRegionMap(0,true,true,false,nil,true)
$game_screen.weather(:None,0,0)
$game_map.refresh
end
def pbWarpToMap

View File

@@ -54,5 +54,5 @@ SINGLE_POKEMON_MODE_VAR=251
SINGLE_POKEMON_MODE_HEAD_SWITCH=791
SINGLE_POKEMON_MODE_BODY_SWITCH=792
SINGLE_POKEMON_MODE_RANDOM_SWITCH=793
FISHING_AUTOHOOK_SWITCH = 916
ODDKEYSTONE_NB_VARIABLE=252

View File

@@ -79,4 +79,58 @@ def pbRockSmashRandomEncounterDive
Kernel.pbItemBall(itemsList[i],1,nil,false)
end
end
end
############### MORNING SUN / MOONLIGHT
HiddenMoveHandlers::CanUseMove.add(:MORNINGSUN,proc{|move,pkmn|
if !GameData::MapMetadata.get($game_map.map_id).outdoor_map
Kernel.pbMessage(_INTL("Can't use that here."))
next false
end
next true
})
HiddenMoveHandlers::UseMove.add(:MORNINGSUN,proc{|move,pokemon|
Kernel.pbMessage(_INTL("{1} used {2}!",pokemon.name,GameData::Move.get(move).name))
pbHiddenMoveAnimation(pokemon)
pbFadeOutIn(99999){
pbSkipTime(9)
newTime = pbGetTimeNow.strftime("%I:%M %p")
Kernel.pbMessage(_INTL("{1} waited until morning...",$Trainer.name))
Kernel.pbMessage(_INTL("The time is now {1}",newTime))
$game_screen.weather(:None,0,0)
$game_map.refresh
}
next true
})
HiddenMoveHandlers::CanUseMove.add(:MOONLIGHT,proc{|move,pkmn|
if !GameData::MapMetadata.get($game_map.map_id).outdoor_map
Kernel.pbMessage(_INTL("Can't use that here."))
next false
end
next true
})
HiddenMoveHandlers::UseMove.add(:MOONLIGHT,proc{|move,pokemon|
Kernel.pbMessage(_INTL("{1} used {2}!",pokemon.name,GameData::Move.get(move).name))
pbHiddenMoveAnimation(pokemon)
pbFadeOutIn(99999){
pbSkipTime(21)
newTime = pbGetTimeNow.strftime("%I:%M %p")
Kernel.pbMessage(_INTL("{1} waited until night...",$Trainer.name))
Kernel.pbMessage(_INTL("The time is now {1}",newTime))
$game_screen.weather(:None,0,0)
$game_map.refresh
}
next true
})
def pbSkipTime(newTime)
currentTime = pbGetTimeNow.hour
#hoursToAdd = (24-currentTime + newTime)-24
hoursToAdd = newTime - currentTime
$game_variables[UnrealTime::EXTRA_SECONDS] += hoursToAdd*3600
end

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.