private void resolveGrappleAttack(PhysicalResult pr, int lastEntityId) {
resolveGrappleAttack(pr, lastEntityId, Entity.GRAPPLE_BOTH);
}
private void resolveGrappleAttack(PhysicalResult pr, int lastEntityId, int grappleSide) {
final GrappleAttackAction paa = (GrappleAttackAction) pr.aaa;
final Entity ae = game.getEntity(paa.getEntityId());
// PLEASE NOTE: buildings are *never* the target of a "push".
final Entity te = game.getEntity(paa.getTargetId());
// get roll and ToHitData from the PhysicalResult
int roll = pr.roll;
final ToHitData toHit = pr.toHit;
Report r;
// same method as push, for counterattacks
if (pr.pushBackResolved) {
return;
}
if ((te.getGrappled() != Entity.NONE) || (ae.getGrappled() != Entity.NONE)) {
toHit.addModifier(TargetRoll.IMPOSSIBLE, "Already Grappled");
}
if (lastEntityId != paa.getEntityId()) {
// who is making the attack
r = new Report(4005);
r.subject = ae.getId();
r.addDesc(ae);
addReport(r);