Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Eyepatch Flopping + Double Eyepatch #2362

Merged
merged 3 commits into from
Sep 19, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
59 changes: 55 additions & 4 deletions code/modules/clothing/glasses/_glasses.dm
Original file line number Diff line number Diff line change
Expand Up @@ -128,8 +128,31 @@
/obj/item/clothing/glasses/eyepatch
name = "eyepatch"
desc = "Yarr."
icon_state = "eyepatch"
item_state = "eyepatch"
icon_state = "eyepatch-0"
item_state = "eyepatch-0"
var/flipped = FALSE

/obj/item/clothing/glasses/eyepatch/AltClick(mob/user)
. = ..()
flipped = !flipped
to_chat(user, "<span class='notice'>You shift the eyepatch to cover the [flipped == 0 ? "right" : "left"] eye.</span>")
icon_state = "eyepatch-[flipped]"
item_state = "eyepatch-[flipped]"
update_appearance()

/obj/item/clothing/glasses/eyepatch/examine(mob/user)
. = ..()
. += "It is currently aligned to the [flipped == 0 ? "right" : "left"] side."

/obj/item/clothing/glasses/eyepatch/attackby(obj/item/I, mob/user, params)
. = ..()
if(istype(I, /obj/item/clothing/glasses/eyepatch))
var/obj/item/clothing/glasses/eyepatch/old_patch = I
var/obj/item/clothing/glasses/blindfold/eyepatch/double_patch = new/obj/item/clothing/glasses/blindfold/eyepatch
double_patch.forceMove(user.drop_location())
to_chat(user, "<span class='notice'>You combine the eyepatches with a knot.</span>")
old_patch.Destroy()
Destroy()
Comment on lines +154 to +155
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OUGH this should have been qdel()


/obj/item/clothing/glasses/monocle
name = "monocle"
Expand Down Expand Up @@ -348,6 +371,21 @@
M.color = "#[H.eye_color]"
. += M

/obj/item/clothing/glasses/blindfold/eyepatch
name = "double eyepatch"
desc = "For those pirates who've been at it a while. May interfere with navigating ability."
icon_state = "eyepatchd"
item_state = "eyepatchd"

/obj/item/clothing/glasses/blindfold/eyepatch/attack_self(mob/user)
. = ..()
var/obj/item/clothing/glasses/eyepatch/patch_one = new/obj/item/clothing/glasses/eyepatch
var/obj/item/clothing/glasses/eyepatch/patch_two = new/obj/item/clothing/glasses/eyepatch
patch_one.forceMove(user.drop_location())
patch_two.forceMove(user.drop_location())
to_chat(user, "<span class='notice'>You undo the knot on the eyepatches.</span>")
Destroy()

/obj/item/clothing/glasses/sunglasses/big
desc = "Strangely ancient technology used to help provide rudimentary eye cover. Larger than average enhanced shielding blocks flashes."
icon_state = "bigsunglasses"
Expand Down Expand Up @@ -411,8 +449,21 @@
/obj/item/clothing/glasses/thermal/eyepatch
name = "optical thermal eyepatch"
desc = "An eyepatch with built-in thermal optics."
icon_state = "eyepatch"
item_state = "eyepatch"
icon_state = "eyepatch-0"
item_state = "eyepatch-0"
var/flipped = FALSE

/obj/item/clothing/glasses/thermal/eyepatch/AltClick(mob/user)
. = ..()
flipped = !flipped
to_chat(user, "<span class='notice'>You shift the eyepatch to cover the [flipped == 0 ? "right" : "left"] eye.</span>")
icon_state = "eyepatch-[flipped]"
item_state = "eyepatch-[flipped]"
update_appearance()

/obj/item/clothing/glasses/thermal/eyepatch/examine(mob/user)
. = ..()
. += "It is currently aligned to the [flipped == 0 ? "right" : "left"] side."

/obj/item/clothing/glasses/cold
name = "cold goggles"
Expand Down
15 changes: 14 additions & 1 deletion code/modules/clothing/glasses/hud.dm
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,20 @@
/obj/item/clothing/glasses/hud/security/sunglasses/eyepatch
name = "eyepatch HUD"
desc = "A heads-up display that connects directly to the optical nerve of the user, replacing the need for that useless eyeball."
icon_state = "hudpatch"
icon_state = "hudpatch-0"
var/flipped = FALSE

/obj/item/clothing/glasses/hud/security/sunglasses/eyepatch/AltClick(mob/user)
. = ..()
flipped = !flipped
to_chat(user, "<span class='notice'>You shift the hudpatch to cover the [flipped == 0 ? "right" : "left"] eye.</span>")
icon_state = "hudpatch-[flipped]"
item_state = "hudpatch-[flipped]"
update_appearance()

/obj/item/clothing/glasses/hud/security/sunglasses/eyepatch/examine(mob/user)
. = ..()
. += "It is currently aligned to the [flipped == 0 ? "right" : "left"] side."

/obj/item/clothing/glasses/hud/security/sunglasses
name = "security HUDSunglasses"
Expand Down
Binary file modified icons/mob/clothing/eyes.dmi
Binary file not shown.
Binary file modified icons/obj/clothing/glasses.dmi
Binary file not shown.