From b18356c95d4973e6890cc3605d24255edca842e1 Mon Sep 17 00:00:00 2001
From: Timothy Teakettle <59849408+timothyteakettle@users.noreply.github.com>
Date: Thu, 23 Jul 2020 18:47:34 +0100
Subject: [PATCH] requested changes
---
code/datums/beepsky_fashion.dm | 39 ------
.../mob/living/simple_animal/bot/secbot.dm | 115 ++++++++++++------
2 files changed, 75 insertions(+), 79 deletions(-)
diff --git a/code/datums/beepsky_fashion.dm b/code/datums/beepsky_fashion.dm
index 058a005aa8..1156822c93 100644
--- a/code/datums/beepsky_fashion.dm
+++ b/code/datums/beepsky_fashion.dm
@@ -37,45 +37,6 @@
beepsky_overlay.color = obj_color
return beepsky_overlay
-/datum/beepsky_fashion/proc/apply(mob/living/simple_animal/bot/secbot/beepers) //set the emote depending on the fashion datum, if nothing set, turn it back to how it was initially
- //assume name and description is always set, because otherwise, what would be the point of beepsky fashion?
- beepers.name = name
- beepers.desc = desc
-
- //set each variable in beepsky if its defined here, otherwise set it to its initial value just in case
- if(death_emote)
- beepers.death_emote = death_emote
-
- if(capture_one)
- beepers.capture_one = capture_one
-
- if(capture_two)
- beepers.capture_two = capture_two
-
- if(infraction)
- beepers.infraction = infraction
-
- if(taunt)
- beepers.taunt = taunt
-
- if(attack_one)
- beepers.attack_one = attack_one
-
- if(attack_two)
- beepers.attack_two = attack_two
-
- if(patrol_emote)
- beepers.patrol_emote = patrol_emote
-
- if(patrol_fail_emote)
- beepers.patrol_fail_emote = patrol_fail_emote
-
- if(arrest_texts)
- beepers.arrest_texts = arrest_texts
-
- if(arrest_emote)
- beepers.arrest_emote = arrest_emote
-
/datum/beepsky_fashion/proc/stun_attack(mob/living/carbon/C) //fired when beepsky does a stun attack with the fashion worn, for sounds/overlays/etc
return
diff --git a/code/modules/mob/living/simple_animal/bot/secbot.dm b/code/modules/mob/living/simple_animal/bot/secbot.dm
index 351bf10d7d..9281206a6a 100644
--- a/code/modules/mob/living/simple_animal/bot/secbot.dm
+++ b/code/modules/mob/living/simple_animal/bot/secbot.dm
@@ -98,6 +98,68 @@
emote = replacetext(emote, "LOCATION", location)
return emote
+/mob/living/simple_animal/bot/secbot/proc/apply_fashion(var/datum/beepsky_fashion/fashion)
+ stored_fashion = new fashion
+ if(stored_fashion.name)
+ name = stored_fashion.name
+
+ if(stored_fashion.desc)
+ desc = stored_fashion.desc
+
+ if(stored_fashion.death_emote)
+ death_emote = stored_fashion.death_emote
+
+ if(stored_fashion.capture_one)
+ capture_one = stored_fashion.capture_one
+
+ if(stored_fashion.capture_two)
+ capture_two = stored_fashion.capture_two
+
+ if(stored_fashion.infraction)
+ infraction = stored_fashion.infraction
+
+ if(stored_fashion.taunt)
+ taunt = stored_fashion.taunt
+
+ if(stored_fashion.attack_one)
+ attack_one = stored_fashion.attack_one
+
+ if(stored_fashion.attack_two)
+ attack_two = stored_fashion.attack_two
+
+ if(stored_fashion.patrol_emote)
+ patrol_emote = stored_fashion.patrol_emote
+
+ if(stored_fashion.patrol_fail_emote)
+ patrol_fail_emote = stored_fashion.patrol_fail_emote
+
+ if(stored_fashion.arrest_texts)
+ arrest_texts = stored_fashion.arrest_texts
+
+ if(stored_fashion.arrest_emote)
+ arrest_emote = stored_fashion.arrest_emote
+
+/mob/living/simple_animal/bot/secbot/proc/reset_fashion()
+ bot_accessory.forceMove(get_turf(src))
+ //reset all emotes/sounds and name/desc
+ name = initial(name)
+ desc = initial(desc)
+ death_emote = initial(death_emote)
+ capture_one = initial(capture_one)
+ capture_two = initial(capture_two)
+ infraction = initial(infraction)
+ taunt = initial(taunt)
+ attack_one = initial(attack_one)
+ attack_two = initial(attack_two)
+ arrest_texts = initial(arrest_texts)
+ arrest_emote = initial(arrest_emote)
+ patrol_emote = initial(patrol_emote)
+ arrest_texts = initial(arrest_texts)
+ arrest_emote = initial(arrest_emote)
+ bot_accessory = null
+ qdel(stored_fashion)
+ regenerate_icons()
+
/mob/living/simple_animal/bot/secbot/beepsky/explode()
var/atom/Tsec = drop_location()
new /obj/item/stock_parts/cell/potato(Tsec)
@@ -229,25 +291,7 @@ Auto Patrol: []"},
if(H.a_intent == INTENT_HELP && bot_accessory)
to_chat(H, "You knock [bot_accessory] off of [src]'s head!")
- bot_accessory.forceMove(get_turf(src))
- //reset all emotes/sounds and name/desc
- name = initial(name)
- desc = initial(desc)
- death_emote = initial(death_emote)
- capture_one = initial(capture_one)
- capture_two = initial(capture_two)
- infraction = initial(infraction)
- taunt = initial(taunt)
- attack_one = initial(attack_one)
- attack_two = initial(attack_two)
- arrest_texts = initial(arrest_texts)
- arrest_emote = initial(arrest_emote)
- patrol_emote = initial(patrol_emote)
- arrest_texts = initial(arrest_texts)
- arrest_emote = initial(arrest_emote)
- bot_accessory = null
- qdel(stored_fashion)
- regenerate_icons()
+ reset_fashion()
return
return ..()
@@ -256,7 +300,7 @@ Auto Patrol: []"},
..()
if(istype(W, /obj/item/weldingtool) && user.a_intent != INTENT_HARM) // Any intent but harm will heal, so we shouldn't get angry.
return
- if(istype(W, /obj/item/clothing/head) || istype(W, /obj/item/clothing/mask))
+ if(istype(W, /obj/item/clothing/head))
attempt_place_on_head(user, W)
return
if(!istype(W, /obj/item/screwdriver) && (W.force) && (!target) && (W.damtype != STAMINA) ) // Added check for welding tool to fix #2432. Welding tool behavior is handled in superclass.
@@ -264,31 +308,22 @@ Auto Patrol: []"},
if(special_retaliate_after_attack(user))
return
-/mob/living/simple_animal/bot/secbot/proc/attempt_place_on_head(mob/user, obj/item/I)
- if(user && !user.temporarilyRemoveItemFromInventory(I))
- to_chat(user, "\The [I] is stuck to your hand, you cannot put it on [src]'s head!")
+/mob/living/simple_animal/bot/secbot/proc/attempt_place_on_head(mob/user, obj/item/clothing/head/H)
+ if(user && !user.temporarilyRemoveItemFromInventory(H))
+ to_chat(user, "\The [H] is stuck to your hand, you cannot put it on [src]'s head!")
return
if(bot_accessory)
to_chat("\[src] already has an accessory, and the laws of physics disallow him from wearing a second!")
return
- if(istype(I, /obj/item/clothing/head))
- var/obj/item/clothing/head/H = I
- if(H.beepsky_fashion)
- stored_fashion = new H.beepsky_fashion
+
+ if(H.beepsky_fashion)
+ to_chat(user, "You set [H] on [src].")
+ bot_accessory = H
+ H.forceMove(src)
+ apply_fashion(H.beepsky_fashion)
else
- //it must be a mask
- var/obj/item/clothing/mask/M = I
- if(M.beepsky_fashion)
- stored_fashion = new M.beepsky_fashion
- if(stored_fashion)
- to_chat(user, "You set [I] on [src].")
- bot_accessory = I
- I.forceMove(src)
- stored_fashion.apply(src)
- regenerate_icons()
- else
- to_chat(user, "You set [I] on [src]'s head, but it falls off!")
- I.forceMove(drop_location())
+ to_chat(user, "You set [H] on [src]'s head, but it falls off!")
+ H.forceMove(drop_location())
/mob/living/simple_animal/bot/secbot/regenerate_icons()
..()