Date: 2016/04/19 19:46:22 UTC-07: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
boolean:
- goto '<t[<def[orderedRegions].equals_case_sensitive[li@__global__]>]:GLOBAL||REGION>'
# Global Event Handler.
- mark 'GLOBAL'
- define thisRegion '__global__'
- goto '<yaml[dRegions_%world%_cache].read[cache.boolean.__global__.%flag%]||a>'
- mark 'a'
- goto '<proc[dRegions_GetInheritedFlag].context[%world%|__global__|%flag%]>'
# Region Event Handler.
- mark 'REGION'
- define thisRegion '<def[orderedRegions].get[1]>'
- if '<s@dRegions_Flag_%flag%.yaml_key[region_highestOnly]||false>' {
- goto '<yaml[dRegions_%world%_cache].read[cache.boolean.%thisRegion%.%flag%]||b>'
- mark 'b'
- goto '<proc[dRegions_GetInheritedFlag].context[%world%|%thisRegion%|%flag%]>'
}
- foreach '%orderedRegions%' {
- define finalRegion '%value%'
- goto '<yaml[dRegions_%world%_cache].read[cache.boolean.%finalRegion%.%flag%]||c>'
- mark 'c'
- define flagObj '<proc[dRegions_GetInheritedFlag].context[%world%|%value%|%flag%]>'
- if '<def[flagObj].equals_case_sensitive[none].not>' {
- foreach stop
}
}
- goto '%flagObj%'
# This code is shared by the global and the region handlers
- mark 'true'
- yaml set 'cache.boolean.%thisRegion%.%flag%:true' 'id:dRegions_%world%_cache'
- mark 'none'
- inject 's@dRegions_Flag_%flag%' 'p:event-allowed'
# This foreach takes the event to the next flag if it exists
- foreach next
- queue clear
- mark 'false'
- yaml set 'cache.boolean.%thisRegion%.%flag%:false' 'id:dRegions_%world%_cache'
- inject 's@dRegions_Flag_%flag%' 'p:event-cancelled'
- if <def[noCancel].exists> {
- foreach next
- queue clear
}
- determine cancelled