Package megamek.common.actions
Class ClubAttackAction
java.lang.Object
megamek.common.actions.AbstractEntityAction
megamek.common.actions.AbstractAttackAction
megamek.common.actions.PhysicalAttackAction
megamek.common.actions.ClubAttackAction
- All Implemented Interfaces:
Serializable,AttackAction,EntityAction
The attacker makes a club attack on the target. This also covers mek melee weapons like hatchets.
- Since:
- April 3, 2002, 2:37 PM
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionClubAttackAction(int entityId, int targetType, int targetId, MiscMounted club, int aimTable, boolean zweihandering) Creates a new club attackClubAttackAction(int entityId, int targetId, MiscMounted club, int aimTable) Creates new ClubAttackAction -
Method Summary
Modifier and TypeMethodDescriptiongetClub()static intgetDamageFor(Entity entity, MiscMounted club, boolean targetInfantry, boolean zweihandering) Damage for the club attackstatic intgetHitModFor(MiscType clubType) Modifiers to the to-hit roll for specific weaponsbooleanvoidsetClub(MiscMounted club) static ToHitDatatoHit(Game game, int attackerId, Targetable target, Mounted<?> club, int aimTable, boolean zweihandering) To-hit number for the specified club to hittoSummaryString(Game game) Returns a short one-line description of the action that is used in the UI, e.g.Methods inherited from class megamek.common.actions.PhysicalAttackAction
isConvertedQuadVee, setCommonModifiers, toHitIsImpossibleMethods inherited from class megamek.common.actions.AbstractAttackAction
getEntity, getEntity, getTarget, getTargetId, getTargetType, nightModifiers, setTargetId, setTargetType, toAccessibilityDescription, toStringMethods inherited from class megamek.common.actions.AbstractEntityAction
getEntityIdMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface megamek.common.actions.EntityAction
getEntityId
-
Constructor Details
-
ClubAttackAction
Creates new ClubAttackAction -
ClubAttackAction
public ClubAttackAction(int entityId, int targetType, int targetId, MiscMounted club, int aimTable, boolean zweihandering) Creates a new club attack- Parameters:
entityId- - id of entity performing the attacktargetType- - type of targettargetId- - id of targetclub- - TheMountedof the weapon doing the attackzweihandering- - a boolean indicating whether the attacker is zweihandering (using both hands)
-
-
Method Details
-
getDamageFor
public static int getDamageFor(Entity entity, MiscMounted club, boolean targetInfantry, boolean zweihandering) Damage for the club attack- Parameters:
entity- - the entity performing the attackclub- - TheMountedof the weapon doing the attacktargetInfantry- - whether this attack targets infantryzweihandering- - a boolean indicating whether the attacker is zweihandering (using both hands)- Returns:
- an integer of the damage dealt
-
getHitModFor
Modifiers to the to-hit roll for specific weapons- Parameters:
clubType- A physical weapon- Returns:
- The modifier to hit with the weapon
-
isZweihandering
public boolean isZweihandering()- Returns:
- true if the entity is zweihandering (attacking with both hands)
-
toHit
-
toHit
public static ToHitData toHit(Game game, int attackerId, Targetable target, Mounted<?> club, int aimTable, boolean zweihandering) To-hit number for the specified club to hit- Parameters:
game- The currentGameattackerId- - attacker idtarget-Targetableof the targetclub- -Mountedof the weaponzweihandering- - a boolean indicating whether the attacker is zweihandering (using both hands)
-
getClub
-
setClub
-
toSummaryString
Description copied from interface:EntityActionReturns a short one-line description of the action that is used in the UI, e.g. on attack arrows in the BoardView and in the action summary inTurnDetailsOverlay.- Parameters:
game- The game object to get information from- Returns:
- A short String describing the action
- See Also:
-