Compare commits

...
Author SHA1 Message Date
Landon Wills 95840fa30a Reduce jitter 2025-04-12 19:40:10 -04:00
Landon Wills 75953eda5f Locator rotation testing for JPAK 2025-04-12 19:34:55 -04:00
Landon 1c13ab24e8 Merge branch 'even-more-riding-tweaks' into 'main'
Even more riding tweaks

See merge request cable-mc/cobblemon!1597
2025-04-12 03:07:36 +00:00
Paul 380cf0ea71 You? You're meant to be dead! 2025-04-12 12:29:44 +10:00
Paul 8ded7334bb Refactor forcedTick handling in PosableEntityModel 2025-04-12 12:23:17 +10:00
Polymeta 0ac34bf1a4 Merge branch 'locator-rotation-player-rendering' into 'main'
Lock player model to seat locator's rotation when riding

See merge request cable-mc/cobblemon!1598
2025-04-11 19:41:47 +00:00
Landon Wills 9716ea0806 Fix rotation of player when using custom camera 2025-04-11 06:13:47 -04:00
Landon Wills ffea94f3b2 Rotate player depending on seat locator's rotation 2025-04-11 03:39:49 -04:00
Landon Wills 3061ba69e2 Riding momentum is maintained when window is not active 2025-04-11 03:17:26 -04:00
Landon Wills 741e38d606 Fix issue where same-species pokemon will sync animations on multiplayer environments 2025-04-11 02:01:28 -04:00
Landon Wills 02f2c072c9 Fix issues with pre-animation logic 2025-04-11 01:29:49 -04:00
Polymeta c54849f415 Merge branch 'implement_pokemon' into 'main'
Few mons added for testing

See merge request cable-mc/cobblemon!1595
2025-04-10 13:46:35 +00:00
Frank The FarmerandPolymeta d44e625e9d Few mons added for testing 2025-04-10 13:46:35 +00:00
Polymeta 6a74d5982a Merge branch 'more-riding-tweaks' into 'main'
Riding tweaks / fixes

See merge request cable-mc/cobblemon!1594
2025-04-10 09:13:32 +00:00
Landon Wills 03905c77d2 Add license 2025-04-10 03:12:53 -04:00
Landon Wills da9558f5f9 Fix camera riding momentum not occurring when in chat or screens 2025-04-10 01:40:44 -04:00
Landon Wills 5c65dffac8 Improve rendering of ridden pokemon substantially on low or inconsistent FPS 2025-04-09 23:36:21 -04:00
Landon Wills b67b37c99e Fix some issues with merge 2025-04-09 22:54:23 -04:00
Landon Wills fbb7ee31c5 Merge branch 'refs/heads/main' into water-mount-behaviours 2025-04-09 22:38:45 -04:00
Polymeta d3ef26976b Merge branch 'composite-behaviour-refactor' into 'main'
Composite behaviour refactor

See merge request cable-mc/cobblemon!1584
2025-04-09 15:58:55 +00:00
Landon Wills dac01a3730 Fix issue with crashing on packet decode before player is initialized 2025-04-09 03:30:55 -04:00
Landon Wills ddb05768e4 Remove redundant riding behaviour, rename ride style option from misc to composite 2025-04-09 03:17:31 -04:00
Polymeta 5374940d24 Merge branch 'spicy-molang' into 'main'
Added `spawn_pokemon` and `attempt_wild_battle` as available MoLang functions

Closes #1237

See merge request cable-mc/cobblemon!1586
2025-04-09 07:13:00 +00:00
SpicyandPolymeta 1fd6a660dd Added spawn_pokemon and attempt_wild_battle as available MoLang functions 2025-04-09 07:13:00 +00:00
Landon Wills fd45934775 Fix issue with canRide condition, remove duplicate riding config in aerodactyl 2025-04-09 03:09:04 -04:00
Polymeta 5e0ffd8bd3 Merge branch 'josh/item-molang-fixes' into 'main'
Small fixes for molang functions related to item rendering.

See merge request cable-mc/cobblemon!1590
2025-04-08 16:02:48 +00:00
JoshandPolymeta b4b315360d Small fixes for molang functions related to item rendering. 2025-04-08 16:02:48 +00:00
Polymeta a44c70648b actually return held item to player again
Signed-off-by: Polymeta <40173118+Polymeta@users.noreply.github.com>
2025-04-08 16:07:20 +01:00
Polymeta c41b0cdca2 Merge branch 'negative-config-values' into 'main'
Allow negative numbers in config GUI

See merge request cable-mc/cobblemon!1588
2025-04-08 12:01:45 +00:00
lionandPolymeta 88f743ee48 Allow negative numbers in config GUI 2025-04-08 12:01:44 +00:00
Polymeta 15b9afacf8 remove client logic from common code MoLang functions
Signed-off-by: Polymeta <40173118+Polymeta@users.noreply.github.com>
2025-04-08 12:59:36 +01:00
Polymeta babcf7430b don't error when heldItem nbt is not present
Closes #1505

Signed-off-by: Polymeta <40173118+Polymeta@users.noreply.github.com>
2025-04-08 11:38:05 +01:00
Polymeta 3439ca2011 [skip-ci] fix tag docs formatting
Signed-off-by: Polymeta <40173118+Polymeta@users.noreply.github.com>
2025-04-08 10:55:48 +01:00
Polymeta 6539f3dea1 Merge branch 'josh/3d-wearable-items' into 'main'
Start of wearable item implementation.

See merge request cable-mc/cobblemon!1579
2025-04-08 09:16:24 +00:00
Landon Wills 1677598ec0 Merge branch 'refs/heads/main' into water-mount-behaviours
# Conflicts:
#	common/src/main/java/com/cobblemon/mod/common/mixin/client/CameraMixin.java
2025-04-08 01:36:01 -04:00
Landon fcde1eb171 Merge branch 'hitbox-and-hit' into 'main'
Position hitbox on client to be accurate to the locator and make looking at...

See merge request cable-mc/cobblemon!1589
2025-04-08 03:26:26 +00:00
Josh a30a5644df Okay, this is it this time for real 2025-04-07 23:03:30 -04:00
JPAK a5672a38b9 Switch to using delegates to position riders. 2025-04-07 21:37:42 -05:00
JPAK 3b14ea319b Position hitbox on client to be accurate to the locator and make looking at stuff align to the camera. 2025-04-07 21:12:01 -05:00
Landon Wills 57e2765f90 Clean up some method signatures in CameraMixin 2025-04-07 21:57:20 -04:00
Josh a090c90831 Merge branch 'main' into josh/3d-wearable-items 2025-04-07 20:55:41 -04:00
Josh 5dcc9ba46d Edit CHANGELOG.md 2025-04-07 21:21:05 +00:00
Josh f8e4ea70df Removed debug models. 2025-04-07 17:09:15 -04:00
Josh 5dc1c749f3 Replaced WearableItemModel enum with WearableItem class. Instances of this class should have a corresponding 3D model in models/item/wearable/ 2025-04-07 16:35:46 -04:00
Polymeta 3accfa29b7 Merge branch 'josh/joint-transform-command' into 'main'
Changed command "changejointscale" into "transformmodelpart". Allows you to easily add model transformations in-game.

See merge request cable-mc/cobblemon!1587
2025-04-07 17:18:56 +00:00
Polymeta dbd2f5d340 Merge branch 'implement_pokemon' into 'main'
Implemented many pokemon

See merge request cable-mc/cobblemon!1585
2025-04-07 09:35:47 +00:00
Frank The FarmerandPolymeta 86bf413f00 Implemented many pokemon 2025-04-07 09:35:46 +00:00
Landon f13e7d03a1 Merge branch 'camera-changes-third-person' into 'main'
Riding Third Person Camera

See merge request cable-mc/cobblemon!1582
2025-04-07 02:51:07 +00:00
JordanandLandon 4a025ac65e Riding Third Person Camera 2025-04-07 02:51:07 +00:00
Polymeta b14b25ae19 Merge branch 'SaferSendouts' into 'main'
Safer sendouts

See merge request cable-mc/cobblemon!1458
2025-04-06 20:58:09 +00:00
Landon Wills 0293c0e811 Update licenses 2025-04-06 04:02:10 -04:00
Landon 125975e25f Merge branch 'item-with-components-swap' into 'main'
Fixed not being able to swap held item of the same type, but have different components.

See merge request cable-mc/cobblemon!1580
2025-04-06 05:42:42 +00:00
Landon Wills c7223ae898 Fix some issues with the new composite system, move assets to new system 2025-04-06 01:35:46 -04:00
Landon baf766298a Merge branch 'riding-ground-render-revert' into 'main'
revert broken ground rendering code. Correctly set stale yrot value on return...

See merge request cable-mc/cobblemon!1583
2025-04-06 05:11:30 +00:00
Jackson BowesandLandon 83580e7e8b revert broken ground rendering code. Correctly set stale yrot value on return... 2025-04-06 05:11:30 +00:00
Landon Wills 38f5c12dce Remove some redundant casting 2025-04-05 23:59:47 -04:00
Landon Wills e6a9a27692 Forgot to remove some code I refactored 2025-04-05 23:59:21 -04:00
Landon Wills 7ff413c401 Add support for custom behaviour settings for different composite strategies 2025-04-05 23:57:30 -04:00
Test 90335ccb2d hide mark scroll when unused 2025-04-05 17:26:09 -04:00
Landon Wills 603f99e5f3 Refactor composite behaviours 2025-04-05 04:24:19 -04:00
Landon Wills 1b53a127af Add lapras assets 2025-04-05 01:39:02 -04:00
Josh 9679929694 Merge branch 'main' into 'item-with-components-swap'
# Conflicts:
#   common/src/main/kotlin/com/cobblemon/mod/common/entity/pokemon/PokemonEntity.kt
2025-04-05 02:01:27 +00:00
Josh 5af96e75eb Fixed message when swapping items.
Used `displayName` rather than `hoverName` for more dynamic text in message.
2025-04-04 13:35:09 -04:00
Josh 023a01befd Can now swap pokemon's held items if the components are different. 2025-04-04 13:03:49 -04:00
JazzMcNade cc2022ed59 Merge branch 'main' into SaferSendouts 2025-04-03 20:30:24 -05:00
Josh 298fdf45d5 Adjusted default position and scale values for wearables. Any additional transformations for a specific pokemon should be done in its posers. 2025-04-03 20:47:09 -04:00
Josh 1dab5b8c7c Added debug models to help with aligning wearable items on pokemon. 2025-04-03 17:03:26 -04:00
Josh a2fef9f1be Moved WearableItemModel functions out of HeldItemRenderer.kt 2025-03-30 21:24:13 -04:00
Josh 3d4df2c098 Fixed item rendering not falling back to the item locator if other locators are not present. 2025-03-30 21:11:05 -04:00
Josh 7557cab03d Fixed item visibility button not showing the right icon when opening summary or switching pokemon. 2025-03-30 20:55:28 -04:00
Josh f1018b1da9 Simplified HeldItemRenderer to use only one render function that renders an Item on a PosableModel. And fixed the item lighting in the summary menu. 2025-03-30 20:03:07 -04:00
Josh 5af4e3bddb Added placeholder models for wearable items and logic to register the models. 2025-03-30 02:03:44 -04:00
Josh 1f519cae50 Fixed rotation of items rending in PokemonOnShoulderRenderer and ModelWidget 2025-03-29 20:01:04 -04:00
JazzMcNade 91864b13d0 Moved GetSendOutPosition into ActiveBattlePokemon.kt 2025-03-06 01:45:58 -06:00
JazzMcNade adc8e9921a Updated Changelog 2025-03-04 21:54:23 -06:00
JazzMcNade 5e5473acae Muted timing console logging 2025-03-04 21:50:28 -06:00
JazzMcNade 3509944f1a Comment, fixed indentation 2025-03-03 20:53:42 -06:00
JazzMcNade 8a5489f805 Merge branch 'main' into SaferSendouts 2025-03-03 20:44:26 -06:00
JazzMcNade 3b7d56ff45 Merge branch 'main' into SaferSendouts 2025-02-16 20:53:08 -06:00
JazzMcNade 50c567d264 Clean up, scale look radius with size 2025-01-04 18:35:14 -06:00
JazzMcNade d4964e41d3 Clean up, fixed fluid handling 2025-01-03 22:04:23 -06:00
JazzMcNade 41b1c169c3 Merge branch 'main' into SaferSendouts 2025-01-03 20:49:13 -06:00
JazzMcNade 49e2001004 clean up 2025-01-03 20:48:28 -06:00
JazzMcNade 66393f9293 Merge branch 'main' into SaferSendouts 2025-01-02 21:11:07 -06:00
JazzMcNade 7b3b6146a1 Single raycast to avoid spawning in walls, setPositionSafely can no longer path into a wall 2024-12-30 20:44:32 -06:00
JazzMcNade e1452244c2 Merge branch 'main' into SaferSendouts 2024-12-30 12:50:24 -06:00
JazzMcNade 5358414a0c Merge branch 'main' into SaferSendouts 2024-12-24 15:27:25 -06:00
JazzMcNade d691373919 Capped collision box size. Added trace to help prevent attempts to send outs going into walls 2024-12-15 20:14:30 -06:00
JazzMcNade 038f13e6fa Merge branch 'main' into SaferSendouts 2024-12-15 00:52:31 -06:00
JazzMcNade dd288a3b0c SetPositionSafely now implements BFS WIP 2024-12-08 21:39:17 -06:00
529 changed files with 62546 additions and 16703 deletions
+95 -1
View File
@@ -13,9 +13,93 @@
- Added `visibility/hidden`, `visibility/hat` and `visibility/face` tags to control where and how certain items are rendered.
- Added Pokémon markings, toggleable within the summary.
- Added `/boxcount` command to change PC boxes amount
- Added cosmetics for Gurdurr, Conkeldurr, Squirtle Line, Sneasler, Sandile line, Treecko line, Braixen, Delphox, and Dragonite.
- Added cosmetics for Gurdurr, Conkeldurr, Squirtle Line, Sneasler, Sandle line, Treecko line, Braixen, Delphox, and Dragonite.
- Added `/transformmodelpart (position|rotation|scale) <modelPart> <transform: x y z>` command that can add transformations to a pokemon's model part.
- The player executing the command must be facing the target pokemon entity. Transformations are not persistent and will revert when resources are reloaded.
### Pokémon Added
#### Gen 2
- Dunsparce
#### Gen 3
- Spoink
- Grumpig
- Snorunt
- Glalie
#### Gen 4
- Bronzor
- Bronzong
- Croagunk
- Froslass
#### Gen 5
- Pansage
- Simisage
- Pansear
- Simisear
- Panpour
- Simipour
- Munna
- Musharna
- Blitzle
- Zebstrika
- Trubbish
- Garbodor
#### Gen 6
- Noibat
- Noivern
#### Gen 7
- Drampa
#### Gen 8
- Silicobra
- Sandaconda
#### Gen 9
- Smoliv
- Dolliv
- Arboliva
- Orthworm
- Dudunsparce
### Animation updates for the following Pokémon
- Garchomp
- Tropius
- Torpius
- Nosepass
- Probopass
- Sneasler
- Braixen
- Delphox
### Model updates for the following Pokémon
- Gyarados
- Dragonite
- Eevee
- Vaporeon
- Jolteon
- Flareon
- Espeon
- Umbreon
- Leafeon
- Glaceon
- Sylveon
- Treecko
- Grovyle
- Sceptile
- Honchkrow
- Garchomp
- Pidgeot
- Nosepass
- Probopass
- Magnezone
- Metagross
### Changes
- Renamed `chargeGainedPerTick` config to `secondsToChargeHealingMachine`.
- Made Blocks of Gold count as Big Nuggets when held by a Pokémon (for Fling functionality)
@@ -23,6 +107,8 @@
- When using the `cobblemon` or `generation_9` capture calculators a critical capture with a single shake will always play for successful captures when you've already registered the Pokémon as caught in your Pokédex.
- Improved the performance of saving Pokédex and player data.
- Pokémon hitbox now scales with entity attribute `generic.scale`.
- Removed Shulker aspect and replaced it with cosmetic_item-shulker_shell.
- Shulker shell Forretress is now a cosmetic rather than a special evo and thus all shulker Forretress will revert back to normal until a shulker shell is put in their cosmetic slot.
### Fixes
- Fixed Particles sometimes facing the wrong direction (looking at you, Swords Dance)
@@ -45,6 +131,7 @@
- Fixed field name in evolution requirements for Spewpa Pokeball.
- Fixed LevelUpCriterion logic to correctly check that the Pokémon is a preEvo.
- Fixed `hide_additional_tooltip` vanilla flag not properly hiding tooltips on pokerod and bait items
- Removed a number of scenarios in which a Pokémon battle may send out a Pokémon into collision geometry.
- Fixed NPCs using Pokémon outside of their pool when a Pokémon name had a typo.
- Fixed an issue with datapacked species features not being applied properly when relogging.
- Fixed Pokémon marked as silent still playing shiny sounds and effects.
@@ -67,6 +154,7 @@
- Updated NPCEntity beam positioning to properly account for the baseScale property.
- Updated NPCEntity pokeball throw positioning to properly account for the baseScale property.
- Fixed `[Pokemon].copyFrom` error causing forms, IVs, and EVs to not be applied properly when using `[Pokemon].loadFromJSON` or `[Pokemon].loadFromNBT`
- Added new item class, `WearableItem`. Instances of this class should have a corresponding 3D model. These models render when the items display context is `HEAD`.
### MoLang & Datapacks
- The following usages for item predicates can now use item conditions like advancements do, you can learn about them in the [Minecraft wiki](https://minecraft.wiki/w/Advancement_definition#minecraft:filled_bucket)
@@ -77,9 +165,14 @@
- Added `interpolate` boolean property to animated textures to allow gradual colour changes between frames.
- Fixed species additions not being capable of changing implemented status.
- Added support for action effects that are triggered by `|-activate|` Showdown instructions. `activate_{effect_id}` is the syntax.
- Added Molang functions for rendering items `render_item(item_id, locator_name)` and `clear_items()`.
- Added MoLang functions for rendering items `render_item(item_id, locator_name)` and `clear_items()`.
- Fixed location spawn filter components causing crashes
- Added `pokemon` as an available MoLang function for the `battleActor` functions.
- Added `spawn_pokemon` as an available MoLang function for the `worldHolder` functions.
- Added `attempt_wild_battle` as an available MoLang function.
- Added `pokemon` as an available Molang function for the `battleActor` functions.
- Fixed `heldItem` property inside spawn files not working and causing crashes
- Fixed `spawn_bedrock_particles` MoLang causing crashes when used in a server environment
## [1.6.1 (January 26th, 2025)](#1-6-1)
@@ -185,6 +278,7 @@
- Geodude
- Graveler
- Golem
- Magnezone
### Cry updates for the following Pokémon
- Sceptile
@@ -15,10 +15,12 @@ import com.cobblemon.mod.common.api.events.CobblemonEvents;
import com.cobblemon.mod.common.api.events.item.LeftoversCreatedEvent;
import com.cobblemon.mod.common.api.orientation.OrientationController;
import com.cobblemon.mod.common.api.pokemon.PokemonSpecies;
import com.cobblemon.mod.common.api.riding.Rideable;
import com.cobblemon.mod.common.api.riding.Seat;
import com.cobblemon.mod.common.api.storage.party.PartyStore;
import com.cobblemon.mod.common.api.storage.party.PlayerPartyStore;
import com.cobblemon.mod.common.api.tags.CobblemonItemTags;
import com.cobblemon.mod.common.client.entity.PokemonClientDelegate;
import com.cobblemon.mod.common.client.render.MatrixWrapper;
import com.cobblemon.mod.common.entity.pokemon.PokemonEntity;
import com.cobblemon.mod.common.pokedex.scanner.PokedexEntityData;
import com.cobblemon.mod.common.pokedex.scanner.ScannableEntity;
@@ -38,16 +40,18 @@ import net.minecraft.network.chat.Component;
import net.minecraft.resources.ResourceLocation;
import net.minecraft.server.level.ServerPlayer;
import net.minecraft.world.damagesource.DamageSource;
import net.minecraft.world.entity.EntityDimensions;
import net.minecraft.world.entity.EntityType;
import net.minecraft.world.entity.LivingEntity;
import net.minecraft.world.entity.Pose;
import net.minecraft.world.entity.*;
import net.minecraft.world.entity.item.ItemEntity;
import net.minecraft.world.entity.player.Player;
import net.minecraft.world.food.FoodProperties;
import net.minecraft.world.item.ItemStack;
import net.minecraft.world.level.ClipContext;
import net.minecraft.world.level.Level;
import net.minecraft.world.phys.HitResult;
import net.minecraft.world.phys.Vec3;
import org.jetbrains.annotations.Nullable;
import org.joml.Matrix3f;
import org.joml.Vector3f;
import org.objectweb.asm.Opcodes;
import org.spongepowered.asm.mixin.Final;
import org.spongepowered.asm.mixin.Mixin;
@@ -82,7 +86,8 @@ public abstract class PlayerMixin extends LivingEntity implements ScannableEntit
@Shadow @Final private static Map<Pose, EntityDimensions> POSES;
@Shadow @Final public static EntityDimensions STANDING_DIMENSIONS;
@Unique private OrientationController cobblemon$orientationController = new OrientationController(this);
@Unique
private final OrientationController cobblemon$orientationController = new OrientationController(this);
protected PlayerMixin(EntityType<? extends LivingEntity> p_20966_, Level p_20967_) {
super(p_20966_, p_20967_);
@@ -120,7 +125,7 @@ public abstract class PlayerMixin extends LivingEntity implements ScannableEntit
if (this.getVehicle() instanceof PokemonEntity) {
return STANDING_DIMENSIONS;
}
return (EntityDimensions)POSES.getOrDefault(pose, STANDING_DIMENSIONS);
return POSES.getOrDefault(pose, STANDING_DIMENSIONS);
}
@Inject(
@@ -279,4 +284,41 @@ public abstract class PlayerMixin extends LivingEntity implements ScannableEntit
public OrientationController getOrientationController() {
return cobblemon$orientationController;
}
@Override
public HitResult pick(double hitDistance, float partialTicks, boolean hitFluids) {
Entity vehicle = this.getVehicle();
if (vehicle instanceof PokemonEntity pokemonEntity) {
int seatIndex = pokemonEntity.getPassengers().indexOf(this);
Seat seat = pokemonEntity.getSeats().get(seatIndex);
PokemonClientDelegate delegate = (PokemonClientDelegate) pokemonEntity.getDelegate();
MatrixWrapper locator = delegate.getLocatorStates().get(seat.getLocator());
if (locator == null) {
super.pick(hitDistance, partialTicks, hitFluids);
}
Vec3 locatorOffset = new Vec3(locator.getMatrix().getTranslation(new Vector3f()));
OrientationController controller = this.getOrientationController();
float currEyeHeight = this.getEyeHeight();
Matrix3f orientation = controller.isActive() && controller.getOrientation() != null ? controller.getOrientation() : new Matrix3f();
Vec3 rotatedEyeHeight = new Vec3(orientation.transform(new Vector3f(0f, currEyeHeight - (this.getBbHeight() / 2), 0f)));
Vec3 eyePosition = locatorOffset.add(pokemonEntity.position()).add(rotatedEyeHeight);
Vec3 viewVector = this.getViewVector(partialTicks);
Vec3 viewDistanceVector = eyePosition.add(viewVector.x * hitDistance, viewVector.y * hitDistance, viewVector.z * hitDistance);
return this.level()
.clip(
new ClipContext(
eyePosition, viewDistanceVector, ClipContext.Block.OUTLINE, hitFluids ? net.minecraft.world.level.ClipContext.Fluid.ANY : net.minecraft.world.level.ClipContext.Fluid.NONE, this
)
);
}
return super.pick(hitDistance, partialTicks, hitFluids);
}
}
@@ -8,19 +8,29 @@
package com.cobblemon.mod.common.mixin.client;
import com.cobblemon.mod.common.Cobblemon;
import com.cobblemon.mod.common.OrientationControllable;
import com.cobblemon.mod.common.api.orientation.OrientationController;
import com.cobblemon.mod.common.api.riding.Rideable;
import com.cobblemon.mod.common.api.riding.Seat;
import com.cobblemon.mod.common.client.MountedPokemonAnimationRenderController;
import com.cobblemon.mod.common.client.entity.PokemonClientDelegate;
import com.cobblemon.mod.common.client.render.MatrixWrapper;
import com.cobblemon.mod.common.client.render.models.blockbench.FloatingState;
import com.cobblemon.mod.common.client.render.models.blockbench.PosableModel;
import com.cobblemon.mod.common.client.render.models.blockbench.repository.VaryingModelRepository;
import com.cobblemon.mod.common.config.CobblemonConfig;
import com.cobblemon.mod.common.entity.pokemon.PokemonEntity;
import com.llamalad7.mixinextras.injector.wrapoperation.Operation;
import com.llamalad7.mixinextras.injector.wrapoperation.WrapOperation;
import com.llamalad7.mixinextras.sugar.Local;
import net.minecraft.client.Camera;
import net.minecraft.client.Minecraft;
import net.minecraft.util.Mth;
import net.minecraft.world.entity.Entity;
import net.minecraft.world.level.BlockGetter;
import net.minecraft.world.level.ClipContext;
import net.minecraft.world.phys.HitResult;
import net.minecraft.world.phys.Vec3;
import org.joml.Matrix3f;
import org.joml.Quaternionf;
@@ -32,12 +42,11 @@ import org.spongepowered.asm.mixin.Unique;
import org.spongepowered.asm.mixin.injection.At;
import org.spongepowered.asm.mixin.injection.Inject;
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable;
import java.util.Map;
@Mixin(Camera.class)
public abstract class CameraMixin {
@Shadow @Final private static float DEFAULT_CAMERA_DISTANCE;
@Shadow private Entity entity;
@Shadow @Final private Quaternionf rotation;
@Shadow @Final private Vector3f forwards;
@@ -46,12 +55,15 @@ public abstract class CameraMixin {
@Shadow private float xRot;
@Shadow private float yRot;
@Shadow private Vec3 position;
@Shadow private float eyeHeight;
@Shadow private float eyeHeightOld;
@Shadow protected abstract void setPosition(Vec3 pos);
@Shadow
private BlockGetter level;
@Shadow private float partialTickTime;
@Unique private float returnTimer = 0;
@Unique private float rollAngleStart = 0;
@Unique Minecraft minecraft = Minecraft.getInstance();
@@ -59,7 +71,7 @@ public abstract class CameraMixin {
@Unique boolean disableRollableCameraDebug = false;
@Inject(method = "setRotation", at = @At("HEAD"), cancellable = true)
public void open_camera$setRotation(float f, float g, CallbackInfo ci) {
public void cobblemon$setRotation(float f, float g, CallbackInfo ci) {
if (!(this.entity instanceof OrientationControllable controllable) || disableRollableCameraDebug) return;
var controller = controllable.getOrientationController();
if (!controller.isActive() && controller.getOrientation() != null) {
@@ -77,7 +89,7 @@ public abstract class CameraMixin {
return;
}
controller.getOrientation().rotateZ((float) Math.toRadians(-rollAngleStart*(1-returnTimer)));
applyRotation();
cobblemon$applyRotation();
this.returnTimer += .05F;
ci.cancel();
} else {
@@ -86,17 +98,27 @@ public abstract class CameraMixin {
}
return;
}
if (controller.getOrientation() == null) return;
applyRotation();
if (controller.getOrientation() == null && !Cobblemon.config.getThirdPartyViewBobbing()) return;
cobblemon$applyRotation();
this.returnTimer = 0;
this.rollAngleStart = controller.getRoll();
ci.cancel();
}
@Inject(method = "setup", at = @At("HEAD"))
private void cobblemon$prepAnimation(BlockGetter level, Entity entity, boolean detached, boolean thirdPersonReverse, float partialTick, CallbackInfo ci) {
Entity vehicle = entity.getVehicle();
MountedPokemonAnimationRenderController.INSTANCE.reset();
if (vehicle instanceof PokemonEntity pokemon) {
MountedPokemonAnimationRenderController.INSTANCE.setup(pokemon, partialTickTime);
}
}
//If you want to move this to a delagate you need an AW for position
@WrapOperation(method = "setup", at = @At(value = "INVOKE", target = "Lnet/minecraft/client/Camera;setPosition(DDD)V"))
public void positionCamera(Camera instance, double x, double y, double z, Operation<Void> original){
public void cobblemon$positionCamera(Camera instance, double x, double y, double z, Operation<Void> original, @Local(ordinal = 1, argsOnly = true) boolean thirdPersonReverse) {
Entity entity = instance.getEntity();
Entity vehicle = entity.getVehicle();
@@ -107,49 +129,132 @@ public abstract class CameraMixin {
return;
}
int seatIndex = pokemon.getPassengers().indexOf(entity);
Seat seat = pokemon.getSeats().get(seatIndex);
PokemonClientDelegate delegate = (PokemonClientDelegate) pokemon.getDelegate();
MatrixWrapper locator = delegate.getLocatorStates().get(seat.getLocator());
if(locator == null){
original.call(instance, x, y, z);
return;
}
Vec3 locatorOffset = new Vec3(locator.getMatrix().getTranslation(new Vector3f()));
Vec3 entityPos = new Vec3(
Mth.lerp(instance.getPartialTickTime(), pokemon.xOld, pokemon.getX()),
Mth.lerp(instance.getPartialTickTime(), pokemon.yOld, pokemon.getY()),
Mth.lerp(instance.getPartialTickTime(), pokemon.zOld, pokemon.getZ())
);
int seatIndex = pokemon.getPassengers().indexOf(entity);
Seat seat = pokemon.getSeats().get(seatIndex);
OrientationControllable rollable = (OrientationControllable) entity;
float currEyeHeight = Mth.lerp(instance.getPartialTickTime(), eyeHeightOld, eyeHeight);
var controller = rollable.getOrientationController();
Matrix3f orientation = controller.isActive() && controller.getOrientation() != null ? controller.getOrientation() : new Matrix3f();
Vec3 rotatedEyeHeight = new Vec3(orientation.transform(new Vector3f(0f, currEyeHeight, 0f)));
OrientationController controller = rollable.getOrientationController();
var position = locatorOffset.add(entityPos).add(rotatedEyeHeight);
setPosition(position);
if (!instance.isDetached() || Cobblemon.config.getThirdPartyViewBobbing()) {
MatrixWrapper locator = delegate.getLocatorStates().get(seat.getLocator());
if (locator == null) {
original.call(instance, x, y, z);
return;
}
Vec3 locatorOffset = new Vec3(locator.getMatrix().getTranslation(new Vector3f()));
float currEyeHeight = Mth.lerp(instance.getPartialTickTime(), eyeHeightOld, eyeHeight);
var rotatedEyeHeight = new Vector3f(0f, currEyeHeight - (entity.getBbHeight() / 2), 0f);
if (controller.isActive()) {
rotatedEyeHeight = controller.getRenderOrientation(partialTickTime).transform(rotatedEyeHeight);
}
Vec3 position = locatorOffset.add(entityPos).add(new Vec3(rotatedEyeHeight));
setPosition(position);
} else {
Vector3f pos = entityPos.add(new Vec3(0, pokemon.getBbHeight() / 2, 0)).toVector3f();
PosableModel model = VaryingModelRepository.INSTANCE.getPoser(pokemon.getPokemon().getSpecies().getResourceIdentifier(), new FloatingState());
Map<String, Vec3> cameraOffsets = model.getSeatToCameraOffset();
Vec3 cameraOffset;
if (thirdPersonReverse && cameraOffsets.containsKey(seat.getLocator() + "_reverse")) {
cameraOffset = cameraOffsets.get(seat.getLocator() + "_reverse");
} else if (cameraOffsets.containsKey(seat.getLocator())) {
cameraOffset = cameraOffsets.get(seat.getLocator());
} else {
cameraOffset = new Vec3(0f, 2f, 4f);
}
Vector3f offset = cameraOffset.toVector3f();
if (thirdPersonReverse) offset.z *= -1;
float xRot = (float) (-1 * Math.toRadians(instance.getXRot()));
Matrix3f orientation = controller.isActive() && controller.getOrientation() != null ? controller.getOrientation() : new Matrix3f().rotateY((float) Math.toRadians(180f - instance.getYRot())).rotateX(xRot);
Vector3f rotatedOffset = orientation.transform(offset);
float offsetDistance = rotatedOffset.length();
Vector3f offsetDirection = rotatedOffset.mul(1 / offsetDistance);
float maxZoom = cobblemon$getMaxZoom(offsetDistance, offsetDirection, pos);
setPosition(new Vec3(offsetDirection.mul(maxZoom).add(pos)));
}
} else {
original.call(instance, x, y, z);
}
}
@Unique
private void applyRotation(){
private void cobblemon$applyRotation(){
if (!(this.entity instanceof OrientationControllable controllable) || controllable.getOrientationController().getOrientation() == null) return;
var controller = controllable.getOrientationController();
var newRotation = controller.getOrientation().normal(new Matrix3f()).getNormalizedRotation(new Quaternionf());
if (this.minecraft.options.getCameraType().isMirrored()) {
newRotation.rotateY((float)Math.toRadians(180));
}
var vehicle = entity.getVehicle();
if (vehicle instanceof PokemonEntity pokemon) {
var delegate = (PokemonClientDelegate) pokemon.getDelegate();
int seatIndex = pokemon.getPassengers().indexOf(entity);
Seat seat = pokemon.getSeats().get(seatIndex);
MatrixWrapper locator = delegate.getLocatorStates().get(seat.getLocator());
if (locator != null) {
var locatorRotation = locator.getMatrix().getUnnormalizedRotation(new Quaternionf());
newRotation.mul(locatorRotation);
}
}
this.rotation.set(newRotation);
this.xRot = controller.getPitch();
this.yRot = controller.getYaw();
this.forwards.set(controller.getForwardVector());
this.up.set(controller.getUpVector());
this.left.set(controller.getLeftVector());
var forwardVector = newRotation.transform(OrientationController.Companion.getFORWARDS(), new Vector3f());
var upVector = newRotation.transform(OrientationController.Companion.getUP(), new Vector3f());
var leftVector = newRotation.transform(OrientationController.Companion.getLEFT(), new Vector3f());
this.xRot = (float)Mth.wrapDegrees(-Math.toDegrees(Math.asin(forwardVector.y)));
this.yRot = Mth.wrapDegrees((float)-Math.toDegrees(OrientationController.Companion.getFORWARDS().angleSigned(forwardVector, OrientationController.Companion.getUP())) + 180);
this.forwards.set(forwardVector);
this.up.set(upVector);
this.left.set(leftVector);
}
@WrapOperation(method = "setup", at = @At(value = "INVOKE", target = "Lnet/minecraft/client/Camera;move(FFF)V", ordinal = 0))
public void stopMoveIfRolling(Camera instance, float zoom, float dy, float dx, Operation<Void> original) {
Entity entity = instance.getEntity();
Entity vehicle = entity.getVehicle();
if (!(vehicle instanceof PokemonEntity) || Cobblemon.config.getThirdPartyViewBobbing()) {
original.call(instance, zoom, dy, dx);
}
}
//Modified vanilla code
@Unique
private float cobblemon$getMaxZoom(float maxZoom, Vector3f directionVector, Vector3f positionVector) {
Vec3 pos = new Vec3(positionVector);
for (int i = 0; i < 8; i++) {
float g = (float) ((i & 1) * 2 - 1);
float h = (float) ((i >> 1 & 1) * 2 - 1);
float j = (float) ((i >> 2 & 1) * 2 - 1);
Vec3 vec3 = pos.add(g * 0.1F, h * 0.1F, j * 0.1F);
Vec3 vec32 = vec3.add(new Vec3(directionVector).scale(maxZoom));
HitResult hitResult = this.level.clip(new ClipContext(vec3, vec32, ClipContext.Block.VISUAL, ClipContext.Fluid.NONE, this.entity));
if (hitResult.getType() != HitResult.Type.MISS) {
float k = (float) hitResult.getLocation().distanceToSqr(pos);
if (k < Mth.square(maxZoom)) {
maxZoom = Mth.sqrt(k);
}
}
}
return maxZoom;
}
}
@@ -12,6 +12,7 @@ import com.cobblemon.mod.common.Cobblemon;
import com.cobblemon.mod.common.ModAPI;
import com.cobblemon.mod.common.item.PokeBallItem;
import com.cobblemon.mod.common.item.PokedexItem;
import com.cobblemon.mod.common.item.WearableItem;
import com.mojang.blaze3d.vertex.PoseStack;
import net.minecraft.client.multiplayer.ClientLevel;
import net.minecraft.client.renderer.ItemModelShaper;
@@ -54,17 +55,18 @@ public abstract class ItemRendererMixin {
)
private void cobblemon$overrideItemModel(ItemStack stack, ItemDisplayContext renderMode, boolean leftHanded, PoseStack matrices, MultiBufferSource multiBufferSource, int light, int overlay, BakedModel model, CallbackInfo ci) {
boolean shouldBe2d = renderMode == ItemDisplayContext.GUI || renderMode == ItemDisplayContext.FIXED;
ResourceLocation resourceLocation = null;
if (shouldBe2d) {
ResourceLocation resourceLocation = null;
if (stack.getItem() instanceof PokeBallItem pokeBallItem) resourceLocation = pokeBallItem.getPokeBall().getModel2d();
else if (stack.getItem() instanceof PokedexItem pokedexItem) resourceLocation = pokedexItem.getType().getItemSpritePath();
}
if (renderMode != ItemDisplayContext.HEAD && stack.getItem() instanceof WearableItem wearableItem) resourceLocation = wearableItem.getModel2d();
if (resourceLocation != null) {
BakedModel replacementModel = this.itemModelShaper.getModelManager().getModel(new ModelResourceLocation(resourceLocation, "inventory"));
if (!cobblemon$isSameModel(model, replacementModel)) {
ci.cancel();
render(stack, renderMode, leftHanded, matrices, multiBufferSource, light, overlay, replacementModel);
}
if (resourceLocation != null) {
BakedModel replacementModel = this.itemModelShaper.getModelManager().getModel(new ModelResourceLocation(resourceLocation, "inventory"));
if (!cobblemon$isSameModel(model, replacementModel)) {
ci.cancel();
render(stack, renderMode, leftHanded, matrices, multiBufferSource, light, overlay, replacementModel);
}
}
}
@@ -78,6 +80,7 @@ public abstract class ItemRendererMixin {
boolean canOpenScreen = entity != null && ((entity.getOffhandItem() == stack && !(entity.getMainHandItem().getItem() instanceof PokedexItem)) || entity.getMainHandItem() == stack);
resourceLocation = pokedexItem.getType().getItemModelPath(isScanModel ? "scanning" : (canOpenScreen ? null : "off"));
}
else if (stack.getItem() instanceof WearableItem wearableItem) resourceLocation = wearableItem.getModel3d();
if (resourceLocation != null) {
BakedModel model = this.itemModelShaper.getModelManager().getModel(new ModelResourceLocation(resourceLocation, MODEL_PATH));
@@ -15,6 +15,7 @@ import com.cobblemon.mod.common.entity.pokemon.PokemonEntity;
import com.cobblemon.mod.common.pokedex.scanner.PokedexUsageContext;
import com.llamalad7.mixinextras.injector.v2.WrapWithCondition;
import com.llamalad7.mixinextras.sugar.Local;
import com.mojang.blaze3d.Blaze3D;
import net.minecraft.client.Minecraft;
import net.minecraft.client.MouseHandler;
import net.minecraft.client.player.LocalPlayer;
@@ -29,9 +30,10 @@ import org.spongepowered.asm.mixin.Unique;
import org.spongepowered.asm.mixin.injection.At;
import org.spongepowered.asm.mixin.injection.Inject;
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
import org.spongepowered.asm.mixin.injection.callback.LocalCapture;
@Mixin(MouseHandler.class)
public class MouseHandlerMixin {
public abstract class MouseHandlerMixin {
@Shadow private double accumulatedScrollY;
@Shadow @Final private Minecraft minecraft;
@@ -49,6 +51,14 @@ public class MouseHandlerMixin {
@Shadow private double accumulatedDY;
@Shadow private double lastHandleMovementTime;
@Shadow public abstract boolean isMouseGrabbed();
@Shadow protected abstract void turnPlayer(double movementTime);
@Unique private double cobblemon$timeDelta;
@Inject(
method = "onScroll",
at = @At(
@@ -161,16 +171,21 @@ public class MouseHandlerMixin {
return false;
}
@Inject(method = "handleAccumulatedMovement", at = @At(value = "INVOKE", target = "Lnet/minecraft/client/MouseHandler;isMouseGrabbed()Z", ordinal = 0))
private void cobblemon$maintainMovementWhenInScreens(CallbackInfo ci, @Local(ordinal = 1) double e) {
@Inject(method = "handleAccumulatedMovement", at = @At("HEAD"))
private void cobblemon$maintainMovementWhenInScreens2(CallbackInfo ci) {
double time = Blaze3D.getTime();
cobblemon$timeDelta = time - this.lastHandleMovementTime;
}
@Inject(method = "handleAccumulatedMovement", at = @At("TAIL"))
private void cobblemon$maintainMovementWhenInScreens(CallbackInfo ci) {
if (minecraft.player == null) return;
if (!(minecraft.player instanceof OrientationControllable controllable)) return;
if (!controllable.getOrientationController().isActive()) return;
if (minecraft.isPaused()) return;
if (isMouseGrabbed()) return;
var pitch = pitchSmoother.getNewDeltaValue(0, e);
var roll = rollSmoother.getNewDeltaValue(0, e);
controllable.getOrientationController().rotate(0.0F, (float)pitch, (float)roll);
this.turnPlayer(cobblemon$timeDelta);
}
@Unique
@@ -281,7 +281,6 @@ object CobblemonItems : PlatformRegistry<Registry<Item>, ResourceKey<Registry<It
// Evolution items
@JvmField val LINK_CABLE = create("link_cable", LinkCableItem())
@JvmField val DRAGON_SCALE = noSettingsItem("dragon_scale")
@JvmField val KINGS_ROCK = noSettingsItem("kings_rock")
@JvmField val METAL_COAT = noSettingsItem("metal_coat")
@JvmField val UPGRADE = noSettingsItem("upgrade")
@JvmField val DUBIOUS_DISC = noSettingsItem("dubious_disc")
@@ -660,6 +659,19 @@ object CobblemonItems : PlatformRegistry<Registry<Item>, ResourceKey<Registry<It
@JvmField
val WATER_STONE = noSettingsItem("water_stone")
val wearables = mutableListOf<WearableItem>()
//Wearable items (these items should have a corresponding 3D model)
@JvmField val BLACK_GLASSES = wearableItem("black_glasses")
@JvmField val CHOICE_BAND = wearableItem("choice_band")
@JvmField val CHOICE_SPECS = wearableItem("choice_specs")
@JvmField val EXP_SHARE = wearableItem("exp_share")
@JvmField val FOCUS_BAND = wearableItem("focus_band")
@JvmField val KINGS_ROCK = wearableItem("kings_rock")
@JvmField val MUSCLE_BAND = wearableItem("muscle_band")
@JvmField val ROCKY_HELMET = wearableItem("rocky_helmet")
@JvmField val SAFETY_GOGGLES = wearableItem("safety_goggles")
@JvmField val WISE_GLASSES = wearableItem("wise_glasses")
// Held Items
@JvmField
val ABILITY_SHIELD = heldItem("ability_shield")
@@ -676,8 +688,6 @@ object CobblemonItems : PlatformRegistry<Registry<Item>, ResourceKey<Registry<It
@JvmField
val BLACK_BELT = heldItem("black_belt")
@JvmField
val BLACK_GLASSES = heldItem("black_glasses")
@JvmField
val BLACK_SLUDGE = heldItem("black_sludge")
@JvmField
val BLUNDER_POLICY = heldItem("blunder_policy")
@@ -686,12 +696,8 @@ object CobblemonItems : PlatformRegistry<Registry<Item>, ResourceKey<Registry<It
@JvmField
val CHARCOAL = heldItem("charcoal_stick", remappedName = "charcoal")
@JvmField
val CHOICE_BAND = heldItem("choice_band")
@JvmField
val CHOICE_SCARF = heldItem("choice_scarf")
@JvmField
val CHOICE_SPECS = heldItem("choice_specs")
@JvmField
val CLEANSE_TAG = heldItem("cleanse_tag")
// @JvmField
// val CLEAR_AMULET = heldItem("clear_amulet")
@@ -712,8 +718,6 @@ object CobblemonItems : PlatformRegistry<Registry<Item>, ResourceKey<Registry<It
@JvmField
val EVIOLITE = heldItem("eviolite")
@JvmField
val EXP_SHARE = heldItem("exp_share")
@JvmField
val EXPERT_BELT = heldItem("expert_belt")
@JvmField
val FAIRY_FEATHER = heldItem("fairy_feather")
@@ -722,8 +726,6 @@ object CobblemonItems : PlatformRegistry<Registry<Item>, ResourceKey<Registry<It
@JvmField
val FLOAT_STONE = heldItem("float_stone")
@JvmField
val FOCUS_BAND = heldItem("focus_band")
@JvmField
val FOCUS_SASH = heldItem("focus_sash")
@JvmField
val GRASSY_SEED = heldItem("grassy_seed")
@@ -758,8 +760,6 @@ object CobblemonItems : PlatformRegistry<Registry<Item>, ResourceKey<Registry<It
@JvmField
val MIRACLE_SEED = heldItem("miracle_seed")
@JvmField
val MUSCLE_BAND = heldItem("muscle_band")
@JvmField
val MYSTIC_WATER = heldItem("mystic_water")
@JvmField
val NEVER_MELT_ICE = heldItem("never_melt_ice")
@@ -790,12 +790,8 @@ object CobblemonItems : PlatformRegistry<Registry<Item>, ResourceKey<Registry<It
@JvmField
val RING_TARGET = heldItem("ring_target")
@JvmField
val ROCKY_HELMET = heldItem("rocky_helmet")
@JvmField
val ROOM_SERVICE = heldItem("room_service")
@JvmField
val SAFETY_GOGGLES = heldItem("safety_goggles")
@JvmField
val SCOPE_LENS = heldItem("scope_lens")
@JvmField
val SHARP_BEAK = heldItem("sharp_beak")
@@ -832,8 +828,6 @@ object CobblemonItems : PlatformRegistry<Registry<Item>, ResourceKey<Registry<It
@JvmField
val WIDE_LENS = heldItem("wide_lens")
@JvmField
val WISE_GLASSES = heldItem("wise_glasses")
@JvmField
val ZOOM_LENS = heldItem("zoom_lens")
@JvmField
val MENTAL_HERB = compostableHeldItem("mental_herb", null, 1F)
@@ -1263,6 +1257,16 @@ object CobblemonItems : PlatformRegistry<Registry<Item>, ResourceKey<Registry<It
return item
}
private fun wearableItem(name: String, heldItemRemappedName: String? = null): CobblemonItem = create(
name,
WearableItem(name).also {
wearables.add(it)
if (heldItemRemappedName != null) {
CobblemonHeldItemManager.registerRemap(it, heldItemRemappedName)
}
}
)
private fun heldItem(name: String, remappedName: String? = null): CobblemonItem = create(
name,
CobblemonItem(Item.Properties()).also {
@@ -20,4 +20,4 @@ interface EntitySideDelegate<T : Entity> {
fun tick(entity: T) {}
fun onSyncedDataUpdated(data: EntityDataAccessor<*>) {}
fun addToStruct(struct: QueryStruct) {}
}
}
@@ -21,4 +21,6 @@ interface PokemonSideDelegate : EntitySideDelegate<PokemonEntity> {
fun updatePostDeath() {}
fun handleStatus(status: Byte) {}
fun spawnShinyParticle(player: Player) {}
}
fun positionRider(passenger: Entity, positionUpdater: MoveFunction)
fun updateAge(age: Int) {}
}
@@ -38,12 +38,11 @@ import com.cobblemon.mod.common.api.storage.party.PartyStore
import com.cobblemon.mod.common.api.storage.party.PlayerPartyStore
import com.cobblemon.mod.common.api.storage.pc.PCPosition
import com.cobblemon.mod.common.api.storage.pc.PCStore
import com.cobblemon.mod.common.api.tags.CobblemonItemTags
import com.cobblemon.mod.common.api.text.text
import com.cobblemon.mod.common.battles.BattleRegistry
import com.cobblemon.mod.common.battles.actor.PlayerBattleActor
import com.cobblemon.mod.common.battles.actor.PokemonBattleActor
import com.cobblemon.mod.common.client.particle.BedrockParticleOptionsRepository
import com.cobblemon.mod.common.client.particle.ParticleStorm
import com.cobblemon.mod.common.client.render.models.blockbench.wavefunction.WaveFunctions
import com.cobblemon.mod.common.entity.PosableEntity
import com.cobblemon.mod.common.entity.npc.NPCBattleActor
@@ -63,7 +62,6 @@ import com.cobblemon.mod.common.pokemon.evolution.variants.LevelUpEvolution
import com.cobblemon.mod.common.pokemon.evolution.variants.TradeEvolution
import com.cobblemon.mod.common.util.*
import com.mojang.datafixers.util.Either
import net.minecraft.client.multiplayer.ClientLevel
import net.minecraft.commands.arguments.EntityAnchorArgument
import net.minecraft.core.BlockPos
import net.minecraft.core.Holder
@@ -289,16 +287,32 @@ object MoLangFunctions {
} as? ServerPlayer
val pos = Vec3(x, y, z)
if (world !is ClientLevel) {
val packet = SpawnSnowstormParticlePacket(particle, pos)
if (player != null) {
packet.sendToPlayer(player)
} else {
packet.sendToPlayersAround(x, y, z, 64.0, world.dimension())
}
val packet = SpawnSnowstormParticlePacket(particle, pos)
if (player != null) {
packet.sendToPlayer(player)
} else {
val effect = BedrockParticleOptionsRepository.getEffect(particle) ?: return@put DoubleValue.ZERO
ParticleStorm.createAtPosition(world, effect, pos).spawn()
packet.sendToPlayersAround(x, y, z, 64.0, world.dimension())
}
}
map.put("spawn_pokemon") { params ->
val x = params.getInt(0)
val y = params.getInt(1)
val z = params.getInt(2)
val props = params.getString(3).toProperties()
val pos = BlockPos(x, y, z)
if (!Level.isInSpawnableBounds(pos)) {
return@put DoubleValue.ZERO
}
val pokemon = props.createEntity(world)
pokemon.moveTo(pos, pokemon.yRot, pokemon.xRot)
if (world.addFreshEntity(pokemon)) {
return@put pokemon.struct
} else {
return@put DoubleValue.ZERO
}
}
map.put("get_entities_around") { params ->
@@ -820,7 +834,11 @@ object MoLangFunctions {
map.put("is_gliding") { DoubleValue(pokemonEntity.useRidingAltPose()) }
map.put("has_aspect") { DoubleValue(it.getString(0) in pokemonEntity.aspects) }
map.put("is_pokemon") { DoubleValue.ONE }
map.put("is_holding_item") { DoubleValue(!pokemonEntity.entityData.get(PokemonEntity.SHOWN_HELD_ITEM).isEmpty) }
map.put("is_holding_item") { DoubleValue(!pokemonEntity.entityData.get(PokemonEntity.SHOWN_HELD_ITEM).let {
it.isEmpty || it.`is`(CobblemonItemTags.WEARABLE_HAT_ITEMS) || it.`is`(CobblemonItemTags.WEARABLE_FACE_ITEMS)
}) }
map.put("is_wearing_hat") { DoubleValue(pokemonEntity.entityData.get(PokemonEntity.SHOWN_HELD_ITEM).`is`(CobblemonItemTags.WEARABLE_HAT_ITEMS)) }
map.put("is_wearing_face") { DoubleValue(pokemonEntity.entityData.get(PokemonEntity.SHOWN_HELD_ITEM).`is`(CobblemonItemTags.WEARABLE_FACE_ITEMS)) }
map
}
)
@@ -19,4 +19,4 @@ interface Decodable {
*/
fun decode(buffer: RegistryFriendlyByteBuf)
}
}
@@ -25,4 +25,4 @@ interface Encodable {
*/
fun encode(buffer: RegistryFriendlyByteBuf)
}
}
@@ -41,9 +41,6 @@ class RidingProperties(
}
}
val canRide: Boolean
get() = seats.isNotEmpty() && behaviour != null
fun encode(buffer: RegistryFriendlyByteBuf) {
buffer.writeMap(
stats,
@@ -53,7 +50,6 @@ class RidingProperties(
buffer.writeCollection(seats) { _, seat -> seat.encode(buffer) }
buffer.writeCollection(conditions) { _, condition -> buffer.writeString(condition.getString()) }
buffer.writeNullable(behaviour) { _, behaviour ->
buffer.writeResourceLocation(behaviour.key)
behaviour.encode(buffer)
}
}
@@ -18,5 +18,6 @@ package com.cobblemon.mod.common.api.riding
enum class RidingStyle {
LAND,
LIQUID,
AIR
}
AIR,
COMPOSITE
}
@@ -8,6 +8,7 @@
package com.cobblemon.mod.common.api.riding.behaviour
import com.cobblemon.mod.common.api.riding.RidingStyle
import com.cobblemon.mod.common.entity.PoseType
import com.cobblemon.mod.common.entity.pokemon.PokemonEntity
import net.minecraft.resources.ResourceLocation
@@ -27,6 +28,7 @@ import net.minecraft.world.phys.Vec3
*/
interface RidingBehaviour<Settings : RidingBehaviourSettings, State : RidingBehaviourState> {
val key: ResourceLocation
val style: RidingStyle
fun isActive(settings: Settings, state: State, vehicle: PokemonEntity): Boolean
@@ -85,6 +87,6 @@ interface RidingBehaviour<Settings : RidingBehaviourSettings, State : RidingBeha
fun shouldRotatePlayerHead(settings: Settings, state: State, vehicle: PokemonEntity): Boolean
fun createDefaultState(): State
fun createDefaultState(settings: Settings): State
}
@@ -11,6 +11,7 @@ package com.cobblemon.mod.common.api.riding.behaviour
import com.cobblemon.mod.common.api.net.Decodable
import com.cobblemon.mod.common.api.net.Encodable
import net.minecraft.resources.ResourceLocation
import net.minecraft.world.phys.Vec3
/**
* Represents static settings of a riding behaviour.
@@ -8,15 +8,10 @@
package com.cobblemon.mod.common.api.riding.behaviour
import com.cobblemon.mod.common.api.net.Decodable
import com.cobblemon.mod.common.api.net.Encodable
import com.cobblemon.mod.common.entity.pokemon.PokemonEntity
import com.cobblemon.mod.common.util.ifClient
import com.cobblemon.mod.common.util.ifServer
import net.minecraft.client.player.RemotePlayer
import net.minecraft.network.FriendlyByteBuf
import net.minecraft.network.RegistryFriendlyByteBuf
import kotlin.reflect.KProperty
import net.minecraft.world.phys.Vec3
/**
* Represents the state of a Pokemon when being ridden.
@@ -27,18 +22,38 @@ import kotlin.reflect.KProperty
*
* @author landonjw
*/
interface RidingBehaviourState : Encodable, Decodable {
fun reset()
fun copy(): RidingBehaviourState
fun shouldSync(previous: RidingBehaviourState): Boolean
}
open class RidingBehaviourState {
open val rideVelocity: SidedRidingState<Vec3> = ridingState(Vec3.ZERO, Side.BOTH)
open val stamina: SidedRidingState<Float> = ridingState(0F, Side.BOTH)
open fun reset() {
rideVelocity.set(Vec3.ZERO, true)
stamina.set(0F, true)
}
open fun copy(): RidingBehaviourState {
val copy = RidingBehaviourState()
copy.rideVelocity.set(rideVelocity.get(), true)
copy.stamina.set(stamina.get(), true)
return copy
}
open fun shouldSync(previous: RidingBehaviourState): Boolean {
if (previous.rideVelocity.get() != rideVelocity.get()) return true
if (previous.stamina.get() != stamina.get()) return true
return false
}
open fun encode(buffer: FriendlyByteBuf) {
buffer.writeVec3(rideVelocity.get())
buffer.writeFloat(stamina.get())
}
open fun decode(buffer: FriendlyByteBuf) {
rideVelocity.set(buffer.readVec3(), true)
stamina.set(buffer.readFloat(), true)
}
object NoState : RidingBehaviourState {
override fun encode(buffer: RegistryFriendlyByteBuf) = Unit
override fun decode(buffer: RegistryFriendlyByteBuf) = Unit
override fun copy() = NoState
override fun reset() = Unit
override fun shouldSync(previous: RidingBehaviourState) = false
}
fun <T> ridingState(value: T, side: Side) = SidedRidingState(value, side)
@@ -9,32 +9,31 @@
package com.cobblemon.mod.common.api.riding.behaviour
import com.cobblemon.mod.common.api.riding.behaviour.types.*
import com.cobblemon.mod.common.api.riding.behaviour.types.composite.CompositeBehaviour
import net.minecraft.resources.ResourceLocation
object RidingBehaviours {
val behaviours = mutableMapOf<ResourceLocation, RidingBehaviour<*, *>>()
val behaviours = mutableMapOf<ResourceLocation, RidingBehaviour<RidingBehaviourSettings, RidingBehaviourState>>()
init {
register(BirdAirBehaviour.KEY, BirdAirBehaviour())
register(DolphinBehaviour.KEY, DolphinBehaviour())
register(FallToGlideCompositeBehaviour.KEY, FallToGlideCompositeBehaviour())
register(GenericLandBehaviour.KEY, GenericLandBehaviour())
register(GenericSwimBehaviour.KEY, GenericSwimBehaviour())
register(GliderAirBehaviour.KEY, GliderAirBehaviour())
register(HelicopterBehaviour.KEY, HelicopterBehaviour())
register(JetAirBehaviour.KEY, JetAirBehaviour())
register(JumpToFlightCompositeBehaviour.KEY, JumpToFlightCompositeBehaviour())
register(RunToJetCompositeBehaviour.KEY, RunToJetCompositeBehaviour())
register(SwimDashBehaviour.KEY, SwimDashBehaviour())
register(VehicleLandBehaviour.KEY, VehicleLandBehaviour())
register(CompositeBehaviour.KEY, CompositeBehaviour())
}
fun register(key: ResourceLocation, behaviour: RidingBehaviour<*, *>) {
fun register(key: ResourceLocation, behaviour: RidingBehaviour<out RidingBehaviourSettings, out RidingBehaviourState>) {
if (behaviours.contains(key)) error("Behaviour already registered to key $key")
behaviours[key] = RidingController(behaviour)
behaviours[key] = RidingController(behaviour) as RidingBehaviour<RidingBehaviourSettings, RidingBehaviourState>
}
fun get(key: ResourceLocation): RidingBehaviour<*, *> {
fun get(key: ResourceLocation): RidingBehaviour<RidingBehaviourSettings, RidingBehaviourState> {
if (!behaviours.contains(key)) error("Behaviour not registered to key $key")
return behaviours[key]!!
}
@@ -8,6 +8,7 @@
package com.cobblemon.mod.common.api.riding.behaviour
import com.cobblemon.mod.common.api.riding.RidingStyle
import com.cobblemon.mod.common.entity.pokemon.PokemonEntity
import net.minecraft.resources.ResourceLocation
import net.minecraft.util.SmoothDouble
@@ -24,6 +25,7 @@ import net.minecraft.world.phys.Vec3
class RidingController<Settings : RidingBehaviourSettings, State : RidingBehaviourState>(val behaviour: RidingBehaviour<Settings, State>) : RidingBehaviour<Settings, State> {
override val key = behaviour.key
override val style = behaviour.style
override fun isActive(settings: Settings, state: State, vehicle: PokemonEntity) =
behaviour.isActive(settings, state, vehicle)
@@ -40,7 +42,7 @@ class RidingController<Settings : RidingBehaviourSettings, State : RidingBehavio
}
override fun rotation(settings: Settings, state: State, vehicle: PokemonEntity, driver: LivingEntity): Vec2 {
if (!isActive(settings, state, vehicle)) return vehicle.rotationVector
if (!isActive(settings, state, vehicle)) return driver.rotationVector
return behaviour.rotation(settings, state, vehicle, driver)
}
@@ -164,8 +166,8 @@ class RidingController<Settings : RidingBehaviourSettings, State : RidingBehavio
return behaviour.setRideBar(settings, state, vehicle, driver)
}
override fun createDefaultState(): State {
return behaviour.createDefaultState()
override fun createDefaultState(settings: Settings): State {
return behaviour.createDefaultState(settings)
}
}
@@ -12,12 +12,14 @@ import com.bedrockk.molang.Expression
import com.bedrockk.molang.runtime.MoLangMath.lerp
import com.cobblemon.mod.common.Cobblemon
import com.cobblemon.mod.common.OrientationControllable
import com.cobblemon.mod.common.api.riding.RidingStyle
import com.cobblemon.mod.common.api.riding.behaviour.*
import com.cobblemon.mod.common.api.riding.posing.PoseOption
import com.cobblemon.mod.common.api.riding.posing.PoseProvider
import com.cobblemon.mod.common.entity.PoseType
import com.cobblemon.mod.common.entity.pokemon.PokemonEntity
import com.cobblemon.mod.common.util.*
import net.minecraft.network.FriendlyByteBuf
import net.minecraft.network.RegistryFriendlyByteBuf
import net.minecraft.resources.ResourceLocation
import net.minecraft.util.SmoothDouble
@@ -33,9 +35,10 @@ class BirdAirBehaviour : RidingBehaviour<BirdAirSettings, BirdAirState> {
}
override val key: ResourceLocation = KEY
override val style = RidingStyle.AIR
val poseProvider = PoseProvider<BirdAirSettings, BirdAirState>(PoseType.HOVER)
.with(PoseOption(PoseType.FLY) { _, state, _ -> state.rideVel.get().z > 0.2 })
.with(PoseOption(PoseType.FLY) { _, state, _ -> state.rideVelocity.get().z > 0.2 })
override fun isActive(settings: BirdAirSettings, state: BirdAirState, vehicle: PokemonEntity): Boolean {
return true
@@ -51,7 +54,7 @@ class BirdAirBehaviour : RidingBehaviour<BirdAirSettings, BirdAirState> {
vehicle: PokemonEntity,
driver: Player
): Float {
return state.rideVel.get().length().toFloat()
return state.rideVelocity.get().length().toFloat()
}
override fun rotation(
@@ -83,11 +86,11 @@ class BirdAirBehaviour : RidingBehaviour<BirdAirSettings, BirdAirState> {
if (controller != null) {
//Need to deadzone this when straight up or down
upForce += -1.0 * sin(Math.toRadians(controller.pitch.toDouble())) * state.rideVel.get().z
forwardForce += cos(Math.toRadians(controller.pitch.toDouble())) * state.rideVel.get().z
upForce += -1.0 * sin(Math.toRadians(controller.pitch.toDouble())) * state.rideVelocity.get().z
forwardForce += cos(Math.toRadians(controller.pitch.toDouble())) * state.rideVelocity.get().z
upForce += cos(Math.toRadians(controller.pitch.toDouble())) * state.rideVel.get().y
forwardForce += sin(Math.toRadians(controller.pitch.toDouble())) * state.rideVel.get().y
upForce += cos(Math.toRadians(controller.pitch.toDouble())) * state.rideVelocity.get().y
forwardForce += sin(Math.toRadians(controller.pitch.toDouble())) * state.rideVelocity.get().y
}
@@ -104,7 +107,7 @@ class BirdAirBehaviour : RidingBehaviour<BirdAirSettings, BirdAirState> {
upForce = if (vehicle.y >= altitudeLimit && upForce > 0) 0.0 else upForce
}
val velocity = Vec3(state.rideVel.get().x , upForce, forwardForce)
val velocity = Vec3(state.rideVelocity.get().x , upForce, forwardForce)
return velocity
}
@@ -120,12 +123,12 @@ class BirdAirBehaviour : RidingBehaviour<BirdAirSettings, BirdAirState> {
var glideSpeedChange = 0.0
val currSpeed = state.rideVel.get().length()
val currSpeed = state.rideVelocity.get().length()
//Flag for determining if player is actively inputting
var activeInput = false
var newVelocity = Vec3(state.rideVel.get().x, state.rideVel.get().y, state.rideVel.get().z)
var newVelocity = Vec3(state.rideVelocity.get().x, state.rideVelocity.get().y, state.rideVelocity.get().z)
//speed up and slow down based on input
if (driver.zza != 0.0f && state.stamina.get() > 0.0) {
@@ -240,7 +243,7 @@ class BirdAirBehaviour : RidingBehaviour<BirdAirSettings, BirdAirState> {
if( abs(newVelocity.z) > 0) {
newVelocity = newVelocity.subtract(0.0, 0.0, min(0.003 * newVelocity.z.sign, newVelocity.z))
}
state.rideVel.set(newVelocity)
state.rideVelocity.set(newVelocity)
}
override fun angRollVel(
@@ -300,7 +303,7 @@ class BirdAirBehaviour : RidingBehaviour<BirdAirSettings, BirdAirState> {
//modulated by speed so that when flapping idle in air you are ont wobbling around to look around
val rotMin = 15.0
var rollForce = xInput
val rotLimit = max(handling * normalizeVal(state.rideVel.get().length(), 0.0, topSpeed).pow(3), rotMin)
val rotLimit = max(handling * normalizeVal(state.rideVelocity.get().length(), 0.0, topSpeed).pow(3), rotMin)
//Limit roll by non linearly decreasing inputs towards
// a rotation limit based on the current distance from
@@ -315,7 +318,7 @@ class BirdAirBehaviour : RidingBehaviour<BirdAirSettings, BirdAirState> {
}
//Give the ability to yaw with x mouse input when at low speeds.
val yawForce = xInput * ( 1.0 - normalizeVal(state.rideVel.get().length(), 0.0, topSpeed).pow(3))
val yawForce = xInput * ( 1.0 - normalizeVal(state.rideVelocity.get().length(), 0.0, topSpeed).pow(3))
//yaw, pitch, roll
return Vec3(yawForce, yInput, rollForce)
@@ -378,7 +381,7 @@ class BirdAirBehaviour : RidingBehaviour<BirdAirSettings, BirdAirState> {
val glideTopSpeed = vehicle.runtime.resolveDouble(settings.glidespeedExpr)
//Must I ensure that topspeed is greater than minimum?
val normalizedGlideSpeed = normalizeVal(state.rideVel.get().length(), topSpeed, glideTopSpeed)
val normalizedGlideSpeed = normalizeVal(state.rideVelocity.get().length(), topSpeed, glideTopSpeed)
//Only ever want the fov change to be a max of 0.2 and for it to have non linear scaling.
return 1.0f + normalizedGlideSpeed.pow(2).toFloat() * 0.2f
@@ -433,7 +436,7 @@ class BirdAirBehaviour : RidingBehaviour<BirdAirSettings, BirdAirState> {
return false
}
override fun createDefaultState() = BirdAirState()
override fun createDefaultState(settings: BirdAirSettings) = BirdAirState()
}
@@ -457,6 +460,7 @@ class BirdAirSettings : RidingBehaviourSettings {
private set
override fun encode(buffer: RegistryFriendlyByteBuf) {
buffer.writeResourceLocation(key)
buffer.writeExpression(infiniteAltitude)
buffer.writeExpression(infiniteStamina)
buffer.writeExpression(glidespeedExpr)
@@ -479,37 +483,33 @@ class BirdAirSettings : RidingBehaviourSettings {
}
}
class BirdAirState : RidingBehaviourState {
var rideVel = ridingState(Vec3.ZERO, Side.CLIENT)
var stamina = ridingState(1.0f, Side.CLIENT)
class BirdAirState : RidingBehaviourState() {
var gliding = ridingState(false, Side.CLIENT)
var lastGlide = ridingState(-100L, Side.CLIENT)
override fun encode(buffer: RegistryFriendlyByteBuf) {
buffer.writeVec3(rideVel.get())
override fun encode(buffer: FriendlyByteBuf) {
super.encode(buffer)
buffer.writeFloat(stamina.get())
buffer.writeBoolean(gliding.get())
}
override fun decode(buffer: RegistryFriendlyByteBuf) {
rideVel.set(buffer.readVec3(), forced = true)
stamina.set(buffer.readFloat(), forced = true)
override fun decode(buffer: FriendlyByteBuf) {
super.decode(buffer)
gliding.set(buffer.readBoolean(), forced = true)
}
override fun reset() {
rideVel.set(Vec3.ZERO, forced = true)
stamina.set(1.0f, forced = true)
super.reset()
gliding.set(false, forced = true)
lastGlide.set(-100L, forced = true)
}
override fun toString(): String {
return "BirdAirState(rideVel=${rideVel.get()}, stamina=${stamina.get()}, gliding=${gliding.get()})"
return "BirdAirState(rideVelocity=${rideVelocity.get()}, stamina=${stamina.get()}, gliding=${gliding.get()})"
}
override fun copy() = BirdAirState().also {
it.rideVel.set(this.rideVel.get(), forced = true)
it.rideVelocity.set(this.rideVelocity.get(), forced = true)
it.stamina.set(this.stamina.get(), forced = true)
it.gliding.set(this.gliding.get(), forced = true)
it.lastGlide.set(this.lastGlide.get(), forced = true)
@@ -517,9 +517,7 @@ class BirdAirState : RidingBehaviourState {
override fun shouldSync(previous: RidingBehaviourState): Boolean {
if (previous !is BirdAirState) return false
if (previous.rideVel != rideVel) return true
if (previous.stamina != stamina) return true
if (previous.gliding != gliding) return true
return false
return super.shouldSync(previous)
}
}
@@ -11,6 +11,7 @@ package com.cobblemon.mod.common.api.riding.behaviour.types
import com.bedrockk.molang.runtime.value.DoubleValue
import com.cobblemon.mod.common.Cobblemon
import com.cobblemon.mod.common.OrientationControllable
import com.cobblemon.mod.common.api.riding.RidingStyle
import com.cobblemon.mod.common.api.riding.behaviour.*
import com.cobblemon.mod.common.api.riding.posing.PoseOption
import com.cobblemon.mod.common.api.riding.posing.PoseProvider
@@ -18,7 +19,6 @@ import com.cobblemon.mod.common.entity.PoseType
import com.cobblemon.mod.common.entity.pokemon.PokemonEntity
import com.cobblemon.mod.common.util.*
import net.minecraft.network.RegistryFriendlyByteBuf
import net.minecraft.resources.ResourceLocation
import net.minecraft.util.SmoothDouble
import net.minecraft.world.entity.LivingEntity
import net.minecraft.world.entity.player.Player
@@ -35,6 +35,7 @@ class DolphinBehaviour : RidingBehaviour<DolphinSettings, DolphinState> {
}
override val key = KEY
override val style = RidingStyle.LIQUID
val poseProvider = PoseProvider<DolphinSettings, DolphinState>(PoseType.FLOAT)
.with(PoseOption(PoseType.SWIM) { _, _, entity -> entity.entityData.get(PokemonEntity.MOVING) })
@@ -256,7 +257,7 @@ class DolphinBehaviour : RidingBehaviour<DolphinSettings, DolphinState> {
return false
}
override fun createDefaultState() = DolphinState()
override fun createDefaultState(settings: DolphinSettings) = DolphinState()
}
@@ -282,6 +283,7 @@ class DolphinSettings : RidingBehaviourSettings {
private set
override fun encode(buffer: RegistryFriendlyByteBuf) {
buffer.writeResourceLocation(key)
buffer.writeExpression(canJump)
buffer.writeExpression(jumpVector[0])
buffer.writeExpression(jumpVector[1])
@@ -306,13 +308,11 @@ class DolphinSettings : RidingBehaviourSettings {
}
}
class DolphinState : RidingBehaviourState {
class DolphinState : RidingBehaviourState() {
var lastVelocity = ridingState(Vec3.ZERO, Side.BOTH)
override fun encode(buffer: RegistryFriendlyByteBuf) = Unit
override fun decode(buffer: RegistryFriendlyByteBuf) = Unit
override fun reset() {
super.reset()
lastVelocity.set(Vec3.ZERO, forced = true)
}
@@ -321,8 +321,8 @@ class DolphinState : RidingBehaviourState {
}
override fun copy() = DolphinState().also {
it.stamina.set(stamina.get(), forced = true)
it.rideVelocity.set(rideVelocity.get(), forced = true)
it.lastVelocity.set(lastVelocity.get(), forced = true)
}
override fun shouldSync(previous: RidingBehaviourState) = false
}
@@ -1,434 +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.api.riding.behaviour.types
import com.bedrockk.molang.Expression
import com.cobblemon.mod.common.api.riding.behaviour.*
import com.cobblemon.mod.common.entity.PoseType
import com.cobblemon.mod.common.entity.pokemon.PokemonBehaviourFlag
import com.cobblemon.mod.common.entity.pokemon.PokemonEntity
import com.cobblemon.mod.common.util.*
import net.minecraft.network.RegistryFriendlyByteBuf
import net.minecraft.resources.ResourceLocation
import net.minecraft.util.SmoothDouble
import net.minecraft.world.entity.LivingEntity
import net.minecraft.world.entity.player.Player
import net.minecraft.world.phys.Vec2
import net.minecraft.world.phys.Vec3
class FallToGlideCompositeBehaviour : RidingBehaviour<FallToGlideCompositeSettings, FallToGlideCompositeState> {
companion object {
val KEY = cobblemonResource("composite/fall_to_glide")
}
override val key = KEY
val landBehaviour: GenericLandBehaviour = GenericLandBehaviour()
val glideBehaviour: GliderAirBehaviour = GliderAirBehaviour()
override fun tick(
settings: FallToGlideCompositeSettings,
state: FallToGlideCompositeState,
vehicle: PokemonEntity,
driver: Player,
input: Vec3
) {
val shouldBeFlying = checkShouldBeFlying(settings, vehicle, state.activeController.get() == GliderAirBehaviour.KEY)
if (state.activeController.get() == GliderAirBehaviour.KEY && !shouldBeFlying) { // && entity.onGround() && state.timeTransitioned + 20 < entity.level().gameTime) {
state.activeController.set(GenericLandBehaviour.KEY)
vehicle.setBehaviourFlag(PokemonBehaviourFlag.FLYING, false)
} else if (state.activeController.get() == GenericLandBehaviour.KEY && shouldBeFlying) {
state.activeController.set(GliderAirBehaviour.KEY)
vehicle.setBehaviourFlag(PokemonBehaviourFlag.FLYING, true)
}
}
private fun checkShouldBeFlying(
settings: FallToGlideCompositeSettings,
vehicle: PokemonEntity,
isFlyingAlready: Boolean
): Boolean {
val runtime = vehicle.runtime
val minFallingSpeed = runtime.resolveFloat(settings.minimumFallSpeed)
val minForwardSpeed = runtime.resolveFloat(settings.minimumForwardSpeed)
val grounded = vehicle.onGround()
return if (isFlyingAlready) {
!grounded
} else {
vehicle.deltaMovement.y <= -minFallingSpeed && vehicle.deltaMovement.horizontalDistance() >= minForwardSpeed
}
}
override fun isActive(
settings: FallToGlideCompositeSettings,
state: FallToGlideCompositeState,
vehicle: PokemonEntity
): Boolean {
return true
}
override fun pose(
settings: FallToGlideCompositeSettings,
state: FallToGlideCompositeState,
vehicle: PokemonEntity
): PoseType {
return when (state.activeController.get()) {
GenericLandBehaviour.KEY -> landBehaviour.pose(settings.land, state.landState, vehicle)
GliderAirBehaviour.KEY -> glideBehaviour.pose(settings.glide, NoState, vehicle)
else -> error("Invalid controller: ${state.activeController.get()}")
}
}
override fun speed(
settings: FallToGlideCompositeSettings,
state: FallToGlideCompositeState,
vehicle: PokemonEntity,
driver: Player
): Float {
return when (state.activeController.get()) {
GenericLandBehaviour.KEY -> landBehaviour.speed(settings.land, state.landState, vehicle, driver)
GliderAirBehaviour.KEY -> glideBehaviour.speed(settings.glide, NoState, vehicle, driver)
else -> error("Invalid controller: ${state.activeController.get()}")
}
}
override fun rotation(
settings: FallToGlideCompositeSettings,
state: FallToGlideCompositeState,
vehicle: PokemonEntity,
driver: LivingEntity
): Vec2 {
return when (state.activeController.get()) {
GenericLandBehaviour.KEY -> landBehaviour.rotation(settings.land, state.landState, vehicle, driver)
GliderAirBehaviour.KEY -> glideBehaviour.rotation(settings.glide, NoState, vehicle, driver)
else -> error("Invalid controller: ${state.activeController.get()}")
}
}
override fun velocity(
settings: FallToGlideCompositeSettings,
state: FallToGlideCompositeState,
vehicle: PokemonEntity,
driver: Player,
input: Vec3
): Vec3 {
return when (state.activeController.get()) {
GenericLandBehaviour.KEY -> landBehaviour.velocity(settings.land, state.landState, vehicle, driver, input)
GliderAirBehaviour.KEY -> glideBehaviour.velocity(settings.glide, NoState, vehicle, driver, input)
else -> error("Invalid controller: ${state.activeController.get()}")
}
}
override fun angRollVel(
settings: FallToGlideCompositeSettings,
state: FallToGlideCompositeState,
vehicle: PokemonEntity,
driver: Player,
deltaTime: Double
): Vec3 {
return when (state.activeController.get()) {
GenericLandBehaviour.KEY -> landBehaviour.angRollVel(
settings.land,
state.landState,
vehicle,
driver,
deltaTime
)
GliderAirBehaviour.KEY -> glideBehaviour.angRollVel(settings.glide, NoState, vehicle, driver, deltaTime)
else -> error("Invalid controller: ${state.activeController.get()}")
}
}
override fun rotationOnMouseXY(
settings: FallToGlideCompositeSettings,
state: FallToGlideCompositeState,
vehicle: PokemonEntity,
driver: Player,
mouseY: Double,
mouseX: Double,
mouseYSmoother: SmoothDouble,
mouseXSmoother: SmoothDouble,
sensitivity: Double,
deltaTime: Double
): Vec3 {
return when (state.activeController.get()) {
GenericLandBehaviour.KEY -> landBehaviour.rotationOnMouseXY(
settings.land,
state.landState,
vehicle,
driver,
mouseY,
mouseX,
mouseYSmoother,
mouseXSmoother,
sensitivity,
deltaTime
)
GliderAirBehaviour.KEY -> glideBehaviour.rotationOnMouseXY(
settings.glide,
NoState,
vehicle,
driver,
mouseY,
mouseX,
mouseYSmoother,
mouseXSmoother,
sensitivity,
deltaTime
)
else -> error("Invalid controller: ${state.activeController.get()}")
}
}
override fun canJump(
settings: FallToGlideCompositeSettings,
state: FallToGlideCompositeState,
vehicle: PokemonEntity,
driver: Player
): Boolean {
return when (state.activeController.get()) {
GenericLandBehaviour.KEY -> landBehaviour.canJump(settings.land, state.landState, vehicle, driver)
GliderAirBehaviour.KEY -> glideBehaviour.canJump(settings.glide, NoState, vehicle, driver)
else -> error("Invalid controller: ${state.activeController.get()}")
}
}
override fun setRideBar(
settings: FallToGlideCompositeSettings,
state: FallToGlideCompositeState,
vehicle: PokemonEntity,
driver: Player
): Float {
return when (state.activeController.get()) {
GenericLandBehaviour.KEY -> landBehaviour.setRideBar(settings.land, state.landState, vehicle, driver)
GliderAirBehaviour.KEY -> glideBehaviour.setRideBar(settings.glide, NoState, vehicle, driver)
else -> error("Invalid controller: ${state.activeController.get()}")
}
}
override fun jumpForce(
settings: FallToGlideCompositeSettings,
state: FallToGlideCompositeState,
vehicle: PokemonEntity,
driver: Player,
jumpStrength: Int
): Vec3 {
return when (state.activeController.get()) {
GenericLandBehaviour.KEY -> landBehaviour.jumpForce(
settings.land,
state.landState,
vehicle,
driver,
jumpStrength
)
GliderAirBehaviour.KEY -> glideBehaviour.jumpForce(settings.glide, NoState, vehicle, driver, jumpStrength)
else -> error("Invalid controller: ${state.activeController.get()}")
}
}
override fun gravity(
settings: FallToGlideCompositeSettings,
state: FallToGlideCompositeState,
vehicle: PokemonEntity,
regularGravity: Double
): Double {
return when (state.activeController.get()) {
GenericLandBehaviour.KEY -> landBehaviour.gravity(settings.land, state.landState, vehicle, regularGravity)
GliderAirBehaviour.KEY -> glideBehaviour.gravity(settings.glide, NoState, vehicle, regularGravity)
else -> error("Invalid controller: ${state.activeController.get()}")
}
}
override fun rideFovMultiplier(
settings: FallToGlideCompositeSettings,
state: FallToGlideCompositeState,
vehicle: PokemonEntity,
driver: Player
): Float {
return when (state.activeController.get()) {
GenericLandBehaviour.KEY -> landBehaviour.rideFovMultiplier(settings.land, state.landState, vehicle, driver)
GliderAirBehaviour.KEY -> glideBehaviour.rideFovMultiplier(settings.glide, NoState, vehicle, driver)
else -> error("Invalid controller: ${state.activeController.get()}")
}
}
override fun useAngVelSmoothing(
settings: FallToGlideCompositeSettings,
state: FallToGlideCompositeState,
vehicle: PokemonEntity
): Boolean {
return when (state.activeController.get()) {
GenericLandBehaviour.KEY -> landBehaviour.useAngVelSmoothing(settings.land, state.landState, vehicle)
GliderAirBehaviour.KEY -> glideBehaviour.useAngVelSmoothing(settings.glide, NoState, vehicle)
else -> error("Invalid controller: ${state.activeController.get()}")
}
}
override fun useRidingAltPose(
settings: FallToGlideCompositeSettings,
state: FallToGlideCompositeState,
vehicle: PokemonEntity,
driver: Player
): Boolean {
return when (state.activeController.get()) {
GenericLandBehaviour.KEY -> landBehaviour.useRidingAltPose(settings.land, state.landState, vehicle, driver)
GliderAirBehaviour.KEY -> glideBehaviour.useRidingAltPose(settings.glide, NoState, vehicle, driver)
else -> error("Invalid controller: ${state.activeController.get()}")
}
}
override fun inertia(
settings: FallToGlideCompositeSettings,
state: FallToGlideCompositeState,
vehicle: PokemonEntity
): Double {
return when (state.activeController.get()) {
GenericLandBehaviour.KEY -> landBehaviour.inertia(settings.land, state.landState, vehicle)
GliderAirBehaviour.KEY -> glideBehaviour.inertia(settings.glide, NoState, vehicle)
else -> error("Invalid controller: ${state.activeController.get()}")
}
}
override fun shouldRoll(
settings: FallToGlideCompositeSettings,
state: FallToGlideCompositeState,
vehicle: PokemonEntity
): Boolean {
return when (state.activeController.get()) {
GenericLandBehaviour.KEY -> landBehaviour.shouldRoll(settings.land, state.landState, vehicle)
GliderAirBehaviour.KEY -> glideBehaviour.shouldRoll(settings.glide, NoState, vehicle)
else -> error("Invalid controller: ${state.activeController.get()}")
}
}
override fun turnOffOnGround(
settings: FallToGlideCompositeSettings,
state: FallToGlideCompositeState,
vehicle: PokemonEntity
): Boolean {
return when (state.activeController.get()) {
GenericLandBehaviour.KEY -> landBehaviour.turnOffOnGround(settings.land, state.landState, vehicle)
GliderAirBehaviour.KEY -> glideBehaviour.turnOffOnGround(settings.glide, NoState, vehicle)
else -> error("Invalid controller: ${state.activeController.get()}")
}
}
override fun dismountOnShift(
settings: FallToGlideCompositeSettings,
state: FallToGlideCompositeState,
vehicle: PokemonEntity
): Boolean {
return when (state.activeController.get()) {
GenericLandBehaviour.KEY -> landBehaviour.dismountOnShift(settings.land, state.landState, vehicle)
GliderAirBehaviour.KEY -> glideBehaviour.dismountOnShift(settings.glide, NoState, vehicle)
else -> error("Invalid controller: ${state.activeController.get()}")
}
}
override fun shouldRotatePokemonHead(
settings: FallToGlideCompositeSettings,
state: FallToGlideCompositeState,
vehicle: PokemonEntity
): Boolean {
return when (state.activeController.get()) {
GenericLandBehaviour.KEY -> landBehaviour.shouldRotatePokemonHead(settings.land, state.landState, vehicle)
GliderAirBehaviour.KEY -> glideBehaviour.shouldRotatePokemonHead(settings.glide, NoState, vehicle)
else -> error("Invalid controller: ${state.activeController.get()}")
}
}
override fun shouldRotatePlayerHead(
settings: FallToGlideCompositeSettings,
state: FallToGlideCompositeState,
vehicle: PokemonEntity
): Boolean {
return when (state.activeController.get()) {
GenericLandBehaviour.KEY -> landBehaviour.shouldRotatePlayerHead(settings.land, state.landState, vehicle)
GliderAirBehaviour.KEY -> glideBehaviour.shouldRotatePlayerHead(settings.glide, NoState, vehicle)
else -> error("Invalid controller: ${state.activeController.get()}")
}
}
override fun createDefaultState() = FallToGlideCompositeState()
}
class FallToGlideCompositeSettings : RidingBehaviourSettings {
override val key = FallToGlideCompositeBehaviour.KEY
var glide: GliderAirSettings = GliderAirSettings()
private set
var land: GenericLandSettings = GenericLandSettings()
private set
var minimumForwardSpeed: Expression = "0.0".asExpression()
private set
var minimumFallSpeed: Expression = "0.5".asExpression()
private set
override fun encode(buffer: RegistryFriendlyByteBuf) {
glide.encode(buffer)
land.encode(buffer)
buffer.writeExpression(minimumForwardSpeed)
buffer.writeExpression(minimumFallSpeed)
}
override fun decode(buffer: RegistryFriendlyByteBuf) {
glide.decode(buffer)
land.decode(buffer)
minimumForwardSpeed = buffer.readExpression()
minimumFallSpeed = buffer.readExpression()
}
}
class FallToGlideCompositeState : RidingBehaviourState {
var activeController = ridingState(GenericLandBehaviour.KEY, Side.CLIENT)
var landState: GenericLandState = GenericLandState()
var timeTransitioned = ridingState(-100L, Side.BOTH)
override fun encode(buffer: RegistryFriendlyByteBuf) {
buffer.writeResourceLocation(activeController.get())
landState.encode(buffer)
}
override fun decode(buffer: RegistryFriendlyByteBuf) {
activeController.set(buffer.readResourceLocation(), forced = true)
landState.decode(buffer)
}
override fun reset() {
activeController.set(GenericLandBehaviour.KEY, forced = true)
landState.reset()
timeTransitioned.set(-100L, forced = true)
}
override fun toString(): String {
return "FallToGlideCompositeState(activeController=$activeController, landState=$landState, timeTransitioned=$timeTransitioned)"
}
override fun copy() = FallToGlideCompositeState().also {
it.activeController.set(activeController.get(), forced = true)
it.landState = landState.copy()
it.timeTransitioned.set(timeTransitioned.get(), forced = true)
}
override fun shouldSync(previous: RidingBehaviourState): Boolean {
if (previous !is FallToGlideCompositeState) return false
if (activeController != previous.activeController) return true
if (landState.shouldSync(previous.landState)) return true
return false
}
}
@@ -10,6 +10,7 @@ package com.cobblemon.mod.common.api.riding.behaviour.types
import com.bedrockk.molang.Expression
import com.bedrockk.molang.runtime.value.DoubleValue
import com.cobblemon.mod.common.api.riding.RidingStyle
import com.cobblemon.mod.common.api.riding.behaviour.*
import com.cobblemon.mod.common.api.riding.posing.PoseOption
import com.cobblemon.mod.common.api.riding.posing.PoseProvider
@@ -33,10 +34,11 @@ class GenericLandBehaviour : RidingBehaviour<GenericLandSettings, GenericLandSta
}
override val key = KEY
override val style = RidingStyle.LAND
val poseProvider = PoseProvider<GenericLandSettings, GenericLandState>(PoseType.STAND)
.with(PoseOption(PoseType.WALK) { _, state, _ ->
return@PoseOption state.rideVel.get().z > 0.1
return@PoseOption state.rideVelocity.get().z > 0.1
})
override fun isActive(
@@ -72,7 +74,7 @@ class GenericLandBehaviour : RidingBehaviour<GenericLandSettings, GenericLandSta
vehicle: PokemonEntity,
driver: Player
): Float {
return state.rideVel.get().length().toFloat()
return state.rideVelocity.get().length().toFloat()
}
override fun rotation(
@@ -105,9 +107,9 @@ class GenericLandBehaviour : RidingBehaviour<GenericLandSettings, GenericLandSta
//Jump the thang!
if (driver.jumping && vehicle.onGround()) {
state.rideVel.set(Vec3(newVelocity.x, 2.0, newVelocity.z))
state.rideVelocity.set(Vec3(newVelocity.x, 2.0, newVelocity.z))
} else {
state.rideVel.set(newVelocity)
state.rideVelocity.set(newVelocity)
}
//This is cheap.
@@ -118,7 +120,7 @@ class GenericLandBehaviour : RidingBehaviour<GenericLandSettings, GenericLandSta
//entity.deltaMovement = entity.deltaMovement.lerp(velocity, 1.0)
//state.currVel = state.currVel.add( f.toDouble() / 20.0, gravity / 20.0 , g.toDouble() / 20.0)
return state.rideVel.get()
return state.rideVelocity.get()
}
private fun calculateRideSpaceVel(
@@ -129,11 +131,11 @@ class GenericLandBehaviour : RidingBehaviour<GenericLandSettings, GenericLandSta
): Vec3 {
val topSpeed = vehicle.runtime.resolveDouble(settings.topSpeedExpr)
val accel = vehicle.runtime.resolveDouble(settings.accelExpr)
val speed = state.rideVel.get().length()
val speed = state.rideVelocity.get().length()
val minSpeed = 0.0
var newVelocity = Vec3(state.rideVel.get().x, state.rideVel.get().y, state.rideVel.get().z)
var newVelocity = Vec3(state.rideVelocity.get().x, state.rideVelocity.get().y, state.rideVelocity.get().z)
//speed up and slow down based on input
if (driver.zza > 0.0 && speed <= topSpeed && state.stamina.get() > 0.0f) {
@@ -316,7 +318,7 @@ class GenericLandBehaviour : RidingBehaviour<GenericLandSettings, GenericLandSta
return false
}
override fun createDefaultState() = GenericLandState()
override fun createDefaultState(settings: GenericLandSettings) = GenericLandState()
}
class GenericLandSettings : RidingBehaviourSettings {
@@ -354,6 +356,7 @@ class GenericLandSettings : RidingBehaviourSettings {
private set
override fun encode(buffer: RegistryFriendlyByteBuf) {
buffer.writeResourceLocation(key)
buffer.writeExpression(driveFactor)
buffer.writeExpression(strafeFactor)
buffer.writeExpression(reverseDriveFactor)
@@ -385,41 +388,17 @@ class GenericLandSettings : RidingBehaviourSettings {
}
class GenericLandState : RidingBehaviourState {
var rideVel = ridingState(Vec3.ZERO, Side.CLIENT)
var stamina = ridingState(1.0f, Side.CLIENT)
class GenericLandState : RidingBehaviourState() {
var currSpeed = ridingState(0.0, Side.BOTH)
override fun encode(buffer: RegistryFriendlyByteBuf) {
buffer.writeVec3(rideVel.get())
buffer.writeFloat(stamina.get())
}
override fun decode(buffer: RegistryFriendlyByteBuf) {
rideVel.set(buffer.readVec3(), forced = true)
stamina.set(buffer.readFloat(), forced = true)
}
override fun reset() {
rideVel.set(Vec3.ZERO, forced = true)
stamina.set(1.0f, forced = true)
currSpeed.set(0.0, forced = true)
}
override fun toString(): String {
return "GenericLandState(rideVel=${rideVel.get()}, stamina=${stamina.get()}, currSpeed=${currSpeed.get()})"
}
override fun copy() = GenericLandState().also {
it.rideVel.set(this.rideVel.get(), forced = true)
it.rideVelocity.set(this.rideVelocity.get(), forced = true)
it.stamina.set(this.stamina.get(), forced = true)
it.currSpeed.set(this.currSpeed.get(), forced = true)
}
override fun shouldSync(previous: RidingBehaviourState): Boolean {
if (previous !is GenericLandState) return false
if (rideVel != previous.rideVel) return true
if (stamina != previous.stamina) return true
return false
return super.shouldSync(previous)
}
}
@@ -11,7 +11,8 @@ package com.cobblemon.mod.common.api.riding.behaviour.types
import com.bedrockk.molang.runtime.value.DoubleValue
import com.cobblemon.mod.common.Cobblemon
import com.cobblemon.mod.common.OrientationControllable
import com.cobblemon.mod.common.api.riding.behaviour.NoState
import com.cobblemon.mod.common.api.riding.RidingStyle
import com.cobblemon.mod.common.api.riding.behaviour.RidingBehaviourState
import com.cobblemon.mod.common.api.riding.behaviour.RidingBehaviour
import com.cobblemon.mod.common.api.riding.behaviour.RidingBehaviourSettings
import com.cobblemon.mod.common.api.riding.posing.PoseOption
@@ -28,17 +29,18 @@ import net.minecraft.world.phys.Vec2
import net.minecraft.world.phys.Vec3
import net.minecraft.world.phys.shapes.Shapes
class GenericSwimBehaviour : RidingBehaviour<GenericSwimSettings, NoState> {
class GenericSwimBehaviour : RidingBehaviour<GenericSwimSettings, RidingBehaviourState> {
companion object {
val KEY = cobblemonResource("swim/generic")
}
override val key = KEY
override val style = RidingStyle.LIQUID
val poseProvider = PoseProvider<GenericSwimSettings, NoState>(PoseType.FLOAT)
val poseProvider = PoseProvider<GenericSwimSettings, RidingBehaviourState>(PoseType.FLOAT)
.with(PoseOption(PoseType.SWIM) { _, _, entity -> entity.isSwimming && entity.entityData.get(PokemonEntity.MOVING) })
override fun isActive(settings: GenericSwimSettings, state: NoState, vehicle: PokemonEntity): Boolean {
override fun isActive(settings: GenericSwimSettings, state: RidingBehaviourState, vehicle: PokemonEntity): Boolean {
return Shapes.create(vehicle.boundingBox).blockPositionsAsListRounded().any {
if (vehicle.isInWater || vehicle.isUnderWater) {
return@any true
@@ -48,17 +50,17 @@ class GenericSwimBehaviour : RidingBehaviour<GenericSwimSettings, NoState> {
}
}
override fun pose(settings: GenericSwimSettings, state: NoState, vehicle: PokemonEntity): PoseType {
override fun pose(settings: GenericSwimSettings, state: RidingBehaviourState, vehicle: PokemonEntity): PoseType {
return poseProvider.select(settings, state, vehicle)
}
override fun speed(settings: GenericSwimSettings, state: NoState, vehicle: PokemonEntity, driver: Player): Float {
override fun speed(settings: GenericSwimSettings, state: RidingBehaviourState, vehicle: PokemonEntity, driver: Player): Float {
return vehicle.runtime.resolveFloat(settings.speed)
}
override fun rotation(
settings: GenericSwimSettings,
state: NoState,
state: RidingBehaviourState,
vehicle: PokemonEntity,
driver: LivingEntity
): Vec2 {
@@ -67,7 +69,7 @@ class GenericSwimBehaviour : RidingBehaviour<GenericSwimSettings, NoState> {
override fun velocity(
settings: GenericSwimSettings,
state: NoState,
state: RidingBehaviourState,
vehicle: PokemonEntity,
driver: Player,
input: Vec3
@@ -88,7 +90,7 @@ class GenericSwimBehaviour : RidingBehaviour<GenericSwimSettings, NoState> {
override fun angRollVel(
settings: GenericSwimSettings,
state: NoState,
state: RidingBehaviourState,
vehicle: PokemonEntity,
driver: Player,
deltaTime: Double
@@ -98,7 +100,7 @@ class GenericSwimBehaviour : RidingBehaviour<GenericSwimSettings, NoState> {
override fun rotationOnMouseXY(
settings: GenericSwimSettings,
state: NoState,
state: RidingBehaviourState,
vehicle: PokemonEntity,
driver: Player,
mouseY: Double,
@@ -118,7 +120,7 @@ class GenericSwimBehaviour : RidingBehaviour<GenericSwimSettings, NoState> {
override fun canJump(
settings: GenericSwimSettings,
state: NoState,
state: RidingBehaviourState,
vehicle: PokemonEntity,
driver: Player
): Boolean {
@@ -127,7 +129,7 @@ class GenericSwimBehaviour : RidingBehaviour<GenericSwimSettings, NoState> {
override fun setRideBar(
settings: GenericSwimSettings,
state: NoState,
state: RidingBehaviourState,
vehicle: PokemonEntity,
driver: Player
): Float {
@@ -136,7 +138,7 @@ class GenericSwimBehaviour : RidingBehaviour<GenericSwimSettings, NoState> {
override fun jumpForce(
settings: GenericSwimSettings,
state: NoState,
state: RidingBehaviourState,
vehicle: PokemonEntity,
driver: Player,
jumpStrength: Int
@@ -149,7 +151,7 @@ class GenericSwimBehaviour : RidingBehaviour<GenericSwimSettings, NoState> {
override fun gravity(
settings: GenericSwimSettings,
state: NoState,
state: RidingBehaviourState,
vehicle: PokemonEntity,
regularGravity: Double
): Double {
@@ -158,45 +160,45 @@ class GenericSwimBehaviour : RidingBehaviour<GenericSwimSettings, NoState> {
override fun rideFovMultiplier(
settings: GenericSwimSettings,
state: NoState,
state: RidingBehaviourState,
vehicle: PokemonEntity,
driver: Player
): Float {
return 1.0f
}
override fun useAngVelSmoothing(settings: GenericSwimSettings, state: NoState, vehicle: PokemonEntity): Boolean {
override fun useAngVelSmoothing(settings: GenericSwimSettings, state: RidingBehaviourState, vehicle: PokemonEntity): Boolean {
return false
}
override fun useRidingAltPose(
settings: GenericSwimSettings,
state: NoState,
state: RidingBehaviourState,
vehicle: PokemonEntity,
driver: Player
): Boolean {
return false
}
override fun inertia(settings: GenericSwimSettings, state: NoState, vehicle: PokemonEntity): Double {
override fun inertia(settings: GenericSwimSettings, state: RidingBehaviourState, vehicle: PokemonEntity): Double {
return 0.5
}
override fun shouldRoll(settings: GenericSwimSettings, state: NoState, vehicle: PokemonEntity): Boolean {
override fun shouldRoll(settings: GenericSwimSettings, state: RidingBehaviourState, vehicle: PokemonEntity): Boolean {
return false
}
override fun turnOffOnGround(settings: GenericSwimSettings, state: NoState, vehicle: PokemonEntity): Boolean {
override fun turnOffOnGround(settings: GenericSwimSettings, state: RidingBehaviourState, vehicle: PokemonEntity): Boolean {
return false
}
override fun dismountOnShift(settings: GenericSwimSettings, state: NoState, vehicle: PokemonEntity): Boolean {
override fun dismountOnShift(settings: GenericSwimSettings, state: RidingBehaviourState, vehicle: PokemonEntity): Boolean {
return false
}
override fun shouldRotatePokemonHead(
settings: GenericSwimSettings,
state: NoState,
state: RidingBehaviourState,
vehicle: PokemonEntity
): Boolean {
return false
@@ -204,13 +206,13 @@ class GenericSwimBehaviour : RidingBehaviour<GenericSwimSettings, NoState> {
override fun shouldRotatePlayerHead(
settings: GenericSwimSettings,
state: NoState,
state: RidingBehaviourState,
vehicle: PokemonEntity
): Boolean {
return false
}
override fun createDefaultState() = NoState
override fun createDefaultState(settings: GenericSwimSettings) = RidingBehaviourState()
}
@@ -236,6 +238,7 @@ class GenericSwimSettings : RidingBehaviourSettings {
private set
override fun encode(buffer: RegistryFriendlyByteBuf) {
buffer.writeResourceLocation(key)
buffer.writeExpression(canJump)
buffer.writeExpression(jumpVector[0])
buffer.writeExpression(jumpVector[1])
@@ -12,7 +12,7 @@ import com.bedrockk.molang.Expression
import com.cobblemon.mod.common.Cobblemon
import com.cobblemon.mod.common.OrientationControllable
import com.cobblemon.mod.common.api.riding.RidingStyle
import com.cobblemon.mod.common.api.riding.behaviour.NoState
import com.cobblemon.mod.common.api.riding.behaviour.RidingBehaviourState
import com.cobblemon.mod.common.api.riding.behaviour.RidingBehaviour
import com.cobblemon.mod.common.api.riding.behaviour.RidingBehaviourSettings
import com.cobblemon.mod.common.api.riding.posing.PoseOption
@@ -29,31 +29,32 @@ import net.minecraft.world.entity.player.Player
import net.minecraft.world.phys.Vec2
import net.minecraft.world.phys.Vec3
class GliderAirBehaviour : RidingBehaviour<GliderAirSettings, NoState> {
class GliderAirBehaviour : RidingBehaviour<GliderAirSettings, RidingBehaviourState> {
companion object {
val KEY = cobblemonResource("air/glider")
}
override val key = KEY
override val style = RidingStyle.AIR
val poseProvider = PoseProvider<GliderAirSettings, NoState>(PoseType.HOVER)
val poseProvider = PoseProvider<GliderAirSettings, RidingBehaviourState>(PoseType.HOVER)
.with(PoseOption(PoseType.FLY) { _, _, entity -> entity.entityData.get(PokemonEntity.MOVING) })
override fun isActive(settings: GliderAirSettings, state: NoState, vehicle: PokemonEntity): Boolean {
override fun isActive(settings: GliderAirSettings, state: RidingBehaviourState, vehicle: PokemonEntity): Boolean {
return true
}
override fun pose(settings: GliderAirSettings, state: NoState, vehicle: PokemonEntity): PoseType {
override fun pose(settings: GliderAirSettings, state: RidingBehaviourState, vehicle: PokemonEntity): PoseType {
return poseProvider.select(settings, state, vehicle)
}
override fun speed(settings: GliderAirSettings, state: NoState, vehicle: PokemonEntity, driver: Player): Float {
override fun speed(settings: GliderAirSettings, state: RidingBehaviourState, vehicle: PokemonEntity, driver: Player): Float {
return vehicle.runtime.resolveFloat(settings.speed)
}
override fun rotation(
settings: GliderAirSettings,
state: NoState,
state: RidingBehaviourState,
vehicle: PokemonEntity,
driver: LivingEntity
): Vec2 {
@@ -62,7 +63,7 @@ class GliderAirBehaviour : RidingBehaviour<GliderAirSettings, NoState> {
override fun velocity(
settings: GliderAirSettings,
state: NoState,
state: RidingBehaviourState,
vehicle: PokemonEntity,
driver: Player,
input: Vec3
@@ -77,7 +78,7 @@ class GliderAirBehaviour : RidingBehaviour<GliderAirSettings, NoState> {
override fun angRollVel(
settings: GliderAirSettings,
state: NoState,
state: RidingBehaviourState,
vehicle: PokemonEntity,
driver: Player,
deltaTime: Double
@@ -87,7 +88,7 @@ class GliderAirBehaviour : RidingBehaviour<GliderAirSettings, NoState> {
override fun rotationOnMouseXY(
settings: GliderAirSettings,
state: NoState,
state: RidingBehaviourState,
vehicle: PokemonEntity,
driver: Player,
mouseY: Double,
@@ -105,13 +106,13 @@ class GliderAirBehaviour : RidingBehaviour<GliderAirSettings, NoState> {
return Vec3(0.0, mouseY * invertPitch, mouseX * invertRoll)
}
override fun canJump(settings: GliderAirSettings, state: NoState, vehicle: PokemonEntity, driver: Player): Boolean {
override fun canJump(settings: GliderAirSettings, state: RidingBehaviourState, vehicle: PokemonEntity, driver: Player): Boolean {
return false
}
override fun setRideBar(
settings: GliderAirSettings,
state: NoState,
state: RidingBehaviourState,
vehicle: PokemonEntity,
driver: Player
): Float {
@@ -120,7 +121,7 @@ class GliderAirBehaviour : RidingBehaviour<GliderAirSettings, NoState> {
override fun jumpForce(
settings: GliderAirSettings,
state: NoState,
state: RidingBehaviourState,
vehicle: PokemonEntity,
driver: Player,
jumpStrength: Int
@@ -130,7 +131,7 @@ class GliderAirBehaviour : RidingBehaviour<GliderAirSettings, NoState> {
override fun gravity(
settings: GliderAirSettings,
state: NoState,
state: RidingBehaviourState,
vehicle: PokemonEntity,
regularGravity: Double
): Double {
@@ -139,51 +140,51 @@ class GliderAirBehaviour : RidingBehaviour<GliderAirSettings, NoState> {
override fun rideFovMultiplier(
settings: GliderAirSettings,
state: NoState,
state: RidingBehaviourState,
vehicle: PokemonEntity,
driver: Player
): Float {
return 1.0f
}
override fun useAngVelSmoothing(settings: GliderAirSettings, state: NoState, vehicle: PokemonEntity): Boolean {
override fun useAngVelSmoothing(settings: GliderAirSettings, state: RidingBehaviourState, vehicle: PokemonEntity): Boolean {
return false
}
override fun useRidingAltPose(
settings: GliderAirSettings,
state: NoState,
state: RidingBehaviourState,
vehicle: PokemonEntity,
driver: Player
): Boolean {
return false
}
override fun inertia(settings: GliderAirSettings, state: NoState, vehicle: PokemonEntity): Double {
override fun inertia(settings: GliderAirSettings, state: RidingBehaviourState, vehicle: PokemonEntity): Double {
return 0.5
}
override fun shouldRoll(settings: GliderAirSettings, state: NoState, vehicle: PokemonEntity): Boolean {
override fun shouldRoll(settings: GliderAirSettings, state: RidingBehaviourState, vehicle: PokemonEntity): Boolean {
return false
}
override fun turnOffOnGround(settings: GliderAirSettings, state: NoState, vehicle: PokemonEntity): Boolean {
override fun turnOffOnGround(settings: GliderAirSettings, state: RidingBehaviourState, vehicle: PokemonEntity): Boolean {
return false
}
override fun dismountOnShift(settings: GliderAirSettings, state: NoState, vehicle: PokemonEntity): Boolean {
override fun dismountOnShift(settings: GliderAirSettings, state: RidingBehaviourState, vehicle: PokemonEntity): Boolean {
return false
}
override fun shouldRotatePokemonHead(settings: GliderAirSettings, state: NoState, vehicle: PokemonEntity): Boolean {
override fun shouldRotatePokemonHead(settings: GliderAirSettings, state: RidingBehaviourState, vehicle: PokemonEntity): Boolean {
return false
}
override fun shouldRotatePlayerHead(settings: GliderAirSettings, state: NoState, vehicle: PokemonEntity): Boolean {
override fun shouldRotatePlayerHead(settings: GliderAirSettings, state: RidingBehaviourState, vehicle: PokemonEntity): Boolean {
return false
}
override fun createDefaultState() = NoState
override fun createDefaultState(settings: GliderAirSettings) = RidingBehaviourState()
}
class GliderAirSettings : RidingBehaviourSettings {
@@ -199,6 +200,7 @@ class GliderAirSettings : RidingBehaviourSettings {
private set
override fun encode(buffer: RegistryFriendlyByteBuf) {
buffer.writeResourceLocation(key)
buffer.writeExpression(glideSpeed)
buffer.writeExpression(speed)
buffer.writeExpression(canStrafe)
@@ -11,7 +11,8 @@ package com.cobblemon.mod.common.api.riding.behaviour.types
import com.bedrockk.molang.Expression
import com.cobblemon.mod.common.Cobblemon
import com.cobblemon.mod.common.OrientationControllable
import com.cobblemon.mod.common.api.riding.behaviour.NoState
import com.cobblemon.mod.common.api.riding.RidingStyle
import com.cobblemon.mod.common.api.riding.behaviour.RidingBehaviourState
import com.cobblemon.mod.common.api.riding.behaviour.RidingBehaviour
import com.cobblemon.mod.common.api.riding.behaviour.RidingBehaviourSettings
import com.cobblemon.mod.common.api.riding.posing.PoseOption
@@ -31,18 +32,19 @@ import kotlin.math.abs
import kotlin.math.pow
import kotlin.math.sin
class HelicopterBehaviour : RidingBehaviour<HelicopterSettings, NoState> {
class HelicopterBehaviour : RidingBehaviour<HelicopterSettings, RidingBehaviourState> {
companion object {
val KEY = cobblemonResource("air/helicopter")
val ROTATION_LIMIT = 30.0f
}
override val key = KEY
override val style = RidingStyle.AIR
val poseProvider = PoseProvider<HelicopterSettings, NoState>(PoseType.HOVER)
val poseProvider = PoseProvider<HelicopterSettings, RidingBehaviourState>(PoseType.HOVER)
.with(PoseOption(PoseType.FLY) { _, _, entity -> entity.entityData.get(PokemonEntity.MOVING) })
override fun isActive(settings: HelicopterSettings, state: NoState, vehicle: PokemonEntity): Boolean {
override fun isActive(settings: HelicopterSettings, state: RidingBehaviourState, vehicle: PokemonEntity): Boolean {
//If there are only fluid blocks or air block below the ride
//then activate the controller. If it is in water the ride will
//dismount accordingly
@@ -56,11 +58,11 @@ class HelicopterBehaviour : RidingBehaviour<HelicopterSettings, NoState> {
}
}
override fun pose(settings: HelicopterSettings, state: NoState, vehicle: PokemonEntity): PoseType {
override fun pose(settings: HelicopterSettings, state: RidingBehaviourState, vehicle: PokemonEntity): PoseType {
return poseProvider.select(settings, state, vehicle)
}
override fun speed(settings: HelicopterSettings, state: NoState, vehicle: PokemonEntity, driver: Player): Float {
override fun speed(settings: HelicopterSettings, state: RidingBehaviourState, vehicle: PokemonEntity, driver: Player): Float {
//Increased max speed to exaggerate movement.
//This likely just needs to be a static number if it really is just
//the scalar for the velocity vector
@@ -69,7 +71,7 @@ class HelicopterBehaviour : RidingBehaviour<HelicopterSettings, NoState> {
override fun rotation(
settings: HelicopterSettings,
state: NoState,
state: RidingBehaviourState,
vehicle: PokemonEntity,
driver: LivingEntity
): Vec2 {
@@ -78,7 +80,7 @@ class HelicopterBehaviour : RidingBehaviour<HelicopterSettings, NoState> {
override fun velocity(
settings: HelicopterSettings,
state: NoState,
state: RidingBehaviourState,
vehicle: PokemonEntity,
driver: Player,
input: Vec3
@@ -107,7 +109,7 @@ class HelicopterBehaviour : RidingBehaviour<HelicopterSettings, NoState> {
override fun angRollVel(
settings: HelicopterSettings,
state: NoState,
state: RidingBehaviourState,
vehicle: PokemonEntity,
driver: Player,
deltaTime: Double
@@ -162,7 +164,7 @@ class HelicopterBehaviour : RidingBehaviour<HelicopterSettings, NoState> {
override fun rotationOnMouseXY(
settings: HelicopterSettings,
state: NoState,
state: RidingBehaviourState,
vehicle: PokemonEntity,
driver: Player,
mouseY: Double,
@@ -182,7 +184,7 @@ class HelicopterBehaviour : RidingBehaviour<HelicopterSettings, NoState> {
override fun canJump(
settings: HelicopterSettings,
state: NoState,
state: RidingBehaviourState,
vehicle: PokemonEntity,
driver: Player
): Boolean {
@@ -191,7 +193,7 @@ class HelicopterBehaviour : RidingBehaviour<HelicopterSettings, NoState> {
override fun setRideBar(
settings: HelicopterSettings,
state: NoState,
state: RidingBehaviourState,
vehicle: PokemonEntity,
driver: Player
): Float {
@@ -200,7 +202,7 @@ class HelicopterBehaviour : RidingBehaviour<HelicopterSettings, NoState> {
override fun jumpForce(
settings: HelicopterSettings,
state: NoState,
state: RidingBehaviourState,
vehicle: PokemonEntity,
driver: Player,
jumpStrength: Int
@@ -210,7 +212,7 @@ class HelicopterBehaviour : RidingBehaviour<HelicopterSettings, NoState> {
override fun gravity(
settings: HelicopterSettings,
state: NoState,
state: RidingBehaviourState,
vehicle: PokemonEntity,
regularGravity: Double
): Double {
@@ -219,55 +221,55 @@ class HelicopterBehaviour : RidingBehaviour<HelicopterSettings, NoState> {
override fun rideFovMultiplier(
settings: HelicopterSettings,
state: NoState,
state: RidingBehaviourState,
vehicle: PokemonEntity,
driver: Player
): Float {
return 1.0f
}
override fun useAngVelSmoothing(settings: HelicopterSettings, state: NoState, vehicle: PokemonEntity): Boolean {
override fun useAngVelSmoothing(settings: HelicopterSettings, state: RidingBehaviourState, vehicle: PokemonEntity): Boolean {
return true
}
override fun useRidingAltPose(
settings: HelicopterSettings,
state: NoState,
state: RidingBehaviourState,
vehicle: PokemonEntity,
driver: Player
): Boolean {
return false
}
override fun inertia(settings: HelicopterSettings, state: NoState, vehicle: PokemonEntity): Double {
override fun inertia(settings: HelicopterSettings, state: RidingBehaviourState, vehicle: PokemonEntity): Double {
return 0.1
}
override fun shouldRoll(settings: HelicopterSettings, state: NoState, vehicle: PokemonEntity): Boolean {
override fun shouldRoll(settings: HelicopterSettings, state: RidingBehaviourState, vehicle: PokemonEntity): Boolean {
return true
}
override fun turnOffOnGround(settings: HelicopterSettings, state: NoState, vehicle: PokemonEntity): Boolean {
override fun turnOffOnGround(settings: HelicopterSettings, state: RidingBehaviourState, vehicle: PokemonEntity): Boolean {
return false
}
override fun dismountOnShift(settings: HelicopterSettings, state: NoState, vehicle: PokemonEntity): Boolean {
override fun dismountOnShift(settings: HelicopterSettings, state: RidingBehaviourState, vehicle: PokemonEntity): Boolean {
return false
}
override fun shouldRotatePokemonHead(
settings: HelicopterSettings,
state: NoState,
state: RidingBehaviourState,
vehicle: PokemonEntity
): Boolean {
return false
}
override fun shouldRotatePlayerHead(settings: HelicopterSettings, state: NoState, vehicle: PokemonEntity): Boolean {
override fun shouldRotatePlayerHead(settings: HelicopterSettings, state: RidingBehaviourState, vehicle: PokemonEntity): Boolean {
return false
}
override fun createDefaultState() = NoState
override fun createDefaultState(settings: HelicopterSettings) = RidingBehaviourState()
}
@@ -287,6 +289,7 @@ class HelicopterSettings : RidingBehaviourSettings {
private set
override fun encode(buffer: RegistryFriendlyByteBuf) {
buffer.writeResourceLocation(key)
buffer.writeExpression(gravity)
buffer.writeExpression(horizontalAcceleration)
buffer.writeExpression(verticalVelocity)
@@ -11,12 +11,14 @@ package com.cobblemon.mod.common.api.riding.behaviour.types
import com.bedrockk.molang.Expression
import com.cobblemon.mod.common.Cobblemon
import com.cobblemon.mod.common.OrientationControllable
import com.cobblemon.mod.common.api.riding.RidingStyle
import com.cobblemon.mod.common.api.riding.behaviour.*
import com.cobblemon.mod.common.api.riding.posing.PoseOption
import com.cobblemon.mod.common.api.riding.posing.PoseProvider
import com.cobblemon.mod.common.entity.PoseType
import com.cobblemon.mod.common.entity.pokemon.PokemonEntity
import com.cobblemon.mod.common.util.*
import net.minecraft.network.FriendlyByteBuf
import net.minecraft.network.RegistryFriendlyByteBuf
import net.minecraft.resources.ResourceLocation
import net.minecraft.util.SmoothDouble
@@ -32,9 +34,10 @@ class JetAirBehaviour : RidingBehaviour<JetAirSettings, JetAirState> {
}
override val key = KEY
override val style = RidingStyle.AIR
val poseProvider = PoseProvider<JetAirSettings, JetAirState>(PoseType.HOVER)
.with(PoseOption(PoseType.FLY) { _, state, _ -> state.rideVel.get().z > 0.1 })
.with(PoseOption(PoseType.FLY) { _, state, _ -> state.rideVelocity.get().z > 0.1 })
override fun isActive(settings: JetAirSettings, state: JetAirState, vehicle: PokemonEntity): Boolean {
return true
@@ -57,7 +60,7 @@ class JetAirBehaviour : RidingBehaviour<JetAirSettings, JetAirState> {
//Calculate stamina loss due to speed
//At max speed it will tick down 0.1 a second so the stamina will last ten seconds
//There has got to be a better way to express this equation. It interpolates between 0.5 and 1.0
var staminaRate = (normalizeSpeed(state.rideVel.get().length(), minSpeed, topSpeed))
var staminaRate = (normalizeSpeed(state.rideVelocity.get().length(), minSpeed, topSpeed))
//interpolate between 0.25 and 1.0 so that you always have at least a min of 0.25 stam loss
staminaRate = 0.25 + (0.75 * staminaRate.pow(3))
@@ -69,7 +72,7 @@ class JetAirBehaviour : RidingBehaviour<JetAirSettings, JetAirState> {
state.stamina.set(1.0f)
}
return state.rideVel.get().length().toFloat()
return state.rideVelocity.get().length().toFloat()
}
//TODO: Move these functions to a riding util class.
@@ -108,8 +111,8 @@ class JetAirBehaviour : RidingBehaviour<JetAirSettings, JetAirState> {
//Translate ride space velocity to world space velocity.
if (controller != null) {
upForce = -1.0 * sin(Math.toRadians(controller.pitch.toDouble())) * state.rideVel.get().z
forwardForce = cos(Math.toRadians(controller.pitch.toDouble())) * state.rideVel.get().z
upForce = -1.0 * sin(Math.toRadians(controller.pitch.toDouble())) * state.rideVelocity.get().z
forwardForce = cos(Math.toRadians(controller.pitch.toDouble())) * state.rideVelocity.get().z
}
//If stamina has run out then initiate forced glide down.
@@ -141,7 +144,7 @@ class JetAirBehaviour : RidingBehaviour<JetAirSettings, JetAirState> {
val accel = vehicle.runtime.resolveDouble(settings.accelerationExpr)
val altitudeLimit = vehicle.runtime.resolveDouble(settings.jumpExpr)
val minSpeed = vehicle.runtime.resolveDouble(settings.minSpeed)
val speed = state.rideVel.get().length()
val speed = state.rideVelocity.get().length()
//Give no altitude limit if at max jump stat.
val pushingHeightLimit = if (vehicle.runtime.resolveBoolean(settings.infiniteStamina)) false
@@ -152,15 +155,15 @@ class JetAirBehaviour : RidingBehaviour<JetAirSettings, JetAirState> {
if (driver.zza > 0.0 && speed < topSpeed && state.stamina.get() > 0.0f && !pushingHeightLimit) {
//modify acceleration to be slower when at closer speeds to top speed
val accelMod = max(-(normalizeSpeed(speed, minSpeed, topSpeed)) + 1, 0.0)
state.rideVel.set(Vec3(state.rideVel.get().x, state.rideVel.get().y, min(state.rideVel.get().z + (accel * accelMod), topSpeed)))
state.rideVelocity.set(Vec3(state.rideVelocity.get().x, state.rideVelocity.get().y, min(state.rideVelocity.get().z + (accel * accelMod), topSpeed)))
} else if (driver.zza >= 0.0 && (state.stamina.get() == 0.0f || pushingHeightLimit)) {
state.rideVel.set(Vec3(state.rideVel.get().x, state.rideVel.get().y, max(state.rideVel.get().z - ((accel) / 4), minSpeed)))
state.rideVelocity.set(Vec3(state.rideVelocity.get().x, state.rideVelocity.get().y, max(state.rideVelocity.get().z - ((accel) / 4), minSpeed)))
} else if (driver.zza < 0.0 && speed > minSpeed) {
//modify deccel to be slower when at closer speeds to minimum speed
val deccelMod = max((normalizeSpeed(speed, minSpeed, topSpeed) - 1).pow(2), 0.1)
//Decelerate currently always a constant half of max acceleration.
state.rideVel.set(Vec3(state.rideVel.get().x, state.rideVel.get().y, max(state.rideVel.get().z - ((accel * deccelMod) / 2), minSpeed)))
state.rideVelocity.set(Vec3(state.rideVelocity.get().x, state.rideVelocity.get().y, max(state.rideVelocity.get().z - ((accel * deccelMod) / 2), minSpeed)))
}
}
@@ -285,7 +288,7 @@ class JetAirBehaviour : RidingBehaviour<JetAirSettings, JetAirState> {
val minSpeed = vehicle.runtime.resolveDouble(settings.minSpeed)
//Must I ensure that topspeed is greater than minimum?
val normalizedSpeed = normalizeSpeed(state.rideVel.get().length(), minSpeed, topSpeed)
val normalizedSpeed = normalizeSpeed(state.rideVelocity.get().length(), minSpeed, topSpeed)
//TODO: Determine if this should be based on max possible speed instead of top speed.
//Only ever want the fov change to be a max of 0.2 and for it to have non linear scaling.
@@ -333,7 +336,7 @@ class JetAirBehaviour : RidingBehaviour<JetAirSettings, JetAirState> {
return false
}
override fun createDefaultState() = JetAirState()
override fun createDefaultState(settings: JetAirSettings) = JetAirState()
}
class JetAirSettings : RidingBehaviourSettings {
@@ -367,6 +370,7 @@ class JetAirSettings : RidingBehaviourSettings {
private set
override fun encode(buffer: RegistryFriendlyByteBuf) {
buffer.writeResourceLocation(key)
buffer.writeExpression(gravity)
buffer.writeExpression(minSpeed)
buffer.writeExpression(handlingYawExpr)
@@ -393,41 +397,33 @@ class JetAirSettings : RidingBehaviourSettings {
}
}
class JetAirState : RidingBehaviourState {
class JetAirState : RidingBehaviourState() {
var currSpeed = ridingState(0.0, Side.CLIENT)
var stamina = ridingState(1.0f, Side.CLIENT)
var rideVel = ridingState(Vec3.ZERO, Side.CLIENT)
var currMouseXForce = ridingState(0.0, Side.BOTH)
var currMouseYForce = ridingState(0.0, Side.BOTH)
override fun encode(buffer: RegistryFriendlyByteBuf) {
override fun encode(buffer: FriendlyByteBuf) {
super.encode(buffer)
buffer.writeDouble(currSpeed.get())
buffer.writeFloat(stamina.get())
buffer.writeVec3(rideVel.get())
}
override fun decode(buffer: RegistryFriendlyByteBuf) {
override fun decode(buffer: FriendlyByteBuf) {
super.decode(buffer)
currSpeed.set(buffer.readDouble(), forced = true)
stamina.set(buffer.readFloat(), forced = true)
rideVel.set(buffer.readVec3(), forced = true)
}
override fun reset() {
super.reset()
currSpeed.set(0.0, forced = true)
stamina.set(1.0f, forced = true)
rideVel.set(Vec3.ZERO, forced = true)
currMouseXForce.set(0.0, forced = true)
currMouseYForce.set(0.0, forced = true)
}
override fun toString(): String {
return "JetAirState(currSpeed=${currSpeed.get()}, stamina=${stamina.get()}, rideVel=${rideVel.get()}, currMouseXForce=${currMouseXForce.get()}, currMouseYForce=${currMouseYForce.get()})"
}
override fun copy() = JetAirState().also {
it.currSpeed.set(currSpeed.get(), forced = true)
it.stamina.set(stamina.get(), forced = true)
it.rideVel.set(rideVel.get(), forced = true)
it.rideVelocity.set(rideVelocity.get(), forced = true)
it.currMouseXForce.set(currMouseXForce.get(), forced = true)
it.currMouseYForce.set(currMouseYForce.get(), forced = true)
}
@@ -435,8 +431,6 @@ class JetAirState : RidingBehaviourState {
override fun shouldSync(previous: RidingBehaviourState): Boolean {
if (previous !is JetAirState) return false
if (previous.currSpeed != currSpeed) return true
if (previous.stamina != stamina) return true
if (previous.rideVel != rideVel) return true
return false
return super.shouldSync(previous)
}
}
@@ -1,469 +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.api.riding.behaviour.types
import com.bedrockk.molang.Expression
import com.cobblemon.mod.common.api.riding.behaviour.*
import com.cobblemon.mod.common.entity.PoseType
import com.cobblemon.mod.common.entity.pokemon.PokemonBehaviourFlag
import com.cobblemon.mod.common.entity.pokemon.PokemonEntity
import com.cobblemon.mod.common.util.asExpression
import com.cobblemon.mod.common.util.cobblemonResource
import com.cobblemon.mod.common.util.readExpression
import com.cobblemon.mod.common.util.writeExpression
import net.minecraft.network.RegistryFriendlyByteBuf
import net.minecraft.resources.ResourceLocation
import net.minecraft.util.SmoothDouble
import net.minecraft.world.entity.LivingEntity
import net.minecraft.world.entity.player.Player
import net.minecraft.world.phys.Vec2
import net.minecraft.world.phys.Vec3
class JumpToFlightCompositeBehaviour : RidingBehaviour<JumpToFlightCompositeSettings, JumpToFlightCompositeState> {
companion object {
val KEY = cobblemonResource("composite/jump_to_flight")
}
override val key = KEY
val landBehaviour: GenericLandBehaviour = GenericLandBehaviour()
val birdBehaviour: BirdAirBehaviour = BirdAirBehaviour()
override fun tick(
settings: JumpToFlightCompositeSettings,
state: JumpToFlightCompositeState,
vehicle: PokemonEntity,
driver: Player,
input: Vec3
) {
val flightState = state.flightState
val groundState = state.landState
if (shouldTransitionToGround(state, vehicle)) {
//Pass the speed to the next state
// groundState.currSpeed = flightState.currSpeed
groundState.rideVel.set(flightState.rideVel.get())
groundState.stamina.set(flightState.stamina.get())
state.activeController.set(GenericLandBehaviour.KEY)
vehicle.setBehaviourFlag(PokemonBehaviourFlag.FLYING, false)
state.timeTransitioned.set(vehicle.level().gameTime)
} else if (shouldTransitionToAir(state, vehicle, driver)) {
//Pass the speed to the next state
// flightState.currSpeed = groundState.currSpeed
flightState.rideVel.set(groundState.rideVel.get())
flightState.stamina.set(groundState.stamina.get())
state.activeController.set(BirdAirBehaviour.KEY)
vehicle.setBehaviourFlag(PokemonBehaviourFlag.FLYING, true)
state.timeTransitioned.set(vehicle.level().gameTime)
}
}
override fun isActive(
settings: JumpToFlightCompositeSettings,
state: JumpToFlightCompositeState,
vehicle: PokemonEntity
): Boolean {
return true
}
private fun shouldTransitionToGround(state: JumpToFlightCompositeState, entity: PokemonEntity): Boolean {
return state.activeController.get() == BirdAirBehaviour.KEY
&& entity.onGround()
&& state.timeTransitioned.get() + 20 < entity.level().gameTime
}
private fun shouldTransitionToAir(
state: JumpToFlightCompositeState,
entity: PokemonEntity,
driver: Player
): Boolean {
return state.activeController.get() == GenericLandBehaviour.KEY
&& driver.jumping
&& state.timeTransitioned.get() + 20 < entity.level().gameTime
}
override fun pose(
settings: JumpToFlightCompositeSettings,
state: JumpToFlightCompositeState,
vehicle: PokemonEntity
): PoseType {
return when (state.activeController.get()) {
GenericLandBehaviour.KEY -> landBehaviour.pose(settings.land, state.landState, vehicle)
BirdAirBehaviour.KEY -> birdBehaviour.pose(settings.bird, state.flightState, vehicle)
else -> error("Invalid controller: ${state.activeController.get()}")
}
}
override fun speed(
settings: JumpToFlightCompositeSettings,
state: JumpToFlightCompositeState,
vehicle: PokemonEntity,
driver: Player
): Float {
return when (state.activeController.get()) {
GenericLandBehaviour.KEY -> landBehaviour.speed(settings.land, state.landState, vehicle, driver)
BirdAirBehaviour.KEY -> birdBehaviour.speed(settings.bird, state.flightState, vehicle, driver)
else -> error("Invalid controller: ${state.activeController.get()}")
}
}
override fun rotation(
settings: JumpToFlightCompositeSettings,
state: JumpToFlightCompositeState,
vehicle: PokemonEntity,
driver: LivingEntity
): Vec2 {
return when (state.activeController.get()) {
GenericLandBehaviour.KEY -> landBehaviour.rotation(settings.land, state.landState, vehicle, driver)
BirdAirBehaviour.KEY -> birdBehaviour.rotation(settings.bird, state.flightState, vehicle, driver)
else -> error("Invalid controller: ${state.activeController.get()}")
}
}
override fun velocity(
settings: JumpToFlightCompositeSettings,
state: JumpToFlightCompositeState,
vehicle: PokemonEntity,
driver: Player,
input: Vec3
): Vec3 {
return when (state.activeController.get()) {
GenericLandBehaviour.KEY -> landBehaviour.velocity(settings.land, state.landState, vehicle, driver, input)
BirdAirBehaviour.KEY -> birdBehaviour.velocity(settings.bird, state.flightState, vehicle, driver, input)
else -> error("Invalid controller: ${state.activeController.get()}")
}
}
override fun angRollVel(
settings: JumpToFlightCompositeSettings,
state: JumpToFlightCompositeState,
vehicle: PokemonEntity,
driver: Player,
deltaTime: Double
): Vec3 {
return when (state.activeController.get()) {
GenericLandBehaviour.KEY -> landBehaviour.angRollVel(
settings.land,
state.landState,
vehicle,
driver,
deltaTime
)
BirdAirBehaviour.KEY -> birdBehaviour.angRollVel(
settings.bird,
state.flightState,
vehicle,
driver,
deltaTime
)
else -> error("Invalid controller: ${state.activeController.get()}")
}
}
override fun rotationOnMouseXY(
settings: JumpToFlightCompositeSettings,
state: JumpToFlightCompositeState,
vehicle: PokemonEntity,
driver: Player,
mouseY: Double,
mouseX: Double,
mouseYSmoother: SmoothDouble,
mouseXSmoother: SmoothDouble,
sensitivity: Double,
deltaTime: Double
): Vec3 {
return when (state.activeController.get()) {
GenericLandBehaviour.KEY -> landBehaviour.rotationOnMouseXY(
settings.land,
state.landState,
vehicle,
driver,
mouseY,
mouseX,
mouseYSmoother,
mouseXSmoother,
sensitivity,
deltaTime
)
BirdAirBehaviour.KEY -> birdBehaviour.rotationOnMouseXY(
settings.bird,
state.flightState,
vehicle,
driver,
mouseY,
mouseX,
mouseYSmoother,
mouseXSmoother,
sensitivity,
deltaTime
)
else -> error("Invalid controller: ${state.activeController.get()}")
}
}
override fun canJump(
settings: JumpToFlightCompositeSettings,
state: JumpToFlightCompositeState,
vehicle: PokemonEntity,
driver: Player
): Boolean {
return when (state.activeController.get()) {
GenericLandBehaviour.KEY -> landBehaviour.canJump(settings.land, state.landState, vehicle, driver)
BirdAirBehaviour.KEY -> birdBehaviour.canJump(settings.bird, state.flightState, vehicle, driver)
else -> error("Invalid controller: ${state.activeController.get()}")
}
}
override fun setRideBar(
settings: JumpToFlightCompositeSettings,
state: JumpToFlightCompositeState,
vehicle: PokemonEntity,
driver: Player
): Float {
return when (state.activeController.get()) {
GenericLandBehaviour.KEY -> landBehaviour.setRideBar(settings.land, state.landState, vehicle, driver)
BirdAirBehaviour.KEY -> birdBehaviour.setRideBar(settings.bird, state.flightState, vehicle, driver)
else -> error("Invalid controller: ${state.activeController.get()}")
}
}
override fun jumpForce(
settings: JumpToFlightCompositeSettings,
state: JumpToFlightCompositeState,
vehicle: PokemonEntity,
driver: Player,
jumpStrength: Int
): Vec3 {
return when (state.activeController.get()) {
GenericLandBehaviour.KEY -> landBehaviour.jumpForce(
settings.land,
state.landState,
vehicle,
driver,
jumpStrength
)
BirdAirBehaviour.KEY -> birdBehaviour.jumpForce(
settings.bird,
state.flightState,
vehicle,
driver,
jumpStrength
)
else -> error("Invalid controller: ${state.activeController.get()}")
}
}
override fun gravity(
settings: JumpToFlightCompositeSettings,
state: JumpToFlightCompositeState,
vehicle: PokemonEntity,
regularGravity: Double
): Double {
return when (state.activeController.get()) {
GenericLandBehaviour.KEY -> landBehaviour.gravity(settings.land, state.landState, vehicle, regularGravity)
BirdAirBehaviour.KEY -> birdBehaviour.gravity(settings.bird, state.flightState, vehicle, regularGravity)
else -> error("Invalid controller: ${state.activeController.get()}")
}
}
override fun rideFovMultiplier(
settings: JumpToFlightCompositeSettings,
state: JumpToFlightCompositeState,
vehicle: PokemonEntity,
driver: Player
): Float {
return when (state.activeController.get()) {
GenericLandBehaviour.KEY -> landBehaviour.rideFovMultiplier(settings.land, state.landState, vehicle, driver)
BirdAirBehaviour.KEY -> birdBehaviour.rideFovMultiplier(settings.bird, state.flightState, vehicle, driver)
else -> error("Invalid controller: ${state.activeController.get()}")
}
}
override fun useAngVelSmoothing(
settings: JumpToFlightCompositeSettings,
state: JumpToFlightCompositeState,
vehicle: PokemonEntity
): Boolean {
return when (state.activeController.get()) {
GenericLandBehaviour.KEY -> landBehaviour.useAngVelSmoothing(settings.land, state.landState, vehicle)
BirdAirBehaviour.KEY -> birdBehaviour.useAngVelSmoothing(settings.bird, state.flightState, vehicle)
else -> error("Invalid controller: ${state.activeController.get()}")
}
}
override fun useRidingAltPose(
settings: JumpToFlightCompositeSettings,
state: JumpToFlightCompositeState,
vehicle: PokemonEntity,
driver: Player
): Boolean {
return when (state.activeController.get()) {
GenericLandBehaviour.KEY -> landBehaviour.useRidingAltPose(settings.land, state.landState, vehicle, driver)
BirdAirBehaviour.KEY -> birdBehaviour.useRidingAltPose(settings.bird, state.flightState, vehicle, driver)
else -> error("Invalid controller: ${state.activeController.get()}")
}
}
override fun inertia(
settings: JumpToFlightCompositeSettings,
state: JumpToFlightCompositeState,
vehicle: PokemonEntity
): Double {
return when (state.activeController.get()) {
GenericLandBehaviour.KEY -> landBehaviour.inertia(settings.land, state.landState, vehicle)
BirdAirBehaviour.KEY -> birdBehaviour.inertia(settings.bird, state.flightState, vehicle)
else -> error("Invalid controller: ${state.activeController.get()}")
}
}
override fun shouldRoll(
settings: JumpToFlightCompositeSettings,
state: JumpToFlightCompositeState,
vehicle: PokemonEntity
): Boolean {
return when (state.activeController.get()) {
GenericLandBehaviour.KEY -> landBehaviour.shouldRoll(settings.land, state.landState, vehicle)
BirdAirBehaviour.KEY -> birdBehaviour.shouldRoll(settings.bird, state.flightState, vehicle)
else -> error("Invalid controller: ${state.activeController.get()}")
}
}
override fun turnOffOnGround(
settings: JumpToFlightCompositeSettings,
state: JumpToFlightCompositeState,
vehicle: PokemonEntity
): Boolean {
return when (state.activeController.get()) {
GenericLandBehaviour.KEY -> landBehaviour.turnOffOnGround(settings.land, state.landState, vehicle)
BirdAirBehaviour.KEY -> birdBehaviour.turnOffOnGround(settings.bird, state.flightState, vehicle)
else -> error("Invalid controller: ${state.activeController.get()}")
}
}
override fun dismountOnShift(
settings: JumpToFlightCompositeSettings,
state: JumpToFlightCompositeState,
vehicle: PokemonEntity
): Boolean {
return when (state.activeController.get()) {
GenericLandBehaviour.KEY -> landBehaviour.dismountOnShift(settings.land, state.landState, vehicle)
BirdAirBehaviour.KEY -> birdBehaviour.dismountOnShift(settings.bird, state.flightState, vehicle)
else -> error("Invalid controller: ${state.activeController.get()}")
}
}
override fun shouldRotatePokemonHead(
settings: JumpToFlightCompositeSettings,
state: JumpToFlightCompositeState,
vehicle: PokemonEntity
): Boolean {
return when (state.activeController.get()) {
GenericLandBehaviour.KEY -> landBehaviour.shouldRotatePokemonHead(settings.land, state.landState, vehicle)
BirdAirBehaviour.KEY -> birdBehaviour.shouldRotatePokemonHead(settings.bird, state.flightState, vehicle)
else -> error("Invalid controller: ${state.activeController.get()}")
}
}
override fun shouldRotatePlayerHead(
settings: JumpToFlightCompositeSettings,
state: JumpToFlightCompositeState,
vehicle: PokemonEntity
): Boolean {
return when (state.activeController.get()) {
GenericLandBehaviour.KEY -> landBehaviour.shouldRotatePlayerHead(settings.land, state.landState, vehicle)
BirdAirBehaviour.KEY -> birdBehaviour.shouldRotatePlayerHead(settings.bird, state.flightState, vehicle)
else -> error("Invalid controller: ${state.activeController.get()}")
}
}
override fun createDefaultState() = JumpToFlightCompositeState()
}
class JumpToFlightCompositeSettings : RidingBehaviourSettings {
override val key = JumpToFlightCompositeBehaviour.KEY
var bird: BirdAirSettings = BirdAirSettings()
private set
var land: GenericLandSettings = GenericLandSettings()
private set
var minimumSpeed: Expression = "0.5".asExpression()
private set
var minimumJump: Expression = "0.5".asExpression()
private set
override fun encode(buffer: RegistryFriendlyByteBuf) {
bird.encode(buffer)
land.encode(buffer)
buffer.writeExpression(minimumSpeed)
buffer.writeExpression(minimumJump)
}
override fun decode(buffer: RegistryFriendlyByteBuf) {
bird.decode(buffer)
land.decode(buffer)
minimumSpeed = buffer.readExpression()
minimumJump = buffer.readExpression()
}
}
class JumpToFlightCompositeState : RidingBehaviourState {
var activeController = ridingState(GenericLandBehaviour.KEY, Side.CLIENT)
var currSpeed = ridingState(0.0, Side.BOTH)
var timeTransitioned = ridingState(-100L, Side.BOTH)
var landState = GenericLandState()
var flightState = BirdAirState()
override fun encode(buffer: RegistryFriendlyByteBuf) {
buffer.writeResourceLocation(activeController.get())
landState.encode(buffer)
flightState.encode(buffer)
}
override fun decode(buffer: RegistryFriendlyByteBuf) {
activeController.set(buffer.readResourceLocation(), forced = true)
landState.decode(buffer)
flightState.decode(buffer)
}
override fun reset() {
activeController.set(GenericLandBehaviour.KEY, forced = true)
timeTransitioned.set(-100L, forced = true)
currSpeed.set(0.0, forced = true)
}
override fun toString(): String {
return "JumpToFlightCompositeState(activeController=${activeController.get()}, landState=$landState, flightState=$flightState, currSpeed=${currSpeed.get()}, timeTransitioned=${timeTransitioned.get()})"
}
override fun copy() = JumpToFlightCompositeState().also {
it.activeController.set(activeController.get(), forced = true)
it.landState = landState.copy()
it.flightState = flightState.copy()
it.currSpeed.set(currSpeed.get(), forced = true)
it.timeTransitioned.set(timeTransitioned.get(), forced = true)
}
override fun shouldSync(previous: RidingBehaviourState): Boolean {
if (previous !is JumpToFlightCompositeState) return false
if (activeController != previous.activeController) return true
if (landState.shouldSync(previous.landState)) return true
if (flightState.shouldSync(previous.flightState)) return true
return false
}
}
@@ -1,450 +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.api.riding.behaviour.types
import com.bedrockk.molang.Expression
import com.cobblemon.mod.common.api.riding.behaviour.*
import com.cobblemon.mod.common.entity.PoseType
import com.cobblemon.mod.common.entity.pokemon.PokemonBehaviourFlag
import com.cobblemon.mod.common.entity.pokemon.PokemonEntity
import com.cobblemon.mod.common.util.asExpression
import com.cobblemon.mod.common.util.cobblemonResource
import com.cobblemon.mod.common.util.readExpression
import com.cobblemon.mod.common.util.writeExpression
import net.minecraft.network.RegistryFriendlyByteBuf
import net.minecraft.resources.ResourceLocation
import net.minecraft.util.SmoothDouble
import net.minecraft.world.entity.LivingEntity
import net.minecraft.world.entity.player.Player
import net.minecraft.world.phys.Vec2
import net.minecraft.world.phys.Vec3
class RunToJetCompositeBehaviour : RidingBehaviour<RunToJetCompositeSettings, RunToJetCompositeState> {
companion object {
val KEY = cobblemonResource("composite/run_to_jet")
}
override val key = KEY
val landBehaviour: GenericLandBehaviour = GenericLandBehaviour()
val jetBehaviour: JetAirBehaviour = JetAirBehaviour()
override fun tick(
settings: RunToJetCompositeSettings,
state: RunToJetCompositeState,
vehicle: PokemonEntity,
driver: Player,
input: Vec3
) {
val flightState = state.flightState
val groundState = state.landState
if (shouldTransitionToGround(state, vehicle, driver)) {
groundState.currSpeed = flightState.currSpeed
groundState.stamina = flightState.stamina
groundState.rideVel = flightState.rideVel
state.activeController.set(GenericLandBehaviour.KEY)
vehicle.setBehaviourFlag(PokemonBehaviourFlag.FLYING, false)
state.timeTransitioned.set(vehicle.level().gameTime)
} else if (shouldTransitionToAir(state, vehicle, driver, input)) {
flightState.currSpeed = groundState.currSpeed
flightState.stamina = groundState.stamina
flightState.rideVel = groundState.rideVel
state.activeController.set(JetAirBehaviour.KEY)
vehicle.setBehaviourFlag(PokemonBehaviourFlag.FLYING, true)
state.timeTransitioned.set(vehicle.level().gameTime)
}
}
private fun shouldTransitionToGround(
state: RunToJetCompositeState,
entity: PokemonEntity,
driver: Player
): Boolean {
if (state.activeController.get() != JetAirBehaviour.KEY) return false
if (state.timeTransitioned.get() + 20 >= entity.level().gameTime) return false
return driver.isSprinting || entity.onGround()
}
private fun shouldTransitionToAir(
state: RunToJetCompositeState,
entity: PokemonEntity,
driver: Player,
input: Vec3
): Boolean {
if (state.activeController.get() != GenericLandBehaviour.KEY) return false
if (state.timeTransitioned.get() + 20 >= entity.level().gameTime) return false
return driver.isSprinting && input.z > 0.5
}
override fun isActive(
settings: RunToJetCompositeSettings,
state: RunToJetCompositeState,
vehicle: PokemonEntity
): Boolean {
return true
}
override fun pose(
settings: RunToJetCompositeSettings,
state: RunToJetCompositeState,
vehicle: PokemonEntity
): PoseType {
return when (state.activeController.get()) {
GenericLandBehaviour.KEY -> landBehaviour.pose(settings.land, state.landState, vehicle)
JetAirBehaviour.KEY -> jetBehaviour.pose(settings.jet, state.flightState, vehicle)
else -> error("Invalid controller: ${state.activeController.get()}")
}
}
override fun speed(
settings: RunToJetCompositeSettings,
state: RunToJetCompositeState,
vehicle: PokemonEntity,
driver: Player
): Float {
return when (state.activeController.get()) {
GenericLandBehaviour.KEY -> landBehaviour.speed(settings.land, state.landState, vehicle, driver)
JetAirBehaviour.KEY -> jetBehaviour.speed(settings.jet, state.flightState, vehicle, driver)
else -> error("Invalid controller: ${state.activeController.get()}")
}
}
override fun rotation(
settings: RunToJetCompositeSettings,
state: RunToJetCompositeState,
vehicle: PokemonEntity,
driver: LivingEntity
): Vec2 {
return when (state.activeController.get()) {
GenericLandBehaviour.KEY -> landBehaviour.rotation(settings.land, state.landState, vehicle, driver)
JetAirBehaviour.KEY -> jetBehaviour.rotation(settings.jet, state.flightState, vehicle, driver)
else -> error("Invalid controller: ${state.activeController.get()}")
}
}
override fun velocity(
settings: RunToJetCompositeSettings,
state: RunToJetCompositeState,
vehicle: PokemonEntity,
driver: Player,
input: Vec3
): Vec3 {
return when (state.activeController.get()) {
GenericLandBehaviour.KEY -> landBehaviour.velocity(settings.land, state.landState, vehicle, driver, input)
JetAirBehaviour.KEY -> jetBehaviour.velocity(settings.jet, state.flightState, vehicle, driver, input)
else -> error("Invalid controller: ${state.activeController.get()}")
}
}
override fun angRollVel(
settings: RunToJetCompositeSettings,
state: RunToJetCompositeState,
vehicle: PokemonEntity,
driver: Player,
deltaTime: Double
): Vec3 {
return when (state.activeController.get()) {
GenericLandBehaviour.KEY -> landBehaviour.angRollVel(
settings.land,
state.landState,
vehicle,
driver,
deltaTime
)
JetAirBehaviour.KEY -> jetBehaviour.angRollVel(settings.jet, state.flightState, vehicle, driver, deltaTime)
else -> error("Invalid controller: ${state.activeController.get()}")
}
}
override fun rotationOnMouseXY(
settings: RunToJetCompositeSettings,
state: RunToJetCompositeState,
vehicle: PokemonEntity,
driver: Player,
mouseY: Double,
mouseX: Double,
mouseYSmoother: SmoothDouble,
mouseXSmoother: SmoothDouble,
sensitivity: Double,
deltaTime: Double
): Vec3 {
return when (state.activeController.get()) {
GenericLandBehaviour.KEY -> landBehaviour.rotationOnMouseXY(
settings.land,
state.landState,
vehicle,
driver,
mouseY,
mouseX,
mouseYSmoother,
mouseXSmoother,
sensitivity,
deltaTime
)
JetAirBehaviour.KEY -> jetBehaviour.rotationOnMouseXY(
settings.jet,
state.flightState,
vehicle,
driver,
mouseY,
mouseX,
mouseYSmoother,
mouseXSmoother,
sensitivity,
deltaTime
)
else -> error("Invalid controller: ${state.activeController.get()}")
}
}
override fun canJump(
settings: RunToJetCompositeSettings,
state: RunToJetCompositeState,
vehicle: PokemonEntity,
driver: Player
): Boolean {
return when (state.activeController.get()) {
GenericLandBehaviour.KEY -> landBehaviour.canJump(settings.land, state.landState, vehicle, driver)
JetAirBehaviour.KEY -> jetBehaviour.canJump(settings.jet, state.flightState, vehicle, driver)
else -> error("Invalid controller: ${state.activeController.get()}")
}
}
override fun setRideBar(
settings: RunToJetCompositeSettings,
state: RunToJetCompositeState,
vehicle: PokemonEntity,
driver: Player
): Float {
return when (state.activeController.get()) {
GenericLandBehaviour.KEY -> landBehaviour.setRideBar(settings.land, state.landState, vehicle, driver)
JetAirBehaviour.KEY -> jetBehaviour.setRideBar(settings.jet, state.flightState, vehicle, driver)
else -> error("Invalid controller: ${state.activeController.get()}")
}
}
override fun jumpForce(
settings: RunToJetCompositeSettings,
state: RunToJetCompositeState,
vehicle: PokemonEntity,
driver: Player,
jumpStrength: Int
): Vec3 {
return when (state.activeController.get()) {
GenericLandBehaviour.KEY -> landBehaviour.jumpForce(settings.land, state.landState, vehicle, driver, jumpStrength)
JetAirBehaviour.KEY -> jetBehaviour.jumpForce(settings.jet, state.flightState, vehicle, driver, jumpStrength)
else -> error("Invalid controller: ${state.activeController.get()}")
}
}
override fun gravity(
settings: RunToJetCompositeSettings,
state: RunToJetCompositeState,
vehicle: PokemonEntity,
regularGravity: Double
): Double {
return when (state.activeController.get()) {
GenericLandBehaviour.KEY -> landBehaviour.gravity(settings.land, state.landState, vehicle, regularGravity)
JetAirBehaviour.KEY -> jetBehaviour.gravity(settings.jet, state.flightState, vehicle, regularGravity)
else -> error("Invalid controller: ${state.activeController.get()}")
}
}
override fun rideFovMultiplier(
settings: RunToJetCompositeSettings,
state: RunToJetCompositeState,
vehicle: PokemonEntity,
driver: Player
): Float {
return when (state.activeController.get()) {
GenericLandBehaviour.KEY -> landBehaviour.rideFovMultiplier(settings.land, state.landState, vehicle, driver)
JetAirBehaviour.KEY -> jetBehaviour.rideFovMultiplier(settings.jet, state.flightState, vehicle, driver)
else -> error("Invalid controller: ${state.activeController.get()}")
}
}
override fun useAngVelSmoothing(
settings: RunToJetCompositeSettings,
state: RunToJetCompositeState,
vehicle: PokemonEntity
): Boolean {
return when (state.activeController.get()) {
GenericLandBehaviour.KEY -> landBehaviour.useAngVelSmoothing(settings.land, state.landState, vehicle)
JetAirBehaviour.KEY -> jetBehaviour.useAngVelSmoothing(settings.jet, state.flightState, vehicle)
else -> error("Invalid controller: ${state.activeController.get()}")
}
}
override fun useRidingAltPose(
settings: RunToJetCompositeSettings,
state: RunToJetCompositeState,
vehicle: PokemonEntity,
driver: Player
): Boolean {
return when (state.activeController.get()) {
GenericLandBehaviour.KEY -> landBehaviour.useRidingAltPose(settings.land, state.landState, vehicle, driver)
JetAirBehaviour.KEY -> jetBehaviour.useRidingAltPose(settings.jet, state.flightState, vehicle, driver)
else -> error("Invalid controller: ${state.activeController.get()}")
}
}
override fun inertia(
settings: RunToJetCompositeSettings,
state: RunToJetCompositeState,
vehicle: PokemonEntity
): Double {
return when (state.activeController.get()) {
GenericLandBehaviour.KEY -> landBehaviour.inertia(settings.land, state.landState, vehicle)
JetAirBehaviour.KEY -> jetBehaviour.inertia(settings.jet, state.flightState, vehicle)
else -> error("Invalid controller: ${state.activeController.get()}")
}
}
override fun shouldRoll(
settings: RunToJetCompositeSettings,
state: RunToJetCompositeState,
vehicle: PokemonEntity
): Boolean {
return when (state.activeController.get()) {
GenericLandBehaviour.KEY -> landBehaviour.shouldRoll(settings.land, state.landState, vehicle)
JetAirBehaviour.KEY -> jetBehaviour.shouldRoll(settings.jet, state.flightState, vehicle)
else -> error("Invalid controller: ${state.activeController.get()}")
}
}
override fun turnOffOnGround(
settings: RunToJetCompositeSettings,
state: RunToJetCompositeState,
vehicle: PokemonEntity
): Boolean {
return when (state.activeController.get()) {
GenericLandBehaviour.KEY -> landBehaviour.turnOffOnGround(settings.land, state.landState, vehicle)
JetAirBehaviour.KEY -> jetBehaviour.turnOffOnGround(settings.jet, state.flightState, vehicle)
else -> error("Invalid controller: ${state.activeController.get()}")
}
}
override fun dismountOnShift(
settings: RunToJetCompositeSettings,
state: RunToJetCompositeState,
vehicle: PokemonEntity
): Boolean {
return when (state.activeController.get()) {
GenericLandBehaviour.KEY -> landBehaviour.dismountOnShift(settings.land, state.landState, vehicle)
JetAirBehaviour.KEY -> jetBehaviour.dismountOnShift(settings.jet, state.flightState, vehicle)
else -> error("Invalid controller: ${state.activeController.get()}")
}
}
override fun shouldRotatePokemonHead(
settings: RunToJetCompositeSettings,
state: RunToJetCompositeState,
vehicle: PokemonEntity
): Boolean {
return when (state.activeController.get()) {
GenericLandBehaviour.KEY -> landBehaviour.shouldRotatePokemonHead(settings.land, state.landState, vehicle)
JetAirBehaviour.KEY -> jetBehaviour.shouldRotatePokemonHead(settings.jet, state.flightState, vehicle)
else -> error("Invalid controller: ${state.activeController.get()}")
}
}
override fun shouldRotatePlayerHead(
settings: RunToJetCompositeSettings,
state: RunToJetCompositeState,
vehicle: PokemonEntity
): Boolean {
return when (state.activeController.get()) {
GenericLandBehaviour.KEY -> landBehaviour.shouldRotatePlayerHead(settings.land, state.landState, vehicle)
JetAirBehaviour.KEY -> jetBehaviour.shouldRotatePlayerHead(settings.jet, state.flightState, vehicle)
else -> error("Invalid controller: ${state.activeController.get()}")
}
}
override fun createDefaultState() = RunToJetCompositeState()
}
class RunToJetCompositeSettings : RidingBehaviourSettings {
override val key = RunToJetCompositeBehaviour.KEY
var jet: JetAirSettings = JetAirSettings()
private set
var land: GenericLandSettings = GenericLandSettings()
private set
var minimumSpeed: Expression = "0.5".asExpression()
private set
var minimumJump: Expression = "0.5".asExpression()
private set
override fun encode(buffer: RegistryFriendlyByteBuf) {
jet.encode(buffer)
land.encode(buffer)
buffer.writeExpression(minimumSpeed)
buffer.writeExpression(minimumJump)
}
override fun decode(buffer: RegistryFriendlyByteBuf) {
jet.decode(buffer)
land.decode(buffer)
minimumSpeed = buffer.readExpression()
minimumJump = buffer.readExpression()
}
}
class RunToJetCompositeState : RidingBehaviourState {
var activeController = ridingState(GenericLandBehaviour.KEY, Side.CLIENT)
var landState: GenericLandState = GenericLandState()
var flightState: JetAirState = JetAirState()
var currSpeed = ridingState(0.0, Side.BOTH)
var timeTransitioned = ridingState(-100L, Side.BOTH)
override fun encode(buffer: RegistryFriendlyByteBuf) {
buffer.writeResourceLocation(activeController.get())
landState.encode(buffer)
flightState.encode(buffer)
}
override fun decode(buffer: RegistryFriendlyByteBuf) {
activeController.set(buffer.readResourceLocation(), forced = true)
landState.decode(buffer)
flightState.decode(buffer)
}
override fun reset() {
activeController.set(GenericLandBehaviour.KEY, forced = true)
timeTransitioned.set(-100L, forced = true)
currSpeed.set(0.0, forced = true)
}
override fun toString(): String {
return "RunToJetCompositeState(activeController=${activeController.get()}, landState=$landState, flightState=$flightState, currSpeed=${currSpeed.get()}, timeTransitioned=${timeTransitioned.get()})"
}
override fun copy() = RunToJetCompositeState().also {
it.activeController.set(activeController.get(), forced = true)
it.landState = landState.copy()
it.flightState = flightState.copy()
it.currSpeed.set(currSpeed.get(), forced = true)
it.timeTransitioned.set(timeTransitioned.get(), forced = true)
}
override fun shouldSync(previous: RidingBehaviourState): Boolean {
if (previous !is RunToJetCompositeState) return false
if (activeController != previous.activeController) return true
if (landState.shouldSync(previous.landState)) return true
if (flightState.shouldSync(previous.flightState)) return true
return false
}
}
@@ -10,6 +10,7 @@ package com.cobblemon.mod.common.api.riding.behaviour.types
import com.cobblemon.mod.common.Cobblemon
import com.cobblemon.mod.common.OrientationControllable
import com.cobblemon.mod.common.api.riding.RidingStyle
import com.cobblemon.mod.common.api.riding.behaviour.*
import com.cobblemon.mod.common.api.riding.posing.PoseOption
import com.cobblemon.mod.common.api.riding.posing.PoseProvider
@@ -33,6 +34,7 @@ class SwimDashBehaviour : RidingBehaviour<SwimDashSettings, SwimDashState> {
}
override val key = KEY
override val style = RidingStyle.LIQUID
val poseProvider = PoseProvider<SwimDashSettings, SwimDashState>(PoseType.FLOAT)
.with(PoseOption(PoseType.SWIM) { _, _, entity -> entity.isSwimming && entity.entityData.get(PokemonEntity.MOVING) })
@@ -217,7 +219,7 @@ class SwimDashBehaviour : RidingBehaviour<SwimDashSettings, SwimDashState> {
return false
}
override fun createDefaultState() = SwimDashState()
override fun createDefaultState(settings: SwimDashSettings) = SwimDashState()
}
class SwimDashSettings : RidingBehaviourSettings {
@@ -227,6 +229,7 @@ class SwimDashSettings : RidingBehaviourSettings {
private set
override fun encode(buffer: RegistryFriendlyByteBuf) {
buffer.writeResourceLocation(key)
buffer.writeFloat(dashSpeed)
}
@@ -235,14 +238,12 @@ class SwimDashSettings : RidingBehaviourSettings {
}
}
class SwimDashState : RidingBehaviourState {
class SwimDashState : RidingBehaviourState() {
var dashing = ridingState(false, Side.BOTH)
var ticks = ridingState(0, Side.BOTH)
override fun encode(buffer: RegistryFriendlyByteBuf) = Unit
override fun decode(buffer: RegistryFriendlyByteBuf) = Unit
override fun reset() {
super.reset()
dashing.set(false, forced = true)
ticks.set(0, forced = true)
}
@@ -252,9 +253,9 @@ class SwimDashState : RidingBehaviourState {
}
override fun copy() = SwimDashState().also {
it.rideVelocity.set(rideVelocity.get(), forced = true)
it.stamina.set(stamina.get(), forced = true)
it.dashing.set(dashing.get(), forced = true)
it.ticks.set(ticks. get(), forced = true)
}
override fun shouldSync(previous: RidingBehaviourState) = false
}
@@ -53,6 +53,7 @@ class VehicleLandBehaviour : RidingBehaviour<VehicleLandSettings, VehicleLandSta
}
override val key = KEY
override val style = RidingStyle.LAND
val poseProvider = PoseProvider<VehicleLandSettings, VehicleLandState>(PoseType.STAND)
.with(PoseOption(PoseType.WALK) { _, _, entity -> entity.entityData.get(PokemonEntity.MOVING) })
@@ -265,7 +266,7 @@ class VehicleLandBehaviour : RidingBehaviour<VehicleLandSettings, VehicleLandSta
return false
}
override fun createDefaultState() = VehicleLandState()
override fun createDefaultState(settings: VehicleLandSettings) = VehicleLandState()
}
class VehicleLandSettings : RidingBehaviourSettings {
@@ -296,6 +297,7 @@ class VehicleLandSettings : RidingBehaviourSettings {
private set
override fun encode(buffer: RegistryFriendlyByteBuf) {
buffer.writeResourceLocation(key)
buffer.writeExpression(canJump)
buffer.writeExpression(jumpVector[0])
buffer.writeExpression(jumpVector[1])
@@ -324,14 +326,12 @@ class VehicleLandSettings : RidingBehaviourSettings {
}
}
class VehicleLandState : RidingBehaviourState {
class VehicleLandState : RidingBehaviourState() {
var currSpeed = ridingState(0.0, Side.BOTH)
var deltaRotation = ridingState(Vec2.ZERO, Side.BOTH)
override fun encode(buffer: RegistryFriendlyByteBuf) = Unit
override fun decode(buffer: RegistryFriendlyByteBuf) = Unit
override fun reset() {
super.reset()
currSpeed.set(0.0, forced = true)
deltaRotation.set(Vec2.ZERO, forced = true)
}
@@ -341,9 +341,9 @@ class VehicleLandState : RidingBehaviourState {
}
override fun copy() = VehicleLandState().also {
it.rideVelocity.set(rideVelocity.get(), forced = true)
it.stamina.set(stamina.get(), forced = true)
it.currSpeed.set(currSpeed.get(), forced = true)
it.deltaRotation.set(deltaRotation.get(), forced = true)
}
override fun shouldSync(previous: RidingBehaviourState) = false
}
@@ -0,0 +1,418 @@
/*
* 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.api.riding.behaviour.types.composite
import com.cobblemon.mod.common.api.riding.RidingStyle
import com.cobblemon.mod.common.api.riding.behaviour.*
import com.cobblemon.mod.common.api.riding.behaviour.types.composite.strategies.CompositeRidingStrategies
import com.cobblemon.mod.common.entity.PoseType
import com.cobblemon.mod.common.entity.pokemon.PokemonEntity
import com.cobblemon.mod.common.util.adapters.RidingBehaviourSettingsAdapter
import com.cobblemon.mod.common.util.cobblemonResource
import net.minecraft.network.FriendlyByteBuf
import net.minecraft.network.RegistryFriendlyByteBuf
import net.minecraft.resources.ResourceLocation
import net.minecraft.util.SmoothDouble
import net.minecraft.world.entity.LivingEntity
import net.minecraft.world.entity.player.Player
import net.minecraft.world.phys.Vec2
import net.minecraft.world.phys.Vec3
class CompositeBehaviour : RidingBehaviour<CompositeSettings, CompositeState> {
companion object {
val KEY = cobblemonResource("composite")
}
override val key = KEY
override val style = RidingStyle.COMPOSITE
override fun createDefaultState(settings: CompositeSettings): CompositeState {
val defaultBehaviour = RidingBehaviours.get(settings.defaultBehaviour.key)
val defaultState = defaultBehaviour.createDefaultState(settings.defaultBehaviour)
val alternateBehaviour = RidingBehaviours.get(settings.alternateBehaviour.key)
val alternativeState = alternateBehaviour.createDefaultState(settings.alternateBehaviour)
return CompositeState(
defaultBehaviour = settings.defaultBehaviour.key,
defaultBehaviourState = defaultState,
alternateBehaviourState = alternativeState
)
}
fun <T> chooseBehaviour(
settings: CompositeSettings,
state: CompositeState,
action: (behaviour: RidingBehaviour<RidingBehaviourSettings, RidingBehaviourState>, settings: RidingBehaviourSettings, state: RidingBehaviourState) -> T
): T {
val defaultBehaviour = RidingBehaviours.get(settings.defaultBehaviour.key)
val alternativeBehaviour = RidingBehaviours.get(settings.alternateBehaviour.key)
return when (state.activeController.get()) {
settings.defaultBehaviour.key -> action(
defaultBehaviour,
settings.defaultBehaviour,
state.defaultBehaviourState
)
settings.alternateBehaviour.key -> action(
alternativeBehaviour,
settings.alternateBehaviour,
state.alternateBehaviourState
)
else -> error("Invalid controller: ${state.activeController.get()}")
}
}
override fun tick(
settings: CompositeSettings,
state: CompositeState,
vehicle: PokemonEntity,
driver: Player,
input: Vec3
) {
val strategy = CompositeRidingStrategies.get(settings.transitionStrategy)
strategy.tick(settings, state, state.defaultBehaviourState, state.alternateBehaviourState, vehicle, driver, input)
}
override fun clampPassengerRotation(
settings: CompositeSettings,
state: CompositeState,
entity: PokemonEntity,
driver: LivingEntity
) {
return chooseBehaviour(settings, state) { behaviour, behaviourSettings, behaviourState ->
behaviour.clampPassengerRotation(behaviourSettings, behaviourState, entity, driver)
}
}
override fun updatePassengerRotation(
settings: CompositeSettings,
state: CompositeState,
entity: PokemonEntity,
driver: LivingEntity
) {
return chooseBehaviour(settings, state) { behaviour, behaviourSettings, behaviourState ->
behaviour.updatePassengerRotation(behaviourSettings, behaviourState, entity, driver)
}
}
override fun shouldRotatePlayerHead(
settings: CompositeSettings,
state: CompositeState,
vehicle: PokemonEntity
): Boolean {
return chooseBehaviour(settings, state) { behaviour, behaviourSettings, behaviourState ->
behaviour.shouldRotatePlayerHead(behaviourSettings, behaviourState, vehicle)
}
}
override fun shouldRotatePokemonHead(
settings: CompositeSettings,
state: CompositeState,
vehicle: PokemonEntity
): Boolean {
return chooseBehaviour(settings, state) { behaviour, behaviourSettings, behaviourState ->
behaviour.shouldRotatePokemonHead(behaviourSettings, behaviourState, vehicle)
}
}
override fun dismountOnShift(
settings: CompositeSettings,
state: CompositeState,
vehicle: PokemonEntity
): Boolean {
return chooseBehaviour(settings, state) { behaviour, behaviourSettings, behaviourState ->
behaviour.dismountOnShift(behaviourSettings, behaviourState, vehicle)
}
}
override fun turnOffOnGround(
settings: CompositeSettings,
state: CompositeState,
vehicle: PokemonEntity
): Boolean {
return chooseBehaviour(settings, state) { behaviour, behaviourSettings, behaviourState ->
behaviour.turnOffOnGround(behaviourSettings, behaviourState, vehicle)
}
}
override fun shouldRoll(
settings: CompositeSettings,
state: CompositeState,
vehicle: PokemonEntity
): Boolean {
return chooseBehaviour(settings, state) { behaviour, behaviourSettings, behaviourState ->
behaviour.shouldRoll(behaviourSettings, behaviourState, vehicle)
}
}
override fun inertia(
settings: CompositeSettings,
state: CompositeState,
vehicle: PokemonEntity
): Double {
return chooseBehaviour(settings, state) { behaviour, behaviourSettings, behaviourState ->
behaviour.inertia(behaviourSettings, behaviourState, vehicle)
}
}
override fun useRidingAltPose(
settings: CompositeSettings,
state: CompositeState,
vehicle: PokemonEntity,
driver: Player
): Boolean {
return chooseBehaviour(settings, state) { behaviour, behaviourSettings, behaviourState ->
behaviour.useRidingAltPose(behaviourSettings, behaviourState, vehicle, driver)
}
}
override fun useAngVelSmoothing(
settings: CompositeSettings,
state: CompositeState,
vehicle: PokemonEntity
): Boolean {
return chooseBehaviour(settings, state) { behaviour, behaviourSettings, behaviourState ->
behaviour.useAngVelSmoothing(behaviourSettings, behaviourState, vehicle)
}
}
override fun rideFovMultiplier(
settings: CompositeSettings,
state: CompositeState,
vehicle: PokemonEntity,
driver: Player
): Float {
return chooseBehaviour(settings, state) { behaviour, behaviourSettings, behaviourState ->
behaviour.rideFovMultiplier(behaviourSettings, behaviourState, vehicle, driver)
}
}
override fun gravity(
settings: CompositeSettings,
state: CompositeState,
vehicle: PokemonEntity,
regularGravity: Double
): Double {
return chooseBehaviour(settings, state) { behaviour, behaviourSettings, behaviourState ->
behaviour.gravity(behaviourSettings, behaviourState, vehicle, regularGravity)
}
}
override fun jumpForce(
settings: CompositeSettings,
state: CompositeState,
vehicle: PokemonEntity,
driver: Player,
jumpStrength: Int
): Vec3 {
return chooseBehaviour(settings, state) { behaviour, behaviourSettings, behaviourState ->
behaviour.jumpForce(behaviourSettings, behaviourState, vehicle, driver, jumpStrength)
}
}
override fun setRideBar(
settings: CompositeSettings,
state: CompositeState,
vehicle: PokemonEntity,
driver: Player
): Float {
return chooseBehaviour(settings, state) { behaviour, behaviourSettings, behaviourState ->
behaviour.setRideBar(behaviourSettings, behaviourState, vehicle, driver)
}
}
override fun canJump(
settings: CompositeSettings,
state: CompositeState,
vehicle: PokemonEntity,
driver: Player
): Boolean {
return chooseBehaviour(settings, state) { behaviour, behaviourSettings, behaviourState ->
behaviour.canJump(behaviourSettings, behaviourState, vehicle, driver)
}
}
override fun rotationOnMouseXY(
settings: CompositeSettings,
state: CompositeState,
vehicle: PokemonEntity,
driver: Player,
mouseY: Double,
mouseX: Double,
mouseYSmoother: SmoothDouble,
mouseXSmoother: SmoothDouble,
sensitivity: Double,
deltaTime: Double
): Vec3 {
return chooseBehaviour(settings, state) { behaviour, behaviourSettings, behaviourState ->
behaviour.rotationOnMouseXY(
behaviourSettings,
behaviourState,
vehicle,
driver,
mouseY,
mouseX,
mouseYSmoother,
mouseXSmoother,
sensitivity,
deltaTime
)
}
}
override fun angRollVel(
settings: CompositeSettings,
state: CompositeState,
vehicle: PokemonEntity,
driver: Player,
deltaTime: Double
): Vec3 {
return chooseBehaviour(settings, state) { behaviour, behaviourSettings, behaviourState ->
behaviour.angRollVel(behaviourSettings, behaviourState, vehicle, driver, deltaTime)
}
}
override fun velocity(
settings: CompositeSettings,
state: CompositeState,
vehicle: PokemonEntity,
driver: Player,
input: Vec3
): Vec3 {
return chooseBehaviour(settings, state) { behaviour, behaviourSettings, behaviourState ->
behaviour.velocity(behaviourSettings, behaviourState, vehicle, driver, input)
}
}
override fun rotation(
settings: CompositeSettings,
state: CompositeState,
vehicle: PokemonEntity,
driver: LivingEntity
): Vec2 {
return chooseBehaviour(settings, state) { behaviour, behaviourSettings, behaviourState ->
behaviour.rotation(behaviourSettings, behaviourState, vehicle, driver)
}
}
override fun speed(
settings: CompositeSettings,
state: CompositeState,
vehicle: PokemonEntity,
driver: Player
): Float {
return chooseBehaviour(settings, state) { behaviour, behaviourSettings, behaviourState ->
behaviour.speed(behaviourSettings, behaviourState, vehicle, driver)
}
}
override fun pose(
settings: CompositeSettings,
state: CompositeState,
vehicle: PokemonEntity
): PoseType {
return chooseBehaviour(settings, state) { behaviour, behaviourSettings, behaviourState ->
behaviour.pose(behaviourSettings, behaviourState, vehicle)
}
}
override fun isActive(
settings: CompositeSettings,
state: CompositeState,
vehicle: PokemonEntity
): Boolean {
return chooseBehaviour(settings, state) { behaviour, behaviourSettings, behaviourState ->
behaviour.isActive(behaviourSettings, behaviourState, vehicle)
}
}
}
open class CompositeSettings : RidingBehaviourSettings {
lateinit var transitionStrategy: ResourceLocation
private set
lateinit var defaultBehaviour: RidingBehaviourSettings
private set
lateinit var alternateBehaviour: RidingBehaviourSettings
private set
override val key: ResourceLocation = CompositeBehaviour.KEY
override fun encode(buffer: RegistryFriendlyByteBuf) {
buffer.writeResourceLocation(key)
buffer.writeResourceLocation(transitionStrategy)
defaultBehaviour.encode(buffer)
alternateBehaviour.encode(buffer)
}
override fun decode(buffer: RegistryFriendlyByteBuf) {
transitionStrategy = buffer.readResourceLocation()
val defaultBehaviourKey = buffer.readResourceLocation()
defaultBehaviour = RidingBehaviourSettingsAdapter.types[defaultBehaviourKey]?.getConstructor()?.newInstance()
?: error("Unknown controller key: $key")
defaultBehaviour.decode(buffer)
val alternativeBehaviourKey = buffer.readResourceLocation()
alternateBehaviour =
RidingBehaviourSettingsAdapter.types[alternativeBehaviourKey]?.getConstructor()?.newInstance()
?: error("Unknown controller key: $key")
alternateBehaviour.decode(buffer)
}
}
class CompositeState(
private val defaultBehaviour: ResourceLocation,
val defaultBehaviourState: RidingBehaviourState,
val alternateBehaviourState: RidingBehaviourState
) : RidingBehaviourState() {
var activeController = ridingState(defaultBehaviour, Side.CLIENT)
var lastTransition = ridingState(-100L, Side.BOTH)
override val rideVelocity: SidedRidingState<Vec3>
get() = when (activeController.get()) {
defaultBehaviour -> defaultBehaviourState.rideVelocity
else -> alternateBehaviourState.rideVelocity
}
override val stamina: SidedRidingState<Float>
get() = when (activeController.get()) {
defaultBehaviour -> defaultBehaviourState.stamina
else -> alternateBehaviourState.stamina
}
override fun reset() {
super.reset()
activeController.set(defaultBehaviour, forced = true)
lastTransition.set(-100L, forced = true)
}
override fun copy(): CompositeState {
val state =
CompositeState(defaultBehaviour, defaultBehaviourState.copy(), alternateBehaviourState.copy())
state.activeController.set(activeController.get(), forced = true)
state.lastTransition.set(lastTransition.get(), forced = true)
state.rideVelocity.set(rideVelocity.get(), forced = true)
state.stamina.set(stamina.get(), forced = true)
return state
}
override fun shouldSync(previous: RidingBehaviourState): Boolean {
if (previous !is CompositeState) return false
if (previous.activeController.get() != activeController.get()) return true
return super.shouldSync(previous)
}
override fun encode(buffer: FriendlyByteBuf) {
super.encode(buffer)
buffer.writeResourceLocation(activeController.get())
}
override fun decode(buffer: FriendlyByteBuf) {
super.decode(buffer)
activeController.set(buffer.readResourceLocation(), forced = true)
}
}
@@ -0,0 +1,32 @@
/*
* 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.api.riding.behaviour.types.composite.strategies
import com.cobblemon.mod.common.api.riding.behaviour.types.composite.CompositeSettings
import net.minecraft.resources.ResourceLocation
object CompositeRidingStrategies {
val strategies = mutableMapOf<ResourceLocation, CompositeRidingStrategy<out CompositeSettings>>()
init {
register(RunStrategy.key, RunStrategy)
register(JumpStrategy.key, JumpStrategy)
register(FallStrategy.key, FallStrategy)
}
fun register(key: ResourceLocation, strategy: CompositeRidingStrategy<out CompositeSettings>) {
if (strategies.contains(key)) error("Strategy already registered to key $key")
strategies[key] = strategy
}
fun get(key: ResourceLocation): CompositeRidingStrategy<CompositeSettings> {
if (!strategies.contains(key)) error("Strategy not registered to key $key")
return strategies[key]!! as CompositeRidingStrategy<CompositeSettings>
}
}
@@ -0,0 +1,52 @@
/*
* 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.api.riding.behaviour.types.composite.strategies
import com.cobblemon.mod.common.api.riding.RidingStyle
import com.cobblemon.mod.common.api.riding.behaviour.RidingBehaviourSettings
import com.cobblemon.mod.common.api.riding.behaviour.RidingBehaviourState
import com.cobblemon.mod.common.api.riding.behaviour.RidingBehaviours
import com.cobblemon.mod.common.api.riding.behaviour.types.composite.CompositeSettings
import com.cobblemon.mod.common.api.riding.behaviour.types.composite.CompositeState
import com.cobblemon.mod.common.entity.pokemon.PokemonBehaviourFlag
import com.cobblemon.mod.common.entity.pokemon.PokemonEntity
import net.minecraft.resources.ResourceLocation
import net.minecraft.world.entity.player.Player
import net.minecraft.world.phys.Vec3
interface CompositeRidingStrategy<T : CompositeSettings> {
val key: ResourceLocation
fun tick(
settings: T,
state: CompositeState,
defaultState: RidingBehaviourState,
alternateState: RidingBehaviourState,
vehicle: PokemonEntity,
driver: Player,
input: Vec3
)
fun transition(
vehicle: PokemonEntity,
settings: CompositeSettings,
state: CompositeState,
fromState: RidingBehaviourState,
toState: RidingBehaviourState,
toSettings: RidingBehaviourSettings
) {
toState.stamina.set(fromState.stamina.get())
toState.rideVelocity.set(fromState.rideVelocity.get())
state.activeController.set(toSettings.key)
state.lastTransition.set(vehicle.level().gameTime)
val behaviour = RidingBehaviours.get(toSettings.key)
vehicle.setBehaviourFlag(PokemonBehaviourFlag.FLYING, behaviour.style == RidingStyle.AIR)
}
}
@@ -0,0 +1,99 @@
/*
* 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.api.riding.behaviour.types.composite.strategies
import com.bedrockk.molang.Expression
import com.cobblemon.mod.common.api.riding.RidingStyle
import com.cobblemon.mod.common.api.riding.behaviour.RidingBehaviourSettings
import com.cobblemon.mod.common.api.riding.behaviour.RidingBehaviourState
import com.cobblemon.mod.common.api.riding.behaviour.RidingBehaviours
import com.cobblemon.mod.common.api.riding.behaviour.types.composite.CompositeSettings
import com.cobblemon.mod.common.api.riding.behaviour.types.composite.CompositeState
import com.cobblemon.mod.common.entity.pokemon.PokemonBehaviourFlag
import com.cobblemon.mod.common.entity.pokemon.PokemonEntity
import com.cobblemon.mod.common.util.*
import net.minecraft.network.RegistryFriendlyByteBuf
import net.minecraft.world.entity.player.Player
import net.minecraft.world.phys.Vec3
object FallStrategy : CompositeRidingStrategy<FallCompositeSettings> {
override val key = cobblemonResource("strategy/fall")
override fun tick(
settings: FallCompositeSettings,
state: CompositeState,
defaultState: RidingBehaviourState,
alternateState: RidingBehaviourState,
vehicle: PokemonEntity,
driver: Player,
input: Vec3
) {
if (shouldTransitionToDefault(state, settings.defaultBehaviour, vehicle)) {
transition(vehicle, settings, state, alternateState, defaultState, settings.defaultBehaviour)
} else if (shouldTransitionToAlternate(settings, state, settings.alternateBehaviour, vehicle, driver)) {
transition(vehicle, settings, state, defaultState, alternateState, settings.alternateBehaviour)
}
}
private fun shouldTransitionToDefault(
state: CompositeState,
defaultSettings: RidingBehaviourSettings,
vehicle: PokemonEntity
): Boolean {
if (state.activeController.get() == defaultSettings.key) return false
if (state.lastTransition.get() + 20 >= vehicle.level().gameTime) return false
if (!vehicle.onGround()) return false
val defaultBehaviour = RidingBehaviours.get(defaultSettings.key)
return defaultBehaviour.isActive(defaultSettings, state.defaultBehaviourState, vehicle)
}
private fun shouldTransitionToAlternate(
settings: FallCompositeSettings,
state: CompositeState,
alternateSettings: RidingBehaviourSettings,
vehicle: PokemonEntity,
driver: Player
): Boolean {
if (state.activeController.get() == alternateSettings.key) return false
if (!driver.jumping) return false
if (state.lastTransition.get() + 20 >= vehicle.level().gameTime) return false
val runtime = vehicle.runtime
val minFallingSpeed = runtime.resolveFloat(settings.minimumFallSpeed)
val minForwardSpeed = runtime.resolveFloat(settings.minimumForwardSpeed)
if (vehicle.deltaMovement.y < -minFallingSpeed) return false
if (vehicle.deltaMovement.horizontalDistance() < minForwardSpeed) return false
val alternativeBehaviour = RidingBehaviours.get(alternateSettings.key)
return alternativeBehaviour.isActive(alternateSettings, state.alternateBehaviourState, vehicle)
}
}
class FallCompositeSettings : CompositeSettings() {
override val key = FallStrategy.key
var minimumForwardSpeed: Expression = "0.0".asExpression()
private set
var minimumFallSpeed: Expression = "0.5".asExpression()
private set
override fun encode(buffer: RegistryFriendlyByteBuf) {
super.encode(buffer)
buffer.writeExpression(minimumForwardSpeed)
buffer.writeExpression(minimumFallSpeed)
}
override fun decode(buffer: RegistryFriendlyByteBuf) {
super.decode(buffer)
minimumForwardSpeed = buffer.readExpression()
minimumFallSpeed = buffer.readExpression()
}
}
@@ -0,0 +1,68 @@
/*
* 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.api.riding.behaviour.types.composite.strategies
import com.cobblemon.mod.common.api.riding.RidingStyle
import com.cobblemon.mod.common.api.riding.behaviour.RidingBehaviourSettings
import com.cobblemon.mod.common.api.riding.behaviour.RidingBehaviourState
import com.cobblemon.mod.common.api.riding.behaviour.RidingBehaviours
import com.cobblemon.mod.common.api.riding.behaviour.types.composite.CompositeSettings
import com.cobblemon.mod.common.api.riding.behaviour.types.composite.CompositeState
import com.cobblemon.mod.common.entity.pokemon.PokemonBehaviourFlag
import com.cobblemon.mod.common.entity.pokemon.PokemonEntity
import com.cobblemon.mod.common.util.cobblemonResource
import net.minecraft.world.entity.player.Player
import net.minecraft.world.phys.Vec3
object JumpStrategy : CompositeRidingStrategy<CompositeSettings> {
override val key = cobblemonResource("strategy/jump")
override fun tick(
settings: CompositeSettings,
state: CompositeState,
defaultState: RidingBehaviourState,
alternateState: RidingBehaviourState,
vehicle: PokemonEntity,
driver: Player,
input: Vec3
) {
if (shouldTransitionToDefault(state, settings.defaultBehaviour, vehicle)) {
transition(vehicle, settings, state, alternateState, defaultState, settings.defaultBehaviour)
} else if (shouldTransitionToAlternative(state, settings.alternateBehaviour, vehicle, driver)) {
transition(vehicle, settings, state, defaultState, alternateState, settings.alternateBehaviour)
}
}
private fun shouldTransitionToDefault(
state: CompositeState,
defaultSettings: RidingBehaviourSettings,
vehicle: PokemonEntity
): Boolean {
if (state.activeController.get() == defaultSettings.key) return false
if (!vehicle.onGround()) return false
if (state.lastTransition.get() + 20 >= vehicle.level().gameTime) return false
val defaultBehaviour = RidingBehaviours.get(defaultSettings.key)
return defaultBehaviour.isActive(defaultSettings, state.defaultBehaviourState, vehicle)
}
private fun shouldTransitionToAlternative(
state: CompositeState,
alternativeSettings: RidingBehaviourSettings,
vehicle: PokemonEntity,
driver: Player
): Boolean {
if (state.activeController.get() == alternativeSettings.key) return false
if (!driver.jumping) return false
if (state.lastTransition.get() + 20 >= vehicle.level().gameTime) return false
val alternativeBehaviour = RidingBehaviours.get(alternativeSettings.key)
return alternativeBehaviour.isActive(alternativeSettings, state.alternateBehaviourState, vehicle)
}
}
@@ -0,0 +1,67 @@
/*
* 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.api.riding.behaviour.types.composite.strategies
import com.cobblemon.mod.common.api.riding.behaviour.RidingBehaviourSettings
import com.cobblemon.mod.common.api.riding.behaviour.RidingBehaviourState
import com.cobblemon.mod.common.api.riding.behaviour.RidingBehaviours
import com.cobblemon.mod.common.api.riding.behaviour.types.composite.CompositeSettings
import com.cobblemon.mod.common.api.riding.behaviour.types.composite.CompositeState
import com.cobblemon.mod.common.entity.pokemon.PokemonEntity
import com.cobblemon.mod.common.util.cobblemonResource
import net.minecraft.world.entity.player.Player
import net.minecraft.world.phys.Vec3
object RunStrategy : CompositeRidingStrategy<CompositeSettings> {
override val key = cobblemonResource("strategy/run")
override fun tick(
settings: CompositeSettings,
state: CompositeState,
defaultState: RidingBehaviourState,
alternateState: RidingBehaviourState,
vehicle: PokemonEntity,
driver: Player,
input: Vec3
) {
if (shouldTransitionToDefault(state, settings.defaultBehaviour, vehicle, driver)) {
transition(vehicle, settings, state, alternateState, defaultState, settings.defaultBehaviour)
}
else if (shouldTransitionToAlternate(state, settings.alternateBehaviour, vehicle, driver, input)) {
transition(vehicle, settings, state, defaultState, alternateState, settings.alternateBehaviour)
}
}
private fun shouldTransitionToDefault(
state: CompositeState,
defaultSettings: RidingBehaviourSettings,
entity: PokemonEntity,
driver: Player
): Boolean {
if (state.activeController.get() == defaultSettings.key) return false
if (state.lastTransition.get() + 20 >= entity.level().gameTime) return false
val defaultBehaviour = RidingBehaviours.get(defaultSettings.key)
return !driver.isSprinting || defaultBehaviour.isActive(defaultSettings, state.defaultBehaviourState, entity)
}
private fun shouldTransitionToAlternate(
state: CompositeState,
alternativeSettings: RidingBehaviourSettings,
entity: PokemonEntity,
driver: Player,
input: Vec3
): Boolean {
if (state.activeController.get() == alternativeSettings.key) return false
if (state.lastTransition.get() + 20 >= entity.level().gameTime) return false
val alternativeBehaviour = RidingBehaviours.get(alternativeSettings.key)
return driver.isSprinting && input.z > 0.5 && alternativeBehaviour.isActive(alternativeSettings, state.alternateBehaviourState, entity)
}
}
@@ -8,9 +8,13 @@
package com.cobblemon.mod.common.battles
import com.cobblemon.mod.common.api.battles.model.PokemonBattle
import com.cobblemon.mod.common.api.battles.model.actor.BattleActor
import com.cobblemon.mod.common.api.battles.model.actor.EntityBackedBattleActor
import com.cobblemon.mod.common.battles.pokemon.BattlePokemon
import net.minecraft.server.level.ServerLevel
import net.minecraft.world.level.ClipContext
import net.minecraft.world.phys.HitResult
import net.minecraft.world.phys.Vec3
class ActiveBattlePokemon(val actor: BattleActor, var battlePokemon: BattlePokemon? = null): Targetable {
val battle = actor.battle
@@ -28,4 +32,115 @@ class ActiveBattlePokemon(val actor: BattleActor, var battlePokemon: BattlePokem
override fun hasPokemon() = battlePokemon != null
fun isGone() = battlePokemon?.gone ?: true
fun isAlive() = (battlePokemon?.health ?: 0) > 0
fun getSendOutPosition(): Vec3? {
val pnx = getPNX()
val actorEntityPosList = actor.getSide().actors.mapNotNull { if (it is EntityBackedBattleActor<*>) it.initialPos else null }
val actorEntityPos = if (actorEntityPosList.size == 1)
actorEntityPosList[0]
else if (actorEntityPosList.size > 1)
actorEntityPosList.fold(Vec3(0.0, 0.0, 0.0)) { acc, vec3 -> acc.add(vec3.scale(1.0 / actorEntityPosList.size)) }
else
null
val opposingActorEntityList = actor.getSide().getOppositeSide().actors.mapNotNull { if (it is EntityBackedBattleActor<*>) it.initialPos else null }
val opposingEntityPos = if (opposingActorEntityList.size == 1)
opposingActorEntityList[0]
else if (opposingActorEntityList.size > 1) {
// If multiple actors per side, avg their position
opposingActorEntityList.fold(Vec3(0.0, 0.0, 0.0)) { acc, vec3 -> acc.add(vec3.scale(1.0 / opposingActorEntityList.size)) }
}
else null
var actorOffset = actorEntityPos?.let { opposingEntityPos?.subtract(it) }
var result = actorEntityPos
if (actorOffset != null) {
var widthSum = 4.0 // Leave a constant to allow double/triples alignment to be consistent
var pokemonWidth = battlePokemon?.originalPokemon?.form?.hitbox?.width ?: 0F
val pokemonBaseScale = battlePokemon?.originalPokemon?.form?.baseScale ?: 0F
pokemonWidth *= pokemonBaseScale
if (battle.format.battleType.pokemonPerSide == 1) {
battlePokemon?.let { battlePokemon ->
// sum of the hitbox widths of both pokemon
val opposingActivePokemon = (getOppositeOpponent() as ActiveBattlePokemon)
val opposingPokemonWidth = opposingActivePokemon.battlePokemon?.let {
it.originalPokemon.form.hitbox.width * it.originalPokemon.form.baseScale
} ?: pokemonWidth
widthSum = (pokemonWidth + opposingPokemonWidth) / 2.0 // Only care about the front half of each hitbox
}
}
val minDistance = 4.0 + widthSum
val actorDistance = actorOffset.length()
if (actorDistance < minDistance) {
val temp = actorOffset.scale(minDistance / actorDistance) ?: actorOffset
result = actorEntityPos?.subtract(temp.subtract(actorOffset))
actorOffset = temp
}
// orthogonalVector is the sideways displacement from the battle actors
var orthogonalVector = Vec3(actorOffset.x, 0.0, actorOffset.z).normalize()
orthogonalVector = orthogonalVector.cross(Vec3(0.0, 1.0, 0.0))
if (battle.format.battleType.pokemonPerSide == 1) { // Singles
result = result?.add(actorOffset.scale(if (battle.isPvW) 0.4 else 0.3))
battlePokemon?.let { battlePokemon ->
val hitbox = battlePokemon.originalPokemon.form.hitbox
val scale = battlePokemon.originalPokemon.form.baseScale
orthogonalVector = orthogonalVector.scale(-0.3 - hitbox.width * scale )
}
} else if (battle.format.battleType.pokemonPerSide == 2) { // Doubles/Multi
if (battle.actors.first() != battle.actors.last()) {
val offsetB = if (pnx[2] == 'a') orthogonalVector.scale(-1.0) else orthogonalVector
result = result?.add(actorOffset.scale(0.33))
orthogonalVector = offsetB.scale(2.5)
}
} else if (battle.format.battleType.pokemonPerSide == 3) { // Triples
if (battle.actors.first() != battle.actors.last()) {
result = when (pnx[2]) {
'a' -> {
orthogonalVector = orthogonalVector.scale(-3.5)
result?.add(actorOffset.scale(0.15))
}
'b' -> {
orthogonalVector = Vec3.ZERO
result?.add(actorOffset.scale(0.3))
}
'c' -> {
orthogonalVector = orthogonalVector.scale(3.5)
result?.add(actorOffset.scale(0.15))
}
else -> result
}
}
}
val fallbackPos = result
result = result?.add(orthogonalVector)
if (actor is EntityBackedBattleActor<*> && result != null) {
val entity = actor.entity ?: return result
// Do a single raycast to estimate if we're trying to throw a pokemon into a wall.
// If the collision is too close to the actor, try to find a more reasonable position.
// The motivation here is to give setPositionSafely something more reasonable to work with.
val collisionResult = entity.level().clip(
ClipContext(
actorEntityPos!!.add(Vec3(0.0,entity.eyeHeight.toDouble(),0.0)), // start position
Vec3(result.x, entity.y + entity.eyeHeight.toDouble(), result.z), // end position
ClipContext.Block.OUTLINE,
ClipContext.Fluid.NONE,
entity
)
)
if (collisionResult.type == HitResult.Type.BLOCK) {
// Collided with terrain
result = if (collisionResult.location.distanceToSqr(actorEntityPos) < pokemonWidth) {
// Fallback to in between the two actors, dropping the orthogonal vector
// Ideally this keeps a pokemon in between the actors in a narrow tunnel
fallbackPos
} else {
Vec3(collisionResult.location.x, result.y, collisionResult.location.z)
}
}
}
}
return result
}
}
@@ -22,6 +22,8 @@ import com.cobblemon.mod.common.battles.interpreter.instructions.*
import com.cobblemon.mod.common.battles.pokemon.BattlePokemon
import com.cobblemon.mod.common.util.battleLang
import com.cobblemon.mod.common.util.runOnServer
import net.minecraft.world.level.ClipContext
import net.minecraft.world.phys.HitResult
import net.minecraft.world.phys.Vec3
import java.util.UUID
import kotlin.collections.Iterator
@@ -34,6 +36,7 @@ import kotlin.collections.mutableMapOf
import kotlin.collections.set
import kotlin.collections.toMutableList
import kotlin.collections.toTypedArray
import kotlin.time.measureTime
@Suppress("KotlinPlaceholderCountMatchesArgumentCount", "UNUSED_PARAMETER")
object ShowdownInterpreter {
@@ -138,85 +141,6 @@ object ShowdownInterpreter {
// Note '-cureteam' is a legacy thing that is only used in generation 2 and 4 mods for heal bell and aromatherapy respectively as such we can just ignore that
}
/**
*
* Figures out the sendout position for a pokemon in a battle
*
*
*/
fun getSendoutPosition(battle: PokemonBattle, activePokemon: ActiveBattlePokemon, battleActor: BattleActor): Vec3? {
val pnx = activePokemon.getPNX()
val actorEntityPosList = battleActor.getSide().actors.mapNotNull { if (it is EntityBackedBattleActor<*>) it.initialPos else null }
val actorEntityPos = if (actorEntityPosList.size == 1)
actorEntityPosList[0]
else if (actorEntityPosList.size > 1)
actorEntityPosList.fold(Vec3(0.0, 0.0, 0.0)) { acc, vec3 -> acc.add(vec3.scale(1.0 / actorEntityPosList.size)) }
else
null
val opposingActorEntityList = battleActor.getSide().getOppositeSide().actors.mapNotNull { if (it is EntityBackedBattleActor<*>) it.initialPos else null }
val opposingEntityPos = if (opposingActorEntityList.size == 1)
opposingActorEntityList[0]
else if (opposingActorEntityList.size > 1) {
// If multiple actors per side, avg their position
opposingActorEntityList.fold(Vec3(0.0, 0.0, 0.0)) { acc, vec3 -> acc.add(vec3.scale(1.0 / opposingActorEntityList.size)) }
}
else null
var actorOffset = actorEntityPos?.let { opposingEntityPos?.subtract(it) }
var result = actorEntityPos
if (actorOffset != null) {
var widthSum = 4.0 // Leave a constant to allow double/triples alignment to be consistent
if (battle.format.battleType.pokemonPerSide == 1) {
activePokemon.battlePokemon?.let { battlePokemon ->
// sum of the hitbox widths of both pokemon
val opposingActivePokemon = (activePokemon.getOppositeOpponent() as ActiveBattlePokemon)
val pokemonWidth = battlePokemon.originalPokemon.form.hitbox.width * battlePokemon.originalPokemon.form.baseScale
val opposingPokemonWidth = opposingActivePokemon.battlePokemon?.let {
it.originalPokemon.form.hitbox.width * it.originalPokemon.form.baseScale
} ?: pokemonWidth
widthSum = (pokemonWidth + opposingPokemonWidth) / 2.0 // Only care about the front half of each hitbox
}
}
val minDistance = 4.0 + widthSum
val actorDistance = actorOffset.length()
if (actorDistance < minDistance) {
val temp = actorOffset.scale(minDistance / actorDistance) ?: actorOffset
result = actorEntityPos?.subtract(temp.subtract(actorOffset))
actorOffset = temp
}
var vector = Vec3(actorOffset.x, 0.0, actorOffset.z).normalize()
vector = vector.cross(Vec3(0.0, 1.0, 0.0))
if (battle.format.battleType.pokemonPerSide == 1) { // Singles
result = result?.add(actorOffset.scale(if (battle.isPvW) 0.4 else 0.3))
activePokemon.battlePokemon?.let { battlePokemon ->
val hitbox = battlePokemon.originalPokemon.form.hitbox
val scale = battlePokemon.originalPokemon.form.baseScale
activePokemon.getAdjacentOpponents()
result = result?.add(vector.scale(-0.3 - hitbox.width * scale ))
}
} else if (battle.format.battleType.pokemonPerSide == 2) { // Doubles/Multi
if (battle.actors.first() !== battle.actors.last()) {
val offsetB = if (pnx[2] == 'a') vector.scale(-1.0) else vector
result = result?.add(actorOffset.scale(0.33))?.add(offsetB.scale(2.5))
}
} else if (battle.format.battleType.pokemonPerSide == 3) { // Triples
if (battle.actors.first() !== battle.actors.last()) {
result = when (pnx[2]) {
'a' -> result?.add(actorOffset.scale(0.15))?.add(vector.scale(-3.5))
'b' -> result?.add(actorOffset.scale(0.3))
'c' -> result?.add(actorOffset.scale(0.15))?.add(vector.scale(3.5))
else -> result
}
}
}
}
return result
}
fun interpretMessage(battleId: UUID, message: String) {
// Check key map and use function if matching
@@ -13,7 +13,6 @@ import com.cobblemon.mod.common.api.battles.model.PokemonBattle
import com.cobblemon.mod.common.battles.ShowdownInterpreter
import com.cobblemon.mod.common.battles.dispatch.InstructionSet
import com.cobblemon.mod.common.battles.dispatch.InterpreterInstruction
import com.cobblemon.mod.common.entity.pokemon.effects.IllusionEffect
import com.cobblemon.mod.common.net.messages.client.battle.BattleSwapPokemonPacket
import com.cobblemon.mod.common.util.battleLang
import com.cobblemon.mod.common.util.setPositionSafely
@@ -42,12 +41,12 @@ class SwapInstruction(val message: BattleMessage, val instructionSet: Instructio
// Swap references of the 2 pokemon
actor.activePokemon.swap((pnxA[2] - 'a'), (pnxB[2] - 'a'))
val posA = ShowdownInterpreter.getSendoutPosition(battle, activePokemonA, battlePokemonA.actor) ?: activePokemonA.position?.second
val posA = activePokemonA.getSendOutPosition() ?: activePokemonA.position?.second
if (posA != null && battlePokemonA.entity != null) {
battlePokemonA.entity?.setPositionSafely(battlePokemonA.entity!!.getAjustedSendoutPosition(posA))
}
val posB = ShowdownInterpreter.getSendoutPosition(battle, activePokemonB, battlePokemonA.actor) ?: activePokemonB.position?.second
val posB = activePokemonB.getSendOutPosition() ?: activePokemonB.position?.second
val battlePokemonB = activePokemonB.battlePokemon
if (posB != null && battlePokemonB?.entity != null) {
activePokemonB.battlePokemon?.entity?.setPositionSafely(battlePokemonB.entity!!.getAjustedSendoutPosition(posB))
@@ -70,7 +70,7 @@ class SwitchInstruction(val instructionSet: InstructionSet, val battleActor: Bat
else if (pokemonEntity == null && entity != null) {
activePokemon.battlePokemon = pokemon
activePokemon.illusion = illusion
val targetPos = ShowdownInterpreter.getSendoutPosition(battle, activePokemon, battleActor)
val targetPos = activePokemon.getSendOutPosition()
if (targetPos != null) {
val battleSendoutCount = activePokemon.getActorShowdownId()[1].digitToInt() - 1 + actor.stillSendingOutCount
actor.stillSendingOutCount++
@@ -180,7 +180,7 @@ class SwitchInstruction(val instructionSet: InstructionSet, val battleActor: Bat
}
} else {
// For Singles, we modify the sendout position based on the pokemon's hitbox size
val pos = (if (battle.format.battleType.pokemonPerSide == 1) ShowdownInterpreter.getSendoutPosition(battle, activePokemon, actor)
val pos = (if (battle.format.battleType.pokemonPerSide == 1) activePokemon.getSendOutPosition()
else activePokemon.position?.second) ?: entity.position()
// Send out at previous Pokémon's location if it is known, otherwise actor location
val world = entity.level() as ServerLevel
@@ -0,0 +1,77 @@
/*
* 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
import com.cobblemon.mod.common.client.entity.PokemonClientDelegate
import com.cobblemon.mod.common.entity.pokemon.PokemonEntity
import net.minecraft.util.Mth
import net.minecraft.world.phys.Vec3
/**
* This class is responsible for setting up the animation state of a Pokemon entity before it begins to render.
*
* Sometimes we depend on the animation state of the Pokemon to be set up before we begin rendering it, so this class
* allows us to do that. It also caches which Pokemon have been pre-animated to avoid doing it multiple times.
*
* @author landonjw
*/
object MountedPokemonAnimationRenderController {
private val forcedDeltas = mutableMapOf<Int, Float>()
fun setup(pokemon: PokemonEntity, partialTickTime: Float) {
if (forcedDeltas.contains(pokemon.id)) return
val delegate = pokemon.delegate as? PokemonClientDelegate ?: return
val model = delegate.currentModel ?: return
if (!model.isReadyForAnimation()) return
val entityPos = Vec3(
Mth.lerp(partialTickTime.toDouble(), pokemon.xOld, pokemon.x),
Mth.lerp(partialTickTime.toDouble(), pokemon.yOld, pokemon.y),
Mth.lerp(partialTickTime.toDouble(), pokemon.zOld, pokemon.z)
)
val f = Mth.rotLerp(partialTickTime, pokemon.yBodyRotO, pokemon.yBodyRot)
val g = Mth.rotLerp(partialTickTime, pokemon.yHeadRotO, pokemon.yHeadRot)
var h = g - f
val j = Mth.lerp(partialTickTime, pokemon.xRotO, pokemon.xRot)
h = Mth.wrapDegrees(h)
var l = 0.0f
var m = 0.0f
if (!pokemon.isPassenger && pokemon.isAlive) {
l = pokemon.walkAnimation.speed(partialTickTime)
m = pokemon.walkAnimation.position(partialTickTime)
if (pokemon.isBaby) {
m *= 3.0f
}
if (l > 1.0f) {
l = 1.0f
}
}
delegate.updatePartialTicks(partialTickTime)
delegate.updateLocatorPosition(entityPos)
delegate.currentModel?.applyAnimations(pokemon, delegate, l, m, partialTickTime, j, h)
forcedDeltas[pokemon.id] = partialTickTime
}
fun getPartialTick(pokemon: PokemonEntity) : Float? {
return forcedDeltas[pokemon.id]
}
/**
* Resets the prerendered list. This should be called in the render loop before we begin setting up any pokemon with `setup`.
*/
fun reset() {
forcedDeltas.clear()
}
}
@@ -43,8 +43,10 @@ import net.minecraft.sounds.SoundEvent
import net.minecraft.sounds.SoundSource
import net.minecraft.world.InteractionHand
import net.minecraft.world.entity.Entity
import net.minecraft.world.entity.Entity.MoveFunction
import net.minecraft.world.entity.player.Player
import net.minecraft.world.phys.Vec3
import org.joml.Vector3f
class PokemonClientDelegate : PosableState(), PokemonSideDelegate {
companion object {
@@ -343,9 +345,12 @@ class PokemonClientDelegate : PosableState(), PokemonSideDelegate {
runtime.environment.query = struct
}
override fun updateAge(age: Int) {
this.age = age
}
override fun initialize(entity: PokemonEntity) {
this.currentEntity = entity
this.age = entity.tickCount
this.runtime.environment.query.addFunctions(mapOf(
"in_battle" to java.util.function.Function {
@@ -451,4 +456,30 @@ class PokemonClientDelegate : PosableState(), PokemonSideDelegate {
}
cryAnimation = animation
}
override fun positionRider(passenger: Entity, positionUpdater: MoveFunction) {
val index =
this.getEntity().passengers.indexOf(passenger).takeIf { it >= 0 && it < this.getEntity().seats.size }
?: return
val seat = this.getEntity().seats[index]
val locator = this.locatorStates[seat.locator]
if (locator == null) return
val offset = locator.matrix.getTranslation(Vector3f())
.sub(
Vector3f(
0f,
passenger.eyeHeight - (passenger.bbHeight / 2),
0f
)
) // This is close but not exact
positionUpdater.accept(
passenger,
this.getEntity().x + offset.x,
this.getEntity().y + offset.y,
this.getEntity().z + offset.z
)
}
}
@@ -98,13 +98,13 @@ class CobblemonConfigIntVariable(
override fun getConfigValueAsString(): String = (config.getter.call(parent.parent.clonedConfig) as Int?).toString()
init {
editBox.setFilter { value -> value.toIntOrNull() != null || value.isBlank() }
editBox.setFilter { value -> value.toIntOrNull() != null || value.isBlank() || value == "-" }
editBox.setResponder { value ->
if (value.isBlank()) {
return@setResponder
}
val intValue = value.toInt()
val intValue = value.toIntOrNull() ?: return@setResponder
setConfigValue(intValue, false)
if (intConstraintAnnotation != null) {
@@ -129,7 +129,7 @@ class CobblemonConfigFloatVariable(
override fun getConfigValueAsString(): String = (config.getter.call(parent.parent.clonedConfig) as Float?).toString()
init {
editBox.setFilter { value -> value.toFloatOrNull() != null || value.isBlank() }
editBox.setFilter { value -> value.toFloatOrNull() != null || value.isBlank() || value == "." || value == "-" }
editBox.setResponder { value ->
if (value.toFloatOrNull() != null) {
setConfigValue(value.toFloat(), false)
@@ -145,7 +145,7 @@ class CobblemonConfigDoubleVariable(
override fun getConfigValueAsString(): String = (config.getter.call(parent.parent.clonedConfig) as Double?).toString()
init {
editBox.setFilter { value -> value.toDoubleOrNull() != null || value.isBlank() }
editBox.setFilter { value -> value.toDoubleOrNull() != null || value.isBlank() || value == "." || value == "-" }
editBox.setResponder { value ->
if (value.toDoubleOrNull() != null) {
setConfigValue(value.toDouble(), false)
@@ -125,6 +125,7 @@ class Summary private constructor(party: Collection<Pokemon?>, private val edita
private lateinit var markingsWidget: MarkingsWidget
private val summaryTabs = mutableListOf<SummaryTab>()
private var showCosmeticItem = false
private lateinit var heldItemVisibilityButton: SummaryButton
private var mainScreenIndex = INFO
var sideScreenIndex = PARTY
private val party = ArrayList(party)
@@ -181,7 +182,7 @@ class Summary private constructor(party: Collection<Pokemon?>, private val edita
)
//Item Visibility Button
val HeldItemVisibilityButton = SummaryButton(
heldItemVisibilityButton = SummaryButton(
buttonX = x + 3F,
buttonY = y + 104F,
buttonWidth = 32,
@@ -191,7 +192,7 @@ class Summary private constructor(party: Collection<Pokemon?>, private val edita
activeResource = itemHiddenResource,
clickAction = {
selectedPokemon.heldItemVisible = !selectedPokemon.heldItemVisible
(it as SummaryButton).buttonActive = !selectedPokemon.heldItemVisible
heldItemVisibilityButton.buttonActive = !selectedPokemon.heldItemVisible
modelWidget.heldItem = if (selectedPokemon.heldItemVisible) selectedPokemon.heldItem else null
// Send item visibility update to server
sendToServer(SetItemHiddenPacket(selectedPokemon.uuid, selectedPokemon.heldItemVisible))
@@ -199,8 +200,8 @@ class Summary private constructor(party: Collection<Pokemon?>, private val edita
renderRequirement = { !selectedPokemon.heldItemNoCopy().isEmpty && !showCosmeticItem },
clickRequirement = { !selectedPokemon.heldItemNoCopy().isEmpty && !showCosmeticItem }
)
addRenderableWidget(HeldItemVisibilityButton)
heldItemVisibilityButton.buttonActive = !selectedPokemon.heldItemVisible
addRenderableWidget(heldItemVisibilityButton)
// Held/Cosmetic Item Button
addRenderableWidget(
@@ -331,6 +332,7 @@ class Summary private constructor(party: Collection<Pokemon?>, private val edita
if (::modelWidget.isInitialized) {
modelWidget.pokemon = selectedPokemon.asRenderablePokemon()
modelWidget.heldItem = if (selectedPokemon.heldItemVisible) selectedPokemon.heldItem else null
heldItemVisibilityButton.buttonActive = !selectedPokemon.heldItemVisible
}
if (::nicknameEntryWidget.isInitialized) nicknameEntryWidget.setSelectedPokemon(selectedPokemon)
@@ -18,7 +18,6 @@ import com.cobblemon.mod.common.util.math.fromEulerXYZDegrees
import net.minecraft.client.gui.GuiGraphics
import net.minecraft.network.chat.Component
import net.minecraft.world.item.ItemStack
import net.minecraft.world.phys.Vec3
import org.joml.Quaternionf
import org.joml.Vector3f
@@ -114,12 +113,13 @@ class ModelWidget(
)
heldItemRenderer.renderOnModel(
state.currentModel!!,
heldItem?: ItemStack.EMPTY,
state.currentModel!!,
state,
matrices,
context.bufferSource(),
Vec3(0.0,-90.0,-90.0)
light = 0xF000F0,
true
)
matrices.popPose()
@@ -36,11 +36,13 @@ class MarksScrollingWidget(val pX: Int, val pY: Int, val setSelectedMark: () ->
fun createEntries(marks: List<Mark?>) {
marks.chunked(6).forEachIndexed { index, listChunk ->
addEntry(ScrollSlotRow(listChunk, setSelectedMark, setHoveredMark))
addEntry(ScrollSlotRow(this, listChunk, setSelectedMark, setHoveredMark))
}
}
override fun getScrollbarPosition(): Int = pX + width - 3
override fun getRowLeft(): Int = if (children().size > 5) (left + 1) else left
override fun getScrollbarPosition(): Int = rowLeft + width - 3
override fun renderScrollbar(context: GuiGraphics, mouseX: Int, mouseY: Int, delta: Float) {
// Do not render scrollbar if all rows are already visible
@@ -57,8 +59,8 @@ class MarksScrollingWidget(val pX: Int, val pY: Int, val setSelectedMark: () ->
yTop = this.y
}
context.fill(xLeft, this.y, xRight, this.bottom, FastColor.ARGB32.color(255, 47, 47, 47)) // background
context.fill(xLeft,yTop, xRight, yTop + yBottom, FastColor.ARGB32.color(255, 198, 198, 198)) // base
context.fill(xLeft, this.y, xRight, this.bottom, FastColor.ARGB32.color(255, 75, 75, 75)) // background
context.fill(xLeft,yTop, xRight, yTop + yBottom, FastColor.ARGB32.color(255, 141, 141, 141)) // base
}
}
@@ -72,7 +74,7 @@ class MarksScrollingWidget(val pX: Int, val pY: Int, val setSelectedMark: () ->
override fun getEntry(index: Int): ScrollSlotRow = children()[index] as ScrollSlotRow
override fun renderListItems(context: GuiGraphics, mouseX: Int, mouseY: Int, delta: Float) {
val rowX = this.rowLeft
val rowX = rowLeft
var anyHovered = false
for (index in 0 until this.itemCount) {
@@ -96,6 +98,7 @@ class MarksScrollingWidget(val pX: Int, val pY: Int, val setSelectedMark: () ->
}
class ScrollSlotRow(
val parent: MarksScrollingWidget,
val markList: List<Mark?>,
val setSelectedMark : () -> Unit,
val setHoveredMark: (Mark?) -> Unit
@@ -109,10 +112,11 @@ class MarksScrollingWidget(val pX: Int, val pY: Int, val setSelectedMark: () ->
fun renderRow(context: GuiGraphics, y: Int, x: Int, mouseX: Int, mouseY: Int): Boolean {
var anyHovered = false
val horizontalSpacing = if (isScrollVisible()) SLOT_SPACING else (SLOT_SPACING + 1)
markList.forEachIndexed { index, mark ->
val matrices = context.pose()
val startPosX = x + ((SLOT_SPACING + SLOT_SIZE) * index)
val startPosX = x + ((horizontalSpacing + SLOT_SIZE) * index)
val startPosY = y + SLOT_SPACING
val slotHovered = mark != null && getHoveredSlotIndex(mouseX, mouseY) == index
@@ -156,9 +160,12 @@ class MarksScrollingWidget(val pX: Int, val pY: Int, val setSelectedMark: () ->
return true
}
private fun isScrollVisible(): Boolean = parent.children().size > 5
private fun getHoveredSlotIndex(mouseX: Int, mouseY: Int): Int {
val horizontalSpacing = if (isScrollVisible()) SLOT_SPACING else (SLOT_SPACING + 1)
markList.forEachIndexed { index, _ ->
val startPosX = x + ((SLOT_SPACING + SLOT_SIZE) * index)
val startPosX = x + ((horizontalSpacing + SLOT_SIZE) * index)
val startPosY = y + SLOT_SPACING + 1
if (mouseX in startPosX..(startPosX + SLOT_SIZE)
@@ -42,7 +42,7 @@ class MarksWidget(
var hoveredMark: Mark? = null
val marksScrollList = MarksScrollingWidget(
pX = pX + 10,
pX = pX + 9,
pY = pY + 45,
setSelectedMark = {
if (hoveredMark != null) {
@@ -11,9 +11,12 @@ package com.cobblemon.mod.common.client.render.item
import com.cobblemon.mod.common.api.tags.CobblemonItemTags
import com.cobblemon.mod.common.api.tags.CobblemonItemTags.WEARABLE_FACE_ITEMS
import com.cobblemon.mod.common.api.tags.CobblemonItemTags.WEARABLE_HAT_ITEMS
import com.cobblemon.mod.common.client.render.MatrixWrapper
import com.cobblemon.mod.common.client.entity.NPCClientDelegate
import com.cobblemon.mod.common.client.entity.PokemonClientDelegate
import com.cobblemon.mod.common.client.render.models.blockbench.FloatingState
import com.cobblemon.mod.common.client.render.models.blockbench.PosableModel
import com.cobblemon.mod.common.client.render.models.blockbench.PosableState
import com.mojang.blaze3d.systems.RenderSystem
import com.mojang.blaze3d.vertex.PoseStack
import com.mojang.math.Axis
import net.minecraft.client.Minecraft
@@ -24,7 +27,7 @@ import net.minecraft.client.renderer.texture.OverlayTexture
import net.minecraft.world.entity.LivingEntity
import net.minecraft.world.item.ItemDisplayContext
import net.minecraft.world.item.ItemStack
import net.minecraft.world.phys.Vec3
import org.joml.Vector3f
class HeldItemRenderer {
private val itemRenderer: ItemRenderer = Minecraft.getInstance().itemRenderer
@@ -34,133 +37,91 @@ class HeldItemRenderer {
const val ITEM_FACE = "item_face"
const val ITEM_HAT = "item_hat"
const val ITEM = "item"
}
fun render(
entity: LivingEntity?,
model: PosableModel,
item: ItemStack,
locators: Map<String, MatrixWrapper>,
poseStack: PoseStack,
buffer: MultiBufferSource,
light: Int,
seed: Int,
rotation: Vec3
) {
if (item.isEmpty) return
displayContext = ItemDisplayContext.FIXED
poseStack.pushPose()
when {
//item_face locator
(locators.containsKey(ITEM_FACE) && item.`is`(WEARABLE_FACE_ITEMS)) -> {
displayContext = model.getLocatorDisplayContext(ITEM_FACE) ?: ItemDisplayContext.HEAD
poseStack.mulPose(locators[ITEM_FACE]!!.matrix)
poseStack.translate(0f, 0f, .28f)
poseStack.scale(0.7f, 0.7f, 0.7f)
}
//item_hat locator
(locators.containsKey(ITEM_HAT) && item.`is`(WEARABLE_HAT_ITEMS)) -> {
displayContext = model.getLocatorDisplayContext(ITEM_HAT) ?: ItemDisplayContext.HEAD
poseStack.mulPose(locators[ITEM_HAT]!!.matrix)
poseStack.translate(0f, -0.26f, 0f)
poseStack.scale(.68f, .68f, .68f)
}
//item locator
(locators.containsKey(ITEM)) -> {
displayContext = model.getLocatorDisplayContext(ITEM) ?: ItemDisplayContext.FIXED
poseStack.mulPose(locators[ITEM]!!.matrix)
applyContextTransformation(poseStack, rotation)
}
// Don't render any item
else -> {
poseStack.popPose()
return
}
}
itemRenderer.renderStatic(entity, item, displayContext, (displayContext==ItemDisplayContext.THIRD_PERSON_LEFT_HAND), poseStack, buffer, null, light, OverlayTexture.NO_OVERLAY, seed)
poseStack.popPose()
}
private fun renderAnimationItem(
model: PosableModel,
state: PosableState,
locators: Map<String, MatrixWrapper>,
poseStack: PoseStack,
buffer: MultiBufferSource,
light: Int,
entity: LivingEntity?,
rotation: Vec3
) {
state.itemRenderingLocations.forEach { (locatorName, item) ->
poseStack.pushPose()
if (locators.containsKey(locatorName)) {
displayContext = model.getLocatorDisplayContext(locatorName)?: ItemDisplayContext.FIXED
poseStack.mulPose(locators[locatorName]!!.matrix)
applyContextTransformation(poseStack, rotation)
}
itemRenderer.renderStatic(entity, item, displayContext, (displayContext==ItemDisplayContext.THIRD_PERSON_LEFT_HAND), poseStack, buffer, null, light, OverlayTexture.NO_OVERLAY, 0)
poseStack.popPose()
private fun PoseStack.setOriginAndScale(x:Float,y:Float,z:Float,scale:Float=1f) {
this.translate(x*.0625*scale, y*.0625*scale, z*.0625*scale)
this.scale(scale, scale, scale)
}
}
fun renderOnModel(
model: PosableModel,
item: ItemStack,
model: PosableModel,
state: PosableState,
poseStack: PoseStack,
buffer: MultiBufferSource,
rotation: Vec3 = Vec3(0.0,0.0,0.0),
light: Int = LightTexture.pack(11, 7),
frontLight: Boolean = false,
entity: LivingEntity? = null
) {
val locators: Map<String, MatrixWrapper> = state.locatorStates
if (state.itemRenderingLocations.isNotEmpty()) {
renderAnimationItem(model, state, locators, poseStack, buffer, light, null, rotation)
}
else if (!item.`is`(CobblemonItemTags.HIDDEN_ITEMS)) {
render(null, model, item, locators, poseStack, buffer, light, 0, rotation)
}
if (!item.`is`(CobblemonItemTags.HIDDEN_ITEMS)) renderAtLocator(item, model, state, entity, poseStack, buffer, light, 0, frontLight)
state.animationItems.forEach { (targetLocator, item) -> renderAtLocator(item, model, state, entity, poseStack, buffer, light, 0, frontLight, targetLocator) }
}
fun renderOnEntity(
entity: LivingEntity,
private fun renderAtLocator(
item: ItemStack,
model: PosableModel,
state: PosableState,
entity: LivingEntity?,
poseStack: PoseStack,
buffer: MultiBufferSource,
light: Int,
rotation: Vec3 = Vec3(0.0,0.0,0.0)
seed: Int,
frontLight: Boolean = false,
targetLocator: String =
if (item.`is`(WEARABLE_FACE_ITEMS) && state.locatorStates.containsKey(ITEM_FACE)) ITEM_FACE
else if (item.`is`(WEARABLE_HAT_ITEMS) && state.locatorStates.containsKey(ITEM_HAT)) ITEM_HAT
else ITEM
) {
val locators: Map<String, MatrixWrapper> = state.locatorStates
if (state.itemRenderingLocations.isNotEmpty()) {
renderAnimationItem(model, state, locators, poseStack, buffer, light, entity, rotation)
}
else {
render(entity, model, item, locators, poseStack, buffer, light, 0, rotation)
}
}
if (item.isEmpty) return
private fun applyContextTransformation(poseStack: PoseStack, rotation: Vec3) {
when (displayContext) {
ItemDisplayContext.FIXED -> {
poseStack.mulPose(Axis.XP.rotationDegrees(90.0f))
poseStack.scale(.5f, .5f, .5f )
poseStack.translate(0f, 0.01666f, 0f)
if (state.locatorStates.containsKey(targetLocator)) {
poseStack.pushPose()
RenderSystem.applyModelViewMatrix()
displayContext = model.getLocatorDisplayContext(targetLocator)?:
if ((item.`is`(WEARABLE_FACE_ITEMS) && targetLocator==ITEM_FACE) || (item.`is`(WEARABLE_HAT_ITEMS) && targetLocator== ITEM_HAT)) ItemDisplayContext.HEAD
else ItemDisplayContext.FIXED
poseStack.mulPose(state.locatorStates[targetLocator]!!.matrix)
when (displayContext) {
ItemDisplayContext.FIXED -> {
poseStack.setOriginAndScale(0f,.5f,0f, .5f)
poseStack.mulPose(Axis.XP.rotationDegrees(90.0f))
}
ItemDisplayContext.THIRD_PERSON_RIGHT_HAND, ItemDisplayContext.THIRD_PERSON_LEFT_HAND -> {
//For Minecraft player models
if (state is NPCClientDelegate) {
poseStack.mulPose(Axis.XP.rotationDegrees(-90.0F))
}
//for T-Posing Models
else if (state is PokemonClientDelegate || state is FloatingState) {
poseStack.mulPose(Axis.YP.rotationDegrees(-90.0F))
poseStack.mulPose(Axis.ZP.rotationDegrees(90.0F))
}
poseStack.translate(0.025f * if (displayContext==ItemDisplayContext.THIRD_PERSON_LEFT_HAND) 1 else -1 , 0.0f, 0.0f)
}
ItemDisplayContext.HEAD -> {
if (state is NPCClientDelegate) {
if (item.`is`(WEARABLE_FACE_ITEMS)) poseStack.setOriginAndScale(0f,-2f,7.25f, 0.62f)
else if (item.`is`(WEARABLE_HAT_ITEMS)) poseStack.setOriginAndScale(0f,-10.25f,0f, 0.62f)
}
else {
if (item.`is`(WEARABLE_FACE_ITEMS)) poseStack.setOriginAndScale(0f,1f,(7.25f)-.5f, 0.62f)
else if (item.`is`(WEARABLE_HAT_ITEMS)) poseStack.setOriginAndScale(0f,(-7.25f)+.5f,0f, 0.62f)
}
}
else -> {}
}
ItemDisplayContext.THIRD_PERSON_RIGHT_HAND, ItemDisplayContext.THIRD_PERSON_LEFT_HAND -> {
poseStack.mulPose(Axis.XP.rotationDegrees((rotation.x).toFloat()))
poseStack.mulPose(Axis.YP.rotationDegrees((rotation.y).toFloat()))
poseStack.mulPose(Axis.ZP.rotationDegrees((rotation.z).toFloat()))
poseStack.translate(0.025f * if (displayContext==ItemDisplayContext.THIRD_PERSON_LEFT_HAND) 1 else -1 , 0.0f, 0.0f)
//Render front lighting for UI Models
if (frontLight) {
RenderSystem.setShaderLights(Vector3f(0F,0F,1F), Vector3f(0F,0F,1F))
}
ItemDisplayContext.HEAD -> {
poseStack.mulPose(Axis.XP.rotationDegrees(90.0f))
poseStack.scale(.6f, .6f, .6f)
poseStack.translate(0f, -0.6f, 0f)
}
else -> {}
itemRenderer.renderStatic(entity, item, displayContext, (displayContext==ItemDisplayContext.THIRD_PERSON_LEFT_HAND), poseStack, buffer, null, light, OverlayTexture.NO_OVERLAY, seed)
poseStack.popPose()
}
}
}
@@ -37,7 +37,6 @@ import net.minecraft.nbt.Tag
import net.minecraft.resources.ResourceLocation
import net.minecraft.world.entity.player.Player
import net.minecraft.world.item.ItemStack
import net.minecraft.world.phys.Vec3
class PokemonOnShoulderRenderer<T : Player>(renderLayerParent: RenderLayerParent<T, PlayerModel<T>>) : RenderLayer<T, PlayerModel<T>>(renderLayerParent) {
@@ -162,12 +161,12 @@ class PokemonOnShoulderRenderer<T : Player>(renderLayerParent: RenderLayerParent
}
heldItemRenderer.renderOnModel(
model,
shoulderData.shownItem,
model,
state,
matrixStack,
buffer,
Vec3(0.0,-90.0,-90.0)
packedLight
)
model.setDefault()
@@ -8,10 +8,8 @@
package com.cobblemon.mod.common.client.render.models.blockbench
import com.cobblemon.mod.common.client.entity.PokemonClientDelegate
import com.cobblemon.mod.common.client.render.models.blockbench.repository.RenderContext
import com.cobblemon.mod.common.entity.PosableEntity
import com.cobblemon.mod.common.entity.pokemon.PokemonEntity
import net.minecraft.client.renderer.texture.OverlayTexture
import net.minecraft.client.renderer.RenderType
import com.mojang.blaze3d.vertex.VertexConsumer
@@ -36,7 +34,6 @@ abstract class PosableEntityModel<T : Entity>(
val context: RenderContext = RenderContext().also {
it.put(RenderContext.RENDER_STATE, RenderContext.RenderState.WORLD)
}
lateinit var posableModel: PosableModel
override fun renderToBuffer(
@@ -79,11 +76,25 @@ abstract class PosableEntityModel<T : Entity>(
) {
setupEntityTypeContext(entity)
if (entity is PosableEntity) {
val state = entity.delegate as PosableState
posableModel.applyAnimations(entity, state, limbSwing, limbSwingAmount, ageInTicks, headYaw, headPitch)
val ticks = getTicksForAnimation(entity, limbSwing, limbSwingAmount, ageInTicks, headYaw, headPitch)
posableModel.applyAnimations(entity, entity.delegate as PosableState, limbSwing, limbSwingAmount, ticks, headYaw, headPitch)
}
}
/**
* This is to support cases where the ageInTicks value that should go to the animator is not the same as the entity's
* normal value. This can happen in the case of riding where it has been rendered in a different part of the pipeline
* and we want to prevent stuttering / re-render it for a specific moment.
*/
open fun getTicksForAnimation(
entity: T,
limbSwing: Float,
limbSwingAmount: Float,
ageInTicks: Float,
headYaw: Float,
headPitch: Float
): Float = ageInTicks
open fun setupEntityTypeContext(entity: Entity?) {
entity?.let {
context.put(RenderContext.ENTITY, entity)
@@ -92,4 +103,4 @@ abstract class PosableEntityModel<T : Entity>(
}
}
}
}
}
@@ -40,7 +40,6 @@ import com.cobblemon.mod.common.entity.npc.NPCEntity
import com.cobblemon.mod.common.entity.pokeball.EmptyPokeBallEntity
import com.cobblemon.mod.common.entity.pokemon.PokemonEntity
import com.cobblemon.mod.common.util.asExpressionLike
import com.cobblemon.mod.common.util.cobblemonResource
import com.cobblemon.mod.common.util.plus
import com.cobblemon.mod.common.util.toRGBA
import com.mojang.blaze3d.systems.RenderSystem
@@ -51,7 +50,6 @@ import com.mojang.blaze3d.vertex.VertexFormat
import com.mojang.math.Axis
import net.minecraft.client.Minecraft
import net.minecraft.client.model.geom.ModelPart
import net.minecraft.client.player.RemotePlayer
import net.minecraft.client.renderer.MultiBufferSource
import net.minecraft.client.renderer.RenderStateShard
import net.minecraft.client.renderer.RenderType
@@ -59,7 +57,6 @@ import net.minecraft.client.renderer.texture.DynamicTexture
import net.minecraft.resources.ResourceLocation
import net.minecraft.util.Mth
import net.minecraft.world.entity.Entity
import net.minecraft.world.entity.LivingEntity
import net.minecraft.world.item.ItemDisplayContext
import net.minecraft.world.phys.Vec3
import org.joml.Matrix4f
@@ -96,6 +93,9 @@ open class PosableModel(@Transient override val rootPart: Bone) : ModelFrame {
open var profileScale = 1F
/** Used for third person riding camera */
open var seatToCameraOffset = mutableMapOf<String, Vec3>()
/**
* These are open-ended properties that can be used to store miscellaneous properties about the model.
*
@@ -733,14 +733,8 @@ open class PosableModel(@Transient override val rootPart: Bone) : ModelFrame {
transformationMatrix.rotate(controller.getRenderOrientation(state.getPartialTicks()))
transformationMatrix.translate(center.negate())
matrixStack.mulPose(transformationMatrix)
} else if( entity.passengers.isNotEmpty()) {
// rotate a ridden but non rollable pokemon correctly
val driver = entity.controllingPassenger ?: entity
var yRot = Mth.lerp(state.getPartialTicks(), driver.yRotO, driver.yRot)
yRot = Mth.wrapDegrees(yRot)
matrixStack.mulPose(Axis.YP.rotationDegrees(180 - yRot))
} else {
var yRot = Mth.lerp(state.getPartialTicks(), entity.yRotO, entity.yRot)
var yRot = Mth.lerp(state.getPartialTicks(), entity.yBodyRotO, entity.yBodyRot)
yRot = Mth.wrapDegrees(yRot)
matrixStack.mulPose(Axis.YP.rotationDegrees(180 - yRot))
}
@@ -833,4 +827,6 @@ open class PosableModel(@Transient override val rootPart: Bone) : ModelFrame {
condition = condition,
animations = { animations(it) }
)
fun isReadyForAnimation() = ::context.isInitialized
}
@@ -37,6 +37,7 @@ import com.cobblemon.mod.common.entity.PosableEntity
import com.cobblemon.mod.common.entity.PoseType
import com.cobblemon.mod.common.util.asIdentifierDefaultingNamespace
import com.mojang.brigadier.StringReader
import com.mojang.brigadier.exceptions.CommandSyntaxException
import net.minecraft.client.Minecraft
import net.minecraft.client.multiplayer.ClientLevel
import net.minecraft.client.resources.sounds.SimpleSoundInstance
@@ -46,7 +47,6 @@ import net.minecraft.sounds.SoundSource
import net.minecraft.world.entity.Entity
import net.minecraft.world.item.ItemStack
import net.minecraft.world.phys.Vec3
import org.joml.Matrix4f
import java.util.*
import java.util.concurrent.ConcurrentLinkedQueue
@@ -128,9 +128,8 @@ abstract class PosableState : Schedulable {
/** This gets called 500 million times so use a mutable value for runtime */
private val reusableAnimTime = DoubleValue(0.0)
val itemRenderingLocations = mutableMapOf<String, ItemStack>()
// var itemRenderingLocation = ""
// var animationItem : ItemStack? = null
/** A list of items to be rendered on a PosableModel during an animation */
val animationItems = mutableMapOf<String, ItemStack>()
/** All of the MoLang functions that can be applied to something with this state. */
val functions = QueryStruct(hashMapOf())
@@ -159,21 +158,27 @@ abstract class PosableState : Schedulable {
.addFunction("render_item") { params ->
if (params.get<MoValue>(0) !is StringValue) return@addFunction Unit
val client = Minecraft.getInstance().connection ?: return@addFunction Unit
val result = ItemParser(client.registryAccess()).parse(StringReader(params.getString(0)))
val item = ItemStack(result.item)
item.applyComponents(result.components)
val item: ItemStack
try {
val client = Minecraft.getInstance().connection ?: return@addFunction Unit
val result = ItemParser(client.registryAccess()).parse(StringReader(params.getString(0)))
item = ItemStack(result.item)
item.applyComponents(result.components)
}
catch (_: CommandSyntaxException) {
return@addFunction Unit
}
val renderLocation = if (params.contains(1)) params.getString(1) else "item"
if (!item.isEmpty && locatorStates.containsKey(renderLocation)) {
itemRenderingLocations.put(renderLocation, item)
animationItems.put(renderLocation, item)
} else {
if (itemRenderingLocations.containsKey(renderLocation)) itemRenderingLocations.remove(renderLocation)
if (animationItems.containsKey(renderLocation)) animationItems.remove(renderLocation)
return@addFunction Unit
}
}
.addFunction("clear_items") { itemRenderingLocations.clear() }
.addFunction("clear_items") { animationItems.clear() }
.addFunction("play_animation") { params ->
val animationParameter = params.get<MoValue>(0)
val animation = if (animationParameter is ObjectValue<*>) {
@@ -8,12 +8,16 @@
package com.cobblemon.mod.common.client.render.models.blockbench.pokemon
import com.cobblemon.mod.common.client.MountedPokemonAnimationRenderController
import com.cobblemon.mod.common.client.entity.PokemonClientDelegate
import com.cobblemon.mod.common.client.render.models.blockbench.PosableEntityModel
import com.cobblemon.mod.common.client.render.models.blockbench.PosableState
import com.cobblemon.mod.common.client.render.models.blockbench.repository.RenderContext
import com.cobblemon.mod.common.client.render.models.blockbench.repository.VaryingModelRepository
import com.cobblemon.mod.common.entity.pokemon.PokemonEntity
import net.minecraft.util.Mth
import net.minecraft.world.entity.Entity
import net.minecraft.world.phys.Vec3
class PosablePokemonEntityModel : PosableEntityModel<PokemonEntity>() {
override fun setupEntityTypeContext(entity: Entity?) {
@@ -26,4 +30,28 @@ class PosablePokemonEntityModel : PosableEntityModel<PokemonEntity>() {
.let { texture -> context.put(RenderContext.TEXTURE, texture) }
}
}
// TODO: This is a bit of a hack, but it works for now. We should find a better way to do this.
override fun getTicksForAnimation(
entity: PokemonEntity,
limbSwing: Float,
limbSwingAmount: Float,
ageInTicks: Float,
headYaw: Float,
headPitch: Float
): Float {
val delegate = entity.delegate as? PosableState
val forcedTick = MountedPokemonAnimationRenderController.getPartialTick(entity)
if (entity.passengers.isEmpty() || delegate == null || forcedTick == null) {
return ageInTicks
}
delegate.updatePartialTicks(forcedTick)
val entityPos = Vec3(
Mth.lerp(forcedTick.toDouble(), entity.xOld, entity.x),
Mth.lerp(forcedTick.toDouble(), entity.yOld, entity.y),
Mth.lerp(forcedTick.toDouble(), entity.zOld, entity.z)
)
delegate.updateLocatorPosition(entityPos)
return forcedTick
}
}
@@ -1,98 +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.createTransformation
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.ModelPartTransformation.Companion.X_AXIS
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 net.minecraft.client.model.geom.ModelPart
import net.minecraft.world.phys.Vec3
class EeveeModel(root: ModelPart) : PokemonPosableModel(root), HeadedFrame, QuadrupedFrame {
override val rootPart = root.registerChildWithAllChildren("eevee")
val body = getPart("body")
override val head = getPart("head")
override val hindRightLeg = getPart("leg_back_right")
override val hindLeftLeg = getPart("leg_back_left")
override val foreRightLeg = getPart("leg_front_right")
override val foreLeftLeg= getPart("leg_front_left")
override var portraitScale = 2.2F
override var portraitTranslation = Vec3(-0.4, -0.54, 0.0)
override var profileScale = 0.8F
override var profileTranslation = Vec3(0.0, 0.55, 0.0)
lateinit var stand: Pose
lateinit var walk: Pose
lateinit var shoulderLeft: Pose
lateinit var shoulderRight: Pose
override val cryAnimation = CryProvider { bedrockStateful("eevee", "cry") }
val shoulderOffset = 4
override fun registerPoses() {
val blink = quirk { bedrockStateful("eevee", "blink") }
stand = registerPose(
poseName = "standing",
poseTypes = STATIONARY_POSES + UI_POSES,
transformTicks = 10,
quirks = arrayOf(blink),
animations = arrayOf(
singleBoneLook(),
bedrock("eevee", "ground_idle")
)
)
walk = registerPose(
poseName = "walk",
poseTypes = MOVING_POSES,
transformTicks = 10,
quirks = arrayOf(blink),
animations = arrayOf(
singleBoneLook(),
bedrock("eevee", "ground_walk")
)
)
shoulderLeft = registerPose(
poseType = PoseType.SHOULDER_LEFT,
quirks = arrayOf(blink),
animations = arrayOf(
singleBoneLook(),
bedrock("eevee", "ground_idle")
),
transformedParts = arrayOf(
rootPart.createTransformation().addPosition(X_AXIS, shoulderOffset)
)
)
shoulderRight = registerPose(
poseType = PoseType.SHOULDER_RIGHT,
quirks = arrayOf(blink),
animations = arrayOf(
singleBoneLook(),
bedrock("eevee", "ground_idle")
),
transformedParts = arrayOf(
rootPart.createTransformation().addPosition(X_AXIS, -shoulderOffset)
)
)
}
}
@@ -1,62 +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.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.Companion.MOVING_POSES
import com.cobblemon.mod.common.entity.PoseType.Companion.STATIONARY_POSES
import com.cobblemon.mod.common.entity.PoseType.Companion.UI_POSES
import net.minecraft.client.model.geom.ModelPart
import net.minecraft.world.phys.Vec3
class FlareonModel(root: ModelPart) : PokemonPosableModel(root), HeadedFrame {
override val rootPart = root.registerChildWithAllChildren("flareon")
override val head = getPart("head")
override var portraitScale = 2.2F
override var portraitTranslation = Vec3(-0.6, -0.45, 0.0)
override var profileScale = 0.9F
override var profileTranslation = Vec3(0.0, 0.36, 0.0)
lateinit var standing: Pose
lateinit var walk: Pose
override val cryAnimation = CryProvider { bedrockStateful("flareon", "cry") }
override fun registerPoses() {
standing = registerPose(
poseName = "standing",
poseTypes = STATIONARY_POSES + UI_POSES,
transformTicks = 10,
animations = arrayOf(
singleBoneLook(),
bedrock("flareon", "ground_idle")
)
)
walk = registerPose(
poseName = "walk",
poseTypes = MOVING_POSES,
transformTicks = 10,
animations = arrayOf(
singleBoneLook(),
bedrock("flareon", "ground_run")
)
)
}
// override fun getFaintAnimation(
// pokemonEntity: PokemonEntity,
// state: PosableState<PokemonEntity>
// ) = if (state.isPosedIn(standing, walk)) bedrockStateful("flareon", "faint") else null
}
@@ -1,62 +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.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.Companion.MOVING_POSES
import com.cobblemon.mod.common.entity.PoseType.Companion.STATIONARY_POSES
import com.cobblemon.mod.common.entity.PoseType.Companion.UI_POSES
import net.minecraft.client.model.geom.ModelPart
import net.minecraft.world.phys.Vec3
class JolteonModel(root: ModelPart) : PokemonPosableModel(root), HeadedFrame {
override val rootPart = root.registerChildWithAllChildren("jolteon")
override val head = getPart("head")
override var portraitScale = 2.3F
override var portraitTranslation = Vec3(-0.55, -0.6, 0.0)
override var profileScale = 1.0F
override var profileTranslation = Vec3(0.0, 0.2, 0.0)
lateinit var standing: Pose
lateinit var walk: Pose
override val cryAnimation = CryProvider { bedrockStateful("jolteon", "cry") }
override fun registerPoses() {
standing = registerPose(
poseName = "standing",
poseTypes = STATIONARY_POSES + UI_POSES,
transformTicks = 10,
animations = arrayOf(
singleBoneLook(),
bedrock("jolteon", "ground_idle")
)
)
walk = registerPose(
poseName = "walk",
poseTypes = MOVING_POSES,
transformTicks = 10,
animations = arrayOf(
singleBoneLook(),
bedrock("jolteon", "ground_run")
)
)
}
// override fun getFaintAnimation(
// pokemonEntity: PokemonEntity,
// state: PosableState<PokemonEntity>
// ) = if (state.isPosedIn(standing, walk)) bedrockStateful("jolteon", "faint") else null
}
@@ -1,129 +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.animation.BipedWalkAnimation
import com.cobblemon.mod.common.client.render.models.blockbench.createTransformation
import com.cobblemon.mod.common.client.render.models.blockbench.frame.BipedFrame
import com.cobblemon.mod.common.client.render.models.blockbench.frame.HeadedFrame
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.UI_POSES
import net.minecraft.client.model.geom.ModelPart
import net.minecraft.world.phys.Vec3
class PidgeotModel(root: ModelPart) : PokemonPosableModel(root), HeadedFrame, BipedFrame {
override val rootPart = root.registerChildWithAllChildren("pidgeot")
override val leftLeg = getPart("leg_left")
override val rightLeg = getPart("leg_right")
override val head = getPart("neck")
private val wingOpenRight = getPart("wing_open_right")
private val wingOpenLeft = getPart("wing_open_left")
private val wingClosedRight = getPart("wing_closed_right")
private val wingClosedLeft = getPart("wing_closed_left")
override var portraitScale = 2.2F
override var portraitTranslation = Vec3(-0.6, 0.15, 0.0)
override var profileScale = 0.9F
override var profileTranslation = Vec3(0.0, 0.4, 0.0)
// lateinit var sleep: CobblemonPose
lateinit var stand: CobblemonPose
lateinit var walk: CobblemonPose
lateinit var hover: CobblemonPose
lateinit var fly: CobblemonPose
override val cryAnimation = CryProvider { bedrockStateful("pidgeot", "cry") }
override fun registerPoses() {
val blink = quirk { bedrockStateful("pidgeot", "blink")}
val flyQuirk1 = quirk { bedrockStateful("pidgeot", "air_fly_quirk") }
val flyQuirk2 = quirk { bedrockStateful("pidgeot", "air_fly_quirk2") }
// sleep = registerPose(
// poseName = "sleeping",
// transformedParts = arrayOf(
// wingClosedLeft.createTransformation().withVisibility(visibility = true),
// wingClosedRight.createTransformation().withVisibility(visibility = true),
// wingOpenLeft.createTransformation().withVisibility(visibility = false),
// wingOpenRight.createTransformation().withVisibility(visibility = false)
// ),
// poseType = PoseType.SLEEP,
// animations = arrayOf(bedrock("pidgeot", "sleep"))
// )
stand = registerPose(
poseName = "stand",
transformedParts = arrayOf(
wingClosedLeft.createTransformation().withVisibility(visibility = true),
wingClosedRight.createTransformation().withVisibility(visibility = true),
wingOpenLeft.createTransformation().withVisibility(visibility = false),
wingOpenRight.createTransformation().withVisibility(visibility = false)
),
poseTypes = PoseType.STATIONARY_POSES - PoseType.HOVER - PoseType.FLOAT + UI_POSES,
quirks = arrayOf(blink),
animations = arrayOf(
singleBoneLook(),
bedrock("pidgeot", "ground_idle_PLACEHOLDER"),
)
)
walk = registerPose(
poseName = "walk",
transformedParts = arrayOf(
wingClosedLeft.createTransformation().withVisibility(visibility = true),
wingClosedRight.createTransformation().withVisibility(visibility = true),
wingOpenLeft.createTransformation().withVisibility(visibility = false),
wingOpenRight.createTransformation().withVisibility(visibility = false)
),
poseTypes = PoseType.MOVING_POSES - PoseType.FLY - PoseType.SWIM,
quirks = arrayOf(blink),
animations = arrayOf(
singleBoneLook(),
bedrock("pidgeot", "ground_idle_PLACEHOLDER"),
BipedWalkAnimation(this)
)
)
hover = registerPose(
poseName = "floating",
transformedParts = arrayOf(
wingClosedLeft.createTransformation().withVisibility(visibility = false),
wingClosedRight.createTransformation().withVisibility(visibility = false),
wingOpenLeft.createTransformation().withVisibility(visibility = true),
wingOpenRight.createTransformation().withVisibility(visibility = true)
),
poseTypes = setOf(PoseType.FLOAT, PoseType.HOVER),
quirks = arrayOf(blink),
animations = arrayOf(
singleBoneLook(),
bedrock("pidgeot", "air_idle")
)
)
fly = registerPose(
poseName = "flying",
transformedParts = arrayOf(
wingClosedLeft.createTransformation().withVisibility(visibility = false),
wingClosedRight.createTransformation().withVisibility(visibility = false),
wingOpenLeft.createTransformation().withVisibility(visibility = true),
wingOpenRight.createTransformation().withVisibility(visibility = true)
),
poseTypes = setOf(PoseType.FLY, PoseType.SWIM),
quirks = arrayOf(blink, flyQuirk1, flyQuirk2),
animations = arrayOf(
singleBoneLook(),
bedrock("pidgeot", "air_fly")
)
)
}
}
@@ -1,84 +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.PokemonPosableModel
import com.cobblemon.mod.common.client.render.models.blockbench.frame.HeadedFrame
import com.cobblemon.mod.common.client.render.models.blockbench.pokemon.CryProvider
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.STATIONARY_POSES
import com.cobblemon.mod.common.entity.PoseType.Companion.UI_POSES
import net.minecraft.client.model.geom.ModelPart
import net.minecraft.world.phys.Vec3
class VaporeonModel(root: ModelPart) : PokemonPosableModel(root), HeadedFrame {
override val rootPart = root.registerChildWithAllChildren("vaporeon")
override val head = getPart("head")
override var portraitScale = 2.2F
override var portraitTranslation = Vec3(-0.6, -0.58, 0.0)
override var profileScale = 0.9F
override var profileTranslation = Vec3(0.0, 0.35, 0.0)
lateinit var standing: Pose
lateinit var walk: Pose
lateinit var swimIdle: Pose
lateinit var swimMove: Pose
override val cryAnimation = CryProvider { bedrockStateful("vaporeon", "cry") }
override fun registerPoses() {
standing = registerPose(
poseName = "standing",
poseTypes = STATIONARY_POSES + UI_POSES - PoseType.FLOAT,
transformTicks = 10,
animations = arrayOf(
singleBoneLook(),
bedrock("vaporeon", "ground_idle")
)
)
walk = registerPose(
poseName = "walk",
poseTypes = setOf(PoseType.WALK),
transformTicks = 10,
animations = arrayOf(
singleBoneLook(),
bedrock("vaporeon", "ground_run")
)
)
swimIdle = registerPose(
poseName = "float",
poseTypes = setOf(PoseType.FLOAT),
transformTicks = 10,
animations = arrayOf(
singleBoneLook(),
bedrock("vaporeon", "water_idle")
)
)
swimMove = registerPose(
poseName = "swim",
poseTypes = setOf(PoseType.SWIM),
transformTicks = 10,
animations = arrayOf(
singleBoneLook(),
bedrock("vaporeon", "water_swim")
)
)
}
// override fun getFaintAnimation(
// pokemonEntity: PokemonEntity,
// state: PosableState<PokemonEntity>
// ) = if (state.isPosedIn(standing, walk)) bedrockStateful("vaporeon", "faint") else null
}
@@ -1,65 +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.gen2
import com.cobblemon.mod.common.client.render.models.blockbench.frame.HeadedFrame
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.Companion.MOVING_POSES
import com.cobblemon.mod.common.entity.PoseType.Companion.STATIONARY_POSES
import com.cobblemon.mod.common.entity.PoseType.Companion.UI_POSES
import net.minecraft.client.model.geom.ModelPart
import net.minecraft.world.phys.Vec3
class EspeonModel(root: ModelPart) : PokemonPosableModel(root), HeadedFrame {
override val rootPart = root.registerChildWithAllChildren("espeon")
override val head = getPart("head")
override var portraitScale = 2.15F
override var portraitTranslation = Vec3(-0.55, -0.43, 0.0)
override var profileScale = 0.81F
override var profileTranslation = Vec3(0.07, 0.59, 0.0)
lateinit var standing: Pose
lateinit var walk: Pose
override val cryAnimation = CryProvider { bedrockStateful("espeon", "cry") }
override fun registerPoses() {
val blink = quirk { bedrockStateful("espeon", "blink")}
standing = registerPose(
poseName = "standing",
poseTypes = STATIONARY_POSES + UI_POSES,
transformTicks = 10,
quirks = arrayOf(blink),
animations = arrayOf(
singleBoneLook(),
bedrock("espeon", "ground_idle")
)
)
walk = registerPose(
poseName = "walk",
poseTypes = MOVING_POSES,
transformTicks = 10,
quirks = arrayOf(blink),
animations = arrayOf(
singleBoneLook(),
bedrock("espeon", "ground_run")
)
)
}
// override fun getFaintAnimation(
// pokemonEntity: PokemonEntity,
// state: PosableState<PokemonEntity>
// ) = if (state.isPosedIn(standing, walk)) bedrockStateful("espeon", "faint") else null
}
@@ -1,65 +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.gen2
import com.cobblemon.mod.common.client.render.models.blockbench.frame.HeadedFrame
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.Companion.MOVING_POSES
import com.cobblemon.mod.common.entity.PoseType.Companion.STATIONARY_POSES
import com.cobblemon.mod.common.entity.PoseType.Companion.UI_POSES
import net.minecraft.client.model.geom.ModelPart
import net.minecraft.world.phys.Vec3
class UmbreonModel(root: ModelPart) : PokemonPosableModel(root), HeadedFrame {
override val rootPart = root.registerChildWithAllChildren("umbreon")
override val head = getPart("head")
override var portraitScale = 2.2F
override var portraitTranslation = Vec3(-0.6, -0.45, 0.0)
override var profileScale = 0.9F
override var profileTranslation = Vec3(0.0, 0.35, 0.0)
lateinit var standing: Pose
lateinit var walk: Pose
override val cryAnimation = CryProvider { bedrockStateful("umbreon", "cry") }
override fun registerPoses() {
val blink = quirk { bedrockStateful("umbreon", "blink")}
standing = registerPose(
poseName = "standing",
poseTypes = STATIONARY_POSES + UI_POSES,
transformTicks = 10,
quirks = arrayOf(blink),
animations = arrayOf(
singleBoneLook(),
bedrock("umbreon", "ground_idle")
)
)
walk = registerPose(
poseName = "walk",
poseTypes = MOVING_POSES,
transformTicks = 10,
quirks = arrayOf(blink),
animations = arrayOf(
singleBoneLook(),
bedrock("umbreon", "ground_run")
)
)
}
// override fun getFaintAnimation(
// pokemonEntity: PokemonEntity,
// state: PosableState<PokemonEntity>
// ) = if (state.isPosedIn(standing, walk)) bedrockStateful("umbreon", "faint") else null
}
@@ -1,72 +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.gen3
import com.cobblemon.mod.common.client.render.models.blockbench.animation.BipedWalkAnimation
import com.cobblemon.mod.common.client.render.models.blockbench.frame.BipedFrame
import com.cobblemon.mod.common.client.render.models.blockbench.frame.HeadedFrame
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 net.minecraft.client.model.geom.ModelPart
import net.minecraft.world.phys.Vec3
class GrovyleModel (root: ModelPart) : PokemonPosableModel(root), HeadedFrame, BipedFrame {
override val rootPart = root.registerChildWithAllChildren("grovyle")
override val head = getPart("head")
override val leftLeg = getPart("left_upper_leg")
override val rightLeg = getPart("right_upper_leg")
override var portraitScale = 2.31F
override var portraitTranslation = Vec3(-0.24, 1.29, 0.0)
override var profileScale = 0.66F
override var profileTranslation = Vec3(0.01, 0.87, 0.0)
//lateinit var sleep: CobblemonPose
lateinit var standing: CobblemonPose
lateinit var walk: CobblemonPose
override val cryAnimation = CryProvider { bedrockStateful("grovyle", "cry") }
override fun registerPoses() {
//sleep = registerPose(
// poseType = PoseType.SLEEP,
// animations = arrayOf(bedrock("grovyle", "sleep"))
//)
val blink = quirk { bedrockStateful("grovyle", "blink") }
standing = registerPose(
poseName = "standing",
poseTypes = PoseType.STATIONARY_POSES + PoseType.UI_POSES,
quirks = arrayOf(blink),
animations = arrayOf(
singleBoneLook(),
bedrock("grovyle", "ground_idle")
)
)
walk = registerPose(
poseName = "walk",
poseTypes = PoseType.MOVING_POSES,
quirks = arrayOf(blink),
animations = arrayOf(
singleBoneLook(),
bedrock("grovyle", "ground_idle"),
BipedWalkAnimation(this, periodMultiplier = 0.6F, amplitudeMultiplier = 0.9F)
)
)
}
//override fun getFaintAnimation(
// pokemonEntity: PokemonEntity,
// state: PosableState<PokemonEntity>
//) = if (state.isNotPosedIn(sleep)) bedrockStateful("grovyle", "faint") else null
}
@@ -1,95 +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.gen3
import com.cobblemon.mod.common.client.render.models.blockbench.pokemon.PokemonPosableModel
import com.cobblemon.mod.common.client.render.models.blockbench.pokemon.CryProvider
import com.cobblemon.mod.common.client.render.models.blockbench.pose.Pose
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 MetagrossModel (root: ModelPart) : PokemonPosableModel(root) {
override val rootPart = root.registerChildWithAllChildren("metagross")
override var portraitScale = 1.1F
override var portraitTranslation = Vec3(-0.45, 0.5, 0.0)
override var profileScale = 0.4F
override var profileTranslation = Vec3(0.0, 1.0, 0.0)
lateinit var standing: Pose
lateinit var walk: Pose
lateinit var hover: Pose
lateinit var fly: Pose
lateinit var sleep: Pose
lateinit var battleidle: Pose
override val cryAnimation = CryProvider { bedrockStateful("metagross", "cry") }
override fun registerPoses() {
val blink = quirk { bedrockStateful("metagross", "blink")}
sleep = registerPose(
poseType = PoseType.SLEEP,
animations = arrayOf(bedrock("metagross", "sleep"))
)
standing = registerPose(
poseName = "stand",
poseTypes = PoseType.STATIONARY_POSES - PoseType.HOVER - PoseType.FLOAT + PoseType.UI_POSES,
condition = { !it.isBattling },
transformTicks = 10,
quirks = arrayOf(blink),
animations = arrayOf(
bedrock("metagross", "ground_idle")
)
)
hover = registerPose(
poseName = "hover",
poseTypes = setOf(PoseType.HOVER, PoseType.FLOAT),
quirks = arrayOf(blink),
animations = arrayOf(
bedrock("metagross", "air_idle")
)
)
fly = registerPose(
poseName = "fly",
poseTypes = setOf(PoseType.FLY, PoseType.SWIM),
quirks = arrayOf(blink),
animations = arrayOf(
bedrock("metagross", "air_fly")
)
)
walk = registerPose(
poseName = "walk",
poseTypes = PoseType.MOVING_POSES - PoseType.FLY - PoseType.SWIM,
transformTicks = 5,
quirks = arrayOf(blink),
animations = arrayOf(
bedrock("metagross", "ground_walk")
)
)
battleidle = registerPose(
poseName = "battle_idle",
poseTypes = PoseType.STATIONARY_POSES,
transformTicks = 10,
quirks = arrayOf(blink),
condition = { it.isBattling },
animations = arrayOf(
bedrock("metagross", "battle_idle")
)
)
}
// override fun getFaintAnimation(
// pokemonEntity: PokemonEntity,
// state: PosableState<PokemonEntity>
// ) = if (state.isPosedIn(standing, walk)) bedrockStateful("metagross", "faint") else null
}
@@ -1,62 +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.gen3
import com.cobblemon.mod.common.client.render.models.blockbench.pokemon.PokemonPosableModel
import com.cobblemon.mod.common.client.render.models.blockbench.PosableState
import com.cobblemon.mod.common.client.render.models.blockbench.frame.BipedFrame
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.STATIONARY_POSES
import com.cobblemon.mod.common.entity.PoseType.Companion.UI_POSES
import net.minecraft.client.model.geom.ModelPart
import net.minecraft.world.phys.Vec3
class NosepassModel(root: ModelPart) : PokemonPosableModel(root), BipedFrame {
override val rootPart = root.registerChildWithAllChildren("nosepass")
override val leftLeg = getPart("leg_left")
override val rightLeg = getPart("leg_right")
override var portraitScale = 1.5F
override var portraitTranslation = Vec3(-0.1, -0.1, 0.0)
override var profileScale = 0.75F
override var profileTranslation = Vec3(0.0, 0.65, 0.0)
lateinit var sleep: Pose
lateinit var standing: Pose
lateinit var walk: Pose
override fun registerPoses() {
sleep = registerPose(
poseType = PoseType.SLEEP,
animations = arrayOf(bedrock("nosepass", "sleep"))
)
standing = registerPose(
poseName = "standing",
poseTypes = STATIONARY_POSES + UI_POSES,
animations = arrayOf(
bedrock("nosepass", "ground_idle")
)
)
walk = registerPose(
poseName = "walk",
poseTypes = PoseType.MOVING_POSES,
animations = arrayOf(
bedrock("nosepass", "ground_walk"),
)
)
}
override fun getFaintAnimation(state: PosableState) = if (state.isNotPosedIn(sleep)) bedrockStateful("nosepass", "faint") else null
}
@@ -1,72 +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.gen3
import com.cobblemon.mod.common.client.render.models.blockbench.animation.BipedWalkAnimation
import com.cobblemon.mod.common.client.render.models.blockbench.frame.BipedFrame
import com.cobblemon.mod.common.client.render.models.blockbench.frame.HeadedFrame
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 net.minecraft.client.model.geom.ModelPart
import net.minecraft.world.phys.Vec3
class SceptileModel (root: ModelPart) : PokemonPosableModel(root), HeadedFrame, BipedFrame {
override val rootPart = root.registerChildWithAllChildren("sceptile")
override val head = getPart("head")
override val leftLeg = getPart("left_upper_leg")
override val rightLeg = getPart("right_upper_leg")
override var portraitScale = 2.34F
override var portraitTranslation = Vec3(-0.25, 2.22, 0.0)
override var profileScale = 0.63F
override var profileTranslation = Vec3(0.06, 0.91, 0.0)
lateinit var sleep: CobblemonPose
lateinit var standing: CobblemonPose
lateinit var walk: CobblemonPose
override val cryAnimation = CryProvider { bedrockStateful("sceptile", "cry") }
override fun registerPoses() {
// sleep = registerPose(
// poseType = PoseType.SLEEP,
// animations = arrayOf(bedrock("sceptile", "sleep"))
// )
val blink = quirk { bedrockStateful("sceptile", "blink") }
standing = registerPose(
poseName = "standing",
poseTypes = PoseType.STATIONARY_POSES + PoseType.UI_POSES,
quirks = arrayOf(blink),
animations = arrayOf(
singleBoneLook(),
bedrock("sceptile", "ground_idle")
)
)
walk = registerPose(
poseName = "walk",
poseTypes = PoseType.MOVING_POSES,
quirks = arrayOf(blink),
animations = arrayOf(
singleBoneLook(),
bedrock("sceptile", "ground_idle"),
BipedWalkAnimation(this, periodMultiplier = 0.6F, amplitudeMultiplier = 0.9F)
)
)
}
//override fun getFaintAnimation(
// pokemonEntity: PokemonEntity,
// state: PosableState<PokemonEntity>
//) = if (state.isNotPosedIn(sleep)) bedrockStateful("sceptile", "faint") else null
}
@@ -1,66 +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.gen3
import com.cobblemon.mod.common.client.render.models.blockbench.frame.HeadedFrame
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 net.minecraft.client.model.geom.ModelPart
import net.minecraft.world.phys.Vec3
class TreeckoModel (root: ModelPart) : PokemonPosableModel(root), HeadedFrame {
override val rootPart = root.registerChildWithAllChildren("treecko")
override val head = getPart("head")
override var portraitScale = 2.25F
override var portraitTranslation = Vec3(0.02, 0.12, 0.0)
override var profileScale = 0.74F
override var profileTranslation = Vec3(0.0, 0.6, 0.0)
lateinit var sleep: CobblemonPose
lateinit var standing: CobblemonPose
lateinit var walk: CobblemonPose
override val cryAnimation = CryProvider { bedrockStateful("treecko", "cry") }
override fun registerPoses() {
//sleep = registerPose(
// poseType = PoseType.SLEEP,
// animations = arrayOf(bedrock("treecko", "sleep"))
//)
val blink = quirk { bedrockStateful("treecko", "blink") }
standing = registerPose(
poseName = "standing",
poseTypes = PoseType.STATIONARY_POSES + PoseType.UI_POSES + PoseType.SLEEP,
quirks = arrayOf(blink),
animations = arrayOf(
singleBoneLook(),
bedrock("treecko", "ground_idle")
)
)
walk = registerPose(
poseName = "walk",
poseTypes = PoseType.MOVING_POSES,
quirks = arrayOf(blink),
animations = arrayOf(
singleBoneLook(),
bedrock("treecko", "ground_walk"),
)
)
}
//override fun getFaintAnimation(
// pokemonEntity: PokemonEntity,
// state: PosableState<PokemonEntity>
//) = if (state.isNotPosedIn(sleep)) bedrockStateful("treecko", "faint") else null
}
@@ -1,66 +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.gen3
import com.cobblemon.mod.common.client.render.models.blockbench.animation.QuadrupedWalkAnimation
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 net.minecraft.client.model.geom.ModelPart
import net.minecraft.world.phys.Vec3
class TropiusModel (root: ModelPart) : PokemonPosableModel(root), HeadedFrame, QuadrupedFrame {
override val rootPart = root.registerChildWithAllChildren("tropius")
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.31F
override var portraitTranslation = Vec3(-1.23, 5.01, 0.0)
override var profileScale = 0.28F
override var profileTranslation = Vec3(0.0, 1.26, 0.0)
lateinit var standing: CobblemonPose
lateinit var walk: CobblemonPose
override val cryAnimation = CryProvider { bedrockStateful("tropius", "cry") }
override fun registerPoses() {
val blink = quirk { bedrockStateful("tropius", "blink") }
standing = registerPose(
poseName = "standing",
poseTypes = PoseType.STATIONARY_POSES + PoseType.UI_POSES,
transformTicks = 10,
quirks = arrayOf(blink),
animations = arrayOf(
singleBoneLook(),
bedrock("tropius", "ground_idle")
)
)
walk = registerPose(
poseName = "walk",
poseTypes = PoseType.MOVING_POSES,
transformTicks = 10,
quirks = arrayOf(blink),
animations = arrayOf(
singleBoneLook(),
bedrock("tropius", "ground_idle"),
QuadrupedWalkAnimation(this, periodMultiplier = 0.7F, amplitudeMultiplier = 0.7F)
)
)
}
}
@@ -1,65 +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.gen4
import com.cobblemon.mod.common.client.render.models.blockbench.frame.HeadedFrame
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.Companion.MOVING_POSES
import com.cobblemon.mod.common.entity.PoseType.Companion.STATIONARY_POSES
import com.cobblemon.mod.common.entity.PoseType.Companion.UI_POSES
import net.minecraft.client.model.geom.ModelPart
import net.minecraft.world.phys.Vec3
class GlaceonModel(root: ModelPart) : PokemonPosableModel(root), HeadedFrame {
override val rootPart = root.registerChildWithAllChildren("glaceon")
override val head = getPart("head")
override var portraitScale = 2.4F
override var portraitTranslation = Vec3(-0.7, -0.75, 0.0)
override var profileScale = 0.9F
override var profileTranslation = Vec3(0.0, 0.35, 0.0)
lateinit var standing: Pose
lateinit var walk: Pose
override val cryAnimation = CryProvider { bedrockStateful("glaceon", "cry") }
override fun registerPoses() {
// val blink = quirk { bedrockStateful("glaceon", "blink")}
standing = registerPose(
poseName = "standing",
poseTypes = STATIONARY_POSES + UI_POSES,
transformTicks = 10,
// quirks = arrayOf(blink),
animations = arrayOf(
singleBoneLook(),
bedrock("glaceon", "ground_idle")
)
)
walk = registerPose(
poseName = "walk",
poseTypes = MOVING_POSES,
transformTicks = 10,
// quirks = arrayOf(blink),
animations = arrayOf(
singleBoneLook(),
bedrock("glaceon", "ground_run")
)
)
}
// override fun getFaintAnimation(
// pokemonEntity: PokemonEntity,
// state: PosableState<PokemonEntity>
// ) = if (state.isPosedIn(standing, walk)) bedrockStateful("glaceon", "faint") else null
}
@@ -1,106 +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.gen4
import com.cobblemon.mod.common.client.render.models.blockbench.animation.BipedWalkAnimation
import com.cobblemon.mod.common.client.render.models.blockbench.animation.WingFlapIdleAnimation
import com.cobblemon.mod.common.client.render.models.blockbench.frame.BiWingedFrame
import com.cobblemon.mod.common.client.render.models.blockbench.frame.BipedFrame
import com.cobblemon.mod.common.client.render.models.blockbench.frame.HeadedFrame
import com.cobblemon.mod.common.client.render.models.blockbench.pokemon.PokemonPosableModel
import com.cobblemon.mod.common.client.render.models.blockbench.pose.ModelPartTransformation
import com.cobblemon.mod.common.client.render.models.blockbench.pose.Pose
import com.cobblemon.mod.common.client.render.models.blockbench.wavefunction.sineFunction
import com.cobblemon.mod.common.entity.PoseType
import com.cobblemon.mod.common.util.math.geometry.toRadians
import net.minecraft.client.model.geom.ModelPart
import net.minecraft.world.phys.Vec3
class HonchkrowModel(root: ModelPart) : PokemonPosableModel(root), HeadedFrame, BipedFrame, BiWingedFrame {
override val rootPart = root.registerChildWithAllChildren("honchkrow")
override val head = getPart("head")
override val leftLeg = getPart("leg_left")
override val rightLeg = getPart("leg_right")
override val leftWing = getPart("wing_left")
override val rightWing = getPart("wing_right")
override var portraitScale = 3.4F
override var portraitTranslation = Vec3(-0.35, -1.2, 0.0)
override var profileScale = 1.2F
override var profileTranslation = Vec3(0.0, -0.05, 0.0)
lateinit var standing: Pose
lateinit var walk: Pose
lateinit var sleep: Pose
lateinit var hover: Pose
lateinit var fly: Pose
override fun registerPoses() {
val blink = quirk { bedrockStateful("honchkrow", "blink") }
sleep = registerPose(
poseType = PoseType.SLEEP,
animations = arrayOf(
bedrock("honchkrow", "sleep")
)
)
standing = registerPose(
poseName = "standing",
poseTypes = PoseType.STATIONARY_POSES + PoseType.UI_POSES,
quirks = arrayOf(blink), animations = arrayOf(
singleBoneLook(),
bedrock("honchkrow", "ground_idle")
)
)
walk = registerPose(
poseName = "walk",
poseTypes = PoseType.MOVING_POSES,
quirks = arrayOf(blink), animations = arrayOf(
singleBoneLook(),
bedrock("honchkrow", "ground_idle"),
BipedWalkAnimation(this, amplitudeMultiplier = 0.8F, periodMultiplier = 0.7F)
// bedrock("honchkrow", "ground_walk")
)
)
hover = registerPose(
poseName = "hover",
poseType = PoseType.HOVER,
transformTicks = 10,
quirks = arrayOf(blink),
animations = arrayOf(
singleBoneLook(),
bedrock("honchkrow", "air_idle"),
WingFlapIdleAnimation(this,
flapFunction = sineFunction(verticalShift = -10F.toRadians(), period = 0.9F, amplitude = 0.6F),
timeVariable = { state, _, _ -> state.animationSeconds },
axis = ModelPartTransformation.Z_AXIS
)
)
)
fly = registerPose(
poseName = "fly",
poseType = PoseType.FLY,
transformTicks = 10,
quirks = arrayOf(blink),
animations = arrayOf(
singleBoneLook(),
bedrock("honchkrow", "air_fly"),
WingFlapIdleAnimation(this,
flapFunction = sineFunction(verticalShift = -14F.toRadians(), period = 0.9F, amplitude = 0.9F),
timeVariable = { state, _, _ -> state.animationSeconds },
axis = ModelPartTransformation.Z_AXIS
)
)
)
}
}
@@ -1,65 +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.gen4
import com.cobblemon.mod.common.client.render.models.blockbench.pokemon.PokemonPosableModel
import com.cobblemon.mod.common.client.render.models.blockbench.frame.HeadedFrame
import com.cobblemon.mod.common.client.render.models.blockbench.pokemon.CryProvider
import com.cobblemon.mod.common.client.render.models.blockbench.pose.Pose
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 net.minecraft.client.model.geom.ModelPart
import net.minecraft.world.phys.Vec3
class LeafeonModel(root: ModelPart) : PokemonPosableModel(root), HeadedFrame {
override val rootPart = root.registerChildWithAllChildren("leafeon")
override val head = getPart("head")
override var portraitScale = 2.3F
override var portraitTranslation = Vec3(-0.7, -0.7, 0.0)
override var profileScale = 0.9F
override var profileTranslation = Vec3(0.0, 0.35, 0.0)
lateinit var standing: Pose
lateinit var walk: Pose
override val cryAnimation = CryProvider { bedrockStateful("leafeon", "cry") }
override fun registerPoses() {
// val blink = quirk { bedrockStateful("leafeon", "blink")}
standing = registerPose(
poseName = "standing",
poseTypes = STATIONARY_POSES + UI_POSES,
transformTicks = 10,
// quirks = arrayOf(blink),
animations = arrayOf(
singleBoneLook(),
bedrock("leafeon", "ground_idle")
)
)
walk = registerPose(
poseName = "walk",
poseTypes = MOVING_POSES,
transformTicks = 10,
// quirks = arrayOf(blink),
animations = arrayOf(
singleBoneLook(),
bedrock("leafeon", "ground_run")
)
)
}
// override fun getFaintAnimation(
// pokemonEntity: PokemonEntity,
// state: PosableState<PokemonEntity>
// ) = if (state.isPosedIn(standing, walk)) bedrockStateful("leafeon", "faint") else null
}
@@ -1,62 +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.gen4
import com.cobblemon.mod.common.client.render.models.blockbench.PosableState
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 net.minecraft.client.model.geom.ModelPart
import net.minecraft.world.phys.Vec3
class ProbopassModel(root: ModelPart) : PokemonPosableModel(root) {
override val rootPart = root.registerChildWithAllChildren("probopass")
override var portraitScale = 1F
override var portraitTranslation = Vec3(0.0, 0.425, 0.0)
override var profileScale = 0.75F
override var profileTranslation = Vec3(0.0, 0.7, 0.0)
lateinit var sleep: Pose
lateinit var standing: Pose
lateinit var walk: Pose
override fun registerPoses() {
val blink = quirk { bedrockStateful("probopass", "blink") }
sleep = registerPose(
poseType = PoseType.SLEEP,
animations = arrayOf(bedrock("probopass", "sleep"))
)
standing = registerPose(
poseName = "standing",
poseTypes = STATIONARY_POSES + UI_POSES,
quirks = arrayOf(blink),
animations = arrayOf(
bedrock("probopass", "ground_idle")
)
)
walk = registerPose(
poseName = "walk",
poseTypes = MOVING_POSES,
quirks = arrayOf(blink),
animations = arrayOf(
bedrock("probopass", "ground_walk"),
)
)
}
override fun getFaintAnimation(state: PosableState) = if (state.isNotPosedIn(sleep)) bedrockStateful("probopass", "faint") else null
}
@@ -1,65 +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.gen6
import com.cobblemon.mod.common.client.render.models.blockbench.frame.HeadedFrame
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.Companion.MOVING_POSES
import com.cobblemon.mod.common.entity.PoseType.Companion.STATIONARY_POSES
import com.cobblemon.mod.common.entity.PoseType.Companion.UI_POSES
import net.minecraft.client.model.geom.ModelPart
import net.minecraft.world.phys.Vec3
class SylveonModel(root: ModelPart) : PokemonPosableModel(root), HeadedFrame {
override val rootPart = root.registerChildWithAllChildren("sylveon")
override val head = getPart("head")
override var portraitScale = 2.4F
override var portraitTranslation = Vec3(-0.55, -0.45, 0.0)
override var profileScale = 0.85F
override var profileTranslation = Vec3(0.0, 0.43, 0.0)
lateinit var standing: Pose
lateinit var walk: Pose
override val cryAnimation = CryProvider { bedrockStateful("sylveon", "cry") }
override fun registerPoses() {
val blink = quirk { bedrockStateful("sylveon", "blink") }
standing = registerPose(
poseName = "standing",
poseTypes = STATIONARY_POSES + UI_POSES,
transformTicks = 10,
quirks = arrayOf(blink),
animations = arrayOf(
singleBoneLook(),
bedrock("sylveon", "ground_idle")
)
)
walk = registerPose(
poseName = "walk",
poseTypes = MOVING_POSES,
transformTicks = 10,
quirks = arrayOf(blink),
animations = arrayOf(
singleBoneLook(),
bedrock("sylveon", "ground_run")
)
)
}
// override fun getFaintAnimation(
// pokemonEntity: PokemonEntity,
// state: PosableState<PokemonEntity>
// ) = if (state.isPosedIn(standing, walk)) bedrockStateful("sylveon", "faint") else null
}
@@ -1,69 +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.gen8
import com.cobblemon.mod.common.client.render.models.blockbench.animation.BimanualSwingAnimation
import com.cobblemon.mod.common.client.render.models.blockbench.animation.BipedWalkAnimation
import com.cobblemon.mod.common.client.render.models.blockbench.frame.BimanualFrame
import com.cobblemon.mod.common.client.render.models.blockbench.frame.BipedFrame
import com.cobblemon.mod.common.client.render.models.blockbench.frame.HeadedFrame
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 net.minecraft.client.model.geom.ModelPart
import net.minecraft.world.phys.Vec3
class SneaslerModel (root: ModelPart) : PokemonPosableModel(root), HeadedFrame, BipedFrame, BimanualFrame {
override val rootPart = root.registerChildWithAllChildren("sneasler")
override val head = getPart("head")
override val leftArm = getPart("arm_left")
override val rightArm = getPart("arm_right")
override val leftLeg = getPart("leg_left")
override val rightLeg = getPart("leg_right")
override var portraitScale = 2.03F
override var portraitTranslation = Vec3(-0.44, 2.41, 0.0)
override var profileScale = 0.52F
override var profileTranslation = Vec3(0.0, 0.94, 0.0)
lateinit var standing: CobblemonPose
lateinit var walk: CobblemonPose
override val cryAnimation = CryProvider { bedrockStateful("sneasler", "cry") }
override fun registerPoses() {
val blink = quirk { bedrockStateful("sneasler", "blink") }
standing = registerPose(
poseName = "standing",
poseTypes = PoseType.STATIONARY_POSES + PoseType.UI_POSES,
quirks = arrayOf(blink),
animations = arrayOf(
singleBoneLook(),
bedrock("sneasler", "ground_idle")
)
)
walk = registerPose(
poseName = "walk",
poseTypes = PoseType.MOVING_POSES,
quirks = arrayOf(blink),
animations = arrayOf(
singleBoneLook(),
bedrock("sneasler", "ground_idle"),
BipedWalkAnimation(this, periodMultiplier = 0.6F, amplitudeMultiplier = 0.9F),
BimanualSwingAnimation(this, swingPeriodMultiplier = 0.6F, amplitudeMultiplier = 0.9F)
//bedrock("sneasler", "ground_walk")
)
)
}
}
@@ -229,10 +229,8 @@ object VaryingModelRepository {
inbuilt("raticate", ::RaticateModel)
inbuilt("rattata_alolan", ::RattataAlolanModel)
inbuilt("raticate_alolan", ::RaticateAlolanModel)
inbuilt("eevee", ::EeveeModel)
inbuilt("pidgey", ::PidgeyModel)
inbuilt("pidgeotto", ::PidgeottoModel)
inbuilt("pidgeot", ::PidgeotModel)
inbuilt("diglett", ::DiglettModel)
inbuilt("dugtrio", ::DugtrioModel)
inbuilt("zubat", ::ZubatModel)
@@ -274,7 +272,6 @@ object VaryingModelRepository {
inbuilt("farfetchd", ::FarfetchdModel)
inbuilt("farfetchd_galarian", ::FarfetchdGalarianModel)
inbuilt("fearow", ::FearowModel)
inbuilt("flareon", ::FlareonModel)
inbuilt("gengar", ::GengarModel)
inbuilt("geodude", ::GeodudeModel)
inbuilt("golbat", ::GolbatModel)
@@ -286,7 +283,6 @@ object VaryingModelRepository {
inbuilt("hitmonchan", ::HitmonchanModel)
inbuilt("hitmonlee", ::HitmonleeModel)
inbuilt("hypno", ::HypnoModel)
inbuilt("jolteon", ::JolteonModel)
inbuilt("jynx", ::JynxModel)
inbuilt("kabuto", ::KabutoModel)
inbuilt("kabutops", ::KabutopsModel)
@@ -333,7 +329,6 @@ object VaryingModelRepository {
inbuilt("tangela", ::TangelaModel)
inbuilt("tentacool", ::TentacoolModel)
inbuilt("tentacruel", ::TentacruelModel)
inbuilt("vaporeon", ::VaporeonModel)
inbuilt("venomoth", ::VenomothModel)
inbuilt("venonat", ::VenonatModel)
inbuilt("vulpix", ::VulpixModel)
@@ -344,15 +339,10 @@ object VaryingModelRepository {
inbuilt("smoochum", ::SmoochumModel)
inbuilt("hitmontop", ::HitmontopModel)
inbuilt("electivire", ::ElectivireModel)
inbuilt("glaceon", ::GlaceonModel)
inbuilt("leafeon", ::LeafeonModel)
inbuilt("lickilicky", ::LickilickyModel)
inbuilt("mimejr", ::MimejrModel)
inbuilt("scizor", ::ScizorModel)
inbuilt("tangrowth", ::TangrowthModel)
inbuilt("sylveon", ::SylveonModel)
inbuilt("umbreon", ::UmbreonModel)
inbuilt("espeon", ::EspeonModel)
inbuilt("blissey", ::BlisseyModel)
inbuilt("piloswine", ::PiloswineModel)
inbuilt("quagsire", ::QuagsireModel)
@@ -398,7 +388,6 @@ object VaryingModelRepository {
inbuilt("wailmer", ::WailmerModel)
inbuilt("wailord", ::WailordModel)
inbuilt("murkrow", ::MurkrowModel)
inbuilt("honchkrow", ::HonchkrowModel)
inbuilt("nacli", :: NacliModel)
inbuilt("naclstack", :: NaclstackModel)
inbuilt("garganacl", ::GarganaclModel)
@@ -415,9 +404,6 @@ object VaryingModelRepository {
inbuilt("klinklang", :: KlinklangModel)
inbuilt("morelull", :: MorelullModel)
inbuilt("shiinotic", :: ShiinoticModel)
inbuilt("treecko", :: TreeckoModel)
inbuilt("grovyle", :: GrovyleModel)
inbuilt("sceptile", :: SceptileModel)
inbuilt("honedge", :: HonedgeModel)
inbuilt("spiritomb", :: SpiritombModel)
inbuilt("chespin", :: ChespinModel)
@@ -485,8 +471,6 @@ object VaryingModelRepository {
inbuilt("magcargo", ::MagcargoModel)
inbuilt("slugma_shiny", ::SlugmaShinyModel)
inbuilt("magcargo_shiny", ::MagcargoShinyModel)
inbuilt("nosepass", ::NosepassModel)
inbuilt("probopass", ::ProbopassModel)
inbuilt("chinchou", ::ChinchouModel)
inbuilt("clamperl", ::ClamperlModel)
inbuilt("huntail", ::HuntailModel)
@@ -655,7 +639,6 @@ object VaryingModelRepository {
inbuilt("gallade", ::GalladeModel)
inbuilt("beldum", ::BeldumModel)
inbuilt("metang", ::MetangModel)
inbuilt("metagross", ::MetagrossModel)
inbuilt("ursaluna", ::UrsalunaModel)
inbuilt("lechonk", ::LechonkModel)
inbuilt("oinkologne_male", ::OinkologneMaleModel)
@@ -715,8 +698,6 @@ object VaryingModelRepository {
inbuilt("qwilfish_hisuian", ::QwilfishHisuianModel)
inbuilt("overqwil", ::OverqwilModel)
inbuilt("sneasel_hisuian", ::SneaselHisuianModel)
inbuilt("sneasler", ::SneaslerModel)
inbuilt("tropius", ::TropiusModel)
inbuilt("petilil", ::PetililModel)
inbuilt("lilligant", ::LilligantModel)
inbuilt("petilil_hisui_bias", ::PetililHisuiBiasModel)
@@ -20,7 +20,6 @@ import net.minecraft.client.renderer.MultiBufferSource
import net.minecraft.client.renderer.entity.EntityRendererProvider.Context
import net.minecraft.client.renderer.entity.LivingEntityRenderer
import net.minecraft.resources.ResourceLocation
import net.minecraft.world.phys.Vec3
import kotlin.math.min
class NPCRenderer(context: Context) : LivingEntityRenderer<NPCEntity, PosableEntityModel<NPCEntity>>(context, PosableNPCModel(), 0.5f) {
@@ -60,17 +59,17 @@ class NPCRenderer(context: Context) : LivingEntityRenderer<NPCEntity, PosableEnt
model.blue = 1F
model.resetLayerContext()
if (entity.deathTime < 1){
if (entity.deathTime < 1) {
//Render Held Item
heldItemRenderer.renderOnEntity(
entity,
heldItemRenderer.renderOnModel(
entity.mainHandItem,
model,
clientDelegate,
poseMatrix,
buffer,
packedLight,
Vec3(-90.0,0.0,0.0)
false,
entity
)
}
@@ -11,18 +11,17 @@ package com.cobblemon.mod.common.client.render.player
import com.bedrockk.molang.runtime.value.DoubleValue
import com.cobblemon.mod.common.OrientationControllable
import com.cobblemon.mod.common.api.riding.Rideable
import com.cobblemon.mod.common.client.MountedPokemonAnimationRenderController
import com.cobblemon.mod.common.client.entity.PokemonClientDelegate
import com.cobblemon.mod.common.client.render.models.blockbench.bedrock.animation.BedrockAnimationRepository
import com.cobblemon.mod.common.entity.pokemon.PokemonEntity
import com.cobblemon.mod.common.util.cobblemonResource
import com.mojang.blaze3d.vertex.PoseStack
import com.mojang.math.Axis
import net.minecraft.client.model.geom.ModelPart
import net.minecraft.client.player.AbstractClientPlayer
import net.minecraft.client.player.RemotePlayer
import net.minecraft.util.Mth
import net.minecraft.world.phys.Vec3
import org.joml.Matrix3f
import org.joml.AxisAngle4f
import org.joml.Matrix4f
import org.joml.Vector3f
@@ -43,19 +42,7 @@ object MountedPlayerRenderer {
//Positions player
if (locator != null) {
val locatorOffset = locator.matrix.getTranslation(Vector3f())
val center = Vector3f(0f, entity.bbHeight/2, 0f)
val locatorOffsetToCenter = locatorOffset.sub(center, Vector3f())
val transformationMatrix = Matrix4f()
//if (player is Rollable && player.shouldRoll()){
//transformationMatrix.rotate(Axis.YP.rotationDegrees(-yBodyRot))
//transformationMatrix.mulLocal(player.orientation)
//}
val rotatedOffset = transformationMatrix.transformPosition(locatorOffsetToCenter, Vector3f()).add(center).sub(Vector3f(0f, player.bbHeight/2, 0f))
matrix.translate(rotatedOffset)
MountedPokemonAnimationRenderController.setup(entity, partialTicks)
//Undo seat position
val playerPos = Vec3(
@@ -71,21 +58,16 @@ object MountedPlayerRenderer {
)
matrix.translate(playerPos.subtract(entityPos).toVector3f().negate())
}
matrix.translate(locator.matrix.getTranslation(Vector3f()))
//Rotates player
if (player is OrientationControllable && player.orientationController.active && !disableRollableRenderDebug) {
val center = Vector3f(0f, player.bbHeight / 2, 0f)
val yaw = Mth.rotLerp(partialTicks, entity.yBodyRotO, entity.yBodyRot)
val transformationMatrix = Matrix4f()
transformationMatrix.translate(center)
transformationMatrix.rotate(player.orientationController.getRenderOrientation(partialTicks))
transformationMatrix.translate(center.negate(Vector3f()))
//Pre-Undo Yaw
transformationMatrix.rotate(Axis.YP.rotationDegrees(yaw+180f))
matrix.mul(transformationMatrix)
val offset = Vector3f(0f, player.bbHeight / 2, 0f).mul(-1f)
matrix.rotate(locator.matrix.getRotation(AxisAngle4f()))
matrix.rotate(Axis.YP.rotationDegrees(180 + yBodyRot))
matrix.translate(offset)
matrix.translate(Vector3f(0f, 0.35f, 0f))
}
matrix.translate(0f, 0.25f, 0f)
}
fun animate(
@@ -159,15 +159,15 @@ class PokemonRenderer(
// Minecraft.getInstance().bufferBuilders.entityVertexConsumers.draw()
//Render Held Item
heldItemRenderer.renderOnEntity(
entity,
heldItemRenderer.renderOnModel(
entity.shownItem,
model.posableModel,
modelNow,
clientDelegate,
poseMatrix,
buffer,
packedLight,
Vec3(0.0,-90.0,90.0)
false,
entity
)
}
@@ -178,7 +178,7 @@ class PokemonRenderer(
buffer: MultiBufferSource,
packedLight: Int
) {
val driver = entity.controllingPassenger ?: return
val driver = entity.firstPassenger ?: return
val rollable = driver as? OrientationControllable ?: return
val controller = rollable.orientationController
poseMatrix.pushPose()
@@ -198,10 +198,6 @@ class PokemonRenderer(
//Pre-undo yaw rotation
transformationMatrix.rotate(Axis.YP.rotationDegrees(yaw+180f))
matrix.mul(transformationMatrix)
} else {
//Align rotation for non rollable pokemon
entity.yBodyRot = driver.yRot
entity.yBodyRotO = driver.yRotO
}
super.render(entity, 0f, partialTicks, poseMatrix, buffer, packedLight)
@@ -17,9 +17,9 @@ import com.cobblemon.mod.common.pokeball.catching.calculators.CobblemonCaptureCa
import com.cobblemon.mod.common.util.adapters.CaptureCalculatorAdapter
import com.cobblemon.mod.common.util.adapters.IntRangeAdapter
import com.google.gson.GsonBuilder
import com.google.gson.annotations.SerializedName
import kotlin.reflect.full.memberProperties
import kotlin.reflect.jvm.isAccessible
import com.google.gson.annotations.SerializedName
class CobblemonConfig {
companion object {
@@ -259,6 +259,9 @@ class CobblemonConfig {
@CobblemonConfigField(Category.Interface, lang = "party_portrait_animations")
var partyPortraitAnimations = PortraitStyle.NEVER_ANIMATE
@CobblemonConfigField(Category.Riding, lang = "third_person_view_bobbing")
var thirdPartyViewBobbing = false
@CobblemonConfigField(Category.Riding, lang = "invert_roll")
var invertRoll = false
@@ -12,7 +12,6 @@ import com.bedrockk.molang.runtime.MoLangRuntime
import com.bedrockk.molang.runtime.value.DoubleValue
import com.cobblemon.mod.common.*
import com.cobblemon.mod.common.CobblemonNetwork.sendPacket
import com.cobblemon.mod.common.CobblemonSounds
import com.cobblemon.mod.common.api.drop.DropTable
import com.cobblemon.mod.common.api.entity.Despawner
import com.cobblemon.mod.common.api.entity.PokemonSender
@@ -40,9 +39,14 @@ import com.cobblemon.mod.common.api.pokemon.feature.StringSpeciesFeature
import com.cobblemon.mod.common.api.pokemon.status.Statuses
import com.cobblemon.mod.common.api.reactive.ObservableSubscription
import com.cobblemon.mod.common.api.reactive.SimpleObservable
import com.cobblemon.mod.common.api.riding.*
import com.cobblemon.mod.common.api.riding.behaviour.*
import com.cobblemon.mod.common.api.riding.behaviour.types.*
import com.cobblemon.mod.common.api.riding.Rideable
import com.cobblemon.mod.common.api.riding.RidingProperties
import com.cobblemon.mod.common.api.riding.RidingStyle
import com.cobblemon.mod.common.api.riding.Seat
import com.cobblemon.mod.common.api.riding.behaviour.RidingBehaviour
import com.cobblemon.mod.common.api.riding.behaviour.RidingBehaviourSettings
import com.cobblemon.mod.common.api.riding.behaviour.RidingBehaviourState
import com.cobblemon.mod.common.api.riding.behaviour.RidingBehaviours
import com.cobblemon.mod.common.api.riding.events.SelectDriverEvent
import com.cobblemon.mod.common.api.riding.stats.RidingStat
import com.cobblemon.mod.common.api.scheduling.Schedulable
@@ -88,14 +92,8 @@ import com.cobblemon.mod.common.pokemon.evolution.variants.ItemInteractionEvolut
import com.cobblemon.mod.common.pokemon.feature.StashHandler
import com.cobblemon.mod.common.pokemon.properties.UncatchableProperty
import com.cobblemon.mod.common.util.*
import com.cobblemon.mod.common.util.math.geometry.toRadians
import com.cobblemon.mod.common.world.gamerules.CobblemonGameRules
import com.mojang.serialization.Codec
import java.util.EnumSet
import java.util.Optional
import java.util.UUID
import java.util.concurrent.CompletableFuture
import kotlin.math.PI
import net.minecraft.core.BlockPos
import net.minecraft.core.registries.BuiltInRegistries
import net.minecraft.core.registries.Registries
@@ -146,10 +144,9 @@ import net.minecraft.world.level.material.FluidState
import net.minecraft.world.level.pathfinder.PathType
import net.minecraft.world.phys.AABB
import net.minecraft.world.phys.Vec3
import org.joml.AxisAngle4f
import org.joml.Matrix3f
import org.joml.Quaternionf
import org.joml.Vector3f
import java.util.*
import java.util.concurrent.CompletableFuture
import kotlin.math.PI
@Suppress("unused")
open class PokemonEntity(
@@ -286,9 +283,9 @@ open class PokemonEntity(
ridingBehaviourSettings = null
if (pokemon.riding.behaviour == null) return
riding = RidingBehaviours.get(pokemon.riding.behaviour!!.key) as RidingBehaviour<RidingBehaviourSettings, RidingBehaviourState>?
ridingState = riding!!.createDefaultState()
riding = RidingBehaviours.get(pokemon.riding.behaviour!!.key)
ridingBehaviourSettings = pokemon.riding.behaviour!!
ridingState = riding!!.createDefaultState(ridingBehaviourSettings!!)
}
/**
@@ -357,10 +354,11 @@ open class PokemonEntity(
}
var flyDistO = 0F
var isPokemonWalking = false
var isPokemonFlying = false
var tickSpawned = 0
init {
delegate.initialize(this)
delegate.changePokemon(pokemon)
@@ -409,11 +407,7 @@ open class PokemonEntity(
SPECIES -> refreshDimensions()
POSE_TYPE -> {
val value = entityData.get(data) as PoseType
if ((value == PoseType.FLY || value == PoseType.HOVER) && passengers.isEmpty()) {
setNoGravity(true)
} else {
setNoGravity(false)
}
isNoGravity = (value == PoseType.FLY || value == PoseType.HOVER) && passengers.isEmpty()
}
BATTLE_ID -> {
@@ -486,7 +480,7 @@ open class PokemonEntity(
isPokemonFlying = flyDist - flyDistO > 0.005F
isPokemonWalking = walkDist - walkDistO > 0.005F
val isMoving = entityData.get(MOVING)
entityData.get(MOVING)
super.tick()
flyDistO = flyDist
@@ -1018,12 +1012,15 @@ open class PokemonEntity(
itemStack
)
if (player.isShiftKeyDown) {
val canRide = ifRidingAvailableSupply(false) { behaviour, settings, state ->
this.canRide(player) && seats.isNotEmpty() && behaviour.isActive(settings, state, this)
}
InteractPokemonUIPacket(
this.getUUID(),
canSitOnShoulder() && pokemon in player.party(),
!(pokemon.heldItemNoCopy().isEmpty && itemStack.isEmpty),
(!pokemon.cosmeticItem.isEmpty && itemStack.isEmpty) || cosmeticItemDefinition != null,
this.canRide(player) && pokemon.riding.canRide
canRide
).sendToPlayer(player)
} else {
// TODO #105
@@ -1218,7 +1215,7 @@ open class PokemonEntity(
val possibleReturn = if (isCosmetic) this.pokemon.cosmeticItem.copy() else this.pokemon.heldItemNoCopy()
val giving = stack.copy().apply { count = 1 }
if (ItemStack.isSameItem(giving, possibleReturn)) {
if (ItemStack.isSameItemSameComponents(giving, possibleReturn)) {
val message = if (isCosmetic) {
lang("cosmetic_item.already_wearing", this.pokemon.getDisplayName(), stack.hoverName)
} else {
@@ -1235,30 +1232,15 @@ open class PokemonEntity(
}
val text = when {
isCosmetic && giving.isEmpty -> lang(
"cosmetic_item.take",
returned.hoverName,
this.pokemon.getDisplayName()
)
isCosmetic && returned.isEmpty -> lang(
"cosmetic_item.give",
this.pokemon.getDisplayName(),
giving.hoverName
)
!isCosmetic && giving.isEmpty -> lang("held_item.take", returned.hoverName, this.pokemon.getDisplayName())
!isCosmetic && returned.isEmpty -> lang("held_item.give", this.pokemon.getDisplayName(), giving.hoverName)
isCosmetic -> lang(
"cosmetic_item.replace",
returned.hoverName,
this.pokemon.getDisplayName(),
returned.hoverName
)
else -> lang("held_item.replace", returned.hoverName, this.pokemon.getDisplayName(), returned.hoverName)
isCosmetic && giving.isEmpty -> lang("cosmetic_item.take", returned.displayName, this.pokemon.getDisplayName())
isCosmetic && returned.isEmpty -> lang("cosmetic_item.give", this.pokemon.getDisplayName(), giving.displayName)
!isCosmetic && giving.isEmpty -> lang("held_item.take", returned.displayName, this.pokemon.getDisplayName())
!isCosmetic && returned.isEmpty -> lang("held_item.give", this.pokemon.getDisplayName(), giving.displayName)
isCosmetic -> lang("cosmetic_item.replace", returned.displayName, this.pokemon.getDisplayName(), giving.displayName)
else -> lang("held_item.replace", returned.displayName, this.pokemon.getDisplayName(), giving.displayName)
}
player.giveOrDropItemStack(returned, false)
player.sendSystemMessage(text)
this.level().playSoundServer(
position = this.position(),
@@ -1467,7 +1449,7 @@ open class PokemonEntity(
// Copy and paste of how vanilla checks it, unfortunately no util method you can only add then wait for the result
fun hasRoomToMount(player: Player): Boolean {
return (player.shoulderEntityLeft.isEmpty || player.shoulderEntityRight.isEmpty)
&& !player.isPassenger()
&& !player.isPassenger
&& player.onGround()
&& !player.isInWater
&& !player.isInPowderSnow
@@ -1530,7 +1512,7 @@ open class PokemonEntity(
behaviour.velocity(settings, state, this, this.controllingPassenger as Player, deltaMovement)
}
//Handle ridden pokemon differently to allow vector lerp instead of simple addition.
val v = Entity.getInputVector(velocity, 1.0f, this.getYRot());
val v = getInputVector(velocity, 1.0f, this.yRot)
//changing this will give the ride more or less inertia/handling/drift
val inertia = ifRidingAvailableSupply(fallback = 0.5) { behaviour, settings, state ->
behaviour.inertia(settings, state,this)
@@ -1575,8 +1557,8 @@ open class PokemonEntity(
}
// Rotate velocity vector to face the current y rotation
val f = Mth.sin(this.getYRot() * 0.017453292f)
val g = Mth.cos(this.getYRot() * 0.017453292f)
val f = Mth.sin(this.yRot * 0.017453292f)
val g = Mth.cos(this.yRot * 0.017453292f)
val v = Vec3(
inp.x * g.toDouble() - inp.z * f.toDouble(),
inp.y,
@@ -1605,7 +1587,7 @@ open class PokemonEntity(
private fun updateBlocksTraveled(fromBp: BlockPos) {
// Riding or falling shouldn't count, other movement sources are fine
if (this.isPassenger() || this.isFalling()) {
if (this.isPassenger || this.isFalling()) {
return
}
val blocksTaken = this.blockPosition().distSqr(fromBp)
@@ -1878,11 +1860,11 @@ open class PokemonEntity(
}
val rotation = behaviour.rotation(settings, state, this, driver)
this.yRotO = this.yRot
setRot(rotation.y, rotation.x)
this.yHeadRot = this.yRot
this.yBodyRot = this.yRot
this.yRotO = this.yRot
val riders = this.passengers.filterIsInstance<LivingEntity>()
this.passengers.filterIsInstance<LivingEntity>()
if (behaviour.isActive(settings, state, this) && behaviour.canJump(settings, state, this, driver)) {
if (this.jumpInputStrength > 0) {
@@ -1923,7 +1905,7 @@ open class PokemonEntity(
fun Entity.isNearGround(): Boolean {
val blockBelow: BlockPos = this.blockPosition().below()
return this.level().getBlockState(blockBelow).isSolid()
return this.level().getBlockState(blockBelow).isSolid
}
// override fun jump() {
@@ -1950,23 +1932,8 @@ open class PokemonEntity(
override fun positionRider(passenger: Entity, positionUpdater: MoveFunction) {
if (this.hasPassenger(passenger)) {
val index = this.passengers.indexOf(passenger).takeIf { it >= 0 && it < this.seats.size } ?: return
val seat = this.seats[index]
val seatOffset = seat.getOffset(this.getCurrentPoseType()).toVector3f()
val center = Vector3f(0f, this.bbHeight / 2, 0f)
this.delegate.positionRider(passenger, positionUpdater)
val seatToCenter = center.sub(seatOffset, Vector3f())
val matrix = (this.passengers.first() as? OrientationControllable)?.orientationController?.orientation
?: Matrix3f().rotate((180f - passenger.yRot).toRadians(), Vector3f(0f, 1f, 0f))
val rotatedOffset =
matrix.transform(seatToCenter, Vector3f()).add(center).sub(Vector3f(0f, passenger.bbHeight / 2, 0f))
positionUpdater.accept(
passenger,
this.x + rotatedOffset.x,
this.y + rotatedOffset.y,
this.z + rotatedOffset.z
)
if (passenger is LivingEntity) {
ifRidingAvailable { behaviour, settings, state ->
behaviour.updatePassengerRotation(settings, state,this, passenger)
@@ -8,26 +8,29 @@
package com.cobblemon.mod.common.entity.pokemon
import com.cobblemon.mod.common.CobblemonNetwork
import com.bedrockk.molang.runtime.struct.QueryStruct
import com.bedrockk.molang.runtime.value.DoubleValue
import com.bedrockk.molang.runtime.value.MoValue
import com.cobblemon.mod.common.CobblemonSounds
import com.cobblemon.mod.common.OrientationControllable
import com.cobblemon.mod.common.api.entity.PokemonSender
import com.cobblemon.mod.common.api.entity.PokemonSideDelegate
import com.cobblemon.mod.common.api.molang.ObjectValue
import com.cobblemon.mod.common.api.pokemon.PokemonProperties
import com.cobblemon.mod.common.api.pokemon.stats.Stats
import com.cobblemon.mod.common.api.pokemon.status.Statuses
import com.cobblemon.mod.common.api.tags.CobblemonItemTags
import com.cobblemon.mod.common.battles.BattleRegistry
import com.cobblemon.mod.common.entity.PlatformType
import com.cobblemon.mod.common.entity.PoseType
import com.cobblemon.mod.common.net.messages.server.pokemon.update.ServerboundUpdateRidingStatePacket
import com.cobblemon.mod.common.pokemon.Pokemon
import com.cobblemon.mod.common.pokemon.activestate.ActivePokemonState
import com.cobblemon.mod.common.pokemon.activestate.SentOutState
import com.cobblemon.mod.common.util.asUUID
import com.cobblemon.mod.common.util.getIsSubmerged
import com.cobblemon.mod.common.util.math.geometry.toRadians
import com.cobblemon.mod.common.util.playSoundServer
import com.cobblemon.mod.common.util.update
import com.cobblemon.mod.common.world.gamerules.CobblemonGameRules
import net.minecraft.client.Minecraft
import net.minecraft.network.chat.Component
import net.minecraft.network.syncher.EntityDataAccessor
import net.minecraft.server.level.ServerLevel
@@ -37,6 +40,8 @@ import net.minecraft.world.entity.Entity
import net.minecraft.world.entity.ai.attributes.Attributes
import net.minecraft.world.item.ItemStack
import net.minecraft.world.level.pathfinder.PathType
import org.joml.Matrix3f
import org.joml.Vector3f
import java.util.*
/** Handles purely server logic for a Pokémon */
@@ -102,6 +107,32 @@ class PokemonServerDelegate : PokemonSideDelegate {
updateTrackedValues()
}
override fun addToStruct(struct: QueryStruct) {
super.addToStruct(struct)
if (entity.pokemon.isWild()) {
struct
.addFunction("attempt_wild_battle") { params ->
val opponentValue = params.get<MoValue>(0)
val opponent = if (opponentValue is ObjectValue<*>) {
opponentValue.obj as ServerPlayer
} else {
val paramString = opponentValue.asString()
val playerUUID = paramString.asUUID
if (playerUUID != null) {
entity.server!!.playerList.getPlayer(playerUUID) ?: return@addFunction DoubleValue.ZERO
} else {
entity.server!!.playerList.getPlayerByName(paramString) ?: return@addFunction DoubleValue.ZERO
}
}
// Need to wait to ensure any entity info gets grabbed properly before battle attempt.
return@addFunction entity.after(0.01F) {
DoubleValue(entity.forceBattle(opponent))
}
}
}
}
fun getBattle() = entity.battleId?.let(BattleRegistry::getBattle)
fun updateTrackedValues() {
@@ -231,7 +262,7 @@ class PokemonServerDelegate : PokemonSideDelegate {
val isSleeping = entity.pokemon.status?.status == Statuses.SLEEP && entity.behaviour.resting.canSleep
val isMoving = entity.entityData.get(PokemonEntity.MOVING)
val isPassenger = entity.isPassenger()
val isPassenger = entity.isPassenger
val isUnderwater = entity.getIsSubmerged()
val isFlying = entity.getBehaviourFlag(PokemonBehaviourFlag.FLYING)
@@ -297,4 +328,28 @@ class PokemonServerDelegate : PokemonSideDelegate {
entity.remove(Entity.RemovalReason.KILLED)
}
}
override fun positionRider(
passenger: Entity,
positionUpdater: Entity.MoveFunction
) {
val index =
this.entity.passengers.indexOf(passenger).takeIf { it >= 0 && it < this.entity.seats.size } ?: return
val seat = this.entity.seats[index]
val seatOffset = seat.getOffset(this.entity.getCurrentPoseType()).toVector3f()
val center = Vector3f(0f, this.entity.bbHeight / 2, 0f)
val seatToCenter = center.sub(seatOffset, Vector3f())
val matrix = (this.entity.passengers.first() as? OrientationControllable)?.orientationController?.orientation
?: Matrix3f().rotate((180f - passenger.yRot).toRadians(), Vector3f(0f, 1f, 0f))
val offset =
matrix.transform(seatToCenter, Vector3f()).add(center).sub(Vector3f(0f, passenger.bbHeight / 2, 0f))
positionUpdater.accept(
passenger,
this.entity.x + offset.x,
this.entity.y + offset.y,
this.entity.z + offset.z
)
}
}
@@ -0,0 +1,25 @@
/*
* 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.item
import com.cobblemon.mod.common.util.cobblemonResource
import net.minecraft.resources.ResourceLocation
import net.minecraft.world.entity.EquipmentSlot
import net.minecraft.world.item.Equipable
class WearableItem(val name: String): CobblemonItem(Properties()), Equipable {
companion object {
const val MODEL_PATH = "item/wearable"
}
fun getModel3d(): ResourceLocation = cobblemonResource("${MODEL_PATH}/${this.name}")
fun getModel2d(): ResourceLocation = cobblemonResource(this.name)
override fun getEquipmentSlot(): EquipmentSlot { return EquipmentSlot.HEAD }
}
@@ -10,10 +10,8 @@ package com.cobblemon.mod.common.net.messages.client.pokemon.update
import com.cobblemon.mod.common.api.net.NetworkPacket
import com.cobblemon.mod.common.api.riding.behaviour.RidingBehaviourState
import com.cobblemon.mod.common.net.messages.server.pokemon.update.ServerboundUpdateRidingStatePacket
import com.cobblemon.mod.common.util.cobblemonResource
import com.cobblemon.mod.common.util.server
import net.minecraft.client.Minecraft
import net.minecraft.network.FriendlyByteBuf
import net.minecraft.network.RegistryFriendlyByteBuf
import net.minecraft.resources.ResourceLocation
@@ -21,7 +19,7 @@ class ClientboundUpdateRidingStatePacket(
val entity: Int,
val behaviour: ResourceLocation,
val state: RidingBehaviourState? = null,
val data: RegistryFriendlyByteBuf? = null
val data: FriendlyByteBuf? = null
) : NetworkPacket<ClientboundUpdateRidingStatePacket> {
override val id = ID
@@ -37,7 +35,7 @@ class ClientboundUpdateRidingStatePacket(
fun decode(buffer: RegistryFriendlyByteBuf): ClientboundUpdateRidingStatePacket {
val entity = buffer.readInt()
val behaviour = buffer.readResourceLocation()
val state = RegistryFriendlyByteBuf(buffer.readBytes(buffer.readableBytes()), Minecraft.getInstance().player!!.registryAccess())
val state = FriendlyByteBuf(buffer.readBytes(buffer.readableBytes()))
return ClientboundUpdateRidingStatePacket(
entity = entity,
behaviour = behaviour,
@@ -48,6 +48,7 @@ class SpawnPokemonPacket(
var friendship: Int,
var freezeFrame: Float,
var passengers: IntArray,
var tickSpawned: Int,
vanillaSpawnPacket: ClientboundAddEntityPacket,
) : SpawnExtraDataEntityPacket<SpawnPokemonPacket, PokemonEntity>(vanillaSpawnPacket) {
@@ -76,6 +77,7 @@ class SpawnPokemonPacket(
entity.entityData.get(PokemonEntity.FRIENDSHIP),
entity.entityData.get(PokemonEntity.FREEZE_FRAME),
entity.passengers.map { it.id }.toIntArray(),
entity.tickCount,
vanillaSpawnPacket
)
@@ -102,6 +104,7 @@ class SpawnPokemonPacket(
buffer.writeInt(this.friendship)
buffer.writeFloat(this.freezeFrame)
buffer.writeVarIntArray(this.passengers)
buffer.writeInt(this.tickSpawned)
}
override fun applyData(entity: PokemonEntity, level: ClientLevel) {
@@ -136,6 +139,8 @@ class SpawnPokemonPacket(
val passenger = level.getEntity(it) ?: return@forEach
passenger.startRiding(entity)
}
entity.tickSpawned = this.tickSpawned
entity.delegate.updateAge(this.tickSpawned)
}
override fun checkType(entity: Entity): Boolean = entity is PokemonEntity
@@ -165,9 +170,10 @@ class SpawnPokemonPacket(
val friendship = buffer.readInt()
val freezeFrame = buffer.readFloat()
val passengers = buffer.readVarIntArray()
val tickSpawned = buffer.readInt()
val vanillaPacket = decodeVanillaPacket(buffer)
return SpawnPokemonPacket(ownerId, scaleModifier, speciesId, gender, shiny, formName, aspects, battleId, phasingTargetId, beamModeEmitter, platform, nickname, mark, labelLevel, poseType, unbattlable, hideLabel, caughtBall, spawnAngle, friendship, freezeFrame, passengers, vanillaPacket)
return SpawnPokemonPacket(ownerId, scaleModifier, speciesId, gender, shiny, formName, aspects, battleId, phasingTargetId, beamModeEmitter, platform, nickname, mark, labelLevel, poseType, unbattlable, hideLabel, caughtBall, spawnAngle, friendship, freezeFrame, passengers, tickSpawned, vanillaPacket)
}
}
@@ -639,11 +639,7 @@ open class Pokemon : ShowdownIdentifiable {
val entity = PokemonEntity(level, this)
illusion?.start(entity)
val adjustedPosition = entity.getAjustedSendoutPosition(position)
val sentOut = entity.setPositionSafely(adjustedPosition)
//If sendout failed, fall back
if (!sentOut) {
entity.setPos(adjustedPosition.x, adjustedPosition.y, adjustedPosition.z)
}
entity.setPositionSafely(adjustedPosition)
mutation(entity)
level.addFreshEntity(entity)
state = SentOutState(entity)
@@ -694,7 +690,7 @@ open class Pokemon : ShowdownIdentifiable {
battleActor is EntityBackedBattleActor<*> && battleActor.entity != null && battleActor.entity?.uuid !== owner.uuid
} as EntityBackedBattleActor<*>
if (activeBattlePokemon != null) {
opposingEntityPos = ShowdownInterpreter.getSendoutPosition(battle, activeBattlePokemon, opposingEntityBattleActor as BattleActor)
opposingEntityPos = activeBattlePokemon.getSendOutPosition()
}
if (opposingEntityPos == null) {
// Sendout calculation failed, fallback to using the opposing actor's position
@@ -8,6 +8,8 @@
package com.cobblemon.mod.common.util
import com.cobblemon.mod.common.api.text.yellow
import com.cobblemon.mod.common.entity.pokemon.PokemonEntity
import com.google.common.collect.ImmutableMap
import com.mojang.serialization.Dynamic
import net.minecraft.core.BlockPos
@@ -17,12 +19,20 @@ import net.minecraft.nbt.Tag
import net.minecraft.network.syncher.EntityDataAccessor
import net.minecraft.network.syncher.SynchedEntityData
import net.minecraft.world.entity.Entity
import net.minecraft.world.level.Level
import net.minecraft.world.level.block.Block
import net.minecraft.world.level.block.Blocks
import net.minecraft.world.phys.AABB
import net.minecraft.world.phys.Vec3
import net.minecraft.world.phys.shapes.BooleanOp
import net.minecraft.world.phys.shapes.CollisionContext
import net.minecraft.world.phys.shapes.Shapes
import java.util.*
import kotlin.math.ceil
import kotlin.math.floor
import kotlin.math.min
import kotlin.time.measureTime
fun Entity.makeEmptyBrainDynamic() = Dynamic(
NbtOps.INSTANCE,
@@ -31,9 +41,76 @@ fun Entity.makeEmptyBrainDynamic() = Dynamic(
fun Entity.effectiveName() = this.displayName ?: this.name
private fun getPosScore(level: Level, entity: Entity, box: AABB, pos: BlockPos): Int {
// position the hitbox in the xz center of the block
val movedBox = box.move(Vec3(pos.x + 0.5, pos.y.toDouble(), pos.z + 0.5).subtract(box.bottomCenter))
return level.getBlockCollisions(entity, movedBox).count()
}
private fun findBestBlockPosBFS(
entity: Entity,
pos: Vec3,
level: Level,
maxRadius: Int = 4
): BlockPos {
val directions = listOf(
BlockPos(0, 1, 0), BlockPos(0, -1, 0), // Up and down
BlockPos(1, 0, 0), BlockPos(-1, 0, 0), // East and west
BlockPos(0, 0, 1), BlockPos(0, 0, -1) // North and south
)
val queue = ArrayDeque<BlockPos>()
val visited = mutableSetOf<BlockPos>()
val centerPos = BlockPos(if (pos.x > 0) pos.x.toInt() else floor(pos.x).toInt(), if (pos.y > 0) pos.y.toInt() else floor(pos.y).toInt(), if (pos.z > 0) pos.z.toInt() else floor(pos.z).toInt())
queue.add(centerPos)
var bestScore = Int.MAX_VALUE
var bestPos = centerPos
var deflatedBox = entity.boundingBox
val maxHeight = 3
val maxWidth = 3
// We deflate the box to make collision checks cheaper for large pokemon.
if(entity.bbWidth > maxWidth) {
deflatedBox = deflatedBox.deflate((entity.bbWidth - maxWidth) / 2.0, 0.0, (entity.bbWidth - maxWidth) / 2.0)
}
if(entity.bbHeight > maxHeight) {
deflatedBox = deflatedBox.deflate(0.0, (entity.bbWidth - maxHeight) / 2.0, 0.0)
}
while (queue.isNotEmpty()) {
val currentPos = queue.removeFirst()
if (currentPos in visited) continue
visited.add(currentPos)
val blockPosHasCollision = !level.getBlockState(currentPos).getCollisionShape(level, currentPos, CollisionContext.empty()).isEmpty
// Ignore blockPositions that have collision
val score = if (blockPosHasCollision) Int.MAX_VALUE else getPosScore(level, entity, deflatedBox, currentPos)
if (score == 0) {
// Position found with zero collisions, return immediately.
return currentPos
} else if (bestScore > score) {
// Only take better scores and ignore ties, ensures that positions closer to the original position win ties.
bestPos = currentPos
bestScore = score
}
// Add neighbors (up to maxRadius)
for (dir in directions) {
val neighbor = currentPos.offset(dir)
// stay within the max radius and do not path find into a wall
if (neighbor.distManhattan(centerPos) <= maxRadius && (blockPosHasCollision || level.getBlockState(neighbor).getCollisionShape(level, neighbor, CollisionContext.empty()).isEmpty)) {
queue.add(neighbor)
}
}
}
return bestPos
}
fun Entity.setPositionSafely(pos: Vec3): Boolean {
// TODO: Rework this function. Best way to do it would be to define a vertical and horizontal min/max shift based on the Pokemon's hitbox.
// Then loop through horizontal/vertical shifts, and detect collisions in three categories: suffocation, damaging blocks, and general collision
// Unmute to view how long the BFS algorithm takes to run
// val mute = false
// TODO: Rework this function. Detect collisions in three categories: suffocation, damaging blocks, and general collision
// The closest position with the least severe collision types will be selected to move the Pokemon to
// The throw could be cancelled if there are no viable locations without severe problems
@@ -52,117 +129,34 @@ fun Entity.setPositionSafely(pos: Vec3): Boolean {
// return true
// }
var result = pos
val eyes = pos.with(Direction.Axis.Y, pos.y + this.eyeHeight)
val box = boundingBox.move(pos.subtract(boundingBox.bottomCenter))
var box = boundingBox.move(pos)
val conflicts = mutableSetOf<Direction>()
if (!level().getBlockCollisions(this, box).iterator().hasNext()) {
if (level().noBlockCollision(this, box)) {
// Given position is valid so no need to do extra work
setPos(pos)
return true
}
for (target in BlockPos.betweenClosedStream(box)) {
val blockState = this.level().getBlockState(target)
val collides = !blockState.isAir &&
blockState.isSuffocating(this.level(), target) &&
Shapes.joinIsNotEmpty(blockState.getCollisionShape(this.level(), target)
.move(target.x.toDouble(), target.y.toDouble(), target.z.toDouble()),
Shapes.create(box),
BooleanOp.AND
)
if (collides) {
val x = eyes.toBlockPos()
for (direction in Direction.entries) {
if (conflicts.contains(direction)) continue
val bestBlockPosition: BlockPos
val result: Vec3
// val elapsedTime = measureTime {
val searchRadius = min(ceil((this.bbWidth * 2)).toInt(), 4)
bestBlockPosition = findBestBlockPosBFS(this, pos, level(), searchRadius)
result = Vec3(bestBlockPosition.x + 0.5, bestBlockPosition.y.toDouble(), bestBlockPosition.z + 0.5)
setPos(result)
// }
// if (!mute) {
// // Displays the time taken to calculate the best position
// server()?.playerList?.players?.forEach {
// it.sendSystemMessage("Send out for ${(this as PokemonEntity).pokemon.species.name} completed in $elapsedTime".yellow())
// }
// }
val conflict = target.toVec3d()
if (x.offset(direction.normal) == target) {
conflicts.add(direction)
when (direction) {
Direction.UP -> return false
Direction.NORTH -> {
result = result.add(Vec3(0.0, 0.0, 1 + (conflict.z - box.minZ + (1.0 / 8.0))))
}
Direction.SOUTH -> {
result = result.add(Vec3(0.0, 0.0, (conflict.z - box.maxZ) - (1.0 / 8.0)))
}
Direction.WEST -> {
result = result.add(Vec3(1 + (conflict.x - box.minX + (1.0 / 8.0)), 0.0, 0.0))
}
Direction.EAST -> {
result = result.add(Vec3((conflict.x - box.maxX) - (1.0 / 8.0), 0.0, 0.0))
}
else -> {}
}
}
}
}
}
box = boundingBox.move(result)
if (!level().getBlockCollisions(this, box).iterator().hasNext()) {
this.setPos(result)
return true
} else {
val yChanges = listOf(1.0, -1.0, 2.0, -2.0)
var previousChange = 0.0
// If the Pokemon still collides with blocks after horizontal shifting, try vertical shifting from the shifted position
for (yChange in yChanges) {
box = box.move(0.0, yChange - previousChange, 0.0)
previousChange = yChange
if (level().getBlockCollisions(this, box).iterator().hasNext()) {
continue
} else {
val roundedY = (result.y + yChange).toInt()
box = box.move(0.0, roundedY - result.y, 0.0)
// If the rounded position actually collides again, then don't round at all.
if (level().getBlockCollisions(this, box).iterator().hasNext()) {
result = result.add(0.0, yChange, 0.0)
this.setPos(result)
return true
} else {
result = Vec3(result.x, roundedY.toDouble(), result.z)
this.setPos(result)
return true
}
}
}
// If vertical shifting from the new position still collides, try vertical shifting from the original pos
previousChange = 0.0
box = boundingBox.move(pos)
for (yChange in yChanges) {
box = box.move(0.0, yChange - previousChange, 0.0)
previousChange = yChange
if (level().getBlockCollisions(this, box).iterator().hasNext()) {
continue
} else {
val roundedY = (result.y + yChange).toInt()
box = box.move(0.0, roundedY - result.y, 0.0)
// If the rounded position actually collides again, then don't round at all.
if (level().getBlockCollisions(this, box).iterator().hasNext()) {
result = result.add(0.0, yChange, 0.0)
this.setPos(result)
return true
} else {
result = Vec3(result.x, roundedY.toDouble(), result.z)
this.setPos(result)
return true
}
}
}
}
if (conflicts.size >= 3) {
this.setPos(pos)
}
// This final check guarantees that the sendout will return to the original position if the Pokemon will suffocate in the new one
// This will only happen if the horizontal shift moved the Pokemon into a suffocating position, and there was no valid vertical shift
// I don't see the point of returning to the original position here, as the new position is guaranteed to have equal or fewer
// block collisions are the original given position
// We will return whether the new position causes suffocation, and the caller can decide what to do with that info,
// but we will not revert the position here.
// Battle has too many use cases in which using the new position is the preferred outcome, even if it is dangerous.
val resultEyes = result.with(Direction.Axis.Y, result.y + this.eyeHeight)
val resultEyeBox = AABB.ofSize(resultEyes, bbWidth.toDouble(), 1.0E-6, bbWidth.toDouble())
var collides = false
@@ -174,18 +168,13 @@ fun Entity.setPositionSafely(pos: Vec3): Boolean {
Shapes.joinIsNotEmpty(
blockState.getCollisionShape(this.level(), target)
.move(target.x.toDouble(), target.y.toDouble(), target.z.toDouble()),
Shapes.create(box),
Shapes.create(resultEyeBox),
BooleanOp.AND
)
if (collides) break
}
if (collides) {
this.setPos(pos)
return true
} else {
this.setPos(result)
return true
}
this.setPos(result)
return !collides
}
fun Entity.isDusk(): Boolean {
@@ -16,6 +16,7 @@ import com.google.gson.JsonObject
import com.mojang.serialization.JsonOps
import net.minecraft.core.component.DataComponentMap
import java.lang.reflect.Type
import kotlin.jvm.optionals.getOrNull
/**
* A JSON deserializer for [PossibleHeldItem].
@@ -32,9 +33,7 @@ object PossibleHeldItemAdapter : JsonDeserializer<PossibleHeldItem> {
)
} else {
json as JsonObject
val componentMap = JsonOps.INSTANCE.withDecoder(DataComponentMap.CODEC).apply(json.get("nbt")).getOrThrow {
return@getOrThrow IllegalStateException("Cant serialize components for held item")
}.first
val componentMap = JsonOps.INSTANCE.withDecoder(DataComponentMap.CODEC).apply(json.get("nbt")).result().getOrNull()?.first
val item = json.get("item").asString
val percentage = json.get("percentage")?.asDouble ?: 100.0
return PossibleHeldItem(
@@ -10,6 +10,12 @@ package com.cobblemon.mod.common.util.adapters
import com.cobblemon.mod.common.api.riding.behaviour.RidingBehaviourSettings
import com.cobblemon.mod.common.api.riding.behaviour.types.*
import com.cobblemon.mod.common.api.riding.behaviour.types.composite.CompositeBehaviour
import com.cobblemon.mod.common.api.riding.behaviour.types.composite.CompositeSettings
import com.cobblemon.mod.common.api.riding.behaviour.types.composite.strategies.FallCompositeSettings
import com.cobblemon.mod.common.api.riding.behaviour.types.composite.strategies.FallStrategy
import com.cobblemon.mod.common.api.riding.behaviour.types.composite.strategies.JumpStrategy
import com.cobblemon.mod.common.api.riding.behaviour.types.composite.strategies.RunStrategy
import com.cobblemon.mod.common.util.asIdentifierDefaultingNamespace
import com.google.gson.JsonDeserializationContext
import com.google.gson.JsonDeserializer
@@ -23,26 +29,41 @@ import java.lang.reflect.Type
* @author landonjw
*/
object RidingBehaviourSettingsAdapter : JsonDeserializer<RidingBehaviourSettings> {
val types: MutableMap<ResourceLocation, Class<out RidingBehaviourSettings>> = mutableMapOf(
BirdAirBehaviour.KEY to BirdAirSettings::class.java,
val types: MutableMap<ResourceLocation, Class<out RidingBehaviourSettings>> = mutableMapOf(BirdAirBehaviour.KEY to BirdAirSettings::class.java,
DolphinBehaviour.KEY to DolphinSettings::class.java,
FallToGlideCompositeBehaviour.KEY to FallToGlideCompositeSettings::class.java,
GenericLandBehaviour.KEY to GenericLandSettings::class.java,
GenericSwimBehaviour.KEY to GenericSwimSettings::class.java,
GliderAirBehaviour.KEY to GliderAirSettings::class.java,
HelicopterBehaviour.KEY to HelicopterSettings::class.java,
JetAirBehaviour.KEY to JetAirSettings::class.java,
JumpToFlightCompositeBehaviour.KEY to JumpToFlightCompositeSettings::class.java,
RunToJetCompositeBehaviour.KEY to RunToJetCompositeSettings::class.java,
SwimDashBehaviour.KEY to SwimDashSettings::class.java,
VehicleLandBehaviour.KEY to VehicleLandSettings::class.java
VehicleLandBehaviour.KEY to VehicleLandSettings::class.java,
CompositeBehaviour.KEY to CompositeSettings::class.java,
/*
Strategy registration. if you do not register a strategy here, it will not be deserialized.
Register to CompositeSettings if you do not need to define a subclass.
*/
FallStrategy.key to FallCompositeSettings::class.java,
JumpStrategy.key to CompositeSettings::class.java,
RunStrategy.key to CompositeSettings::class.java,
)
override fun deserialize(element: JsonElement, type: Type, context: JsonDeserializationContext): RidingBehaviourSettings {
val root = element.asJsonObject
val key = root.get("key").asString
val behaviourType = types[key.asIdentifierDefaultingNamespace()] ?: throw IllegalArgumentException("Unknown controller: $key")
val settings: RidingBehaviourSettings = context.deserialize(element, behaviourType)
return settings
val keyIdentifier = key.asIdentifierDefaultingNamespace()
if (keyIdentifier == CompositeBehaviour.KEY) {
val strategy = root.get("transitionStrategy").asString
val strategyIdentifier = strategy.asIdentifierDefaultingNamespace()
val behaviourType = types[strategyIdentifier] ?: throw IllegalArgumentException("Unknown strategy for composite behaviour: $strategy")
val settings: RidingBehaviourSettings = context.deserialize(root, behaviourType)
return settings
}
else {
val behaviourType = types[keyIdentifier] ?: throw IllegalArgumentException("Unknown behaviour: $key")
val settings: RidingBehaviourSettings = context.deserialize(element, behaviourType)
return settings
}
}
}
@@ -2741,14 +2741,6 @@
}
}
}
},
"animation.pidgeot.cry": {
"animation_length": 1.33333,
"sound_effects": {
"0.04": {
"effect": "pokemon.pidgeot.cry"
}
}
}
}
}
@@ -888,7 +888,7 @@
},
"sound_effects": {
"0.0": {
"effect": "pokemon.ponyta_galar.cry"
"effect": "pokemon.ponyta_galarian.cry"
}
}
},
@@ -1867,7 +1867,7 @@
},
"sound_effects": {
"0.1667": {
"effect": "pokemon.rapidash_galar.cry"
"effect": "pokemon.rapidash_galarian.cry"
}
}
},
@@ -2,521 +2,191 @@
"format_version": "1.8.0",
"animations": {
"animation.eevee.ground_idle": {
"loop": true,
"bones": {
"head": {
"rotation": [0, 0, "math.clamp(math.sin(q.anim_time*90*4+45)*0.2,-1.2,1.2)"],
"position": [0, "math.clamp(math.sin(q.anim_time*90*4+180-20)*0.01,-0.03,0.03)+math.clamp(math.sin(q.anim_time*90*4+180-20)*0.01,-0.5,0.5)", 0]
},
"ear_right": {
"rotation": [0, 0, "(math.sin(q.anim_time*90*4+90)*1-1)*1"]
},
"ear_left": {
"rotation": [0, 0, "-(math.sin(q.anim_time*90*4+90)*1-1)*1"]
},
"tail": {
"rotation": ["math.clamp(3*(math.sin(q.anim_time*90*2+90)*1-1),0,7)-(math.sin(q.anim_time*90*2+90)*1)*3", 0, 0]
},
"leg_front_right": {
"rotation": ["-math.sin(q.anim_time*90*2)*0.2", 0, 0]
},
"leg_front_left": {
"rotation": ["-math.sin(q.anim_time*90*2)*0.2", 0, 0]
},
"leg_back_right": {
"rotation": ["-math.sin(q.anim_time*90*2)*0.2", 0, 0]
},
"leg_back_left": {
"rotation": ["-math.sin(q.anim_time*90*2)*0.2", 0, 0]
},
"torso": {
"rotation": ["math.sin(q.anim_time*90*2)*0.2", 0, 0],
"position": [0, "math.clamp(math.sin(q.anim_time*90*4+180)*0.02,-0.03,0.03)+math.clamp(math.sin(q.anim_time*90*4+180)*0.03,-0.5,0.5)", 0]
}
}
},
"animation.eevee.ground_walk": {
"loop": true,
"bones": {
"body": {
"rotation": ["5*(math.sin(q.anim_time*90*4*2-90)*1+1)-math.clamp(10*(math.sin(q.anim_time*90*4*2+45)*1+1),15,20)+15", 0, 0],
"position": [
0,
"math.clamp(math.sin(q.anim_time*90*4*2+45)*1,0.5,2)-0.5+math.clamp(math.sin(q.anim_time*90*4*2)*1,0,2)",
"-math.clamp(math.sin(q.anim_time*90*4*2-30)*2,0,2)+math.clamp(math.sin(-q.anim_time*90*4*2-30)*1,0,2)"
]
},
"head": {
"rotation": ["-5*(math.sin(q.anim_time*90*4*2-90)*1+1)+math.clamp(10*(math.sin(q.anim_time*90*4*2+45)*1+1),15,20)-15", 0, 0]
},
"tail": {
"rotation": ["-5-math.sin(q.anim_time*90*4*2+60)*10", 0, 0],
"position": [0, 0, -0.5]
},
"leg_front_right": {
"rotation": [
"5+math.clamp(math.sin(-q.anim_time*90*4*1-20)*30,-40,0)+math.clamp(math.sin(q.anim_time*90*4*1+20)*30,-40,0)+math.clamp(math.sin(-q.anim_time*90*4*2-40)*50,0,70)-math.clamp(math.sin(-q.anim_time*90*4*2-30+180)*20,5,70)+5",
0,
0
]
},
"leg_front_left": {
"rotation": [
"5+math.clamp(math.sin(-q.anim_time*90*4*1-20+30)*30,-40,0)+math.clamp(math.sin(q.anim_time*90*4*1+20-30)*30,-40,0)+math.clamp(math.sin(-q.anim_time*90*4*2-40+30)*50,0,70)-math.clamp(math.sin(-q.anim_time*90*4*2-30+180+30)*20,5,70)+5",
0,
0
]
},
"leg_back_right": {
"rotation": ["math.clamp(math.sin(q.anim_time*90*4*2)*40,0,50)-math.clamp(math.sin(-q.anim_time*90*4*2)*40,0,50)", 0, 0],
"position": [
-0.1,
"-math.clamp(math.sin(q.anim_time*90*4*2)*0.3,-1,2)-math.clamp(math.sin(-q.anim_time*90*4*2)*0.8,-1,2)",
"math.clamp(math.sin(q.anim_time*90*4*2-30)*0.5,0,2)-math.clamp(math.sin(q.anim_time*90*4*2-30+180)*0.5,0,2)"
]
},
"leg_back_left": {
"rotation": ["math.clamp(math.sin(q.anim_time*90*4*2+20)*40,0,50)-math.clamp(math.sin(-q.anim_time*90*4*2-20)*40,0,50)", 0, 0],
"position": [
0.1,
"-math.clamp(math.sin(q.anim_time*90*4*2)*0.3,-1,2)-math.clamp(math.sin(-q.anim_time*90*4*2)*0.8,0,2)",
"math.clamp(math.sin(q.anim_time*90*4*2-30)*0.5,0,2)-math.clamp(math.sin(q.anim_time*90*4*2-30+180)*0.5,0,2)"
]
"position": [0, -0.3, 0]
},
"ear_right": {
"rotation": [
"-30-5*math.sin(q.anim_time*90*4*2+45)-math.clamp(4*math.sin(q.anim_time*90*4*2+90),-2,2)",
5,
"-30+5*math.sin(q.anim_time*90*4*2-135)+math.clamp(4*math.sin(q.anim_time*90*4*2-90),-2,2)"
]
"rotation": [10, 0, 10]
},
"ear2_right": {
"rotation": [0, -10, 0]
},
"ear_left": {
"rotation": [
"-30-5*math.sin(q.anim_time*90*4*2+45)-math.clamp(4*math.sin(q.anim_time*90*4*2+90),-2,2)",
-5,
"30-5*math.sin(q.anim_time*90*4*2-135)-math.clamp(4*math.sin(q.anim_time*90*4*2-90),-2,2)"
]
"rotation": [10, 0, -10]
},
"leg_front_right2": {
"rotation": ["-math.clamp(math.sin(-q.anim_time*90*4*2-90)*20,5,70)+5-math.clamp(math.sin(-q.anim_time*90*4*2+180)*10,5,70)+5", 0, 0]
"ear2_left": {
"rotation": [0, 10, 0]
},
"leg_front_right3": {
"rotation": ["12*math.sin(q.anim_time*90*8+30)-math.clamp(math.sin(q.anim_time*90*8),1,1)", 0, 0]
"tail1": {
"rotation": [20, 0, 0]
},
"leg_front_left2": {
"rotation": ["-math.clamp(math.sin(-q.anim_time*90*8-90+30)*20,5,70)+5-math.clamp(math.sin(-q.anim_time*90*8+180+30)*10,5,70)+5", 0, 0]
"tail2": {
"rotation": [10, 0, 0]
},
"leg_front_left3": {
"rotation": ["8*math.sin(q.anim_time*90*8+30-90)-math.clamp(math.sin(q.anim_time*90*8-90),1,1)", 0, 0]
"tail3": {
"rotation": [10, 0, 0]
},
"leg_back_right2": {
"rotation": ["math.clamp(math.sin(q.anim_time*90*8-180-30)*20,0,10)-math.clamp(math.sin(-q.anim_time*90*8-90)*20,0,50)", 0, 0]
"tail4": {
"rotation": [10, 0, 0]
},
"leg_back_right3": {
"rotation": ["20+20*math.sin(q.anim_time*90*8+45-30)-math.clamp(math.sin(q.anim_time*90*8+90-30),1,1)", 0, 0]
"front_leg_left": {
"rotation": [15, 0, 0],
"position": [0, -0.2, 0]
},
"leg_back_left2": {
"rotation": ["math.clamp(math.sin(q.anim_time*90*8-90)*5,0,5)-math.clamp(math.sin(-q.anim_time*90*8-90)*10,0,10)", 0, 0]
"elbow_left": {
"rotation": [-20, 0, 0]
},
"leg_back_left3": {
"rotation": ["20+20*math.sin(q.anim_time*90*8+15)-math.clamp(math.sin(q.anim_time*90*8+90),1,1)", 0, 0]
}
}
},
"animation.eevee.special_attack": {
"loop": true,
"animation_length": 3,
"bones": {
"head": {
"rotation": {
"0.0": [0, 0, "math.clamp(math.sin(q.anim_time*90*4+45)*0.2,-1.2,1.2)"],
"0.2083": [0, 0, "math.clamp(math.sin(q.anim_time*90*4+45)*0.2,-1.2,1.2)"],
"1.0": [-17.5, 0, "0+math.clamp(math.sin(q.anim_time*90*4+45)*0.2,-1.2,1.2)"],
"2.5": [-17.5, 0, "0+math.clamp(math.sin(q.anim_time*90*4+45)*0.2,-1.2,1.2)"],
"2.6667": [2.5, 0, "0+math.clamp(math.sin(q.anim_time*90*4+45)*0.2,-1.2,1.2)"],
"2.875": [-2.5, 0, "0+math.clamp(math.sin(q.anim_time*90*4+45)*0.2,-1.2,1.2)"],
"3.0": [0, 0, "math.clamp(math.sin(q.anim_time*90*4+45)*0.2,-1.2,1.2)"]
},
"position": {
"0.0": [0, "math.clamp(math.sin(q.anim_time*90*4+180-20)*0.01,-0.03,0.03)+math.clamp(math.sin(q.anim_time*90*4+180-20)*0.01,-0.5,0.5)", 0],
"0.2083": [0, "math.clamp(math.sin(q.anim_time*90*4+180-20)*0.01,-0.03,0.03)+math.clamp(math.sin(q.anim_time*90*4+180-20)*0.01,-0.5,0.5)", 0],
"0.9583": [0, "math.clamp(math.sin(q.anim_time*90*4+180-20)*0.01,-0.03,0.03)+math.clamp(math.sin(q.anim_time*90*4+180-20)*0.01,-0.5,0.5)", 0],
"1.125": [0, "math.clamp(math.sin(q.anim_time*90*4+180-20)*0.01,-0.03,0.03)+math.clamp(math.sin(q.anim_time*90*4+180-20)*0.01,-0.5,0.5)", -0.1],
"1.3333": [0, "math.clamp(math.sin(q.anim_time*90*4+180-20)*0.01,-0.03,0.03)+math.clamp(math.sin(q.anim_time*90*4+180-20)*0.01,-0.5,0.5)", 0],
"2.5": [0, "math.clamp(math.sin(q.anim_time*90*4+180-20)*0.01,-0.03,0.03)+math.clamp(math.sin(q.anim_time*90*4+180-20)*0.01,-0.5,0.5)", 0],
"2.6667": [0, "math.clamp(math.sin(q.anim_time*90*4+180-20)*0.01,-0.03,0.03)+math.clamp(math.sin(q.anim_time*90*4+180-20)*0.01,-0.5,0.5)", 0],
"2.875": [0, "math.clamp(math.sin(q.anim_time*90*4+180-20)*0.01,-0.03,0.03)+math.clamp(math.sin(q.anim_time*90*4+180-20)*0.01,-0.5,0.5)", 0],
"3.0": [0, "math.clamp(math.sin(q.anim_time*90*4+180-20)*0.01,-0.03,0.03)+math.clamp(math.sin(q.anim_time*90*4+180-20)*0.01,-0.5,0.5)", 0]
}
"frontpaw_left": {
"rotation": [5, 0, 0]
},
"ear_right": {
"rotation": {
"0.0": [0, 0, "(math.sin(q.anim_time*90*4+90)*1-1)*1"],
"0.2083": [0, 0, "(math.sin(q.anim_time*90*4+90)*1-1)*1"],
"0.5833": [7.76316, 0, "0+(math.sin(q.anim_time*90*4+90)*1-1)*1"],
"1.0": [-10, 0, "(math.sin(q.anim_time*90*4+90)*1-1)*1"],
"1.1667": [2.5, 0, "0+(math.sin(q.anim_time*90*4+90)*1-1)*1"],
"1.4167": [0, 0, "(math.sin(q.anim_time*90*4+90)*1-1)*1"],
"2.5": [0, 0, "(math.sin(q.anim_time*90*4+90)*1-1)*1"],
"2.6667": [0, 0, "(math.sin(q.anim_time*90*4+90)*1-1)*1"],
"2.875": [0, 0, "(math.sin(q.anim_time*90*4+90)*1-1)*1"],
"3.0": [0, 0, "(math.sin(q.anim_time*90*4+90)*1-1)*1"]
}
"front_leg_right": {
"rotation": [15, 0, 0],
"position": [0, -0.2, 0]
},
"ear_left": {
"rotation": {
"0.0": [0, 0, "-(math.sin(q.anim_time*90*4+90)*1-1)*1"],
"0.2083": [0, 0, "-(math.sin(q.anim_time*90*4+90)*1-1)*1"],
"0.5833": [7.76316, 0, 1.86603],
"1.0": [-10, 0, "0-(math.sin(q.anim_time*90*4+90)*1-1)*1"],
"1.1667": [2.5, 0, "0-(math.sin(q.anim_time*90*4+90)*1-1)*1"],
"1.4167": [0, 0, "-(math.sin(q.anim_time*90*4+90)*1-1)*1"],
"2.5": [0, 0, "-(math.sin(q.anim_time*90*4+90)*1-1)*1"],
"2.6667": [0, 0, "-(math.sin(q.anim_time*90*4+90)*1-1)*1"],
"2.875": [0, 0, "-(math.sin(q.anim_time*90*4+90)*1-1)*1"],
"3.0": [0, 0, "-(math.sin(q.anim_time*90*4+90)*1-1)*1"]
}
"elbow_right": {
"rotation": [-20, 0, 0]
},
"tail": {
"rotation": {
"0.0": ["math.clamp(3*(math.sin(q.anim_time*90*2+90)*1-1),0,7)-(math.sin(q.anim_time*90*2+90)*1)*3", 0, 0],
"0.2083": ["math.clamp(3*(math.sin(q.anim_time*90*2+90)*1-1),0,7)-(math.sin(q.anim_time*90*2+90)*1)*3", 0, 0],
"0.625": ["-20+math.clamp(3*(math.sin(q.anim_time*90*2+90)*1-1),0,7)-(math.sin(q.anim_time*90*2+90)*1)*3", 0, 0],
"0.9167": ["12.5+math.clamp(3*(math.sin(q.anim_time*90*2+90)*1-1),0,7)-(math.sin(q.anim_time*90*2+90)*1)*3", 0, 0],
"1.0833": ["22.5+math.clamp(3*(math.sin(q.anim_time*90*2+90)*1-1),0,7)-(math.sin(q.anim_time*90*2+90)*1)*3", 0, 0],
"1.5417": ["12.5+math.clamp(3*(math.sin(q.anim_time*90*2+90)*1-1),0,7)-(math.sin(q.anim_time*90*2+90)*1)*3", 0, 0],
"2.5": ["12.5+math.clamp(3*(math.sin(q.anim_time*90*2+90)*1-1),0,7)-(math.sin(q.anim_time*90*2+90)*1)*3", 0, 0],
"2.875": ["math.clamp(3*(math.sin(q.anim_time*90*2+90)*1-1),0,7)-(math.sin(q.anim_time*90*2+90)*1)*3", 0, 0],
"3.0": ["math.clamp(3*(math.sin(q.anim_time*90*2+90)*1-1),0,7)-(math.sin(q.anim_time*90*2+90)*1)*3", 0, 0]
}
"frontpaw_right": {
"rotation": [5, 0, 0]
},
"leg_front_right": {
"rotation": {
"0.0": ["-math.sin(q.anim_time*90*2)*0.2", 0, 0],
"0.2083": ["17.5-math.sin(q.anim_time*90*2)*0.2", 0, 0],
"0.625": ["7.5-math.sin(q.anim_time*90*2)*0.2", 0, 0],
"1.0": ["-12.4907-math.sin(q.anim_time*90*2)*0.2", 0.43399, 2.46207],
"2.5": ["-12.4907-math.sin(q.anim_time*90*2)*0.2", 0.43399, 2.46207],
"2.6667": ["-math.sin(q.anim_time*90*2)*0.2", 0, 0],
"2.875": ["-math.sin(q.anim_time*90*2)*0.2", 0, 0],
"3.0": ["-math.sin(q.anim_time*90*2)*0.2", 0, 0]
}
"back_leg_left": {
"rotation": [7.5, 0, 0]
},
"leg_front_left": {
"rotation": {
"0.0": ["-math.sin(q.anim_time*90*2)*0.2", 0, 0],
"0.2083": ["17.5-math.sin(q.anim_time*90*2)*0.2", 0, 0],
"0.625": ["7.5-math.sin(q.anim_time*90*2)*0.2", 0, 0],
"1.0": ["-12.4907-math.sin(q.anim_time*90*2)*0.2", -0.43399, -2.46207],
"2.5": ["-12.4907-math.sin(q.anim_time*90*2)*0.2", -0.43399, -2.46207],
"2.6667": ["-math.sin(q.anim_time*90*2)*0.2", 0, 0],
"2.875": ["-math.sin(q.anim_time*90*2)*0.2", 0, 0],
"3.0": ["-math.sin(q.anim_time*90*2)*0.2", 0, 0]
}
"ankle_left": {
"rotation": [-7.5, 0, 0]
},
"leg_back_right": {
"rotation": {
"0.0": ["-math.sin(q.anim_time*90*2)*0.2", 0, 0],
"0.2083": ["12.5-math.sin(q.anim_time*90*2)*0.2", 0, 0],
"0.625": ["17.5-math.sin(q.anim_time*90*2)*0.2", 0, 0],
"1.0": ["-14.9813-math.sin(q.anim_time*90*2)*0.2", 0.44221, 4.98047],
"2.5": ["-14.9813-math.sin(q.anim_time*90*2)*0.2", 0.44221, 4.98047],
"2.6667": ["-math.sin(q.anim_time*90*2)*0.2", 0, 0],
"2.875": ["-math.sin(q.anim_time*90*2)*0.2", 0, 0],
"3.0": ["-math.sin(q.anim_time*90*2)*0.2", 0, 0]
}
"back_leg_right": {
"rotation": [7.5, 0, 0]
},
"leg_back_left": {
"rotation": {
"0.0": ["-math.sin(q.anim_time*90*2)*0.2", 0, 0],
"0.2083": ["12.5-math.sin(q.anim_time*90*2)*0.2", 0, 0],
"0.625": ["17.5-math.sin(q.anim_time*90*2)*0.2", 0, 0],
"1.0": ["-14.9813-math.sin(q.anim_time*90*2)*0.2", -0.44221, -4.98047],
"2.5": ["-14.9813-math.sin(q.anim_time*90*2)*0.2", -0.44221, -4.98047],
"2.6667": ["-math.sin(q.anim_time*90*2)*0.2", 0, 0],
"2.875": ["-math.sin(q.anim_time*90*2)*0.2", 0, 0],
"3.0": ["-math.sin(q.anim_time*90*2)*0.2", 0, 0]
}
},
"torso": {
"rotation": {
"0.0": ["math.sin(q.anim_time*90*2)*0.2", 0, 0],
"0.2083": ["5+math.sin(q.anim_time*90*2)*0.2", 0, 0],
"0.625": ["math.sin(q.anim_time*90*2)*0.2", 0, 0],
"1.0": ["5+math.sin(q.anim_time*90*2)*0.2", 0, 0],
"1.125": ["7.5+math.sin(q.anim_time*90*2)*0.2", 0, 0],
"1.4167": ["5+math.sin(q.anim_time*90*2)*0.2", 0, 0],
"2.5": ["5+math.sin(q.anim_time*90*2)*0.2", 0, 0],
"2.6667": ["10+math.sin(q.anim_time*90*2)*0.2", 0, 0],
"2.875": ["-2.5+math.sin(q.anim_time*90*2)*0.2", 0, 0],
"3.0": ["math.sin(q.anim_time*90*2)*0.2", 0, 0]
},
"position": {
"0.0": [0, "math.clamp(math.sin(q.anim_time*90*4+180)*0.02,-0.03,0.03)+math.clamp(math.sin(q.anim_time*90*4+180)*0.03,-0.5,0.5)", 0],
"0.2083": [0, "math.clamp(math.sin(q.anim_time*90*4+180)*0.02,-0.03,0.03)+math.clamp(math.sin(q.anim_time*90*4+180)*0.03,-0.5,0.5)", 0],
"0.9583": [0, "math.clamp(math.sin(q.anim_time*90*4+180)*0.02,-0.03,0.03)+math.clamp(math.sin(q.anim_time*90*4+180)*0.03,-0.5,0.5)", 0],
"1.0833": [0, "-0.2+math.clamp(math.sin(q.anim_time*90*4+180)*0.02,-0.03,0.03)+math.clamp(math.sin(q.anim_time*90*4+180)*0.03,-0.5,0.5)", -0.2],
"1.25": [0, "math.clamp(math.sin(q.anim_time*90*4+180)*0.02,-0.03,0.03)+math.clamp(math.sin(q.anim_time*90*4+180)*0.03,-0.5,0.5)", 0],
"2.5": [0, "math.clamp(math.sin(q.anim_time*90*4+180)*0.02,-0.03,0.03)+math.clamp(math.sin(q.anim_time*90*4+180)*0.03,-0.5,0.5)", 0],
"2.6667": [0, "math.clamp(math.sin(q.anim_time*90*4+180)*0.02,-0.03,0.03)+math.clamp(math.sin(q.anim_time*90*4+180)*0.03,-0.5,0.5)", 0],
"2.875": [0, "0.1+math.clamp(math.sin(q.anim_time*90*4+180)*0.02,-0.03,0.03)+math.clamp(math.sin(q.anim_time*90*4+180)*0.03,-0.5,0.5)", 0],
"3.0": [0, "math.clamp(math.sin(q.anim_time*90*4+180)*0.02,-0.03,0.03)+math.clamp(math.sin(q.anim_time*90*4+180)*0.03,-0.5,0.5)", 0]
}
},
"body": {
"rotation": {
"0.0": [0, 0, 0],
"0.2083": [0, 0, 0],
"0.625": [-12.5, 0, 0],
"1.0": [15, 0, 0],
"2.5": [15, 0, 0],
"2.6667": [0, 0, 0],
"2.875": [0, 0, 0],
"3.0": [0, 0, 0]
},
"position": {
"0.0": [0, 0, 0],
"0.2083": [0, -0.6, -1.4],
"0.625": [0, 0, -0.9],
"1.0": [0, 0, 0],
"2.5": [0, 0, 0],
"2.6667": [0, 0, 0],
"2.875": [0, 0, 0],
"3.0": [0, 0, 0]
}
},
"mouth_closed": {
"rotation": {
"0.0": [0, 0, 0],
"0.2083": [0, 0, 0],
"1.0": [0, 0, 0],
"2.6667": [0, 0, 0],
"2.875": [0, 0, 0],
"3.0": [0, 0, 0]
}
},
"mouth_open": {
"position": {
"0.0": [0, 0, 0],
"0.9583": [0, 0, 0],
"1.0": [0, 0, -0.1],
"2.4583": [0, 0, -0.1],
"2.5": [0, 0, 0],
"2.6667": [0, 0, 0],
"2.875": [0, 0, 0],
"3.0": [0, 0, 0]
}
},
"eyelid_right": {
"rotation": {
"0.0": [0, 0, 0],
"2.6667": [0, 0, 0],
"2.875": [0, 0, 0],
"3.0": [0, 0, 0]
},
"position": {
"0.0": [0, 0, 0],
"0.1667": [0, 0, 0],
"0.2083": [0, 0, -0.1],
"0.6667": [0, 0, -0.1],
"0.7083": [0, 0, 0],
"2.6667": [0, 0, 0],
"2.875": [0, 0, 0],
"3.0": [0, 0, 0]
}
},
"eyelid_left": {
"rotation": {
"0.0": [0, 0, 0],
"2.6667": [0, 0, 0],
"2.875": [0, 0, 0],
"3.0": [0, 0, 0]
},
"position": {
"0.0": [0, 0, 0],
"0.1667": [0, 0, 0],
"0.2083": [0, 0, -0.1],
"0.6667": [0, 0, -0.1],
"0.7083": [0, 0, 0],
"2.6667": [0, 0, 0],
"2.875": [0, 0, 0],
"3.0": [0, 0, 0]
}
},
"leg_front_right2": {
"rotation": {
"0.0": [0, 0, 0],
"0.2083": [-10, 0, 0],
"0.625": [20, 0, 0],
"1.0": [-20, 0, 0],
"2.5": [-20, 0, 0],
"2.6667": [0, 0, 0],
"2.875": [0, 0, 0],
"3.0": [0, 0, 0]
}
},
"leg_front_right3": {
"rotation": {
"0.0": [0, 0, 0],
"0.2083": [0, 0, 0],
"0.625": [10, 0, 0],
"1.0": [19.97314, 1.60667, -1.91561],
"2.5": [19.97314, 1.60667, -1.91561],
"2.6667": [0, 0, 0],
"2.875": [0, 0, 0],
"3.0": [0, 0, 0]
}
},
"leg_front_left2": {
"rotation": {
"0.0": [0, 0, 0],
"0.2083": [-10, 0, 0],
"0.625": [20, 0, 0],
"1.0": [-20, 0, 0],
"2.5": [-20, 0, 0],
"2.6667": [0, 0, 0],
"2.875": [0, 0, 0],
"3.0": [0, 0, 0]
}
},
"leg_front_left3": {
"rotation": {
"0.0": [0, 0, 0],
"0.2083": [0, 0, 0],
"1.0": [19.97314, -1.60667, 1.91561],
"2.5": [19.97314, -1.60667, 1.91561],
"2.6667": [0, 0, 0],
"2.875": [0, 0, 0],
"3.0": [0, 0, 0]
}
},
"leg_back_right2": {
"rotation": {
"0.0": [0, 0, 0],
"0.2083": [-12.5, 0, 0],
"0.625": [-17.5, 0, 0],
"1.0": [20, 0, 0],
"2.5": [20, 0, 0],
"2.6667": [0, 0, 0],
"2.875": [0, 0, 0],
"3.0": [0, 0, 0]
}
},
"leg_back_right3": {
"rotation": {
"0.0": [0, 0, 0],
"0.2083": [0, 0, 0],
"0.625": [10, 0, 0],
"1.0": [15, 0, 0],
"2.5": [15, 0, 0],
"2.6667": [0, 0, 0],
"2.875": [0, 0, 0],
"3.0": [0, 0, 0]
}
},
"leg_back_left2": {
"rotation": {
"0.0": [0, 0, 0],
"0.2083": [-12.5, 0, 0],
"0.625": [-17.5, 0, 0],
"1.0": [20, 0, 0],
"2.5": [20, 0, 0],
"2.6667": [0, 0, 0],
"2.875": [0, 0, 0],
"3.0": [0, 0, 0]
}
},
"leg_back_left3": {
"rotation": {
"0.0": [0, 0, 0],
"0.2083": [0, 0, 0],
"0.625": [10, 0, 0],
"1.0": [15, 0, 0],
"2.5": [15, 0, 0],
"2.6667": [0, 0, 0],
"2.875": [0, 0, 0],
"3.0": [0, 0, 0]
}
"ankle_right": {
"rotation": [-7.5, 0, 0]
}
}
},
"animation.eevee.blink": {
"animation_length": 0.16667,
"animation_length": 0.1667,
"bones": {
"eyelid_right": {
"position": {
"0.0": [0, 0, -0.1],
"0.125": [0, 0, -0.1],
"0.1667": [0, 0, 0]
}
},
"eyelid_left": {
"position": {
"0.0": [0, 0, -0.1],
"0.125": [0, 0, -0.1],
"0.1667": [0, 0, 0]
"0.1667": {
"pre": [0, 0, -0.1],
"post": [0, 0, 0]
}
}
},
"eyelid_right": {
"position": {
"0.0": [0, 0, -0.1],
"0.1667": {
"pre": [0, 0, -0.1],
"post": [0, 0, 0]
}
}
}
}
},
"animation.eevee.cry": {
"animation_length": 1.25,
"animation.eevee.pose": {
"loop": true,
"bones": {
"body": {
"position": [0, 1, 0]
},
"torso": {
"rotation": {
"0.0": {
"post": [0, 0, 0],
"lerp_mode": "catmullrom"
},
"0.3333": {
"post": [-17.5, 0, 0],
"lerp_mode": "catmullrom"
},
"1.0417": {
"post": [0, 0, 0],
"lerp_mode": "catmullrom"
}
}
"rotation": [10, 0, 0]
},
"waist": {
"rotation": [-7.5, 0, 0]
},
"tail1": {
"rotation": [27.5, 0, 0]
},
"tail2": {
"rotation": [-17.5, 0, 0]
},
"tail3": {
"rotation": [25, 0, 0]
},
"tail4": {
"rotation": [27.5, 0, 0]
},
"neck": {
"rotation": [2.5, 0, 0]
},
"head": {
"rotation": {
"0.0": {
"post": [0, 0, 0],
"lerp_mode": "catmullrom"
},
"0.3333": {
"post": [-20, 0, 0],
"lerp_mode": "catmullrom"
},
"0.7083": {
"post": [0, 0, 0],
"lerp_mode": "catmullrom"
}
}
"rotation": [-5, 0, 0]
},
"mouth_open": {
"position": {
"0.0": {
"post": [0, 0, 0],
"lerp_mode": "catmullrom"
},
"0.1667": {
"post": [0, 0, -0.1],
"lerp_mode": "catmullrom"
},
"0.5833": {
"post": [0, 0, -0.1],
"lerp_mode": "catmullrom"
},
"0.75": {
"post": [0, 0, 0],
"lerp_mode": "catmullrom"
}
}
"hair_left": {
"rotation": [-62.5, 0, 0]
},
"ear_left": {
"rotation": [30, -22.5, 0]
},
"ear2_left": {
"rotation": [0, -22.5, 0]
},
"ear_right": {
"rotation": [43.09472, 22.29711, 8.11003]
},
"ear2_right": {
"rotation": [0, 22.5, 0]
},
"back_leg_right": {
"rotation": [34.89743, -2.86544, 4.09918]
},
"knee_right": {
"rotation": [15, 0, 0]
},
"ankle_right": {
"rotation": [2.5, 0, 0]
},
"backpaw_right": {
"rotation": [25, 0, 0]
},
"back_leg_left": {
"rotation": [59.90532, 4.32875, -2.50477]
},
"knee_left": {
"rotation": [-15, 0, 0]
},
"ankle_left": {
"rotation": [20, 0, 0]
},
"backpaw_left": {
"rotation": [50, 0, 0]
},
"front_leg_right": {
"rotation": [2.5, 0, 0]
},
"elbow_right": {
"rotation": [-14.89445, 3.9649, 3.04868]
},
"frontpaw_right": {
"rotation": [7.5, 0, 0]
},
"front_leg_left": {
"rotation": [-5, 0, 0]
},
"elbow_left": {
"rotation": [-4.79887, -3.45533, -6.66067]
},
"frontpaw_left": {
"rotation": [-15, 0, 0]
},
"mouth_open_happy": {
"position": [0, -0.38, -0.1]
},
"head_angle": {
"rotation": [0, 0, 0]
}
},
}
},
"animation.eevee.cry": {
"animation_length": 1.2,
"sound_effects": {
"0.0833": {
"0.04": {
"effect": "pokemon.eevee.cry"
}
}
@@ -3,731 +3,158 @@
"animations": {
"animation.jolteon.ground_idle": {
"loop": true,
"override_previous_animation": true,
"bones": {
"head": {
"rotation": ["-math.sin(q.anim_time*90*4)*0.2", 0, "math.clamp(math.sin(q.anim_time*90*4+45)*0.2,-1.2,1.2)"]
},
"ear_right": {
"rotation": [0, 0, "-math.sin(q.anim_time*90*2+90)+0.5*math.clamp(math.sin(q.anim_time*90*2-90),-0.5,0.5)"]
},
"ear_left": {
"rotation": [0, 0, "math.sin(q.anim_time*90*2+90)-0.5*math.clamp(math.sin(q.anim_time*90*2-90),-0.5,0.5)"]
},
"torso": {
"rotation": ["math.sin(q.anim_time*90*4)*0.2", 0, 0],
"position": [0, "(math.clamp(math.sin(q.anim_time*90*4+180)*0.1,-0.03,0.03)+math.clamp(math.sin(q.anim_time*90*2+180)*0.15,-0.5,0.5))*0.5", 0]
},
"ruff": {
"rotation": [0, "-2*math.sin(q.anim_time*90*4)+math.clamp(3*math.sin(q.anim_time*90*4),-3,3)", 0]
},
"spikes": {
"rotation": [0, "-2*math.sin(q.anim_time*90*4+90)+math.clamp(3*math.sin(q.anim_time*90*4+90),-3,3)", 0]
}
}
},
"animation.jolteon.ground_walk": {
"loop": true,
"override_previous_animation": true,
"bones": {
"body": {
"rotation": [0, 0, "math.clamp(math.sin(q.anim_time*90*4-90)*1,-0.8,0.8)+math.sin(q.anim_time*90*4-180)*1"],
"position": [0, "-1.5+math.clamp(math.sin(q.anim_time*90*4)*1.1,0.5,1)+math.clamp(math.sin(q.anim_time*90*4+180)*1.1,0.5,1)", 0]
},
"head": {
"rotation": [0, 0, "-math.clamp(math.sin(q.anim_time*90*4-90)*1,-0.8,0.8)-math.sin(q.anim_time*90*4-180)*1"],
"position": [
"math.sin(q.anim_time*90*4-45)*0.1",
"math.clamp(math.sin(q.anim_time*90*4+30)*0.05,0.5,1)+math.clamp(math.sin(-q.anim_time*90*4+30)*0.05,0.5,1)+math.sin(-q.anim_time*90*8+30)*0.2-1",
0
]
},
"leg_front_right": {
"rotation": [
"30-math.clamp(20*(math.sin(q.anim_time*90*4-90+180)*1+1),-0,60)",
0,
"math.clamp(math.sin(q.anim_time*90*4-90+180)*1,-0.8,0.8)+math.sin(q.anim_time*90*4-180+180)*1"
],
"position": [
0,
"-0.5+0.8*(math.clamp(math.sin(q.anim_time*90*4-155+180)*1.6,1,1.6)-0.2)+0.5*(math.clamp(math.sin(q.anim_time*90*4-75+180)*1.8,1,1.8)-1)-0.2*(math.clamp(math.sin(q.anim_time*90*4+180)*1.4,1,1.4)+1)",
0
]
},
"leg_front_left": {
"rotation": [
"30-math.clamp(20*(math.sin(q.anim_time*90*4-90)*1+1),-0,60)",
0,
"-math.clamp(math.sin(q.anim_time*90*4-90)*1,-0.8,0.8)-math.sin(q.anim_time*90*4-180)*1"
],
"position": [
0,
"-0.5+0.8*(math.clamp(math.sin(q.anim_time*90*4-155)*1.6,1,1.6)-0.2)+0.5*(math.clamp(math.sin(q.anim_time*90*4-75)*1.8,1,1.8)-1)-0.2*(math.clamp(math.sin(q.anim_time*90*4)*1.4,1,1.4)+1)",
0
]
},
"leg_back_right": {
"rotation": [
"-20+math.clamp(15*(math.sin(q.anim_time*90*4-90+180)*1+1),-0,60)",
0,
"math.clamp(math.sin(q.anim_time*90*4-90+180)*1,-0.8,0.8)+math.sin(q.anim_time*90*4-180+180)*1"
],
"position": [
0,
"-math.clamp(-math.sin(q.anim_time*90*4+90+180)*0.01,0,0.01)+math.clamp(-math.sin(q.anim_time*90*4+20+180)*1,0.4,1)-0.4+math.clamp(math.sin(q.anim_time*90*4-130+180)*1.5,0.4,0.6)-0.3",
-0.1
]
},
"leg_back_left": {
"rotation": [
"-20+math.clamp(15*(math.sin(q.anim_time*90*4-90)*1+1),-0,60)",
0,
"-math.clamp(math.sin(q.anim_time*90*4-90)*1,-0.8,0.8)-math.sin(q.anim_time*90*4-180)*1"
],
"position": [
0,
"-math.clamp(-math.sin(q.anim_time*90*4+90)*0.01,0,0.01)+math.clamp(-math.sin(q.anim_time*90*4+20)*1,0.4,1)-0.4+math.clamp(math.sin(q.anim_time*90*4-130)*1.5,0.4,0.6)-0.3",
-0.1
]
},
"ear_right": {
"rotation": [
"math.sin(q.anim_time*90*8+45)+math.clamp(math.sin(q.anim_time*90*8+90),-1,1)",
"0.5*math.sin(q.anim_time*90*8+45)+0.5*math.clamp(math.sin(q.anim_time*90*8+90),-2,2)",
0
]
"position": [0, -0.8, 0]
},
"ear_left": {
"rotation": [
"math.sin(q.anim_time*90*8+45)+math.clamp(math.sin(q.anim_time*90*8+90),-1,1)",
"-0.5*math.sin(q.anim_time*90*8+45)-0.5*math.clamp(math.sin(q.anim_time*90*8+90),-2,2)",
0
]
},
"leg_front_right2": {
"rotation": [
"math.clamp(math.sin(q.anim_time*90*4-180+10+180)*20,0,10)+math.clamp(math.sin(q.anim_time*90*4-180+10+180)*20,-50,50)-math.clamp(math.sin(q.anim_time*90*4+10+180)*70,50,60)+25",
0,
0
]
},
"leg_front_right3": {
"rotation": [
"-45+math.clamp(20*(math.sin(q.anim_time*90*4-90+180)*1+1),-0,60)-math.clamp(math.sin(q.anim_time*90*4-180+10+180)*20,0,10)-math.clamp(math.sin(q.anim_time*90*4-180+10+180)*20,-50,50)+math.clamp(math.sin(q.anim_time*90*4+10+180)*70,50,60)+math.clamp(math.sin(q.anim_time*90*4+40+180)*80,50,80)-60",
0,
0
],
"position": [0, "math.clamp(math.sin(q.anim_time*90*4-120+180)*1.1,0.9,1)-0.9+math.clamp(math.sin(q.anim_time*90*2-130+180)*1.3,0.9,1)-0.9", 0]
},
"leg_front_left2": {
"rotation": [
"math.clamp(math.sin(q.anim_time*90*4-180+10)*20,0,10)+math.clamp(math.sin(q.anim_time*90*4-180+10)*20,-50,50)-math.clamp(math.sin(q.anim_time*90*4+10)*70,50,60)+25",
0,
0
]
},
"leg_front_left3": {
"rotation": [
"-45+math.clamp(20*(math.sin(q.anim_time*90*4-90)*1+1),-0,60)-math.clamp(math.sin(q.anim_time*90*4-180+10)*20,0,10)-math.clamp(math.sin(q.anim_time*90*4-180+10)*20,-50,50)+math.clamp(math.sin(q.anim_time*90*4+10)*70,50,60)+math.clamp(math.sin(q.anim_time*90*4+40)*80,50,80)-60",
0,
0
],
"position": [0, "math.clamp(math.sin(q.anim_time*90*4-120)*1.1,0.9,1)-0.9+math.clamp(math.sin(q.anim_time*90*2-130)*1.3,0.9,1)-0.9", 0]
},
"leg_back_right2": {
"rotation": [
"math.clamp(math.sin(q.anim_time*90*4+180)*10,0,10)+math.clamp(math.sin(q.anim_time*90*4-95+180)*25,0,45)-math.clamp(math.sin(q.anim_time*90*4+180+180)*10,0,45)",
0,
0
],
"position": [0, "math.clamp(math.sin(q.anim_time*90*4-130+180)*1.5,0.5,0.8)-0.5", 0]
},
"leg_back_right3": {
"rotation": [
"-math.clamp(math.sin(q.anim_time*90*4+180)*10,0,10)-math.clamp(math.sin(q.anim_time*90*4-95+180)*25,0,45)+math.clamp(math.sin(q.anim_time*90*4+180+180)*15,0,45)-(-20+math.clamp(15*(math.sin(q.anim_time*90*4-90+180)*1+1),-0,60))+math.clamp(math.sin(q.anim_time*90*4-100+180)*100,60,100)-60",
0,
0
],
"position": [0, "math.clamp(math.sin(q.anim_time*90*4-110)*1,0.8,1)-0.8", 0]
},
"leg_back_left2": {
"rotation": [
"math.clamp(math.sin(q.anim_time*90*4)*10,0,10)+math.clamp(math.sin(q.anim_time*90*4-95)*25,0,45)-math.clamp(math.sin(q.anim_time*90*4+180)*10,0,45)",
0,
0
],
"position": [0, "math.clamp(math.sin(q.anim_time*90*4-130)*1.5,0.5,0.8)-0.5", 0]
},
"leg_back_left3": {
"rotation": [
"-math.clamp(math.sin(q.anim_time*90*4)*10,0,10)-math.clamp(math.sin(q.anim_time*90*4-95)*25,0,45)+math.clamp(math.sin(q.anim_time*90*4+180)*15,0,45)-(-20+math.clamp(15*(math.sin(q.anim_time*90*4-90)*1+1),-0,60))+math.clamp(math.sin(q.anim_time*90*4-100)*100,60,100)-60",
0,
0
],
"position": [0, "math.clamp(math.sin(q.anim_time*90*4-110+180)*1,0.8,1)-0.8", 0]
},
"ruff": {
"rotation": [0, "-2*math.sin(q.anim_time*90*4)+math.clamp(2*math.sin(q.anim_time*90*4),-2,2)", 0]
},
"spikes": {
"rotation": [0, "-2*math.sin(q.anim_time*90*4+90)+math.clamp(3*math.sin(q.anim_time*90*4+90),-3,3)", 0]
}
}
},
"animation.jolteon.ground_run": {
"loop": true,
"override_previous_animation": true,
"bones": {
"body": {
"rotation": ["5*(math.sin(q.anim_time*90*4*2-90)*1+1)-math.clamp(10*(math.sin(q.anim_time*90*4*2+45)*1+1),15,20)+15", 0, 0],
"position": [
0,
"math.clamp(math.sin(q.anim_time*90*4*2+45)*1,0.5,2)-0.5+math.clamp(math.sin(q.anim_time*90*4*2)*1,0,2)",
"-math.clamp(math.sin(q.anim_time*90*4*2-30)*2,0,2)+math.clamp(math.sin(-q.anim_time*90*4*2-30)*1,0,2)"
]
},
"head": {
"rotation": ["-5*(math.sin(q.anim_time*90*4*2-90)*1+1)+math.clamp(10*(math.sin(q.anim_time*90*4*2+45)*1+1),15,20)-15", 0, 0],
"position": [0, -1, -1]
},
"leg_front_right": {
"rotation": [
"5+math.clamp(math.sin(-q.anim_time*90*4*1-20)*30,-40,0)+math.clamp(math.sin(q.anim_time*90*4*1+20)*30,-40,0)+math.clamp(math.sin(-q.anim_time*90*4*2-40)*50,0,70)-math.clamp(math.sin(-q.anim_time*90*4*2-30+180)*20,5,70)+5",
0,
0
]
},
"leg_front_left": {
"rotation": [
"5+math.clamp(math.sin(-q.anim_time*90*4*1-20+30)*30,-40,0)+math.clamp(math.sin(q.anim_time*90*4*1+20-30)*30,-40,0)+math.clamp(math.sin(-q.anim_time*90*4*2-40+30)*50,0,70)-math.clamp(math.sin(-q.anim_time*90*4*2-30+180+30)*20,5,70)+5",
0,
0
]
},
"leg_back_right": {
"rotation": ["math.clamp(math.sin(q.anim_time*90*4*2)*40,0,50)-math.clamp(math.sin(-q.anim_time*90*4*2)*40,0,50)", 0, 0],
"position": [
0,
"-math.clamp(math.sin(q.anim_time*90*4*2)*0.3,-1,2)-math.clamp(math.sin(-q.anim_time*90*4*2)*0.8,-1,2)",
"-0.3+math.clamp(math.sin(q.anim_time*90*4*2-30)*0.5,0,2)-math.clamp(math.sin(q.anim_time*90*4*2-30+180)*0.5,0,2)"
]
},
"leg_back_left": {
"rotation": ["math.clamp(math.sin(q.anim_time*90*4*2+20)*40,0,50)-math.clamp(math.sin(-q.anim_time*90*4*2-20)*40,0,50)", 0, 0],
"position": [
0,
"-math.clamp(math.sin(q.anim_time*90*4*2)*0.3,-1,2)-math.clamp(math.sin(-q.anim_time*90*4*2)*0.8,0,2)",
"-0.3+math.clamp(math.sin(q.anim_time*90*4*2-30)*0.5,0,2)-math.clamp(math.sin(q.anim_time*90*4*2-30+180)*0.5,0,2)"
]
"rotation": [20, -30, 0]
},
"ear_right": {
"rotation": [
"-10-4*math.sin(q.anim_time*90*4*2+45)-math.clamp(4*math.sin(q.anim_time*90*4*2+90),-4,4)",
"5+math.sin(q.anim_time*90*4*2+45)+math.clamp(math.sin(q.anim_time*90*4*2+90),-1,1)",
0
]
"rotation": [20, 30, 0]
},
"ear_left": {
"rotation": [
"-10-4*math.sin(q.anim_time*90*4*2+45)-math.clamp(4*math.sin(q.anim_time*90*4*2+90),-4,4)",
"-5-math.sin(q.anim_time*90*4*2+45)-math.clamp(math.sin(q.anim_time*90*4*2+90),-1,1)",
0
]
"front_leg_left": {
"rotation": [7.5, -2.5, -5]
},
"leg_front_right2": {
"rotation": ["-math.clamp(math.sin(-q.anim_time*90*4*2-70)*20,5,70)+5-math.clamp(math.sin(-q.anim_time*90*4*2-30+180)*10,5,70)+5", 0, 0]
"elbow_left": {
"rotation": [-22.5, 0, 0]
},
"leg_front_right3": {
"rotation": ["12*math.sin(q.anim_time*90*8+30)-math.clamp(math.sin(q.anim_time*90*8+15),1,1)", 0, 0]
"frontpaw_left": {
"rotation": [15, 0, 5]
},
"leg_front_left2": {
"rotation": ["-math.clamp(math.sin(-q.anim_time*90*8-70+30)*20,5,70)+5-math.clamp(math.sin(-q.anim_time*90*8-30+180+30)*10,5,70)+5", 0, 0]
"front_leg_right": {
"rotation": [7.5, 2.5, 5]
},
"leg_front_left3": {
"rotation": ["12*math.sin(q.anim_time*90*8-15+30)-math.clamp(math.sin(q.anim_time*90*8-30+30),1,1)", 0, 0]
"elbow_right": {
"rotation": [-22.5, 0, 0]
},
"leg_back_right2": {
"rotation": ["math.clamp(math.sin(q.anim_time*90*8-180-30)*20,0,10)-math.clamp(math.sin(-q.anim_time*90*8-90)*20,0,50)", 0, 0]
"frontpaw_right": {
"rotation": [15, 0, -5]
},
"leg_back_right3": {
"rotation": ["20+20*math.sin(q.anim_time*90*8+45-30)-math.clamp(math.sin(q.anim_time*90*8+90-30),1,1)", 0, 0]
"backleg_left": {
"rotation": [7.5, -5, -7.5]
},
"leg_back_left2": {
"rotation": ["math.clamp(math.sin(q.anim_time*90*8-90)*5,0,5)-math.clamp(math.sin(-q.anim_time*90*8-90)*10,0,10)", 0, 0]
"ankle_left": {
"rotation": [-12.5, 0, 0]
},
"leg_back_left3": {
"rotation": ["20+20*math.sin(q.anim_time*90*8+15)-math.clamp(math.sin(q.anim_time*90*8+90),1,1)", 0, 0]
"foot_left": {
"rotation": [5, 0, 7.5]
},
"ruff": {
"rotation": ["-2.5-math.sin(q.anim_time*90*4*2+30)*7", 0, 0]
"backleg_right": {
"rotation": [7.5, 5, 7.5]
},
"spikes": {
"rotation": ["-math.sin(q.anim_time*90*4*2+45)*9", 0, 0]
"ankle_right": {
"rotation": [-12.5, 0, 0]
},
"foot_right": {
"rotation": [5, 0, -7.5]
}
}
},
"animation.jolteon.blink": {
"animation_length": 0.1667,
"bones": {
"eye_right": {
"position": {
"0.0": [0.1, 0, 0.1],
"0.1667": {"pre": [0.1, 0, 0.1], "post": [0, 0, 0]}
}
},
"eye_left": {
"position": {
"0.0": [-0.1, 0, 0.1],
"0.1667": {"pre": [-0.1, 0, 0.1], "post": [0, 0, 0]}
}
},
"eyelid_right": {
"position": {
"0.0": [-0.1, 0, -0.1],
"0.125": [-0.1, 0, -0.1],
"0.1667": [0, 0, 0]
"0.1667": {"pre": [-0.1, 0, -0.1], "post": [0, 0, 0]}
}
},
"eyelid_left": {
"position": {
"0.0": [0.1, 0, -0.1],
"0.125": [0.1, 0, -0.1],
"0.1667": [0, 0, 0]
"0.1667": {"pre": [0.1, 0, -0.1], "post": [0, 0, 0]}
}
}
}
},
"animation.jolteon.render": {
"animation.jolteon.hold_item": {
"loop": true,
"bones": {
"jaw": {
"rotation": [32.5, 0, 0]
}
}
},
"animation.jolteon.pose": {
"loop": true,
"bones": {
"body": {
"rotation": [0, 47.5, 0]
},
"torso": {
"rotation": [-7.5, 0, 0]
"rotation": [20, 0, 0]
},
"leg_front_right": {
"rotation": [0, 0, -5]
"torso2": {
"rotation": [-2.5, 0, 0]
},
"leg_front_right2": {
"rotation": [0, 0, 5]
"torso3": {
"rotation": [-22.5, 0, 0]
},
"leg_front_left": {
"rotation": [0, 0, 7.5]
"head_angle": {
"rotation": [12.5, -32.5, 27.5]
},
"leg_front_left2": {
"rotation": [0, 0, -7.5]
"front_leg_left": {
"rotation": [40, 0, 0]
},
"elbow_left": {
"rotation": [-45, 0, 0]
},
"frontpaw_left": {
"rotation": [85, 0, 0]
},
"front_leg_right": {
"rotation": [-17.5, -5, -7.5],
"position": [0, -1, 0]
},
"elbow_right": {
"rotation": [7.5, 0, 0]
},
"frontpaw_right": {
"rotation": [10, 0, 10]
},
"backleg_left": {
"rotation": [25, -10, -7.5]
},
"ankle_left": {
"rotation": [52.5, 0, 0]
},
"foot_left": {
"rotation": [47.5, 0, 0]
},
"backleg_right": {
"rotation": [50, 7.5, 7.5]
},
"ankle_right": {
"rotation": [40, 0, 0]
},
"foot_right": {
"rotation": [22.5, 0, 0]
},
"ear_left": {
"rotation": [37.5, -37.5, 0]
},
"ear_right": {
"rotation": [37.5, 37.5, 0]
}
}
},
"animation.jolteon.cry": {
"animation_length": 1.45833,
"bones": {
"torso": {
"rotation": {
"0.0": {
"post": [0, 0, 0],
"lerp_mode": "catmullrom"
},
"0.25": {
"post": [-12.5, 0, 0],
"lerp_mode": "catmullrom"
},
"1.25": {
"post": [0, 0, 0],
"lerp_mode": "catmullrom"
}
}
},
"head": {
"rotation": {
"0.0": {
"post": [0, 0, 0],
"lerp_mode": "catmullrom"
},
"0.25": {
"post": [-12.94747, 4.87543, -0.82759],
"lerp_mode": "catmullrom"
},
"0.375": {
"post": [-12.37673, 4.88568, -1.06437],
"lerp_mode": "catmullrom"
},
"0.75": {
"post": [-6.31372, -6.71183, -0.23449],
"lerp_mode": "catmullrom"
},
"1.25": {
"post": [0, 0, 0],
"lerp_mode": "catmullrom"
}
}
},
"mouth": {
"position": {
"0.0": {
"post": [0, 0, 0],
"lerp_mode": "catmullrom"
},
"0.2083": {
"post": [0, 0, -0.1],
"lerp_mode": "catmullrom"
},
"0.5": {
"post": [0, 0, -0.1],
"lerp_mode": "catmullrom"
},
"0.625": {
"post": [0, 0, 0],
"lerp_mode": "catmullrom"
},
"0.7083": {
"post": [0, 0, -0.1],
"lerp_mode": "catmullrom"
},
"1.125": {
"post": [0, 0, -0.1],
"lerp_mode": "catmullrom"
},
"1.25": {
"post": [0, 0, 0],
"lerp_mode": "catmullrom"
}
}
},
"leg_back_right": {
"rotation": {
"0.0": {
"post": [0, 0, 0],
"lerp_mode": "catmullrom"
},
"0.25": {
"post": [12.5, 0, 0],
"lerp_mode": "catmullrom"
},
"1.25": {
"post": [0, 0, 0],
"lerp_mode": "catmullrom"
}
},
"position": {
"0.0": {
"post": [0, 0, 0],
"lerp_mode": "catmullrom"
},
"0.25": {
"post": [0, -0.32729, -0.18404],
"lerp_mode": "catmullrom"
},
"1.25": {
"post": [0, 0, 0],
"lerp_mode": "catmullrom"
}
}
},
"leg_back_right2": {
"rotation": {
"0.0": {
"post": [0, 0, 0],
"lerp_mode": "catmullrom"
},
"0.25": {
"post": [-22.5, 0, 0],
"lerp_mode": "catmullrom"
},
"1.25": {
"post": [0, 0, 0],
"lerp_mode": "catmullrom"
}
},
"position": {
"0.0": {
"post": [0, -0.03502, -0.03301],
"lerp_mode": "catmullrom"
},
"0.25": {
"post": [0, -0.32189, -0.47184],
"lerp_mode": "catmullrom"
},
"1.25": {
"post": [0, -0.03502, -0.03301],
"lerp_mode": "catmullrom"
}
}
},
"leg_back_right3": {
"rotation": {
"0.0": {
"post": [0, 0, 0],
"lerp_mode": "catmullrom"
},
"0.25": {
"post": [10, 0, 0],
"lerp_mode": "catmullrom"
},
"1.25": {
"post": [0, 0, 0],
"lerp_mode": "catmullrom"
}
}
},
"leg_back_left": {
"rotation": {
"0.0": {
"post": [0, 0, 0],
"lerp_mode": "catmullrom"
},
"0.25": {
"post": [12.5, 0, 0],
"lerp_mode": "catmullrom"
},
"1.25": {
"post": [0, 0, 0],
"lerp_mode": "catmullrom"
}
},
"position": {
"0.0": {
"post": [0, 0, 0],
"lerp_mode": "catmullrom"
},
"0.25": {
"post": [0, -0.32729, -0.18404],
"lerp_mode": "catmullrom"
},
"1.25": {
"post": [0, 0, 0],
"lerp_mode": "catmullrom"
}
}
},
"leg_back_left2": {
"rotation": {
"0.0": {
"post": [0, 0, 0],
"lerp_mode": "catmullrom"
},
"0.25": {
"post": [-22.5, 0, 0],
"lerp_mode": "catmullrom"
},
"1.25": {
"post": [0, 0, 0],
"lerp_mode": "catmullrom"
}
},
"position": {
"0.0": {
"post": [0, -0.03502, -0.03301],
"lerp_mode": "catmullrom"
},
"0.25": {
"post": [0, -0.32189, -0.47184],
"lerp_mode": "catmullrom"
},
"1.25": {
"post": [0, -0.03502, -0.03301],
"lerp_mode": "catmullrom"
}
}
},
"leg_back_left3": {
"rotation": {
"0.0": {
"post": [0, 0, 0],
"lerp_mode": "catmullrom"
},
"0.25": {
"post": [10, 0, 0],
"lerp_mode": "catmullrom"
},
"1.25": {
"post": [0, 0, 0],
"lerp_mode": "catmullrom"
}
}
},
"tail": {
"rotation": {
"0.0": {
"post": [0, 0, 0],
"lerp_mode": "catmullrom"
},
"0.2083": {
"post": [12.5, 0, 0],
"lerp_mode": "catmullrom"
},
"1.125": {
"post": [0, 0, 0],
"lerp_mode": "catmullrom"
}
}
},
"leg_front_right": {
"rotation": {
"0.0": {
"post": [0, 0, 0],
"lerp_mode": "catmullrom"
},
"0.25": {
"post": [-7.5, 0, 0],
"lerp_mode": "catmullrom"
},
"1.25": {
"post": [0, 0, 0],
"lerp_mode": "catmullrom"
}
},
"position": {
"0.0": {
"post": [0, 0, 0],
"lerp_mode": "catmullrom"
},
"0.25": {
"post": [0, 0.75, 0],
"lerp_mode": "catmullrom"
},
"1.25": {
"post": [0, 0, 0],
"lerp_mode": "catmullrom"
}
}
},
"leg_front_right2": {
"rotation": {
"0.0": {
"post": [0, 0, 0],
"lerp_mode": "catmullrom"
},
"0.25": {
"post": [17.5, 0, 0],
"lerp_mode": "catmullrom"
},
"1.25": {
"post": [0, 0, 0],
"lerp_mode": "catmullrom"
}
}
},
"leg_front_right3": {
"rotation": {
"0.0": {
"post": [0, 0, 0],
"lerp_mode": "catmullrom"
},
"0.25": {
"post": [-7.5, 0, 0],
"lerp_mode": "catmullrom"
},
"1.25": {
"post": [0, 0, 0],
"lerp_mode": "catmullrom"
}
}
},
"leg_front_left": {
"rotation": {
"0.0": {
"post": [0, 0, 0],
"lerp_mode": "catmullrom"
},
"0.25": {
"post": [-7.5, 0, 0],
"lerp_mode": "catmullrom"
},
"1.25": {
"post": [0, 0, 0],
"lerp_mode": "catmullrom"
}
},
"position": {
"0.0": {
"post": [0, 0, 0],
"lerp_mode": "catmullrom"
},
"0.25": {
"post": [0, 0.75, 0],
"lerp_mode": "catmullrom"
},
"1.25": {
"post": [0, 0, 0],
"lerp_mode": "catmullrom"
}
}
},
"leg_front_left2": {
"rotation": {
"0.0": {
"post": [0, 0, 0],
"lerp_mode": "catmullrom"
},
"0.25": {
"post": [17.5, 0, 0],
"lerp_mode": "catmullrom"
},
"1.25": {
"post": [0, 0, 0],
"lerp_mode": "catmullrom"
}
}
},
"leg_front_left3": {
"rotation": {
"0.0": {
"post": [0, 0, 0],
"lerp_mode": "catmullrom"
},
"0.25": {
"post": [-7.5, 0, 0],
"lerp_mode": "catmullrom"
},
"1.25": {
"post": [0, 0, 0],
"lerp_mode": "catmullrom"
}
}
},
"ear_right": {
"rotation": {
"0.0": {
"post": [0, 0, 0],
"lerp_mode": "catmullrom"
},
"0.25": {
"post": [0, -7.5, 0],
"lerp_mode": "catmullrom"
},
"0.7083": {
"post": [0, 10, 0],
"lerp_mode": "catmullrom"
},
"1.125": {
"post": [0, 0, 0],
"lerp_mode": "catmullrom"
}
}
},
"ear_left": {
"rotation": {
"0.0": {
"post": [0, 0, 0],
"lerp_mode": "catmullrom"
},
"0.25": {
"post": [0, -12.5, 0],
"lerp_mode": "catmullrom"
},
"0.7083": {
"post": [0, 7.5, 0],
"lerp_mode": "catmullrom"
},
"1.125": {
"post": [0, 0, 0],
"lerp_mode": "catmullrom"
}
}
},
"jaw": {
"rotation": {
"0.0": [0, 0, 0],
"0.1667": [35, 0, 0],
"1.3333": [0, 0, 0]
}
},
"ruff": {
"scale": 1
},
"spikes": {
"scale": 1
}
},
"animation_length": 1.2,
"sound_effects": {
"0.125": {
"0.04": {
"effect": "pokemon.jolteon.cry"
}
}
@@ -3,743 +3,274 @@
"animations": {
"animation.flareon.ground_idle": {
"loop": true,
"override_previous_animation": true,
"bones": {
"head": {
"rotation": ["-math.sin(q.anim_time*90*4)*0.2", 0, "math.clamp(math.sin(q.anim_time*90*4+45)*0.2,-1.2,1.2)"]
},
"ear_right": {
"rotation": [0, 0, "-math.sin(q.anim_time*90*2+90)+math.clamp(math.sin(q.anim_time*90*2-90),-1,1)"]
},
"ear_left": {
"rotation": [0, 0, "math.sin(q.anim_time*90*2+90)-math.clamp(math.sin(q.anim_time*90*2-90),-1,1)"]
},
"torso": {
"rotation": ["math.sin(q.anim_time*90*4)*0.2", 0, 0],
"position": [0, "(math.clamp(math.sin(q.anim_time*90*4+180)*0.1,-0.03,0.03)+math.clamp(math.sin(q.anim_time*90*2+180)*0.15,-0.5,0.5))*0.5", 0]
},
"tail": {
"rotation": [
"math.clamp(1*(math.sin(q.anim_time*90*2+90)*1-1),0,7)-(math.sin(q.anim_time*90*2+90)*1)",
"(math.sin(q.anim_time*90*2)*1)+(math.sin(q.anim_time*90*2/2)*1)",
0
]
},
"ruff": {
"rotation": [0, "-2*math.sin(q.anim_time*90*2)+math.clamp(3*math.sin(q.anim_time*90*2),-3,3)", 0]
}
}
},
"animation.flareon.ground_walk": {
"loop": true,
"override_previous_animation": true,
"bones": {
"body": {
"rotation": [0, 0, "math.clamp(math.sin(q.anim_time*90*4-90)*1,-0.8,0.8)+math.sin(q.anim_time*90*4-180)*1"],
"position": [0, "-1.5+math.clamp(math.sin(q.anim_time*90*4)*1.1,0.5,1)+math.clamp(math.sin(q.anim_time*90*4+180)*1.1,0.5,1)", 0]
},
"head": {
"rotation": [0, 0, "-math.clamp(math.sin(q.anim_time*90*4-90)*1,-0.8,0.8)-math.sin(q.anim_time*90*4-180)*1"],
"position": [
"math.sin(q.anim_time*90*4-45)*0.1",
"math.clamp(math.sin(q.anim_time*90*4+30)*0.05,0.5,1)+math.clamp(math.sin(-q.anim_time*90*4+30)*0.05,0.5,1)+math.sin(-q.anim_time*90*8+30)*0.2-1",
0
]
},
"leg_front_right": {
"rotation": [
"30-math.clamp(20*(math.sin(q.anim_time*90*4-90+180)*1+1),-0,60)",
0,
"math.clamp(math.sin(q.anim_time*90*4-90+180)*1,-0.8,0.8)+math.sin(q.anim_time*90*4-180+180)*1"
],
"position": [
0,
"-0.5+0.8*(math.clamp(math.sin(q.anim_time*90*4-155+180)*1.6,1,1.6)-0.2)+0.5*(math.clamp(math.sin(q.anim_time*90*4-75+180)*1.8,1,1.8)-1)-0.2*(math.clamp(math.sin(q.anim_time*90*4+180)*1.4,1,1.4)+1)",
0
]
},
"leg_front_left": {
"rotation": [
"30-math.clamp(20*(math.sin(q.anim_time*90*4-90)*1+1),-0,60)",
0,
"-math.clamp(math.sin(q.anim_time*90*4-90)*1,-0.8,0.8)-math.sin(q.anim_time*90*4-180)*1"
],
"position": [
0,
"-0.5+0.8*(math.clamp(math.sin(q.anim_time*90*4-155)*1.6,1,1.6)-0.2)+0.5*(math.clamp(math.sin(q.anim_time*90*4-75)*1.8,1,1.8)-1)-0.2*(math.clamp(math.sin(q.anim_time*90*4)*1.4,1,1.4)+1)",
0
]
},
"leg_back_right": {
"rotation": [
"-20+math.clamp(15*(math.sin(q.anim_time*90*4-90+180)*1+1),-0,60)",
0,
"math.clamp(math.sin(q.anim_time*90*4-90+180)*1,-0.8,0.8)+math.sin(q.anim_time*90*4-180+180)*1"
],
"position": [
0,
"-math.clamp(-math.sin(q.anim_time*90*4+90+180)*0.01,0,0.01)+math.clamp(-math.sin(q.anim_time*90*4+20+180)*1,0.4,1)-0.4+math.clamp(math.sin(q.anim_time*90*4-130+180)*1.5,0.4,0.6)-0.3",
-0.1
]
},
"leg_back_left": {
"rotation": [
"-20+math.clamp(15*(math.sin(q.anim_time*90*4-90)*1+1),-0,60)",
0,
"-math.clamp(math.sin(q.anim_time*90*4-90)*1,-0.8,0.8)-math.sin(q.anim_time*90*4-180)*1"
],
"position": [
0,
"-math.clamp(-math.sin(q.anim_time*90*4+90)*0.01,0,0.01)+math.clamp(-math.sin(q.anim_time*90*4+20)*1,0.4,1)-0.4+math.clamp(math.sin(q.anim_time*90*4-130)*1.5,0.4,0.6)-0.3",
-0.1
]
},
"ear_right": {
"rotation": [
"math.sin(q.anim_time*90*8+45)+math.clamp(math.sin(q.anim_time*90*8+90),-1,1)",
"0.5*math.sin(q.anim_time*90*8+45)+0.5*math.clamp(math.sin(q.anim_time*90*8+90),-2,2)",
0
]
"position": [0, -0.3, 0]
},
"ear_left": {
"rotation": [
"math.sin(q.anim_time*90*8+45)+math.clamp(math.sin(q.anim_time*90*8+90),-1,1)",
"-0.5*math.sin(q.anim_time*90*8+45)-0.5*math.clamp(math.sin(q.anim_time*90*8+90),-2,2)",
0
]
},
"leg_front_right2": {
"rotation": [
"math.clamp(math.sin(q.anim_time*90*4-180+10+180)*20,0,10)+math.clamp(math.sin(q.anim_time*90*4-180+10+180)*20,-50,50)-math.clamp(math.sin(q.anim_time*90*4+10+180)*70,50,60)+25",
0,
0
]
},
"leg_front_right3": {
"rotation": [
"-45+math.clamp(20*(math.sin(q.anim_time*90*4-90+180)*1+1),-0,60)-math.clamp(math.sin(q.anim_time*90*4-180+10+180)*20,0,10)-math.clamp(math.sin(q.anim_time*90*4-180+10+180)*20,-50,50)+math.clamp(math.sin(q.anim_time*90*4+10+180)*70,50,60)+math.clamp(math.sin(q.anim_time*90*4+40+180)*80,50,80)-60",
0,
0
],
"position": [0, "math.clamp(math.sin(q.anim_time*90*4-120+180)*1.1,0.9,1)-0.9+math.clamp(math.sin(q.anim_time*90*2-130+180)*1.3,0.9,1)-0.9", 0]
},
"leg_front_left2": {
"rotation": [
"math.clamp(math.sin(q.anim_time*90*4-180+10)*20,0,10)+math.clamp(math.sin(q.anim_time*90*4-180+10)*20,-50,50)-math.clamp(math.sin(q.anim_time*90*4+10)*70,50,60)+25",
0,
0
]
},
"leg_front_left3": {
"rotation": [
"-45+math.clamp(20*(math.sin(q.anim_time*90*4-90)*1+1),-0,60)-math.clamp(math.sin(q.anim_time*90*4-180+10)*20,0,10)-math.clamp(math.sin(q.anim_time*90*4-180+10)*20,-50,50)+math.clamp(math.sin(q.anim_time*90*4+10)*70,50,60)+math.clamp(math.sin(q.anim_time*90*4+40)*80,50,80)-60",
0,
0
],
"position": [0, "math.clamp(math.sin(q.anim_time*90*4-120)*1.1,0.9,1)-0.9+math.clamp(math.sin(q.anim_time*90*2-130)*1.3,0.9,1)-0.9", 0]
},
"leg_back_right2": {
"rotation": [
"math.clamp(math.sin(q.anim_time*90*4+180)*10,0,10)+math.clamp(math.sin(q.anim_time*90*4-95+180)*25,0,45)-math.clamp(math.sin(q.anim_time*90*4+180+180)*10,0,45)",
0,
0
],
"position": [0, "math.clamp(math.sin(q.anim_time*90*4-130+180)*1.5,0.5,0.8)-0.5", 0]
},
"leg_back_right3": {
"rotation": [
"-math.clamp(math.sin(q.anim_time*90*4+180)*10,0,10)-math.clamp(math.sin(q.anim_time*90*4-95+180)*25,0,45)+math.clamp(math.sin(q.anim_time*90*4+180+180)*15,0,45)-(-20+math.clamp(15*(math.sin(q.anim_time*90*4-90+180)*1+1),-0,60))+math.clamp(math.sin(q.anim_time*90*4-100+180)*100,60,100)-60",
0,
0
],
"position": [0, "math.clamp(math.sin(q.anim_time*90*4-110)*1,0.8,1)-0.8", 0]
},
"leg_back_left2": {
"rotation": [
"math.clamp(math.sin(q.anim_time*90*4)*10,0,10)+math.clamp(math.sin(q.anim_time*90*4-95)*25,0,45)-math.clamp(math.sin(q.anim_time*90*4+180)*10,0,45)",
0,
0
],
"position": [0, "math.clamp(math.sin(q.anim_time*90*4-130)*1.5,0.5,0.8)-0.5", 0]
},
"leg_back_left3": {
"rotation": [
"-math.clamp(math.sin(q.anim_time*90*4)*10,0,10)-math.clamp(math.sin(q.anim_time*90*4-95)*25,0,45)+math.clamp(math.sin(q.anim_time*90*4+180)*15,0,45)-(-20+math.clamp(15*(math.sin(q.anim_time*90*4-90)*1+1),-0,60))+math.clamp(math.sin(q.anim_time*90*4-100)*100,60,100)-60",
0,
0
],
"position": [0, "math.clamp(math.sin(q.anim_time*90*4-110+180)*1,0.8,1)-0.8", 0]
},
"ruff": {
"rotation": [0, "-2*math.sin(q.anim_time*90*4)+math.clamp(2*math.sin(q.anim_time*90*4),-2,2)", 0]
}
}
},
"animation.flareon.ground_run": {
"loop": true,
"override_previous_animation": true,
"bones": {
"body": {
"rotation": ["5*(math.sin(q.anim_time*90*4*2-90)*1+1)-math.clamp(10*(math.sin(q.anim_time*90*4*2+45)*1+1),15,20)+15", 0, 0],
"position": [
0,
"math.clamp(math.sin(q.anim_time*90*4*2+45)*1,0.5,2)-0.5+math.clamp(math.sin(q.anim_time*90*4*2)*1,0,2)",
"-math.clamp(math.sin(q.anim_time*90*4*2-30)*2,0,2)+math.clamp(math.sin(-q.anim_time*90*4*2-30)*1,0,2)"
]
},
"head": {
"rotation": ["-5*(math.sin(q.anim_time*90*4*2-90)*1+1)+math.clamp(10*(math.sin(q.anim_time*90*4*2+45)*1+1),15,20)-15", 0, 0],
"position": [0, -1, -1]
},
"leg_front_right": {
"rotation": [
"5+math.clamp(math.sin(-q.anim_time*90*4*1-20)*30,-40,0)+math.clamp(math.sin(q.anim_time*90*4*1+20)*30,-40,0)+math.clamp(math.sin(-q.anim_time*90*4*2-40)*50,0,70)-math.clamp(math.sin(-q.anim_time*90*4*2-30+180)*20,5,70)+5",
0,
0
]
},
"leg_front_left": {
"rotation": [
"5+math.clamp(math.sin(-q.anim_time*90*4*1-20+30)*30,-40,0)+math.clamp(math.sin(q.anim_time*90*4*1+20-30)*30,-40,0)+math.clamp(math.sin(-q.anim_time*90*4*2-40+30)*50,0,70)-math.clamp(math.sin(-q.anim_time*90*4*2-30+180+30)*20,5,70)+5",
0,
0
]
},
"leg_back_right": {
"rotation": ["math.clamp(math.sin(q.anim_time*90*4*2)*40,0,50)-math.clamp(math.sin(-q.anim_time*90*4*2)*40,0,50)", 0, 0],
"position": [
0,
"-math.clamp(math.sin(q.anim_time*90*4*2)*0.3,-1,2)-math.clamp(math.sin(-q.anim_time*90*4*2)*0.8,-1,2)",
"-0.3+math.clamp(math.sin(q.anim_time*90*4*2-30)*0.5,0,2)-math.clamp(math.sin(q.anim_time*90*4*2-30+180)*0.5,0,2)"
]
},
"leg_back_left": {
"rotation": ["math.clamp(math.sin(q.anim_time*90*4*2+20)*40,0,50)-math.clamp(math.sin(-q.anim_time*90*4*2-20)*40,0,50)", 0, 0],
"position": [
0,
"-math.clamp(math.sin(q.anim_time*90*4*2)*0.3,-1,2)-math.clamp(math.sin(-q.anim_time*90*4*2)*0.8,0,2)",
"-0.3+math.clamp(math.sin(q.anim_time*90*4*2-30)*0.5,0,2)-math.clamp(math.sin(q.anim_time*90*4*2-30+180)*0.5,0,2)"
]
"rotation": [25, -30, 0]
},
"ear_right": {
"rotation": [
"-5-4*math.sin(q.anim_time*90*4*2+45)-math.clamp(4*math.sin(q.anim_time*90*4*2+90),-4,4)",
"5+2*math.sin(q.anim_time*90*4*2+45)+math.clamp(2*math.sin(q.anim_time*90*4*2+90),-2,2)",
0
]
},
"ear_left": {
"rotation": [
"-5-4*math.sin(q.anim_time*90*4*2+45)-math.clamp(4*math.sin(q.anim_time*90*4*2+90),-4,4)",
"-5-2*math.sin(q.anim_time*90*4*2+45)-math.clamp(2*math.sin(q.anim_time*90*4*2+90),-2,2)",
0
]
},
"leg_front_right2": {
"rotation": ["-math.clamp(math.sin(-q.anim_time*90*4*2-90)*20,5,70)+5-math.clamp(math.sin(-q.anim_time*90*4*2+180)*10,5,70)+5", 0, 0]
},
"leg_front_right3": {
"rotation": ["12*math.sin(q.anim_time*90*8+30)-math.clamp(math.sin(q.anim_time*90*8),1,1)", 0, 0]
},
"leg_front_left2": {
"rotation": ["-math.clamp(math.sin(-q.anim_time*90*8-90+30)*20,5,70)+5-math.clamp(math.sin(-q.anim_time*90*8+180+30)*10,5,70)+5", 0, 0]
},
"leg_front_left3": {
"rotation": ["8*math.sin(q.anim_time*90*8+30-90)-math.clamp(math.sin(q.anim_time*90*8-90),1,1)", 0, 0]
},
"leg_back_right2": {
"rotation": ["math.clamp(math.sin(q.anim_time*90*8-180-30)*5,0,5)-math.clamp(math.sin(-q.anim_time*90*8-90)*10,0,50)", 0, 0]
},
"leg_back_right3": {
"rotation": ["20+20*math.sin(q.anim_time*90*8+45-30)-math.clamp(math.sin(q.anim_time*90*8+90-30),1,1)", 0, 0]
},
"leg_back_left2": {
"rotation": ["math.clamp(math.sin(q.anim_time*90*8-90)*5,0,5)-math.clamp(math.sin(-q.anim_time*90*8-90)*10,0,10)", 0, 0]
},
"leg_back_left3": {
"rotation": ["20+20*math.sin(q.anim_time*90*8+15)-math.clamp(math.sin(q.anim_time*90*8+90),1,1)", 0, 0]
"rotation": [25, 30, 0]
},
"tail": {
"rotation": ["-15-math.sin(q.anim_time*90*4*2+45)*4", 0, 0]
"rotation": [25, 0, 0]
},
"ruff": {
"rotation": ["-math.sin(q.anim_time*90*4*2+30)*2", 0, 0]
"tail4": {
"rotation": [5, 0, 0]
},
"tail5": {
"rotation": [10, 0, 0]
},
"tail6": {
"rotation": [5, 0, 0]
},
"front_leg_left": {
"rotation": [5, 0, -5]
},
"elbow_left": {
"rotation": [-10, 0, 0]
},
"frontpaw_left": {
"rotation": [5, 0, 5]
},
"front_leg_right": {
"rotation": [5, 0, 5]
},
"elbow_right": {
"rotation": [-10, 0, 0]
},
"frontpaw_right": {
"rotation": [5, 0, -5]
},
"back_leg_left": {
"rotation": [5, -2.5, -5]
},
"ankle_left": {
"rotation": [-5, 0, 0]
},
"foot_left": {
"rotation": [0, 0, 5]
},
"back_leg_right": {
"rotation": [5, 2.5, 5]
},
"ankle_right": {
"rotation": [-5, 0, 0]
},
"foot_right": {
"rotation": [0, 0, -5]
}
}
},
"animation.flareon.blink": {
"animation_length": 0.1667,
"bones": {
"eyelid_right": {
"eye_right": {
"position": {
"0.0": [-0.1, 0, -0.1],
"0.125": [-0.1, 0, -0.1],
"0.1667": [0, 0, 0]
"0.0": [0.1, 0, 0.1],
"0.1667": {"pre": [0.1, 0, 0.1], "post": [0, 0, 0]}
}
},
"eye_left": {
"position": [0, 0, 0]
"position": {
"0.0": [-0.1, 0, 0.1],
"0.1667": {"pre": [-0.1, 0, 0.1], "post": [0, 0, 0]}
}
},
"eyelid_right": {
"position": {
"0.0": [-0.1, 0, -0.1],
"0.1667": {"pre": [-0.1, 0, -0.1], "post": [0, 0, 0]}
}
},
"eyelid_left": {
"position": {
"0.0": [0.1, 0, -0.1],
"0.125": [0.1, 0, -0.1],
"0.1667": [0, 0, 0]
"0.1667": {"pre": [0.1, 0, -0.1], "post": [0, 0, 0]}
}
}
}
},
"animation.flareon.render": {
"animation.flareon.pose": {
"loop": true,
"bones": {
"torso": {
"rotation": [20, 0, 0],
"position": [0, -1, 0]
"headfur1": {
"rotation": [-2.32648, -2.86313, -6.93488]
},
"tail": {
"rotation": [-27.5, 0, 0]
"ear1_left": {
"rotation": [-4.29907, -5.86145, 44.84339]
},
"tail1": {
"rotation": [64.62786, 7.28488, -7.16943]
},
"tail2": {
"rotation": [0, 15, 0]
},
"tail4": {
"rotation": [17.5, 17.5, 0]
},
"tail5": {
"rotation": [17.5, 10, 0]
},
"tail6": {
"rotation": [0, 27.5, 0]
},
"body": {
"rotation": [0, 35, 0],
"position": [0, -0.75, 0]
},
"torso": {
"rotation": [2.5, 0, 0],
"position": [0, 1, 0]
},
"mane_main": {
"rotation": [-1.68086, -6.89591, 4.97567]
},
"manefur1_left": {
"rotation": [0, 0, 45]
},
"manefur2_left": {
"rotation": [0, 0, 67.5]
},
"manefur3_left": {
"rotation": [0, 0, 90]
},
"manefur1_right": {
"rotation": [0, 0, -45]
},
"manefur2_right": {
"rotation": [0, 0, -67.5]
},
"manefur3_right": {
"rotation": [0, 0, -90]
},
"manefur1": {
"rotation": [-22.5, 0, 0]
},
"manefur2": {
"rotation": [-67.5, 0, 0]
},
"manefur3": {
"rotation": [-90, 0, 0]
},
"head": {
"rotation": [1.44098, -29.18067, 33.5351]
},
"ear3_left": {
"rotation": [-45, 0, 0]
},
"waist": {
"rotation": [7.5, 0, 0]
},
"leg_front_right": {
"rotation": [-23, 0, 0]
"torso2": {
"rotation": [0.99736, 4.89966, 6.88728]
},
"leg_front_right2": {
"rotation": [19, 0, 0]
"shoulder_left": {
"rotation": [-22.5, 0, 0],
"position": [-1, 0, -1]
},
"leg_front_left": {
"rotation": [20.5, 0, 0],
"position": [0, -1.3, 0]
"elbow_left": {
"rotation": [-60, 0, 0]
},
"leg_front_left2": {
"frontpaw_left": {
"rotation": [117.5, 0, 0]
},
"thigh_left": {
"rotation": [27.78445, 24.4963, -1.02058],
"position": [0, 0, -1]
},
"ankle_left": {
"rotation": [-15, 0, 0]
},
"foot_left": {
"rotation": [-5, 0, 0],
"position": [0, 0, 0]
},
"eyes_closed": {
"position": [0, 0, -1]
},
"mouth_o": {
"position": [0, 0, 0]
},
"eyes_open": {
"position": [0, 0, 0]
},
"eyes_halfclosed": {
"position": [0, 0, 0]
},
"eyelid_halfclosed_right": {
"position": [0, 0, 0]
},
"eyelid_halfclosed_left": {
"position": [0, 0, 0]
},
"fur_tail_right2": {
"rotation": [0, 22.5, 0]
},
"thigh_right": {
"rotation": [-15, 0, 0]
},
"shoulder_right": {
"rotation": [-10, 0, 0],
"position": [-1, -1, 0]
},
"elbow_right": {
"rotation": [-35, 0, 0]
},
"frontpaw_right": {
"rotation": [27.5, 0, 0]
},
"knee_right": {
"rotation": [-27.5, 0, 0]
},
"leg_front_left3": {
"ankle_right": {
"rotation": [42.5, 0, 0]
},
"torso1": {
"rotation": [10, 0, 0]
},
"leg_back_right": {
"rotation": [-12.5, 0, 0]
"ear1_right": {
"rotation": [-19.71092, 2.99333, -7.87628]
},
"leg_back_left": {
"rotation": [17.5, 0, 0]
"ear3_right": {
"rotation": [-45, 0, 0]
},
"leg_back_left2": {
"rotation": [-12.5, 0, 0]
"torso3": {
"rotation": [-17.5, 0, 0]
},
"front_leg_left": {
"rotation": [10, -20, -12.5],
"position": [0, 0, 1]
},
"back_leg_left": {
"rotation": [20, -7.5, 0]
},
"foot_right": {
"rotation": [-62.5, 0, -7.5],
"position": [0, 1, -1]
},
"tail": {
"rotation": [25, -12.5, 0]
},
"back_leg_right": {
"rotation": [50.435, 12.7313, 6.61102]
},
"tail3": {
"rotation": [0, 17.5, 0]
},
"ear_left": {
"rotation": [37.5, -27.5, 0]
},
"ear_right": {
"rotation": [37.5, 27.5, 0]
}
}
},
"animation.flareon.cry": {
"animation_length": 1.45833,
"bones": {
"torso": {
"rotation": {
"0.0": {
"post": [0, 0, 0],
"lerp_mode": "catmullrom"
},
"0.25": {
"post": [-12.5, 0, 0],
"lerp_mode": "catmullrom"
},
"1.25": {
"post": [0, 0, 0],
"lerp_mode": "catmullrom"
}
}
},
"head": {
"rotation": {
"0.0": {
"post": [0, 0, 0],
"lerp_mode": "catmullrom"
},
"0.25": {
"post": [-12.94747, 4.87543, -0.82759],
"lerp_mode": "catmullrom"
},
"0.375": {
"post": [-12.37673, 4.88568, -1.06437],
"lerp_mode": "catmullrom"
},
"0.75": {
"post": [-6.31372, -6.71183, -0.23449],
"lerp_mode": "catmullrom"
},
"1.25": {
"post": [0, 0, 0],
"lerp_mode": "catmullrom"
}
}
},
"mouth": {
"position": {
"0.0": {
"post": [0, 0, 0],
"lerp_mode": "catmullrom"
},
"0.2083": {
"post": [0, 0, -0.1],
"lerp_mode": "catmullrom"
},
"1.125": {
"post": [0, 0, -0.1],
"lerp_mode": "catmullrom"
},
"1.25": {
"post": [0, 0, 0],
"lerp_mode": "catmullrom"
}
}
},
"leg_back_right": {
"rotation": {
"0.0": {
"post": [0, 0, 0],
"lerp_mode": "catmullrom"
},
"0.25": {
"post": [12.5, 0, 0],
"lerp_mode": "catmullrom"
},
"1.25": {
"post": [0, 0, 0],
"lerp_mode": "catmullrom"
}
},
"position": {
"0.0": {
"post": [0, 0, 0],
"lerp_mode": "catmullrom"
},
"0.25": {
"post": [0, -0.32729, -0.18404],
"lerp_mode": "catmullrom"
},
"1.25": {
"post": [0, 0, 0],
"lerp_mode": "catmullrom"
}
}
},
"leg_back_right2": {
"rotation": {
"0.0": {
"post": [0, 0, 0],
"lerp_mode": "catmullrom"
},
"0.25": {
"post": [-22.5, 0, 0],
"lerp_mode": "catmullrom"
},
"1.25": {
"post": [0, 0, 0],
"lerp_mode": "catmullrom"
}
},
"position": {
"0.0": {
"post": [0, -0.03502, -0.03301],
"lerp_mode": "catmullrom"
},
"0.25": {
"post": [0, -0.32189, -0.47184],
"lerp_mode": "catmullrom"
},
"1.25": {
"post": [0, -0.03502, -0.03301],
"lerp_mode": "catmullrom"
}
}
},
"leg_back_right3": {
"rotation": {
"0.0": {
"post": [0, 0, 0],
"lerp_mode": "catmullrom"
},
"0.25": {
"post": [10, 0, 0],
"lerp_mode": "catmullrom"
},
"1.25": {
"post": [0, 0, 0],
"lerp_mode": "catmullrom"
}
}
},
"leg_back_left": {
"rotation": {
"0.0": {
"post": [0, 0, 0],
"lerp_mode": "catmullrom"
},
"0.25": {
"post": [12.5, 0, 0],
"lerp_mode": "catmullrom"
},
"1.25": {
"post": [0, 0, 0],
"lerp_mode": "catmullrom"
}
},
"position": {
"0.0": {
"post": [0, 0, 0],
"lerp_mode": "catmullrom"
},
"0.25": {
"post": [0, -0.32729, -0.18404],
"lerp_mode": "catmullrom"
},
"1.25": {
"post": [0, 0, 0],
"lerp_mode": "catmullrom"
}
}
},
"leg_back_left2": {
"rotation": {
"0.0": {
"post": [0, 0, 0],
"lerp_mode": "catmullrom"
},
"0.25": {
"post": [-22.5, 0, 0],
"lerp_mode": "catmullrom"
},
"1.25": {
"post": [0, 0, 0],
"lerp_mode": "catmullrom"
}
},
"position": {
"0.0": {
"post": [0, -0.03502, -0.03301],
"lerp_mode": "catmullrom"
},
"0.25": {
"post": [0, -0.32189, -0.47184],
"lerp_mode": "catmullrom"
},
"1.25": {
"post": [0, -0.03502, -0.03301],
"lerp_mode": "catmullrom"
}
}
},
"leg_back_left3": {
"rotation": {
"0.0": {
"post": [0, 0, 0],
"lerp_mode": "catmullrom"
},
"0.25": {
"post": [10, 0, 0],
"lerp_mode": "catmullrom"
},
"1.25": {
"post": [0, 0, 0],
"lerp_mode": "catmullrom"
}
}
},
"tail": {
"rotation": {
"0.0": {
"post": [0, 0, 0],
"lerp_mode": "catmullrom"
},
"0.2083": {
"post": [12.5, 0, 0],
"lerp_mode": "catmullrom"
},
"1.125": {
"post": [0, 0, 0],
"lerp_mode": "catmullrom"
}
}
},
"leg_front_right": {
"rotation": {
"0.0": {
"post": [0, 0, 0],
"lerp_mode": "catmullrom"
},
"0.25": {
"post": [-7.5, 0, 0],
"lerp_mode": "catmullrom"
},
"1.25": {
"post": [0, 0, 0],
"lerp_mode": "catmullrom"
}
},
"position": {
"0.0": {
"post": [0, 0, 0],
"lerp_mode": "catmullrom"
},
"0.25": {
"post": [0, 0.75, 0],
"lerp_mode": "catmullrom"
},
"1.25": {
"post": [0, 0, 0],
"lerp_mode": "catmullrom"
}
}
},
"leg_front_right2": {
"rotation": {
"0.0": {
"post": [0, 0, 0],
"lerp_mode": "catmullrom"
},
"0.25": {
"post": [17.5, 0, 0],
"lerp_mode": "catmullrom"
},
"1.25": {
"post": [0, 0, 0],
"lerp_mode": "catmullrom"
}
}
},
"leg_front_right3": {
"rotation": {
"0.0": {
"post": [0, 0, 0],
"lerp_mode": "catmullrom"
},
"0.25": {
"post": [-7.5, 0, 0],
"lerp_mode": "catmullrom"
},
"1.25": {
"post": [0, 0, 0],
"lerp_mode": "catmullrom"
}
}
},
"leg_front_left": {
"rotation": {
"0.0": {
"post": [0, 0, 0],
"lerp_mode": "catmullrom"
},
"0.25": {
"post": [-7.5, 0, 0],
"lerp_mode": "catmullrom"
},
"1.25": {
"post": [0, 0, 0],
"lerp_mode": "catmullrom"
}
},
"position": {
"0.0": {
"post": [0, 0, 0],
"lerp_mode": "catmullrom"
},
"0.25": {
"post": [0, 0.75, 0],
"lerp_mode": "catmullrom"
},
"1.25": {
"post": [0, 0, 0],
"lerp_mode": "catmullrom"
}
}
},
"leg_front_left2": {
"rotation": {
"0.0": {
"post": [0, 0, 0],
"lerp_mode": "catmullrom"
},
"0.25": {
"post": [17.5, 0, 0],
"lerp_mode": "catmullrom"
},
"1.25": {
"post": [0, 0, 0],
"lerp_mode": "catmullrom"
}
}
},
"leg_front_left3": {
"rotation": {
"0.0": {
"post": [0, 0, 0],
"lerp_mode": "catmullrom"
},
"0.25": {
"post": [-7.5, 0, 0],
"lerp_mode": "catmullrom"
},
"1.25": {
"post": [0, 0, 0],
"lerp_mode": "catmullrom"
}
}
},
"ear_right": {
"rotation": {
"0.0": {
"post": [0, 0, 0],
"lerp_mode": "catmullrom"
},
"0.25": {
"post": [0, -7.5, 0],
"lerp_mode": "catmullrom"
},
"0.7083": {
"post": [0, 10, 0],
"lerp_mode": "catmullrom"
},
"1.125": {
"post": [0, 0, 0],
"lerp_mode": "catmullrom"
}
}
},
"ear_left": {
"rotation": {
"0.0": {
"post": [0, 0, 0],
"lerp_mode": "catmullrom"
},
"0.25": {
"post": [0, -12.5, 0],
"lerp_mode": "catmullrom"
},
"0.7083": {
"post": [0, 7.5, 0],
"lerp_mode": "catmullrom"
},
"1.125": {
"post": [0, 0, 0],
"lerp_mode": "catmullrom"
}
}
},
"jaw": {
"rotation": {
"0.0": [0, 0, 0],
"0.1667": [35, 0, 0],
"1.3333": [0, 0, 0]
}
},
"ruff": {
"scale": 1
},
"spikes": {
"scale": 1
}
},
"animation_length": 1.2,
"sound_effects": {
"0.125": {
"0.04": {
"effect": "pokemon.flareon.cry"
}
}
@@ -3,480 +3,199 @@
"animations": {
"animation.espeon.ground_idle": {
"loop": true,
"override_previous_animation": true,
"bones": {
"head": {
"rotation": ["-math.sin(q.anim_time*90*4)*0.2", 0, "math.clamp(math.sin(q.anim_time*90*4+45)*0.2,-1.2,1.2)"]
},
"ear_right": {
"rotation": [0, "5-2*math.sin(q.anim_time*90*2+90)+math.clamp(math.sin(q.anim_time*90*2-90),-2,2)", 0]
},
"ear_left": {
"rotation": [0, "-5+2*math.sin(q.anim_time*90*2+90)-math.clamp(math.sin(q.anim_time*90*2-90),-2,2)", 0]
},
"tail": {
"rotation": [25, "6*(math.sin(q.anim_time*90*2)*1)+6*(math.sin(q.anim_time*90*2/2)*1)", 0]
},
"tail2": {
"rotation": [25, "6*(math.sin(q.anim_time*90*2-30)*1)+6*(math.sin(q.anim_time*90*2/2-30)*1)", 0]
},
"tail4": {
"rotation": [-10, "8*(math.sin(q.anim_time*90*2-90)*1)+6*(math.sin(q.anim_time*90*2/2-90)*1)", 0]
},
"fur_left": {
"rotation": [0, "-2.5+2*math.sin(q.anim_time*90*2+45)", "1.5*math.sin(q.anim_time*90*2-180)"]
},
"fur_right": {
"rotation": [0, "2.5-2*math.sin(q.anim_time*90*2+45)", "-1.5*math.sin(q.anim_time*90*2+180)"]
},
"tail5": {
"rotation": [-15, "12*(math.sin(q.anim_time*90*2-120)*1)+6*(math.sin(q.anim_time*90*2/2-120)*1)", 0]
},
"tail7": {
"rotation": ["4*(math.sin(q.anim_time*90*2-180)*1)+3*(math.sin(q.anim_time*90*2/2-180)*1)", 0, 0]
},
"tail3": {
"rotation": [20, "6*(math.sin(q.anim_time*90*2-60)*1)+6*(math.sin(q.anim_time*90*2/2-60)*1)", 0]
},
"tail6": {
"rotation": [
"-20+4*(math.sin(q.anim_time*90*2)*1)+3*(math.sin(q.anim_time*90*2/2)*1)",
"10*(math.sin(q.anim_time*90*2-150)*1)+6*(math.sin(q.anim_time*90*2/2-150)*1)",
0
]
},
"tail8": {
"rotation": [
"-10+4*(math.sin(q.anim_time*90*2)*1)+3*(math.sin(q.anim_time*90*2/2)*1)",
"10*(math.sin(q.anim_time*90*2-150)*1)+6*(math.sin(q.anim_time*90*2/2-150)*1)",
0
]
},
"torso": {
"rotation": ["math.sin(q.anim_time*90*4)*0.2", 0, 0],
"position": [0, "(math.clamp(math.sin(q.anim_time*90*4+180)*0.1,-0.03,0.03)+math.clamp(math.sin(q.anim_time*90*2+180)*0.15,-0.5,0.5))*0.5", 0]
}
}
},
"animation.espeon.cry": {
"animation_length": 1.54167,
"bones": {
"head": {
"rotation": {
"0.0": {
"post": [0, 0, 0],
"lerp_mode": "catmullrom"
},
"0.0833": {
"post": [0, 0, 0],
"lerp_mode": "catmullrom"
},
"0.2083": {
"post": [-8, 0, 0],
"lerp_mode": "catmullrom"
},
"0.4167": {
"post": [-8, 0, 0],
"lerp_mode": "catmullrom"
},
"0.5417": {
"post": [-14.40833, 0, 0],
"lerp_mode": "catmullrom"
},
"1.0": {
"post": [-2.5, 0, 0],
"lerp_mode": "catmullrom"
},
"1.1667": {
"post": [0, 0, 0],
"lerp_mode": "catmullrom"
},
"1.5": [0, 0, 0]
}
},
"mouth": {
"position": {
"0.0": [0, 0, 0],
"0.0417": [0, 0, 0],
"0.0833": [0, 0, -0.1],
"0.3333": [0, 0, -0.1],
"0.375": [0, 0, 0],
"0.5": [0, 0, -0.1],
"0.5417": [0, 0, -0.1],
"1.0833": [0, 0, -0.1],
"1.125": [0, 0, 0]
}
},
"ear_left": {
"rotation": {
"0.0": {
"post": [0, 0, 0],
"lerp_mode": "catmullrom"
},
"0.2083": {
"post": [0, 0, 5],
"lerp_mode": "catmullrom"
},
"0.4167": {
"post": [0, 0, 0],
"lerp_mode": "catmullrom"
},
"0.6667": {
"post": [0, 0, 10],
"lerp_mode": "catmullrom"
},
"1.0417": {
"post": [0, 0, -5],
"lerp_mode": "catmullrom"
},
"1.5": {
"post": [0, 0, 0],
"lerp_mode": "catmullrom"
}
}
},
"ear_right": {
"rotation": {
"0.0": {
"post": [0, 0, 0],
"lerp_mode": "catmullrom"
},
"0.2083": {
"post": [0, 0, -5],
"lerp_mode": "catmullrom"
},
"0.4167": {
"post": [0, 0, 0],
"lerp_mode": "catmullrom"
},
"0.6667": {
"post": [0, 0, -10],
"lerp_mode": "catmullrom"
},
"1.0417": {
"post": [0, 0, 5],
"lerp_mode": "catmullrom"
},
"1.5": {
"post": [0, 0, 0],
"lerp_mode": "catmullrom"
}
}
},
"fur_left": {
"rotation": {
"0.0": {
"post": [0, 0, 0],
"lerp_mode": "catmullrom"
},
"0.1667": {
"post": [0.09882, -9.99016, 2.04498],
"lerp_mode": "catmullrom"
},
"0.4167": {
"post": [0.73184, -7.36624, -0.42175],
"lerp_mode": "catmullrom"
},
"0.5833": {
"post": [0.066, -7.49269, 2.16229],
"lerp_mode": "catmullrom"
},
"1.0417": {
"post": [0, 0, 0],
"lerp_mode": "catmullrom"
},
"1.5417": [0, 0, 0]
}
}
},
"sound_effects": {
"0.0833": {
"effect": "pokemon.espeon.cry"
}
}
},
"animation.espeon.ground_walk": {
"loop": true,
"override_previous_animation": true,
"bones": {
"body": {
"rotation": [0, 0, "math.clamp(math.sin(q.anim_time*90*4-90)*1,-0.8,0.8)+math.sin(q.anim_time*90*4-180)*1"],
"position": [0, "-1.5+math.clamp(math.sin(q.anim_time*90*4)*1.1,0.5,1)+math.clamp(math.sin(q.anim_time*90*4+180)*1.1,0.5,1)", 0]
},
"head": {
"rotation": [0, 0, "-math.clamp(math.sin(q.anim_time*90*4-90)*1,-0.8,0.8)-math.sin(q.anim_time*90*4-180)*1"],
"position": [
"math.sin(q.anim_time*90*4-45)*0.1",
"math.clamp(math.sin(q.anim_time*90*4+30)*0.05,0.5,1)+math.clamp(math.sin(-q.anim_time*90*4+30)*0.05,0.5,1)+math.sin(-q.anim_time*90*8+30)*0.2-1",
0
]
},
"leg_front_right": {
"rotation": [
"30-math.clamp(20*(math.sin(q.anim_time*90*4-90+180)*1+1),-0,60)",
0,
"math.clamp(math.sin(q.anim_time*90*4-90+180)*1,-0.8,0.8)+math.sin(q.anim_time*90*4-180+180)*1"
],
"position": [
0,
"-0.5+0.8*(math.clamp(math.sin(q.anim_time*90*4-155+180)*1.6,1,1.6)-0.2)+0.5*(math.clamp(math.sin(q.anim_time*90*4-75+180)*1.8,1,1.8)-1)-0.2*(math.clamp(math.sin(q.anim_time*90*4+180)*1.4,1,1.4)+1)",
0
]
},
"leg_front_left": {
"rotation": [
"30-math.clamp(20*(math.sin(q.anim_time*90*4-90)*1+1),-0,60)",
0,
"-math.clamp(math.sin(q.anim_time*90*4-90)*1,-0.8,0.8)-math.sin(q.anim_time*90*4-180)*1"
],
"position": [
0,
"-0.5+0.8*(math.clamp(math.sin(q.anim_time*90*4-155)*1.6,1,1.6)-0.2)+0.5*(math.clamp(math.sin(q.anim_time*90*4-75)*1.8,1,1.8)-1)-0.2*(math.clamp(math.sin(q.anim_time*90*4)*1.4,1,1.4)+1)",
0
]
},
"leg_back_right": {
"rotation": [
"-20+math.clamp(15*(math.sin(q.anim_time*90*4-90+180)*1+1),-0,60)",
0,
"math.clamp(math.sin(q.anim_time*90*4-90+180)*1,-0.8,0.8)+math.sin(q.anim_time*90*4-180+180)*1"
],
"position": [
0,
"-math.clamp(-math.sin(q.anim_time*90*4+90+180)*0.01,0,0.01)+math.clamp(-math.sin(q.anim_time*90*4+20+180)*1,0.4,1)-0.4+math.clamp(math.sin(q.anim_time*90*4-130+180)*1.5,0.4,0.6)-0.3",
-0.1
]
},
"leg_back_left": {
"rotation": [
"-20+math.clamp(15*(math.sin(q.anim_time*90*4-90)*1+1),-0,60)",
0,
"-math.clamp(math.sin(q.anim_time*90*4-90)*1,-0.8,0.8)-math.sin(q.anim_time*90*4-180)*1"
],
"position": [
0,
"-math.clamp(-math.sin(q.anim_time*90*4+90)*0.01,0,0.01)+math.clamp(-math.sin(q.anim_time*90*4+20)*1,0.4,1)-0.4+math.clamp(math.sin(q.anim_time*90*4-130)*1.5,0.4,0.6)-0.3",
-0.1
]
},
"ear_right": {
"rotation": [0, "5+math.sin(q.anim_time*90*8+45)+math.clamp(math.sin(q.anim_time*90*8+90),-2,2)", 0]
},
"ear_left": {
"rotation": [0, "-5-math.sin(q.anim_time*90*8+45)-math.clamp(math.sin(q.anim_time*90*8+90),-2,2)", 0]
},
"leg_front_right2": {
"rotation": [
"math.clamp(math.sin(q.anim_time*90*4-180+10+180)*20,0,10)+math.clamp(math.sin(q.anim_time*90*4-180+10+180)*20,-50,50)-math.clamp(math.sin(q.anim_time*90*4+10+180)*70,50,60)+25",
0,
0
]
},
"leg_front_right3": {
"rotation": [
"-45+math.clamp(20*(math.sin(q.anim_time*90*4-90+180)*1+1),-0,60)-math.clamp(math.sin(q.anim_time*90*4-180+10+180)*20,0,10)-math.clamp(math.sin(q.anim_time*90*4-180+10+180)*20,-50,50)+math.clamp(math.sin(q.anim_time*90*4+10+180)*70,50,60)+math.clamp(math.sin(q.anim_time*90*4+40+180)*80,50,80)-60",
0,
0
],
"position": [0, "math.clamp(math.sin(q.anim_time*90*4-120+180)*1.1,0.9,1)-0.9+math.clamp(math.sin(q.anim_time*90*2-130+180)*1.3,0.9,1)-0.9", 0]
},
"leg_front_left2": {
"rotation": [
"math.clamp(math.sin(q.anim_time*90*4-180+10)*20,0,10)+math.clamp(math.sin(q.anim_time*90*4-180+10)*20,-50,50)-math.clamp(math.sin(q.anim_time*90*4+10)*70,50,60)+25",
0,
0
]
},
"leg_front_left3": {
"rotation": [
"-45+math.clamp(20*(math.sin(q.anim_time*90*4-90)*1+1),-0,60)-math.clamp(math.sin(q.anim_time*90*4-180+10)*20,0,10)-math.clamp(math.sin(q.anim_time*90*4-180+10)*20,-50,50)+math.clamp(math.sin(q.anim_time*90*4+10)*70,50,60)+math.clamp(math.sin(q.anim_time*90*4+40)*80,50,80)-60",
0,
0
],
"position": [0, "math.clamp(math.sin(q.anim_time*90*4-120)*1.1,0.9,1)-0.9+math.clamp(math.sin(q.anim_time*90*2-130)*1.3,0.9,1)-0.9", 0]
},
"leg_back_right2": {
"rotation": [
"math.clamp(math.sin(q.anim_time*90*4+180)*10,0,10)+math.clamp(math.sin(q.anim_time*90*4-95+180)*25,0,45)-math.clamp(math.sin(q.anim_time*90*4+180+180)*10,0,45)",
0,
0
],
"position": [0, "math.clamp(math.sin(q.anim_time*90*4-130+180)*1.5,0.5,0.8)-0.5", 0]
},
"leg_back_right3": {
"rotation": [
"-math.clamp(math.sin(q.anim_time*90*4+180)*10,0,10)-math.clamp(math.sin(q.anim_time*90*4-95+180)*25,0,45)+math.clamp(math.sin(q.anim_time*90*4+180+180)*15,0,45)-(-20+math.clamp(15*(math.sin(q.anim_time*90*4-90+180)*1+1),-0,60))+math.clamp(math.sin(q.anim_time*90*4-100+180)*100,60,100)-60",
0,
0
],
"position": [0, "math.clamp(math.sin(q.anim_time*90*4-110)*1,0.8,1)-0.8", 0]
},
"leg_back_left2": {
"rotation": [
"math.clamp(math.sin(q.anim_time*90*4)*10,0,10)+math.clamp(math.sin(q.anim_time*90*4-95)*25,0,45)-math.clamp(math.sin(q.anim_time*90*4+180)*10,0,45)",
0,
0
],
"position": [0, "math.clamp(math.sin(q.anim_time*90*4-130)*1.5,0.5,0.8)-0.5", 0]
},
"leg_back_left3": {
"rotation": [
"-math.clamp(math.sin(q.anim_time*90*4)*10,0,10)-math.clamp(math.sin(q.anim_time*90*4-95)*25,0,45)+math.clamp(math.sin(q.anim_time*90*4+180)*15,0,45)-(-20+math.clamp(15*(math.sin(q.anim_time*90*4-90)*1+1),-0,60))+math.clamp(math.sin(q.anim_time*90*4-100)*100,60,100)-60",
0,
0
],
"position": [0, "math.clamp(math.sin(q.anim_time*90*4-110+180)*1,0.8,1)-0.8", 0]
},
"fur_left": {
"rotation": [0, -5, "-math.sin(q.anim_time*90*8+90)-math.clamp(math.sin(q.anim_time*90*8+90),-2,2)"]
},
"fur_right": {
"rotation": [0, 5, "math.sin(q.anim_time*90*8+90)+math.clamp(math.sin(q.anim_time*90*8+90),-2,2)"]
}
}
},
"animation.espeon.ground_run": {
"loop": true,
"override_previous_animation": true,
"bones": {
"body": {
"rotation": ["5*(math.sin(q.anim_time*90*4*2-90)*1+1)-math.clamp(10*(math.sin(q.anim_time*90*4*2+45)*1+1),15,20)+15", 0, 0],
"position": [
0,
"math.clamp(math.sin(q.anim_time*90*4*2+45)*1,0.5,2)-0.5+math.clamp(math.sin(q.anim_time*90*4*2)*1,0,2)",
"-math.clamp(math.sin(q.anim_time*90*4*2-30)*2,0,2)+math.clamp(math.sin(-q.anim_time*90*4*2-30)*1,0,2)"
]
},
"head": {
"rotation": ["-5*(math.sin(q.anim_time*90*4*2-90)*1+1)+math.clamp(10*(math.sin(q.anim_time*90*4*2+45)*1+1),15,20)-15", 0, 0],
"position": [0, -1, -1]
"position": [0, -0.1, 0]
},
"tail": {
"rotation": ["5-math.sin(q.anim_time*90*4*2+30)*4", 0, 0]
},
"leg_front_right": {
"rotation": [
"5+math.clamp(math.sin(-q.anim_time*90*4*1-20)*30,-40,0)+math.clamp(math.sin(q.anim_time*90*4*1+20)*30,-40,0)+math.clamp(math.sin(-q.anim_time*90*4*2-40)*50,0,70)-math.clamp(math.sin(-q.anim_time*90*4*2-30+180)*20,5,70)+5",
0,
0
]
},
"leg_front_left": {
"rotation": [
"5+math.clamp(math.sin(-q.anim_time*90*4*1-20+30)*30,-40,0)+math.clamp(math.sin(q.anim_time*90*4*1+20-30)*30,-40,0)+math.clamp(math.sin(-q.anim_time*90*4*2-40+30)*50,0,70)-math.clamp(math.sin(-q.anim_time*90*4*2-30+180+30)*20,5,70)+5",
0,
0
]
},
"leg_back_right": {
"rotation": ["math.clamp(math.sin(q.anim_time*90*4*2)*40,0,50)-math.clamp(math.sin(-q.anim_time*90*4*2)*40,0,50)", 0, 0],
"position": [
0,
"-math.clamp(math.sin(q.anim_time*90*4*2)*0.3,-1,2)-math.clamp(math.sin(-q.anim_time*90*4*2)*0.8,-1,2)",
"-0.3+math.clamp(math.sin(q.anim_time*90*4*2-30)*0.5,0,2)-math.clamp(math.sin(q.anim_time*90*4*2-30+180)*0.5,0,2)"
]
},
"leg_back_left": {
"rotation": ["math.clamp(math.sin(q.anim_time*90*4*2+20)*40,0,50)-math.clamp(math.sin(-q.anim_time*90*4*2-20)*40,0,50)", 0, 0],
"position": [
0,
"-math.clamp(math.sin(q.anim_time*90*4*2)*0.3,-1,2)-math.clamp(math.sin(-q.anim_time*90*4*2)*0.8,0,2)",
"-0.3+math.clamp(math.sin(q.anim_time*90*4*2-30)*0.5,0,2)-math.clamp(math.sin(q.anim_time*90*4*2-30+180)*0.5,0,2)"
]
},
"ear_right": {
"rotation": [
0,
"15+5*math.sin(q.anim_time*90*4*2+45)+math.clamp(4*math.sin(q.anim_time*90*4*2+90),-2,2)",
"math.sin(q.anim_time*90*4*2-135)+math.clamp(4*math.sin(q.anim_time*90*4*2-90),-2,2)"
]
},
"ear_left": {
"rotation": [
0,
"-15-5*math.sin(q.anim_time*90*4*2+45)-math.clamp(4*math.sin(q.anim_time*90*4*2+90),-2,2)",
"-math.sin(q.anim_time*90*4*2-135)-math.clamp(4*math.sin(q.anim_time*90*4*2-90),-2,2)"
]
},
"leg_front_right2": {
"rotation": ["-math.clamp(math.sin(-q.anim_time*90*4*2-90)*20,5,70)+5-math.clamp(math.sin(-q.anim_time*90*4*2+180)*10,5,70)+5", 0, 0]
},
"leg_front_right3": {
"rotation": ["12*math.sin(q.anim_time*90*8+30)-math.clamp(math.sin(q.anim_time*90*8),1,1)", 0, 0]
},
"leg_front_left2": {
"rotation": ["-math.clamp(math.sin(-q.anim_time*90*8-90+30)*20,5,70)+5-math.clamp(math.sin(-q.anim_time*90*8+180+30)*10,5,70)+5", 0, 0]
},
"leg_front_left3": {
"rotation": ["8*math.sin(q.anim_time*90*8+30-90)-math.clamp(math.sin(q.anim_time*90*8-90),1,1)", 0, 0]
"rotation": [25, -12.5, 0]
},
"tail2": {
"rotation": ["2.5-math.sin(q.anim_time*90*4*2)*4", 0, 0]
},
"tail4": {
"rotation": ["-2.5-math.sin(q.anim_time*90*4*2-30)*4", 0, 0]
},
"leg_back_right2": {
"rotation": ["math.clamp(math.sin(q.anim_time*90*8-180-30)*5,0,5)-math.clamp(math.sin(-q.anim_time*90*8-90)*10,0,50)", 0, 0]
},
"leg_back_right3": {
"rotation": ["20+20*math.sin(q.anim_time*90*8+45-30)-math.clamp(math.sin(q.anim_time*90*8+90-30),1,1)", 0, 0]
},
"leg_back_left2": {
"rotation": ["math.clamp(math.sin(q.anim_time*90*8-90)*5,0,5)-math.clamp(math.sin(-q.anim_time*90*8-90)*10,0,10)", 0, 0]
},
"leg_back_left3": {
"rotation": ["20+20*math.sin(q.anim_time*90*8+15)-math.clamp(math.sin(q.anim_time*90*8+90),1,1)", 0, 0]
},
"fur_left": {
"rotation": [
0,
"-10-5*math.sin(q.anim_time*90*4*2+45)-math.clamp(4*math.sin(q.anim_time*90*4*2+90),-2,2)",
"-2*math.sin(q.anim_time*90*4*2-135)-math.clamp(4*math.sin(q.anim_time*90*4*2-90),-2,2)"
]
},
"fur_right": {
"rotation": [
0,
"10+5*math.sin(q.anim_time*90*4*2+45)+math.clamp(4*math.sin(q.anim_time*90*4*2+90),-2,2)",
"2*math.sin(q.anim_time*90*4*2-135)+math.clamp(4*math.sin(q.anim_time*90*4*2-90),-2,2)"
]
},
"tail5": {
"rotation": ["-math.sin(q.anim_time*90*4*2-30)*4", 0, 0]
},
"tail7": {
"rotation": ["15-math.sin(q.anim_time*90*4*2-90)*4", 0, 0]
"rotation": [37.5, 12.5, 0]
},
"tail3": {
"rotation": ["2.5-math.sin(q.anim_time*90*4*2-30)*4", 0, 0]
"rotation": [30, 15, 0]
},
"tail6": {
"rotation": ["-5-math.sin(q.anim_time*90*4*2-60)*6", 0, 0]
"tail4": {
"rotation": [-17.5, -15, 0]
},
"tail8": {
"rotation": ["-5-math.sin(q.anim_time*90*4*2-60)*6", 0, 0]
"tail5": {
"rotation": [-17.5, -25, 0]
},
"tail_left": {
"rotation": [0, 7.5, 0]
},
"tail_left2": {
"rotation": [0, 17.5, 0]
},
"tail_right": {
"rotation": [0, -10, 0]
},
"tail_right2": {
"rotation": [0, 17.5, 0]
},
"front_leg_left": {
"rotation": [-2, 0, 0]
},
"elbow_left": {
"rotation": [-5, 0, 0]
},
"frontpaw_left": {
"rotation": [6.5, 0, 0]
},
"front_leg_right": {
"rotation": [-2, 0, 0]
},
"elbow_right": {
"rotation": [-5, 0, 0]
},
"frontpaw_right": {
"rotation": [6.5, 0, 0]
},
"back_legs": {
"position": [0, -0.1, 0]
},
"back_leg_left": {
"rotation": [4, 0, -2.5]
},
"ankle_left": {
"rotation": [-5, 0, 0]
},
"foot_left": {
"rotation": [1, 0, 2.5]
},
"back_leg_right": {
"rotation": [4, 0, 2.5]
},
"ankle_right": {
"rotation": [-5, 0, 0]
},
"foot_right": {
"rotation": [1, 0, -2.5]
}
}
},
"animation.espeon.blink": {
"animation_length": 0.1667,
"bones": {
"eye_right": {
"position": {
"0.0": [0.1, 0, 0.1],
"0.1667": {"pre": [0.1, 0, 0.1], "post": [0, 0, 0]}
}
},
"eye_left": {
"position": {
"0.0": [-0.1, 0, 0.1],
"0.1667": {"pre": [-0.1, 0, 0.1], "post": [0, 0, 0]}
}
},
"eyelid_right": {
"position": {
"0.0": [-0.1, 0, -0.1],
"0.125": [-0.1, 0, -0.1],
"0.1667": [0, 0, 0]
"0.1667": {"pre": [-0.1, 0, -0.1], "post": [0, 0, 0]}
}
},
"eyelid_left": {
"position": {
"0.0": [0.1, 0, -0.1],
"0.125": [0.1, 0, -0.1],
"0.1667": [0, 0, 0]
"0.1667": {"pre": [0.1, 0, -0.1], "post": [0, 0, 0]}
}
}
}
},
"animation.espeon.glow": {
"loop": true,
"bones": {
"head_gem": {
"scale": 1.035
}
}
},
"animation.espeon.pose": {
"loop": true,
"bones": {
"body": {
"rotation": [0, 22.5, 0]
},
"torso": {
"rotation": [-2.5, 0, 0]
},
"torso2": {
"rotation": [-12.5, 0, 0]
},
"torso3": {
"rotation": [-2.5, 0, 0]
},
"neck": {
"rotation": [0, 0, 0]
},
"head_angle": {
"rotation": [20.3, -15, -1.5],
"position": [0, 0, 0.5]
},
"tail": {
"rotation": [-6.6945, 22.92358, 33.3055]
},
"tail2": {
"rotation": [25, 0, 0]
},
"tail3": {
"rotation": [30, 0, 0]
},
"tail4": {
"rotation": [25, 0, 0]
},
"tail5": {
"rotation": [30, 0, 0]
},
"front_leg_left": {
"rotation": [-5, 0, 2.5],
"position": [0, 1, 0]
},
"elbow_left": {
"rotation": [0, 0, 5]
},
"frontpaw_left": {
"rotation": [15, 0, 0]
},
"front_leg_right": {
"rotation": [5, 0, -7.5],
"position": [0, 1, 0]
},
"elbow_right": {
"rotation": [-7.5, 0, 0]
},
"frontpaw_right": {
"rotation": [22.5, 0, 0]
},
"back_leg_left": {
"rotation": [12.41834, -7.61516, -11.90917]
},
"ankle_left": {
"rotation": [12.5, 0, 0]
},
"foot_left": {
"rotation": [2.41492, -0.64686, 14.98637]
},
"back_leg_right": {
"rotation": [7.5, 0, 10]
},
"ankle_right": {
"rotation": [20, 0, 0]
},
"foot_right": {
"rotation": [12.5, 0, 0]
}
}
},
"animation.espeon.cry": {
"animation_length": 1.2,
"sound_effects": {
"0.04": {
"effect": "pokemon.espeon.cry"
}
}
}
}
}
@@ -3,406 +3,241 @@
"animations": {
"animation.umbreon.ground_idle": {
"loop": true,
"override_previous_animation": true,
"bones": {
"head": {
"rotation": ["-math.sin(q.anim_time*90*4)*0.2", 0, "math.clamp(math.sin(q.anim_time*90*4+45)*0.2,-1.2,1.2)"]
},
"ear_right": {
"rotation": [0, 0, "-2*math.sin(q.anim_time*90*2+90)+math.clamp(math.sin(q.anim_time*90*2-90),-1,1)"]
},
"ear_left": {
"rotation": [0, 0, "2*math.sin(q.anim_time*90*2+90)-math.clamp(math.sin(q.anim_time*90*2-90),-1,1)"]
},
"torso": {
"rotation": ["math.sin(q.anim_time*90*4)*0.2", 0, 0],
"position": [0, "(math.clamp(math.sin(q.anim_time*90*4+180)*0.1,-0.03,0.03)+math.clamp(math.sin(q.anim_time*90*2+180)*0.15,-0.5,0.5))*0.5", 0]
},
"tail": {
"rotation": ["4*(math.sin(q.anim_time*90*2)*1)+4*(math.sin(q.anim_time*90*2/2)*1)", 0, 0]
},
"tail2": {
"rotation": ["4*(math.sin(q.anim_time*90*2-90)*1)+4*(math.sin(q.anim_time*90*2/2-90)*1)", 0, 0]
},
"tail3": {
"rotation": ["4*(math.sin(q.anim_time*90*2-90)*1)+4*(math.sin(q.anim_time*90*2/2-90)*1)", 0, 0]
}
}
},
"animation.umbreon.ground_walk": {
"loop": true,
"override_previous_animation": true,
"bones": {
"body": {
"rotation": [0, 0, "math.clamp(math.sin(q.anim_time*90*4-90)*1,-0.8,0.8)+math.sin(q.anim_time*90*4-180)*1"],
"position": [0, "-1.5+math.clamp(math.sin(q.anim_time*90*4)*1.1,0.5,1)+math.clamp(math.sin(q.anim_time*90*4+180)*1.1,0.5,1)", 0]
},
"head": {
"rotation": [0, 0, "-math.clamp(math.sin(q.anim_time*90*4-90)*1,-0.8,0.8)-math.sin(q.anim_time*90*4-180)*1"],
"position": [
"math.sin(q.anim_time*90*4-45)*0.1",
"math.clamp(math.sin(q.anim_time*90*4+30)*0.05,0.5,1)+math.clamp(math.sin(-q.anim_time*90*4+30)*0.05,0.5,1)+math.sin(-q.anim_time*90*8+30)*0.2-1",
0
]
},
"leg_front_right": {
"rotation": [
"30-math.clamp(20*(math.sin(q.anim_time*90*4-90+180)*1+1),-0,60)",
0,
"math.clamp(math.sin(q.anim_time*90*4-90+180)*1,-0.8,0.8)+math.sin(q.anim_time*90*4-180+180)*1"
],
"position": [
0,
"-0.5+0.8*(math.clamp(math.sin(q.anim_time*90*4-155+180)*1.6,1,1.6)-0.2)+0.5*(math.clamp(math.sin(q.anim_time*90*4-75+180)*1.8,1,1.8)-1)-0.2*(math.clamp(math.sin(q.anim_time*90*4+180)*1.4,1,1.4)+1)",
0
]
},
"leg_front_left": {
"rotation": [
"30-math.clamp(20*(math.sin(q.anim_time*90*4-90)*1+1),-0,60)",
0,
"-math.clamp(math.sin(q.anim_time*90*4-90)*1,-0.8,0.8)-math.sin(q.anim_time*90*4-180)*1"
],
"position": [
0,
"-0.5+0.8*(math.clamp(math.sin(q.anim_time*90*4-155)*1.6,1,1.6)-0.2)+0.5*(math.clamp(math.sin(q.anim_time*90*4-75)*1.8,1,1.8)-1)-0.2*(math.clamp(math.sin(q.anim_time*90*4)*1.4,1,1.4)+1)",
0
]
},
"leg_back_right": {
"rotation": [
"-20+math.clamp(15*(math.sin(q.anim_time*90*4-90+180)*1+1),-0,60)",
0,
"math.clamp(math.sin(q.anim_time*90*4-90+180)*1,-0.8,0.8)+math.sin(q.anim_time*90*4-180+180)*1"
],
"position": [
0,
"-math.clamp(-math.sin(q.anim_time*90*4+90+180)*0.01,0,0.01)+math.clamp(-math.sin(q.anim_time*90*4+20+180)*1,0.4,1)-0.4+math.clamp(math.sin(q.anim_time*90*4-130+180)*1.5,0.4,0.6)-0.3",
-0.1
]
},
"leg_back_left": {
"rotation": [
"-20+math.clamp(15*(math.sin(q.anim_time*90*4-90)*1+1),-0,60)",
0,
"-math.clamp(math.sin(q.anim_time*90*4-90)*1,-0.8,0.8)-math.sin(q.anim_time*90*4-180)*1"
],
"position": [
0,
"-math.clamp(-math.sin(q.anim_time*90*4+90)*0.01,0,0.01)+math.clamp(-math.sin(q.anim_time*90*4+20)*1,0.4,1)-0.4+math.clamp(math.sin(q.anim_time*90*4-130)*1.5,0.4,0.6)-0.3",
-0.1
]
},
"ear_right": {
"rotation": [
"math.sin(q.anim_time*90*8+45)+math.clamp(math.sin(q.anim_time*90*8+90),-1,1)",
"0.5*math.sin(q.anim_time*90*8+45)+0.5*math.clamp(math.sin(q.anim_time*90*8+90),-2,2)",
0
]
"position": [0, -0.2, 0]
},
"ear_left": {
"rotation": [
"math.sin(q.anim_time*90*8+45)+math.clamp(math.sin(q.anim_time*90*8+90),-1,1)",
"-0.5*math.sin(q.anim_time*90*8+45)-0.5*math.clamp(math.sin(q.anim_time*90*8+90),-2,2)",
0
]
"rotation": [-20, 0, 0]
},
"leg_front_right2": {
"rotation": [
"math.clamp(math.sin(q.anim_time*90*4-180+10+180)*20,0,10)+math.clamp(math.sin(q.anim_time*90*4-180+10+180)*20,-50,50)-math.clamp(math.sin(q.anim_time*90*4+10+180)*70,50,60)+25",
0,
0
]
},
"leg_front_right3": {
"rotation": [
"-45+math.clamp(20*(math.sin(q.anim_time*90*4-90+180)*1+1),-0,60)-math.clamp(math.sin(q.anim_time*90*4-180+10+180)*20,0,10)-math.clamp(math.sin(q.anim_time*90*4-180+10+180)*20,-50,50)+math.clamp(math.sin(q.anim_time*90*4+10+180)*70,50,60)+math.clamp(math.sin(q.anim_time*90*4+40+180)*80,50,80)-60",
0,
0
],
"position": [0, "math.clamp(math.sin(q.anim_time*90*4-120+180)*1.1,0.9,1)-0.9+math.clamp(math.sin(q.anim_time*90*2-130+180)*1.3,0.9,1)-0.9", 0]
},
"leg_front_left2": {
"rotation": [
"math.clamp(math.sin(q.anim_time*90*4-180+10)*20,0,10)+math.clamp(math.sin(q.anim_time*90*4-180+10)*20,-50,50)-math.clamp(math.sin(q.anim_time*90*4+10)*70,50,60)+25",
0,
0
]
},
"leg_front_left3": {
"rotation": [
"-45+math.clamp(20*(math.sin(q.anim_time*90*4-90)*1+1),-0,60)-math.clamp(math.sin(q.anim_time*90*4-180+10)*20,0,10)-math.clamp(math.sin(q.anim_time*90*4-180+10)*20,-50,50)+math.clamp(math.sin(q.anim_time*90*4+10)*70,50,60)+math.clamp(math.sin(q.anim_time*90*4+40)*80,50,80)-60",
0,
0
],
"position": [0, "math.clamp(math.sin(q.anim_time*90*4-120)*1.1,0.9,1)-0.9+math.clamp(math.sin(q.anim_time*90*2-130)*1.3,0.9,1)-0.9", 0]
},
"leg_back_right2": {
"rotation": [
"math.clamp(math.sin(q.anim_time*90*4+180)*10,0,10)+math.clamp(math.sin(q.anim_time*90*4-95+180)*25,0,45)-math.clamp(math.sin(q.anim_time*90*4+180+180)*10,0,45)",
0,
0
],
"position": [0, "math.clamp(math.sin(q.anim_time*90*4-130+180)*1.5,0.5,0.8)-0.5", 0]
},
"leg_back_right3": {
"rotation": [
"-math.clamp(math.sin(q.anim_time*90*4+180)*10,0,10)-math.clamp(math.sin(q.anim_time*90*4-95+180)*25,0,45)+math.clamp(math.sin(q.anim_time*90*4+180+180)*15,0,45)-(-20+math.clamp(15*(math.sin(q.anim_time*90*4-90+180)*1+1),-0,60))+math.clamp(math.sin(q.anim_time*90*4-100+180)*100,60,100)-60",
0,
0
],
"position": [0, "math.clamp(math.sin(q.anim_time*90*4-110)*1,0.8,1)-0.8", 0]
},
"leg_back_left2": {
"rotation": [
"math.clamp(math.sin(q.anim_time*90*4)*10,0,10)+math.clamp(math.sin(q.anim_time*90*4-95)*25,0,45)-math.clamp(math.sin(q.anim_time*90*4+180)*10,0,45)",
0,
0
],
"position": [0, "math.clamp(math.sin(q.anim_time*90*4-130)*1.5,0.5,0.8)-0.5", 0]
},
"leg_back_left3": {
"rotation": [
"-math.clamp(math.sin(q.anim_time*90*4)*10,0,10)-math.clamp(math.sin(q.anim_time*90*4-95)*25,0,45)+math.clamp(math.sin(q.anim_time*90*4+180)*15,0,45)-(-20+math.clamp(15*(math.sin(q.anim_time*90*4-90)*1+1),-0,60))+math.clamp(math.sin(q.anim_time*90*4-100)*100,60,100)-60",
0,
0
],
"position": [0, "math.clamp(math.sin(q.anim_time*90*4-110+180)*1,0.8,1)-0.8", 0]
}
}
},
"animation.umbreon.ground_run": {
"loop": true,
"override_previous_animation": true,
"bones": {
"body": {
"rotation": ["5*(math.sin(q.anim_time*90*4*2-90)*1+1)-math.clamp(10*(math.sin(q.anim_time*90*4*2+45)*1+1),15,20)+15", 0, 0],
"position": [
0,
"math.clamp(math.sin(q.anim_time*90*4*2+45)*1,0.5,2)-0.5+math.clamp(math.sin(q.anim_time*90*4*2)*1,0,2)",
"-math.clamp(math.sin(q.anim_time*90*4*2-30)*2,0,2)+math.clamp(math.sin(-q.anim_time*90*4*2-30)*1,0,2)"
]
},
"head": {
"rotation": ["-5*(math.sin(q.anim_time*90*4*2-90)*1+1)+math.clamp(10*(math.sin(q.anim_time*90*4*2+45)*1+1),15,20)-15", 0, 0],
"position": [0, -1, -1]
},
"leg_front_right": {
"rotation": [
"5+math.clamp(math.sin(-q.anim_time*90*4*1-20)*30,-40,0)+math.clamp(math.sin(q.anim_time*90*4*1+20)*30,-40,0)+math.clamp(math.sin(-q.anim_time*90*4*2-40)*50,0,70)-math.clamp(math.sin(-q.anim_time*90*4*2-30+180)*20,5,70)+5",
0,
0
]
},
"leg_front_left": {
"rotation": [
"5+math.clamp(math.sin(-q.anim_time*90*4*1-20+30)*30,-40,0)+math.clamp(math.sin(q.anim_time*90*4*1+20-30)*30,-40,0)+math.clamp(math.sin(-q.anim_time*90*4*2-40+30)*50,0,70)-math.clamp(math.sin(-q.anim_time*90*4*2-30+180+30)*20,5,70)+5",
0,
0
]
},
"leg_back_right": {
"rotation": ["math.clamp(math.sin(q.anim_time*90*4*2)*40,0,50)-math.clamp(math.sin(-q.anim_time*90*4*2)*40,0,50)", 0, 0],
"position": [
0,
"-math.clamp(math.sin(q.anim_time*90*4*2)*0.3,-1,2)-math.clamp(math.sin(-q.anim_time*90*4*2)*0.8,-1,2)",
"-0.3+math.clamp(math.sin(q.anim_time*90*4*2-30)*0.5,0,2)-math.clamp(math.sin(q.anim_time*90*4*2-30+180)*0.5,0,2)"
]
},
"leg_back_left": {
"rotation": ["math.clamp(math.sin(q.anim_time*90*4*2+20)*40,0,50)-math.clamp(math.sin(-q.anim_time*90*4*2-20)*40,0,50)", 0, 0],
"position": [
0,
"-math.clamp(math.sin(q.anim_time*90*4*2)*0.3,-1,2)-math.clamp(math.sin(-q.anim_time*90*4*2)*0.8,0,2)",
"-0.3+math.clamp(math.sin(q.anim_time*90*4*2-30)*0.5,0,2)-math.clamp(math.sin(q.anim_time*90*4*2-30+180)*0.5,0,2)"
]
"ear_left2": {
"rotation": [-2.5, 0, 0]
},
"ear_right": {
"rotation": [
"-10-4*math.sin(q.anim_time*90*4*2+45)-math.clamp(4*math.sin(q.anim_time*90*4*2+90),-4,4)",
"10+4*math.sin(q.anim_time*90*4*2+45)+math.clamp(4*math.sin(q.anim_time*90*4*2+90),-4,4)",
0
]
"rotation": [-20, 0, 0]
},
"ear_left": {
"rotation": [
"-10-4*math.sin(q.anim_time*90*4*2+45)-math.clamp(4*math.sin(q.anim_time*90*4*2+90),-4,4)",
"-10-4*math.sin(q.anim_time*90*4*2+45)-math.clamp(4*math.sin(q.anim_time*90*4*2+90),-4,4)",
0
]
},
"leg_front_right2": {
"rotation": ["-math.clamp(math.sin(-q.anim_time*90*4*2-90)*20,5,70)+5-math.clamp(math.sin(-q.anim_time*90*4*2+180)*10,5,70)+5", 0, 0]
},
"leg_front_right3": {
"rotation": ["12*math.sin(q.anim_time*90*8+30)-math.clamp(math.sin(q.anim_time*90*8),1,1)", 0, 0]
},
"leg_front_left2": {
"rotation": ["-math.clamp(math.sin(-q.anim_time*90*8-90+30)*20,5,70)+5-math.clamp(math.sin(-q.anim_time*90*8+180+30)*10,5,70)+5", 0, 0]
},
"leg_front_left3": {
"rotation": ["8*math.sin(q.anim_time*90*8+30-90)-math.clamp(math.sin(q.anim_time*90*8-90),1,1)", 0, 0]
},
"leg_back_right2": {
"rotation": ["math.clamp(math.sin(q.anim_time*90*8-180-30)*5,0,5)-math.clamp(math.sin(-q.anim_time*90*8-90)*10,0,50)", 0, 0]
},
"leg_back_right3": {
"rotation": ["20+20*math.sin(q.anim_time*90*8+45-30)-math.clamp(math.sin(q.anim_time*90*8+90-30),1,1)", 0, 0]
},
"leg_back_left2": {
"rotation": ["math.clamp(math.sin(q.anim_time*90*8-90)*5,0,5)-math.clamp(math.sin(-q.anim_time*90*8-90)*10,0,10)", 0, 0]
},
"leg_back_left3": {
"rotation": ["20+20*math.sin(q.anim_time*90*8+15)-math.clamp(math.sin(q.anim_time*90*8+90),1,1)", 0, 0]
"ear_right2": {
"rotation": [-2.5, 0, 0]
},
"tail": {
"rotation": ["-20-math.sin(q.anim_time*90*4*2+60)*12", 0, 0]
"rotation": [35, 0, 0]
},
"tail2": {
"rotation": ["-math.sin(q.anim_time*90*4*2-30)*12", 0, 0]
"rotation": [2.5, 0, 0]
},
"tail3": {
"rotation": ["-math.sin(q.anim_time*90*4*2)*6", 0, 0]
"rotation": [2.5, 0, 0]
},
"front_leg_left": {
"rotation": [2.5, 0, -2]
},
"elbow_left": {
"rotation": [-10, 0, 0]
},
"frontpaw_left": {
"rotation": [7.5, 0, 2]
},
"front_leg_right": {
"rotation": [2.5, 0, 2]
},
"elbow_right": {
"rotation": [-10, 0, 0]
},
"frontpaw_right": {
"rotation": [7.5, 0, -2]
},
"back_leg_left": {
"rotation": [3, 0, -4]
},
"ankle_left": {
"rotation": [-5, 0, 0]
},
"foot_left": {
"rotation": [2, 0, 4]
},
"back_leg_right": {
"rotation": [3, 0, 4]
},
"ankle_right": {
"rotation": [-5, 0, 0]
},
"foot_right": {
"rotation": [2, 0, -4]
}
}
},
"animation.umbreon.blink": {
"animation_length": 0.1667,
"bones": {
"eyelid_right": {
"position": {
"0.0": [-0.1, 0, -0.1],
"0.125": [-0.1, 0, -0.1],
"0.1667": [0, 0, 0]
}
},
"eyelid_left": {
"position": {
"0.0": [0.1, 0, -0.1],
"0.125": [0.1, 0, -0.1],
"0.1667": [0, 0, 0]
"0.1667": {"pre": [0.1, 0, -0.1], "post": [0, 0, 0]}
}
},
"eyelid_right": {
"position": {
"0.0": [-0.1, 0, -0.1],
"0.1667": {"pre": [-0.1, 0, -0.1], "post": [0, 0, 0]}
}
},
"eye_left": {
"position": {
"0.0": [-0.1, 0, 0.1],
"0.1667": {"pre": [-0.1, 0, 0.1], "post": [0, 0, 0]}
}
},
"eye_right": {
"position": {
"0.0": [0.1, 0, 0.1],
"0.1667": {"pre": [0.1, 0, 0.1], "post": [0, 0, 0]}
}
}
}
},
"animation.umbreon.cry": {
"animation_length": 1.25,
"animation.umbreon.glow": {
"loop": true,
"bones": {
"head": {
"rotation": {
"0.0": {
"post": [0, 0, 0],
"lerp_mode": "catmullrom"
},
"0.0833": {
"post": [1.25, 0, 0],
"lerp_mode": "catmullrom"
},
"0.1667": {
"post": [-5, 0, 0],
"lerp_mode": "catmullrom"
},
"0.4583": {
"post": [-2.5, 0, 0],
"lerp_mode": "catmullrom"
},
"0.5833": {
"post": [-5, 0, 0],
"lerp_mode": "catmullrom"
},
"0.7083": {
"post": [-10, 0, 0],
"lerp_mode": "catmullrom"
},
"0.9167": {
"post": [0, 0, 0],
"lerp_mode": "catmullrom"
},
"1.25": [0, 0, 0]
}
"ear_ring_left": {
"scale": [1.01, 1, 1.01]
},
"mouth": {
"position": {
"0.0": [0, 0, 0],
"0.0833": [0, 0, 0],
"0.125": [0, 0, -0.1],
"0.2917": [0, 0, -0.1],
"0.3333": [0, 0, 0],
"0.5417": [0, 0, 0],
"0.5833": [0, 0, -0.1],
"0.75": [0, 0, -0.1],
"0.7917": [0, 0, 0]
}
"ear_ring_right": {
"scale": [1.01, 1, 1.01]
},
"ear_left": {
"rotation": {
"0.0": {
"post": [0, 0, 0],
"lerp_mode": "catmullrom"
},
"0.1667": {
"post": [-0.5, 0, 0],
"lerp_mode": "catmullrom"
},
"0.25": {
"post": [-7.5, 0, 0],
"lerp_mode": "catmullrom"
},
"0.4583": {
"post": [-2.5, 0, 0],
"lerp_mode": "catmullrom"
},
"0.625": {
"post": [-5, 0, 0],
"lerp_mode": "catmullrom"
},
"0.7917": {
"post": [-10, 0, 0],
"lerp_mode": "catmullrom"
},
"1.0417": {
"post": [0, 0, 0],
"lerp_mode": "catmullrom"
},
"1.25": [0, 0, 0]
}
"tail_ring": {
"scale": [1.01, 1.01, 1]
},
"frontleg_ring_left": {
"position": [0.025, 0, 0]
},
"frontleg_ring_right": {
"position": [-0.025, 0, 0]
},
"backleg_ring_left": {
"position": [0.025, 0, 0]
},
"backleg_ring_right": {
"position": [-0.025, 0, 0]
},
"head_ring": {
"scale": 1.02
}
}
},
"animation.umbreon.pose": {
"loop": true,
"bones": {
"body": {
"rotation": [0, -45, 0]
},
"torso": {
"rotation": [10, 0, 0]
},
"torso2": {
"rotation": [-2.5, 0, 0]
},
"torso3": {
"rotation": [-10, 0, 0]
},
"head_angle": {
"rotation": [-35, 70, -55]
},
"tail": {
"rotation": [5, 5, 0]
},
"front_leg_left": {
"rotation": [10, 0, -5]
},
"elbow_left": {
"rotation": [-10, 0, 0]
},
"frontpaw_left": {
"rotation": [0, 0, 5]
},
"back_leg_left": {
"rotation": [5, 0, -5]
},
"ankle_left": {
"rotation": [-5, 0, 0]
},
"foot_left": {
"rotation": [0, 0, 5]
},
"tail2": {
"rotation": [7.5, 5, 0]
},
"tail3": {
"rotation": [12.5, 0, 0]
},
"tail4": {
"rotation": [7.5, 0, 0]
},
"front_leg_right": {
"rotation": [0, 7.5, 7.5]
},
"elbow_right": {
"rotation": [-7.5, 0, 0]
},
"frontpaw_right": {
"rotation": [7.5, 0, -7.5]
},
"ear_left2": {
"rotation": [0, 0, 5]
},
"ear_ring_left": {
"scale": 1.02
},
"ear_left3": {
"rotation": [0, 0, 7.5]
},
"ear_right": {
"rotation": {
"0.0": {
"post": [0, 0, 0],
"lerp_mode": "catmullrom"
},
"0.1667": {
"post": [-0.5, 0, 0],
"lerp_mode": "catmullrom"
},
"0.25": {
"post": [-7.5, 0, 0],
"lerp_mode": "catmullrom"
},
"0.4583": {
"post": [-2.5, 0, 0],
"lerp_mode": "catmullrom"
},
"0.625": {
"post": [-5, 0, 0],
"lerp_mode": "catmullrom"
},
"0.7917": {
"post": [-10, 0, 0],
"lerp_mode": "catmullrom"
},
"1.0417": {
"post": [0, 0, 0],
"lerp_mode": "catmullrom"
},
"1.25": [0, 0, 0]
}
"rotation": [-30, 0, 5]
},
"ear_right2": {
"rotation": [0, 0, 5]
},
"ear_ring_right": {
"scale": 1.02
},
"ear_right3": {
"rotation": [0, 0, 7.5]
},
"back_leg_right": {
"rotation": [17.5, 0, 12.5]
},
"frontleg_ring_left": {
"scale": 1.02
},
"frontleg_ring_right": {
"scale": 1.02
},
"backleg_ring_left": {
"scale": 1.02
},
"backleg_ring_right": {
"scale": 1.02
},
"knee_right": {
"rotation": [-12.5, 0, 0]
},
"ankle_right": {
"rotation": [15, 0, 0]
},
"foot_right": {
"rotation": [-20, 0, -12.5]
},
"tail_ring": {
"scale": 1.02
},
"ear_left": {
"rotation": [-20, 0, 0]
}
},
}
},
"animation.umbreon.cry": {
"animation_length": 1.2,
"sound_effects": {
"0.125": {
"0.04": {
"effect": "pokemon.umbreon.cry"
}
}
@@ -0,0 +1,178 @@
{
"format_version": "1.8.0",
"animations": {
"animation.dunsparce.pose": {
"loop": true,
"bones": {
"body": {
"position": [0, 10, 0]
},
"torso": {
"rotation": [-29.14743, 7.43547, 13.06431]
},
"wing_left": {
"rotation": [0, 0, 30]
},
"tail": {
"rotation": [-25, 0, 0]
},
"drill": {
"rotation": [37.5, 0, 0]
},
"neck": {
"rotation": [15, 0, 0]
},
"head": {
"rotation": [11.76782, 4.2453, -19.5623]
},
"mouth_spikes_bottom": {
"rotation": [-55, 0, 0],
"position": [0, -2, 0]
},
"mouth_spikes_front": {
"position": [0, 0, 2]
},
"wing_right": {
"rotation": [0, 0, -30]
},
"mouth_open_wide_right": {
"position": [-0.1, -0.1, -0.1]
},
"mouth_open_wide_left": {
"position": [0.1, -0.1, -0.1]
}
}
},
"animation.dunsparce.mouths_test": {
"loop": "hold_on_last_frame",
"animation_length": 0.75,
"bones": {
"head": {
"rotation": [-10, 0, 0]
},
"mouth_open_right": {
"position": {
"0.0": [0, 0, 0],
"0.25": {"pre": [0, 0, 0], "post": [-0.1, -0.1, -0.1]},
"0.5": {"pre": [-0.1, -0.1, -0.1], "post": [0, 0, 0]}
}
},
"mouth_spikes_bottom": {
"position": {
"0.0": [0, 0, 0],
"0.25": {"pre": [0, 0, 0], "post": [0, -2, 0]},
"0.5": {"pre": [0, -2, 0], "post": [0, -2, -2]},
"0.75": {"pre": [0, -2, -2], "post": [0, 0, 0]}
}
},
"mouth_spike_bottom_left": {
"rotation": {
"0.0": [0, 0, 0],
"0.25": {"pre": [0, 0, 0], "post": [-35, 0, 0]},
"0.75": {"pre": [-35, 0, 0], "post": [0, 0, 0]}
}
},
"mouth_spike_bottom_right": {
"rotation": {
"0.0": [0, 0, 0],
"0.25": {"pre": [0, 0, 0], "post": [-35, 0, 0]},
"0.75": {"pre": [-35, 0, 0], "post": [0, 0, 0]}
}
},
"mouth_spikes_front": {
"position": {
"0.0": [0, 0, 0],
"0.25": {"pre": [0, 0, 0], "post": [0, 0, 2]},
"0.75": {"pre": [0, 0, 2], "post": [0, 0, 0]}
}
},
"mouth_open_small_right": {
"position": {
"0.0": [0, 0, 0],
"0.5": {"pre": [0, 0, 0], "post": [-0.1, -0.1, -0.1]},
"0.75": {"pre": [-0.1, -0.1, -0.1], "post": [0, 0, 0]}
}
},
"mouth_open_left": {
"position": {
"0.0": [0, 0, 0],
"0.25": {"pre": [0, 0, 0], "post": [0.1, -0.1, -0.1]},
"0.5": {"pre": [0.1, -0.1, -0.1], "post": [0, 0, 0]}
}
},
"mouth_open_small_left": {
"position": {
"0.0": [0, 0, 0],
"0.5": {"pre": [0, 0, 0], "post": [0.1, -0.1, -0.1]},
"0.75": {"pre": [0.1, -0.1, -0.1], "post": [0, 0, 0]}
}
}
}
},
"animation.dunsparce.ground_idle": {
"loop": true,
"bones": {
"tail": {
"rotation": [35, 0, 0]
},
"head": {
"rotation": [-5, 0, 0]
},
"wing_left": {
"rotation": [0, -15, 35]
},
"drill": {
"rotation": [30, 0, 0]
},
"mouth_spike_front_right": {
"rotation": [12.5, 0, 0]
},
"mouth_spike_front_left": {
"rotation": [12.5, 0, 0]
},
"wing_right": {
"rotation": [0, 15, -35]
}
}
},
"animation.dunsparce.hiding": {
"loop": true,
"bones": {
"torso": {
"rotation": [-67.5, 0, 0],
"position": [0, -4, 2]
},
"wing_left": {
"rotation": [-37.5, 0, 20]
},
"tail": {
"rotation": [-22.5, 0, 0]
},
"tail2": {
"rotation": [-30, 0, 0]
},
"drill": {
"rotation": [-32.5, 0, 0]
},
"head": {
"rotation": [25, 0, 0]
},
"mouth_spikes_front": {
"rotation": [35, 0, 0]
},
"neck": {
"rotation": [25, 0, 0]
},
"wing_right": {
"rotation": [-37.5, 0, -20]
}
}
},
"animation.dunsparce.blink": {
"animation_length": 0.1667
},
"animation.dunsparce.recoil": {
"animation_length": 0.0417
}
}
}
@@ -2,257 +2,102 @@
"format_version": "1.8.0",
"animations": {
"animation.treecko.test": {
"animation_length": 1.2,
"loop": true,
"bones": {
"head": {
"rotation": [-2.5, 0, 0]
"rotation": [-10, 0, 0],
"position": [0, 0.1, -0.3]
},
"jaw": {
"rotation": [42.5, 0, 0]
"rotation": [32.5, 0, 0]
},
"tail": {
"rotation": [-45, 0, 0],
"position": [0, -0.5, 0]
},
"left_tail": {
"tail_left": {
"rotation": [10, 0, 2.5]
},
"left_tail2": {
"tail_left2": {
"rotation": [17.5, 0, 0]
},
"right_tail": {
"tail_right": {
"rotation": [10, 0, -2.5]
},
"right_tail2": {
"tail_right2": {
"rotation": [15, 0, 0]
},
"left_upper_arm": {
"arm_left": {
"rotation": [0, 0, -5]
},
"left_hand": {
"hand_left": {
"rotation": [0, 0, -57.5]
},
"left_index_finger": {
"finger_front_left": {
"rotation": [0, 0, 20]
},
"left_index_finger2": {
"finger_front_left2": {
"rotation": [0, 0, 45]
},
"left_pinky_finger": {
"finger_back_left": {
"rotation": [0, 0, 20]
},
"left_pinky_finger2": {
"finger_back_left2": {
"rotation": [0, 0, 45]
},
"left_middle_finger": {
"finger_middle_left": {
"rotation": [0, 0, 20]
},
"left_middle_finger2": {
"finger_middle_left2": {
"rotation": [0, 0, 45]
},
"right_upper_arm": {
"arm_right": {
"rotation": [0, 0, 5]
},
"torso": {
"rotation": [7.5, 0, 0]
},
"upper_torso": {
"torso2": {
"rotation": [-5, 0, 0]
},
"neck": {
"rotation": [-5, 0, 0]
},
"right_hand": {
"hand_right": {
"rotation": [0, 0, 57.5]
},
"right_index_finger": {
"finger_front_right": {
"rotation": [0, 0, -20]
},
"right_index_finger2": {
"finger_front_right2": {
"rotation": [0, 0, -45]
},
"right_pinky_finger": {
"finger_back_right": {
"rotation": [0, 0, -20]
},
"right_pinky_finger2": {
"finger_back_right2": {
"rotation": [0, 0, -45]
},
"right_middle_finger": {
"finger_middle_right": {
"rotation": [0, 0, -20]
},
"right_middle_finger2": {
"finger_middle_right2": {
"rotation": [0, 0, -45]
},
"left_upper_leg": {
"leg_left": {
"rotation": [1.18155, -9.91358, -2.38565]
},
"left_foot": {
"foot_left": {
"rotation": [-0.4165, -7.26605, 3.29302]
},
"right_upper_leg": {
"leg_right": {
"rotation": [1.18155, 9.91358, 2.38565]
},
"right_foot": {
"foot_right": {
"rotation": [-0.4165, 7.26605, -3.29302]
}
}
},
"animation.treecko.test2": {
"loop": true,
"bones": {
"torso": {
"rotation": [-4.73298, 2.77592, 27.09295]
},
"tail": {
"rotation": [-6.80313, 33.64286, -11.17316],
"position": [0.25, 0, 0]
},
"left_tail": {
"rotation": [15.32536, 9.84392, 1.79183]
},
"left_tail2": {
"rotation": [15.64835, 14.47267, 4.00563]
},
"right_tail": {
"rotation": [20.05865, 9.84795, 1.74036]
},
"right_tail2": {
"rotation": [17.62876, 9.658, 2.59914]
},
"upper_torso": {
"rotation": [12.06953, 5.56451, -12.40436]
},
"neck": {
"rotation": [3.59647, 22.86202, -3.90796]
},
"head": {
"rotation": [8.6876, -10.06991, 4.69965],
"position": [0, 0, -0.5]
},
"right_pupil": {
"position": [0, 0, -0.5]
},
"left_upper_arm": {
"rotation": [0, 22.5, -25],
"position": [0, 0, 0.25]
},
"left_lower_arm": {
"rotation": [0, 5, 0]
},
"left_hand": {
"rotation": [-17.87814, -19.86103, -49.99202],
"position": [-0.15, 0.05, 0]
},
"left_index_finger": {
"rotation": [0, 5, 20]
},
"left_index_finger2": {
"rotation": [0, 0, 45]
},
"left_pinky_finger": {
"rotation": [0, -5, 20]
},
"left_pinky_finger2": {
"rotation": [0, 0, 45]
},
"left_middle_finger": {
"rotation": [0, 0, 20]
},
"left_middle_finger2": {
"rotation": [0, 0, 45]
},
"right_upper_arm": {
"rotation": [27.9096, 1.08115, 23.32938]
},
"right_lower_arm": {
"rotation": [0, -10, 0]
},
"right_hand": {
"rotation": [8.98458, -4.04496, 42.82624],
"position": [0.15, 0.05, 0]
},
"right_index_finger": {
"rotation": [0, -15, -20]
},
"right_index_finger2": {
"rotation": [0, 0, -45]
},
"right_pinky_finger": {
"rotation": [0, 15, -20]
},
"right_pinky_finger2": {
"rotation": [0, 0, -45]
},
"right_middle_finger": {
"rotation": [0, 0, -20]
},
"right_middle_finger2": {
"rotation": [0, 0, -45]
},
"right_upper_leg": {
"rotation": [-118.81845, 9.91358, 2.38565],
"position": [0, 0.75, -1.25]
},
"right_foot": {
"rotation": [-11.96634, 26.73797, -15.04829]
},
"left_upper_leg": {
"rotation": [-2.91472, -22.08853, 21.08653]
},
"left_foot": {
"rotation": [65.81573, -6.16374, -15.44323]
},
"body": {
"position": [0, 0.75, 0]
},
"right_tail3": {
"rotation": [0, 0, 0]
},
"jaw": {
"rotation": [50, 0, 0]
},
"right_lower_leg": {
"rotation": [70.02991, 6.8466, -10.45577]
},
"right_foot2": {
"rotation": [12.5, 0, 0],
"position": [0, 0, 0.25]
},
"right_toes": {
"rotation": [17.5, 0, 0]
},
"left_lower_leg": {
"rotation": [16.93839, -4.46375, 14.33501]
},
"left_foot2": {
"rotation": [-40.67815, -9.54385, 8.11019]
},
"left_toes": {
"rotation": [-24.91643, -2.11089, -4.53359]
},
"left_pupil": {
"position": [0, 0, 0.5]
},
"right_inner_toe": {
"rotation": [25, -20, 0]
},
"right_outer_toe": {
"rotation": [22.5, 20, 0]
},
"right_middle_toe": {
"rotation": [15, 0, 0]
},
"left_inner_toe": {
"rotation": [-32.5, 0, 0]
},
"left_outer_toe": {
"rotation": [-25, 0, 0]
},
"left_middle_toe": {
"rotation": [-25, 0, 0]
}
}
},
"animation.treecko.ground_idle": {
"loop": true,
"bones": {
@@ -262,19 +107,19 @@
"tail": {
"rotation": [-45, 0, 0]
},
"left_tail": {
"tail_left": {
"rotation": [10, 0, 0]
},
"left_tail2": {
"tail_left2": {
"rotation": [15, 0, 0]
},
"right_tail": {
"tail_right": {
"rotation": [10, 0, 0]
},
"right_tail2": {
"tail_right2": {
"rotation": [15, 0, 0]
},
"upper_torso": {
"torso2": {
"rotation": [-5, 0, 0]
},
"neck": {
@@ -283,95 +128,106 @@
"head": {
"rotation": [2.5, 0, 0]
},
"right_pupil": {
"pupil_right": {
"position": [0, 0, 0]
},
"left_upper_arm": {
"arm_left": {
"rotation": [10.08453, -7.38542, 48.69038]
},
"left_lower_arm": {
"arm_left2": {
"rotation": [0, 42.5, 0]
},
"left_hand": {
"hand_left": {
"rotation": [0, 0, 22.5],
"position": [-0.15, 0.05, 0]
},
"left_index_finger": {
"finger_front_left": {
"rotation": [6.94363, 7.64256, 14.02881]
},
"left_index_finger2": {
"finger_front_left2": {
"rotation": [0, 0, 22.5]
},
"left_pinky_finger": {
"finger_back_left": {
"rotation": [-4.01743, -1.75217, 14.46202]
},
"left_pinky_finger2": {
"finger_back_left2": {
"rotation": [0, 0, 30]
},
"left_middle_finger": {
"finger_middle_left": {
"rotation": [0, 0, 12.5]
},
"left_middle_finger2": {
"finger_middle_left2": {
"rotation": [0, 0, 20]
},
"right_upper_arm": {
"arm_right": {
"rotation": [10.08453, 7.38542, -48.69038]
},
"right_lower_arm": {
"arm_right2": {
"rotation": [0, -42.5, 0]
},
"right_hand": {
"hand_right": {
"rotation": [0, 0, -22.5],
"position": [0.15, 0.05, 0]
},
"right_index_finger": {
"finger_front_right": {
"rotation": [6.94363, -7.64256, -14.02881]
},
"right_index_finger2": {
"finger_front_right2": {
"rotation": [0, 0, -22.5]
},
"right_pinky_finger": {
"finger_back_right": {
"rotation": [-4.01743, 1.75217, -14.46202]
},
"right_pinky_finger2": {
"finger_back_right2": {
"rotation": [0, 0, -30]
},
"right_middle_finger": {
"finger_middle_right": {
"rotation": [0, 0, -12.5]
},
"right_middle_finger2": {
"finger_middle_right2": {
"rotation": [0, 0, -20]
},
"right_upper_leg": {
"leg_right": {
"rotation": [1.18155, 9.91358, 2.38565]
},
"right_foot": {
"foot_right": {
"rotation": [-0.4165, 7.26605, -3.29302]
},
"left_upper_leg": {
"leg_left": {
"rotation": [1.18155, -9.91358, -2.38565]
},
"left_foot": {
"foot_left": {
"rotation": [-0.4165, -7.26605, 3.29302]
},
"stick": {
"rotation": [30, 45, 0],
"scale": 0.7
}
}
},
"animation.treecko.blink": {
"animation_length": 0.16667,
"animation_length": 0.1667,
"bones": {
"left_eyelid": {
"eyelid_left": {
"position": {
"0.0": [0.1, 0, 0],
"0.125": {"pre": [0.1, 0, 0], "post": [0.1, 0, 0]},
"0.125": [0.1, 0, 0],
"0.1667": {"pre": [0.1, 0, 0], "post": [0, 0, 0]}
}
},
"right_eyelid": {
"eyelid_right": {
"position": {
"0.0": [-0.1, 0, 0],
"0.125": {"pre": [-0.1, 0, 0], "post": [-0.1, 0, 0]},
"0.125": [-0.1, 0, 0],
"0.1667": {"pre": [-0.1, 0, 0], "post": [0, 0, 0]}
}
},
"eye_right": {
"position": {
"0.0": [0.1, 0, 0],
"0.125": [0.1, 0, 0],
"0.1667": {"pre": [0.1, 0, 0], "post": [0, 0, 0]}
}
}
}
},
@@ -422,25 +278,25 @@
"tail": {
"rotation": ["-42.5+math.sin(q.anim_time*90*8+0)*3", "math.sin(q.anim_time*90*4+60)*10", 0]
},
"left_tail": {
"tail_left": {
"rotation": ["10+math.sin(q.anim_time*90*8-25)*2", "0+math.sin(q.anim_time*90*4+30)*8", 0]
},
"left_tail2": {
"tail_left2": {
"rotation": ["15+math.sin(q.anim_time*90*8-55)*2", "0+math.sin(q.anim_time*90*4+0)*6", 0]
},
"left_tail3": {
"tail_left3": {
"rotation": ["0+math.sin(q.anim_time*90*8-85)*2", "0+math.sin(q.anim_time*90*4-30)*4", 0]
},
"right_tail": {
"tail_right": {
"rotation": ["10+math.sin(q.anim_time*90*8-35)*2", "0+math.sin(q.anim_time*90*4+30)*8", 0]
},
"right_tail2": {
"tail_right2": {
"rotation": ["15+math.sin(q.anim_time*90*8-65)*2", "0+math.sin(q.anim_time*90*4+0)*6", 0]
},
"right_tail3": {
"tail_right3": {
"rotation": ["0+math.sin(q.anim_time*90*8-95)*2", "0+math.sin(q.anim_time*90*4-30)*4", 0]
},
"upper_torso": {
"torso2": {
"rotation": ["-5+math.sin(q.anim_time*90*8+0)*1", "0+math.sin(q.anim_time*90*4+60+180)*5", "0+math.sin(q.anim_time*90*4+60)*3"]
},
"neck": {
@@ -449,66 +305,66 @@
"head": {
"rotation": ["2.5+math.sin(q.anim_time*90*8-60)*1.5", "0+math.sin(q.anim_time*90*4+0)*5", "0+math.sin(q.anim_time*90*4+0+180)*3"]
},
"right_pupil": {
"pupil_right": {
"position": [0, 0, 0]
},
"left_upper_arm": {
"arm_left": {
"rotation": [10.08453, "-7.3854+math.sin(q.anim_time*90*4-90)*25", "48.6904+math.sin(q.anim_time*90*4+0)*2.5"]
},
"left_lower_arm": {
"arm_left2": {
"rotation": [0, "42.5+math.sin(q.anim_time*90*4-120)*20", 0]
},
"left_hand": {
"hand_left": {
"rotation": [0, "0+math.sin(q.anim_time*90*4-150)*2.5", "22.5+math.sin(q.anim_time*90*4-150)*5"],
"position": [-0.15, 0.05, 0]
},
"left_index_finger": {
"finger_front_left": {
"rotation": [6.94363, 7.64256, 14.02881]
},
"left_index_finger2": {
"finger_front_left2": {
"rotation": [0, 0, 22.5]
},
"left_pinky_finger": {
"finger_back_left": {
"rotation": [-4.01743, -1.75217, 14.46202]
},
"left_pinky_finger2": {
"finger_back_left2": {
"rotation": [0, 0, 30]
},
"left_middle_finger": {
"finger_middle_left": {
"rotation": [0, 0, 12.5]
},
"left_middle_finger2": {
"finger_middle_left2": {
"rotation": [0, 0, 20]
},
"right_upper_arm": {
"arm_right": {
"rotation": [10.08453, "7.3854+math.sin(q.anim_time*90*4-90)*25", "-48.6904+math.sin(q.anim_time*90*4+0)*2.5"]
},
"right_lower_arm": {
"arm_right2": {
"rotation": [0, "-42.5+math.sin(q.anim_time*90*4-120)*20", 0]
},
"right_hand": {
"hand_right": {
"rotation": [0, "0+math.sin(q.anim_time*90*4-150)*2.5", "-22.5+math.sin(q.anim_time*90*4-150)*5"],
"position": [0.15, 0.05, 0]
},
"right_index_finger": {
"finger_front_right": {
"rotation": [6.94363, -7.64256, -14.02881]
},
"right_index_finger2": {
"finger_front_right2": {
"rotation": [0, 0, -22.5]
},
"right_pinky_finger": {
"finger_back_right": {
"rotation": [-4.01743, 1.75217, -14.46202]
},
"right_pinky_finger2": {
"finger_back_right2": {
"rotation": [0, 0, -30]
},
"right_middle_finger": {
"finger_middle_right": {
"rotation": [0, 0, -12.5]
},
"right_middle_finger2": {
"finger_middle_right2": {
"rotation": [0, 0, -20]
},
"right_upper_leg": {
"leg_right": {
"rotation": {
"0.0": {
"post": [36.50677, 8.43184, 4.42536],
@@ -558,7 +414,7 @@
}
}
},
"right_lower_leg": {
"leg_right2": {
"rotation": {
"0.0": {
"post": [15, 0, 0],
@@ -586,7 +442,7 @@
}
}
},
"right_foot": {
"foot_right": {
"rotation": {
"0.0": {
"post": [24.37394, 0.4385, -6.40588],
@@ -614,7 +470,7 @@
}
}
},
"right_foot2": {
"foot_right2": {
"rotation": {
"0.0": {
"post": [-30, 0, 0],
@@ -652,7 +508,7 @@
}
}
},
"right_toes": {
"toes_right": {
"rotation": {
"0.0": {
"post": [-42.5, 0, 0],
@@ -690,7 +546,7 @@
}
}
},
"left_upper_leg": {
"leg_left": {
"rotation": {
"0.0": {
"post": [-61.31845, -9.91358, -2.38565],
@@ -740,7 +596,7 @@
}
}
},
"left_lower_leg": {
"leg_left2": {
"rotation": {
"0.0": {
"post": [47.5, 0, 0],
@@ -768,7 +624,7 @@
}
}
},
"left_foot": {
"foot_left": {
"rotation": {
"0.0": {
"post": [-30.4165, -7.26605, 3.29302],
@@ -796,7 +652,7 @@
}
}
},
"left_foot2": {
"foot_left2": {
"rotation": {
"0.0": {
"post": [12.5, 0, 0],
@@ -834,7 +690,7 @@
}
}
},
"left_toes": {
"toes_right2": {
"rotation": {
"0.0": {
"post": [15, 0, 0],
@@ -882,6 +738,265 @@
}
}
},
"animation.treecko.test2": {
"loop": true,
"bones": {
"torso": {
"rotation": [-4.73298, 2.77592, 27.09295]
},
"tail": {
"rotation": [-5.82738, 13.76109, -8.78252],
"position": [0.25, 0, 0]
},
"tail_left": {
"rotation": [17.07306, 24.25643, 6.31117]
},
"tail_left2": {
"rotation": [24.53554, -3.67372, -4.51152]
},
"tail_right": {
"rotation": [20.05865, 9.84795, 1.74036]
},
"tail_right2": {
"rotation": [25.12876, 9.658, 2.59914]
},
"torso2": {
"rotation": [7.06953, 5.56451, -12.40436],
"position": [0, 0, 0.5]
},
"neck": {
"rotation": [0.41092, 23.12473, -12.05132],
"position": [0, 0.5, 0]
},
"head": {
"rotation": [12.80178, -8.52421, -5.3105],
"position": [0, 0.5, -1]
},
"pupil_right": {
"position": [0, 0, -0.5]
},
"arm_left": {
"rotation": [9.29398, -6.81225, -20.04345],
"position": [0, 0.25, 1]
},
"arm_left2": {
"rotation": [0.65426, 4.95712, 7.52832]
},
"hand_left": {
"rotation": [-17.87814, -19.86103, -49.99202],
"position": [-0.15, 0.05, 0]
},
"finger_front_left": {
"rotation": [0, 5, 20]
},
"finger_front_left2": {
"rotation": [0, 0, 45]
},
"finger_back_left": {
"rotation": [0, -5, 20]
},
"finger_back_left2": {
"rotation": [0, 0, 45]
},
"finger_middle_left": {
"rotation": [0, 0, 20]
},
"finger_middle_left2": {
"rotation": [0, 0, 45]
},
"arm_right": {
"rotation": [28.39833, -11.25395, 25.21731],
"position": [0, 3, -3.25]
},
"arm_right2": {
"rotation": [0, -27.5, 0]
},
"hand_right": {
"rotation": [8.98458, -4.04496, 42.82624],
"position": [0.15, 0.05, 0]
},
"finger_front_right": {
"rotation": [24.55654, -22.88323, -18.35198]
},
"finger_front_right2": {
"rotation": [0, 0, -45]
},
"finger_back_right": {
"rotation": [24.23178, 6.06465, 25.68919]
},
"finger_back_right2": {
"rotation": [0, 0, -45]
},
"finger_middle_right": {
"rotation": [0, 0, 15]
},
"finger_middle_right2": {
"rotation": [0, 0, -45]
},
"leg_right": {
"rotation": [-156.31845, 9.91358, 2.38565],
"position": [0, 0.75, -2.25]
},
"foot_right": {
"rotation": [0.53366, 26.73797, -15.04829]
},
"leg_left": {
"rotation": [-2.91472, -22.08853, 21.08653],
"position": [0, -1, 0]
},
"foot_left": {
"rotation": [65.81573, -6.16374, -15.44323]
},
"body": {
"rotation": [0, 32.5, 0],
"position": [0, 1.75, 0]
},
"tail_right3": {
"rotation": [0, 0, 0]
},
"jaw": {
"rotation": [40, 0, 0]
},
"leg_right2": {
"rotation": [77.54738, -0.6465, -10.13344]
},
"foot_right2": {
"rotation": [12.5, 0, 0],
"position": [0, 0, 0.25]
},
"toes_right": {
"rotation": [17.5, 0, 0]
},
"leg_left2": {
"rotation": [16.93839, -4.46375, 14.33501]
},
"foot_left2": {
"rotation": [-35.67815, -9.54385, 8.11019]
},
"toes_right2": {
"rotation": [-24.91643, -2.11089, -4.53359]
},
"toe_inner_right": {
"rotation": [26.9673, -26.74473, -3.82626]
},
"toe_outer_right": {
"rotation": [22.5, 20, 0]
},
"toe_middle_right": {
"rotation": [15, 0, 0]
},
"toe_inner_left": {
"rotation": [-32.5, 0, 0]
},
"toe_outer_left": {
"rotation": [-25, 0, 0]
},
"toe_middle_left": {
"rotation": [-25, 0, 0]
},
"pupil_left": {
"position": [0, 0, 0.5]
},
"eye_shine_left": {
"position": [0, 0, 0.5]
}
}
},
"animation.treecko.eye_wide": {
"loop": true,
"bones": {
"eye_emote_right2": {
"scale": [1, 1.5, 1]
},
"eye_emote_left2": {
"scale": [1, 1.5, 1]
}
}
},
"animation.treecko.happy": {
"loop": true,
"bones": {
"jaw": {
"rotation": [20, 0, 0]
},
"eye_right": {
"position": [0.1, 0, 0]
},
"eye_left": {
"position": [-0.1, 0, 0]
},
"eyelid_happy_left": {
"position": [0.1, 0, 0]
},
"eyelid_happy_right": {
"position": [-0.1, 0, 0]
}
}
},
"animation.treecko.angry": {
"loop": true,
"bones": {
"eye_emote_right2": {
"position": [0.1, 0, 0]
},
"pupil_emote_right": {
"position": [0.1, 0, 0]
},
"eye_emote_left2": {
"position": [-0.1, 0, 0]
},
"pupil_emote_left": {
"position": [-0.1, 0, 0]
}
}
},
"animation.treecko.sad": {
"loop": true,
"bones": {
"eye_emote_right": {
"position": [0.1, 0, 0]
},
"eye_emote_left": {
"position": [-0.1, 0, 0]
}
}
},
"animation.treecko.shocked": {
"loop": true,
"bones": {
"jaw": {
"rotation": [20, 0, 0]
},
"pupil_right": {
"position": [0, 0, -0.2],
"scale": [1, 0.5, 0.7]
},
"pupil_left": {
"position": [0, 0, -0.2],
"scale": [1, 0.5, 0.7]
}
}
},
"animation.treecko.hurt": {
"loop": true,
"bones": {
"jaw": {
"rotation": [20, 0, 0]
},
"eye_right": {
"position": [0.1, 0, 0]
},
"eye_left": {
"position": [-0.1, 0, 0]
},
"eyelid_hurt_left": {
"position": [0.1, 0, 0]
},
"eyelid_hurt_right": {
"position": [-0.1, 0, 0]
}
}
},
"animation.treecko.cry": {
"animation_length": 1.2,
"sound_effects": {
@@ -7,7 +7,7 @@
"torso": {
"rotation": [10, 0, 0]
},
"upper_torso": {
"torso2": {
"rotation": [5, 0, 0]
},
"neck": {
@@ -17,100 +17,122 @@
"rotation": [2.5, 0, 0]
},
"leaf7": {
"rotation": [12.5, 0, 0]
"rotation": [-5, 0, 0]
},
"jaw": {
"rotation": [0, 0, 0]
},
"left_upper_arm": {
"arm_left": {
"rotation": [2.5, 7.5, 40]
},
"left_lower_arm": {
"arm_left2": {
"rotation": [0, 52.5, 0]
},
"left_hand": {
"hand_left": {
"rotation": [2.5, 0, 32.5]
},
"left_arm_leaves": {
"arm_leaves_left": {
"rotation": [-25.08377, -4.53051, 2.11751]
},
"left_index_finger": {
"finger_front_left": {
"rotation": [0, 0, 10]
},
"left_pinky_finger": {
"finger_back_left": {
"rotation": [0, 0, 27.5]
},
"left_tail": {
"tail_left": {
"rotation": [-10, 12.5, -2.5]
},
"left_tail2": {
"tail_left2": {
"rotation": [-15, 0, 0]
},
"left_upper_leg": {
"leg_left": {
"rotation": [0, -22.5, 0]
},
"left_lower_leg": {
"leg_left2": {
"rotation": [0, 0, 0]
},
"left_foot": {
"foot_left": {
"rotation": [0, 0, 0]
},
"left_inner_toe": {
"toe_inner_left": {
"rotation": [0, 10, 0]
},
"left_outer_toe": {
"toe_outer_left": {
"rotation": [0, -10, 0]
},
"right_tail": {
"tail_right": {
"rotation": [-10, -12.5, 2.5]
},
"right_upper_leg": {
"leg_right": {
"rotation": [0, 22.5, 0]
},
"right_lower_leg": {
"leg_right2": {
"rotation": [0, 0, 0]
},
"right_foot": {
"foot_right": {
"rotation": [0, 0, 0]
},
"right_inner_toe": {
"toe_inner_right": {
"rotation": [0, -10, 0]
},
"right_outer_toe": {
"toe_outer_right": {
"rotation": [0, 10, 0]
},
"right_upper_arm": {
"arm_right": {
"rotation": [2.5, -7.5, -40]
},
"right_lower_arm": {
"arm_right2": {
"rotation": [0, -52.5, 0]
},
"right_hand": {
"hand_right": {
"rotation": [2.5, 0, -32.5]
},
"right_index_finger": {
"finger_front_right": {
"rotation": [0, 0, -10]
},
"right_pinky_finger": {
"finger_back_right": {
"rotation": [0, 0, -27.5]
},
"right_arm_leaves": {
"arm_leaves_right": {
"rotation": [-25.08377, 4.53051, -2.11751]
},
"right_tail2": {
"tail_right2": {
"rotation": [-15, 0, 0]
},
"left_index_finger2": {
"finger_front_left2": {
"rotation": [0, 0, 17.5]
},
"left_pinky_finger2": {
"finger_back_left2": {
"rotation": [0, 0, 22.5]
},
"right_index_finger2": {
"finger_front_right2": {
"rotation": [0, 0, -17.5]
},
"right_pinky_finger2": {
"finger_back_right2": {
"rotation": [0, 0, -22.5]
},
"leaf": {
"rotation": [-50, 0, 0]
},
"leaf2": {
"rotation": [-35, 0, 0]
},
"leaf3": {
"rotation": [-22.5, 0, 0]
},
"leaf4": {
"rotation": [-25, 0, 0]
},
"leaf5": {
"rotation": [-25, 0, 0]
},
"leaf6": {
"rotation": [-7.5, 0, 0]
},
"stick": {
"rotation": [30, 40, 0],
"scale": 0.7
}
}
},
@@ -120,7 +142,7 @@
"torso": {
"rotation": [-5, 0, 0]
},
"upper_torso": {
"torso2": {
"rotation": [2.5, 0, 0]
},
"neck": {
@@ -135,94 +157,94 @@
"jaw": {
"rotation": [0, 0, 0]
},
"left_upper_arm": {
"arm_left": {
"rotation": [-52.5, 5, 27.5]
},
"left_lower_arm": {
"arm_left2": {
"rotation": [0, 65, 0]
},
"left_hand": {
"hand_left": {
"rotation": [2.38443, -0.75155, 49.98436]
},
"left_arm_leaves": {
"arm_leaves_left": {
"rotation": [-10, -17.5, 0]
},
"left_index_finger": {
"finger_front_left": {
"rotation": [0, 0, 2.5]
},
"left_pinky_finger": {
"finger_back_left": {
"rotation": [0, 0, 5]
},
"left_tail": {
"tail_left": {
"rotation": [-15, 12.5, -2.5]
},
"left_tail2": {
"tail_left2": {
"rotation": [7.5, 0, 0]
},
"left_upper_leg": {
"leg_left": {
"rotation": [0, -22.5, 0]
},
"left_lower_leg": {
"leg_left2": {
"rotation": [0, 0, 0]
},
"left_foot": {
"foot_left": {
"rotation": [0, 0, 0]
},
"left_inner_toe": {
"toe_inner_left": {
"rotation": [0, 10, 0]
},
"left_outer_toe": {
"toe_outer_left": {
"rotation": [0, -10, 0]
},
"right_tail": {
"tail_right": {
"rotation": [-15, -12.5, 2.5]
},
"right_upper_leg": {
"leg_right": {
"rotation": [0, 22.5, 0]
},
"right_lower_leg": {
"leg_right2": {
"rotation": [0, 0, 0]
},
"right_foot": {
"foot_right": {
"rotation": [0, 0, 0]
},
"right_inner_toe": {
"toe_inner_right": {
"rotation": [0, -10, 0]
},
"right_outer_toe": {
"toe_outer_right": {
"rotation": [0, 10, 0]
},
"right_upper_arm": {
"arm_right": {
"rotation": [-52.5, -5, -27.5]
},
"right_lower_arm": {
"arm_right2": {
"rotation": [0, -65, 0]
},
"right_hand": {
"hand_right": {
"rotation": [2.38443, 0.75155, -49.98436]
},
"right_index_finger": {
"finger_front_right": {
"rotation": [0, 0, -2.5]
},
"right_pinky_finger": {
"finger_back_right": {
"rotation": [0, 0, -5]
},
"right_arm_leaves": {
"arm_leaves_right": {
"rotation": [-10, 17.5, 0]
},
"right_tail2": {
"tail_right2": {
"rotation": [7.5, 0, 0]
},
"left_index_finger2": {
"finger_front_left2": {
"rotation": [0, 0, 65]
},
"left_pinky_finger2": {
"finger_back_left2": {
"rotation": [0, 0, 87.5]
},
"right_index_finger2": {
"finger_front_right2": {
"rotation": [0, 0, -65]
},
"right_pinky_finger2": {
"finger_back_right2": {
"rotation": [0, 0, -87.5]
}
}
@@ -233,7 +255,7 @@
"torso": {
"rotation": [45.38165, -3.51814, -7.08167]
},
"upper_torso": {
"torso2": {
"rotation": [-9.97857, 3.32943, 4.4913]
},
"neck": {
@@ -248,86 +270,86 @@
"jaw": {
"rotation": [42.5, 0, 0]
},
"left_upper_arm": {
"arm_left": {
"rotation": [-12.58328, 9.94037, 39.45082]
},
"left_lower_arm": {
"arm_left2": {
"rotation": [0, 82.5, 0]
},
"left_hand": {
"hand_left": {
"rotation": [7.5, 0, 32.5]
},
"left_arm_leaves": {
"arm_leaves_left": {
"rotation": [-21.78282, -11.4487, 11.10461]
},
"left_index_finger": {
"finger_front_left": {
"rotation": [0, 0, 10]
},
"left_pinky_finger": {
"finger_back_left": {
"rotation": [0, 0, 22.5]
},
"left_tail": {
"tail_left": {
"rotation": [-17.99085, 11.53327, -4.85721]
},
"left_tail2": {
"tail_left2": {
"rotation": [-15, 0, 0]
},
"left_upper_leg": {
"leg_left": {
"rotation": [-37.5, -22.5, 0],
"position": [0.5, 0.5, -1]
},
"left_lower_leg": {
"leg_left2": {
"rotation": [5, 0, 0]
},
"left_foot": {
"foot_left": {
"rotation": [0, 0, 0]
},
"left_inner_toe": {
"toe_inner_left": {
"rotation": [10, 10, 0]
},
"left_outer_toe": {
"toe_outer_left": {
"rotation": [20, -10, 0]
},
"right_tail": {
"tail_right": {
"rotation": [-28.32455, -16.15901, -4.25872]
},
"right_upper_leg": {
"leg_right": {
"rotation": [38, 7.5, 2.5],
"position": [0, -0.5, -0.5]
},
"right_lower_leg": {
"leg_right2": {
"rotation": [5, 0, 0]
},
"right_foot": {
"foot_right": {
"rotation": [27.5, 0, 0]
},
"right_inner_toe": {
"toe_inner_right": {
"rotation": [-24.71447, -5.46269, -2.12052],
"position": [0, -0.1, 0.6]
},
"right_outer_toe": {
"toe_outer_right": {
"rotation": [-24.71447, 5.46269, 2.12052],
"position": [0, -0.1, 0.6]
},
"right_upper_arm": {
"arm_right": {
"rotation": [-14.26018, -29.40676, -34.54418]
},
"right_lower_arm": {
"arm_right2": {
"rotation": [0, -70, 0]
},
"right_hand": {
"hand_right": {
"rotation": [7.5, 0, -32.5]
},
"right_index_finger": {
"finger_front_right": {
"rotation": [0, 0, -10]
},
"right_pinky_finger": {
"finger_back_right": {
"rotation": [0, 0, -22.5]
},
"right_arm_leaves": {
"arm_leaves_right": {
"rotation": [-26.39218, 18.05776, -8.74472]
},
"right_tail2": {
"tail_right2": {
"rotation": [-15, 0, 0]
},
"body": {
@@ -345,76 +367,191 @@
"leaf6": {
"rotation": [5, 0, 0]
},
"left_back_toe": {
"toe_back_left": {
"rotation": [-5, 0, 0]
},
"right_back_toe": {
"toe_back_right": {
"rotation": [-10, 0, 0]
},
"left_outer_toe2": {
"toe_outer_left2": {
"rotation": [10, 0, 0]
},
"left_inner_toe2": {
"toe_inner_left2": {
"rotation": [10, 0, 0]
},
"right_inner_toe2": {
"toe_inner_right2": {
"rotation": [-45, 0, 0],
"position": [0, -0.55, 1.4]
},
"right_outer_toe2": {
"toe_outer_right2": {
"rotation": [-45, 0, 0],
"position": [0, -0.55, 1.4]
},
"left_leaf1": {
"arm_leaf_middle_left": {
"rotation": [15, 0, 0]
},
"left_leaf2": {
"arm_leaf_inner_left": {
"rotation": [5.76917, -1.99557, 14.05033]
},
"left_leaf3": {
"arm_leaf_outer_left": {
"rotation": [10, 0, 0]
},
"right_leaf1": {
"arm_leaf_middle_right": {
"rotation": [5, 0, 0]
},
"right_leaf2": {
"arm_leaf_inner_right": {
"rotation": [2.5, 0, 0]
},
"left_index_finger2": {
"finger_front_left2": {
"rotation": [0, 0, 22.5]
},
"left_pinky_finger2": {
"finger_back_left2": {
"rotation": [0, 0, 30]
},
"right_index_finger2": {
"finger_front_right2": {
"rotation": [0, 0, -22.5]
},
"right_pinky_finger2": {
"finger_back_right2": {
"rotation": [0, 0, -30]
}
}
},
"animation.grovyle.blink": {
"animation_length": 0.16667,
"animation_length": 0.1667,
"bones": {
"eyelid_right": {
"position": {
"0.0": [-0.1, 0, 0],
"0.125": [-0.1, 0, 0],
"0.1667": [0, 0, 0]
"0.1667": {"pre": [-0.1, 0, 0], "post": [0, 0, 0]}
}
},
"eyelid_left": {
"position": {
"0.0": [0.1, 0, 0],
"0.125": [0.1, 0, 0],
"0.1667": [0, 0, 0]
"0.1667": {"pre": [0.1, 0, 0], "post": [0, 0, 0]}
}
},
"eye_left": {
"position": {
"0.0": [-0.1, 0, 0],
"0.125": [-0.1, 0, 0],
"0.1667": {"pre": [-0.1, 0, 0], "post": [0, 0, 0]}
}
},
"eye_right": {
"position": {
"0.0": [0.1, 0, 0],
"0.125": [0.1, 0, 0],
"0.1667": {"pre": [0.1, 0, 0], "post": [0, 0, 0]}
}
}
}
},
"animation.grovyle.happy": {
"loop": true,
"bones": {
"eye_left": {
"position": [-0.1, 0, 0]
},
"eye_right": {
"position": [0.1, 0, 0]
},
"eyelid_happy_left": {
"position": [0.1, 0, 0]
},
"eyelid_happy_right": {
"position": [-0.1, 0, 0]
}
}
},
"animation.grovyle.angry": {
"loop": true,
"bones": {
"eye_emote_right": {
"scale": [1, 1.5, 1]
},
"eye_brow_right": {
"position": [0, -0.3, 0]
},
"eye_brow_right2": {
"position": [0, 0.5, 0]
},
"eye_brow_left": {
"position": [0, -0.3, 0]
},
"eye_brow_left2": {
"position": [0, 0.5, 0]
},
"eye_emote_left": {
"scale": [1, 1.5, 1]
}
}
},
"animation.grovyle.sad": {
"loop": true,
"bones": {
"eye_brow_right": {
"position": [0, 0.5, 0]
},
"eye_brow_right2": {
"position": [0, -0.5, 0]
},
"eye_brow_left": {
"position": [0, 0.5, 0]
},
"eye_brow_left2": {
"position": [0, -0.5, 0]
}
}
},
"animation.grovyle.shocked": {
"loop": true,
"bones": {
"pupil_left": {
"position": [0, 0, -0.1],
"scale": [1, 0.5, 0.5]
},
"pupil_right": {
"position": [0, 0, -0.1],
"scale": [1, 0.5, 0.5]
},
"eye_emote_right": {
"position": [0, -0.5, 0],
"scale": [1, 2, 1]
},
"eye_brow_right": {
"position": [0, 0.3, 0]
},
"eye_brow_left": {
"position": [0, 0.3, 0]
},
"eye_emote_left": {
"position": [0, -0.5, 0],
"scale": [1, 2, 1]
}
}
},
"animation.grovyle.hurt": {
"loop": true,
"bones": {
"eye_left": {
"position": [-0.1, 0, 0]
},
"eye_right": {
"position": [0.1, 0, 0]
},
"eyelid_hurt_left": {
"position": [0.1, 0, 0]
},
"eyelid_hurt_right": {
"position": [-0.1, 0, 0]
}
}
},
"animation.grovyle.cry": {
"animation_length": 1.33333,
"animation_length": 1.2,
"sound_effects": {
"0.04": {
"effect": "pokemon.grovyle.cry"
@@ -7,7 +7,7 @@
"torso": {
"rotation": [17.5, 0, 0]
},
"upper_torso": {
"torso2": {
"rotation": [-7.5, 0, 0]
},
"neck": {
@@ -16,37 +16,34 @@
"head": {
"rotation": [5, 0, 0]
},
"jaw": {
"rotation": [0, 0, 0]
},
"right_upper_arm": {
"arm_right": {
"rotation": [0, 5, 0]
},
"right_lower_arm": {
"arm_right2": {
"rotation": [0, -50, 0]
},
"right_hand": {
"hand_right": {
"rotation": [0, 0, -27.5]
},
"right_index_finger": {
"finger_front_right": {
"rotation": [0, 0, -20]
},
"right_middle_finger": {
"finger_middle_right": {
"rotation": [0, 0, -15]
},
"right_pinky_finger": {
"finger_back_right": {
"rotation": [0, 0, -25]
},
"right_pinky_finger2": {
"finger_back_right2": {
"rotation": [0, 0, -47.5]
},
"right_index_finger2": {
"finger_front_right2": {
"rotation": [0, 0, -50]
},
"right_middle_finger2": {
"finger_middle_right2": {
"rotation": [0, 0, -40]
},
"right_upper_leg": {
"leg_right": {
"rotation": [0, 15, 0]
},
"tail": {
@@ -64,77 +61,81 @@
"tail5": {
"rotation": [7.5, 0, 0]
},
"right_shoulder": {
"shoulder_right": {
"rotation": [0, 0, -45]
},
"left_upper_leg": {
"leg_left": {
"rotation": [0, -15, 0]
},
"left_shoulder": {
"shoulder_left": {
"rotation": [0, 0, 45]
},
"left_upper_arm": {
"arm_left": {
"rotation": [0, -5, 0]
},
"left_lower_arm": {
"arm_left2": {
"rotation": [0, 50, 0]
},
"left_hand": {
"hand_left": {
"rotation": [0, 0, 27.5]
},
"left_index_finger": {
"finger_front_left": {
"rotation": [0, 0, 20]
},
"left_index_finger2": {
"finger_front_left2": {
"rotation": [0, 0, 50]
},
"left_middle_finger": {
"finger_middle_left": {
"rotation": [0, 0, 15]
},
"left_middle_finger2": {
"finger_middle_left2": {
"rotation": [0, 0, 40]
},
"left_pinky_finger": {
"finger_back_left": {
"rotation": [0, 0, 25]
},
"left_pinky_finger2": {
"finger_back_left2": {
"rotation": [0, 0, 47.5]
},
"right_arm_leaf_front_blade": {
"arm_leaf_front_blade_right": {
"scale": [1, 0, 1]
},
"right_arm_leaf_back_blade": {
"arm_leaf_back_blade_right": {
"scale": [1, 0, 1]
},
"left_arm_leaf_front_blade": {
"arm_leaf_front_blade_left": {
"scale": [1, 0, 1]
},
"left_arm_leaf_back_blade": {
"arm_leaf_back_blade_left": {
"scale": [1, 0, 1]
},
"left_top_leaves": {
"tail_leaves_top_left": {
"rotation": [2.5, 0, 0]
},
"left_bottom_leaves": {
"tail_leaves_bottom_left": {
"rotation": [0, -2.5, 0]
},
"left_top_leaves3": {
"tail_leaves_top_left3": {
"rotation": [-5, 0, 0]
},
"left_bottom_leaves3": {
"tail_leaves_bottom_left3": {
"rotation": [0, 5, 0]
},
"right_top_leaves": {
"tail_leaves_top_right": {
"rotation": [2.5, 0, 0]
},
"right_bottom_leaves": {
"tail_leaves_bottom_right": {
"rotation": [0, 2.5, 0]
},
"right_top_leaves3": {
"tail_leaves_top_right3": {
"rotation": [-5, 0, 0]
},
"right_bottom_leaves3": {
"tail_leaves_bottom_right3": {
"rotation": [0, -5, 0]
},
"stick": {
"rotation": [16, 40, 0],
"scale": 0.7
}
}
},
@@ -144,7 +145,7 @@
"torso": {
"rotation": [32.40109, 2.68407, -4.22005]
},
"upper_torso": {
"torso2": {
"rotation": [4.98107, -0.43523, 4.98107]
},
"neck": {
@@ -156,34 +157,34 @@
"jaw": {
"rotation": [45, 0, 0]
},
"right_upper_arm": {
"arm_right": {
"rotation": [-7.5, 2.5, 0]
},
"right_lower_arm": {
"arm_right2": {
"rotation": [0, -72.5, 0]
},
"right_hand": {
"hand_right": {
"rotation": [0, 0, -50]
},
"right_index_finger": {
"finger_front_right": {
"rotation": [0, 0, -20]
},
"right_middle_finger": {
"finger_middle_right": {
"rotation": [0, 0, -15]
},
"right_pinky_finger": {
"finger_back_right": {
"rotation": [0, 0, -25]
},
"right_pinky_finger2": {
"finger_back_right2": {
"rotation": [0, 0, -47.5]
},
"right_index_finger2": {
"finger_front_right2": {
"rotation": [0, 0, -50]
},
"right_middle_finger2": {
"finger_middle_right2": {
"rotation": [0, 0, -40]
},
"right_upper_leg": {
"leg_right": {
"rotation": [22.5, 15, 0],
"position": [0, 0.5, 0.5]
},
@@ -202,92 +203,92 @@
"tail5": {
"rotation": [12.79362, 12.19908, 2.74715]
},
"right_shoulder": {
"shoulder_right": {
"rotation": [-10.01754, 2.34914, -25.85553]
},
"left_upper_leg": {
"leg_left": {
"rotation": [-17.5, -15, 0],
"position": [0, 0, -0.5]
},
"left_shoulder": {
"shoulder_left": {
"rotation": [-11.9857, 23.12519, 20.20473]
},
"left_upper_arm": {
"arm_left": {
"rotation": [-5, 10, 0]
},
"left_lower_arm": {
"arm_left2": {
"rotation": [0, 47.5, 0]
},
"left_hand": {
"hand_left": {
"rotation": [0, 0, 22.5]
},
"left_index_finger": {
"finger_front_left": {
"rotation": [0, 0, 20]
},
"left_index_finger2": {
"finger_front_left2": {
"rotation": [0, 0, 50]
},
"left_middle_finger": {
"finger_middle_left": {
"rotation": [0, 0, 15]
},
"left_middle_finger2": {
"finger_middle_left2": {
"rotation": [0, 0, 40]
},
"left_pinky_finger": {
"finger_back_left": {
"rotation": [0, 0, 25]
},
"left_pinky_finger2": {
"finger_back_left2": {
"rotation": [0, 0, 47.5]
},
"right_lower_leg": {
"leg_right2": {
"rotation": [10, 0, 0]
},
"right_ankle": {
"leg_right3": {
"rotation": [0, 0, 0]
},
"right_foot": {
"foot_right": {
"rotation": [10, 0, 0]
},
"right_middle_toe": {
"toe_middle_right": {
"rotation": [-42.5, 0, 0],
"position": [0, -0.5, 0.6]
},
"right_inner_toe": {
"toe_inner_right": {
"rotation": [-43.11609, 4.07933, 4.44372],
"position": [0, -0.5, 0.6]
},
"right_outer_toe": {
"toe_outer_right": {
"rotation": [-43.11609, -4.07933, -4.44372],
"position": [0, -0.5, 0.6]
},
"left_lower_leg": {
"leg_left2": {
"rotation": [-5, 0, 0]
},
"left_ankle": {
"leg_left3": {
"rotation": [0, 0, 0]
},
"left_foot": {
"foot_left": {
"rotation": [22.5, 0, 0]
},
"right_arm_leaf_front_blade": {
"arm_leaf_front_blade_right": {
"scale": [1, 0, 1]
},
"right_arm_leaf_back_blade": {
"arm_leaf_back_blade_right": {
"scale": [1, 0, 1]
},
"left_arm_leaf_front_blade": {
"arm_leaf_front_blade_left": {
"scale": [1, 0, 1]
},
"left_arm_leaf_back_blade": {
"arm_leaf_back_blade_left": {
"scale": [1, 0, 1]
},
"left_top_leaves": {
"tail_leaves_top_left": {
"rotation": [10, 0, 0]
},
"left_top_leaves2": {
"tail_leaves_top_left2": {
"rotation": [2.5, 0, 0]
},
"left_top_leaves3": {
"tail_leaves_top_left3": {
"rotation": [-7.5, 0, 0]
}
}
@@ -301,7 +302,7 @@
"torso": {
"rotation": [49.75757, -7.34759, 2.92368]
},
"upper_torso": {
"torso2": {
"rotation": [14.94548, 1.29256, -4.83045]
},
"neck": {
@@ -310,68 +311,68 @@
"head": {
"rotation": [-55.48448, 3.48051, -3.55608]
},
"right_shoulder": {
"shoulder_right": {
"rotation": [-58.62702, 15.46973, -8.28342],
"position": [0, -0.5, 0]
},
"right_upper_arm": {
"arm_right": {
"rotation": [-7.5, -1, -7.5]
},
"right_lower_arm": {
"arm_right2": {
"rotation": [0, -30, 0]
},
"right_hand": {
"hand_right": {
"rotation": [0, 0, -15]
},
"right_index_finger": {
"finger_front_right": {
"rotation": [0, 0, -12.5]
},
"right_index_finger2": {
"finger_front_right2": {
"rotation": [0, 0, -45]
},
"right_middle_finger": {
"finger_middle_right": {
"rotation": [0, 0, 22.5],
"position": [0.5, 0, 0]
},
"right_middle_finger2": {
"finger_middle_right2": {
"rotation": [0, 0, -35]
},
"right_pinky_finger": {
"finger_back_right": {
"rotation": [0, 0, -37.5]
},
"right_pinky_finger2": {
"finger_back_right2": {
"rotation": [0, 0, -42.5]
},
"left_shoulder": {
"shoulder_left": {
"rotation": [-59.92127, -18.02575, 12.77165],
"position": [0, -0.5, 0]
},
"left_upper_arm": {
"arm_left": {
"rotation": [-7.5, 1, 7.5]
},
"left_lower_arm": {
"arm_left2": {
"rotation": [0, 42.5, 0]
},
"left_hand": {
"hand_left": {
"rotation": [0, 0, 15]
},
"left_index_finger": {
"finger_front_left": {
"rotation": [0, 0, 12.5]
},
"left_index_finger2": {
"finger_front_left2": {
"rotation": [0, 0, 45]
},
"left_middle_finger": {
"finger_middle_left": {
"rotation": [0, 0, -22.5],
"position": [-0.5, 0, 0]
},
"left_middle_finger2": {
"finger_middle_left2": {
"rotation": [0, 0, 35]
},
"left_pinky_finger": {
"finger_back_left": {
"rotation": [0, 0, 37.5]
},
"left_pinky_finger2": {
"finger_back_left2": {
"rotation": [0, 0, 42.5]
},
"tail": {
@@ -390,97 +391,170 @@
"tail5": {
"rotation": [10.08453, -7.38542, -1.30962]
},
"right_upper_leg": {
"leg_right": {
"rotation": [-25.44458, 0.21572, -4.69162],
"position": [0, 0, -1]
},
"right_lower_leg": {
"leg_right2": {
"rotation": [-5, -2.5, 0]
},
"right_ankle": {
"leg_right3": {
"rotation": [35, 0, 0],
"position": [0, 0, 0.6]
},
"right_foot": {
"foot_right": {
"rotation": [7.74222, 4.81281, 5.7589]
},
"right_middle_toe": {
"toe_middle_right": {
"rotation": [-12.5, 0, 0]
},
"right_inner_toe": {
"toe_inner_right": {
"rotation": [-12.5, 0, 0]
},
"right_outer_toe": {
"toe_outer_right": {
"rotation": [-12.5, 0, 0]
},
"left_upper_leg": {
"leg_left": {
"rotation": [32.71776, -4.77227, -5.22233],
"position": [0, 0, 1]
},
"left_lower_leg": {
"leg_left2": {
"rotation": [4.96271, -0.86717, 4.92442]
},
"left_ankle": {
"leg_left3": {
"rotation": [42.5, 0, 0],
"position": [0, 0, 1]
},
"left_foot": {
"foot_left": {
"rotation": [85, 0, 0],
"position": [0, 0.35, 1.2]
},
"left_middle_toe": {
"toe_middle_left": {
"rotation": [5, 0, 0]
},
"left_inner_toe": {
"toe_inner_left": {
"rotation": [10, 0, 0]
},
"left_outer_toe": {
"toe_outer_left": {
"rotation": [15, 0, 0]
},
"left_bottom_leaves": {
"tail_leaves_bottom_left": {
"rotation": [0, -5, 0]
},
"left_bottom_leaves3": {
"tail_leaves_bottom_left3": {
"rotation": [0, 5, 0]
},
"left_middle_toe2": {
"toe_middle_left2": {
"rotation": [17.5, 0, 0]
},
"left_inner_toe2": {
"toe_inner_left2": {
"rotation": [22.5, 0, 0]
},
"left_outer_toe2": {
"toe_outer_left2": {
"rotation": [15, 0, 0]
},
"right_top_leaves": {
"tail_leaves_top_right": {
"rotation": [2.5, 0, 0]
},
"right_top_leaves3": {
"tail_leaves_top_right3": {
"rotation": [-5, 0, 0]
}
}
},
"animation.sceptile.blink": {
"animation_length": 0.16667,
"animation_length": 0.1667,
"bones": {
"right_eyelid": {
"eyelid_right": {
"position": {
"0.0": [-0.1, 0, 0],
"0.125": {"pre": [-0.1, 0, 0], "post": [-0.1, 0, 0]},
"0.125": [-0.1, 0, 0],
"0.1667": {"pre": [-0.1, 0, 0], "post": [0, 0, 0]}
}
},
"left_eyelid": {
"eyelid_left": {
"position": {
"0.0": [0.1, 0, 0],
"0.125": {"pre": [0.1, 0, 0], "post": [0.1, 0, 0]},
"0.125": [0.1, 0, 0],
"0.1667": {"pre": [0.1, 0, 0], "post": [0, 0, 0]}
}
}
}
},
"animation.sceptile.hurt_or_happy": {
"loop": true,
"bones": {
"eyelid_hurt_right": {
"position": [-0.1, 0, 0]
},
"eyelid_hurt_left": {
"position": [0.1, 0, 0]
}
}
},
"animation.sceptile.angry": {
"loop": true,
"bones": {
"eye_brow_right": {
"position": [0, -0.4, 0]
},
"eye_brow_left": {
"position": [0, -0.4, 0]
},
"eye_brow_left2": {
"position": [0, 0.4, 0]
},
"eye_brow_right2": {
"position": [0, 0.4, 0]
}
}
},
"animation.sceptile.sad": {
"loop": true,
"bones": {
"pupil_right": {
"position": [0, 0.1, 0]
},
"pupil_left": {
"position": [0, 0.1, 0]
},
"eye_brow_right": {
"position": [0, 0.3, 0]
},
"eye_brow_left": {
"position": [0, 0.3, 0]
},
"eye_brow_left2": {
"position": [0, -0.4, 0]
},
"eye_brow_right2": {
"position": [0, -0.4, 0]
}
}
},
"animation.sceptile.shocked": {
"loop": true,
"bones": {
"jaw": {
"rotation": [35, 0, 0]
},
"pupil_right": {
"position": [0, 0.1, 0],
"scale": [1, 0.5, 0.5]
},
"pupil_left": {
"position": [0, 0.1, 0],
"scale": [1, 0.5, 0.5]
},
"eye_brow_right": {
"position": [0, 0.3, 0]
},
"eye_brow_left": {
"position": [0, 0.3, 0]
}
}
},
"animation.sceptile.cry": {
"animation_length": 1.33333,
"animation_length": 1.2,
"sound_effects": {
"0.04": {
"effect": "pokemon.sceptile.cry"

Some files were not shown because too many files have changed in this diff Show More