Skip to content

Commit

Permalink
cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
Doubleumc committed Nov 19, 2023
1 parent cdd8a38 commit 7d0a915
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 197 deletions.
47 changes: 4 additions & 43 deletions code/modules/vehicles/hardpoints/hardpoint.dm
Original file line number Diff line number Diff line change
Expand Up @@ -544,28 +544,20 @@
user = hp_operator

if(ammo)
//to_chat(user, SPAN_DANGER("[ammo.current_rounds] / [ammo.max_rounds] ROUNDS REMAINING"))
to_chat(user, SPAN_WARNING("[name] Ammo: <b>[SPAN_HELPFUL(ammo ? ammo.current_rounds : 0)]/[SPAN_HELPFUL(ammo ? ammo.max_rounds : 0)]</b> | Mags: <b>[SPAN_HELPFUL(LAZYLEN(backup_clips))]/[SPAN_HELPFUL(max_clips)]</b>"))

/// Reset variables used in firing and remove the gun from the autofire system.
/obj/item/hardpoint/proc/stop_fire(datum/source, atom/object, turf/location, control, params)
if(auto_firing || burst_firing)
SEND_SIGNAL(src, COMSIG_GUN_STOP_FIRE)
if(auto_firing)
reset_fire() //automatic fire doesn't reset itself from COMSIG_GUN_STOP_FIRE
SEND_SIGNAL(src, COMSIG_GUN_STOP_FIRE)
if(auto_firing)
reset_fire() //automatic fire doesn't reset itself from COMSIG_GUN_STOP_FIRE

/// Update the target if you dragged your mouse.
/obj/item/hardpoint/proc/change_target(mob/source, atom/src_object, atom/over_object, turf/src_location, turf/over_location, src_control, over_control, params)
/obj/item/hardpoint/proc/change_target(datum/source, atom/src_object, atom/over_object, turf/src_location, turf/over_location, src_control, over_control, params)
set_target(get_turf_on_clickcatcher(over_object, hp_operator, params))

/// Check if the gun can fire and add it to bucket autofire system if needed, or just fire the gun if not.
/obj/item/hardpoint/proc/start_fire(datum/source, atom/object, turf/location, control, params)
/*
var/list/modifiers = params2list(params)
if(modifiers[SHIFT_CLICK] || modifiers[CTRL_CLICK] || modifiers[ALT_CLICK] || modifiers[MIDDLE_CLICK] || modifiers[RIGHT_CLICK])
return
*/

if(istype(object, /atom/movable/screen))
return

Expand Down Expand Up @@ -676,36 +668,6 @@
/obj/item/hardpoint/proc/get_origin_turf()
return get_offset_target_turf(get_turf(src), origins[1], origins[2])

/*
/// Toggles the gun's firemode one down the list.
/obj/item/hardpoint/proc/do_toggle_firemode(mob/user, new_firemode)
if(burst_firing) //can't toggle mid burst
return
if(!length(gun_firemode_list))
CRASH("[src] called do_toggle_firemode() with an empty gun_firemodes")
if(length(gun_firemode_list) == 1)
to_chat(user, SPAN_NOTICE("[icon2html(src, user)] This hardpoint only has one firemode."))
return
if(new_firemode)
if(!(new_firemode in gun_firemode_list))
CRASH("[src] called do_toggle_firemode() with [new_firemode] new_firemode, not on gun_firemodes")
gun_firemode = new_firemode
else
var/mode_index = gun_firemode_list.Find(gun_firemode)
if(++mode_index <= length(gun_firemode_list))
gun_firemode = gun_firemode_list[mode_index]
else
gun_firemode = gun_firemode_list[1]
playsound(user, 'sound/weapons/handling/gun_burst_toggle.ogg', 15, 1)
to_chat(user, SPAN_NOTICE("[icon2html(src, user)] You switch the hardpoint to <b>[gun_firemode]</b>."))
SEND_SIGNAL(src, COMSIG_GUN_FIRE_MODE_TOGGLE, gun_firemode)
*/

/// Plays 'click' noise and announced to chat. Usually called when weapon empty.
/obj/item/hardpoint/proc/click_empty(mob/user)
if(user)
Expand Down Expand Up @@ -736,7 +698,6 @@
angle_diff += 360
else if(angle_diff > 180)
angle_diff -= 360
//debug_msg("Get_Angle: [Get_Angle(muzzle_turf, target_turf)] get_angle: [get_angle(muzzle_turf, target_turf)] dir2angle: [dir2angle(dir)] angle_diff: [angle_diff]")

return abs(angle_diff) <= (firing_arc * 0.5)

Expand Down
48 changes: 0 additions & 48 deletions code/modules/vehicles/multitile/multitile_hardpoints.dm
Original file line number Diff line number Diff line change
Expand Up @@ -236,51 +236,3 @@
var/list/hardpoints = get_hardpoints_copy() //could be more selective with get_hardpoints_with_ammo(), as only autofire weapons need it
for(var/obj/item/hardpoint/hardpoint in hardpoints)
hardpoint.recalculate_hardpoint_bonuses()

/*
//proc that fires non selected weaponry
/obj/vehicle/multitile/proc/shoot_other_weapon(mob/living/carbon/human/M, seat, atom/A)
if(!istype(M))
return
var/list/usable_hps = get_hardpoints_with_ammo(seat)
for(var/obj/item/hardpoint/HP in usable_hps)
if(HP == active_hp[seat] || HP.slot != HDPT_PRIMARY && HP.slot != HDPT_SECONDARY)
usable_hps.Remove(HP)
if(!LAZYLEN(usable_hps))
to_chat(M, SPAN_WARNING("No other working weapons detected."))
return
for(var/obj/item/hardpoint/HP in usable_hps)
if(!HP.can_activate(M, A))
return
HP.activate(M, A)
break
return
*/

/*
//proc that activates support module if it can be activated and you meet requirements
/obj/vehicle/multitile/proc/activate_support_module(mob/living/carbon/human/M, seat, atom/A)
if(!istype(M))
return
var/list/usable_hps = get_activatable_hardpoints(seat)
for(var/obj/item/hardpoint/HP in usable_hps)
if(HP.slot != HDPT_SUPPORT)
usable_hps.Remove(HP)
if(!LAZYLEN(usable_hps))
to_chat(M, SPAN_WARNING("No activatable support modules detected."))
return
for(var/obj/item/hardpoint/HP in usable_hps)
if(!HP.can_activate(M, A))
return
HP.activate(M, A)
break
return
*/
77 changes: 0 additions & 77 deletions code/modules/vehicles/multitile/multitile_interaction.dm
Original file line number Diff line number Diff line change
Expand Up @@ -410,83 +410,6 @@

hardpoint.start_fire(source, object, location, control, params)

/*
/obj/vehicle/multitile/handle_click(mob/living/user, atom/A, list/mods)
var/seat
for(var/vehicle_seat in seats)
if(seats[vehicle_seat] == user)
seat = vehicle_seat
break
if(istype(A, /atom/movable/screen) || !seat)
return
if(seat == VEHICLE_DRIVER)
if(mods["shift"] && !mods["alt"])
A.examine(user)
return
if(mods["ctrl"] && !mods["alt"])
activate_horn()
return
var/obj/item/hardpoint/HP = active_hp[seat]
if(!HP)
to_chat(user, SPAN_WARNING("Please select an active hardpoint first."))
return
if(!HP.can_activate(user, A))
return
HP.activate(user, A)
if(seat == VEHICLE_GUNNER)
if(mods["shift"] && !mods["middle"])
if(vehicle_flags & VEHICLE_TOGGLE_SHIFT_CLICK_GUNNER)
shoot_other_weapon(user, seat, A)
else
A.examine(user)
return
if(mods["middle"] && !mods["shift"])
if(!(vehicle_flags & VEHICLE_TOGGLE_SHIFT_CLICK_GUNNER))
shoot_other_weapon(user, seat, A)
return
if(mods["alt"])
toggle_gyrostabilizer()
return
if(mods["ctrl"])
activate_support_module(user, seat, A)
return
var/obj/item/hardpoint/HP = active_hp[seat]
if(!HP)
to_chat(user, SPAN_WARNING("Please select an active hardpoint first."))
return
if(!HP.can_activate(user, A))
return
HP.activate(user, A)
if(seat == VEHICLE_SUPPORT_GUNNER_ONE || seat == VEHICLE_SUPPORT_GUNNER_TWO)
if(mods["shift"])
A.examine(user)
return
if(mods["middle"] || mods["alt"] || mods["ctrl"])
return
var/obj/item/hardpoint/HP = active_hp[seat]
if(!HP)
to_chat(user, SPAN_WARNING("Please select an active hardpoint first."))
return
if(!HP.can_activate(user, A))
return
HP.activate(user, A)
*/

/obj/vehicle/multitile/proc/handle_player_entrance(mob/M)
if(!M || M.client == null) return

Expand Down
29 changes: 0 additions & 29 deletions code/modules/vehicles/multitile/multitile_verbs.dm
Original file line number Diff line number Diff line change
Expand Up @@ -381,32 +381,3 @@
return

to_chat(user, SPAN_WARNING("Warning. No FPW for [seat] found, tell a dev!"))

/*
/obj/vehicle/multitile/proc/cycle_firemode()
set name = "Cycle Firemode"
set desc = "Cycles through your gun's firemodes."
set category = "Vehicle"
var/mob/user = usr
if(!user || !istype(user))
return
var/obj/vehicle/multitile/vehicle = user.interactee
if(!istype(vehicle))
return
var/seat
for(var/vehicle_seat in vehicle.seats)
if(vehicle.seats[vehicle_seat] == user)
seat = vehicle_seat
break
if(!seat)
return
var/obj/item/hardpoint/hardpoint = vehicle.active_hp[seat]
if(!hardpoint)
return
hardpoint.do_toggle_firemode(usr)
*/

0 comments on commit 7d0a915

Please sign in to comment.