Skip to content

Instantly share code, notes, and snippets.

@Ipotrick
Last active February 15, 2018 23:51
Show Gist options
  • Save Ipotrick/88c6b3e2d455157e23a98adc86869f74 to your computer and use it in GitHub Desktop.
Save Ipotrick/88c6b3e2d455157e23a98adc86869f74 to your computer and use it in GitHub Desktop.
import java.util.*;
import static java.lang.System.*;
public class IO {
public static void print(Object object) {
out.print(object);
}
public static void println(Object object) {
out.println(object);
}
public static int readInt() {
try {
return new Scanner(in).nextInt();
}
catch(Throwable ex) {
throw new RuntimeException("Input not an integer", ex);
}
}
public static String readString() {
try {
return new Scanner(in).nextLine();
}
catch(Throwable ex) {
throw new RuntimeException("Error in reading input", ex);
}
}
public static char readChar() {
try {
String result = readString();
if (result.length() > 1)
out.println("*** Warning: Input too long.\n"+
"*** Rest of input discarded.");
return result.charAt(0);
}
catch(IndexOutOfBoundsException ex) {
throw new RuntimeException("Empty input",ex);
}
}
}
import java.io.*;
import java.util.*;
class WeaponStatsReader
{ //Double.parseDouble() Wandelt String in double um
//zeile.matches(".*\\d+.*") Prüft ob ein double in einen string enthalten ist
//replaceAll("\\D+",""); Entfernt aus String alle nicht Zahlen
static List<String> WeaponsName = new ArrayList<> ();
static List<Double> critC = new ArrayList<> ();
static List<Double> critM = new ArrayList<> ();
static List<Double> fireR = new ArrayList<> ();
static List<Double> bullet = new ArrayList<> ();
static List<Double> reload = new ArrayList<> ();
static List<Double> mag = new ArrayList<> ();
static List<Double> slHC = new ArrayList<> ();
static List<Double> slLC = new ArrayList<> ();
static List<Double> slDOT = new ArrayList<> ();
static List<Double> corPP = new ArrayList<> ();
static List<Double> viralPP = new ArrayList<> ();
static List<Double> toxinPP = new ArrayList<> ();
static List<Double> poisonDOT = new ArrayList<> ();
static List<Double> heatPP = new ArrayList<> ();
static List<Double> heatDot = new ArrayList<> ();
static List<Double> impact = new ArrayList<> ();
static List<Double> slash = new ArrayList<> ();
static List<Double> puncture = new ArrayList<> ();
static List<Double> cold = new ArrayList<> ();
static List<Double> electricity = new ArrayList<> ();
static List<Double> heat = new ArrayList<> ();
static List<Double> toxin = new ArrayList<> ();
static List<Double> blast = new ArrayList<> ();
static List<Double> corrosive = new ArrayList<> ();
static List<Double> gas = new ArrayList<> ();
static List<Double> magnetic = new ArrayList<> ();
static List<Double> radiation = new ArrayList<> ();
static List<Double> viral = new ArrayList<> ();
public WeaponStatsReader(){
scanWeaponsIn();
}
public static void main(String[] args){
scanWeaponsIn();
}
public static void scanWeaponsIn(){
try{
BufferedReader br = new BufferedReader(new FileReader("Waffen.txt"));
String zeile = "";
zeile = br.readLine();
do{
if(zeile.length() > 0 && zeile.matches(".*\\d+.*") == false){
WeaponsName.add(zeile);
critC.add(stringToDouble(br.readLine())/1000.0);
critM.add(stringToDouble(br.readLine())/100.0);
fireR.add(stringToDouble(br.readLine())/100.0);
bullet.add(stringToDouble(br.readLine())/10.0);
reload.add(stringToDouble(br.readLine())/100.0);
mag.add(stringToDouble(br.readLine()));
slHC.add(stringToDouble(br.readLine())/10000.0);
slLC.add(stringToDouble(br.readLine())/10000.0);
slDOT.add(stringToDouble(br.readLine())/100.0);
corPP.add(stringToDouble(br.readLine())/10000.0);
viralPP.add(stringToDouble(br.readLine())/10000.0);
toxinPP.add(stringToDouble(br.readLine())/10000.0);
poisonDOT.add(stringToDouble(br.readLine())/100.0);
heatPP.add(stringToDouble(br.readLine())/10000.0);
heatDot.add(stringToDouble(br.readLine())/100.0);
impact.add(stringToDouble(br.readLine())/100.0);
slash.add(stringToDouble(br.readLine())/100.0);
puncture.add(stringToDouble(br.readLine())/100.0);
cold.add(stringToDouble(br.readLine())/100.0);
electricity.add(stringToDouble(br.readLine())/100.0);
heat.add(stringToDouble(br.readLine())/100.0);
toxin.add(stringToDouble(br.readLine())/100.0);
blast.add(stringToDouble(br.readLine())/100.0);
corrosive.add(stringToDouble(br.readLine())/100.0);
gas.add(stringToDouble(br.readLine())/100.0);
magnetic.add(stringToDouble(br.readLine())/100.0);
radiation.add(stringToDouble(br.readLine())/100.0);
viral.add(stringToDouble(br.readLine())/100.0);
}
zeile = br.readLine();
}while (zeile != null);
br.close();
}
catch(IOException e){
System.out.print("TXT DATEI IST FALSH FORMATIERT");
}
}
double get(String pWeapon, String pStat){
for(int i = WeaponsName.size()-1; i >= 0; i--){
if(WeaponsName.get(i).equals(pWeapon)){
switch (pStat){
case "critC": return critC.get(i);
case "critM": return critM.get(i);
case "fireR": return fireR.get(i);
case "bullet": return bullet.get(i);
case "reload": return reload.get(i);
case "mag": return mag.get(i);
case "slHC": return slHC.get(i);
case "slLC": return slLC.get(i);
case "slDOT": return slDOT.get(i);
case "corPP": return corPP.get(i);
case "viralPP": return viralPP.get(i);
case "toxinPP": return toxinPP.get(i);
case "poisonDOT": return poisonDOT.get(i);
case "heatPP": return heatPP.get(i);
case "heatDot": return heatDot.get(i);
case "impact": return impact.get(i);
case "slash": return slash.get(i);
case "puncture": return puncture.get(i);
case "cold": return cold.get(i);
case "electricity": return electricity.get(i);
case "heat": return heat.get(i);
case "toxin": return toxin.get(i);
case "blast": return blast.get(i);
case "corrosive": return corrosive.get(i);
case "gas": return gas.get(i);
case "magnetic": return magnetic.get(i);
case "radiation": return radiation.get(i);
case "viral": return viral.get(i);
default: throw new java.lang.Error("Stat nicht in Bibliothek enthalten!");
}
}
}
throw new java.lang.Error("WAFFE NICHT IN BIBLIOTHEK ODER WAFFENNAME FALSCH GESCHRIEBEN!");
}
/*public static void main(String[] args) throws IOException{
FileReader fr = new FileReader("Waffen.txt");
BufferedReader br = new BufferedReader(fr);
String zeile = "";
zeile = br.readLine();
do{
if(zeile.length() > 0 && zeile.matches(".*\\d+.*") == false){
WeaponsName.add(zeile);
damage.add(((stringToDouble(br.readLine()))/100.0));
critC.add(stringToDouble(br.readLine())/1000.0);
critM.add(stringToDouble(br.readLine()));
fireR.add(stringToDouble(br.readLine())/100.0);
bullet.add(stringToDouble(br.readLine())/10.0);
reload.add(stringToDouble(br.readLine())/10.0);
mag.add(stringToDouble(br.readLine()));
slHC.add(stringToDouble(br.readLine())/10000.0);
slLC.add(stringToDouble(br.readLine())/10000.0);
slDOT.add(stringToDouble(br.readLine())/100.0);
corPP.add(stringToDouble(br.readLine())/10000.0);
System.out.println(WeaponsName.get(0));
System.out.println(damage.get(0));
System.out.println(critC.get(0));
System.out.println(critM.get(0));
System.out.println(fireR.get(0));
System.out.println(bullet.get(0));
System.out.println(reload.get(0));
System.out.println(mag.get(0));
System.out.println(slHC.get(0));
System.out.println(slLC.get(0));
System.out.println(slDOT.get(0));
System.out.println(corPP.get(0));
}
zeile = br.readLine();
}while (zeile != null);
br.close();
}*/
public static void prl(String pString){
if(pString.matches(".*\\d+.*")){
pString = pString.replaceAll("\\D+","");
System.out.println(""+Double.parseDouble(pString));
}else{
System.out.println(""+pString);
}
}
public static double stringToDouble(String pString){
pString = pString.replaceAll("\\D+","");
return Double.parseDouble(pString);
}
}
import java.util.*;
public class Simulator
{
static boolean debugMode3 = false;
static int preN = 10000;
static String preWeapon = "Akstiletto Prime";
static int preLevel = 100;
public static void main(String[] args){
System.out.println("Mode 1: Set your Simulationcount, Enemy Level and Weapon, Mode 2: Set your Weapon and 10000 Simultaions for Level 50, 100 and 150 are done for fast input.");
System.out.print("Mode: "); int mode = IO.readInt();
if(debugMode3){
System.out.println(+timeToKillAccum(preWeapon, preN, preLevel));
}else{
if(mode == 1){
System.out.print("Waffe: ");String pWeapon = IO.readString();
System.out.print("Simulationsanzahl: "); int n = IO.readInt();
System.out.print("Gegnerlevel: "); int level = IO.readInt();
System.out.print("Durchschnitliche Time To Kill bei "+n+" Simultaionen: "+timeToKillAccum(pWeapon, n,level)+"s");
}else{
System.out.print("Waffe: ");String pWeapon = IO.readString();
int n = 10000;
System.out.println("Durchschnitliche Time To Kill bei Gegnerlevel 50: "+timeToKillAccum(pWeapon, n,50)+"s");
System.out.println("Durchschnitliche Time To Kill bei Gegnerlevel 100: "+timeToKillAccum(pWeapon, n,100)+"s");
System.out.println("Durchschnitliche Time To Kill bei Gegnerlevel 150: "+timeToKillAccum(pWeapon, n,150)+"s");
}
}
}
public static double timeToKillAccum(String pWeapon, int pN,int pLevel){
double[] simulations = new double[pN];
for(int e = pN-1;e >= 0; e--){
W3.debugMode = false;
W3.debugMode2 = false;
double temp = W3.timeToKill(pLevel,pWeapon);
simulations[e] = temp;
if(debugMode3 == true){System.out.print(""+temp+" "); System.out.println(Math.floor(1000-((((double)(e))/((double)(pN)))*1000))/10+"%");System.out.println("");}
}
double result2 = 0;
for(int e= pN-1;e>= 0;e--){
result2 = result2 + simulations[e];
}
return (Math.floor((result2/((double)pN))*100))/100.0;
}
}
import java.io.*;
import java.util.*;
public class W3
{
static boolean debugMode2 = true;
static boolean debugMode = true;
static boolean inputMode = true;
static WeaponStatsReader weaponStats = new WeaponStatsReader();
public static void main(String[] args){
String pWeapon;
int pLevel;
if(inputMode){
System.out.print("Weapon: "); pWeapon = IO.readString();
System.out.print("Enemy Level: "); pLevel = IO.readInt();
}else{
pWeapon = "Tigris Prime Corrosive";
pLevel = 100;
}
System.out.print("Time to kill: "+timeToKill(pLevel,pWeapon));System.out.println(" seconds");
System.out.println("EHP: "+ehp(heathScale(baseHealth, pLevel,baseLevel),armorScale(baseArmor, pLevel, baseLevel)));
}
static double damage = 0;
static double critC = 0;
static double critM = 0;
static double fireR = 0;
static double bullet = 0;
static double reload = 0;
static double mag = 0;
static double slHC = 0;
static double slLC = 0;
static double slDOT = 0;
static double corPP = 0;
static double viralPP = 0;
static double toxinPP = 0;
static double poisonDOT = 0;
static double heatPP = 0;
static double heatDot = 0;
static double impact = 0;
static double slash = 0;
static double puncture = 0;
static double cold = 0;
static double electricity = 0;
static double heat = 0;
static double toxin = 0;
static double blast = 0;
static double corrosive = 0;
static double gas = 0;
static double magnetic = 0;
static double radiation = 0;
static double viral = 0;
//corrupted heavy Gunner Stats
static double baseHealth = 700;
static double baseLevel = 8;
static double baseArmor = 500;
//CHG Health Resistances
static double impactDMH = 0.75;
static double slashDMH = 1.25;
static double punctureDMH = 1;
static double coldDMH = 1;
static double electricityDMH = 1;
static double heatDMH = 1.25;
static double toxinDMH = 1;
static double blastDMH = 1;
static double corrosiveDMH = 1;
static double gasDMH = 0.5;
static double magneticDMH = 1;
static double radiationDMH = 1;
static double viralDMH = 1.75;
//CHG Armor Damage Multipliers
static double impactDMA = 1;
static double slashDMA = 0.75;
static double punctureDMA = 1.5;
static double coldDMA = 1;
static double electricityDMA = 1;
static double heatDMA = 1;
static double toxinDMA = 1.25;
static double blastDMA = 0.75;
static double corrosiveDMA = 1.75;
static double gasDMA = 1;
static double magneticDMA = 1;
static double radiationDMA = 1;
static double viralDMA = 1;
public static double timeToKill(int pLevel, String pWeapon){
//Preprozessing Weapon Stats
readWeaponStats(pWeapon);
int magazineR = (int)mag;
int reloadTimer = (int)(reload*1000+1);
int critLevel = (int)Math.floor(critC);
double realCritChance = critC % 1;
int fireTicket = (int)Math.round(1/fireR*1000);
int fireSequence = 0;
double impactRA = impact*impactDMA;
double slashRA = slash*slashDMA;
double punctureRA = puncture*punctureDMA;
double coldRA = cold*coldDMA;
double electricityRA = electricity*electricityDMA;
double heatRA = heat*heatDMA;
double toxinRA = toxin*toxinDMA;
double blastRA = blast*blastDMA;
double corrosiveRA = corrosive*corrosiveDMA;
double gasRA = gas*gasDMA;
double magneticRA = magnetic*magneticDMA;
double radiationRA = radiation*radiationDMA;
double viralRA = viral*viralDMA;
double impactRH = impact*impactDMH;
double slashRH = slash*slashDMH;
double punctureRH = puncture*punctureDMH;
double coldRH = cold*coldDMH;
double electricityRH = electricity*electricityDMH;
double heatRH = heat*heatDMH;
double toxinRH = toxin*toxinDMH;
double blastRH = blast*blastDMH;
double corrosiveRH = corrosive*corrosiveDMH;
double gasRH = gas*gasDMH;
double magneticRH = magnetic*magneticDMH;
double radiationRH = radiation*radiationDMH;
double viralRH = viral*viralDMH;
double damageOnHealth = impactRH+slashRH+punctureRH+coldRH+electricityRH+heatRH+toxinRH+blastRH+corrosiveRH+gasRH+magneticRH+radiationRH+viralRH;
int slashListLength = 0;
List<Integer> slDotSequence = new ArrayList<> ();
List<Integer> slDotLife = new ArrayList<> ();
List<Double> slDotDamage = new ArrayList<> ();
int toxinListLength = 0;
List<Integer> toxinDotSequence = new ArrayList<> ();
List<Integer> toxinDotLife = new ArrayList<> ();
boolean viralProc = false;
double viralHealthPuffer = 0;
int viralSequence = 0;
int viralProcLife = -1;
int heatDotSequence = 0;
int heatDotLife = -1;
//Preprozessing Enemy Stats
//CHG Armor Multipliers
double impactMA = 1-(impactDMA-1);
double slashMA = 1-(slashDMA-1);
double punctureMA = 1-(punctureDMA-1);
double coldMA = 1-(coldDMA-1);
double electricityMA = 1-(electricityDMA-1);
double heatMA = 1-(heatDMA-1);
double toxinMA = 1-(toxinDMA-1);
double blastMA = 1-(blastDMA-1);
double corrosiveMA = 1-(corrosiveDMA-1);
double gasMA = 1-(gasDMA-1);
double magneticMA = 1-(magneticDMA-1);
double radiationMA = 1-(radiationDMA-1);
double viralMA = 1-(viralDMA-1);
double healthR = heathScale(baseHealth,pLevel,baseLevel);
double armorR = armorScale(baseArmor,pLevel,baseLevel);
boolean armorOn = true;
//Statistics
int ms10 = 0;
int shots= 0;
double debugMode2Health = 0;
if(debugMode2){ //DEBUG TEXT
System.out.println("Enemy Health: "+healthR);
System.out.println("Enemy Armor: "+armorR);
debugMode2Health = healthR;
}
while(healthR > 0){
if(magazineR > 0)
{
if(debugMode == true){if((ms10-fireSequence) % fireTicket == 0){System.out.print("Millisecond: "+(ms10+1)/10.0);System.out.print(" Shot: "+(shots+1));}} //DEBUG TEXT Wenn Projektil abgefeuert wird, werden ausserdem Millisekunden und Schuss ausgegeben.
///BEGINN Damage Calculations
if((ms10-fireSequence) % fireTicket == 0){ //Prüfen ob Projektil abgefeuert wird, aufgrund der fireTicket
///BEGINN Projectile Calculations
double result = 0;
double multiShotChance = bullet % 1;
int bulletCount = 0;;
if(Math.random() <= multiShotChance){ //Multishot Entscheidung
bulletCount = (int)Math.floor(bullet)+1; if(debugMode == true){System.out.print(" Bullets: "+((int)Math.floor(bullet)+1));} //DEBUG TEXT
}else{
bulletCount = (int)Math.floor(bullet); if(debugMode == true){System.out.print(" Bullets: "+bulletCount);} //DEBUG TEXT
}
for(int i = bulletCount;i>=1;i--){ //Berechnung für i Bullets
if(Math.random() <= realCritChance){ //CritChance Entscheidung
result = result + critM*(critLevel+1); if(debugMode == true){System.out.print(" Crit");} //DEBUG TEXT
if(Math.random() <= slHC){//SLASH PROC
slDotSequence.add(ms10 % 1000); if(debugMode == true){System.out.print(" SP");} //DEBUG TEXT
slDotLife.add(7);
slDotDamage.add(slDOT*(critM+critM*critLevel));
slashListLength++;
}
}else{
if(critLevel == 0){
result = result + 1; if(debugMode == true){System.out.print(" Norm");} //DEBUG TEXT
if(Math.random() <= slLC){//SLASH PROC
slDotSequence.add(ms10 % 1000); if(debugMode == true){System.out.print(" SP");} //DEBUG TEXT
slDotLife.add(7);
slDotDamage.add(slDOT);
slashListLength++;
}
}else{
result = result + critM*critLevel; if(debugMode == true){System.out.print(" Norm");} //DEBUG TEXT
if(Math.random() <= slLC){//SLASH PROC
slDotSequence.add(ms10 % 1000); if(debugMode == true){System.out.print(" SP");} //DEBUG TEXT 1000 1.0/(8.0/6.0)*1000 slDotSequence.add(Math.floor(1000+(ms10 % 1000)));
slDotLife.add(7);
slDotDamage.add(slDOT*critM*critLevel);
slashListLength++;
}
}
}
///BEGINN Status Effect Inflictions That Dont Use Crits
if(Math.random() <= corPP){ //corrosive Proc Apply
armorR = armorR*0.75; if(debugMode == true){System.out.print(" CP");} //DEBUG TEXT
}
if(Math.random() <= viralPP){ //viral Proc
viralProc = true; if(debugMode == true){System.out.print(" VP");} //DEBUG TEXT
}
if(Math.random() <= heatPP){ //heat Proc
heatDotLife = 7; if(debugMode == true){System.out.print(" HP");} //DEBUG TEXT
heatDotSequence = ms10 % 1000;
}
if(Math.random() <= toxinPP){ //toxin Proc
toxinDotSequence.add(ms10 % 1000); if(debugMode == true){System.out.print(" TP");} //DEBUG TEXT
toxinDotLife.add(7);
toxinListLength++;
}
///END Status Effect Inflictions That Dont Use Crits
}
///END Projectile Calculations
double tempDMG = 0;
if(armorOn){
tempDMG =
impactRA *dmgRed(armorR*impactMA)+
slashRA *dmgRed(armorR*slashMA)+
punctureRA *dmgRed(armorR*punctureMA)+
coldRA *dmgRed(armorR*coldMA)+
electricityRA*dmgRed(armorR*electricityMA)+
heatRA *dmgRed(armorR*heatMA)+
toxinRA *dmgRed(armorR*toxinMA)+
blastRA *dmgRed(armorR*blastMA)+
corrosiveRA *dmgRed(armorR*corrosiveMA)+
gasRA *dmgRed(armorR*gasMA)+
magneticRA *dmgRed(armorR*magneticMA)+
radiationRA *dmgRed(armorR*radiationMA)+
viralRA *dmgRed(armorR*viralMA);
}else{
tempDMG = damageOnHealth;
}
healthR = healthR - (tempDMG*result);
shots++;
magazineR--; if(debugMode == true){if(magazineR == 0){System.out.println("");System.out.println("Millisecond: "+(ms10+1)/10.0+" reloading start");}} // DEBUG TEXT
} if(debugMode == true){if((ms10-fireSequence) % fireTicket == 0){System.out.println("");}} // DEBUG TEXT
///END Damage Calculations
}else{ //Nachlademechanik
///BEGINN Reload Calculations
reloadTimer--;
if(reloadTimer == 0){
magazineR = (int)mag;
reloadTimer = (int)(reload*1000+1); if(debugMode == true){System.out.println(""); System.out.println("Millisecond: "+(ms10+1)/10.0+" reloading end");}// DEBUG TEXT
fireSequence = (ms10 % 1000)+1;
}
///END Reload Calculations
}
///BEGINN Status Proc Calculations
if(armorOn && armorR < 0.00001){
armorOn = false; armorR = 0;
if(debugMode == true){System.out.println("Millisecond: "+(ms10+1)/10.0+" Armor Completely stripped!");} //DEBUG TEXT
}
//Viral Proc Apply Scan
if(viralProc){
if(viralHealthPuffer == 0.0){
viralHealthPuffer = healthR/2.0;
healthR = healthR/2.0;
}
viralSequence = (int)Math.floor(1000+(ms10 % 1000));
viralProcLife = 7;
viralProc = false;
}
//Viral Proc Decay
if(viralProcLife > 0 && ms10 % (int)Math.floor(viralSequence) == 0){
viralProcLife--;
}
//Viral Proc Death Scan
if(viralProcLife == 0){
healthR = healthR + viralHealthPuffer; if(debugMode == true){System.out.println("--Millisecond: "+(ms10+1)/10.0+" Viral Proc Expired!");}
viralHealthPuffer = 0;
viralProcLife--;
}
///END Status Proc Calculations
///BEGIN Status DOT Calculations
//Fire Dot Damage Apply Scan
if(heatDotLife > 0 && ((ms10-heatDotSequence) % 1000) == 0){
heatDotLife--;
if(armorOn){
healthR = healthR - (dmgRed(armorR)*(heatDot*heatDMA)); if(debugMode == true){System.out.println("-Millisecond: "+(ms10+1)/10.0+" Heat DOT DAMAGE: "+(dmgRed(armorR)*(heatDot*heatMA)));} //DEBUG TEXT
}else{
healthR = healthR - (heatDot*heatDMH); if(debugMode == true){System.out.println("-Millisecond: "+(ms10+1)/10.0+" Heat DOT DAMAGE: "+(heatDot*heatDMH));} //DEBUG TEXT
}
}
//Fire Dot Death Scan
if(debugMode == true){if(heatDotLife == 0){heatDotLife--;System.out.println("--Millisecond: "+(ms10+1)/10.0+" Heat Dot Expired!");}} //DEBUG TEXT
//Toxin Dot DAMAGE APPLY Scan
for(int i = 0;i < toxinListLength;i++){
if(((ms10-toxinDotSequence.get(i)) % 1000) == 0){
if(armorOn){
healthR = healthR - (dmgRed(armorR)*(poisonDOT*toxinDMA)); if(debugMode == true){System.out.println("-Millisecond: "+(ms10+1)/10.0+" Toxin Dot Damage: "+(dmgRed(armorR)*(poisonDOT*toxinDMA)));} //DEBUG TEXT
}else{
healthR = healthR - (poisonDOT*toxinDMH); if(debugMode == true){System.out.println("-Millisecond: "+(ms10+1)/10.0+" Toxin Dot Damage: "+(poisonDOT*toxinDMH));} //DEBUG TEXT
}
int oldLife = toxinDotLife.get(i);
toxinDotLife.set(i,oldLife-1);
}
}
//Toxin Dot Death Scan
for(int i = 0;i < toxinListLength;i++){
if(((ms10-toxinDotSequence.get(i)) % 1000) == 0){
if(toxinDotLife.get(i) == 0){
toxinDotLife.remove(i);
toxinDotSequence.remove(i);
toxinListLength--; if(debugMode == true){System.out.println("--Millisecond: "+(ms10+1)/10.0+" Toxin Dot Expired!");}
i--;
}
}
}
//Slash Dot Damage Apply Scan
for(int i = 0;i < slashListLength;i++){
if(((ms10-slDotSequence.get(i)) % 1000) == 0){
healthR = healthR - (double)(slDotDamage.get(i));
int oldLife = slDotLife.get(i);
slDotLife.set(i,oldLife-1); if(debugMode == true){System.out.println("-Millisecond: "+(ms10+1)/10.0+" SLASH DOT DAMAGE: "+(double)(slDotDamage.get(i)));} //DEBUG TEXT
}
}
//Slash DOT Death Scan
for(int i = 0;i < slashListLength;i++){
if(((ms10-slDotSequence.get(i)) % 1000) == 0){ //ms10 % (int)Math.floor(slDotSequence.get(i)) == 0
if(slDotLife.get(i) == 0){
slDotLife.remove(i);
slDotSequence.remove(i);
slDotDamage.remove(i);
slashListLength--; if(debugMode == true){System.out.println("--Millisecond: "+(ms10+1)/10.0+" Slash Dot Expired!");}
i--;
}
}
}
///END Status DOT Calculations
if(debugMode2 && debugMode2Health != healthR){ //DEBUG TEXT
System.out.println("Enemy Health: "+healthR);
System.out.println("Enemy Armor: "+armorR);
debugMode2Health = healthR;
}
ms10++;
if (ms10 > 1000000){throw new java.lang.Error("Simultaionslaufzeit zu lang! Laufzeitkillswitch beendete Simultaion!");}
} if(debugMode == true){System.out.println("");System.out.println("Results:");System.out.println("Shots fired: "+shots+" active Slash DOTs in the end: "+slashListLength);} //DEBUG TEXT
return ms10/1000.0;
}
public static void readWeaponStats(String pWeapon){
critC = weaponStats.get(pWeapon,"critC");
critM = weaponStats.get(pWeapon,"critM");
fireR = weaponStats.get(pWeapon,"fireR");
bullet = weaponStats.get(pWeapon,"bullet");
reload = weaponStats.get(pWeapon,"reload");
mag = weaponStats.get(pWeapon,"mag");
slHC = weaponStats.get(pWeapon,"slHC");
slLC = weaponStats.get(pWeapon,"slLC");
slDOT = weaponStats.get(pWeapon,"slDOT");
corPP = weaponStats.get(pWeapon,"corPP");
viralPP = weaponStats.get(pWeapon,"viralPP");
toxinPP= weaponStats.get(pWeapon,"toxinPP");
poisonDOT= weaponStats.get(pWeapon,"poisonDOT");
heatPP= weaponStats.get(pWeapon,"heatPP");
heatDot= weaponStats.get(pWeapon,"heatDot");
impact= weaponStats.get(pWeapon,"impact");
slash= weaponStats.get(pWeapon,"slash");
puncture= weaponStats.get(pWeapon,"puncture");
cold= weaponStats.get(pWeapon,"cold");
electricity= weaponStats.get(pWeapon,"electricity");
heat= weaponStats.get(pWeapon,"heat");
toxin= weaponStats.get(pWeapon,"toxin");
blast= weaponStats.get(pWeapon,"blast");
corrosive= weaponStats.get(pWeapon,"corrosive");
gas= weaponStats.get(pWeapon,"gas");
magnetic= weaponStats.get(pWeapon,"magnetic");
radiation= weaponStats.get(pWeapon,"radiation");
viral= weaponStats.get(pWeapon,"viral");
damage = impact+slash+puncture+cold+electricity+heat+toxin+blast+corrosive+gas+magnetic+radiation+viral;
if(debugMode == true){ //DEBUG TEXT
System.out.println("Scanned critC: "+critC);
System.out.println("Scanned critM: "+critM);
System.out.println("Scanned fireR: "+fireR);
System.out.println("Scanned bullet: "+bullet);
System.out.println("Scanned reload: "+reload);
System.out.println("Scanned mag: "+mag);
System.out.println("Scanned slHC: "+slHC);
System.out.println("Scanned slLC: "+slLC);
System.out.println("Scanned slDOT: "+slDOT);
System.out.println("Scanned corPP: "+corPP);
System.out.println("Scanned viralPP: "+viralPP);
System.out.println("Scanned toxinPP: "+toxinPP);
System.out.println("Scanned poisonDOT: "+poisonDOT);
System.out.println("Scanned heatPP: "+heatPP);
System.out.println("Scanned heatDot: "+heatDot);
System.out.println("Scanned impact: "+impact);
System.out.println("Scanned slash: "+slash);
System.out.println("Scanned puncture: "+puncture);
System.out.println("Scanned cold: "+cold);
System.out.println("Scanned electricity: "+electricity);
System.out.println("Scanned heat: "+heat);
System.out.println("Scanned toxin: "+toxin);
System.out.println("Scanned blast: "+blast);
System.out.println("Scanned corrosive: "+corrosive);
System.out.println("Scanned gas: "+gas);
System.out.println("Scanned magnetic: "+magnetic);
System.out.println("Scanned radiation: "+radiation);
System.out.println("Scanned viral: "+viral);
}
}
public static double heathScale(double pHealth, double pLevel, double pBaseLevel){
return pHealth*(1+Math.pow((pLevel- pBaseLevel),2) *0.015);
}
public static double armorScale(double pBaseArmor, double pLevel, double pBaseLevel){
return (pBaseArmor*(1+ Math.pow(pLevel-pBaseLevel,1.75) *0.005));
}
public static double dmgRed(double pArmor){
return 1/(1+pArmor/300.0);
}
public static double ehp(double pHealth, double pArmor){
return (pHealth)/(dmgRed(pArmor));
}
}
THIS IS THE END OF JAVA CODE, THS NEXT PARAGRAPH IS A Waffen.txt FILE FOR THE WEAPON INPUT
Akstiletto Prime
critC = 0.405
critM = 4.00
fireR = 11.33
bullet = 2.8
reload = 1.10
mag = 40
slHC = 0.0479
slLC = 0.0703
slDOT = 40.32
corPP = 0.1182
viralPP = 0.0000
poisonPP = 0.0000
poisonDOT = 0.00
heatPP = 0.1272
heatDOT = 144.00
impact = 69.12
slash = 34.56
puncture = 11.52
cold = 0.00
electricity = 0.00
heat = 172.80
toxin = 0.00
blast = 0.00
corrosive = 138.24
gas = 0.00
magnetic = 0.00
radiation = 0.00
viral = 0.00
Boar Prime
critC = 0.150
critM = 2.00
fireR = 4.47
bullet = 22.4
reload = 2.70
mag = 20
slHC = 0.0164
slLC = 0.0931
slDOT = 37.10
corPP = 0.2877
viralPP = 0.0000
poisonPP = 0.0000
poisonDOT = 0.00
heatPP = 0.0000
heatDOT = 0.00
impact = 68.90
slash = 21.20
puncture = 15.90
cold = 0.00
electricity = 0.00
heat = 0.00
toxin = 0.00
blast = 127.20
corrosive = 222.6
gas = 0.00
magnetic = 0.00
radiation = 0.00
viral = 0.00
Tigris Prime Viral
critC = 0.100
critM = 2.00
fireR = 10.00
bullet = 17.6
reload = 1.57
mag = 2
slHC = 0.0687
slLC = 0.6187
slDOT = 180.86
corPP = 0.0000
viralPP = 0.1172
poisonPP = 0.0000
poisonDOT = 0.00
heatPP = 0.0000
heatDOT = 0.00
impact = 51.30
slash = 909.48
puncture = 51.68
cold = 0.00
electricity = 0.00
heat = 0.00
toxin = 0.00
blast = 00.00
corrosive = 00.00
gas = 0.00
magnetic = 0.00
radiation = 620.10
viral = 620.10
Tigris Prime Corrosive
critC = 0.100
critM = 2.00
fireR = 10.00
bullet = 17.6
reload = 1.57
mag = 2
slHC = 0.0687
slLC = 0.6187
slDOT = 180.86
corPP = 0.1172
viralPP = 0.0000
poisonPP = 0.0000
poisonDOT = 0.00
heatPP = 0.0000
heatDOT = 0.00
impact = 51.30
slash = 909.48
puncture = 51.68
cold = 0.00
electricity = 0.00
heat = 0.00
toxin = 0.00
blast = 620.10
corrosive = 620.10
gas = 0.00
magnetic = 0.00
radiation = 0.00
viral = 0.00
Tigris Prime Viral HD
critC = 0.100
critM = 2.00
fireR = 10.00
bullet = 17.6
reload = 1.80
mag = 2
slHC = 0.0687
slLC = 0.6187
slDOT = 242.29
corPP = 0.0000
viralPP = 0.1172
poisonPP = 0.0000
poisonDOT = 0.00
heatPP = 0.0000
heatDOT = 0.00
impact = 69.23
slash = 1218.36
puncture = 69.23
cold = 0.00
electricity = 0.00
heat = 0.00
toxin = 0.00
blast = 0.00
corrosive = 0.00
gas = 0.00
magnetic = 0.00
radiation = 830.70
viral = 830.70
Tigris Prime Corrosive HD
critC = 0.100
critM = 2.00
fireR = 10.00
bullet = 17.6
reload = 1.80
mag = 2
slHC = 0.0632
slLC = 0.5688
slDOT = 180.86
corPP = 0.1885
viralPP = 0.0000
poisonPP = 0.0000
poisonDOT = 0.00
heatPP = 0.0000
heatDOT = 0.00
impact = 51.30
slash = 909.48
puncture = 51.68
cold = 0.00
electricity = 0.00
heat = 0.00
toxin = 0.00
blast = 620.10
corrosive = 1085.18
gas = 0.00
magnetic = 0.00
radiation = 0.00
viral = 0.00
Corinth
critC = 0.570
critM = 5.88
fireR = 1.17
bullet = 11.0
reload = 1.74
mag = 5
slHC = 0.1741
slLC = 0.0024
slDOT = 122.85
corPP = 0.0000
viralPP = 0.0000
poisonPP = 0.0000
poisonDOT = 0.00
heatPP = 0.0000
heatDOT = 0.00
impact = 98.28
slash = 105.30
puncture = 147.42
cold = 0.00
electricity = 0.00
heat = 526.50
toxin = 0.00
blast = 0.00
corrosive = 0.00
gas = 0.00
magnetic = 0.00
radiation = 0.00
viral = 0.00
Euphona Prime P
critC = 0.810
critM = 5.25
fireR = 2.40
bullet = 2.8
reload = 2.00
mag = 5
slHC = 0.0001
slLC = 0.0000
slDOT = 369.69
corPP = 0.0049
viralPP = 0.0000
poisonPP = 0.0000
poisonDOT = 0.00
heatPP = 0.0041
heatDOT = 1320.31
impact = 960.63
slash = 52.81
puncture = 52.81
cold = 0.00
electricity = 0.00
heat = 1584.38
toxin = 0.00
blast = 00.00
corrosive = 1901.25
gas = 0.00
magnetic = 0.00
radiation = 0.00
viral = 0.00
Euphona Prime S
critC = 0.020
critM = 2.00
fireR = 2.40
bullet = 28.0
reload = 2.00
mag = 5
slHC = 0.0132
slLC = 0.6468
slDOT = 100.10
corPP = 0.1200
viralPP = 0.0000
poisonPP = 0.0000
poisonDOT = 0.00
heatPP = 0.0000
heatDOT = 0.00
impact = 14.30
slash = 471.90
puncture = 57.20
cold = 0.00
electricity = 0.00
heat = 0.00
toxin = 0.00
blast = 343.20
corrosive = 343.20
gas = 0.00
magnetic = 0.00
radiation = 0.00
viral = 0.00
Soma Prime Corrosive
critC = 0.750
critM = 6.60
fireR = 15.00
bullet = 1.9
reload = 3.00
mag = 200
slHC = 0.0471
slLC = 0.0157
slDOT = 10.85
corPP = 0.0943
viralPP = 0.0000
poisonPP = 0.0000
poisonDOT = 0.00
heatPP = 0.0000
heatDOT = 0.00
impact = 3.10
slash = 15.50
puncture = 12.40
cold = 0.00
electricity = 0.00
heat = 0.00
toxin = 0.00
blast = 0.00
corrosive = 93.02
gas = 0.00
magnetic = 0.00
radiation = 0.00
viral = 0.00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment