mirror of
https://github.com/Sollace/Unicopia.git
synced 2024-11-23 21:38:00 +01:00
Sombra will now spawn crystals more often and will heal 1 heart for every crystal left unbroken
This commit is contained in:
parent
3525ed5629
commit
a6cb13e27a
1 changed files with 19 additions and 2 deletions
|
@ -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),
|
||||
|
|
Loading…
Reference in a new issue