/
mode_9.py
110 lines (96 loc) · 4.61 KB
/
mode_9.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
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
#################################################################################
## _________ ____ ________ _______ __ _____ __ __ __________ __
## / ____/ | / __ \/_ __/ / / / ___// / / / | / //_// ____/ __ \/ /
## / __/ / /| | / /_/ / / / / /_/ /\__ \/ /_/ / /| | / ,< / __/ / /_/ / /
## / /___/ ___ |/ _, _/ / / / __ /___/ / __ / ___ |/ /| |/ /___/ _, _/_/
## /_____/_/ |_/_/ |_| /_/ /_/ /_//____/_/ /_/_/ |_/_/ |_/_____/_/ |_(_)
## ___ ______________________ _____ __ ______ ________ __
## / | / ____/_ __/ ____/ __ \/ ___// / / / __ \/ ____/ //_/
## / /| | / /_ / / / __/ / /_/ /\__ \/ /_/ / / / / / / ,<
## / ___ |/ __/ / / / /___/ _, _/___/ / __ / /_/ / /___/ /| |
## /_/ |_/_/ /_/ /_____/_/ |_|/____/_/ /_/\____/\____/_/ |_|
##
## A P-ROC Project by Scott Danesi, Copyright 2013-2014
## Built on the PyProcGame Framework from Adam Preble and Gerry Stellenberg
#################################################################################
#################################################################################
## _________ ____ ___________ ________ _________ ____ _ _______ _____ __
## / ____/ | / __ \/_ __/ _/ | / / ____/ / ____/ | / __ \/ | / / _/ | / / | / /
## / / / /| | / /_/ / / / / / | | / / __/ / / / /| | / /_/ / |/ // / | | / / /| | / /
## / /___/ ___ |/ ____/ / / _/ / | |/ / /___ / /___/ ___ |/ _, _/ /| // / | |/ / ___ |/ /___
## \____/_/ |_/_/ /_/ /___/ |___/_____/ \____/_/ |_/_/ |_/_/ |_/___/ |___/_/ |_/_____/
##
#################################################################################
import procgame
from procgame import *
import locale
import logging
class Mode9(game.Mode):
"""docstring for Bonus"""
def __init__(self, game, priority):
super(Mode9, self).__init__(game, priority)
self.captiveLevel = 0
def mode_started(self):
self.game.modes.remove(self.game.skillshot_mode)
self.game.utilities.set_player_stats('mode9_status',0)
self.game.shelter_mode.refreshPlayerInfo()
self.game.update_lamps()
self.incrementCaptiveLevel()
self.delay(delay=20,handler=self.game.modes.remove,param=self)
def mode_stopped(self):
self.captiveLevel = 0
self.game.lamps.captive25k.disable()
self.game.lamps.captive50k.disable()
self.game.lamps.captive100k.disable()
self.game.lamps.captive150k.disable()
self.game.lamps.captive250k.disable()
self.game.utilities.set_player_stats('mode9_status',1)
self.cancel_delayed('increment')
def update_lamps(self):
self.game.lamps.captive25k.disable()
self.game.lamps.captive50k.disable()
self.game.lamps.captive100k.disable()
self.game.lamps.captive150k.disable()
self.game.lamps.captive250k.disable()
if self.captiveLevel >= 1:
self.game.lamps.captive25k.enable()
if self.captiveLevel >= 2:
self.game.lamps.captive50k.enable()
if self.captiveLevel >= 3:
self.game.lamps.captive100k.enable()
if self.captiveLevel >= 4:
self.game.lamps.captive150k.enable()
if self.captiveLevel == 5:
self.game.lamps.captive250k.enable()
def incrementCaptiveLevel(self):
if (self.captiveLevel < 5):
self.captiveLevel += 1
else:
self.captiveLevel = 1
self.update_lamps()
self.delay(name='increment',delay=.2,handler=self.incrementCaptiveLevel)
def awardCaptiveValue(self):
self.cancel_delayed('increment')
if self.captiveLevel == 1:
self.game.utilities.score(25000)
self.game.lamps.captive25k.schedule(schedule=0xCCCCCCCC, cycle_seconds=0, now=True)
elif self.captiveLevel == 2:
self.game.utilities.score(50000)
self.game.lamps.captive50k.schedule(schedule=0xCCCCCCCC, cycle_seconds=0, now=True)
elif self.captiveLevel == 3:
self.game.utilities.score(100000)
self.game.lamps.captive100k.schedule(schedule=0xCCCCCCCC, cycle_seconds=0, now=True)
elif self.captiveLevel == 4:
self.game.utilities.score(150000)
self.game.lamps.captive150k.schedule(schedule=0xCCCCCCCC, cycle_seconds=0, now=True)
elif self.captiveLevel == 5:
self.game.utilities.score(200000)
self.game.lamps.captive250k.schedule(schedule=0xCCCCCCCC, cycle_seconds=0, now=True)
self.game.sound.play('captive_carnival')
self.delay(delay=.1,handler=self.game.sound.play,param='captive_carnival')
self.delay(delay=.2,handler=self.game.sound.play,param='captive_carnival')
self.delay(delay=.4,handler=self.game.sound.play_voice,param='complete_shot')
self.delay(name='increment',delay=.6,handler=self.incrementCaptiveLevel)
def sw_captiveBall9_closed(self, sw):
self.awardCaptiveValue()
return procgame.game.SwitchStop