Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Collections.Generic;
- using System.ComponentModel;
- using System.Data;
- using System.Drawing;
- using System.Linq;
- using System.Text;
- using System.Threading.Tasks;
- using System.Windows.Forms;
- namespace Giant_stats_calucator
- {
- public partial class Form1 : Form
- {
- public Form1()
- {
- InitializeComponent();
- timer.Start();
- }
- public double HumanHeight { get; set; }
- public double Multiplier { get; set; }
- public double MultiplierWeight { get; set; }
- public int MaxStrengthGiants { get; set; }
- public int MinStrengthGiants { get; set; }
- public int MaxWeigthGiants { get; set; }
- public int MinWeigthGiants { get; set; }
- public int MultiplierMin { get; set; }
- public int MultiplierMax { get; set; }
- public double MaxHeight { get; set; }
- public double GiantHeight { get; set; }
- public string StringStrength { get; set; }
- public string StringWeight { get; set; }
- public double HumanStrength { get; set; }
- public double GiantStrength { get; set; }
- public int HumanWeight { get; set; }
- public double GiantWeight { get; set; }
- public double WeightDivider { get; set; }
- public double StrengthDivider { get; set; }
- public double RoundedMultiplier { get; set; }
- public double MaxStrengthHuman { get; set; }
- public double WeigthMaxHuman { get; set; }
- public double MaxHumanHeight { get; set; }
- public double MinhumanHeight { get; set; }
- public double MinHumanHeight { get; set; }
- public double MinWeightHuman { get; set; }
- public double MinStrengthHuman { get; set; }
- public double RelativeMaxHeight { get; set; }
- public double RelativeMinheight { get; set; }
- public double CurrentMaxStrength { get; set; }
- public double CurrentMinStrength { get; set; }
- public double CurrentMaxweigth { get; set; }
- public double CurrentMinWeight { get; set; }
- public double StrengthMultiplier { get; set; }
- public double LifeLengthMultiplier { get; set; }
- public double LifeLengthMin { get; set; }
- public double LifeLengthMax { get; set; }
- public double NormalMinLife { get; set; }
- public double NormalMaxLife { get; set; }
- public double LifeLengthVariable { get; set; }
- public string PreviusValues { get; set; }
- private void Activate_Click(object sender, EventArgs e)
- {
- HumanHeight = TbHeight.Value;
- HumanStrength = TbStrength.Value;
- HumanWeight = TbWeight.Value;
- Multiplier = TbMultiplier.Value;
- Multiplier = Multiplier / 100;
- HumanHeight = HumanHeight / 100;
- switch (TbMode.Value)
- {
- case 1:
- WeightDivider = 2.5;
- StrengthDivider = 3;
- MultiplierWeight = 3;
- StrengthMultiplier = 3;
- NormalMinLife = 45;
- NormalMaxLife = 65;
- MaxHeight = 18.5;
- LifeLengthVariable = 1.5;
- break;
- case 2:
- WeightDivider = 2.5;
- StrengthDivider = 1.75;
- MultiplierWeight = 3;
- StrengthMultiplier = 3;
- NormalMinLife = 145;
- NormalMaxLife = 185;
- MaxHeight = 13.5;
- LifeLengthVariable = 2;
- break;
- case 3:
- WeightDivider = 1;
- StrengthDivider = 1;
- MultiplierWeight = 2;
- StrengthMultiplier = 3;
- NormalMinLife = 70;
- NormalMaxLife = 95;
- LifeLengthVariable = 1;
- MaxHeight = 1;
- break;
- case 4:
- WeightDivider = 1;
- StrengthDivider = 1;
- MultiplierWeight = 3;
- StrengthMultiplier = 3;
- LifeLengthVariable = 1;
- MaxHeight = 1;
- break;
- }
- if (TbMode.Value != 4)
- {
- LifeLengthMultiplier = Multiplier * LifeLengthVariable * (Multiplier / MaxHeight);
- LifeLengthMin = Math.Round(LifeLengthMultiplier * NormalMinLife);
- LifeLengthMax = Math.Round(LifeLengthMultiplier * NormalMaxLife);
- LifeLengthMultiplier = Math.Round(LifeLengthMultiplier, 2, MidpointRounding.ToEven);
- lblpotage.Text = "Expected life length is " + LifeLengthMin + " to " + LifeLengthMax + " years." + " (" + LifeLengthMultiplier + ")";
- }
- else
- lblpotage.Text = "She can never die of age or mortal harm";
- GiantHeight = HumanHeight * Multiplier;
- GiantStrength = System.Math.Pow(Multiplier, MultiplierWeight) * HumanStrength / StrengthDivider;
- GiantWeight = System.Math.Pow(Multiplier, StrengthMultiplier) * HumanWeight / WeightDivider;
- if (GiantStrength > 1000000)
- {
- GiantStrength = GiantStrength / 1000000;
- StringStrength = "M Kg";
- }
- else
- {
- GiantStrength = GiantStrength / 1000;
- StringStrength = "T";
- }
- if (GiantWeight > 1000000)
- {
- GiantWeight = GiantWeight / 1000000;
- StringWeight = "M Kg";
- }
- else
- {
- GiantWeight = GiantWeight / 1000;
- StringWeight = "T";
- }
- GiantHeight = Math.Round(GiantHeight, 2);
- GiantStrength = Math.Round(GiantStrength, 2);
- GiantWeight = Math.Round(GiantWeight, 2);
- lblMultiplier.Text = "" + Multiplier;
- lblHeightHuman.Text = HumanHeight + "m";
- lblStrengthHuman.Text = HumanStrength + "Kg";
- lblWeightHuman.Text = HumanWeight + "Kg";
- lblHeight.Text = "Height: " + GiantHeight + "m";
- lblStrength.Text = "Strength: " + GiantStrength + StringStrength;
- lblWeight.Text = "Weight: " + GiantWeight + StringWeight;
- }
- protected override void OnShown(EventArgs e)
- {
- Activate.PerformClick();
- lblMode.Text = "Giants";
- }
- private void TbHeight_Scroll(object sender, EventArgs e)
- {
- HumanHeight = TbHeight.Value;
- switch (TbMode.Value)
- {
- case 1:
- MaxStrengthHuman = 300;
- WeigthMaxHuman = 125;
- MaxHumanHeight = 230;
- MinHumanHeight = 100;
- MinWeightHuman = 20;
- MinStrengthHuman = 30;
- break;
- case 2:
- MaxStrengthHuman = 250;
- WeigthMaxHuman = 75;
- MinHumanHeight = 100;
- MaxHumanHeight = 165;
- MinWeightHuman = 20;
- MinStrengthHuman = 30;
- break;
- case 3:
- MaxStrengthHuman = 250;
- WeigthMaxHuman = 130;
- MinHumanHeight = 100;
- MaxHumanHeight = 230;
- MinWeightHuman = 20;
- MinStrengthHuman = 30;
- break;
- case 4:
- MaxStrengthHuman = 187;
- WeigthMaxHuman = 63;
- MinHumanHeight = 177;
- MaxHumanHeight = 179;
- MinWeightHuman = 61;
- MinStrengthHuman = 185;
- break;
- }
- if (TbMode.Value != 4)
- {
- RelativeMaxHeight = (HumanHeight) / (MaxHumanHeight);
- RelativeMinheight = (HumanHeight) / (MinHumanHeight);
- CurrentMaxStrength = (MaxStrengthHuman * RelativeMaxHeight);
- CurrentMinStrength = (MinStrengthHuman * RelativeMinheight);
- CurrentMaxweigth = (WeigthMaxHuman * RelativeMaxHeight);
- CurrentMinWeight = (MinWeightHuman * RelativeMinheight);
- TbStrength.Maximum = (int)CurrentMaxStrength;
- TbStrength.Minimum = (int)CurrentMinStrength;
- TbStrength.Value = (int)((CurrentMaxStrength + CurrentMinStrength) / 2);
- TbWeight.Minimum = (int)CurrentMinWeight;
- TbWeight.Maximum = (int)CurrentMaxweigth;
- TbWeight.Value = (int)((CurrentMaxweigth + CurrentMinWeight) / 2);
- }
- else
- {
- TbStrength.Maximum = 187;
- TbStrength.Minimum = 185;
- TbStrength.Value = 186;
- TbWeight.Maximum = 63;
- TbWeight.Minimum = 61;
- TbWeight.Value = 62;
- }
- }
- private void TbStrength_Scroll(object sender, EventArgs e)
- { }
- private void TbWeight_Scroll(object sender, EventArgs e)
- { }
- private void TbMultiplier_Scroll(object sender, EventArgs e)
- { }
- private void TbMode_Scroll(object sender, EventArgs e)
- {
- switch (TbMode.Value)
- {
- case 1: // Giants
- MultiplierMin = 1850;
- MultiplierMax = 1300;
- MaxStrengthGiants = 300;
- MinStrengthGiants = 30;
- MaxWeigthGiants = 125;
- MinWeigthGiants = 20;
- TbHeight.Maximum = 225;
- TbHeight.Minimum = 100;
- TbHeight.Value = 170;
- lblMode.Text = "Giants";
- break;
- case 2: // Tigrissess
- MaxStrengthGiants = 250;
- MinStrengthGiants = 50;
- MaxWeigthGiants = 75;
- MinWeigthGiants = 25;
- MultiplierMin = 1350;
- MultiplierMax = 1050;
- TbHeight.Maximum = 165;
- TbHeight.Minimum = 100;
- TbHeight.Value = 140;
- lblMode.Text = "Giant Tigri";
- break;
- case 3: // Realistic
- MaxStrengthGiants = 250;
- MinStrengthGiants = 50;
- MaxWeigthGiants = 130;
- MinWeigthGiants = 30;
- MultiplierMin = 5000;
- MultiplierMax = 500;
- TbHeight.Maximum = 225;
- TbHeight.Minimum = 100;
- TbHeight.Value = 175;
- lblMode.Text = "Realistic giants";
- break;
- case 4: // Avina
- MaxStrengthGiants = 187;
- MinStrengthGiants = 185;
- MaxWeigthGiants = 63;
- MinWeigthGiants = 61;
- MultiplierMin = 4051;
- MultiplierMax = 4049;
- TbHeight.Maximum = 179;
- TbHeight.Minimum = 177;
- TbHeight.Value = 178;
- lblMode.Text = "Avina ";
- break;
- }
- TbStrength.Maximum = MaxStrengthGiants;
- TbStrength.Minimum = MinStrengthGiants;
- TbStrength.Value = (MaxStrengthGiants + MinStrengthGiants) / 2;
- TbWeight.Maximum = MaxWeigthGiants;
- TbWeight.Minimum = MinWeigthGiants;
- TbWeight.Value = (MaxWeigthGiants + MinWeigthGiants) / 2;
- TbMultiplier.Maximum = MultiplierMin;
- TbMultiplier.Minimum = MultiplierMax;
- TbMultiplier.Value = (MultiplierMin + MultiplierMax) / 2;
- }
- private void Round_Click(object sender, EventArgs e)
- {
- Multiplier = TbMultiplier.Value;
- Multiplier = Multiplier / 100;
- try
- {
- RoundedMultiplier = Math.Round((double)Multiplier, 1, MidpointRounding.ToEven);
- if (RoundedMultiplier == Multiplier)
- RoundedMultiplier = Math.Round((double)Multiplier, MidpointRounding.ToEven);
- RoundedMultiplier = RoundedMultiplier * 100;
- TbMultiplier.Value = Convert.ToInt32(RoundedMultiplier);
- }
- catch (ArgumentOutOfRangeException)
- { }
- PreviusValues = "" + TbMultiplier.Value + TbWeight.Value + TbStrength.Value + TbHeight.Value;
- Activate.PerformClick();
- }
- private void CB_SelectedIndexChanged(object sender, EventArgs e)
- {
- }
- private void Form1_Load(object sender, EventArgs e)
- {
- }
- private void timer_Tick(object sender, EventArgs e)
- {
- if (PreviusValues != ("" + TbMultiplier.Value + TbWeight.Value + TbStrength.Value + TbHeight.Value))
- {
- PreviusValues = "" + TbMultiplier.Value + TbWeight.Value + TbStrength.Value + TbHeight.Value;
- Activate.PerformClick();
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement