I have added an encounter method to select a form of Oricorio and Flabebe depending on which color of flower you are standing on, and random if the flower you are on doesn't match that Pokemon's variation.
However while the Flowers work just fine, they have seemed to disable the Grass tiles from spawning Pokemon. Can anyone help me figure this out?
PBTerrain
I have added the terrain tags for 7 colors of flowers.
I have defined what is a Flower under Grass.
PField_Encounters
I copied land for the encounter Density, Chances, and CompileDens
Copied isGrass? to make isFlower?
Added Flower to isEncounterPossibleHere? and pbEncounterType
Pokemon_Forms
Finally had Oricorio and Flabebe check which color flower the player was standing on.
Encounter PBS
However while the Flowers work just fine, they have seemed to disable the Grass tiles from spawning Pokemon. Can anyone help me figure this out?
PBTerrain
Spoiler:
I have added the terrain tags for 7 colors of flowers.
Code:
module PBTerrain
Ledge = 1
Grass = 2
Sand = 3
Rock = 4
DeepWater = 5
StillWater = 6
Water = 7
Waterfall = 8
WaterfallCrest = 9
TallGrass = 10
UnderwaterGrass = 11
Ice = 12
Neutral = 13
SootGrass = 14
Bridge = 15
Puddle = 16
FlowerRed = 17
FlowerYellow = 18
FlowerOrange = 19
FlowerBlue = 20
FlowerWhite = 21
FlowerPink = 22
FlowerPurple = 23
I have defined what is a Flower under Grass.
Code:
def self.isGrass?(tag)
return tag==PBTerrain::Grass ||
tag==PBTerrain::TallGrass ||
tag==PBTerrain::UnderwaterGrass ||
tag==PBTerrain::SootGrass
end
def self.isFlower?(tag)
return tag==PBTerrain::FlowerRed ||
tag==PBTerrain::FlowerOrange ||
tag==PBTerrain::FlowerYellow ||
tag==PBTerrain::FlowerBlue ||
tag==PBTerrain::FlowerWhite ||
tag==PBTerrain::FlowerPink ||
tag==PBTerrain::FlowerPurple
end
PField_Encounters
Spoiler:
I copied land for the encounter Density, Chances, and CompileDens
Code:
module EncounterTypes
Land = 0
Cave = 1
Water = 2
RockSmash = 3
OldRod = 4
GoodRod = 5
SuperRod = 6
HeadbuttLow = 7
HeadbuttHigh = 8
LandMorning = 9
LandDay = 10
LandNight = 11
BugContest = 12
Flower = 13
Names = [
"Land",
"Cave",
"Water",
"RockSmash",
"OldRod",
"GoodRod",
"SuperRod",
"HeadbuttLow",
"HeadbuttHigh",
"LandMorning",
"LandDay",
"LandNight",
"BugContest",
"Flower"
]
EnctypeChances = [
[20,20,10,10,10,10,5,5,4,4,1,1],
[20,20,10,10,10,10,5,5,4,4,1,1],
[60,30,5,4,1],
[60,30,5,4,1],
[70,30],
[60,20,20],
[40,40,15,4,1],
[30,25,20,10,5,5,4,1],
[30,25,20,10,5,5,4,1],
[20,20,10,10,10,10,5,5,4,4,1,1],
[20,20,10,10,10,10,5,5,4,4,1,1],
[20,20,10,10,10,10,5,5,4,4,1,1],
[20,20,10,10,10,10,5,5,4,4,1,1],
[20,20,10,10,10,10,5,5,4,4,1,1]
]
EnctypeDensities = [25, 10, 10, 0, 0, 0, 0, 0, 0, 25, 25, 25, 25, 25]
EnctypeCompileDens = [ 1, 2, 3, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1]
end
Copied isGrass? to make isFlower?
Code:
def isFlower?
return false if @density==nil
return @enctypes[EncounterTypes::Flower] ? true : false
end
# Returns whether grass-like encounters have been defined for the current map.
# Applies only to encounters triggered by moving around.
def isGrass?
return false if @density==nil
return (@enctypes[EncounterTypes::Land] ||
@enctypes[EncounterTypes::LandMorning] ||
@enctypes[EncounterTypes::LandDay] ||
@enctypes[EncounterTypes::LandNight] ||
@enctypes[EncounterTypes::BugContest]) ? true : false
end
Added Flower to isEncounterPossibleHere? and pbEncounterType
Code:
# Returns whether it is theoretically possible to have an encounter in the
# player's current location.
def isEncounterPossibleHere?
if $PokemonGlobal.surfing
return true
elsif PBTerrain.isIce?(pbGetTerrainTag($game_player))
return false
[ elsif self.isFlower?
return PBTerrain.isFlower?($game_map.terrain_tag($game_player.x,$game_player.y))
elsif self.isCave?
return true
elsif self.isGrass?
return PBTerrain.isGrass?($game_map.terrain_tag($game_player.x,$game_player.y))
end
return false
end
# Returns the encounter method that the current encounter should be generated
# from, depending on the player's current location.
def pbEncounterType
if $PokemonGlobal.surfing
return EncounterTypes::Water
elsif self.isCave?
return EncounterTypes::Cave
elsif self.isFlower?
return EncounterTypes::Flower
elsif self.isGrass?
time = pbGetTimeNow
enctype = EncounterTypes::Land
enctype = EncounterTypes::LandNight if self.hasEncounter?(EncounterTypes::LandNight) && PBDayNight.isNight?(time)
enctype = EncounterTypes::LandDay if self.hasEncounter?(EncounterTypes::LandDay) && PBDayNight.isDay?(time)
enctype = EncounterTypes::LandMorning if self.hasEncounter?(EncounterTypes::LandMorning) && PBDayNight.isMorning?(time)
if pbInBugContest? && self.hasEncounter?(EncounterTypes::BugContest)
enctype = EncounterTypes::BugContest
end
return enctype
end
return -1
end
Pokemon_Forms
Spoiler:
Finally had Oricorio and Flabebe check which color flower the player was standing on.
Code:
MultipleForms.register(:FLABEBE,{
"getFormOnCreation" => proc { |pkmn|
playerxy = $game_map.terrain_tag($game_player.x,$game_player.y)
next 0 if playerxy == PBTerrain::FlowerRed #Red Flower
next 1 if playerxy == PBTerrain::FlowerYellow #Yellow Flower
next 2 if playerxy == PBTerrain::FlowerOrange #Orange Flower
next 3 if playerxy == PBTerrain::FlowerBlue #Blue Flower
next 3 if playerxy == PBTerrain::FlowerWhite #White Flower
next rand(5) #Random
}
})
MultipleForms.copy(:FLABEBE,:FLOETTE,:FLORGES)
MultipleForms.register(:ORICORIO,{
"getFormOnCreation" => proc { |pkmn|
playerxy = $game_map.terrain_tag($game_player.x,$game_player.y)
next 0 if playerxy == PBTerrain::FlowerRed #Baile Style
next 1 if playerxy == PBTerrain::FlowerYellow #Pom-Pom Style
next 2 if playerxy == PBTerrain::FlowerPink #Pa'u Style
next 3 if playerxy == PBTerrain::FlowerPurple #Sensu Style
next rand(4) #Random
},
})
Encounter PBS
Spoiler:
Code:
005 # Route 1
25,10,10
Land
RATTATA,11,14
PIDGEY,11,14
RATTATA,11,14
PIDGEY,11,14
RATTATA,11,14
PIDGEY,11,14
RATTATA,11,13
PIDGEY,11,13
RATTATA,11,13
PIDGEY,11,13
RATTATA,14
PIDGEY,14
LandNight
RATTATA,10,14
HOOTHOOT,10,13
RATTATA,10,14
HOOTHOOT,10,13
SPINARAK,8,12
SPINARAK,8,12
RATTATA,10,14
HOOTHOOT,10,14
RATTATA,10,14
HOOTHOOT,10,14
RATTATA,15
HOOTHOOT,14
Flower
ORICORIO,5
ORICORIO,5
ORICORIO,5
ORICORIO,5
ORICORIO,5
ORICORIO,5
ORICORIO,5
ORICORIO,5
ORICORIO,5
ORICORIO,5
ORICORIO,5
ORICORIO,5
Attachments
Last edited: