-
Notifications
You must be signed in to change notification settings - Fork 0
/
bloodFuryTattoo.py
78 lines (77 loc) · 2.94 KB
/
bloodFuryTattoo.py
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
tembed
<drac2>
die_num = 4 #num d6
crit_text = ""
cc_request = 1
isResistant = False
isVulnerable = False
for input in &ARGS&:
input = input.lower()
length = len(input)
if input == "critical"[0:length] or input == "allcritical"[0:length]:
die_num = 2 * die_num
crit_text = " (CRIT!)"
elif input.isnumeric():
cc_request = int(input)
die_num = cc_request * die_num
elif input == "resistant"[0:length] or input == "resistance"[0:length]:
isResistant = True
elif input == "vulnerable"[0:length] or input == "vulnerability"[0:length]:
isVulnerable = True
cc_name = "Blood Fury Tattoo"
cc_value = character().get_cc(cc_name)
return_string = ""
if cc_value < cc_request:
cc_use = 0
return_string = (
f' -title "{name} fails to use of their {cc_name}!" '
f' -desc "Your {cc_name} does not have {str(cc_request)} remaining charges." '
)
else:
cc_use = cc_request
character().mod_cc(cc_name, -cc_use)
roll_string = str(die_num) + "d6"
if isResistant:
roll_string += "/2"
if cc_use > 1:
return_string += f' -f "Calculation Uncertainty|Multiple resisted strikes may have a lower total than displayed due to rounding down odds." '
if isVulnerable:
roll_string += "*2"
roll_string += "[necrotic]"
damage = vroll(roll_string)
if cc_use == 1:
num_text_1 = "a"
num_text_2 = ""
else:
num_text_1 = str(cc_use)
num_text_2 = "s"
return_string += (
f' -title "{name} makes {num_text_1} Bloodthirsty Strike{num_text_2}!" '
f' -desc "When you hit a creature with a weapon attack, you can expend a charge to deal an extra 4d6 necrotic damage to the target, and you regain a number of hit points equal to the necrotic damage dealt." '
f' -f "Damage{crit_text}|{str(damage)}|inline" '
)
former_hp = character().hp
missing_hp = character().max_hp - former_hp
if damage.total <= missing_hp:
character().modify_hp(damage.total)
return_string += (
f' -f "Healing|{str(former_hp)} + {str(damage.total)} = {str(character().hp)}/{str(character().max_hp)}|inline" '
)
elif missing_hp >= 0:
character().modify_hp(missing_hp)
return_string += (
f' -f "Healing|{str(former_hp)} + {str(missing_hp)} = {str(character().hp)}/{str(character().max_hp)}|inline" '
f' -f "Unused Healing|!hp {str(damage.total - missing_hp)}|inline" '
)
else:
return_string += (
f' -f "Healing|{str(former_hp)} + 0 = {str(character().hp)}/{str(character().max_hp)}|inline" '
f' -f "Unused Healing|!hp {str(damage.total)}|inline" '
)
cc_current = character().cc_str(cc_name)
return_string += (
f' -f "{cc_name} (-{cc_use})| {cc_current}|inline" '
f' -footer "{ctx.prefix}{ctx.alias} [crit(n)] [charges(1)] [?res/vuln]" '
)
return return_string
</drac2>