Package megamek.common.weapons
Class CapitalMissileBearingsOnlyHandler
java.lang.Object
megamek.common.weapons.WeaponHandler
megamek.common.weapons.BayWeaponHandler
megamek.common.weapons.AmmoBayWeaponHandler
megamek.common.weapons.CapitalMissileBearingsOnlyHandler
- All Implemented Interfaces:
Serializable
,AttackHandler
- Since:
- Sep 24, 2004
- See Also:
-
Field Summary
Fields inherited from class megamek.common.weapons.WeaponHandler
advancedPD, ae, amsBayEngaged, amsBayEngagedCap, amsBayEngagedMissile, amsEngaged, announcedEntityFiring, apdsEngaged, attackValue, atype, bDirect, bGlancing, bLowProfileGlancing, bMissed, bSalvo, calcDmgPerHitReport, CapMissileAMSMod, CapMissileArmor, CapMissileMissed, CounterAV, damageType, firstHit, game, gameManager, generalDamageType, hit, insertedAttacks, isJammed, isStrafing, isStrafingFirstShot, missed, nDamPerHit, nRange, nSalvoBonus, nukeS2S, numRapidFireHits, nweapons, nweaponsHit, originalAV, parentBayHandler, pdBayEngaged, pdBayEngagedCap, pdBayEngagedMissile, pdOverheated, roll, secondShot, sSalvoType, subjectId, target, throughFront, toHit, typeName, underWater, waa, weapon, wtype
-
Constructor Summary
ConstructorsModifierConstructorDescriptionprotected
This constructor can only be used for deserialization. -
Method Summary
Modifier and TypeMethodDescriptionprotected int
Calculate the attack value based on range This needs to do additional work for Weapon Bays with ammo.protected int
Calculates the to-hit penalty inflicted on a capital missile attack by point defense fire this should return 0 unless this is a capital missile attack (otherwise, reporting and to-hit get screwed up)protected int
Calculate the damage per hit.protected boolean
canEngageCapitalMissile
(WeaponMounted counter) Checks to see if this point defense/AMS bay can engage a capital missile This should return true.boolean
Do we care about the specified phase?void
Find the available targets within sensor range.void
convertHexTargetToEntityTarget
(Vector<Report> vPhaseReport) Deprecated.The parameter isn't used so replacing with version without the parameter.protected int
protected int
getCritMod
(AmmoType ammoType) protected void
boolean
Sigh, according to the ruling linked below, when weapon bays are fired at ground targets, they should make one to-hit roll, but the AV of each weapon should be applied separately as damage - that needs a special handlerprotected boolean
handleSpecialMiss
(Entity entityTarget, boolean bldgDamagedOnMiss, Building bldg, Vector<Report> vPhaseReport) protected int
Calculate the starting armor value of a flight of Capital Missiles Used for Aero Sanity.protected void
Sets the appropriate AMS Bay reporting flag depending on what type of missile this isprotected void
Sets the appropriate PD Bay reporting flag depending on what type of missile this isprotected double
updateAVforAmmo
(double currentAttackValue, AmmoType ammoType, WeaponType bayWeaponType, int range, int wId) protected void
useAmmo()
Methods inherited from class megamek.common.weapons.BayWeaponHandler
addHeat, handleAeroSanity
Methods inherited from class megamek.common.weapons.WeaponHandler
absorbBuildingDamage, addGlancingBlowReports, allShotsHit, announcedEntityFiring, applyGlancingBlowModifier, applyGlancingBlowModifier, calcAeroDamage, calcCounterAV, calcHits, calcnCluster, calcnClusterAero, checkLI, checkPDConditions, checkTerrain, doAmmoFeedProblemCheck, doChecks, getAttacker, getAttackerId, getBracketingMultiplier, getCapMissileAMSMod, getClusterModifiers, getCounterAV, getFireTNRoll, getLargeCraftHeat, getNumberWeapons, getParentBayHandler, getSalvoBonus, getTotalGlancingBlowFactor, getWaa, handleArtilleryDriftMarker, handleBuildingDamage, handleClearDamage, handleClearDamage, handleEntityDamage, handleIgnitionDamage, handlePartialCoverHit, initHit, insertAttacks, isLowProfileGlancingBlow, isStrafing, isStrafingFirstShot, isTbolt, reportMiss, reportMiss, restore, setAnnouncedEntityFiring, setDone, setGlancingBlowFlags, setParentBayHandler, setStrafing, setStrafingFirstShot, specialResolution, unitGainsPartialCoverFromWater, unitStickingOutOfBuilding, usesClusterTable
-
Constructor Details
-
CapitalMissileBearingsOnlyHandler
protected CapitalMissileBearingsOnlyHandler()This constructor can only be used for deserialization. -
CapitalMissileBearingsOnlyHandler
public CapitalMissileBearingsOnlyHandler(ToHitData t, WeaponAttackAction w, Game g, TWGameManager m)
-
-
Method Details
-
cares
Description copied from class:WeaponHandler
Do we care about the specified phase?- Specified by:
cares
in interfaceAttackHandler
- Overrides:
cares
in classWeaponHandler
-
getMountedAmmo
protected void getMountedAmmo() -
useAmmo
protected void useAmmo()- Overrides:
useAmmo
in classWeaponHandler
-
handle
Description copied from class:BayWeaponHandler
Sigh, according to the ruling linked below, when weapon bays are fired at ground targets, they should make one to-hit roll, but the AV of each weapon should be applied separately as damage - that needs a special handler- Specified by:
handle
in interfaceAttackHandler
- Overrides:
handle
in classBayWeaponHandler
- Returns:
- a
boolean
value indicating whether this should be kept or not
-
convertHexTargetToEntityTarget
@Deprecated(since="0.50.05") public void convertHexTargetToEntityTarget(Vector<Report> vPhaseReport) Deprecated.The parameter isn't used so replacing with version without the parameter. -
convertHexTargetToEntityTarget
public void convertHexTargetToEntityTarget()Find the available targets within sensor range. Bearings-only missiles scan within the nose arc and target the closest large craft within the preset range band. If none are found, it targets the closest small craft. -
handleSpecialMiss
protected boolean handleSpecialMiss(Entity entityTarget, boolean bldgDamagedOnMiss, Building bldg, Vector<Report> vPhaseReport) - Overrides:
handleSpecialMiss
in classWeaponHandler
- Returns:
- a
boolean
value indicating whether or not this attack needs further calculating, like a missed shot hitting a building, or an AMS only shooting down some missiles.
-
canEngageCapitalMissile
Checks to see if this point defense/AMS bay can engage a capital missile This should return true. Only when handling capital missile attacks can this be false.- Overrides:
canEngageCapitalMissile
in classWeaponHandler
-
setAMSBayReportingFlag
protected void setAMSBayReportingFlag()Sets the appropriate AMS Bay reporting flag depending on what type of missile this is- Overrides:
setAMSBayReportingFlag
in classWeaponHandler
-
setPDBayReportingFlag
protected void setPDBayReportingFlag()Sets the appropriate PD Bay reporting flag depending on what type of missile this is- Overrides:
setPDBayReportingFlag
in classWeaponHandler
-
calcAttackValue
protected int calcAttackValue()Description copied from class:AmmoBayWeaponHandler
Calculate the attack value based on range This needs to do additional work for Weapon Bays with ammo. I need to use the ammo within this function because I may run out of ammo while going through the loop Sine this function is called in the WeaponHandler constructor it should be ok to use the ammo here- Overrides:
calcAttackValue
in classAmmoBayWeaponHandler
- Returns:
- an
int
representing the attack value at that range.
-
calcDamagePerHit
protected int calcDamagePerHit()Calculate the damage per hit.- Overrides:
calcDamagePerHit
in classWeaponHandler
- Returns:
- an
int
representing the damage dealt per hit.
-
calcCapMissileAMSMod
protected int calcCapMissileAMSMod()Description copied from class:WeaponHandler
Calculates the to-hit penalty inflicted on a capital missile attack by point defense fire this should return 0 unless this is a capital missile attack (otherwise, reporting and to-hit get screwed up)- Overrides:
calcCapMissileAMSMod
in classWeaponHandler
-
initializeCapMissileArmor
protected int initializeCapMissileArmor()Calculate the starting armor value of a flight of Capital Missiles Used for Aero Sanity. This is done in calcAttackValue() otherwise- Overrides:
initializeCapMissileArmor
in classBayWeaponHandler
-
getCapMisMod
protected int getCapMisMod()- Overrides:
getCapMisMod
in classWeaponHandler
-
getCritMod
-
updateAVforAmmo
protected double updateAVforAmmo(double currentAttackValue, AmmoType ammoType, WeaponType bayWeaponType, int range, int wId) - Overrides:
updateAVforAmmo
in classAmmoBayWeaponHandler
-