mirror of
https://gitlab.com/cable-mc/cobblemon.git
synced 2026-12-03 21:48:53 -05:00
changes to pokemon crying in the wild
This commit is contained in:
1 parent
4e6501e6f5
commit
ee9b8bb556
67 files changed
+679
-36
No files matched your search
+57
-15
@@ -3,6 +3,7 @@ package com.cobblemon.mod.common.api.ai.biggerbrain.objective
|
||||
import com.cobblemon.mod.common.api.ai.BehaviourConfigurationContext
|
||||
import com.cobblemon.mod.common.api.ai.biggerbrain.BiggerBrain
|
||||
import com.cobblemon.mod.common.api.ai.config.objective.ObjectiveConfig
|
||||
import com.cobblemon.mod.common.api.ai.resolveBoolean
|
||||
import com.cobblemon.mod.common.api.ai.resolveInt
|
||||
import com.cobblemon.mod.common.entity.pokemon.PokemonEntity
|
||||
import net.minecraft.world.effect.MobEffects
|
||||
@@ -10,25 +11,32 @@ import net.minecraft.world.entity.LivingEntity
|
||||
import net.minecraft.world.entity.ai.memory.MemoryModuleType
|
||||
import net.minecraft.world.entity.player.Player
|
||||
|
||||
class CryAtEntity(
|
||||
/**
|
||||
* Behaviour for performing a cry. Can be random, at other entities, or both.
|
||||
*/
|
||||
class Cry(
|
||||
val cooldownTicks: Int,
|
||||
val variation: Int
|
||||
val variation: Int,
|
||||
val atEntities: Boolean,
|
||||
val atRandom: Boolean
|
||||
) : Objective {
|
||||
var remainingCooldownTicks = 0
|
||||
override fun getDescription(entity: LivingEntity) = "Cry at entity"
|
||||
|
||||
override fun perform(
|
||||
entity: LivingEntity,
|
||||
brain: BiggerBrain,
|
||||
activeObjectiveTags: MutableSet<String>
|
||||
): ObjectiveStatus {
|
||||
if (remainingCooldownTicks > 0) {
|
||||
remainingCooldownTicks--
|
||||
return ObjectiveStatus.INACTIVE
|
||||
}
|
||||
override fun getDescription(entity: LivingEntity) = if (!atEntities && atRandom) {
|
||||
"Cry (Random)"
|
||||
} else if (atEntities && !atRandom) {
|
||||
"Cry (Entities)"
|
||||
} else {
|
||||
"Cry (Both)"
|
||||
}
|
||||
|
||||
entity as PokemonEntity
|
||||
private fun doRandomCry(entity: PokemonEntity): ObjectiveStatus {
|
||||
entity.cry()
|
||||
remainingCooldownTicks = ((cooldownTicks - variation)..(cooldownTicks + variation)).random()
|
||||
return ObjectiveStatus.ACTIVE
|
||||
}
|
||||
|
||||
private fun doEntityCry(entity: PokemonEntity, brain: BiggerBrain): ObjectiveStatus {
|
||||
val nearbyEntities = brain.getMemory(MemoryModuleType.NEAREST_VISIBLE_LIVING_ENTITIES) ?: return ObjectiveStatus.INVALID
|
||||
val toleratedLeaderPokemon = entity.pokemon.species.behaviour.herd.toleratedLeaders.mapNotNull { it.pokemon.species }
|
||||
|
||||
@@ -51,19 +59,53 @@ class CryAtEntity(
|
||||
return ObjectiveStatus.ACTIVE
|
||||
}
|
||||
|
||||
override fun perform(
|
||||
entity: LivingEntity,
|
||||
brain: BiggerBrain,
|
||||
activeObjectiveTags: MutableSet<String>
|
||||
): ObjectiveStatus {
|
||||
if (remainingCooldownTicks > 0) {
|
||||
remainingCooldownTicks--
|
||||
return ObjectiveStatus.INACTIVE
|
||||
}
|
||||
|
||||
entity as PokemonEntity
|
||||
|
||||
return if (atRandom && !atEntities) {
|
||||
doRandomCry(entity)
|
||||
} else if (!atRandom && atEntities) {
|
||||
doEntityCry(entity, brain)
|
||||
} else if (atRandom && atEntities) {
|
||||
if ((1..2).random() == 1) {
|
||||
doRandomCry(entity)
|
||||
} else {
|
||||
doEntityCry(entity, brain)
|
||||
}
|
||||
} else {
|
||||
ObjectiveStatus.INVALID // Why are you here?
|
||||
}
|
||||
}
|
||||
|
||||
class Config : ObjectiveConfig {
|
||||
val cooldownTicks = createVariable("400")
|
||||
val variation = createVariable("200")
|
||||
val atEntities = createVariable("false")
|
||||
val atRandom = createVariable("false")
|
||||
|
||||
override fun getVariables(
|
||||
entity: LivingEntity,
|
||||
ctx: BehaviourConfigurationContext
|
||||
) = variables(cooldownTicks, variation)
|
||||
) = variables(cooldownTicks, variation, atEntities, atRandom)
|
||||
|
||||
override fun create(
|
||||
entity: LivingEntity,
|
||||
ctx: BehaviourConfigurationContext
|
||||
) = CryAtEntity(cooldownTicks.resolveInt(ctx.runtime), variation.resolveInt(ctx.runtime))
|
||||
) = Cry(
|
||||
cooldownTicks.resolveInt(ctx.runtime),
|
||||
variation.resolveInt(ctx.runtime),
|
||||
atEntities.resolveBoolean(ctx.runtime),
|
||||
atRandom.resolveBoolean(ctx.runtime)
|
||||
)
|
||||
|
||||
}
|
||||
}
|
||||
+2
-2
@@ -17,7 +17,7 @@ import com.cobblemon.mod.common.api.ai.biggerbrain.objective.AvoidTarget
|
||||
import com.cobblemon.mod.common.api.ai.biggerbrain.objective.Dance
|
||||
import com.cobblemon.mod.common.api.ai.biggerbrain.objective.DefendOwner
|
||||
import com.cobblemon.mod.common.api.ai.biggerbrain.objective.Breed
|
||||
import com.cobblemon.mod.common.api.ai.biggerbrain.objective.CryAtEntity
|
||||
import com.cobblemon.mod.common.api.ai.biggerbrain.objective.Cry
|
||||
import com.cobblemon.mod.common.api.ai.biggerbrain.objective.DefendNest
|
||||
import com.cobblemon.mod.common.api.ai.biggerbrain.objective.EggRecovery
|
||||
import com.cobblemon.mod.common.api.ai.biggerbrain.objective.Defensive
|
||||
@@ -99,7 +99,7 @@ interface ObjectiveConfig {
|
||||
cobblemonResource("seek_shelter") to SeekShelter.Config::class.java,
|
||||
cobblemonResource("avoid_light") to AvoidLight.Config::class.java,
|
||||
cobblemonResource("face_sun") to FaceSun.Config::class.java,
|
||||
cobblemonResource("cry_at_entity") to CryAtEntity.Config::class.java
|
||||
cobblemonResource("cry") to Cry.Config::class.java
|
||||
)
|
||||
}
|
||||
|
||||
|
||||
@@ -69,14 +69,6 @@
|
||||
"behaviours": [
|
||||
"cobblemon:pokemon_dances"
|
||||
]
|
||||
},
|
||||
{
|
||||
"type": "cobblemon:add_objectives",
|
||||
"objectivesByPriority": {
|
||||
"0": [
|
||||
"cobblemon:cry_at_entity"
|
||||
]
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
+17
@@ -0,0 +1,17 @@
|
||||
{
|
||||
"name": "cobblemon.brain_preset.pokemon.pokemon_cries_at_entities.name",
|
||||
"description": "cobblemon.brain_preset.pokemon.pokemon_cries_at_entities.desc",
|
||||
"configurations": [
|
||||
{
|
||||
"type": "cobblemon:add_objectives",
|
||||
"objectivesByPriority": {
|
||||
"0": [
|
||||
{
|
||||
"type": "cobblemon:cry",
|
||||
"atEntities": true
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1,18 @@
|
||||
{
|
||||
"name": "cobblemon.brain_preset.pokemon.pokemon_cries_both.name",
|
||||
"description": "cobblemon.brain_preset.pokemon.pokemon_cries_both.desc",
|
||||
"configurations": [
|
||||
{
|
||||
"type": "cobblemon:add_objectives",
|
||||
"objectivesByPriority": {
|
||||
"0": [
|
||||
{
|
||||
"type": "cobblemon:cry",
|
||||
"atEntities": true,
|
||||
"atRandom": true
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
+17
@@ -0,0 +1,17 @@
|
||||
{
|
||||
"name": "cobblemon.brain_preset.pokemon.pokemon_cries_randomly.name",
|
||||
"description": "cobblemon.brain_preset.pokemon.pokemon_cries_randomly.desc",
|
||||
"configurations": [
|
||||
{
|
||||
"type": "cobblemon:add_objectives",
|
||||
"objectivesByPriority": {
|
||||
"0": [
|
||||
{
|
||||
"type": "cobblemon:cry",
|
||||
"atRandom": true
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -247,5 +247,13 @@
|
||||
"nestTypes": [
|
||||
"rocky",
|
||||
"sandy"
|
||||
],
|
||||
"ai": [
|
||||
{
|
||||
"type": "apply_behaviours",
|
||||
"behaviours": [
|
||||
"cobblemon:pokemon_cries_at_entities"
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -348,7 +348,8 @@
|
||||
{
|
||||
"type": "apply_behaviours",
|
||||
"behaviours": [
|
||||
"cobblemon:pokemon_avoids_rain"
|
||||
"cobblemon:pokemon_avoids_rain",
|
||||
"cobblemon:pokemon_cries_both"
|
||||
]
|
||||
}
|
||||
]
|
||||
|
||||
@@ -466,5 +466,13 @@
|
||||
"nestTypes": [
|
||||
"sandy",
|
||||
"watery"
|
||||
],
|
||||
"ai": [
|
||||
{
|
||||
"type": "apply_behaviours",
|
||||
"behaviours": [
|
||||
"cobblemon:pokemon_cries_at_entities"
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -247,5 +247,13 @@
|
||||
],
|
||||
"nestTypes": [
|
||||
"grassy"
|
||||
],
|
||||
"ai": [
|
||||
{
|
||||
"type": "apply_behaviours",
|
||||
"behaviours": [
|
||||
"cobblemon:pokemon_cries_at_entities"
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -281,5 +281,13 @@
|
||||
"nestTypes": [
|
||||
"grassy",
|
||||
"leafy"
|
||||
],
|
||||
"ai": [
|
||||
{
|
||||
"type": "apply_behaviours",
|
||||
"behaviours": [
|
||||
"cobblemon:pokemon_cries_both"
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -128,5 +128,13 @@
|
||||
"nestTypes": [
|
||||
"grassy",
|
||||
"leafy"
|
||||
],
|
||||
"ai": [
|
||||
{
|
||||
"type": "apply_behaviours",
|
||||
"behaviours": [
|
||||
"cobblemon:pokemon_cries_both"
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -169,7 +169,8 @@
|
||||
{
|
||||
"type": "apply_behaviours",
|
||||
"behaviours": [
|
||||
"cobblemon:pokemon_avoids_rain"
|
||||
"cobblemon:pokemon_avoids_rain",
|
||||
"cobblemon:pokemon_cries_at_entities"
|
||||
]
|
||||
}
|
||||
],
|
||||
|
||||
@@ -283,7 +283,8 @@
|
||||
{
|
||||
"type": "apply_behaviours",
|
||||
"behaviours": [
|
||||
"cobblemon:pokemon_avoids_rain"
|
||||
"cobblemon:pokemon_avoids_rain",
|
||||
"cobblemon:pokemon_cries_at_entities"
|
||||
]
|
||||
}
|
||||
]
|
||||
|
||||
@@ -276,7 +276,8 @@
|
||||
{
|
||||
"type": "apply_behaviours",
|
||||
"behaviours": [
|
||||
"cobblemon:pokemon_avoids_rain"
|
||||
"cobblemon:pokemon_avoids_rain",
|
||||
"cobblemon:pokemon_cries_at_entities"
|
||||
]
|
||||
}
|
||||
]
|
||||
|
||||
@@ -334,5 +334,13 @@
|
||||
"nestTypes": [
|
||||
"rocky",
|
||||
"shroomy"
|
||||
],
|
||||
"ai": [
|
||||
{
|
||||
"type": "apply_behaviours",
|
||||
"behaviours": [
|
||||
"cobblemon:pokemon_cries_at_entities"
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -340,5 +340,13 @@
|
||||
"nestTypes": [
|
||||
"rocky",
|
||||
"shroomy"
|
||||
],
|
||||
"ai": [
|
||||
{
|
||||
"type": "apply_behaviours",
|
||||
"behaviours": [
|
||||
"cobblemon:pokemon_cries_at_entities"
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -412,5 +412,13 @@
|
||||
"nestTypes": [
|
||||
"rocky",
|
||||
"sandy"
|
||||
],
|
||||
"ai": [
|
||||
{
|
||||
"type": "apply_behaviours",
|
||||
"behaviours": [
|
||||
"cobblemon:pokemon_cries_at_entities"
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -307,5 +307,13 @@
|
||||
"evolutions": [],
|
||||
"nestTypes": [
|
||||
"icy"
|
||||
],
|
||||
"ai": [
|
||||
{
|
||||
"type": "apply_behaviours",
|
||||
"behaviours": [
|
||||
"cobblemon:pokemon_cries_at_entities"
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -153,5 +153,13 @@
|
||||
"shroomy",
|
||||
"twiggy",
|
||||
"watery"
|
||||
],
|
||||
"ai": [
|
||||
{
|
||||
"type": "apply_behaviours",
|
||||
"behaviours": [
|
||||
"cobblemon:pokemon_cries_both"
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -311,5 +311,13 @@
|
||||
"nestTypes": [
|
||||
"rocky",
|
||||
"watery"
|
||||
],
|
||||
"ai": [
|
||||
{
|
||||
"type": "apply_behaviours",
|
||||
"behaviours": [
|
||||
"cobblemon:pokemon_cries_at_entities"
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -419,5 +419,13 @@
|
||||
"nestTypes": [
|
||||
"rocky",
|
||||
"watery"
|
||||
],
|
||||
"ai": [
|
||||
{
|
||||
"type": "apply_behaviours",
|
||||
"behaviours": [
|
||||
"cobblemon:pokemon_cries_at_entities"
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -286,5 +286,13 @@
|
||||
"nestTypes": [
|
||||
"rocky",
|
||||
"watery"
|
||||
],
|
||||
"ai": [
|
||||
{
|
||||
"type": "apply_behaviours",
|
||||
"behaviours": [
|
||||
"cobblemon:pokemon_cries_at_entities"
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -360,5 +360,13 @@
|
||||
},
|
||||
"nestTypes": [
|
||||
"grassy"
|
||||
],
|
||||
"ai": [
|
||||
{
|
||||
"type": "apply_behaviours",
|
||||
"behaviours": [
|
||||
"cobblemon:pokemon_cries_at_entities"
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -251,5 +251,13 @@
|
||||
"nestTypes": [
|
||||
"rocky",
|
||||
"sandy"
|
||||
],
|
||||
"ai": [
|
||||
{
|
||||
"type": "apply_behaviours",
|
||||
"behaviours": [
|
||||
"cobblemon:pokemon_cries_at_entities"
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -446,11 +446,27 @@
|
||||
},
|
||||
"nestTypes": [
|
||||
"twiggy"
|
||||
],
|
||||
"ai": [
|
||||
{
|
||||
"type": "apply_behaviours",
|
||||
"behaviours": [
|
||||
"cobblemon:pokemon_cries_both"
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
],
|
||||
"nestTypes": [
|
||||
"twiggy",
|
||||
"watery"
|
||||
],
|
||||
"ai": [
|
||||
{
|
||||
"type": "apply_behaviours",
|
||||
"behaviours": [
|
||||
"cobblemon:pokemon_cries_both"
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -255,7 +255,8 @@
|
||||
{
|
||||
"type": "apply_behaviours",
|
||||
"behaviours": [
|
||||
"cobblemon:pokemon_avoids_rain"
|
||||
"cobblemon:pokemon_avoids_rain",
|
||||
"cobblemon:pokemon_cries_randomly"
|
||||
]
|
||||
}
|
||||
]
|
||||
|
||||
@@ -454,10 +454,26 @@
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
},
|
||||
"ai": [
|
||||
{
|
||||
"type": "apply_behaviours",
|
||||
"behaviours": [
|
||||
"cobblemon:pokemon_cries_both"
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
],
|
||||
"nestTypes": [
|
||||
"watery"
|
||||
],
|
||||
"ai": [
|
||||
{
|
||||
"type": "apply_behaviours",
|
||||
"behaviours": [
|
||||
"cobblemon:pokemon_cries_both"
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -124,6 +124,12 @@
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
{
|
||||
"type": "apply_behaviours",
|
||||
"behaviours": [
|
||||
"cobblemon:pokemon_cries_at_entities"
|
||||
]
|
||||
}
|
||||
],
|
||||
"drops": {
|
||||
@@ -437,6 +443,14 @@
|
||||
"nestTypes": [
|
||||
"fiery",
|
||||
"rocky"
|
||||
],
|
||||
"ai": [
|
||||
{
|
||||
"type": "apply_behaviours",
|
||||
"behaviours": [
|
||||
"cobblemon:pokemon_cries_at_entities"
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
],
|
||||
|
||||
@@ -223,5 +223,13 @@
|
||||
],
|
||||
"nestTypes": [
|
||||
"watery"
|
||||
],
|
||||
"ai": [
|
||||
{
|
||||
"type": "apply_behaviours",
|
||||
"behaviours": [
|
||||
"cobblemon:pokemon_cries_at_entities"
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -249,5 +249,13 @@
|
||||
],
|
||||
"nestTypes": [
|
||||
"grassy"
|
||||
],
|
||||
"ai": [
|
||||
{
|
||||
"type": "apply_behaviours",
|
||||
"behaviours": [
|
||||
"cobblemon:pokemon_cries_at_entities"
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -245,5 +245,13 @@
|
||||
"nestTypes": [
|
||||
"rocky",
|
||||
"watery"
|
||||
],
|
||||
"ai": [
|
||||
{
|
||||
"type": "apply_behaviours",
|
||||
"behaviours": [
|
||||
"cobblemon:pokemon_cries_at_entities"
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -256,5 +256,13 @@
|
||||
"nestTypes": [
|
||||
"rocky",
|
||||
"watery"
|
||||
],
|
||||
"ai": [
|
||||
{
|
||||
"type": "apply_behaviours",
|
||||
"behaviours": [
|
||||
"cobblemon:pokemon_cries_at_entities"
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -258,5 +258,13 @@
|
||||
"rocky",
|
||||
"sandy",
|
||||
"watery"
|
||||
],
|
||||
"ai": [
|
||||
{
|
||||
"type": "apply_behaviours",
|
||||
"behaviours": [
|
||||
"cobblemon:pokemon_cries_both"
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -301,5 +301,13 @@
|
||||
"leafy",
|
||||
"rocky",
|
||||
"shroomy"
|
||||
],
|
||||
"ai": [
|
||||
{
|
||||
"type": "apply_behaviours",
|
||||
"behaviours": [
|
||||
"cobblemon:pokemon_cries_both"
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -234,5 +234,13 @@
|
||||
"rocky",
|
||||
"sandy",
|
||||
"watery"
|
||||
],
|
||||
"ai": [
|
||||
{
|
||||
"type": "apply_behaviours",
|
||||
"behaviours": [
|
||||
"cobblemon:pokemon_cries_both"
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -518,5 +518,13 @@
|
||||
"nestTypes": [
|
||||
"rocky",
|
||||
"sandy"
|
||||
],
|
||||
"ai": [
|
||||
{
|
||||
"type": "apply_behaviours",
|
||||
"behaviours": [
|
||||
"cobblemon:pokemon_cries_at_entities"
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -235,5 +235,13 @@
|
||||
],
|
||||
"nestTypes": [
|
||||
"grassy"
|
||||
],
|
||||
"ai": [
|
||||
{
|
||||
"type": "apply_behaviours",
|
||||
"behaviours": [
|
||||
"cobblemon:pokemon_cries_at_entities"
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -239,5 +239,13 @@
|
||||
],
|
||||
"nestTypes": [
|
||||
"grassy"
|
||||
],
|
||||
"ai": [
|
||||
{
|
||||
"type": "apply_behaviours",
|
||||
"behaviours": [
|
||||
"cobblemon:pokemon_cries_at_entities"
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -230,5 +230,13 @@
|
||||
],
|
||||
"nestTypes": [
|
||||
"grassy"
|
||||
],
|
||||
"ai": [
|
||||
{
|
||||
"type": "apply_behaviours",
|
||||
"behaviours": [
|
||||
"cobblemon:pokemon_cries_at_entities"
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -224,5 +224,13 @@
|
||||
],
|
||||
"nestTypes": [
|
||||
"grassy"
|
||||
],
|
||||
"ai": [
|
||||
{
|
||||
"type": "apply_behaviours",
|
||||
"behaviours": [
|
||||
"cobblemon:pokemon_cries_at_entities"
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -231,5 +231,13 @@
|
||||
],
|
||||
"nestTypes": [
|
||||
"watery"
|
||||
],
|
||||
"ai": [
|
||||
{
|
||||
"type": "apply_behaviours",
|
||||
"behaviours": [
|
||||
"cobblemon:pokemon_cries_at_entities"
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -251,5 +251,13 @@
|
||||
},
|
||||
"nestTypes": [
|
||||
"watery"
|
||||
],
|
||||
"ai": [
|
||||
{
|
||||
"type": "apply_behaviours",
|
||||
"behaviours": [
|
||||
"cobblemon:pokemon_cries_at_entities"
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -172,6 +172,12 @@
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
{
|
||||
"type": "apply_behaviours",
|
||||
"behaviours": [
|
||||
"cobblemon:pokemon_cries_randomly"
|
||||
]
|
||||
}
|
||||
],
|
||||
"drops": {
|
||||
|
||||
@@ -113,6 +113,12 @@
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
{
|
||||
"type": "apply_behaviours",
|
||||
"behaviours": [
|
||||
"cobblemon:pokemon_cries_randomly"
|
||||
]
|
||||
}
|
||||
],
|
||||
"drops": {
|
||||
|
||||
@@ -245,5 +245,13 @@
|
||||
],
|
||||
"nestTypes": [
|
||||
"twiggy"
|
||||
],
|
||||
"ai": [
|
||||
{
|
||||
"type": "apply_behaviours",
|
||||
"behaviours": [
|
||||
"cobblemon:pokemon_cries_randomly"
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -432,5 +432,13 @@
|
||||
"grassy",
|
||||
"leafy",
|
||||
"twiggy"
|
||||
],
|
||||
"ai": [
|
||||
{
|
||||
"type": "apply_behaviours",
|
||||
"behaviours": [
|
||||
"cobblemon:pokemon_cries_at_entities"
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -415,6 +415,14 @@
|
||||
},
|
||||
"nestTypes": [
|
||||
"grassy"
|
||||
],
|
||||
"ai": [
|
||||
{
|
||||
"type": "apply_behaviours",
|
||||
"behaviours": [
|
||||
"cobblemon:pokemon_cries_at_entities"
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
],
|
||||
@@ -430,7 +438,8 @@
|
||||
{
|
||||
"type": "apply_behaviours",
|
||||
"behaviours": [
|
||||
"cobblemon:pokemon_avoids_rain"
|
||||
"cobblemon:pokemon_avoids_rain",
|
||||
"cobblemon:pokemon_cries_at_entities"
|
||||
]
|
||||
}
|
||||
]
|
||||
|
||||
@@ -579,6 +579,14 @@
|
||||
"leafy",
|
||||
"sandy",
|
||||
"twiggy"
|
||||
],
|
||||
"ai": [
|
||||
{
|
||||
"type": "apply_behaviours",
|
||||
"behaviours": [
|
||||
"cobblemon:pokemon_cries_at_entities"
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
],
|
||||
@@ -586,5 +594,13 @@
|
||||
"grassy",
|
||||
"leafy",
|
||||
"twiggy"
|
||||
],
|
||||
"ai": [
|
||||
{
|
||||
"type": "apply_behaviours",
|
||||
"behaviours": [
|
||||
"cobblemon:pokemon_cries_at_entities"
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -433,6 +433,14 @@
|
||||
},
|
||||
"nestTypes": [
|
||||
"grassy"
|
||||
],
|
||||
"ai": [
|
||||
{
|
||||
"type": "apply_behaviours",
|
||||
"behaviours": [
|
||||
"cobblemon:pokemon_cries_at_entities"
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
],
|
||||
@@ -471,7 +479,8 @@
|
||||
{
|
||||
"type": "apply_behaviours",
|
||||
"behaviours": [
|
||||
"cobblemon:pokemon_avoids_rain"
|
||||
"cobblemon:pokemon_avoids_rain",
|
||||
"cobblemon:pokemon_cries_at_entities"
|
||||
]
|
||||
}
|
||||
]
|
||||
|
||||
@@ -437,10 +437,26 @@
|
||||
"nestTypes": [
|
||||
"grassy",
|
||||
"rocky"
|
||||
],
|
||||
"ai": [
|
||||
{
|
||||
"type": "apply_behaviours",
|
||||
"behaviours": [
|
||||
"cobblemon:pokemon_cries_at_entities"
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
],
|
||||
"nestTypes": [
|
||||
"grassy"
|
||||
],
|
||||
"ai": [
|
||||
{
|
||||
"type": "apply_behaviours",
|
||||
"behaviours": [
|
||||
"cobblemon:pokemon_cries_at_entities"
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -443,10 +443,26 @@
|
||||
"nestTypes": [
|
||||
"grassy",
|
||||
"rocky"
|
||||
],
|
||||
"ai": [
|
||||
{
|
||||
"type": "apply_behaviours",
|
||||
"behaviours": [
|
||||
"cobblemon:pokemon_cries_at_entities"
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
],
|
||||
"nestTypes": [
|
||||
"grassy"
|
||||
],
|
||||
"ai": [
|
||||
{
|
||||
"type": "apply_behaviours",
|
||||
"behaviours": [
|
||||
"cobblemon:pokemon_cries_at_entities"
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -502,11 +502,27 @@
|
||||
"nestTypes": [
|
||||
"icy",
|
||||
"rocky"
|
||||
],
|
||||
"ai": [
|
||||
{
|
||||
"type": "apply_behaviours",
|
||||
"behaviours": [
|
||||
"cobblemon:pokemon_cries_at_entities"
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
],
|
||||
"nestTypes": [
|
||||
"rocky",
|
||||
"sandy"
|
||||
],
|
||||
"ai": [
|
||||
{
|
||||
"type": "apply_behaviours",
|
||||
"behaviours": [
|
||||
"cobblemon:pokemon_cries_at_entities"
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -494,11 +494,27 @@
|
||||
"nestTypes": [
|
||||
"icy",
|
||||
"rocky"
|
||||
],
|
||||
"ai": [
|
||||
{
|
||||
"type": "apply_behaviours",
|
||||
"behaviours": [
|
||||
"cobblemon:pokemon_cries_at_entities"
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
],
|
||||
"nestTypes": [
|
||||
"rocky",
|
||||
"sandy"
|
||||
],
|
||||
"ai": [
|
||||
{
|
||||
"type": "apply_behaviours",
|
||||
"behaviours": [
|
||||
"cobblemon:pokemon_cries_at_entities"
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -255,5 +255,13 @@
|
||||
],
|
||||
"nestTypes": [
|
||||
"icy"
|
||||
],
|
||||
"ai": [
|
||||
{
|
||||
"type": "apply_behaviours",
|
||||
"behaviours": [
|
||||
"cobblemon:pokemon_cries_at_entities"
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -519,10 +519,26 @@
|
||||
},
|
||||
"nestTypes": [
|
||||
"sandy"
|
||||
],
|
||||
"ai": [
|
||||
{
|
||||
"type": "apply_behaviours",
|
||||
"behaviours": [
|
||||
"cobblemon:pokemon_cries_both"
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
],
|
||||
"nestTypes": [
|
||||
"sandy"
|
||||
],
|
||||
"ai": [
|
||||
{
|
||||
"type": "apply_behaviours",
|
||||
"behaviours": [
|
||||
"cobblemon:pokemon_cries_both"
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -359,5 +359,13 @@
|
||||
"nestTypes": [
|
||||
"grassy",
|
||||
"leafy"
|
||||
],
|
||||
"ai": [
|
||||
{
|
||||
"type": "apply_behaviours",
|
||||
"behaviours": [
|
||||
"cobblemon:pokemon_cries_randomly"
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -216,5 +216,13 @@
|
||||
"nestTypes": [
|
||||
"rocky",
|
||||
"twiggy"
|
||||
],
|
||||
"ai": [
|
||||
{
|
||||
"type": "apply_behaviours",
|
||||
"behaviours": [
|
||||
"cobblemon:pokemon_cries_randomly"
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -279,5 +279,13 @@
|
||||
"nestTypes": [
|
||||
"sandy",
|
||||
"watery"
|
||||
],
|
||||
"ai": [
|
||||
{
|
||||
"type": "apply_behaviours",
|
||||
"behaviours": [
|
||||
"cobblemon:pokemon_cries_at_entities"
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -453,6 +453,14 @@
|
||||
"battleOnly": false,
|
||||
"nestTypes": [
|
||||
"grassy"
|
||||
],
|
||||
"ai": [
|
||||
{
|
||||
"type": "apply_behaviours",
|
||||
"behaviours": [
|
||||
"cobblemon:pokemon_cries_at_entities"
|
||||
]
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
@@ -632,6 +640,14 @@
|
||||
"nestTypes": [
|
||||
"fiery",
|
||||
"grassy"
|
||||
],
|
||||
"ai": [
|
||||
{
|
||||
"type": "apply_behaviours",
|
||||
"behaviours": [
|
||||
"cobblemon:pokemon_cries_at_entities"
|
||||
]
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
@@ -827,6 +843,14 @@
|
||||
"nestTypes": [
|
||||
"grassy",
|
||||
"watery"
|
||||
],
|
||||
"ai": [
|
||||
{
|
||||
"type": "apply_behaviours",
|
||||
"behaviours": [
|
||||
"cobblemon:pokemon_cries_at_entities"
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
],
|
||||
@@ -836,5 +860,13 @@
|
||||
],
|
||||
"nestTypes": [
|
||||
"grassy"
|
||||
],
|
||||
"ai": [
|
||||
{
|
||||
"type": "apply_behaviours",
|
||||
"behaviours": [
|
||||
"cobblemon:pokemon_cries_at_entities"
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -374,5 +374,13 @@
|
||||
"swimmingEyeHeight": 0.4,
|
||||
"nestTypes": [
|
||||
"grassy"
|
||||
],
|
||||
"ai": [
|
||||
{
|
||||
"type": "apply_behaviours",
|
||||
"behaviours": [
|
||||
"cobblemon:pokemon_cries_at_entities"
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -109,7 +109,8 @@
|
||||
{
|
||||
"type": "apply_behaviours",
|
||||
"behaviours": [
|
||||
"cobblemon:pokemon_fox"
|
||||
"cobblemon:pokemon_fox",
|
||||
"cobblemon:pokemon_cries_both"
|
||||
]
|
||||
}
|
||||
],
|
||||
|
||||
@@ -275,5 +275,13 @@
|
||||
"nestTypes": [
|
||||
"sandy",
|
||||
"watery"
|
||||
],
|
||||
"ai": [
|
||||
{
|
||||
"type": "apply_behaviours",
|
||||
"behaviours": [
|
||||
"cobblemon:pokemon_cries_at_entities"
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -132,5 +132,13 @@
|
||||
"nestTypes": [
|
||||
"grassy",
|
||||
"leafy"
|
||||
],
|
||||
"ai": [
|
||||
{
|
||||
"type": "apply_behaviours",
|
||||
"behaviours": [
|
||||
"cobblemon:pokemon_cries_both"
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -440,6 +440,14 @@
|
||||
"leafy",
|
||||
"rocky",
|
||||
"shroomy"
|
||||
],
|
||||
"ai": [
|
||||
{
|
||||
"type": "apply_behaviours",
|
||||
"behaviours": [
|
||||
"cobblemon:pokemon_cries_both"
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
],
|
||||
@@ -468,5 +476,13 @@
|
||||
"leafy",
|
||||
"rocky",
|
||||
"shroomy"
|
||||
],
|
||||
"ai": [
|
||||
{
|
||||
"type": "apply_behaviours",
|
||||
"behaviours": [
|
||||
"cobblemon:pokemon_cries_both"
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -258,7 +258,8 @@
|
||||
{
|
||||
"type": "apply_behaviours",
|
||||
"behaviours": [
|
||||
"cobblemon:pokemon_avoids_rain"
|
||||
"cobblemon:pokemon_avoids_rain",
|
||||
"cobblemon:pokemon_cries_randomly"
|
||||
]
|
||||
}
|
||||
]
|
||||
|
||||
@@ -398,10 +398,36 @@ ai_behaviour_mapping = {
|
||||
'faces_sun': 'cobblemon:pokemon_faces_sun'
|
||||
}
|
||||
|
||||
CRY_RANDOM = 'cobblemon:pokemon_cries_randomly'
|
||||
CRY_ENTITIES = 'cobblemon:pokemon_cries_at_entities'
|
||||
CRY_BOTH = 'cobblemon:pokemon_cries_both'
|
||||
cry_behaviours = {CRY_RANDOM, CRY_ENTITIES, CRY_BOTH}
|
||||
|
||||
def to_bool(value):
|
||||
if isinstance(value, bool):
|
||||
return value
|
||||
return str(value).strip().lower() in ('true', '1', 'yes', 'y', 'x')
|
||||
|
||||
def get_cry_behaviour(behaviour_row):
|
||||
random_cry = to_bool(behaviour_row.get('Cry (Random)', False))
|
||||
entity_cry = to_bool(behaviour_row.get('Cry (Entities)', False))
|
||||
if random_cry and entity_cry:
|
||||
return CRY_BOTH
|
||||
if random_cry:
|
||||
return CRY_RANDOM
|
||||
if entity_cry:
|
||||
return CRY_ENTITIES
|
||||
return None
|
||||
|
||||
def build_species_specific(behaviour_row, ai):
|
||||
specific = behaviour_row['Species Specific']
|
||||
wanted = [b for tag, b in ai_behaviour_mapping.items() if tag in specific]
|
||||
managed = set(ai_behaviour_mapping.values())
|
||||
|
||||
cry = get_cry_behaviour(behaviour_row)
|
||||
if cry:
|
||||
wanted.append(cry)
|
||||
|
||||
managed = set(ai_behaviour_mapping.values()) | cry_behaviours
|
||||
|
||||
ai = ai if isinstance(ai, list) else []
|
||||
entry = next((e for e in ai if e.get('type') == 'apply_behaviours'), None)
|
||||
|
||||
Reference in new issue
Block a user