Skip to content

Commit

Permalink
Rebalance movement staff spells.
Browse files Browse the repository at this point in the history
  • Loading branch information
Provismet committed Feb 10, 2024
1 parent bb100d1 commit 1f6eba4
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
package com.provismet.AdditionalArmoury.enchantments.staff;

import net.minecraft.entity.LivingEntity;
import net.minecraft.entity.MovementType;
import net.minecraft.item.ItemStack;
import net.minecraft.util.math.MathHelper;
import net.minecraft.util.math.Vec3d;

public class BoostEnchantment extends StaffEnchantment {
public BoostEnchantment () {
Expand All @@ -13,8 +15,10 @@ public BoostEnchantment () {
public boolean castSpell (ItemStack stack, LivingEntity user) {
double dx = -MathHelper.sin(user.getHeadYaw() / MathHelper.DEGREES_PER_RADIAN);
double dz = MathHelper.cos(user.getHeadYaw() / MathHelper.DEGREES_PER_RADIAN);
Vec3d velocity = new Vec3d(dx, 0.0, dz).multiply(1.25).add(0.0, 0.2, 0.0);

user.addVelocity(dx, 0.35, dz);
if (user.isOnGround()) user.move(MovementType.SELF, new Vec3d(0.0, 0.2, 0.0));
user.addVelocity(velocity);
return true;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,16 @@

public class JumpEnchantment extends StaffEnchantment {
public JumpEnchantment () {
super(Rarity.COMMON, 0xA2C663, 64, 10);
super(Rarity.COMMON, 0xA2C663, 32, 10);
}

@Override
public boolean castSpell (ItemStack stack, LivingEntity user) {
user.addStatusEffect(new StatusEffectInstance(StatusEffects.SLOW_FALLING, 40));
user.fallDistance = 0f;

Vec3d velocity = user.getVelocity();
user.setVelocity(velocity.x, 1, velocity.z);
user.setVelocity(velocity.x, 0.75, velocity.z);
return true;
}
}

0 comments on commit 1f6eba4

Please sign in to comment.