From 15aaa4e8730c623a813f7de2bf984d2533da48a4 Mon Sep 17 00:00:00 2001 From: Geeves Date: Tue, 31 Aug 2021 18:05:09 +0200 Subject: [PATCH] Powerful Mechs (#12193) --- aurorastation.dme | 1 + code/__defines/projectiles.dm | 23 +++++++++ code/datums/outfits/ert/ap_eridani.dm | 2 + code/datums/outfits/ert/deathsquad.dm | 2 + code/datums/outfits/ert/fsf.dm | 2 + code/datums/outfits/ert/iac.dm | 2 + code/datums/outfits/ert/kataphract.dm | 2 + code/datums/outfits/ert/mercenary.dm | 2 + code/datums/outfits/ert/syndicate.dm | 4 +- code/datums/outfits/ert/tcfl.dm | 2 + code/datums/outfits/event/outfit_events.dm | 3 ++ code/datums/outfits/event/outfit_killers.dm | 1 + code/datums/outfits/event/outfit_megacorps.dm | 6 ++- code/datums/outfits/event/outfit_tfcl.dm | 2 + code/datums/outfits/outfit.dm | 2 + code/datums/outfits/outfit_antag.dm | 17 +++++++ code/game/antagonist/outsider/commando.dm | 2 +- code/game/objects/items/weapons/cards_ids.dm | 12 +++-- .../items/weapons/cards_ids_syndicate.dm | 1 + .../modules/heavy_vehicle/equipment/combat.dm | 13 ++++- code/modules/heavy_vehicle/mech_helpers.dm | 8 +++- code/modules/item_worth/worths_list.dm | 2 +- .../mob/living/carbon/human/human_helpers.dm | 8 +++- .../living/silicon/robot/syndicate_robot.dm | 3 ++ .../mob/living/simple_animal/simple_animal.dm | 3 ++ code/modules/mob/mob_helpers.dm | 5 +- code/modules/projectiles/gun.dm | 2 + code/modules/projectiles/projectile.dm | 47 ++++++++++++------- code/modules/projectiles/projectile/beams.dm | 11 +++++ .../modules/projectiles/projectile/bullets.dm | 3 ++ html/changelogs/geeves-powerful_mechs.yml | 8 ++++ 31 files changed, 173 insertions(+), 28 deletions(-) create mode 100644 code/__defines/projectiles.dm create mode 100644 html/changelogs/geeves-powerful_mechs.yml diff --git a/aurorastation.dme b/aurorastation.dme index a84aabd452b..35a9deab0ed 100644 --- a/aurorastation.dme +++ b/aurorastation.dme @@ -54,6 +54,7 @@ #include "code\__defines\modular_guns.dm" #include "code\__defines\obj.dm" #include "code\__defines\overmap.dm" +#include "code\__defines\projectiles.dm" #include "code\__defines\psi.dm" #include "code\__defines\qdel.dm" #include "code\__defines\radio.dm" diff --git a/code/__defines/projectiles.dm b/code/__defines/projectiles.dm new file mode 100644 index 00000000000..67bcfecb143 --- /dev/null +++ b/code/__defines/projectiles.dm @@ -0,0 +1,23 @@ +// IFF values +#define IFF_DEFAULT "station" +#define IFF_TCFL "tcfl" +#define IFF_SYNDICATE "syndicate" +#define IFF_MERCENARY "mercenary" +#define IFF_RAIDER "raider" +#define IFF_LONER "loner" +#define IFF_BURGLAR "burglar" +#define IFF_CULTIST "cultist" +#define IFF_BLUESPACE "bluespace" +#define IFF_DEATHSQUAD "deathsquad" +#define IFF_ERIDANI "eridani" +#define IFF_HEPH "hephaestus" +#define IFF_ZENGHU "zenghu" +#define IFF_ZAVOD "zavodskoi" +#define IFF_EE "einstein" +#define IFF_FSF "freesolarianfleets" +#define IFF_IAC "interstellaraidcorps" +#define IFF_KATAPHRACT "kataphract" +#define IFF_FREELANCER "freelancer" +#define IFF_LANCER "lancer" +#define IFF_SOL "solarian" +#define IFF_HIGHLANDER "highlander" \ No newline at end of file diff --git a/code/datums/outfits/ert/ap_eridani.dm b/code/datums/outfits/ert/ap_eridani.dm index 65f21feb875..0166f637bb7 100644 --- a/code/datums/outfits/ert/ap_eridani.dm +++ b/code/datums/outfits/ert/ap_eridani.dm @@ -37,6 +37,8 @@ /obj/item/grenade/flashbang = 1 ) + id_iff = IFF_ERIDANI + /datum/outfit/admin/ert/ap_eridani/get_id_access() return get_distress_access() diff --git a/code/datums/outfits/ert/deathsquad.dm b/code/datums/outfits/ert/deathsquad.dm index 01d0c44a1c5..920ca514f5d 100644 --- a/code/datums/outfits/ert/deathsquad.dm +++ b/code/datums/outfits/ert/deathsquad.dm @@ -25,6 +25,8 @@ var/syndie = FALSE + id_iff = IFF_DEATHSQUAD + /datum/outfit/admin/deathsquad/leader name = "Asset Protection Lead" diff --git a/code/datums/outfits/ert/fsf.dm b/code/datums/outfits/ert/fsf.dm index 2ee8cddb3b4..1b98773b6ef 100644 --- a/code/datums/outfits/ert/fsf.dm +++ b/code/datums/outfits/ert/fsf.dm @@ -28,6 +28,8 @@ accessory = /obj/item/clothing/accessory/holster/hip/brown accessory_contents = list(/obj/item/gun/projectile/pistol/sol = 1) + id_iff = IFF_FSF + /datum/outfit/admin/ert/fsf/get_id_access() return get_distress_access_lesser() diff --git a/code/datums/outfits/ert/iac.dm b/code/datums/outfits/ert/iac.dm index 1ca86f37d47..ea8088cf035 100644 --- a/code/datums/outfits/ert/iac.dm +++ b/code/datums/outfits/ert/iac.dm @@ -36,6 +36,8 @@ /obj/item/reagent_containers/glass/bottle/perconol = 1 ) + id_iff = IFF_IAC + /datum/outfit/admin/ert/iac/get_id_access() return get_distress_access() diff --git a/code/datums/outfits/ert/kataphract.dm b/code/datums/outfits/ert/kataphract.dm index 75d1c3faad9..8b6ea07be69 100644 --- a/code/datums/outfits/ert/kataphract.dm +++ b/code/datums/outfits/ert/kataphract.dm @@ -26,6 +26,8 @@ /obj/item/storage/box/donkpockets = 1 ) + id_iff = IFF_KATAPHRACT + /datum/outfit/admin/ert/kataphract/post_equip(mob/living/carbon/human/H, visualsOnly = FALSE) if(H?.w_uniform) H.w_uniform.color = pick("#42b360", "#b68029", "#5574c2") diff --git a/code/datums/outfits/ert/mercenary.dm b/code/datums/outfits/ert/mercenary.dm index 0dbff2f4270..e380a7aa3a8 100644 --- a/code/datums/outfits/ert/mercenary.dm +++ b/code/datums/outfits/ert/mercenary.dm @@ -32,6 +32,8 @@ /obj/item/material/knife/trench = 1 ) + id_iff = IFF_FREELANCER + /datum/outfit/admin/ert/mercenary/get_id_access() return get_distress_access_lesser() diff --git a/code/datums/outfits/ert/syndicate.dm b/code/datums/outfits/ert/syndicate.dm index 24d5666e447..1204cb86ad7 100644 --- a/code/datums/outfits/ert/syndicate.dm +++ b/code/datums/outfits/ert/syndicate.dm @@ -6,7 +6,7 @@ mask = /obj/item/clothing/mask/gas/syndicate l_ear = /obj/item/device/radio/headset/syndicate glasses = /obj/item/clothing/glasses/thermal - id = /obj/item/card/id/syndicate_ert + id = /obj/item/card/id/syndicate/ert l_pocket = /obj/item/ammo_magazine/c45m l_hand = /obj/item/gun/projectile/automatic/rifle/sts35 @@ -22,6 +22,8 @@ syndie = TRUE + id_iff = IFF_SYNDICATE + /datum/outfit/admin/deathsquad/syndicate/leader name = "Syndicate Commando Lead" diff --git a/code/datums/outfits/ert/tcfl.dm b/code/datums/outfits/ert/tcfl.dm index 0756815fb7d..c06ee8d2674 100644 --- a/code/datums/outfits/ert/tcfl.dm +++ b/code/datums/outfits/ert/tcfl.dm @@ -12,6 +12,8 @@ backpack_contents = null + id_iff = IFF_TCFL + /datum/outfit/admin/ert/legion/post_equip(mob/living/carbon/human/H, visualsOnly = FALSE) . = ..() if(isvaurca(H)) diff --git a/code/datums/outfits/event/outfit_events.dm b/code/datums/outfits/event/outfit_events.dm index d27093fb002..a04c11d2c16 100644 --- a/code/datums/outfits/event/outfit_events.dm +++ b/code/datums/outfits/event/outfit_events.dm @@ -35,6 +35,7 @@ ) id = /obj/item/card/id/syndicate + id_iff = IFF_LANCER var/id_access = "Lancer" /datum/outfit/admin/event/lance/post_equip(mob/living/carbon/human/H, visualsOnly) @@ -141,6 +142,8 @@ accessory = /obj/item/clothing/accessory/holster/hip/brown accessory_contents = list(/obj/item/gun/projectile/pistol/sol = 1) + id_iff = IFF_SOL + /datum/outfit/admin/event/sol_marine/heavy name = "Heavy Solarian Marine" diff --git a/code/datums/outfits/event/outfit_killers.dm b/code/datums/outfits/event/outfit_killers.dm index 32e8fa4dc0a..fd1dc9ee9ff 100644 --- a/code/datums/outfits/event/outfit_killers.dm +++ b/code/datums/outfits/event/outfit_killers.dm @@ -33,6 +33,7 @@ r_pocket = /obj/item/cloaking_device id = /obj/item/card/id/syndicate pda = /obj/item/modular_computer/handheld/pda/command + id_iff = IFF_SYNDICATE /datum/outfit/admin/killer/assassin/post_equip(mob/living/carbon/human/H, visualsOnly = FALSE) var/obj/item/storage/secure/briefcase/sec_briefcase = new(H) diff --git a/code/datums/outfits/event/outfit_megacorps.dm b/code/datums/outfits/event/outfit_megacorps.dm index de25a5251da..0fc138e60fe 100644 --- a/code/datums/outfits/event/outfit_megacorps.dm +++ b/code/datums/outfits/event/outfit_megacorps.dm @@ -26,6 +26,7 @@ /obj/item/melee/baton/loaded = 1, /obj/item/grenade/flashbang = 2 ) + id_iff = IFF_HEPH /datum/outfit/admin/megacorp/hephaestus_trooper/heavy name = "Hephaestus Heavy Asset Protection" @@ -68,6 +69,7 @@ /obj/item/melee/baton/loaded = 1, /obj/item/grenade/flashbang = 2 ) + id_iff = IFF_ZENGHU /datum/outfit/admin/megacorp/zenghu_trooper/heavy name = "Zeng Hu Pharmaceuticals Heavy Asset Protection" @@ -111,6 +113,7 @@ /obj/item/ammo_magazine/mc9mmt = 2, /obj/item/ammo_magazine/mc9mm = 3 ) + id_iff = IFF_ZAVOD /datum/outfit/admin/megacorp/zavodskoi_trooper/heavy name = "Zavodskoi Interstellar Heavy Asset Protection" @@ -152,4 +155,5 @@ /obj/item/grenade/flashbang = 2, /obj/item/handcuffs = 2, /obj/item/grenade/frag = 1 - ) \ No newline at end of file + ) + id_iff = IFF_EE \ No newline at end of file diff --git a/code/datums/outfits/event/outfit_tfcl.dm b/code/datums/outfits/event/outfit_tfcl.dm index 6ef08373a29..c07762a6610 100644 --- a/code/datums/outfits/event/outfit_tfcl.dm +++ b/code/datums/outfits/event/outfit_tfcl.dm @@ -23,6 +23,8 @@ /obj/item/ammo_magazine/a454 = 2, /obj/item/shield/energy/legion = 1 ) + + id_iff = IFF_TCFL var/id_access = "NanoTrasen Representative" /datum/outfit/admin/tcfl/get_id_access() diff --git a/code/datums/outfits/outfit.dm b/code/datums/outfits/outfit.dm index 969410554b7..a43a73b5172 100644 --- a/code/datums/outfits/outfit.dm +++ b/code/datums/outfits/outfit.dm @@ -103,6 +103,8 @@ var/double_headset = /obj/item/device/radio/headset/alt/double var/wrist_radio = /obj/item/device/radio/headset/wrist + var/id_iff = IFF_DEFAULT // when spawning in, the ID will be set to this iff, preventing friendly fire + var/internals_slot = null //ID of slot containing a gas tank var/list/backpack_contents = list() //In the list(path=count,otherpath=count) format var/list/accessory_contents = list() diff --git a/code/datums/outfits/outfit_antag.dm b/code/datums/outfits/outfit_antag.dm index b64357be1c3..d74fd78a2df 100644 --- a/code/datums/outfits/outfit_antag.dm +++ b/code/datums/outfits/outfit_antag.dm @@ -25,6 +25,8 @@ /obj/item/device/multitool = 1 ) + id_iff = IFF_SYNDICATE + var/id_access = "Syndicate Operative" var/uplink_uses = DEFAULT_TELECRYSTAL_AMOUNT @@ -155,6 +157,8 @@ /obj/item/reagent_containers/pill/cyanide = 1 ) + id_iff = IFF_MERCENARY + /datum/outfit/admin/syndicate/mercenary/post_equip(mob/living/carbon/human/H, visualsOnly = FALSE) . = ..() if(visualsOnly) @@ -176,6 +180,7 @@ /obj/item/device/multitool/hacktool = 1 ) + id_iff = IFF_LONER id_access = "Lone Operative" /datum/outfit/admin/syndicate/raider @@ -318,7 +323,9 @@ /obj/item/clothing/glasses/thermal, /obj/item/clothing/glasses/thermal/aviator ) + id = /obj/item/storage/wallet/random + id_iff = IFF_RAIDER accessory = /obj/item/clothing/accessory/storage/webbing @@ -418,6 +425,8 @@ backpack_contents = list() + id_iff = IFF_BURGLAR + /datum/outfit/admin/syndicate/burglar/post_equip(mob/living/carbon/human/H, visualsOnly = FALSE) . = ..() if(visualsOnly) @@ -488,6 +497,7 @@ l_pocket = /obj/item/pinpointer id = /obj/item/card/id/highlander + id_iff = IFF_HIGHLANDER /datum/outfit/admin/highlander/post_equip(mob/living/carbon/human/H, visualsOnly = FALSE) . = ..() @@ -517,6 +527,8 @@ r_hand = /obj/item/melee/cultblade + id_iff = IFF_CULTIST + /datum/outfit/admin/syndicate/cultist/post_equip(mob/living/carbon/human/H, visualsOnly = FALSE) return @@ -547,6 +559,8 @@ accessory = /obj/item/clothing/accessory/storage/webbing backpack_contents = list() + id_iff = IFF_BLUESPACE + /datum/outfit/admin/syndicate/raider_techno/equip(mob/living/carbon/human/H, visualsOnly = FALSE) var/list/loadouts = list("Nature", "Techno", "Cobra", "Brawler", "Shimmer") if(H.gender in list(FEMALE, PLURAL, NEUTER)) @@ -617,6 +631,7 @@ allow_backbag_choice = FALSE l_ear = /obj/item/device/radio/headset/bluespace + id_iff = IFF_BLUESPACE /datum/outfit/admin/techomancer name = "Technomancer" @@ -634,6 +649,8 @@ l_pocket = /obj/item/technomancer_catalog id = /obj/item/card/id/bluespace + id_iff = IFF_BLUESPACE + var/id_assignment = "Technomagus" /datum/outfit/admin/techomancer/post_equip(mob/living/carbon/human/H, visualsOnly = FALSE) diff --git a/code/game/antagonist/outsider/commando.dm b/code/game/antagonist/outsider/commando.dm index a58c3322c70..43c67e6f202 100644 --- a/code/game/antagonist/outsider/commando.dm +++ b/code/game/antagonist/outsider/commando.dm @@ -7,7 +7,7 @@ var/datum/antagonist/deathsquad/mercenary/commandos role_text_plural = "Commandos" welcome_text = "You are in the employ of a criminal syndicate hostile to corporate interests." antag_sound = 'sound/effects/antag_notice/deathsquid_alert.ogg' - id_type = /obj/item/card/id/syndicate_ert + id_type = /obj/item/card/id/syndicate/ert flags = ANTAG_NO_ROUNDSTART_SPAWN faction = "syndicate" diff --git a/code/game/objects/items/weapons/cards_ids.dm b/code/game/objects/items/weapons/cards_ids.dm index 10eb65cee3e..45b581e8f32 100644 --- a/code/game/objects/items/weapons/cards_ids.dm +++ b/code/game/objects/items/weapons/cards_ids.dm @@ -121,6 +121,8 @@ var/const/NO_EMAG_ACT = -50 var/dorm = 0 // determines if this ID has claimed a dorm already var/datum/ntnet_user/chat_user + var/iff_faction = IFF_DEFAULT + /obj/item/card/id/Destroy() mob = null return ..() @@ -367,7 +369,7 @@ var/const/NO_EMAG_ACT = -50 item_state = "gold_id" overlay_state = "gold" -/obj/item/card/id/syndicate_command +/obj/item/card/id/syndicate/command name = "syndicate ID card" desc = "An ID straight from the Syndicate." icon_state = "dark" @@ -375,14 +377,14 @@ var/const/NO_EMAG_ACT = -50 assignment = "Syndicate Overlord" access = list(access_syndicate, access_external_airlocks) -/obj/item/card/id/syndicate_ert +/obj/item/card/id/syndicate/ert name = "\improper Syndicate Commando ID" assignment = "Commando" icon_state = "centcom" -/obj/item/card/id/syndicate_ert/New() +/obj/item/card/id/syndicate/ert/Initialize() + . = ..() access = get_all_accesses() - ..() /obj/item/card/id/syndicate/raider name = "passport" @@ -602,12 +604,14 @@ var/const/NO_EMAG_ACT = -50 desc = "A stylized plastic card, belonging to one of the many specialists at Einstein Engines." icon_state = "einstein_card" overlay_state = "einstein_card" + iff_faction = IFF_EE /obj/item/card/id/bluespace name = "bluespace identification card" desc = "A bizarre imitation of Nanotrasen identification cards. It seems to function normally as well." desc_antag = "Access can be copied from other ID cards by clicking on them." icon_state = "crystalid" + iff_faction = IFF_BLUESPACE /obj/item/card/id/bluespace/update_name() return diff --git a/code/game/objects/items/weapons/cards_ids_syndicate.dm b/code/game/objects/items/weapons/cards_ids_syndicate.dm index ed753eb6974..ed5c845d719 100644 --- a/code/game/objects/items/weapons/cards_ids_syndicate.dm +++ b/code/game/objects/items/weapons/cards_ids_syndicate.dm @@ -2,6 +2,7 @@ name = "agent card" assignment = "Agent" origin_tech = list(TECH_ILLEGAL = 3) + iff_faction = IFF_SYNDICATE can_copy_access = TRUE access_copy_msg = "The microscanner activates as you pass it over the ID, copying its access." var/charge = 10000 diff --git a/code/modules/heavy_vehicle/equipment/combat.dm b/code/modules/heavy_vehicle/equipment/combat.dm index be450a971fb..930d13465cc 100644 --- a/code/modules/heavy_vehicle/equipment/combat.dm +++ b/code/modules/heavy_vehicle/equipment/combat.dm @@ -7,6 +7,14 @@ restricted_hardpoints = list(HARDPOINT_LEFT_HAND, HARDPOINT_RIGHT_HAND, HARDPOINT_LEFT_SHOULDER, HARDPOINT_RIGHT_SHOULDER) restricted_software = list(MECH_SOFTWARE_WEAPONS) +/obj/item/mecha_equipment/mounted_system/combat/CtrlClick(mob/user) + if(owner && istype(holding, /obj/item/gun)) + var/obj/item/gun/G = holding + G.iff_capable = !G.iff_capable + to_chat(user, SPAN_NOTICE("You [G.iff_capable ? "en" : "dis"]able \the [src]'s IFF systems!")) + else + return ..() + /obj/item/mecha_equipment/mounted_system/combat/taser name = "mounted electrolaser carbine" desc = "A dual fire mode electrolaser system connected to the exosuit's targetting system." @@ -30,7 +38,7 @@ name = "mounted machinegun" desc = "An exosuit-mounted automatic weapon. Handle with care." icon_state = "mecha_ballistic" - holding_type = /obj/item/gun/energy/mountedsmg + holding_type = /obj/item/gun/energy/mountedsmg/mech /obj/item/mecha_equipment/mounted_system/combat/pulse name = "heavy pulse cannon" @@ -72,16 +80,19 @@ use_external_power = TRUE self_recharge = TRUE has_safety = FALSE + projectile_type = /obj/item/projectile/beam/midlaser/mech /obj/item/gun/energy/pulse/mounted/mech use_external_power = TRUE self_recharge = TRUE has_safety = FALSE + projectile_type = /obj/item/projectile/beam/pulse/mech /obj/item/gun/energy/xray/mounted/mech use_external_power = TRUE self_recharge = TRUE has_safety = FALSE + projectile_type = /obj/item/projectile/beam/xray/mech /*Launchers*/ diff --git a/code/modules/heavy_vehicle/mech_helpers.dm b/code/modules/heavy_vehicle/mech_helpers.dm index 49fa2a9d6a3..a63a4a38f0d 100644 --- a/code/modules/heavy_vehicle/mech_helpers.dm +++ b/code/modules/heavy_vehicle/mech_helpers.dm @@ -114,4 +114,10 @@ else animate(get_filter("INCORPBLUR"), time = 1 SECOND, size = 1, flags = ANIMATION_PARALLEL) animate(src, time = 1 SECOND, alpha = initial(alpha), flags = ANIMATION_PARALLEL) - remove_filter("INCORPBLUR") \ No newline at end of file + remove_filter("INCORPBLUR") + +/mob/living/heavy_vehicle/get_organ_name_from_zone(var/def_zone) + var/obj/item/mech_component/MC = zoneToComponent(def_zone) + if(MC) + return MC.name + return ..() \ No newline at end of file diff --git a/code/modules/item_worth/worths_list.dm b/code/modules/item_worth/worths_list.dm index 69ae579da0e..74e276fcc06 100644 --- a/code/modules/item_worth/worths_list.dm +++ b/code/modules/item_worth/worths_list.dm @@ -295,7 +295,7 @@ var/list/worths = list( /obj/item/card/id/silver = 200, /obj/item/card/id/gold = 5000, /obj/item/card/id/captains_spare = 5000, - /obj/item/card/id/syndicate_command = 7000, + /obj/item/card/id/syndicate/command = 7000, /obj/item/card/id/centcom = 7000, /obj/item/card/id/all_access = 10000, /obj/item/card/id = 30, diff --git a/code/modules/mob/living/carbon/human/human_helpers.dm b/code/modules/mob/living/carbon/human/human_helpers.dm index 15f2374e3d0..906e0b5f3e5 100644 --- a/code/modules/mob/living/carbon/human/human_helpers.dm +++ b/code/modules/mob/living/carbon/human/human_helpers.dm @@ -309,8 +309,14 @@ return TRUE return FALSE +/mob/living/carbon/human/get_organ_name_from_zone(var/def_zone) + var/obj/item/organ/external/E = organs_by_name[parse_zone(def_zone)] + if(E) + return E.name + return ..() + /mob/living/carbon/human/is_anti_materiel_vulnerable() if(isSynthetic()) return TRUE else - return FALSE \ No newline at end of file + return FALSE diff --git a/code/modules/mob/living/silicon/robot/syndicate_robot.dm b/code/modules/mob/living/silicon/robot/syndicate_robot.dm index ef6f491cf06..97cc1098f49 100644 --- a/code/modules/mob/living/silicon/robot/syndicate_robot.dm +++ b/code/modules/mob/living/silicon/robot/syndicate_robot.dm @@ -79,6 +79,9 @@ ) has_safety = FALSE +/obj/item/gun/energy/mountedsmg/mech + projectile_type = /obj/item/projectile/bullet/pistol/medium/mech + /obj/item/gun/energy/crossbow/cyborg name = "mounted energy-crossbow" desc = "A weapon favored by mercenary infiltration teams, this one is suited to be used by cyborgs." diff --git a/code/modules/mob/living/simple_animal/simple_animal.dm b/code/modules/mob/living/simple_animal/simple_animal.dm index 572597ddcf7..7f09dce3e3d 100644 --- a/code/modules/mob/living/simple_animal/simple_animal.dm +++ b/code/modules/mob/living/simple_animal/simple_animal.dm @@ -930,6 +930,9 @@ /mob/living/simple_animal/set_respawn_time() set_death_time(ANIMAL, world.time) +/mob/living/simple_animal/get_organ_name_from_zone(var/def_zone) + return pick(organ_names) + /mob/living/simple_animal/is_anti_materiel_vulnerable() if(isSynthetic()) return TRUE diff --git a/code/modules/mob/mob_helpers.dm b/code/modules/mob/mob_helpers.dm index 9b7b190a1c3..f89e4d15629 100644 --- a/code/modules/mob/mob_helpers.dm +++ b/code/modules/mob/mob_helpers.dm @@ -1253,4 +1253,7 @@ proc/is_blind(A) name = real_name voice_name = real_name if(mind) - mind.name = real_name \ No newline at end of file + mind.name = real_name + +/mob/proc/get_organ_name_from_zone(var/def_zone) + return parse_zone(def_zone) diff --git a/code/modules/projectiles/gun.dm b/code/modules/projectiles/gun.dm index 8ca0f3e7ca0..4eb9f5ef417 100644 --- a/code/modules/projectiles/gun.dm +++ b/code/modules/projectiles/gun.dm @@ -120,6 +120,8 @@ var/has_safety = TRUE var/image/safety_overlay + var/iff_capable = FALSE // if true, applies the user's ID iff_faction to the projectile + // sounds n shit var/safetyon_sound = 'sound/weapons/blade_open.ogg' var/safetyoff_sound = 'sound/weapons/blade_close.ogg' diff --git a/code/modules/projectiles/projectile.dm b/code/modules/projectiles/projectile.dm index 99169b086b7..260ac27c47d 100644 --- a/code/modules/projectiles/projectile.dm +++ b/code/modules/projectiles/projectile.dm @@ -99,6 +99,8 @@ var/hit_effect var/anti_materiel_potential = 1 //how much the damage of this bullet is increased against mechs + var/iff // identify friend or foe. will check mob's IDs to see if they match, if they do, won't hit + /obj/item/projectile/CanPass() return TRUE @@ -173,8 +175,17 @@ shot_from = launcher.name silenced = launcher.silenced + if(launcher.iff_capable && user) + iff = get_iff_from_user(user) + return launch_projectile(target, target_zone, user, params, angle_override, forced_spread) +/obj/item/projectile/proc/get_iff_from_user(var/mob/user) + var/obj/item/card/id/ID = user.GetIdCard() + if(ID) + return ID.iff_faction + return null + //Called when the projectile intercepts a mob. Returns 1 if the projectile hit the mob, 0 if it missed and should keep flying. /obj/item/projectile/proc/attack_mob(var/mob/living/target_mob, var/distance, var/miss_modifier=0) if(!istype(target_mob)) @@ -203,14 +214,7 @@ if(PROJECTILE_STOPPED) return TRUE - var/impacted_organ = parse_zone(def_zone) - if(isanimal(target_mob)) - var/mob/living/simple_animal/SA = target_mob - impacted_organ = pick(SA.organ_names) - else if(ishuman(target_mob)) - var/mob/living/carbon/human/H = target_mob - var/obj/item/organ/external/E = H.organs_by_name[impacted_organ] - impacted_organ = E.name + var/impacted_organ = target_mob.get_organ_name_from_zone(def_zone) //hit messages if(silenced) to_chat(target_mob, "You've been hit in the [impacted_organ] by \a [src]!") @@ -268,15 +272,18 @@ if(ismob(A)) var/mob/M = A if(isliving(A)) //so ghosts don't stop bullets - if(M.dir & get_dir(M, starting)) // only check neckgrab if they're facing in the direction the bullets came from - //if they have a neck grab on someone, that person gets hit instead - for(var/obj/item/grab/G in list(M.l_hand, M.r_hand)) - if(!G.affecting.lying && G.state >= GRAB_NECK) - visible_message(SPAN_DANGER("\The [M] uses [G.affecting] as a shield!")) - if(Collide(G.affecting)) - return //If Collide() returns 0 (keep going) then we continue on to attack M. + if(check_iff(M)) + passthrough = TRUE + else + if(M.dir & get_dir(M, starting)) // only check neckgrab if they're facing in the direction the bullets came from + //if they have a neck grab on someone, that person gets hit instead + for(var/obj/item/grab/G in list(M.l_hand, M.r_hand)) + if(!G.affecting.lying && G.state >= GRAB_NECK) + visible_message(SPAN_DANGER("\The [M] uses [G.affecting] as a shield!")) + if(Collide(G.affecting)) + return //If Collide() returns 0 (keep going) then we continue on to attack M. - passthrough = !attack_mob(M, distance) + passthrough = !attack_mob(M, distance) else passthrough = TRUE else @@ -312,6 +319,14 @@ qdel(src) return TRUE +/obj/item/projectile/proc/check_iff(var/mob/M) + if(isnull(iff)) + return FALSE + var/obj/item/card/id/ID = M.GetIdCard() + if(ID && (ID.iff_faction == iff)) + return TRUE + return FALSE + /obj/item/projectile/ex_act(var/severity = 2.0) return //explosions probably shouldn't delete projectiles diff --git a/code/modules/projectiles/projectile/beams.dm b/code/modules/projectiles/projectile/beams.dm index 18f30fc3705..fee955632bf 100644 --- a/code/modules/projectiles/projectile/beams.dm +++ b/code/modules/projectiles/projectile/beams.dm @@ -50,6 +50,9 @@ damage = 35 armor_penetration = 10 +/obj/item/projectile/beam/midlaser/mech + armor_penetration = 35 + /obj/item/projectile/beam/heavylaser name = "heavy laser" icon_state = "heavylaser" @@ -70,6 +73,10 @@ tracer_type = /obj/effect/projectile/tracer/xray impact_type = /obj/effect/projectile/impact/xray +/obj/item/projectile/beam/xray/mech + damage = 40 + armor_penetration = 75 + /obj/item/projectile/beam/pulse name = "pulse" icon_state = "u_laser" @@ -80,6 +87,10 @@ tracer_type = /obj/effect/projectile/tracer/pulse impact_type = /obj/effect/projectile/impact/pulse +/obj/item/projectile/beam/pulse/mech + damage = 45 + armor_penetration = 40 + /obj/item/projectile/beam/pulse/on_hit(var/atom/target, var/blocked = 0) if(isturf(target)) target.ex_act(2) diff --git a/code/modules/projectiles/projectile/bullets.dm b/code/modules/projectiles/projectile/bullets.dm index d548225266b..2aa8dd6de3d 100644 --- a/code/modules/projectiles/projectile/bullets.dm +++ b/code/modules/projectiles/projectile/bullets.dm @@ -127,6 +127,9 @@ /obj/item/projectile/bullet/pistol/medium damage = 30 +/obj/item/projectile/bullet/pistol/medium/mech + armor_penetration = 35 + /obj/item/projectile/bullet/pistol/strong damage = 45 armor_penetration = 20 diff --git a/html/changelogs/geeves-powerful_mechs.yml b/html/changelogs/geeves-powerful_mechs.yml new file mode 100644 index 00000000000..a106f490dfb --- /dev/null +++ b/html/changelogs/geeves-powerful_mechs.yml @@ -0,0 +1,8 @@ +author: Geeves + +delete-after: True + +changes: + - rscadd: "Mech mounted firearms have been buffed. They now deal more damage and pierce through more armor." + - rscadd: "Projectiles hitting mechs now state which component they hit rather than using the humanoid limb naming system." + - rscadd: "Implemented an IFF system, currently only mech mounted weapons can enable them by cntrl clicking the weapon in the hotbar. IFF weapons will never hit a friendly that has the same IFF ID as you." \ No newline at end of file