From 980517c0a293e309edbc9c2fcbdad22775eab0fd Mon Sep 17 00:00:00 2001 From: infinitefusion Date: Wed, 28 Jul 2021 20:18:51 -0400 Subject: [PATCH] hidden ability maps --- .../004_Game classes/007_Game_Character.rb | 3 +- Data/Scripts/049_Compatibility/PBItems.rb | 4 +++ Data/Scripts/050_AddOns/BetterRegionMap.rb | 4 ++- Data/Scripts/050_AddOns/HiddenAbilityMaps.rb | 29 +++++++++++++++++++ PBS/bttrainers.txt | 2 +- 5 files changed, 39 insertions(+), 3 deletions(-) create mode 100644 Data/Scripts/050_AddOns/HiddenAbilityMaps.rb diff --git a/Data/Scripts/004_Game classes/007_Game_Character.rb b/Data/Scripts/004_Game classes/007_Game_Character.rb index b7ddc4772..6a183f8f6 100644 --- a/Data/Scripts/004_Game classes/007_Game_Character.rb +++ b/Data/Scripts/004_Game classes/007_Game_Character.rb @@ -319,7 +319,8 @@ class Game_Character begin return z + self.map.priorities[@tile_id] * 32 rescue - raise "Event's graphic is an out-of-range tile (event #{@id}, map #{self.map.map_id})" + return 0 + #raise "Event's graphic is an out-of-range tile (event #{@id}, map #{self.map.map_id})" end end # Add z if height exceeds 32 diff --git a/Data/Scripts/049_Compatibility/PBItems.rb b/Data/Scripts/049_Compatibility/PBItems.rb index 49d0f3f66..950b9e33a 100644 --- a/Data/Scripts/049_Compatibility/PBItems.rb +++ b/Data/Scripts/049_Compatibility/PBItems.rb @@ -647,4 +647,8 @@ module PBItems JETPACK = 643 INFINITEREVERSERS = 644 INFINITESPLICERS = 645 + + def PBItems.getName(item) + return GameData::Item.get(item).real_name + end end \ No newline at end of file diff --git a/Data/Scripts/050_AddOns/BetterRegionMap.rb b/Data/Scripts/050_AddOns/BetterRegionMap.rb index 930e9da8c..ff2bf4d3f 100644 --- a/Data/Scripts/050_AddOns/BetterRegionMap.rb +++ b/Data/Scripts/050_AddOns/BetterRegionMap.rb @@ -54,7 +54,9 @@ class BetterRegionMap def initialize(region = -1, show_player = true, can_fly = false, wallmap = false, species = nil,fly_anywhere=false) showBlk map_metadata = GameData::MapMetadata.try_get($game_map.map_id) - playerpos = $game_map ? map_metadata.town_map_position : nil#pbGetMetadata($game_map.map_id, MetadataMapPosition) : nil + if map_metadata + playerpos = $game_map ? map_metadata.town_map_position : nil#pbGetMetadata($game_map.map_id, MetadataMapPosition) : nil + end if playerpos == nil playerpos = [0,0] end diff --git a/Data/Scripts/050_AddOns/HiddenAbilityMaps.rb b/Data/Scripts/050_AddOns/HiddenAbilityMaps.rb new file mode 100644 index 000000000..4a004a09a --- /dev/null +++ b/Data/Scripts/050_AddOns/HiddenAbilityMaps.rb @@ -0,0 +1,29 @@ + + +HIDDEN_MAPS_STEPS = 1500 +HIDDEN_MAP_ALWAYS = [178,655,570,356] +RANDOM_HIDDEN_MAP_LIST = [8,109,431,446,402,403,467,468,10,23,167,16,19,78,185,86, + 491,90,40,342,490,102,103,104,105,106,1,12,413,445,484,485,486,140,350,146, + 149,304,356,307,409,351,495,154,349,322,323,544,198,144,155,444,58,59,229,52,53,54, + 55,98,173,174,181,187,95,159,162,437,220,440,438,57,171,172,528,265,288,364,329, + 335,254,261,262,266,230,145,147,258,284,283,267,586,285,286,287,300,311,47,580,529, + 635,638,646,560,559,526,600,564,594,566,562,619,563,603,561,597,633,640,641,621,312, + 670,692,643,523,698, + 602,642,623,569,588,573,362,645,651,376 +] + +Events.onMapUpdate+=proc {|sender,e| + #next if !$game_switches[HIDDENMAPSWITCH] + if $PokemonGlobal.stepcount % HIDDEN_MAPS_STEPS == 0 + changeHiddenMap() + end +} +def changeHiddenMap() + i = rand(RANDOM_HIDDEN_MAP_LIST.length-1) + pbSet(226,RANDOM_HIDDEN_MAP_LIST[i]) +end + +def Kernel.getMapName(id) + mapinfos = pbLoadMapInfos + return mapinfos[id].name +end \ No newline at end of file diff --git a/PBS/bttrainers.txt b/PBS/bttrainers.txt index 11e6ee94e..fd2f12e72 100644 --- a/PBS/bttrainers.txt +++ b/PBS/bttrainers.txt @@ -587,7 +587,7 @@ BeginSpeech=HEY Type=SAILOR EndSpeechWin=MY RIVAL IS MY GIRL FRIEND [084] -EndSpeechLose=YOU'RE GOING TO A LEGEND ! +EndSpeechLose=YOU'RE GOING TO BE A LEGEND ! Name=DARYL PokemonNos=15,22,31,39,50,51,58,67,70,74,75,81,82,85,104,120,122,132,133,138,139,140,141,142,144,150,156 BeginSpeech=I ONLY KNOW HOW TO CHARGE