This repository has been archived on 2026-05-24. You can view files and clone it. You cannot open issues or pull requests or push a commit.
Files
AgrarianGameArchive/Scripts/verify_replicated_death_feedback.py
2026-05-18 13:37:11 -07:00

35 lines
1.3 KiB
Python

from pathlib import Path
ROOT = Path(__file__).resolve().parents[1]
def require(path: Path, snippet: str) -> None:
text = path.read_text(encoding="utf-8")
if snippet not in text:
raise SystemExit(f"{path.relative_to(ROOT)} missing {snippet!r}")
def main() -> None:
header = ROOT / "Source" / "AgrarianGame" / "AgrarianSurvivalComponent.h"
source = ROOT / "Source" / "AgrarianGame" / "AgrarianSurvivalComponent.cpp"
hud = ROOT / "Source" / "AgrarianGame" / "AgrarianDebugHUD.cpp"
roadmap = ROOT / "AGRARIAN_DEVELOPMENT_ROADMAP.md"
require(header, "DECLARE_DYNAMIC_MULTICAST_DELEGATE_TwoParams(FAgrarianDeathStateChangedSignature")
require(header, "FAgrarianDeathStateChangedSignature OnDeathStateChanged;")
require(header, "bool bLastBroadcastDeathState = false;")
require(header, "FName LastBroadcastDeathReason = NAME_None;")
require(source, "OnSurvivalChanged.Broadcast(Survival);")
require(source, "bLastBroadcastDeathState != Survival.bIsDead")
require(source, "LastBroadcastDeathReason != Survival.LastDeathReason")
require(source, "OnDeathStateChanged.Broadcast(Survival.bIsDead, Survival.LastDeathReason);")
require(hud, "Death: %s")
require(roadmap, "[x] Add replicated death feedback.")
print("PASS: replicated death feedback is present.")
if __name__ == "__main__":
main()