Skip to content

Commit

Permalink
Merge remote-tracking branch 'cmss13-devs/master' into Black-Market
Browse files Browse the repository at this point in the history
  • Loading branch information
realforest2001 committed Sep 14, 2023
2 parents d67efa0 + 4ec3d3e commit 0087b23
Show file tree
Hide file tree
Showing 11 changed files with 73 additions and 47 deletions.
4 changes: 4 additions & 0 deletions code/game/jobs/job/civilians/support/working_joe.dm
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,10 @@
else
. = {"You are a <a href='"+URL_WIKI_WJ_GUIDE+"'>Working Joe</a> for Hazardous Environments! You are held to a higher standard and are required to obey not only the Server Rules but Marine Law, Roleplay Expectations and Synthetic Rules. You are a variant of the Working Joe built for tougher environments and fulfill the specific duty of dangerous repairs or maintenance. Your primary task is to maintain the reactor, SMES and AI Core. Your secondary task is to respond to hazardous environments, such as an atmospheric breach or biohazard spill, and assist with repairs when ordered to by either an AI Mainframe, or a Commisioned Officer. You should not be seen outside of emergencies besides in Engineering and the AI Core! Stay in character at all times. Use the APOLLO link to communicate with your uplink!"}

/datum/job/civilian/working_joe/announce_entry_message(mob/living/carbon/human/H)
addtimer(CALLBACK(GLOBAL_PROC, GLOBAL_PROC_REF(ares_apollo_talk), "[H.real_name] has been activated."), 1.5 SECONDS)
return ..()

/obj/effect/landmark/start/working_joe
name = JOB_WORKING_JOE
icon_state = "wj_spawn"
Expand Down
67 changes: 46 additions & 21 deletions code/modules/projectiles/gun.dm
Original file line number Diff line number Diff line change
Expand Up @@ -503,8 +503,7 @@ As sniper rifles have both and weapon mods can change them as well. ..() deals w

var/delay_left = (last_fired + fire_delay + additional_fire_group_delay) - world.time
if(fire_delay_group && delay_left > 0)
for(var/group in fire_delay_group)
LAZYSET(user.fire_delay_next_fire, group, world.time + delay_left)
LAZYSET(user.fire_delay_next_fire, src, world.time + delay_left)

if(slot in list(WEAR_L_HAND, WEAR_R_HAND))
set_gun_user(user)
Expand All @@ -523,8 +522,7 @@ As sniper rifles have both and weapon mods can change them as well. ..() deals w

var/delay_left = (last_fired + fire_delay + additional_fire_group_delay) - world.time
if(fire_delay_group && delay_left > 0)
for(var/group in fire_delay_group)
LAZYSET(user.fire_delay_next_fire, group, world.time + delay_left)
LAZYSET(user.fire_delay_next_fire, src, world.time + delay_left)

unwield(user)
set_gun_user(null)
Expand Down Expand Up @@ -1111,27 +1109,20 @@ and you're good to go.
if(PB_burst_bullets_fired) //Has a burst been carried over from a PB?
PB_burst_bullets_fired = 0 //Don't need this anymore. The torch is passed.

//Dual wielding. Do we have a gun in the other hand, is it loaded, and is it the same category?
//Dual wielding. Do we have a gun in the other hand and is it the same category?
var/obj/item/weapon/gun/akimbo = user.get_inactive_hand()
if(!reflex && !dual_wield && user)
var/obj/item/weapon/gun/akimbo = user.get_inactive_hand()
if(istype(akimbo) && akimbo.gun_category == gun_category && !(akimbo.flags_gun_features & GUN_WIELDED_FIRING_ONLY))
/*Does the offhand weapon have a loaded selected attachable gun or ammo? This doesn't necessarily mean the offhand gun can be *fired*,
an unpumped shotgun or opened double-barrel or a revolver with a spun cylinder would pass it, but it's less indiscrimate than it used to be.*/
if(akimbo.active_attachable?.current_rounds || akimbo.has_ammunition())
dual_wield = TRUE //increases recoil, increases scatter, and reduces accuracy.
if(user?.client?.prefs?.toggle_prefs & TOGGLE_ALTERNATING_DUAL_WIELD)
user.swap_hand()
else
akimbo.Fire(target,user,params, 0, TRUE)
dual_wield = TRUE //increases recoil, increases scatter, and reduces accuracy.

var/fire_return = handle_fire(target, user, params, reflex, dual_wield, check_for_attachment_fire)
var/fire_return = handle_fire(target, user, params, reflex, dual_wield, check_for_attachment_fire, akimbo)
if(!fire_return)
return fire_return

flags_gun_features &= ~GUN_BURST_FIRING // We always want to turn off bursting when we're done, mainly for when we break early mid-burstfire.
return AUTOFIRE_CONTINUE

/obj/item/weapon/gun/proc/handle_fire(atom/target, mob/living/user, params, reflex = FALSE, dual_wield, check_for_attachment_fire)
/obj/item/weapon/gun/proc/handle_fire(atom/target, mob/living/user, params, reflex = FALSE, dual_wield, check_for_attachment_fire, akimbo)
var/turf/curloc = get_turf(user) //In case the target or we are expired.
var/turf/targloc = get_turf(target)

Expand Down Expand Up @@ -1210,11 +1201,20 @@ and you're good to go.
active_attachable.last_fired = world.time
else
last_fired = world.time
var/delay_left = (last_fired + fire_delay + additional_fire_group_delay) - world.time
if(fire_delay_group && delay_left > 0)
LAZYSET(user.fire_delay_next_fire, src, world.time + delay_left)
SEND_SIGNAL(user, COMSIG_MOB_FIRED_GUN, src)
. = TRUE

shots_fired++

if(dual_wield)
if(user?.client?.prefs?.toggle_prefs & TOGGLE_ALTERNATING_DUAL_WIELD)
user.swap_hand()
else
INVOKE_ASYNC(akimbo, PROC_REF(Fire), target, user, params, 0, TRUE)

else
return TRUE

Expand All @@ -1240,7 +1240,7 @@ and you're good to go.
return TRUE


/obj/item/weapon/gun/attack(mob/living/attacked_mob, mob/living/user)
/obj/item/weapon/gun/attack(mob/living/attacked_mob, mob/living/user, dual_wield)
if(active_attachable && (active_attachable.flags_attach_features & ATTACH_MELEE)) //this is expected to do something in melee.
active_attachable.last_fired = world.time
active_attachable.fire_attachment(attacked_mob, src, user)
Expand Down Expand Up @@ -1352,6 +1352,11 @@ and you're good to go.
else
active_attachable.activate_attachment(src, null, TRUE)//No way.

//Dual wielding. Do we have a gun in the other hand and is it the same category?
var/obj/item/weapon/gun/akimbo = user.get_inactive_hand()
if(!dual_wield && user)
if(istype(akimbo) && akimbo.gun_category == gun_category && !(akimbo.flags_gun_features & GUN_WIELDED_FIRING_ONLY))
dual_wield = TRUE //increases recoil, increases scatter, and reduces accuracy.

var/bullets_to_fire = 1

Expand Down Expand Up @@ -1394,7 +1399,7 @@ and you're good to go.
SPAN_WARNING("You fire [src] point blank at [attacked_mob]!"), null, null, CHAT_TYPE_WEAPON_USE)

user.track_shot(initial(name))
apply_bullet_effects(projectile_to_fire, user, bullets_fired) //We add any damage effects that we need.
apply_bullet_effects(projectile_to_fire, user, bullets_fired, dual_wield) //We add any damage effects that we need.

SEND_SIGNAL(projectile_to_fire, COMSIG_BULLET_USER_EFFECTS, user)
SEND_SIGNAL(user, COMSIG_BULLET_DIRECT_HIT, attacked_mob)
Expand Down Expand Up @@ -1436,9 +1441,18 @@ and you're good to go.
active_attachable.last_fired = world.time
else
last_fired = world.time
var/delay_left = (last_fired + fire_delay + additional_fire_group_delay) - world.time
if(fire_delay_group && delay_left > 0)
LAZYSET(user.fire_delay_next_fire, src, world.time + delay_left)

SEND_SIGNAL(user, COMSIG_MOB_FIRED_GUN, src)

if(dual_wield)
if(user?.client?.prefs?.toggle_prefs & TOGGLE_ALTERNATING_DUAL_WIELD)
user.swap_hand()
else
INVOKE_ASYNC(akimbo, PROC_REF(attack), attacked_mob, user, TRUE)

if(EXECUTION_CHECK) //Continue execution if on the correct intent. Accounts for change via the earlier do_after
user.visible_message(SPAN_DANGER("[user] has executed [attacked_mob] with [src]!"), SPAN_DANGER("You have executed [attacked_mob] with [src]!"), message_flags = CHAT_TYPE_WEAPON_USE)
attacked_mob.death()
Expand Down Expand Up @@ -1548,9 +1562,20 @@ not all weapons use normal magazines etc. load_into_chamber() itself is designed

if(fire_delay_group)
for(var/group in fire_delay_group)
var/group_next_fire = LAZYACCESS(user.fire_delay_next_fire, group)
if(!isnull(group_next_fire) && world.time < group_next_fire)
return
for(var/obj/item/weapon/gun/cycled_gun in user.fire_delay_next_fire)
if(cycled_gun == src)
continue

for(var/cycled_gun_group in cycled_gun.fire_delay_group)
if(group != cycled_gun_group)
continue

if(user.fire_delay_next_fire[cycled_gun] < world.time)
user.fire_delay_next_fire -= cycled_gun
continue

return

return TRUE

/obj/item/weapon/gun/proc/click_empty(mob/user)
Expand Down
2 changes: 1 addition & 1 deletion code/modules/projectiles/guns/shotguns.dm
Original file line number Diff line number Diff line change
Expand Up @@ -515,6 +515,7 @@ can cause issues with ammo types getting mixed up during the burst.
burst_delay = 0 //So doubleshotty can doubleshot
has_open_icon = TRUE
civilian_usable_override = TRUE // Come on. It's THE survivor shotgun.
additional_fire_group_delay = 1.5 SECONDS

/obj/item/weapon/gun/shotgun/double/set_gun_attachment_offsets()
attachable_offset = list("muzzle_x" = 32, "muzzle_y" = 19,"rail_x" = 11, "rail_y" = 20, "under_x" = 15, "under_y" = 14, "stock_x" = 13, "stock_y" = 14)
Expand Down Expand Up @@ -761,7 +762,6 @@ can cause issues with ammo types getting mixed up during the burst.
reload_sound = 'sound/weapons/handling/gun_mou_reload.ogg'//unique shell insert
flags_equip_slot = SLOT_BACK
flags_gun_features = GUN_CAN_POINTBLANK|GUN_INTERNAL_MAG
additional_fire_group_delay = 1.5 SECONDS
current_mag = /obj/item/ammo_magazine/internal/shotgun/double/mou53 //Take care, she comes loaded!
attachable_allowed = list(
/obj/item/attachable/bayonet,
Expand Down
4 changes: 0 additions & 4 deletions html/changelogs/AutoChangeLog-pr-4392.yml

This file was deleted.

4 changes: 0 additions & 4 deletions html/changelogs/AutoChangeLog-pr-4393.yml

This file was deleted.

4 changes: 4 additions & 0 deletions html/changelogs/AutoChangeLog-pr-4395.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
author: "Ben10083"
delete-after: True
changes:
- rscadd: "Working Joe arrivals announced in Apollo link"
4 changes: 0 additions & 4 deletions html/changelogs/AutoChangeLog-pr-4399.yml

This file was deleted.

4 changes: 4 additions & 0 deletions html/changelogs/AutoChangeLog-pr-4402.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
author: "Morrow"
delete-after: True
changes:
- bugfix: "Fixed a few ways around fire group delays"
4 changes: 0 additions & 4 deletions html/changelogs/AutoChangeLog-pr-4403.yml

This file was deleted.

9 changes: 0 additions & 9 deletions html/changelogs/AutoChangeLog-pr-4406.yml

This file was deleted.

14 changes: 14 additions & 0 deletions html/changelogs/archive/2023-09.yml
Original file line number Diff line number Diff line change
Expand Up @@ -191,3 +191,17 @@
- balance: M56D now has full auto mode.
- qol: M56D now has an ammo counter when firing.
- rscdel: M2C can no longer rotate with MMB
2023-09-14:
Morrow:
- rscadd: Added a ghost notification for yautja self destructs
- bugfix: Fixed lifepods still working after evac canceled
Zonespace27:
- balance: Coffins now layer above beds
realforest2001:
- imageadd: Added a CMB stamp icon.
- imageadd: Changes the icon_state name of the WY stamp from centcom to weyyu.
- rscadd: Changes EFTPOS stamp icon to use RD instead of weyyu.
- bugfix: Changes the pre-spawned QMs stamp to use the proper stamp.
- spellcheck: Renames Requisiton Officer's stamp to Quartermaster's Stamp.
- maptweak: Renamed the spare Req Officer's stamp to spare Quartermaster's stamp.
- rscadd: Codebooks are now faction based rather than individually unique.

0 comments on commit 0087b23

Please sign in to comment.