@Override protected int calcDamagePerHit() { return Compute.d6(); } }
@Override public boolean canAddDropShips() { return Compute.d6() <= 2; } }
/** * @return The result of a 2d6 roll from {@link Compute#d6(int)} */ protected int rollDice() { return Compute.d6(2); }
public static int rollSpecialAbilities(int bonus) { int roll = Compute.d6(2) + bonus; if(roll < 10) { return 0; } else if(roll < 12) { return 1; } else { return 2; } }
public void addRoll(int bonus) { Integer roll = new Integer(Compute.d6(2)); rolls.addElement(roll); originalRolls.addElement(roll); bonuses.addElement(bonus); wasRollReplaced.addElement(new Boolean(false)); }
@Override protected int modifyInjuryTime(Person p, int time) { return super.modifyInjuryTime(p, time + Compute.d6()); } }
/** * scatter from a hex according, roll d6 to choose scatter direction * * @param coords The <code>Coords</code> to scatter from * @param margin the <code>int</code> margin of failure, scatter distance will * be the margin of failure * @return the <code>Coords</code> scattered to */ public static Coords scatter(Coords coords, int margin) { int scatterDirection = Compute.d6(1) - 1; return coords.translated(scatterDirection, margin); }
@Override public boolean canAddDropShips() { return !isAttacker() && (Compute.d6() == 1); } }
@Override public boolean canAddDropShips() { return isAttacker() && (Compute.d6() <= 3); } }
/** * Replace the previous init roll with a new one, and make a note that it * was replaced. Used for Tactical Genius special pilot ability (lvl 3). */ public void replaceRoll(int bonus) { Integer roll = new Integer(Compute.d6(2)); rolls.setElementAt(roll, size() - 1); bonuses.setElementAt(bonus, size() - 1); wasRollReplaced.setElementAt(new Boolean(true), size() - 1); }
protected int modifyInjuryTime(Person p, int time) { // Randomize healing time int mod = 100; int rand = Compute.randomInt(100); if(rand < 5) { mod += (Compute.d6() < 4) ? rand : -rand; } return Math.round(time * mod * p.getAbilityTimeModifier() / 10000); }
@Override public void setTerrain() { do { setTerrainType(terrainChart[Compute.d6(2) - 2]); } while (getTerrainType() == TER_HEAVYURBAN); }
@Override protected void addHeat() { // Only add heat for first shot in strafe if (isStrafing && !isStrafingFirstShot()) { return; } if (!(toHit.getValue() == TargetRoll.IMPOSSIBLE)) { super.addHeat(); ae.heatBuildup += Compute.d6(); } }
@Override public void setTerrain() { do { setTerrainType(terrainChart[Compute.d6(2) - 2]); } while ((getTerrainType() == TER_WETLANDS || getTerrainType() == TER_COASTAL || getTerrainType() == TER_FLATLANDS)); }
private void rollCommandClause(AtBContract contract, int mod) { int roll = Compute.d6(2) + mod; if (roll < 3) contract.setCommandRights(Contract.COM_INTEGRATED); else if (roll < 8) contract.setCommandRights(Contract.COM_HOUSE); else if (roll < 12) contract.setCommandRights(Contract.COM_LIAISON); else contract.setCommandRights(Contract.COM_INDEP); }
private void rollTransportClause(AtBContract contract, int mod) { int roll = Compute.d6(2) + mod; if (roll < 2) contract.setTransportComp(0); else if (roll < 6) contract.setTransportComp((20 + (roll - 2) * 5)); else if (roll < 10) contract.setTransportComp((45 + (roll - 6) * 5)); else contract.setTransportComp(100); }
public void checkForFollowup(Campaign campaign) { if ((getMissionType() == AtBContract.MT_DIVERSIONARYRAID || getMissionType() == AtBContract.MT_RECONRAID || getMissionType() == AtBContract.MT_RIOTDUTY)) { int roll = Compute.d6(); if (roll == 6) { campaign.getContractMarket().addFollowup(campaign, this); campaign.addReport("Your employer has offered a follow-up contract (available on the <a href=\"CONTRACT_MARKET\">contract market</a>)."); } } }
public void doPostResolution(Campaign c, int contractBreaches, int bonusRolls) { getContract(c).addPlayerMinorBreaches(contractBreaches); for (int i = 0; i < bonusRolls; i++) { getContract(c).doBonusRoll(c); } if (RECONRAID == getScenarioType() && attacker && (getStatus() == S_VICTORY || getStatus() == S_MVICTORY)) { for (int i = 0; i < Compute.d6() - 2; i++) { getContract(c).doBonusRoll(c); } } }