Skip to content

Commit

Permalink
TGS Test Merge (#7536)
Browse files Browse the repository at this point in the history
  • Loading branch information
cm13-github committed Dec 11, 2024
2 parents fba7fe5 + d8bd743 commit 79b862c
Show file tree
Hide file tree
Showing 26 changed files with 82 additions and 23 deletions.
13 changes: 13 additions & 0 deletions code/modules/cm_marines/smartgun_mount.dm
Original file line number Diff line number Diff line change
Expand Up @@ -519,6 +519,17 @@
if (PF)
PF.flags_can_pass_all = PASS_AROUND|PASS_OVER_THROW_ITEM|PASS_OVER_THROW_MOB

///Turns the mouse cursor into a crosshair if new_cursor is set to TRUE. If set to FALSE, returns the cursor to its initial icon.
/obj/structure/machinery/m56d_hmg/proc/update_mouse_pointer(mob/user, new_cursor)
if(!user.client?.prefs.custom_cursors)
return

user.client?.mouse_pointer_icon = new_cursor ? get_mouse_pointer() : initial(user.client?.mouse_pointer_icon)

///Getter proc. Returns the weapon's crosshair icon.
/obj/structure/machinery/m56d_hmg/proc/get_mouse_pointer()
return 'icons/effects/mouse_pointer/lmg_mouse.dmi'

//Making so rockets don't hit M56D
/obj/structure/machinery/m56d_hmg/calculate_cover_hit_boolean(obj/projectile/P, distance = 0, cade_direction_correct = FALSE)
var/ammo_flags = P.ammo.flags_ammo_behavior | P.projectile_override_flags
Expand Down Expand Up @@ -677,6 +688,7 @@
/obj/structure/machinery/m56d_hmg/proc/exit_interaction()
SIGNAL_HANDLER

update_mouse_pointer(operator, FALSE)
operator.unset_interaction()

/obj/structure/machinery/m56d_hmg/proc/update_damage_state()
Expand Down Expand Up @@ -918,6 +930,7 @@
RegisterSignal(user, COMSIG_MOB_MOUSEUP, PROC_REF(stop_fire))

operator = user
update_mouse_pointer(operator, TRUE)
flags_atom |= RELAY_CLICK

/obj/structure/machinery/m56d_hmg/on_unset_interaction(mob/user)
Expand Down
2 changes: 2 additions & 0 deletions code/modules/cm_preds/yaut_bracers.dm
Original file line number Diff line number Diff line change
Expand Up @@ -853,6 +853,8 @@
return
caller.put_in_active_hand(caster)
caster_deployed = TRUE
if(caller.client?.prefs.custom_cursors)
caller.client?.mouse_pointer_icon = 'icons/effects/mouse_pointer/plasma_caster_mouse.dmi'
to_chat(caller, SPAN_NOTICE("You activate your plasma caster. It is in [caster.mode] mode."))
playsound(src, 'sound/weapons/pred_plasmacaster_on.ogg', 15, TRUE)

Expand Down
2 changes: 1 addition & 1 deletion code/modules/cm_preds/yaut_weapons.dm
Original file line number Diff line number Diff line change
Expand Up @@ -1267,7 +1267,6 @@
. = ..()
source = null


/obj/item/weapon/gun/energy/yautja/plasma_caster/set_gun_config_values()
..()
set_fire_delay(FIRE_DELAY_TIER_6)
Expand Down Expand Up @@ -1354,6 +1353,7 @@
/obj/item/weapon/gun/energy/yautja/plasma_caster/dropped(mob/living/carbon/human/M)
playsound(M, 'sound/weapons/pred_plasmacaster_off.ogg', 15, 1)
to_chat(M, SPAN_NOTICE("You deactivate your plasma caster."))
update_mouse_pointer(M, FALSE)

var/datum/action/predator_action/bracer/caster/caster_action
for(caster_action as anything in M.actions)
Expand Down
14 changes: 14 additions & 0 deletions code/modules/projectiles/gun.dm
Original file line number Diff line number Diff line change
Expand Up @@ -767,13 +767,27 @@ As sniper rifles have both and weapon mods can change them as well. ..() deals w
else
wield_time -= 2*user.skills.get_skill_level(SKILL_FIREARMS)

update_mouse_pointer(user, TRUE)

return 1

/obj/item/weapon/gun/unwield(mob/user)
. = ..()
if(.)
update_mouse_pointer(user, FALSE)
slowdown = initial(slowdown)

///Turns the mouse cursor into a crosshair if new_cursor is set to TRUE. If set to FALSE, returns the cursor to its initial icon.
/obj/item/weapon/gun/proc/update_mouse_pointer(mob/user, new_cursor)
if(!user.client?.prefs.custom_cursors)
return

user.client?.mouse_pointer_icon = new_cursor ? get_mouse_pointer() : initial(user.client?.mouse_pointer_icon)

///Getter proc. Returns the weapon's crosshair icon.
/obj/item/weapon/gun/proc/get_mouse_pointer()
return 'icons/effects/mouse_pointer/rifle_mouse.dmi'

//----------------------------------------------------------
// \\
// LOADING, RELOADING, AND CASINGS \\
Expand Down
3 changes: 3 additions & 0 deletions code/modules/projectiles/guns/boltaction.dm
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,9 @@
/// If this gun should change icon states when the bolt is open
var/has_openbolt_icon = TRUE

/obj/item/weapon/gun/boltaction/get_mouse_pointer()
return 'icons/effects/mouse_pointer/sniper_mouse.dmi'

/obj/item/weapon/gun/boltaction/set_gun_attachment_offsets()
attachable_offset = list("muzzle_x" = 32, "muzzle_y" = 17,"rail_x" = 5, "rail_y" = 18, "under_x" = 25, "under_y" = 14, "stock_x" = 20, "stock_y" = 9)

Expand Down
3 changes: 3 additions & 0 deletions code/modules/projectiles/guns/flamer/flamer.dm
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,9 @@
. = ..()
update_icon()

/obj/item/weapon/gun/flamer/get_mouse_pointer()
return 'icons/effects/mouse_pointer/flamer_mouse.dmi'

/obj/item/weapon/gun/flamer/set_gun_attachment_offsets()
attachable_offset = list("muzzle_x" = 0, "muzzle_y" = 0, "rail_x" = 11, "rail_y" = 20, "under_x" = 21, "under_y" = 14, "stock_x" = 0, "stock_y" = 0)

Expand Down
28 changes: 6 additions & 22 deletions code/modules/projectiles/guns/lever_action.dm
Original file line number Diff line number Diff line change
Expand Up @@ -412,26 +412,11 @@ their unique feature is that a direct hit will buff your damage and firerate
/obj/item/weapon/gun/lever_action/xm88/wield(mob/user)
. = ..()
if(.)
RegisterSignal(src, COMSIG_ITEM_ZOOM, PROC_REF(scope_on))
RegisterSignal(src, COMSIG_ITEM_UNZOOM, PROC_REF(scope_off))

/obj/item/weapon/gun/lever_action/xm88/proc/scope_on(atom/source, mob/current_user)
SIGNAL_HANDLER

RegisterSignal(current_user, COMSIG_MOB_FIRED_GUN, PROC_REF(update_fired_mouse_pointer))
update_mouse_pointer(current_user)

/obj/item/weapon/gun/lever_action/xm88/proc/scope_off(atom/source, mob/current_user)
SIGNAL_HANDLER

UnregisterSignal(current_user, COMSIG_MOB_FIRED_GUN)
current_user.client?.mouse_pointer_icon = null
RegisterSignal(user, COMSIG_MOB_FIRED_GUN, PROC_REF(update_fired_mouse_pointer))

/obj/item/weapon/gun/lever_action/xm88/unwield(mob/user)
. = ..()

user.client?.mouse_pointer_icon = null
UnregisterSignal(src, list(COMSIG_ITEM_ZOOM, COMSIG_ITEM_UNZOOM))
UnregisterSignal(user, COMSIG_MOB_FIRED_GUN)

/obj/item/weapon/gun/lever_action/xm88/proc/update_fired_mouse_pointer(mob/user)
SIGNAL_HANDLER
Expand All @@ -440,13 +425,13 @@ their unique feature is that a direct hit will buff your damage and firerate
return

user.client?.mouse_pointer_icon = get_fired_mouse_pointer(floating_penetration)
addtimer(CALLBACK(src, PROC_REF(update_mouse_pointer), user), 0.4 SECONDS, TIMER_UNIQUE|TIMER_OVERRIDE|TIMER_CLIENT_TIME)
addtimer(CALLBACK(src, PROC_REF(update_mouse_pointer), user, TRUE), 0.4 SECONDS, TIMER_UNIQUE|TIMER_OVERRIDE|TIMER_CLIENT_TIME)

/obj/item/weapon/gun/lever_action/xm88/proc/update_mouse_pointer(mob/user)
/obj/item/weapon/gun/lever_action/xm88/update_mouse_pointer(mob/user, new_cursor)
if(user.client?.prefs.custom_cursors)
user.client?.mouse_pointer_icon = get_mouse_pointer(floating_penetration)
user.client?.mouse_pointer_icon = new_cursor ? get_scaling_mouse_pointer(floating_penetration) : initial(user.client?.mouse_pointer_icon)

/obj/item/weapon/gun/lever_action/xm88/proc/get_mouse_pointer(level)
/obj/item/weapon/gun/lever_action/xm88/proc/get_scaling_mouse_pointer(level)
switch(level)
if(FLOATING_PENETRATION_TIER_0)
return 'icons/effects/mouse_pointer/xm88/xm88-0.dmi'
Expand All @@ -461,7 +446,6 @@ their unique feature is that a direct hit will buff your damage and firerate
else
return 'icons/effects/mouse_pointer/xm88/xm88-0.dmi'


/obj/item/weapon/gun/lever_action/xm88/proc/get_fired_mouse_pointer(level)
switch(level)
if(FLOATING_PENETRATION_TIER_0)
Expand Down
6 changes: 6 additions & 0 deletions code/modules/projectiles/guns/misc.dm
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,9 @@
. = ..()
if(current_mag && current_mag.current_rounds > 0) load_into_chamber()

/obj/item/weapon/gun/minigun/get_mouse_pointer()
return 'icons/effects/mouse_pointer/lmg_mouse.dmi'

/obj/item/weapon/gun/minigun/set_gun_config_values()
..()
set_fire_delay(FIRE_DELAY_TIER_12)
Expand Down Expand Up @@ -105,6 +108,9 @@
if(current_mag && current_mag.current_rounds > 0)
load_into_chamber()

/obj/item/weapon/gun/m60/get_mouse_pointer()
return 'icons/effects/mouse_pointer/lmg_mouse.dmi'

/obj/item/weapon/gun/m60/set_gun_attachment_offsets()
attachable_offset = list("muzzle_x" = 37, "muzzle_y" = 16, "rail_x" = 0, "rail_y" = 0, "under_x" = 27, "under_y" = 12, "stock_x" = 10, "stock_y" = 14)

Expand Down
2 changes: 2 additions & 0 deletions code/modules/projectiles/guns/pistols.dm
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,8 @@
/obj/item/weapon/gun/pistol/unique_action(mob/user)
cock(user)

/obj/item/weapon/gun/pistol/get_mouse_pointer()
return 'icons/effects/mouse_pointer/pistol_mouse.dmi'

/obj/item/weapon/gun/pistol/set_gun_config_values()
..()
Expand Down
3 changes: 3 additions & 0 deletions code/modules/projectiles/guns/revolvers.dm
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,9 @@
if(current_mag)
replace_cylinder(current_mag.current_rounds)

/obj/item/weapon/gun/revolver/get_mouse_pointer()
return 'icons/effects/mouse_pointer/pistol_mouse.dmi'

/obj/item/weapon/gun/revolver/set_gun_config_values()
..()
set_fire_delay(FIRE_DELAY_TIER_5)
Expand Down
11 changes: 11 additions & 0 deletions code/modules/projectiles/guns/rifles.dm
Original file line number Diff line number Diff line change
Expand Up @@ -868,6 +868,9 @@

flags_gun_features = GUN_CAN_POINTBLANK|GUN_WIELDED_FIRING_ONLY

/obj/item/weapon/gun/rifle/mar40/lmg/get_mouse_pointer()
return 'icons/effects/mouse_pointer/lmg_mouse.dmi'

/obj/item/weapon/gun/rifle/mar40/lmg/set_gun_attachment_offsets()
attachable_offset = list("muzzle_x" = 32, "muzzle_y" = 16,"rail_x" = 16, "rail_y" = 20, "under_x" = 26, "under_y" = 16, "stock_x" = 24, "stock_y" = 13)

Expand Down Expand Up @@ -1270,6 +1273,8 @@
/obj/item/weapon/gun/rifle/lmg/set_gun_attachment_offsets()
attachable_offset = list("muzzle_x" = 33, "muzzle_y" = 19,"rail_x" = 10, "rail_y" = 23, "under_x" = 23, "under_y" = 12, "stock_x" = 24, "stock_y" = 12)

/obj/item/weapon/gun/rifle/lmg/get_mouse_pointer()
return 'icons/effects/mouse_pointer/lmg_mouse.dmi'

/obj/item/weapon/gun/rifle/lmg/set_gun_config_values()
..()
Expand Down Expand Up @@ -1600,6 +1605,9 @@
/obj/item/weapon/gun/rifle/m4ra/set_gun_attachment_offsets()
attachable_offset = list("muzzle_x" = 43, "muzzle_y" = 17,"rail_x" = 22, "rail_y" = 21, "under_x" = 30, "under_y" = 13, "stock_x" = 24, "stock_y" = 13, "special_x" = 37, "special_y" = 16)

/obj/item/weapon/gun/rifle/m4ra/get_mouse_pointer()
return 'icons/effects/mouse_pointer/sniper_mouse.dmi'

/obj/item/weapon/gun/rifle/m4ra/set_gun_config_values()
..()
set_fire_delay(FIRE_DELAY_TIER_9)
Expand Down Expand Up @@ -1962,6 +1970,9 @@
COOLDOWN_DECLARE(allow_message)
COOLDOWN_DECLARE(allow_pump)

/obj/item/weapon/gun/rifle/xm51/get_mouse_pointer()
return 'icons/effects/mouse_pointer/shotgun_mouse.dmi'

/obj/item/weapon/gun/rifle/xm51/set_gun_attachment_offsets()
attachable_offset = list("muzzle_x" = 34, "muzzle_y" = 18, "rail_x" = 12, "rail_y" = 20, "under_x" = 24, "under_y" = 13, "stock_x" = 15, "stock_y" = 16)

Expand Down
3 changes: 3 additions & 0 deletions code/modules/projectiles/guns/shotguns.dm
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,9 @@ can cause issues with ammo types getting mixed up during the burst.
recoil = RECOIL_AMOUNT_TIER_4
recoil_unwielded = RECOIL_AMOUNT_TIER_2

/obj/item/weapon/gun/shotgun/get_mouse_pointer()
return 'icons/effects/mouse_pointer/shotgun_mouse.dmi'

/obj/item/weapon/gun/shotgun/proc/replace_tube(number_to_replace)
if(!current_mag)
return
Expand Down
3 changes: 3 additions & 0 deletions code/modules/projectiles/guns/smartgun.dm
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,9 @@
QDEL_NULL(battery)
. = ..()

/obj/item/weapon/gun/smartgun/get_mouse_pointer()
return 'icons/effects/mouse_pointer/smartgun_mouse.dmi'

/obj/item/weapon/gun/smartgun/set_gun_attachment_offsets()
attachable_offset = list("muzzle_x" = 33, "muzzle_y" = 16,"rail_x" = 17, "rail_y" = 18, "under_x" = 22, "under_y" = 14, "stock_x" = 22, "stock_y" = 14)

Expand Down
3 changes: 3 additions & 0 deletions code/modules/projectiles/guns/smgs.dm
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,9 @@
/obj/item/weapon/gun/smg/unique_action(mob/user)
cock(user)

/obj/item/weapon/gun/smg/get_mouse_pointer()
return 'icons/effects/mouse_pointer/pistol_mouse.dmi'

/obj/item/weapon/gun/smg/set_gun_config_values()
..()
movement_onehanded_acc_penalty_mult = 4
Expand Down
3 changes: 3 additions & 0 deletions code/modules/projectiles/guns/specialist/launcher/launcher.dm
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,9 @@
new preload(cylinder)
update_icon()

/obj/item/weapon/gun/launcher/get_mouse_pointer()
return 'icons/effects/mouse_pointer/explosive_mouse.dmi'

/obj/item/weapon/gun/launcher/Destroy(force)
QDEL_NULL(cylinder)
return ..()
Expand Down
3 changes: 3 additions & 0 deletions code/modules/projectiles/guns/specialist/scout.dm
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,9 @@
update_attachable(integrated.slot)


/obj/item/weapon/gun/rifle/m4ra_custom/get_mouse_pointer()
return 'icons/effects/mouse_pointer/sniper_mouse.dmi'

/obj/item/weapon/gun/rifle/m4ra_custom/set_gun_attachment_offsets()
attachable_offset = list("muzzle_x" = 43, "muzzle_y" = 17,"rail_x" = 23, "rail_y" = 21, "under_x" = 30, "under_y" = 11, "stock_x" = 24, "stock_y" = 13, "special_x" = 37, "special_y" = 16)

Expand Down
3 changes: 3 additions & 0 deletions code/modules/projectiles/guns/specialist/sniper.dm
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,9 @@
var/sniper_beam_icon_max = "laser_beam_intense"


/obj/item/weapon/gun/rifle/sniper/get_mouse_pointer()
return 'icons/effects/mouse_pointer/sniper_mouse.dmi'

/obj/item/weapon/gun/rifle/sniper/get_examine_text(mob/user)
. = ..()
if(!has_aimed_shot)
Expand Down
Binary file added icons/effects/mouse_pointer/explosive_mouse.dmi
Binary file not shown.
Binary file added icons/effects/mouse_pointer/flamer_mouse.dmi
Binary file not shown.
Binary file added icons/effects/mouse_pointer/lmg_mouse.dmi
Binary file not shown.
Binary file added icons/effects/mouse_pointer/pistol_mouse.dmi
Binary file not shown.
Binary file added icons/effects/mouse_pointer/plasma_caster_mouse.dmi
Binary file not shown.
Binary file added icons/effects/mouse_pointer/rifle_mouse.dmi
Binary file not shown.
Binary file added icons/effects/mouse_pointer/shotgun_mouse.dmi
Binary file not shown.
Binary file added icons/effects/mouse_pointer/smartgun_mouse.dmi
Binary file not shown.
Binary file added icons/effects/mouse_pointer/sniper_mouse.dmi
Binary file not shown.

0 comments on commit 79b862c

Please sign in to comment.