🐐 SEMEN

This commit is contained in:
2026-04-21 14:24:48 +02:00
parent 4f67b1b2dc
commit ad46f189c0
8 changed files with 32 additions and 3 deletions

View File

@@ -920,6 +920,14 @@ class BuiltIn(Node):
if len(lst) == 0:
raise CentvrionError("FORTIS_ELECTIONIS: cannot select from an empty array")
return vtable, lst[random.randint(0, len(lst) - 1)]
case "SEMEN":
if "FORS" not in vtable["#modules"]:
raise CentvrionError("Cannot use 'SEMEN' without module 'FORS'")
seed = params[0].value()
if not isinstance(seed, int):
raise CentvrionError("SEMEN requires an integer seed")
random.seed(seed)
return vtable, ValNul()
case "LONGITVDO":
if isinstance(params[0], (ValList, ValStr)):
return vtable, ValInt(len(params[0].value()))