megamek.common.weapons
Class MissileWeaponHandler

java.lang.Object
  extended by megamek.common.weapons.WeaponHandler
      extended by megamek.common.weapons.AmmoWeaponHandler
          extended by megamek.common.weapons.MissileWeaponHandler
All Implemented Interfaces:
java.io.Serializable, AttackHandler
Direct Known Subclasses:
ATMHandler, LRMHandler, LRMScatterableHandler, MRMHandler, NarcExplosiveHandler, NarcHandler, RLHandler, SRMHandler, StreakHandler, ThunderBoltWeaponHandler

public class MissileWeaponHandler
extends AmmoWeaponHandler

Author:
Sebastian Brocks
See Also:
Serialized Form

Field Summary
(package private)  boolean advancedAMS
           
(package private)  boolean amsEnganged
           
(package private)  int nSalvoBonus
           
(package private)  java.lang.String sSalvoType
           
 
Fields inherited from class megamek.common.weapons.AmmoWeaponHandler
ammo
 
Fields inherited from class megamek.common.weapons.WeaponHandler
ae, announcedEntityFiring, attackValue, bDirect, bGlancing, bMissed, bSalvo, damageType, game, generalDamageType, insertedAttacks, missed, nDamPerHit, nRange, nukeS2S, nweapons, roll, server, subjectId, target, throughFront, toHit, underWater, waa, weapon, wtype
 
Constructor Summary
MissileWeaponHandler(ToHitData t, WeaponAttackAction w, IGame g, Server s)
           
 
Method Summary
protected  int calcAttackValue()
          Calculate the attack value based on range
protected  int calcDamagePerHit()
          Calculate the damage per hit.
protected  int calcHits(java.util.Vector<Report> vPhaseReport)
          Calculate the number of hits
protected  int calcnCluster()
          Calculate the clustering of the hits
protected  boolean canDoDirectBlowDamage()
           
protected  int getAMSHitsMod(java.util.Vector<Report> vPhaseReport)
           
 boolean handle(IGame.Phase phase, java.util.Vector<Report> vPhaseReport)
          handle this weapons firing
protected  boolean handleSpecialMiss(Entity entityTarget, boolean targetInBuilding, Building bldg, java.util.Vector<Report> vPhaseReport)
           
protected  boolean isNemesisConfusable()
           
protected  boolean usesClusterTable()
          Does this attack use the cluster hit table?
 
Methods inherited from class megamek.common.weapons.AmmoWeaponHandler
checkAmmo, getNumberWeapons, useAmmo
 
Methods inherited from class megamek.common.weapons.WeaponHandler
addHeat, allShotsHit, announcedEntityFiring, cares, checkTerrain, doChecks, getAttackerId, getBracketingMultiplier, getCapMisMod, getWaa, handleBuildingDamage, handleClearDamage, handleEntityDamage, handleIgnitionDamage, insertAttacks, reportMiss, setAnnouncedEntityFiring, setDone, specialResolution
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

sSalvoType

java.lang.String sSalvoType

amsEnganged

boolean amsEnganged

nSalvoBonus

int nSalvoBonus

advancedAMS

boolean advancedAMS
Constructor Detail

MissileWeaponHandler

public MissileWeaponHandler(ToHitData t,
                            WeaponAttackAction w,
                            IGame g,
                            Server s)
Parameters:
t -
w -
g -
s -
Method Detail

calcHits

protected int calcHits(java.util.Vector<Report> vPhaseReport)
Description copied from class: WeaponHandler
Calculate the number of hits

Overrides:
calcHits in class WeaponHandler
Parameters:
vPhaseReport - - the Vector containing the phase report.
Returns:
an int containing the number of hits.

calcnCluster

protected int calcnCluster()
Description copied from class: WeaponHandler
Calculate the clustering of the hits

Overrides:
calcnCluster in class WeaponHandler
Returns:
a int value saying how much hits are in each cluster of damage.

calcDamagePerHit

protected int calcDamagePerHit()
Description copied from class: WeaponHandler
Calculate the damage per hit.

Overrides:
calcDamagePerHit in class WeaponHandler
Returns:
an int representing the damage dealt per hit.

calcAttackValue

protected int calcAttackValue()
Calculate the attack value based on range

Overrides:
calcAttackValue in class WeaponHandler
Returns:
an int representing the attack value at that range.

handleSpecialMiss

protected boolean handleSpecialMiss(Entity entityTarget,
                                    boolean targetInBuilding,
                                    Building bldg,
                                    java.util.Vector<Report> vPhaseReport)
Overrides:
handleSpecialMiss in class WeaponHandler
Returns:
a boolean value indicating wether or not this attack needs further calculating, like a missed shot hitting a building, or an AMS only shooting down some missiles.

getAMSHitsMod

protected int getAMSHitsMod(java.util.Vector<Report> vPhaseReport)

handle

public boolean handle(IGame.Phase phase,
                      java.util.Vector<Report> vPhaseReport)
Description copied from class: WeaponHandler
handle this weapons firing

Specified by:
handle in interface AttackHandler
Overrides:
handle in class WeaponHandler
Returns:
a boolean value indicating whether this should be kept or not

isNemesisConfusable

protected boolean isNemesisConfusable()

usesClusterTable

protected boolean usesClusterTable()
Description copied from class: WeaponHandler
Does this attack use the cluster hit table? necessary to determine how Aero damage should be applied

Overrides:
usesClusterTable in class WeaponHandler

canDoDirectBlowDamage

protected boolean canDoDirectBlowDamage()
Overrides:
canDoDirectBlowDamage in class WeaponHandler