Sombra will now spawn crystals more often and will heal 1 heart for every crystal left unbroken

This commit is contained in:
Sollace 2023-08-27 23:36:54 +01:00
parent 3525ed5629
commit a6cb13e27a
No known key found for this signature in database
GPG key ID: E52FACE7B5C773DB

View file

@ -12,8 +12,10 @@ import com.minelittlepony.unicopia.entity.ai.ArenaAttackGoal;
import com.minelittlepony.unicopia.entity.player.Pony;
import com.minelittlepony.unicopia.item.AmuletItem;
import com.minelittlepony.unicopia.item.UItems;
import com.minelittlepony.unicopia.particle.FollowingParticleEffect;
import com.minelittlepony.unicopia.particle.ParticleSource;
import com.minelittlepony.unicopia.particle.ParticleUtils;
import com.minelittlepony.unicopia.particle.UParticles;
import com.minelittlepony.unicopia.util.VecHelper;
import com.minelittlepony.unicopia.util.shape.Sphere;
@ -278,7 +280,7 @@ public class SombraEntity extends HostileEntity implements ArenaCombatant, Parti
}
}
if (random.nextInt(200) == 0) {
if (random.nextInt(150) == 0) {
for (BlockPos p : BlockPos.iterateRandomly(random, 3, getBlockPos(), 20)) {
CrystalShardsEntity.infestBlock((ServerWorld)getWorld(), p);
}
@ -289,6 +291,21 @@ public class SombraEntity extends HostileEntity implements ArenaCombatant, Parti
}
}
if (getHealth() < getMaxHealth()) {
for (Entity shard : getWorld().getEntitiesByClass(CrystalShardsEntity.class, getBoundingBox().expand(50), EntityPredicates.VALID_ENTITY)) {
if (age % 150 == 0) {
heal(2);
}
ParticleUtils.spawnParticle(getWorld(),
new FollowingParticleEffect(UParticles.HEALTH_DRAIN, this, 0.2F)
.withChild(ParticleTypes.CAMPFIRE_SIGNAL_SMOKE),
shard.getPos(),
Vec3d.ZERO
);
}
}
getHomePos().ifPresent(this::generateArenaEffects);
}
@ -345,7 +362,7 @@ public class SombraEntity extends HostileEntity implements ArenaCombatant, Parti
}
protected void generateBodyParticles() {
for (int i = 0; i < 23; i++) {
for (int i = 0; i < 3; i++) {
getWorld().addParticle(ParticleTypes.LARGE_SMOKE,
random.nextTriangular(getX(), 8),
random.nextTriangular(getY(), 1),