forked from Arathain/Tome-Of-Tiamatha
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
28 changed files
with
314 additions
and
84 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 changes: 2 additions & 2 deletions
4
src/main/java/net/arathain/tot/common/effect/DriderCurseStatusEffect.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,10 @@ | ||
package net.arathain.tot.common.effect; | ||
|
||
import net.minecraft.entity.effect.StatusEffect; | ||
import net.minecraft.entity.effect.StatusEffectCategory; | ||
import net.minecraft.entity.effect.StatusEffectType; | ||
|
||
public class DriderCurseStatusEffect extends StatusEffect { | ||
public DriderCurseStatusEffect(StatusEffectCategory category, int color) { | ||
public DriderCurseStatusEffect(StatusEffectType category, int color) { | ||
super(category, color); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
61 changes: 61 additions & 0 deletions
61
src/main/java/net/arathain/tot/common/entity/living/goal/NevermoreAttackGoal.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
package net.arathain.tot.common.entity.living.goal; | ||
|
||
import net.arathain.tot.common.entity.living.raven.NevermoreEntity; | ||
import net.minecraft.entity.LivingEntity; | ||
import net.minecraft.entity.ai.goal.Goal; | ||
import net.minecraft.sound.SoundEvent; | ||
|
||
public abstract class NevermoreAttackGoal extends Goal { | ||
protected final NevermoreEntity nevermore; | ||
protected int attackCooldown; | ||
protected int nextAttackTime; | ||
|
||
public NevermoreAttackGoal(NevermoreEntity quothed) { | ||
nevermore = quothed; | ||
} | ||
@Override | ||
public void start() { | ||
this.attackCooldown = this.getWarmupTime(); | ||
this.nextAttackTime = this.nevermore.age + this.getCooldown(); | ||
this.nevermore.playSound(this.getChargeSound(), 1.0F, 1.0F); | ||
this.nevermore.setAttackState(this.getAttackId()); | ||
} | ||
@Override | ||
public boolean canStart() { | ||
LivingEntity target = this.nevermore.getTarget(); | ||
if (target != null && target.isAlive() && this.nevermore.getAttackState() == 0) { | ||
return this.nevermore.age >= this.nextAttackTime; | ||
} else { | ||
return false; | ||
} | ||
} | ||
|
||
@Override | ||
public boolean shouldContinue() { | ||
LivingEntity target = this.nevermore.getTarget(); | ||
return target != null && target.isAlive() && this.attackCooldown > 0; | ||
} | ||
|
||
protected abstract SoundEvent getChargeSound(); | ||
protected abstract int getAttackId(); | ||
|
||
@Override | ||
public void stop() { | ||
this.nevermore.setAttackState(0); | ||
} | ||
|
||
@Override | ||
public void tick() { | ||
--this.attackCooldown; | ||
if (this.attackCooldown == 0) { | ||
this.attack(); | ||
this.nevermore.playSound(this.nevermore.getAttackSound(), 1.0F, 1.0F); | ||
this.nevermore.stopAnger(); | ||
} | ||
} | ||
protected abstract int getCooldown(); | ||
|
||
protected abstract int getWarmupTime(); | ||
|
||
protected abstract void attack(); | ||
} |
33 changes: 33 additions & 0 deletions
33
src/main/java/net/arathain/tot/common/entity/living/goal/NevermoreLookAtTargetGoal.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
package net.arathain.tot.common.entity.living.goal; | ||
|
||
import net.arathain.tot.common.entity.living.raven.NevermoreEntity; | ||
import net.minecraft.entity.ai.goal.Goal; | ||
|
||
import java.util.EnumSet; | ||
|
||
public class NevermoreLookAtTargetGoal extends Goal { | ||
private final NevermoreEntity nevermore; | ||
|
||
public NevermoreLookAtTargetGoal(NevermoreEntity aaa) { | ||
this.nevermore = aaa; | ||
this.setControls(EnumSet.of(Goal.Control.MOVE, Goal.Control.LOOK)); | ||
} | ||
|
||
@Override | ||
public boolean canStart() { | ||
return this.nevermore.getAttackState() != 0; | ||
} | ||
|
||
@Override | ||
public void start() { | ||
super.start(); | ||
this.nevermore.getNavigation().stop(); | ||
} | ||
|
||
@Override | ||
public void tick() { | ||
if (this.nevermore.getTarget() != null) { | ||
this.nevermore.getLookControl().lookAt(this.nevermore.getTarget(), (float)this.nevermore.getLookYawSpeed(), (float)this.nevermore.getLookPitchSpeed()); | ||
} | ||
} | ||
} |
62 changes: 62 additions & 0 deletions
62
src/main/java/net/arathain/tot/common/entity/living/goal/NevermoreYeetGoal.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
package net.arathain.tot.common.entity.living.goal; | ||
|
||
import net.arathain.tot.common.entity.living.raven.NevermoreEntity; | ||
import net.minecraft.entity.LivingEntity; | ||
import net.minecraft.entity.attribute.EntityAttributes; | ||
import net.minecraft.entity.damage.DamageSource; | ||
import net.minecraft.sound.SoundEvent; | ||
import net.minecraft.sound.SoundEvents; | ||
|
||
public class NevermoreYeetGoal extends NevermoreAttackGoal { | ||
public NevermoreYeetGoal(NevermoreEntity quothed) { | ||
super(quothed); | ||
} | ||
|
||
@Override | ||
protected SoundEvent getChargeSound() { | ||
return SoundEvents.ENTITY_IRON_GOLEM_REPAIR; | ||
} | ||
|
||
@Override | ||
protected int getAttackId() { | ||
return 1; | ||
} | ||
|
||
@Override | ||
protected int getCooldown() { | ||
return 60; | ||
} | ||
|
||
@Override | ||
protected int getWarmupTime() { | ||
|
||
return 16; | ||
} | ||
|
||
@Override | ||
public void start() { | ||
LivingEntity target = this.nevermore.getTarget(); | ||
if (target != null) { | ||
this.nevermore.teleportTo(target); | ||
} | ||
super.start(); | ||
} | ||
|
||
@Override | ||
protected void attack() { | ||
LivingEntity target = this.nevermore.getTarget(); | ||
if (target != null && this.nevermore.squaredDistanceTo(target) < 4) { | ||
float f = (float) this.nevermore.getAttributeValue(EntityAttributes.GENERIC_ATTACK_DAMAGE); | ||
float g = (int)f > 0 ? f / 2.0F + (float)this.nevermore.getRandom().nextInt((int)f) : f; | ||
boolean bl = target.damage(DamageSource.mob(this.nevermore), g); | ||
if (bl) { | ||
target.setVelocity(target.getVelocity().add(0.0D, 1.2000000059604645D, 0.0D)); | ||
this.nevermore.applyDamageEffects(this.nevermore, target); | ||
} | ||
|
||
this.nevermore.playSound(nevermore.getAttackSound(), 1.0F, 1.0F); | ||
} | ||
} | ||
|
||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.