fixed new nightmare
This commit is contained in:
1 parent
8a0c22a8f6
commit
7e470cd95b
1 file changed
+1
-18
+1
-18
@@ -76,10 +76,6 @@ public class NightmareEntity extends Monster implements GeoEntity {
|
|||||||
private static final int ANIM_ATTACK = 3;
|
private static final int ANIM_ATTACK = 3;
|
||||||
private static final int ANIM_FLY_ATTACK = 4;
|
private static final int ANIM_FLY_ATTACK = 4;
|
||||||
private static final int ANIM_ROAR = 5;
|
private static final int ANIM_ROAR = 5;
|
||||||
private static final int ANIM_DEATH = 6;
|
|
||||||
private static final int ANIM_TAKEOFF = 7;
|
|
||||||
private static final int ANIM_FLY_DAMAGED = 8;
|
|
||||||
|
|
||||||
private static final int ATTACK_TOTAL_TICKS = 20;
|
private static final int ATTACK_TOTAL_TICKS = 20;
|
||||||
private static final int ATTACK_DAMAGE_TICK = 10;
|
private static final int ATTACK_DAMAGE_TICK = 10;
|
||||||
private static final int INTRO_ROAR_TICKS = 30;
|
private static final int INTRO_ROAR_TICKS = 30;
|
||||||
@@ -103,13 +99,10 @@ public class NightmareEntity extends Monster implements GeoEntity {
|
|||||||
|
|
||||||
private static final RawAnimation IDLE_ANIM = RawAnimation.begin().thenLoop("idle");
|
private static final RawAnimation IDLE_ANIM = RawAnimation.begin().thenLoop("idle");
|
||||||
private static final RawAnimation WALK_ANIM = RawAnimation.begin().thenLoop("walk");
|
private static final RawAnimation WALK_ANIM = RawAnimation.begin().thenLoop("walk");
|
||||||
private static final RawAnimation TAKEOFF_ANIM = RawAnimation.begin().thenLoop("fly");
|
|
||||||
private static final RawAnimation FLY_ANIM = RawAnimation.begin().thenLoop("fly");
|
private static final RawAnimation FLY_ANIM = RawAnimation.begin().thenLoop("fly");
|
||||||
private static final RawAnimation ATTACK_ANIM = RawAnimation.begin().thenPlay("attack").thenLoop("idle");
|
private static final RawAnimation ATTACK_ANIM = RawAnimation.begin().thenPlay("attack").thenLoop("idle");
|
||||||
private static final RawAnimation FLY_ATTACK_ANIM = RawAnimation.begin().thenPlay("attack2").thenLoop("fly");
|
private static final RawAnimation FLY_ATTACK_ANIM = RawAnimation.begin().thenPlay("attack2").thenLoop("fly");
|
||||||
private static final RawAnimation ROAR_ANIM = RawAnimation.begin().thenPlay("roar").thenLoop("idle");
|
private static final RawAnimation ROAR_ANIM = RawAnimation.begin().thenPlay("roar").thenLoop("idle");
|
||||||
private static final RawAnimation DEATH_ANIM = RawAnimation.begin().thenPlayAndHold("roar");
|
|
||||||
|
|
||||||
private final AnimatableInstanceCache geoCache = GeckoLibUtil.createInstanceCache(this);
|
private final AnimatableInstanceCache geoCache = GeckoLibUtil.createInstanceCache(this);
|
||||||
|
|
||||||
private int attackCooldown;
|
private int attackCooldown;
|
||||||
@@ -179,18 +172,14 @@ public class NightmareEntity extends Monster implements GeoEntity {
|
|||||||
int animState = this.getAnimationState();
|
int animState = this.getAnimationState();
|
||||||
state.getController().setAnimationSpeed(switch (animState) {
|
state.getController().setAnimationSpeed(switch (animState) {
|
||||||
case ANIM_FLY -> 0.45D;
|
case ANIM_FLY -> 0.45D;
|
||||||
case ANIM_DEATH -> 0.6D;
|
|
||||||
default -> 1.0D;
|
default -> 1.0D;
|
||||||
});
|
});
|
||||||
return switch (animState) {
|
return switch (animState) {
|
||||||
case ANIM_WALK -> state.setAndContinue(WALK_ANIM);
|
case ANIM_WALK -> state.setAndContinue(WALK_ANIM);
|
||||||
case ANIM_TAKEOFF -> state.setAndContinue(TAKEOFF_ANIM);
|
|
||||||
case ANIM_FLY -> state.setAndContinue(FLY_ANIM);
|
case ANIM_FLY -> state.setAndContinue(FLY_ANIM);
|
||||||
// case ANIM_FLY_DAMAGED -> state.setAndContinue(FLY_ANIM);
|
|
||||||
case ANIM_ATTACK -> state.setAndContinue(ATTACK_ANIM);
|
case ANIM_ATTACK -> state.setAndContinue(ATTACK_ANIM);
|
||||||
case ANIM_FLY_ATTACK -> state.setAndContinue(FLY_ATTACK_ANIM);
|
case ANIM_FLY_ATTACK -> state.setAndContinue(FLY_ATTACK_ANIM);
|
||||||
case ANIM_ROAR -> state.setAndContinue(ROAR_ANIM);
|
case ANIM_ROAR -> state.setAndContinue(ROAR_ANIM);
|
||||||
case ANIM_DEATH -> state.setAndContinue(DEATH_ANIM);
|
|
||||||
default -> state.setAndContinue(IDLE_ANIM);
|
default -> state.setAndContinue(IDLE_ANIM);
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
@@ -257,7 +246,6 @@ public class NightmareEntity extends Monster implements GeoEntity {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (this.isDeadOrDying()) {
|
if (this.isDeadOrDying()) {
|
||||||
this.setAnimationState(ANIM_DEATH);
|
|
||||||
this.updateFlightRotation();
|
this.updateFlightRotation();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@@ -375,7 +363,6 @@ public class NightmareEntity extends Monster implements GeoEntity {
|
|||||||
@Override
|
@Override
|
||||||
public void die(DamageSource damageSource) {
|
public void die(DamageSource damageSource) {
|
||||||
if (!this.level().isClientSide) {
|
if (!this.level().isClientSide) {
|
||||||
this.setAnimationState(ANIM_DEATH);
|
|
||||||
this.attackAnimationTicks = 0;
|
this.attackAnimationTicks = 0;
|
||||||
this.attackCooldown = 0;
|
this.attackCooldown = 0;
|
||||||
this.roarTicks = 0;
|
this.roarTicks = 0;
|
||||||
@@ -389,9 +376,6 @@ public class NightmareEntity extends Monster implements GeoEntity {
|
|||||||
@Override
|
@Override
|
||||||
protected void tickDeath() {
|
protected void tickDeath() {
|
||||||
this.deathTime++;
|
this.deathTime++;
|
||||||
if (this.deathTime == 1) {
|
|
||||||
this.setAnimationState(ANIM_DEATH);
|
|
||||||
}
|
|
||||||
if (this.deathTime >= DEATH_TICKS) {
|
if (this.deathTime >= DEATH_TICKS) {
|
||||||
this.remove(RemovalReason.KILLED);
|
this.remove(RemovalReason.KILLED);
|
||||||
this.dropExperience(this);
|
this.dropExperience(this);
|
||||||
@@ -649,7 +633,6 @@ public class NightmareEntity extends Monster implements GeoEntity {
|
|||||||
|
|
||||||
private void updateAnimationState() {
|
private void updateAnimationState() {
|
||||||
if (this.isDeadOrDying()) {
|
if (this.isDeadOrDying()) {
|
||||||
this.setAnimationState(ANIM_DEATH);
|
|
||||||
this.groundMoveTicks = 0;
|
this.groundMoveTicks = 0;
|
||||||
this.wingFlapCooldown = 0;
|
this.wingFlapCooldown = 0;
|
||||||
return;
|
return;
|
||||||
@@ -669,7 +652,7 @@ public class NightmareEntity extends Monster implements GeoEntity {
|
|||||||
if (this.flyingToTarget) {
|
if (this.flyingToTarget) {
|
||||||
this.groundMoveTicks = 0;
|
this.groundMoveTicks = 0;
|
||||||
if (this.onGround() || this.airborneTicks <= 8) {
|
if (this.onGround() || this.airborneTicks <= 8) {
|
||||||
this.setAnimationState(ANIM_TAKEOFF);
|
this.setAnimationState(ANIM_FLY);
|
||||||
this.wingFlapCooldown = 0;
|
this.wingFlapCooldown = 0;
|
||||||
} else {
|
} else {
|
||||||
this.setAnimationState(ANIM_FLY);
|
this.setAnimationState(ANIM_FLY);
|
||||||
|
|||||||
Reference in new issue
Block a user