Some extra event stuff

This commit is contained in:
2025-05-20 11:04:04 -05:00
parent 36762682b8
commit 8311d7c68f
6 changed files with 12 additions and 11 deletions

View File

@@ -0,0 +1,58 @@
class_name EventIfFlag extends "res://scripts/Event/Condition/EventIf.gd"
enum Type {
ANY_OF_FLAGS_ON,
ALL_OF_FLAGS_ON,
ANY_OF_FLAGS_OFF,
ALL_OF_FLAGS_OFF,
}
@export var event:EventSystem.SpecialEvent;
@export var type:Type = Type.ANY_OF_FLAGS_ON;
@export_flags(
"1:1",
"2:2",
"3:4",
"4:8",
"5:16",
"6:32",
"7:64",
"8:128",
"9:256",
"10:512",
"11:1024",
"12:2048",
"13:4096",
"14:8192",
"15:16384",
"16:32768",
"17:65536",
"18:131072",
"19:262144",
"20:524288",
"21:1048576",
"22:2097152",
"23:4194304",
"24:8388608",
"25:16777216",
"26:33554432",
"27:67108864",
"28:134217728",
"29:268435456",
"30:536870912",
"31:1073741824",
"32:2147483648"
)
var eventFlag:int = 0;
func ifCondition() -> bool:
match type:
Type.ANY_OF_FLAGS_ON:
return EVENT.eventIsAnyOfFlagsOn(event, eventFlag)
Type.ALL_OF_FLAGS_ON:
return EVENT.eventAreFlagsOn(event, eventFlag)
Type.ANY_OF_FLAGS_OFF:
return EVENT.eventIsAnyOfFlagsOff(event, eventFlag)
Type.ALL_OF_FLAGS_OFF:
return EVENT.eventAreFlagsOff(event, eventFlag)
return false