Package megamek.common.weapons.infantry
Class InfantryWeaponHandler
java.lang.Object
megamek.common.weapons.handlers.WeaponHandler
megamek.common.weapons.infantry.InfantryWeaponHandler
- All Implemented Interfaces:
Serializable,AttackHandler
- Direct Known Subclasses:
InfantryDisposableWeaponHandler,InfantryHeatWeaponHandler
- Since:
- Sept 24, 2004
- See Also:
-
Field Summary
Fields 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, weaponEntity, weaponType -
Constructor Summary
ConstructorsConstructorDescriptionInfantryWeaponHandler(ToHitData toHitData, WeaponAttackAction weaponAttackAction, Game game, TWGameManager twGameManager) -
Method Summary
Modifier and TypeMethodDescriptionprotected intCalculate the attack value based on rangeprotected intCalculate the damage per hit.protected intCalculate the number of hitsstatic doublecalculateBaseDamage(Entity ae, Mounted<?> weapon, WeaponType weaponType) Utility function to calculate variable damage based only on the firing entity.protected intCalculate the clustering of the hitsprotected intcalculateNumClusterAero(Entity entityTarget) protected voidWorker function that initializes the actual hit, including a hit location and various other properties.voiduseAmmo()Methods inherited from class megamek.common.weapons.handlers.WeaponHandler
absorbBuildingDamage, addGlancingBlowReports, addHeat, allShotsHit, announcedEntityFiring, applyGlancingBlowModifier, applyGlancingBlowModifier, calcAeroDamage, calcCapMissileAMSMod, calcCounterAV, canEngageCapitalMissile, cares, checkLI, checkPDConditions, checkTerrain, doAmmoFeedProblemCheck, doChecks, getAttacker, getAttackerId, getBracketingMultiplier, getCapMisMod, getCapMissileAMSMod, getClusterModifiers, getCounterAV, getFireTNRoll, getLargeCraftHeat, getNumberWeapons, getParentBayHandler, getSalvoBonus, getTotalGlancingBlowFactor, getWeaponAttackAction, handle, handleArtilleryDriftMarker, handleBuildingDamage, handleClearDamage, handleClearDamage, handleEntityDamage, handleIgnitionDamage, handlePartialCoverHit, handleSpecialMiss, insertAttacks, isLowProfileGlancingBlow, isStrafing, isStrafingFirstShot, isThunderBolt, reportMiss, reportMiss, restore, setAMSBayReportingFlag, setAnnouncedEntityFiring, setDone, setGlancingBlowFlags, setParentBayHandler, setPDBayReportingFlag, setStrafing, setStrafingFirstShot, specialResolution, unitGainsPartialCoverFromWater, unitStickingOutOfBuilding, usesClusterTableMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface megamek.common.weapons.handlers.AttackHandler
getBuildingDamageAdjustment, producesReportThisPhase
-
Constructor Details
-
InfantryWeaponHandler
public InfantryWeaponHandler(ToHitData toHitData, WeaponAttackAction weaponAttackAction, Game game, TWGameManager twGameManager) throws EntityLoadingException - Throws:
EntityLoadingException
-
-
Method Details
-
calcDamagePerHit
protected int calcDamagePerHit()Description copied from class:WeaponHandlerCalculate the damage per hit.- Overrides:
calcDamagePerHitin classWeaponHandler- Returns:
- an
intrepresenting the damage dealt per hit.
-
calculateNumCluster
protected int calculateNumCluster()Description copied from class:WeaponHandlerCalculate the clustering of the hits- Overrides:
calculateNumClusterin classWeaponHandler- Returns:
- a
intvalue saying how much hits are in each cluster of damage.
-
calcHits
Description copied from class:WeaponHandlerCalculate the number of hits- Overrides:
calcHitsin classWeaponHandler- Parameters:
vPhaseReport- - theVectorcontaining the phase report.- Returns:
- an
intcontaining the number of hits.
-
calculateNumClusterAero
- Overrides:
calculateNumClusterAeroin classWeaponHandler
-
calcAttackValue
protected int calcAttackValue()Description copied from class:WeaponHandlerCalculate the attack value based on range- Overrides:
calcAttackValuein classWeaponHandler- Returns:
- an
intrepresenting the attack value at that range.
-
useAmmo
public void useAmmo()- Overrides:
useAmmoin classWeaponHandler
-
calculateBaseDamage
Utility function to calculate variable damage based only on the firing entity. -
initHit
Description copied from class:WeaponHandlerWorker function that initializes the actual hit, including a hit location and various other properties.- Overrides:
initHitin classWeaponHandler- Parameters:
entityTarget- Entity being hit.
-