Skip to content

Commit

Permalink
atempt to update doorgun mg
Browse files Browse the repository at this point in the history
  • Loading branch information
cuberound authored Dec 12, 2023
1 parent 8964920 commit 73fb044
Showing 1 changed file with 15 additions and 8 deletions.
23 changes: 15 additions & 8 deletions code/modules/cm_marines/smartgun_mount.dm
Original file line number Diff line number Diff line change
@@ -1,6 +1,12 @@
//////////////////////////////////////////////////////////////
//Mounted MG, Replacment for the current jury rig code.

//Adds a coin for engi vendors
/obj/item/coin/marine/engineer
name = "marine engineer support token"
desc = "Insert this into an engineer vendor in order to access a support weapon."
icon_state = "coin_platinum"

// First thing we need is the ammo drum for this thing.
/obj/item/ammo_magazine/m56d
name = "M56D drum magazine (10x28mm Caseless)"
Expand Down Expand Up @@ -825,15 +831,15 @@
to_chat(user, SPAN_WARNING("You aren't allowed to use firearms!"))
return
else
ADD_TRAIT(user, TRAIT_IMMOBILIZED, INTERACTION_TRAIT)
user.freeze()
user.set_interaction(src)
give_action(user, /datum/action/human_action/mg_exit)

else
to_chat(usr, SPAN_NOTICE("You are too far from the handles to man [src]!"))

/obj/structure/machinery/m56d_hmg/on_set_interaction(mob/user)
RegisterSignal(user, list(COMSIG_MOB_MG_EXIT, COMSIG_MOB_RESISTED, COMSIG_MOB_DEATH, COMSIG_LIVING_SET_BODY_POSITION), PROC_REF(exit_interaction))
RegisterSignal(user, list(COMSIG_MOB_MG_EXIT, COMSIG_MOB_RESISTED, COMSIG_MOB_DEATH, COMSIG_MOB_KNOCKED_DOWN), PROC_REF(exit_interaction))
flags_atom |= RELAY_CLICK
user.status_flags |= IMMOBILE_ACTION
user.visible_message(SPAN_NOTICE("[user] mans \the [src]."),SPAN_NOTICE("You man \the [src], locked and loaded!"))
Expand All @@ -848,12 +854,12 @@
update_pixels(user)
operator = user

/obj/structure/machinery/m56d_hmg/on_unset_interaction(mob/living/user)
/obj/structure/machinery/m56d_hmg/on_unset_interaction(mob/user)
flags_atom &= ~RELAY_CLICK
SEND_SIGNAL(src, COMSIG_GUN_INTERRUPT_FIRE)
user.status_flags &= ~IMMOBILE_ACTION
user.visible_message(SPAN_NOTICE("[user] lets go of \the [src]."),SPAN_NOTICE("You let go of \the [src], letting the gun rest."))
REMOVE_TRAIT(user, TRAIT_IMMOBILIZED, INTERACTION_TRAIT)
user.unfreeze()
UnregisterSignal(user, list(COMSIG_MOB_MOUSEUP, COMSIG_MOB_MOUSEDOWN, COMSIG_MOB_MOUSEDRAG))
user.reset_view(null)
user.remove_temp_pass_flags(PASS_MOB_THRU) // this is necessary because being knocked over while using the gun makes you incorporeal
Expand All @@ -869,7 +875,7 @@
COMSIG_MOB_MG_EXIT,
COMSIG_MOB_RESISTED,
COMSIG_MOB_DEATH,
COMSIG_LIVING_SET_BODY_POSITION,
COMSIG_MOB_KNOCKED_DOWN,
))


Expand Down Expand Up @@ -904,13 +910,13 @@
animate(user, pixel_x=diff_x, pixel_y=diff_y, 0.4 SECONDS)
else
if(user.client)
user.client.change_view(GLOB.world_view_size)
user.client.change_view(world_view_size)
user.client.pixel_x = 0
user.client.pixel_y = 0
animate(user, pixel_x=user_old_x, pixel_y=user_old_y, 4, 1)

/obj/structure/machinery/m56d_hmg/check_eye(mob/living/user)
if(user.body_position != STANDING_UP || get_dist(user,src) > 0 || user.is_mob_incapacitated() || !user.client)
/obj/structure/machinery/m56d_hmg/check_eye(mob/user)
if(user.lying || get_dist(user,src) > 0 || user.is_mob_incapacitated() || !user.client)
user.unset_interaction()

/obj/structure/machinery/m56d_hmg/clicked(mob/user, list/mods)
Expand Down Expand Up @@ -1077,6 +1083,7 @@
rounds = 1500
rounds_max = 1500
locked = 1
ammo = /datum/ammo/bullet/machinegun/doorgun
projectile_coverage = PROJECTILE_COVERAGE_HIGH
icon = 'icons/turf/whiskeyoutpost.dmi'
zoom = 1
Expand Down

0 comments on commit 73fb044

Please sign in to comment.