@Override protected int calcDamagePerHit() { return Compute.d6(); } }
public int getAeroCrewNeeds() { return Compute.getAeroCrewNeeds(entity); }
public int getFullCrewSize() { return Compute.getFullCrewSize(entity); }
public static int getRandomMechWeight() { int roll = Compute.randomInt(10); if (roll <= 2) return EntityWeightClass.WEIGHT_LIGHT; if (roll <= 6) return EntityWeightClass.WEIGHT_MEDIUM; if (roll <= 8) return EntityWeightClass.WEIGHT_HEAVY; return EntityWeightClass.WEIGHT_ASSAULT; }
/** * Returns the odds that a certain number or above will be rolled on 2d6. */ public static double oddsAbove(int n) { return oddsAbove(n, false); }
casualties = (int)Math.ceil(Compute.getFullCrewSize(en) * (newHits/6.0)); if (Compute.d6(2) >= 7) { wounded = true; } else { if (Compute.d6(2) >= 7) { wounded = true; } else { if(Compute.d6(2) >= 7) { wounded = true; } else { if(Compute.d6(2) >= 7) { wounded = true; } else { if(casualtiesAssigned < casualties) { casualtiesAssigned++; if(Compute.d6(2) >= 7) { wounded = true; } else { if (campaign.getCampaignOptions().useAdvancedMedical() || campaign.getCampaignOptions().useRandomHitsForVees()) { int range = 6 - hits; hits = hits + Compute.randomInt(range);
if (f.isClan() && Compute.d6(2) > 8 - skill + skills[0] + skills[1]) { int phenotype; switch (en.getUnitType()) { Compute.getFullCrewSize(en), skills[0], skills[1]));
int roll = Compute.d6(2); int tn = ae.getCrew().getPiloting(); int maxSensorRange = ae.getActiveSensor().getRangeByBracket(); tn += calcSpaceECM(game, ae, target); tn += calcSensorShadow(game, ae, target);
if (((base_to_hit + 4) <= 12) && Compute.allowAimedShotWith(test_weapon, IAimingModes .AIM_MODE_TARG_COMP)) { refactored_damage = base_damage * (Compute.oddsAbove(base_to_hit + 4, aptGunnery) / 100.0); ((WeaponAttackAction) atk_action_list .get(action_index)) if ((0.2 * base_damage * (Compute.oddsAbove(base_to_hit, aptGunnery) / 100.0)) > refactored_damage) { refactored_damage = 0.2 * (Compute.oddsAbove(base_to_hit, aptGunnery) / 100.0); ((WeaponAttackAction) atk_action_list .get(action_index)) if (Compute.allowAimedShotWith(test_weapon, IAimingModes.AIM_MODE_TARG_COMP)) { * (Compute.oddsAbove(base_to_hit + 4, aptGunnery) / 100.0); refactored_head = 0.0; ((WeaponAttackAction) atk_action_list .oddsAbove(base_to_hit, aptGunnery) / 100.0)) > refactored_damage) && Compute.allowAimedShotWith(test_weapon, IAimingModes.AIM_MODE_IMMOBILE)) { refactored_damage = 0.50 * (Compute.oddsAbove(base_to_hit, aptGunnery) / 100.0); refactored_head = 0.50
return ((Infantry) entity).getSquadN() * ((Infantry) entity).getSquadSize(); } else if (entity instanceof Jumpship || entity instanceof SmallCraft) { return getAeroCrewNeeds(entity) + getTotalGunnerNeeds(entity); } else { return 1;
int distance = Compute.effectiveDistance(game, ce(), target); if (m.isUsedThisRound()) { .setText(toHit.getValueAsString() + " (" + Compute.oddsAbove( toHit.getValue(), ce().hasAbility(OptionsConstants.PILOT_APTITUDE_GUNNERY))
Coords vertex = movableArea.getVertexNum(vertexNum); if(vertex != null && Compute.isInArc(finalCoords, path.getFinalFacing(), vertex, arcToUse)) { inArcVertexCount++; double myDamageDiscount = Compute.oddsAbove(path.getEntity().getCrew().getGunnery()) / 100 * vertexCoverage; double enemyDamageDiscount = Compute.oddsAbove(enemy.getCrew().getGunnery() + sensorShadowMod) / 100;
public int getTotalDriverNeeds() { return Compute.getTotalDriverNeeds(entity); }
public int getTotalGunnerNeeds() { return Compute.getTotalGunnerNeeds(entity); }
/** * should aimned shoots be allowed with the passed weapon * * @param weapon * @return */ public boolean allowAimedShotWith(Mounted weapon) { return Compute.allowAimedShotWith(weapon, aimingMode); }
public static int getRandomAeroWeight() { int roll = Compute.randomInt(8); if (roll <= 2) return EntityWeightClass.WEIGHT_LIGHT; if (roll <= 6) return EntityWeightClass.WEIGHT_MEDIUM; return EntityWeightClass.WEIGHT_HEAVY; }
private double calcBuildingHazard(MoveStep step, Entity movingUnit, boolean jumpLanding, IBoard board, StringBuilder logMsg) { logMsg.append("\n\tCalculating building hazard: "); // Protos, BA and Infantry move through buildings freely. if (movingUnit instanceof Protomech || movingUnit instanceof Infantry) { logMsg.append("Safe for infantry and protos."); return 0; } // Jumping onto a building is handled in PathRanker validatePaths. if (jumpLanding) { return 0; } // Get the odds of failing the piloting roll while moving through the building. double odds = (1.0 - (Compute.oddsAbove(movingUnit.getCrew() .getPiloting()) / 100)); logMsg.append("\n\t\tChance to fail piloting roll: ") .append(LOG_PERCENT.format(odds)); // Hazard is based on potential damage taken. double dmg = board.getBuildingAt(step.getPosition()) .getCurrentCF(step.getPosition()) / 10D; logMsg.append("\n\t\tPotential building damage: ") .append(LOG_DECIMAL.format(dmg)); double hazard = dmg * odds; logMsg.append("\n\t\tHazard value (") .append(LOG_DECIMAL.format(hazard)).append(")."); return hazard; }
casualties = (int)Math.ceil(Compute.getFullCrewSize(en) * (newHits/6.0)); if(Compute.d6(2) >= 7) { wounded = true; } else { if(Compute.d6(2) >= 7) { wounded = true; } else { if(Compute.d6(2) >= 7) { wounded = true; } else { if(Compute.d6(2) >= 7) { wounded = true; } else { if(Compute.d6(2) >= 7) { wounded = true; } else { if (campaign.getCampaignOptions().useAdvancedMedical() || campaign.getCampaignOptions().useRandomHitsForVees()) { int range = 6 - hits; hits = hits + Compute.randomInt(range);
/** Called when creating a new injury to generate a slightly randomized healing time */ public static int genHealingTime(Campaign c, Person p, InjuryType itype, int severity) { int mod = 100; int rand = Compute.randomInt(100); if(rand < 5) { mod += (Compute.d6() < 4) ? rand : -rand; } int time = itype.getRecoveryTime(severity); if(itype == InjuryTypes.LACERATION) { time += Compute.d6(); } time = Math.round(time * mod * p.getAbilityTimeModifier() / 10000); return time; }