DeletedUser563
No to this idea
Yep, nice speech Samuel. But, as Zd indicated, you are not providing a solution and are not recognizing how changing fort gun damage effectively addresses the hp issue without pissing off a lot of players who have respecced their characters to take advantage of the hp issue. Changing fort gun damage, particularly utilizing a percentage, presents an elegant solution.
Also, the argument of attempting to boost the influence of other skills is insufficient and results in new problems, such as far longer, or far shorter, fort battles based on skill points of the respective teams. Indeed, it doesn't even remotely address the issue of hp being such a deciding factor, precisely because a person with 12,000 hps can easily manage being hit 50 times before going down.
The ol' adage is to fix the problem, not create potential for new problems.
{determine variables
}
dmg% = (dmgRnd/2900);
calcDmg = currentHP*dmg%;
twMax = totalHP/3;
if(hit=true)then
{ensure calculated damage is not less than minimum gun damage
}
if(calcDmg < MinDmg then
calcDmg = MinDmg;
{ensure calculated damage is not less than rolled damage
}
if calcDmg < dmgRnd then
calcDmg = dmgRnd;
{ensure calculated damage is not more than 1/3 of target's total, unmodified health points
}
if calcDmg > twMax then
dmgMade = twMax;
else
dmgMade = calcDmg;
{deduct damage from current health points
}
currentHP = currentHP-dmgMade;
Please enter the HP of your opponent:10000
Min gun damage =200
Max gun damage =300
[6.896% - 10.344%]
Lube [20-40] - press 1
Bayo [25-75] - press 2
Nothing - press 0
Please enter gun Buff:0
Using Percentage:
Shot 1 : You hit for 878.30 damage. Opponent has 9121.70 HP left. %
Shot 2 : You hit for 880.97 damage. Opponent has 8240.73 HP left. %
Shot 3 : You hit for 653.32 damage. Opponent has 7587.40 HP left. %
Shot 4 : You hit for 572.32 damage. Opponent has 7015.08 HP left. %
Shot 5 : You hit for 661.66 damage. Opponent has 6353.42 HP left. %
Shot 6 : You hit for 487.18 damage. Opponent has 5866.24 HP left. %
Shot 7 : You hit for 453.64 damage. Opponent has 5412.60 HP left. %
Shot 8 : You hit for 484.43 damage. Opponent has 4928.18 HP left. %
Shot 9 : You hit for 420.37 damage. Opponent has 4507.80 HP left. %
Shot 10 : You hit for 368.47 damage. Opponent has 4139.34 HP left. %
Shot 11 : You hit for 352.38 damage. Opponent has 3786.95 HP left. %
Shot 12 : You hit for 371.95 damage. Opponent has 3415.00 HP left. %
Shot 13 : You hit for 263.84 damage. Opponent has 3151.16 HP left. %
Shot 14 : You hit for 273.96 damage. Opponent has 2877.19 HP left. %
Shot 15 : You hit for 243.00 damage. Opponent has 2634.19 HP left.
Shot 16 : You hit for 262.00 damage. Opponent has 2372.19 HP left.
Shot 17 : You hit for 237.00 damage. Opponent has 2135.19 HP left.
Shot 18 : You hit for 273.00 damage. Opponent has 1862.19 HP left.
Shot 19 : You hit for 246.00 damage. Opponent has 1616.19 HP left.
Shot 20 : You hit for 211.00 damage. Opponent has 1405.19 HP left.
Shot 21 : You hit for 231.00 damage. Opponent has 1174.19 HP left.
Shot 22 : You hit for 258.00 damage. Opponent has 916.19 HP left.
Shot 23 : You hit for 219.00 damage. Opponent has 697.19 HP left.
Shot 24 : You hit for 272.00 damage. Opponent has 425.19 HP left.
Shot 25 : You hit for 283.00 damage. Opponent has 142.19 HP left.
Shot 26 : You hit for 254.00 damage. Opponent has -111.81 HP left.
Currently:40 hits killed opponent.
import java.util.Random;
import java.util.Scanner;
public class Damage {
public static void main(String [] args){
Random generator = new Random();
Scanner input = new Scanner(System.in);
// Variable init
int hpThreshold = 2900;
double maxHp;
double hp = 0;
int counter = 0;
int counter1 = 0;
double damage = 0;
double result = 0;
double randomPercentageDamage = 0;
int minGunDamage = 0;
int maxGunDamage = 0;
int minPercentageDamage = 0;
int maxPercentageDamage = 0;
int randomGunDamage =0;
int randomGunDamage1 =0;
int buff = 0;
int buffMin = 0;
int buffMax = 0;
int choice = 0;
// Set HP
do
{
System.out.print("Please enter the HP of your opponent:");
maxHp = input.nextDouble();
} while (maxHp <= 0);
hp = maxHp;
// Set minimal and maximal Gun Damage
do
{
System.out.print("Min gun damage =");
minGunDamage = input.nextInt();
System.out.print("Max gun damage =");
maxGunDamage = input.nextInt();
} while ((minGunDamage < 1) || (maxGunDamage < minGunDamage));
// Calculate min and max percentage damage
minPercentageDamage = (int)((double)minGunDamage/hpThreshold*100000);
maxPercentageDamage = (int)((double)maxGunDamage/hpThreshold*100000);
System.out.printf("[%s%% - %s%%]\n",(double)minPercentageDamage/1000, (double)maxPercentageDamage/1000);
// Set Buff
do{
System.out.print("\nLube [20-40] - press 1\nBayo [25-75] - press 2\nNothing - press 0\nPlease enter gun Buff:");
choice = input.nextInt();
} while ((choice < 0) || ( choice > 2));
switch (choice)
{
case 1:
{
buffMin =20; buffMax = 40;
buff = generator.nextInt(buffMax-buffMin) + buffMin;break;
}
case 2:
{
buffMin =25; buffMax = 75;
buff = generator.nextInt(buffMax-buffMin) + buffMin; break;
}
}
//Using the percentage
System.out.printf("\n\n Using Percentage:");
do
{
randomGunDamage = generator.nextInt(maxGunDamage-minGunDamage) + minGunDamage;
randomGunDamage1 = generator.nextInt(maxPercentageDamage-minPercentageDamage) + minPercentageDamage;
randomPercentageDamage = ((double)randomGunDamage1/100000)*hp;
counter ++;
if ((randomPercentageDamage)<randomGunDamage)
{
damage = randomGunDamage + buff;
// account for "max damage can be one third from max HP" rule
if ((damage - buff) > (maxHp/3))
damage = maxHp/3;
hp = hp - damage;
System.out.printf("\n Shot %d : You hit for %.2f damage. Opponent has %.2f HP left.\n",
counter,damage, hp);
}
else
{
damage = randomPercentageDamage + buff;
hp = hp - damage;
System.out.printf("\n Shot %d : You hit for %.2f damage. Opponent has %.2f HP left. %%\n",
counter,damage, hp);
}
}while (hp > 0.99); // hp > 0 is not enough because substracting 3 times a third from maxHp doesn't result in a clean 0
// Current implemetnation
hp = maxHp;
//System.out.printf("\n\n Currently:");
do
{
randomGunDamage = generator.nextInt(maxGunDamage-minGunDamage) + minGunDamage;
counter1 = counter1 +1;
damage = randomGunDamage + buff;
if ((damage - buff) > (maxHp/3))
damage = maxHp/3;
hp = hp-damage;
//System.out.printf("\n Shot %d : You hit for %.2f damage. Opponent has %.2f HP left",counter1,damage, hp);
} while (hp >=0.99);
System.out.printf("\n\n Currently:%d hits killed opponent.", counter1);
}
}
PS.Hellstorm, can you please explain to me how can I wrap up the code and attach a button to "show" like you did?
[SPOIL]Your text here[/SPOIL]
insert text here ["/"code] ["/"spoil]
tags didn't nullify the spoiler code I changed them to HTML and must've backspaced the spoil tags instead of the code ones :hmf:
Fixed it now.
Care to elaborate Supraxus?I'm going to have to say No to this