From 45aa4ba3de00a14002dbce4e58b813400aa69bf8 Mon Sep 17 00:00:00 2001
From: Novacat <35587478+Novacat@users.noreply.github.com>
Date: Fri, 13 Dec 2019 20:55:47 -0500
Subject: [PATCH] More bug fixes (#6560)
* More esword fixes
- Fixes Holodeck eswords being completely broken, Holodeck eswords are not recolorable
- Fixes Toy sword onmob sprite not properly updating
- Fixes eswords not properly updating onmob color (this is an incredibly hacky fix)
- Readds the esword sub types, they are not recolorable
* Removes unintended code
* More unintended code removal
* Fixes spy bug sprite
* Fixes PMC-S Name
* Fixes syringes not working through voidsuits.
---
code/game/objects/items/devices/spy_bug.dm | 4 +-
code/game/objects/items/toys.dm | 2 +
.../objects/items/weapons/melee/energy.dm | 27 ++++++++--
.../clothing/spacesuits/rig/suits/pmc.dm | 2 +-
code/modules/holodeck/HolodeckObjects.dm | 50 ++++++++++++-------
.../reagents/reagent_containers/syringes.dm | 2 -
6 files changed, 61 insertions(+), 26 deletions(-)
diff --git a/code/game/objects/items/devices/spy_bug.dm b/code/game/objects/items/devices/spy_bug.dm
index e3392f33fe..1f15d36b12 100644
--- a/code/game/objects/items/devices/spy_bug.dm
+++ b/code/game/objects/items/devices/spy_bug.dm
@@ -60,7 +60,7 @@
name = "broken bug"
desc = "" //Even when it's broken it's inconspicuous
icon = 'icons/obj/weapons.dmi'
- icon_state = "eshield0"
+ icon_state = "eshield"
item_state = "nothing"
layer = TURF_LAYER+0.2
w_class = ITEMSIZE_TINY
@@ -75,7 +75,7 @@
name = "bug"
desc = "" //Nothing to see here
icon = 'icons/obj/weapons.dmi'
- icon_state = "eshield0"
+ icon_state = "eshield"
item_state = "nothing"
layer = TURF_LAYER+0.2
w_class = ITEMSIZE_TINY
diff --git a/code/game/objects/items/toys.dm b/code/game/objects/items/toys.dm
index e7294a4b81..67a88ccb85 100644
--- a/code/game/objects/items/toys.dm
+++ b/code/game/objects/items/toys.dm
@@ -271,10 +271,12 @@
if (src.active)
user << "You extend the plastic blade with a quick flick of your wrist."
playsound(user, 'sound/weapons/saberon.ogg', 50, 1)
+ src.item_state = "[icon_state]_blade"
src.w_class = ITEMSIZE_LARGE
else
user << "You push the plastic blade back down into the handle."
playsound(user, 'sound/weapons/saberoff.ogg', 50, 1)
+ src.item_state = "[icon_state]"
src.w_class = ITEMSIZE_SMALL
update_icon()
src.add_fingerprint(user)
diff --git a/code/game/objects/items/weapons/melee/energy.dm b/code/game/objects/items/weapons/melee/energy.dm
index ad8fc3bdac..17d7bc4621 100644
--- a/code/game/objects/items/weapons/melee/energy.dm
+++ b/code/game/objects/items/weapons/melee/energy.dm
@@ -23,6 +23,26 @@
slot_r_hand_str = 'icons/mob/items/righthand_melee.dmi',
)
+/obj/item/weapon/melee/energy/sword/green/New()
+ colorable = FALSE
+ lcolor = "#008000"
+
+/obj/item/weapon/melee/energy/sword/red/New()
+ colorable = FALSE
+ lcolor = "#FF0000"
+
+/obj/item/weapon/melee/energy/sword/blue/New()
+ colorable = FALSE
+ lcolor = "#0000FF"
+
+/obj/item/weapon/melee/energy/sword/purple/New()
+ colorable = FALSE
+ lcolor = "#800080"
+
+/obj/item/weapon/melee/energy/sword/white/New()
+ colorable = FALSE
+ lcolor = "#FFFFFF"
+
/obj/item/weapon/melee/energy/proc/activate(mob/living/user)
if(active)
return
@@ -147,11 +167,12 @@
/obj/item/weapon/melee/energy/update_icon()
. = ..()
var/mutable_appearance/blade_overlay = mutable_appearance(icon, "[icon_state]_blade")
- if(colorable)
- blade_overlay.color = lcolor
- if(rainbow || !colorable)
+ blade_overlay.color = lcolor
+ color = lcolor
+ if(rainbow)
blade_overlay = mutable_appearance(icon, "[icon_state]_blade_rainbow")
blade_overlay.color = "FFFFFF"
+ color = "FFFFFF"
cut_overlays() //So that it doesn't keep stacking overlays non-stop on top of each other
if(active)
add_overlay(blade_overlay)
diff --git a/code/modules/clothing/spacesuits/rig/suits/pmc.dm b/code/modules/clothing/spacesuits/rig/suits/pmc.dm
index 7b609be4e8..b10e559977 100644
--- a/code/modules/clothing/spacesuits/rig/suits/pmc.dm
+++ b/code/modules/clothing/spacesuits/rig/suits/pmc.dm
@@ -99,7 +99,7 @@
)
/obj/item/weapon/rig/pmc/security
- name = "ERT-S suit control module"
+ name = "PMC-S suit control module"
desc = "A suit worn by private military contractors. This one is setup for security. Armoured and space ready."
suit_type = "PMC security"
icon_state = "pmc_securitygrey_rig"
diff --git a/code/modules/holodeck/HolodeckObjects.dm b/code/modules/holodeck/HolodeckObjects.dm
index 7fcf97a410..fe8c45e7bb 100644
--- a/code/modules/holodeck/HolodeckObjects.dm
+++ b/code/modules/holodeck/HolodeckObjects.dm
@@ -259,7 +259,9 @@ datum/unarmed_attack/holopugilism/unarmed_override(var/mob/living/carbon/human/u
/obj/item/weapon/holo/esword
desc = "May the force be within you. Sorta."
- icon_state = "sword0"
+ icon_state = "esword"
+ var/lcolor
+ var/rainbow = FALSE
item_icons = list(
slot_l_hand_str = 'icons/mob/items/lefthand_melee.dmi',
slot_r_hand_str = 'icons/mob/items/righthand_melee.dmi',
@@ -271,15 +273,12 @@ datum/unarmed_attack/holopugilism/unarmed_override(var/mob/living/carbon/human/u
w_class = ITEMSIZE_SMALL
flags = NOBLOODY
var/active = 0
- var/item_color
-/obj/item/weapon/holo/esword/green
- New()
- item_color = "green"
+/obj/item/weapon/holo/esword/green/New()
+ lcolor = "#008000"
-/obj/item/weapon/holo/esword/red
- New()
- item_color = "red"
+/obj/item/weapon/holo/esword/red/New()
+ lcolor = "#FF0000"
/obj/item/weapon/holo/esword/handle_shield(mob/user, var/damage, atom/damage_source = null, mob/attacker = null, var/def_zone = null, var/attack_text = "the attack")
if(active && default_parry_check(user, attacker, damage_source) && prob(50))
@@ -292,32 +291,47 @@ datum/unarmed_attack/holopugilism/unarmed_override(var/mob/living/carbon/human/u
return TRUE
return FALSE
-/obj/item/weapon/holo/esword/New()
- item_color = pick("red","blue","green","purple")
-
/obj/item/weapon/holo/esword/attack_self(mob/living/user as mob)
active = !active
if (active)
force = 30
- icon_state = "sword[item_color]"
+ item_state = "[icon_state]_blade"
w_class = ITEMSIZE_LARGE
playsound(user, 'sound/weapons/saberon.ogg', 50, 1)
to_chat(user, "[src] is now active.")
else
force = 3
- icon_state = "sword0"
+ item_state = "[icon_state]"
w_class = ITEMSIZE_SMALL
playsound(user, 'sound/weapons/saberoff.ogg', 50, 1)
to_chat(user, "[src] can now be concealed.")
- if(istype(user,/mob/living/carbon/human))
- var/mob/living/carbon/human/H = user
- H.update_inv_l_hand()
- H.update_inv_r_hand()
-
+ update_icon()
add_fingerprint(user)
return
+/obj/item/weapon/holo/esword/attackby(obj/item/weapon/W, mob/user)
+ if(istype(W, /obj/item/device/multitool) && !active)
+ if(!rainbow)
+ rainbow = TRUE
+ else
+ rainbow = FALSE
+ to_chat(user, "You manipulate the color controller in [src].")
+ update_icon()
+ return ..()
+
+/obj/item/weapon/holo/esword/update_icon()
+ . = ..()
+ var/mutable_appearance/blade_overlay = mutable_appearance(icon, "[icon_state]_blade")
+ blade_overlay.color = lcolor
+ cut_overlays() //So that it doesn't keep stacking overlays non-stop on top of each other
+ if(active)
+ add_overlay(blade_overlay)
+ if(istype(usr,/mob/living/carbon/human))
+ var/mob/living/carbon/human/H = usr
+ H.update_inv_l_hand()
+ H.update_inv_r_hand()
+
//BASKETBALL OBJECTS
/obj/item/weapon/beach_ball/holoball
diff --git a/code/modules/reagents/reagent_containers/syringes.dm b/code/modules/reagents/reagent_containers/syringes.dm
index cf9ce9630f..ca0f4f7658 100644
--- a/code/modules/reagents/reagent_containers/syringes.dm
+++ b/code/modules/reagents/reagent_containers/syringes.dm
@@ -182,8 +182,6 @@
if(H.wear_suit)
if(istype(H.wear_suit, /obj/item/clothing/suit/space))
injtime = injtime * 2
- if(!H.can_inject(user, 1))
- return
else if(isliving(target))
var/mob/living/M = target