Skip to content

Commit

Permalink
feat: buff familiars
Browse files Browse the repository at this point in the history
Closes #1056
  • Loading branch information
klikli-dev committed Feb 14, 2024
1 parent 752502b commit 3d2d937
Show file tree
Hide file tree
Showing 6 changed files with 15 additions and 14 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -266,7 +266,7 @@ public void shootRay(List<Integer> targetIds) {

private static class RayGoal extends Goal {

private static final int MAX_COOLDOWN = 20 * 5;
private static final int MAX_COOLDOWN = 20 * 1;

protected final BeholderFamiliarEntity entity;
private int cooldown = MAX_COOLDOWN;
Expand Down Expand Up @@ -319,7 +319,7 @@ protected void attack() {

for (int id : this.targetIds) {
Entity e = this.entity.level().getEntity(id);
float damage = 6;
float damage = 9;
if (this.entity.hasEffect(MobEffects.DAMAGE_BOOST))
damage *= this.entity.getEffect(MobEffects.DAMAGE_BOOST).getAmplifier() + 2;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ public DragonFamiliarEntity(EntityType<? extends DragonFamiliarEntity> type, Lev
}

public static AttributeSupplier.Builder createAttributes() {
return FamiliarEntity.createMobAttributes().add(Attributes.ATTACK_DAMAGE, 4);
return FamiliarEntity.createAttributes().add(Attributes.ARMOR, 25);
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -433,7 +433,7 @@ public MagicGoal(FairyFamiliarEntity fairy) {
@Override
public void start() {
super.start();
this.attackTimer = 20;
this.attackTimer = 10;
}

@Override
Expand All @@ -449,17 +449,17 @@ protected void checkAndPerformAttack(LivingEntity pEnemy, double pDistToEnemySqr
if (pDistToEnemySqr <= reach) {
this.fairy.setMagicTarget(pEnemy);
if (this.attackTimer <= 0) {
this.attackTimer = 20;
this.attackTimer = 10;
LivingEntity owner = this.fairy.getFamiliarOwner();
if (owner != null) {
pEnemy.hurt(this.fairy.damageSources().mobAttack(owner), 1);
pEnemy.hurt(this.fairy.damageSources().mobAttack(owner), 3);
pEnemy.addEffect(new MobEffectInstance(MobEffects.MOVEMENT_SLOWDOWN, 40, 1));
List<LivingEntity> allies = this.fairy.level().getEntitiesOfClass(LivingEntity.class,
this.fairy.getBoundingBox().inflate(7), e -> e != this.fairy && e instanceof IFamiliar
&& ((IFamiliar) e).getFamiliarOwner() == owner);
allies.add(owner);
for (LivingEntity ally : allies) {
ally.heal(1);
ally.heal(3);
((ServerLevel) this.fairy.level()).sendParticles(ParticleTypes.HEART, ally.getX(),
ally.getY() + ally.getBbHeight(), ally.getZ(), 1, 0, 0, 0, 1);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -71,10 +71,11 @@ public FamiliarEntity(EntityType<? extends FamiliarEntity> type, Level level) {
}

public static AttributeSupplier.Builder createAttributes() {
return Mob.createMobAttributes().add(Attributes.MAX_HEALTH, 20)
.add(Attributes.ARMOR, 2.0)
.add(Attributes.ARMOR_TOUGHNESS, 2.0)
.add(Attributes.MOVEMENT_SPEED, 0.3);
return Mob.createMobAttributes().add(Attributes.MAX_HEALTH, 30)
.add(Attributes.ARMOR, 15.0)
.add(Attributes.ARMOR_TOUGHNESS, 10.0)
.add(Attributes.MOVEMENT_SPEED, 0.3)
.add(Attributes.ATTACK_DAMAGE, 6);
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,8 +66,8 @@ public MummyFamiliarEntity(EntityType<? extends MummyFamiliarEntity> type, Level
}

public static AttributeSupplier.Builder createAttributes() {
return FamiliarEntity.createAttributes().add(Attributes.MAX_HEALTH, 18).add(Attributes.ARMOR, 2)
.add(Attributes.ATTACK_DAMAGE, 4).add(Attributes.FOLLOW_RANGE, 30);
return FamiliarEntity.createAttributes()
.add(Attributes.ATTACK_DAMAGE, 9).add(Attributes.FOLLOW_RANGE, 30);
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ protected DemonicPartner(EntityType<? extends TamableAnimal> pEntityType, Level
}

public static AttributeSupplier.Builder createAttributes() {
return FamiliarEntity.createAttributes().add(Attributes.ATTACK_DAMAGE, 3.0D);
return FamiliarEntity.createAttributes().add(Attributes.ATTACK_DAMAGE, 9.0D);
}

protected void defineSynchedData() {
Expand Down

0 comments on commit 3d2d937

Please sign in to comment.