Package megamek.common.weapons.handlers
Class AmmoWeaponHandler
java.lang.Object
megamek.common.weapons.handlers.WeaponHandler
megamek.common.weapons.handlers.AmmoWeaponHandler
- All Implemented Interfaces:
Serializable
,AttackHandler
- Direct Known Subclasses:
ACFlechetteHandler
,ACWeaponHandler
,AR10Handler
,ArtilleryCannonWeaponHandler
,ArtilleryWeaponIndirectFireHandler
,BarracudaHandler
,BATaserHandler
,BPodHandler
,CapitalMissileHandler
,ChemicalLaserHandler
,FluidGunCoolHandler
,GRHandler
,HAGWeaponHandler
,KillerWhaleHandler
,LBXHandler
,MantaRayHandler
,MekMortarAirburstHandler
,MekMortarAntiPersonnelHandler
,MekMortarFlareHandler
,MekMortarHandler
,MekMortarSmokeHandler
,MekTaserHandler
,MGHandler
,MicroBombHandler
,MissileMineClearanceHandler
,MissileWeaponHandler
,NailRivetGunHandler
,PiranhaHandler
,PlasmaCannonHandler
,PlasmaRifleHandler
,PopUpMineLauncherHandler
,RifleWeaponHandler
,ScreenLauncherHandler
,StingrayHandler
,SwordfishHandler
,UltraWeaponHandler
,VehicleFlamerCoolHandler
,VehicleFlamerHandler
,VGLWeaponHandler
,WhiteSharkHandler
- See Also:
-
Field Summary
FieldsFields inherited from class megamek.common.weapons.handlers.WeaponHandler
advancedPD, ammoType, amsBayEngaged, amsBayEngagedCap, amsBayEngagedMissile, amsEngaged, announcedEntityFiring, apdsEngaged, attackingEntity, attackValue, 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, numWeapons, numWeaponsHit, originalAV, parentBayHandler, pdBayEngaged, pdBayEngagedCap, pdBayEngagedMissile, pdOverheated, roll, secondShot, sSalvoType, subjectId, target, throughFront, toHit, typeName, underWater, weapon, weaponAttackAction, weaponType
-
Constructor Summary
ConstructorsConstructorDescriptionAmmoWeaponHandler
(ToHitData t, WeaponAttackAction w, Game g, TWGameManager m) -
Method Summary
Modifier and TypeMethodDescriptionprotected void
protected boolean
doAmmoFeedProblemCheck
(Vector<Report> vPhaseReport) Carry out an 'ammo feed problems' check on the weapon.protected boolean
protected void
explodeRoundInBarrel
(Vector<Report> vPhaseReport) Worker function that explodes a round in the barrel of the attack's weaponprotected int
For ammo weapons, this number can be less than the full number if the amount of ammo is not high enough.protected void
useAmmo()
Methods inherited from class megamek.common.weapons.handlers.WeaponHandler
absorbBuildingDamage, addGlancingBlowReports, addHeat, allShotsHit, announcedEntityFiring, applyGlancingBlowModifier, applyGlancingBlowModifier, calcAeroDamage, calcAttackValue, calcCapMissileAMSMod, calcCounterAV, calcDamagePerHit, calcHits, calculateNumCluster, calculateNumClusterAero, canEngageCapitalMissile, cares, checkLI, checkPDConditions, checkTerrain, getAttacker, getAttackerId, getBracketingMultiplier, getCapMisMod, getCapMissileAMSMod, getClusterModifiers, getCounterAV, getFireTNRoll, getLargeCraftHeat, getParentBayHandler, getSalvoBonus, getTotalGlancingBlowFactor, getWeaponAttackAction, handle, handleArtilleryDriftMarker, handleBuildingDamage, handleClearDamage, handleClearDamage, handleEntityDamage, handleIgnitionDamage, handlePartialCoverHit, handleSpecialMiss, initHit, insertAttacks, isLowProfileGlancingBlow, isStrafing, isStrafingFirstShot, isThunderBolt, reportMiss, reportMiss, restore, setAMSBayReportingFlag, setAnnouncedEntityFiring, setDone, setGlancingBlowFlags, setParentBayHandler, setPDBayReportingFlag, setStrafing, setStrafingFirstShot, specialResolution, unitGainsPartialCoverFromWater, unitStickingOutOfBuilding, usesClusterTable
-
Field Details
-
ammo
-
-
Constructor Details
-
AmmoWeaponHandler
public AmmoWeaponHandler(ToHitData t, WeaponAttackAction w, Game g, TWGameManager m) throws EntityLoadingException - Throws:
EntityLoadingException
-
-
Method Details
-
useAmmo
protected void useAmmo()- Overrides:
useAmmo
in classWeaponHandler
-
checkAmmo
protected void checkAmmo() -
getNumberWeapons
protected int getNumberWeapons()For ammo weapons, this number can be less than the full number if the amount of ammo is not high enough.- Overrides:
getNumberWeapons
in classWeaponHandler
- Returns:
- the number of weapons of this type firing (for squadron weapon groups)
-
doChecks
- Overrides:
doChecks
in classWeaponHandler
- Parameters:
vPhaseReport
- - AVector
containing the phase report.- Returns:
- a
boolean
value indicating whether the attack misses because of a failed check.
-
doAmmoFeedProblemCheck
Carry out an 'ammo feed problems' check on the weapon. Return true if it blew up.- Overrides:
doAmmoFeedProblemCheck
in classWeaponHandler
-
explodeRoundInBarrel
Worker function that explodes a round in the barrel of the attack's weapon
-