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

Fixes the M707 spotting scope teleporting its user and M707 attachment camo #5832

Merged
merged 2 commits into from
Feb 27, 2024
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
8 changes: 6 additions & 2 deletions code/game/objects/structures/vulture_spotter.dm
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@
if(user.client)
RegisterSignal(user.client, COMSIG_PARENT_QDELETING, PROC_REF(do_unscope))
user.client.change_view(scope_zoom, src)
RegisterSignal(user, list(COMSIG_MOB_PICKUP_ITEM, COMSIG_MOB_RESISTED), PROC_REF(do_unscope))
RegisterSignal(user, list(COMSIG_MOB_PICKUP_ITEM, COMSIG_MOB_RESISTED, COMSIG_MOB_DEATH, COMSIG_LIVING_SET_BODY_POSITION), PROC_REF(do_unscope))
user.see_in_dark += darkness_view
user.lighting_alpha = 127
user.sync_lighting_plane_alpha()
Expand Down Expand Up @@ -234,7 +234,7 @@
user.lighting_alpha = user.default_lighting_alpha
user.sync_lighting_plane_alpha()
user.clear_fullscreen("vulture_spotter")
UnregisterSignal(user, list(COMSIG_MOB_PICKUP_ITEM, COMSIG_MOB_RESISTED))
UnregisterSignal(user, list(COMSIG_MOB_PICKUP_ITEM, COMSIG_MOB_RESISTED, COMSIG_MOB_DEATH, COMSIG_LIVING_SET_BODY_POSITION))
user.pixel_x = 0
user.pixel_y = 0
if(user.client)
Expand Down Expand Up @@ -295,6 +295,10 @@

return rifle.attachments["rail"]

/obj/structure/vulture_spotter_tripod/check_eye(mob/living/user)
if((user.body_position != STANDING_UP) || (get_dist(user, src) > 0) || user.is_mob_incapacitated() || !user.client)
do_unscope()

/datum/action/vulture_tripod_unscope
name = "Stop Using Scope"
action_icon_state = "vulture_tripod_close"
Expand Down
44 changes: 44 additions & 0 deletions code/modules/projectiles/gun_attachables.dm
Original file line number Diff line number Diff line change
Expand Up @@ -1271,6 +1271,19 @@ Defined in conflicts.dm of the #defines folder.
QDEL_NULL(scope_element)
return ..()

/obj/item/attachable/vulture_scope/select_gamemode_skin(expected_type, list/override_icon_state, list/override_protection)
. = ..()
var/new_attach_icon
switch(SSmapping.configs[GROUND_MAP].camouflage_type)
if("snow")
attach_icon = new_attach_icon ? new_attach_icon : "s_" + attach_icon
if("desert")
attach_icon = new_attach_icon ? new_attach_icon : "d_" + attach_icon
if("classic")
attach_icon = new_attach_icon ? new_attach_icon : "c_" + attach_icon
if("urban")
attach_icon = new_attach_icon ? new_attach_icon : "u_" + attach_icon

/obj/item/attachable/vulture_scope/tgui_interact(mob/user, datum/tgui/ui)
ui = SStgui.try_update_ui(user, src, ui)
if(!ui)
Expand Down Expand Up @@ -1814,13 +1827,27 @@ Defined in conflicts.dm of the #defines folder.
/obj/item/attachable/stock/vulture
name = "\improper M707 heavy stock"
icon_state = "vulture_stock"
attach_icon = "vulture_stock"
hud_offset_mod = 3

/obj/item/attachable/stock/vulture/Initialize(mapload, ...)
. = ..()
select_gamemode_skin(type)
// Doesn't give any stat additions due to the gun already having really good ones, and this is unremovable from the gun itself

/obj/item/attachable/stock/vulture/select_gamemode_skin(expected_type, list/override_icon_state, list/override_protection)
. = ..()
var/new_attach_icon
switch(SSmapping.configs[GROUND_MAP].camouflage_type)
if("snow")
attach_icon = new_attach_icon ? new_attach_icon : "s_" + attach_icon
if("desert")
attach_icon = new_attach_icon ? new_attach_icon : "d_" + attach_icon
if("classic")
attach_icon = new_attach_icon ? new_attach_icon : "c_" + attach_icon
if("urban")
attach_icon = new_attach_icon ? new_attach_icon : "u_" + attach_icon

/obj/item/attachable/stock/tactical
name = "\improper MK221 tactical stock"
desc = "A metal stock made for the MK221 tactical shotgun."
Expand Down Expand Up @@ -3513,6 +3540,23 @@ Defined in conflicts.dm of the #defines folder.
attach_icon = "vulture_bipod"
heavy_bipod = TRUE

/obj/item/attachable/bipod/vulture/Initialize(mapload, ...)
. = ..()
select_gamemode_skin(type)

/obj/item/attachable/bipod/vulture/select_gamemode_skin(expected_type, list/override_icon_state, list/override_protection)
. = ..()
var/new_attach_icon
switch(SSmapping.configs[GROUND_MAP].camouflage_type)
if("snow")
attach_icon = new_attach_icon ? new_attach_icon : "s_" + attach_icon
if("desert")
attach_icon = new_attach_icon ? new_attach_icon : "d_" + attach_icon
if("classic")
attach_icon = new_attach_icon ? new_attach_icon : "c_" + attach_icon
if("urban")
attach_icon = new_attach_icon ? new_attach_icon : "u_" + attach_icon

/obj/item/attachable/burstfire_assembly
name = "burst fire assembly"
desc = "A small angled piece of fine machinery that increases the burst count on some weapons, and grants the ability to others. \nIncreases weapon scatter."
Expand Down
Loading