diff --git a/Data/Actors.rxdata b/Data/Actors.rxdata index 41edc8e26..7967a5432 100644 Binary files a/Data/Actors.rxdata and b/Data/Actors.rxdata differ diff --git a/Data/Animations.rxdata b/Data/Animations.rxdata index 065a7e253..d940ad63a 100644 Binary files a/Data/Animations.rxdata and b/Data/Animations.rxdata differ diff --git a/Data/Armors.rxdata b/Data/Armors.rxdata index 901f2bb2b..2249bec14 100644 Binary files a/Data/Armors.rxdata and b/Data/Armors.rxdata differ diff --git a/Data/CommonEvents.rxdata b/Data/CommonEvents.rxdata index c6e152721..69752b6ed 100644 Binary files a/Data/CommonEvents.rxdata and b/Data/CommonEvents.rxdata differ diff --git a/Data/Enemies.rxdata b/Data/Enemies.rxdata index be622f513..004ee903d 100644 Binary files a/Data/Enemies.rxdata and b/Data/Enemies.rxdata differ diff --git a/Data/Items.rxdata b/Data/Items.rxdata index fe767fa0b..3e62ba6d2 100644 Binary files a/Data/Items.rxdata and b/Data/Items.rxdata differ diff --git a/Data/Map490.rxdata b/Data/Map490.rxdata index a09761c18..fd9ef4c93 100644 Binary files a/Data/Map490.rxdata and b/Data/Map490.rxdata differ diff --git a/Data/MapInfos.rxdata b/Data/MapInfos.rxdata index 261f21205..44c1cf574 100644 Binary files a/Data/MapInfos.rxdata and b/Data/MapInfos.rxdata differ diff --git a/Data/Scripts/001_Settings.rb b/Data/Scripts/001_Settings.rb index 5b10aadab..293f587c9 100644 --- a/Data/Scripts/001_Settings.rb +++ b/Data/Scripts/001_Settings.rb @@ -6,7 +6,12 @@ module Settings # The version of your game. It has to adhere to the MAJOR.MINOR.PATCH format. GAME_VERSION = '5.0.0' - GAME_VERSION_NUMBER = "5.0.11 - beta" + GAME_VERSION_NUMBER = "5.0.13 - beta" + + POKERADAR_LIGHT_ANIMATION_RED_ID = 17 + POKERADAR_LIGHT_ANIMATION_GREEN_ID = 18 + POKERADAR_HIDDEN_ABILITY_POKE_CHANCE = 32 + POKERADAR_BATTERY_STEPS = 0 # FUSION_ICON_SPRITE_OFFSET = 10 @@ -310,10 +315,48 @@ module Settings # * Minimum possible level. # * Maximum possible level (optional). POKE_RADAR_ENCOUNTERS = [ - [5, 20, :STARLY, 12, 15], - [21, 10, :STANTLER, 14], - [28, 20, :BUTTERFREE, 15, 18], - [28, 20, :BEEDRILL, 15, 18] + [78, 30, :FLETCHLING,2,5], #Rt. 1 + [86, 30, :FLETCHLING,2,5], #Rt. 2 + [90, 30, :FLETCHLING,2,5], #Rt. 2 + [491, 30, :SHROOMISH,2,5], #Viridian Forest + [490, 30, :BUDEW,4,9], #Rt. 3 + [106, 30, :NINCADA,8,10], #Rt. 4 + [12, 30, :TOGEPI,10,10], #Rt. 5 + [16, 30, :SLAKOTH,12,15], #Rt. 6 + [413, 30, :DRIFLOON,17,20], #Rt. 7 + [409, 30, :SHINX,17,18], #Rt. 8 + [495, 30, :ARON,12,15], #Rt. 9 + [351, 30, :ARON,12,15], #Rt. 9 + [154, 30, :KLINK,14,17], #Rt. 10 + [155, 30, :NINCADA,12,15], #Rt. 11 + [159, 30, :COTTONEE,22,25], #Rt. 12 + [437, 30, :COTTONEE,22,25], #Rt. 13 + [437, 30, :JOLTIK,22,25], #Rt. 13 + [440, 30, :JOLTIK,22,25], #Rt. 14 + [444, 30, :SOLOSIS,22,25], #Rt. 15 + [438, 30, :NATU,22,25], #Rt. 16 + [146, 30, :KLEFKI,22,25], #Rt. 17 + [517, 30, :FERROSEED,22,25], #Rt. 18 + [445, 30, :BAGON,20,20], #Safari zone 1 + [484, 30, :AXEW,20,20], #Safari zone 2 + [485, 30, :DEINO,20,20], #Safari zone 3 + [486, 30, :LARVITAR,20,20], #Safari zone 4 + [487, 30, :BELDUM,20,20], #Safari zone 5 + [59, 30, :DUNSPARSE,25,30], #Rt. 21 + [171, 30, :BIDOOF,2,5], #Rt. 22 + [143, 30, :RIOLU,25,25], #Rt. 23 + [8, 30, :BUNEARY,12,13], #Rt. 24 + [145, 5, :ABSOL,30,35], #Rt. 26 + [147, 5, :ABSOL,30,35], #Rt. 27 + [311, 30, :BIDOOF,5,5], #Rt. 29 + [265, 30, :KIRLIA,25,30], #Rt. 34 + [300, 30, :ROSELIA,30,30], #National Park + [300, 30, :BRELOOM,30,30], #Ilex Forest + [670, 30, :WEAVILE,50,50], #Ice mountains + [528, 30, :PYUKUMUKU,20,20], #Treasure Beach + [690, 30, :OCTILLERY,32,45], #Deep Ocean + [561, 30, :MAGMAR,32,45], #Mt. Ember + [654, 30, :WHIMSICOTT,32,45], #Brine Road ] #============================================================================= diff --git a/Data/Scripts/012_Overworld/002_Battle triggering/003_Overworld_WildEncounters.rb b/Data/Scripts/012_Overworld/002_Battle triggering/003_Overworld_WildEncounters.rb index c48c97b7c..4556fd02c 100644 --- a/Data/Scripts/012_Overworld/002_Battle triggering/003_Overworld_WildEncounters.rb +++ b/Data/Scripts/012_Overworld/002_Battle triggering/003_Overworld_WildEncounters.rb @@ -109,6 +109,9 @@ class PokemonEncounters # Check if enc_type has a defined step chance/encounter table return false if !@step_chances[enc_type] || @step_chances[enc_type] == 0 return false if !has_encounter_type?(enc_type) + #Always check encounter if pokeradar is active + return true if $PokemonTemp.pokeradar != nil + # Get base encounter chance and minimum steps grace period encounter_chance = @step_chances[enc_type].to_f min_steps_needed = (8 - encounter_chance / 10).clamp(0, 8).to_f diff --git a/Data/Scripts/013_Items/005_Item_PokeRadar.rb b/Data/Scripts/013_Items/005_Item_PokeRadar.rb index e7bff118a..ba8156e31 100644 --- a/Data/Scripts/013_Items/005_Item_PokeRadar.rb +++ b/Data/Scripts/013_Items/005_Item_PokeRadar.rb @@ -2,20 +2,16 @@ class PokemonGlobalMetadata attr_accessor :pokeradarBattery end - - class PokemonTemp - attr_accessor :pokeradar # [species, level, chain count, grasses (x,y,ring,rarity)] + attr_accessor :pokeradar # [species, level, chain count, grasses (x,y,ring,rarity)] end - - ################################################################################ # Using the Poke Radar ################################################################################ def pbCanUsePokeRadar? # Can't use Radar if not in tall grass - terrain = $game_map.terrain_tag($game_player.x,$game_player.y) + terrain = $game_map.terrain_tag($game_player.x, $game_player.y) if !terrain.land_wild_encounters || !terrain.shows_grass_rustle pbMessage(_INTL("Can't use that here.")) return false @@ -33,9 +29,9 @@ def pbCanUsePokeRadar? # Debug return true if $DEBUG && Input.press?(Input::CTRL) # Can't use Radar if it isn't fully charged - if $PokemonGlobal.pokeradarBattery && $PokemonGlobal.pokeradarBattery>0 + if $PokemonGlobal.pokeradarBattery && $PokemonGlobal.pokeradarBattery > 0 pbMessage(_INTL("The battery has run dry!\nFor it to recharge, you need to walk another {1} steps.", - $PokemonGlobal.pokeradarBattery)) + $PokemonGlobal.pokeradarBattery)) return false end return true @@ -43,12 +39,39 @@ end def pbUsePokeRadar return false if !pbCanUsePokeRadar? - $PokemonTemp.pokeradar = [0,0,0,[]] if !$PokemonTemp.pokeradar - $PokemonGlobal.pokeradarBattery = 50 + $PokemonTemp.pokeradar = [0, 0, 0, []] if !$PokemonTemp.pokeradar + $PokemonGlobal.pokeradarBattery = Settings::POKERADAR_BATTERY_STEPS + rareAllowed = canEncounterRarePokemon() + playPokeradarLightAnimation(rareAllowed) + pbWait(20) pbPokeRadarHighlightGrass return true end +#can only encounter rare if have seen every encounterable land pokemon on the route +def canEncounterRarePokemon() + processed = [] + for encounter in $PokemonEncounters.listPossibleEncounters($PokemonEncounters.pbEncounterType) + species = encounter[0] + if !processed.include?(species) + if $Trainer.seen[species] + processed << species + else + return false + end + end + end + return true +end + +def playPokeradarLightAnimation(rareAllowed = false) + if rareAllowed + $scene.spriteset.addUserAnimation(Settings::POKERADAR_LIGHT_ANIMATION_GREEN_ID, $game_player.x, $game_player.y, true) + else + $scene.spriteset.addUserAnimation(Settings::POKERADAR_LIGHT_ANIMATION_RED_ID, $game_player.x, $game_player.y, true) + end +end + def pbPokeRadarCancel $PokemonTemp.pokeradar = nil end @@ -57,57 +80,49 @@ def listUnseenPokemonInCurrentRoute(encounterType) processed = [] unseen = [] for encounter in $PokemonEncounters.listPossibleEncounters(encounterType) - species = encounter[0] + species = encounter[1] if !processed.include?(species) if $Trainer.seen?(species) - processed<=0 && x<$game_map.width && - y>=0 && y<$game_map.height + if x >= 0 && x < $game_map.width && + y >= 0 && y < $game_map.height terrain = $game_map.terrain_tag(x, y) if terrain.land_wild_encounters && terrain.shows_grass_rustle # Choose a rarity for the grass (0=normal, 1=rare, 2=shiny) @@ -118,11 +133,11 @@ def pbPokeRadarHighlightGrass(showmessage=true) v = rand(65536) / v s = 2 if v == 0 end - grasses.push([x,y,i,s]) + grasses.push([x, y, i, s]) end end end - if grasses.length==0 + if grasses.length == 0 # No shaking grass found, break the chain pbMessage(_INTL("The grassy patch remained quiet...")) if showmessage pbPokeRadarCancel @@ -130,16 +145,16 @@ def pbPokeRadarHighlightGrass(showmessage=true) # Show grass rustling animations for grass in grasses case grass[3] - when 0 # Normal rustle - $scene.spriteset.addUserAnimation(Settings::RUSTLE_NORMAL_ANIMATION_ID,grass[0],grass[1],true,1) - when 1 # Vigorous rustle - $scene.spriteset.addUserAnimation(Settings::RUSTLE_VIGOROUS_ANIMATION_ID,grass[0],grass[1],true,1) - when 2 # Shiny rustle - $scene.spriteset.addUserAnimation(Settings::RUSTLE_SHINY_ANIMATION_ID,grass[0],grass[1],true,1) + when 0 # Normal rustle + $scene.spriteset.addUserAnimation(Settings::RUSTLE_NORMAL_ANIMATION_ID, grass[0], grass[1], true, 1) + when 1 # Vigorous rustle + $scene.spriteset.addUserAnimation(Settings::RUSTLE_VIGOROUS_ANIMATION_ID, grass[0], grass[1], true, 1) + when 2 # Shiny rustle + $scene.spriteset.addUserAnimation(Settings::RUSTLE_SHINY_ANIMATION_ID, grass[0], grass[1], true, 1) end end $PokemonTemp.pokeradar[3] = grasses if $PokemonTemp.pokeradar - pbWait(Graphics.frame_rate/2) + pbWait(Graphics.frame_rate / 2) end end @@ -186,16 +201,16 @@ end ################################################################################ EncounterModifier.register(proc { |encounter| if GameData::EncounterType.get($PokemonTemp.encounterType).type != :land || - $PokemonGlobal.bicycle || $PokemonGlobal.partner + $PokemonGlobal.bicycle || $PokemonGlobal.partner pbPokeRadarCancel next encounter end ring = pbPokeRadarGetShakingGrass - if ring >= 0 # Encounter triggered by stepping into rustling grass + if ring >= 0 # Encounter triggered by stepping into rustling grass # Get rarity of shaking grass - rarity = 0 # 0 = rustle, 1 = vigorous rustle, 2 = shiny rustle + rarity = 0 # 0 = rustle, 1 = vigorous rustle, 2 = shiny rustle $PokemonTemp.pokeradar[3].each { |g| rarity = g[3] if g[2] == ring } - if $PokemonTemp.pokeradar[2] > 0 # Chain count, i.e. is chaining + if $PokemonTemp.pokeradar[2] > 0 # Chain count, i.e. is chaining if rarity == 2 || rand(100) < 86 + ring * 4 + ($PokemonTemp.pokeradar[2] / 4).floor # Continue the chain encounter = [$PokemonTemp.pokeradar[0], $PokemonTemp.pokeradar[1]] @@ -208,67 +223,69 @@ EncounterModifier.register(proc { |encounter| end pbPokeRadarCancel end - else # Not chaining; will start one + else + # Not chaining; will start one # Force random wild encounter, vigorous shaking means rarer species encounter = pbPokeRadarGetEncounter(rarity) $PokemonTemp.forceSingleBattle = true end - else # Encounter triggered by stepping in non-rustling grass - pbPokeRadarCancel if encounter + else + # Encounter triggered by stepping in non-rustling grass + pbPokeRadarCancel if encounter && $PokemonGlobal.repel <= 0 end next encounter }) -Events.onWildPokemonCreate += proc { |_sender,e| +Events.onWildPokemonCreate += proc { |_sender, e| pokemon = e[0] next if !$PokemonTemp.pokeradar grasses = $PokemonTemp.pokeradar[3] next if !grasses for grass in grasses - next if $game_player.x!=grass[0] || $game_player.y!=grass[1] - pokemon.shiny = true if grass[3]==2 + next if $game_player.x != grass[0] || $game_player.y != grass[1] + pokemon.shiny = true if grass[3] == 2 break end } -Events.onWildBattleEnd += proc { |_sender,e| - species = e[0] - level = e[1] +Events.onWildBattleEnd += proc { |_sender, e| + species = e[0] + level = e[1] decision = e[2] - if $PokemonTemp.pokeradar && (decision==1 || decision==4) # Defeated/caught + if $PokemonTemp.pokeradar && (decision == 1 || decision == 4) # Defeated/caught $PokemonTemp.pokeradar[0] = species $PokemonTemp.pokeradar[1] = level $PokemonTemp.pokeradar[2] += 1 - $PokemonTemp.pokeradar[2] = 40 if $PokemonTemp.pokeradar[2]>40 + $PokemonTemp.pokeradar[2] = 40 if $PokemonTemp.pokeradar[2] > 40 pbPokeRadarHighlightGrass(false) else pbPokeRadarCancel end } -Events.onStepTaken += proc { |_sender,_e| +Events.onStepTaken += proc { |_sender, _e| if $PokemonGlobal.pokeradarBattery && $PokemonGlobal.pokeradarBattery > 0 && - !$PokemonTemp.pokeradar + !$PokemonTemp.pokeradar $PokemonGlobal.pokeradarBattery -= 1 end - terrain = $game_map.terrain_tag($game_player.x,$game_player.y) + terrain = $game_map.terrain_tag($game_player.x, $game_player.y) if !terrain.land_wild_encounters || !terrain.shows_grass_rustle pbPokeRadarCancel end } -Events.onMapChange += proc { |_sender,_e| +Events.onMapChange += proc { |_sender, _e| pbPokeRadarCancel } ################################################################################ # Item handlers ################################################################################ -ItemHandlers::UseInField.add(:POKERADAR,proc { |item| +ItemHandlers::UseInField.add(:POKERADAR, proc { |item| next (pbCanUsePokeRadar?) ? pbUsePokeRadar : 0 }) -ItemHandlers::UseFromBag.add(:POKERADAR,proc { |item| +ItemHandlers::UseFromBag.add(:POKERADAR, proc { |item| next (pbCanUsePokeRadar?) ? 2 : 0 }) diff --git a/Data/Scripts/050_AddOns/GeneralUtils.rb b/Data/Scripts/050_AddOns/GeneralUtils.rb index 03a2e85d9..afa1235b7 100644 --- a/Data/Scripts/050_AddOns/GeneralUtils.rb +++ b/Data/Scripts/050_AddOns/GeneralUtils.rb @@ -371,5 +371,3 @@ def reverseFusionSpecies(species) return getPokemon(newspecies) end - - diff --git a/Data/Skills.rxdata b/Data/Skills.rxdata index a45219f5e..61cba7ea2 100644 Binary files a/Data/Skills.rxdata and b/Data/Skills.rxdata differ diff --git a/Data/States.rxdata b/Data/States.rxdata index 868d49e59..0f9b4ae5d 100644 Binary files a/Data/States.rxdata and b/Data/States.rxdata differ diff --git a/Data/System.rxdata b/Data/System.rxdata index 2d9042c0c..92baedea6 100644 Binary files a/Data/System.rxdata and b/Data/System.rxdata differ diff --git a/Data/Tilesets.rxdata b/Data/Tilesets.rxdata index 838a3a9d6..e3795ef66 100644 Binary files a/Data/Tilesets.rxdata and b/Data/Tilesets.rxdata differ diff --git a/Data/Weapons.rxdata b/Data/Weapons.rxdata index c7ea19a7a..d9bd35260 100644 Binary files a/Data/Weapons.rxdata and b/Data/Weapons.rxdata differ