|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectmegamek.common.weapons.WeaponHandler
public class WeaponHandler
| Field Summary | |
|---|---|
protected Entity |
ae
|
protected boolean |
announcedEntityFiring
|
protected int |
attackValue
|
protected boolean |
bDirect
|
protected boolean |
bGlancing
|
protected boolean |
bMissed
|
protected boolean |
bSalvo
|
protected Server.DamageType |
damageType
|
protected IGame |
game
|
protected int |
generalDamageType
|
protected java.util.Vector<java.lang.Integer> |
insertedAttacks
|
protected boolean |
missed
|
protected int |
nDamPerHit
|
protected int |
nRange
|
protected boolean |
nukeS2S
|
protected int |
nweapons
|
int |
roll
|
protected Server |
server
|
protected int |
subjectId
|
protected Targetable |
target
|
protected boolean |
throughFront
|
ToHitData |
toHit
|
protected boolean |
underWater
|
WeaponAttackAction |
waa
|
protected Mounted |
weapon
|
protected WeaponType |
wtype
|
| Constructor Summary | |
|---|---|
protected |
WeaponHandler()
|
|
WeaponHandler(ToHitData t,
WeaponAttackAction w,
IGame g,
Server s)
|
| Method Summary | |
|---|---|
protected void |
addHeat()
|
protected boolean |
allShotsHit()
|
boolean |
announcedEntityFiring()
|
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()
|
boolean |
cares(IGame.Phase phase)
Do we care about the specified phase? |
int |
checkTerrain(int nDamage,
Entity entityTarget,
java.util.Vector<Report> vPhaseReport)
|
protected boolean |
doChecks(java.util.Vector<Report> vPhaseReport)
|
int |
getAttackerId()
return the int Id of the attacking Entity |
protected double |
getBracketingMultiplier()
adjustment factor on attack value for fighter squadrons |
protected int |
getCapMisMod()
|
protected int |
getNumberWeapons()
|
WeaponAttackAction |
getWaa()
|
boolean |
handle(IGame.Phase phase,
java.util.Vector<Report> vPhaseReport)
handle this weapons firing |
protected void |
handleBuildingDamage(java.util.Vector<Report> vPhaseReport,
Building bldg,
int nDamage,
Coords coords)
|
protected void |
handleClearDamage(java.util.Vector<Report> vPhaseReport,
Building bldg,
int nDamage)
|
protected void |
handleEntityDamage(Entity entityTarget,
java.util.Vector<Report> vPhaseReport,
Building bldg,
int hits,
int nCluster,
int bldgAbsorbs)
Handle damage against an entity, called once per hit by default. |
protected void |
handleIgnitionDamage(java.util.Vector<Report> vPhaseReport,
Building bldg,
int hits)
|
protected boolean |
handleSpecialMiss(Entity entityTarget,
boolean targetInBuilding,
Building bldg,
java.util.Vector<Report> vPhaseReport)
|
protected void |
insertAttacks(IGame.Phase phase,
java.util.Vector<Report> vPhaseReport)
Insert any additionaly attacks that should occur before this attack |
protected void |
reportMiss(java.util.Vector<Report> vPhaseReport)
|
void |
setAnnouncedEntityFiring(boolean announcedEntityFiring)
|
protected void |
setDone()
|
protected boolean |
specialResolution(java.util.Vector<Report> vPhaseReport,
Entity entityTarget)
special resolution, like minefields and arty |
protected void |
useAmmo()
|
protected boolean |
usesClusterTable()
Does this attack use the cluster hit table? |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public ToHitData toHit
public WeaponAttackAction waa
public int roll
protected IGame game
protected transient Server server
protected boolean bMissed
protected boolean bSalvo
protected boolean bGlancing
protected boolean bDirect
protected boolean nukeS2S
protected WeaponType wtype
protected Mounted weapon
protected Entity ae
protected Targetable target
protected int subjectId
protected int nRange
protected int nDamPerHit
protected int attackValue
protected boolean throughFront
protected boolean underWater
protected boolean announcedEntityFiring
protected boolean missed
protected Server.DamageType damageType
protected int generalDamageType
protected java.util.Vector<java.lang.Integer> insertedAttacks
protected int nweapons
| Constructor Detail |
|---|
protected WeaponHandler()
public WeaponHandler(ToHitData t,
WeaponAttackAction w,
IGame g,
Server s)
| Method Detail |
|---|
public int getAttackerId()
int Id of the attacking Entity
getAttackerId in interface AttackHandlerpublic boolean cares(IGame.Phase phase)
cares in interface AttackHandlerprotected boolean doChecks(java.util.Vector<Report> vPhaseReport)
vPhaseReport - - A Vector containing the phasereport.
boolean value indicating wether or not the
attack misses because of a failed check.
protected boolean handleSpecialMiss(Entity entityTarget,
boolean targetInBuilding,
Building bldg,
java.util.Vector<Report> vPhaseReport)
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.protected int calcHits(java.util.Vector<Report> vPhaseReport)
vPhaseReport - - the Vector containing the phase
report.
int containing the number of hits.protected int calcnCluster()
int value saying how much hits are in each
cluster of damage.
public boolean handle(IGame.Phase phase,
java.util.Vector<Report> vPhaseReport)
handle in interface AttackHandlerboolean value indicating whether this should be
kept or notprotected int calcDamagePerHit()
int representing the damage dealt per hit.protected int calcAttackValue()
int representing the attack value at that range.protected double getBracketingMultiplier()
protected int getCapMisMod()
protected void handleEntityDamage(Entity entityTarget,
java.util.Vector<Report> vPhaseReport,
Building bldg,
int hits,
int nCluster,
int bldgAbsorbs)
entityTarget - vPhaseReport - bldg - hits - nCluster - bldgAbsorbs -
protected void handleIgnitionDamage(java.util.Vector<Report> vPhaseReport,
Building bldg,
int hits)
protected void handleClearDamage(java.util.Vector<Report> vPhaseReport,
Building bldg,
int nDamage)
protected void handleBuildingDamage(java.util.Vector<Report> vPhaseReport,
Building bldg,
int nDamage,
Coords coords)
protected boolean allShotsHit()
protected void reportMiss(java.util.Vector<Report> vPhaseReport)
protected void useAmmo()
protected void setDone()
protected void addHeat()
protected boolean usesClusterTable()
protected boolean specialResolution(java.util.Vector<Report> vPhaseReport,
Entity entityTarget)
vPhaseReport - - a Vector containing the phase reportentityTarget - - the Entity targeted, or
null, if no Entity targeted
public boolean announcedEntityFiring()
announcedEntityFiring in interface AttackHandlerpublic void setAnnouncedEntityFiring(boolean announcedEntityFiring)
setAnnouncedEntityFiring in interface AttackHandlerpublic WeaponAttackAction getWaa()
getWaa in interface AttackHandler
public int checkTerrain(int nDamage,
Entity entityTarget,
java.util.Vector<Report> vPhaseReport)
protected boolean canDoDirectBlowDamage()
protected void insertAttacks(IGame.Phase phase,
java.util.Vector<Report> vPhaseReport)
protected int getNumberWeapons()
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||