Merge branch 'alpha-bait-changes' into 'main'

Size Modifying Bait effect

See merge request cable-mc/cobblemon!2237
This commit is contained in:
Polymeta
2026-04-30 21:55:18 +00:00
6 changed files with 14 additions and 6 deletions
@@ -75,6 +75,7 @@ class SpawnBait(
val POKEMON_CHANCE = cobblemonResource("pokemon_chance")
val FRIENDSHIP = cobblemonResource("friendship")
val RARITY_BUCKET = cobblemonResource("rarity_bucket")
val SIZE = cobblemonResource("size")
fun registerEffect(type: ResourceLocation, effect: (PokemonEntity, Effect) -> Unit) {
EFFECT_FUNCTIONS[type] = effect
@@ -95,6 +96,7 @@ class SpawnBait(
registerEffect(HIDDEN_ABILITY_CHANCE) { entity, _ -> FishingSpawnCause.alterHAAttempt(entity) }
registerEffect(ALPHA_CHANCE) { entity, effect -> FishingSpawnCause.alterAlphaAttempt(entity) }
registerEffect(FRIENDSHIP) { entity, effect -> FishingSpawnCause.alterFriendshipAttempt(entity, effect) }
registerEffect(SIZE) { entity, effect -> FishingSpawnCause.alterSize(entity, effect) }
CobblemonEvents.BAIT_EFFECT_REGISTRATION.post(BaitEffectFunctionRegistryEvent()) { event ->
event.functions.forEach { (type, function) -> registerEffect(type, function) }
}
@@ -70,6 +70,10 @@ class FishingSpawnCause(
pokemonEntity.pokemon.applyPotentialMarks(1.0 + (effect.value / 100))
}
fun alterSize(pokemonEntity: PokemonEntity, effect: SpawnBait.Effect) {
pokemonEntity.pokemon.scaleModifier *= effect.value.toFloat() / 1000.0f
}
fun saveDropsReroll(pokemonEntity: PokemonEntity, effect: SpawnBait.Effect) {
pokemonEntity.pokemon.forcedAspects += DROPS_REROLL_ASPECT
}
@@ -160,8 +160,9 @@ fun generateAdditionalBaitEffectTooltip(stack: ItemStack): MutableList<Component
val effectSubcategory = effect.subcategory?.path
val effectChance = effect.chance * 100
var effectValue = when (effectType) {
"bite_time" -> (effect.value * 100).toInt()
"shiny_reroll" -> (effect.value + 1).toInt()
SpawnBait.Effects.BITE_TIME.path -> (effect.value * 100).toInt()
SpawnBait.Effects.SHINY_REROLL.path -> (effect.value + 1).toInt()
SpawnBait.Effects.SIZE.path -> (effect.value / 100.0).toDouble()
else -> effect.value.toInt()
}
@@ -1084,6 +1084,7 @@
"cobblemon.fishing_bait_effects.pokemon_chance.tooltip": "%1$s%% - Reel in a Pokémon",
"cobblemon.fishing_bait_effects.friendship.tooltip": "%1$s%% - Boost Friendship +%3$s",
"cobblemon.fishing_bait_effects.rarity_bucket.tooltip": "%1$s%% - Boost Rarity Bucket +%3$s Tiers",
"cobblemon.fishing_bait_effects.size.tooltip": "%1$s%% - Modify Size by %3$s%%",
"cobblemon.fishing_bait_effects.inert.tooltip": "No known effect",
"cobblemon.technical_machine_effect_header": "Technical Machine info:",
@@ -2,9 +2,9 @@
"item": "cobblemon:jaboca_berry",
"effects": [
{
"type": "cobblemon:friendship",
"type": "cobblemon:size",
"chance": 1.0,
"value": 100.0
"value": 50.0
}
]
}
@@ -2,9 +2,9 @@
"item": "cobblemon:rowap_berry",
"effects": [
{
"type": "cobblemon:drops_reroll",
"type": "cobblemon:size",
"chance": 1.0,
"value": 1.0
"value": -50.0
}
]
}