-
Notifications
You must be signed in to change notification settings - Fork 0
/
arrowOfSlaying.py
80 lines (75 loc) · 3.03 KB
/
arrowOfSlaying.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
79
80
TODO for adding new types: create cc and add type to arguments for alias
!cc create "Arrows of _ Slaying" -min 0 -desc "If a creature belonging to the type, race, or group associated with an arrow of slaying takes damage from the arrow, the creature must make a DC 17 Constitution saving throw, taking an extra 6d10 piercing damage on a failed save, or half as much extra damage on a successful one.
Once an arrow of slaying deals its extra damage to a creature, it becomes a nonmagical arrow."
#TODO:
- add unordered input handling if implementing below
- add vuln and resist
- add multi-arrow functionality (loop, list, multiline display?)
!alias slay
tembed
<drac2>
if len(&ARGS&) > 0:
args = &ARGS&
type = args[0].lower()
l = len(type)
if type == "aberrations"[0:l]:
type = "Aberration"
elif type == "beasts"[0:l]:
type = "Beast"
elif type == "celestials"[0:l]:
type = "Celestial"
elif type == "dragons"[0:l]:
type = "Dragon"
elif type == "elementals"[0:l]:
type = "Elemental"
elif type == "feys"[0:l]:
type = "Fey"
elif type == "fiends"[0:l]:
type = "Fiend"
elif type == "giants"[0:l]:
type = "Giant"
elif type == "humanoids"[0:l]:
type = "Humanoid"
elif type == "monstrositys"[0:l] or type == "monstrosities"[0:l] :
type = "Monstrosity"
elif type == "oozes"[0:l]:
type = "Ooze"
elif type == "plants"[0:l]:
type = "Plant"
elif type == "undeads"[0:l]:
type = "Undead"
else:
rs = (
f' -title "Specified type of Arrow of Slaying is not enabled!" '
f' -desc "Correct specification or update this alias." '
)
return rs
cc_name = "Arrows of " + type + " Slaying"
cc_val = character().get_cc(cc_name)
num = 1
rs = ""
if cc_val >= num:
cc_use = num
character().mod_cc(cc_name, -cc_use)
rs += f'-title "{name} looses an Arrow of {type} Slaying!" '
rs += f'-desc "If a creature belonging to the type, race, or group associated with an arrow of slaying takes damage from the arrow, the creature must make a **DC 17 Constitution saving throw**, taking an extra 6d10 piercing damage on a failed save, or half as much extra damage on a successful one.\n\nOnce an arrow of slaying deals its extra damage to a creature, it becomes a nonmagical arrow." '
dmg = vroll("6d10[magical piercing]")
rs += f'-f "Damage (DC 17 Con, Save for Half)|{dmg} (Half: `{int(dmg.total/2)}`)" '
else:
cc_use = 0
rs += (
f'-title "{name} fails to loose an Arrow of {type} Slaying!" '
f'-desc "No arrows remaining." '
)
cc_current = character().cc_str(cc_name)
rs += (
f'-f "{cc_name} (-{cc_use})|{cc_current}|inline" '
f'-footer "{ctx.prefix}{ctx.alias} [type (required)]" '
)
else:
rs = (
f'-title "Specify type of Arrow of Slaying!" '
f'-desc "This ensures correct cc interaction." '
)
return rs
</drac2>