diff --git a/code/__HELPERS/sanitize_values.dm b/code/__HELPERS/sanitize_values.dm index c065fec9b81..66e75a63374 100644 --- a/code/__HELPERS/sanitize_values.dm +++ b/code/__HELPERS/sanitize_values.dm @@ -30,6 +30,11 @@ else return default return default +/proc/unsanitize_hexcolor(color) + . = "" + for(var/i = 1; i <= length(color); i++) + . += text("[copytext(color, i, i + 1)]0") + return . /proc/sanitize_hexcolor(color, desired_format=3, include_crunch=0, default) var/crunch = include_crunch ? "#" : "" diff --git a/code/__HELPERS/text.dm b/code/__HELPERS/text.dm index c050d2cdc6a..9d11eeeca28 100644 --- a/code/__HELPERS/text.dm +++ b/code/__HELPERS/text.dm @@ -305,6 +305,9 @@ var/list/binary = list("0","1") /proc/random_short_color() return random_string(3, hex_characters) +/proc/random_color() + return random_string(6, hex_characters) + /proc/add_zero2(t, u) var/temp1 while (length(t) < u) diff --git a/code/game/objects/items/devices/flash.dm b/code/game/objects/items/devices/flash.dm index 2e1096009d7..9f8f0f484d0 100644 --- a/code/game/objects/items/devices/flash.dm +++ b/code/game/objects/items/devices/flash.dm @@ -159,11 +159,6 @@ del(animation) for(var/mob/living/carbon/M in oviewers(3, null)) - if(prob(50)) - if (locate(/obj/item/weapon/cloaking_device, M)) - for(var/obj/item/weapon/cloaking_device/S in M) - S.active = 0 - S.icon_state = "shield0" var/safety = M:eyecheck() if(!safety) if(!M.blinded) diff --git a/code/game/objects/items/weapons/grenades/flashbang.dm b/code/game/objects/items/weapons/grenades/flashbang.dm index 36ea6b5521e..52503c244d7 100644 --- a/code/game/objects/items/weapons/grenades/flashbang.dm +++ b/code/game/objects/items/weapons/grenades/flashbang.dm @@ -22,12 +22,11 @@ B.update_icon() del(src) -/obj/item/weapon/grenade/flashbang/proc/bang(var/turf/T , var/mob/living/carbon/M) // Added a new proc called 'bang' that takes a location and a person to be banged. - if (locate(/obj/item/weapon/cloaking_device, M)) // Called during the loop that bangs people in lockers/containers and when banging - for(var/obj/item/weapon/cloaking_device/S in M) // people in normal view. Could theroetically be called during other explosions. - S.active = 0 // -- Polymorph - S.icon_state = "shield0" - +/obj/item/weapon/grenade/flashbang/proc/bang(var/turf/T , var/mob/living/carbon/M) + // Added a new proc called 'bang' that takes a location and a person to be banged. + // Called during the loop that bangs people in lockers/containers and when banging + // people in normal view. Could theroetically be called during other explosions. + // -- Polymorph M << "\red BANG" playsound(src.loc, 'sound/effects/bang.ogg', 25, 1) diff --git a/code/game/objects/items/weapons/shields.dm b/code/game/objects/items/weapons/shields.dm index ca03ea5a96b..8d5b0f05d37 100644 --- a/code/game/objects/items/weapons/shields.dm +++ b/code/game/objects/items/weapons/shields.dm @@ -74,40 +74,4 @@ playsound(user, 'sound/weapons/saberoff.ogg', 50, 1) user << "[src] can now be concealed." reflect_chance = 0 - add_fingerprint(user) - - - -/obj/item/weapon/cloaking_device - name = "cloaking device" - desc = "Use this to become invisible to the human eyesocket." - icon = 'icons/obj/device.dmi' - icon_state = "shield0" - var/active = 0.0 - flags = CONDUCT - item_state = "electronic" - throwforce = 10.0 - throw_speed = 2 - throw_range = 10 - w_class = 2.0 - origin_tech = "magnets=3;syndicate=4" - - -/obj/item/weapon/cloaking_device/attack_self(mob/user as mob) - src.active = !( src.active ) - if (src.active) - user << "\blue The cloaking device is now active." - src.icon_state = "shield1" - else - user << "\blue The cloaking device is now inactive." - src.icon_state = "shield0" - src.add_fingerprint(user) - user.update_icons() - return - -/obj/item/weapon/cloaking_device/emp_act(severity) - active = 0 - icon_state = "shield0" - if(ismob(loc)) - loc:update_icons() - ..() + add_fingerprint(user) \ No newline at end of file diff --git a/code/modules/admin/verbs/debug.dm b/code/modules/admin/verbs/debug.dm index 6b06342dee7..6667140ae0d 100644 --- a/code/modules/admin/verbs/debug.dm +++ b/code/modules/admin/verbs/debug.dm @@ -689,8 +689,6 @@ var/global/list/g_fancy_list_of_safe_types = null M.equip_to_slot_or_del(new /obj/item/clothing/glasses/thermal/monocle(M), slot_glasses) M.equip_to_slot_or_del(new /obj/item/clothing/head/det_hat(M), slot_head) - M.equip_to_slot_or_del(new /obj/item/weapon/cloaking_device(M), slot_r_store) - M.equip_to_slot_or_del(new /obj/item/weapon/gun/projectile(M), slot_r_hand) M.equip_to_slot_or_del(new /obj/item/ammo_box/a357(M), slot_l_store) @@ -800,7 +798,6 @@ var/global/list/g_fancy_list_of_safe_types = null M.equip_to_slot_or_del(new /obj/item/clothing/glasses/sunglasses(M), slot_glasses) M.equip_to_slot_or_del(new /obj/item/clothing/suit/wcoat(M), slot_wear_suit) M.equip_to_slot_or_del(new /obj/item/weapon/melee/energy/sword(M), slot_l_store) - M.equip_to_slot_or_del(new /obj/item/weapon/cloaking_device(M), slot_r_store) var/obj/item/weapon/storage/secure/briefcase/sec_briefcase = new(M) for(var/obj/item/briefcase_item in sec_briefcase) diff --git a/code/modules/events/ninja.dm b/code/modules/events/ninja.dm index 6efe7f928ad..1839dd59ea5 100644 --- a/code/modules/events/ninja.dm +++ b/code/modules/events/ninja.dm @@ -2207,7 +2207,7 @@ ________________________________________________________________________________ spawn(0) anim(U.loc,U,'icons/mob/mob.dmi',,"cloak",,U.dir) s_active=!s_active - U.update_icons() //update their icons + U.alpha = 0 U << "\blue You are now invisible to normal detection." for(var/mob/O in oviewers(U)) O.show_message("[U.name] vanishes into thin air!",1) @@ -2219,7 +2219,7 @@ ________________________________________________________________________________ spawn(0) anim(U.loc,U,'icons/mob/mob.dmi',,"uncloak",,U.dir) s_active=!s_active - U.update_icons() //update their icons + U.alpha = 255 U << "\blue You are now visible." for(var/mob/O in oviewers(U)) O.show_message("[U.name] appears from thin air!",1) diff --git a/code/modules/mob/living/carbon/human/update_icons.dm b/code/modules/mob/living/carbon/human/update_icons.dm index 4b917bcd71f..219ae4b7653 100644 --- a/code/modules/mob/living/carbon/human/update_icons.dm +++ b/code/modules/mob/living/carbon/human/update_icons.dm @@ -118,8 +118,7 @@ Please contact me on #coderbus IRC. ~Carnie x overlays_standing[cache_index] = null //UPDATES OVERLAYS FROM OVERLAYS_LYING/OVERLAYS_STANDING -//this proc is messy as I was forced to include some old laggy cloaking code to it so that I don't break cloakers -//I'll work on removing that stuff by rewriting some of the cloaking stuff at a later date. + /mob/living/carbon/human/update_icons() lying_prev = lying //so we don't update overlays for lying/standing unless our stance changes again update_hud() //TODO: remove the need for this @@ -130,25 +129,9 @@ Please contact me on #coderbus IRC. ~Carnie x for(var/thing in overlays_lying) if(thing) overlays += thing else - var/stealth = 0 - if(istype(wear_suit, /obj/item/clothing/suit/space/space_ninja) && wear_suit:s_active) - stealth = 1 - else - //cloaking devices. //TODO: get rid of this :< - for(var/obj/item/weapon/cloaking_device/S in list(l_hand,r_hand,belt,l_store,r_store)) - if(S.active) - stealth = 1 - break - if(stealth) - icon_state = "body_cloaked" - if(overlays_standing[L_HAND_LAYER]) - overlays += overlays_standing[L_HAND_LAYER] - if(overlays_standing[R_HAND_LAYER]) - overlays += overlays_standing[R_HAND_LAYER] - else - icon_state = "[base_icon_state]_s" - for(var/thing in overlays_standing) - if(thing) overlays += thing + icon_state = "[base_icon_state]_s" + for(var/thing in overlays_standing) + if(thing) overlays += thing @@ -192,10 +175,16 @@ Please contact me on #coderbus IRC. ~Carnie x if(S) var/icon/facial_s = icon("icon"=S.icon, "icon_state"="[S.icon_state]_s") var/icon/facial_l = icon("icon"=S.icon, "icon_state"="[S.icon_state]_l") - facial_s.Blend("#[facial_hair_color]", ICON_ADD) - facial_l.Blend("#[facial_hair_color]", ICON_ADD) - standing += image("icon"=facial_s, "layer"=-HAIR_LAYER) - lying += image("icon"=facial_l, "layer"=-HAIR_LAYER) + + var/image/img_facial_s = image("icon"=facial_s, "layer"=-HAIR_LAYER) + var/image/img_facial_l = image("icon"=facial_l, "layer"=-HAIR_LAYER) + + var/new_color = "#" + unsanitize_hexcolor(facial_hair_color) + img_facial_l.color = new_color + img_facial_s.color = new_color + + standing += img_facial_s + lying += img_facial_l //Applies the debrained overlay if there is no brain if(!getorgan(/obj/item/organ/brain)) @@ -206,10 +195,16 @@ Please contact me on #coderbus IRC. ~Carnie x if(S) var/icon/hair_s = icon("icon"=S.icon, "icon_state"="[S.icon_state]_s") var/icon/hair_l = icon("icon"=S.icon, "icon_state"="[S.icon_state]_l") - hair_s.Blend("#[hair_color]", ICON_ADD) - hair_l.Blend("#[hair_color]", ICON_ADD) - standing += image("icon"=hair_s, "layer"=-HAIR_LAYER) - lying += image("icon"=hair_l, "layer"=-HAIR_LAYER) + + var/image/img_hair_s = image("icon"=hair_s, "layer"=-HAIR_LAYER) + var/image/img_hair_l = image("icon"=hair_l, "layer"=-HAIR_LAYER) + + var/new_color = "#" + unsanitize_hexcolor(hair_color) + img_hair_s.color = new_color + img_hair_l.color = new_color + + standing += img_hair_s + lying += img_hair_l if(lying.len) overlays_lying[HAIR_LAYER] = lying @@ -266,10 +261,17 @@ Please contact me on #coderbus IRC. ~Carnie x if(!dna || dna.mutantrace != "skeleton") var/icon/eyes_s = icon('icons/mob/human_face.dmi', "eyes_s") var/icon/eyes_l = icon('icons/mob/human_face.dmi', "eyes_l") - eyes_s.Blend("#[eye_color]", ICON_ADD) - eyes_l.Blend("#[eye_color]", ICON_ADD) - standing += image("icon"=eyes_s, "layer"=-BODY_LAYER) - lying += image("icon"=eyes_l, "layer"=-BODY_LAYER) + + var/image/img_eyes_s = image("icon"=eyes_s, "layer"=-BODY_LAYER) + var/image/img_eyes_l = image("icon"=eyes_l, "layer"=-BODY_LAYER) + + var/new_color = "#" + unsanitize_hexcolor(eye_color) + + img_eyes_s.color = new_color + img_eyes_l.color = new_color + + standing += img_eyes_s + lying += img_eyes_l //Underwear if(underwear) diff --git a/code/modules/mob/living/living_defense.dm b/code/modules/mob/living/living_defense.dm index 786eec71a0f..88167c46fb3 100644 --- a/code/modules/mob/living/living_defense.dm +++ b/code/modules/mob/living/living_defense.dm @@ -18,13 +18,6 @@ /mob/living/bullet_act(obj/item/projectile/P, def_zone) - var/obj/item/weapon/cloaking_device/C = locate((/obj/item/weapon/cloaking_device) in src) - if(C && C.active) - C.attack_self(src)//Should shut it off - update_icons() - src << "Your [C] was disrupted!" - Stun(2) - var/armor = run_armor_check(def_zone, P.flag) if(!P.nodamage) apply_damage(P.damage, P.damage_type, def_zone, armor) diff --git a/code/modules/mob/new_player/preferences_setup.dm b/code/modules/mob/new_player/preferences_setup.dm index ca2309473a7..ef774523cda 100644 --- a/code/modules/mob/new_player/preferences_setup.dm +++ b/code/modules/mob/new_player/preferences_setup.dm @@ -32,18 +32,18 @@ datum/preferences preview_icon.Blend(new /icon(S.icon, "[S.icon_state]_s"), ICON_OVERLAY) var/icon/eyes_s = new/icon("icon" = 'icons/mob/human_face.dmi', "icon_state" = "eyes_s") - eyes_s.Blend("#[eye_color]", ICON_ADD) + eyes_s.Blend("#[eye_color]", ICON_MULTIPLY) S = hair_styles_list[hair_style] if(S) var/icon/hair_s = new/icon("icon" = S.icon, "icon_state" = "[S.icon_state]_s") - hair_s.Blend("#[hair_color]", ICON_ADD) + hair_s.Blend("#[hair_color]", ICON_MULTIPLY) eyes_s.Blend(hair_s, ICON_OVERLAY) S = facial_hair_styles_list[facial_hair_style] if(S) var/icon/facial_s = new/icon("icon" = S.icon, "icon_state" = "[S.icon_state]_s") - facial_s.Blend("#[facial_hair_color]", ICON_ADD) + facial_s.Blend("#[facial_hair_color]", ICON_MULTIPLY) eyes_s.Blend(facial_s, ICON_OVERLAY) var/icon/clothes_s = null diff --git a/code/modules/research/rd-readme.dm b/code/modules/research/rd-readme.dm index 8680460c227..5c42b3e930b 100644 --- a/code/modules/research/rd-readme.dm +++ b/code/modules/research/rd-readme.dm @@ -189,7 +189,7 @@ When thinking about new stuff, check here to see if there are any slots unfilled //SYNDICATE 1 | Sleepypen 2 | TYRANT Module, Emag -3 | Cloaking Device, Power Sink +3 | Power Sink 4 | 5 | 6 | diff --git a/icons/mob/human_face.dmi b/icons/mob/human_face.dmi index 57cc98ea18c..ba946e3c80f 100644 Binary files a/icons/mob/human_face.dmi and b/icons/mob/human_face.dmi differ