protected void drawDamageGivenStat(TrekDamageStat stat) {
        if (stat == null) {
            return;
        }

        int bonus = 0;
        int tempDmg = 0;

        // Only add damage given if it was a ship that was attacked.
        // ... and it wasn't yourself.
        if (TrekUtilities.isObjectShip(stat.victim) && stat.victim != stat.victor) {
            TrekShip theVictimShip = (TrekShip) stat.victim;

            // Set our damage given for our next dock.
            //player.ship.damageGiven += stat.structuralDamage;
            if (stat.rammed) {
                tempDmg = stat.damageGiven;
            } else {
                tempDmg = (int) Math.round((float) stat.damageGiven / theVictimShip.shieldStrength * 4.0);
            }
            player.ship.damageGiven += tempDmg;

            // Calculate bonus. BonusForAttack = DmgGivenInAttack * OtherShipsTotalDmgGiven / 400000
            bonus = (theVictimShip.totalDamageGiven * tempDmg) / 400000;

            // Cap it at the amount of bonus to the damage.
            if (bonus > tempDmg) {
                bonus = tempDmg;
            }

            // Set the bonus for our next dock.
            player.ship.bonus += bonus;

            // Add to our permenant ship values.
            //player.ship.totalDamageGiven += stat.structuralDamage;
            player.ship.totalDamageGiven += tempDmg;
            player.ship.totalBonus += bonus;

            // Add to team stats
            if (TrekServer.isTeamPlayEnabled()) {
                TrekServer.teamStats[player.teamNumber].addDmgGvn(tempDmg);
                TrekServer.teamStats[player.teamNumber].addBonus(bonus);
            }
        }

        // If there was a bonus, decide what to tack on to the end of the damage message.
        String bonusString = "";

        if (bonus != 0) {
            bonusString = new Integer(bonus).toString();
        } else {
            bonusString = "0";
        }

        damageGvnWaiting = true;
        dmgGvnTimeout = 10;

        // Jailles: plasma: DmgGiven=387 Bonus=0 Structural=0 - Only if attacking a ship.
        if (TrekUtilities.isObjectShip(stat.victim)) {
            if (player.playerOptions.getOption(TrekPlayerOptions.OPTION_DAMAGEREPORT) == 0) {
                player.addMessageToQueue(stat.victim.name + ": " + stat.type + ": DmgGiven=" + tempDmg + " Bonus=" + bonusString + " Structural=" + stat.structuralDamage + TrekAnsi.eraseToEndOfLine(player));
            } else {
                player.addMessageToQueue(stat.victim.name + ": " + tempDmg + " " + bonusString + " " + stat.structuralDamage + TrekAnsi.eraseToEndOfLine(player));
            }
        }
    }