Merge pull request #639 from ArchieBeepBoop/fuckcluwnes

Refactoring some of the cluwne's targeting and feedback system.
This commit is contained in:
Dahlular
2020-11-02 00:36:03 -07:00
committed by GitHub
3 changed files with 15 additions and 17 deletions

View File

@@ -1276,7 +1276,9 @@ GLOBAL_LIST_EMPTY(custom_outfits) //Admin created outfits
FC.smite = TRUE
FC.forced = TRUE
FC.Acquire_Victim(target)
FC.interest = 5000;
FC.target = target
FC.current_victim = target
FC.interest = 5000
FC.maxHealth = 5000
FC.health = 5000
if(ADMIN_PUNISHMENT_ROD)

View File

@@ -13,6 +13,8 @@
var/mob/living/simple_animal/hostile/floor_cluwne/FC = new /mob/living/simple_animal/hostile/floor_cluwne(H.loc)
FC.forced = TRUE
FC.Acquire_Victim(H)
FC.target = H
FC.current_victim = H
log_admin("[key_name(usr)] spawned floor cluwne.")
message_admins("[key_name(usr)] spawned floor cluwne.")
deadchat_broadcast("<span class='deadsay'><b>Floor Cluwne</b> has just been spawned!</span>")

View File

@@ -104,12 +104,10 @@ GLOBAL_VAR_INIT(floor_cluwnes, 0)
if(current_victim?.stat == DEAD || is_type_in_typecache(A, invalid_area_typecache) || !is_station_level(current_victim?.z))
if(!Found_You() && forced == FALSE && smite == FALSE)
Acquire_Victim()
else if (!Found_You() && forced == TRUE)
message_admins("Floor Cluwne was deleted due to a lack of valid targets, if this was a manually targeted instance please re-evaluate your choice.")
message_admins("Seems our victim is either dead or in an invalid area. Acquiring new Victim.")
else if(current_victim?.stat == DEAD)
message_admins("Target seems to have died. Deleting cluwne.")
qdel(src)
if(!current_victim || current_victim?.stat == DEAD)
message_admins("Floor Cluwne was deleted due to a lack of valid targets or an internal error when locating one.")
qdel(src)
if(get_dist(src, current_victim) > 9 && !manifested && !is_type_in_typecache(A, invalid_area_typecache))//if cluwne gets stuck he just teleports
do_teleport(src, T)
@@ -158,7 +156,7 @@ GLOBAL_VAR_INIT(floor_cluwnes, 0)
/mob/living/simple_animal/hostile/floor_cluwne/proc/Found_You()
for(var/obj/structure/closet/hiding_spot in orange(7,src))
if(current_victim.loc == hiding_spot)
if(current_victim?.loc == hiding_spot)
hiding_spot.bust_open()
current_victim.Stun(40,ignore_canstun = TRUE)
to_chat(current_victim, "<span class='warning'>...edih t'nac uoY</span>")
@@ -168,7 +166,7 @@ GLOBAL_VAR_INIT(floor_cluwnes, 0)
/mob/living/simple_animal/hostile/floor_cluwne/proc/Acquire_Victim(specific)
var/mob/living/carbon/human/H
var/area/A
if (!specific && forced == FALSE)
if (!specific && forced == FALSE && smite == FALSE)
for(var/I in GLOB.player_list)//better than a potential recursive loop
H = pick(GLOB.player_list)//so the check is fair
A = get_area(H.loc)
@@ -183,7 +181,7 @@ GLOBAL_VAR_INIT(floor_cluwnes, 0)
if(H.stat != DEAD && H.has_dna() && !is_type_in_typecache(A, invalid_area_typecache) && is_station_level(H.z))
return target = current_victim
message_admins("Floor Cluwne was deleted due to a lack of valid targets, if this was a manually targeted instance please re-evaluate your choice.")
message_admins("Floor Cluwne was deleted due to a lack of valid targets in the Acquire_Victim stage. This means the target could be in an area considered invalid for the cluwne, is off the station or is dead.")
qdel(src)
/mob/living/simple_animal/hostile/floor_cluwne/proc/Manifest()//handles disappearing and appearance anim
@@ -216,12 +214,8 @@ GLOBAL_VAR_INIT(floor_cluwnes, 0)
/mob/living/simple_animal/hostile/floor_cluwne/proc/On_Stage()
var/mob/living/carbon/human/H = current_victim
if(!H)
if(forced == FALSE || smite == FALSE)
FindTarget()
return
else
message_admins("Target is... Gone? Deleting Cluwne.")
qdel(src)
FindTarget()
return
switch(stage)
if(STAGE_HAUNT)
@@ -361,7 +355,7 @@ GLOBAL_VAR_INIT(floor_cluwnes, 0)
/mob/living/simple_animal/hostile/floor_cluwne/proc/Grab(mob/living/carbon/human/H)
if (H != current_victim)
message_admins("Cluwne tried to grab someone who's not the target. Returning.")
message_admins("Cluwne tried to grab someone who's not the target. Returning to life stage.")
return
to_chat(H, "<span class='userdanger'>You feel a cold, gloved hand clamp down on your ankle!</span>")
for(var/I in 1 to get_dist(src, H))
@@ -395,7 +389,7 @@ GLOBAL_VAR_INIT(floor_cluwnes, 0)
/mob/living/simple_animal/hostile/floor_cluwne/proc/Kill(mob/living/carbon/human/H)
if (H != current_victim)
message_admins("Cluwne tried to kill someone who's not the target. Returning.")
message_admins("Cluwne tried to kill someone who's not the target. Returning to life stage.")
return
if(!istype(H) || !H.client)
//Acquire_Victim()