-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpowerPlay.opy
More file actions
69 lines (64 loc) · 2.65 KB
/
powerPlay.opy
File metadata and controls
69 lines (64 loc) · 2.65 KB
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
#!mainFile "conquest.opy"
subroutine playSoundForAll
def playSoundForAll():
for i in range(0,getNumberOfPlayers(Team.ALL)):
playEffect(getAllPlayers()[i], DynamicEffect.RING_EXPLOSION_SOUND, Color.WHITE, getAllPlayers()[i], 200)
rule "If a Team controls all 3 points, activate Power Play":
@Event global
@Condition powerPlayEnabled
@Condition zoneControl[0] == Team.1 or zoneControl[0] == Team.2
@Condition all([c == zoneControl[0] for c in zoneControl])
# If a team is about to win, don't trigger a power play
if teamScore(Team.1) >= scoreToWin or teamScore(Team.2) >= scoreToWin:
playSoundForAll()
return
powerPlayActive = true
powerPlayTimer = powerPlayDuration if overtime else min(powerPlayDuration, getMatchTime())
stopAllProgress()
setSlowMotion(10)
getAllPlayers().setAimSpeed(50)
setObjectiveDescription(getAllPlayers(), "Power Play", HudReeval.VISIBILITY)
resumeMatchTime = max(getMatchTime() - powerPlayTimer, 0)
setMatchTime(powerPlayDuration)
bigMessage(getAllPlayers(), "Power Play")
bigMessage(getAllPlayers(), "Zones Locked")
if powerPlayMarkers:
toggleSkulls(true)
playSoundForAll()
getPlayers(getOppositeTeam(zoneControl[0])).setStatusEffect(null, Status.BURNING, powerPlayDuration + 0.5)
pauseMatchTime()
wait(0.5, Wait.IGNORE_CONDITION)
setSlowMotion(100)
getAllPlayers().setAimSpeed(100)
unpauseMatchTime()
chase(powerPlayTimer, 0, rate=1, ChaseReeval.NONE)
rule "Reapply burning effect if not burning":
@Event eachPlayer
@Condition powerPlayActive
@Condition eventPlayer.getTeam() == getOppositeTeam(zoneControl[0])
@Condition not eventPlayer.hasStatusEffect(Status.BURNING)
eventPlayer.setStatusEffect(null, Status.BURNING, powerPlayTimer)
rule "At end of Power Play, reset points":
@Event global
@Condition powerPlayActive and powerPlayTimer == 0
stopChasingVariable(powerPlayTimer)
if powerPlayMarkers:
toggleSkulls(false)
if overtime:
setObjectiveDescription(getAllPlayers(), "Overtime", HudReeval.VISIBILITY)
else:
setObjectiveDescription(getAllPlayers(), "Fight", HudReeval.VISIBILITY)
bigMessage(getAllPlayers(), "Power Play Ended")
setMatchTime(resumeMatchTime)
triggerPointReset()
playSoundForAll()
if createWorkshopSetting(bool, "Power Play Settings", "Reset Ults When Power Play Ends", true, 3):
getAllPlayers().setUltCharge(0)
# Use different sides from the previous Power Play
swapSides = not swapSides
# Reset spawns
if swapSides:
currTeamSpawns = [2,0]
else:
currTeamSpawns = [0,2]
powerPlayActive = false