-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathflashOfGenius.py
35 lines (35 loc) · 1.19 KB
/
flashOfGenius.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
!alias flash tembed
<drac2>
input_recieved = False
if len(&ARGS&) > 0:
input_recieved = True
args = &ARGS&
input = int(args[0])
ability_name = "Flash of Genius"
cc_name = "Flash of Genius"
cc_value = character().get_cc(cc_name)
return_string = ""
if cc_value >= 1:
cc_use = 1
character().mod_cc(cc_name, -cc_use)
return_string = (
f'-title "{name} uses {ability_name}!" '
f'-desc "When you or another creature you can see within 30 feet of you makes an ability check or a saving throw, you can use your reaction to add your Intelligence modifier to the roll." '
)
if input_recieved:
return_string += (f'-f "New Roll|{str(input)} + {str(intelligenceMod)} = {str(int(input)+intelligenceMod)}|inline" ')
else:
return_string += (f'-f "Roll Bonus|+{intelligenceMod}|inline" ')
else:
cc_use = 0
return_string = (
f' -title "{name} fails to use {ability_name}!" '
f' -desc "Take a long rest." '
)
cc_current = character().cc_str(cc_name)
return_string += (
f'-f "{cc_name} (-{cc_use})| {cc_current}|inline" '
f'-footer "{ctx.prefix}{ctx.alias} [original roll (optional)]"'
)
return return_string
</drac2>