munition.addBeforeString(base, "Ammo", this.name + " "); break;
        public AmmoType createMunitionType( AmmoType base ) {            StringBuffer nameBuf;            String temp;            int index;            // Create an uninitialized munition object.            AmmoType munition = new AmmoType();            // Manipulate the base round's names, depending on ammoType.            switch ( base.ammoType ) {            case AmmoType.T_AC:                // Add the munition name to the beginning of the display name.                nameBuf = new StringBuffer( this.name );                nameBuf.append( " " );                nameBuf.append( base.name );                munition.name = nameBuf.toString();                // Add the munition name to the end of the TDB ammo name.                nameBuf = new StringBuffer( " - " );                nameBuf.append( this.name );                munition.addToEnd(base, " - " + this.name);                                // The munition name appears in the middle of the other names.                nameBuf = new StringBuffer( base.internalName );                index = base.internalName.lastIndexOf( "Ammo" );                nameBuf.insert( index, ' ' );                nameBuf.insert( index, this.name );                munition.setInternalName(nameBuf.toString());                munition.addBeforeString(base, "Ammo", this.name + " ");                nameBuf = null;                break;            case AmmoType.T_ARROW_IV:                // The munition name appears in the middle of all names.                nameBuf = new StringBuffer( base.name );                index = base.name.lastIndexOf( "Ammo" );                nameBuf.insert( index, ' ' );                // Do special processing for munition names ending in "IV".                //  Note: this does not work for The Drawing Board                if ( this.name.endsWith("-IV") ) {                    StringBuffer tempName = new StringBuffer(this.name);                    tempName.setLength(tempName.length() - 3);                    nameBuf.insert( index, tempName.toString() );                } else {                    nameBuf.insert( index, this.name );                }                munition.name = nameBuf.toString();                nameBuf = new StringBuffer( base.internalName );                index = base.internalName.lastIndexOf( "Ammo" );                nameBuf.insert( index, this.name );                munition.setInternalName(nameBuf.toString());                munition.addBeforeString(base, "Ammo", this.name + " ");                munition.addToEnd(base, " - " + this.name);                if (this.name.equals("Homing"))                    munition.addToEnd(base, " (HO)"); //mep                nameBuf = null;                break;            case AmmoType.T_SRM:                // Add the munition name to the end of some of the ammo names.                nameBuf = new StringBuffer( " " );                nameBuf.append( this.name );                munition.setInternalName(base.internalName + nameBuf.toString());                munition.addToEnd(base, nameBuf.toString());                nameBuf.insert( 0, " -" );                munition.addToEnd(base, nameBuf.toString());                // The munition name appears in the middle of the other names.                nameBuf = new StringBuffer( base.name );                index = base.name.lastIndexOf( "Ammo" );                nameBuf.insert( index, ' ' );                nameBuf.insert( index, this.name );                munition.name = nameBuf.toString();                nameBuf = null;                munition.addBeforeString(base, "Ammo", this.name + " ");                break;            case AmmoType.T_LRM:                // Add the munition name to the beginning of the display name.                nameBuf = new StringBuffer( this.name );                nameBuf.append( " " );                nameBuf.append( base.name );                munition.name = nameBuf.toString();                // Add the munition name to the end of some of the ammo names.                nameBuf = new StringBuffer( " " );                nameBuf.append( this.name );                munition.setInternalName(base.internalName + nameBuf.toString());                munition.addToEnd(base, nameBuf.toString());                nameBuf.insert( 0, " -" );                munition.addToEnd(base, nameBuf.toString());                break;            case AmmoType.T_LONG_TOM:            case AmmoType.T_SNIPER:            case AmmoType.T_THUMPER:                // Add the munition name to the beginning of the display name.                nameBuf = new StringBuffer( this.name );                nameBuf.append( " " );                nameBuf.append( base.name );                munition.name = nameBuf.toString();                munition.setInternalName( munition.name );                munition.addToEnd( base, munition.name );            default:                throw new IllegalArgumentException                    ( "Don't know how to create munitions for " +                      base.ammoType );            }            // Assign our munition type.            munition.munitionType = this.type;            // Reduce base number of shots to reflect the munition's weight.            munition.shots = base.shots / this.weight;            // Assign techlevel of the munition type.            // TODO : find a non-hardcoded way of doing this.            if ( TechConstants.T_CLAN_LEVEL_2 == base.techType ) {                munition.techType = TechConstants.T_CLAN_LEVEL_2;            } else {                munition.techType = TechConstants.T_IS_LEVEL_2;            }            // Copy over all other values.            munition.damagePerShot = base.damagePerShot;            munition.rackSize = base.rackSize;            munition.ammoType = base.ammoType;            munition.bv = base.bv;            munition.flags = base.flags;            munition.hittable = base.hittable;            munition.explosive = base.explosive;            munition.toHitModifier = base.toHitModifier;            // Return the new munition.            return munition;        }