-
Notifications
You must be signed in to change notification settings - Fork 0
/
services.py
31 lines (26 loc) · 849 Bytes
/
services.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
# -*- coding: UTF-8 -*-
# P-uppgift grupdat VT-2014
# Tobias Bolin
# errands
# Contains functions representing
# services a facility can provide
import random
def robbed(facility):
if facility.attraction < 4: facility.attraction += 0.5
elif facility.attraction > 8: facility.attraction -= 3
elif facility.attraction > 4: facility.attraction -= 1
else: facility.effects = []
def robbery(facility, client, state):
if state == 'add':
facility.timer = 0
facility.queue = []
facility.current = None
# Franco wins 4 out of 5
if not random.randint(0,4):
facility.loger(client, 'robberyl', "and manages to overpower Franco")
facility.attraction = 20
else:
facility.loger(client, 'robberyw', 'but is quickly tickled into submision by Franco')
facility.attraction = 1
facility.effects.append(robbed)
return False