Date: 2020/02/03 15:11:58 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
doubledoors:
type: world
events:
on player right clicks *door using hand:
- determine passively cancelled
- define 1x1:<context.location.center.relative[1,0,1]>
- define -1x-1:<context.location.center.relative[-1,0,-1]>
- define doors:<cuboid[<[1x1]>|<[-1x-1]>].blocks[<context.location.material>].exclude[<context.location>]>
- if <[doors].is_empty>:
- switch <context.location> state:toggle
- stop
- narrate <context.location.material.direction>
- foreach <[doors]>:
- if <context.location.material.direction> == <[value].material.direction>:
- switch <[value]>|<context.location> state:toggle
- stop
- choose <context.location.material.direction>:
- case north:
- if <[value]> == <context.location.add[1,0,1]> && <[value].material.direction> == east:
- switch <[value]>|<context.location> state:toggle
- stop
- else <[value]> == <context.location.add[-1,0,1]> && <[value].material.direction> == west:
- switch <[value]>|<context.location> state:toggle
- stop
- case south:
- if <[value]> == <context.location.add[1,0,-1]> && <[value].material.direction> == east:
- switch <[value]>|<context.location> state:toggle
- stop
- else <[value]> == <context.location.add[-1,0,-1]> && <[value].material.direction> == west:
- switch <[value]>|<context.location> state:toggle
- stop
- case east:
- if <[value]> == <context.location.add[-1,0,1]> && <[value].material.direction> == north:
- switch <[value]>|<context.location> state:toggle
- stop
- else <[value]> == <context.location.add[-1,0,-1]> && <[value].material.direction> == south:
- switch <[value]>|<context.location> state:toggle
- stop
- case west:
- if <[value]>|<[value].material.direction> == <context.location.add[1,0,-1]>|north:
- switch <[value]>|<context.location> state:toggle
- stop
- else <[value]>|<[value].material.direction> == <context.location.add[1,0,1]>|south:
- switch <[value]>|<context.location> state:toggle
- stop