refactor: Rapidash (+ galar) poser

This commit is contained in:
Gitoido Okaski committed 2026-11-11 20:37:58 +03:00
1 parent ca4f50b973
commit 4cd3e05028
5 files changed
+133 -178

No files matched your search

@@ -1,83 +0,0 @@
/*
* Copyright (C) 2023 Cobblemon Contributors
*
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at https://mozilla.org/MPL/2.0/.
*/
package com.cobblemon.mod.common.client.render.models.blockbench.pokemon.gen1
import com.cobblemon.mod.common.client.render.models.blockbench.frame.HeadedFrame
import com.cobblemon.mod.common.client.render.models.blockbench.frame.QuadrupedFrame
import com.cobblemon.mod.common.client.render.models.blockbench.pokemon.CryProvider
import com.cobblemon.mod.common.client.render.models.blockbench.pokemon.PokemonPosableModel
import com.cobblemon.mod.common.client.render.models.blockbench.pose.CobblemonPose
import com.cobblemon.mod.common.entity.PoseType
import com.cobblemon.mod.common.util.isBattling
import net.minecraft.client.model.geom.ModelPart
import net.minecraft.world.phys.Vec3
class RapidashGalarianModel (root: ModelPart) : PokemonPosableModel(root), HeadedFrame, QuadrupedFrame {
override val rootPart = root.registerChildWithAllChildren("rapidash_galar")
override val head = getPart("neck")
override val foreLeftLeg = getPart("leg_front_left")
override val foreRightLeg = getPart("leg_front_right")
override val hindLeftLeg = getPart("leg_back_left")
override val hindRightLeg = getPart("leg_back_right")
override var portraitScale = 1.86F
override var portraitTranslation = Vec3(-0.5, 1.3, 0.0)
override var profileScale = 0.67F
override var profileTranslation = Vec3(0.0, 0.72, 0.0)
lateinit var standing: CobblemonPose
lateinit var walk: CobblemonPose
lateinit var battle_idle: CobblemonPose
override val cryAnimation = CryProvider { bedrockStateful("rapidash_galar", "cry") }
override fun registerPoses() {
val blink = quirk { bedrockStateful("rapidash_galar", "blink") }
standing = registerPose(
poseName = "standing",
poseTypes = PoseType.UI_POSES + PoseType.STATIONARY_POSES,
quirks = arrayOf(blink),
condition = { !it.isBattling },
animations = arrayOf(
singleBoneLook(),
bedrock("rapidash_galar", "ground_idle"),
bedrock("rapidash_galar", "hair")
)
)
walk = registerPose(
poseName = "walk",
poseTypes = PoseType.MOVING_POSES,
quirks = arrayOf(blink),
animations = arrayOf(
singleBoneLook(),
bedrock("rapidash_galar", "ground_walk"),
bedrock("rapidash_galar", "hair")
)
)
battle_idle = registerPose(
poseName = "battle_idle",
poseTypes = PoseType.STATIONARY_POSES,
condition = { it.isBattling },
animations = arrayOf(
singleBoneLook(),
bedrock("rapidash_galar", "battle_idle"),
bedrock("rapidash_galar", "hair")
)
)
}
// override fun getFaintAnimation(
// pokemonEntity: PokemonEntity,
// state: PosableState<PokemonEntity>
// ) = if (state.isPosedIn(standing, walk)) bedrockStateful("rapidash_galar", "faint") else null
}
@@ -1,93 +0,0 @@
/*
* Copyright (C) 2023 Cobblemon Contributors
*
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at https://mozilla.org/MPL/2.0/.
*/
package com.cobblemon.mod.common.client.render.models.blockbench.pokemon.gen1
import com.cobblemon.mod.common.client.render.models.blockbench.PosableState
import com.cobblemon.mod.common.client.render.models.blockbench.frame.HeadedFrame
import com.cobblemon.mod.common.client.render.models.blockbench.frame.QuadrupedFrame
import com.cobblemon.mod.common.client.render.models.blockbench.pokemon.CryProvider
import com.cobblemon.mod.common.client.render.models.blockbench.pokemon.PokemonPosableModel
import com.cobblemon.mod.common.client.render.models.blockbench.pose.Pose
import com.cobblemon.mod.common.entity.PoseType
import com.cobblemon.mod.common.entity.PoseType.Companion.MOVING_POSES
import com.cobblemon.mod.common.entity.PoseType.Companion.STATIONARY_POSES
import com.cobblemon.mod.common.entity.PoseType.Companion.UI_POSES
import com.cobblemon.mod.common.util.isBattling
import net.minecraft.client.model.geom.ModelPart
import net.minecraft.world.phys.Vec3
class RapidashModel(root: ModelPart) : PokemonPosableModel(root), HeadedFrame, QuadrupedFrame {
override val rootPart = root.registerChildWithAllChildren("rapidash")
override val head = getPart("head")
override val foreLeftLeg= getPart("leg_front_left")
override val foreRightLeg = getPart("leg_front_right")
override val hindLeftLeg = getPart("leg_back_left")
override val hindRightLeg = getPart("leg_back_right")
override var portraitScale = 2.5F
override var portraitTranslation = Vec3(-0.7, 1.11, 0.0)
override var profileScale = 0.75F
override var profileTranslation = Vec3(0.0, 0.65, 0.0)
lateinit var standing: Pose
lateinit var walk: Pose
lateinit var sleep: Pose
lateinit var battling: Pose
override val cryAnimation = CryProvider { bedrockStateful("rapidash", "cry") }
override fun registerPoses() {
val blink = quirk { bedrockStateful("rapidash", "blink") }
sleep = registerPose(
poseType = PoseType.SLEEP,
animations = arrayOf(bedrock("rapidash", "sleep"))
)
standing = registerPose(
poseName = "standing",
poseTypes = STATIONARY_POSES + UI_POSES,
transformTicks = 10,
condition = { !it.isBattling },
quirks = arrayOf(blink),
animations = arrayOf(
singleBoneLook(),
bedrock("rapidash", "ground_idle")
)
)
walk = registerPose(
poseName = "walk",
poseTypes = MOVING_POSES,
transformTicks = 10,
quirks = arrayOf(blink),
animations = arrayOf(
singleBoneLook(),
bedrock("rapidash", "ground_walk")
)
)
battling = registerPose(
poseName = "battlestanding",
poseTypes = STATIONARY_POSES,
transformTicks = 10,
quirks = arrayOf(blink),
condition = { it.isBattling },
animations = arrayOf(
singleBoneLook(),
bedrock("rapidash", "ground_idle")
)
)
}
override fun getFaintAnimation(state: PosableState) = if (state.isPosedIn(standing, walk, sleep)) bedrockStateful("rapidash", "faint") else
if (state.isPosedIn(battling)) bedrockStateful("rapidash", "battle_faint")
else null
}
@@ -239,7 +239,6 @@ object VaryingModelRepository {
inbuilt("lickitung", ::LickitungModel)
inbuilt("marowak", ::MarowakModel)
inbuilt("pinsir", ::PinsirModel)
inbuilt("rapidash", ::RapidashModel)
inbuilt("tangela", ::TangelaModel)
inbuilt("elekid", ::ElekidModel)
inbuilt("hitmontop", ::HitmontopModel)
@@ -372,7 +371,6 @@ object VaryingModelRepository {
inbuilt("bunnelby", ::BunnelbyModel)
inbuilt("arrokuda", ::ArrokudaModel)
inbuilt("barraskewda", ::BarraskewdaModel)
inbuilt("rapidash_galarian", ::RapidashGalarianModel)
inbuilt("volbeat", ::VolbeatModel)
inbuilt("illumise", ::IllumiseModel)
inbuilt("yamper", ::YamperModel)
@@ -0,0 +1,67 @@
{
"rootBone": "rapidash",
"portraitScale": 2.5,
"portraitTranslation": [
-0.7,
1.11,
0
],
"profileScale": 0.75,
"profileTranslation": [
0,
0.65,
0
],
"animations": {
"cry": "q.bedrock_stateful('rapidash', 'cry')",
"faint": "q.bedrock_stateful('rapidash', 'faint')"
},
"poses": {
"standing": {
"poseTypes": [
"STAND",
"FLOAT",
"HOVER",
"PROFILE",
"PORTRAIT"
],
"isBattle": false,
"animations": [
"q.look('neck')",
"q.bedrock('rapidash', 'ground_idle')"
],
"quirks": [
"q.bedrock_quirk('rapidash', 'blink')"
]
},
"walk": {
"poseTypes": [
"WALK",
"SWIM",
"FLY"
],
"animations": [
"q.look('neck')",
"q.bedrock('rapidash', 'ground_walk')"
],
"quirks": [
"q.bedrock_quirk('rapidash', 'blink')"
]
},
"battle-standing": {
"poseTypes": [
"STAND",
"FLOAT",
"HOVER"
],
"isBattle": true,
"namedAnimations": {
"faint": "q.bedrock_stateful('rapidash', 'battle_faint')"
},
"animations": [
"q.look('neck')",
"q.bedrock('rapidash', 'battle_idle')"
]
}
}
}
@@ -0,0 +1,66 @@
{
"rootBone": "rapidash_galar",
"portraitScale": 1.86,
"portraitTranslation": [
-0.5,
1.3,
0
],
"profileScale": 0.67,
"profileTranslation": [
0,
0.72,
0
],
"animations": {
"cry": "q.bedrock_stateful('rapidash', 'cry')"
},
"poses": {
"standing": {
"poseTypes": [
"STAND",
"FLOAT",
"HOVER",
"PROFILE",
"PORTRAIT"
],
"isBattle": false,
"animations": [
"q.look('neck')",
"q.bedrock('rapidash_galar', 'ground_idle')",
"q.bedrock('rapidash_galar', 'hair')"
],
"quirks": [
"q.bedrock_quirk('rapidash_galar', 'blink')"
]
},
"walk": {
"poseTypes": [
"WALK",
"SWIM",
"FLY"
],
"animations": [
"q.look('neck')",
"q.bedrock('rapidash_galar', 'ground_walk')",
"q.bedrock('rapidash_galar', 'hair')"
],
"quirks": [
"q.bedrock_quirk('rapidash_galar', 'blink')"
]
},
"battle-standing": {
"poseTypes": [
"STAND",
"FLOAT",
"HOVER"
],
"isBattle": true,
"animations": [
"q.look('neck')",
"q.bedrock('rapidash_galar', 'battle_idle')",
"q.bedrock('rapidash_galar', 'hair')"
]
}
}
}