Fixes some issues in floor cluwne code

This commit is contained in:
Citinited
2018-12-01 16:18:04 +00:00
parent 1e82b962f4
commit 5d5c17492f
2 changed files with 25 additions and 16 deletions
+19 -14
View File
@@ -2,25 +2,30 @@
set category = "Event"
set name = "Unleash Floor Cluwne"
set desc = "Pick a specific target or just let it select randomly and spawn the floor cluwne mob on the station. Be warned: spawning more than one may cause issues!"
var/target
var/mob/living/carbon/human/target
if(!check_rights(R_EVENT))
return
var/confirm = alert("Are you sure you want to release a floor cluwne and kill alot of people?", "Confirm Massacre", "Yes", "No")
var/confirm = alert("Are you sure you want to release a floor cluwne and kill a lot of people?", "Confirm Massacre", "Yes", "No")
if(confirm == "Yes")
var/turf/T = get_turf(usr)
target = input("Any specific target in mind? Please note only live, non cluwned, human targets are valid.", "Target", target) as null|anything in GLOB.player_list
if(isnull(target))
var/list/potential_targets = list()
for(var/mob/M in GLOB.player_list)
if(!istype(M, /mob/living/carbon/human))
continue
if(M.mind.assigned_role == "Cluwne")
continue
var/mob/living/carbon/human/H = M
potential_targets += H
for(var/mob/M in potential_targets)
if(!potential_targets.len) //You're probably the only player on this damn station, spawn it yourself
to_chat(src, "<span class='notice'>No valid targets!</span>")
return
if(target && ishuman(target))
var/mob/living/carbon/human/H = target
var/mob/living/simple_animal/hostile/floor_cluwne/FC = new /mob/living/simple_animal/hostile/floor_cluwne(T)
FC.Acquire_Victim(H)
else
new /mob/living/simple_animal/hostile/floor_cluwne(T)
log_admin("[key_name(usr)] spawned floor cluwne.")
message_admins("[key_name(usr)] spawned floor cluwne.")
else
return
target = input("Any specific target in mind? Please note only live, non cluwned, human targets are valid.", "Target", target) as null|anything in potential_targets
var/mob/living/simple_animal/hostile/floor_cluwne/FC = new /mob/living/simple_animal/hostile/floor_cluwne(T)
if(target)
FC.Acquire_Victim(target)
log_admin("[key_name(usr)] spawned floor cluwne[target ? ", initially targetting [target]": null].")
message_admins("[key_name(usr)] spawned floor cluwne[target ? ", initially targetting [target]": null].")