Compare commits
263
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
a7b55e5d03 | ||
|
|
28db655376 | ||
|
|
006736cd71 | ||
|
|
f240dc1963 | ||
|
|
535c5f2e67 | ||
|
|
8b209e081b | ||
|
|
f7f276ecfb | ||
|
|
019245472f | ||
|
|
cefb502f10 | ||
|
|
ee5e4d33b2 | ||
|
|
0fd954ffa5 | ||
|
|
60d3d737f9 | ||
|
|
fb570404c0 | ||
|
|
d22602dac5 | ||
|
|
2f16ba5470 | ||
|
|
cbdfbc9745 | ||
|
|
ac210e027b | ||
|
|
1fc91a794f | ||
|
|
f78b289171 | ||
|
|
c46461c843 | ||
|
|
386a897295 | ||
|
|
8328f741d8 | ||
|
|
2b19943416 | ||
|
|
550b99be36 | ||
|
|
8960c6dddc | ||
|
|
bfbee7b1d7 | ||
|
|
bc1f9f8cb4 | ||
|
|
f5d71390dd | ||
|
|
6ff5d3df06 | ||
|
|
988766894a | ||
|
|
34805ea496 | ||
|
|
b670d44e21 | ||
|
|
159905eb3b | ||
|
|
c10213480b | ||
|
|
3d5a365a6e | ||
|
|
4b64b4307a | ||
|
|
382f741db8 | ||
|
|
6d62d911d6 | ||
|
|
a1d40084c5 | ||
|
|
8b1b63e110 | ||
|
|
baf3cd5f30 | ||
|
|
2327f1aa2c | ||
|
|
62036c0ac6 | ||
|
|
9e2e95e287 | ||
|
|
2db494ff5e | ||
|
|
7fe1415551 | ||
|
|
ca4d4ed3be | ||
|
|
700227be41 | ||
|
|
985a4f65dc | ||
|
|
e117100e34 | ||
|
|
93ea13fa4d | ||
|
|
6694680c50 | ||
|
|
cd14881d17 | ||
|
|
1393cc3ef3 | ||
|
|
23ebd0573a | ||
|
|
6447c2e2eb | ||
|
|
8cafce0a4a | ||
|
|
039a18a2bf | ||
|
|
de271f81b1 | ||
|
|
feb78c5c58 | ||
|
|
1caf963323 | ||
|
|
71736341f0 | ||
|
|
bb94f872a9 | ||
|
|
bb6e5607f1 | ||
|
|
4603f5ac7a | ||
|
|
c683294227 | ||
|
|
f29c2343e6 | ||
|
|
3a2da5a87d | ||
|
|
27d1de8e4e | ||
|
|
e5d052a6bf | ||
|
|
8af62f800b | ||
|
|
a50da47a8e | ||
|
|
f690781b0d | ||
|
|
6a7fc67ae1 | ||
|
|
4722defec2 | ||
|
|
7b7acb97d1 | ||
|
|
53af92f254 | ||
|
|
91bce4b153 | ||
|
|
511130d353 | ||
|
|
476c3e54f1 | ||
|
|
4bfe8b808c | ||
|
|
8db943d2a9 | ||
|
|
fdff6ecfa5 | ||
|
|
2eb698969d | ||
|
|
bba60f0098 | ||
|
|
8ee2c95853 | ||
|
|
77db2ce17a | ||
|
|
0ea4641536 | ||
|
|
ff5ea6fa21 | ||
|
|
4820d78416 | ||
|
|
2f417e953c | ||
|
|
8fde0ed4f6 | ||
|
|
6715874a8f | ||
|
|
31f88a1f68 | ||
|
|
f80aa2769a | ||
|
|
20aa4d43b8 | ||
|
|
9bec3e088f | ||
|
|
5b4dbe1957 | ||
|
|
48f248d481 | ||
|
|
d726c4d0ed | ||
|
|
c9c421ba2a | ||
|
|
2436a8ddcc | ||
|
|
3364944c26 | ||
|
|
9e6a6eabc7 | ||
|
|
78def7318e | ||
|
|
fdf062bd4c | ||
|
|
ef5a682adb | ||
|
|
f76d28d29e | ||
|
|
9c70aad64d | ||
|
|
25de1ad180 | ||
|
|
f967d1ec11 | ||
|
|
efd0497de1 | ||
|
|
b30c0a4a9a | ||
|
|
c99b26a44b | ||
|
|
b19bc1e4c7 | ||
|
|
bc5ffda1a5 | ||
|
|
491d6c9fd6 | ||
|
|
ccc6ad77a5 | ||
|
|
00fd9d1278 | ||
|
|
01464f8b71 | ||
|
|
d91fe0b876 | ||
|
|
3f6faf7796 | ||
|
|
d5efdeee68 | ||
|
|
57f446260c | ||
|
|
d4cf44f8f0 | ||
|
|
a074ebbcce | ||
|
|
6578ed55e3 | ||
|
|
f567ceadd8 | ||
|
|
5de92f78c6 | ||
|
|
a2402f78e7 | ||
|
|
1ad6d63137 | ||
|
|
39d417c651 | ||
|
|
ce1bf9f4f2 | ||
|
|
a6136906f8 | ||
|
|
37a99b528e | ||
|
|
048b237302 | ||
|
|
131773f9c8 | ||
|
|
22e55b7e77 | ||
|
|
6c288f9cc8 | ||
|
|
b5e86a9460 | ||
|
|
f199e7c1c0 | ||
|
|
4161d96707 | ||
|
|
59927dd701 | ||
|
|
220d8ddc0f | ||
|
|
0dd143e67e | ||
|
|
d83eb62821 | ||
|
|
a716fda023 | ||
|
|
d14aad787c | ||
|
|
2eb7b60dd1 | ||
|
|
bc4699e354 | ||
|
|
d79ffc631b | ||
|
|
9270119675 | ||
|
|
0058906022 | ||
|
|
7cd1870f23 | ||
|
|
14d2a76211 | ||
|
|
7669000962 | ||
|
|
716d1b848e | ||
|
|
4878fc517d | ||
|
|
4d9d543110 | ||
|
|
718a9b922b | ||
|
|
e2a152aeb3 | ||
|
|
3e21226b27 | ||
|
|
c46c5b806c | ||
|
|
3c37d93046 | ||
|
|
8912911800 | ||
|
|
62ecfaf54a | ||
|
|
6684177236 | ||
|
|
deca5cf55b | ||
|
|
7b2790de50 | ||
|
|
7f2bb84c85 | ||
|
|
0f75797759 | ||
|
|
331e1371d4 | ||
|
|
bdd57ba1a4 | ||
|
|
c194aefce5 | ||
|
|
f4798c8783 | ||
|
|
2178a5f10e | ||
|
|
bc145a56d5 | ||
|
|
670e7e9ca1 | ||
|
|
476ef3bb2f | ||
|
|
460050289b | ||
|
|
01fd4dcc68 | ||
|
|
0392eb3b7e | ||
|
|
493f423a2f | ||
|
|
cbcfa1bbfb | ||
|
|
17a3ff15db | ||
|
|
9c14cccc98 | ||
|
|
850cfbe755 | ||
|
|
28afa6a9e8 | ||
|
|
7a76d95ce7 | ||
|
|
54707d0618 | ||
|
|
307c400e28 | ||
|
|
5c9b3ab25d | ||
|
|
532e991fb2 | ||
|
|
b1bf817329 | ||
|
|
c091f90487 | ||
|
|
a49d4715ff | ||
|
|
652b15532e | ||
|
|
e4064897b0 | ||
|
|
f9ca8222da | ||
|
|
3ae349aea5 | ||
|
|
67480a945f | ||
|
|
e6e811e6e6 | ||
|
|
4635c531b9 | ||
|
|
3bdfac9a46 | ||
|
|
2b7a71cb1c | ||
|
|
d47a500a0e | ||
|
|
13650f98f9 | ||
|
|
d3379557fd | ||
|
|
143c2683fe | ||
|
|
72d64d36e5 | ||
|
|
c0b52c38e3 | ||
|
|
12a0ee309e | ||
|
|
33e6dbb4c1 | ||
|
|
824e37effd | ||
|
|
482c57dd2e | ||
|
|
503c62d78d | ||
|
|
708d0ab6d3 | ||
|
|
19727542bd | ||
|
|
c4e6714a95 | ||
|
|
c116e612c6 | ||
|
|
215a055ce6 | ||
|
|
9c0b6b8d26 | ||
|
|
5c4462ee94 | ||
|
|
04edd6f9e2 | ||
|
|
52821cc051 | ||
|
|
0029deb029 | ||
|
|
c6360e2a36 | ||
|
|
2e77c647b6 | ||
|
|
c3d3b19788 | ||
|
|
219cd61beb | ||
|
|
207e5a9142 | ||
|
|
c721fb534d | ||
|
|
dba2622fd7 | ||
|
|
da68675133 | ||
|
|
975cdf050f | ||
|
|
9aea5a7daf | ||
|
|
10402575fb | ||
|
|
0f82ade57c | ||
|
|
450b041118 | ||
|
|
770c349ac4 | ||
|
|
f76648b6f2 | ||
|
|
56e60667db | ||
|
|
c4a60951c5 | ||
|
|
814eee8125 | ||
|
|
2a9ff3bfbd | ||
|
|
8fe2042127 | ||
|
|
538ad883ab | ||
|
|
136cb86492 | ||
|
|
e4eb1251d1 | ||
|
|
83350cb0db | ||
|
|
778761dbee | ||
|
|
e9881b748a | ||
|
|
dabaeefa23 | ||
|
|
0e0bec2712 | ||
|
|
48fe160334 | ||
|
|
1bc83d9045 | ||
|
|
7d599e12d0 | ||
|
|
98775ffc1e | ||
|
|
bbeb3d45f0 | ||
|
|
8fd854f7f7 | ||
|
|
f449cf27c5 | ||
|
|
bf5fd5eed8 | ||
|
|
facead5f0b |
No files matched your search
@@ -6,6 +6,7 @@
|
||||
- Added filter functionality in PC UI, which supports `PokemonProperties` (e.g. `shiny=yes` shows all shiny Pokémon).
|
||||
- Added `/changewallpaper <player> <boxNumber> <wallpaper>` command to change a box wallpaper through commands.
|
||||
- Added `/renamebox <player> <boxNumber> <name>` command to rename a PC box through commands.
|
||||
- Added IVs and EVs stat displays in PC.
|
||||
|
||||
### Developer
|
||||
- Added `RenamePCBoxEvent.Pre` and `RenamePCBoxEvent.Post` events to prevent players from renaming a box or changing their input.
|
||||
|
||||
@@ -17,6 +17,8 @@
|
||||
- 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.
|
||||
- Added lang keys for all moves and abilities up to Generation 9.
|
||||
- Fixed Moon Ball moon phase logic to actually work correctly
|
||||
|
||||
### Pokémon Added
|
||||
|
||||
@@ -76,6 +78,8 @@
|
||||
- Sneasler
|
||||
- Braixen
|
||||
- Delphox
|
||||
- Cinderace
|
||||
- Kangaskhan
|
||||
|
||||
### Model updates for the following Pokémon
|
||||
- Gyarados
|
||||
@@ -97,18 +101,36 @@
|
||||
- Pidgeot
|
||||
- Nosepass
|
||||
- Probopass
|
||||
- Kangaskhan
|
||||
- Cinderace
|
||||
- Magnezone
|
||||
- Metagross
|
||||
- Added Syrupy Apples.
|
||||
|
||||
### Changes
|
||||
- Renamed `chargeGainedPerTick` config to `secondsToChargeHealingMachine`.
|
||||
- Made Blocks of Gold count as Big Nuggets when held by a Pokémon (for Fling functionality)
|
||||
- Players can now eat Sweet and Tart Apples, Whipped Dreams, and the Alcremie Sweets.
|
||||
- Updated Sweet and Tart Apple sprites
|
||||
- Updated the following recipes: Air Balloon, Assault Vest, Binding Band, Black Belt, Blunder Policy, Choice Band, Choice Scarf, Cleanse Tag, Covert Cloak, Destiny Knot, Eject Button, Expert Belt, Focus Band, Focus Sash, Magnet, Metronome, Muscle Band, Power Anklet, Power Band, Power Belt, Power Bracer, Power Lens, Power Weight, Protective Pads, Protein, Punching Glove, Reaper Cloth, Rocky Helmet, Room Service, Sachet, Safety Goggles, Silk Scarf, Spell Tag, Utility Umbrella, Weakness Policy, Zinc
|
||||
- Added alternate ingredient options to the following recipes: Cell Battery, Charcoal Stick, Dragon Fang, Miracle Seed, Mystic Water, Never Melt Ice, Twisted Spoon, Damp Rock, Heat Rock, Icy Rock, Smooth Rock
|
||||
- Grouped together some recipes within the Recipe Book. Groups include: the seven basic Poké Balls, the seven basic Ancient Poké Balls, Gilded Chests, Pokedexes, and the Weather Rocks.
|
||||
- Updated some item tags to better integrate behaviours between Cobblemon, Vanilla Minecraft, and other mods
|
||||
- Removed Cooked Meat, Raw Meat, Protein Ingredients, and Zinc Ingredients, the first two are now using `c` namespace tags, the latter have better integrated use of tags within their recipes which removes need for custom tags.
|
||||
- Added our seeds tag into `#c:seeds`, which is now made use of for the Miracle Seed recipe.
|
||||
- Tweaked the Natural Materials Vanilla file to fit with the changes to tags
|
||||
- Substantially optimised spawning checks mainly by front-loading biome filtering.
|
||||
- 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.
|
||||
- Updated `doPokemonSpawning` gamerule to support per-dimension configurations.
|
||||
- The Pokedex now displays a form name of a "normal" Pokémon for when the base form is still a named form.
|
||||
- Improved the zoom functionality of the Pokédex Scanner by giving the levels logarithmic scaling.
|
||||
- Added a subtle rotation effect to the Pokédex Scanner's wheel when zooming.
|
||||
- Improved parity with vanilla mobs' drop behavior; loot and XP drop on death instead of after the entire death sequence finishes.
|
||||
- Quirk animations no longer play in the battle GUI since they were pretty distracting.
|
||||
|
||||
### Fixes
|
||||
- Fixed Particles sometimes facing the wrong direction (looking at you, Swords Dance)
|
||||
@@ -137,6 +159,9 @@
|
||||
- Fixed Pokémon marked as silent still playing shiny sounds and effects.
|
||||
- Fixed an issue with newer versions of Fabric API where underground Pokémon were spawning in The End.
|
||||
- Fixed spawning not working well when you're at high points surrounded by lower altitude spawning areas, such as flying.
|
||||
- Fixed certain Pokémon with forms not having appropriate stock Pokédex entries.
|
||||
- Fixed issue with Pokédex Scanner that caused the open/close overlay to have the wrong opacity values
|
||||
- Fixed dragon's breath not being usable on the restoration tank when it should be
|
||||
|
||||
### Developer
|
||||
- A finished battle now has winners and losers set inside of `PokemonBattle` instead of them always being empty.
|
||||
@@ -173,6 +198,7 @@
|
||||
- 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
|
||||
- The Pokédex form lang key definition now follows `cobblemon.ui.pokedex.info.form.{species}-{formname}` instead of `cobblemon.ui.pokedex.info.form.{formname}`.
|
||||
|
||||
## [1.6.1 (January 26th, 2025)](#1-6-1)
|
||||
|
||||
|
||||
@@ -19,7 +19,6 @@ 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;
|
||||
@@ -98,7 +97,7 @@ public abstract class CameraMixin {
|
||||
}
|
||||
return;
|
||||
}
|
||||
if (controller.getOrientation() == null && !Cobblemon.config.getThirdPartyViewBobbing()) return;
|
||||
if (controller.getOrientation() == null) return;
|
||||
cobblemon$applyRotation();
|
||||
|
||||
this.returnTimer = 0;
|
||||
@@ -106,21 +105,12 @@ public abstract class CameraMixin {
|
||||
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 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();
|
||||
MountedPokemonAnimationRenderController.INSTANCE.reset();
|
||||
|
||||
if(vehicle instanceof Rideable){
|
||||
//RidingCameraDelagate.INSTANCE.positionCamera(instance, x, y, z, original);
|
||||
@@ -135,6 +125,7 @@ public abstract class CameraMixin {
|
||||
Mth.lerp(instance.getPartialTickTime(), pokemon.yOld, pokemon.getY()),
|
||||
Mth.lerp(instance.getPartialTickTime(), pokemon.zOld, pokemon.getZ())
|
||||
);
|
||||
MountedPokemonAnimationRenderController.INSTANCE.setup(pokemon, partialTickTime);
|
||||
int seatIndex = pokemon.getPassengers().indexOf(entity);
|
||||
Seat seat = pokemon.getSeats().get(seatIndex);
|
||||
|
||||
@@ -160,7 +151,12 @@ public abstract class CameraMixin {
|
||||
Vec3 position = locatorOffset.add(entityPos).add(new Vec3(rotatedEyeHeight));
|
||||
setPosition(position);
|
||||
} else {
|
||||
Vector3f pos = entityPos.add(new Vec3(0, pokemon.getBbHeight() / 2, 0)).toVector3f();
|
||||
var playerPos = new Vec3(
|
||||
Mth.lerp(instance.getPartialTickTime(), entity.xOld, entity.getX()),
|
||||
Mth.lerp(instance.getPartialTickTime(), entity.yOld, entity.getY()),
|
||||
Mth.lerp(instance.getPartialTickTime(), entity.zOld, entity.getZ())
|
||||
);
|
||||
Vector3f pos = playerPos.toVector3f();
|
||||
|
||||
PosableModel model = VaryingModelRepository.INSTANCE.getPoser(pokemon.getPokemon().getSpecies().getResourceIdentifier(), new FloatingState());
|
||||
Map<String, Vec3> cameraOffsets = model.getSeatToCameraOffset();
|
||||
@@ -180,7 +176,11 @@ public abstract class CameraMixin {
|
||||
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);
|
||||
Vector3f rotatedOffset = orientation.transform(new Vector3f(
|
||||
offset.x,
|
||||
offset.y,
|
||||
offset.z + 4.0f
|
||||
));
|
||||
float offsetDistance = rotatedOffset.length();
|
||||
Vector3f offsetDirection = rotatedOffset.mul(1 / offsetDistance);
|
||||
|
||||
@@ -201,29 +201,12 @@ public abstract class CameraMixin {
|
||||
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);
|
||||
|
||||
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);
|
||||
this.xRot = controller.getPitch();
|
||||
this.yRot = controller.getYaw();
|
||||
this.forwards.set(controller.getForwardVector());
|
||||
this.up.set(controller.getUpVector());
|
||||
this.left.set(controller.getLeftVector());
|
||||
}
|
||||
|
||||
@WrapOperation(method = "setup", at = @At(value = "INVOKE", target = "Lnet/minecraft/client/Camera;move(FFF)V", ordinal = 0))
|
||||
|
||||
@@ -59,8 +59,21 @@ public class HumanoidModelMixin {
|
||||
}
|
||||
|
||||
Entity vehicle = entity.getVehicle();
|
||||
if (vehicle instanceof PokemonEntity && entity instanceof AbstractClientPlayer) {
|
||||
MountedPlayerRenderer.INSTANCE.animate((PokemonEntity) vehicle, (AbstractClientPlayer) entity, relevantPartsByName, netHeadYaw, headPitch, ageInTicks, limbSwing, limbSwingAmount);
|
||||
if (vehicle instanceof PokemonEntity pokemonEntity && entity instanceof AbstractClientPlayer) {
|
||||
var shouldRotatePlayerHead = pokemonEntity.ifRidingAvailableSupply(false, (behaviour, settings, state) -> {
|
||||
return behaviour.shouldRotatePlayerHead(settings, state, pokemonEntity);
|
||||
});
|
||||
|
||||
if (!shouldRotatePlayerHead) {
|
||||
netHeadYaw = 0f;
|
||||
headPitch = 0f;
|
||||
if (this.head != null) {
|
||||
this.head.yRot = 0f;
|
||||
this.head.xRot = 0f;
|
||||
}
|
||||
}
|
||||
|
||||
MountedPlayerRenderer.INSTANCE.animate(pokemonEntity, (AbstractClientPlayer) entity, relevantPartsByName, netHeadYaw, headPitch, ageInTicks, limbSwing, limbSwingAmount);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,38 +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.mixin.client;
|
||||
|
||||
import com.cobblemon.mod.common.entity.pokemon.PokemonEntity;
|
||||
import net.minecraft.client.model.PlayerModel;
|
||||
import net.minecraft.world.entity.Entity;
|
||||
import net.minecraft.world.entity.LivingEntity;
|
||||
import net.minecraft.world.entity.player.Player;
|
||||
import org.spongepowered.asm.mixin.Mixin;
|
||||
import org.spongepowered.asm.mixin.injection.At;
|
||||
import org.spongepowered.asm.mixin.injection.Inject;
|
||||
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
|
||||
|
||||
@Mixin(PlayerModel.class)
|
||||
public class PlayerModelMixin {
|
||||
@Inject(method = "setupAnim(Lnet/minecraft/world/entity/LivingEntity;FFFFF)V", at = @At(value = "HEAD"))
|
||||
private void cobblemon$setHeadRotation(LivingEntity entity, float limbSwing, float limbSwingAmount, float ageInTicks, float netHeadYaw, float headPitch, CallbackInfo ci) {
|
||||
if (!(entity instanceof Player)) return;
|
||||
Entity vehicle = entity.getVehicle();
|
||||
|
||||
if (!(vehicle instanceof PokemonEntity pokemonEntity)) return;
|
||||
|
||||
var shouldRotatePlayerHead = pokemonEntity.ifRidingAvailableSupply(false, (behaviour, settings, state) -> {
|
||||
return behaviour.shouldRotatePlayerHead(settings, state, pokemonEntity);
|
||||
});
|
||||
if (shouldRotatePlayerHead) return;
|
||||
|
||||
netHeadYaw = 0f;
|
||||
headPitch = 0f;
|
||||
}
|
||||
}
|
||||
@@ -293,20 +293,21 @@ object CobblemonItems : PlatformRegistry<Registry<Item>, ResourceKey<Registry<It
|
||||
@JvmField val REAPER_CLOTH = noSettingsItem("reaper_cloth")
|
||||
@JvmField val PRISM_SCALE = noSettingsItem("prism_scale")
|
||||
@JvmField val SACHET = noSettingsItem("sachet")
|
||||
@JvmField val WHIPPED_DREAM = noSettingsItem("whipped_dream")
|
||||
@JvmField val STRAWBERRY_SWEET = noSettingsItem("strawberry_sweet")
|
||||
@JvmField val LOVE_SWEET = noSettingsItem("love_sweet")
|
||||
@JvmField val BERRY_SWEET = noSettingsItem("berry_sweet")
|
||||
@JvmField val CLOVER_SWEET = noSettingsItem("clover_sweet")
|
||||
@JvmField val FLOWER_SWEET = noSettingsItem("flower_sweet")
|
||||
@JvmField val STAR_SWEET = noSettingsItem("star_sweet")
|
||||
@JvmField val RIBBON_SWEET = noSettingsItem("ribbon_sweet")
|
||||
@JvmField val WHIPPED_DREAM = create("whipped_dream", foodItem(8, 0.3f))
|
||||
@JvmField val STRAWBERRY_SWEET = create("strawberry_sweet", foodItem(6, 0.125f))
|
||||
@JvmField val LOVE_SWEET = create("love_sweet", foodItem(6, 0.125f))
|
||||
@JvmField val BERRY_SWEET = create("berry_sweet", foodItem(6, 0.125f))
|
||||
@JvmField val CLOVER_SWEET = create("clover_sweet", foodItem(6, 0.125f))
|
||||
@JvmField val FLOWER_SWEET = create("flower_sweet", foodItem(6, 0.125f))
|
||||
@JvmField val STAR_SWEET = create("star_sweet", foodItem(6, 0.125f))
|
||||
@JvmField val RIBBON_SWEET = create("ribbon_sweet", foodItem(6, 0.125f))
|
||||
@JvmField val CHIPPED_POT = noSettingsItem("chipped_pot")
|
||||
@JvmField val CRACKED_POT = noSettingsItem("cracked_pot")
|
||||
@JvmField val MASTERPIECE_TEACUP = noSettingsItem("masterpiece_teacup")
|
||||
@JvmField val UNREMARKABLE_TEACUP = noSettingsItem("unremarkable_teacup")
|
||||
@JvmField val SWEET_APPLE = noSettingsItem("sweet_apple")
|
||||
@JvmField val TART_APPLE = noSettingsItem("tart_apple")
|
||||
@JvmField val SWEET_APPLE = create("sweet_apple", foodItem(4, 0.3f))
|
||||
@JvmField val TART_APPLE = create("tart_apple", foodItem(4, 0.3f))
|
||||
@JvmField val SYRUPY_APPLE = create("syrupy_apple", foodItem(4, 0.3f))
|
||||
@JvmField val GALARICA_CUFF = noSettingsItem("galarica_cuff")
|
||||
@JvmField val GALARICA_WREATH = noSettingsItem("galarica_wreath")
|
||||
@JvmField val BLACK_AUGURITE = noSettingsItem("black_augurite")
|
||||
@@ -1358,4 +1359,7 @@ object CobblemonItems : PlatformRegistry<Registry<Item>, ResourceKey<Registry<It
|
||||
return createdItem
|
||||
}
|
||||
|
||||
private fun foodItem(nutrition: Int, saturationModifier: Float): Item {
|
||||
return Item(Item.Properties().food(FoodProperties.Builder().nutrition(nutrition).saturationModifier(saturationModifier).build()))
|
||||
}
|
||||
}
|
||||
@@ -142,6 +142,8 @@ import com.cobblemon.mod.common.net.messages.server.callback.party.PartyPokemonS
|
||||
import com.cobblemon.mod.common.net.messages.server.callback.party.PartySelectCancelledPacket
|
||||
import com.cobblemon.mod.common.net.messages.server.callback.partymove.PartyMoveSelectCancelledPacket
|
||||
import com.cobblemon.mod.common.net.messages.server.callback.partymove.PartyPokemonMoveSelectedPacket
|
||||
import com.cobblemon.mod.common.net.messages.server.debug.ServerboundUpdateRidingStatRangePacket
|
||||
import com.cobblemon.mod.common.net.messages.server.debug.ServerboundUpdateRidingStatsPacket
|
||||
import com.cobblemon.mod.common.net.messages.server.dialogue.EscapeDialoguePacket
|
||||
import com.cobblemon.mod.common.net.messages.server.dialogue.InputToDialoguePacket
|
||||
import com.cobblemon.mod.common.net.messages.server.npc.SaveNPCPacket
|
||||
@@ -186,6 +188,8 @@ import com.cobblemon.mod.common.net.serverhandling.callback.party.PartyPokemonSe
|
||||
import com.cobblemon.mod.common.net.serverhandling.callback.party.PartySelectCancelledHandler
|
||||
import com.cobblemon.mod.common.net.serverhandling.callback.partymove.PartyMoveSelectCancelledHandler
|
||||
import com.cobblemon.mod.common.net.serverhandling.callback.partymove.PartyPokemonMoveSelectedHandler
|
||||
import com.cobblemon.mod.common.net.serverhandling.debug.ServerboundUpdateRidingStatRangeHandler
|
||||
import com.cobblemon.mod.common.net.serverhandling.debug.ServerboundUpdateRidingStatsHandler
|
||||
import com.cobblemon.mod.common.net.serverhandling.dialogue.EscapeDialogueHandler
|
||||
import com.cobblemon.mod.common.net.serverhandling.dialogue.InputToDialogueHandler
|
||||
import com.cobblemon.mod.common.net.serverhandling.evolution.AcceptEvolutionHandler
|
||||
@@ -536,6 +540,8 @@ object CobblemonNetwork {
|
||||
// Riding packet(s)
|
||||
list.add(PacketRegisterInfo(ServerboundUpdateOrientationPacket.ID, ServerboundUpdateOrientationPacket::decode, OrientationPacketHandler))
|
||||
list.add(PacketRegisterInfo(ServerboundUpdateRidingStatePacket.ID, ServerboundUpdateRidingStatePacket::decode, ServerboundUpdateRidingStateHandler))
|
||||
list.add(PacketRegisterInfo(ServerboundUpdateRidingStatsPacket.ID, ServerboundUpdateRidingStatsPacket::decode, ServerboundUpdateRidingStatsHandler))
|
||||
list.add(PacketRegisterInfo(ServerboundUpdateRidingStatRangePacket.ID, ServerboundUpdateRidingStatRangePacket::decode, ServerboundUpdateRidingStatRangeHandler))
|
||||
|
||||
return list
|
||||
}
|
||||
|
||||
@@ -215,6 +215,7 @@ fun drawPosablePortrait(
|
||||
ageInTicks: Float = 0F,
|
||||
headYaw: Float = 0F,
|
||||
headPitch: Float = 0F,
|
||||
doQuirks: Boolean = true,
|
||||
r: Float = 1F,
|
||||
g: Float = 1F,
|
||||
b: Float = 1F,
|
||||
@@ -240,6 +241,7 @@ fun drawPosablePortrait(
|
||||
context.put(RenderContext.SPECIES, identifier)
|
||||
context.put(RenderContext.ASPECTS, state.currentAspects)
|
||||
context.put(RenderContext.POSABLE_STATE, state)
|
||||
context.put(RenderContext.DO_QUIRKS, doQuirks)
|
||||
|
||||
val renderType = RenderType.entityCutout(texture)
|
||||
|
||||
|
||||
@@ -832,6 +832,7 @@ object MoLangFunctions {
|
||||
map.put("is_moving") { DoubleValue((pokemonEntity.moveControl as? PokemonMoveControl)?.hasWanted() == true) }
|
||||
map.put("is_flying") { DoubleValue(pokemonEntity.getBehaviourFlag(PokemonBehaviourFlag.FLYING)) }
|
||||
map.put("is_gliding") { DoubleValue(pokemonEntity.useRidingAltPose()) }
|
||||
map.put("is_ridden") { DoubleValue(pokemonEntity.hasControllingPassenger()) }
|
||||
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).let {
|
||||
|
||||
+18
@@ -107,4 +107,22 @@ open class OrientationController(val entity: LivingEntity) {
|
||||
val roll: Float
|
||||
get() = Mth.wrapDegrees(-upVector.angleSigned(UP, forwardVector).toDegrees())
|
||||
|
||||
fun applyGlobalYaw(deltaYawDegrees: Float) = updateOrientation { original ->
|
||||
val euler = Vector3f()
|
||||
original.getEulerAnglesXYZ(euler)
|
||||
val pitch0 = euler.x
|
||||
val roll0 = euler.z
|
||||
|
||||
val unroll = Matrix3f().rotateZ(-roll0)
|
||||
val unpitch = Matrix3f().rotateX(-pitch0)
|
||||
val flattened = Matrix3f(original).mul(unroll).mul(unpitch)
|
||||
|
||||
//Flip to reflect current acceptance of what direction is pos for yaw
|
||||
val globalYaw = Matrix3f().rotationY(-1.0f * deltaYawDegrees.toRadians())
|
||||
val rePitch = Matrix3f().rotateX(pitch0)
|
||||
val reRoll = Matrix3f().rotateZ(roll0)
|
||||
|
||||
return@updateOrientation Matrix3f(globalYaw).mul(flattened).mul(rePitch).mul(reRoll)
|
||||
}
|
||||
|
||||
}
|
||||
+6
-6
@@ -77,18 +77,18 @@ object CatchRateModifiers {
|
||||
|
||||
/**
|
||||
* Used by [PokeBalls.MOON_BALL].
|
||||
* Boosts the catch rate 1.5× during Moon Phases 3 and 7 between the times of 12000 – 24000.
|
||||
* 2.5× during Moon Phases 2 and 8 between the times of 12000 – 24000.
|
||||
* 4× during Moon Phase 1 between the times of 12000 – 24000.
|
||||
* Boosts the catch rate 1.5× during Moon Phases 2 and 6 between the times of 12000 – 24000.
|
||||
* 2.5× during Moon Phases 1 and 7 between the times of 12000 – 24000.
|
||||
* 4× during Moon Phase 0 between the times of 12000 – 24000.
|
||||
* 1× otherwise.
|
||||
*/
|
||||
val MOON_PHASES: CatchRateModifier = WorldStateModifier { _, entity ->
|
||||
if (entity.level().gameTime in 12000..24000)
|
||||
return@WorldStateModifier 1F
|
||||
when (entity.level().moonPhase) {
|
||||
3, 7 -> 1.5F
|
||||
2, 8 -> 2.5F
|
||||
1 -> 4F
|
||||
2, 6 -> 1.5F
|
||||
1, 7 -> 2.5F
|
||||
0 -> 4F
|
||||
else -> 1F
|
||||
}
|
||||
}
|
||||
|
||||
@@ -9,6 +9,7 @@
|
||||
package com.cobblemon.mod.common.api.riding
|
||||
|
||||
import com.bedrockk.molang.Expression
|
||||
import com.cobblemon.mod.common.Cobblemon
|
||||
import com.cobblemon.mod.common.api.riding.behaviour.RidingBehaviourSettings
|
||||
import com.cobblemon.mod.common.api.riding.stats.RidingStat
|
||||
import com.cobblemon.mod.common.api.riding.stats.RidingStatDefinition
|
||||
@@ -17,17 +18,18 @@ import com.cobblemon.mod.common.util.adapters.RidingBehaviourSettingsAdapter
|
||||
import net.minecraft.network.RegistryFriendlyByteBuf
|
||||
|
||||
class RidingProperties(
|
||||
val stats: Map<RidingStat, RidingStatDefinition> = mapOf(),
|
||||
val stats: MutableMap<RidingStat, RidingStatDefinition> = mutableMapOf(),
|
||||
val seats: List<Seat> = listOf(),
|
||||
val conditions: List<Expression> = listOf(),
|
||||
val behaviour: RidingBehaviourSettings? = null
|
||||
) {
|
||||
|
||||
companion object {
|
||||
fun decode(buffer: RegistryFriendlyByteBuf): RidingProperties {
|
||||
val stats: Map<RidingStat, RidingStatDefinition> = buffer.readMap(
|
||||
val stats: MutableMap<RidingStat, RidingStatDefinition> = buffer.readMap(
|
||||
{ buffer.readEnum(RidingStat::class.java) },
|
||||
{ RidingStatDefinition.decode(buffer) }
|
||||
)
|
||||
).toMutableMap()
|
||||
val seats: List<Seat> = buffer.readList { _ -> Seat.decode(buffer) }
|
||||
val conditions = buffer.readList { buffer.readString().asExpression() }
|
||||
val behaviour = buffer.readNullable { _ ->
|
||||
@@ -41,6 +43,14 @@ class RidingProperties(
|
||||
}
|
||||
}
|
||||
|
||||
internal fun updateStatRange(stat: RidingStat, style: RidingStyle, min: Int, max: Int) {
|
||||
if (!Cobblemon.config.enableDebugKeys) return
|
||||
if (stats[stat] == null) {
|
||||
stats[stat] = RidingStatDefinition()
|
||||
}
|
||||
stats[stat]!!.ranges[style] = min..max
|
||||
}
|
||||
|
||||
fun encode(buffer: RegistryFriendlyByteBuf) {
|
||||
buffer.writeMap(
|
||||
stats,
|
||||
|
||||
@@ -18,6 +18,5 @@ package com.cobblemon.mod.common.api.riding
|
||||
enum class RidingStyle {
|
||||
LAND,
|
||||
LIQUID,
|
||||
AIR,
|
||||
COMPOSITE
|
||||
AIR
|
||||
}
|
||||
+6
-3
@@ -28,7 +28,8 @@ import net.minecraft.world.phys.Vec3
|
||||
*/
|
||||
interface RidingBehaviour<Settings : RidingBehaviourSettings, State : RidingBehaviourState> {
|
||||
val key: ResourceLocation
|
||||
val style: RidingStyle
|
||||
|
||||
fun getRidingStyle(settings: Settings, state: State): RidingStyle
|
||||
|
||||
fun isActive(settings: Settings, state: State, vehicle: PokemonEntity): Boolean
|
||||
|
||||
@@ -38,9 +39,9 @@ interface RidingBehaviour<Settings : RidingBehaviourSettings, State : RidingBeha
|
||||
|
||||
fun speed(settings: Settings, state: State, vehicle: PokemonEntity, driver: Player): Float
|
||||
|
||||
fun clampPassengerRotation(settings: Settings, state: State, entity: PokemonEntity, driver: LivingEntity) {}
|
||||
fun clampPassengerRotation(settings: Settings, state: State, vehicle: PokemonEntity, driver: LivingEntity) {}
|
||||
|
||||
fun updatePassengerRotation(settings: Settings, state: State, entity: PokemonEntity, driver: LivingEntity) {}
|
||||
fun updatePassengerRotation(settings: Settings, state: State, vehicle: PokemonEntity, driver: LivingEntity) {}
|
||||
|
||||
fun rotation(settings: Settings, state: State, vehicle: PokemonEntity, driver: LivingEntity): Vec2
|
||||
|
||||
@@ -87,6 +88,8 @@ interface RidingBehaviour<Settings : RidingBehaviourSettings, State : RidingBeha
|
||||
|
||||
fun shouldRotatePlayerHead(settings: Settings, state: State, vehicle: PokemonEntity): Boolean
|
||||
|
||||
fun maxUpStep(settings: Settings, state: State, vehicle: PokemonEntity): Float? = null
|
||||
|
||||
fun createDefaultState(settings: Settings): State
|
||||
|
||||
}
|
||||
+3
-3
@@ -23,12 +23,12 @@ import net.minecraft.world.phys.Vec3
|
||||
* @author landonjw
|
||||
*/
|
||||
open class RidingBehaviourState {
|
||||
open val rideVelocity: SidedRidingState<Vec3> = ridingState(Vec3.ZERO, Side.BOTH)
|
||||
open val stamina: SidedRidingState<Float> = ridingState(0F, Side.BOTH)
|
||||
open val rideVelocity: SidedRidingState<Vec3> = ridingState(Vec3.ZERO, Side.CLIENT)
|
||||
open val stamina: SidedRidingState<Float> = ridingState(1.0F, Side.CLIENT)
|
||||
|
||||
open fun reset() {
|
||||
rideVelocity.set(Vec3.ZERO, true)
|
||||
stamina.set(0F, true)
|
||||
stamina.set(1.0F, true)
|
||||
}
|
||||
|
||||
open fun copy(): RidingBehaviourState {
|
||||
|
||||
+16
-8
@@ -8,23 +8,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.air.*
|
||||
import com.cobblemon.mod.common.api.riding.behaviour.types.composite.CompositeBehaviour
|
||||
import com.cobblemon.mod.common.api.riding.behaviour.types.land.HorseBehaviour
|
||||
import com.cobblemon.mod.common.api.riding.behaviour.types.land.VehicleBehaviour
|
||||
import com.cobblemon.mod.common.api.riding.behaviour.types.liquid.BoatBehaviour
|
||||
import com.cobblemon.mod.common.api.riding.behaviour.types.liquid.BurstBehaviour
|
||||
import com.cobblemon.mod.common.api.riding.behaviour.types.liquid.DolphinBehaviour
|
||||
import com.cobblemon.mod.common.api.riding.behaviour.types.liquid.SubmarineBehaviour
|
||||
import net.minecraft.resources.ResourceLocation
|
||||
|
||||
object RidingBehaviours {
|
||||
val behaviours = mutableMapOf<ResourceLocation, RidingBehaviour<RidingBehaviourSettings, RidingBehaviourState>>()
|
||||
|
||||
init {
|
||||
register(BirdAirBehaviour.KEY, BirdAirBehaviour())
|
||||
register(BirdBehaviour.KEY, BirdBehaviour())
|
||||
register(DolphinBehaviour.KEY, DolphinBehaviour())
|
||||
register(GenericLandBehaviour.KEY, GenericLandBehaviour())
|
||||
register(GenericSwimBehaviour.KEY, GenericSwimBehaviour())
|
||||
register(GliderAirBehaviour.KEY, GliderAirBehaviour())
|
||||
register(HorseBehaviour.KEY, HorseBehaviour())
|
||||
register(BoatBehaviour.KEY, BoatBehaviour())
|
||||
register(SubmarineBehaviour.KEY, SubmarineBehaviour())
|
||||
register(GliderBehaviour.KEY, GliderBehaviour())
|
||||
register(HelicopterBehaviour.KEY, HelicopterBehaviour())
|
||||
register(JetAirBehaviour.KEY, JetAirBehaviour())
|
||||
register(SwimDashBehaviour.KEY, SwimDashBehaviour())
|
||||
register(VehicleLandBehaviour.KEY, VehicleLandBehaviour())
|
||||
register(JetBehaviour.KEY, JetBehaviour())
|
||||
register(BurstBehaviour.KEY, BurstBehaviour())
|
||||
register(VehicleBehaviour.KEY, VehicleBehaviour())
|
||||
register(HoverBehaviour.KEY, HoverBehaviour())
|
||||
register(CompositeBehaviour.KEY, CompositeBehaviour())
|
||||
}
|
||||
|
||||
|
||||
+26
-1
@@ -11,6 +11,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.server.level.ServerPlayer
|
||||
import net.minecraft.util.SmoothDouble
|
||||
import net.minecraft.world.entity.LivingEntity
|
||||
import net.minecraft.world.entity.player.Player
|
||||
@@ -25,7 +26,10 @@ 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 getRidingStyle(settings: Settings, state: State): RidingStyle {
|
||||
return behaviour.getRidingStyle(settings, state)
|
||||
}
|
||||
|
||||
override fun isActive(settings: Settings, state: State, vehicle: PokemonEntity) =
|
||||
behaviour.isActive(settings, state, vehicle)
|
||||
@@ -41,6 +45,21 @@ class RidingController<Settings : RidingBehaviourSettings, State : RidingBehavio
|
||||
return behaviour.speed(settings, state, vehicle, driver)
|
||||
}
|
||||
|
||||
override fun updatePassengerRotation(
|
||||
settings: Settings,
|
||||
state: State,
|
||||
vehicle: PokemonEntity,
|
||||
driver: LivingEntity
|
||||
) {
|
||||
if (!isActive(settings, state, vehicle)) return
|
||||
return behaviour.updatePassengerRotation(settings, state, vehicle, driver)
|
||||
}
|
||||
|
||||
override fun clampPassengerRotation(settings: Settings, state: State, vehicle: PokemonEntity, driver: LivingEntity) {
|
||||
if (!isActive(settings, state, vehicle)) return
|
||||
return behaviour.clampPassengerRotation(settings, state, vehicle, driver)
|
||||
}
|
||||
|
||||
override fun rotation(settings: Settings, state: State, vehicle: PokemonEntity, driver: LivingEntity): Vec2 {
|
||||
if (!isActive(settings, state, vehicle)) return driver.rotationVector
|
||||
return behaviour.rotation(settings, state, vehicle, driver)
|
||||
@@ -166,8 +185,14 @@ class RidingController<Settings : RidingBehaviourSettings, State : RidingBehavio
|
||||
return behaviour.setRideBar(settings, state, vehicle, driver)
|
||||
}
|
||||
|
||||
override fun maxUpStep(settings: Settings, state: State, vehicle: PokemonEntity): Float? {
|
||||
if (!isActive(settings, state, vehicle)) return null
|
||||
return behaviour.maxUpStep(settings, state, vehicle)
|
||||
}
|
||||
|
||||
override fun createDefaultState(settings: Settings): State {
|
||||
return behaviour.createDefaultState(settings)
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
-264
@@ -1,264 +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.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.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
|
||||
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.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
|
||||
import net.minecraft.world.phys.shapes.Shapes
|
||||
|
||||
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, RidingBehaviourState>(PoseType.FLOAT)
|
||||
.with(PoseOption(PoseType.SWIM) { _, _, entity -> entity.isSwimming && entity.entityData.get(PokemonEntity.MOVING) })
|
||||
|
||||
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
|
||||
}
|
||||
val blockState = vehicle.level().getBlockState(it)
|
||||
return@any !blockState.fluidState.isEmpty
|
||||
}
|
||||
}
|
||||
|
||||
override fun pose(settings: GenericSwimSettings, state: RidingBehaviourState, vehicle: PokemonEntity): PoseType {
|
||||
return poseProvider.select(settings, state, vehicle)
|
||||
}
|
||||
|
||||
override fun speed(settings: GenericSwimSettings, state: RidingBehaviourState, vehicle: PokemonEntity, driver: Player): Float {
|
||||
return vehicle.runtime.resolveFloat(settings.speed)
|
||||
}
|
||||
|
||||
override fun rotation(
|
||||
settings: GenericSwimSettings,
|
||||
state: RidingBehaviourState,
|
||||
vehicle: PokemonEntity,
|
||||
driver: LivingEntity
|
||||
): Vec2 {
|
||||
return Vec2(driver.xRot * 0.5f, driver.yRot)
|
||||
}
|
||||
|
||||
override fun velocity(
|
||||
settings: GenericSwimSettings,
|
||||
state: RidingBehaviourState,
|
||||
vehicle: PokemonEntity,
|
||||
driver: Player,
|
||||
input: Vec3
|
||||
): Vec3 {
|
||||
val runtime = vehicle.runtime
|
||||
val driveFactor = runtime.resolveFloat(settings.driveFactor)
|
||||
val strafeFactor = runtime.resolveFloat(settings.strafeFactor)
|
||||
val f = driver.xxa * strafeFactor
|
||||
var g = driver.zza * driveFactor
|
||||
if (g <= 0.0f) {
|
||||
g *= runtime.resolveFloat(settings.reverseDriveFactor)
|
||||
}
|
||||
|
||||
val velocity = Vec3(f.toDouble(), 0.0, g.toDouble())
|
||||
|
||||
return velocity
|
||||
}
|
||||
|
||||
override fun angRollVel(
|
||||
settings: GenericSwimSettings,
|
||||
state: RidingBehaviourState,
|
||||
vehicle: PokemonEntity,
|
||||
driver: Player,
|
||||
deltaTime: Double
|
||||
): Vec3 {
|
||||
return Vec3.ZERO
|
||||
}
|
||||
|
||||
override fun rotationOnMouseXY(
|
||||
settings: GenericSwimSettings,
|
||||
state: RidingBehaviourState,
|
||||
vehicle: PokemonEntity,
|
||||
driver: Player,
|
||||
mouseY: Double,
|
||||
mouseX: Double,
|
||||
mouseYSmoother: SmoothDouble,
|
||||
mouseXSmoother: SmoothDouble,
|
||||
sensitivity: Double,
|
||||
deltaTime: Double
|
||||
): Vec3 {
|
||||
if (driver !is OrientationControllable) return Vec3.ZERO
|
||||
|
||||
//Might need to add the smoothing here for default.
|
||||
val invertRoll = if (Cobblemon.config.invertRoll) -1 else 1
|
||||
val invertPitch = if (Cobblemon.config.invertPitch) -1 else 1
|
||||
return Vec3(0.0, mouseY * invertPitch, mouseX * invertRoll)
|
||||
}
|
||||
|
||||
override fun canJump(
|
||||
settings: GenericSwimSettings,
|
||||
state: RidingBehaviourState,
|
||||
vehicle: PokemonEntity,
|
||||
driver: Player
|
||||
): Boolean {
|
||||
return vehicle.runtime.resolveBoolean(settings.canJump)
|
||||
}
|
||||
|
||||
override fun setRideBar(
|
||||
settings: GenericSwimSettings,
|
||||
state: RidingBehaviourState,
|
||||
vehicle: PokemonEntity,
|
||||
driver: Player
|
||||
): Float {
|
||||
return 0.0f
|
||||
}
|
||||
|
||||
override fun jumpForce(
|
||||
settings: GenericSwimSettings,
|
||||
state: RidingBehaviourState,
|
||||
vehicle: PokemonEntity,
|
||||
driver: Player,
|
||||
jumpStrength: Int
|
||||
): Vec3 {
|
||||
val runtime = vehicle.runtime
|
||||
runtime.environment.query.addFunction("jump_strength") { DoubleValue(jumpStrength.toDouble()) }
|
||||
val jumpVector = settings.jumpVector.map { runtime.resolveFloat(it) }
|
||||
return Vec3(jumpVector[0].toDouble(), jumpVector[1].toDouble(), jumpVector[2].toDouble())
|
||||
}
|
||||
|
||||
override fun gravity(
|
||||
settings: GenericSwimSettings,
|
||||
state: RidingBehaviourState,
|
||||
vehicle: PokemonEntity,
|
||||
regularGravity: Double
|
||||
): Double {
|
||||
return regularGravity
|
||||
}
|
||||
|
||||
override fun rideFovMultiplier(
|
||||
settings: GenericSwimSettings,
|
||||
state: RidingBehaviourState,
|
||||
vehicle: PokemonEntity,
|
||||
driver: Player
|
||||
): Float {
|
||||
return 1.0f
|
||||
}
|
||||
|
||||
override fun useAngVelSmoothing(settings: GenericSwimSettings, state: RidingBehaviourState, vehicle: PokemonEntity): Boolean {
|
||||
return false
|
||||
}
|
||||
|
||||
override fun useRidingAltPose(
|
||||
settings: GenericSwimSettings,
|
||||
state: RidingBehaviourState,
|
||||
vehicle: PokemonEntity,
|
||||
driver: Player
|
||||
): Boolean {
|
||||
return false
|
||||
}
|
||||
|
||||
override fun inertia(settings: GenericSwimSettings, state: RidingBehaviourState, vehicle: PokemonEntity): Double {
|
||||
return 0.5
|
||||
}
|
||||
|
||||
override fun shouldRoll(settings: GenericSwimSettings, state: RidingBehaviourState, vehicle: PokemonEntity): Boolean {
|
||||
return false
|
||||
}
|
||||
|
||||
override fun turnOffOnGround(settings: GenericSwimSettings, state: RidingBehaviourState, vehicle: PokemonEntity): Boolean {
|
||||
return false
|
||||
}
|
||||
|
||||
override fun dismountOnShift(settings: GenericSwimSettings, state: RidingBehaviourState, vehicle: PokemonEntity): Boolean {
|
||||
return false
|
||||
}
|
||||
|
||||
override fun shouldRotatePokemonHead(
|
||||
settings: GenericSwimSettings,
|
||||
state: RidingBehaviourState,
|
||||
vehicle: PokemonEntity
|
||||
): Boolean {
|
||||
return false
|
||||
}
|
||||
|
||||
override fun shouldRotatePlayerHead(
|
||||
settings: GenericSwimSettings,
|
||||
state: RidingBehaviourState,
|
||||
vehicle: PokemonEntity
|
||||
): Boolean {
|
||||
return false
|
||||
}
|
||||
|
||||
override fun createDefaultState(settings: GenericSwimSettings) = RidingBehaviourState()
|
||||
|
||||
}
|
||||
|
||||
class GenericSwimSettings : RidingBehaviourSettings {
|
||||
override val key = GenericSwimBehaviour.KEY
|
||||
|
||||
var canJump = "true".asExpression()
|
||||
private set
|
||||
|
||||
var jumpVector = listOf("0".asExpression(), "0.3".asExpression(), "0".asExpression())
|
||||
private set
|
||||
|
||||
var speed = "1.0".asExpression()
|
||||
private set
|
||||
|
||||
var driveFactor = "1.0".asExpression()
|
||||
private set
|
||||
|
||||
var reverseDriveFactor = "0.25".asExpression()
|
||||
private set
|
||||
|
||||
var strafeFactor = "0.2".asExpression()
|
||||
private set
|
||||
|
||||
override fun encode(buffer: RegistryFriendlyByteBuf) {
|
||||
buffer.writeResourceLocation(key)
|
||||
buffer.writeExpression(canJump)
|
||||
buffer.writeExpression(jumpVector[0])
|
||||
buffer.writeExpression(jumpVector[1])
|
||||
buffer.writeExpression(jumpVector[2])
|
||||
buffer.writeExpression(speed)
|
||||
buffer.writeExpression(driveFactor)
|
||||
buffer.writeExpression(reverseDriveFactor)
|
||||
buffer.writeExpression(strafeFactor)
|
||||
}
|
||||
|
||||
override fun decode(buffer: RegistryFriendlyByteBuf) {
|
||||
canJump = buffer.readExpression()
|
||||
jumpVector = listOf(
|
||||
buffer.readExpression(),
|
||||
buffer.readExpression(),
|
||||
buffer.readExpression()
|
||||
)
|
||||
speed = buffer.readExpression()
|
||||
driveFactor = buffer.readExpression()
|
||||
reverseDriveFactor = buffer.readExpression()
|
||||
strafeFactor = buffer.readExpression()
|
||||
}
|
||||
}
|
||||
+127
-83
@@ -6,7 +6,7 @@
|
||||
* file, You can obtain one at https://mozilla.org/MPL/2.0/.
|
||||
*/
|
||||
|
||||
package com.cobblemon.mod.common.api.riding.behaviour.types
|
||||
package com.cobblemon.mod.common.api.riding.behaviour.types.air
|
||||
|
||||
import com.bedrockk.molang.Expression
|
||||
import com.bedrockk.molang.runtime.MoLangMath.lerp
|
||||
@@ -29,28 +29,31 @@ import net.minecraft.world.phys.Vec2
|
||||
import net.minecraft.world.phys.Vec3
|
||||
import kotlin.math.*
|
||||
|
||||
class BirdAirBehaviour : RidingBehaviour<BirdAirSettings, BirdAirState> {
|
||||
class BirdBehaviour : RidingBehaviour<BirdSettings, BirdState> {
|
||||
companion object {
|
||||
val KEY = cobblemonResource("air/bird")
|
||||
}
|
||||
|
||||
override val key: ResourceLocation = KEY
|
||||
override val style = RidingStyle.AIR
|
||||
|
||||
val poseProvider = PoseProvider<BirdAirSettings, BirdAirState>(PoseType.HOVER)
|
||||
override fun getRidingStyle(settings: BirdSettings, state: BirdState): RidingStyle {
|
||||
return RidingStyle.AIR
|
||||
}
|
||||
|
||||
val poseProvider = PoseProvider<BirdSettings, BirdState>(PoseType.HOVER)
|
||||
.with(PoseOption(PoseType.FLY) { _, state, _ -> state.rideVelocity.get().z > 0.2 })
|
||||
|
||||
override fun isActive(settings: BirdAirSettings, state: BirdAirState, vehicle: PokemonEntity): Boolean {
|
||||
override fun isActive(settings: BirdSettings, state: BirdState, vehicle: PokemonEntity): Boolean {
|
||||
return true
|
||||
}
|
||||
|
||||
override fun pose(settings: BirdAirSettings, state: BirdAirState, vehicle: PokemonEntity): PoseType {
|
||||
override fun pose(settings: BirdSettings, state: BirdState, vehicle: PokemonEntity): PoseType {
|
||||
return poseProvider.select(settings, state, vehicle)
|
||||
}
|
||||
|
||||
override fun speed(
|
||||
settings: BirdAirSettings,
|
||||
state: BirdAirState,
|
||||
settings: BirdSettings,
|
||||
state: BirdState,
|
||||
vehicle: PokemonEntity,
|
||||
driver: Player
|
||||
): Float {
|
||||
@@ -58,8 +61,8 @@ class BirdAirBehaviour : RidingBehaviour<BirdAirSettings, BirdAirState> {
|
||||
}
|
||||
|
||||
override fun rotation(
|
||||
settings: BirdAirSettings,
|
||||
state: BirdAirState,
|
||||
settings: BirdSettings,
|
||||
state: BirdState,
|
||||
vehicle: PokemonEntity,
|
||||
driver: LivingEntity
|
||||
): Vec2 {
|
||||
@@ -67,8 +70,8 @@ class BirdAirBehaviour : RidingBehaviour<BirdAirSettings, BirdAirState> {
|
||||
}
|
||||
|
||||
override fun velocity(
|
||||
settings: BirdAirSettings,
|
||||
state: BirdAirState,
|
||||
settings: BirdSettings,
|
||||
state: BirdState,
|
||||
vehicle: PokemonEntity,
|
||||
driver: Player,
|
||||
input: Vec3
|
||||
@@ -114,7 +117,7 @@ class BirdAirBehaviour : RidingBehaviour<BirdAirSettings, BirdAirState> {
|
||||
/*
|
||||
* Calculates the change in the ride space vector due to player input and ride state
|
||||
*/
|
||||
fun calculateRideSpaceVel(settings: BirdAirSettings, state: BirdAirState, vehicle: PokemonEntity, driver: Player) {
|
||||
fun calculateRideSpaceVel(settings: BirdSettings, state: BirdState, vehicle: PokemonEntity, driver: Player) {
|
||||
//retrieve stats
|
||||
val topSpeed = vehicle.runtime.resolveDouble(settings.speedExpr)
|
||||
val glideTopSpeed = vehicle.runtime.resolveDouble(settings.glidespeedExpr)
|
||||
@@ -179,26 +182,26 @@ class BirdAirBehaviour : RidingBehaviour<BirdAirSettings, BirdAirState> {
|
||||
}
|
||||
|
||||
//Lateral movement based on driver input.
|
||||
val latTopSpeed = topSpeed / 2.0
|
||||
if (driver.xxa != 0.0f && state.stamina.get() > 0.0) {
|
||||
newVelocity = Vec3(
|
||||
(newVelocity.x + (accel * driver.xxa)).coerceIn(-latTopSpeed, latTopSpeed),
|
||||
newVelocity.y,
|
||||
newVelocity.z)
|
||||
activeInput = true
|
||||
}
|
||||
else {
|
||||
newVelocity = Vec3(
|
||||
lerp(newVelocity.x, 0.0, latTopSpeed / 20.0),
|
||||
newVelocity.y,
|
||||
newVelocity.z)
|
||||
}
|
||||
// val latTopSpeed = topSpeed / 2.0
|
||||
// if (driver.xxa != 0.0f && state.stamina.get() > 0.0) {
|
||||
// newVelocity = Vec3(
|
||||
// (newVelocity.x + (accel * driver.xxa)).coerceIn(-latTopSpeed, latTopSpeed),
|
||||
// newVelocity.y,
|
||||
// newVelocity.z)
|
||||
// activeInput = true
|
||||
// }
|
||||
// else {
|
||||
// newVelocity = Vec3(
|
||||
// lerp(newVelocity.x, 0.0, latTopSpeed / 20.0),
|
||||
// newVelocity.y,
|
||||
// newVelocity.z)
|
||||
// }
|
||||
|
||||
//Vertical movement based on driver input.
|
||||
val vertTopSpeed = topSpeed / 2.0
|
||||
val vertInput = when {
|
||||
driver.jumping -> 1.0
|
||||
driver.isShiftKeyDown -> -1.0
|
||||
driver.jumping && state.rideVelocity.get().length() < 0.3 -> 1.0
|
||||
driver.isShiftKeyDown && state.rideVelocity.get().length() < 0.3 -> -1.0
|
||||
else -> 0.0
|
||||
}
|
||||
|
||||
@@ -225,30 +228,31 @@ class BirdAirBehaviour : RidingBehaviour<BirdAirSettings, BirdAirState> {
|
||||
}
|
||||
}
|
||||
|
||||
//Only perform stamina logic if the ride does not have infinite stamina
|
||||
if (!vehicle.runtime.resolveBoolean(settings.infiniteStamina)) {
|
||||
if (activeInput) {
|
||||
state.stamina.set(state.stamina.get() - (0.05 / staminaStat).toFloat())
|
||||
}
|
||||
|
||||
//Lose a base amount of stamina just for being airborne
|
||||
state.stamina.set(state.stamina.get() - (0.01 / staminaStat).toFloat())
|
||||
}
|
||||
else
|
||||
{
|
||||
state.stamina.set(1.0f)
|
||||
}
|
||||
//TODO: Reintroduce stamina drain once stats start to be polished and tweaked
|
||||
// //Only perform stamina logic if the ride does not have infinite stamina
|
||||
// if (!vehicle.runtime.resolveBoolean(settings.infiniteStamina)) {
|
||||
// if (activeInput) {
|
||||
// state.stamina.set(state.stamina.get() - (0.05 / staminaStat).toFloat())
|
||||
// }
|
||||
//
|
||||
// //Lose a base amount of stamina just for being airborne
|
||||
// state.stamina.set(state.stamina.get() - (0.01 / staminaStat).toFloat())
|
||||
// }
|
||||
// else
|
||||
// {
|
||||
// state.stamina.set(1.0f)
|
||||
// }
|
||||
|
||||
//air resistance
|
||||
if( abs(newVelocity.z) > 0) {
|
||||
newVelocity = newVelocity.subtract(0.0, 0.0, min(0.003 * newVelocity.z.sign, newVelocity.z))
|
||||
newVelocity = newVelocity.subtract(0.0, 0.0, min(0.0015 * newVelocity.z.sign, newVelocity.z))
|
||||
}
|
||||
state.rideVelocity.set(newVelocity)
|
||||
}
|
||||
|
||||
override fun angRollVel(
|
||||
settings: BirdAirSettings,
|
||||
state: BirdAirState,
|
||||
settings: BirdSettings,
|
||||
state: BirdState,
|
||||
vehicle: PokemonEntity,
|
||||
driver: Player,
|
||||
deltaTime: Double
|
||||
@@ -256,10 +260,17 @@ class BirdAirBehaviour : RidingBehaviour<BirdAirSettings, BirdAirState> {
|
||||
if (driver !is OrientationControllable) return Vec3.ZERO
|
||||
val controller = (driver as OrientationControllable).orientationController
|
||||
|
||||
//TODO: Tie into handling
|
||||
//limit rolling based on handling and current speed.
|
||||
//modulated by speed so that when flapping idle in air you are ont wobbling around to look around
|
||||
//TODO: Tie handling into yaw rate
|
||||
val handling = vehicle.runtime.resolveDouble(settings.handlingExpr)
|
||||
val topSpeed = vehicle.runtime.resolveDouble(settings.speedExpr)
|
||||
val rotationChangeRate = 10.0
|
||||
//This rotation limit will be used to know if the ride has exceeded it and its needs correcting.
|
||||
val rotMin = 15.0
|
||||
val rotLimit = max(handling * sqrt(normalizeVal(state.rideVelocity.get().length(), 0.0, topSpeed)), rotMin)
|
||||
|
||||
|
||||
val rotationChangeRate = 100.0
|
||||
|
||||
var yawForce = rotationChangeRate * sin(Math.toRadians(controller.roll.toDouble()))
|
||||
//for a bit of correction on the rolls limit it to a quarter the amount
|
||||
@@ -269,12 +280,33 @@ class BirdAirBehaviour : RidingBehaviour<BirdAirSettings, BirdAirState> {
|
||||
yawForce *= abs(cos(Math.toRadians(controller.pitch.toDouble())))
|
||||
pitchForce *= abs(cos(Math.toRadians(controller.pitch.toDouble()))) * 1.5
|
||||
|
||||
return Vec3(yawForce, pitchForce, 0.0)
|
||||
var yawDeltaDeg = deltaTime * rotationChangeRate * sin(Math.toRadians(controller.roll.toDouble())) //sin(Math.toRadians(controller.roll.toDouble())) * abs(cos(Math.toRadians(controller.pitch.toDouble())))
|
||||
val trueYawDelt = yawDeltaDeg * abs(cos(Math.toRadians(controller.pitch.toDouble())))
|
||||
//val pitchedYawDelt = yawDeltaDeg - trueYawDelt
|
||||
|
||||
controller.applyGlobalYaw(trueYawDelt.toFloat())
|
||||
|
||||
val correctionRate = 5.0
|
||||
//Calculate correcting roll force.
|
||||
if(abs(controller.roll) > rotLimit) {
|
||||
state.currRollCorrectionForce.set(
|
||||
state.currRollCorrectionForce.get() + ((abs(controller.roll) - rotLimit) / 180 - rotLimit) * controller.roll.sign * correctionRate * deltaTime * 0.01
|
||||
)
|
||||
} else {
|
||||
state.currRollCorrectionForce.set(
|
||||
//reduce rollCorrection gradually and make sure to
|
||||
//state.currRollCorrectionForce.get() - max(correctionRate * deltaTime * 0.04, abs(state.currRollCorrectionForce.get())) * state.currRollCorrectionForce.get().sign
|
||||
lerp(state.currRollCorrectionForce.get(), 0.0, deltaTime * 0.98)
|
||||
)
|
||||
}
|
||||
|
||||
//yaw, pitch, roll
|
||||
return Vec3(0.0, 0.0, state.currRollCorrectionForce.get())
|
||||
}
|
||||
|
||||
override fun rotationOnMouseXY(
|
||||
settings: BirdAirSettings,
|
||||
state: BirdAirState,
|
||||
settings: BirdSettings,
|
||||
state: BirdState,
|
||||
vehicle: PokemonEntity,
|
||||
driver: Player,
|
||||
mouseY: Double,
|
||||
@@ -303,13 +335,14 @@ 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.rideVelocity.get().length(), 0.0, topSpeed).pow(3), rotMin)
|
||||
val rotLimit = max(handling * sqrt(normalizeVal(state.rideVelocity.get().length(), 0.0, topSpeed)), rotMin)
|
||||
|
||||
//Limit roll by non linearly decreasing inputs towards
|
||||
// a rotation limit based on the current distance from
|
||||
// that rotation limit
|
||||
if (abs(controller.roll + rollForce) < rotLimit) {
|
||||
if (sign(rollForce) == sign(controller.roll).toDouble()) {
|
||||
//Grab how far the current roll is away from the roll limit
|
||||
val d = abs(abs(controller.roll) - rotLimit)
|
||||
rollForce *= (d.pow(2)) / (rotLimit.pow(2))
|
||||
}
|
||||
@@ -318,10 +351,18 @@ 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.rideVelocity.get().length(), 0.0, topSpeed).pow(3))
|
||||
val yawForce = xInput * ( 1.0 - sqrt(normalizeVal(state.rideVelocity.get().length(), 0.0, topSpeed)))
|
||||
|
||||
//Yaw locally a bit when up or down so that its more intuitive to make it out of a dive or a straight vertical
|
||||
//climb
|
||||
val yawForcePitched = xInput * sin(Math.toRadians(abs(controller.pitch.toDouble()))) * 0.25
|
||||
|
||||
|
||||
//Apply yaw globally as we don't want roll or pitch changes due to local yaw when looking up or down.
|
||||
controller.applyGlobalYaw(yawForce.toFloat())
|
||||
|
||||
//yaw, pitch, roll
|
||||
return Vec3(yawForce, yInput, rollForce)
|
||||
return Vec3(yawForcePitched, yInput, rollForce)
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -335,8 +376,8 @@ class BirdAirBehaviour : RidingBehaviour<BirdAirSettings, BirdAirState> {
|
||||
}
|
||||
|
||||
override fun canJump(
|
||||
settings: BirdAirSettings,
|
||||
state: BirdAirState,
|
||||
settings: BirdSettings,
|
||||
state: BirdState,
|
||||
vehicle: PokemonEntity,
|
||||
driver: Player
|
||||
): Boolean {
|
||||
@@ -344,8 +385,8 @@ class BirdAirBehaviour : RidingBehaviour<BirdAirSettings, BirdAirState> {
|
||||
}
|
||||
|
||||
override fun setRideBar(
|
||||
settings: BirdAirSettings,
|
||||
state: BirdAirState,
|
||||
settings: BirdSettings,
|
||||
state: BirdState,
|
||||
vehicle: PokemonEntity,
|
||||
driver: Player
|
||||
): Float {
|
||||
@@ -353,8 +394,8 @@ class BirdAirBehaviour : RidingBehaviour<BirdAirSettings, BirdAirState> {
|
||||
}
|
||||
|
||||
override fun jumpForce(
|
||||
settings: BirdAirSettings,
|
||||
state: BirdAirState,
|
||||
settings: BirdSettings,
|
||||
state: BirdState,
|
||||
vehicle: PokemonEntity,
|
||||
driver: Player,
|
||||
jumpStrength: Int
|
||||
@@ -363,8 +404,8 @@ class BirdAirBehaviour : RidingBehaviour<BirdAirSettings, BirdAirState> {
|
||||
}
|
||||
|
||||
override fun gravity(
|
||||
settings: BirdAirSettings,
|
||||
state: BirdAirState,
|
||||
settings: BirdSettings,
|
||||
state: BirdState,
|
||||
vehicle: PokemonEntity,
|
||||
regularGravity: Double
|
||||
): Double {
|
||||
@@ -372,8 +413,8 @@ class BirdAirBehaviour : RidingBehaviour<BirdAirSettings, BirdAirState> {
|
||||
}
|
||||
|
||||
override fun rideFovMultiplier(
|
||||
settings: BirdAirSettings,
|
||||
state: BirdAirState,
|
||||
settings: BirdSettings,
|
||||
state: BirdState,
|
||||
vehicle: PokemonEntity,
|
||||
driver: Player
|
||||
): Float {
|
||||
@@ -388,60 +429,60 @@ class BirdAirBehaviour : RidingBehaviour<BirdAirSettings, BirdAirState> {
|
||||
}
|
||||
|
||||
override fun useAngVelSmoothing(
|
||||
settings: BirdAirSettings,
|
||||
state: BirdAirState,
|
||||
settings: BirdSettings,
|
||||
state: BirdState,
|
||||
vehicle: PokemonEntity
|
||||
): Boolean {
|
||||
return false
|
||||
}
|
||||
|
||||
override fun useRidingAltPose(
|
||||
settings: BirdAirSettings,
|
||||
state: BirdAirState,
|
||||
settings: BirdSettings,
|
||||
state: BirdState,
|
||||
vehicle: PokemonEntity,
|
||||
driver: Player
|
||||
): Boolean {
|
||||
return state.gliding.get()
|
||||
}
|
||||
|
||||
override fun inertia(settings: BirdAirSettings, state: BirdAirState, vehicle: PokemonEntity): Double {
|
||||
override fun inertia(settings: BirdSettings, state: BirdState, vehicle: PokemonEntity): Double {
|
||||
return 0.5
|
||||
}
|
||||
|
||||
override fun shouldRoll(settings: BirdAirSettings, state: BirdAirState, vehicle: PokemonEntity): Boolean {
|
||||
override fun shouldRoll(settings: BirdSettings, state: BirdState, vehicle: PokemonEntity): Boolean {
|
||||
return true
|
||||
}
|
||||
|
||||
override fun turnOffOnGround(settings: BirdAirSettings, state: BirdAirState, vehicle: PokemonEntity): Boolean {
|
||||
override fun turnOffOnGround(settings: BirdSettings, state: BirdState, vehicle: PokemonEntity): Boolean {
|
||||
return false
|
||||
}
|
||||
|
||||
override fun dismountOnShift(settings: BirdAirSettings, state: BirdAirState, vehicle: PokemonEntity): Boolean {
|
||||
override fun dismountOnShift(settings: BirdSettings, state: BirdState, vehicle: PokemonEntity): Boolean {
|
||||
return false
|
||||
}
|
||||
|
||||
override fun shouldRotatePokemonHead(
|
||||
settings: BirdAirSettings,
|
||||
state: BirdAirState,
|
||||
settings: BirdSettings,
|
||||
state: BirdState,
|
||||
vehicle: PokemonEntity
|
||||
): Boolean {
|
||||
return false
|
||||
}
|
||||
|
||||
override fun shouldRotatePlayerHead(
|
||||
settings: BirdAirSettings,
|
||||
state: BirdAirState,
|
||||
settings: BirdSettings,
|
||||
state: BirdState,
|
||||
vehicle: PokemonEntity
|
||||
): Boolean {
|
||||
return false
|
||||
}
|
||||
|
||||
override fun createDefaultState(settings: BirdAirSettings) = BirdAirState()
|
||||
override fun createDefaultState(settings: BirdSettings) = BirdState()
|
||||
|
||||
}
|
||||
|
||||
class BirdAirSettings : RidingBehaviourSettings {
|
||||
override val key = BirdAirBehaviour.KEY
|
||||
class BirdSettings : RidingBehaviourSettings {
|
||||
override val key = BirdBehaviour.KEY
|
||||
|
||||
var infiniteAltitude: Expression = "false".asExpression()
|
||||
private set
|
||||
@@ -483,9 +524,10 @@ class BirdAirSettings : RidingBehaviourSettings {
|
||||
}
|
||||
}
|
||||
|
||||
class BirdAirState : RidingBehaviourState() {
|
||||
class BirdState : RidingBehaviourState() {
|
||||
var gliding = ridingState(false, Side.CLIENT)
|
||||
var lastGlide = ridingState(-100L, Side.CLIENT)
|
||||
var currRollCorrectionForce = ridingState(0.0, Side.CLIENT)
|
||||
|
||||
override fun encode(buffer: FriendlyByteBuf) {
|
||||
super.encode(buffer)
|
||||
@@ -502,22 +544,24 @@ class BirdAirState : RidingBehaviourState() {
|
||||
super.reset()
|
||||
gliding.set(false, forced = true)
|
||||
lastGlide.set(-100L, forced = true)
|
||||
currRollCorrectionForce.set(0.0, forced = true)
|
||||
}
|
||||
|
||||
override fun toString(): String {
|
||||
return "BirdAirState(rideVelocity=${rideVelocity.get()}, stamina=${stamina.get()}, gliding=${gliding.get()})"
|
||||
return "BirdState(rideVelocity=${rideVelocity.get()}, stamina=${stamina.get()}, gliding=${gliding.get()})"
|
||||
}
|
||||
|
||||
override fun copy() = BirdAirState().also {
|
||||
override fun copy() = BirdState().also {
|
||||
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)
|
||||
it.currRollCorrectionForce.set(this.currRollCorrectionForce.get(), forced = true)
|
||||
}
|
||||
|
||||
override fun shouldSync(previous: RidingBehaviourState): Boolean {
|
||||
if (previous !is BirdAirState) return false
|
||||
if (previous.gliding != gliding) return true
|
||||
if (previous !is BirdState) return false
|
||||
if (previous.gliding.get() != gliding.get()) return true
|
||||
return super.shouldSync(previous)
|
||||
}
|
||||
}
|
||||
+30
-28
@@ -6,7 +6,7 @@
|
||||
* file, You can obtain one at https://mozilla.org/MPL/2.0/.
|
||||
*/
|
||||
|
||||
package com.cobblemon.mod.common.api.riding.behaviour.types
|
||||
package com.cobblemon.mod.common.api.riding.behaviour.types.air
|
||||
|
||||
import com.bedrockk.molang.Expression
|
||||
import com.cobblemon.mod.common.Cobblemon
|
||||
@@ -22,38 +22,40 @@ 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
|
||||
import net.minecraft.world.phys.Vec2
|
||||
import net.minecraft.world.phys.Vec3
|
||||
|
||||
class GliderAirBehaviour : RidingBehaviour<GliderAirSettings, RidingBehaviourState> {
|
||||
class GliderBehaviour : RidingBehaviour<GliderSettings, RidingBehaviourState> {
|
||||
companion object {
|
||||
val KEY = cobblemonResource("air/glider")
|
||||
}
|
||||
|
||||
override val key = KEY
|
||||
override val style = RidingStyle.AIR
|
||||
|
||||
val poseProvider = PoseProvider<GliderAirSettings, RidingBehaviourState>(PoseType.HOVER)
|
||||
override fun getRidingStyle(settings: GliderSettings, state: RidingBehaviourState): RidingStyle {
|
||||
return RidingStyle.AIR
|
||||
}
|
||||
|
||||
val poseProvider = PoseProvider<GliderSettings, RidingBehaviourState>(PoseType.HOVER)
|
||||
.with(PoseOption(PoseType.FLY) { _, _, entity -> entity.entityData.get(PokemonEntity.MOVING) })
|
||||
|
||||
override fun isActive(settings: GliderAirSettings, state: RidingBehaviourState, vehicle: PokemonEntity): Boolean {
|
||||
override fun isActive(settings: GliderSettings, state: RidingBehaviourState, vehicle: PokemonEntity): Boolean {
|
||||
return true
|
||||
}
|
||||
|
||||
override fun pose(settings: GliderAirSettings, state: RidingBehaviourState, vehicle: PokemonEntity): PoseType {
|
||||
override fun pose(settings: GliderSettings, state: RidingBehaviourState, vehicle: PokemonEntity): PoseType {
|
||||
return poseProvider.select(settings, state, vehicle)
|
||||
}
|
||||
|
||||
override fun speed(settings: GliderAirSettings, state: RidingBehaviourState, vehicle: PokemonEntity, driver: Player): Float {
|
||||
override fun speed(settings: GliderSettings, state: RidingBehaviourState, vehicle: PokemonEntity, driver: Player): Float {
|
||||
return vehicle.runtime.resolveFloat(settings.speed)
|
||||
}
|
||||
|
||||
override fun rotation(
|
||||
settings: GliderAirSettings,
|
||||
settings: GliderSettings,
|
||||
state: RidingBehaviourState,
|
||||
vehicle: PokemonEntity,
|
||||
driver: LivingEntity
|
||||
@@ -62,7 +64,7 @@ class GliderAirBehaviour : RidingBehaviour<GliderAirSettings, RidingBehaviourSta
|
||||
}
|
||||
|
||||
override fun velocity(
|
||||
settings: GliderAirSettings,
|
||||
settings: GliderSettings,
|
||||
state: RidingBehaviourState,
|
||||
vehicle: PokemonEntity,
|
||||
driver: Player,
|
||||
@@ -77,7 +79,7 @@ class GliderAirBehaviour : RidingBehaviour<GliderAirSettings, RidingBehaviourSta
|
||||
}
|
||||
|
||||
override fun angRollVel(
|
||||
settings: GliderAirSettings,
|
||||
settings: GliderSettings,
|
||||
state: RidingBehaviourState,
|
||||
vehicle: PokemonEntity,
|
||||
driver: Player,
|
||||
@@ -87,7 +89,7 @@ class GliderAirBehaviour : RidingBehaviour<GliderAirSettings, RidingBehaviourSta
|
||||
}
|
||||
|
||||
override fun rotationOnMouseXY(
|
||||
settings: GliderAirSettings,
|
||||
settings: GliderSettings,
|
||||
state: RidingBehaviourState,
|
||||
vehicle: PokemonEntity,
|
||||
driver: Player,
|
||||
@@ -106,12 +108,12 @@ class GliderAirBehaviour : RidingBehaviour<GliderAirSettings, RidingBehaviourSta
|
||||
return Vec3(0.0, mouseY * invertPitch, mouseX * invertRoll)
|
||||
}
|
||||
|
||||
override fun canJump(settings: GliderAirSettings, state: RidingBehaviourState, vehicle: PokemonEntity, driver: Player): Boolean {
|
||||
override fun canJump(settings: GliderSettings, state: RidingBehaviourState, vehicle: PokemonEntity, driver: Player): Boolean {
|
||||
return false
|
||||
}
|
||||
|
||||
override fun setRideBar(
|
||||
settings: GliderAirSettings,
|
||||
settings: GliderSettings,
|
||||
state: RidingBehaviourState,
|
||||
vehicle: PokemonEntity,
|
||||
driver: Player
|
||||
@@ -120,7 +122,7 @@ class GliderAirBehaviour : RidingBehaviour<GliderAirSettings, RidingBehaviourSta
|
||||
}
|
||||
|
||||
override fun jumpForce(
|
||||
settings: GliderAirSettings,
|
||||
settings: GliderSettings,
|
||||
state: RidingBehaviourState,
|
||||
vehicle: PokemonEntity,
|
||||
driver: Player,
|
||||
@@ -130,7 +132,7 @@ class GliderAirBehaviour : RidingBehaviour<GliderAirSettings, RidingBehaviourSta
|
||||
}
|
||||
|
||||
override fun gravity(
|
||||
settings: GliderAirSettings,
|
||||
settings: GliderSettings,
|
||||
state: RidingBehaviourState,
|
||||
vehicle: PokemonEntity,
|
||||
regularGravity: Double
|
||||
@@ -139,7 +141,7 @@ class GliderAirBehaviour : RidingBehaviour<GliderAirSettings, RidingBehaviourSta
|
||||
}
|
||||
|
||||
override fun rideFovMultiplier(
|
||||
settings: GliderAirSettings,
|
||||
settings: GliderSettings,
|
||||
state: RidingBehaviourState,
|
||||
vehicle: PokemonEntity,
|
||||
driver: Player
|
||||
@@ -147,12 +149,12 @@ class GliderAirBehaviour : RidingBehaviour<GliderAirSettings, RidingBehaviourSta
|
||||
return 1.0f
|
||||
}
|
||||
|
||||
override fun useAngVelSmoothing(settings: GliderAirSettings, state: RidingBehaviourState, vehicle: PokemonEntity): Boolean {
|
||||
override fun useAngVelSmoothing(settings: GliderSettings, state: RidingBehaviourState, vehicle: PokemonEntity): Boolean {
|
||||
return false
|
||||
}
|
||||
|
||||
override fun useRidingAltPose(
|
||||
settings: GliderAirSettings,
|
||||
settings: GliderSettings,
|
||||
state: RidingBehaviourState,
|
||||
vehicle: PokemonEntity,
|
||||
driver: Player
|
||||
@@ -160,35 +162,35 @@ class GliderAirBehaviour : RidingBehaviour<GliderAirSettings, RidingBehaviourSta
|
||||
return false
|
||||
}
|
||||
|
||||
override fun inertia(settings: GliderAirSettings, state: RidingBehaviourState, vehicle: PokemonEntity): Double {
|
||||
override fun inertia(settings: GliderSettings, state: RidingBehaviourState, vehicle: PokemonEntity): Double {
|
||||
return 0.5
|
||||
}
|
||||
|
||||
override fun shouldRoll(settings: GliderAirSettings, state: RidingBehaviourState, vehicle: PokemonEntity): Boolean {
|
||||
override fun shouldRoll(settings: GliderSettings, state: RidingBehaviourState, vehicle: PokemonEntity): Boolean {
|
||||
return false
|
||||
}
|
||||
|
||||
override fun turnOffOnGround(settings: GliderAirSettings, state: RidingBehaviourState, vehicle: PokemonEntity): Boolean {
|
||||
override fun turnOffOnGround(settings: GliderSettings, state: RidingBehaviourState, vehicle: PokemonEntity): Boolean {
|
||||
return false
|
||||
}
|
||||
|
||||
override fun dismountOnShift(settings: GliderAirSettings, state: RidingBehaviourState, vehicle: PokemonEntity): Boolean {
|
||||
override fun dismountOnShift(settings: GliderSettings, state: RidingBehaviourState, vehicle: PokemonEntity): Boolean {
|
||||
return false
|
||||
}
|
||||
|
||||
override fun shouldRotatePokemonHead(settings: GliderAirSettings, state: RidingBehaviourState, vehicle: PokemonEntity): Boolean {
|
||||
override fun shouldRotatePokemonHead(settings: GliderSettings, state: RidingBehaviourState, vehicle: PokemonEntity): Boolean {
|
||||
return false
|
||||
}
|
||||
|
||||
override fun shouldRotatePlayerHead(settings: GliderAirSettings, state: RidingBehaviourState, vehicle: PokemonEntity): Boolean {
|
||||
override fun shouldRotatePlayerHead(settings: GliderSettings, state: RidingBehaviourState, vehicle: PokemonEntity): Boolean {
|
||||
return false
|
||||
}
|
||||
|
||||
override fun createDefaultState(settings: GliderAirSettings) = RidingBehaviourState()
|
||||
override fun createDefaultState(settings: GliderSettings) = RidingBehaviourState()
|
||||
}
|
||||
|
||||
class GliderAirSettings : RidingBehaviourSettings {
|
||||
override val key = GliderAirBehaviour.KEY
|
||||
class GliderSettings : RidingBehaviourSettings {
|
||||
override val key = GliderBehaviour.KEY
|
||||
|
||||
var glideSpeed: Expression = "0.1".asExpression()
|
||||
private set
|
||||
+5
-3
@@ -6,7 +6,7 @@
|
||||
* file, You can obtain one at https://mozilla.org/MPL/2.0/.
|
||||
*/
|
||||
|
||||
package com.cobblemon.mod.common.api.riding.behaviour.types
|
||||
package com.cobblemon.mod.common.api.riding.behaviour.types.air
|
||||
|
||||
import com.bedrockk.molang.Expression
|
||||
import com.cobblemon.mod.common.Cobblemon
|
||||
@@ -21,7 +21,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
|
||||
@@ -39,7 +38,10 @@ class HelicopterBehaviour : RidingBehaviour<HelicopterSettings, RidingBehaviourS
|
||||
}
|
||||
|
||||
override val key = KEY
|
||||
override val style = RidingStyle.AIR
|
||||
|
||||
override fun getRidingStyle(settings: HelicopterSettings, state: RidingBehaviourState): RidingStyle {
|
||||
return RidingStyle.AIR
|
||||
}
|
||||
|
||||
val poseProvider = PoseProvider<HelicopterSettings, RidingBehaviourState>(PoseType.HOVER)
|
||||
.with(PoseOption(PoseType.FLY) { _, _, entity -> entity.entityData.get(PokemonEntity.MOVING) })
|
||||
+481
@@ -0,0 +1,481 @@
|
||||
/*
|
||||
* 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.air
|
||||
|
||||
import com.bedrockk.molang.Expression
|
||||
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.RegistryFriendlyByteBuf
|
||||
import net.minecraft.util.Mth
|
||||
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
|
||||
import net.minecraft.world.phys.shapes.Shapes
|
||||
import kotlin.math.*
|
||||
|
||||
class HoverBehaviour : RidingBehaviour<HoverSettings, HoverState> {
|
||||
companion object {
|
||||
val KEY = cobblemonResource("air/hover")
|
||||
}
|
||||
|
||||
override val key = KEY
|
||||
|
||||
override fun getRidingStyle(settings: HoverSettings, state: HoverState): RidingStyle {
|
||||
return RidingStyle.AIR
|
||||
}
|
||||
|
||||
val poseProvider = PoseProvider<HoverSettings, HoverState>(PoseType.STAND)
|
||||
.with(PoseOption(PoseType.WALK) { _, state, _ ->
|
||||
return@PoseOption abs(state.rideVelocity.get().z) > 0.2
|
||||
})
|
||||
|
||||
override fun isActive(
|
||||
settings: HoverSettings,
|
||||
state: HoverState,
|
||||
vehicle: PokemonEntity
|
||||
): Boolean {
|
||||
return Shapes.create(vehicle.boundingBox).blockPositionsAsListRounded().any {
|
||||
//Need to check other fluids
|
||||
if (vehicle.isInWater || vehicle.isUnderWater) {
|
||||
return@any false
|
||||
}
|
||||
//This might not actually work, depending on what the yPos actually is. yPos of the middle of the entity? the feet?
|
||||
if (it.y.toDouble() == (vehicle.position().y)) {
|
||||
val blockState = vehicle.level().getBlockState(it.below())
|
||||
return@any !blockState.isAir && blockState.fluidState.isEmpty
|
||||
}
|
||||
true
|
||||
}
|
||||
}
|
||||
|
||||
override fun pose(
|
||||
settings: HoverSettings,
|
||||
state: HoverState,
|
||||
vehicle: PokemonEntity
|
||||
): PoseType {
|
||||
return this.poseProvider.select(settings, state, vehicle)
|
||||
}
|
||||
|
||||
override fun speed(
|
||||
settings: HoverSettings,
|
||||
state: HoverState,
|
||||
vehicle: PokemonEntity,
|
||||
driver: Player
|
||||
): Float {
|
||||
return state.rideVelocity.get().length().toFloat()
|
||||
}
|
||||
|
||||
override fun updatePassengerRotation(
|
||||
settings: HoverSettings,
|
||||
state: HoverState,
|
||||
vehicle: PokemonEntity,
|
||||
driver: LivingEntity
|
||||
) {
|
||||
|
||||
//Take the inverse so that it cancels out how
|
||||
//much the entity rotates.
|
||||
val turnAmount = calcRotAmount(settings, state, vehicle, driver)
|
||||
|
||||
val topSpeed = vehicle.runtime.resolveDouble(settings.speedExpr)
|
||||
val maxYawDiff = 90.0f
|
||||
|
||||
//Normalize the current rotation diff
|
||||
val rotMod = Mth.wrapDegrees(driver.yRot - vehicle.yRot) / maxYawDiff
|
||||
|
||||
val rotAmount = 10.0f
|
||||
|
||||
//Take the inverse so that you turn more at higher speeds
|
||||
val normSpeed = 1.0f - 0.5f*normalizeVal(state.rideVelocity.get().length(), 0.0, topSpeed).toFloat()
|
||||
|
||||
//driver.yRot += (entity.riding.deltaRotation.y - turnAmount)
|
||||
//driver.setYHeadRot(driver.yHeadRot + (entity.riding.deltaRotation.y) - turnAmount)
|
||||
}
|
||||
|
||||
override fun clampPassengerRotation(
|
||||
settings: HoverSettings,
|
||||
state: HoverState,
|
||||
vehicle: PokemonEntity,
|
||||
driver: LivingEntity
|
||||
) {
|
||||
val f = Mth.wrapDegrees(driver.yRot - vehicle.yRot)
|
||||
val lookYawLimit = 90.0f
|
||||
val g = Mth.clamp(f, -lookYawLimit, lookYawLimit)
|
||||
driver.yRotO += g - f
|
||||
driver.yRot = driver.yRot + g - f
|
||||
driver.setYHeadRot(driver.yRot)
|
||||
}
|
||||
|
||||
|
||||
override fun rotation(
|
||||
settings: HoverSettings,
|
||||
state: HoverState,
|
||||
vehicle: PokemonEntity,
|
||||
driver: LivingEntity
|
||||
): Vec2 {
|
||||
val turnAmount = calcRotAmount(settings, state, vehicle, driver)
|
||||
|
||||
return Vec2(driver.xRot, vehicle.yRot + turnAmount )
|
||||
|
||||
}
|
||||
|
||||
/*
|
||||
* Calculates the rotation amount given the difference between
|
||||
* the current player y rot and entity y rot. This gives the
|
||||
* affect of influencing a rides rotation through the mouse
|
||||
* without it being instant.
|
||||
*/
|
||||
fun calcRotAmount(
|
||||
settings: HoverSettings,
|
||||
state: HoverState,
|
||||
vehicle: PokemonEntity,
|
||||
driver: LivingEntity
|
||||
): Float {
|
||||
val topSpeed = vehicle.runtime.resolveDouble(settings.speedExpr)
|
||||
//In degrees per second
|
||||
val handling = vehicle.runtime.resolveDouble(settings.handlingExpr)
|
||||
val maxYawDiff = 90.0f
|
||||
|
||||
//Normalize the current rotation diff
|
||||
val rotDiff = Mth.wrapDegrees(driver.yRot - vehicle.yRot)
|
||||
val rotDiffNorm = rotDiff / maxYawDiff
|
||||
|
||||
//Take the square root so that the ride levels out quicker when at lower differences between entity
|
||||
//y and driver y
|
||||
//This influences the speed of the turn based on how far in one direction you're looking
|
||||
val rotDiffMod = (sqrt(abs(rotDiffNorm)) * rotDiffNorm.sign)
|
||||
|
||||
//Take the inverse so that you turn less at higher speeds
|
||||
val normSpeed = 1.0f // = 1.0f - 0.5f*normalizeVal(state.rideVelocityocity.length(), 0.0, topSpeed).toFloat()
|
||||
|
||||
// TODO: This needs to be tweaked with in game results and testing
|
||||
val turnRate = (handling.toFloat() / 20.0f) * 2
|
||||
|
||||
//Ensure you only ever rotate as much difference as there is between the angles.
|
||||
val turnSpeed = turnRate * rotDiffMod * normSpeed
|
||||
val rotAmount = turnSpeed.coerceIn(-abs(rotDiff), abs(rotDiff))
|
||||
|
||||
return rotAmount
|
||||
}
|
||||
|
||||
|
||||
override fun velocity(
|
||||
settings: HoverSettings,
|
||||
state: HoverState,
|
||||
vehicle: PokemonEntity,
|
||||
driver: Player,
|
||||
input: Vec3
|
||||
): Vec3 {
|
||||
|
||||
val strafeFactor = 0.2
|
||||
val f = driver.xxa * strafeFactor
|
||||
var g = driver.zza
|
||||
if (g <= 0.0f) {
|
||||
g *= -1.0f
|
||||
}
|
||||
|
||||
return calculateRideSpaceVel(settings, state, vehicle, driver).scale(10.0)
|
||||
}
|
||||
|
||||
private fun calculateRideSpaceVel(
|
||||
settings: HoverSettings,
|
||||
state: HoverState,
|
||||
vehicle: PokemonEntity,
|
||||
driver: Player
|
||||
): Vec3 {
|
||||
val topSpeed = vehicle.runtime.resolveDouble(settings.speedExpr)
|
||||
val accel = vehicle.runtime.resolveDouble(settings.accelerationExpr)
|
||||
val speed = state.rideVelocity.get().length()
|
||||
|
||||
//Flag for determining if player is actively inputting
|
||||
var activeInput = false
|
||||
|
||||
val minSpeed = 0.0
|
||||
|
||||
var newVelocity = Vec3(state.rideVelocity.get().x, state.rideVelocity.get().y, state.rideVelocity.get().z)
|
||||
|
||||
var jumpVec = Vec3.ZERO
|
||||
|
||||
|
||||
//speed up and slow down based on input
|
||||
if (driver.zza != 0.0f && state.stamina.get() > 0.0) {
|
||||
//make sure it can't exceed top speed
|
||||
val forwardInput = when {
|
||||
driver.zza > 0 && newVelocity.z > topSpeed -> 0.0
|
||||
driver.zza < 0 && newVelocity.z < (-topSpeed / 3.0) -> 0.0
|
||||
else -> driver.zza.sign
|
||||
}
|
||||
|
||||
newVelocity = Vec3(
|
||||
newVelocity.x,
|
||||
newVelocity.y,
|
||||
(newVelocity.z + (accel * forwardInput.toDouble())))
|
||||
|
||||
activeInput = true
|
||||
jumpVec = jumpVec.add(0.0, 0.0, forwardInput.toDouble())
|
||||
}
|
||||
|
||||
//speed up and slow down based on input
|
||||
if (driver.xxa != 0.0f && state.stamina.get() > 0.0) {
|
||||
//make sure it can't exceed top speed
|
||||
val forwardInput = when {
|
||||
driver.xxa > 0 && newVelocity.x > topSpeed -> 0.0
|
||||
driver.xxa < 0 && newVelocity.x < (-topSpeed / 3.0) -> 0.0
|
||||
else -> driver.xxa.sign
|
||||
}
|
||||
|
||||
newVelocity = Vec3(
|
||||
newVelocity.x + (accel * forwardInput.toDouble()),
|
||||
newVelocity.y,
|
||||
(newVelocity.z ))
|
||||
|
||||
activeInput = true
|
||||
}
|
||||
|
||||
//Vertical movement based on driver input.
|
||||
val vertTopSpeed = topSpeed / 2.0
|
||||
val vertInput = when {
|
||||
driver.jumping -> 1.0
|
||||
driver.isShiftKeyDown -> -1.0
|
||||
else -> 0.0
|
||||
}
|
||||
|
||||
if (vertInput != 0.0 && state.stamina.get() > 0.0) {
|
||||
newVelocity = Vec3(
|
||||
newVelocity.x,
|
||||
(newVelocity.y + (accel * vertInput)).coerceIn(-vertTopSpeed, vertTopSpeed),
|
||||
newVelocity.z)
|
||||
activeInput = true
|
||||
}
|
||||
|
||||
|
||||
//air Friction
|
||||
|
||||
|
||||
|
||||
return newVelocity
|
||||
}
|
||||
|
||||
/*
|
||||
* Normalizes the current speed between minSpeed and maxSpeed.
|
||||
* The result is clamped between 0.0 and 1.0, where 0.0 represents minSpeed and 1.0 represents maxSpeed.
|
||||
*/
|
||||
private fun normalizeVal(currSpeed: Double, minSpeed: Double, maxSpeed: Double): Double {
|
||||
require(maxSpeed > minSpeed) { "maxSpeed must be greater than minSpeed" }
|
||||
return ((currSpeed - minSpeed) / (maxSpeed - minSpeed)).coerceIn(0.0, 1.0)
|
||||
}
|
||||
|
||||
override fun angRollVel(
|
||||
settings: HoverSettings,
|
||||
state: HoverState,
|
||||
vehicle: PokemonEntity,
|
||||
driver: Player,
|
||||
deltaTime: Double
|
||||
): Vec3 {
|
||||
return Vec3.ZERO
|
||||
}
|
||||
|
||||
override fun rotationOnMouseXY(
|
||||
settings: HoverSettings,
|
||||
state: HoverState,
|
||||
vehicle: PokemonEntity,
|
||||
driver: Player,
|
||||
mouseY: Double,
|
||||
mouseX: Double,
|
||||
mouseYSmoother: SmoothDouble,
|
||||
mouseXSmoother: SmoothDouble,
|
||||
sensitivity: Double,
|
||||
deltaTime: Double
|
||||
): Vec3 {
|
||||
//Smooth out mouse input.
|
||||
val smoothingSpeed = 4
|
||||
val xInput = mouseXSmoother.getNewDeltaValue(mouseX * 0.1, deltaTime * smoothingSpeed);
|
||||
val yInput = mouseYSmoother.getNewDeltaValue(mouseY * 0.1, deltaTime * smoothingSpeed);
|
||||
|
||||
//yaw, pitch, roll
|
||||
return Vec3(0.0, yInput, xInput)
|
||||
}
|
||||
|
||||
override fun canJump(
|
||||
settings: HoverSettings,
|
||||
state: HoverState,
|
||||
vehicle: PokemonEntity,
|
||||
driver: Player
|
||||
): Boolean {
|
||||
return false
|
||||
}
|
||||
|
||||
override fun setRideBar(
|
||||
settings: HoverSettings,
|
||||
state: HoverState,
|
||||
vehicle: PokemonEntity,
|
||||
driver: Player
|
||||
): Float {
|
||||
//Retrieve stamina from state and use it to set the "stamina bar"
|
||||
return (state.stamina.get() / 1.0f)
|
||||
}
|
||||
|
||||
override fun jumpForce(
|
||||
settings: HoverSettings,
|
||||
state: HoverState,
|
||||
vehicle: PokemonEntity,
|
||||
driver: Player,
|
||||
jumpStrength: Int
|
||||
): Vec3 {
|
||||
return Vec3.ZERO
|
||||
}
|
||||
|
||||
override fun gravity(
|
||||
settings: HoverSettings,
|
||||
state: HoverState,
|
||||
vehicle: PokemonEntity,
|
||||
regularGravity: Double
|
||||
): Double {
|
||||
return 0.0
|
||||
}
|
||||
|
||||
override fun rideFovMultiplier(
|
||||
settings: HoverSettings,
|
||||
state: HoverState,
|
||||
vehicle: PokemonEntity,
|
||||
driver: Player
|
||||
): Float {
|
||||
return 1.0f
|
||||
}
|
||||
|
||||
override fun useAngVelSmoothing(
|
||||
settings: HoverSettings,
|
||||
state: HoverState,
|
||||
vehicle: PokemonEntity
|
||||
): Boolean {
|
||||
return false
|
||||
}
|
||||
|
||||
override fun useRidingAltPose(
|
||||
settings: HoverSettings,
|
||||
state: HoverState,
|
||||
vehicle: PokemonEntity,
|
||||
driver: Player
|
||||
): Boolean {
|
||||
return false
|
||||
}
|
||||
|
||||
override fun inertia(
|
||||
settings: HoverSettings,
|
||||
state: HoverState,
|
||||
vehicle: PokemonEntity
|
||||
): Double {
|
||||
return 0.05
|
||||
}
|
||||
|
||||
override fun shouldRoll(
|
||||
settings: HoverSettings,
|
||||
state: HoverState,
|
||||
vehicle: PokemonEntity
|
||||
): Boolean {
|
||||
return false
|
||||
}
|
||||
|
||||
override fun turnOffOnGround(
|
||||
settings: HoverSettings,
|
||||
state: HoverState,
|
||||
vehicle: PokemonEntity
|
||||
): Boolean {
|
||||
return false
|
||||
}
|
||||
|
||||
override fun dismountOnShift(
|
||||
settings: HoverSettings,
|
||||
state: HoverState,
|
||||
vehicle: PokemonEntity
|
||||
): Boolean {
|
||||
return false
|
||||
}
|
||||
|
||||
override fun shouldRotatePokemonHead(
|
||||
settings: HoverSettings,
|
||||
state: HoverState,
|
||||
vehicle: PokemonEntity
|
||||
): Boolean {
|
||||
return false
|
||||
}
|
||||
|
||||
override fun shouldRotatePlayerHead(
|
||||
settings: HoverSettings,
|
||||
state: HoverState,
|
||||
vehicle: PokemonEntity
|
||||
): Boolean {
|
||||
return false
|
||||
}
|
||||
|
||||
override fun createDefaultState(settings: HoverSettings) = HoverState()
|
||||
}
|
||||
|
||||
class HoverSettings : RidingBehaviourSettings {
|
||||
override val key = HoverBehaviour.KEY
|
||||
|
||||
var canJump = "true".asExpression()
|
||||
private set
|
||||
|
||||
var speedExpr: Expression = "q.get_ride_stats('SPEED', 'AIR', 1.0, 0.3)".asExpression()
|
||||
private set
|
||||
|
||||
// Max accel is a whole 1.0 in 1 second. The conversion in the function below is to convert seconds to ticks
|
||||
var accelerationExpr: Expression =
|
||||
"q.get_ride_stats('ACCELERATION', 'AIR', (1.0 / (20.0 * 0.5)), (1.0 / (20.0 * 5.0)))".asExpression()
|
||||
private set
|
||||
|
||||
// Between 30 seconds and 10 seconds at the lowest when at full speed.
|
||||
var staminaExpr: Expression = "q.get_ride_stats('STAMINA', 'AIR', 30.0, 10.0)".asExpression()
|
||||
private set
|
||||
|
||||
//Between a one block jump and a ten block jump
|
||||
var jumpExpr: Expression = "q.get_ride_stats('JUMP', 'AIR', 10.0, 1.0)".asExpression()
|
||||
private set
|
||||
|
||||
var handlingExpr: Expression = "q.get_ride_stats('SKILL', 'AIR', 140.0, 20.0)".asExpression()
|
||||
private set
|
||||
|
||||
override fun encode(buffer: RegistryFriendlyByteBuf) {
|
||||
buffer.writeResourceLocation(key)
|
||||
buffer.writeExpression(speedExpr)
|
||||
buffer.writeExpression(accelerationExpr)
|
||||
buffer.writeExpression(staminaExpr)
|
||||
buffer.writeExpression(jumpExpr)
|
||||
buffer.writeExpression(handlingExpr)
|
||||
}
|
||||
|
||||
override fun decode(buffer: RegistryFriendlyByteBuf) {
|
||||
speedExpr = buffer.readExpression()
|
||||
accelerationExpr = buffer.readExpression()
|
||||
staminaExpr = buffer.readExpression()
|
||||
jumpExpr = buffer.readExpression()
|
||||
handlingExpr = buffer.readExpression()
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
class HoverState : RidingBehaviourState() {
|
||||
|
||||
override fun copy() = HoverState().also {
|
||||
it.rideVelocity.set(this.rideVelocity.get(), forced = true)
|
||||
it.stamina.set(this.stamina.get(), forced = true)
|
||||
}
|
||||
|
||||
override fun shouldSync(previous: RidingBehaviourState): Boolean {
|
||||
if (previous !is HoverState) return false
|
||||
return super.shouldSync(previous)
|
||||
}
|
||||
}
|
||||
+96
-74
@@ -6,7 +6,7 @@
|
||||
* file, You can obtain one at https://mozilla.org/MPL/2.0/.
|
||||
*/
|
||||
|
||||
package com.cobblemon.mod.common.api.riding.behaviour.types
|
||||
package com.cobblemon.mod.common.api.riding.behaviour.types.air
|
||||
|
||||
import com.bedrockk.molang.Expression
|
||||
import com.cobblemon.mod.common.Cobblemon
|
||||
@@ -20,34 +20,48 @@ 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
|
||||
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
|
||||
import net.minecraft.world.phys.shapes.Shapes
|
||||
import kotlin.math.*
|
||||
|
||||
class JetAirBehaviour : RidingBehaviour<JetAirSettings, JetAirState> {
|
||||
class JetBehaviour : RidingBehaviour<JetSettings, JetState> {
|
||||
companion object {
|
||||
val KEY = cobblemonResource("air/jet")
|
||||
}
|
||||
|
||||
override val key = KEY
|
||||
override val style = RidingStyle.AIR
|
||||
|
||||
val poseProvider = PoseProvider<JetAirSettings, JetAirState>(PoseType.HOVER)
|
||||
.with(PoseOption(PoseType.FLY) { _, state, _ -> state.rideVelocity.get().z > 0.1 })
|
||||
|
||||
override fun isActive(settings: JetAirSettings, state: JetAirState, vehicle: PokemonEntity): Boolean {
|
||||
return true
|
||||
override fun getRidingStyle(settings: JetSettings, state: JetState): RidingStyle {
|
||||
return RidingStyle.AIR
|
||||
}
|
||||
|
||||
override fun pose(settings: JetAirSettings, state: JetAirState, vehicle: PokemonEntity): PoseType {
|
||||
val poseProvider = PoseProvider<JetSettings, JetState>(PoseType.HOVER)
|
||||
.with(PoseOption(PoseType.FLY) { _, state, _ -> state.rideVelocity.get().z > 0.1 })
|
||||
|
||||
override fun isActive(settings: JetSettings, state: JetState, vehicle: PokemonEntity): Boolean {
|
||||
return Shapes.create(vehicle.boundingBox).blockPositionsAsListRounded().any {
|
||||
//Need to check other fluids
|
||||
if (vehicle.isInWater || vehicle.isUnderWater) {
|
||||
return@any false
|
||||
}
|
||||
//This might not actually work, depending on what the yPos actually is. yPos of the middle of the entity? the feet?
|
||||
if (it.y.toDouble() == (vehicle.position().y)) {
|
||||
val blockState = vehicle.level().getBlockState(it.below())
|
||||
return@any !(!blockState.isAir && blockState.fluidState.isEmpty)
|
||||
}
|
||||
true
|
||||
}
|
||||
}
|
||||
|
||||
override fun pose(settings: JetSettings, state: JetState, vehicle: PokemonEntity): PoseType {
|
||||
return poseProvider.select(settings, state, vehicle)
|
||||
}
|
||||
|
||||
override fun speed(settings: JetAirSettings, state: JetAirState, vehicle: PokemonEntity, driver: Player): Float {
|
||||
override fun speed(settings: JetSettings, state: JetState, vehicle: PokemonEntity, driver: Player): Float {
|
||||
//retrieve stats
|
||||
val topSpeed = vehicle.runtime.resolveDouble(settings.speedExpr)
|
||||
val staminaStat = vehicle.runtime.resolveDouble(settings.staminaExpr)
|
||||
@@ -55,22 +69,24 @@ class JetAirBehaviour : RidingBehaviour<JetAirSettings, JetAirState> {
|
||||
//retrieve minSpeed
|
||||
val minSpeed = vehicle.runtime.resolveDouble(settings.minSpeed)
|
||||
|
||||
//Reduce stamina unless stamina is infinite
|
||||
if (!vehicle.runtime.resolveBoolean(settings.infiniteStamina)) {
|
||||
//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.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))
|
||||
|
||||
//Calculate stamina loss in seconds achievable at top speed
|
||||
val staminaLoss = staminaRate * (1.0 / (20.0 * staminaStat))
|
||||
state.stamina.set(max(state.stamina.get() - staminaLoss, 0.0).toFloat())
|
||||
} else {
|
||||
state.stamina.set(1.0f)
|
||||
}
|
||||
//TODO: Reintroduce stamina drain once stats start to be polished and tweaked
|
||||
state.stamina.set(1.0f)
|
||||
// //Reduce stamina unless stamina is infinite
|
||||
// if (!vehicle.runtime.resolveBoolean(settings.infiniteStamina)) {
|
||||
// //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.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))
|
||||
//
|
||||
// //Calculate stamina loss in seconds achievable at top speed
|
||||
// val staminaLoss = staminaRate * (1.0 / (20.0 * staminaStat))
|
||||
// state.stamina.set(max(state.stamina.get() - staminaLoss, 0.0).toFloat())
|
||||
// } else {
|
||||
// state.stamina.set(1.0f)
|
||||
// }
|
||||
|
||||
return state.rideVelocity.get().length().toFloat()
|
||||
}
|
||||
@@ -86,8 +102,8 @@ class JetAirBehaviour : RidingBehaviour<JetAirSettings, JetAirState> {
|
||||
}
|
||||
|
||||
override fun rotation(
|
||||
settings: JetAirSettings,
|
||||
state: JetAirState,
|
||||
settings: JetSettings,
|
||||
state: JetState,
|
||||
vehicle: PokemonEntity,
|
||||
driver: LivingEntity
|
||||
): Vec2 {
|
||||
@@ -95,8 +111,8 @@ class JetAirBehaviour : RidingBehaviour<JetAirSettings, JetAirState> {
|
||||
}
|
||||
|
||||
override fun velocity(
|
||||
settings: JetAirSettings,
|
||||
state: JetAirState,
|
||||
settings: JetSettings,
|
||||
state: JetState,
|
||||
vehicle: PokemonEntity,
|
||||
driver: Player,
|
||||
input: Vec3
|
||||
@@ -135,8 +151,8 @@ class JetAirBehaviour : RidingBehaviour<JetAirSettings, JetAirState> {
|
||||
* Calculates the change in the ride space vector due to player input and ride state
|
||||
*/
|
||||
private fun calculateRideSpaceVel(
|
||||
settings: JetAirSettings,
|
||||
state: JetAirState,
|
||||
settings: JetSettings,
|
||||
state: JetState,
|
||||
vehicle: PokemonEntity,
|
||||
driver: Player
|
||||
) {
|
||||
@@ -160,7 +176,7 @@ class JetAirBehaviour : RidingBehaviour<JetAirSettings, JetAirState> {
|
||||
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)
|
||||
val deccelMod = max((normalizeSpeed(speed, minSpeed, topSpeed) - 1).pow(2) * 8, 0.1)
|
||||
|
||||
//Decelerate currently always a constant half of max acceleration.
|
||||
state.rideVelocity.set(Vec3(state.rideVelocity.get().x, state.rideVelocity.get().y, max(state.rideVelocity.get().z - ((accel * deccelMod) / 2), minSpeed)))
|
||||
@@ -168,8 +184,8 @@ class JetAirBehaviour : RidingBehaviour<JetAirSettings, JetAirState> {
|
||||
}
|
||||
|
||||
override fun angRollVel(
|
||||
settings: JetAirSettings,
|
||||
state: JetAirState,
|
||||
settings: JetSettings,
|
||||
state: JetState,
|
||||
vehicle: PokemonEntity,
|
||||
driver: Player,
|
||||
deltaTime: Double
|
||||
@@ -193,8 +209,8 @@ class JetAirBehaviour : RidingBehaviour<JetAirSettings, JetAirState> {
|
||||
}
|
||||
|
||||
override fun rotationOnMouseXY(
|
||||
settings: JetAirSettings,
|
||||
state: JetAirState,
|
||||
settings: JetSettings,
|
||||
state: JetState,
|
||||
vehicle: PokemonEntity,
|
||||
driver: Player,
|
||||
mouseY: Double,
|
||||
@@ -212,8 +228,13 @@ class JetAirBehaviour : RidingBehaviour<JetAirSettings, JetAirState> {
|
||||
val invertRoll = if (Cobblemon.config.invertRoll) -1 else 1
|
||||
val invertPitch = if (Cobblemon.config.invertPitch) -1 else 1
|
||||
|
||||
// Accumulate the mouse input
|
||||
state.currMouseXForce.set((state.currMouseXForce.get() + (0.0015 * mouseX * invertRoll)).coerceIn(-1.0, 1.0))
|
||||
// Smooth out and accumulate roll input
|
||||
val smoothingSpeed = 4.0
|
||||
val mouseXc = (mouseX).coerceIn(-60.0, 60.0)
|
||||
val xInput = mouseXSmoother.getNewDeltaValue(mouseXc * 0.1 * invertRoll, deltaTime * smoothingSpeed);
|
||||
|
||||
// Accumulate the y mouse input for pitch
|
||||
//state.currMouseXForce.set((state.currMouseXForce.get() + (0.0015 * mouseX * invertRoll)).coerceIn(-1.0, 1.0))
|
||||
state.currMouseYForce.set((state.currMouseYForce.get() + (0.0015 * mouseY * invertPitch)).coerceIn(-1.0, 1.0))
|
||||
|
||||
//Get handling in degrees per second
|
||||
@@ -235,15 +256,16 @@ class JetAirBehaviour : RidingBehaviour<JetAirSettings, JetAirState> {
|
||||
val pitchRot = handling * state.currMouseYForce.get()
|
||||
|
||||
//Roll is 1.5 times as fast as pitch
|
||||
val rollRot = handling * 1.5 * state.currMouseXForce.get()
|
||||
|
||||
//val rollRot = handling * 1.5 * state.currMouseXForce.get()
|
||||
val rollRot = handling * 1.5 * xInput.coerceIn(-1.0,1.0)
|
||||
//yaw, pitch, roll
|
||||
return Vec3(0.0, pitchRot, rollRot)
|
||||
}
|
||||
|
||||
override fun canJump(
|
||||
settings: JetAirSettings,
|
||||
state: JetAirState,
|
||||
settings: JetSettings,
|
||||
state: JetState,
|
||||
vehicle: PokemonEntity,
|
||||
driver: Player
|
||||
): Boolean {
|
||||
@@ -251,8 +273,8 @@ class JetAirBehaviour : RidingBehaviour<JetAirSettings, JetAirState> {
|
||||
}
|
||||
|
||||
override fun setRideBar(
|
||||
settings: JetAirSettings,
|
||||
state: JetAirState,
|
||||
settings: JetSettings,
|
||||
state: JetState,
|
||||
vehicle: PokemonEntity,
|
||||
driver: Player
|
||||
): Float {
|
||||
@@ -260,8 +282,8 @@ class JetAirBehaviour : RidingBehaviour<JetAirSettings, JetAirState> {
|
||||
}
|
||||
|
||||
override fun jumpForce(
|
||||
settings: JetAirSettings,
|
||||
state: JetAirState,
|
||||
settings: JetSettings,
|
||||
state: JetState,
|
||||
vehicle: PokemonEntity,
|
||||
driver: Player,
|
||||
jumpStrength: Int
|
||||
@@ -270,8 +292,8 @@ class JetAirBehaviour : RidingBehaviour<JetAirSettings, JetAirState> {
|
||||
}
|
||||
|
||||
override fun gravity(
|
||||
settings: JetAirSettings,
|
||||
state: JetAirState,
|
||||
settings: JetSettings,
|
||||
state: JetState,
|
||||
vehicle: PokemonEntity,
|
||||
regularGravity: Double
|
||||
): Double {
|
||||
@@ -279,8 +301,8 @@ class JetAirBehaviour : RidingBehaviour<JetAirSettings, JetAirState> {
|
||||
}
|
||||
|
||||
override fun rideFovMultiplier(
|
||||
settings: JetAirSettings,
|
||||
state: JetAirState,
|
||||
settings: JetSettings,
|
||||
state: JetState,
|
||||
vehicle: PokemonEntity,
|
||||
driver: Player
|
||||
): Float {
|
||||
@@ -295,60 +317,60 @@ class JetAirBehaviour : RidingBehaviour<JetAirSettings, JetAirState> {
|
||||
return 1.0f + normalizedSpeed.pow(2).toFloat() * 0.2f
|
||||
}
|
||||
|
||||
override fun useAngVelSmoothing(settings: JetAirSettings, state: JetAirState, vehicle: PokemonEntity): Boolean {
|
||||
override fun useAngVelSmoothing(settings: JetSettings, state: JetState, vehicle: PokemonEntity): Boolean {
|
||||
return true
|
||||
}
|
||||
|
||||
override fun useRidingAltPose(
|
||||
settings: JetAirSettings,
|
||||
state: JetAirState,
|
||||
settings: JetSettings,
|
||||
state: JetState,
|
||||
vehicle: PokemonEntity,
|
||||
driver: Player
|
||||
): Boolean {
|
||||
return false
|
||||
}
|
||||
|
||||
override fun inertia(settings: JetAirSettings, state: JetAirState, vehicle: PokemonEntity): Double {
|
||||
override fun inertia(settings: JetSettings, state: JetState, vehicle: PokemonEntity): Double {
|
||||
return 0.5
|
||||
}
|
||||
|
||||
override fun shouldRoll(settings: JetAirSettings, state: JetAirState, vehicle: PokemonEntity): Boolean {
|
||||
override fun shouldRoll(settings: JetSettings, state: JetState, vehicle: PokemonEntity): Boolean {
|
||||
return true
|
||||
}
|
||||
|
||||
override fun turnOffOnGround(settings: JetAirSettings, state: JetAirState, vehicle: PokemonEntity): Boolean {
|
||||
override fun turnOffOnGround(settings: JetSettings, state: JetState, vehicle: PokemonEntity): Boolean {
|
||||
return false
|
||||
}
|
||||
|
||||
override fun dismountOnShift(settings: JetAirSettings, state: JetAirState, vehicle: PokemonEntity): Boolean {
|
||||
override fun dismountOnShift(settings: JetSettings, state: JetState, vehicle: PokemonEntity): Boolean {
|
||||
return false
|
||||
}
|
||||
|
||||
override fun shouldRotatePokemonHead(
|
||||
settings: JetAirSettings,
|
||||
state: JetAirState,
|
||||
settings: JetSettings,
|
||||
state: JetState,
|
||||
vehicle: PokemonEntity
|
||||
): Boolean {
|
||||
return false
|
||||
}
|
||||
|
||||
override fun shouldRotatePlayerHead(settings: JetAirSettings, state: JetAirState, vehicle: PokemonEntity): Boolean {
|
||||
override fun shouldRotatePlayerHead(settings: JetSettings, state: JetState, vehicle: PokemonEntity): Boolean {
|
||||
return false
|
||||
}
|
||||
|
||||
override fun createDefaultState(settings: JetAirSettings) = JetAirState()
|
||||
override fun createDefaultState(settings: JetSettings) = JetState()
|
||||
}
|
||||
|
||||
class JetAirSettings : RidingBehaviourSettings {
|
||||
override val key = JetAirBehaviour.KEY
|
||||
class JetSettings : RidingBehaviourSettings {
|
||||
override val key = JetBehaviour.KEY
|
||||
|
||||
var gravity: Expression = "0".asExpression()
|
||||
private set
|
||||
|
||||
var minSpeed: Expression = "1.2".asExpression()
|
||||
var minSpeed: Expression = "0.8".asExpression()
|
||||
private set
|
||||
|
||||
var handlingYawExpr: Expression = "q.get_ride_stats('SKILL', 'AIR', 25.0, 8.0)".asExpression()
|
||||
var handlingYawExpr: Expression = "q.get_ride_stats('SKILL', 'AIR', 50.0, 25.0)".asExpression()
|
||||
private set
|
||||
|
||||
// Make configurable by json
|
||||
@@ -362,7 +384,7 @@ class JetAirSettings : RidingBehaviourSettings {
|
||||
private set
|
||||
var handlingExpr: Expression = "q.get_ride_stats('SKILL', 'AIR', 140.0, 20.0)".asExpression()
|
||||
private set
|
||||
var speedExpr: Expression = "q.get_ride_stats('SPEED', 'AIR', 2.5, 1.0)".asExpression()
|
||||
var speedExpr: Expression = "q.get_ride_stats('SPEED', 'AIR', 1.8, 1.0)".asExpression()
|
||||
private set
|
||||
var accelerationExpr: Expression = "q.get_ride_stats('ACCELERATION', 'AIR', (1.0 / (20.0 * 1.0)), (1.0 / (20.0 * 5.0)))".asExpression()
|
||||
private set
|
||||
@@ -397,10 +419,10 @@ class JetAirSettings : RidingBehaviourSettings {
|
||||
}
|
||||
}
|
||||
|
||||
class JetAirState : RidingBehaviourState() {
|
||||
class JetState : RidingBehaviourState() {
|
||||
var currSpeed = ridingState(0.0, Side.CLIENT)
|
||||
var currMouseXForce = ridingState(0.0, Side.BOTH)
|
||||
var currMouseYForce = ridingState(0.0, Side.BOTH)
|
||||
var currMouseXForce = ridingState(0.0, Side.CLIENT)
|
||||
var currMouseYForce = ridingState(0.0, Side.CLIENT)
|
||||
|
||||
override fun encode(buffer: FriendlyByteBuf) {
|
||||
super.encode(buffer)
|
||||
@@ -420,16 +442,16 @@ class JetAirState : RidingBehaviourState() {
|
||||
currMouseYForce.set(0.0, forced = true)
|
||||
}
|
||||
|
||||
override fun copy() = JetAirState().also {
|
||||
override fun copy() = JetState().also {
|
||||
it.currSpeed.set(currSpeed.get(), forced = true)
|
||||
it.stamina.set(stamina.get(), forced = true)
|
||||
it.rideVelocity.set(rideVelocity.get(), forced = true)
|
||||
it.currMouseXForce.set(currMouseXForce.get(), forced = true)
|
||||
it.currMouseYForce.set(currMouseYForce.get(), forced = true)
|
||||
// it.currMouseXForce.set(currMouseXForce.get(), forced = true)
|
||||
// it.currMouseYForce.set(currMouseYForce.get(), forced = true)
|
||||
}
|
||||
|
||||
override fun shouldSync(previous: RidingBehaviourState): Boolean {
|
||||
if (previous !is JetAirState) return false
|
||||
if (previous !is JetState) return false
|
||||
if (previous.currSpeed != currSpeed) return true
|
||||
return super.shouldSync(previous)
|
||||
}
|
||||
+26
-12
@@ -30,8 +30,14 @@ class CompositeBehaviour : RidingBehaviour<CompositeSettings, CompositeState> {
|
||||
}
|
||||
|
||||
override val key = KEY
|
||||
override val style = RidingStyle.COMPOSITE
|
||||
|
||||
override fun getRidingStyle(settings: CompositeSettings, state: CompositeState): RidingStyle {
|
||||
return chooseBehaviour(settings, state) {
|
||||
behaviour, behaviourSettings, behaviourState ->
|
||||
behaviour.getRidingStyle(behaviourSettings, behaviourState)
|
||||
}
|
||||
}
|
||||
|
||||
override fun createDefaultState(settings: CompositeSettings): CompositeState {
|
||||
val defaultBehaviour = RidingBehaviours.get(settings.defaultBehaviour.key)
|
||||
val defaultState = defaultBehaviour.createDefaultState(settings.defaultBehaviour)
|
||||
@@ -51,7 +57,7 @@ class CompositeBehaviour : RidingBehaviour<CompositeSettings, CompositeState> {
|
||||
): T {
|
||||
val defaultBehaviour = RidingBehaviours.get(settings.defaultBehaviour.key)
|
||||
val alternativeBehaviour = RidingBehaviours.get(settings.alternateBehaviour.key)
|
||||
return when (state.activeController.get()) {
|
||||
return when (state.activeBehaviour.get()) {
|
||||
settings.defaultBehaviour.key -> action(
|
||||
defaultBehaviour,
|
||||
settings.defaultBehaviour,
|
||||
@@ -63,7 +69,7 @@ class CompositeBehaviour : RidingBehaviour<CompositeSettings, CompositeState> {
|
||||
state.alternateBehaviourState
|
||||
)
|
||||
|
||||
else -> error("Invalid controller: ${state.activeController.get()}")
|
||||
else -> error("Invalid controller: ${state.activeBehaviour.get()}")
|
||||
}
|
||||
}
|
||||
|
||||
@@ -364,35 +370,37 @@ open class CompositeSettings : RidingBehaviourSettings {
|
||||
}
|
||||
|
||||
class CompositeState(
|
||||
private val defaultBehaviour: ResourceLocation,
|
||||
val defaultBehaviour: ResourceLocation,
|
||||
val defaultBehaviourState: RidingBehaviourState,
|
||||
val alternateBehaviourState: RidingBehaviourState
|
||||
) : RidingBehaviourState() {
|
||||
var activeController = ridingState(defaultBehaviour, Side.CLIENT)
|
||||
var activeBehaviour = ridingState(defaultBehaviour, Side.CLIENT)
|
||||
var lastTransition = ridingState(-100L, Side.BOTH)
|
||||
|
||||
override val rideVelocity: SidedRidingState<Vec3>
|
||||
get() = when (activeController.get()) {
|
||||
get() = when (activeBehaviour.get()) {
|
||||
defaultBehaviour -> defaultBehaviourState.rideVelocity
|
||||
else -> alternateBehaviourState.rideVelocity
|
||||
}
|
||||
|
||||
override val stamina: SidedRidingState<Float>
|
||||
get() = when (activeController.get()) {
|
||||
get() = when (activeBehaviour.get()) {
|
||||
defaultBehaviour -> defaultBehaviourState.stamina
|
||||
else -> alternateBehaviourState.stamina
|
||||
}
|
||||
|
||||
override fun reset() {
|
||||
super.reset()
|
||||
activeController.set(defaultBehaviour, forced = true)
|
||||
activeBehaviour.set(defaultBehaviour, forced = true)
|
||||
lastTransition.set(-100L, forced = true)
|
||||
defaultBehaviourState.reset()
|
||||
alternateBehaviourState.reset()
|
||||
}
|
||||
|
||||
override fun copy(): CompositeState {
|
||||
val state =
|
||||
CompositeState(defaultBehaviour, defaultBehaviourState.copy(), alternateBehaviourState.copy())
|
||||
state.activeController.set(activeController.get(), forced = true)
|
||||
state.activeBehaviour.set(activeBehaviour.get(), forced = true)
|
||||
state.lastTransition.set(lastTransition.get(), forced = true)
|
||||
state.rideVelocity.set(rideVelocity.get(), forced = true)
|
||||
state.stamina.set(stamina.get(), forced = true)
|
||||
@@ -401,18 +409,24 @@ class CompositeState(
|
||||
|
||||
override fun shouldSync(previous: RidingBehaviourState): Boolean {
|
||||
if (previous !is CompositeState) return false
|
||||
if (previous.activeController.get() != activeController.get()) return true
|
||||
if (previous.activeBehaviour.get() != activeBehaviour.get()) return true
|
||||
if (defaultBehaviourState.shouldSync(previous.defaultBehaviourState)) return true
|
||||
if (alternateBehaviourState.shouldSync(previous.alternateBehaviourState)) return true
|
||||
return super.shouldSync(previous)
|
||||
}
|
||||
|
||||
override fun encode(buffer: FriendlyByteBuf) {
|
||||
super.encode(buffer)
|
||||
buffer.writeResourceLocation(activeController.get())
|
||||
buffer.writeResourceLocation(activeBehaviour.get())
|
||||
defaultBehaviourState.encode(buffer)
|
||||
alternateBehaviourState.encode(buffer)
|
||||
}
|
||||
|
||||
override fun decode(buffer: FriendlyByteBuf) {
|
||||
super.decode(buffer)
|
||||
activeController.set(buffer.readResourceLocation(), forced = true)
|
||||
activeBehaviour.set(buffer.readResourceLocation(), forced = true)
|
||||
defaultBehaviourState.decode(buffer)
|
||||
alternateBehaviourState.decode(buffer)
|
||||
}
|
||||
|
||||
}
|
||||
+3
-2
@@ -43,10 +43,11 @@ interface CompositeRidingStrategy<T : CompositeSettings> {
|
||||
) {
|
||||
toState.stamina.set(fromState.stamina.get())
|
||||
toState.rideVelocity.set(fromState.rideVelocity.get())
|
||||
state.activeController.set(toSettings.key)
|
||||
fromState.reset()
|
||||
state.activeBehaviour.set(toSettings.key)
|
||||
state.lastTransition.set(vehicle.level().gameTime)
|
||||
val behaviour = RidingBehaviours.get(toSettings.key)
|
||||
vehicle.setBehaviourFlag(PokemonBehaviourFlag.FLYING, behaviour.style == RidingStyle.AIR)
|
||||
vehicle.setBehaviourFlag(PokemonBehaviourFlag.FLYING, behaviour.getRidingStyle(toSettings, toState) == RidingStyle.AIR)
|
||||
}
|
||||
|
||||
}
|
||||
+2
-4
@@ -9,13 +9,11 @@
|
||||
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
|
||||
@@ -47,7 +45,7 @@ object FallStrategy : CompositeRidingStrategy<FallCompositeSettings> {
|
||||
defaultSettings: RidingBehaviourSettings,
|
||||
vehicle: PokemonEntity
|
||||
): Boolean {
|
||||
if (state.activeController.get() == defaultSettings.key) return false
|
||||
if (state.activeBehaviour.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)
|
||||
@@ -61,7 +59,7 @@ object FallStrategy : CompositeRidingStrategy<FallCompositeSettings> {
|
||||
vehicle: PokemonEntity,
|
||||
driver: Player
|
||||
): Boolean {
|
||||
if (state.activeController.get() == alternateSettings.key) return false
|
||||
if (state.activeBehaviour.get() == alternateSettings.key) return false
|
||||
if (!driver.jumping) return false
|
||||
if (state.lastTransition.get() + 20 >= vehicle.level().gameTime) return false
|
||||
|
||||
|
||||
+2
-4
@@ -8,13 +8,11 @@
|
||||
|
||||
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
|
||||
@@ -45,7 +43,7 @@ object JumpStrategy : CompositeRidingStrategy<CompositeSettings> {
|
||||
defaultSettings: RidingBehaviourSettings,
|
||||
vehicle: PokemonEntity
|
||||
): Boolean {
|
||||
if (state.activeController.get() == defaultSettings.key) return false
|
||||
if (state.activeBehaviour.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)
|
||||
@@ -58,7 +56,7 @@ object JumpStrategy : CompositeRidingStrategy<CompositeSettings> {
|
||||
vehicle: PokemonEntity,
|
||||
driver: Player
|
||||
): Boolean {
|
||||
if (state.activeController.get() == alternativeSettings.key) return false
|
||||
if (state.activeBehaviour.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)
|
||||
|
||||
+5
-3
@@ -45,10 +45,12 @@ object RunStrategy : CompositeRidingStrategy<CompositeSettings> {
|
||||
entity: PokemonEntity,
|
||||
driver: Player
|
||||
): Boolean {
|
||||
if (state.activeController.get() == defaultSettings.key) return false
|
||||
if (state.activeBehaviour.get() == defaultSettings.key) return false
|
||||
if (!entity.onGround()) 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)
|
||||
val ret = defaultBehaviour.isActive(defaultSettings, state.defaultBehaviourState, entity)
|
||||
return ret
|
||||
}
|
||||
|
||||
private fun shouldTransitionToAlternate(
|
||||
@@ -58,7 +60,7 @@ object RunStrategy : CompositeRidingStrategy<CompositeSettings> {
|
||||
driver: Player,
|
||||
input: Vec3
|
||||
): Boolean {
|
||||
if (state.activeController.get() == alternativeSettings.key) return false
|
||||
if (state.activeBehaviour.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)
|
||||
|
||||
+204
-132
@@ -6,10 +6,9 @@
|
||||
* file, You can obtain one at https://mozilla.org/MPL/2.0/.
|
||||
*/
|
||||
|
||||
package com.cobblemon.mod.common.api.riding.behaviour.types
|
||||
package com.cobblemon.mod.common.api.riding.behaviour.types.land
|
||||
|
||||
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
|
||||
@@ -18,32 +17,34 @@ 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.util.Mth
|
||||
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
|
||||
import net.minecraft.world.phys.shapes.Shapes
|
||||
import kotlin.math.max
|
||||
import kotlin.math.min
|
||||
import kotlin.math.pow
|
||||
import kotlin.math.*
|
||||
|
||||
class GenericLandBehaviour : RidingBehaviour<GenericLandSettings, GenericLandState> {
|
||||
class HorseBehaviour : RidingBehaviour<HorseSettings, HorseState> {
|
||||
companion object {
|
||||
val KEY = cobblemonResource("land/generic")
|
||||
val KEY = cobblemonResource("land/horse")
|
||||
}
|
||||
|
||||
override val key = KEY
|
||||
override val style = RidingStyle.LAND
|
||||
|
||||
val poseProvider = PoseProvider<GenericLandSettings, GenericLandState>(PoseType.STAND)
|
||||
override fun getRidingStyle(settings: HorseSettings, state: HorseState): RidingStyle {
|
||||
return RidingStyle.LAND
|
||||
}
|
||||
|
||||
val poseProvider = PoseProvider<HorseSettings, HorseState>(PoseType.STAND)
|
||||
.with(PoseOption(PoseType.WALK) { _, state, _ ->
|
||||
return@PoseOption state.rideVelocity.get().z > 0.1
|
||||
return@PoseOption abs(state.rideVelocity.get().z) > 0.2
|
||||
})
|
||||
|
||||
override fun isActive(
|
||||
settings: GenericLandSettings,
|
||||
state: GenericLandState,
|
||||
settings: HorseSettings,
|
||||
state: HorseState,
|
||||
vehicle: PokemonEntity
|
||||
): Boolean {
|
||||
return Shapes.create(vehicle.boundingBox).blockPositionsAsListRounded().any {
|
||||
@@ -61,56 +62,132 @@ class GenericLandBehaviour : RidingBehaviour<GenericLandSettings, GenericLandSta
|
||||
}
|
||||
|
||||
override fun pose(
|
||||
settings: GenericLandSettings,
|
||||
state: GenericLandState,
|
||||
settings: HorseSettings,
|
||||
state: HorseState,
|
||||
vehicle: PokemonEntity
|
||||
): PoseType {
|
||||
return this.poseProvider.select(settings, state, vehicle)
|
||||
}
|
||||
|
||||
override fun speed(
|
||||
settings: GenericLandSettings,
|
||||
state: GenericLandState,
|
||||
settings: HorseSettings,
|
||||
state: HorseState,
|
||||
vehicle: PokemonEntity,
|
||||
driver: Player
|
||||
): Float {
|
||||
return state.rideVelocity.get().length().toFloat()
|
||||
}
|
||||
|
||||
override fun updatePassengerRotation(
|
||||
settings: HorseSettings,
|
||||
state: HorseState,
|
||||
vehicle: PokemonEntity,
|
||||
driver: LivingEntity
|
||||
) {
|
||||
|
||||
//Take the inverse so that it cancels out how
|
||||
//much the entity rotates.
|
||||
val turnAmount = calcRotAmount(settings, state, vehicle, driver)
|
||||
|
||||
val topSpeed = vehicle.runtime.resolveDouble(settings.speedExpr)
|
||||
val maxYawDiff = 90.0f
|
||||
|
||||
//Normalize the current rotation diff
|
||||
val rotMod = Mth.wrapDegrees(driver.yRot - vehicle.yRot) / maxYawDiff
|
||||
|
||||
val rotAmount = 10.0f
|
||||
|
||||
//Take the inverse so that you turn more at higher speeds
|
||||
val normSpeed = 1.0f - 0.5f*normalizeVal(state.rideVelocity.get().length(), 0.0, topSpeed).toFloat()
|
||||
|
||||
//driver.yRot += (entity.riding.deltaRotation.y - turnAmount)
|
||||
//driver.setYHeadRot(driver.yHeadRot + (entity.riding.deltaRotation.y) - turnAmount)
|
||||
}
|
||||
|
||||
override fun clampPassengerRotation(
|
||||
settings: HorseSettings,
|
||||
state: HorseState,
|
||||
vehicle: PokemonEntity,
|
||||
driver: LivingEntity
|
||||
) {
|
||||
val f = Mth.wrapDegrees(driver.yRot - vehicle.yRot)
|
||||
val lookYawLimit = 90.0f
|
||||
val g = Mth.clamp(f, -lookYawLimit, lookYawLimit)
|
||||
driver.yRotO += g - f
|
||||
driver.yRot = driver.yRot + g - f
|
||||
driver.setYHeadRot(driver.yRot)
|
||||
}
|
||||
|
||||
|
||||
override fun rotation(
|
||||
settings: GenericLandSettings,
|
||||
state: GenericLandState,
|
||||
settings: HorseSettings,
|
||||
state: HorseState,
|
||||
vehicle: PokemonEntity,
|
||||
driver: LivingEntity
|
||||
): Vec2 {
|
||||
return Vec2(driver.xRot * 0.5f, driver.yRot)
|
||||
val turnAmount = calcRotAmount(settings, state, vehicle, driver)
|
||||
|
||||
return Vec2(vehicle.xRot, vehicle.yRot + turnAmount )
|
||||
|
||||
}
|
||||
|
||||
/*
|
||||
* Calculates the rotation amount given the difference between
|
||||
* the current player y rot and entity y rot. This gives the
|
||||
* affect of influencing a rides rotation through the mouse
|
||||
* without it being instant.
|
||||
*/
|
||||
fun calcRotAmount(
|
||||
settings: HorseSettings,
|
||||
state: HorseState,
|
||||
vehicle: PokemonEntity,
|
||||
driver: LivingEntity
|
||||
): Float {
|
||||
val topSpeed = vehicle.runtime.resolveDouble(settings.speedExpr)
|
||||
//In degrees per second
|
||||
val handling = vehicle.runtime.resolveDouble(settings.handlingExpr)
|
||||
val maxYawDiff = 90.0f
|
||||
|
||||
//Normalize the current rotation diff
|
||||
val rotDiff = Mth.wrapDegrees(driver.yRot - vehicle.yRot)
|
||||
val rotDiffNorm = rotDiff / maxYawDiff
|
||||
|
||||
//Take the square root so that the ride levels out quicker when at lower differences between entity
|
||||
//y and driver y
|
||||
//This influences the speed of the turn based on how far in one direction you're looking
|
||||
val rotDiffMod = (sqrt(abs(rotDiffNorm)) * rotDiffNorm.sign)
|
||||
|
||||
//Take the inverse so that you turn less at higher speeds
|
||||
val normSpeed = 1.0f // = 1.0f - 0.5f*normalizeVal(state.rideVelocityocity.length(), 0.0, topSpeed).toFloat()
|
||||
|
||||
// TODO: This needs to be tweaked with in game results and testing
|
||||
val turnRate = (handling.toFloat() / 20.0f) * 2
|
||||
|
||||
//Ensure you only ever rotate as much difference as there is between the angles.
|
||||
val turnSpeed = turnRate * rotDiffMod * normSpeed
|
||||
val rotAmount = turnSpeed.coerceIn(-abs(rotDiff), abs(rotDiff))
|
||||
|
||||
return rotAmount
|
||||
}
|
||||
|
||||
|
||||
override fun velocity(
|
||||
settings: GenericLandSettings,
|
||||
state: GenericLandState,
|
||||
settings: HorseSettings,
|
||||
state: HorseState,
|
||||
vehicle: PokemonEntity,
|
||||
driver: Player,
|
||||
input: Vec3
|
||||
): Vec3 {
|
||||
val runtime = vehicle.runtime
|
||||
val driveFactor = runtime.resolveFloat(settings.driveFactor)
|
||||
val strafeFactor = runtime.resolveFloat(settings.strafeFactor)
|
||||
val f = driver.xxa * strafeFactor
|
||||
var g = driver.zza * driveFactor
|
||||
if (g <= 0.0f) {
|
||||
g *= runtime.resolveFloat(settings.reverseDriveFactor)
|
||||
}
|
||||
val gravity = -1.0
|
||||
//Limit horizontal velocity that may have accumulated through alternate behaviour
|
||||
val topSpeed = vehicle.runtime.resolveDouble(settings.speedExpr)
|
||||
val currVel = state.rideVelocity.get()
|
||||
// state.rideVelocity.set(Vec3(
|
||||
// max(currVel.x, topSpeed),
|
||||
// currVel.y,
|
||||
// max(currVel.z, topSpeed)
|
||||
// ))
|
||||
|
||||
val newVelocity = calculateRideSpaceVel(settings, state, vehicle, driver)
|
||||
|
||||
//Jump the thang!
|
||||
if (driver.jumping && vehicle.onGround()) {
|
||||
state.rideVelocity.set(Vec3(newVelocity.x, 2.0, newVelocity.z))
|
||||
} else {
|
||||
state.rideVelocity.set(newVelocity)
|
||||
}
|
||||
state.rideVelocity.set(calculateRideSpaceVel(settings, state, vehicle, driver))
|
||||
|
||||
//This is cheap.
|
||||
//Also make it stop quicker the slower it is.
|
||||
@@ -124,40 +201,64 @@ class GenericLandBehaviour : RidingBehaviour<GenericLandSettings, GenericLandSta
|
||||
}
|
||||
|
||||
private fun calculateRideSpaceVel(
|
||||
settings: GenericLandSettings,
|
||||
state: GenericLandState,
|
||||
settings: HorseSettings,
|
||||
state: HorseState,
|
||||
vehicle: PokemonEntity,
|
||||
driver: Player
|
||||
): Vec3 {
|
||||
val topSpeed = vehicle.runtime.resolveDouble(settings.topSpeedExpr)
|
||||
val accel = vehicle.runtime.resolveDouble(settings.accelExpr)
|
||||
val topSpeed = vehicle.runtime.resolveDouble(settings.speedExpr)
|
||||
val accel = vehicle.runtime.resolveDouble(settings.accelerationExpr)
|
||||
val speed = state.rideVelocity.get().length()
|
||||
|
||||
val minSpeed = 0.0
|
||||
//Flag for determining if player is actively inputting
|
||||
var activeInput = false
|
||||
|
||||
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) {
|
||||
//modify acceleration to be slower when at closer speeds to top speed
|
||||
val accelMod = max((normalizeSpeed(speed, minSpeed, topSpeed) - 1).pow(2), 0.1)
|
||||
newVelocity = Vec3(newVelocity.x, newVelocity.y, min(newVelocity.z + (accel * accelMod), topSpeed))
|
||||
} else if (driver.zza >= 0.0 && state.stamina.get() == 0.0f || speed > topSpeed) {
|
||||
newVelocity = Vec3(newVelocity.x, newVelocity.y, max(newVelocity.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, 0.0)
|
||||
|
||||
//Decelerate currently always a constant half of max acceleration.
|
||||
newVelocity =
|
||||
Vec3(newVelocity.x, newVelocity.y, max(newVelocity.z - ((accel * deccelMod) / 2), minSpeed))
|
||||
//speed up and slow down based on input
|
||||
if (driver.zza != 0.0f && state.stamina.get() > 0.0) {
|
||||
//make sure it can't exceed top speed
|
||||
val forwardInput = when {
|
||||
driver.zza > 0 && newVelocity.z > topSpeed -> 0.0
|
||||
driver.zza < 0 && newVelocity.z < (-topSpeed / 3.0) -> 0.0
|
||||
else -> driver.zza.sign
|
||||
}
|
||||
|
||||
newVelocity = Vec3(
|
||||
newVelocity.x,
|
||||
newVelocity.y,
|
||||
(newVelocity.z + (accel * forwardInput.toDouble())))
|
||||
|
||||
activeInput = true
|
||||
}
|
||||
|
||||
//Gravity logic
|
||||
if (vehicle.onGround()) {
|
||||
newVelocity = Vec3(newVelocity.x, 0.0, newVelocity.z)
|
||||
} else {
|
||||
newVelocity = Vec3(newVelocity.x, max(newVelocity.y - 0.2, -1.0), newVelocity.z)
|
||||
val gravity = (9.8 / ( 20.0)) * 0.2
|
||||
val terminalVel = 2.0
|
||||
|
||||
val fallingForce = gravity - ( newVelocity.z.sign *gravity *(abs(newVelocity.z) / 2.0))
|
||||
newVelocity = Vec3(newVelocity.x, max(newVelocity.y - fallingForce, -terminalVel), newVelocity.z)
|
||||
}
|
||||
|
||||
//ground Friction
|
||||
if( abs(newVelocity.z) > 0 && vehicle.onGround() && !activeInput) {
|
||||
newVelocity = newVelocity.subtract(0.0, 0.0, min(0.03 * newVelocity.z.sign, newVelocity.z))
|
||||
}
|
||||
|
||||
//Jump the thang!
|
||||
if (driver.jumping && vehicle.onGround()) {
|
||||
val jumpVel = 1.0
|
||||
newVelocity = newVelocity.add(0.0, 1.0, 0.0)
|
||||
|
||||
//Ensure this doesn't add unwanted forward velocity
|
||||
val mag = if(newVelocity.length() < topSpeed) newVelocity.length() else topSpeed
|
||||
newVelocity = newVelocity.normalize().scale(mag)
|
||||
}
|
||||
|
||||
return newVelocity
|
||||
}
|
||||
|
||||
@@ -165,14 +266,14 @@ class GenericLandBehaviour : RidingBehaviour<GenericLandSettings, GenericLandSta
|
||||
* Normalizes the current speed between minSpeed and maxSpeed.
|
||||
* The result is clamped between 0.0 and 1.0, where 0.0 represents minSpeed and 1.0 represents maxSpeed.
|
||||
*/
|
||||
private fun normalizeSpeed(currSpeed: Double, minSpeed: Double, maxSpeed: Double): Double {
|
||||
private fun normalizeVal(currSpeed: Double, minSpeed: Double, maxSpeed: Double): Double {
|
||||
require(maxSpeed > minSpeed) { "maxSpeed must be greater than minSpeed" }
|
||||
return ((currSpeed - minSpeed) / (maxSpeed - minSpeed)).coerceIn(0.0, 1.0)
|
||||
}
|
||||
|
||||
override fun angRollVel(
|
||||
settings: GenericLandSettings,
|
||||
state: GenericLandState,
|
||||
settings: HorseSettings,
|
||||
state: HorseState,
|
||||
vehicle: PokemonEntity,
|
||||
driver: Player,
|
||||
deltaTime: Double
|
||||
@@ -181,8 +282,8 @@ class GenericLandBehaviour : RidingBehaviour<GenericLandSettings, GenericLandSta
|
||||
}
|
||||
|
||||
override fun rotationOnMouseXY(
|
||||
settings: GenericLandSettings,
|
||||
state: GenericLandState,
|
||||
settings: HorseSettings,
|
||||
state: HorseState,
|
||||
vehicle: PokemonEntity,
|
||||
driver: Player,
|
||||
mouseY: Double,
|
||||
@@ -202,8 +303,8 @@ class GenericLandBehaviour : RidingBehaviour<GenericLandSettings, GenericLandSta
|
||||
}
|
||||
|
||||
override fun canJump(
|
||||
settings: GenericLandSettings,
|
||||
state: GenericLandState,
|
||||
settings: HorseSettings,
|
||||
state: HorseState,
|
||||
vehicle: PokemonEntity,
|
||||
driver: Player
|
||||
): Boolean {
|
||||
@@ -211,33 +312,28 @@ class GenericLandBehaviour : RidingBehaviour<GenericLandSettings, GenericLandSta
|
||||
}
|
||||
|
||||
override fun setRideBar(
|
||||
settings: GenericLandSettings,
|
||||
state: GenericLandState,
|
||||
settings: HorseSettings,
|
||||
state: HorseState,
|
||||
vehicle: PokemonEntity,
|
||||
driver: Player
|
||||
): Float {
|
||||
//Retrieve stamina from state and tick up at a rate of 0.1 a second
|
||||
val staminaGain = (1.0 / 20.0) * 0.1
|
||||
state.stamina.set(min(state.stamina.get() + staminaGain, 1.0).toFloat())
|
||||
return (state.stamina.get() / 1.0f)
|
||||
}
|
||||
|
||||
override fun jumpForce(
|
||||
settings: GenericLandSettings,
|
||||
state: GenericLandState,
|
||||
settings: HorseSettings,
|
||||
state: HorseState,
|
||||
vehicle: PokemonEntity,
|
||||
driver: Player,
|
||||
jumpStrength: Int
|
||||
): Vec3 {
|
||||
val runtime = vehicle.runtime
|
||||
runtime.environment.query.addFunction("jump_strength") { DoubleValue(jumpStrength.toDouble()) }
|
||||
val jumpVector = settings.jumpVector.map { runtime.resolveFloat(it) }
|
||||
return Vec3(jumpVector[0].toDouble(), jumpVector[1].toDouble(), jumpVector[2].toDouble())
|
||||
return Vec3.ZERO
|
||||
}
|
||||
|
||||
override fun gravity(
|
||||
settings: GenericLandSettings,
|
||||
state: GenericLandState,
|
||||
settings: HorseSettings,
|
||||
state: HorseState,
|
||||
vehicle: PokemonEntity,
|
||||
regularGravity: Double
|
||||
): Double {
|
||||
@@ -245,8 +341,8 @@ class GenericLandBehaviour : RidingBehaviour<GenericLandSettings, GenericLandSta
|
||||
}
|
||||
|
||||
override fun rideFovMultiplier(
|
||||
settings: GenericLandSettings,
|
||||
state: GenericLandState,
|
||||
settings: HorseSettings,
|
||||
state: HorseState,
|
||||
vehicle: PokemonEntity,
|
||||
driver: Player
|
||||
): Float {
|
||||
@@ -254,16 +350,16 @@ class GenericLandBehaviour : RidingBehaviour<GenericLandSettings, GenericLandSta
|
||||
}
|
||||
|
||||
override fun useAngVelSmoothing(
|
||||
settings: GenericLandSettings,
|
||||
state: GenericLandState,
|
||||
settings: HorseSettings,
|
||||
state: HorseState,
|
||||
vehicle: PokemonEntity
|
||||
): Boolean {
|
||||
return false
|
||||
}
|
||||
|
||||
override fun useRidingAltPose(
|
||||
settings: GenericLandSettings,
|
||||
state: GenericLandState,
|
||||
settings: HorseSettings,
|
||||
state: HorseState,
|
||||
vehicle: PokemonEntity,
|
||||
driver: Player
|
||||
): Boolean {
|
||||
@@ -271,77 +367,68 @@ class GenericLandBehaviour : RidingBehaviour<GenericLandSettings, GenericLandSta
|
||||
}
|
||||
|
||||
override fun inertia(
|
||||
settings: GenericLandSettings,
|
||||
state: GenericLandState,
|
||||
settings: HorseSettings,
|
||||
state: HorseState,
|
||||
vehicle: PokemonEntity
|
||||
): Double {
|
||||
return 0.5
|
||||
}
|
||||
|
||||
override fun shouldRoll(
|
||||
settings: GenericLandSettings,
|
||||
state: GenericLandState,
|
||||
settings: HorseSettings,
|
||||
state: HorseState,
|
||||
vehicle: PokemonEntity
|
||||
): Boolean {
|
||||
return false
|
||||
}
|
||||
|
||||
override fun turnOffOnGround(
|
||||
settings: GenericLandSettings,
|
||||
state: GenericLandState,
|
||||
settings: HorseSettings,
|
||||
state: HorseState,
|
||||
vehicle: PokemonEntity
|
||||
): Boolean {
|
||||
return false
|
||||
}
|
||||
|
||||
override fun dismountOnShift(
|
||||
settings: GenericLandSettings,
|
||||
state: GenericLandState,
|
||||
settings: HorseSettings,
|
||||
state: HorseState,
|
||||
vehicle: PokemonEntity
|
||||
): Boolean {
|
||||
return false
|
||||
}
|
||||
|
||||
override fun shouldRotatePokemonHead(
|
||||
settings: GenericLandSettings,
|
||||
state: GenericLandState,
|
||||
settings: HorseSettings,
|
||||
state: HorseState,
|
||||
vehicle: PokemonEntity
|
||||
): Boolean {
|
||||
return false
|
||||
}
|
||||
|
||||
override fun shouldRotatePlayerHead(
|
||||
settings: GenericLandSettings,
|
||||
state: GenericLandState,
|
||||
settings: HorseSettings,
|
||||
state: HorseState,
|
||||
vehicle: PokemonEntity
|
||||
): Boolean {
|
||||
return false
|
||||
}
|
||||
|
||||
override fun createDefaultState(settings: GenericLandSettings) = GenericLandState()
|
||||
override fun createDefaultState(settings: HorseSettings) = HorseState()
|
||||
}
|
||||
|
||||
class GenericLandSettings : RidingBehaviourSettings {
|
||||
override val key = GenericLandBehaviour.KEY
|
||||
class HorseSettings : RidingBehaviourSettings {
|
||||
override val key = HorseBehaviour.KEY
|
||||
|
||||
var driveFactor = "1.0".asExpression()
|
||||
var canJump = "true".asExpression()
|
||||
private set
|
||||
|
||||
var strafeFactor = "0.2".asExpression()
|
||||
private set
|
||||
|
||||
var reverseDriveFactor = "0.25".asExpression()
|
||||
private set
|
||||
|
||||
var topSpeedExpr: Expression = "q.get_ride_stats('SPEED', 'LAND', 1.0, 0.3)".asExpression()
|
||||
var speedExpr: Expression = "q.get_ride_stats('SPEED', 'LAND', 1.0, 0.3)".asExpression()
|
||||
private set
|
||||
|
||||
// Max accel is a whole 1.0 in 1 second. The conversion in the function below is to convert seconds to ticks
|
||||
var accelExpr: Expression =
|
||||
"q.get_ride_stats('ACCELERATION', 'LAND', (1.0 / (20.0 * 0.5)), (1.0 / (20.0 * 5.0)))".asExpression()
|
||||
private set
|
||||
|
||||
var jumpVector = listOf("0".asExpression(), "0.3".asExpression(), "0".asExpression())
|
||||
var accelerationExpr: Expression =
|
||||
"q.get_ride_stats('ACCELERATION', 'LAND', (1.0 / (20.0 * 1.5)), (1.0 / (20.0 * 5.0)))".asExpression()
|
||||
private set
|
||||
|
||||
// Between 30 seconds and 10 seconds at the lowest when at full speed.
|
||||
@@ -357,30 +444,16 @@ class GenericLandSettings : RidingBehaviourSettings {
|
||||
|
||||
override fun encode(buffer: RegistryFriendlyByteBuf) {
|
||||
buffer.writeResourceLocation(key)
|
||||
buffer.writeExpression(driveFactor)
|
||||
buffer.writeExpression(strafeFactor)
|
||||
buffer.writeExpression(reverseDriveFactor)
|
||||
buffer.writeExpression(topSpeedExpr)
|
||||
buffer.writeExpression(accelExpr)
|
||||
buffer.writeExpression(jumpVector[0])
|
||||
buffer.writeExpression(jumpVector[1])
|
||||
buffer.writeExpression(jumpVector[2])
|
||||
buffer.writeExpression(speedExpr)
|
||||
buffer.writeExpression(accelerationExpr)
|
||||
buffer.writeExpression(staminaExpr)
|
||||
buffer.writeExpression(jumpExpr)
|
||||
buffer.writeExpression(handlingExpr)
|
||||
}
|
||||
|
||||
override fun decode(buffer: RegistryFriendlyByteBuf) {
|
||||
driveFactor = buffer.readExpression()
|
||||
strafeFactor = buffer.readExpression()
|
||||
reverseDriveFactor = buffer.readExpression()
|
||||
topSpeedExpr = buffer.readExpression()
|
||||
accelExpr = buffer.readExpression()
|
||||
jumpVector = listOf(
|
||||
buffer.readExpression(),
|
||||
buffer.readExpression(),
|
||||
buffer.readExpression()
|
||||
)
|
||||
speedExpr = buffer.readExpression()
|
||||
accelerationExpr = buffer.readExpression()
|
||||
staminaExpr = buffer.readExpression()
|
||||
jumpExpr = buffer.readExpression()
|
||||
handlingExpr = buffer.readExpression()
|
||||
@@ -388,17 +461,16 @@ class GenericLandSettings : RidingBehaviourSettings {
|
||||
|
||||
}
|
||||
|
||||
class GenericLandState : RidingBehaviourState() {
|
||||
class HorseState : RidingBehaviourState() {
|
||||
var currSpeed = ridingState(0.0, Side.BOTH)
|
||||
|
||||
override fun copy() = GenericLandState().also {
|
||||
override fun copy() = HorseState().also {
|
||||
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 (previous !is HorseState) return false
|
||||
return super.shouldSync(previous)
|
||||
}
|
||||
}
|
||||
+49
-47
@@ -6,7 +6,7 @@
|
||||
* file, You can obtain one at https://mozilla.org/MPL/2.0/.
|
||||
*/
|
||||
|
||||
package com.cobblemon.mod.common.api.riding.behaviour.types
|
||||
package com.cobblemon.mod.common.api.riding.behaviour.types.land
|
||||
|
||||
import com.bedrockk.molang.runtime.value.DoubleValue
|
||||
import com.cobblemon.mod.common.Cobblemon
|
||||
@@ -20,7 +20,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
|
||||
@@ -31,7 +30,7 @@ import kotlin.math.absoluteValue
|
||||
import kotlin.math.max
|
||||
import kotlin.math.min
|
||||
|
||||
class VehicleLandBehaviour : RidingBehaviour<VehicleLandSettings, VehicleLandState> {
|
||||
class VehicleBehaviour : RidingBehaviour<VehicleSettings, VehicleState> {
|
||||
companion object {
|
||||
val KEY = cobblemonResource("land/vehicle")
|
||||
|
||||
@@ -53,12 +52,15 @@ class VehicleLandBehaviour : RidingBehaviour<VehicleLandSettings, VehicleLandSta
|
||||
}
|
||||
|
||||
override val key = KEY
|
||||
override val style = RidingStyle.LAND
|
||||
|
||||
val poseProvider = PoseProvider<VehicleLandSettings, VehicleLandState>(PoseType.STAND)
|
||||
override fun getRidingStyle(settings: VehicleSettings, state: VehicleState): RidingStyle {
|
||||
return RidingStyle.LAND
|
||||
}
|
||||
|
||||
val poseProvider = PoseProvider<VehicleSettings, VehicleState>(PoseType.STAND)
|
||||
.with(PoseOption(PoseType.WALK) { _, _, entity -> entity.entityData.get(PokemonEntity.MOVING) })
|
||||
|
||||
override fun isActive(settings: VehicleLandSettings, state: VehicleLandState, vehicle: PokemonEntity): Boolean {
|
||||
override fun isActive(settings: VehicleSettings, state: VehicleState, vehicle: PokemonEntity): Boolean {
|
||||
return Shapes.create(vehicle.boundingBox).blockPositionsAsListRounded().any {
|
||||
//Need to check other fluids
|
||||
if (vehicle.isInWater || vehicle.isUnderWater) {
|
||||
@@ -73,13 +75,13 @@ class VehicleLandBehaviour : RidingBehaviour<VehicleLandSettings, VehicleLandSta
|
||||
}
|
||||
}
|
||||
|
||||
override fun pose(settings: VehicleLandSettings, state: VehicleLandState, vehicle: PokemonEntity): PoseType {
|
||||
override fun pose(settings: VehicleSettings, state: VehicleState, vehicle: PokemonEntity): PoseType {
|
||||
return poseProvider.select(settings, state, vehicle)
|
||||
}
|
||||
|
||||
override fun speed(
|
||||
settings: VehicleLandSettings,
|
||||
state: VehicleLandState,
|
||||
settings: VehicleSettings,
|
||||
state: VehicleState,
|
||||
vehicle: PokemonEntity,
|
||||
driver: Player
|
||||
): Float {
|
||||
@@ -98,8 +100,8 @@ class VehicleLandBehaviour : RidingBehaviour<VehicleLandSettings, VehicleLandSta
|
||||
}
|
||||
|
||||
override fun rotation(
|
||||
settings: VehicleLandSettings,
|
||||
state: VehicleLandState,
|
||||
settings: VehicleSettings,
|
||||
state: VehicleState,
|
||||
vehicle: PokemonEntity,
|
||||
driver: LivingEntity
|
||||
): Vec2 {
|
||||
@@ -110,8 +112,8 @@ class VehicleLandBehaviour : RidingBehaviour<VehicleLandSettings, VehicleLandSta
|
||||
}
|
||||
|
||||
override fun velocity(
|
||||
settings: VehicleLandSettings,
|
||||
state: VehicleLandState,
|
||||
settings: VehicleSettings,
|
||||
state: VehicleState,
|
||||
vehicle: PokemonEntity,
|
||||
driver: Player,
|
||||
input: Vec3
|
||||
@@ -131,8 +133,8 @@ class VehicleLandBehaviour : RidingBehaviour<VehicleLandSettings, VehicleLandSta
|
||||
}
|
||||
|
||||
override fun angRollVel(
|
||||
settings: VehicleLandSettings,
|
||||
state: VehicleLandState,
|
||||
settings: VehicleSettings,
|
||||
state: VehicleState,
|
||||
vehicle: PokemonEntity,
|
||||
driver: Player,
|
||||
deltaTime: Double
|
||||
@@ -141,8 +143,8 @@ class VehicleLandBehaviour : RidingBehaviour<VehicleLandSettings, VehicleLandSta
|
||||
}
|
||||
|
||||
override fun rotationOnMouseXY(
|
||||
settings: VehicleLandSettings,
|
||||
state: VehicleLandState,
|
||||
settings: VehicleSettings,
|
||||
state: VehicleState,
|
||||
vehicle: PokemonEntity,
|
||||
driver: Player,
|
||||
mouseY: Double,
|
||||
@@ -161,8 +163,8 @@ class VehicleLandBehaviour : RidingBehaviour<VehicleLandSettings, VehicleLandSta
|
||||
}
|
||||
|
||||
override fun canJump(
|
||||
settings: VehicleLandSettings,
|
||||
state: VehicleLandState,
|
||||
settings: VehicleSettings,
|
||||
state: VehicleState,
|
||||
vehicle: PokemonEntity,
|
||||
driver: Player
|
||||
): Boolean {
|
||||
@@ -170,8 +172,8 @@ class VehicleLandBehaviour : RidingBehaviour<VehicleLandSettings, VehicleLandSta
|
||||
}
|
||||
|
||||
override fun setRideBar(
|
||||
settings: VehicleLandSettings,
|
||||
state: VehicleLandState,
|
||||
settings: VehicleSettings,
|
||||
state: VehicleState,
|
||||
vehicle: PokemonEntity,
|
||||
driver: Player
|
||||
): Float {
|
||||
@@ -179,8 +181,8 @@ class VehicleLandBehaviour : RidingBehaviour<VehicleLandSettings, VehicleLandSta
|
||||
}
|
||||
|
||||
override fun jumpForce(
|
||||
settings: VehicleLandSettings,
|
||||
state: VehicleLandState,
|
||||
settings: VehicleSettings,
|
||||
state: VehicleState,
|
||||
vehicle: PokemonEntity,
|
||||
driver: Player,
|
||||
jumpStrength: Int
|
||||
@@ -192,8 +194,8 @@ class VehicleLandBehaviour : RidingBehaviour<VehicleLandSettings, VehicleLandSta
|
||||
}
|
||||
|
||||
override fun gravity(
|
||||
settings: VehicleLandSettings,
|
||||
state: VehicleLandState,
|
||||
settings: VehicleSettings,
|
||||
state: VehicleState,
|
||||
vehicle: PokemonEntity,
|
||||
regularGravity: Double
|
||||
): Double {
|
||||
@@ -201,8 +203,8 @@ class VehicleLandBehaviour : RidingBehaviour<VehicleLandSettings, VehicleLandSta
|
||||
}
|
||||
|
||||
override fun rideFovMultiplier(
|
||||
settings: VehicleLandSettings,
|
||||
state: VehicleLandState,
|
||||
settings: VehicleSettings,
|
||||
state: VehicleState,
|
||||
vehicle: PokemonEntity,
|
||||
driver: Player
|
||||
): Float {
|
||||
@@ -210,67 +212,67 @@ class VehicleLandBehaviour : RidingBehaviour<VehicleLandSettings, VehicleLandSta
|
||||
}
|
||||
|
||||
override fun useAngVelSmoothing(
|
||||
settings: VehicleLandSettings,
|
||||
state: VehicleLandState,
|
||||
settings: VehicleSettings,
|
||||
state: VehicleState,
|
||||
vehicle: PokemonEntity
|
||||
): Boolean {
|
||||
return false
|
||||
}
|
||||
|
||||
override fun useRidingAltPose(
|
||||
settings: VehicleLandSettings,
|
||||
state: VehicleLandState,
|
||||
settings: VehicleSettings,
|
||||
state: VehicleState,
|
||||
vehicle: PokemonEntity,
|
||||
driver: Player
|
||||
): Boolean {
|
||||
return false
|
||||
}
|
||||
|
||||
override fun inertia(settings: VehicleLandSettings, state: VehicleLandState, vehicle: PokemonEntity): Double {
|
||||
override fun inertia(settings: VehicleSettings, state: VehicleState, vehicle: PokemonEntity): Double {
|
||||
return 0.5
|
||||
}
|
||||
|
||||
override fun shouldRoll(settings: VehicleLandSettings, state: VehicleLandState, vehicle: PokemonEntity): Boolean {
|
||||
override fun shouldRoll(settings: VehicleSettings, state: VehicleState, vehicle: PokemonEntity): Boolean {
|
||||
return false
|
||||
}
|
||||
|
||||
override fun turnOffOnGround(
|
||||
settings: VehicleLandSettings,
|
||||
state: VehicleLandState,
|
||||
settings: VehicleSettings,
|
||||
state: VehicleState,
|
||||
vehicle: PokemonEntity
|
||||
): Boolean {
|
||||
return false
|
||||
}
|
||||
|
||||
override fun dismountOnShift(
|
||||
settings: VehicleLandSettings,
|
||||
state: VehicleLandState,
|
||||
settings: VehicleSettings,
|
||||
state: VehicleState,
|
||||
vehicle: PokemonEntity
|
||||
): Boolean {
|
||||
return false
|
||||
}
|
||||
|
||||
override fun shouldRotatePokemonHead(
|
||||
settings: VehicleLandSettings,
|
||||
state: VehicleLandState,
|
||||
settings: VehicleSettings,
|
||||
state: VehicleState,
|
||||
vehicle: PokemonEntity
|
||||
): Boolean {
|
||||
return false
|
||||
}
|
||||
|
||||
override fun shouldRotatePlayerHead(
|
||||
settings: VehicleLandSettings,
|
||||
state: VehicleLandState,
|
||||
settings: VehicleSettings,
|
||||
state: VehicleState,
|
||||
vehicle: PokemonEntity
|
||||
): Boolean {
|
||||
return false
|
||||
}
|
||||
|
||||
override fun createDefaultState(settings: VehicleLandSettings) = VehicleLandState()
|
||||
override fun createDefaultState(settings: VehicleSettings) = VehicleState()
|
||||
}
|
||||
|
||||
class VehicleLandSettings : RidingBehaviourSettings {
|
||||
override val key = VehicleLandBehaviour.KEY
|
||||
class VehicleSettings : RidingBehaviourSettings {
|
||||
override val key = VehicleBehaviour.KEY
|
||||
|
||||
var canJump = "true".asExpression()
|
||||
private set
|
||||
@@ -326,7 +328,7 @@ class VehicleLandSettings : RidingBehaviourSettings {
|
||||
}
|
||||
}
|
||||
|
||||
class VehicleLandState : RidingBehaviourState() {
|
||||
class VehicleState : RidingBehaviourState() {
|
||||
var currSpeed = ridingState(0.0, Side.BOTH)
|
||||
var deltaRotation = ridingState(Vec2.ZERO, Side.BOTH)
|
||||
|
||||
@@ -337,10 +339,10 @@ class VehicleLandState : RidingBehaviourState() {
|
||||
}
|
||||
|
||||
override fun toString(): String {
|
||||
return "VehicleLandState(currSpeed=${currSpeed.get()}, deltaRotation=${deltaRotation.get()})"
|
||||
return "VehicleState(currSpeed=${currSpeed.get()}, deltaRotation=${deltaRotation.get()})"
|
||||
}
|
||||
|
||||
override fun copy() = VehicleLandState().also {
|
||||
override fun copy() = VehicleState().also {
|
||||
it.rideVelocity.set(rideVelocity.get(), forced = true)
|
||||
it.stamina.set(stamina.get(), forced = true)
|
||||
it.currSpeed.set(currSpeed.get(), forced = true)
|
||||
+382
@@ -0,0 +1,382 @@
|
||||
/*
|
||||
* 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.liquid
|
||||
|
||||
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.api.riding.stats.RidingStat
|
||||
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.util.Mth
|
||||
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
|
||||
import net.minecraft.world.phys.shapes.Shapes
|
||||
import kotlin.math.abs
|
||||
import kotlin.math.max
|
||||
import kotlin.math.min
|
||||
|
||||
class BoatBehaviour : RidingBehaviour<BoatSettings, BoatState> {
|
||||
companion object {
|
||||
val KEY = cobblemonResource("liquid/boat")
|
||||
val TOP_SPEED = 2.0
|
||||
}
|
||||
|
||||
override val key = KEY
|
||||
|
||||
override fun getRidingStyle(settings: BoatSettings, state: BoatState): RidingStyle {
|
||||
return RidingStyle.LIQUID
|
||||
}
|
||||
|
||||
val poseProvider = PoseProvider<BoatSettings, BoatState>(PoseType.FLOAT)
|
||||
.with(PoseOption(PoseType.SWIM) { _, _, entity -> entity.isSwimming && entity.entityData.get(PokemonEntity.MOVING) })
|
||||
|
||||
override fun isActive(settings: BoatSettings, state: BoatState, vehicle: PokemonEntity): Boolean {
|
||||
if (state.jumpBuffer.get() != -1) {
|
||||
return true
|
||||
}
|
||||
return Shapes.create(vehicle.boundingBox).blockPositionsAsListRounded().any {
|
||||
if (vehicle.isInWater || vehicle.isUnderWater) {
|
||||
return@any true
|
||||
}
|
||||
val blockState = vehicle.level().getBlockState(it)
|
||||
return@any !blockState.fluidState.isEmpty
|
||||
}
|
||||
}
|
||||
|
||||
override fun tick(
|
||||
settings: BoatSettings,
|
||||
state: BoatState,
|
||||
vehicle: PokemonEntity,
|
||||
driver: Player,
|
||||
input: Vec3
|
||||
) {
|
||||
if (state.jumpBuffer.get() > 5) {
|
||||
if ((vehicle.isInWater || vehicle.isUnderWater || vehicle.onGround())) {
|
||||
state.jumpBuffer.set(-1)
|
||||
}
|
||||
}
|
||||
else if (state.jumpBuffer.get() > -1) {
|
||||
state.jumpBuffer.set(state.jumpBuffer.get() + 1)
|
||||
}
|
||||
|
||||
if (driver.zza == 0f && (vehicle.isInWater || vehicle.isUnderWater)) {
|
||||
if (state.staminaBuffer.get() >= 20) {
|
||||
val staminaIncrease = vehicle.getRideStat(RidingStat.STAMINA, RidingStyle.LIQUID, 1.0, 2.0)
|
||||
state.stamina.set(min(1.0f, state.stamina.get() + 0.01f * staminaIncrease.toFloat()))
|
||||
}
|
||||
}
|
||||
else if (abs(state.rideVelocity.get().z) > 0.1) {
|
||||
consumeStamina(vehicle, state, 0.01f)
|
||||
}
|
||||
state.staminaBuffer.set(state.staminaBuffer.get() + 1)
|
||||
super.tick(settings, state, vehicle, driver, input)
|
||||
}
|
||||
|
||||
override fun pose(settings: BoatSettings, state: BoatState, vehicle: PokemonEntity): PoseType {
|
||||
return poseProvider.select(settings, state, vehicle)
|
||||
}
|
||||
|
||||
override fun speed(settings: BoatSettings, state: BoatState, vehicle: PokemonEntity, driver: Player): Float {
|
||||
return state.rideVelocity.get().length().toFloat()
|
||||
}
|
||||
|
||||
override fun rotation(
|
||||
settings: BoatSettings,
|
||||
state: BoatState,
|
||||
vehicle: PokemonEntity,
|
||||
driver: LivingEntity
|
||||
): Vec2 {
|
||||
state.deltaRotation.set(state.deltaRotation.get() * 0.8)
|
||||
return Vec2(vehicle.xRot, vehicle.yRot + state.deltaRotation.get().toFloat())
|
||||
}
|
||||
|
||||
override fun velocity(
|
||||
settings: BoatSettings,
|
||||
state: BoatState,
|
||||
vehicle: PokemonEntity,
|
||||
driver: Player,
|
||||
input: Vec3
|
||||
): Vec3 {
|
||||
applyStrafeRotation(vehicle, driver, state)
|
||||
|
||||
var velocity = state.rideVelocity.get()
|
||||
velocity = applyVelocityFromInput(velocity, vehicle, driver, state)
|
||||
velocity = applyGravity(velocity, vehicle, settings, state)
|
||||
velocity = applyJump(velocity, vehicle, driver, state)
|
||||
state.rideVelocity.set(velocity)
|
||||
return state.rideVelocity.get()
|
||||
}
|
||||
|
||||
private fun applyVelocityFromInput(velocity: Vec3, vehicle: PokemonEntity, driver: Player, state: BoatState): Vec3 {
|
||||
val speed = vehicle.getRideStat(RidingStat.SPEED, RidingStyle.LIQUID, 0.8, TOP_SPEED)
|
||||
val acceleration = vehicle.getRideStat(RidingStat.ACCELERATION, RidingStyle.LIQUID, 0.05, 0.5)
|
||||
|
||||
if (state.jumpBuffer.get() != -1 || !(vehicle.isInWater || vehicle.isUnderWater)) {
|
||||
return velocity
|
||||
}
|
||||
|
||||
val forwardInput = driver.zza.toDouble()
|
||||
val delta = when {
|
||||
!hasStamina(state) || forwardInput == 0.0 -> -velocity.z * 0.04
|
||||
forwardInput < 0.0 -> when {
|
||||
velocity.z < 0.0 -> forwardInput * acceleration * 0.5
|
||||
else -> min(forwardInput * acceleration * 0.5, -velocity.z * 0.04) // We never want it to be slower to reverse than no input
|
||||
}
|
||||
else -> forwardInput * acceleration
|
||||
}
|
||||
|
||||
return Vec3(
|
||||
velocity.x,
|
||||
velocity.y,
|
||||
Mth.clamp(velocity.z + delta, -speed * 0.25, speed)
|
||||
)
|
||||
}
|
||||
|
||||
private fun applyJump(velocity: Vec3, vehicle: PokemonEntity, driver: Player, state: BoatState): Vec3 {
|
||||
if (!driver.jumping) return velocity // Not jumping
|
||||
if (state.jumpBuffer.get() != -1) return velocity // Already jumped very recently
|
||||
if (!hasStamina(state)) return velocity // Has no stamina
|
||||
|
||||
val jumpStrength = vehicle.getRideStat(RidingStat.JUMP, RidingStyle.LIQUID, 1.0, 2.5)
|
||||
state.jumpBuffer.set(0)
|
||||
consumeStamina(vehicle, state, 0.05f)
|
||||
return Vec3(velocity.x, velocity.y + jumpStrength, velocity.z)
|
||||
}
|
||||
|
||||
private fun applyGravity(velocity: Vec3, vehicle: PokemonEntity, settings: BoatSettings, state: BoatState): Vec3 {
|
||||
if (state.jumpBuffer.get() == -1 && vehicle.isInWater || vehicle.isUnderWater) {
|
||||
return Vec3(velocity.x, -0.05, velocity.z)
|
||||
}
|
||||
val terminalVelocity = vehicle.runtime.resolveDouble(settings.terminalVelocity)
|
||||
val gravity = (9.8 / ( 20.0)) * 0.2
|
||||
return Vec3(velocity.x, max(velocity.y - gravity, terminalVelocity), velocity.z)
|
||||
}
|
||||
|
||||
private fun applyStrafeRotation(vehicle: PokemonEntity, driver: Player, state: BoatState) {
|
||||
val skill = vehicle.getRideStat(RidingStat.SKILL, RidingStyle.LIQUID, 0.5, 1.5)
|
||||
val strafe = driver.xxa
|
||||
if (abs(strafe) > 0) {
|
||||
val increase = if (strafe > 0) -1 else 1
|
||||
state.deltaRotation.set(state.deltaRotation.get() + increase * skill)
|
||||
}
|
||||
}
|
||||
|
||||
private fun hasStamina(state: BoatState): Boolean {
|
||||
return state.stamina.get() != 0f
|
||||
}
|
||||
|
||||
private fun consumeStamina(vehicle: PokemonEntity, state: BoatState, drain: Float) {
|
||||
val stamina = vehicle.getRideStat(RidingStat.STAMINA, RidingStyle.LIQUID, 1.0, 5.0)
|
||||
state.stamina.set(max(0f, state.stamina.get() - drain / stamina.toFloat()))
|
||||
state.staminaBuffer.set(0)
|
||||
}
|
||||
|
||||
override fun updatePassengerRotation(
|
||||
settings: BoatSettings,
|
||||
state: BoatState,
|
||||
vehicle: PokemonEntity,
|
||||
driver: LivingEntity
|
||||
) {
|
||||
driver.yRot += state.deltaRotation.get().toFloat() * 0.887f
|
||||
driver.yHeadRot += state.deltaRotation.get().toFloat() * 0.887f
|
||||
clampPassengerRotation(settings, state, vehicle, driver)
|
||||
}
|
||||
|
||||
override fun clampPassengerRotation(
|
||||
settings: BoatSettings,
|
||||
state: BoatState,
|
||||
vehicle: PokemonEntity,
|
||||
driver: LivingEntity
|
||||
) {
|
||||
driver.setYBodyRot(vehicle.yRot)
|
||||
val f: Float = Mth.wrapDegrees(driver.yRot - vehicle.yRot)
|
||||
val g = Mth.clamp(f, -105.0f, 105.0f)
|
||||
driver.yRotO += g - f
|
||||
driver.yRot = driver.yRot + g - f
|
||||
driver.setYHeadRot(driver.yRot)
|
||||
vehicle.setYHeadRot(driver.yRot)
|
||||
}
|
||||
|
||||
override fun angRollVel(
|
||||
settings: BoatSettings,
|
||||
state: BoatState,
|
||||
vehicle: PokemonEntity,
|
||||
driver: Player,
|
||||
deltaTime: Double
|
||||
): Vec3 {
|
||||
return Vec3.ZERO
|
||||
}
|
||||
|
||||
override fun rotationOnMouseXY(
|
||||
settings: BoatSettings,
|
||||
state: BoatState,
|
||||
vehicle: PokemonEntity,
|
||||
driver: Player,
|
||||
mouseY: Double,
|
||||
mouseX: Double,
|
||||
mouseYSmoother: SmoothDouble,
|
||||
mouseXSmoother: SmoothDouble,
|
||||
sensitivity: Double,
|
||||
deltaTime: Double
|
||||
): Vec3 {
|
||||
if (driver !is OrientationControllable) return Vec3.ZERO
|
||||
|
||||
//Might need to add the smoothing here for default.
|
||||
val invertRoll = if (Cobblemon.config.invertRoll) -1 else 1
|
||||
val invertPitch = if (Cobblemon.config.invertPitch) -1 else 1
|
||||
return Vec3(0.0, mouseY * invertPitch, mouseX * invertRoll)
|
||||
}
|
||||
|
||||
override fun canJump(
|
||||
settings: BoatSettings,
|
||||
state: BoatState,
|
||||
vehicle: PokemonEntity,
|
||||
driver: Player
|
||||
): Boolean {
|
||||
return false
|
||||
}
|
||||
|
||||
override fun setRideBar(
|
||||
settings: BoatSettings,
|
||||
state: BoatState,
|
||||
vehicle: PokemonEntity,
|
||||
driver: Player
|
||||
): Float {
|
||||
return (state.stamina.get() / 1.0f)
|
||||
}
|
||||
|
||||
override fun jumpForce(
|
||||
settings: BoatSettings,
|
||||
state: BoatState,
|
||||
vehicle: PokemonEntity,
|
||||
driver: Player,
|
||||
jumpStrength: Int
|
||||
): Vec3 {
|
||||
return Vec3.ZERO
|
||||
}
|
||||
|
||||
override fun gravity(
|
||||
settings: BoatSettings,
|
||||
state: BoatState,
|
||||
vehicle: PokemonEntity,
|
||||
regularGravity: Double
|
||||
): Double {
|
||||
return 0.0
|
||||
}
|
||||
|
||||
override fun rideFovMultiplier(
|
||||
settings: BoatSettings,
|
||||
state: BoatState,
|
||||
vehicle: PokemonEntity,
|
||||
driver: Player
|
||||
): Float {
|
||||
if (state.rideVelocity.get().z > TOP_SPEED * 0.8) {
|
||||
return Mth.lerp((state.rideVelocity.get().z - (TOP_SPEED * 0.8)) / (TOP_SPEED * 0.2), 1.0, 1.2).toFloat()
|
||||
}
|
||||
return 1.0f
|
||||
}
|
||||
|
||||
override fun useAngVelSmoothing(settings: BoatSettings, state: BoatState, vehicle: PokemonEntity): Boolean {
|
||||
return false
|
||||
}
|
||||
|
||||
override fun useRidingAltPose(
|
||||
settings: BoatSettings,
|
||||
state: BoatState,
|
||||
vehicle: PokemonEntity,
|
||||
driver: Player
|
||||
): Boolean {
|
||||
return false
|
||||
}
|
||||
|
||||
override fun inertia(settings: BoatSettings, state: BoatState, vehicle: PokemonEntity): Double {
|
||||
return 0.5
|
||||
}
|
||||
|
||||
override fun shouldRoll(settings: BoatSettings, state: BoatState, vehicle: PokemonEntity): Boolean {
|
||||
return false
|
||||
}
|
||||
|
||||
override fun turnOffOnGround(settings: BoatSettings, state: BoatState, vehicle: PokemonEntity): Boolean {
|
||||
return false
|
||||
}
|
||||
|
||||
override fun dismountOnShift(settings: BoatSettings, state: BoatState, vehicle: PokemonEntity): Boolean {
|
||||
return false
|
||||
}
|
||||
|
||||
override fun shouldRotatePokemonHead(
|
||||
settings: BoatSettings,
|
||||
state: BoatState,
|
||||
vehicle: PokemonEntity
|
||||
): Boolean {
|
||||
return vehicle.runtime.resolveBoolean(settings.rotatePokemonHead)
|
||||
}
|
||||
|
||||
override fun shouldRotatePlayerHead(
|
||||
settings: BoatSettings,
|
||||
state: BoatState,
|
||||
vehicle: PokemonEntity
|
||||
): Boolean {
|
||||
return true
|
||||
}
|
||||
|
||||
override fun maxUpStep(settings: BoatSettings, state: BoatState, vehicle: PokemonEntity) = 0f
|
||||
|
||||
override fun createDefaultState(settings: BoatSettings) = BoatState()
|
||||
|
||||
}
|
||||
|
||||
class BoatSettings : RidingBehaviourSettings {
|
||||
override val key = BoatBehaviour.KEY
|
||||
|
||||
var terminalVelocity = "-2.0".asExpression()
|
||||
private set
|
||||
|
||||
var rotatePokemonHead = "true".asExpression()
|
||||
private set
|
||||
|
||||
override fun encode(buffer: RegistryFriendlyByteBuf) {
|
||||
buffer.writeResourceLocation(key)
|
||||
buffer.writeExpression(terminalVelocity)
|
||||
}
|
||||
|
||||
override fun decode(buffer: RegistryFriendlyByteBuf) {
|
||||
terminalVelocity = buffer.readExpression()
|
||||
}
|
||||
}
|
||||
|
||||
class BoatState : RidingBehaviourState() {
|
||||
val deltaRotation = ridingState(0.0, Side.CLIENT)
|
||||
val jumpBuffer = ridingState(-1, Side.CLIENT)
|
||||
val staminaBuffer = ridingState(0, Side.CLIENT)
|
||||
|
||||
override fun copy() = BoatState().also {
|
||||
it.deltaRotation.set(deltaRotation.get(), true)
|
||||
it.rideVelocity.set(rideVelocity.get(), true)
|
||||
it.stamina.set(stamina.get(), true)
|
||||
it.jumpBuffer.set(jumpBuffer.get(), true)
|
||||
it.staminaBuffer.set(staminaBuffer.get(), true)
|
||||
}
|
||||
|
||||
override fun shouldSync(previous: RidingBehaviourState): Boolean {
|
||||
if (previous !is BoatState) return false
|
||||
return super.shouldSync(previous)
|
||||
}
|
||||
|
||||
}
|
||||
+47
-45
@@ -6,7 +6,7 @@
|
||||
* file, You can obtain one at https://mozilla.org/MPL/2.0/.
|
||||
*/
|
||||
|
||||
package com.cobblemon.mod.common.api.riding.behaviour.types
|
||||
package com.cobblemon.mod.common.api.riding.behaviour.types.liquid
|
||||
|
||||
import com.cobblemon.mod.common.Cobblemon
|
||||
import com.cobblemon.mod.common.OrientationControllable
|
||||
@@ -19,7 +19,6 @@ import com.cobblemon.mod.common.entity.pokemon.PokemonEntity
|
||||
import com.cobblemon.mod.common.util.blockPositionsAsListRounded
|
||||
import com.cobblemon.mod.common.util.cobblemonResource
|
||||
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
|
||||
@@ -27,19 +26,22 @@ import net.minecraft.world.phys.Vec2
|
||||
import net.minecraft.world.phys.Vec3
|
||||
import net.minecraft.world.phys.shapes.Shapes
|
||||
|
||||
class SwimDashBehaviour : RidingBehaviour<SwimDashSettings, SwimDashState> {
|
||||
class BurstBehaviour : RidingBehaviour<BurstSettings, BurstState> {
|
||||
companion object {
|
||||
val KEY = cobblemonResource("swim/dash")
|
||||
val KEY = cobblemonResource("liquid/burst")
|
||||
const val DASH_TICKS: Int = 60
|
||||
}
|
||||
|
||||
override val key = KEY
|
||||
override val style = RidingStyle.LIQUID
|
||||
|
||||
val poseProvider = PoseProvider<SwimDashSettings, SwimDashState>(PoseType.FLOAT)
|
||||
override fun getRidingStyle(settings: BurstSettings, state: BurstState): RidingStyle {
|
||||
return RidingStyle.LIQUID
|
||||
}
|
||||
|
||||
val poseProvider = PoseProvider<BurstSettings, BurstState>(PoseType.FLOAT)
|
||||
.with(PoseOption(PoseType.SWIM) { _, _, entity -> entity.isSwimming && entity.entityData.get(PokemonEntity.MOVING) })
|
||||
|
||||
override fun isActive(settings: SwimDashSettings, state: SwimDashState, vehicle: PokemonEntity): Boolean {
|
||||
override fun isActive(settings: BurstSettings, state: BurstState, vehicle: PokemonEntity): Boolean {
|
||||
//This could be kinda weird... what if the top of the mon is in a fluid but the bottom isnt?
|
||||
return Shapes.create(vehicle.boundingBox).blockPositionsAsListRounded().any {
|
||||
if (vehicle.isInWater || vehicle.isUnderWater) {
|
||||
@@ -50,13 +52,13 @@ class SwimDashBehaviour : RidingBehaviour<SwimDashSettings, SwimDashState> {
|
||||
}
|
||||
}
|
||||
|
||||
override fun pose(settings: SwimDashSettings, state: SwimDashState, vehicle: PokemonEntity): PoseType {
|
||||
override fun pose(settings: BurstSettings, state: BurstState, vehicle: PokemonEntity): PoseType {
|
||||
return poseProvider.select(settings, state, vehicle)
|
||||
}
|
||||
|
||||
override fun speed(
|
||||
settings: SwimDashSettings,
|
||||
state: SwimDashState,
|
||||
settings: BurstSettings,
|
||||
state: BurstState,
|
||||
vehicle: PokemonEntity,
|
||||
driver: Player
|
||||
): Float {
|
||||
@@ -74,8 +76,8 @@ class SwimDashBehaviour : RidingBehaviour<SwimDashSettings, SwimDashState> {
|
||||
}
|
||||
|
||||
override fun rotation(
|
||||
settings: SwimDashSettings,
|
||||
state: SwimDashState,
|
||||
settings: BurstSettings,
|
||||
state: BurstState,
|
||||
vehicle: PokemonEntity,
|
||||
driver: LivingEntity
|
||||
): Vec2 {
|
||||
@@ -83,8 +85,8 @@ class SwimDashBehaviour : RidingBehaviour<SwimDashSettings, SwimDashState> {
|
||||
}
|
||||
|
||||
override fun velocity(
|
||||
settings: SwimDashSettings,
|
||||
state: SwimDashState,
|
||||
settings: BurstSettings,
|
||||
state: BurstState,
|
||||
vehicle: PokemonEntity,
|
||||
driver: Player,
|
||||
input: Vec3
|
||||
@@ -99,8 +101,8 @@ class SwimDashBehaviour : RidingBehaviour<SwimDashSettings, SwimDashState> {
|
||||
}
|
||||
|
||||
override fun angRollVel(
|
||||
settings: SwimDashSettings,
|
||||
state: SwimDashState,
|
||||
settings: BurstSettings,
|
||||
state: BurstState,
|
||||
vehicle: PokemonEntity,
|
||||
driver: Player,
|
||||
deltaTime: Double
|
||||
@@ -109,8 +111,8 @@ class SwimDashBehaviour : RidingBehaviour<SwimDashSettings, SwimDashState> {
|
||||
}
|
||||
|
||||
override fun rotationOnMouseXY(
|
||||
settings: SwimDashSettings,
|
||||
state: SwimDashState,
|
||||
settings: BurstSettings,
|
||||
state: BurstState,
|
||||
vehicle: PokemonEntity,
|
||||
driver: Player,
|
||||
mouseY: Double,
|
||||
@@ -129,8 +131,8 @@ class SwimDashBehaviour : RidingBehaviour<SwimDashSettings, SwimDashState> {
|
||||
}
|
||||
|
||||
override fun canJump(
|
||||
settings: SwimDashSettings,
|
||||
state: SwimDashState,
|
||||
settings: BurstSettings,
|
||||
state: BurstState,
|
||||
vehicle: PokemonEntity,
|
||||
driver: Player
|
||||
): Boolean {
|
||||
@@ -138,8 +140,8 @@ class SwimDashBehaviour : RidingBehaviour<SwimDashSettings, SwimDashState> {
|
||||
}
|
||||
|
||||
override fun setRideBar(
|
||||
settings: SwimDashSettings,
|
||||
state: SwimDashState,
|
||||
settings: BurstSettings,
|
||||
state: BurstState,
|
||||
vehicle: PokemonEntity,
|
||||
driver: Player
|
||||
): Float {
|
||||
@@ -147,8 +149,8 @@ class SwimDashBehaviour : RidingBehaviour<SwimDashSettings, SwimDashState> {
|
||||
}
|
||||
|
||||
override fun jumpForce(
|
||||
settings: SwimDashSettings,
|
||||
state: SwimDashState,
|
||||
settings: BurstSettings,
|
||||
state: BurstState,
|
||||
vehicle: PokemonEntity,
|
||||
driver: Player,
|
||||
jumpStrength: Int
|
||||
@@ -157,8 +159,8 @@ class SwimDashBehaviour : RidingBehaviour<SwimDashSettings, SwimDashState> {
|
||||
}
|
||||
|
||||
override fun gravity(
|
||||
settings: SwimDashSettings,
|
||||
state: SwimDashState,
|
||||
settings: BurstSettings,
|
||||
state: BurstState,
|
||||
vehicle: PokemonEntity,
|
||||
regularGravity: Double
|
||||
): Double {
|
||||
@@ -166,64 +168,64 @@ class SwimDashBehaviour : RidingBehaviour<SwimDashSettings, SwimDashState> {
|
||||
}
|
||||
|
||||
override fun rideFovMultiplier(
|
||||
settings: SwimDashSettings,
|
||||
state: SwimDashState,
|
||||
settings: BurstSettings,
|
||||
state: BurstState,
|
||||
vehicle: PokemonEntity,
|
||||
driver: Player
|
||||
): Float {
|
||||
return 1.0f
|
||||
}
|
||||
|
||||
override fun useAngVelSmoothing(settings: SwimDashSettings, state: SwimDashState, vehicle: PokemonEntity): Boolean {
|
||||
override fun useAngVelSmoothing(settings: BurstSettings, state: BurstState, vehicle: PokemonEntity): Boolean {
|
||||
return false
|
||||
}
|
||||
|
||||
override fun useRidingAltPose(
|
||||
settings: SwimDashSettings,
|
||||
state: SwimDashState,
|
||||
settings: BurstSettings,
|
||||
state: BurstState,
|
||||
vehicle: PokemonEntity,
|
||||
driver: Player
|
||||
): Boolean {
|
||||
return false
|
||||
}
|
||||
|
||||
override fun inertia(settings: SwimDashSettings, state: SwimDashState, vehicle: PokemonEntity): Double {
|
||||
override fun inertia(settings: BurstSettings, state: BurstState, vehicle: PokemonEntity): Double {
|
||||
return 0.5
|
||||
}
|
||||
|
||||
override fun shouldRoll(settings: SwimDashSettings, state: SwimDashState, vehicle: PokemonEntity): Boolean {
|
||||
override fun shouldRoll(settings: BurstSettings, state: BurstState, vehicle: PokemonEntity): Boolean {
|
||||
return false
|
||||
}
|
||||
|
||||
override fun turnOffOnGround(settings: SwimDashSettings, state: SwimDashState, vehicle: PokemonEntity): Boolean {
|
||||
override fun turnOffOnGround(settings: BurstSettings, state: BurstState, vehicle: PokemonEntity): Boolean {
|
||||
return false
|
||||
}
|
||||
|
||||
override fun dismountOnShift(settings: SwimDashSettings, state: SwimDashState, vehicle: PokemonEntity): Boolean {
|
||||
override fun dismountOnShift(settings: BurstSettings, state: BurstState, vehicle: PokemonEntity): Boolean {
|
||||
return false
|
||||
}
|
||||
|
||||
override fun shouldRotatePokemonHead(
|
||||
settings: SwimDashSettings,
|
||||
state: SwimDashState,
|
||||
settings: BurstSettings,
|
||||
state: BurstState,
|
||||
vehicle: PokemonEntity
|
||||
): Boolean {
|
||||
return false
|
||||
}
|
||||
|
||||
override fun shouldRotatePlayerHead(
|
||||
settings: SwimDashSettings,
|
||||
state: SwimDashState,
|
||||
settings: BurstSettings,
|
||||
state: BurstState,
|
||||
vehicle: PokemonEntity
|
||||
): Boolean {
|
||||
return false
|
||||
}
|
||||
|
||||
override fun createDefaultState(settings: SwimDashSettings) = SwimDashState()
|
||||
override fun createDefaultState(settings: BurstSettings) = BurstState()
|
||||
}
|
||||
|
||||
class SwimDashSettings : RidingBehaviourSettings {
|
||||
override val key = SwimDashBehaviour.KEY
|
||||
class BurstSettings : RidingBehaviourSettings {
|
||||
override val key = BurstBehaviour.KEY
|
||||
|
||||
var dashSpeed = 1F
|
||||
private set
|
||||
@@ -238,7 +240,7 @@ class SwimDashSettings : RidingBehaviourSettings {
|
||||
}
|
||||
}
|
||||
|
||||
class SwimDashState : RidingBehaviourState() {
|
||||
class BurstState : RidingBehaviourState() {
|
||||
var dashing = ridingState(false, Side.BOTH)
|
||||
var ticks = ridingState(0, Side.BOTH)
|
||||
|
||||
@@ -249,10 +251,10 @@ class SwimDashState : RidingBehaviourState() {
|
||||
}
|
||||
|
||||
override fun toString(): String {
|
||||
return "SwimDashState(dashing=${dashing.get()}, ticks=${ticks.get()})"
|
||||
return "BurstState(dashing=${dashing.get()}, ticks=${ticks.get()})"
|
||||
}
|
||||
|
||||
override fun copy() = SwimDashState().also {
|
||||
override fun copy() = BurstState().also {
|
||||
it.rideVelocity.set(rideVelocity.get(), forced = true)
|
||||
it.stamina.set(stamina.get(), forced = true)
|
||||
it.dashing.set(dashing.get(), forced = true)
|
||||
+6
-3
@@ -6,7 +6,7 @@
|
||||
* file, You can obtain one at https://mozilla.org/MPL/2.0/.
|
||||
*/
|
||||
|
||||
package com.cobblemon.mod.common.api.riding.behaviour.types
|
||||
package com.cobblemon.mod.common.api.riding.behaviour.types.liquid
|
||||
|
||||
import com.bedrockk.molang.runtime.value.DoubleValue
|
||||
import com.cobblemon.mod.common.Cobblemon
|
||||
@@ -31,11 +31,14 @@ import kotlin.math.sin
|
||||
|
||||
class DolphinBehaviour : RidingBehaviour<DolphinSettings, DolphinState> {
|
||||
companion object {
|
||||
val KEY = cobblemonResource("swim/dolphin")
|
||||
val KEY = cobblemonResource("liquid/dolphin")
|
||||
}
|
||||
|
||||
override val key = KEY
|
||||
override val style = RidingStyle.LIQUID
|
||||
|
||||
override fun getRidingStyle(settings: DolphinSettings, state: DolphinState): RidingStyle {
|
||||
return RidingStyle.LIQUID
|
||||
}
|
||||
|
||||
val poseProvider = PoseProvider<DolphinSettings, DolphinState>(PoseType.FLOAT)
|
||||
.with(PoseOption(PoseType.SWIM) { _, _, entity -> entity.entityData.get(PokemonEntity.MOVING) })
|
||||
+382
@@ -0,0 +1,382 @@
|
||||
/*
|
||||
* 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.liquid
|
||||
|
||||
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.api.riding.stats.RidingStat
|
||||
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.util.Mth
|
||||
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
|
||||
import net.minecraft.world.phys.shapes.Shapes
|
||||
import kotlin.math.abs
|
||||
import kotlin.math.max
|
||||
import kotlin.math.min
|
||||
|
||||
class SubmarineBehaviour : RidingBehaviour<SubmarineSettings, SubmarineState> {
|
||||
companion object {
|
||||
val KEY = cobblemonResource("liquid/submarine")
|
||||
val TOP_SPEED = 2.0
|
||||
}
|
||||
|
||||
override val key = KEY
|
||||
|
||||
override fun getRidingStyle(settings: SubmarineSettings, state: SubmarineState): RidingStyle {
|
||||
return RidingStyle.LIQUID
|
||||
}
|
||||
|
||||
val poseProvider = PoseProvider<SubmarineSettings, SubmarineState>(PoseType.FLOAT)
|
||||
.with(PoseOption(PoseType.SWIM) { _, _, entity -> entity.isSwimming && entity.entityData.get(PokemonEntity.MOVING) })
|
||||
|
||||
override fun isActive(settings: SubmarineSettings, state: SubmarineState, vehicle: PokemonEntity): Boolean {
|
||||
if (state.jumpBuffer.get() != -1) {
|
||||
return true
|
||||
}
|
||||
return Shapes.create(vehicle.boundingBox).blockPositionsAsListRounded().any {
|
||||
if (vehicle.isInWater || vehicle.isUnderWater) {
|
||||
return@any true
|
||||
}
|
||||
val blockState = vehicle.level().getBlockState(it)
|
||||
return@any !blockState.fluidState.isEmpty
|
||||
}
|
||||
}
|
||||
|
||||
override fun tick(
|
||||
settings: SubmarineSettings,
|
||||
state: SubmarineState,
|
||||
vehicle: PokemonEntity,
|
||||
driver: Player,
|
||||
input: Vec3
|
||||
) {
|
||||
if (state.jumpBuffer.get() > 5) {
|
||||
if ((vehicle.isInWater || vehicle.isUnderWater || vehicle.onGround())) {
|
||||
state.jumpBuffer.set(-1)
|
||||
}
|
||||
}
|
||||
else if (state.jumpBuffer.get() > -1) {
|
||||
state.jumpBuffer.set(state.jumpBuffer.get() + 1)
|
||||
}
|
||||
|
||||
if (driver.zza == 0f && (vehicle.isInWater || vehicle.isUnderWater)) {
|
||||
if (state.staminaBuffer.get() >= 20) {
|
||||
val staminaIncrease = vehicle.getRideStat(RidingStat.STAMINA, RidingStyle.LIQUID, 1.0, 2.0)
|
||||
state.stamina.set(min(1.0f, state.stamina.get() + 0.01f * staminaIncrease.toFloat()))
|
||||
}
|
||||
}
|
||||
else if (abs(state.rideVelocity.get().z) > 0.1) {
|
||||
consumeStamina(vehicle, state, 0.01f)
|
||||
}
|
||||
state.staminaBuffer.set(state.staminaBuffer.get() + 1)
|
||||
super.tick(settings, state, vehicle, driver, input)
|
||||
}
|
||||
|
||||
override fun pose(settings: SubmarineSettings, state: SubmarineState, vehicle: PokemonEntity): PoseType {
|
||||
return poseProvider.select(settings, state, vehicle)
|
||||
}
|
||||
|
||||
override fun speed(settings: SubmarineSettings, state: SubmarineState, vehicle: PokemonEntity, driver: Player): Float {
|
||||
return state.rideVelocity.get().length().toFloat()
|
||||
}
|
||||
|
||||
override fun rotation(
|
||||
settings: SubmarineSettings,
|
||||
state: SubmarineState,
|
||||
vehicle: PokemonEntity,
|
||||
driver: LivingEntity
|
||||
): Vec2 {
|
||||
state.deltaRotation.set(state.deltaRotation.get() * 0.8)
|
||||
return Vec2(vehicle.xRot, vehicle.yRot + state.deltaRotation.get().toFloat())
|
||||
}
|
||||
|
||||
override fun velocity(
|
||||
settings: SubmarineSettings,
|
||||
state: SubmarineState,
|
||||
vehicle: PokemonEntity,
|
||||
driver: Player,
|
||||
input: Vec3
|
||||
): Vec3 {
|
||||
applyStrafeRotation(vehicle, driver, state)
|
||||
|
||||
var velocity = state.rideVelocity.get()
|
||||
velocity = applyVelocityFromInput(velocity, vehicle, driver, state)
|
||||
velocity = applyGravity(velocity, vehicle, settings, state)
|
||||
velocity = applyJump(velocity, vehicle, driver, state)
|
||||
state.rideVelocity.set(velocity)
|
||||
return state.rideVelocity.get()
|
||||
}
|
||||
|
||||
private fun applyVelocityFromInput(velocity: Vec3, vehicle: PokemonEntity, driver: Player, state: SubmarineState): Vec3 {
|
||||
val speed = vehicle.getRideStat(RidingStat.SPEED, RidingStyle.LIQUID, 0.8, TOP_SPEED)
|
||||
val acceleration = vehicle.getRideStat(RidingStat.ACCELERATION, RidingStyle.LIQUID, 0.05, 0.5)
|
||||
|
||||
if (state.jumpBuffer.get() != -1 || !(vehicle.isInWater || vehicle.isUnderWater)) {
|
||||
return velocity
|
||||
}
|
||||
|
||||
val forwardInput = driver.zza.toDouble()
|
||||
val delta = when {
|
||||
!hasStamina(state) || forwardInput == 0.0 -> -velocity.z * 0.04
|
||||
forwardInput < 0.0 -> when {
|
||||
velocity.z < 0.0 -> forwardInput * acceleration * 0.5
|
||||
else -> min(forwardInput * acceleration * 0.5, -velocity.z * 0.04) // We never want it to be slower to reverse than no input
|
||||
}
|
||||
else -> forwardInput * acceleration
|
||||
}
|
||||
|
||||
return Vec3(
|
||||
velocity.x,
|
||||
velocity.y,
|
||||
Mth.clamp(velocity.z + delta, -speed * 0.25, speed)
|
||||
)
|
||||
}
|
||||
|
||||
private fun applyJump(velocity: Vec3, vehicle: PokemonEntity, driver: Player, state: SubmarineState): Vec3 {
|
||||
if (!driver.jumping) return velocity // Not jumping
|
||||
if (state.jumpBuffer.get() != -1) return velocity // Already jumped very recently
|
||||
if (!hasStamina(state)) return velocity // Has no stamina
|
||||
|
||||
val jumpStrength = vehicle.getRideStat(RidingStat.JUMP, RidingStyle.LIQUID, 1.0, 2.5)
|
||||
state.jumpBuffer.set(0)
|
||||
consumeStamina(vehicle, state, 0.05f)
|
||||
return Vec3(velocity.x, velocity.y + jumpStrength, velocity.z)
|
||||
}
|
||||
|
||||
private fun applyGravity(velocity: Vec3, vehicle: PokemonEntity, settings: SubmarineSettings, state: SubmarineState): Vec3 {
|
||||
if (state.jumpBuffer.get() == -1 && vehicle.isInWater || vehicle.isUnderWater) {
|
||||
return Vec3(velocity.x, -0.05, velocity.z)
|
||||
}
|
||||
val terminalVelocity = vehicle.runtime.resolveDouble(settings.terminalVelocity)
|
||||
val gravity = (9.8 / ( 20.0)) * 0.2
|
||||
return Vec3(velocity.x, max(velocity.y - gravity, terminalVelocity), velocity.z)
|
||||
}
|
||||
|
||||
private fun applyStrafeRotation(vehicle: PokemonEntity, driver: Player, state: SubmarineState) {
|
||||
val skill = vehicle.getRideStat(RidingStat.SKILL, RidingStyle.LIQUID, 0.5, 1.5)
|
||||
val strafe = driver.xxa
|
||||
if (abs(strafe) > 0) {
|
||||
val increase = if (strafe > 0) -1 else 1
|
||||
state.deltaRotation.set(state.deltaRotation.get() + increase * skill)
|
||||
}
|
||||
}
|
||||
|
||||
private fun hasStamina(state: SubmarineState): Boolean {
|
||||
return state.stamina.get() != 0f
|
||||
}
|
||||
|
||||
private fun consumeStamina(vehicle: PokemonEntity, state: SubmarineState, drain: Float) {
|
||||
val stamina = vehicle.getRideStat(RidingStat.STAMINA, RidingStyle.LIQUID, 1.0, 5.0)
|
||||
state.stamina.set(max(0f, state.stamina.get() - drain / stamina.toFloat()))
|
||||
state.staminaBuffer.set(0)
|
||||
}
|
||||
|
||||
override fun updatePassengerRotation(
|
||||
settings: SubmarineSettings,
|
||||
state: SubmarineState,
|
||||
vehicle: PokemonEntity,
|
||||
driver: LivingEntity
|
||||
) {
|
||||
driver.yRot += state.deltaRotation.get().toFloat() * 0.887f
|
||||
driver.yHeadRot += state.deltaRotation.get().toFloat() * 0.887f
|
||||
clampPassengerRotation(settings, state, vehicle, driver)
|
||||
}
|
||||
|
||||
override fun clampPassengerRotation(
|
||||
settings: SubmarineSettings,
|
||||
state: SubmarineState,
|
||||
vehicle: PokemonEntity,
|
||||
driver: LivingEntity
|
||||
) {
|
||||
driver.setYBodyRot(vehicle.yRot)
|
||||
val f: Float = Mth.wrapDegrees(driver.yRot - vehicle.yRot)
|
||||
val g = Mth.clamp(f, -105.0f, 105.0f)
|
||||
driver.yRotO += g - f
|
||||
driver.yRot = driver.yRot + g - f
|
||||
driver.setYHeadRot(driver.yRot)
|
||||
vehicle.setYHeadRot(driver.yRot)
|
||||
}
|
||||
|
||||
override fun angRollVel(
|
||||
settings: SubmarineSettings,
|
||||
state: SubmarineState,
|
||||
vehicle: PokemonEntity,
|
||||
driver: Player,
|
||||
deltaTime: Double
|
||||
): Vec3 {
|
||||
return Vec3.ZERO
|
||||
}
|
||||
|
||||
override fun rotationOnMouseXY(
|
||||
settings: SubmarineSettings,
|
||||
state: SubmarineState,
|
||||
vehicle: PokemonEntity,
|
||||
driver: Player,
|
||||
mouseY: Double,
|
||||
mouseX: Double,
|
||||
mouseYSmoother: SmoothDouble,
|
||||
mouseXSmoother: SmoothDouble,
|
||||
sensitivity: Double,
|
||||
deltaTime: Double
|
||||
): Vec3 {
|
||||
if (driver !is OrientationControllable) return Vec3.ZERO
|
||||
|
||||
//Might need to add the smoothing here for default.
|
||||
val invertRoll = if (Cobblemon.config.invertRoll) -1 else 1
|
||||
val invertPitch = if (Cobblemon.config.invertPitch) -1 else 1
|
||||
return Vec3(0.0, mouseY * invertPitch, mouseX * invertRoll)
|
||||
}
|
||||
|
||||
override fun canJump(
|
||||
settings: SubmarineSettings,
|
||||
state: SubmarineState,
|
||||
vehicle: PokemonEntity,
|
||||
driver: Player
|
||||
): Boolean {
|
||||
return false
|
||||
}
|
||||
|
||||
override fun setRideBar(
|
||||
settings: SubmarineSettings,
|
||||
state: SubmarineState,
|
||||
vehicle: PokemonEntity,
|
||||
driver: Player
|
||||
): Float {
|
||||
return (state.stamina.get() / 1.0f)
|
||||
}
|
||||
|
||||
override fun jumpForce(
|
||||
settings: SubmarineSettings,
|
||||
state: SubmarineState,
|
||||
vehicle: PokemonEntity,
|
||||
driver: Player,
|
||||
jumpStrength: Int
|
||||
): Vec3 {
|
||||
return Vec3.ZERO
|
||||
}
|
||||
|
||||
override fun gravity(
|
||||
settings: SubmarineSettings,
|
||||
state: SubmarineState,
|
||||
vehicle: PokemonEntity,
|
||||
regularGravity: Double
|
||||
): Double {
|
||||
return 0.0
|
||||
}
|
||||
|
||||
override fun rideFovMultiplier(
|
||||
settings: SubmarineSettings,
|
||||
state: SubmarineState,
|
||||
vehicle: PokemonEntity,
|
||||
driver: Player
|
||||
): Float {
|
||||
if (state.rideVelocity.get().z > TOP_SPEED * 0.8) {
|
||||
return Mth.lerp((state.rideVelocity.get().z - (TOP_SPEED * 0.8)) / (TOP_SPEED * 0.2), 1.0, 1.2).toFloat()
|
||||
}
|
||||
return 1.0f
|
||||
}
|
||||
|
||||
override fun useAngVelSmoothing(settings: SubmarineSettings, state: SubmarineState, vehicle: PokemonEntity): Boolean {
|
||||
return false
|
||||
}
|
||||
|
||||
override fun useRidingAltPose(
|
||||
settings: SubmarineSettings,
|
||||
state: SubmarineState,
|
||||
vehicle: PokemonEntity,
|
||||
driver: Player
|
||||
): Boolean {
|
||||
return false
|
||||
}
|
||||
|
||||
override fun inertia(settings: SubmarineSettings, state: SubmarineState, vehicle: PokemonEntity): Double {
|
||||
return 0.5
|
||||
}
|
||||
|
||||
override fun shouldRoll(settings: SubmarineSettings, state: SubmarineState, vehicle: PokemonEntity): Boolean {
|
||||
return false
|
||||
}
|
||||
|
||||
override fun turnOffOnGround(settings: SubmarineSettings, state: SubmarineState, vehicle: PokemonEntity): Boolean {
|
||||
return false
|
||||
}
|
||||
|
||||
override fun dismountOnShift(settings: SubmarineSettings, state: SubmarineState, vehicle: PokemonEntity): Boolean {
|
||||
return false
|
||||
}
|
||||
|
||||
override fun shouldRotatePokemonHead(
|
||||
settings: SubmarineSettings,
|
||||
state: SubmarineState,
|
||||
vehicle: PokemonEntity
|
||||
): Boolean {
|
||||
return vehicle.runtime.resolveBoolean(settings.rotatePokemonHead)
|
||||
}
|
||||
|
||||
override fun shouldRotatePlayerHead(
|
||||
settings: SubmarineSettings,
|
||||
state: SubmarineState,
|
||||
vehicle: PokemonEntity
|
||||
): Boolean {
|
||||
return true
|
||||
}
|
||||
|
||||
override fun maxUpStep(settings: SubmarineSettings, state: SubmarineState, vehicle: PokemonEntity) = 0f
|
||||
|
||||
override fun createDefaultState(settings: SubmarineSettings) = SubmarineState()
|
||||
|
||||
}
|
||||
|
||||
class SubmarineSettings : RidingBehaviourSettings {
|
||||
override val key = SubmarineBehaviour.KEY
|
||||
|
||||
var terminalVelocity = "-2.0".asExpression()
|
||||
private set
|
||||
|
||||
var rotatePokemonHead = "true".asExpression()
|
||||
private set
|
||||
|
||||
override fun encode(buffer: RegistryFriendlyByteBuf) {
|
||||
buffer.writeResourceLocation(key)
|
||||
buffer.writeExpression(terminalVelocity)
|
||||
}
|
||||
|
||||
override fun decode(buffer: RegistryFriendlyByteBuf) {
|
||||
terminalVelocity = buffer.readExpression()
|
||||
}
|
||||
}
|
||||
|
||||
class SubmarineState : RidingBehaviourState() {
|
||||
val deltaRotation = ridingState(0.0, Side.CLIENT)
|
||||
val jumpBuffer = ridingState(-1, Side.CLIENT)
|
||||
val staminaBuffer = ridingState(0, Side.CLIENT)
|
||||
|
||||
override fun copy() = SubmarineState().also {
|
||||
it.deltaRotation.set(deltaRotation.get(), true)
|
||||
it.rideVelocity.set(rideVelocity.get(), true)
|
||||
it.stamina.set(stamina.get(), true)
|
||||
it.jumpBuffer.set(jumpBuffer.get(), true)
|
||||
it.staminaBuffer.set(staminaBuffer.get(), true)
|
||||
}
|
||||
|
||||
override fun shouldSync(previous: RidingBehaviourState): Boolean {
|
||||
if (previous !is SubmarineState) return false
|
||||
return super.shouldSync(previous)
|
||||
}
|
||||
|
||||
}
|
||||
+143
@@ -0,0 +1,143 @@
|
||||
/*
|
||||
* 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.util
|
||||
|
||||
import com.cobblemon.mod.common.OrientationControllable
|
||||
import com.cobblemon.mod.common.entity.pokemon.PokemonEntity
|
||||
import com.cobblemon.mod.common.util.math.geometry.toRadians
|
||||
import net.minecraft.util.Mth
|
||||
import net.minecraft.world.phys.Vec3
|
||||
import org.joml.Matrix3f
|
||||
import org.joml.Quaternionf
|
||||
import org.joml.Vector3f
|
||||
|
||||
/**
|
||||
* Class to handle the updating and containment of ride data used in animation.
|
||||
*
|
||||
* @author Jackowes
|
||||
* @since April 7th, 2025
|
||||
*/
|
||||
|
||||
|
||||
class RidingAnimationData
|
||||
{
|
||||
var prevOrientation: Matrix3f = Matrix3f()
|
||||
var prevRot: Vec3 = Vec3.ZERO
|
||||
var velocitySpring: Vec3Spring = Vec3Spring()
|
||||
var rotSpring: Vec3Spring = Vec3Spring()
|
||||
var rotDeltaSpring: Vec3Spring = Vec3Spring()
|
||||
var localVelocitySpring: Vec3Spring = Vec3Spring()
|
||||
|
||||
fun update(entity: PokemonEntity) {
|
||||
|
||||
var currRot = Vec3.ZERO
|
||||
var angDelta = Vec3.ZERO
|
||||
|
||||
// val stiffness = 90.0
|
||||
// val damping = 18.0
|
||||
val stiffness = 16.0
|
||||
val damping = 8.0
|
||||
|
||||
// Update velocity first
|
||||
val currentVelocity = Vec3(
|
||||
entity.x - entity.xOld,
|
||||
entity.y - entity.yOld,
|
||||
entity.z - entity.zOld
|
||||
)
|
||||
|
||||
val r = entity.ifRidingAvailableSupply(false) { behaviour, settings, state ->
|
||||
behaviour.shouldRoll(settings, state, entity);
|
||||
}
|
||||
if( r ) {
|
||||
//TODO: should this return?
|
||||
val controller = (entity.firstPassenger as? OrientationControllable)?.orientationController ?: return
|
||||
val orientation = controller.orientation ?: Matrix3f()
|
||||
|
||||
val currPitch = controller.pitch
|
||||
val currYaw = controller.yaw
|
||||
val currRoll = controller.roll
|
||||
currRot = Vec3(currPitch.toDouble(), currYaw.toDouble(), currRoll.toDouble())
|
||||
|
||||
val currOrientation = orientation
|
||||
|
||||
/******************************************************
|
||||
* Calculate current 3d euler rotation deltas in the
|
||||
* entities local space
|
||||
*****************************************************/
|
||||
|
||||
// Get current and previous orientation as quaternions
|
||||
val currQuat = Quaternionf().setFromUnnormalized(currOrientation)
|
||||
val prevQuat = Quaternionf().setFromUnnormalized(prevOrientation)
|
||||
|
||||
// Compute deltaQuat = current * inverse(previous)
|
||||
val deltaQuat = Quaternionf(currQuat).mul(Quaternionf(prevQuat).invert())
|
||||
|
||||
// Transform delta into the local space of the current orientation
|
||||
val localDeltaQuat = Quaternionf(currQuat).invert().mul(deltaQuat).mul(currQuat)
|
||||
|
||||
// Convert delta rotation to Euler angles
|
||||
val euler = Vector3f()
|
||||
localDeltaQuat.getEulerAnglesXYZ(euler) // Angles are in radians
|
||||
|
||||
// Convert to degrees
|
||||
val pitchDegrees = Math.toDegrees(euler.x.toDouble()) // Rotation around X axis = pitch
|
||||
val yawDegrees = Math.toDegrees(euler.y.toDouble()) // Rotation around Y axis = yaw
|
||||
val rollDegrees = Math.toDegrees(euler.z.toDouble()) // Rotation around Z axis = roll
|
||||
//Scale rotation delta by 20 to represent degree per second instead of tick
|
||||
angDelta = Vec3(pitchDegrees, yawDegrees, rollDegrees).scale(20.0)
|
||||
|
||||
/******************************************************
|
||||
* Calculate ride local velocity
|
||||
*****************************************************/
|
||||
val velocityWorldF = Vector3f(currentVelocity.x.toFloat(), currentVelocity.y.toFloat(), currentVelocity.z.toFloat())
|
||||
|
||||
val localVelocityF = Matrix3f(orientation).transpose().transform(velocityWorldF)
|
||||
val localVelocity = Vec3(localVelocityF.x.toDouble(), localVelocityF.y.toDouble(), localVelocityF.z.toDouble())
|
||||
|
||||
localVelocitySpring.update(localVelocity, stiffness, damping)
|
||||
|
||||
// Update previous values
|
||||
prevOrientation.set(currOrientation)
|
||||
} else {
|
||||
val currPitch = entity.xRot
|
||||
val currYaw = entity.yRot
|
||||
val currRoll = 0.0f
|
||||
currRot = Vec3(currPitch.toDouble(), currYaw.toDouble(), currRoll.toDouble())
|
||||
|
||||
//Scale rotation delta by 20 to represent degree per second instead of tick
|
||||
angDelta = Vec3(
|
||||
(currRot.x - prevRot.x),
|
||||
Mth.degreesDifference(currRot.y.toFloat(), prevRot.y.toFloat()).toDouble(),
|
||||
Mth.degreesDifference(currRot.z.toFloat(), prevRot.z.toFloat()).toDouble()
|
||||
).scale(20.0)
|
||||
|
||||
/******************************************************
|
||||
* Calculate ride local velocity
|
||||
*****************************************************/
|
||||
val yaw360 = -1.0 * (entity.yRot + 360.0f) % 360.0f
|
||||
val orientationNonRollable = Matrix3f().rotateY(yaw360.toRadians())
|
||||
|
||||
//Convert to Vector3f
|
||||
var velocityWorldF = Vector3f(currentVelocity.x.toFloat(), currentVelocity.y.toFloat(), currentVelocity.z.toFloat())
|
||||
|
||||
val localVelocityF = Matrix3f(orientationNonRollable).transpose().transform(velocityWorldF)
|
||||
val localVelocity = Vec3(localVelocityF.x.toDouble(), localVelocityF.y.toDouble(), localVelocityF.z.toDouble())
|
||||
|
||||
localVelocitySpring.update(localVelocity, stiffness, damping)
|
||||
}
|
||||
|
||||
/******************************************************
|
||||
* Update springs
|
||||
*****************************************************/
|
||||
rotDeltaSpring.update(angDelta, stiffness, damping)
|
||||
velocitySpring.update(currentVelocity, stiffness, damping)
|
||||
rotSpring.update(currRot, stiffness, damping)
|
||||
prevRot = currRot
|
||||
}
|
||||
}
|
||||
@@ -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.util
|
||||
|
||||
import net.minecraft.world.phys.Vec3
|
||||
import kotlin.math.min
|
||||
|
||||
/**
|
||||
* A spring-based smoother for Vec3 values, designed for applying damped spring motion to riding data.
|
||||
* Stores the previous and current values, along with a history buffer for lookback-based interpolation.
|
||||
*
|
||||
* @author Jackowes
|
||||
* @since March 27th, 2025
|
||||
*/
|
||||
|
||||
|
||||
class Vec3Spring(
|
||||
var value: Vec3 = Vec3.ZERO,
|
||||
var velocity: Vec3 = Vec3.ZERO
|
||||
) {
|
||||
val history = ArrayDeque<Vec3>()
|
||||
//Hold up to a seconds worth of values
|
||||
val lookBackSize = 20
|
||||
|
||||
fun update(target: Vec3, stiffness: Double, damping: Double) {
|
||||
|
||||
//Hooke's Law f = kx where:
|
||||
//f is force
|
||||
//k is the spring constant or stiffness of this spring
|
||||
//x is the distance from rest and in this case the difference between the most recent
|
||||
//rotation delta ( the target ) and the springs current value for delta rot
|
||||
val force = target.subtract(value).scale(stiffness)
|
||||
|
||||
//Now calculate acceleration and apply damping
|
||||
val accel = force.subtract(velocity.scale(damping))
|
||||
|
||||
velocity = velocity.add(accel.scale(1.0/20.0))
|
||||
value = value.add(velocity.scale(1.0/20.0))
|
||||
|
||||
history.addFirst(value)
|
||||
//Adding one since if we want to check max look back point it needs something to interp with.
|
||||
if( history.size > lookBackSize + 1) {
|
||||
history.removeLast()
|
||||
}
|
||||
}
|
||||
|
||||
fun getInterpolated(partialTick: Double, lookBackTick: Int): Vec3 {
|
||||
if (history.size < 2) {
|
||||
return value // or Vec3.ZERO if you prefer
|
||||
}
|
||||
|
||||
val tick = min(lookBackTick, history.size - 2)
|
||||
var ret = Vec3.ZERO
|
||||
for( i in 0..tick) {
|
||||
val older = history.get(i + 1).scale(1.0)
|
||||
val newer = history.get(i).scale(1.0)
|
||||
ret = ret.add(older.add(newer.subtract(older).scale(partialTick)))
|
||||
}
|
||||
|
||||
return ret.scale(1.0/(tick+1))
|
||||
}
|
||||
}
|
||||
+30
-8
@@ -14,6 +14,7 @@ import com.cobblemon.mod.common.api.spawning.spawner.PlayerSpawnerFactory
|
||||
import com.cobblemon.mod.common.platform.events.PlatformEvents
|
||||
import com.cobblemon.mod.common.util.server
|
||||
import com.cobblemon.mod.common.world.gamerules.CobblemonGameRules
|
||||
import net.minecraft.server.level.ServerLevel
|
||||
import java.util.UUID
|
||||
import net.minecraft.server.level.ServerPlayer
|
||||
|
||||
@@ -32,24 +33,45 @@ object CobblemonWorldSpawnerManager : SpawnerManager() {
|
||||
init {
|
||||
PlatformEvents.SERVER_PLAYER_LOGIN.subscribe { this.onPlayerLogin(it.player) }
|
||||
PlatformEvents.SERVER_PLAYER_LOGOUT.subscribe { this.onPlayerLogout(it.player) }
|
||||
PlatformEvents.CHANGE_DIMENSION.subscribe { this.onDimensionChange(it.player, it.origin, it.destination) }
|
||||
}
|
||||
|
||||
fun onPlayerLogin(player: ServerPlayer) {
|
||||
// Disables spawning
|
||||
if (!Cobblemon.config.enableSpawning || server()?.gameRules?.getBoolean(CobblemonGameRules.DO_POKEMON_SPAWNING) == false) {
|
||||
if (!Cobblemon.config.enableSpawning || player.level().gameRules.getBoolean(CobblemonGameRules.DO_POKEMON_SPAWNING) == false) {
|
||||
return;
|
||||
}
|
||||
|
||||
val spawner = PlayerSpawnerFactory.create(this, player)
|
||||
spawnersForPlayers[player.uuid] = spawner
|
||||
registerSpawner(spawner)
|
||||
registerPlayerSpawner(player)
|
||||
}
|
||||
|
||||
fun onPlayerLogout(player: ServerPlayer) {
|
||||
val spawner = spawnersForPlayers[player.uuid]
|
||||
if (spawner != null) {
|
||||
spawnersForPlayers.remove(player.uuid)
|
||||
unregisterSpawner(spawner)
|
||||
unregisterPlayerSpawner(player)
|
||||
}
|
||||
|
||||
fun onDimensionChange(player: ServerPlayer, origin: ServerLevel?, destination: ServerLevel?) {
|
||||
fun getSpawnRule(level: ServerLevel?) = level?.gameRules?.getBoolean(CobblemonGameRules.DO_POKEMON_SPAWNING)
|
||||
|
||||
if (!Cobblemon.config.enableSpawning || getSpawnRule(origin) == getSpawnRule(destination)) {
|
||||
return
|
||||
}
|
||||
|
||||
val spawnerAction = if (destination?.gameRules?.getBoolean(CobblemonGameRules.DO_POKEMON_SPAWNING) == false) {
|
||||
::unregisterPlayerSpawner
|
||||
} else {
|
||||
::registerPlayerSpawner
|
||||
}
|
||||
spawnerAction(player)
|
||||
}
|
||||
|
||||
private fun unregisterPlayerSpawner(player: ServerPlayer) {
|
||||
spawnersForPlayers.remove(player.uuid)?.let { unregisterSpawner(it) }
|
||||
}
|
||||
|
||||
private fun registerPlayerSpawner(player: ServerPlayer) {
|
||||
PlayerSpawnerFactory.create(this, player).also {
|
||||
spawnersForPlayers[player.uuid] = it
|
||||
registerSpawner(it)
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -71,10 +71,15 @@ open class SpawnerManager {
|
||||
|
||||
open fun onServerTick() {
|
||||
// Disables spawning
|
||||
if (!Cobblemon.config.enableSpawning || server()?.gameRules?.getBoolean(DO_POKEMON_SPAWNING) == false) {
|
||||
if (!Cobblemon.config.enableSpawning) {
|
||||
return
|
||||
}
|
||||
influences.removeIf { it.isExpired() }
|
||||
getSpawnersOfType<TickingSpawner>().forEach(TickingSpawner::tick)
|
||||
getSpawnersOfType<TickingSpawner>().forEach {
|
||||
if (it.getCauseEntity()?.level()?.gameRules?.getBoolean(DO_POKEMON_SPAWNING) == false) {
|
||||
return@forEach
|
||||
}
|
||||
it.tick()
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -55,6 +55,7 @@ class SpawnPool(val name: String) : JsonDataRegistry<SpawnSet>, Iterable<SpawnDe
|
||||
CobblemonSpawnPools.onServerLoad(server)
|
||||
}
|
||||
precalculate()
|
||||
this.observable.emit(this)
|
||||
}
|
||||
|
||||
val details = mutableListOf<SpawnDetail>()
|
||||
|
||||
@@ -58,8 +58,8 @@ class NPCClientDelegate : PosableState(), NPCSideDelegate {
|
||||
|
||||
override fun addToStruct(struct: QueryStruct) {
|
||||
super.addToStruct(struct)
|
||||
struct.addFunctions(functions.functions)
|
||||
struct.addFunctions(ClientMoLangFunctions.clientFunctions)
|
||||
struct.addFunctions(functions.functions)
|
||||
runtime.environment.query.addFunctions(struct.functions)
|
||||
}
|
||||
}
|
||||
+1
-1
@@ -340,8 +340,8 @@ class PokemonClientDelegate : PosableState(), PokemonSideDelegate {
|
||||
|
||||
override fun addToStruct(struct: QueryStruct) {
|
||||
super.addToStruct(struct)
|
||||
struct.addFunctions(functions.functions)
|
||||
struct.addFunctions(ClientMoLangFunctions.clientFunctions)
|
||||
struct.addFunctions(functions.functions)
|
||||
runtime.environment.query = struct
|
||||
}
|
||||
|
||||
|
||||
@@ -75,6 +75,7 @@ fun drawProfilePokemon(
|
||||
scale: Float = 20F,
|
||||
applyProfileTransform: Boolean = true,
|
||||
applyBaseScale: Boolean = false,
|
||||
doQuirks: Boolean = false,
|
||||
r: Float = 1F,
|
||||
g: Float = 1F,
|
||||
b: Float = 1F,
|
||||
@@ -101,7 +102,7 @@ fun drawProfilePokemon(
|
||||
context.put(RenderContext.ASPECTS, state.currentAspects)
|
||||
context.put(RenderContext.RENDER_STATE, RenderContext.RenderState.PROFILE)
|
||||
context.put(RenderContext.POSABLE_STATE, state)
|
||||
context.put(RenderContext.DO_QUIRKS, false)
|
||||
context.put(RenderContext.DO_QUIRKS, doQuirks)
|
||||
|
||||
state.currentModel = model
|
||||
|
||||
|
||||
@@ -321,6 +321,7 @@ class BattleOverlay : Gui(Minecraft.getInstance()), Schedulable {
|
||||
scale = 18F * (ballState?.scale ?: 1F) * if (isCompact) 0.65F else 1.0f,
|
||||
contextScale = species.getForm(state.currentAspects).baseScale,
|
||||
reversed = reversed,
|
||||
doQuirks = false,
|
||||
state = state,
|
||||
partialTicks = partialTicks
|
||||
)
|
||||
|
||||
+1
@@ -254,6 +254,7 @@ class BattleSwitchPokemonSelection(
|
||||
matrixStack = matrixStack,
|
||||
rotation = Quaternionf().fromEulerXYZDegrees(Vector3f(13F, 35F, 0F)),
|
||||
state = state,
|
||||
doQuirks = false,
|
||||
scale = 4.5F,
|
||||
partialTicks = deltaTicks
|
||||
)
|
||||
|
||||
+304
@@ -0,0 +1,304 @@
|
||||
/*
|
||||
* 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.gui.debug.riding
|
||||
|
||||
import com.cobblemon.mod.common.CobblemonNetwork
|
||||
import com.cobblemon.mod.common.api.riding.RidingStyle
|
||||
import com.cobblemon.mod.common.api.riding.stats.RidingStat
|
||||
import com.cobblemon.mod.common.api.text.text
|
||||
import com.cobblemon.mod.common.client.gui.CobblemonRenderable
|
||||
import com.cobblemon.mod.common.client.render.drawScaledText
|
||||
import com.cobblemon.mod.common.entity.pokemon.PokemonEntity
|
||||
import com.cobblemon.mod.common.net.messages.server.debug.ServerboundUpdateRidingStatRangePacket
|
||||
import com.cobblemon.mod.common.net.messages.server.debug.ServerboundUpdateRidingStatsPacket
|
||||
import com.cobblemon.mod.common.util.lang
|
||||
import net.minecraft.client.Minecraft
|
||||
import net.minecraft.client.gui.GuiGraphics
|
||||
import net.minecraft.client.gui.components.AbstractSliderButton
|
||||
import net.minecraft.client.gui.components.Button
|
||||
import net.minecraft.client.gui.components.EditBox
|
||||
import net.minecraft.client.gui.screens.Screen
|
||||
import net.minecraft.network.chat.CommonComponents
|
||||
import net.minecraft.network.chat.Component
|
||||
import net.minecraft.util.Mth
|
||||
import java.awt.Color
|
||||
|
||||
class RidingStatsDebugGUI(val vehicle: PokemonEntity) : Screen(lang("ui.debug.riding_stats")), CobblemonRenderable {
|
||||
|
||||
var ridingStyle: RidingStyle = RidingStyle.LAND
|
||||
|
||||
val changeRidingStyle: Button
|
||||
|
||||
val speedSlider: SettingsSlider
|
||||
val accelerationSlider: SettingsSlider
|
||||
val skillSlider: SettingsSlider
|
||||
val jumpSlider: SettingsSlider
|
||||
val staminaSlider: SettingsSlider
|
||||
|
||||
val minSpeedInput: RidingStatInputWidget
|
||||
val maxSpeedInput: RidingStatInputWidget
|
||||
val minAccelerationInput: RidingStatInputWidget
|
||||
val maxAccelerationInput: RidingStatInputWidget
|
||||
val minSkillInput: RidingStatInputWidget
|
||||
val maxSkillInput: RidingStatInputWidget
|
||||
val minJumpInput: RidingStatInputWidget
|
||||
val maxJumpInput: RidingStatInputWidget
|
||||
val minStaminaInput: RidingStatInputWidget
|
||||
val maxStaminaInput: RidingStatInputWidget
|
||||
|
||||
init {
|
||||
ridingStyle = vehicle.ifRidingAvailableSupply(RidingStyle.LAND) { behaviour, settings, state ->
|
||||
behaviour.getRidingStyle(settings, state)
|
||||
}
|
||||
changeRidingStyle = addRenderableWidget(
|
||||
Button.builder("Riding Style: $ridingStyle".text()) { button ->
|
||||
ridingStyle = when (ridingStyle) {
|
||||
RidingStyle.LAND -> RidingStyle.LIQUID
|
||||
RidingStyle.LIQUID -> RidingStyle.AIR
|
||||
RidingStyle.AIR -> RidingStyle.LAND
|
||||
else -> RidingStyle.LAND
|
||||
}
|
||||
refresh()
|
||||
}.bounds(10, 10, getScaledWidth() - 20, 20).build()
|
||||
)
|
||||
speedSlider = addRenderableWidget(SettingsSlider(10, 60, 200, "Speed".text(), 0, 0f, 1f))
|
||||
accelerationSlider = addRenderableWidget(SettingsSlider(10, 90, 200, "Acceleration".text(), 0, 0f, 1f))
|
||||
skillSlider = addRenderableWidget(SettingsSlider(10, 120, 200, "Skill".text(), 0, 0f, 1f))
|
||||
jumpSlider = addRenderableWidget(SettingsSlider(10, 150, 200, "Jump".text(), 0, 0f, 1f))
|
||||
staminaSlider = addRenderableWidget(SettingsSlider(10, 180, 200, "Stamina".text(), 0, 0f, 1f))
|
||||
addRenderableWidget(
|
||||
Button.builder("Save".text()) { button ->
|
||||
saveStats()
|
||||
}.bounds(10, 210, 200, 20).build()
|
||||
)
|
||||
|
||||
minSpeedInput = addRenderableWidget(RidingStatInputWidget(getScaledWidth() - 210, 60, "".text()))
|
||||
maxSpeedInput = addRenderableWidget(RidingStatInputWidget(getScaledWidth() - 100, 60, "".text()))
|
||||
minAccelerationInput = addRenderableWidget(RidingStatInputWidget(getScaledWidth() - 210, 90, "".text()))
|
||||
maxAccelerationInput = addRenderableWidget(RidingStatInputWidget(getScaledWidth() - 100, 90, "".text()))
|
||||
minSkillInput = addRenderableWidget(RidingStatInputWidget(getScaledWidth() - 210, 120, "".text()))
|
||||
maxSkillInput = addRenderableWidget(RidingStatInputWidget(getScaledWidth() - 100, 120, "".text()))
|
||||
minJumpInput = addRenderableWidget(RidingStatInputWidget(getScaledWidth() - 210, 150, "".text()))
|
||||
maxJumpInput = addRenderableWidget(RidingStatInputWidget(getScaledWidth() - 100, 150, "".text()))
|
||||
minStaminaInput = addRenderableWidget(RidingStatInputWidget(getScaledWidth() - 210, 180, "".text()))
|
||||
maxStaminaInput = addRenderableWidget(RidingStatInputWidget(getScaledWidth() - 100, 180, "".text()))
|
||||
|
||||
addRenderableWidget(
|
||||
Button.builder("Save".text()) { button ->
|
||||
saveStatRanges()
|
||||
}.bounds(getScaledWidth() - 210, 220, 200, 20).build()
|
||||
)
|
||||
|
||||
refresh()
|
||||
}
|
||||
|
||||
fun refresh() {
|
||||
changeRidingStyle.message = "Riding Style: $ridingStyle".text()
|
||||
updateElementsForStat(RidingStat.SPEED, speedSlider, minSpeedInput, maxSpeedInput)
|
||||
updateElementsForStat(RidingStat.ACCELERATION, accelerationSlider, minAccelerationInput, maxAccelerationInput)
|
||||
updateElementsForStat(RidingStat.SKILL, skillSlider, minSkillInput, maxSkillInput)
|
||||
updateElementsForStat(RidingStat.JUMP, jumpSlider, minJumpInput, maxJumpInput)
|
||||
updateElementsForStat(RidingStat.STAMINA, staminaSlider, minStaminaInput, maxStaminaInput)
|
||||
}
|
||||
|
||||
fun saveStats() {
|
||||
val speed = speedSlider.currentValue
|
||||
val acceleration = accelerationSlider.currentValue
|
||||
val skill = skillSlider.currentValue
|
||||
val jump = jumpSlider.currentValue
|
||||
val stamina = staminaSlider.currentValue
|
||||
|
||||
vehicle.overrideRideStat(ridingStyle, RidingStat.SPEED, speed.toDouble())
|
||||
vehicle.overrideRideStat(ridingStyle, RidingStat.ACCELERATION, acceleration.toDouble())
|
||||
vehicle.overrideRideStat(ridingStyle, RidingStat.SKILL, skill.toDouble())
|
||||
vehicle.overrideRideStat(ridingStyle, RidingStat.JUMP, jump.toDouble())
|
||||
vehicle.overrideRideStat(ridingStyle, RidingStat.STAMINA, stamina.toDouble())
|
||||
|
||||
CobblemonNetwork.sendToServer(
|
||||
ServerboundUpdateRidingStatsPacket(
|
||||
vehicle.id,
|
||||
ridingStyle,
|
||||
speed.toDouble(),
|
||||
acceleration.toDouble(),
|
||||
skill.toDouble(),
|
||||
jump.toDouble(),
|
||||
stamina.toDouble()
|
||||
)
|
||||
)
|
||||
refresh()
|
||||
}
|
||||
|
||||
fun saveStatRanges() {
|
||||
val minSpeed = minSpeedInput.value.toIntOrNull() ?: getRidingStatRange(RidingStat.SPEED).first
|
||||
val maxSpeed = maxSpeedInput.value.toIntOrNull() ?: getRidingStatRange(RidingStat.SPEED).first
|
||||
val minAcceleration = minAccelerationInput.value.toIntOrNull() ?: getRidingStatRange(RidingStat.ACCELERATION).first
|
||||
val maxAcceleration = maxAccelerationInput.value.toIntOrNull() ?: getRidingStatRange(RidingStat.ACCELERATION).last
|
||||
val minSkill = minSkillInput.value.toIntOrNull() ?: getRidingStatRange(RidingStat.SKILL).first
|
||||
val maxSkill = maxSkillInput.value.toIntOrNull() ?: getRidingStatRange(RidingStat.SKILL).last
|
||||
val minJump = minJumpInput.value.toIntOrNull() ?: getRidingStatRange(RidingStat.JUMP).first
|
||||
val maxJump = maxJumpInput.value.toIntOrNull() ?: getRidingStatRange(RidingStat.JUMP).last
|
||||
val minStamina = minStaminaInput.value.toIntOrNull() ?: getRidingStatRange(RidingStat.STAMINA).first
|
||||
val maxStamina = maxStaminaInput.value.toIntOrNull() ?: getRidingStatRange(RidingStat.STAMINA).last
|
||||
|
||||
if (minSpeed < maxSpeed) {
|
||||
vehicle.rideProp.stats[RidingStat.SPEED]?.ranges?.put(ridingStyle, minSpeed..maxSpeed)
|
||||
}
|
||||
if (minAcceleration < maxAcceleration) {
|
||||
vehicle.rideProp.stats[RidingStat.ACCELERATION]?.ranges?.put(ridingStyle, minAcceleration..maxAcceleration)
|
||||
}
|
||||
if (minSkill < maxSkill) {
|
||||
vehicle.rideProp.stats[RidingStat.SKILL]?.ranges?.put(ridingStyle, minSkill..maxSkill)
|
||||
}
|
||||
if (minJump < maxJump) {
|
||||
vehicle.rideProp.stats[RidingStat.JUMP]?.ranges?.put(ridingStyle, minJump..maxJump)
|
||||
}
|
||||
if (minStamina < maxStamina) {
|
||||
vehicle.rideProp.stats[RidingStat.STAMINA]?.ranges?.put(ridingStyle, minStamina..maxStamina)
|
||||
}
|
||||
|
||||
CobblemonNetwork.sendToServer(
|
||||
ServerboundUpdateRidingStatRangePacket(
|
||||
vehicle.id,
|
||||
ridingStyle,
|
||||
minSpeed,
|
||||
maxSpeed,
|
||||
minAcceleration,
|
||||
maxAcceleration,
|
||||
minSkill,
|
||||
maxSkill,
|
||||
minJump,
|
||||
maxJump,
|
||||
minStamina,
|
||||
maxStamina
|
||||
)
|
||||
)
|
||||
refresh()
|
||||
}
|
||||
|
||||
fun updateElementsForStat(
|
||||
ridingStat: RidingStat,
|
||||
slider: SettingsSlider,
|
||||
minInput: RidingStatInputWidget,
|
||||
maxInput: RidingStatInputWidget
|
||||
) {
|
||||
val range = getRidingStatRange(ridingStat)
|
||||
|
||||
slider.update(getRidingStat(ridingStat), range.first.toFloat(), range.last.toFloat())
|
||||
minInput.setHint("Min: ${range.first}".text())
|
||||
maxInput.setHint("Max: ${range.last}".text())
|
||||
}
|
||||
|
||||
fun getRidingStat(ridingStat: RidingStat): Int {
|
||||
return vehicle.getRawRideStat(ridingStat, ridingStyle).toInt()
|
||||
}
|
||||
|
||||
fun getRidingStatRange(ridingStat: RidingStat): IntRange {
|
||||
return vehicle.rideProp.stats[ridingStat]?.ranges?.get(ridingStyle) ?: 0..0
|
||||
}
|
||||
|
||||
fun getScaledWidth() = Minecraft.getInstance().window.guiScaledWidth
|
||||
|
||||
override fun render(guiGraphics: GuiGraphics, mouseX: Int, mouseY: Int, partialTick: Float) {
|
||||
guiGraphics.fill(0, 0, width, height, Color(0, 0, 0, 100).rgb)
|
||||
super.render(guiGraphics, mouseX, mouseY, partialTick)
|
||||
drawScaledText(
|
||||
context = guiGraphics,
|
||||
text = "Pokemon Stats Editor".text(),
|
||||
x = 10,
|
||||
y = 40,
|
||||
)
|
||||
|
||||
drawScaledText(
|
||||
context = guiGraphics,
|
||||
text = "Species Stat Range Editor".text(),
|
||||
x = getScaledWidth() - 210,
|
||||
y = 40,
|
||||
)
|
||||
|
||||
drawScaledText(
|
||||
context = guiGraphics,
|
||||
text = "Speed".text(),
|
||||
x = getScaledWidth() - 285,
|
||||
y = 70,
|
||||
)
|
||||
|
||||
drawScaledText(
|
||||
context = guiGraphics,
|
||||
text = "Acceleration".text(),
|
||||
x = getScaledWidth() - 285,
|
||||
y = 100,
|
||||
)
|
||||
|
||||
drawScaledText(
|
||||
context = guiGraphics,
|
||||
text = "Skill".text(),
|
||||
x = getScaledWidth() - 285,
|
||||
y = 130,
|
||||
)
|
||||
|
||||
drawScaledText(
|
||||
context = guiGraphics,
|
||||
text = "Jump".text(),
|
||||
x = getScaledWidth() - 285,
|
||||
y = 160,
|
||||
)
|
||||
|
||||
drawScaledText(
|
||||
context = guiGraphics,
|
||||
text = "Stamina".text(),
|
||||
x = getScaledWidth() - 285,
|
||||
y = 190,
|
||||
)
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
class SettingsSlider(x: Int, y: Int, width: Int, val label: Component, value: Int, private var minValue: Float, private var maxValue: Float) :
|
||||
AbstractSliderButton(x, y, width, 20, CommonComponents.EMPTY, 0.0) {
|
||||
|
||||
var currentValue: Int
|
||||
get() = ((this.value * (maxValue - minValue)) + minValue).toInt()
|
||||
set(value) {
|
||||
this.value = ((Mth.clamp(value.toFloat(), minValue, maxValue) - minValue) / (maxValue - minValue)).toDouble()
|
||||
}
|
||||
|
||||
init {
|
||||
currentValue = value
|
||||
}
|
||||
|
||||
fun update(value: Int, min: Float, max: Float) {
|
||||
minValue = min
|
||||
maxValue = max
|
||||
currentValue = value
|
||||
refresh()
|
||||
}
|
||||
|
||||
override fun applyValue() {}
|
||||
|
||||
fun refresh() {
|
||||
this.updateMessage()
|
||||
}
|
||||
|
||||
override fun updateMessage() {
|
||||
this.message = CommonComponents.optionNameValue(label, "$currentValue".text())
|
||||
}
|
||||
}
|
||||
|
||||
class RidingStatInputWidget(x: Int, y: Int, val hint: Component) : EditBox(
|
||||
Minecraft.getInstance().font,
|
||||
x,
|
||||
y,
|
||||
90,
|
||||
30,
|
||||
Component.literal("Enter command")
|
||||
) {
|
||||
init {
|
||||
setHint(hint)
|
||||
}
|
||||
}
|
||||
@@ -11,6 +11,7 @@ package com.cobblemon.mod.common.client.gui.pc
|
||||
import com.cobblemon.mod.common.CobblemonSounds
|
||||
import com.cobblemon.mod.common.api.gui.blitk
|
||||
import com.cobblemon.mod.common.api.pokemon.PokemonSortMode
|
||||
import com.cobblemon.mod.common.api.pokemon.stats.Stats
|
||||
import com.cobblemon.mod.common.api.storage.pc.search.Search
|
||||
import com.cobblemon.mod.common.api.text.bold
|
||||
import com.cobblemon.mod.common.api.text.text
|
||||
@@ -19,6 +20,9 @@ import com.cobblemon.mod.common.client.gui.CobblemonRenderable
|
||||
import com.cobblemon.mod.common.client.gui.ExitButton
|
||||
import com.cobblemon.mod.common.client.gui.TypeIcon
|
||||
import com.cobblemon.mod.common.client.gui.summary.Summary
|
||||
import com.cobblemon.mod.common.client.gui.summary.Summary.Companion.iconCosmeticItemResource
|
||||
import com.cobblemon.mod.common.client.gui.summary.Summary.Companion.iconHeldItemResource
|
||||
import com.cobblemon.mod.common.client.gui.summary.SummaryButton
|
||||
import com.cobblemon.mod.common.client.gui.summary.widgets.MarkingsWidget
|
||||
import com.cobblemon.mod.common.client.gui.summary.widgets.ModelWidget
|
||||
import com.cobblemon.mod.common.client.gui.summary.widgets.common.reformatNatureTextIfMinted
|
||||
@@ -55,20 +59,40 @@ class PCGUI(
|
||||
companion object {
|
||||
const val BASE_WIDTH = 349
|
||||
const val BASE_HEIGHT = 205
|
||||
const val INFO_BOX_WIDTH = 63
|
||||
const val INFO_BOX_HEIGHT = 69
|
||||
const val RIGHT_PANEL_WIDTH = 82
|
||||
const val RIGHT_PANEL_HEIGHT = 169
|
||||
const val TYPE_SPACER_WIDTH = 128
|
||||
const val TYPE_SPACER_WIDTH = 126
|
||||
const val TYPE_SPACER_HEIGHT = 12
|
||||
const val PC_SPACER_WIDTH = 342
|
||||
const val PC_SPACER_HEIGHT = 14
|
||||
const val PORTRAIT_SIZE = 66
|
||||
const val SCALE = 0.5F
|
||||
|
||||
const val STAT_INFO = 0
|
||||
const val STAT_IV = 1
|
||||
const val STAT_EV = 2
|
||||
|
||||
private val statLabels = arrayOf(
|
||||
lang("ui.stats.hp"),
|
||||
lang("ui.stats.atk"),
|
||||
lang("ui.stats.def"),
|
||||
lang("ui.stats.sp_atk"),
|
||||
lang("ui.stats.sp_def"),
|
||||
lang("ui.stats.speed")
|
||||
)
|
||||
|
||||
private val stats = arrayOf(Stats.HP, Stats.ATTACK, Stats.DEFENCE, Stats.SPECIAL_ATTACK, Stats.SPECIAL_DEFENCE, Stats.SPEED)
|
||||
|
||||
private val baseResource = cobblemonResource("textures/gui/pc/pc_base.png")
|
||||
private val portraitBackgroundResource = cobblemonResource("textures/gui/pc/portrait_background.png")
|
||||
private val infoBoxResource = cobblemonResource("textures/gui/pc/info_box.png")
|
||||
private val infoBoxStatResource = cobblemonResource("textures/gui/pc/info_box_stats.png")
|
||||
|
||||
private val buttonOptionsResource = cobblemonResource("textures/gui/pc/pc_icon_options.png")
|
||||
private val buttonWallpaperResource = cobblemonResource("textures/gui/pc/pc_button_set_wallpaper.png")
|
||||
private val buttonInfoArrow = cobblemonResource("textures/gui/pc/info_arrow.png")
|
||||
|
||||
private val topSpacerResource = cobblemonResource("textures/gui/pc/pc_spacer_top.png")
|
||||
private val bottomSpacerResource = cobblemonResource("textures/gui/pc/pc_spacer_bottom.png")
|
||||
@@ -87,6 +111,9 @@ class PCGUI(
|
||||
internal var previewPokemon: Pokemon? = null
|
||||
var isPreviewInParty: Boolean? = null
|
||||
|
||||
private var showCosmeticItem = false
|
||||
private var currentStatIndex = 0
|
||||
|
||||
private val optionButtons: MutableList<IconButton> = mutableListOf()
|
||||
|
||||
var search: Search = Search.DEFAULT
|
||||
@@ -244,6 +271,37 @@ class PCGUI(
|
||||
|
||||
this.markingsWidget = MarkingsWidget(x + 29, y + 96.5, null, false)
|
||||
this.addRenderableWidget(markingsWidget)
|
||||
|
||||
// Held/Cosmetic Item Button
|
||||
addRenderableWidget(
|
||||
SummaryButton(
|
||||
buttonX = x + 67F,
|
||||
buttonY = y + 107F,
|
||||
buttonWidth = 12,
|
||||
buttonHeight = 12,
|
||||
scale = 0.5F,
|
||||
resource = iconCosmeticItemResource,
|
||||
activeResource = iconHeldItemResource,
|
||||
clickAction = {
|
||||
showCosmeticItem = !showCosmeticItem
|
||||
(it as SummaryButton).buttonActive = showCosmeticItem
|
||||
}
|
||||
)
|
||||
)
|
||||
|
||||
addRenderableWidget(
|
||||
IconButton(
|
||||
pX = x + 1,
|
||||
pY = y + 157,
|
||||
buttonWidth = 10,
|
||||
buttonHeight = 16,
|
||||
resource = buttonInfoArrow,
|
||||
label = "switch"
|
||||
) {
|
||||
currentStatIndex = (currentStatIndex + 1) % 3
|
||||
}
|
||||
)
|
||||
|
||||
this.setPreviewPokemon(null)
|
||||
|
||||
super.init()
|
||||
@@ -280,33 +338,68 @@ class PCGUI(
|
||||
height = BASE_HEIGHT
|
||||
)
|
||||
|
||||
// Render Info Box
|
||||
blitk(
|
||||
matrixStack = matrices,
|
||||
texture = if (currentStatIndex > 0) infoBoxStatResource else infoBoxResource,
|
||||
x = x + 9,
|
||||
y = y + 128,
|
||||
width = INFO_BOX_WIDTH,
|
||||
height = INFO_BOX_HEIGHT
|
||||
)
|
||||
|
||||
val labelX = x + 9 + (INFO_BOX_WIDTH / 2)
|
||||
// Render Info Labels
|
||||
drawScaledText(
|
||||
context = context,
|
||||
text = lang("ui.info.nature").bold(),
|
||||
x = x + 39,
|
||||
y = y + 129.5,
|
||||
centered = true,
|
||||
scale = SCALE
|
||||
)
|
||||
when (currentStatIndex) {
|
||||
STAT_INFO -> {
|
||||
drawScaledText(
|
||||
context = context,
|
||||
text = lang("ui.info.nature").bold(),
|
||||
x = labelX,
|
||||
y = y + 129.5,
|
||||
centered = true,
|
||||
scale = SCALE
|
||||
)
|
||||
|
||||
drawScaledText(
|
||||
context = context,
|
||||
text = lang("ui.info.ability").bold(),
|
||||
x = x + 39,
|
||||
y = y + 146.5,
|
||||
centered = true,
|
||||
scale = SCALE
|
||||
)
|
||||
drawScaledText(
|
||||
context = context,
|
||||
text = lang("ui.info.ability").bold(),
|
||||
x = labelX,
|
||||
y = y + 146.5,
|
||||
centered = true,
|
||||
scale = SCALE
|
||||
)
|
||||
|
||||
drawScaledText(
|
||||
context = context,
|
||||
text = lang("ui.moves").bold(),
|
||||
x = x + 39,
|
||||
y = y + 163.5,
|
||||
centered = true,
|
||||
scale = SCALE
|
||||
)
|
||||
drawScaledText(
|
||||
context = context,
|
||||
text = lang("ui.moves").bold(),
|
||||
x = labelX,
|
||||
y = y + 163.5,
|
||||
centered = true,
|
||||
scale = SCALE
|
||||
)
|
||||
}
|
||||
STAT_IV -> {
|
||||
drawScaledText(
|
||||
context = context,
|
||||
text = lang("ui.stats.ivs").bold(),
|
||||
x = labelX,
|
||||
y = y + 129.5,
|
||||
centered = true,
|
||||
scale = SCALE
|
||||
)
|
||||
}
|
||||
STAT_EV -> {
|
||||
drawScaledText(
|
||||
context = context,
|
||||
text = lang("ui.stats.evs").bold(),
|
||||
x = labelX,
|
||||
y = y + 129.5,
|
||||
centered = true,
|
||||
scale = SCALE
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
// Render Pokemon Info
|
||||
val pokemon = previewPokemon
|
||||
@@ -398,19 +491,19 @@ class PCGUI(
|
||||
)
|
||||
}
|
||||
|
||||
// Held Item
|
||||
val heldItem = pokemon.heldItemNoCopy()
|
||||
// Held/Cosmetic Item
|
||||
val displayedItem = if (showCosmeticItem) pokemon.cosmeticItem else pokemon.heldItemNoCopy()
|
||||
val itemX = x + 3
|
||||
val itemY = y + 98
|
||||
if (!heldItem.isEmpty) {
|
||||
context.renderItem(heldItem, itemX, itemY)
|
||||
context.renderItemDecorations(Minecraft.getInstance().font, heldItem, itemX, itemY)
|
||||
if (!displayedItem.isEmpty) {
|
||||
context.renderItem(displayedItem, itemX, itemY)
|
||||
context.renderItemDecorations(Minecraft.getInstance().font, displayedItem, itemX, itemY)
|
||||
}
|
||||
|
||||
drawScaledText(
|
||||
context = context,
|
||||
text = lang("held_item"),
|
||||
x = x + 27,
|
||||
text = lang("${if (showCosmeticItem) "cosmetic" else "held"}_item"),
|
||||
x = x + 24,
|
||||
y = y + 108.5,
|
||||
scale = SCALE
|
||||
)
|
||||
@@ -431,7 +524,7 @@ class PCGUI(
|
||||
blitk(
|
||||
matrixStack = matrices,
|
||||
texture = if (pokemon.secondaryType != null) typeSpacerDoubleResource else typeSpacerSingleResource,
|
||||
x = (x + 7) / SCALE,
|
||||
x = (x + 9) / SCALE,
|
||||
y = (y + 118.5) / SCALE,
|
||||
width = TYPE_SPACER_WIDTH,
|
||||
height = TYPE_SPACER_HEIGHT,
|
||||
@@ -439,7 +532,7 @@ class PCGUI(
|
||||
)
|
||||
|
||||
TypeIcon(
|
||||
x = x + 39,
|
||||
x = x + 40.5,
|
||||
y = y + 117,
|
||||
type = pokemon.primaryType,
|
||||
secondaryType = pokemon.secondaryType,
|
||||
@@ -449,43 +542,91 @@ class PCGUI(
|
||||
centeredX = true
|
||||
).render(context)
|
||||
|
||||
// Nature
|
||||
val natureText = reformatNatureTextIfMinted(pokemon)
|
||||
drawScaledText(
|
||||
context = context,
|
||||
text = natureText,
|
||||
x = x + 39,
|
||||
y = y + 137,
|
||||
centered = true,
|
||||
shadow = true,
|
||||
scale = SCALE,
|
||||
pMouseX = mouseX,
|
||||
pMouseY = mouseY
|
||||
)
|
||||
when (currentStatIndex) {
|
||||
STAT_INFO -> {
|
||||
// Nature
|
||||
val natureText = reformatNatureTextIfMinted(pokemon)
|
||||
drawScaledText(
|
||||
context = context,
|
||||
text = natureText,
|
||||
x = labelX,
|
||||
y = y + 137,
|
||||
centered = true,
|
||||
shadow = true,
|
||||
scale = SCALE,
|
||||
pMouseX = mouseX,
|
||||
pMouseY = mouseY
|
||||
)
|
||||
|
||||
// Ability
|
||||
drawScaledText(
|
||||
context = context,
|
||||
text = pokemon.ability.displayName.asTranslated(),
|
||||
x = x + 39,
|
||||
y = y + 154,
|
||||
centered = true,
|
||||
shadow = true,
|
||||
scale = SCALE
|
||||
)
|
||||
// Ability
|
||||
drawScaledText(
|
||||
context = context,
|
||||
text = pokemon.ability.displayName.asTranslated(),
|
||||
x = labelX,
|
||||
y = y + 154,
|
||||
centered = true,
|
||||
shadow = true,
|
||||
scale = SCALE
|
||||
)
|
||||
|
||||
// Moves
|
||||
val moves = pokemon.moveSet.getMoves()
|
||||
for (i in moves.indices) {
|
||||
drawScaledText(
|
||||
context = context,
|
||||
text = moves[i].displayName,
|
||||
x = x + 39,
|
||||
y = y + 170.5 + (7 * i),
|
||||
centered = true,
|
||||
shadow = true,
|
||||
scale = SCALE
|
||||
)
|
||||
// Moves
|
||||
val moves = pokemon.moveSet.getMoves()
|
||||
for (i in moves.indices) {
|
||||
drawScaledText(
|
||||
context = context,
|
||||
text = moves[i].displayName,
|
||||
x = labelX,
|
||||
y = y + 170.5 + (7 * i),
|
||||
centered = true,
|
||||
shadow = true,
|
||||
scale = SCALE
|
||||
)
|
||||
}
|
||||
}
|
||||
STAT_IV -> {
|
||||
for (i in statLabels.indices) {
|
||||
drawScaledText(
|
||||
context = context,
|
||||
text = statLabels[i],
|
||||
x = x + 13,
|
||||
y = y + 139 + (10 * i),
|
||||
shadow = true,
|
||||
scale = SCALE
|
||||
)
|
||||
|
||||
drawScaledText(
|
||||
context = context,
|
||||
text = pokemon.ivs.get(stats[i]).toString().text(),
|
||||
x = x + 65,
|
||||
y = y + 139 + (10 * i),
|
||||
centered = true,
|
||||
shadow = true,
|
||||
scale = SCALE
|
||||
)
|
||||
}
|
||||
}
|
||||
STAT_EV -> {
|
||||
for (i in statLabels.indices) {
|
||||
drawScaledText(
|
||||
context = context,
|
||||
text = statLabels[i],
|
||||
x = x + 13,
|
||||
y = y + 139 + (10 * i),
|
||||
shadow = true,
|
||||
scale = SCALE
|
||||
)
|
||||
|
||||
drawScaledText(
|
||||
context = context,
|
||||
text = pokemon.evs.get(stats[i]).toString().text(),
|
||||
x = x + 65,
|
||||
y = y + 139 + (10 * i),
|
||||
centered = true,
|
||||
shadow = true,
|
||||
scale = SCALE
|
||||
)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
} else {
|
||||
@@ -537,17 +678,14 @@ class PCGUI(
|
||||
super.render(context, mouseX, mouseY, delta)
|
||||
|
||||
// Item Tooltip
|
||||
if (pokemon != null && !pokemon.heldItemNoCopy().isEmpty) {
|
||||
if (pokemon != null) {
|
||||
val displayedItem = if (showCosmeticItem) pokemon.cosmeticItem else pokemon.heldItemNoCopy()
|
||||
val itemX = x + 3
|
||||
val itemY = y + 98
|
||||
val itemHovered =
|
||||
mouseX.toFloat() in (itemX.toFloat()..(itemX.toFloat() + 16)) && mouseY.toFloat() in (itemY.toFloat()..(itemY.toFloat() + 16))
|
||||
if (itemHovered) context.renderTooltip(
|
||||
Minecraft.getInstance().font,
|
||||
pokemon.heldItemNoCopy(),
|
||||
mouseX,
|
||||
mouseY
|
||||
)
|
||||
if (!displayedItem.isEmpty) {
|
||||
val itemHovered = mouseX.toFloat() in (itemX.toFloat()..(itemX.toFloat() + 16)) && mouseY.toFloat() in (itemY.toFloat()..(itemY.toFloat() + 16))
|
||||
if (itemHovered) context.renderTooltip(Minecraft.getInstance().font, displayedItem, mouseX, mouseY)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
+2
-1
@@ -458,10 +458,11 @@ class PokemonInfoWidget(val pX: Int, val pY: Int, val updateForm: (PokedexForm)
|
||||
formRightButton.render(context,mouseX, mouseY, delta)
|
||||
|
||||
val form = showableForms[selectedFormIndex]
|
||||
val formName = if (form.displayForm.lowercase() == "normal") "" else "-${form.displayForm.lowercase().replace("-", "")}"
|
||||
drawScaledTextJustifiedRight(
|
||||
context = context,
|
||||
font = CobblemonResources.DEFAULT_LARGE,
|
||||
text = lang("ui.pokedex.info.form.${form.displayForm.lowercase()}").bold(),
|
||||
text = lang("ui.pokedex.info.form.${species}${formName}").bold(),
|
||||
x = pX + 136,
|
||||
y = pY + 15,
|
||||
shadow = true
|
||||
|
||||
+21
-2
@@ -10,10 +10,12 @@ package com.cobblemon.mod.common.client.keybind.keybinds
|
||||
|
||||
import com.cobblemon.mod.common.Cobblemon
|
||||
import com.cobblemon.mod.common.client.CobblemonClient
|
||||
import com.cobblemon.mod.common.client.gui.debug.riding.RidingStatsDebugGUI
|
||||
import com.cobblemon.mod.common.client.keybind.CobblemonKeyBinding
|
||||
import com.cobblemon.mod.common.client.keybind.KeybindCategories
|
||||
import com.cobblemon.mod.common.client.render.models.blockbench.FloatingState
|
||||
import com.cobblemon.mod.common.client.render.models.blockbench.repository.VaryingModelRepository
|
||||
import com.cobblemon.mod.common.entity.pokemon.PokemonEntity
|
||||
import com.mojang.blaze3d.platform.InputConstants
|
||||
import net.minecraft.client.Minecraft
|
||||
import net.minecraft.network.chat.Component
|
||||
@@ -26,8 +28,10 @@ object DebugKeybindings {
|
||||
TranslateRightKeybinding(),
|
||||
TranslateUpKeybinding(),
|
||||
TranslateDownKeybinding(),
|
||||
PrintModelSettingsKeybinding()
|
||||
PrintModelSettingsKeybinding(),
|
||||
ToggleRidingStatsDebugGUIKeybinding()
|
||||
)
|
||||
|
||||
class ScaleUpKeybinding: CobblemonKeyBinding(
|
||||
"key.cobblemon.scaleportraitup",
|
||||
InputConstants.Type.KEYSYM,
|
||||
@@ -145,4 +149,19 @@ object DebugKeybindings {
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
class ToggleRidingStatsDebugGUIKeybinding : CobblemonKeyBinding(
|
||||
"key.cobblemon.toggleridingstatsgui",
|
||||
InputConstants.Type.KEYSYM,
|
||||
InputConstants.KEY_SEMICOLON,
|
||||
KeybindCategories.COBBLEMON_DEBUG_CATEGORY
|
||||
) {
|
||||
override fun onPress() {
|
||||
val vehicle = Minecraft.getInstance().player?.vehicle ?: return
|
||||
if (vehicle is PokemonEntity) {
|
||||
Minecraft.getInstance().setScreen(RidingStatsDebugGUI(vehicle))
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
+2
-2
@@ -282,12 +282,12 @@ class PokedexScannerRenderer {
|
||||
val effectiveIntervals = clamp(usageContext.transitionIntervals + (if (usageContext.scanningGuiOpen) 1 else -1) * tickDelta, 0F, 12F)
|
||||
|
||||
if (effectiveIntervals <= PokedexUsageContext.TRANSITION_INTERVALS) {
|
||||
val scale = 1 + (if (effectiveIntervals <= 2) 0F else ((effectiveIntervals - 2) * 0.075F))
|
||||
val scale = 1F + (if (effectiveIntervals <= 2) 0F else ((effectiveIntervals - 2) * 0.075F))
|
||||
|
||||
val centerX = (screenWidth - (BASE_WIDTH * scale)) / 2
|
||||
val centerY = (screenHeight - (BASE_HEIGHT * scale)) / 2
|
||||
|
||||
val opacity = if (effectiveIntervals <= 2) 1F else (10F - (effectiveIntervals - 2F)) / 10F
|
||||
val opacity = if (effectiveIntervals > 11) 0F else effectiveIntervals / PokedexUsageContext.TRANSITION_INTERVALS
|
||||
blitk(matrixStack = matrices, texture = CobblemonClient.pokedexUsageContext.type.getTexturePath(), x = centerX / scale, y = centerY / scale, width = BASE_WIDTH, height = BASE_HEIGHT, scale = scale, alpha = opacity)
|
||||
blitk(matrixStack = matrices, texture = SCAN_SCREEN, x = centerX / scale, y = centerY / scale, width = BASE_WIDTH, height = BASE_HEIGHT, scale = scale, alpha = opacity)
|
||||
}
|
||||
|
||||
+5
-4
@@ -90,16 +90,17 @@ class HeldItemRenderer {
|
||||
poseStack.mulPose(Axis.XP.rotationDegrees(90.0f))
|
||||
}
|
||||
ItemDisplayContext.THIRD_PERSON_RIGHT_HAND, ItemDisplayContext.THIRD_PERSON_LEFT_HAND -> {
|
||||
val isLeft = displayContext==ItemDisplayContext.THIRD_PERSON_LEFT_HAND
|
||||
//For Minecraft player models
|
||||
if (state is NPCClientDelegate) {
|
||||
poseStack.mulPose(Axis.XP.rotationDegrees(-90.0F))
|
||||
poseStack.mulPose(Axis.XP.rotationDegrees(-90.0f))
|
||||
poseStack.translate(0.025f * if (isLeft) 1 else -1 , 0.0f, 0.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.mulPose(Axis.YP.rotationDegrees(-90.0f * if (isLeft) -1f else 1f))
|
||||
poseStack.mulPose(Axis.ZP.rotationDegrees(90.0f * if (isLeft) -1f else 1f))
|
||||
}
|
||||
poseStack.translate(0.025f * if (displayContext==ItemDisplayContext.THIRD_PERSON_LEFT_HAND) 1 else -1 , 0.0f, 0.0f)
|
||||
}
|
||||
ItemDisplayContext.HEAD -> {
|
||||
if (state is NPCClientDelegate) {
|
||||
|
||||
+137
-5
@@ -35,6 +35,7 @@ import com.cobblemon.mod.common.client.render.models.blockbench.quirk.ModelQuirk
|
||||
import com.cobblemon.mod.common.client.render.models.blockbench.quirk.QuirkData
|
||||
import com.cobblemon.mod.common.entity.PosableEntity
|
||||
import com.cobblemon.mod.common.entity.PoseType
|
||||
import com.cobblemon.mod.common.entity.pokemon.PokemonEntity
|
||||
import com.cobblemon.mod.common.util.asIdentifierDefaultingNamespace
|
||||
import com.mojang.brigadier.StringReader
|
||||
import com.mojang.brigadier.exceptions.CommandSyntaxException
|
||||
@@ -131,8 +132,137 @@ abstract class PosableState : Schedulable {
|
||||
/** 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 expose current riding data. */
|
||||
val ridingFunctions = QueryStruct(hashMapOf())
|
||||
.addFunction("pitch") { params ->
|
||||
val lookBackTick = params.getInt(0)
|
||||
|
||||
val pokemon = getEntity() as? PokemonEntity ?: return@addFunction DoubleValue(0.0)
|
||||
val partialTickPitch = pokemon.ridingAnimationData.rotSpring.getInterpolated(currentPartialTicks.toDouble(), lookBackTick).x
|
||||
val maxPitch = 90.0
|
||||
return@addFunction DoubleValue((partialTickPitch / maxPitch).coerceIn(-1.0,1.0))
|
||||
}
|
||||
.addFunction("yaw") { params ->
|
||||
val lookBackTick = params.getInt(0)
|
||||
|
||||
val pokemon = getEntity() as? PokemonEntity ?: return@addFunction DoubleValue(0.0)
|
||||
val partialTickYaw = pokemon.ridingAnimationData.rotSpring.getInterpolated(currentPartialTicks.toDouble(), lookBackTick).y
|
||||
val maxYaw = 180.0
|
||||
return@addFunction DoubleValue((partialTickYaw / maxYaw).coerceIn(-1.0,1.0))
|
||||
}
|
||||
.addFunction("roll") { params ->
|
||||
val lookBackTick = params.getInt(0)
|
||||
|
||||
val pokemon = getEntity() as? PokemonEntity ?: return@addFunction DoubleValue(0.0)
|
||||
val partialTickRoll = pokemon.ridingAnimationData.rotSpring.getInterpolated(currentPartialTicks.toDouble(), lookBackTick).z
|
||||
val maxRoll = 180.0
|
||||
return@addFunction DoubleValue((partialTickRoll / maxRoll).coerceIn(-1.0,1.0))
|
||||
}
|
||||
.addFunction("pitch_change") { params ->
|
||||
val lookBackTick = params.getInt(0)
|
||||
|
||||
val pokemon = getEntity() as? PokemonEntity ?: return@addFunction DoubleValue(0.0)
|
||||
val partialTickPitchDelta = pokemon.ridingAnimationData.rotDeltaSpring.getInterpolated(currentPartialTicks.toDouble(), lookBackTick).x
|
||||
//TODO: hook back up the retrieval of the current behaviors stat for this and the following functions
|
||||
val maxRotRate = 140.0//pokemon.riding.getController(pokemon)?.getStat(pokemon, RidingStat.SKILL)
|
||||
//?: return@addFunction DoubleValue(0.0)
|
||||
return@addFunction DoubleValue((partialTickPitchDelta / maxRotRate).coerceIn(-1.0,1.0))
|
||||
}
|
||||
.addFunction("yaw_change") { params ->
|
||||
val lookBackTick = params.getInt(0)
|
||||
val pokemon = getEntity() as? PokemonEntity ?: return@addFunction DoubleValue(0.0)
|
||||
val partialTickYawDelta = pokemon.ridingAnimationData.rotDeltaSpring.getInterpolated(currentPartialTicks.toDouble(), lookBackTick).y
|
||||
//TODO: make this not hardcoded
|
||||
val maxRotRate = 140.0 //pokemon.riding.getController(pokemon)?.getStat(pokemon, RidingStat.SKILL)
|
||||
//?: return@addFunction DoubleValue(0.0)
|
||||
return@addFunction DoubleValue((partialTickYawDelta / maxRotRate).coerceIn(-1.0,1.0))
|
||||
}
|
||||
.addFunction("roll_change") { params ->
|
||||
val lookBackTick = params.getInt(0)
|
||||
|
||||
val pokemon = getEntity() as? PokemonEntity ?: return@addFunction DoubleValue(0.0)
|
||||
val partialTickRollDelta = pokemon.ridingAnimationData.rotDeltaSpring.getInterpolated(currentPartialTicks.toDouble(), lookBackTick).z
|
||||
val maxRotRate = 140.0 //pokemon.riding.getController(pokemon)?.getStat(pokemon, RidingStat.SKILL)
|
||||
//?: return@addFunction DoubleValue(0.0)
|
||||
return@addFunction DoubleValue((partialTickRollDelta / maxRotRate).coerceIn(-1.0,1.0))
|
||||
}
|
||||
.addFunction("speed") { params ->
|
||||
val lookBackTick = params.getInt(0)
|
||||
val pokemon = getEntity() as? PokemonEntity ?: return@addFunction DoubleValue(0.0)
|
||||
|
||||
val partialTickSpeed = pokemon.ridingAnimationData.velocitySpring.getInterpolated(currentPartialTicks.toDouble(), lookBackTick).length()
|
||||
val topSpeed = 1.0//pokemon.riding.getController(pokemon)?.getStat(pokemon, RidingStat.SPEED)
|
||||
//?: return@addFunction DoubleValue(0.0)
|
||||
|
||||
return@addFunction DoubleValue((partialTickSpeed / topSpeed).coerceIn(-1.0,1.0))
|
||||
}
|
||||
.addFunction("velocity_x") { params ->
|
||||
val lookBackTick = params.getInt(0)
|
||||
val pokemon = getEntity() as? PokemonEntity ?: return@addFunction DoubleValue(0.0)
|
||||
|
||||
val partialTickXVel = pokemon.ridingAnimationData.velocitySpring.getInterpolated(currentPartialTicks.toDouble(), lookBackTick).x
|
||||
|
||||
val topSpeed = 1.0//pokemon.riding.getController(pokemon)?.getStat(pokemon, RidingStat.SPEED)
|
||||
//?: return@addFunction DoubleValue(0.0)
|
||||
return@addFunction DoubleValue((partialTickXVel / topSpeed).coerceIn(-1.0,1.0))
|
||||
}
|
||||
.addFunction("velocity_y") { params ->
|
||||
val lookBackTick = params.getInt(0)
|
||||
val pokemon = getEntity() as? PokemonEntity ?: return@addFunction DoubleValue(0.0)
|
||||
|
||||
val partialTickYVel = pokemon.ridingAnimationData.velocitySpring.getInterpolated(currentPartialTicks.toDouble(), lookBackTick).y
|
||||
|
||||
val topSpeed = 1.0//pokemon.riding.getController(pokemon)?.getStat(pokemon, RidingStat.SPEED)
|
||||
//?: return@addFunction DoubleValue(0.0)
|
||||
return@addFunction DoubleValue((partialTickYVel / topSpeed).coerceIn(-1.0,1.0))
|
||||
}
|
||||
.addFunction("velocity_z") { params ->
|
||||
val lookBackTick = params.getInt(0)
|
||||
val pokemon = getEntity() as? PokemonEntity ?: return@addFunction DoubleValue(0.0)
|
||||
|
||||
val partialTickZVel = pokemon.ridingAnimationData.velocitySpring.getInterpolated(currentPartialTicks.toDouble(), lookBackTick).z
|
||||
|
||||
val topSpeed = 1.0//pokemon.riding.getController(pokemon)?.getStat(pokemon, RidingStat.SPEED)
|
||||
//?: return@addFunction DoubleValue(0.0)
|
||||
return@addFunction DoubleValue((partialTickZVel / topSpeed).coerceIn(-1.0,1.0))
|
||||
}
|
||||
.addFunction("velocity_right") { params ->
|
||||
val lookBackTick = params.getInt(0)
|
||||
val pokemon = getEntity() as? PokemonEntity ?: return@addFunction DoubleValue(0.0)
|
||||
|
||||
val partialTickZVel = pokemon.ridingAnimationData.localVelocitySpring.getInterpolated(currentPartialTicks.toDouble(), lookBackTick).x
|
||||
|
||||
val topSpeed = 1.0//pokemon.riding.getController(pokemon)?.getStat(pokemon, RidingStat.SPEED)
|
||||
//?: return@addFunction DoubleValue(0.0)
|
||||
return@addFunction DoubleValue((partialTickZVel / topSpeed).coerceIn(-1.0,1.0) * -1.0)
|
||||
}
|
||||
.addFunction("velocity_upward") { params ->
|
||||
val lookBackTick = params.getInt(0)
|
||||
val pokemon = getEntity() as? PokemonEntity ?: return@addFunction DoubleValue(0.0)
|
||||
|
||||
val partialTickZVel = pokemon.ridingAnimationData.localVelocitySpring.getInterpolated(currentPartialTicks.toDouble(), lookBackTick).y
|
||||
|
||||
val topSpeed = 1.0//pokemon.riding.getController(pokemon)?.getStat(pokemon, RidingStat.SPEED)
|
||||
//?: return@addFunction DoubleValue(0.0)
|
||||
return@addFunction DoubleValue((partialTickZVel / topSpeed).coerceIn(-1.0,1.0))
|
||||
}
|
||||
.addFunction("velocity_forward") { params ->
|
||||
val lookBackTick = params.getInt(0)
|
||||
val pokemon = getEntity() as? PokemonEntity ?: return@addFunction DoubleValue(0.0)
|
||||
|
||||
val partialTickZVel = pokemon.ridingAnimationData.localVelocitySpring.getInterpolated(currentPartialTicks.toDouble(), lookBackTick).z
|
||||
|
||||
val topSpeed = 1.0//pokemon.riding.getController(pokemon)?.getStat(pokemon, RidingStat.SPEED)
|
||||
//?: return@addFunction DoubleValue(0.0)
|
||||
return@addFunction DoubleValue((partialTickZVel / topSpeed).coerceIn(-1.0,1.0))
|
||||
}
|
||||
|
||||
|
||||
/** All of the MoLang functions that can be applied to something with this state. */
|
||||
val functions = QueryStruct(hashMapOf())
|
||||
val functions = QueryStruct(hashMapOf(
|
||||
"riding" to java.util.function.Function { ridingFunctions },
|
||||
"r" to java.util.function.Function { ridingFunctions }
|
||||
))
|
||||
.addFunction("anim_time") {
|
||||
reusableAnimTime.value = animationSeconds.toDouble()
|
||||
reusableAnimTime
|
||||
@@ -142,17 +272,19 @@ abstract class PosableState : Schedulable {
|
||||
.addFunction("has_entity") { DoubleValue(getEntity() != null) }
|
||||
.addFunction("pose") { StringValue(currentPose ?: "") }
|
||||
.addFunction("sound") { params ->
|
||||
val entity = getEntity() ?: return@addFunction Unit
|
||||
if (params.get<MoValue>(0) !is StringValue) {
|
||||
return@addFunction Unit
|
||||
}
|
||||
val entity = getEntity()
|
||||
val soundEvent = SoundEvent.createVariableRangeEvent(params.getString(0).asIdentifierDefaultingNamespace())
|
||||
if (soundEvent != null) {
|
||||
val volume = if (params.contains(1)) params.getDouble(1).toFloat() else 1F
|
||||
val pitch = if (params.contains(2)) params.getDouble(2).toFloat() else 1F
|
||||
Minecraft.getInstance().soundManager.play(
|
||||
SimpleSoundInstance(soundEvent, SoundSource.NEUTRAL, volume, pitch, entity.level().random, entity.x, entity.y, entity.z)
|
||||
)
|
||||
if (entity != null) {
|
||||
entity.level().playLocalSound(entity, soundEvent, entity.soundSource, volume, pitch)
|
||||
} else {
|
||||
Minecraft.getInstance().soundManager.play(SimpleSoundInstance.forUI(soundEvent, volume, pitch))
|
||||
}
|
||||
}
|
||||
}
|
||||
.addFunction("render_item") { params ->
|
||||
|
||||
-64
@@ -1,64 +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.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 KangaskhanModel(root: ModelPart) : PokemonPosableModel(root), HeadedFrame {
|
||||
override val rootPart = root.registerChildWithAllChildren("kangaskhan")
|
||||
override val head = getPart("head")
|
||||
|
||||
override var portraitScale = 1.7F
|
||||
override var portraitTranslation = Vec3(-0.15, 1.1, 0.0)
|
||||
|
||||
override var profileScale = 0.7F
|
||||
override var profileTranslation = Vec3(0.0, 0.65, 0.0)
|
||||
|
||||
lateinit var standing: Pose
|
||||
lateinit var walk: Pose
|
||||
|
||||
override fun registerPoses() {
|
||||
val blink = quirk { bedrockStateful("kangaskhan", "blink")}
|
||||
val blink2 = quirk { bedrockStateful("kangaskhan", "blink2")}
|
||||
standing = registerPose(
|
||||
poseName = "standing",
|
||||
poseTypes = STATIONARY_POSES + UI_POSES,
|
||||
transformTicks = 10,
|
||||
quirks = arrayOf(blink, blink2),
|
||||
animations = arrayOf(
|
||||
singleBoneLook(),
|
||||
bedrock("kangaskhan", "ground_idle")
|
||||
)
|
||||
)
|
||||
|
||||
walk = registerPose(
|
||||
poseName = "walk",
|
||||
poseTypes = MOVING_POSES,
|
||||
transformTicks = 10,
|
||||
quirks = arrayOf(blink, blink2),
|
||||
animations = arrayOf(
|
||||
singleBoneLook(),
|
||||
bedrock("kangaskhan", "ground_idle")
|
||||
//bedrock("kangaskhan", "ground_walk")
|
||||
)
|
||||
)
|
||||
}
|
||||
|
||||
// override fun getFaintAnimation(
|
||||
// pokemonEntity: PokemonEntity,
|
||||
// state: PosableState<PokemonEntity>
|
||||
// ) = if (state.isPosedIn(standing, walk)) bedrockStateful("kangaskhan", "faint") else null
|
||||
}
|
||||
+5
-1
@@ -32,6 +32,10 @@ class WailordModel(root: ModelPart) : PokemonPosableModel(root) {
|
||||
lateinit var sleep: Pose
|
||||
lateinit var battleidle: Pose
|
||||
|
||||
override var seatToCameraOffset: MutableMap<String, Vec3> = mutableMapOf(
|
||||
"seat_1" to Vec3(0.0, 0.0, 4.0),
|
||||
)
|
||||
|
||||
val offsetY = 0.0
|
||||
override fun registerPoses() {
|
||||
val blink = quirk { bedrockStateful("wailord", "blink")}
|
||||
@@ -102,4 +106,4 @@ class WailordModel(root: ModelPart) : PokemonPosableModel(root) {
|
||||
override fun getFaintAnimation(state: PosableState) = if (state.isPosedIn(standing, walk, sleep, battleidle)) bedrockStateful("wailord", "faint") else
|
||||
if (state.isPosedIn(floating, swimming)) bedrockStateful("wailord", "faint_water")
|
||||
else null
|
||||
}
|
||||
}
|
||||
-76
@@ -1,76 +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.gen7
|
||||
|
||||
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.frame.QuadrupedFrame
|
||||
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 net.minecraft.client.model.geom.ModelPart
|
||||
import net.minecraft.world.phys.Vec3
|
||||
|
||||
class MudsdaleModel (root: ModelPart) : PokemonPosableModel(root), HeadedFrame, QuadrupedFrame {
|
||||
override val rootPart = root.registerChildWithAllChildren("mudsdale")
|
||||
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.5F
|
||||
override var portraitTranslation = Vec3(-1.0, 1.76, 0.0)
|
||||
|
||||
override var profileScale = 0.5F
|
||||
override var profileTranslation = Vec3(0.0, 1.0, 0.0)
|
||||
|
||||
lateinit var standing: Pose
|
||||
lateinit var walk: Pose
|
||||
lateinit var sleep: Pose
|
||||
|
||||
override val cryAnimation = CryProvider { bedrockStateful("mudsdale", "cry") }
|
||||
|
||||
override fun registerPoses() {
|
||||
val blink = quirk { bedrockStateful("mudsdale", "blink") }
|
||||
|
||||
sleep = registerPose(
|
||||
poseType = PoseType.SLEEP,
|
||||
animations = arrayOf(bedrock("mudsdale", "sleep"))
|
||||
)
|
||||
|
||||
standing = registerPose(
|
||||
poseName = "standing",
|
||||
poseTypes = PoseType.STATIONARY_POSES + PoseType.UI_POSES,
|
||||
transformTicks = 10,
|
||||
quirks = arrayOf(blink),
|
||||
animations = arrayOf(
|
||||
singleBoneLook(disableY = true),
|
||||
bedrock("mudsdale", "ground_idle")
|
||||
)
|
||||
)
|
||||
|
||||
walk = registerPose(
|
||||
poseName = "walk",
|
||||
poseTypes = PoseType.MOVING_POSES,
|
||||
transformTicks = 10,
|
||||
quirks = arrayOf(blink),
|
||||
animations = arrayOf(
|
||||
singleBoneLook(disableY = true),
|
||||
bedrock("mudsdale", "ground_walk")
|
||||
)
|
||||
)
|
||||
}
|
||||
|
||||
// override fun getFaintAnimation(
|
||||
// pokemonEntity: PokemonEntity,
|
||||
// state: PosableState<PokemonEntity>
|
||||
// ) = if (state.isPosedIn(standing, walk)) bedrockStateful("mudsdale", "faint") else null
|
||||
}
|
||||
-2
@@ -287,7 +287,6 @@ object VaryingModelRepository {
|
||||
inbuilt("kabuto", ::KabutoModel)
|
||||
inbuilt("kabutops", ::KabutopsModel)
|
||||
inbuilt("kadabra", ::KadabraModel)
|
||||
inbuilt("kangaskhan", ::KangaskhanModel)
|
||||
inbuilt("koffing", ::KoffingModel)
|
||||
inbuilt("krabby", ::KrabbyModel)
|
||||
inbuilt("lickitung", ::LickitungModel)
|
||||
@@ -481,7 +480,6 @@ object VaryingModelRepository {
|
||||
inbuilt("taillow", ::TaillowModel)
|
||||
inbuilt("swellow", ::SwellowModel)
|
||||
inbuilt("mudbray", ::MudbrayModel)
|
||||
inbuilt("mudsdale", ::MudsdaleModel)
|
||||
inbuilt("comfey", ::ComfeyModel)
|
||||
inbuilt("tandemaus", ::TandemausModel)
|
||||
inbuilt("maushold", ::MausholdModel)
|
||||
|
||||
+4
-2
@@ -62,8 +62,10 @@ object MountedPlayerRenderer {
|
||||
|
||||
val offset = Vector3f(0f, player.bbHeight / 2, 0f).mul(-1f)
|
||||
|
||||
matrix.rotate(locator.matrix.getRotation(AxisAngle4f()))
|
||||
matrix.rotate(Axis.YP.rotationDegrees(180 + yBodyRot))
|
||||
if (entity.beamMode == 0) {
|
||||
matrix.rotate(locator.matrix.getRotation(AxisAngle4f()))
|
||||
matrix.rotate(Axis.YP.rotationDegrees(180 + yBodyRot))
|
||||
}
|
||||
matrix.translate(offset)
|
||||
|
||||
matrix.translate(Vector3f(0f, 0.35f, 0f))
|
||||
|
||||
+3
-2
@@ -144,7 +144,7 @@ class PokemonRenderer(
|
||||
|
||||
|
||||
if (entity.passengers.isNotEmpty()) {
|
||||
renderRiding(entity, partialTicks, poseMatrix, buffer, packedLight)
|
||||
renderRiding(entity, entityYaw, partialTicks, poseMatrix, buffer, packedLight)
|
||||
}
|
||||
else {
|
||||
super.render(entity, entityYaw, partialTicks, poseMatrix, buffer, packedLight)
|
||||
@@ -173,6 +173,7 @@ class PokemonRenderer(
|
||||
|
||||
fun renderRiding(
|
||||
entity: PokemonEntity,
|
||||
entityYaw: Float,
|
||||
partialTicks: Float,
|
||||
poseMatrix: PoseStack,
|
||||
buffer: MultiBufferSource,
|
||||
@@ -200,7 +201,7 @@ class PokemonRenderer(
|
||||
matrix.mul(transformationMatrix)
|
||||
}
|
||||
|
||||
super.render(entity, 0f, partialTicks, poseMatrix, buffer, packedLight)
|
||||
super.render(entity, entityYaw, partialTicks, poseMatrix, buffer, packedLight)
|
||||
poseMatrix.popPose()
|
||||
}
|
||||
|
||||
|
||||
@@ -46,6 +46,9 @@ class CobblemonConfig {
|
||||
var announceDropItems = true
|
||||
@CobblemonConfigField(Category.Pokemon, lang = "default_drop_item_method")
|
||||
var defaultDropItemMethod = ItemDropMethod.ON_ENTITY
|
||||
@CobblemonConfigField(Category.Pokemon, lang = "drops_after_death_animation")
|
||||
var dropAfterDeathAnimation = false
|
||||
|
||||
@CobblemonConfigField(Category.Pokemon, lang = "ambient_pokemon_cry_ticks")
|
||||
@LastChangedVersion("1.4.0")
|
||||
var ambientPokemonCryTicks = 1080
|
||||
|
||||
@@ -49,6 +49,8 @@ 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.riding.util.RidingAnimationData
|
||||
import com.cobblemon.mod.common.api.riding.util.Vec3Spring
|
||||
import com.cobblemon.mod.common.api.scheduling.Schedulable
|
||||
import com.cobblemon.mod.common.api.scheduling.SchedulingTracker
|
||||
import com.cobblemon.mod.common.api.scheduling.afterOnServer
|
||||
@@ -139,6 +141,7 @@ import net.minecraft.world.item.ItemStack
|
||||
import net.minecraft.world.item.ItemUtils
|
||||
import net.minecraft.world.item.Items
|
||||
import net.minecraft.world.level.Level
|
||||
import net.minecraft.world.level.block.state.BlockState
|
||||
import net.minecraft.world.level.gameevent.GameEvent
|
||||
import net.minecraft.world.level.material.FluidState
|
||||
import net.minecraft.world.level.pathfinder.PathType
|
||||
@@ -251,12 +254,15 @@ open class PokemonEntity(
|
||||
|
||||
var enablePoseTypeRecalculation = true
|
||||
|
||||
val ridingAnimationData: RidingAnimationData = RidingAnimationData()
|
||||
|
||||
var previousRidingState: RidingBehaviourState? = null
|
||||
var ridingState: RidingBehaviourState? = null
|
||||
var ridingBehaviourSettings: RidingBehaviourSettings? = null
|
||||
override var riding: RidingBehaviour<RidingBehaviourSettings, RidingBehaviourState>? = null
|
||||
|
||||
private val rideStatOverrides = mutableMapOf<RidingStyle, MutableMap<RidingStat, Double>>()
|
||||
|
||||
val runtime: MoLangRuntime by lazy {
|
||||
MoLangRuntime()
|
||||
.setup()
|
||||
@@ -268,11 +274,7 @@ open class PokemonEntity(
|
||||
val rideStyle = RidingStyle.valueOf(params.getString(1).uppercase())
|
||||
val maxVal = params.getDouble(2)
|
||||
val minVal = params.getDouble(3)
|
||||
//TODO: Use the mons actual boost once implemented
|
||||
val normalizedStat = rideProp.calculate(rideStat, rideStyle, 0) / 100.0f
|
||||
val trueStatVal = (normalizedStat * (maxVal - minVal)) + minVal
|
||||
|
||||
DoubleValue(trueStatVal)
|
||||
DoubleValue(getRideStat(rideStat, rideStyle, minVal, maxVal))
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -483,6 +485,11 @@ open class PokemonEntity(
|
||||
entityData.get(MOVING)
|
||||
|
||||
super.tick()
|
||||
|
||||
if (passengers.isNotEmpty()) {
|
||||
ridingAnimationData.update(this)
|
||||
}
|
||||
|
||||
flyDistO = flyDist
|
||||
|
||||
if (isBattling) {
|
||||
@@ -1565,6 +1572,8 @@ open class PokemonEntity(
|
||||
inp.z * g.toDouble() + inp.x * f.toDouble()
|
||||
)
|
||||
|
||||
|
||||
|
||||
val diff = v.subtract(this.deltaMovement)
|
||||
|
||||
val inertia = ifRidingAvailableSupply(fallback = 0.5) { behaviour, settings, state ->
|
||||
@@ -1817,11 +1826,28 @@ open class PokemonEntity(
|
||||
// stat based on the boost of that pokemons stat
|
||||
fun getRideStat(stat: RidingStat, style: RidingStyle, baseMin: Double, baseMax: Double): Double {
|
||||
//TODO: Change from static zero boost once aprijuice is implemented.
|
||||
if (rideStatOverrides[style] != null && rideStatOverrides[style]!![stat] != null) {
|
||||
return (((baseMax - baseMin) / 100) * rideStatOverrides[style]!![stat]!!) + baseMin
|
||||
}
|
||||
val stat = this.rideProp.calculate(stat, style, 0)
|
||||
val statVal = (((baseMax - baseMin) / 100) * stat) + baseMin
|
||||
return statVal
|
||||
}
|
||||
|
||||
fun getRawRideStat(stat: RidingStat, style: RidingStyle): Double {
|
||||
if (rideStatOverrides[style] != null && rideStatOverrides[style]!![stat] != null) {
|
||||
return rideStatOverrides[style]!![stat]!!
|
||||
}
|
||||
return this.rideProp.calculate(stat, style, 0).toDouble()
|
||||
}
|
||||
|
||||
internal fun overrideRideStat(style: RidingStyle, stat: RidingStat, value: Double) {
|
||||
if (rideStatOverrides[style] == null) {
|
||||
rideStatOverrides[style] = mutableMapOf()
|
||||
}
|
||||
rideStatOverrides[style]!![stat] = value
|
||||
}
|
||||
|
||||
override fun canAddPassenger(passenger: Entity): Boolean {
|
||||
return passengers.size < seats.size
|
||||
}
|
||||
@@ -1924,7 +1950,7 @@ open class PokemonEntity(
|
||||
// }
|
||||
|
||||
override fun onPassengerTurned(entityToUpdate: Entity) {
|
||||
if (entityToUpdate !is LivingEntity) return
|
||||
if (entityToUpdate !is LivingEntity) return
|
||||
ifRidingAvailable { behaviour, settings, state ->
|
||||
behaviour.clampPassengerRotation(settings, state, this, entityToUpdate)
|
||||
}
|
||||
@@ -1942,6 +1968,22 @@ open class PokemonEntity(
|
||||
}
|
||||
}
|
||||
|
||||
// When riding mimic RemotePlayers logic for rendering players at farther
|
||||
// distances than usual. Otherwise the player may render when the pokemon
|
||||
// entity is not, causing a floating player.
|
||||
override fun shouldRenderAtSqrDistance(distance: Double): Boolean {
|
||||
if (!passengers.isEmpty()) {
|
||||
var d = (boundingBox.getSize() * 10.0)
|
||||
if (d.isNaN()) {
|
||||
d = 1.0
|
||||
}
|
||||
val scale = 64.0 * getViewScale()
|
||||
return distance < d * scale * scale
|
||||
}
|
||||
|
||||
return super.shouldRenderAtSqrDistance(distance)
|
||||
}
|
||||
|
||||
override fun getControllingPassenger(): LivingEntity? {
|
||||
val riders = this.passengers.filterIsInstance<LivingEntity>()
|
||||
if (riders.isEmpty()) {
|
||||
@@ -1971,6 +2013,13 @@ open class PokemonEntity(
|
||||
}
|
||||
}
|
||||
|
||||
override fun maxUpStep(): Float {
|
||||
val upStep = ifRidingAvailableSupply(fallback = null) { behaviour, settings, state ->
|
||||
behaviour.maxUpStep(settings, state, this)
|
||||
}
|
||||
return upStep ?: super.maxUpStep()
|
||||
}
|
||||
|
||||
override fun getRiddenSpeed(controller: Player): Float {
|
||||
return ifRidingAvailableSupply(fallback = 0.05f) { behaviour, settings, state ->
|
||||
behaviour.speed(settings, state,this, controller)
|
||||
@@ -2105,4 +2154,10 @@ open class PokemonEntity(
|
||||
override fun resolveEntityScan(): LivingEntity {
|
||||
return this
|
||||
}
|
||||
|
||||
fun canStopRiding(pokemon: PokemonEntity, player: ServerPlayer): Boolean {
|
||||
if (pokemon.passengers.isEmpty()) return false
|
||||
if (pokemon.controllingPassenger != player) return false
|
||||
return true
|
||||
}
|
||||
}
|
||||
+12
-9
@@ -11,6 +11,7 @@ package com.cobblemon.mod.common.entity.pokemon
|
||||
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.Cobblemon
|
||||
import com.cobblemon.mod.common.CobblemonSounds
|
||||
import com.cobblemon.mod.common.OrientationControllable
|
||||
import com.cobblemon.mod.common.api.entity.PokemonSender
|
||||
@@ -287,6 +288,14 @@ class PokemonServerDelegate : PokemonSideDelegate {
|
||||
}
|
||||
}
|
||||
|
||||
fun doDeathDrops() {
|
||||
if (entity.ownerUUID == null && entity.owner == null && entity.level().gameRules.getBoolean(CobblemonGameRules.DO_POKEMON_LOOT)) {
|
||||
val heldItem = (entity as PokemonEntity?)?.pokemon?.heldItemNoCopy() ?: ItemStack.EMPTY
|
||||
if (!heldItem.isEmpty) entity.spawnAtLocation(heldItem.item)
|
||||
(entity.drops ?: entity.pokemon.form.drops).drop(entity, entity.level() as ServerLevel, entity.position(), entity.killer)
|
||||
}
|
||||
}
|
||||
|
||||
override fun updatePostDeath() {
|
||||
// clear active effects before proceeding
|
||||
val owner = entity.owner
|
||||
@@ -299,6 +308,7 @@ class PokemonServerDelegate : PokemonSideDelegate {
|
||||
if (entity.deathTime == 0) {
|
||||
entity.effects.wipe()
|
||||
entity.deathTime = 1
|
||||
if (!Cobblemon.config.dropAfterDeathAnimation) doDeathDrops()
|
||||
return
|
||||
} else if (entity.effects.progress?.isDone == false) {
|
||||
return
|
||||
@@ -316,15 +326,8 @@ class PokemonServerDelegate : PokemonSideDelegate {
|
||||
}
|
||||
|
||||
if (entity.deathTime == 60) {
|
||||
if (entity.ownerUUID == null && entity.owner == null) {
|
||||
entity.level().broadcastEntityEvent(entity, 60.toByte()) // Sends smoke effect
|
||||
if(entity.level().gameRules.getBoolean(CobblemonGameRules.DO_POKEMON_LOOT)) {
|
||||
val heldItem = (entity as PokemonEntity?)?.pokemon?.heldItemNoCopy() ?: ItemStack.EMPTY
|
||||
if (!heldItem.isEmpty) entity.spawnAtLocation(heldItem.item)
|
||||
(entity.drops ?: entity.pokemon.form.drops).drop(entity, entity.level() as ServerLevel, entity.position(), entity.killer)
|
||||
}
|
||||
}
|
||||
|
||||
entity.level().broadcastEntityEvent(entity, 60.toByte()) // Sends smoke effect
|
||||
if (Cobblemon.config.dropAfterDeathAnimation) doDeathDrops()
|
||||
entity.remove(Entity.RemovalReason.KILLED)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -353,6 +353,18 @@ object CobblemonItemGroups {
|
||||
entries.accept(CobblemonItems.LEEK_AND_POTATO_STEW)
|
||||
entries.accept(CobblemonItems.BRAISED_VIVICHOKE)
|
||||
entries.accept(CobblemonItems.VIVICHOKE_DIP)
|
||||
entries.accept(CobblemonItems.TART_APPLE)
|
||||
entries.accept(CobblemonItems.SWEET_APPLE)
|
||||
entries.accept(CobblemonItems.SYRUPY_APPLE)
|
||||
entries.accept(CobblemonItems.WHIPPED_DREAM)
|
||||
entries.accept(CobblemonItems.STRAWBERRY_SWEET)
|
||||
entries.accept(CobblemonItems.LOVE_SWEET)
|
||||
entries.accept(CobblemonItems.BERRY_SWEET)
|
||||
entries.accept(CobblemonItems.CLOVER_SWEET)
|
||||
entries.accept(CobblemonItems.FLOWER_SWEET)
|
||||
entries.accept(CobblemonItems.STAR_SWEET)
|
||||
entries.accept(CobblemonItems.RIBBON_SWEET)
|
||||
|
||||
entries.accept(CobblemonItems.BERRY_JUICE)
|
||||
entries.accept(CobblemonItems.REMEDY)
|
||||
entries.accept(CobblemonItems.FINE_REMEDY)
|
||||
@@ -475,6 +487,7 @@ object CobblemonItemGroups {
|
||||
entries.accept(CobblemonItems.WHIPPED_DREAM)
|
||||
entries.accept(CobblemonItems.TART_APPLE)
|
||||
entries.accept(CobblemonItems.SWEET_APPLE)
|
||||
entries.accept(CobblemonItems.SYRUPY_APPLE)
|
||||
entries.accept(CobblemonItems.CRACKED_POT)
|
||||
entries.accept(CobblemonItems.CHIPPED_POT)
|
||||
entries.accept(CobblemonItems.MASTERPIECE_TEACUP)
|
||||
@@ -644,9 +657,23 @@ object CobblemonItemGroups {
|
||||
}
|
||||
|
||||
private fun foodInjections(injector: Injector) {
|
||||
injector.putAfter(CobblemonItems.TART_APPLE, Items.ENCHANTED_GOLDEN_APPLE)
|
||||
injector.putAfter(CobblemonItems.SWEET_APPLE, CobblemonItems.TART_APPLE)
|
||||
injector.putAfter(CobblemonItems.SYRUPY_APPLE, CobblemonItems.SWEET_APPLE)
|
||||
|
||||
injector.putAfter(CobblemonItems.MEDICINAL_LEEK, Items.POISONOUS_POTATO)
|
||||
injector.putAfter(CobblemonItems.ROASTED_LEEK, CobblemonItems.MEDICINAL_LEEK)
|
||||
injector.putAfter(CobblemonItems.BRAISED_VIVICHOKE, CobblemonItems.ROASTED_LEEK)
|
||||
|
||||
injector.putAfter(CobblemonItems.WHIPPED_DREAM, Items.PUMPKIN_PIE)
|
||||
injector.putAfter(CobblemonItems.STRAWBERRY_SWEET, CobblemonItems.WHIPPED_DREAM)
|
||||
injector.putAfter(CobblemonItems.LOVE_SWEET, CobblemonItems.STRAWBERRY_SWEET)
|
||||
injector.putAfter(CobblemonItems.BERRY_SWEET, CobblemonItems.LOVE_SWEET)
|
||||
injector.putAfter(CobblemonItems.CLOVER_SWEET, CobblemonItems.BERRY_SWEET)
|
||||
injector.putAfter(CobblemonItems.FLOWER_SWEET, CobblemonItems.CLOVER_SWEET)
|
||||
injector.putAfter(CobblemonItems.STAR_SWEET, CobblemonItems.FLOWER_SWEET)
|
||||
injector.putAfter(CobblemonItems.RIBBON_SWEET, CobblemonItems.STAR_SWEET)
|
||||
|
||||
injector.putAfter(CobblemonItems.LEEK_AND_POTATO_STEW, Items.RABBIT_STEW)
|
||||
injector.putAfter(CobblemonItems.VIVICHOKE_DIP, CobblemonItems.LEEK_AND_POTATO_STEW)
|
||||
}
|
||||
|
||||
+51
@@ -0,0 +1,51 @@
|
||||
/*
|
||||
* 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.net.messages.server.debug
|
||||
|
||||
import com.cobblemon.mod.common.api.net.NetworkPacket
|
||||
import com.cobblemon.mod.common.api.riding.RidingStyle
|
||||
import com.cobblemon.mod.common.util.cobblemonResource
|
||||
import net.minecraft.network.RegistryFriendlyByteBuf
|
||||
|
||||
class ServerboundUpdateRidingStatsPacket(
|
||||
val entity: Int,
|
||||
val ridingStyle: RidingStyle,
|
||||
val speed: Double,
|
||||
val acceleration: Double,
|
||||
val skill: Double,
|
||||
val jump: Double,
|
||||
val stamina: Double,
|
||||
) : NetworkPacket<ServerboundUpdateRidingStatsPacket> {
|
||||
override val id = ID
|
||||
|
||||
override fun encode(buffer: RegistryFriendlyByteBuf) {
|
||||
buffer.writeInt(entity)
|
||||
buffer.writeEnum(ridingStyle)
|
||||
buffer.writeDouble(speed)
|
||||
buffer.writeDouble(acceleration)
|
||||
buffer.writeDouble(skill)
|
||||
buffer.writeDouble(jump)
|
||||
buffer.writeDouble(stamina)
|
||||
}
|
||||
|
||||
companion object {
|
||||
val ID = cobblemonResource("c2s_update_ride_stats")
|
||||
fun decode(buffer: RegistryFriendlyByteBuf): ServerboundUpdateRidingStatsPacket {
|
||||
return ServerboundUpdateRidingStatsPacket(
|
||||
entity = buffer.readInt(),
|
||||
ridingStyle = buffer.readEnum(RidingStyle::class.java),
|
||||
speed = buffer.readDouble(),
|
||||
acceleration = buffer.readDouble(),
|
||||
skill = buffer.readDouble(),
|
||||
jump = buffer.readDouble(),
|
||||
stamina = buffer.readDouble()
|
||||
)
|
||||
}
|
||||
}
|
||||
}
|
||||
+66
@@ -0,0 +1,66 @@
|
||||
/*
|
||||
* 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.net.messages.server.debug
|
||||
|
||||
import com.cobblemon.mod.common.api.net.NetworkPacket
|
||||
import com.cobblemon.mod.common.api.riding.RidingStyle
|
||||
import com.cobblemon.mod.common.util.cobblemonResource
|
||||
import net.minecraft.network.RegistryFriendlyByteBuf
|
||||
|
||||
class ServerboundUpdateRidingStatRangePacket(
|
||||
val entity: Int,
|
||||
val ridingStyle: RidingStyle,
|
||||
val minSpeed: Int,
|
||||
val maxSpeed: Int,
|
||||
val minAcceleration: Int,
|
||||
val maxAcceleration: Int,
|
||||
val minSkill: Int,
|
||||
val maxSkill: Int,
|
||||
val minJump: Int,
|
||||
val maxJump: Int,
|
||||
val minStamina: Int,
|
||||
val maxStamina: Int
|
||||
) : NetworkPacket<ServerboundUpdateRidingStatRangePacket> {
|
||||
override val id = ID
|
||||
|
||||
override fun encode(buffer: RegistryFriendlyByteBuf) {
|
||||
buffer.writeInt(entity)
|
||||
buffer.writeEnum(ridingStyle)
|
||||
buffer.writeInt(minSpeed)
|
||||
buffer.writeInt(maxSpeed)
|
||||
buffer.writeInt(minAcceleration)
|
||||
buffer.writeInt(maxAcceleration)
|
||||
buffer.writeInt(minSkill)
|
||||
buffer.writeInt(maxSkill)
|
||||
buffer.writeInt(minJump)
|
||||
buffer.writeInt(maxJump)
|
||||
buffer.writeInt(minStamina)
|
||||
buffer.writeInt(maxStamina)
|
||||
}
|
||||
|
||||
companion object {
|
||||
val ID = cobblemonResource("c2s_update_ride_stat_range")
|
||||
fun decode(buffer: RegistryFriendlyByteBuf): ServerboundUpdateRidingStatRangePacket {
|
||||
return ServerboundUpdateRidingStatRangePacket(
|
||||
entity = buffer.readInt(),
|
||||
ridingStyle = buffer.readEnum(RidingStyle::class.java),
|
||||
minSpeed = buffer.readInt(),
|
||||
maxSpeed = buffer.readInt(),
|
||||
minAcceleration = buffer.readInt(),
|
||||
maxAcceleration = buffer.readInt(),
|
||||
minSkill = buffer.readInt(),
|
||||
maxSkill = buffer.readInt(),
|
||||
minJump = buffer.readInt(),
|
||||
maxJump = buffer.readInt(),
|
||||
minStamina = buffer.readInt(),
|
||||
maxStamina = buffer.readInt()
|
||||
)
|
||||
}
|
||||
}
|
||||
}
|
||||
+45
@@ -0,0 +1,45 @@
|
||||
/*
|
||||
* 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.net.serverhandling.debug
|
||||
|
||||
import com.cobblemon.mod.common.Cobblemon
|
||||
import com.cobblemon.mod.common.api.net.ServerNetworkPacketHandler
|
||||
import com.cobblemon.mod.common.api.riding.stats.RidingStat
|
||||
import com.cobblemon.mod.common.entity.pokemon.PokemonEntity
|
||||
import com.cobblemon.mod.common.net.messages.server.debug.ServerboundUpdateRidingStatRangePacket
|
||||
import net.minecraft.server.MinecraftServer
|
||||
import net.minecraft.server.level.ServerPlayer
|
||||
|
||||
object ServerboundUpdateRidingStatRangeHandler : ServerNetworkPacketHandler<ServerboundUpdateRidingStatRangePacket> {
|
||||
|
||||
override fun handle(packet: ServerboundUpdateRidingStatRangePacket, server: MinecraftServer, player: ServerPlayer) {
|
||||
if (!Cobblemon.config.enableDebugKeys) return
|
||||
|
||||
val entity = player.level().getEntity(packet.entity) ?: return
|
||||
if (entity !is PokemonEntity) return
|
||||
if (entity.controllingPassenger != player) return
|
||||
|
||||
if (packet.minSpeed < packet.maxSpeed) {
|
||||
entity.rideProp.updateStatRange(RidingStat.SPEED, packet.ridingStyle, packet.minSpeed, packet.maxSpeed)
|
||||
}
|
||||
if (packet.minAcceleration < packet.maxAcceleration) {
|
||||
entity.rideProp.updateStatRange(RidingStat.ACCELERATION, packet.ridingStyle, packet.minAcceleration, packet.maxAcceleration)
|
||||
}
|
||||
if (packet.minSkill < packet.maxSkill) {
|
||||
entity.rideProp.updateStatRange(RidingStat.SKILL, packet.ridingStyle, packet.minSkill, packet.maxSkill)
|
||||
}
|
||||
if (packet.minJump < packet.maxJump) {
|
||||
entity.rideProp.updateStatRange(RidingStat.JUMP, packet.ridingStyle, packet.minJump, packet.maxJump)
|
||||
}
|
||||
if (packet.minStamina < packet.maxStamina) {
|
||||
entity.rideProp.updateStatRange(RidingStat.STAMINA, packet.ridingStyle, packet.minStamina, packet.maxStamina)
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
+34
@@ -0,0 +1,34 @@
|
||||
/*
|
||||
* 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.net.serverhandling.debug
|
||||
|
||||
import com.cobblemon.mod.common.Cobblemon
|
||||
import com.cobblemon.mod.common.api.net.ServerNetworkPacketHandler
|
||||
import com.cobblemon.mod.common.api.riding.stats.RidingStat
|
||||
import com.cobblemon.mod.common.entity.pokemon.PokemonEntity
|
||||
import com.cobblemon.mod.common.net.messages.server.debug.ServerboundUpdateRidingStatsPacket
|
||||
import net.minecraft.server.MinecraftServer
|
||||
import net.minecraft.server.level.ServerPlayer
|
||||
|
||||
object ServerboundUpdateRidingStatsHandler : ServerNetworkPacketHandler<ServerboundUpdateRidingStatsPacket> {
|
||||
|
||||
override fun handle(packet: ServerboundUpdateRidingStatsPacket, server: MinecraftServer, player: ServerPlayer) {
|
||||
if (!Cobblemon.config.enableDebugKeys) return
|
||||
|
||||
val entity = player.level().getEntity(packet.entity) ?: return
|
||||
if (entity !is PokemonEntity) return
|
||||
if (entity.controllingPassenger != player) return
|
||||
entity.overrideRideStat(packet.ridingStyle, RidingStat.SPEED, packet.speed)
|
||||
entity.overrideRideStat(packet.ridingStyle, RidingStat.ACCELERATION, packet.acceleration)
|
||||
entity.overrideRideStat(packet.ridingStyle, RidingStat.SKILL, packet.skill)
|
||||
entity.overrideRideStat(packet.ridingStyle, RidingStat.JUMP, packet.jump)
|
||||
entity.overrideRideStat(packet.ridingStyle, RidingStat.STAMINA, packet.stamina)
|
||||
}
|
||||
|
||||
}
|
||||
+31
-16
@@ -10,6 +10,8 @@ package com.cobblemon.mod.common.net.serverhandling.storage
|
||||
|
||||
import com.cobblemon.mod.common.Cobblemon
|
||||
import com.cobblemon.mod.common.api.net.ServerNetworkPacketHandler
|
||||
import com.cobblemon.mod.common.api.riding.RidingStyle
|
||||
import com.cobblemon.mod.common.entity.pokemon.PokemonEntity
|
||||
import com.cobblemon.mod.common.net.messages.server.SendOutPokemonPacket
|
||||
import com.cobblemon.mod.common.pokemon.activestate.ActivePokemonState
|
||||
import com.cobblemon.mod.common.pokemon.activestate.ShoulderedState
|
||||
@@ -41,22 +43,35 @@ object SendOutPokemonHandler : ServerNetworkPacketHandler<SendOutPokemonPacket>
|
||||
}
|
||||
} else {
|
||||
val entity = state.entity
|
||||
if (entity != null) {
|
||||
// Calculate time until ball throw animation would be finished nicely
|
||||
val buffer = THROW_DURATION + 0.5F - entity.ticksLived.toFloat() / 20F
|
||||
if (buffer > 0.75F) {
|
||||
// Do nothing if the recall button is spammed too fast
|
||||
} else if (buffer > 0) {
|
||||
// If the recall button is pressed early,
|
||||
// buffer the recall instruction until after ball throw animation is complete
|
||||
entity.after(buffer) { entity.recallWithAnimation() }
|
||||
} else {
|
||||
// Recall normally
|
||||
entity.recallWithAnimation()
|
||||
}
|
||||
} else {
|
||||
pokemon.recall()
|
||||
when {
|
||||
entity == null -> pokemon.recall()
|
||||
entity.canStopRiding(entity, player) -> stopRiding(entity, player)
|
||||
else -> recallWithAnimation(entity)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private fun stopRiding(pokemon: PokemonEntity, driver: ServerPlayer) {
|
||||
val shouldStopRiding = pokemon.ifRidingAvailableSupply(false) { behaviour, settings, state ->
|
||||
behaviour.getRidingStyle(settings, state) != RidingStyle.AIR
|
||||
}
|
||||
if (shouldStopRiding) {
|
||||
driver.stopRiding()
|
||||
}
|
||||
}
|
||||
|
||||
private fun recallWithAnimation(pokemon: PokemonEntity) {
|
||||
// Calculate time until ball throw animation would be finished nicely
|
||||
val buffer = THROW_DURATION + 0.5F - pokemon.ticksLived.toFloat() / 20F
|
||||
if (buffer > 0.75F) {
|
||||
// Do nothing if the recall button is spammed too fast
|
||||
} else if (buffer > 0) {
|
||||
// If the recall button is pressed early,
|
||||
// buffer the recall instruction until after ball throw animation is complete
|
||||
pokemon.after(buffer) { pokemon.recallWithAnimation() }
|
||||
} else {
|
||||
// Recall normally
|
||||
pokemon.recallWithAnimation()
|
||||
}
|
||||
}
|
||||
}
|
||||
+5
@@ -26,6 +26,11 @@ object RequestRenamePCBoxHandler : ServerNetworkPacketHandler<RequestRenamePCBox
|
||||
}
|
||||
|
||||
val box = pc.boxes[packet.boxNumber]
|
||||
if (packet.name != null && packet.name.length > 19) {
|
||||
RenamePCBoxPacket(pc.uuid, packet.boxNumber, box.name).sendToPlayer(player)
|
||||
return
|
||||
}
|
||||
|
||||
CobblemonEvents.RENAME_PC_BOX_EVENT_PRE.postThenFinally(
|
||||
event = RenamePCBoxEvent.Pre(player, box, packet.name?: ""),
|
||||
ifSucceeded = { preEvent ->
|
||||
|
||||
+2
-1
@@ -8,6 +8,7 @@
|
||||
|
||||
package com.cobblemon.mod.common.platform.events
|
||||
|
||||
import net.minecraft.server.level.ServerLevel
|
||||
import net.minecraft.server.level.ServerPlayer
|
||||
|
||||
class ChangeDimensionEvent(val player: ServerPlayer)
|
||||
class ChangeDimensionEvent(val player: ServerPlayer, val origin: ServerLevel?, val destination: ServerLevel?)
|
||||
+21
-8
@@ -28,11 +28,14 @@ import net.minecraft.client.player.LocalPlayer
|
||||
import net.minecraft.client.resources.sounds.SimpleSoundInstance
|
||||
import net.minecraft.resources.ResourceLocation
|
||||
import net.minecraft.sounds.SoundEvent
|
||||
import net.minecraft.util.Mth.clamp
|
||||
import kotlin.math.exp
|
||||
import kotlin.math.ln
|
||||
|
||||
class PokedexUsageContext {
|
||||
companion object {
|
||||
const val ZOOM_STAGES = 10
|
||||
const val ZOOM_MAX_STEP = 9F
|
||||
const val ZOOM_TARGET_FOV = 10F // the FOV we get at max zoom (probably somewhat inaccurate, but irrelevant)
|
||||
const val ZOOM_BASE_FOV = 80F // getting FOV from MC is easy, but pin it for consistent step count/zoom dist
|
||||
const val BLOCK_LENGTH_PER_ZOOM_STAGE = 2
|
||||
const val OPEN_SCANNER_BUFFER_TICKS = 5 // Open scanner interface if usage ticks are above this threshold
|
||||
const val VIEW_INFO_BUFFER_TICKS = 10
|
||||
@@ -59,6 +62,7 @@ class PokedexUsageContext {
|
||||
var focusIntervals: Float = 0F
|
||||
var innerRingRotation: Float = 0F
|
||||
var zoomLevel: Float = 0F
|
||||
var zoomModifier: Float = 1F
|
||||
var newPokemonInfo: PokedexLearnedInformation = PokedexLearnedInformation.NONE
|
||||
var type: PokedexType = PokedexType.RED
|
||||
var availableInfoFrames: MutableList<Boolean?> = mutableListOf(null, null, null, null)
|
||||
@@ -204,6 +208,7 @@ class PokedexUsageContext {
|
||||
fun resetState(resetAnimationStates: Boolean = true) {
|
||||
scanningGuiOpen = false
|
||||
zoomLevel = 0F
|
||||
zoomModifier = 1F
|
||||
focusIntervals = 0F
|
||||
resetFocusedPokemonState()
|
||||
|
||||
@@ -215,14 +220,22 @@ class PokedexUsageContext {
|
||||
}
|
||||
|
||||
fun adjustZoom(verticalScrollAmount: Double) {
|
||||
zoomLevel = clamp(zoomLevel + verticalScrollAmount.toFloat(), 0F, ZOOM_STAGES.toFloat())
|
||||
if (zoomLevel > 0F && zoomLevel < ZOOM_STAGES.toFloat()) {
|
||||
playSound(CobblemonSounds.POKEDEX_SCAN_ZOOM_INCREMENT)
|
||||
}
|
||||
if ((zoomLevel <= 0F && verticalScrollAmount < 0) || (zoomLevel >= ZOOM_MAX_STEP && verticalScrollAmount > 0))
|
||||
return
|
||||
|
||||
playSound(CobblemonSounds.POKEDEX_SCAN_ZOOM_INCREMENT)
|
||||
zoomLevel = (zoomLevel + verticalScrollAmount.toFloat()).coerceIn(0F, ZOOM_MAX_STEP)
|
||||
innerRingRotation = (innerRingRotation + 15) % 360
|
||||
val startLog = ln(ZOOM_BASE_FOV)
|
||||
val targetLog = ln(ZOOM_TARGET_FOV)
|
||||
val stepSize = (startLog - targetLog) / ZOOM_MAX_STEP
|
||||
val currentZoomLog = startLog - (zoomLevel * stepSize)
|
||||
val currentFov = exp(currentZoomLog)
|
||||
zoomModifier = currentFov / ZOOM_BASE_FOV
|
||||
}
|
||||
|
||||
// Higher multiplier = more zoomed out
|
||||
fun getFovMultiplier() = 1 - (zoomLevel / ZOOM_STAGES)
|
||||
// 1 = normal FOV; 0 = max zoom; this runs on render update, best to keep logic out of here
|
||||
fun getFovMultiplier() = zoomModifier
|
||||
|
||||
fun playSound(soundEvent: SoundEvent) {
|
||||
Minecraft.getInstance().soundManager.play(SimpleSoundInstance.forUI(soundEvent, 1.0F))
|
||||
|
||||
+16
-8
@@ -9,13 +9,18 @@
|
||||
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.air.*
|
||||
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.api.riding.behaviour.types.land.HorseBehaviour
|
||||
import com.cobblemon.mod.common.api.riding.behaviour.types.land.HorseSettings
|
||||
import com.cobblemon.mod.common.api.riding.behaviour.types.land.VehicleBehaviour
|
||||
import com.cobblemon.mod.common.api.riding.behaviour.types.land.VehicleSettings
|
||||
import com.cobblemon.mod.common.api.riding.behaviour.types.liquid.*
|
||||
import com.cobblemon.mod.common.util.asIdentifierDefaultingNamespace
|
||||
import com.google.gson.JsonDeserializationContext
|
||||
import com.google.gson.JsonDeserializer
|
||||
@@ -29,15 +34,18 @@ 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(
|
||||
BirdBehaviour.KEY to BirdSettings::class.java,
|
||||
DolphinBehaviour.KEY to DolphinSettings::class.java,
|
||||
GenericLandBehaviour.KEY to GenericLandSettings::class.java,
|
||||
GenericSwimBehaviour.KEY to GenericSwimSettings::class.java,
|
||||
GliderAirBehaviour.KEY to GliderAirSettings::class.java,
|
||||
HorseBehaviour.KEY to HorseSettings::class.java,
|
||||
BoatBehaviour.KEY to BoatSettings::class.java,
|
||||
SubmarineBehaviour.KEY to SubmarineSettings::class.java,
|
||||
GliderBehaviour.KEY to GliderSettings::class.java,
|
||||
HelicopterBehaviour.KEY to HelicopterSettings::class.java,
|
||||
JetAirBehaviour.KEY to JetAirSettings::class.java,
|
||||
SwimDashBehaviour.KEY to SwimDashSettings::class.java,
|
||||
VehicleLandBehaviour.KEY to VehicleLandSettings::class.java,
|
||||
JetBehaviour.KEY to JetSettings::class.java,
|
||||
BurstBehaviour.KEY to BurstSettings::class.java,
|
||||
VehicleBehaviour.KEY to VehicleSettings::class.java,
|
||||
HoverBehaviour.KEY to HoverSettings::class.java,
|
||||
CompositeBehaviour.KEY to CompositeSettings::class.java,
|
||||
|
||||
/*
|
||||
|
||||
+28
@@ -0,0 +1,28 @@
|
||||
{
|
||||
"format_version": "1.8.0",
|
||||
"animations": {
|
||||
"animation.ride_test.sitting": {
|
||||
"loop": true,
|
||||
"bones": {
|
||||
"body": {
|
||||
"position": [0, -9, 0]
|
||||
},
|
||||
"torso": {
|
||||
"rotation": [25, 0, 0]
|
||||
},
|
||||
"arm_right": {
|
||||
"rotation": [0, 0, 22.5]
|
||||
},
|
||||
"arm_left": {
|
||||
"rotation": [0, 0, -27.5]
|
||||
},
|
||||
"leg_right": {
|
||||
"rotation": [-90, 20, 0]
|
||||
},
|
||||
"leg_left": {
|
||||
"rotation": [-90, -20, 0]
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
+488
-93
@@ -2272,23 +2272,59 @@
|
||||
"eyelid_right": {
|
||||
"position": {
|
||||
"0.0": [0, 0, 0],
|
||||
"0.4167": {"pre": [0, 0, 0], "post": [-0.1, 0.1, 0]},
|
||||
"0.5833": {"pre": [-0.1, 0.1, 0], "post": [0, 0, 0]},
|
||||
"2.0417": {"pre": [0, 0, 0], "post": [-0.1, 0.1, 0]},
|
||||
"2.375": {"pre": [-0.1, 0.1, 0], "post": [0, 0, 0]},
|
||||
"3.0": {"pre": [0, 0, 0], "post": [-0.1, 0.1, 0]},
|
||||
"5.875": {"pre": [-0.1, 0.1, 0], "post": [0, 0, 0]}
|
||||
"0.4167": {
|
||||
"pre": [0, 0, 0],
|
||||
"post": [-0.1, 0.1, 0]
|
||||
},
|
||||
"0.5833": {
|
||||
"pre": [-0.1, 0.1, 0],
|
||||
"post": [0, 0, 0]
|
||||
},
|
||||
"2.0417": {
|
||||
"pre": [0, 0, 0],
|
||||
"post": [-0.1, 0.1, 0]
|
||||
},
|
||||
"2.375": {
|
||||
"pre": [-0.1, 0.1, 0],
|
||||
"post": [0, 0, 0]
|
||||
},
|
||||
"3.0": {
|
||||
"pre": [0, 0, 0],
|
||||
"post": [-0.1, 0.1, 0]
|
||||
},
|
||||
"5.875": {
|
||||
"pre": [-0.1, 0.1, 0],
|
||||
"post": [0, 0, 0]
|
||||
}
|
||||
}
|
||||
},
|
||||
"eyelid_left": {
|
||||
"position": {
|
||||
"0.0": [0, 0, 0],
|
||||
"0.4167": {"pre": [0, 0, 0], "post": [0.1, 0.1, 0]},
|
||||
"0.5833": {"pre": [0.1, 0.1, 0], "post": [0, 0, 0]},
|
||||
"2.0417": {"pre": [0, 0, 0], "post": [0.1, 0.1, 0]},
|
||||
"2.375": {"pre": [0.1, 0.1, 0], "post": [0, 0, 0]},
|
||||
"3.0": {"pre": [0, 0, 0], "post": [0.1, 0.1, 0]},
|
||||
"5.875": {"pre": [0.1, 0.1, 0], "post": [0, 0, 0]}
|
||||
"0.4167": {
|
||||
"pre": [0, 0, 0],
|
||||
"post": [0.1, 0.1, 0]
|
||||
},
|
||||
"0.5833": {
|
||||
"pre": [0.1, 0.1, 0],
|
||||
"post": [0, 0, 0]
|
||||
},
|
||||
"2.0417": {
|
||||
"pre": [0, 0, 0],
|
||||
"post": [0.1, 0.1, 0]
|
||||
},
|
||||
"2.375": {
|
||||
"pre": [0.1, 0.1, 0],
|
||||
"post": [0, 0, 0]
|
||||
},
|
||||
"3.0": {
|
||||
"pre": [0, 0, 0],
|
||||
"post": [0.1, 0.1, 0]
|
||||
},
|
||||
"5.875": {
|
||||
"pre": [0.1, 0.1, 0],
|
||||
"post": [0, 0, 0]
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -2553,15 +2589,27 @@
|
||||
"eyelid_right": {
|
||||
"position": {
|
||||
"0.0": [0, 0, 0],
|
||||
"1.25": {"pre": [0, 0, 0], "post": [-0.1, 0.1, 0]},
|
||||
"3.6667": {"pre": [-0.1, 0.1, 0], "post": [0, 0, 0]}
|
||||
"1.25": {
|
||||
"pre": [0, 0, 0],
|
||||
"post": [-0.1, 0.1, 0]
|
||||
},
|
||||
"3.6667": {
|
||||
"pre": [-0.1, 0.1, 0],
|
||||
"post": [0, 0, 0]
|
||||
}
|
||||
}
|
||||
},
|
||||
"eyelid_left": {
|
||||
"position": {
|
||||
"0.0": [0, 0, 0],
|
||||
"1.25": {"pre": [0, 0, 0], "post": [0.1, 0.1, 0]},
|
||||
"3.6667": {"pre": [0.1, 0.1, 0], "post": [0, 0, 0]}
|
||||
"1.25": {
|
||||
"pre": [0, 0, 0],
|
||||
"post": [0.1, 0.1, 0]
|
||||
},
|
||||
"3.6667": {
|
||||
"pre": [0.1, 0.1, 0],
|
||||
"post": [0, 0, 0]
|
||||
}
|
||||
}
|
||||
},
|
||||
"jaw": {
|
||||
@@ -8763,19 +8811,43 @@
|
||||
"eyelid_right": {
|
||||
"position": {
|
||||
"0.0": [0, 0, 0],
|
||||
"0.25": {"pre": [0, 0, 0], "post": [-0.1, 0.1, 0]},
|
||||
"0.5": {"pre": [-0.1, 0.1, 0], "post": [0, 0, 0]},
|
||||
"2.25": {"pre": [0, 0, 0], "post": [-0.1, 0.1, 0]},
|
||||
"2.4583": {"pre": [-0.1, 0.1, 0], "post": [0, 0, 0]}
|
||||
"0.25": {
|
||||
"pre": [0, 0, 0],
|
||||
"post": [-0.1, 0.1, 0]
|
||||
},
|
||||
"0.5": {
|
||||
"pre": [-0.1, 0.1, 0],
|
||||
"post": [0, 0, 0]
|
||||
},
|
||||
"2.25": {
|
||||
"pre": [0, 0, 0],
|
||||
"post": [-0.1, 0.1, 0]
|
||||
},
|
||||
"2.4583": {
|
||||
"pre": [-0.1, 0.1, 0],
|
||||
"post": [0, 0, 0]
|
||||
}
|
||||
}
|
||||
},
|
||||
"eyelid_left": {
|
||||
"position": {
|
||||
"0.0": [0, 0, 0],
|
||||
"0.25": {"pre": [0, 0, 0], "post": [0.1, 0.1, 0]},
|
||||
"0.5": {"pre": [0.1, 0.1, 0], "post": [0, 0, 0]},
|
||||
"2.25": {"pre": [0, 0, 0], "post": [0.1, 0.1, 0]},
|
||||
"2.4583": {"pre": [0.1, 0.1, 0], "post": [0, 0, 0]}
|
||||
"0.25": {
|
||||
"pre": [0, 0, 0],
|
||||
"post": [0.1, 0.1, 0]
|
||||
},
|
||||
"0.5": {
|
||||
"pre": [0.1, 0.1, 0],
|
||||
"post": [0, 0, 0]
|
||||
},
|
||||
"2.25": {
|
||||
"pre": [0, 0, 0],
|
||||
"post": [0.1, 0.1, 0]
|
||||
},
|
||||
"2.4583": {
|
||||
"pre": [0.1, 0.1, 0],
|
||||
"post": [0, 0, 0]
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -11221,23 +11293,59 @@
|
||||
"eyelid_right": {
|
||||
"position": {
|
||||
"0.0": [0, 0, 0],
|
||||
"0.25": {"pre": [0, 0, 0], "post": [-0.1, 0.1, 0]},
|
||||
"0.4167": {"pre": [-0.1, 0.1, 0], "post": [0, 0, 0]},
|
||||
"0.8333": {"pre": [0, 0, 0], "post": [-0.1, 0.1, 0]},
|
||||
"1.125": {"pre": [-0.1, 0.1, 0], "post": [0, 0, 0]},
|
||||
"2.5417": {"pre": [0, 0, 0], "post": [-0.1, 0.1, 0]},
|
||||
"2.6667": {"pre": [-0.1, 0.1, 0], "post": [0, 0, 0]}
|
||||
"0.25": {
|
||||
"pre": [0, 0, 0],
|
||||
"post": [-0.1, 0.1, 0]
|
||||
},
|
||||
"0.4167": {
|
||||
"pre": [-0.1, 0.1, 0],
|
||||
"post": [0, 0, 0]
|
||||
},
|
||||
"0.8333": {
|
||||
"pre": [0, 0, 0],
|
||||
"post": [-0.1, 0.1, 0]
|
||||
},
|
||||
"1.125": {
|
||||
"pre": [-0.1, 0.1, 0],
|
||||
"post": [0, 0, 0]
|
||||
},
|
||||
"2.5417": {
|
||||
"pre": [0, 0, 0],
|
||||
"post": [-0.1, 0.1, 0]
|
||||
},
|
||||
"2.6667": {
|
||||
"pre": [-0.1, 0.1, 0],
|
||||
"post": [0, 0, 0]
|
||||
}
|
||||
}
|
||||
},
|
||||
"eyelid_left": {
|
||||
"position": {
|
||||
"0.0": [0, 0, 0],
|
||||
"0.25": {"pre": [0, 0, 0], "post": [0.1, 0.1, 0]},
|
||||
"0.4167": {"pre": [0.1, 0.1, 0], "post": [0, 0, 0]},
|
||||
"0.8333": {"pre": [0, 0, 0], "post": [0.1, 0.1, 0]},
|
||||
"1.125": {"pre": [0.1, 0.1, 0], "post": [0, 0, 0]},
|
||||
"2.5417": {"pre": [0, 0, 0], "post": [0.1, 0.1, 0]},
|
||||
"2.6667": {"pre": [0.1, 0.1, 0], "post": [0, 0, 0]}
|
||||
"0.25": {
|
||||
"pre": [0, 0, 0],
|
||||
"post": [0.1, 0.1, 0]
|
||||
},
|
||||
"0.4167": {
|
||||
"pre": [0.1, 0.1, 0],
|
||||
"post": [0, 0, 0]
|
||||
},
|
||||
"0.8333": {
|
||||
"pre": [0, 0, 0],
|
||||
"post": [0.1, 0.1, 0]
|
||||
},
|
||||
"1.125": {
|
||||
"pre": [0.1, 0.1, 0],
|
||||
"post": [0, 0, 0]
|
||||
},
|
||||
"2.5417": {
|
||||
"pre": [0, 0, 0],
|
||||
"post": [0.1, 0.1, 0]
|
||||
},
|
||||
"2.6667": {
|
||||
"pre": [0.1, 0.1, 0],
|
||||
"post": [0, 0, 0]
|
||||
}
|
||||
}
|
||||
},
|
||||
"locator_target": {
|
||||
@@ -13529,19 +13637,43 @@
|
||||
"eyelid_right": {
|
||||
"position": {
|
||||
"0.0": [0, 0, 0],
|
||||
"0.3333": {"pre": [0, 0, 0], "post": [-0.1, 0.1, 0]},
|
||||
"1.2083": {"pre": [-0.1, 0.1, 0], "post": [0, 0, 0]},
|
||||
"2.5417": {"pre": [0, 0, 0], "post": [-0.1, 0.1, 0]},
|
||||
"2.7083": {"pre": [-0.1, 0.1, 0], "post": [0, 0, 0]}
|
||||
"0.3333": {
|
||||
"pre": [0, 0, 0],
|
||||
"post": [-0.1, 0.1, 0]
|
||||
},
|
||||
"1.2083": {
|
||||
"pre": [-0.1, 0.1, 0],
|
||||
"post": [0, 0, 0]
|
||||
},
|
||||
"2.5417": {
|
||||
"pre": [0, 0, 0],
|
||||
"post": [-0.1, 0.1, 0]
|
||||
},
|
||||
"2.7083": {
|
||||
"pre": [-0.1, 0.1, 0],
|
||||
"post": [0, 0, 0]
|
||||
}
|
||||
}
|
||||
},
|
||||
"eyelid_left": {
|
||||
"position": {
|
||||
"0.0": [0, 0, 0],
|
||||
"0.3333": {"pre": [0, 0, 0], "post": [0.1, 0.1, 0]},
|
||||
"1.2083": {"pre": [0.1, 0.1, 0], "post": [0, 0, 0]},
|
||||
"2.5417": {"pre": [0, 0, 0], "post": [0.1, 0.1, 0]},
|
||||
"2.7083": {"pre": [0.1, 0.1, 0], "post": [0, 0, 0]}
|
||||
"0.3333": {
|
||||
"pre": [0, 0, 0],
|
||||
"post": [0.1, 0.1, 0]
|
||||
},
|
||||
"1.2083": {
|
||||
"pre": [0.1, 0.1, 0],
|
||||
"post": [0, 0, 0]
|
||||
},
|
||||
"2.5417": {
|
||||
"pre": [0, 0, 0],
|
||||
"post": [0.1, 0.1, 0]
|
||||
},
|
||||
"2.7083": {
|
||||
"pre": [0.1, 0.1, 0],
|
||||
"post": [0, 0, 0]
|
||||
}
|
||||
}
|
||||
},
|
||||
"locator_mouth": {
|
||||
@@ -13740,14 +13872,20 @@
|
||||
"position": {
|
||||
"0.0": [-0.1, 0.1, 0],
|
||||
"0.125": [-0.1, 0.1, 0],
|
||||
"0.1667": {"pre": [-0.1, 0.1, 0], "post": [0, 0, 0]}
|
||||
"0.1667": {
|
||||
"pre": [-0.1, 0.1, 0],
|
||||
"post": [0, 0, 0]
|
||||
}
|
||||
}
|
||||
},
|
||||
"eyelid_left": {
|
||||
"position": {
|
||||
"0.0": [0.1, 0.1, 0],
|
||||
"0.125": [0.1, 0.1, 0],
|
||||
"0.1667": {"pre": [0.1, 0.1, 0], "post": [0, 0, 0]}
|
||||
"0.1667": {
|
||||
"pre": [0.1, 0.1, 0],
|
||||
"post": [0, 0, 0]
|
||||
}
|
||||
}
|
||||
},
|
||||
"jaw": {
|
||||
@@ -14543,7 +14681,7 @@
|
||||
"rotation": [0, -6, -15]
|
||||
},
|
||||
"wing_right_elbow": {
|
||||
"rotation": [0, "-6", -15],
|
||||
"rotation": [0, "-6+", -15],
|
||||
"position": [0.45, 0.1, 0]
|
||||
},
|
||||
"wing_right_membrane": {
|
||||
@@ -16036,7 +16174,7 @@
|
||||
"animation_length": 4,
|
||||
"bones": {
|
||||
"body": {
|
||||
"rotation": [22.5, 0, "math.sin(q.anim_time*90*1-90)*-0.5"],
|
||||
"rotation": ["22.5 + q.riding.pitch(0)*-90", 0, "math.sin(q.anim_time*90*1-90)*-0.5"],
|
||||
"position": ["math.cos(q.anim_time*90*1-60)*1", "12+math.cos((q.anim_time*90*2-60)+math.sin(q.anim_time*90*2)*20)*3", 0]
|
||||
},
|
||||
"torso": {
|
||||
@@ -17357,6 +17495,14 @@
|
||||
"locator_top": {
|
||||
"position": [0, 13, 0]
|
||||
}
|
||||
},
|
||||
"sound_effects": {
|
||||
"1.125": {
|
||||
"effect": "animation.leather.wing_flap.medium"
|
||||
},
|
||||
"3.1667": {
|
||||
"effect": "animation.leather.wing_flap.medium"
|
||||
}
|
||||
}
|
||||
},
|
||||
"animation.charizard.air_fly": {
|
||||
@@ -18633,6 +18779,17 @@
|
||||
},
|
||||
"locator_top": {
|
||||
"position": [0, -1, 0]
|
||||
},
|
||||
"locator_seat_1": {
|
||||
"rotation": [-60, 0, 0]
|
||||
}
|
||||
},
|
||||
"sound_effects": {
|
||||
"1.0833": {
|
||||
"effect": "animation.leather.wing_flap.medium"
|
||||
},
|
||||
"3.0833": {
|
||||
"effect": "animation.leather.wing_flap.medium"
|
||||
}
|
||||
}
|
||||
},
|
||||
@@ -18898,6 +19055,9 @@
|
||||
},
|
||||
"locator_top": {
|
||||
"position": [0, -6, 0]
|
||||
},
|
||||
"locator_seat_1": {
|
||||
"rotation": [-60, 0, 0]
|
||||
}
|
||||
}
|
||||
},
|
||||
@@ -19097,23 +19257,59 @@
|
||||
"eyelid_right": {
|
||||
"position": {
|
||||
"0.0": [0, 0, 0],
|
||||
"0.4167": {"pre": [0, 0, 0], "post": [-0.1, 0.1, 0]},
|
||||
"0.5833": {"pre": [-0.1, 0.1, 0], "post": [0, 0, 0]},
|
||||
"2.4167": {"pre": [0, 0, 0], "post": [-0.1, 0.1, 0]},
|
||||
"2.5833": {"pre": [-0.1, 0.1, 0], "post": [0, 0, 0]},
|
||||
"3.9167": {"pre": [0, 0, 0], "post": [-0.1, 0.1, 0]},
|
||||
"4.0833": {"pre": [-0.1, 0.1, 0], "post": [0, 0, 0]}
|
||||
"0.4167": {
|
||||
"pre": [0, 0, 0],
|
||||
"post": [-0.1, 0.1, 0]
|
||||
},
|
||||
"0.5833": {
|
||||
"pre": [-0.1, 0.1, 0],
|
||||
"post": [0, 0, 0]
|
||||
},
|
||||
"2.4167": {
|
||||
"pre": [0, 0, 0],
|
||||
"post": [-0.1, 0.1, 0]
|
||||
},
|
||||
"2.5833": {
|
||||
"pre": [-0.1, 0.1, 0],
|
||||
"post": [0, 0, 0]
|
||||
},
|
||||
"3.9167": {
|
||||
"pre": [0, 0, 0],
|
||||
"post": [-0.1, 0.1, 0]
|
||||
},
|
||||
"4.0833": {
|
||||
"pre": [-0.1, 0.1, 0],
|
||||
"post": [0, 0, 0]
|
||||
}
|
||||
}
|
||||
},
|
||||
"eyelid_left": {
|
||||
"position": {
|
||||
"0.0": [0, 0, 0],
|
||||
"0.4167": {"pre": [0, 0, 0], "post": [0.1, 0.1, 0]},
|
||||
"0.5833": {"pre": [0.1, 0.1, 0], "post": [0, 0, 0]},
|
||||
"2.4167": {"pre": [0, 0, 0], "post": [0.1, 0.1, 0]},
|
||||
"2.5833": {"pre": [0.1, 0.1, 0], "post": [0, 0, 0]},
|
||||
"3.9167": {"pre": [0, 0, 0], "post": [0.1, 0.1, 0]},
|
||||
"4.0833": {"pre": [0.1, 0.1, 0], "post": [0, 0, 0]}
|
||||
"0.4167": {
|
||||
"pre": [0, 0, 0],
|
||||
"post": [0.1, 0.1, 0]
|
||||
},
|
||||
"0.5833": {
|
||||
"pre": [0.1, 0.1, 0],
|
||||
"post": [0, 0, 0]
|
||||
},
|
||||
"2.4167": {
|
||||
"pre": [0, 0, 0],
|
||||
"post": [0.1, 0.1, 0]
|
||||
},
|
||||
"2.5833": {
|
||||
"pre": [0.1, 0.1, 0],
|
||||
"post": [0, 0, 0]
|
||||
},
|
||||
"3.9167": {
|
||||
"pre": [0, 0, 0],
|
||||
"post": [0.1, 0.1, 0]
|
||||
},
|
||||
"4.0833": {
|
||||
"pre": [0.1, 0.1, 0],
|
||||
"post": [0, 0, 0]
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -22458,7 +22654,10 @@
|
||||
},
|
||||
"0.5": [0.78, -10.13, 0.45],
|
||||
"0.5417": [-0.45, -8.03, 0.45],
|
||||
"0.5833": {"pre": [-0.45, -8.03, 0.45], "post": [-0.45, "-7.79+360", 0.45]},
|
||||
"0.5833": {
|
||||
"pre": [-0.45, -8.03, 0.45],
|
||||
"post": [-0.45, "-7.79+360", 0.45]
|
||||
},
|
||||
"0.625": [-2.7, 355.37, 0.45],
|
||||
"1.0": {
|
||||
"pre": [-9.46, "10.71+360", 0.5],
|
||||
@@ -26129,23 +26328,59 @@
|
||||
"eyelid_right": {
|
||||
"position": {
|
||||
"0.0": [0, 0, 0],
|
||||
"0.0833": {"pre": [0, 0, 0], "post": [-0.1, 0.1, 0]},
|
||||
"0.3333": {"pre": [-0.1, 0.1, 0], "post": [0, 0, 0]},
|
||||
"1.625": {"pre": [0, 0, 0], "post": [-0.1, 0.1, 0]},
|
||||
"1.8333": {"pre": [-0.1, 0.1, 0], "post": [0, 0, 0]},
|
||||
"2.5": {"pre": [0, 0, 0], "post": [-0.1, 0.1, 0]},
|
||||
"2.625": {"pre": [-0.1, 0.1, 0], "post": [0, 0, 0]}
|
||||
"0.0833": {
|
||||
"pre": [0, 0, 0],
|
||||
"post": [-0.1, 0.1, 0]
|
||||
},
|
||||
"0.3333": {
|
||||
"pre": [-0.1, 0.1, 0],
|
||||
"post": [0, 0, 0]
|
||||
},
|
||||
"1.625": {
|
||||
"pre": [0, 0, 0],
|
||||
"post": [-0.1, 0.1, 0]
|
||||
},
|
||||
"1.8333": {
|
||||
"pre": [-0.1, 0.1, 0],
|
||||
"post": [0, 0, 0]
|
||||
},
|
||||
"2.5": {
|
||||
"pre": [0, 0, 0],
|
||||
"post": [-0.1, 0.1, 0]
|
||||
},
|
||||
"2.625": {
|
||||
"pre": [-0.1, 0.1, 0],
|
||||
"post": [0, 0, 0]
|
||||
}
|
||||
}
|
||||
},
|
||||
"eyelid_left": {
|
||||
"position": {
|
||||
"0.0": [0, 0, 0],
|
||||
"0.0833": {"pre": [0, 0, 0], "post": [0.1, 0.1, 0]},
|
||||
"0.3333": {"pre": [0.1, 0.1, 0], "post": [0, 0, 0]},
|
||||
"1.625": {"pre": [0, 0, 0], "post": [0.1, 0.1, 0]},
|
||||
"1.8333": {"pre": [0.1, 0.1, 0], "post": [0, 0, 0]},
|
||||
"2.5": {"pre": [0, 0, 0], "post": [0.1, 0.1, 0]},
|
||||
"2.625": {"pre": [0.1, 0.1, 0], "post": [0, 0, 0]}
|
||||
"0.0833": {
|
||||
"pre": [0, 0, 0],
|
||||
"post": [0.1, 0.1, 0]
|
||||
},
|
||||
"0.3333": {
|
||||
"pre": [0.1, 0.1, 0],
|
||||
"post": [0, 0, 0]
|
||||
},
|
||||
"1.625": {
|
||||
"pre": [0, 0, 0],
|
||||
"post": [0.1, 0.1, 0]
|
||||
},
|
||||
"1.8333": {
|
||||
"pre": [0.1, 0.1, 0],
|
||||
"post": [0, 0, 0]
|
||||
},
|
||||
"2.5": {
|
||||
"pre": [0, 0, 0],
|
||||
"post": [0.1, 0.1, 0]
|
||||
},
|
||||
"2.625": {
|
||||
"pre": [0.1, 0.1, 0],
|
||||
"post": [0, 0, 0]
|
||||
}
|
||||
}
|
||||
},
|
||||
"locator_root": {
|
||||
@@ -29385,9 +29620,15 @@
|
||||
"brow": {
|
||||
"position": {
|
||||
"0.9583": [0, 0, 0],
|
||||
"1.1667": {"pre": [0, 0, 0], "post": [0, 0, -0.3]},
|
||||
"1.1667": {
|
||||
"pre": [0, 0, 0],
|
||||
"post": [0, 0, -0.3]
|
||||
},
|
||||
"2.2917": [0, 0, -0.3],
|
||||
"2.5417": {"pre": [0, 0, -0.3], "post": [0, 0, 0]}
|
||||
"2.5417": {
|
||||
"pre": [0, 0, -0.3],
|
||||
"post": [0, 0, 0]
|
||||
}
|
||||
}
|
||||
},
|
||||
"jaw": {
|
||||
@@ -29722,19 +29963,43 @@
|
||||
"eyelid_right": {
|
||||
"position": {
|
||||
"0.0": [0, 0, 0],
|
||||
"0.3333": {"pre": [0, 0, 0], "post": [-0.1, 0.1, 0]},
|
||||
"1.2083": {"pre": [-0.1, 0.1, 0], "post": [0, 0, 0]},
|
||||
"2.375": {"pre": [0, 0, 0], "post": [-0.1, 0.1, 0]},
|
||||
"2.6667": {"pre": [-0.1, 0.1, 0], "post": [0, 0, 0]}
|
||||
"0.3333": {
|
||||
"pre": [0, 0, 0],
|
||||
"post": [-0.1, 0.1, 0]
|
||||
},
|
||||
"1.2083": {
|
||||
"pre": [-0.1, 0.1, 0],
|
||||
"post": [0, 0, 0]
|
||||
},
|
||||
"2.375": {
|
||||
"pre": [0, 0, 0],
|
||||
"post": [-0.1, 0.1, 0]
|
||||
},
|
||||
"2.6667": {
|
||||
"pre": [-0.1, 0.1, 0],
|
||||
"post": [0, 0, 0]
|
||||
}
|
||||
}
|
||||
},
|
||||
"eyelid_left": {
|
||||
"position": {
|
||||
"0.0": [0, 0, 0],
|
||||
"0.3333": {"pre": [0, 0, 0], "post": [0.1, 0.1, 0]},
|
||||
"1.2083": {"pre": [0.1, 0.1, 0], "post": [0, 0, 0]},
|
||||
"2.375": {"pre": [0, 0, 0], "post": [0.1, 0.1, 0]},
|
||||
"2.6667": {"pre": [0.1, 0.1, 0], "post": [0, 0, 0]}
|
||||
"0.3333": {
|
||||
"pre": [0, 0, 0],
|
||||
"post": [0.1, 0.1, 0]
|
||||
},
|
||||
"1.2083": {
|
||||
"pre": [0.1, 0.1, 0],
|
||||
"post": [0, 0, 0]
|
||||
},
|
||||
"2.375": {
|
||||
"pre": [0, 0, 0],
|
||||
"post": [0.1, 0.1, 0]
|
||||
},
|
||||
"2.6667": {
|
||||
"pre": [0.1, 0.1, 0],
|
||||
"post": [0, 0, 0]
|
||||
}
|
||||
}
|
||||
},
|
||||
"locator_root": {
|
||||
@@ -29753,6 +30018,106 @@
|
||||
}
|
||||
}
|
||||
},
|
||||
"animation.charizard.ride_air_look": {
|
||||
"loop": true,
|
||||
"bones": {
|
||||
"body": {
|
||||
"rotation": ["q.riding.pitch_change(0)*-0", "q.riding.yaw_change(0)*-15", "q.riding.roll_change(0)*15"]
|
||||
},
|
||||
"neck": {
|
||||
"rotation": ["math.clamp(q.riding.pitch_change(0),-0.5,1.0)*-20", 0, "q.riding.yaw_change(0)*7"]
|
||||
},
|
||||
"neck2": {
|
||||
"rotation": ["math.clamp(q.riding.pitch_change(0),-0.5,1.0)*-12", 0, "q.riding.yaw_change(0)*12"]
|
||||
},
|
||||
"neck3": {
|
||||
"rotation": ["q.riding.pitch_change(0)*-7", 0, "q.riding.yaw_change(0)*7"]
|
||||
},
|
||||
"neck4": {
|
||||
"rotation": ["q.riding.pitch_change(0)*-7", 0, "q.riding.yaw_change(0)*7"]
|
||||
},
|
||||
"head_angle": {
|
||||
"rotation": ["q.riding.pitch_change(0)*-7", 0, "q.riding.yaw_change(0)*7"]
|
||||
},
|
||||
"shoulder_right": {
|
||||
"rotation": [0, "-12.5*q.riding.pitch_change(0)", "27.5*q.riding.yaw_change(0)"]
|
||||
},
|
||||
"arm_right": {
|
||||
"rotation": [0, "15*q.riding.yaw_change(0)", 0]
|
||||
},
|
||||
"forearm_right": {
|
||||
"rotation": [0, "15*q.riding.yaw_change(0)", "-12.5*q.riding.pitch_change(0)"]
|
||||
},
|
||||
"shoulder_left": {
|
||||
"rotation": [0, "12.5*q.riding.pitch_change(0)", "27.5*q.riding.yaw_change(0)"]
|
||||
},
|
||||
"arm_left": {
|
||||
"rotation": [0, "15*q.riding.yaw_change(0)", 0]
|
||||
},
|
||||
"forearm_left": {
|
||||
"rotation": [0, "15*q.riding.yaw_change(0)", "12.5*q.riding.pitch_change(0)"]
|
||||
},
|
||||
"wing_right_base": {
|
||||
"rotation": ["-5*q.riding.pitch_change(0)", 0, 0]
|
||||
},
|
||||
"wing_right_bend": {
|
||||
"rotation": ["10*q.riding.yaw_change(0)", "7.5*q.riding.pitch_change(0)", "10*q.riding.yaw_change(0)"]
|
||||
},
|
||||
"wing_right_mid": {
|
||||
"rotation": ["-5*q.riding.pitch_change(0)", 0, 0]
|
||||
},
|
||||
"wing_right_elbow": {
|
||||
"rotation": ["-2.5*q.riding.pitch_change(0)", "5*q.riding.pitch_change(0)", 0]
|
||||
},
|
||||
"wing_left_base": {
|
||||
"rotation": ["-5*q.riding.pitch_change(0)", 0, 0]
|
||||
},
|
||||
"wing_left_bend": {
|
||||
"rotation": ["-10*q.riding.yaw_change(0)", "-7.5*q.riding.pitch_change(0)", "-10*q.riding.yaw_change(0)"]
|
||||
},
|
||||
"wing_left_mid": {
|
||||
"rotation": ["-5*q.riding.pitch_change(0)", 0, 0]
|
||||
},
|
||||
"wing_left_elbow": {
|
||||
"rotation": ["-2.5*q.riding.pitch_change(0)", "-(5*q.riding.pitch_change(0))", 0]
|
||||
},
|
||||
"tail": {
|
||||
"rotation": ["q.riding.pitch_change(0)*7", 0, "q.riding.yaw_change(0)*-10"]
|
||||
},
|
||||
"tail2": {
|
||||
"rotation": ["q.riding.pitch_change(0)*7", "q.riding.yaw_change(0)*15", 0]
|
||||
},
|
||||
"tail3": {
|
||||
"rotation": ["q.riding.pitch_change(0)*7", "q.riding.yaw_change(0)*20", 0]
|
||||
},
|
||||
"tail4": {
|
||||
"rotation": ["q.riding.pitch_change(0)*7", "q.riding.yaw_change(0)*20", 0]
|
||||
},
|
||||
"tail5": {
|
||||
"rotation": ["q.riding.pitch_change(0)*8", "q.riding.yaw_change(0)*20", 0]
|
||||
},
|
||||
"leg_right": {
|
||||
"rotation": ["-12.5*q.riding.pitch_change(0)", "q.riding.yaw_change(0)*20", 0],
|
||||
"position": ["-1.5*q.riding.yaw_change(0)", 0, 0]
|
||||
},
|
||||
"knee_right": {
|
||||
"rotation": ["-12.5*q.riding.pitch_change(0)", 0, 0]
|
||||
},
|
||||
"foot_right": {
|
||||
"rotation": ["-12.5*q.riding.pitch_change(0)", 0, 0]
|
||||
},
|
||||
"leg_left": {
|
||||
"rotation": ["-12.5*q.riding.pitch_change(0)", "q.riding.yaw_change(0)*20", 0],
|
||||
"position": ["-1.5*q.riding.yaw_change(0)", 0, 0]
|
||||
},
|
||||
"knee_left": {
|
||||
"rotation": ["-12.5*q.riding.pitch_change(0)", 0, 0]
|
||||
},
|
||||
"foot_left": {
|
||||
"rotation": ["-12.5*q.riding.pitch_change(0)", 0, 0]
|
||||
}
|
||||
}
|
||||
},
|
||||
"animation.charizard.air_status": {
|
||||
"animation_length": 3,
|
||||
"bones": {
|
||||
@@ -32994,19 +33359,43 @@
|
||||
"eyelid_right": {
|
||||
"position": {
|
||||
"0.0": [0, 0, 0],
|
||||
"0.3333": {"pre": [0, 0, 0], "post": [-0.1, 0.1, 0]},
|
||||
"1.2083": {"pre": [-0.1, 0.1, 0], "post": [0, 0, 0]},
|
||||
"2.2083": {"pre": [0, 0, 0], "post": [-0.1, 0.1, 0]},
|
||||
"2.4583": {"pre": [-0.1, 0.1, 0], "post": [0, 0, 0]}
|
||||
"0.3333": {
|
||||
"pre": [0, 0, 0],
|
||||
"post": [-0.1, 0.1, 0]
|
||||
},
|
||||
"1.2083": {
|
||||
"pre": [-0.1, 0.1, 0],
|
||||
"post": [0, 0, 0]
|
||||
},
|
||||
"2.2083": {
|
||||
"pre": [0, 0, 0],
|
||||
"post": [-0.1, 0.1, 0]
|
||||
},
|
||||
"2.4583": {
|
||||
"pre": [-0.1, 0.1, 0],
|
||||
"post": [0, 0, 0]
|
||||
}
|
||||
}
|
||||
},
|
||||
"eyelid_left": {
|
||||
"position": {
|
||||
"0.0": [0, 0, 0],
|
||||
"0.3333": {"pre": [0, 0, 0], "post": [0.1, 0.1, 0]},
|
||||
"1.2083": {"pre": [0.1, 0.1, 0], "post": [0, 0, 0]},
|
||||
"2.2083": {"pre": [0, 0, 0], "post": [0.1, 0.1, 0]},
|
||||
"2.4583": {"pre": [0.1, 0.1, 0], "post": [0, 0, 0]}
|
||||
"0.3333": {
|
||||
"pre": [0, 0, 0],
|
||||
"post": [0.1, 0.1, 0]
|
||||
},
|
||||
"1.2083": {
|
||||
"pre": [0.1, 0.1, 0],
|
||||
"post": [0, 0, 0]
|
||||
},
|
||||
"2.2083": {
|
||||
"pre": [0, 0, 0],
|
||||
"post": [0.1, 0.1, 0]
|
||||
},
|
||||
"2.4583": {
|
||||
"pre": [0.1, 0.1, 0],
|
||||
"post": [0, 0, 0]
|
||||
}
|
||||
}
|
||||
},
|
||||
"locator_root": {
|
||||
@@ -34432,14 +34821,20 @@
|
||||
"position": {
|
||||
"0.0": [-0.1, 0.1, 0],
|
||||
"0.125": [-0.1, 0.1, 0],
|
||||
"0.1667": {"pre": [-0.1, 0.1, 0], "post": [0, 0, 0]}
|
||||
"0.1667": {
|
||||
"pre": [-0.1, 0.1, 0],
|
||||
"post": [0, 0, 0]
|
||||
}
|
||||
}
|
||||
},
|
||||
"eyelid_left": {
|
||||
"position": {
|
||||
"0.0": [0.1, 0.1, 0],
|
||||
"0.125": [0.1, 0.1, 0],
|
||||
"0.1667": {"pre": [0.1, 0.1, 0], "post": [0, 0, 0]}
|
||||
"0.1667": {
|
||||
"pre": [0.1, 0.1, 0],
|
||||
"post": [0, 0, 0]
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
+21
@@ -535,6 +535,11 @@
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"sound_effects": {
|
||||
"0.5": {
|
||||
"effect": "animation.plumage.wing_flap.medium"
|
||||
}
|
||||
}
|
||||
},
|
||||
"animation.pidgeot.air_fly": {
|
||||
@@ -710,6 +715,9 @@
|
||||
},
|
||||
"wing_open_right4": {
|
||||
"rotation": [0, 0, "7.5+math.sin(q.anim_time*90*0.8-240)*-10+math.sin(q.anim_time*90*12-120)*0.4"]
|
||||
},
|
||||
"locator_seat1": {
|
||||
"position": [0, 1.5, -4]
|
||||
}
|
||||
}
|
||||
},
|
||||
@@ -1566,6 +1574,11 @@
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"sound_effects": {
|
||||
"1.375": {
|
||||
"effect": "animation.plumage.wing_flap.medium"
|
||||
}
|
||||
}
|
||||
},
|
||||
"animation.pidgeot.air_fly_quirk2": {
|
||||
@@ -2721,6 +2734,14 @@
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"sound_effects": {
|
||||
"1.4583": {
|
||||
"effect": "animation.plumage.wing_flap.medium"
|
||||
},
|
||||
"3.0833": {
|
||||
"effect": "animation.plumage.wing_flap.medium"
|
||||
}
|
||||
}
|
||||
},
|
||||
"animation.pidgeot.blink": {
|
||||
|
||||
+1480
-29
File diff suppressed because it is too large.
Load diff
+12
@@ -467,6 +467,7 @@
|
||||
},
|
||||
"animation.aerodactyl.air_idle": {
|
||||
"loop": true,
|
||||
"animation_length": 1.33333,
|
||||
"bones": {
|
||||
"aerodactyl": {
|
||||
"position": [0, 3, 0]
|
||||
@@ -642,10 +643,16 @@
|
||||
"right_wing_membrane": {
|
||||
"rotation": [0, "0+math.sin(q.anim_time*90*3+90)*3", "0+math.sin(q.anim_time*90*3+90)*1.5"]
|
||||
}
|
||||
},
|
||||
"sound_effects": {
|
||||
"1.0833": {
|
||||
"effect": "animation.leather.wing_flap.medium"
|
||||
}
|
||||
}
|
||||
},
|
||||
"animation.aerodactyl.air_fly": {
|
||||
"loop": true,
|
||||
"animation_length": 1.33333,
|
||||
"bones": {
|
||||
"aerodactyl": {
|
||||
"position": [0, 3, 0]
|
||||
@@ -827,6 +834,11 @@
|
||||
"right_horn": {
|
||||
"rotation": ["math.sin(q.anim_time*90*12-160)*2", 0, 0]
|
||||
}
|
||||
},
|
||||
"sound_effects": {
|
||||
"0.9583": {
|
||||
"effect": "animation.leather.wing_flap.medium"
|
||||
}
|
||||
}
|
||||
},
|
||||
"animation.aerodactyl.sleep": {
|
||||
|
||||
+97
@@ -1237,6 +1237,20 @@
|
||||
"rotation": ["-math.sin(q.anim_time*90*2-120)*4", 0, 0],
|
||||
"position": [0, "7.8+math.sin(q.anim_time*90*2)*2", -5.6]
|
||||
}
|
||||
},
|
||||
"sound_effects": {
|
||||
"1.5": {
|
||||
"effect": "animation.leather.wing_flap.medium"
|
||||
},
|
||||
"3.5": {
|
||||
"effect": "animation.leather.wing_flap.medium"
|
||||
},
|
||||
"5.5": {
|
||||
"effect": "animation.leather.wing_flap.medium"
|
||||
},
|
||||
"7.5": {
|
||||
"effect": "animation.leather.wing_flap.medium"
|
||||
}
|
||||
}
|
||||
},
|
||||
"animation.dragonite.water_idle": {
|
||||
@@ -2053,6 +2067,89 @@
|
||||
"effect": "pokemon.dragonite.cry"
|
||||
}
|
||||
}
|
||||
},
|
||||
"animation.dragonite.shock": {
|
||||
"loop": true,
|
||||
"bones": {
|
||||
"pupil_left": {
|
||||
"scale": [0.7, 0.7, 1]
|
||||
},
|
||||
"eye_shine_left": {
|
||||
"position": [0, -0.5, 0]
|
||||
},
|
||||
"pupil_right": {
|
||||
"scale": [0.7, 0.7, 1]
|
||||
},
|
||||
"eye_shine_right": {
|
||||
"position": [0, -0.5, 0]
|
||||
},
|
||||
"jaw": {
|
||||
"rotation": [27.5, 0, 0]
|
||||
},
|
||||
"eye_left": {
|
||||
"position": [0, 0, 0],
|
||||
"scale": 1
|
||||
},
|
||||
"eye_shocked_left": {
|
||||
"position": [0.25, 0, -0.26]
|
||||
},
|
||||
"eye_shocked_right": {
|
||||
"position": [-0.125, 0, -0.18]
|
||||
}
|
||||
}
|
||||
},
|
||||
"animation.dragonite.angry": {
|
||||
"loop": true,
|
||||
"bones": {
|
||||
"eye_angry_left": {
|
||||
"position": [0.1, 0, -0.1]
|
||||
},
|
||||
"eye_shine_left": {
|
||||
"position": [0, -1, 0]
|
||||
},
|
||||
"eye_shine_right": {
|
||||
"position": [0, -1, 0]
|
||||
},
|
||||
"eye_angry_right": {
|
||||
"position": [-0.1, 0, -0.1]
|
||||
}
|
||||
}
|
||||
},
|
||||
"animation.dragonite.sad": {
|
||||
"loop": true,
|
||||
"bones": {
|
||||
"eye_sad_left": {
|
||||
"position": [0.1, 0, -0.1]
|
||||
},
|
||||
"eye_sad_right": {
|
||||
"position": [-0.1, 0, -0.1]
|
||||
}
|
||||
}
|
||||
},
|
||||
"animation.dragonite.happy": {
|
||||
"loop": true,
|
||||
"bones": {
|
||||
"eyelid_happy_left": {
|
||||
"position": [0.1, 0, -0.1]
|
||||
},
|
||||
"eyelid_happy_right": {
|
||||
"position": [-0.1, 0, -0.1]
|
||||
},
|
||||
"jaw": {
|
||||
"rotation": [27.5, 0, 0]
|
||||
}
|
||||
}
|
||||
},
|
||||
"animation.dragonite.hurt": {
|
||||
"loop": true,
|
||||
"bones": {
|
||||
"eyelid_recoil_left": {
|
||||
"position": [0.1, 0, -0.1]
|
||||
},
|
||||
"eyelid_recoil_right": {
|
||||
"position": [-0.1, 0, -0.1]
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
+10
-2
@@ -266,7 +266,7 @@
|
||||
}
|
||||
},
|
||||
"animation.wailord.cry": {
|
||||
"animation_length": 2.83333,
|
||||
"animation_length": 2.8333,
|
||||
"bones": {
|
||||
"body": {
|
||||
"rotation": {
|
||||
@@ -1337,6 +1337,14 @@
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"scale": {
|
||||
"loop": true,
|
||||
"bones": {
|
||||
"wailord": {
|
||||
"scale": 25
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
+1077
-267
File diff suppressed because it is too large.
Load diff
+106
-26
@@ -5,7 +5,11 @@
|
||||
"loop": true,
|
||||
"bones": {
|
||||
"body": {
|
||||
"rotation": [0, "0 - Math.Sin(((q.anim_time + 0.1) * 180 * 0.5) * 1) * 5", "Math.Sin(((q.anim_time + 0.4) * 180 * 0.5) * 1) * 5"],
|
||||
"rotation": [
|
||||
"45*q.riding.velocity_forward(0)",
|
||||
"0 - Math.Sin(((q.anim_time + 0.1) * 180 * 0.5) * 1) * 5",
|
||||
"Math.Sin(((q.anim_time + 0.4) * 180 * 0.5) * 1) * 5 + 45*q.riding.velocity_right(0)"
|
||||
],
|
||||
"position": ["Math.Sin((q.anim_time * 180 * 0.5) * 1) * 1.5", "7+Math.Sin((q.anim_time * 90 * 0.5) * 1) * 1.5", 0]
|
||||
},
|
||||
"magnet_back_rotation": {
|
||||
@@ -45,7 +49,11 @@
|
||||
"loop": true,
|
||||
"bones": {
|
||||
"body": {
|
||||
"rotation": [15, "0 - Math.Sin(((q.anim_time + 0.1) * 180 * 0.5) * 1) * 5", "Math.Sin(((q.anim_time + 0.4) * 180 * 0.5) * 1) * 5"],
|
||||
"rotation": [
|
||||
"2.5 + 45*q.riding.velocity_forward(0)",
|
||||
"- Math.Sin(((q.anim_time + 0.1) * 180 * 0.5) * 1) * 5",
|
||||
"Math.Sin(((q.anim_time + 0.4) * 180 * 0.5) * 1) * 5 - 45*q.riding.velocity_right(0)"
|
||||
],
|
||||
"position": ["Math.Sin((q.anim_time * 180 * 0.5) * 1) * 1.5", "7+Math.Sin((q.anim_time * 90 * 0.5) * 1) * 1.5", 0]
|
||||
},
|
||||
"magnet_back_rotation": {
|
||||
@@ -266,45 +274,117 @@
|
||||
"pupil_left": {
|
||||
"position": {
|
||||
"0.0": [0, 0, 0],
|
||||
"0.5": {"pre": [0, 0, 0], "post": [0, 0, 0]},
|
||||
"0.5417": {"pre": [0, 0, 0], "post": [0, 0, 0.1]},
|
||||
"1.75": {"pre": [0, 0, 0.1], "post": [0, 0, 0.1]},
|
||||
"1.7917": {"pre": [0, 0, 0.1], "post": [0, 0, 0]},
|
||||
"2.0833": {"pre": [0, 0, 0], "post": [0, 0, 0]},
|
||||
"2.125": {"pre": [0, 0, 0], "post": [0, 0, 0.1]}
|
||||
"0.5": {
|
||||
"pre": [0, 0, 0],
|
||||
"post": [0, 0, 0]
|
||||
},
|
||||
"0.5417": {
|
||||
"pre": [0, 0, 0],
|
||||
"post": [0, 0, 0.1]
|
||||
},
|
||||
"1.75": {
|
||||
"pre": [0, 0, 0.1],
|
||||
"post": [0, 0, 0.1]
|
||||
},
|
||||
"1.7917": {
|
||||
"pre": [0, 0, 0.1],
|
||||
"post": [0, 0, 0]
|
||||
},
|
||||
"2.0833": {
|
||||
"pre": [0, 0, 0],
|
||||
"post": [0, 0, 0]
|
||||
},
|
||||
"2.125": {
|
||||
"pre": [0, 0, 0],
|
||||
"post": [0, 0, 0.1]
|
||||
}
|
||||
}
|
||||
},
|
||||
"pupil_closed_left": {
|
||||
"position": {
|
||||
"0.0": [0, 0, 0],
|
||||
"0.5": {"pre": [0, 0, 0], "post": [0, 0, 0]},
|
||||
"0.5417": {"pre": [0, 0, 0], "post": [0, 0, -0.1]},
|
||||
"1.75": {"pre": [0, 0, -0.1], "post": [0, 0, -0.1]},
|
||||
"1.7917": {"pre": [0, 0, -0.1], "post": [0, 0, 0]},
|
||||
"2.0833": {"pre": [0, 0, 0], "post": [0, 0, 0]},
|
||||
"2.125": {"pre": [0, 0, 0], "post": [0, 0, -0.1]}
|
||||
"0.5": {
|
||||
"pre": [0, 0, 0],
|
||||
"post": [0, 0, 0]
|
||||
},
|
||||
"0.5417": {
|
||||
"pre": [0, 0, 0],
|
||||
"post": [0, 0, -0.1]
|
||||
},
|
||||
"1.75": {
|
||||
"pre": [0, 0, -0.1],
|
||||
"post": [0, 0, -0.1]
|
||||
},
|
||||
"1.7917": {
|
||||
"pre": [0, 0, -0.1],
|
||||
"post": [0, 0, 0]
|
||||
},
|
||||
"2.0833": {
|
||||
"pre": [0, 0, 0],
|
||||
"post": [0, 0, 0]
|
||||
},
|
||||
"2.125": {
|
||||
"pre": [0, 0, 0],
|
||||
"post": [0, 0, -0.1]
|
||||
}
|
||||
}
|
||||
},
|
||||
"pupil_right": {
|
||||
"position": {
|
||||
"0.0": [0, 0, 0],
|
||||
"0.2083": {"pre": [0, 0, 0], "post": [0, 0, 0]},
|
||||
"0.25": {"pre": [0, 0, 0], "post": [0, 0, 0.1]},
|
||||
"0.5": {"pre": [0, 0, 0.1], "post": [0, 0, 0.1]},
|
||||
"0.5417": {"pre": [0, 0, 0.1], "post": [0, 0, 0]},
|
||||
"1.9583": {"pre": [0, 0, 0], "post": [0, 0, 0]},
|
||||
"2.0": {"pre": [0, 0, 0], "post": [0, 0, 0.1]}
|
||||
"0.2083": {
|
||||
"pre": [0, 0, 0],
|
||||
"post": [0, 0, 0]
|
||||
},
|
||||
"0.25": {
|
||||
"pre": [0, 0, 0],
|
||||
"post": [0, 0, 0.1]
|
||||
},
|
||||
"0.5": {
|
||||
"pre": [0, 0, 0.1],
|
||||
"post": [0, 0, 0.1]
|
||||
},
|
||||
"0.5417": {
|
||||
"pre": [0, 0, 0.1],
|
||||
"post": [0, 0, 0]
|
||||
},
|
||||
"1.9583": {
|
||||
"pre": [0, 0, 0],
|
||||
"post": [0, 0, 0]
|
||||
},
|
||||
"2.0": {
|
||||
"pre": [0, 0, 0],
|
||||
"post": [0, 0, 0.1]
|
||||
}
|
||||
}
|
||||
},
|
||||
"pupil_closed_right": {
|
||||
"position": {
|
||||
"0.0": [0, 0, 0],
|
||||
"0.2083": {"pre": [0, 0, 0], "post": [0, 0, 0]},
|
||||
"0.25": {"pre": [0, 0, 0], "post": [0, 0, -0.1]},
|
||||
"0.5": {"pre": [0, 0, -0.1], "post": [0, 0, -0.1]},
|
||||
"0.5417": {"pre": [0, 0, -0.1], "post": [0, 0, 0]},
|
||||
"1.9583": {"pre": [0, 0, 0], "post": [0, 0, 0]},
|
||||
"2.0": {"pre": [0, 0, 0], "post": [0, 0, -0.1]}
|
||||
"0.2083": {
|
||||
"pre": [0, 0, 0],
|
||||
"post": [0, 0, 0]
|
||||
},
|
||||
"0.25": {
|
||||
"pre": [0, 0, 0],
|
||||
"post": [0, 0, -0.1]
|
||||
},
|
||||
"0.5": {
|
||||
"pre": [0, 0, -0.1],
|
||||
"post": [0, 0, -0.1]
|
||||
},
|
||||
"0.5417": {
|
||||
"pre": [0, 0, -0.1],
|
||||
"post": [0, 0, 0]
|
||||
},
|
||||
"1.9583": {
|
||||
"pre": [0, 0, 0],
|
||||
"post": [0, 0, 0]
|
||||
},
|
||||
"2.0": {
|
||||
"pre": [0, 0, 0],
|
||||
"post": [0, 0, -0.1]
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
+8
-4
@@ -155,6 +155,9 @@
|
||||
"back_neck_braid_right4": {
|
||||
"rotation": [2.5, 0, -10],
|
||||
"position": [-0.5, 0, 0]
|
||||
},
|
||||
"body": {
|
||||
"rotation": ["q.riding.velocity_y(0)*-90", 0, 0]
|
||||
}
|
||||
}
|
||||
},
|
||||
@@ -650,7 +653,7 @@
|
||||
}
|
||||
},
|
||||
"neck2": {
|
||||
"rotation": ["5+math.sin(q.anim_time*90*4-60)*2", 0, 0]
|
||||
"rotation": ["5+math.sin(q.anim_time*90*4-60)*2 - math.pow(q.riding.yaw_change(0),2)*20", "q.riding.yaw_change(0)*-10", "q.riding.yaw_change(0)*10"]
|
||||
},
|
||||
"tail5": {
|
||||
"rotation": ["-7.5+math.sin(q.anim_time*90*4-90)*2", "math.sin(q.anim_time*90*2)*1", "math.sin(q.anim_time*90*2)*4"]
|
||||
@@ -677,7 +680,7 @@
|
||||
}
|
||||
},
|
||||
"neck": {
|
||||
"rotation": ["3+math.sin(q.anim_time*90*4-30)*1", 0, "math.sin(q.anim_time*90*2-30)*2"]
|
||||
"rotation": ["3+math.sin(q.anim_time*90*4-30)*1", "q.riding.yaw_change(0)*-10", "math.sin(q.anim_time*90*2-30)*2 + q.riding.yaw_change(0)*10"]
|
||||
},
|
||||
"front_neck_braid_left": {
|
||||
"rotation": ["5+math.sin(q.anim_time*90*4-60)*1", 0.5, 5]
|
||||
@@ -844,6 +847,7 @@
|
||||
"position": [-0.5, 0, 0]
|
||||
},
|
||||
"body": {
|
||||
"rotation": ["q.riding.velocity_y(0)*-90", 0, 0],
|
||||
"position": {
|
||||
"0.0": [0, 0, 0],
|
||||
"0.0417": [0, -0.25, 0],
|
||||
@@ -1257,7 +1261,7 @@
|
||||
}
|
||||
},
|
||||
"neck2": {
|
||||
"rotation": ["math.sin(q.anim_time*90*4-60)*4", 0, 0]
|
||||
"rotation": ["math.sin(q.anim_time*90*4-60)*4 - math.pow(q.riding.yaw_delta(0),2)*20", "q.riding.yaw_delta(0)*-10", "q.riding.yaw_delta(0)*10"]
|
||||
},
|
||||
"tail5": {
|
||||
"rotation": ["-10+math.sin(q.anim_time*90*4-100)*6", "math.sin(q.anim_time*90*4-40)*2", "math.sin(q.anim_time*90*4-20)*1"]
|
||||
@@ -1279,7 +1283,7 @@
|
||||
}
|
||||
},
|
||||
"neck": {
|
||||
"rotation": ["13+math.sin(q.anim_time*90*4-30)*7", 0, 0],
|
||||
"rotation": ["13+math.sin(q.anim_time*90*4-30)*7", "q.riding.yaw_delta(0)*-10", "q.riding.yaw_delta(0)*10"],
|
||||
"position": [0, 0, "-0.5+math.sin(q.anim_time*90*4-30)*0.2"]
|
||||
},
|
||||
"front_neck_braid_left": {
|
||||
|
||||
+10790
-206
File diff suppressed because it is too large.
Load diff
+115
-148
@@ -7,8 +7,8 @@
|
||||
"texture_width": 256,
|
||||
"texture_height": 128,
|
||||
"visible_bounds_width": 10,
|
||||
"visible_bounds_height": 5,
|
||||
"visible_bounds_offset": [0, 1.5, 0]
|
||||
"visible_bounds_height": 6,
|
||||
"visible_bounds_offset": [0, 2, 0]
|
||||
},
|
||||
"bones": [
|
||||
{
|
||||
@@ -20,7 +20,7 @@
|
||||
"parent": "charizard",
|
||||
"pivot": [0, 0, -1],
|
||||
"locators": {
|
||||
"root": [0, 0, 0]
|
||||
"root": [0, 0, -1]
|
||||
}
|
||||
},
|
||||
{
|
||||
@@ -28,7 +28,7 @@
|
||||
"parent": "charizard",
|
||||
"pivot": [0, 41, -1],
|
||||
"locators": {
|
||||
"top": [0, 41, 0]
|
||||
"top": [0, 41, -1]
|
||||
}
|
||||
},
|
||||
{
|
||||
@@ -116,7 +116,8 @@
|
||||
{
|
||||
"name": "head_correction",
|
||||
"parent": "head",
|
||||
"pivot": [0, 43.5, -0.5]
|
||||
"pivot": [0, 43.5, -0.5],
|
||||
"rotation": [-95, 0, 0]
|
||||
},
|
||||
{
|
||||
"name": "head_ai",
|
||||
@@ -127,20 +128,15 @@
|
||||
"name": "head_angle",
|
||||
"parent": "head_ai",
|
||||
"pivot": [0, 43.5, -0.5],
|
||||
"rotation": [95, 0, 0],
|
||||
"cubes": [
|
||||
{"origin": [-3.5, 41.5, -2], "size": [7, 7, 5], "uv": [48, 0]},
|
||||
{"origin": [-3.5, 41.5, -4], "size": [7, 4, 2], "uv": [95, 64]}
|
||||
{"origin": [-3.5, 41.5, -4], "size": [7, 4, 2], "uv": [95, 64]},
|
||||
{"origin": [-2.5, 48, -2], "size": [5, 5, 2], "inflate": 0.02, "uv": [37, 31]},
|
||||
{"origin": [-2, 51.48744, -3.03033], "size": [0, 1, 1], "inflate": 0.01, "pivot": [-2, 52.51777, -2], "rotation": [45, 0, 15], "uv": [43, 42]},
|
||||
{"origin": [2, 51.48744, -3.03033], "size": [0, 1, 1], "inflate": 0.01, "pivot": [2, 52.51777, -2], "rotation": [45, 0, -15], "uv": [41, 42]}
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "item_hat",
|
||||
"parent": "head_angle",
|
||||
"pivot": [0, 45, 3],
|
||||
"rotation": [-90, 0, 0],
|
||||
"locators": {
|
||||
"item_hat": [0, 45, 3]
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "locator_head",
|
||||
"parent": "head_angle",
|
||||
@@ -150,51 +146,59 @@
|
||||
"head": [0, 46.5, 3]
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "locator_face",
|
||||
"parent": "head_angle",
|
||||
"pivot": [0, 53.75, -0.25],
|
||||
"rotation": [-90, 0, 0],
|
||||
"locators": {
|
||||
"face": [0, 53.75, -0.25]
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "locator_item_face",
|
||||
"parent": "head_angle",
|
||||
"pivot": [0, 48.5, 0.5],
|
||||
"rotation": [-90, 0, 0],
|
||||
"locators": {
|
||||
"item_face": [0, 48.5, 0.5]
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "locator_mouth",
|
||||
"parent": "head_angle",
|
||||
"pivot": [0, 45.75, -2],
|
||||
"pivot": [0, 48.75, -3],
|
||||
"rotation": [-90, 0, 0],
|
||||
"locators": {
|
||||
"mouth": [0, 45.75, -2],
|
||||
"special": [0, 45.75, -2]
|
||||
"mouth": [0, 48.75, -3]
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "eyes",
|
||||
"name": "locator_special_attack",
|
||||
"parent": "head_angle",
|
||||
"pivot": [0, -3.5, 1.5]
|
||||
"pivot": [0, 48.75, -3],
|
||||
"rotation": [-90, 0, 0],
|
||||
"locators": {
|
||||
"special_attack": [0, 48.75, -3]
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "locator_jaw_upper",
|
||||
"parent": "head_angle",
|
||||
"pivot": [0, 51.75, -2.25],
|
||||
"rotation": [-90, 0, 0],
|
||||
"locators": {
|
||||
"jaw1": [0, 51.75, -2.25]
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "brow",
|
||||
"parent": "eyes",
|
||||
"parent": "head_angle",
|
||||
"pivot": [0, 48.275, 1.765],
|
||||
"cubes": [
|
||||
{"origin": [-2.5, 48.55, 1], "size": [5, 0, 1], "uv": [0, 14]},
|
||||
{"origin": [-3.5, 47.5, 1.53], "size": [7, 1, 1], "inflate": 0.04, "uv": [0, 12]}
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "eye",
|
||||
"parent": "head_angle",
|
||||
"pivot": [0, -3.5, 1.5]
|
||||
},
|
||||
{
|
||||
"name": "locator_face",
|
||||
"parent": "eye",
|
||||
"pivot": [0, 53.75, -0.25],
|
||||
"rotation": [-90, 0, 0],
|
||||
"locators": {
|
||||
"face": [0, 53.75, -0.25]
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "eye_right",
|
||||
"parent": "eyes",
|
||||
"parent": "eye",
|
||||
"pivot": [-2.75, 47.75, 0.875],
|
||||
"cubes": [
|
||||
{"origin": [-3.5, 47.5, 0], "size": [2, 1, 2], "inflate": 0.01, "uv": [106, 36]},
|
||||
@@ -222,7 +226,7 @@
|
||||
},
|
||||
{
|
||||
"name": "eye_left",
|
||||
"parent": "eyes",
|
||||
"parent": "eye",
|
||||
"pivot": [2.75, 47.75, 0.875],
|
||||
"cubes": [
|
||||
{"origin": [1.5, 47.5, 0], "size": [2, 1, 2], "inflate": 0.01, "uv": [44, 82]},
|
||||
@@ -251,91 +255,6 @@
|
||||
{"origin": [2.41, 46.4, 0.5], "size": [1, 1, 1], "inflate": 0.03, "uv": [39, 86]}
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "muzzle",
|
||||
"parent": "head_angle",
|
||||
"pivot": [-3, 48.5, -2],
|
||||
"cubes": [
|
||||
{"origin": [-2.5, 48, -2], "size": [5, 5, 2], "inflate": 0.02, "uv": [37, 31]},
|
||||
{"origin": [-2, 51.48744, -3.03033], "size": [0, 1, 1], "inflate": 0.01, "pivot": [-2, 52.51777, -2], "rotation": [45, 0, 15], "uv": [43, 42]},
|
||||
{"origin": [2, 51.48744, -3.03033], "size": [0, 1, 1], "inflate": 0.01, "pivot": [2, 52.51777, -2], "rotation": [45, 0, -15], "uv": [41, 42]}
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "locator_jaw_upper",
|
||||
"parent": "muzzle",
|
||||
"pivot": [0, 51.75, -2.25],
|
||||
"rotation": [-90, 0, 0],
|
||||
"locators": {
|
||||
"jaw1": [0, 51.75, -2.25]
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "nose",
|
||||
"parent": "muzzle",
|
||||
"pivot": [0, 53, 0],
|
||||
"rotation": [-40, 0, 0],
|
||||
"cubes": [
|
||||
{"origin": [-2.5, 51.36698, -1.67861], "size": [5, 2, 2], "inflate": 0.03, "uv": [48, 12]},
|
||||
{"origin": [-2, 53.40698, -1.17861], "size": [4, 0, 1], "uv": [0, 15]}
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "jaw",
|
||||
"parent": "head_angle",
|
||||
"pivot": [0, 45.5, -2],
|
||||
"cubes": [
|
||||
{"origin": [-3.5, 45.5, -4], "size": [7, 3, 2], "inflate": 0.01, "uv": [76, 20]}
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "jaw2",
|
||||
"parent": "jaw",
|
||||
"pivot": [0, 48.5, -4],
|
||||
"rotation": [-7.5, 0, 0],
|
||||
"cubes": [
|
||||
{"origin": [-2, 48.49, -4], "size": [4, 4, 2], "uv": [0, 51]},
|
||||
{"origin": [-1.5, 48.5, -2], "size": [3, 4, 0], "uv": [90, 0]},
|
||||
{"origin": [1.5, 51.49749, -3.03033], "size": [0, 1, 1], "pivot": [1.5, 52.52782, -2], "rotation": [45, 0, -7.5], "uv": [37, 39]},
|
||||
{"origin": [-1.5, 51.49749, -3.03033], "size": [0, 1, 1], "pivot": [-1.5, 52.52782, -2], "rotation": [45, 0, 7.5], "uv": [37, 38]}
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "locator_jaw_lower",
|
||||
"parent": "jaw2",
|
||||
"pivot": [0, 51.75, -1.75],
|
||||
"locators": {
|
||||
"jaw2": {
|
||||
"offset": [0, 51.75, -1.75],
|
||||
"rotation": [-90, 0, 0]
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "tongue",
|
||||
"parent": "jaw",
|
||||
"pivot": [0, 45.5, -2],
|
||||
"cubes": [
|
||||
{"origin": [-1.5, 45.5, -2], "size": [3, 3, 0], "uv": [87, 29]}
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "tongue2",
|
||||
"parent": "tongue",
|
||||
"pivot": [0, 48.5, -2],
|
||||
"cubes": [
|
||||
{"origin": [-1, 48.5, -2], "size": [2, 2, 0], "inflate": 0.01, "uv": [46, 38]}
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "tongue3",
|
||||
"parent": "tongue2",
|
||||
"pivot": [0, 50.5, -2],
|
||||
"cubes": [
|
||||
{"origin": [-1, 50.5, -2], "size": [2, 1, 0], "uv": [37, 43]},
|
||||
{"origin": [-0.5, 51.5, -2], "size": [1, 1, 0], "uv": [45, 43]}
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "horns",
|
||||
"parent": "head_angle",
|
||||
@@ -381,6 +300,72 @@
|
||||
"horn2": [2.5, 39, 2]
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "nose",
|
||||
"parent": "head_angle",
|
||||
"pivot": [0, 53, 0],
|
||||
"rotation": [-40, 0, 0],
|
||||
"cubes": [
|
||||
{"origin": [-2.5, 51.36698, -1.67861], "size": [5, 2, 2], "inflate": 0.03, "uv": [48, 12]},
|
||||
{"origin": [-2, 53.40698, -1.17861], "size": [4, 0, 1], "uv": [0, 15]}
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "jaw",
|
||||
"parent": "head_angle",
|
||||
"pivot": [0, 45.5, -2],
|
||||
"cubes": [
|
||||
{"origin": [-3.5, 45.5, -4], "size": [7, 3, 2], "inflate": 0.01, "uv": [76, 20]}
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "jaw2",
|
||||
"parent": "jaw",
|
||||
"pivot": [0, 48.5, -4],
|
||||
"rotation": [-7.5, 0, 0],
|
||||
"cubes": [
|
||||
{"origin": [-2, 48.49, -4], "size": [4, 4, 2], "uv": [0, 51]},
|
||||
{"origin": [-1.5, 48.5, -1.99], "size": [3, 4, 0], "uv": [90, 0]},
|
||||
{"origin": [1.5, 51.49749, -3.03033], "size": [0, 1, 1], "pivot": [1.5, 52.52782, -2], "rotation": [45, 0, -7.5], "uv": [37, 39]},
|
||||
{"origin": [-1.5, 51.49749, -3.03033], "size": [0, 1, 1], "pivot": [-1.5, 52.52782, -2], "rotation": [45, 0, 7.5], "uv": [37, 38]}
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "locator_jaw_lower",
|
||||
"parent": "jaw2",
|
||||
"pivot": [0, 51.75, -1.75],
|
||||
"locators": {
|
||||
"jaw2": {
|
||||
"offset": [0, 51.75, -1.75],
|
||||
"rotation": [-90, 0, 0]
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "tongue",
|
||||
"parent": "jaw",
|
||||
"pivot": [0, 45.5, -2],
|
||||
"cubes": [
|
||||
{"origin": [-1.5, 45.5, -2], "size": [3, 3, 0], "uv": [87, 29]}
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "tongue2",
|
||||
"parent": "tongue",
|
||||
"pivot": [0, 48.5, -2],
|
||||
"cubes": [
|
||||
{"origin": [-1, 48.5, -2], "size": [2, 2, 0], "inflate": 0.01, "uv": [46, 38]}
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "tongue3",
|
||||
"parent": "tongue2",
|
||||
"pivot": [0, 50.5, -2],
|
||||
"cubes": [
|
||||
{"origin": [-1, 50.5, -2], "size": [2, 1, 0], "uv": [37, 43]},
|
||||
{"origin": [-0.5, 51.5, -2], "size": [1, 1, 0], "uv": [45, 43]}
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "arms",
|
||||
"parent": "torso2",
|
||||
@@ -418,14 +403,6 @@
|
||||
{"origin": [-21.5, 22, -1.5], "size": [3, 2, 3], "inflate": 0.1, "uv": [0, 58]}
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "locator_item",
|
||||
"parent": "hand_right",
|
||||
"pivot": [-21.6, 23, 0],
|
||||
"locators": {
|
||||
"item": [-21.6, 23, 0]
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "locator_hand_primary",
|
||||
"parent": "hand_right",
|
||||
@@ -936,14 +913,6 @@
|
||||
{"origin": [0, 9.5, 58.5], "size": [0, 13, 7], "pivot": [0, 14.45, 62], "rotation": [0, 90, 0], "uv": [0, 92]}
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "locator_fire",
|
||||
"parent": "fire2",
|
||||
"pivot": [0, 11, 62],
|
||||
"locators": {
|
||||
"fire": [0, 11, 62]
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "legs",
|
||||
"parent": "body",
|
||||
@@ -976,10 +945,9 @@
|
||||
{
|
||||
"name": "locator_foot_primary",
|
||||
"parent": "foot_right",
|
||||
"pivot": [-9, 1.5, -5],
|
||||
"rotation": [90, 0, 0],
|
||||
"pivot": [-9, 1.5, -7],
|
||||
"locators": {
|
||||
"foot_primary": [-9, 1.5, -5]
|
||||
"foot_primary": [-9, 1.5, -7]
|
||||
}
|
||||
},
|
||||
{
|
||||
@@ -1041,10 +1009,9 @@
|
||||
{
|
||||
"name": "locator_foot_secondary",
|
||||
"parent": "foot_left",
|
||||
"pivot": [9, 1.5, -5],
|
||||
"rotation": [90, 0, 0],
|
||||
"pivot": [9, 1.5, -7],
|
||||
"locators": {
|
||||
"foot_secondary": [9, 1.5, -5]
|
||||
"foot_secondary": [9, 1.5, -7]
|
||||
}
|
||||
},
|
||||
{
|
||||
|
||||
+1100
-152
File diff suppressed because it is too large.
Load diff
+2
-2
@@ -33,7 +33,7 @@
|
||||
"parent": "torso",
|
||||
"pivot": [0, 13, -1.5],
|
||||
"locators": {
|
||||
"seat_1": [0, 12.25, -1.5]
|
||||
"seat_1": [0, 13, -1.5]
|
||||
}
|
||||
},
|
||||
{
|
||||
@@ -812,4 +812,4 @@
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
+309
-1
@@ -15,11 +15,43 @@
|
||||
"name": "wailord",
|
||||
"pivot": [0, 0, 0]
|
||||
},
|
||||
{
|
||||
"name": "locator_root",
|
||||
"parent": "wailord",
|
||||
"pivot": [0, 0, 0],
|
||||
"locators": {
|
||||
"root": [0, 0, 0]
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "locator_top",
|
||||
"parent": "wailord",
|
||||
"pivot": [0, 38, 8],
|
||||
"locators": {
|
||||
"top": [0, 38, 8]
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "body",
|
||||
"parent": "wailord",
|
||||
"pivot": [0, 0, 0]
|
||||
},
|
||||
{
|
||||
"name": "locator_middle",
|
||||
"parent": "body",
|
||||
"pivot": [0, 19, 8],
|
||||
"locators": {
|
||||
"middle": [0, 19, 8]
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "locator_target",
|
||||
"parent": "body",
|
||||
"pivot": [0, 19, -42.5],
|
||||
"locators": {
|
||||
"target": [0, 19, -42.5]
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "torso",
|
||||
"parent": "body",
|
||||
@@ -38,6 +70,87 @@
|
||||
{"origin": [20.5, 14, -40.5], "size": [0, 5, 30], "uv": [14, 12]}
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "locator_physical",
|
||||
"parent": "head",
|
||||
"pivot": [0, 25, -41],
|
||||
"locators": {
|
||||
"item_physical": [0, 25, -41]
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "locator_item_face",
|
||||
"parent": "head",
|
||||
"pivot": [0, 20, -41],
|
||||
"locators": {
|
||||
"item_face": [0, 20, -41]
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "locator_item_hat",
|
||||
"parent": "head",
|
||||
"pivot": [0, 38, -14],
|
||||
"locators": {
|
||||
"item_hat": [0, 38, -14]
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "locator_head",
|
||||
"parent": "head",
|
||||
"pivot": [0, 38, -25],
|
||||
"locators": {
|
||||
"head": [0, 38, -25]
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "locator_face",
|
||||
"parent": "head",
|
||||
"pivot": [0, 20, -41],
|
||||
"locators": {
|
||||
"face": [0, 20, -41]
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "locator_mouth",
|
||||
"parent": "head",
|
||||
"pivot": [0, 19, -9],
|
||||
"locators": {
|
||||
"mouth": [0, 19, -9],
|
||||
"special": [0, 19, -9]
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "locator_jaw_upper",
|
||||
"parent": "head",
|
||||
"pivot": [0, 14, -40.5],
|
||||
"locators": {
|
||||
"jaw1": [0, 14, -40.5]
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "locator_seat_1",
|
||||
"parent": "head",
|
||||
"pivot": [0, 40, -25],
|
||||
"locators": {
|
||||
"seat_1": [0, 38.25, -25]
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "locator_seat_2",
|
||||
"parent": "head",
|
||||
"pivot": [-11, 40, -14],
|
||||
"locators": {
|
||||
"seat_2": [-11, 38.25, -14]
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "locator_seat_3",
|
||||
"parent": "head",
|
||||
"pivot": [11, 40, -14],
|
||||
"locators": {
|
||||
"seat_3": [11, 38.25, -14]
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "eyes",
|
||||
"parent": "head",
|
||||
@@ -52,6 +165,14 @@
|
||||
{"origin": [-21.5, 19.75, -26], "size": [0, 1, 1], "inflate": 0.06, "uv": [2, -1]}
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "locator_eye_right",
|
||||
"parent": "eye_right",
|
||||
"pivot": [-21.5, 20.25, -25.5],
|
||||
"locators": {
|
||||
"eye1": [-21.5, 20.25, -25.5]
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "eyelid_right",
|
||||
"parent": "eye_right",
|
||||
@@ -69,6 +190,14 @@
|
||||
{"origin": [21.5, 19.75, -26], "size": [0, 1, 1], "inflate": 0.06, "uv": [0, -1], "mirror": true}
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "locator_eye_left",
|
||||
"parent": "eye_left",
|
||||
"pivot": [21.5, 20.25, -25.5],
|
||||
"locators": {
|
||||
"eye2": [21.5, 20.25, -25.5]
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "eyelid_left",
|
||||
"parent": "eye_left",
|
||||
@@ -85,6 +214,14 @@
|
||||
{"origin": [-21.5, 0, -41], "size": [43, 19, 32], "inflate": 0.02, "uv": [159, 77]}
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "locator_jaw_lower",
|
||||
"parent": "lower_jaw",
|
||||
"pivot": [0, 19, -39],
|
||||
"locators": {
|
||||
"jaw2": [0, 19, -39]
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "tongue",
|
||||
"parent": "lower_jaw",
|
||||
@@ -94,6 +231,14 @@
|
||||
{"origin": [-15.5, 15.5, -36], "size": [31, 7, 27], "uv": [396, 58]}
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "locator_item",
|
||||
"parent": "tongue",
|
||||
"pivot": [0, 22.5, -28],
|
||||
"locators": {
|
||||
"item": [0, 22.5, -28]
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "torso_middle",
|
||||
"parent": "torso",
|
||||
@@ -102,6 +247,107 @@
|
||||
{"origin": [-21.5, 0, -12], "size": [43, 38, 35], "inflate": 0.01, "uv": [0, 55]}
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "locators",
|
||||
"parent": "torso_middle",
|
||||
"pivot": [0, 0, 0]
|
||||
},
|
||||
{
|
||||
"name": "locator_seat_4",
|
||||
"parent": "locators",
|
||||
"pivot": [-6, 40, -1],
|
||||
"locators": {
|
||||
"seat_4": [-6, 38.25, -1]
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "locator_seat_5",
|
||||
"parent": "locators",
|
||||
"pivot": [6, 40, -1],
|
||||
"locators": {
|
||||
"seat_5": [6, 38.25, -1]
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "locator_seat_6",
|
||||
"parent": "locators",
|
||||
"pivot": [-16, 40, -1],
|
||||
"locators": {
|
||||
"seat_6": [-16, 38.25, -1]
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "locator_seat_7",
|
||||
"parent": "locators",
|
||||
"pivot": [16, 40, -1],
|
||||
"locators": {
|
||||
"seat_7": [16, 38.25, -1]
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "locator_seat_8",
|
||||
"parent": "locators",
|
||||
"pivot": [-6, 40, 11],
|
||||
"locators": {
|
||||
"seat_8": [-6, 38.25, 11]
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "locator_seat_9",
|
||||
"parent": "locators",
|
||||
"pivot": [6, 40, 11],
|
||||
"locators": {
|
||||
"seat_9": [6, 38.25, 11]
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "locator_seat_10",
|
||||
"parent": "locators",
|
||||
"pivot": [-16, 40, 11],
|
||||
"locators": {
|
||||
"seat_10": [-16, 38.25, 11]
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "locator_seat_11",
|
||||
"parent": "locators",
|
||||
"pivot": [16, 40, 11],
|
||||
"locators": {
|
||||
"seat_11": [16, 38.25, 11]
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "locator_seat_12",
|
||||
"parent": "locators",
|
||||
"pivot": [-6, 40, 21],
|
||||
"locators": {
|
||||
"seat_12": [-6, 38.25, 21]
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "locator_seat_13",
|
||||
"parent": "locators",
|
||||
"pivot": [6, 40, 21],
|
||||
"locators": {
|
||||
"seat_13": [6, 38.25, 21]
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "locator_seat_14",
|
||||
"parent": "locators",
|
||||
"pivot": [-16, 40, 21],
|
||||
"locators": {
|
||||
"seat_14": [-16, 38.25, 21]
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "locator_seat_15",
|
||||
"parent": "locators",
|
||||
"pivot": [16, 40, 21],
|
||||
"locators": {
|
||||
"seat_15": [16, 38.25, 21]
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "fin_right_front",
|
||||
"parent": "torso_middle",
|
||||
@@ -142,6 +388,38 @@
|
||||
{"origin": [-21.5, 0, 20], "size": [43, 38, 35], "uv": [136, 0]}
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "locator_seat_16",
|
||||
"parent": "torso_back",
|
||||
"pivot": [-6, 40, 31],
|
||||
"locators": {
|
||||
"seat_16": [-6, 38.25, 31]
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "locator_seat_17",
|
||||
"parent": "torso_back",
|
||||
"pivot": [6, 40, 31],
|
||||
"locators": {
|
||||
"seat_17": [6, 38.25, 31]
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "locator_seat_18",
|
||||
"parent": "torso_back",
|
||||
"pivot": [-16, 40, 31],
|
||||
"locators": {
|
||||
"seat_18": [-16, 38.25, 31]
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "locator_seat_19",
|
||||
"parent": "torso_back",
|
||||
"pivot": [16, 40, 31],
|
||||
"locators": {
|
||||
"seat_19": [16, 38.25, 31]
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "fin_right_back",
|
||||
"parent": "torso_back",
|
||||
@@ -192,6 +470,18 @@
|
||||
{"origin": [-3, 49.5, 45], "size": [6, 7, 10], "uv": [361, 68]}
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "locator_tail",
|
||||
"parent": "tail_base2",
|
||||
"pivot": [0, 53, 50],
|
||||
"rotation": [-65, 180, 0],
|
||||
"locators": {
|
||||
"tail": {
|
||||
"offset": [0, 53, 50],
|
||||
"rotation": [180, 0, 0]
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "tail_fin",
|
||||
"parent": "tail_base2",
|
||||
@@ -211,6 +501,15 @@
|
||||
{"origin": [-32, 54.5, 47], "size": [7, 2, 11], "pivot": [-25, 55.5, 58], "rotation": [0, -32.5, 0], "uv": [323, 56]}
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "locator_tail_tip",
|
||||
"parent": "tail_right",
|
||||
"pivot": [-30.75, 55.5, 54.25],
|
||||
"rotation": [0, 150, 0],
|
||||
"locators": {
|
||||
"tail_tip1": [-30.75, 55.5, 54.25]
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "tail_left",
|
||||
"parent": "tail_fin",
|
||||
@@ -221,6 +520,15 @@
|
||||
{"origin": [25, 54.5, 47], "size": [7, 2, 11], "pivot": [25, 55.5, 58], "rotation": [0, 32.5, 0], "uv": [322, 72]}
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "locator_tail_tip2",
|
||||
"parent": "tail_left",
|
||||
"pivot": [30.75, 55.5, 54.25],
|
||||
"rotation": [0, -150, 0],
|
||||
"locators": {
|
||||
"tail_tip2": [30.75, 55.5, 54.25]
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "white_fin_right",
|
||||
"parent": "torso_back",
|
||||
@@ -242,4 +550,4 @@
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
+8
@@ -405,6 +405,14 @@
|
||||
"cubes": [
|
||||
{"origin": [-5, 6.5, 25.92], "size": [10, 3, 0], "uv": [77, 7]}
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "locator_seat_1",
|
||||
"parent": "body",
|
||||
"pivot": [0, 0, 0],
|
||||
"locators": {
|
||||
"seat_1": [0, 17.5, 4]
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
|
||||
+10
-2
@@ -7,8 +7,8 @@
|
||||
"texture_width": 128,
|
||||
"texture_height": 128,
|
||||
"visible_bounds_width": 6,
|
||||
"visible_bounds_height": 4.5,
|
||||
"visible_bounds_offset": [0, 1.75, 0]
|
||||
"visible_bounds_height": 5,
|
||||
"visible_bounds_offset": [0, 1.5, 0]
|
||||
},
|
||||
"bones": [
|
||||
{
|
||||
@@ -480,6 +480,14 @@
|
||||
{"origin": [-4.5, 24.5, 26.5], "size": [9, 9, 7], "uv": [66, 109]}
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "locator_seat_1",
|
||||
"parent": "torso",
|
||||
"pivot": [0, 0, 0],
|
||||
"locators": {
|
||||
"seat_1": [0, 30, 0]
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "legs",
|
||||
"parent": "body",
|
||||
|
||||
+554
-445
File diff suppressed because it is too large.
Load diff
+16
-2
@@ -99,7 +99,14 @@
|
||||
"poseTypes": ["FLY"],
|
||||
"isBattle": false,
|
||||
"condition": "!q.is_gliding",
|
||||
"animations": ["q.look('head_ai')", "q.bedrock('charizard', 'air_fly')"],
|
||||
"animations": [
|
||||
"q.look('head_ai')",
|
||||
"q.bedrock('charizard', 'air_fly')",
|
||||
{
|
||||
"condition": "q.is_ridden",
|
||||
"animation": "q.bedrock('charizard', 'ride_air_look')"
|
||||
}
|
||||
],
|
||||
"quirks": [
|
||||
"q.bedrock_quirk('charizard', 'blink')",
|
||||
"q.bedrock_quirk('charizard', 'air_fly_quirk')"
|
||||
@@ -109,7 +116,14 @@
|
||||
"poseTypes": ["FLY"],
|
||||
"isBattle": false,
|
||||
"condition": "q.is_gliding",
|
||||
"animations": ["q.look('head_ai')", "q.bedrock('charizard', 'air_glide_TEST')"],
|
||||
"animations": [
|
||||
"q.look('head_ai')",
|
||||
"q.bedrock('charizard', 'air_glide_TEST')",
|
||||
{
|
||||
"condition": "q.is_ridden",
|
||||
"animation": "q.bedrock('charizard', 'ride_air_look')"
|
||||
}
|
||||
],
|
||||
"quirks": [
|
||||
"q.bedrock_quirk('charizard', 'blink')"
|
||||
]
|
||||
|
||||
+63
@@ -0,0 +1,63 @@
|
||||
{
|
||||
"portraitScale": 0.89,
|
||||
"portraitTranslation": [-0.17,2.04,0],
|
||||
"profileScale": 0.37,
|
||||
"profileTranslation": [0,1.14,0],
|
||||
"rootBone": "kangaskhan",
|
||||
"animations": {
|
||||
"cry": "q.bedrock_stateful('kangaskhan', 'cry')",
|
||||
"recoil": "q.bedrock_stateful('kangaskhan', 'recoil')"
|
||||
},
|
||||
"poses": {
|
||||
"battle-standing": {
|
||||
"poseTypes": [
|
||||
"STAND"
|
||||
],
|
||||
"isBattle": true,
|
||||
"animations": [
|
||||
"q.look('kid_head')",
|
||||
"q.bedrock('kangaskhan', 'battle_idle')"
|
||||
],
|
||||
"quirks": [
|
||||
"q.bedrock_quirk('kangaskhan', 'blink')"
|
||||
]
|
||||
},
|
||||
"standing": {
|
||||
"poseTypes": [
|
||||
"STAND",
|
||||
"NONE",
|
||||
"PORTRAIT",
|
||||
"PROFILE"
|
||||
],
|
||||
"isBattle": false,
|
||||
"animations": [
|
||||
"q.look('kid_head')",
|
||||
"q.bedrock('kangaskhan', 'ground_idle')"
|
||||
],
|
||||
"quirks": [
|
||||
"q.bedrock_quirk('kangaskhan', 'blink')"
|
||||
]
|
||||
},
|
||||
"walking": {
|
||||
"poseTypes": [
|
||||
"WALK",
|
||||
"SWIM"
|
||||
],
|
||||
"animations": [
|
||||
"q.look('kid_head')",
|
||||
"q.bedrock('kangaskhan', 'ground_walk')"
|
||||
],
|
||||
"quirks": [
|
||||
"q.bedrock_quirk('kangaskhan', 'blink')"
|
||||
]
|
||||
},
|
||||
"sleep": {
|
||||
"poseTypes": [
|
||||
"SLEEP"
|
||||
],
|
||||
"animations": [
|
||||
"q.bedrock('kangaskhan', 'sleep')"
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
+12
@@ -4,6 +4,18 @@
|
||||
"profileScale": 0.28,
|
||||
"profileTranslation": [ 0, 1.26, 0 ],
|
||||
"rootBone": "tropius",
|
||||
"seatToCameraOffset": {
|
||||
"seat_1": [
|
||||
0,
|
||||
5,
|
||||
10
|
||||
],
|
||||
"seat_1_reverse": [
|
||||
0,
|
||||
2,
|
||||
4
|
||||
]
|
||||
},
|
||||
"animations": {
|
||||
"faint": "q.bedrock_primary('tropius', 'faint', q.curve('one'))",
|
||||
"cry": "q.bedrock_stateful('tropius', 'cry')",
|
||||
|
||||
+1
-2
@@ -139,8 +139,7 @@
|
||||
"poseTypes": ["FLY"],
|
||||
"animations": ["q.look('head')", "q.bedrock('garchomp', 'air_fly')"],
|
||||
"quirks": [
|
||||
"q.bedrock_quirk('garchomp', 'blink')",
|
||||
"q.bedrock_quirk('garchomp', q.array('air_fly_quirk1', 'air_fly_quirk2'), 5, 10, 1)"
|
||||
"q.bedrock_quirk('garchomp', 'blink')"
|
||||
],
|
||||
"transformedParts": [
|
||||
{
|
||||
|
||||
+36
@@ -0,0 +1,36 @@
|
||||
{
|
||||
"portraitScale": 1.5,
|
||||
"portraitTranslation": [-1.0, 1.76, 0.0],
|
||||
"profileScale": 0.5,
|
||||
"profileTranslation": [0.0, 1.0, 0.0],
|
||||
"rootBone": "mudsdale",
|
||||
"animations": {
|
||||
"cry": "q.bedrock_stateful('mudsdale', 'cry')"
|
||||
},
|
||||
"poses": {
|
||||
"sleep": {
|
||||
"poseName": "sleep",
|
||||
"poseTypes": ["SLEEP"],
|
||||
"animations": ["q.bedrock('mudsdale', 'sleep')"]
|
||||
},
|
||||
"standing": {
|
||||
"poseName": "standing",
|
||||
"poseTypes": ["STAND", "FLOAT", "NONE", "PORTRAIT", "PROFILE"],
|
||||
"animations": [
|
||||
"q.look('head')",
|
||||
"q.bedrock('mudsdale', 'ground_idle')",
|
||||
"q.bedrock_stateful('mudsdale', 'blink')"
|
||||
]
|
||||
},
|
||||
"walk": {
|
||||
"poseName": "walk",
|
||||
"poseTypes": ["WALK", "SWIM"],
|
||||
"animations": [
|
||||
"q.look('head')",
|
||||
"q.bedrock('mudsdale', 'ground_walk')",
|
||||
"q.bedrock_stateful('mudsdale', 'blink')"
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
+55
-25
@@ -1,28 +1,58 @@
|
||||
{
|
||||
"portraitScale": 1.7,
|
||||
"portraitTranslation": [-0.07, 2.95, 0],
|
||||
"profileScale": 0.33,
|
||||
"profileTranslation": [0, 1.23, 0],
|
||||
"rootBone": "cinderace",
|
||||
"animations": {
|
||||
"cry": "q.bedrock_stateful('cinderace', 'cry')"
|
||||
},
|
||||
"poses": {
|
||||
"standing": {
|
||||
"poseName": "standing",
|
||||
"poseTypes": ["STAND", "FLOAT", "PORTRAIT", "PROFILE", "NONE"],
|
||||
"animations": ["q.bedrock('cinderace', 'ground_idle')"],
|
||||
"quirks": ["q.bedrock_quirk('cinderace', 'blink')"]
|
||||
"portraitScale": 1.5,
|
||||
"portraitTranslation": [-0.13, 2.74, 0],
|
||||
"profileScale": 0.37,
|
||||
"profileTranslation": [0, 1.22, 0],
|
||||
"rootBone": "cinderace",
|
||||
"animations": {
|
||||
"faint": "q.bedrock_primary('cinderace', math.random(0, 1) < 0.25 ? 'faint2' : 'faint', q.curve('one'))",
|
||||
"cry": "q.bedrock_stateful('cinderace', 'cry')",
|
||||
"recoil": "q.bedrock_stateful('cinderace', 'recoil')",
|
||||
"physical": "q.bedrock_primary('cinderace', 'physical', q.curve('symmetrical'))",
|
||||
"special": "q.bedrock_primary('cinderace', 'special', q.curve('symmetrical'))",
|
||||
"status": "q.bedrock_primary('cinderace', 'status', q.curve('symmetrical'))"
|
||||
},
|
||||
"walking": {
|
||||
"poseName": "walking",
|
||||
"poseTypes": ["WALK", "SWIM"],
|
||||
"animations": [
|
||||
"q.bedrock('cinderace', 'ground_idle')",
|
||||
"q.biped_walk(0.66, 0.6, 'leg_left0', 'leg_right0')",
|
||||
"q.bimanual_swing(0.66, 0.6, 'arm_left', 'arm_right')"
|
||||
],
|
||||
"quirks": ["q.bedrock_quirk('cinderace', 'blink')"]
|
||||
"poses": {
|
||||
"battle-standing": {
|
||||
"poseTypes": ["STAND"],
|
||||
"isBattle": true,
|
||||
"animations": [
|
||||
"q.look('head')",
|
||||
"q.bedrock('cinderace', 'battle_idle')"
|
||||
],
|
||||
"namedAnimations": {
|
||||
"cry": "q.bedrock_primary('cinderace', 'battle_cry', q.curve('one'))"
|
||||
},
|
||||
"quirks": ["q.bedrock_quirk('cinderace', 'blink')"]
|
||||
},
|
||||
"standing": {
|
||||
"poseTypes": ["STAND", "NONE", "PORTRAIT", "PROFILE"],
|
||||
"isBattle": false,
|
||||
"animations": [
|
||||
"q.look('head')",
|
||||
"q.bedrock('cinderace', 'ground_idle')"
|
||||
],
|
||||
"quirks": [
|
||||
"q.bedrock_quirk('cinderace', 'blink')"
|
||||
],
|
||||
"transitions": {
|
||||
"battle-standing": "q.bedrock_primary('cinderace', 'battle_intro'), q.curve('symmetrical'))"
|
||||
}
|
||||
},
|
||||
"walking": {
|
||||
"poseTypes": ["WALK"],
|
||||
"animations": [
|
||||
"q.look('head')",
|
||||
"q.bedrock('cinderace', 'ground_walk')"
|
||||
],
|
||||
"quirks": ["q.bedrock_quirk('cinderace', 'blink')"]
|
||||
},
|
||||
"sleeping": {
|
||||
"poseTypes": ["SLEEP"],
|
||||
"namedAnimations": {
|
||||
"cry": "q.bedrock_stateful('dummy', 'cry')"
|
||||
},
|
||||
"animations": ["q.bedrock('cinderace', 'sleep')"]
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
+18
-16
@@ -1,17 +1,19 @@
|
||||
{
|
||||
"species": "cobblemon:kangaskhan",
|
||||
"order": 0,
|
||||
"variations": [
|
||||
{
|
||||
"aspects": [],
|
||||
"poser": "cobblemon:kangaskhan",
|
||||
"model": "cobblemon:kangaskhan.geo",
|
||||
"texture": "cobblemon:textures/pokemon/0115_kangaskhan/kangaskhan.png",
|
||||
"layers": []
|
||||
},
|
||||
{
|
||||
"aspects": ["shiny"],
|
||||
"texture": "cobblemon:textures/pokemon/0115_kangaskhan/kangaskhan_shiny.png"
|
||||
}
|
||||
]
|
||||
}
|
||||
"species": "cobblemon:kangaskhan",
|
||||
"order": 0,
|
||||
"variations": [
|
||||
{
|
||||
"aspects": [],
|
||||
"poser": "cobblemon:kangaskhan",
|
||||
"model": "cobblemon:kangaskhan.geo",
|
||||
"texture": "cobblemon:textures/pokemon/0115_kangaskhan/kangaskhan.png",
|
||||
"layers": []
|
||||
},
|
||||
{
|
||||
"aspects": [
|
||||
"shiny"
|
||||
],
|
||||
"texture": "cobblemon:textures/pokemon/0115_kangaskhan/kangaskhan_shiny.png"
|
||||
}
|
||||
]
|
||||
}
|
||||
+12
-3
@@ -7,11 +7,20 @@
|
||||
"poser": "cobblemon:cinderace",
|
||||
"model": "cobblemon:cinderace.geo",
|
||||
"texture": "cobblemon:textures/pokemon/0815_cinderace/cinderace.png",
|
||||
"layers": []
|
||||
"layers": [
|
||||
{
|
||||
"name": "emissive",
|
||||
"emissive": true,
|
||||
"texture": "cobblemon:textures/pokemon/0815_cinderace/cinderace_emissive.png",
|
||||
"translucent": true
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"aspects": ["shiny"],
|
||||
"aspects": [
|
||||
"shiny"
|
||||
],
|
||||
"texture": "cobblemon:textures/pokemon/0815_cinderace/cinderace_shiny.png"
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
@@ -419,12 +419,12 @@
|
||||
"cobblemon.fossil.sail": "Flosse",
|
||||
"cobblemon.fossil.skull": "Kopf",
|
||||
"cobblemon.fossilmachine.protected": "Dieses Fossil gehört %s!",
|
||||
"itemGroup.cobblemon.blocks": "Blöcke",
|
||||
"itemGroup.cobblemon.blocks": "Cobblemon: Blöcke",
|
||||
"itemGroup.cobblemon.pokeball": "Pokébälle",
|
||||
"itemGroup.cobblemon.agriculture": "Agrikultur",
|
||||
"itemGroup.cobblemon.consumables": "Verwendbare Items",
|
||||
"itemGroup.cobblemon.held_item": "Getragene Items",
|
||||
"itemGroup.cobblemon.evolution_item": "Evolution Items",
|
||||
"itemGroup.cobblemon.agriculture": "Cobblemon: Agrikultur",
|
||||
"itemGroup.cobblemon.consumables": "Cobblemon: Verwendbare Items",
|
||||
"itemGroup.cobblemon.held_item": "Cobblemon: Getragene Items",
|
||||
"itemGroup.cobblemon.evolution_item": "Cobblemon: Evolution Items",
|
||||
"itemGroup.cobblemon.archaeology": "Archaeology",
|
||||
"block.cobblemon.apricorn_log": "Aprikoko Stamm",
|
||||
"block.cobblemon.stripped_apricorn_log": "Entrindeter Aprikoko Stamm",
|
||||
@@ -943,7 +943,7 @@
|
||||
"cobblemon.battle.side_subject.ally": "dein",
|
||||
"cobblemon.battle.side_subject.opponent": "der feindlicher",
|
||||
"cobblemon.battle.transform": "%1$s transformed into %2$s",
|
||||
"cobblemon.battle.endability": "%1$s's Ability was suppressed!",
|
||||
"cobblemon.battle.endability": "Die Fähigkeit von %1$s wirkt nicht mehr!",
|
||||
"cobblemon.battle.weather.raindance.start": "Es fängt an zu regnen!",
|
||||
"cobblemon.battle.weather.raindance.upkeep": "Der strömende Regen lässt nicht nach!",
|
||||
"cobblemon.battle.weather.raindance.end": "Der Regen lässt nach!",
|
||||
@@ -3674,7 +3674,7 @@
|
||||
"cobblemon.move.zippyzap": "Britzelturbo",
|
||||
"cobblemon.move.zippyzap.desc": "Ein stürmischer Blitz-Angriff mit hoher Erstschlag- und Volltrefferquote.",
|
||||
"cobblemon.species.bulbasaur.name": "Bisasam",
|
||||
"cobblemon.species.bulbasaur.desc": "Nach der Geburt nimmt es für eine Weile Nährstoffe über den Samen auf seinem Rücken auf.",
|
||||
"cobblemon.species.bulbasaur.desc": "Obwohl selten und schwer fassbar in der Wilderniss, ist Bisasam dennoch unter Anfängeren beliebt für seine ruhige, gelassane Natur. Die Knospe auf seinem Rücken ist noch unterentwickelt, also braucht dieses Pokémon hohe Mengen an Energie, um dessen Wachstum zu fördern. Folglich ist es oft in Kompostern zu finden, wo es nach wertvollem Dünger sucht.",
|
||||
"cobblemon.species.ivysaur.name": "Bisaknosp",
|
||||
"cobblemon.species.ivysaur.desc": "Die Sonne macht es stärker. Die Knospe auf seinem Rücken wächst unter dem Einfluss von Sonnenlicht.",
|
||||
"cobblemon.species.venusaur.name": "Bisaflor",
|
||||
@@ -6237,8 +6237,8 @@
|
||||
"cobblemon.challenge.multi.team_request.accept.sender": "Du hast %1$ss Einladung angenommen!",
|
||||
"key.cobblemon.pokedex": "Öffne Pokédex",
|
||||
"cobblemon.challenge.multi.team_reject.existing_team": "Du bist schon teil eines Teams!",
|
||||
"cobblemon.challenge.multi.decline.receiver": "%1$s hat die Herausforderung abgelehnt...",
|
||||
"cobblemon.challenge.decline.sender": "Du hast %1$s's Herausforderung abgelehnt...",
|
||||
"cobblemon.challenge.multi.decline.receiver": "Dein team hat %1$s's Herausforderung abgelehnt.",
|
||||
"cobblemon.challenge.decline.sender": "%1$s hat deine Herausforderung abgelehnt...",
|
||||
"cobblemon.ui.pokenav.narrator.backbutton": "PokéNav Knopf gedrückt",
|
||||
"cobblemon.fishing_bait_effect_header": "Fisch Köder Effekte:",
|
||||
"cobblemon.fishing_bait_effects.iv.tooltip": "%1$s%% - %2$s IV +%3$s",
|
||||
@@ -6253,17 +6253,17 @@
|
||||
"cobblemon.ui.pokedex.info.form.maushold-family-four": "Familie",
|
||||
"cobblemon.ui.starter.narrator.backbutton": "Zurück-Knopf gedrückt",
|
||||
"cobblemon.pokerod.bobber": "Schwimmer: %1$s",
|
||||
"cobblemon.pokerod.bait": "Köder: %1$s x%2$s",
|
||||
"cobblemon.pokerod.bait": "Köder: %1$s ×%2$s",
|
||||
"block.cobblemon.lectern": "Pult",
|
||||
"cobblemon.fishing_bait_effects.level_raise.tooltip": "%1$s%% - Erhöhe Level +%3$s",
|
||||
"cobblemon.fishing_bait_effects.shiny_reroll.tooltip": "%1$sx - %3$sx Shiny Chance",
|
||||
"cobblemon.fishing_bait_effects.shiny_reroll.tooltip": "%1$s%% - %3$s× Shiny Chance",
|
||||
"entity.minecraft.villager.cobblemon.nurse": "Schwester",
|
||||
"cobblemon.fishing_bait_effects.friendship.tooltip": "%1$s%% - Erhöht Freundschaft +%3$s",
|
||||
"cobblemon.ui.stash.gold": "Münzlager",
|
||||
"cobblemon.ui.interact.accept": "Akzeptieren",
|
||||
"cobblemon.ui.interact.decline": "Ablehnen",
|
||||
"cobblemon.ui.interact.team_request": "Zusammenschließen",
|
||||
"cobblemon.ui.interact.too_far": "Das Ziel ist zu weit entfernt",
|
||||
"cobblemon.ui.interact.too_far": "Das Ziel ist zu weit entfernt!",
|
||||
"cobblemon.ui.pokedex.scan.registered_suffix": "%1$s registriert",
|
||||
"cobblemon.ui.pokedex.scan.trainer_owned": "Trainerbesitz",
|
||||
"cobblemon.ui.pokedex.info.drops_display": "%1$s %2$s",
|
||||
@@ -6291,7 +6291,7 @@
|
||||
"cobblemon.challenge.multi.sender": "Du hast %1$s (%2$s Mitglieder) zu einen Multikampf herausgefordert!",
|
||||
"cobblemon.challenge.multi.receiver": "%1$s (%2$s Mitglieder) hat dich zu einen Multikampf herausgefordert!",
|
||||
"cobblemon.challenge.multi.decline.disband": "Das generische Team wurde aufgelöst, Multikampf abgebrochen...",
|
||||
"cobblemon.challenge.multi.decline.sender": "%1$s hat %2$s's Multikampf Herausforderung abgelehnt...",
|
||||
"cobblemon.challenge.multi.decline.sender": "%1$s's team hat die Herausforderung abgelehnt...",
|
||||
"cobblemon.challenge.multi.decline.sender.personal": "Du hast %1$s's Multikampf Herausforderung abgelehnt...",
|
||||
"cobblemon.challenge.decline.receiver": "%1$s hat deine Herausforderung abgelehnt...",
|
||||
"cobblemon.command.freezepokemon.non_pokemon": "Du musst auf ein Pokémon zielen.",
|
||||
@@ -6316,5 +6316,16 @@
|
||||
"cobblemon.ui.pokedex.info.form.hisui": "Hisui",
|
||||
"cobblemon.ui.pokedex.info.form.region-bias-hisui": "Hisui-Einfluss",
|
||||
"cobblemon.ui.pokedex.info.form.region-bias-paldea": "Paldea-Einfluss",
|
||||
"cobblemon.ui.pokedex.info.form.no_ice": "Wohlfühlkopf"
|
||||
"cobblemon.ui.pokedex.info.form.no_ice": "Wohlfühlkopf",
|
||||
"cobblemon.ui.pokedex.info.form.tree-warped": "Wirr",
|
||||
"cobblemon.config.ui.starters": "Starter",
|
||||
"cobblemon.battle.start.flashfire": "Die Stärke der Feuer-Attacken von %1$s wurde erhöht!",
|
||||
"cobblemon.battle.activate.mummy": "%1$s hat die Fähigkeit Mumie angenommen!",
|
||||
"cobblemon.battle.activate.allyswitch": "%1$s und %2$s haben den Platz getauscht!",
|
||||
"cobblemon.battle.activate.insomnia": "Das Pokémon leidet von Insomnia, und kann nicht Einschlafen.",
|
||||
"cobblemon.battle.activate.custapberry": "Dank seiner Eipfelbeere kann %1$s schneller handeln als sonst!",
|
||||
"cobblemon.battle.enditem.ejectpack": "%1$s wird dank Fluchttasche ausgewechselt!",
|
||||
"item.cobblemon.galarica_nuts": "Galarnüsse",
|
||||
"cobblemon.ui.pokedex.info.form.tree-crimson": "Karmesin",
|
||||
"cobblemon.battle.enditem.focussash": "%1$s hält mithilfe seinem Fokusgurt durch!"
|
||||
}
|
||||
File diff suppressed because it is too large.
Load diff
File diff suppressed because it is too large.
Load diff
@@ -280,7 +280,7 @@
|
||||
"item.cobblemon.lure_ball.tooltip": "Taux de capture ×2 sur un Pokémon de type Eau, jusqu'à ce que la pêche soit ajoutée",
|
||||
"item.cobblemon.heavy_ball.tooltip": "Taux de capture ×1 à ×4, augmente selon la masse de la cible",
|
||||
"item.cobblemon.love_ball.tooltip": "Taux de capture ×2,5 si la cible est du genre opposé du Pokémon du joueur, ×8 s'ils sont aussi de la même espèce",
|
||||
"item.cobblemon.friend_ball.tooltip": "Taux de capture ×1, le Pokémon attrapé commencera avec 150 de bonheur",
|
||||
"item.cobblemon.friend_ball.tooltip": "Taux de capture ×1, le Pokémon attrapé commencera avec 150 de Bonheur",
|
||||
"item.cobblemon.moon_ball.tooltip": "Taux de capture ×1 à ×4, augmente durant la nuit en fonction de la proximité de la pleine lune",
|
||||
"item.cobblemon.sport_ball.tooltip": "Taux de capture ×1,5",
|
||||
"item.cobblemon.net_ball.tooltip": "Taux de capture ×3 sur un Pokémon de type Eau ou Insecte",
|
||||
@@ -288,7 +288,7 @@
|
||||
"item.cobblemon.nest_ball.tooltip": "Taux de capture ×1 à ×4, selon le niveau de la cible en allant du niveau 30 à 1",
|
||||
"item.cobblemon.repeat_ball.tooltip": "Taux de capture ×1, jusqu'à ce que le Pokédex soit ajouté",
|
||||
"item.cobblemon.timer_ball.tooltip": "Taux de capture ×1 à ×4, augmente à chaque tour passé, jusqu'au tour 10",
|
||||
"item.cobblemon.luxury_ball.tooltip": "Taux de capture ×1, le Pokémon attrapé gagne du bonheur deux fois plus rapidement",
|
||||
"item.cobblemon.luxury_ball.tooltip": "Taux de capture ×1, le Pokémon attrapé gagne du Bonheur deux fois plus rapidement",
|
||||
"item.cobblemon.premier_ball.tooltip": "Taux de capture ×1",
|
||||
"item.cobblemon.dusk_ball.tooltip": "Taux de capture ×3 si la cible est dans un niveau de lumière de 0, ×1,5 dans un niveau de lumière de 1 à 7",
|
||||
"item.cobblemon.heal_ball.tooltip": "Taux de capture ×1, restaure tous les PV, PP et les changements de statut lors de la capture",
|
||||
@@ -696,13 +696,13 @@
|
||||
"item.cobblemon.kelpsy_berry": "Baie Alga",
|
||||
"item.cobblemon.kelpsy_berry.tooltip": "Ne peut pas être consommée par le porteur",
|
||||
"item.cobblemon.lansat_berry": "Baie Lansat",
|
||||
"item.cobblemon.lansat_berry.tooltip": "Augmente le taux de coups critiques lorsque le porteur a moins d'1/4 de ses PV max",
|
||||
"item.cobblemon.lansat_berry.tooltip": "Augmente le Taux de critiques lorsque le porteur a moins d'1/4 de ses PV max",
|
||||
"item.cobblemon.leppa_berry": "Baie Mepo",
|
||||
"item.cobblemon.leppa_berry.tooltip": "Restaure 10 PP de la première capacité qui atteint 0 PP",
|
||||
"item.cobblemon.liechi_berry": "Baie Lichii",
|
||||
"item.cobblemon.liechi_berry.tooltip": "Augmente l'Attaque de 1 niveau lorsque le porteur a moins d'1/4 de ses PV max",
|
||||
"item.cobblemon.lum_berry": "Baie Prine",
|
||||
"item.cobblemon.lum_berry.tooltip": "Soigne tous les problèmes de statut du porteur",
|
||||
"item.cobblemon.lum_berry.tooltip": "Le porteur se soigne s'il a un problème de statut non volatile ou s'il est confus",
|
||||
"item.cobblemon.mago_berry": "Baie Mago",
|
||||
"item.cobblemon.mago_berry.tooltip": "Restaure 1/3 des PV lorsque le porteur a moins d'1/4 de ses PV max ; rend confus si le Pokémon n'aime pas les Baies sucrées",
|
||||
"item.cobblemon.magost_berry": "Baie Mangou",
|
||||
@@ -781,11 +781,11 @@
|
||||
"cobblemon.command.teach": "%1$s de %2$s a appris %3$s.",
|
||||
"cobblemon.command.teach.already_knows": "%1$s connait déjà %2$s !",
|
||||
"cobblemon.command.healpokemon.heal": "L'équipe de %1$s est complètement soignée.",
|
||||
"cobblemon.command.friendship": "%1$s a %2$s de bonheur.",
|
||||
"cobblemon.command.friendship": "%1$s a %2$s de Bonheur.",
|
||||
"cobblemon.command.givepokemon.nospecies": "Erreur : Vous devez inclure le nom d'un Pokémon ou 'random'",
|
||||
"cobblemon.command.spawnpokemon.nospecies": "Erreur : Vous devez inclure le nom d'un Pokémon ou 'random'",
|
||||
"cobblemon.command.held_item": "%2$s de %1$s a récupéré l'objet %3$s.",
|
||||
"cobblemon.command.pokeheal.in_battle": "Vous ne pouvez pas soigner votre équipe pendant un combat !",
|
||||
"cobblemon.command.pokeheal.in_battle": "Vous ne pouvez pas soigner votre équipe pendant un Combat !",
|
||||
"cobblemon.command.spawnpokemonfrompool": "%1$s est apparu dans les environs.",
|
||||
"cobblemon.command.spawnpokemonfrompool.unable_to_spawn": "Impossible de faire apparaître un Pokémon.",
|
||||
"cobblemon.command.pokebox.box_does_not_exist": "Ce joueur n'a pas de boîte %1$s.",
|
||||
@@ -827,7 +827,7 @@
|
||||
"advancements.cobblemon.first_shiny_catch.description": "Attrapez votre premier Pokémon chromatique",
|
||||
"advancements.cobblemon.healing_machine": "Repos bien mérité",
|
||||
"advancements.cobblemon.healing_machine.description": "Attendez que la machine de soin soit chargée, puis soignez votre équipe",
|
||||
"advancements.cobblemon.obtain_leek": "Que quelqu'un soigne le bateau !",
|
||||
"advancements.cobblemon.obtain_leek": "Mare de Poireauter",
|
||||
"advancements.cobblemon.obtain_leek.description": "Obtenez un Soignon, une plante sauvage qui pousse dans l'eau douce",
|
||||
"advancements.cobblemon.medicinal_brew": "Apothicaire local",
|
||||
"advancements.cobblemon.medicinal_brew.description": "Utilisez un Soignon pour confectionner la base de vos remèdes",
|
||||
@@ -1533,7 +1533,7 @@
|
||||
"tag.item.cobblemon.type_gems": "Types de joyaux",
|
||||
"tag.item.cobblemon.feathers": "Plumes",
|
||||
"tag.item.cobblemon.ability_changers": "Changeurs de talent",
|
||||
"tag.item.cobblemon.held.is_friendship_booster": "Boosteurs de bonheur",
|
||||
"tag.item.cobblemon.held.is_friendship_booster": "Boosteurs de Bonheur",
|
||||
"cobblemon.ability.adaptability": "Adaptabilité",
|
||||
"cobblemon.ability.adaptability.desc": "Quand le Pokémon utilise une capacité du même type que lui, le bonus de puissance qu’elle reçoit est encore plus important que normalement.",
|
||||
"cobblemon.ability.aerilate": "Peau Céleste",
|
||||
@@ -2251,7 +2251,7 @@
|
||||
"cobblemon.move.blastburn": "Rafale Feu",
|
||||
"cobblemon.move.blastburn.desc": "Une explosion ardente consume la cible. Le lanceur doit se reposer au tour suivant.",
|
||||
"cobblemon.move.blazekick": "Pied Brûleur",
|
||||
"cobblemon.move.blazekick.desc": "Le lanceur envoie un coup de pied au taux de critiques élevé. Peut aussi brûler la cible.",
|
||||
"cobblemon.move.blazekick.desc": "Le lanceur envoie un coup de pied au Taux de critiques élevé. Peut aussi brûler la cible.",
|
||||
"cobblemon.move.blazingtorque": "Couple Ardent",
|
||||
"cobblemon.move.blazingtorque.desc": "A 30% de chance de brûler la cible.",
|
||||
"cobblemon.move.bleakwindstorm": "Tempête Hivernale",
|
||||
@@ -2655,7 +2655,7 @@
|
||||
"cobblemon.move.focusblast": "Exploforce",
|
||||
"cobblemon.move.focusblast.desc": "Le lanceur rassemble ses forces et laisse éclater son pouvoir. Peut aussi baisser la Défense Spéciale de l’ennemi.",
|
||||
"cobblemon.move.focusenergy": "Puissance",
|
||||
"cobblemon.move.focusenergy.desc": "Le lanceur prend une profonde inspiration et se concentre pour augmenter son taux de critiques.",
|
||||
"cobblemon.move.focusenergy.desc": "Le lanceur prend une profonde inspiration et se concentre pour augmenter son Taux de critiques.",
|
||||
"cobblemon.move.focuspunch": "Mitra-Poing",
|
||||
"cobblemon.move.focuspunch.desc": "Le lanceur se concentre avant d’attaquer. Échoue s’il est touché avant d’avoir frappé.",
|
||||
"cobblemon.move.followme": "Par Ici",
|
||||
@@ -3207,7 +3207,7 @@
|
||||
"cobblemon.move.poisonsting": "Dard-Venin",
|
||||
"cobblemon.move.poisonsting.desc": "Un dard toxique qui transperce l’ennemi. Peut aussi l’empoisonner.",
|
||||
"cobblemon.move.poisontail": "Queue-Poison",
|
||||
"cobblemon.move.poisontail.desc": "Attaque à taux de critiques élevé. Peut aussi empoisonner l’ennemi.",
|
||||
"cobblemon.move.poisontail.desc": "Attaque à Taux de critiques élevé. Peut aussi empoisonner l’ennemi.",
|
||||
"cobblemon.move.pollenpuff": "Boule Pollen",
|
||||
"cobblemon.move.pollenpuff.desc": "Utilisée sur l’ennemi, envoie une boule explosive qui fait des dégâts ; sur un allié, donne du bon pollen nutritif qui fait récupérer des PV.",
|
||||
"cobblemon.move.poltergeist": "Esprit Frappeur",
|
||||
@@ -3471,7 +3471,7 @@
|
||||
"cobblemon.move.skullbash": "Coud’Krâne",
|
||||
"cobblemon.move.skullbash.desc": "Le lanceur baisse la tête pour augmenter sa Défense au premier tour et percuter l’ennemi au second.",
|
||||
"cobblemon.move.skyattack": "Piqué",
|
||||
"cobblemon.move.skyattack.desc": "Une attaque en deux tours au taux de critiques élevé. Peut aussi apeurer l’ennemi.",
|
||||
"cobblemon.move.skyattack.desc": "Une attaque en deux tours au Taux de critiques élevé. Peut aussi apeurer l’ennemi.",
|
||||
"cobblemon.move.skydrop": "Chute Libre",
|
||||
"cobblemon.move.skydrop.desc": "Le lanceur emmène l’ennemi dans les airs au premier tour et le lâche dans le vide au second. L’ennemi saisi ne peut pas attaquer.",
|
||||
"cobblemon.move.skyuppercut": "Stratopercut",
|
||||
@@ -6236,7 +6236,7 @@
|
||||
"cobblemon.move.gmaxcannonade.desc": "Une attaque de type Eau que seul un Tortank Gigamax peut utiliser. Inflige des dégâts à la cible pendant quatre tours.",
|
||||
"cobblemon.move.gmaxcentiferno": "Combustion G-Max",
|
||||
"cobblemon.move.gmaxchistrike": "Frappe G-Max",
|
||||
"cobblemon.move.gmaxchistrike.desc": "Une attaque de type Combat que seul un Mackogneur Gigamax peut utiliser. Augmente le taux de critiques du lanceur et de ses alliés.",
|
||||
"cobblemon.move.gmaxchistrike.desc": "Une attaque de type Combat que seul un Mackogneur Gigamax peut utiliser. Augmente le Taux de critiques du lanceur et de ses alliés.",
|
||||
"cobblemon.move.gmaxcuddle": "Câlin G-Max",
|
||||
"cobblemon.move.gmaxdepletion": "Usure G-Max",
|
||||
"cobblemon.move.gmaxdrumsolo": "Percussion G-Max",
|
||||
@@ -6289,7 +6289,7 @@
|
||||
"cobblemon.move.shatteredpsyche.desc": "Le Pokémon utilise la Force Z pour manipuler l'adversaire et lui infliger de sérieux dégâts. La puissance varie selon celle de la capacité originale.",
|
||||
"cobblemon.move.supersonicskystrike.desc": "Le Pokémon utilise la Force Z pour s'envoler très haut dans le ciel avant de plonger sur l'adversaire. La puissance varie selon celle de la capacité originale.",
|
||||
"cobblemon.move.twinkletackle.desc": "Le Pokémon utilise la Force Z pour créer une dimension irréelle où l'adversaire est à sa merci. La puissance varie selon celle de la capacité originale.",
|
||||
"cobblemon.move.10000000voltthunderbolt.desc": "Le Pikachu à casquette utilise la Force Z pour augmenter sa puissance électrique avant de la déchaîner sur la cible. Taux de critique élevé.",
|
||||
"cobblemon.move.10000000voltthunderbolt.desc": "Le Pikachu à casquette utilise la Force Z pour augmenter sa puissance électrique avant de la déchaîner sur la cible. Taux de critiques élevé.",
|
||||
"cobblemon.move.alloutpummeling.desc": "Le Pokémon utilise la Force Z pour créer une boule d'énergie qu'il projette sur l'adversaire. La puissance varie selon celle de la capacité originale.",
|
||||
"cobblemon.move.blackholeeclipse.desc": "Le Pokémon utilise la Force Z pour rassembler l'énergie négative et y aspirer l'adversaire. La puissance varie selon celle de la capacité originale.",
|
||||
"cobblemon.move.gmaxbefuddle": "Illusion G-Max",
|
||||
@@ -6396,5 +6396,355 @@
|
||||
"cobblemon.pokerod.bobber": "Flotteur : %1$s",
|
||||
"cobblemon.pokerod.bait": "Appât : %1$s x%2$s",
|
||||
"cobblemon.challenge.rule.level": "Tous niveau %1$s",
|
||||
"cobblemon.pokedex.variation.wood": "Bois"
|
||||
"cobblemon.pokedex.variation.wood": "Bois",
|
||||
"cobblemon.pokerod.remove": "Clic-droit pour retirer l'âppat",
|
||||
"item.cobblemon.galarica_nuts": "Branche Galanoa",
|
||||
"item.cobblemon.metal_coat.tooltip_2": "Fait évoluer Onix en Steelix et Insécateur en Cizayox lorsqu'il est tenu pendant un échange",
|
||||
"item.cobblemon.dubious_disc.tooltip": "Fait évoluer Porygon2 en Porygon-Z lorsqu'il est tenu pendant un échange",
|
||||
"item.cobblemon.deep_sea_scale.tooltip_1": "Double la Défense Spéciale de Coquiperl",
|
||||
"item.cobblemon.oval_stone.tooltip": "Fait évoluer Ptiravi en Leveinard lorsqu'il est tenu pendant la journée",
|
||||
"item.cobblemon.reaper_cloth.tooltip": "Fait évoluer Téraclope en Noctunoir lorsqu'il est tenu pendant un échange",
|
||||
"item.cobblemon.prism_scale.tooltip": "Fait évoluer Barpau en Milobellus lorsqu'il est tenu pendant un échange",
|
||||
"item.cobblemon.sachet.tooltip": "Fait évoluer Fluvetin en Cocotine lorsqu'il est tenu pendant un échange",
|
||||
"item.cobblemon.strawberry_sweet.tooltip": "Fait évoluer Crémy en Charmilly forme Fraise lorsqu'il est tenu pendant un échange",
|
||||
"item.cobblemon.berry_sweet.tooltip": "Fait évoluer Crémy en Charmilly forme Baie",
|
||||
"item.cobblemon.clover_sweet.tooltip": "Fait évoluer Crémy en Charmilly forme Trèfle",
|
||||
"item.cobblemon.flower_sweet.tooltip": "Fait évoluer Crémy en Charmilly forme Fleur",
|
||||
"item.cobblemon.ribbon_sweet.tooltip": "Fait évoluer Crémy en Charmilly forme Ruban",
|
||||
"item.cobblemon.chipped_pot.tooltip": "Fait évoluer Théffroi forme Authentique en Polthégeist",
|
||||
"item.cobblemon.cracked_pot.tooltip": "Fait évoluer Théffroi forme Contrefaçon en Polthégeist",
|
||||
"item.cobblemon.star_sweet.tooltip": "Fait évoluer Crémy en Charmilly forme Étoile",
|
||||
"cobblemon.pokerod.apply": "Clic-droit pour appliquer l'âppat",
|
||||
"item.cobblemon.npc_editor": "Éditeur de PNJ",
|
||||
"item.cobblemon.metal_coat.tooltip_1": "Augmente la puissance des capacités de type Acier",
|
||||
"item.cobblemon.upgrade.tooltip": "Fait évoluer Porygon en Porygon2 lorsqu'il est tenu pendant un échange",
|
||||
"item.cobblemon.whipped_dream.tooltip": "Fait évoluer Sucroquin en Cupcanaille lorsqu'il est tenu pendant un échange",
|
||||
"item.cobblemon.protector.tooltip": "Fait évoluer Rhinoféros en Rhinastoc lorsqu'il est tenu pendant un échange",
|
||||
"item.cobblemon.love_sweet.tooltip": "Fait évoluer Crémy en Charmilly forme Cœur",
|
||||
"item.cobblemon.link_cable.tooltip": "Fait évoluer les Pokémon qui nécessitent un échange",
|
||||
"item.cobblemon.dragon_scale.tooltip": "Fait évoluer Hypocéan en Hyporoi lorsqu'il est tenu pendant un échange",
|
||||
"item.cobblemon.kings_rock.tooltip_1": "Les capacités du porteur peuvent parfois apeurer l'adversaire",
|
||||
"item.cobblemon.kings_rock.tooltip_2": "Fait évoluer Têtarte en Tarpaud et Ramoloss en Roigada lorsqu'elle est tenue pendant un échange",
|
||||
"item.cobblemon.deep_sea_scale.tooltip_2": "Fait évoluer Coquiperl en Rosabyss lorsqu'elle est tenue pendant un échange",
|
||||
"item.cobblemon.deep_sea_tooth.tooltip_1": "Augmente l'Attaque Spéciale de Coquiperl",
|
||||
"item.cobblemon.deep_sea_tooth.tooltip_2": "Fait évoluer Coquiperl en Serpang lorsqu'elle est tenue pendant un échange",
|
||||
"item.cobblemon.electirizer.tooltip": "Fait évoluer Élektek en Élekable lorsqu'il est tenu pendant un échange",
|
||||
"item.cobblemon.magmarizer.tooltip": "Fait évoluer Magmar en Maganon lorsqu'il est tenu pendant un échange",
|
||||
"item.cobblemon.masterpiece_teacup.tooltip": "Fait évoluer Poltchageist Forme Onéreuse en Théffroyable Exceptionnelle",
|
||||
"item.cobblemon.unremarkable_teacup.tooltip": "Fait évoluer Poltchageist Imitation en Théffroyable Médiocre",
|
||||
"item.cobblemon.sweet_apple.tooltip": "Fait évoluer Verpom en Dratatin",
|
||||
"item.cobblemon.tart_apple.tooltip": "Fait évoluer Verpom en Pomdrapi",
|
||||
"item.cobblemon.galarica_cuff.tooltip": "Fait évoluer Ramoloss de Galar en Flagadoss de Galar",
|
||||
"item.cobblemon.galarica_wreath.tooltip": "Fait évoluer Ramoloss de Galar en Roigada de Galar",
|
||||
"item.cobblemon.black_augurite.tooltip": "Fait évoluer Insécateur en Hachécateur",
|
||||
"item.cobblemon.peat_block.tooltip": "Fait évoluer Ursaring en Ursaking lorsqu'il est utilisé pendant une pleine lune la nuit",
|
||||
"item.cobblemon.dawn_stone.tooltip": "Une pierre étrange qui fait évoluer certaines espèces de Pokémon",
|
||||
"item.cobblemon.dusk_stone.tooltip": "Une pierre étrange qui fait évoluer certaines espèces de Pokémon",
|
||||
"item.cobblemon.fire_stone.tooltip": "Une pierre étrange qui fait évoluer certaines espèces de Pokémon",
|
||||
"item.cobblemon.exp_candy_xl.tooltip": "Augmente l'expérience d'un Pokémon de 30 000 points d'Exp",
|
||||
"item.cobblemon.carbos.tooltip": "Augmente les EVs de Vitesse du Pokémon de 10",
|
||||
"item.cobblemon.hp_up.tooltip": "Augmente les EVs de PV du Pokémon de 10",
|
||||
"item.cobblemon.iron.tooltip": "Augmente les EVs de Défense du Pokémon de 10",
|
||||
"item.cobblemon.protein.tooltip": "Augmente les EVs d'Attaque du Pokémon de 10",
|
||||
"item.cobblemon.potion.tooltip": "Restaure 60 PV d'un Pokémon",
|
||||
"item.cobblemon.super_potion.tooltip": "Restaure 100 PV d'un Pokémon",
|
||||
"item.cobblemon.hyper_potion.tooltip": "Restaure 150 PV d'un Pokémon",
|
||||
"item.cobblemon.ice_stone.tooltip": "Une pierre étrange qui fait évoluer certaines espèces de Pokémon",
|
||||
"item.cobblemon.leaf_stone.tooltip": "Une pierre étrange qui fait évoluer certaines espèces de Pokémon",
|
||||
"item.cobblemon.shiny_stone.tooltip": "Une pierre étrange qui fait évoluer certaines espèces de Pokémon",
|
||||
"item.cobblemon.sun_stone.tooltip": "Une pierre étrange qui fait évoluer certaines espèces de Pokémon",
|
||||
"item.cobblemon.water_stone.tooltip": "Une pierre étrange qui fait évoluer certaines espèces de Pokémon",
|
||||
"item.cobblemon.rare_candy.tooltip": "Permet à un Pokémon de monter d'un niveau",
|
||||
"item.cobblemon.exp_candy_xs.tooltip": "Augmente l'expérience d'un Pokémon de 100 points d'Exp",
|
||||
"item.cobblemon.exp_candy_m.tooltip": "Augmente l'expérience d'un Pokémon de 3000 points d'Exp",
|
||||
"item.cobblemon.exp_candy_l.tooltip": "Augmente l'expérience d'un Pokémon de 10 000 points d'Exp",
|
||||
"item.cobblemon.full_restore.tooltip": "Restaure totalement les PV et soigne tous les problèmes de statut d'un Pokémon",
|
||||
"item.cobblemon.health_feather.tooltip": "Augmente les EVs de PV du Pokémon de 1",
|
||||
"item.cobblemon.resist_feather.tooltip": "Augmente les EVs de Défense du Pokémon de 1",
|
||||
"item.cobblemon.genius_feather.tooltip": "Augmente les EVs d'Attaque Spéciale du Pokémon de 1",
|
||||
"item.cobblemon.clever_feather.tooltip": "Augmente les EVs de Défense Spéciale du Pokémon de 1",
|
||||
"item.cobblemon.swift_feather.tooltip": "Augmente les EVs de Vitesse du Pokémon de 1",
|
||||
"item.cobblemon.ability_patch.tooltip": "Change le talent du Pokémon en son talent caché",
|
||||
"item.cobblemon.lonely_mint.tooltip": "Change les stats d'un Pokémon pour correspondre à la nature Solo",
|
||||
"item.cobblemon.adamant_mint.tooltip": "Change les stats d'un Pokémon pour correspondre à la nature Rigide",
|
||||
"item.cobblemon.bold_mint.tooltip": "Change les stats d'un Pokémon pour correspondre à la nature Assuré",
|
||||
"item.cobblemon.impish_mint.tooltip": "Change les stats d'un Pokémon pour correspondre à la nature Malin",
|
||||
"item.cobblemon.relaxed_mint.tooltip": "Change les stats d'un Pokémon pour correspondre à la nature Relax",
|
||||
"item.cobblemon.modest_mint.tooltip": "Change les stats d'un Pokémon pour correspondre à la nature Modeste",
|
||||
"item.cobblemon.mild_mint.tooltip": "Change les stats d'un Pokémon pour correspondre à la nature Doux",
|
||||
"item.cobblemon.quiet_mint.tooltip": "Change les stats d'un Pokémon pour correspondre à la nature Discret",
|
||||
"item.cobblemon.calm_mint.tooltip": "Change les stats d'un Pokémon pour correspondre à la nature Calme",
|
||||
"item.cobblemon.gentle_mint.tooltip": "Change les stats d'un Pokémon pour correspondre à la nature Gentil",
|
||||
"item.cobblemon.sassy_mint.tooltip": "Change les stats d'un Pokémon pour correspondre à la nature Malpoli",
|
||||
"item.cobblemon.timid_mint.tooltip": "Change les stats d'un Pokémon pour correspondre à la nature Timide",
|
||||
"item.cobblemon.hasty_mint.tooltip": "Change les stats d'un Pokémon pour correspondre à la nature Pressé",
|
||||
"item.cobblemon.naive_mint.tooltip": "Change les stats d'un Pokémon pour correspondre à la nature Naïf",
|
||||
"item.cobblemon.serious_mint.tooltip": "Change les stats d'un Pokémon pour correspondre à la nature Sérieux",
|
||||
"item.cobblemon.ability_shield.tooltip": "Le talent du Pokémon tenant cet objet ne peut pas être changé par un adversaire",
|
||||
"item.cobblemon.absorb_bulb.tooltip_2": "Consommé après usage",
|
||||
"item.cobblemon.air_balloon.tooltip_2": "Éclate quand touché par une attaque",
|
||||
"item.cobblemon.assault_vest.tooltip": "Augmente la Déf. Spé. du porteur mais empêche l'utilisation des capacités de statut",
|
||||
"item.cobblemon.auspicious_armor.tooltip": "Fait évoluer Charbambin en Carmadura",
|
||||
"item.cobblemon.malicious_armor.tooltip": "Fait évoluer Charbambin en Malvalame",
|
||||
"item.cobblemon.binding_band.tooltip": "Augmente la puissance des attaques immobilisantes",
|
||||
"item.cobblemon.black_glasses.tooltip": "Augmente la puissance des capacités de type Ténèbres",
|
||||
"item.cobblemon.blunder_policy.tooltip_2": "Consommée après usage",
|
||||
"item.cobblemon.cell_battery.tooltip_2": "Consommée après usage",
|
||||
"item.cobblemon.charcoal_stick.tooltip": "Augmente la puissance des capacités de type Feu",
|
||||
"item.cobblemon.choice_scarf.tooltip": "Ce bandeau augmente la Vitesse, mais ne permet d'utiliser qu'une seule capacité",
|
||||
"item.cobblemon.choice_specs.tooltip": "Ce bandeau augmente l'Attaque Spéciale, mais ne permet d'utiliser qu'une seule capacité",
|
||||
"item.cobblemon.cleanse_tag.tooltip": "N'a aucun effet",
|
||||
"item.cobblemon.covert_cloak.tooltip": "Le porteur est immunisé aux effets additionnels des capacités qu'il reçoit",
|
||||
"item.cobblemon.dragon_fang.tooltip": "Augmente la puissance des capacités de type Dragon",
|
||||
"item.cobblemon.eject_pack.tooltip_2": "Consommé après usage",
|
||||
"item.cobblemon.electric_seed.tooltip": "Augmente d'un cran la Défense du porteur lorsque le terrain est couvert d'un Champ Électrifié",
|
||||
"item.cobblemon.exp_share.tooltip": "Permet au porteur de recevoir de l'Exp. sans participer au combat",
|
||||
"item.cobblemon.expert_belt.tooltip": "Augmente les dégâts des capacités super efficaces",
|
||||
"item.cobblemon.thunder_stone.tooltip": "Une pierre étrange qui fait évoluer certaines espèces de Pokémon",
|
||||
"item.cobblemon.exp_candy_s.tooltip": "Augmente l'expérience d'un Pokémon de 800 points d'Exp",
|
||||
"item.cobblemon.lax_mint.tooltip": "Change les stats d'un Pokémon pour correspondre à la nature Lâche",
|
||||
"item.cobblemon.black_sludge.tooltip": "Si le porteur est de type Poison, ses PV se régénèrent progressivement pendant le combat. Il inflige des dégâts à tout autre type",
|
||||
"item.cobblemon.choice_band.tooltip": "Ce bandeau augmente l'Attaque, mais ne permet d'utiliser qu'une seule capacité",
|
||||
"item.cobblemon.everstone.tooltip": "Empêche le porteur d'évoluer",
|
||||
"item.cobblemon.max_potion.tooltip": "Restaure la totalité des PV d'un Pokémon",
|
||||
"item.cobblemon.absorb_bulb.tooltip_1": "Augmente l'Atq. Spé. du porteur lorsqu'il est touché par une capacité de type Eau",
|
||||
"item.cobblemon.eviolite.tooltip": "Augmente la Défense et la Défense Spéciale du porteur, s'il peut évoluer",
|
||||
"item.cobblemon.ability_capsule.tooltip": "Change le talent du Pokémon en son autre talent standard",
|
||||
"item.cobblemon.eject_button.tooltip_2": "Consommé après usage",
|
||||
"item.cobblemon.eject_pack.tooltip_1": "Permet au porteur de quitter le combat s'il subit une baisse de statistiques",
|
||||
"item.cobblemon.fairy_feather.tooltip": "Augmente la puissance des capacités de type Fée",
|
||||
"item.cobblemon.zinc.tooltip": "Augmente les EVs de Défense Spéciale du Pokémon de 10",
|
||||
"item.cobblemon.moon_stone.tooltip": "Une pierre étrange qui fait évoluer certaines espèces de Pokémon",
|
||||
"item.cobblemon.muscle_feather.tooltip": "Augmente les EVs d'Attaque du Pokémon de 1",
|
||||
"item.cobblemon.brave_mint.tooltip": "Change les stats d'un Pokémon pour correspondre à la nature Brave",
|
||||
"item.cobblemon.careful_mint.tooltip": "Change les stats d'un Pokémon pour correspondre à la nature Prudent",
|
||||
"item.cobblemon.jolly_mint.tooltip": "Change les stats d'un Pokémon pour correspondre à la nature Jovial",
|
||||
"item.cobblemon.air_balloon.tooltip_1": "Il permet au porteur de flotter dans les airs",
|
||||
"item.cobblemon.black_belt.tooltip": "Augmente la puissance des capacités de type Combat",
|
||||
"item.cobblemon.calcium.tooltip": "Augmente les EVs d'Attaque Spéciale du Pokémon de 10",
|
||||
"item.cobblemon.naughty_mint.tooltip": "Change les stats d'un Pokémon pour correspondre à la nature Mauvais",
|
||||
"item.cobblemon.rash_mint.tooltip": "Change les stats d'un Pokémon pour correspondre à la nature Foufou",
|
||||
"item.cobblemon.blunder_policy.tooltip_1": "Augmente la Vitesse du porteur lorsqu'une capacité est ratée",
|
||||
"item.cobblemon.cell_battery.tooltip_1": "Augmente l'Attaque du porteur lorsqu'il est touché par une capacité de type Électrik",
|
||||
"item.cobblemon.eject_button.tooltip_1": "Permet au porteur de quitter le combat s'il subit des dégâts d'une capacité offensive",
|
||||
"item.cobblemon.float_stone.tooltip": "Le poids du porteur est divisé par deux",
|
||||
"item.cobblemon.focus_band.tooltip": "Donne une chance au porteur de survivre à une attaque si il a tous ses PV, le laissant à 1 PV",
|
||||
"item.cobblemon.focus_sash.tooltip_1": "Empêche le porteur de se faire tuer en un coup",
|
||||
"item.cobblemon.focus_sash.tooltip_2": "Consommé après usage",
|
||||
"item.cobblemon.grassy_seed.tooltip": "Augmente d'un cran la Défense du porteur lorsque le terrain est couvert d'un Champ Herbu",
|
||||
"item.cobblemon.hard_stone.tooltip": "Augmente la puissance des capacités de type Roche",
|
||||
"item.cobblemon.heavy_duty_boots.tooltip": "Cet objet immunise le Pokémon qui le tient à tous les pièges sur le terrain",
|
||||
"item.cobblemon.iron_ball.tooltip": "Diminue la vitesse du porteur de moitié et le clou au sol",
|
||||
"item.cobblemon.leftovers.tooltip": "Rend des PV au porteur à chaque tour",
|
||||
"item.cobblemon.light_ball.tooltip": "Augmente l'Attaque et l'Atq. Spé. de Pikachu",
|
||||
"item.cobblemon.light_clay.tooltip": "Les capacités de protection comme Mur Lumière, Protection et Voile Aurore durent plus longtemps",
|
||||
"item.cobblemon.loaded_dice.tooltip": "Les capacités Multi-Coups frappent au moins quatre fois",
|
||||
"item.cobblemon.lucky_egg.tooltip": "Augmente la quatité d'Exp. gagnée par le porteur en Combat",
|
||||
"item.cobblemon.magnet.tooltip": "Augmente la puissance des capacités de type Électrik",
|
||||
"item.cobblemon.metronome.tooltip": "Augmente la puissance des capacités utilisées de façon répétées",
|
||||
"item.cobblemon.miracle_seed.tooltip": "Augmente la puissance des capacités de type Plante",
|
||||
"item.cobblemon.mystic_water.tooltip": "Augmente la puissance des capacités de type Eau",
|
||||
"item.cobblemon.poison_barb.tooltip": "Augmente la puissance des capacités de type Poison",
|
||||
"item.cobblemon.protective_pads.tooltip": "Protège le porteur des effets de contact",
|
||||
"item.cobblemon.quick_claw.tooltip": "Le porteur peut frapper en premier occasionnellement",
|
||||
"item.cobblemon.razor_claw.tooltip_1": "Augmente les chances de coup critique du porteur",
|
||||
"item.cobblemon.razor_claw.tooltip_2": "Fait évoluer Farfuret en Farfurex ou Dimoret lorsqu'elle est tenue en montant d'un niveau pendant le jour ou la nuit",
|
||||
"item.cobblemon.razor_fang.tooltip_1": "Peut appeurer l'ennemi lorsque le porteur lui inflige des dégâts",
|
||||
"item.cobblemon.red_card.tooltip_1": "Le Pokémon qui inflige des dégâts au porteur est obligé de sortir du combat",
|
||||
"item.cobblemon.red_card.tooltip_2": "Consommé après usage",
|
||||
"item.cobblemon.ring_target.tooltip": "Annule les immunités de type du porteur",
|
||||
"item.cobblemon.rocky_helmet.tooltip": "Renvoie des dégâts en cas de contact direct",
|
||||
"item.cobblemon.room_service.tooltip_1": "Diminue la vitesse du lanceur quand Distorsion est activée",
|
||||
"item.cobblemon.room_service.tooltip_2": "Consommé après usage",
|
||||
"item.cobblemon.scope_lens.tooltip": "Augmente les chances de coup critique du porteur",
|
||||
"item.cobblemon.sharp_beak.tooltip": "Augmente la puissance des capacités de type Vol",
|
||||
"item.cobblemon.shed_shell.tooltip": "Permet au porteur d'être changé, dans n'importe quelle situation",
|
||||
"item.cobblemon.shell_bell.tooltip": "Rend des PV au porteur à chaque tour",
|
||||
"item.cobblemon.silk_scarf.tooltip": "Augmente la puissance des capacités de type Normal",
|
||||
"item.cobblemon.silver_powder.tooltip": "Augmente la puissance des capacités de type Insecte",
|
||||
"item.cobblemon.soft_sand.tooltip": "Augmente la puissance des capacités de type Sol",
|
||||
"item.cobblemon.spell_tag.tooltip": "Augmente la puissance des capacités de type Spectre",
|
||||
"item.cobblemon.sticky_barb.tooltip": "Inflige des dégâts au porteur chaque tour, et change de porteur en cas de contact physique",
|
||||
"item.cobblemon.throat_spray.tooltip_1": "Augmente l'Atk. Spé. du porteur lorsqu'il utilise une attaque basée sur le son",
|
||||
"item.cobblemon.throat_spray.tooltip_2": "Consommé après usage",
|
||||
"item.cobblemon.twisted_spoon.tooltip": "Augmente la puissance des capacités de type Psy",
|
||||
"item.cobblemon.utility_umbrella.tooltip": "Le porteur n'est pas affecté par la Pluie ni par l'Ensoleillement",
|
||||
"item.cobblemon.weakness_policy.tooltip_2": "Consommée après usage",
|
||||
"item.cobblemon.wide_lens.tooltip": "Augmente la Précision du porteur",
|
||||
"item.cobblemon.wise_glasses.tooltip": "Augmente la puissance des capacités Spéciales",
|
||||
"item.cobblemon.zoom_lens.tooltip": "Augmente la Précision du porteur",
|
||||
"item.cobblemon.mental_herb.tooltip_2": "Consommée après usage",
|
||||
"item.cobblemon.mirror_herb.tooltip_1": "Si un Pokémon adverse augmente l'une de ses statistiques, le porteur copie cette augmentation",
|
||||
"item.cobblemon.mirror_herb.tooltip_2": "Consommée après usage",
|
||||
"item.cobblemon.misty_seed.tooltip": "Augmente d'un cran la Défense Spéciale du porteur lorsque le terrain est couvert d'un Champ Brumeux",
|
||||
"item.cobblemon.razor_fang.tooltip_2": "Fait évoluer Scorplane en Scorvol lorsqu'elle est tenue en montant d'un niveau pendant la nuit",
|
||||
"item.cobblemon.safety_goggles.tooltip": "Immunise le porteur aux attaques à base de poudres, spores et aux effets de météo",
|
||||
"item.cobblemon.mental_herb.tooltip_1": "Soigne le porteur et permet de choisir sa capacité normalement lorsque la sélection a été limitée",
|
||||
"item.cobblemon.shell_helmet": "Casquillage",
|
||||
"item.cobblemon.shell_helmet.tooltip": "Fait évoluer Carabing en Lançargot",
|
||||
"item.cobblemon.muscle_band.tooltip": "Augmente la puissance des capacités Physiques",
|
||||
"item.cobblemon.weakness_policy.tooltip_1": "Augmente l'Atk. et l'Atk. Spé. du porteur quand il est frappé par une attaque Super Efficace",
|
||||
"item.cobblemon.terrain_extender.tooltip": "Allonge la durée des effets des compétences et talents qui influencent le terrain",
|
||||
"item.cobblemon.never_melt_ice.tooltip": "Augmente la puissance des capacités de type Glace",
|
||||
"item.cobblemon.punching_glove.tooltip": "Augmente la puissance des capacités Coups de Poing et évite les effets de contact",
|
||||
"item.cobblemon.soothe_bell.tooltip": "Augmente les gains de Bonheur du porteur",
|
||||
"item.cobblemon.power_herb.tooltip_2": "Consommé après usage",
|
||||
"item.cobblemon.white_herb.tooltip_1": "Restaure toute statistique diminuée au combat",
|
||||
"item.cobblemon.white_herb.tooltip_2": "Consommé après usage",
|
||||
"item.cobblemon.bright_powder.tooltip": "Réduit de 10% la précision des capacités du pokemon adverse",
|
||||
"item.cobblemon.metal_powder.tooltip": "Augmente de 50% la Défense et Défense spéciale d'un Métamorph non transformé",
|
||||
"item.cobblemon.quick_powder.tooltip": "Double la vitesse d'un Métamorph non transformé",
|
||||
"item.cobblemon.power_anklet.tooltip": "Augmente de 8 les EVs de Vitesse lorsque de l'Exp. est gagnée en combat",
|
||||
"item.cobblemon.power_band.tooltip": "Augmente de 8 les EVs de Défense Spéciale lorsque de l'expérience est gagnée en combat",
|
||||
"item.cobblemon.power_belt.tooltip": "Augmente de 8 les EVs de Défense lorsque de l'expérience est gagnée en combat",
|
||||
"item.cobblemon.power_lens.tooltip": "Augmente de 8 les EVs d'Attaque Spéciale lorsque de l'expérience est gagnée en combat",
|
||||
"item.cobblemon.power_weight.tooltip": "Augmente de 8 les EVs de PV lorsque de l'expérience est gagnée en combat",
|
||||
"item.cobblemon.flame_orb.tooltip": "Brûle le porteur",
|
||||
"item.cobblemon.smoke_ball.tooltip": "N'a aucun effet",
|
||||
"item.cobblemon.toxic_orb.tooltip": "Empoisonne le porteur",
|
||||
"item.cobblemon.life_orb.tooltip": "Le porteur subit des dégâts mais augmente sa puissance",
|
||||
"item.cobblemon.damp_rock.tooltip": "Étend la durée de la Pluie",
|
||||
"item.cobblemon.heat_rock.tooltip": "Étend la durée du Soleil",
|
||||
"item.cobblemon.smooth_rock.tooltip": "Étend la durée de la Tempête de sable",
|
||||
"item.cobblemon.icy_rock.tooltip": "Étend la durée de la Tempête de neige ou Grêle",
|
||||
"item.cobblemon.medicinal_leek.tooltip_1": "Utilisé pour faire des boissons médicinales",
|
||||
"item.cobblemon.energy_root.tooltip": "Restaure 120 PV d'un Pokémon mais réduit son Bonheur",
|
||||
"item.cobblemon.revival_herb.tooltip": "Réanime complètement un Pokémon K.O. tout en réduisant son Bonheur",
|
||||
"item.cobblemon.berry_juice.tooltip": "Restaure 20 PV au porteur lorsque ses PV descendent sous 50%",
|
||||
"item.cobblemon.remedy.tooltip": "Restaure 60 PV à un Pokémon",
|
||||
"item.cobblemon.fine_remedy.tooltip": "Restaure 100 PV à un Pokémon",
|
||||
"item.cobblemon.revive.tooltip": "Réanime un Pokémon K.O avec 50% de ses PV max",
|
||||
"item.cobblemon.max_revive.tooltip": "Réanime et restaure la totalité de ses PV à un Pokémon K.O",
|
||||
"item.cobblemon.pp_max.tooltip": "Augmente de 60 % les PP maximum d'une capacité d'un Pokémon une seule fois",
|
||||
"item.cobblemon.x_attack.tooltip": "Augmente temporairement l'Attaque de la cible d'un cran lorsque utilisé en combat",
|
||||
"item.cobblemon.x_defence.tooltip": "Augmente temporairement la Défense de la cible d'un cran lorsque utilisé en combat",
|
||||
"item.cobblemon.x_speed.tooltip": "Augmente temporairement la Vitesse de la cible d'un cran lorsque utilisé en combat",
|
||||
"item.cobblemon.x_special_attack.tooltip": "Augmente temporairement l'Atq. Spé. de la cible d'un cran lorsque utilisé en combat",
|
||||
"item.cobblemon.dire_hit.tooltip": "Augmente temporairement le Taux de critiques de la cible d'un cran lorsque utilisé en combat",
|
||||
"item.cobblemon.guard_spec.tooltip": "Empêche temporairement les baisses de statistiques quand utilisé en Combat",
|
||||
"item.cobblemon.full_heal.tooltip": "Soigne toute altération de statut d'un Pokémon",
|
||||
"item.cobblemon.antidote.tooltip": "Soigne un Pokémon empoisonné",
|
||||
"item.cobblemon.awakening.tooltip": "Réveille un Pokémon endormi",
|
||||
"item.cobblemon.burn_heal.tooltip": "Soigne un Pokémon brûlé",
|
||||
"item.cobblemon.paralyze_heal.tooltip": "Soigne un Pokémon paralysé",
|
||||
"item.cobblemon.max_ether.tooltip": "Restaure la totalité des PP d'une capacité au choix d'un Pokémon",
|
||||
"item.cobblemon.elixir.tooltip": "Restaure 10 PP de toutes les capacités d'un Pokémon",
|
||||
"item.cobblemon.power_herb.tooltip_1": "Permet au porteur d’utiliser sans tour de charge une capacité qui nécessite un tour de charge",
|
||||
"item.cobblemon.destiny_knot.tooltip": "Si le porteur devient amoureux du Pokémon adverse, ce dernier devient également amoureux du porteur",
|
||||
"item.cobblemon.x_accuracy.tooltip": "Augmente temporairement la Précision de la cible d'un cran lorsque utilisé en combat",
|
||||
"item.cobblemon.ice_heal.tooltip": "Libère un Pokémon gelé",
|
||||
"item.cobblemon.heal_powder.tooltip": "Soigne toute altération de statut d'un Pokémon mais réduit son Bonheur",
|
||||
"item.cobblemon.pp_up.tooltip": "Augmente de 20 % les PP maximum d'une capacité d'un Pokémon jusqu'à un maximum d'augmentation de 60%",
|
||||
"item.cobblemon.power_bracer.tooltip": "Augmente de 8 les EVs d'Attaque lorsque de l'expérience est gagnée en combat",
|
||||
"item.cobblemon.psychic_seed.tooltip": "Augmente d'un cran la Défense Spéciale du porteur lorsque le terrain est couvert d'un Champ Psychique",
|
||||
"item.cobblemon.superb_remedy.tooltip": "Restaure 150 PV à un Pokémon",
|
||||
"item.cobblemon.x_special_defence.tooltip": "Augmente temporairement la Déf. Spé. de la cible d'un cran lorsque utilisé en combat",
|
||||
"item.cobblemon.medicinal_leek.tooltip_2": "Augmente aussi le Taux de critiques de deux crans pour les Canarticho et Palarticho qui le portent",
|
||||
"item.cobblemon.ether.tooltip": "Restaure 10 PP d'une capacité au choix d'un Pokémon",
|
||||
"item.cobblemon.max_elixir.tooltip": "Restaure totalement tous les PP de toutes les capacités d'un Pokémon",
|
||||
"item.cobblemon.normal_gem.tooltip_1": "Augmente la puissance de la première capacité de type Normal",
|
||||
"item.cobblemon.normal_gem.tooltip_2": "Consommé après usage",
|
||||
"item.cobblemon.water_gem.tooltip_1": "Augmente la puissance de la première capacité de type Eau",
|
||||
"item.cobblemon.water_gem.tooltip_2": "Consommé après usage",
|
||||
"item.cobblemon.fire_gem.tooltip_1": "Augmente la puissance de la première capacité de type Feu",
|
||||
"item.cobblemon.fire_gem.tooltip_2": "Consommé après usage",
|
||||
"item.cobblemon.grass_gem.tooltip_1": "Augmente la puissance de la première capacité de type Plante",
|
||||
"item.cobblemon.grass_gem.tooltip_2": "Consommé après usage",
|
||||
"item.cobblemon.dragon_gem.tooltip_1": "Augmente la puissance de la première capacité de type Dragon",
|
||||
"item.cobblemon.ghost_gem.tooltip_2": "Consommé après usage",
|
||||
"item.cobblemon.ground_gem.tooltip_1": "Augmente la puissance de la première capacité de type Sol",
|
||||
"item.cobblemon.ground_gem.tooltip_2": "Consommé après usage",
|
||||
"item.cobblemon.steel_gem.tooltip_1": "Augmente la puissance de la première capacité de type Acier",
|
||||
"item.cobblemon.steel_gem.tooltip_2": "Consommé après usage",
|
||||
"item.cobblemon.fairy_gem.tooltip_1": "Augmente la puissance de la première capacité de type Fée",
|
||||
"item.cobblemon.fairy_gem.tooltip_2": "Consommé après usage",
|
||||
"item.cobblemon.rock_gem.tooltip_2": "Consommé après usage",
|
||||
"item.cobblemon.psychic_gem.tooltip_1": "Augmente la puissance de la première capacité de type Psy",
|
||||
"item.cobblemon.psychic_gem.tooltip_2": "Consommé après usage",
|
||||
"item.cobblemon.electric_gem.tooltip_2": "Consommé après usage",
|
||||
"item.cobblemon.bug_gem.tooltip_1": "Augmente la puissance de la première capacité de type Insecte",
|
||||
"item.cobblemon.bug_gem.tooltip_2": "Consommé après usage",
|
||||
"item.cobblemon.poison_gem.tooltip_1": "Augmente la puissance de la première capacité de type Poison",
|
||||
"item.cobblemon.poison_gem.tooltip_2": "Consommé après usage",
|
||||
"item.cobblemon.ice_gem.tooltip_1": "Augmente la puissance de la première capacité de type Glace",
|
||||
"item.cobblemon.ice_gem.tooltip_2": "Consommé après usage",
|
||||
"item.cobblemon.dark_gem.tooltip_2": "Consommé après usage",
|
||||
"item.cobblemon.fighting_gem.tooltip_1": "Augmente la puissance de la première capacité de type Combat",
|
||||
"item.cobblemon.fighting_gem.tooltip_2": "Consommé après usage",
|
||||
"item.cobblemon.flying_gem.tooltip_2": "Consommé après usage",
|
||||
"block.cobblemon.big_root.tooltip": "Augmente la quantité de PV que récupère le porteur avec les capacités de vampirisme",
|
||||
"cobblemon.fishing.no_bite": "Pas de quoi grignoter.",
|
||||
"cobblemon.egg_group.monster": "Monstrueux",
|
||||
"cobblemon.egg_group.water_1": "Aquatique 1",
|
||||
"cobblemon.egg_group.bug": "Insectoïde",
|
||||
"cobblemon.egg_group.flying": "Aérien",
|
||||
"cobblemon.egg_group.field": "Terrain",
|
||||
"cobblemon.egg_group.fairy": "Féerique",
|
||||
"cobblemon.egg_group.grass": "Végétal",
|
||||
"cobblemon.egg_group.human_like": "Humanoïde",
|
||||
"cobblemon.egg_group.water_3": "Aquatique 3",
|
||||
"cobblemon.egg_group.mineral": "Minéral",
|
||||
"cobblemon.egg_group.amorphous": "Amorphe",
|
||||
"cobblemon.egg_group.water_2": "Aquatique 2",
|
||||
"cobblemon.egg_group.ditto": "Métamorph",
|
||||
"item.cobblemon.dragon_gem.tooltip_2": "Consommé après usage",
|
||||
"item.cobblemon.ghost_gem.tooltip_1": "Augmente la puissance de la première capacité de type Spectre",
|
||||
"item.cobblemon.rock_gem.tooltip_1": "Augmente la puissance de la première capacité de type Roche",
|
||||
"item.cobblemon.electric_gem.tooltip_1": "Augmente la puissance de la première capacité de type Électrik",
|
||||
"item.cobblemon.dark_gem.tooltip_1": "Augmente la puissance de la première capacité de type Ténèbres",
|
||||
"item.cobblemon.flying_gem.tooltip_1": "Augmente la puissance de la première capacité de type Vol",
|
||||
"cobblemon.fishing_bait_effects.typing.tooltip": "%1$s%% - %3$s× Chance pour Type %2$s",
|
||||
"cobblemon.fishing_bait_effects.egg_group.tooltip": "%1$s%% - %3$s× Chance pour Groupe Œuf %2$s",
|
||||
"cobblemon.egg_group.dragon": "Draconique",
|
||||
"cobblemon.egg_group.undiscovered": "Inconnu",
|
||||
"cobblemon.ui.generic.save": "Enregistrer",
|
||||
"cobblemon.trade.expired.receiver": "La demande d'échange de %1$s a expiré !",
|
||||
"cobblemon.trade.canceled.sender": "Vous avez annulmé votre demande d'échange avec %1$s.",
|
||||
"cobblemon.trade.canceled.receiver": "%1$s a annulé sa demande d'échange...",
|
||||
"cobblemon.trade.sent": "Demande d'échange envoyée à %1$s.",
|
||||
"cobblemon.trade.received": "%1$s veut échanger des Pokémon !",
|
||||
"cobblemon.trade.accept.receiver": "Vous acceptez la demande d'échange de %1$s !",
|
||||
"cobblemon.trade.decline.sender": "%1$s a refusé de vous échanger des Pokémon...",
|
||||
"cobblemon.trade.decline.receiver": "Vous avez refusé la demande d'échange de %1$s.",
|
||||
"cobblemon.trade.error.insufficient_pokemon.other": "%1$s n'a pas de Pokémon à échanger !",
|
||||
"cobblemon.trade.error.pending": "Vous avez déjà une requête en attente de %1$s !",
|
||||
"cobblemon.trade.error.duplicate": "Vous avez déjà envoyé une requête à %1$s !",
|
||||
"cobblemon.ui.wallpapers": "Fonds d'écran",
|
||||
"cobblemon.ui.pc.search": "Rechercher",
|
||||
"cobblemon.ui.interact.give.cosmetic_item": "Changer le cosmétique",
|
||||
"cobblemon.ui.interact.ride": "Chevaucher",
|
||||
"cobblemon.ui.pokedex.search.search_by": "Rechercher par %1$s",
|
||||
"cobblemon.ui.pokedex.search.type.species": "Espèce",
|
||||
"cobblemon.ui.pokedex.search.type.abilities": "Talent",
|
||||
"cobblemon.ui.pokedex.search.type.drops": "Butins",
|
||||
"cobblemon.cosmetic.held_logs.spruce": "Sapin",
|
||||
"cobblemon.cosmetic.held_logs.birch": "Bouleau",
|
||||
"cobblemon.cosmetic.held_logs.acacia": "Acacia",
|
||||
"cobblemon.cosmetic.held_logs.crimson": "Carmin",
|
||||
"cobblemon.cosmetic.held_logs.mangrove": "Palétuvier",
|
||||
"cobblemon.cosmetic.held_logs.cherry": "Cerisier",
|
||||
"cobblemon.cosmetic_item": "Cosmétique",
|
||||
"cobblemon.cosmetic_item.give": "%1$s porte %2$s.",
|
||||
"cobblemon.cosmetic_item.replace": "%1$s ne porte plus %2$s, mais %3$s oui !",
|
||||
"cobblemon.cosmetic_item.take": "%1$s ne porte plus %2$s.",
|
||||
"cobblemon.cosmetic_item.already_wearing": "%1$s porte déjà %2$s !",
|
||||
"cobblemon.ui.challenge.challenge_title": "Demande de Combat",
|
||||
"cobblemon.challenge.sent": "Vous défiez %1$s à %2$s.",
|
||||
"cobblemon.challenge.accept.receiver": "Vous acceptez le défi de %1$s !",
|
||||
"cobblemon.challenge.accept.sender": "%1$s a accepté le défi !",
|
||||
"cobblemon.ui.challenge.challenge": "Défi",
|
||||
"cobblemon.challenge.expired.receiver": "Le défi de %1$s a expiré !",
|
||||
"cobblemon.challenge.canceled.sender": "Vous avez annulé votre défi contre %1$s.",
|
||||
"cobblemon.challenge.expired.sender": "Votre défi contre %1$s a expiré !",
|
||||
"cobblemon.trade.accept.sender": "%1$s a accepté votre demande !",
|
||||
"cobblemon.trade.error.insufficient_pokemon.self": "Vous n'avez pas de Pokémon à échanger !",
|
||||
"cobblemon.ui.interact.request_already_expired": "Cette requête a déjà expiré !",
|
||||
"cobblemon.cosmetic.held_logs.oak": "Chêne",
|
||||
"cobblemon.command.pc.invalid-box": "Boîte numéro %1$s dépasse le nombre max de boîtes de %2$s.",
|
||||
"cobblemon.cosmetic.held_logs.jungle": "Acajou",
|
||||
"cobblemon.cosmetic.held_logs.dark_oak": "Chêne noir",
|
||||
"cobblemon.cosmetic.held_logs.warped": "Biscornue",
|
||||
"cobblemon.challenge.received": "%1$s vous défie à un %2$s !",
|
||||
"cobblemon.ui.pokedex.info.form.noice-face": "Dégel",
|
||||
"cobblemon.trade.expired.sender": "Votre demande d'échange avec %1$s a expiré !"
|
||||
}
|
||||
Loaded 100 of 292 files, more files were not shown because too many files have changed in this diff.
Show more
Reference in new issue
Block a user