mirror of
https://gitlab.com/cable-mc/cobblemon.git
synced 2026-11-20 07:08:53 -05:00
refactor: Doduo poser
This commit is contained in:
1 parent
5c0a46907e
commit
0c8239b85e
3 files changed
+82
-86
No files matched your search
-85
@@ -1,85 +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.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.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 DoduoModel (root: ModelPart) : PokemonPosableModel(root) {
|
||||
override val rootPart = root.registerChildWithAllChildren("doduo")
|
||||
|
||||
override var portraitScale = 2.0F
|
||||
override var portraitTranslation = Vec3(-0.1, 0.35, 0.0)
|
||||
|
||||
override var profileScale = 0.85F
|
||||
override var profileTranslation = Vec3(0.0, 0.5, 0.0)
|
||||
|
||||
lateinit var standing: CobblemonPose
|
||||
lateinit var walking: CobblemonPose
|
||||
lateinit var sleep: CobblemonPose
|
||||
lateinit var battleidle: CobblemonPose
|
||||
|
||||
override val cryAnimation = CryProvider { bedrockStateful("doduo", "cry") }
|
||||
|
||||
override fun registerPoses() {
|
||||
val blink = quirk { bedrockStateful("doduo", "blink1") }
|
||||
val blink2 = quirk { bedrockStateful("doduo", "blink2") }
|
||||
val bite = quirk(secondsBetweenOccurrences = 5F to 20F) { bedrockStateful("doduo", "bite_quirk1") }
|
||||
val bite2 = quirk(secondsBetweenOccurrences = 5F to 20F) { bedrockStateful("doduo", "bite_quirk2") }
|
||||
|
||||
sleep = registerPose(
|
||||
poseType = PoseType.SLEEP,
|
||||
animations = arrayOf(bedrock("doduo", "sleep"))
|
||||
)
|
||||
|
||||
standing = registerPose(
|
||||
poseName = "standing",
|
||||
poseTypes = STATIONARY_POSES + UI_POSES,
|
||||
transformTicks = 10,
|
||||
condition = { !it.isBattling },
|
||||
quirks = arrayOf(blink, blink2),
|
||||
animations = arrayOf(
|
||||
bedrock("doduo", "ground_idle")
|
||||
)
|
||||
)
|
||||
|
||||
walking = registerPose(
|
||||
poseName = "walking",
|
||||
poseTypes = MOVING_POSES,
|
||||
transformTicks = 10,
|
||||
quirks = arrayOf(blink, blink2),
|
||||
animations = arrayOf(
|
||||
bedrock("doduo", "ground_walk")
|
||||
)
|
||||
)
|
||||
|
||||
battleidle = registerPose(
|
||||
poseName = "battle_idle",
|
||||
poseTypes = PoseType.STATIONARY_POSES,
|
||||
transformTicks = 10,
|
||||
quirks = arrayOf(blink, blink2, bite, bite2),
|
||||
condition = { it.isBattling },
|
||||
animations = arrayOf(
|
||||
bedrock("doduo", "battle_idle")
|
||||
)
|
||||
)
|
||||
}
|
||||
// override fun getFaintAnimation(
|
||||
// pokemonEntity: PokemonEntity,
|
||||
// state: PosableState<PokemonEntity>
|
||||
// ) = if (state.isPosedIn(standing, walking, battleidle, sleep)) bedrockStateful("doduo", "faint") else null
|
||||
}
|
||||
-1
@@ -223,7 +223,6 @@ object VaryingModelRepository {
|
||||
inbuilt("electrode", ::ElectrodeModel)
|
||||
inbuilt("cubone", ::CuboneModel)
|
||||
inbuilt("dodrio", ::DodrioModel)
|
||||
inbuilt("doduo", ::DoduoModel)
|
||||
inbuilt("electabuzz", ::ElectabuzzModel)
|
||||
inbuilt("exeggcute", ::ExeggcuteModel)
|
||||
inbuilt("exeggutor", ::ExeggutorModel)
|
||||
|
||||
+82
@@ -0,0 +1,82 @@
|
||||
{
|
||||
"rootBone": "doduo",
|
||||
"portraitScale": 2.0,
|
||||
"portraitTranslation": [
|
||||
-0.1,
|
||||
0.35,
|
||||
0
|
||||
],
|
||||
"profileScale": 0.85,
|
||||
"profileTranslation": [
|
||||
0,
|
||||
0.5,
|
||||
0
|
||||
],
|
||||
"animations": {
|
||||
"cry": "q.bedrock_stateful('doduo', 'cry')"
|
||||
},
|
||||
"poses": {
|
||||
"sleep": {
|
||||
"poseTypes": [
|
||||
"SLEEP"
|
||||
],
|
||||
"animations": [
|
||||
"q.bedrock('doduo', 'sleep')"
|
||||
]
|
||||
},
|
||||
"standing": {
|
||||
"poseTypes": [
|
||||
"STAND",
|
||||
"FLOAT",
|
||||
"HOVER",
|
||||
"PROFILE",
|
||||
"PORTRAIT"
|
||||
],
|
||||
"isBattle": false,
|
||||
"animations": [
|
||||
"q.look('head')",
|
||||
"q.bedrock('doduo', 'ground_idle')"
|
||||
],
|
||||
"transformTicks": 10,
|
||||
"quirks": [
|
||||
"q.bedrock_quirk('doduo', 'blink1')",
|
||||
"q.bedrock_quirk('doduo', 'blink2')"
|
||||
]
|
||||
},
|
||||
"walk": {
|
||||
"poseTypes": [
|
||||
"WALK",
|
||||
"SWIM",
|
||||
"FLY"
|
||||
],
|
||||
"animations": [
|
||||
"q.look('head')",
|
||||
"q.bedrock('doduo', 'ground_walk')"
|
||||
],
|
||||
"transformTicks": 10,
|
||||
"quirks": [
|
||||
"q.bedrock_quirk('doduo', 'blink1')",
|
||||
"q.bedrock_quirk('doduo', 'blink2')"
|
||||
]
|
||||
},
|
||||
"battle-standing": {
|
||||
"poseTypes": [
|
||||
"STAND",
|
||||
"FLOAT",
|
||||
"HOVER"
|
||||
],
|
||||
"isBattle": true,
|
||||
"animations": [
|
||||
"q.look('head')",
|
||||
"q.bedrock('doduo', 'battle_idle')"
|
||||
],
|
||||
"transformTicks": 10,
|
||||
"quirks": [
|
||||
"q.bedrock_quirk('doduo', 'blink1')",
|
||||
"q.bedrock_quirk('doduo', 'blink2')",
|
||||
"q.bedrock_quirk('doduo', 'bite_quirk1', 5, 20, 1)",
|
||||
"q.bedrock_quirk('doduo', 'bite_quirk2', 5, 20, 1)"
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user