🐐 SEMEN
This commit is contained in:
@@ -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()))
|
||||
|
||||
Reference in New Issue
Block a user