semi-idle-arpg/scripts/Globals.gd

88 lines
1.8 KiB
GDScript3
Raw Normal View History

# file containing type information to be referrenced by other classes
extends Node
2024-10-22 14:11:05 -06:00
var debugSpeedEnabled : bool
class World:
2024-10-20 16:44:08 -06:00
enum Zone {
TUTORIAL,
}
2024-10-20 16:44:08 -06:00
enum AreaType {
PEACEFUL,
URBAN,
WILDS,
DEEP_WILDS,
DUNGEON,
}
2024-10-20 16:44:08 -06:00
enum Faction {
CREATURE,
MONSTER,
}
class Ability:
2024-10-20 16:44:08 -06:00
enum PDamageType {
SLICE,
PUNCTURE,
BASH,
HACK,
SHRED,
}
2024-10-20 16:44:08 -06:00
enum MDamageType {
BURN,
FREEZE,
SHOCK,
POISON,
LIFE,
MENTAL,
RADIANT,
ARCANE,
FORCE
}
2024-10-20 16:44:08 -06:00
enum StatusModType {
STUN,
SLOW,
ABSORB,
SHIELD,
2024-10-20 16:44:08 -06:00
DOT,
DOTB,
DOTE
}
class Weapon:
enum WeaponType {
SWORD,
BOW,
}
func debug_print(value: String) -> void:
if OS.is_debug_build():
2024-10-21 13:09:51 -06:00
print(value)
2024-10-22 14:11:05 -06:00
func fade_node(node: Node, direction: String, duration: float) -> void:
var modulation_step = 1.0 / (100 * duration)
match direction:
"in":
node.modulate.a = 0
node.show()
while node.modulate.a < 1:
await get_tree().create_timer(0.01).timeout
node.modulate.a += modulation_step
"out":
node.modulate.a = 1
while node.modulate.a > 0:
await get_tree().create_timer(0.01).timeout
node.modulate.a -= modulation_step
node.hide()
_:
print("Unknown fade direction")
func _input(event: InputEvent) -> void:
if OS.is_debug_build():
if event.is_action_pressed("game_speed_fast"):
Engine.time_scale = 10.0
if event.is_action_pressed("game_speed_normal"):
Engine.time_scale = 1.0