Add the random option to new objective admin tool

This commit is contained in:
joep van der velden
2020-06-14 22:00:25 +02:00
parent ab957a66ea
commit b9205b0e8e
+13 -4
View File
@@ -545,11 +545,20 @@
if(objective&&(objective.type in objective_list) && objective:target)
def_target = objective.target.current
possible_targets = sortAtom(possible_targets)
possible_targets += "Free objective"
var/new_target = input("Select target:", "Objective target", def_target) as null|anything in possible_targets
if(!new_target)
return
var/new_target
if(LAZYLEN(possible_targets) > 0)
if(alert(usr, "Do you want to pick the objective yourself? No will randomise it", "Pick objective", "Yes", "No") == "Yes")
possible_targets += "Free objective"
new_target = input("Select target:", "Objective target", def_target) as null|anything in possible_targets
else
new_target = pick(possible_targets)
if(!new_target)
return
else
to_chat(usr, "<span class='warning'>No possible target found. Defaulting to a Free objective.</span>")
new_target = "Free objective"
var/objective_path = text2path("/datum/objective/[new_obj_type]")
if(new_target == "Free objective")