/** * Damage that a mech does with a accidental fall from above. */ public static int getAffaDamageFor(Entity entity) { return (int) entity.getWeight() / 10; }
/** * Damage done to a mech after a successful DFA. */ public static int getDamageTakenBy(Entity entity) { return (int) Math.ceil(entity.getWeight() / 5.0); }
/** * Damage caused by a successfull thrashing attack. * * @param entity - the <code>Entity</code> conducting the thrash attack. * @return The <code>int</code> amount of damage caused by this attack. */ public static int getDamageFor(Entity entity) { int nDamage = (int) Math.round(entity.getWeight() / 3.0); return nDamage; }
public static int getDamageTakenBy(Entity entity, Entity target, boolean tacops, int distance) { if (!tacops) { return (int) Math .ceil((target.getWeight() / 10.0) * (entity.getLocationStatus(1) == ILocationExposureStatus.WET ? 0.5 : 1)); } return (int) Math .floor((((target.getWeight() * entity.getWeight()) * distance) / (target .getWeight() + entity.getWeight())) / 10); }
public static int getDamageFor(IAero attacker, Entity target, Coords atthex, int avel, int tvel) { int netv = Compute.getNetVelocity(atthex, target, avel, tvel); return (int) Math.ceil( (((Entity)attacker).getWeight() / 10.0) * netv); }
public boolean canLoad(Entity unit) { return unit.hasETypeFlag(Entity.ETYPE_DROPSHIP) && (unit.getWeight() <= 5000) && (currentSpace >= 1); }
public static int getDamageFor(Entity entity, int hexesMoved) { if (hexesMoved == 0) { hexesMoved = 1; } return (int) Math .ceil((entity.getWeight() / 5.0) * (hexesMoved - 1) * (entity.getLocationStatus(1) == ILocationExposureStatus.WET ? 0.5 : 1)); }
public static int getDamageTakenBy(Entity entity, Targetable target, int distance) { if (distance == 0) { distance = 1; } double weight = entity.getWeight(); if (target.getTargetType() == Targetable.TYPE_ENTITY) { weight = ((Entity)target).getWeight(); } return (int) Math .ceil((weight / 10.0) * (distance - 1) * (entity.getLocationStatus(1) == ILocationExposureStatus.WET ? 0.5 : 1)); }
@Override public void autoSetMaxBombPoints() { maxBombPoints = Integer.MAX_VALUE; for (Integer fId : fighters) { Entity fighter = game.getEntity(fId); int currBombPoints = (int) Math.round(fighter.getWeight() / 5); maxBombPoints = Math.min(maxBombPoints, currBombPoints); } }
public static int getDamageTakenBy(IAero attacker, Entity target, Coords atthex, int avel, int tvel) { int netv = Compute.getNetVelocity(atthex, target, avel, tvel); return (int) Math.ceil( (target.getWeight() / 10.0) * netv); }
/** * Damage that a mech does with a successful DFA. */ public static int getDamageFor(Entity entity, boolean targetInfantry) { int toReturn = (int) Math.ceil((entity.getWeight() / 10.0) * 3.0); if (DfaAttackAction.hasTalons(entity)) { toReturn *= 1.5; } if (targetInfantry) { toReturn = Math.max(1, toReturn / 10); } return toReturn; }
public int getWeightClass() { return EntityWeightClass.getWeightClass(getWeight(), this); }
public double getWeight() { return getEntity().getWeight(); }
@Override public double getWeight() { return fighters.stream().map(fid -> game.getEntity(fid)) .filter(ACTIVE_CHECK).mapToDouble(ent -> ent.getWeight()).sum(); }
public void setUnit(Unit u) { this.unit = u; if(null != unit) { unitId = unit.getId(); unitTonnage = (int) u.getEntity().getWeight(); } else { unitId = null; } }
public static boolean usesKgStandard(Entity entity) { return entity.hasETypeFlag(Entity.ETYPE_BATTLEARMOR) || entity.hasETypeFlag(Entity.ETYPE_PROTOMECH) || (EntityWeightClass.getWeightClass(entity.getWeight(), entity) == EntityWeightClass.WEIGHT_SMALL_SUPPORT); }
public double getMassOfAllInBuilding(final IGame game, final Coords coords) { double mass = 0; // Add the mass of anyone else standing in/on this building. final IHex hex = game.getBoard().getHex(coords); final int buildingElevation = hex.terrainLevel(Terrains.BLDG_ELEV); final int bridgeElevation = hex.terrainLevel(Terrains.BRIDGE_ELEV); Iterator<Entity> crowd = game.getEntities(coords); while (crowd.hasNext()) { Entity e = crowd.next(); if (buildingElevation >= e.getElevation() || bridgeElevation >= e.getElevation()) { mass += e.getWeight(); } } return mass; }
@Override public double getWeightArmor() { int totalArmorPoints = 0; for (int loc = 0; loc < getEntity().locations(); loc++) { totalArmorPoints += getEntity().getOArmor(loc); } int bar = getEntity().getBARRating(Tank.LOC_BODY); int techRating = getEntity().getArmorTechRating(); double weight = totalArmorPoints * SV_ARMOR_WEIGHT[bar][techRating]; if (getEntity().getWeight() < 5) { return TestEntity.floor(weight, Ceil.KILO); } else { return TestEntity.ceil(weight, Ceil.HALFTON); } }