int damage = (int)Math.ceil(entity.getWeight() / 10.0);
int damage = Compute.getAffaDamageFor(entity);
    private void doEntityDisplacement(Entity entity, Coords src, Coords dest,    PilotingRollData roll) {        final Hex srcHex = game.board.getHex(src);        final Hex destHex = game.board.getHex(dest);        final int direction = src.direction(dest);        // Handle null hexes.        if ( srcHex == null || destHex == null ) {            System.err.println( "Can not displace " + entity.getShortName() +                                " from " + src +                                " to " + dest + "." );        }        int fallElevation = entity.elevationOccupied(srcHex) - entity.elevationOccupied(destHex);        Entity violation =Compute.stackingViolation(game, entity.getId(), dest);        // can't fall upwards        if (fallElevation < 0) {            fallElevation = 0;        }        // if destination is empty, this could be easy...        if (violation == null) {            if (fallElevation < 2) {                // no cliff: move and roll normally                phaseReport.append(entity.getDisplayName()                ).append( " is displaced into hex "                ).append( dest.getBoardNum() ).append( ".\n");                entity.setPosition(dest);                doEntityDisplacementMinefieldCheck(entity, src, dest);                doSetLocationsExposure(entity, destHex, destHex.hasPavement(), false);                if (roll != null) {                    game.addPSR(roll);                }                // Update the entity's postion on the client.                entityUpdate( entity.getId() );                return;            } else {                // cliff: fall off it, deal damage, prone immediately                phaseReport.append(entity.getDisplayName() ).append( " falls "                ).append( fallElevation ).append( " levels into hex "                ).append( dest.getBoardNum() ).append( ".\n");                // only given a modifier, so flesh out into a full piloting roll                PilotingRollData pilotRoll = entity.getBasePilotingRoll();                if (roll != null) {                    pilotRoll.append(roll);                }                doEntityFall(entity, dest, fallElevation, pilotRoll);                doEntityDisplacementMinefieldCheck(entity, src, dest);                doSetLocationsExposure(entity, destHex, destHex.hasPavement(), false);                return;            }        }        // okay, destination occupied.  hmmm...        System.err.println("server.doEntityDisplacement: destination occupied");        if (fallElevation < 2) {            // domino effect: move & displace target            phaseReport.append(entity.getDisplayName()            ).append( " is displaced into hex "            ).append( dest.getBoardNum() ).append( ", violating stacking with "            ).append( violation.getDisplayName() ).append( ".\n");            entity.setPosition(dest);            doEntityDisplacementMinefieldCheck(entity, src, dest);            if (roll != null) {                game.addPSR(roll);            }            doEntityDisplacement(violation, dest, dest.translated(direction), new PilotingRollData(violation.getId(), 0, "domino effect"));            // Update the violating entity's postion on the client.            entityUpdate( violation.getId() );            return;        } else {            // accidental fall from above: havoc!            phaseReport.append(entity.getDisplayName() ).append( " falls "            ).append( fallElevation ).append( " levels into hex "            ).append( dest.getBoardNum() ).append( ", violating stacking with "            ).append( violation.getDisplayName() ).append( ".\n");            // determine to-hit number            ToHitData toHit = new ToHitData(7, "base");            toHit.append(Compute.getTargetMovementModifier(game, violation.getId()));            toHit.append(Compute.getTargetTerrainModifier(game, violation));            // roll dice            final int diceRoll = Compute.d6(2);            phaseReport.append("Collision occurs on a " ).append( toHit.getValue()            ).append( " or greater.  Rolls " ).append( diceRoll);            if (diceRoll >= toHit.getValue()) {                phaseReport.append(", hits!\n");                // deal damage to target                int damage = (int)Math.ceil(entity.getWeight() / 10.0);                phaseReport.append(violation.getDisplayName() ).append( " takes "                ).append( damage ).append( " from the collision.");                while (damage > 0) {                    int cluster = Math.min(5, damage);                    HitData hit = violation.rollHitLocation(ToHitData.HIT_PUNCH, ToHitData.SIDE_FRONT);                    phaseReport.append(damageEntity(violation, hit, cluster));                    damage -= cluster;                }                phaseReport.append("\n");                // attacker falls as normal, on his back                // only given a modifier, so flesh out into a full piloting roll                PilotingRollData pilotRoll = entity.getBasePilotingRoll();                pilotRoll.append(roll);                doEntityFall(entity, dest, fallElevation, 3, pilotRoll);                doEntityDisplacementMinefieldCheck(entity, src, dest);                // defender pushed away, or destroyed                Coords targetDest = Compute.getValidDisplacement(game, violation.getId(), dest, direction);                if (targetDest != null) {                    doEntityDisplacement(violation, dest, targetDest, new PilotingRollData(violation.getId(), 2, "fallen on"));                    // Update the violating entity's postion on the client.                    entityUpdate( violation.getId() );                } else {                    // ack!  automatic death!  Tanks                    // suffer an ammo/power plant hit.                    // TODO : a Mech suffers a Head Blown Off crit.                    phaseReport.append(destroyEntity(violation, "impossible displacement", (violation instanceof Mech), (violation instanceof Mech)));                }            } else {                phaseReport.append(", misses.\n");                //TODO: this is not quite how the rules go                Coords targetDest = Compute.getValidDisplacement(game, entity.getId(), dest, direction);                if (targetDest != null) {                    doEntityDisplacement(entity, src, targetDest, new PilotingRollData(entity.getId(), PilotingRollData.IMPOSSIBLE, "pushed off a cliff"));                    // Update the entity's postion on the client.                    entityUpdate( entity.getId() );                } else {                    // ack!  automatic death!  Tanks                    // suffer an ammo/power plant hit.                    // TODO : a Mech suffers a Head Blown Off crit.                    phaseReport.append(destroyEntity(entity, "impossible displacement", (entity instanceof Mech), (entity instanceof Mech)));                }            }               return;        }    }