character sizes, ..

This commit is contained in:
Sen 2025-03-27 23:14:26 +01:00
parent 74f730e450
commit 517e7d74f9
42 changed files with 405 additions and 209 deletions

View file

@ -216,8 +216,12 @@ public class EntityArachnoid extends EntityNPC
// return 0;
// }
public float getHeightDeviation(Random rand) {
return rand.frange(0.0f, 0.25f);
// public float getHeightDeviation(Random rand) {
// return rand.frange(0.0f, 0.25f);
// }
public float getHeightDeviationMax() {
return 0.25f;
}
public Alignment getNaturalAlign(Random rand) {

View file

@ -44,9 +44,13 @@ public class EntityBloodElf extends EntityNPC {
public int getBaseHealth(Random rand) {
return rand.range(24, 26);
}
public float getHeightDeviation(Random rand) {
return rand.frange(-0.1f, 0.3f);
public float getHeightDeviationMin() {
return -0.1f;
}
public float getHeightDeviationMax() {
return 0.3f;
}
public Alignment getNaturalAlign(Random rand) {

View file

@ -76,8 +76,8 @@ public class EntityChaosMarine extends EntityNPC {
return this.getLegion().health;
}
public float getBaseSize(Random rand) {
return this.getLegion().size / this.species.size;
public float getEntityBaseSize() {
return this.getLegion().size;
}
public Alignment getNaturalAlign(Random rand) {

View file

@ -101,9 +101,13 @@ public class EntityCultivator extends EntityNPC {
public Alignment getNaturalAlign(Random rand) {
return rand.pick(Alignment.values());
}
public float getHeightDeviation(Random rand) {
return rand.frange(-0.2f, 0.2f);
public float getHeightDeviationMin() {
return -0.2f;
}
public float getHeightDeviationMax() {
return 0.2f;
}
public void onStruckByLightning(EntityLightning lightningBolt) {

View file

@ -48,9 +48,13 @@ public class EntityDarkMage extends EntityHoveringNPC {
// public int getBaseEnergy(Random rand) {
// return 0;
// }
public float getHeightDeviation(Random rand) {
return rand.frange(-0.2f, 0.2f);
public float getHeightDeviationMin() {
return -0.2f;
}
public float getHeightDeviationMax() {
return 0.2f;
}
public Alignment getNaturalAlign(Random rand) {

View file

@ -44,9 +44,13 @@ public class EntityDwarf extends EntityNPC {
public int getBaseHealth(Random rand) {
return rand.range(16, 18);
}
public float getHeightDeviation(Random rand) {
return rand.frange(-0.1f, 0.1f);
public float getHeightDeviationMin() {
return -0.1f;
}
public float getHeightDeviationMax() {
return 0.1f;
}
public Alignment getNaturalAlign(Random rand) {

View file

@ -45,9 +45,13 @@ public class EntityElf extends EntityNPC {
public int getBaseHealth(Random rand) {
return rand.range(20, 24);
}
public float getHeightDeviation(Random rand) {
return rand.frange(-0.2f, 0.4f);
public float getHeightDeviationMin() {
return -0.2f;
}
public float getHeightDeviationMax() {
return 0.4f;
}
public Alignment getNaturalAlign(Random rand) {

View file

@ -48,9 +48,13 @@ public class EntityFireDemon extends EntityFlyingNPC {
// public int getBaseEnergy(Random rand) {
// return 0;
// }
public float getHeightDeviation(Random rand) {
return rand.frange(-0.15f, 0.35f);
public float getHeightDeviationMin() {
return -0.15f;
}
public float getHeightDeviationMax() {
return 0.35f;
}
public Alignment getNaturalAlign(Random rand) {

View file

@ -48,6 +48,14 @@ public abstract class EntityFlyingNPC extends EntityNPC
return true;
}
// public boolean canFlyFullSpeed() {
// return true;
// }
// public boolean canNaturallyFly() {
// return true;
// }
public void moveEntityWithHeading(float strafe, float forward)
{
if(this.isPlayer()) {

View file

@ -225,9 +225,9 @@ public class EntityGargoyle extends EntityFlyingNPC
// public int getBaseEnergy(Random rand) {
// return 0;
// }
public float getHeightDeviation(Random rand) {
return rand.frange(0.0f, 0.05f);
public float getHeightDeviationMax() {
return 0.05f;
}
public Alignment getNaturalAlign(Random rand) {

View file

@ -17,9 +17,13 @@ public class EntityGoblin extends EntityNPC {
public int getBaseHealth(Random rand) {
return rand.range(8, 12);
}
public float getHeightDeviation(Random rand) {
return rand.frange(-0.1f, 0.1f);
public float getHeightDeviationMin() {
return -0.1f;
}
public float getHeightDeviationMax() {
return 0.1f;
}
public Alignment getNaturalAlign(Random rand) {

View file

@ -87,9 +87,13 @@ public class EntityHuman extends EntityNPC {
public int getBaseHealth(Random rand) {
return rand.range(18, 20);
}
public float getHeightDeviation(Random rand) {
return rand.frange(-0.2f, 0.2f);
public float getHeightDeviationMin() {
return -0.2f;
}
public float getHeightDeviationMax() {
return 0.2f;
}
public Alignment getNaturalAlign(Random rand) {

View file

@ -151,9 +151,13 @@ public class EntityMage extends EntityNPC
// public int getBaseEnergy(Random rand) {
// return 0;
// }
public float getHeightDeviation(Random rand) {
return rand.frange(-0.2f, 0.2f);
public float getHeightDeviationMin() {
return -0.2f;
}
public float getHeightDeviationMax() {
return 0.2f;
}
public Alignment getNaturalAlign(Random rand) {

View file

@ -46,9 +46,13 @@ public class EntityMetalhead extends EntityNPC {
public int getBaseHealth(Random rand) {
return rand.range(20, 24);
}
public float getHeightDeviation(Random rand) {
return rand.frange(-0.2f, 0.2f);
public float getHeightDeviationMin() {
return -0.2f;
}
public float getHeightDeviationMax() {
return 0.2f;
}
public Alignment getNaturalAlign(Random rand) {

View file

@ -1131,10 +1131,22 @@ public abstract class EntityNPC extends EntityLiving
// return 0;
// }
public float getHeightDeviation(Random rand) {
public final float getHeightDeviation(Random rand) {
return this.getHeightDeviationMin() == this.getHeightDeviationMax() ? this.getHeightDeviationMin() : this.rand.frange(this.getHeightDeviationMin(), this.getHeightDeviationMax());
}
public float getHeightDeviationMin() {
return 0.0f;
}
public float getHeightDeviationMax() {
return 0.0f;
}
public float getEntityBaseSize() {
return this.species.size;
}
public boolean isVisibleTo(EntityNPC player)
{
return this.connection == null || !this.connection.isInEditor();
@ -2431,7 +2443,7 @@ public abstract class EntityNPC extends EntityLiving
this.setSprinting(false);
}
if (this.hasEffect(Potion.FLYING) || this.noclip)
if (this.hasEffect(Potion.FLYING) || this.noclip || this.canNaturallyFly())
{
if (this.noclip)
{
@ -2466,13 +2478,13 @@ public abstract class EntityNPC extends EntityLiving
if (this.gm.sneak)
{
this.motionY -= (double)(
this.flying ? (this.landMovement * 0.5f * 3.0F) : 0.05F);
this.landMovement * 0.5f * (this.canFlyFullSpeed() ? 3.0F : 1.0F));
}
if (this.gm.jump)
{
this.motionY += (double)(
this.flying ? (this.landMovement * 0.5f * 3.0F) : 0.05F);
this.landMovement * 0.5f * (this.canFlyFullSpeed() ? 3.0F : 1.0F));
}
}
@ -3042,7 +3054,7 @@ public abstract class EntityNPC extends EntityLiving
protected void onFinishedEffect(PotionEffect effect) {
super.onFinishedEffect(effect);
if(this.isPlayer() && effect.getPotion() == Potion.FLYING)
if(this.isPlayer() && effect.getPotion() == Potion.FLYING && !this.noclip && !this.canNaturallyFly())
this.flying = false;
// super.onFinishedEffect(effect);
if(this.connection != null)
@ -3532,7 +3544,7 @@ public abstract class EntityNPC extends EntityLiving
// this.foodStats.readNBT(tagCompund);
// this.readCapabilitiesFromNBT(tagCompund);
this.flying = tagCompund.getBoolean("flying") && this.hasEffect(Potion.FLYING);
this.flying = tagCompund.getBoolean("flying") && (this.hasEffect(Potion.FLYING) || this.canNaturallyFly());
// if(tagCompund.hasKey("speed", 99))
// this.speed = tagCompund.getFloat("speed");
// this.disableDamagePersist = tagCompund.getBoolean("alwaysInvulnerable");
@ -3987,8 +3999,7 @@ public abstract class EntityNPC extends EntityLiving
{
double d3 = this.motionY;
float f = this.jumpMovement;
if(this.flying)
this.jumpMovement = this.landMovement * 0.5f * (float)(this.isSprinting() ? 2 : 1);
this.jumpMovement = this.landMovement * (this.canFlyFullSpeed() ? 0.5f : 0.2f) * (float)(this.isSprinting() ? 2 : 1);
super.moveEntityWithHeading(strafe, forward);
this.motionY = d3 * 0.6D;
this.jumpMovement = f;
@ -4391,6 +4402,14 @@ public abstract class EntityNPC extends EntityLiving
public boolean isFlying() {
return this.flying || this.worldObj.gravity == 0.0;
}
public boolean canNaturallyFly() {
return false;
}
public boolean canFlyFullSpeed() {
return this.flying;
}
public int getEnergy(Energy type) { // TODO
return 0;
@ -4595,8 +4614,24 @@ public abstract class EntityNPC extends EntityLiving
return !this.isPlayer() && this.getGrowingAge() <= -14000;
}
public float getBaseSize(Random rand) {
return /* this.isPlayer() ? 1.8f : ( */ (this.species.size + this.getHeightDeviation(rand)) / this.species.size; // );
public final float getBaseSize(Random rand) {
return /* this.isPlayer() ? 1.8f : ( */ (this.getEntityBaseSize() + this.getHeightDeviation(rand)) / this.species.size; // );
}
public int getCurrentSize() {
return (int)(this.species.renderer.height * this.getHeight() * 100.0f + 0.5f);
}
public int getDefaultSize() {
return (int)(this.getEntityBaseSize() * 100.0f + 0.5f);
}
public int getMinSize() {
return (int)((this.getEntityBaseSize() + this.getHeightDeviationMin()) * 100.0f + 0.5f);
}
public int getMaxSize() {
return (int)((this.getEntityBaseSize() + this.getHeightDeviationMax()) * 100.0f + 0.5f);
}
public ModelType getModel() {

View file

@ -45,9 +45,13 @@ public class EntityOrc extends EntityNPC {
// public int getBaseEnergy(Random rand) {
// return 0;
// }
public float getHeightDeviation(Random rand) {
return rand.frange(-0.1f, 0.3f);
public float getHeightDeviationMin() {
return -0.1f;
}
public float getHeightDeviationMax() {
return 0.3f;
}
public Alignment getNaturalAlign(Random rand) {

View file

@ -125,8 +125,8 @@ public class EntityPrimarch extends EntityMobNPC {
// return 0;
// }
public float getBaseSize(Random rand) {
return this.getFounding().size / this.species.size;
public float getEntityBaseSize() {
return this.getFounding().size;
}
// public float getHeightDeviation(Random rand) {

View file

@ -77,9 +77,13 @@ public class EntitySlime extends EntityNPC
// public int getBaseEnergy(Random rand) {
// return 0;
// }
public float getHeightDeviation(Random rand) {
return rand.frange(-0.7f, 3.0f);
public float getHeightDeviationMin() {
return -0.7f;
}
public float getHeightDeviationMax() {
return 3.0f;
}
public Alignment getNaturalAlign(Random rand) {

View file

@ -76,8 +76,8 @@ public class EntitySpaceMarine extends EntityNPC {
return this.getLegion().health;
}
public float getBaseSize(Random rand) {
return this.getLegion().size / this.species.size;
public float getEntityBaseSize() {
return this.getLegion().size;
}
public Alignment getNaturalAlign(Random rand) {

View file

@ -43,9 +43,9 @@ public class EntitySpirit extends EntityNPC {
public int getBaseHealth(Random rand) {
return rand.range(8, 14);
}
public float getHeightDeviation(Random rand) {
return rand.frange(0.0f, 0.1f);
public float getHeightDeviationMax() {
return 0.1f;
}
public Alignment getNaturalAlign(Random rand) {

View file

@ -44,9 +44,13 @@ public class EntityTiefling extends EntityMobNPC {
// public int getBaseEnergy(Random rand) {
// return 0;
// }
public float getHeightDeviation(Random rand) {
return rand.frange(-0.1f, 0.4f);
public float getHeightDeviationMin() {
return -0.1f;
}
public float getHeightDeviationMax() {
return 0.4f;
}
public Alignment getNaturalAlign(Random rand) {

View file

@ -87,9 +87,13 @@ public class EntityUndead extends EntityNPC
// public int getBaseEnergy(Random rand) {
// return 0;
// }
public float getHeightDeviation(Random rand) {
return rand.frange(-0.2f, 0.2f);
public float getHeightDeviationMin() {
return -0.2f;
}
public float getHeightDeviationMax() {
return 0.2f;
}
public Alignment getNaturalAlign(Random rand) {

View file

@ -56,9 +56,13 @@ public class EntityVampire extends EntityNPC {
// public int getBaseEnergy(Random rand) {
// return 0;
// }
public float getHeightDeviation(Random rand) {
return rand.frange(-0.2f, 0.2f);
public float getHeightDeviationMin() {
return -0.2f;
}
public float getHeightDeviationMax() {
return 0.2f;
}
public Alignment getNaturalAlign(Random rand) {

View file

@ -45,9 +45,13 @@ public class EntityWoodElf extends EntityNPC {
public int getBaseHealth(Random rand) {
return rand.range(20, 22);
}
public float getHeightDeviation(Random rand) {
return rand.frange(-0.1f, 0.25f);
public float getHeightDeviationMin() {
return -0.1f;
}
public float getHeightDeviationMax() {
return 0.25f;
}
public Alignment getNaturalAlign(Random rand) {

View file

@ -308,9 +308,13 @@ public class EntityZombie extends EntityNPC
// public int getBaseEnergy(Random rand) {
// return 0;
// }
public float getHeightDeviation(Random rand) {
return rand.frange(-0.2f, 0.2f);
public float getHeightDeviationMin() {
return -0.2f;
}
public float getHeightDeviationMax() {
return 0.2f;
}
public Alignment getNaturalAlign(Random rand) {