Date: 2020/02/21 21:36:34 UTC-08:00
Type: Denizen Script
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
SeasonalDigitalTimer:
type: task
debug: false
Config:
Winter:
Blocks: <location[2,77,99911,PvP_World]>
Teleport: <location[-1,81,100003,PvP_World].add[<util.random.gauss>,0,<util.random.gauss>]>
Cuboid: <cuboid[PvP_World,7,77,99907,-7,77,99913]>
Spring:
Blocks:
Teleport:
Cuboid:
Summer:
Blocks:
Teleport:
Cuboid:
Autumn:
Blocks:
Teleport:
Cuboid:
script:
- define arena <[1]>
- repeat 10:
- if !<schematic[<[arena]>_Readout_<value].sub[1]>].exists>:
- schematic load name:<[arena]>_Readout_<[value].sub[1]>
- flag server <[arena]>_timer_queue:<queue>
- flag server <[arena]>_Match_Start_Timer duration:30s
- modifyblock <list[<script.yaml_key[Config.<[arena]>.Blocks].parsed>|<script.yaml_key[Config.<[arena]>.Blocks].parsed.sub[0,0,2]>]> glowstone
- while <server.has_flag[<[arena]>_Match_Start_Timer]>:
- define readout_A:<server.flag[<[arena]>_Match_Start_Timer].expiration.in_seconds.add[1].div[60].round_down>
- define readout_B:<server.flag[<[arena]>_Match_Start_Timer].expiration.in_seconds.add[1].div[10].round_down>
- if <[readout_A]> > 0:
- define readout_B:<[readout_B].sub[6]>
- define readout_C:<server.flag[<[arena]>_Match_Start_Timer].expiration.in_seconds.add[1].mod[10].round_down>
- schematic paste name:<[arena]>_Readout_<[readout_A]> <script.yaml_key[Config.<[arena]>.Blocks].parsed.add[2,0,-3]>
- schematic paste name:<[arena]>_Readout_<[readout_B]> <script.yaml_key[Config.<[arena]>.Blocks].parsed.add[-4,0,-3]>
- schematic paste name:<[arena]>_Readout_<[readout_C]> <script.yaml_key[Config.<[arena]>.Blocks].parsed.add[-8,0,-3]>
- if <list[29.9|14.9|9.9|4.9|3.9|2.9|1.9|0.9].contains[<server.flag[<[arena]>_Match_Start_Timer].expiration.in_seconds.round_down.to[1]>]>:
- narrate "<&b>Match will begin in <server.flag[<[arena]>_Match_Start_Timer].expiration.in_seconds> seconds." targets:<cuboid[<[arena]>_Lobby].list_players>
- if <list[4.9|3.9|2.9|1.9|0.9].contains[<server.flag[<[arena]>_Match_Start_Timer].expiration.in_seconds.round_to[1]>]>:
- title "title:<&4><server.flag[<[arena]>_Match_Start_Timer].expiration.in_seconds.round_up>" "subtitle:<&b>You will be teleported to the arena." fade_in:0t fade_out:1s targets:<cuboid[<[arena]>_Lobby].list_players.filter[has_flag[<[arena]>_match_joined]]>
- wait 1t
- modifyblock <script.yaml_key[Config.<[arena]>.Cuboid].parsed> snow_block
- if <cuboid[<[arena]>_Lobby].list_players.filter[has_flag[<[arena]>_match_joined]].size> < 2:
- narrate "<&4>Match cancelled. Not enough players!" targets:<cuboid[<[arena]>_Lobby].list_players>
- title "title:<&4>Match Cancelled." "subtitle:<&c>Not enough players!" targets:<cuboid[<[arena]>_Lobby].list_players>
- foreach <cuboid[<[arena]>_Lobby].list_players>:
- flag <[value]> <[arena]>_match_joined:!
- flag <[value]> noteleport:!
- flag server <[arena]>_Match_State:ready
- wait 1t
- inject SeasonalLobbyCenterSignsTask instantly
- stop
- run <[arena]>InventorySwap def:START instantly
- foreach <cuboid[<[arena]>_Lobby].list_players.filter[has_flag[<[arena]>_match_joined]]>:
- flag <[value]> noteleport
- adjust <[value]> item_slot:1
- teleport <[value]> <script.yaml_key[Config.<[arena]>.Teleport].parsed>
- wait 1t
- title "title:<&4>Match Not Joined!" "subtitle:<&c>You did not click the button in time." targets:<cuboid[<[arena]>_Lobby].list_players>
- narrate "<&4>Match not joined. You did not click the button in time." targets:<cuboid[<[arena]>_Lobby].list_players>
- flag server <[arena]>_Match_State:inprogress
- inject SeasonalLobbyCenterSignsTask instantly
- run <[arena]>_MatchStart instantly
- flag server <[arena]>_timer_queue:!
SeasonalDigitalTimer_STOP:
type: task
debug: false
script:
- queue <server.flag[<[arena]>_timer_queue]> clear
- flag server <[arena]>_timer_queue:!
- flag server <[arena]>_Match_Start_Timer:!
- modifyblock <script[SeasonalDigitalTimer].yaml_key[Config.<[arena]>.Cuboid].parsed> snow_block
- narrate "<&4>Match cancelled. All players left the queue." targets:<cuboid[<[arena]>_Lobby].list_players>
- title "title:<&4>Match Cancelled." "subtitle:<&c>All players left the queue." targets:<cuboid[<[arena]>_Lobby].list_players>
- wait 2s
- flag server <[arena]>_Match_State:ready
- inject SeasonalLobbyCenterSignsTask instantly