Bug Contest maps can now be defined using a map metadata flag

This commit is contained in:
Maruno17
2022-08-07 15:00:40 +01:00
parent f083cddca5
commit cca414a826
3 changed files with 27 additions and 7 deletions

View File

@@ -151,8 +151,8 @@ class DayCare
end end
# If a Pokémon is bred with a Ditto, that Pokémon can pass down its Hidden # If a Pokémon is bred with a Ditto, that Pokémon can pass down its Hidden
# Ability (80% chance). If neither Pokémon are Ditto, then the mother can # Ability (60% chance). If neither Pokémon are Ditto, then the mother can
# pass down its ability (80% chance if Hidden, 60% chance if not). # pass down its ability (60% chance if Hidden, 80% chance if not).
# NOTE: This is how ability inheritance works in Gen 6+. Gen 5 is more # NOTE: This is how ability inheritance works in Gen 6+. Gen 5 is more
# restrictive, and even works differently between BW and B2W2, and I # restrictive, and even works differently between BW and B2W2, and I
# don't think that is worth adding in. Gen 4 and lower don't have # don't think that is worth adding in. Gen 4 and lower don't have

View File

@@ -70,13 +70,31 @@ class BugContestState
end end
def pbSetContestMap(*maps) def pbSetContestMap(*maps)
@contestMaps = maps maps.each do |map|
if map.is_a?(String) # Map metadata flag
GameData::MapMetadata.each do |map_data|
@contestMaps.push(map_data.id) if map_data.has_flag?(map)
end
else
@contestMaps.push(map)
end
end
echoln "contest maps: #{@contestMaps}"
end end
# Reception map is handled separately from contest map since the reception map # Reception map is handled separately from contest map since the reception map
# can be outdoors, with its own grassy patches. # can be outdoors, with its own grassy patches.
def pbSetReception(*maps) def pbSetReception(*maps)
@reception = maps maps.each do |map|
if map.is_a?(String) # Map metadata flag
GameData::MapMetadata.each do |map_data|
@reception.push(map_data.id) if map_data.has_flag?(map)
end
else
@reception.push(map)
end
end
echoln "reception maps: #{@reception}"
end end
def pbOffLimits?(map) def pbOffLimits?(map)
@@ -97,8 +115,8 @@ class BugContestState
maps_with_encounters = [] maps_with_encounters = []
@contestMaps.each do |map| @contestMaps.each do |map|
enc_type = :BugContest enc_type = :BugContest
enc_type = :Land if !$PokemonEncounters.map_has_encounter_type?(@contestMaps, enc_type) enc_type = :Land if !$PokemonEncounters.map_has_encounter_type?(map, enc_type)
if $PokemonEncounters.map_has_encounter_type?(@contestMaps, enc_type) if $PokemonEncounters.map_has_encounter_type?(map, enc_type)
maps_with_encounters.push([map, enc_type]) maps_with_encounters.push([map, enc_type])
end end
end end

View File

@@ -132,16 +132,18 @@ Outdoor = true
ShowArea = true ShowArea = true
MapPosition = 0,16,8 MapPosition = 0,16,8
BattleBack = field BattleBack = field
Flags = MossRock Flags = MossRock,BugContest
#------------------------------- #-------------------------------
[029] # Natural Park Entrance [029] # Natural Park Entrance
Name = Natural Park Name = Natural Park
Bicycle = true Bicycle = true
MapPosition = 0,16,8 MapPosition = 0,16,8
Flags = BugContestReception
#------------------------------- #-------------------------------
[030] # Natural Park Pavillion [030] # Natural Park Pavillion
Name = Natural Park Name = Natural Park
MapPosition = 0,16,8 MapPosition = 0,16,8
Flags = BugContestReception
#------------------------------- #-------------------------------
[031] # Route 3 [031] # Route 3
Name = Route 3 Name = Route 3