Please note, this is a STATIC archive of website www.tutorialspoint.com from 11 May 2019, cach3.com does not collect or store any user information, there is no "phishing" involved.
Tutorialspoint

Combat Health Calculator

using System;

namespace HealthCalculator {

class Damage {
// member variables
double B;
// B = Blunt Damage being dealt to the entity.
double S;
// S = Sharp Damage being dealt to the entity.
double BT;
// BT = Blunt Damage Threshold of the entity.
double ST;
// ST = Sharp Damage Threshold of the entity.
double DR;
// DR = Damage Resistance % of the entity. Calculated by subtracting the DR Stat from 100 then divide by 100. 
double Limb;
// The Limb Damage multiplier for the entity. 
double Health;
// The total health of the entity. 

public void Acceptdetails() {
B = 40; 
S = 30;
BT = 10;
ST = 30;
DR = 5;
Limb = .8;
Health = 156.25;

}

public double GetHealth() {
return Health - ((((B - BT) + (S - ST) ) * (100 - DR) / 100) * Limb); 
}

public void Display() {
Console.WriteLine("Health: {0}", GetHealth());


}
}

class ExecuteRectangle {

static void Main(string[] args) {
Damage D = new Damage();
D.Acceptdetails();
D.Display();
Console.ReadLine(); 
}
}
}

Advertisements
Loading...

We use cookies to provide and improve our services. By using our site, you consent to our Cookies Policy.