forked from StrawberryPear/healstatus
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathScoreCalculator.lua
107 lines (76 loc) · 3.39 KB
/
ScoreCalculator.lua
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
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
local _, addon = ...;
local TANK_HEALTH = 6000;
addon.getLightScore = function(playerMana, healthMissing, maxHealth, danger)
if (playerMana < 700) then return 0; end
local dangerMissingHealthModifier = ((danger > 0.25) and 500) or 0;
local healthMissingScore = ((dangerMissingHealthModifier + healthMissing) - 3000) * 1.5;
local healthScore = (maxHealth / TANK_HEALTH) * 100;
local totalScore = healthMissingScore + healthScore;
return math.min(totalScore, 42) + totalScore / 100;
end
addon.getLightCancelScore = function(healthMissing)
return healthMissing - 1200;
end
addon.getFlashSixScore = function(playerMana, healthMissing, maxHealth, danger)
if (playerMana < 400) then return 0; end
local dangerMissingHealthModifier = ((danger > 0.1) and 50) or 0;
local healthMissingScore = ((dangerMissingHealthModifier + healthMissing) - 600) * 0.5;
local healthScore = (1 - (maxHealth / TANK_HEALTH)) * 40;
local totalScore = healthMissingScore + danger + healthScore;
return math.min(totalScore, 28) + totalScore / 100;
end
addon.getFlashSixCancelScore = function(healthMissing)
return healthMissing - 200;
end
addon.getFlashFourScore = function(playerMana, healthMissing, maxHealth, danger)
if (playerMana < 200) then return 0; end
local healthMissingScore = (healthMissing - 400) * 0.33;
local healthScore = (1 - (maxHealth / TANK_HEALTH)) * 10;
local totalScore = healthMissingScore + healthScore;
return math.min(totalScore, 22) + totalScore / 100;
end
addon.getFlashFourCancelScore = function(healthMissing)
return healthMissing - 100;
end
addon.getFlashOneScore = function(playerMana, healthMissing, maxHealth, danger)
if (playerMana < 100) then return 0; end
local healthMissingScore = healthMissing * 0.015;
local healthScore = (maxHealth / TANK_HEALTH) * 10;
local totalScore = healthMissingScore + healthScore;
return math.min(totalScore, 10) + totalScore / 100;
end
addon.getFlashFourCancelScore = function(healthMissing)
return 10;
end
-- PRIEST
addon.getGreaterHealScore = function(playerMana, healthMissing, maxHealth, danger)
if (playerMana < 350) then return 0; end
local healthMissingScore = (healthMissing - 800) * 1.5;
local healthScore = (maxHealth / TANK_HEALTH) * 100;
local totalScore = healthMissingScore + healthScore;
return math.min(totalScore, 42) + totalScore / 100;
end
addon.getGreaterHealCancelScore = function(healthMissing)
return healthMissing - 700;
end
addon.getHealScore = function(playerMana, healthMissing, maxHealth, danger)
if (playerMana < 300) then return 0; end
local dangerMissingHealthModifier = ((danger > 0.1) and 50) or 0;
local healthMissingScore = ((dangerMissingHealthModifier + healthMissing) - 700) * 0.5;
local healthScore = (1 - (maxHealth / TANK_HEALTH)) * 40;
local totalScore = healthMissingScore + danger + healthScore;
return math.min(totalScore, 28) + totalScore / 100;
end
addon.getHealCancelScore = function(healthMissing)
return healthMissing - 500;
end
addon.getFlashHealScore = function(playerMana, healthMissing, maxHealth, danger)
if (playerMana < 200) then return 0; end
local healthMissingScore = (healthMissing - 400) * 0.33;
local healthScore = (1 - (maxHealth / TANK_HEALTH)) * 10;
local totalScore = healthMissingScore + healthScore;
return math.min(totalScore, 22) + totalScore / 100;
end
addon.getFlashHealCancelScore = function(healthMissing)
return healthMissing - 400;
end