Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/master' into Security-Changes
Browse files Browse the repository at this point in the history
  • Loading branch information
Stutternov committed Nov 8, 2024
2 parents 6789d60 + e11dadd commit a96bc70
Show file tree
Hide file tree
Showing 51 changed files with 152 additions and 40 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,9 @@
#define GUN_UPGRADE_DAMAGE_CLONE "clone_damage"
#define GUN_UPGRADE_DAMAGE_HALLOSS "hallucination_damage"
#define GUN_UPGRADE_DAMAGE_RADIATION "radiation_damage"
#define GUN_UPGRADE_MELEEDAMAGE "melee_damage"
#define GUN_UPGRADE_MELEEPENETRATION "melee_penetration"
#define GUN_UPGRADE_MELEE_DAMAGE_ADDITIVE "melee_damage_additive"

#define GUN_UPGRADE_OFFSET "offset" //Constant offset, in degrees
#define GUN_UPGRADE_ZOOM "zoom"
Expand All @@ -90,6 +93,7 @@
#define GUN_UPGRADE_AUTOEJECT "autoeject"
#define GUN_UPGRADE_CELLMINUS "small cell adapter"
#define GUN_UPGRADE_THERMAL "thermal scope"
#define GUN_UPGRADE_BAYONET "bayonet"
#define GUN_UPGRADE_DNALOCK "biocoded"
#define GUN_UPGRADE_FOREGRIP "foregrip"
#define GUN_UPGRADE_BIPOD "bipod"
Expand Down
1 change: 1 addition & 0 deletions code/__DEFINES/projectile_defines.dm
Original file line number Diff line number Diff line change
Expand Up @@ -54,3 +54,4 @@
#define SLOT_UNDERBARREL "underbarrel"
#define SLOT_MECHANICS "mechanics"
#define SLOT_MAGWELL "magwell"

2 changes: 0 additions & 2 deletions code/datums/outfits/jobs/science.dm
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,6 @@
pda_slot = slot_r_store
id_type = /obj/item/card/id/dkgrey
pda_type = /obj/item/modular_computer/pda/science/roboticist
backpack_contents = list(/obj/item/hydrogen_fuel_cell = 1)
l_pocket = /obj/item/device/robotanalyzer

/decl/hierarchy/outfit/job/science/roboticist/New()
..()
Expand Down
15 changes: 15 additions & 0 deletions code/game/objects/items/weapons/tools/knifes_daggers.dm
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
slot_flags = SLOT_BELT
structure_damage_factor = STRUCTURE_DAMAGE_BLADE
var/backstab_damage = 10
var/can_remove = TRUE //For bayonet gunmod usage.

has_alt_mode = TRUE
alt_mode_damagetype = HALLOSS
Expand All @@ -31,6 +32,20 @@
alt_mode_toggle = "switches their stance to avoid using the blade of their weapon"
alt_mode_lossrate = 0.7

//Handles attaching bayonets to guns capable of taking them. Think of bayonet lugs.
/obj/item/tool/knife/New()
..()
var/datum/component/item_upgrade/I = AddComponent(/datum/component/item_upgrade)
I.weapon_upgrades = list(
GUN_UPGRADE_BAYONET = TRUE,
GUN_UPGRADE_MELEE_DAMAGE_ADDITIVE = 10,
GUN_UPGRADE_MELEEPENETRATION = ARMOR_PEN_MODERATE,
GUN_UPGRADE_OFFSET = 4
)
I.gun_loc_tag = GUN_UNDERBARREL
I.req_gun_tags = list(GUN_KNIFE)
I.prefix = "bayonetted"

/obj/item/tool/knife/resolve_attackby(atom/target, mob/user)
. = ..()
if(!(iscarbon(target) || isanimal(target)))
Expand Down
15 changes: 15 additions & 0 deletions code/game/objects/items/weapons/tools/mods/_upgrades.dm
Original file line number Diff line number Diff line change
Expand Up @@ -181,6 +181,9 @@
to_chat(user, SPAN_WARNING("This hardsuit can't fit any more modifications!"))
return FALSE

if(!required_qualities.len)
return FALSE

if(required_qualities.len)
var/qmatch = FALSE
for (var/q in required_qualities)
Expand All @@ -199,6 +202,9 @@
to_chat(user, SPAN_WARNING("This armor can't fit anymore modifications!"))
return FALSE

if(!required_qualities.len)
return FALSE

if(required_qualities.len)
var/qmatch = FALSE
for (var/q in required_qualities)
Expand Down Expand Up @@ -473,6 +479,15 @@
if(weapon_upgrades[GUN_UPGRADE_THERMAL])
G.vision_flags = SEE_MOBS

if(weapon_upgrades[GUN_UPGRADE_BAYONET])
G.attack_verb = list("attacked", "slashed", "stabbed", "sliced", "torn", "ripped", "diced", "cut")
G.sharp = TRUE
G.bayonet = weapon_upgrades[GUN_UPGRADE_BAYONET]
if(weapon_upgrades[GUN_UPGRADE_MELEE_DAMAGE_ADDITIVE])
G.force += weapon_upgrades[GUN_UPGRADE_MELEE_DAMAGE_ADDITIVE]
if(weapon_upgrades[GUN_UPGRADE_MELEEPENETRATION])
G.armor_divisor += weapon_upgrades[GUN_UPGRADE_MELEEPENETRATION]

if(weapon_upgrades[GUN_UPGRADE_DNALOCK])
G.dna_compare_samples = TRUE
if(G.dna_lock_sample == "not_set")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,15 +13,39 @@
else
new /obj/item/storage/backpack/satchel/purple/scientist(src)
new /obj/item/clothing/under/rank/scientist(src)
//new /obj/item/clothing/suit/labcoat/science(src)
new /obj/item/clothing/suit/storage/toggle/labcoat(src)
new /obj/item/clothing/suit/storage/toggle/labcoat/science(src)
new /obj/item/clothing/shoes/jackboots(src)
new /obj/item/device/radio/headset/headset_sci(src)
new /obj/item/tank/air(src)
new /obj/item/clothing/mask/gas(src)
new /obj/item/storage/belt/sci(src)
new /obj/item/storage/bag/xenobio(src)
new /obj/item/bodybag/xenobio(src)
new /obj/item/device/science_tool(src)

/obj/structure/closet/secure_closet/personal/robo
name = "soteria roboticist's locker"
req_access = list(access_robotics)
icon_state = "science"

/obj/structure/closet/secure_closet/personal/robo/populate_contents()
if(populated_contents)
return
populated_contents = TRUE
if(prob(50))
new /obj/item/storage/backpack/purple/scientist(src)
else
new /obj/item/storage/backpack/satchel/purple/scientist(src)
new /obj/item/clothing/under/rank/roboticist(src)
new /obj/item/clothing/suit/storage/rank/robotech_jacket(src)
new /obj/item/clothing/shoes/jackboots(src)
new /obj/item/device/radio/headset/headset_sci(src)
new /obj/item/tank/air(src)
new /obj/item/clothing/mask/gas(src)
new /obj/item/storage/belt/sci(src)
new /obj/item/device/robotanalyzer(src)
new /obj/item/hydrogen_fuel_cell(src)


/obj/structure/closet/secure_closet/reinforced/RD
name = "soteria research overseer's locker"
Expand Down
2 changes: 1 addition & 1 deletion code/modules/clothing/spacesuits/rig/suits/combat.dm
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@
/obj/item/clothing/head/helmet/space/rig/combat/ironhammer
light_overlay = "sec_light"
camera_networks = list(NETWORK_SECURITY)
//blacksheild
//blackshield
/obj/item/rig/combat/blackshield
name = "Blackshield Ops control module"
desc = "A Blackshield RIG module that has been tailored for CQC. Due to its plating, it's slightly bulkier than normal standard security hardsuits."
Expand Down
3 changes: 3 additions & 0 deletions code/modules/projectiles/gun.dm
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,9 @@ For the sake of consistency, I suggest always rounding up on even values when ap
var/silenced = FALSE
var/fire_sound_silenced = 'sound/weapons/Gunshot_silenced.wav' //Firing sound used when silenced

//For bayonet icon handling
var/bayonet = FALSE

var/icon_contained = TRUE
var/static/list/item_icons_cache = list()
var/wielded_item_state = null
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
load_method = SINGLE_CASING
origin_tech = list(TECH_COMBAT = 6, TECH_MATERIAL = 2)
handle_casings = HOLD_CASINGS
gun_tags = list(GUN_PROJECTILE, GUN_INTERNAL_MAG) //Would be funny as shit if it took a bayonet but, no.
fire_sound = 'sound/weapons/guns/fire/GLfire.ogg'
bulletinsert_sound = 'sound/weapons/guns/interact/china_lake_reload.ogg' // Might not be a M203 but better than a mag sound.
max_shells = 3
Expand Down
3 changes: 3 additions & 0 deletions code/modules/projectiles/guns/projectile/automatic/ak47.dm
Original file line number Diff line number Diff line change
Expand Up @@ -283,6 +283,9 @@
if(!ammo_magazine || !length(ammo_magazine.stored_ammo))
iconstring += "_slide"

if (bayonet)
add_overlay("bayonet")

icon_state = iconstring
set_item_state(itemstring)

Expand Down
4 changes: 4 additions & 0 deletions code/modules/projectiles/guns/projectile/automatic/luger.dm
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@

/obj/item/gun/projectile/automatic/luger/update_icon()
..()
cut_overlays()
var/iconstring = initial(icon_state)
var/itemstring = ""

Expand All @@ -36,6 +37,9 @@
if (!ammo_magazine || !length(ammo_magazine.stored_ammo))
iconstring += "_slide"

if (bayonet)
add_overlay("bayonet")

icon_state = iconstring
set_item_state(itemstring)

Expand Down
7 changes: 5 additions & 2 deletions code/modules/projectiles/guns/projectile/automatic/mamba.dm
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
init_recoil = CARBINE_RECOIL(1)
folding_stock = TRUE
can_dual = FALSE //please god please please NO MORE NO MORE GOD, PLEASE
gun_tags = list(GUN_PROJECTILE, GUN_SILENCABLE, GUN_MAGWELL, GUN_SIGHT)
gun_tags = list(GUN_PROJECTILE, GUN_SILENCABLE, GUN_MAGWELL, GUN_SIGHT, GUN_KNIFE)
init_firemodes = list(
SEMI_AUTO_NODELAY,
BURST_2_ROUND,
Expand All @@ -33,7 +33,7 @@

/obj/item/gun/projectile/automatic/mamba/update_icon()
..()

cut_overlays()
var/iconstring = initial(icon_state)
var/itemstring = ""

Expand All @@ -53,6 +53,9 @@
iconstring += "_s"
itemstring += "_s"

if (bayonet)
add_overlay("bayonet")

icon_state = iconstring
set_item_state(itemstring)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@
slot_flags = SLOT_BACK
load_method = SINGLE_CASING|MAGAZINE
mag_well = MAG_WELL_RIFLE
gun_tags = list(GUN_PROJECTILE)
gun_tags = list(GUN_PROJECTILE, GUN_MAGWELL, GUN_KNIFE) //Able to take a bayonet to stay competative.
matter = list(MATERIAL_PLASTEEL = 10, MATERIAL_STEEL = 10, MATERIAL_WOOD = 10)
price_tag = 700
zoom_factors = list(0.6)
Expand All @@ -77,7 +77,7 @@

/obj/item/gun/projectile/automatic/nordwind/update_icon()
..()

cut_overlays()
var/iconstring = initial(icon_state)
var/itemstring = ""

Expand All @@ -87,6 +87,9 @@
if (!ammo_magazine || !length(ammo_magazine.stored_ammo))
iconstring += "_slide"

if (bayonet)
add_overlay("bayonet")

icon_state = iconstring
set_item_state(itemstring)

Expand All @@ -104,6 +107,7 @@
w_class = ITEM_SIZE_NORMAL
slot_flags = SLOT_BACK|SLOT_BELT
matter = list(MATERIAL_PLASTEEL = 5, MATERIAL_STEEL = 6, MATERIAL_WOOD = 5)
gun_tags = list(GUN_PROJECTILE, GUN_MAGWELL) //Boo-womp, no more bayonet.
gun_parts = list(/obj/item/part/gun/grip/wood = 1, /obj/item/part/gun/mechanism/autorifle = 1, /obj/item/stack/material/plasteel = 2)
price_tag = 450
zoom_factors = list()
Expand Down
44 changes: 24 additions & 20 deletions code/modules/projectiles/guns/projectile/automatic/solmarine.dm
Original file line number Diff line number Diff line change
Expand Up @@ -94,26 +94,6 @@

shotgun_haver = FALSE

/obj/item/gun/projectile/automatic/omnirifle/solmarine/shotgunless_sawn
name = "sawn down \"Saturnian\" carbine"
desc = "An ancient design that predates mass autolathe-printed rifles found commonly in the Sol Federation's oldest military stockpiles. Reliable but heavily dated. \
Unlike other old stocks this one was always intented to be a 6.5mm.\
Someone butchered this thing beyond recognition! At least it fits in a holster now."
icon = 'icons/obj/guns/projectile/sawnoff/solmarine.dmi'
matter = list(MATERIAL_IRON = 10, MATERIAL_PLASTIC = 8)
init_recoil = CARBINE_RECOIL(1.2)
damage_multiplier = 0.8
price_tag = 650
icon_state = "solmarine"
item_state = "solmarine"
gun_parts = list(/obj/item/part/gun/grip/serb = 1, /obj/item/part/gun/mechanism/autorifle = 1, /obj/item/stack/material/plasteel = 2)
shotgun_haver = FALSE
init_firemodes = list(
SEMI_AUTO_NODELAY,
BURST_3_ROUND
)


/obj/item/gun/projectile/automatic/omnirifle/solmarine/shotgunless
name = "\"Saturnian\" carbine"
desc = "An ancient design that predates mass autolathe-printed rifles found commonly in the Sol Federation's oldest military stockpiles. Reliable but heavily dated. \
Expand All @@ -123,6 +103,7 @@
item_state = "service"
matter = list(MATERIAL_IRON = 20, MATERIAL_PLASTIC = 16)
shotgun_haver = FALSE
gun_tags = list(GUN_PROJECTILE, GUN_SCOPE, GUN_MAGWELL, GUN_SILENCABLE, GUN_KNIFE) //No shotgun, so it can take a bayonet.
saw_off = TRUE
sawn = /obj/item/gun/projectile/automatic/omnirifle/solmarine/shotgunless_sawn
serial_type = "Sol Fed"
Expand All @@ -134,6 +115,7 @@

/obj/item/gun/projectile/automatic/omnirifle/solmarine/shotgunless/update_icon()
..()
cut_overlays()
var/iconstring = initial(icon_state)
var/itemstring = ""

Expand All @@ -144,13 +126,35 @@
if (!ammo_magazine || !length(ammo_magazine.stored_ammo))
iconstring += "_slide"

if (bayonet)
add_overlay("bayonet")

icon_state = iconstring
set_item_state(itemstring)

/obj/item/gun/projectile/automatic/omnirifle/solmarine/shotgunless/Initialize()
. = ..()
update_icon()

/obj/item/gun/projectile/automatic/omnirifle/solmarine/shotgunless_sawn
name = "sawn down \"Saturnian\" carbine"
desc = "An ancient design that predates mass autolathe-printed rifles found commonly in the Sol Federation's oldest military stockpiles. Reliable but heavily dated. \
Unlike other old stocks this one was always intented to be a 6.5mm.\
Someone butchered this thing beyond recognition! At least it fits in a holster now."
icon = 'icons/obj/guns/projectile/sawnoff/solmarine.dmi'
matter = list(MATERIAL_IRON = 10, MATERIAL_PLASTIC = 8)
init_recoil = CARBINE_RECOIL(1.2)
damage_multiplier = 0.8
price_tag = 650
icon_state = "solmarine"
item_state = "solmarine"
gun_parts = list(/obj/item/part/gun/grip/serb = 1, /obj/item/part/gun/mechanism/autorifle = 1, /obj/item/stack/material/plasteel = 2)
shotgun_haver = FALSE
init_firemodes = list(
SEMI_AUTO_NODELAY,
BURST_3_ROUND
)

/obj/item/part/gun/frame/solmarine
name = "Solmarine frame"
desc = "A Solmarine carbine frame. For those who want to be re-enactors of soldiers from 600 years ago."
Expand Down
8 changes: 6 additions & 2 deletions code/modules/projectiles/guns/projectile/automatic/sts.dm
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
cocked_sound = 'sound/weapons/guns/interact/ltrifle_cock.ogg'
damage_multiplier = 1.2
init_recoil = RIFLE_RECOIL(1.1)
gun_tags = list(GUN_PROJECTILE, GUN_SCOPE, GUN_MAGWELL, GUN_SILENCABLE)
gun_tags = list(GUN_PROJECTILE, GUN_SCOPE, GUN_MAGWELL, GUN_SILENCABLE, GUN_KNIFE) //Can add bayonet
serial_type = "SA"
gun_parts = list(/obj/item/part/gun/frame/sts = 1, /obj/item/part/gun/grip/black = 1, /obj/item/part/gun/mechanism/autorifle = 1, /obj/item/part/gun/barrel/srifle = 1)
saw_off = TRUE
Expand All @@ -35,7 +35,7 @@

/obj/item/gun/projectile/automatic/sts/update_icon()
..()

cut_overlays()
var/iconstring = initial(icon_state)
var/itemstring = ""

Expand All @@ -45,6 +45,9 @@
if (!ammo_magazine || !length(ammo_magazine.stored_ammo))
iconstring += "_slide"

if (bayonet)
add_overlay("bayonet")

icon_state = iconstring
set_item_state(itemstring)

Expand Down Expand Up @@ -138,6 +141,7 @@
fire_sound = 'sound/weapons/guns/fire/sniper_fire.ogg'
cocked_sound = 'sound/weapons/guns/interact/batrifle_cock.ogg'
saw_off = TRUE
gun_tags = list(GUN_PROJECTILE, GUN_SCOPE, GUN_MAGWELL, GUN_SILENCABLE) //No bayonet for you.
sawn = /obj/item/gun/projectile/automatic/sts/rifle/heavy/sawn
gun_parts = list(/obj/item/part/gun/frame/sts = 1, /obj/item/part/gun/grip/rubber = 1, /obj/item/part/gun/mechanism/autorifle = 1, /obj/item/part/gun/barrel/hrifle = 1)
init_firemodes = list(
Expand Down
5 changes: 4 additions & 1 deletion code/modules/projectiles/guns/projectile/boltgun.dm
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@

/obj/item/gun/projectile/boltgun/update_icon()
..()

cut_overlays()
var/iconstring = initial(icon_state)
var/itemstring = ""

Expand All @@ -80,6 +80,9 @@
iconstring += "_s"
itemstring += "_s"

if (bayonet) //Used not for base Mosin, but any sub-types that end up able to take bayonets.
add_overlay("bayonet")

icon_state = iconstring
set_item_state(itemstring)

Expand Down
Loading

0 comments on commit a96bc70

Please sign in to comment.