cs.setDestroyed(cs.isHit());
cs.setDestroyed(cs.isDamaged());
    private void resetEntityPhase() {    // first, mark doomed entities as destroyed and move them to the graveyard        for (Enumeration e = game.getEntities(); e.hasMoreElements();) {            final Entity entity = (Entity)e.nextElement();            if (entity.isDoomed()) {                entity.setDestroyed(true);            }            if (entity.isDestroyed()) {                game.moveToGraveyard(entity.getId());            }        }        for (Enumeration e = game.getEntities(); e.hasMoreElements();) {            final Entity entity = (Entity)e.nextElement();            // if ammo has exploded, empty the bin            for (Enumeration i = entity.ammo.elements(); i.hasMoreElements();) {                final Ammo a = (Ammo)i.nextElement();                if (a.exploded) {                    a.shots = 0;                    a.exploded = false;                }            }            // weapons are readied, except destroyed ones.            for (Enumeration i = entity.weapons.elements(); i.hasMoreElements();) {               final MountedWeapon w = (MountedWeapon)i.nextElement();                // first, if a weapon isn't destroyed, it's okay.                boolean weaponOK = !w.isDestroyed();                // does the weapon use ammo?                if (weaponOK && w.getType().getAmmoType() != Ammo.TYPE_NA) {                    // try to reload if needed                    if (w.getAmmoFeed() == null || w.getAmmoFeed().shots <= 0) {                        entity.loadWeapon(w);                    }                    // if still out of shots, weapon is useless                    if (w.getAmmoFeed() == null || w.getAmmoFeed().shots <= 0) {                        weaponOK = false;                    }                }                // ready it if it's still okay                w.setReady(weaponOK);            }            // destroy criticals that were hit last phase            for (int i = 0; i < entity.locations(); i++) {                for (int j = 0; j < entity.getNumberOfCriticals(i); j++) {                    final CriticalSlot cs = entity.getCritical(i, j);                    if (cs != null) {                        cs.setDestroyed(cs.isHit());                    }                }            }                        // destroy armor/internals if the section was removed            for (int i = 0; i < entity.locations(); i++) {                if (entity.getInternal(i) == Entity.ARMOR_DOOMED) {                    entity.setArmor(Entity.ARMOR_DESTROYED, i);                    entity.setArmor(Entity.ARMOR_DESTROYED, i, true);                    entity.setInternal(Entity.ARMOR_DESTROYED, i);                }            }                        // reset damage this phase            entity.damageThisPhase = 0;            // reset ready to true            entity.ready = entity.isActive();        }    }