public int getLongRangeModifier() { int mod = 4; if (hasAbility(OptionsConstants.GUNNERY_RANGE_MASTER, Crew.RANGEMASTER_LONG)) { mod = 0; } if (hasAbility(OptionsConstants.GUNNERY_SNIPER) && (mod > 0)) { mod = mod / 2; } if (hasQuirk(OptionsConstants.QUIRK_POS_IMP_TARG_L)) { mod--; } if (hasQuirk(OptionsConstants.QUIRK_NEG_POOR_TARG_L)) { mod++; } if (hasQuirk(OptionsConstants.QUIRK_POS_VAR_RNG_TARG_L)) { mod--; } if (hasQuirk(OptionsConstants.QUIRK_POS_VAR_RNG_TARG_S)) { mod++; } return mod; }
public int getMediumRangeModifier() { int mod = 2; if (hasAbility(OptionsConstants.GUNNERY_RANGE_MASTER, Crew.RANGEMASTER_MEDIUM)) { mod = 0; } if (hasAbility(OptionsConstants.GUNNERY_SNIPER) && (mod > 0)) { mod = mod / 2; } if (hasQuirk(OptionsConstants.QUIRK_POS_IMP_TARG_M)) { mod--; } if (hasQuirk(OptionsConstants.QUIRK_NEG_POOR_TARG_M)) { mod++; } return mod; }
public int getShortRangeModifier() { int mod = 0; if (hasAbility(OptionsConstants.GUNNERY_RANGE_MASTER, Crew.RANGEMASTER_MEDIUM)) { mod = 2; } if (hasAbility(OptionsConstants.GUNNERY_RANGE_MASTER, Crew.RANGEMASTER_LONG)) { mod = 4; } if (hasAbility(OptionsConstants.GUNNERY_RANGE_MASTER, Crew.RANGEMASTER_EXTREME)) { mod = 6; } if (hasAbility(OptionsConstants.GUNNERY_SNIPER) && (mod > 0)) { mod = mod / 2; } if (hasQuirk(OptionsConstants.QUIRK_POS_IMP_TARG_S)) { mod--; } if (hasQuirk(OptionsConstants.QUIRK_NEG_POOR_TARG_S)) { mod++; } if (hasQuirk(OptionsConstants.QUIRK_POS_VAR_RNG_TARG_L)) { mod++; } if (hasQuirk(OptionsConstants.QUIRK_POS_VAR_RNG_TARG_S)) { mod--; } return mod; }
public static List<Integer> getValidFacingChanges(final Entity shooter) { // figure out all valid twists or turret turns // mechs can turn: // one left, one right unless he has "no torso twist" quirk or is on the ground // two left, two right if he has "extended torso twist" quirk // vehicles and turrets can turn any direction unless he has no turret final List<Integer> validFacingChanges = new ArrayList<>(); if (((Entity.ETYPE_MECH & shooter.getEntityType()) > 0) && !shooter.hasQuirk(OptionsConstants.QUIRK_NEG_NO_TWIST) && !shooter.hasFallen()) { validFacingChanges.add(1); validFacingChanges.add(-1); if (shooter.hasQuirk(OptionsConstants.QUIRK_POS_EXT_TWIST)) { validFacingChanges.add(2); validFacingChanges.add(-2); } } else if (shooter instanceof Tank && !((Tank) shooter).hasNoTurret()) { validFacingChanges.add(1); validFacingChanges.add(-1); validFacingChanges.add(2); validFacingChanges.add(-2); validFacingChanges.add(3); } return validFacingChanges; }
/** * calculate any changes to the PSR modifier for entering difficult terrain */ private void adjustDifficultTerrainPSRModifier(PilotingRollData psr) { if (hasQuirk(OptionsConstants.QUIRK_POS_EASY_PILOT) && (getCrew().getPiloting() > 3)) { psr.addModifier(-1, "easy to pilot"); } if (hasQuirk(OptionsConstants.QUIRK_NEG_UNBALANCED)) { psr.addModifier(+1, "unbalanced"); } }
/** * @return the initiative bonus this Entity grants for quirks */ public int getQuirkIniBonus() { // command battlemech and and battle computer are not cumulative if (hasQuirk(OptionsConstants.QUIRK_POS_BATTLE_COMP) && !getCrew().isDead() && !getCrew().isUnconscious()) { return 2; } else if (hasQuirk(OptionsConstants.QUIRK_POS_COMMAND_MECH) && !getCrew().isDead() && !getCrew().isUnconscious()) { return 1; } return 0; }
@Override public TargetRoll getAllMods(Person tech) { TargetRoll mods = new TargetRoll(getDifficulty(), "difficulty"); if(null != unit) { mods.append(unit.getSiteMod()); if(unit.getEntity().hasQuirk("easy_maintain")) { mods.addModifier(-1, "easy to maintain"); } else if(unit.getEntity().hasQuirk("difficult_maintain")) { mods.addModifier(1, "difficult to maintain"); } } return mods; }
private void updateDropJumpShipSupportNeeds(Entity en) { final String METHOD_NAME = "updateDropJumpShipSupportNeeds(Entity)"; double hours = 0; if (en instanceof Warship) { hours += 5000; } else if (en instanceof Jumpship) { hours += 800; } else if (en instanceof Dropship) { if (en.getWeight() >= 50000) { hours = Math.floor(en.getWeight() / 50) + 20; } else if (en.getWeight() >= 16000) { hours = Math.floor(en.getWeight() / 25) + 40; } else { hours = Math.floor(en.getWeight() / 10) + 80; } } if (getCampaign().getCampaignOptions().useQuirks()) { if (en.hasQuirk("easy_maintain")) { hours -= hours * 0.2; } else if (en.hasQuirk("difficult_maintain")) { hours += hours * 0.2; } } getLogger().log(getClass(), METHOD_NAME, LogLevel.DEBUG, "Unit " + en.getId() + " needs " + hours + " ship tech hours."); dropJumpShipSupportNeeded += hours; }
@Override public TargetRoll getAllMods(Person tech) { TargetRoll mods = new TargetRoll(getDifficulty(), "difficulty"); mods.append(oldUnit.getSiteMod()); if(oldUnit.getEntity().hasQuirk("easy_maintain")) { mods.addModifier(-1, "easy to maintain"); } else if(oldUnit.getEntity().hasQuirk("difficult_maintain")) { mods.addModifier(1, "difficult to maintain"); } if(customJob) { mods.addModifier(2, "custom job"); } return mods; }
int needed = 0; if (getCampaign().getCampaignOptions().useQuirks()) { if (en.hasQuirk("easy_maintain")) { getLogger().log(getClass(), METHOD_NAME, LogLevel.DEBUG, "Unit " + u.getName() + " is easy to maintain."); timeMult = 0.8; } else if (en.hasQuirk("difficult_maintain")) { getLogger().log(getClass(), METHOD_NAME, LogLevel.DEBUG, "Unit " + u.getName() +
private boolean isSubCommander(final Entity entity) { final int initBonus = entity.getHQIniBonus() + entity.getQuirkIniBonus(); //removed in IO + entity.getMDIniBonus() return entity.hasC3() || entity.hasTAG() || entity.hasBoostedC3() || entity.hasNovaCEWS() || entity.isUsingSpotlight() || entity.hasBAP() || entity.hasActiveECM() || entity.hasActiveECCM() || entity.hasQuirk(OptionsConstants.QUIRK_POS_IMPROVED_SENSORS) || entity.hasEiCockpit() || (0 < initBonus); }
if (hasQuirk(OptionsConstants.QUIRK_POS_IMPROVED_SENSORS)) { if (isClan()) { quirkBonus = 5;
if (entity.hasQuirk(OptionsConstants.QUIRK_NEG_NO_ARMS)) { return false;
if (hasQuirk(OptionsConstants.QUIRK_POS_IMPROVED_SENSORS)) { return !checkECM || !ComputeECM.isAffectedByECM(this, getPosition(),
if (ae.hasQuirk(OptionsConstants.QUIRK_NEG_NO_ARMS)) { return "No/minimal arms";
if (ce.hasQuirk(OptionsConstants.QUIRK_NEG_POOR_PERFORMANCE)) { String poorPerfMsg; if (ce.getMpUsedLastRound() < ce.getWalkMP()) {
if (hasQuirk(OptionsConstants.QUIRK_NEG_HARD_PILOT)) { roll.addModifier(+1, "hard to pilot");