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 voidprotected booleandoAmmoFeedProblemCheck(Vector<Report> vPhaseReport) Carry out an 'ammo feed problems' check on the weapon.protected booleanprotected voidexplodeRoundInBarrel(Vector<Report> vPhaseReport) Worker function that explodes a round in the barrel of the attack's weaponprotected intFor ammo weapons, this number can be less than the full number if the amount of ammo is not high enough.protected voiduseAmmo()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:
useAmmoin 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:
getNumberWeaponsin classWeaponHandler- Returns:
- the number of weapons of this type firing (for squadron weapon groups)
-
doChecks
- Overrides:
doChecksin classWeaponHandler- Parameters:
vPhaseReport- - AVectorcontaining the phase report.- Returns:
- a
booleanvalue 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:
doAmmoFeedProblemCheckin classWeaponHandler
-
explodeRoundInBarrel
Worker function that explodes a round in the barrel of the attack's weapon
-