-
Notifications
You must be signed in to change notification settings - Fork 1
/
charm.py
61 lines (43 loc) · 1.51 KB
/
charm.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
__actionname__ = 'bats eyelashes :lips:'
from sys import argv
from Character import Character, get_data
from dice import d6, check
import private
import slacker
def main(argv):
slack = slacker.Slacker(private.sixthWorld)
charactername = argv[0]
difficulty = argv[1]
channelname = argv[2]
modifiers = \
{
'sexy sleepwear': 4,
'pheromone augmentation': 2
}
last = len(modifiers) - 1
mod_bonus = 0
for key, value in modifiers.items():
mod_bonus += value
character = get_data(charactername)
die_pool = character['Charisma'] + character['Seduction'] + mod_bonus
# create good looking description
description = ''
description += ('_' + character['Name'] + ' ' + __actionname__ + '_\n')
description += (
"Charisma(" + str(character['Charisma']) + ") + " +
"Seduction(" + str(character['Seduction']) + ") + ")
for i, key in enumerate(modifiers):
if i == last:
operator = '= '
else:
operator = '+ '
description += (
str(key) + "(" + str(modifiers[key]) + ") " + operator)
description += ("*" + str(die_pool) + "d6*")
# perform the roll
roll = d6(die_pool)
# send results to slack
output = check(difficulty, roll)
slack.chat.post_message(channelname, description + '\n' + str(roll) + "\n" + output, username=character['Name'], icon_url=character['imageURL'])
if __name__ == '__main__':
main(['jtrip', 5, '#scratch'])