@Override protected int calcHits(Vector<Report> vPhaseReport) { int shotsHit; int nMod = getClusterModifiers(true); switch (howManyShots) { case 1: shotsHit = 1; break; default: shotsHit = allShotsHit() ? howManyShots : Compute.missilesHit( howManyShots, nMod); Report r = new Report(3325); r.subject = subjectId; r.add(shotsHit); r.add(" shot(s) "); r.add(toHit.getTableDesc()); r.newlines = 0; vPhaseReport.addElement(r); r = new Report(3345); r.subject = subjectId; vPhaseReport.addElement(r); break; } bSalvo = true; return shotsHit; }
/** * Adds a weapon to this attack */ public void addWeapon(WeaponAttackAction attack) { final Entity entity = this.boardView1.game.getEntity(attack.getEntityId()); final WeaponType wtype = (WeaponType) entity.getEquipment( attack.getWeaponId()).getType(); final String roll = attack.toHit(this.boardView1.game).getValueAsString(); final String table = attack.toHit(this.boardView1.game).getTableDesc(); weaponDescs .add(wtype.getName() + Messages.getString("BoardView1.needs") + roll + " " + table); //$NON-NLS-1$ }
@Override protected int calcHits(Vector<Report> vPhaseReport) { // conventional infantry gets hit in one lump // BAs do one lump of damage per BA suit if ((target instanceof Infantry) && !(target instanceof BattleArmor)) { if (ae instanceof BattleArmor) { bSalvo = true; return ((BattleArmor) ae).getShootingStrength(); } return 1; } int hits = weapon.getCurrentShots(); if (!allShotsHit()) { hits = Compute.missilesHit(hits); } bSalvo = true; Report r = new Report(3325); r.subject = subjectId; r.add(hits); r.add(sSalvoType); r.add(toHit.getTableDesc()); r.newlines = 0; vPhaseReport.addElement(r); r = new Report(3345); r.subject = subjectId; vPhaseReport.addElement(r); return hits; }
@Override protected int calcHits(Vector<Report> vPhaseReport) { // conventional infantry gets hit in one lump // BAs can't mount LBXs if ((target instanceof Infantry) && !(target instanceof BattleArmor)) { return 1; } int shotMod = getClusterModifiers(true); shotMod -= 1; int shotsHit = allShotsHit() ? wtype.getRackSize() : Compute .missilesHit(wtype.getRackSize(), shotMod); Report r = new Report(3325); r.subject = subjectId; r.add(shotsHit); r.add(sSalvoType); r.add(toHit.getTableDesc()); r.newlines = 0; vPhaseReport.addElement(r); r = new Report(3345); r.subject = subjectId; vPhaseReport.addElement(r); bSalvo = true; return shotsHit; }
r.add(shotsHit); r.add(sSalvoType); r.add(toHit.getTableDesc()); r.newlines = 0; vPhaseReport.addElement(r);
r.add(shotsHit); r.add(sSalvoType); r.add(toHit.getTableDesc()); r.newlines = 0; vPhaseReport.addElement(r);
str = str + thd.getValue() + ", at range " + ent.getPosition().distance(entList.get(i).getPosition()) + thd.getTableDesc() + ";\n"; //$NON-NLS-1$
r.add(missilesHit); r.add(sSalvoType); r.add(toHit.getTableDesc()); r.newlines = 0; vPhaseReport.addElement(r);
r.add(""); } else { r.add(toHit.getTableDesc());
r.add(sSalvoType); r.newlines = 0; r.add(toHit.getTableDesc()); vPhaseReport.addElement(r); if (nHitsModifier != 0) {
r.add(missilesHit); r.add(sSalvoType); r.add(toHit.getTableDesc()); r.newlines = 0; vPhaseReport.addElement(r);
r.add(shotsHit); r.add(sSalvoType); r.add(toHit.getTableDesc()); r.newlines = 0; vPhaseReport.addElement(r);
r.add(shotsHit); r.add(sSalvoType); r.add(toHit.getTableDesc()); r.newlines = 0; vPhaseReport.addElement(r);
/** * Calculate the number of hits * * @param vPhaseReport * - the <code>Vector</code> containing the phase report. * @return an <code>int</code> containing the number of hits. */ protected int calcHits(Vector<Report> vPhaseReport) { // normal BA attacks (non-swarm, non single-trooper weapons) // do more than 1 hit if ((ae instanceof BattleArmor) && (weapon.getLocation() == BattleArmor.LOC_SQUAD) && !(weapon.isSquadSupportWeapon()) && !(ae.getSwarmTargetId() == target.getTargetId())) { bSalvo = true; int toReturn = allShotsHit() ? ((BattleArmor) ae) .getShootingStrength() : Compute .missilesHit(((BattleArmor) ae).getShootingStrength()); Report r = new Report(3325); r.newlines = 0; r.subject = subjectId; r.add(toReturn); r.add(" troopers "); r.add(toHit.getTableDesc()); vPhaseReport.add(r); return toReturn; } return 1; }
/** * slice 'em up with your vibroclaws */ public void vibroclawatt() { BAVibroClawAttackAction act = new BAVibroClawAttackAction(cen, target.getTargetType(), target.getTargetId()); ToHitData toHit = act.toHit(clientgui.getClient().getGame()); String title = Messages .getString( "PhysicalDisplay.BAVibroClawDialog.title", new Object[] { target.getDisplayName() }); //$NON-NLS-1$ String message = Messages .getString( "PhysicalDisplay.BAVibroClawDialog.message", new Object[] {//$NON-NLS-1$ toHit.getValueAsString(), new Double( Compute.oddsAbove( toHit.getValue(), ce().hasAbility(OptionsConstants.PILOT_APTITUDE_PILOTING))), toHit.getDesc(), ce().getVibroClaws() + toHit.getTableDesc() }); // Give the user to cancel the attack. if (clientgui.doYesNoDialog(title, message)) { disableButtons(); attacks.addElement(act); ready(); } }
/** * Thrash at the target, unless the player cancels the action. */ void thrash() { ThrashAttackAction act = new ThrashAttackAction(cen, target.getTargetType(), target.getTargetId()); ToHitData toHit = act.toHit(clientgui.getClient().getGame()); String title = Messages .getString( "PhysicalDisplay.TrashDialog.title", new Object[] { target.getDisplayName() }); //$NON-NLS-1$ String message = Messages .getString( "PhysicalDisplay.TrashDialog.message", new Object[] {//$NON-NLS-1$ toHit.getValueAsString(), new Double( Compute.oddsAbove( toHit.getValue(), ce().hasAbility(OptionsConstants.PILOT_APTITUDE_PILOTING))), toHit.getDesc(), ThrashAttackAction.getDamageFor(ce()) + toHit.getTableDesc() }); // Give the user to cancel the attack. if (clientgui.doYesNoDialog(title, message)) { disableButtons(); attacks.addElement(act); ready(); } }
r.add(missilesHit); r.add(sSalvoType); r.add(toHit.getTableDesc()); r.newlines = 0; vPhaseReport.addElement(r);
proto.getDesc(), ProtomechPhysicalAttackAction.getDamageFor( ce(), target) + proto.getTableDesc() }); if (clientgui.doYesNoDialog(title, message)) { disableButtons();
r.add(toHit.getTableDesc()); r.add(entityTarget.getLocationAbbr(hit)); vPhaseReport.addElement(r);
r.add(toHit.getTableDesc()); r.add(entityTarget.getLocationAbbr(hit)); vPhaseReport.addElement(r);