Calculating Damage resistance
I want my 15 rapid-fire quantum torpedo launchers Uber-Defiant now! - Get help from modders. Share your work. Discuss modifications.
posted on August 21st, 2009, 5:48 am
I have created a java program to assist in the calculation of damage resistance for beam weapons.
Anyway all you should have to do is compile it using a Java programing environment and it should work. Note not all vessels are included as they rely on the offensive value of the attacking vessle to determine resistance. The sovereigns attack resistance to non officers will have to be included manually as well. Also the values may not be perfectly accurate as i used a rounding package on doubles, however they should be very close.
- Code: Select all
import java.util.*;
import java.text.DecimalFormat;
public class PhaserResistance {
public static void main (String [] args) {
Scanner keyboard = new Scanner (System.in);
String userInput;
DecimalFormat deci = new DecimalFormat("#.####");
int quitNumber=1; //Creates a varible named quitNumber, used to end the proceeding string
while (quitNumber != 0){ //While quitNumber is not equal to zero do this loop, ended by the user typeing quit.
System.out.println ("Enter the phaser damage");
userInput = keyboard.next();
if (userInput.equalsIgnoreCase ("quit")){ //used to end the loop
quitNumber --; //
System.out.println ("Bye");
}
else {
double parsedDamage = Double.parseDouble (userInput);
System.out.println ("damagebase = " + parsedDamage);
System.out.println (" "bor_adaptor_00.odf" " + deci.format(parsedDamage * 0.5));
System.out.println (" "bor_adaptor_01.odf" " + deci.format(parsedDamage * 0.75));
System.out.println (" "bor_adaptor_02.odf" " + deci.format(parsedDamage * 0.75));
System.out.println (" "bor_adaptor_03.odf" " + deci.format(parsedDamage * 0.75));
System.out.println (" "bor_adaptor_R0.odf" " + deci.format(parsedDamage * 0.75));
System.out.println (" "bor_adaptor_T0.odf" " + deci.format(parsedDamage * 0.75));
System.out.println (" "bor_cube_BHHHMM.odf" " + deci.format(parsedDamage * 0.8));
System.out.println (" "bor_cube_BRHHMM.odf" " + deci.format(parsedDamage * 0.9));
System.out.println (" "bor_cube_BRHHMM.odf" " + deci.format(parsedDamage * 0.8));
System.out.println (" "bor_cube_BTHHHM.odf" " + deci.format(parsedDamage * 0.9));
System.out.println (" "bor_cube_BTHHMM.odf" " + deci.format(parsedDamage * 0.8));
System.out.println (" "bor_cube_BTRHHM.odf" " + deci.format(parsedDamage * 0.9));
System.out.println (" "bor_cube_BTRHMM.odf" " + deci.format(parsedDamage * 0.8));
System.out.println (" "bor_cube_BTTHHM.odf" " + deci.format(parsedDamage * 0.9));
System.out.println (" "bor_cube_BTTHMM.odf" " + deci.format(parsedDamage * 0.8));
System.out.println (" "bor_cube_BTTRHM.odf" " + deci.format(parsedDamage * 0.9));
System.out.println (" "bor_cube_BTTRMM.odf" " + deci.format(parsedDamage * 0.8));
System.out.println (" "bor_cube_BTTTHM.odf" " + deci.format(parsedDamage * 0.9));
System.out.println (" "bor_cube_BTTTMM.odf" " + deci.format(parsedDamage * 0.8));
System.out.println (" "bor_cube_BTTTRM.odf" " + deci.format(parsedDamage * 0.9));
System.out.println (" "bor_cube_RHHHMM.odf" " + deci.format(parsedDamage * 0.8));
System.out.println (" "bor_cube_THHHMM.odf" " + deci.format(parsedDamage * 0.9));
System.out.println (" "bor_cube_TRHHMM.odf" " + deci.format(parsedDamage * 0.8));
System.out.println (" "bor_cube_TTHHHM.odf" " + deci.format(parsedDamage * 0.9));
System.out.println (" "bor_cube_TTHHMM.odf" " + deci.format(parsedDamage * 0.8));
System.out.println (" "bor_cube_TTRHHM.odf" " + deci.format(parsedDamage * 0.9));
System.out.println (" "bor_cube_TTRHMM.odf" " + deci.format(parsedDamage * 0.8));
System.out.println (" "bor_cube_TTTHHM.odf" " + deci.format(parsedDamage * 0.9));
System.out.println (" "bor_cube_TTTHMM.odf" " + deci.format(parsedDamage * 0.8));
System.out.println (" "bor_cube_TTTRHM.odf" " + deci.format(parsedDamage * 0.9));
System.out.println (" "bor_cube_TTTRMM.odf" " + deci.format(parsedDamage * 0.8));
/** damage reduction based on offensive vaule, not currently figurable. **/
//System.out.println (" "dom_battle_cruiserY2r6.odf" " + deci.format(parsedDamage * 0.));
//System.out.println (" "dom_battle_cruiserYr6.odf" " + deci.format(parsedDamage * 0.));
//System.out.println (" "dom_battle_cruiserZ2r6.odf" " + deci.format(parsedDamage * 0.));
//System.out.println (" "dom_battle_cruiserZr6.odf" " + deci.format(parsedDamage * 0.));
//System.out.println (" "dom_battle_cruiser_fed2r6.odf" " + deci.format(parsedDamage * 0.));
//System.out.println (" "dom_battle_cruiser_fedr6.odf" " + deci.format(parsedDamage * 0.));
/** ///////////////////////////////////////////////////////////////////// **/
System.out.println (" "dom_defenderr4.odf" " + deci.format(parsedDamage * 0.94));
System.out.println (" "dom_defenderr5.odf" " + deci.format(parsedDamage * 0.92));
/** damage reduction based on offensive vaule, not currently figurable in addition too a damage reduction of *%. **/
//System.out.println (" "dom_defenderr6.odf" " + deci.format(parsedDamage * 0.));
/** ///////////////////////////////////////////////////////////////////// **/
System.out.println (" "dom_dreadnought_borr5.odf" " + deci.format(parsedDamage * 0.75));
System.out.println (" "dom_dreadnought_borr6.odf" " + deci.format(parsedDamage * 0.75));
System.out.println (" "dom_dreadnought_fedr5.odf" " + deci.format(parsedDamage * 0.75));
System.out.println (" "dom_dreadnought_fedr6.odf" " + deci.format(parsedDamage * 0.75));
System.out.println (" "dom_dreadnought_klir5.odf" " + deci.format(parsedDamage * 0.75));
System.out.println (" "dom_dreadnought_klir6.odf" " + deci.format(parsedDamage * 0.75));
System.out.println (" "dom_dreadnought_romr5.odf" " + deci.format(parsedDamage * 0.75));
System.out.println (" "dom_dreadnought_romr6.odf" " + deci.format(parsedDamage * 0.75));
System.out.println (" "dom_intercept_destr4.odf" " + deci.format(parsedDamage * 0.77));
System.out.println (" "dom_intercept_destr5.odf" " + deci.format(parsedDamage * 0.77));
System.out.println (" "dom_intercept_destr6.odf" " + deci.format(parsedDamage * 0.44));
System.out.println (" "dom_intercept_dest_romr4.odf" " + deci.format(parsedDamage * 0.77));
System.out.println (" "dom_intercept_dest_romr5.odf" " + deci.format(parsedDamage * 0.77));
System.out.println (" "dom_intercept_dest_romr6.odf" " + deci.format(parsedDamage * 0.44));
System.out.println (" "fed_ambassadorMr6.odf" " + deci.format(parsedDamage * 0.7));
System.out.println (" "fed_ambassadorr6.odf" " + deci.format(parsedDamage * 0.7));
System.out.println (" "fed_intrepidYr6.odf" " + deci.format(parsedDamage * 0.7));
System.out.println (" "fed_intrepidZr6.odf" " + deci.format(parsedDamage * 0.7));
System.out.println (" "fed_intrepid_borr6.odf" " + deci.format(parsedDamage * 0.7));
/** damage reduction based on offensive vaule, not currently figurable. **/
//System.out.println (" "fed_mirandaii.odf" " + deci.format(parsedDamage * 0.));
//System.out.println (" "fed_mirandaiiM.odf" " + deci.format(parsedDamage * 0.));
//System.out.println (" "fed_mirandaiiMr2.odf" " + deci.format(parsedDamage * 0.));
//System.out.println (" "fed_mirandaiiMr3.odf" " + deci.format(parsedDamage * 0.));
//System.out.println (" "fed_mirandaiiMr4.odf" " + deci.format(parsedDamage * 0.));
//System.out.println (" "fed_mirandaiiMr5.odf" " + deci.format(parsedDamage * 0.));
//System.out.println (" "fed_mirandaiiMr6.odf" " + deci.format(parsedDamage * 0.));
//System.out.println (" "fed_mirandaiir2.odf" " + deci.format(parsedDamage * 0.));
//System.out.println (" "fed_mirandaiir3.odf" " + deci.format(parsedDamage * 0.));
//System.out.println (" "fed_mirandaiir4.odf" " + deci.format(parsedDamage * 0.));
//System.out.println (" "fed_mirandaiir5.odf" " + deci.format(parsedDamage * 0.));
//System.out.println (" "fed_mirandaiir6.odf" " + deci.format(parsedDamage * 0.));
/** ///////////////////////////////////////////////////////////////////// **/
System.out.println (" "fed_monsoonr4.odf" " + deci.format(parsedDamage * 0.88));
System.out.println (" "fed_monsoonr5.odf" " + deci.format(parsedDamage * 0.76));
System.out.println (" "fed_monsoonr6.odf" " + deci.format(parsedDamage * 0.46));
System.out.println (" "fed_monsoonZr4.odf" " + deci.format(parsedDamage * 0.88));
System.out.println (" "fed_monsoonZr5.odf" " + deci.format(parsedDamage * 0.76));
System.out.println (" "fed_monsoonZr6.odf" " + deci.format(parsedDamage * 0.46));
System.out.println (" "fed_monsoon_bor.odf" " + deci.format(parsedDamage * 0.9));
System.out.println (" "fed_monsoon_borr2.odf" " + deci.format(parsedDamage * 0.9));
System.out.println (" "fed_monsoon_borr3.odf" " + deci.format(parsedDamage * 0.9));
System.out.println (" "fed_monsoon_borr4.odf" " + deci.format(parsedDamage * 0.78));
System.out.println (" "fed_monsoon_borr5.odf" " + deci.format(parsedDamage * 0.66));
System.out.println (" "fed_monsoon_borr6.odf" " + deci.format(parsedDamage * 0.36));
System.out.println (" "fed_monsoon_klir4.odf" " + deci.format(parsedDamage * 0.88));
System.out.println (" "fed_monsoon_klir5.odf" " + deci.format(parsedDamage * 0.76));
System.out.println (" "fed_monsoon_klir6.odf" " + deci.format(parsedDamage * 0.46));
/** program will need to be expanded before the sovereign damage resistance to non officer rank vessels will be included **/
//System.out.println (" "fed_sovereignr4.odf" " + deci.format(parsedDamage * 0.84));
//System.out.println (" "fed_sovereignr5.odf" " + deci.format(parsedDamage * 0.68));
//System.out.println (" "fed_sovereignr6.odf" " + deci.format(parsedDamage * 0.68));
//System.out.println (" "fed_sovereignYr4.odf" " + deci.format(parsedDamage * 0.84));
//System.out.println (" "fed_sovereignYr5.odf" " + deci.format(parsedDamage * 0.68));
//System.out.println (" "fed_sovereignYr6.odf" " + deci.format(parsedDamage * 0.68));
/** ///////////////////////////////////////////////////////////////////// **/
System.out.println (" "kli_edjenr4.odf" " + deci.format(parsedDamage * 0.92));
System.out.println (" "kli_edjenr5.odf" " + deci.format(parsedDamage * 0.84));
System.out.println (" "kli_edjenr6.odf" " + deci.format(parsedDamage * 0.84));
/** damage reduction based on offensive vaule, not currently figurable. **/
//System.out.println (" "rom_generix_dreadr4.odf" " + deci.format(parsedDamage * 0.));
//System.out.println (" "rom_generix_dreadr5.odf" " + deci.format(parsedDamage * 0.));
//System.out.println (" "rom_generix_dreadr6.odf" " + deci.format(parsedDamage * 0.));
//System.out.println (" "rom_generix_dreadYr4.odf" " + deci.format(parsedDamage * 0.));
//System.out.println (" "rom_generix_dreadYr5.odf" " + deci.format(parsedDamage * 0.));
//System.out.println (" "rom_generix_dreadYr6.odf" " + deci.format(parsedDamage * 0.));
//System.out.println (" "rom_generix_dread_klir4.odf" " + deci.format(parsedDamage * 0.));
//System.out.println (" "rom_generix_dread_klir5.odf" " + deci.format(parsedDamage * 0.));
//System.out.println (" "rom_generix_dread_klir6.odf" " + deci.format(parsedDamage * 0.));
/** ///////////////////////////////////////////////////////////////////// **/
}
}
}
}
Anyway all you should have to do is compile it using a Java programing environment and it should work. Note not all vessels are included as they rely on the offensive value of the attacking vessle to determine resistance. The sovereigns attack resistance to non officers will have to be included manually as well. Also the values may not be perfectly accurate as i used a rounding package on doubles, however they should be very close.
posted on August 21st, 2009, 1:23 pm
Most interesting:). I'm sure this will be useful for some of the more experienced modders here 

Who is online
Users browsing this forum: No registered users and 8 guests