Initial Commit

This commit is contained in:
June
2026-03-24 22:00:03 -07:00
parent bf9620bbb6
commit 5533b95cff
73 changed files with 1647 additions and 293 deletions

View File

@@ -1,30 +1,32 @@
class_name cCharacter
extends Node
const Map = preload("res://Scripts/Levels/lsOffice.gd")
# --- Parameters ---
@export_range(0, 20) var ai_level := 10
@export var min_interval := 8
@export var max_interval := 12
@export var reset_after_climax := true
@export var character_name := "template"
# --- Constants ---
const MAX_STATE := 6
const DEBUG := true
# --- Runtime ---
var state: int = 0
var current_location: int = Global.LocationID.POWER_STATION
var current_room: int = -1
var move_timer := 0.0
var stunted: bool = false
func get_room_presence(room_id):
if current_location != room_id:
return -1
return state
func move_to(room_id: int):
if current_room != -1:
Global.rooms[current_room].remove_enemy(self)
current_room = room_id
Global.rooms[current_room].add_enemy(self)
func _init():
_ready()
func _ready() -> void:
randomize()
@@ -47,31 +49,12 @@ func try_move(delta: float) -> bool:
var roll := randi_range(1, 20)
if DEBUG:
print(name, " | AI:", ai_level, " | Roll:", roll)
print(character_name, " | AI:", ai_level, " | Roll:", roll)
return roll <= ai_level
func advance_state() -> void:
if state >= MAX_STATE:
if reset_after_climax:
state = 0
else:
state += 1
func _process(delta: float) -> void:
if try_move(delta):
if(stunted):
stunted = false
return
advance_state()
if (randi_range(1, 20) > 10):
stunted = true
match state:
0: pass # dormant
1: pass
2: pass
3: pass
4: pass
5: pass
6: pass