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
# 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
# pass down its ability (80% chance if Hidden, 60% chance if not).
# Ability (60% chance). If neither Pokémon are Ditto, then the mother can
# 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
# 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

View File

@@ -70,13 +70,31 @@ class BugContestState
end
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
# Reception map is handled separately from contest map since the reception map
# can be outdoors, with its own grassy patches.
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
def pbOffLimits?(map)
@@ -97,8 +115,8 @@ class BugContestState
maps_with_encounters = []
@contestMaps.each do |map|
enc_type = :BugContest
enc_type = :Land if !$PokemonEncounters.map_has_encounter_type?(@contestMaps, enc_type)
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?(map, enc_type)
maps_with_encounters.push([map, enc_type])
end
end

View File

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