forked from mirrors/cobblemon
Merge branch 'main-crab-1.8-fixes' into 'main'
1.8 fixes from QA Doc See merge request cable-mc/cobblemon!2230
This commit is contained in:
+5
@@ -142,6 +142,11 @@ class FishingSpawnCause(
|
||||
}
|
||||
pokemonEntity.pokemon.isAlpha = true
|
||||
pokemonEntity.pokemon.initializeMovesetWithRandomTm(2)
|
||||
if (!pokemonEntity.level().isClientSide) {
|
||||
// Alpha status is applied after entity creation in bait flows, so rebuild the brain
|
||||
// to ensure alpha-only sensors/memories are actually attached.
|
||||
pokemonEntity.remakeBrain()
|
||||
}
|
||||
pokemonEntity.entityData.set(PokemonEntity.IS_ALPHA, true)
|
||||
}
|
||||
|
||||
|
||||
@@ -259,7 +259,7 @@ class CobblemonConfig {
|
||||
var babyPokemonLevelDuration = 9
|
||||
|
||||
@CobblemonConfigField(Category.Pokemon, lang = "baby_pokemon_size_multiplier", SERVER)
|
||||
var babyPokemonSizeMultiplier = 0.8F
|
||||
var babyPokemonSizeMultiplier = 0.9F
|
||||
|
||||
@CobblemonConfigField(Category.Pokemon, lang = "minimum_riding_scale", SERVER)
|
||||
var minimumRidingScale = 0.75F
|
||||
|
||||
@@ -1900,12 +1900,38 @@ open class Pokemon : ShowdownIdentifiable {
|
||||
}
|
||||
|
||||
tmMoves.shuffle()
|
||||
val count = min(numTMMoves, tmMoves.size)
|
||||
val tmCount = min(numTMMoves, tmMoves.size)
|
||||
moveSet.doWithoutEmitting {
|
||||
moveSet.clear()
|
||||
for (i in 0 until count) {
|
||||
moveSet.setMove(i, tmMoves[i].create())
|
||||
val selectedMoves = mutableSetOf<MoveTemplate>()
|
||||
for (i in 0 until tmCount) {
|
||||
val selectedTm = tmMoves[i]
|
||||
moveSet.setMove(i, selectedTm.create())
|
||||
moveSet[i]?.update()
|
||||
selectedMoves.add(selectedTm)
|
||||
}
|
||||
|
||||
// Fill blank moveset slots with random benched moves
|
||||
if (tmCount < MoveSet.MOVE_COUNT) {
|
||||
val benchedCandidates = benchedMoves
|
||||
.filter { benchedMove ->
|
||||
benchedMove.moveTemplate !is MoveTemplate.Dummy &&
|
||||
benchedMove.moveTemplate !in selectedMoves
|
||||
}
|
||||
.distinctBy { it.moveTemplate }
|
||||
.shuffled()
|
||||
|
||||
var nextMoveSlot = tmCount
|
||||
for (benchedMove in benchedCandidates) {
|
||||
if (nextMoveSlot >= MoveSet.MOVE_COUNT) {
|
||||
break
|
||||
}
|
||||
|
||||
moveSet.setMove(nextMoveSlot, Move(benchedMove.moveTemplate, benchedMove.ppRaisedStages))
|
||||
moveSet[nextMoveSlot]?.update()
|
||||
selectedMoves.add(benchedMove.moveTemplate)
|
||||
nextMoveSlot++
|
||||
}
|
||||
}
|
||||
}
|
||||
moveSet.update()
|
||||
|
||||
Reference in New Issue
Block a user