-
Notifications
You must be signed in to change notification settings - Fork 0
/
debuffSuccessChance.cs
62 lines (55 loc) · 1.78 KB
/
debuffSuccessChance.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
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 WOTV_FFBE
{
public partial class debuffSuccessChance : Form
{
public debuffSuccessChance()
{
InitializeComponent();
}
private void button1_Click(object sender, EventArgs e)
{
double.TryParse(textBox1.Text, out double successChance);
double.TryParse(textBox2.Text, out double enemyResistance);
double.TryParse(textBox3.Text, out double yourFTH);
double.TryParse(textBox4.Text, out double enemyFTH);
successChance = (successChance - enemyResistance) / 100;
if(successChance <= 0) { finalResult.Text = "0%"; return; }
successChance *= yourFTH + enemyFTH;
finalResult.Text = Math.Truncate(successChance) + "%";
}
private void button2_Click(object sender, EventArgs e)
{
textBox3.Text = "30";
textBox4.Text = "30";
button1_Click(button2, EventArgs.Empty);
}
private void button3_Click(object sender, EventArgs e)
{
textBox3.Text = "30";
textBox4.Text = "97";
button1_Click(button3, EventArgs.Empty);
}
private void button4_Click(object sender, EventArgs e)
{
textBox3.Text = "97";
textBox4.Text = "97";
button1_Click(button4, EventArgs.Empty);
}
private void debuffSuccessChance_KeyDown(object sender, KeyEventArgs e)
{
if (e.KeyCode == Keys.Escape)
{
this.Close();
}
}
}
}