From 55eb445a072056ec867304d50865439badf324ff Mon Sep 17 00:00:00 2001 From: The0bserver Date: Sun, 11 Apr 2021 04:20:12 -0400 Subject: [PATCH] Adds Derringers (Code) Initial Commit --- code/game/objects/items/storage/fancy.dm | 55 +++++++++++++++++++ .../ammunition/ballistic/revolver.dm | 7 +++ .../boxes_magazines/internal/derringer.dm | 19 +++++++ .../projectiles/guns/ballistic/derringer.dm | 44 +++++++++++++++ .../projectile/bullets/revolver.dm | 10 ++++ .../uplink/uplink_items/uplink_stealth.dm | 20 +++++++ tgstation.dme | 2 + 7 files changed, 157 insertions(+) create mode 100644 code/modules/projectiles/boxes_magazines/internal/derringer.dm create mode 100644 code/modules/projectiles/guns/ballistic/derringer.dm diff --git a/code/game/objects/items/storage/fancy.dm b/code/game/objects/items/storage/fancy.dm index db55b0414c..e3fedecc1d 100644 --- a/code/game/objects/items/storage/fancy.dm +++ b/code/game/objects/items/storage/fancy.dm @@ -351,6 +351,61 @@ if(!contents.len) . += "[icon_state]_empty" +//Derringer "Cigarettes"// +/obj/item/storage/fancy/cigarettes/derringer + name = "\improper Robust packet" + desc = "Smoked by the robust." + icon_state = "robust" + spawn_type = /obj/item/gun/ballistic/derringer/traitor + +/obj/item/storage/fancy/cigarettes/derringer/ComponentInitialize() + . = ..() + var/datum/component/storage/STR = GetComponent(/datum/component/storage) + STR.max_items = 6 + STR.set_holdable(list(/obj/item/clothing/mask/cigarette, /obj/item/lighter, /obj/item/gun/ballistic/derringer, /obj/item/ammo_casing/a357, /obj/item/ammo_casing/g4570)) + +/obj/item/storage/fancy/cigarettes/derringer/AltClick(mob/living/carbon/user) + if(!istype(user) || !user.canUseTopic(src, BE_CLOSE, ismonkey(user))) + return + var/obj/item/W = (locate(/obj/item/ammo_casing/a357) in contents) || (locate(/obj/item/clothing/mask/cigarette) in contents) //Easy access smokes and bullets + if(W && contents.len > 0) + SEND_SIGNAL(src, COMSIG_TRY_STORAGE_TAKE, W, user) + user.put_in_hands(W) + contents -= W + to_chat(user, "You take \a [W] out of the pack.") + else + to_chat(user, "There are no items left in the pack.") + +/obj/item/storage/fancy/cigarettes/derringer/PopulateContents() + new spawn_type(src) + new /obj/item/ammo_casing/a357(src) + new /obj/item/ammo_casing/a357(src) + new /obj/item/ammo_casing/a357(src) + new /obj/item/ammo_casing/a357(src) + new /obj/item/clothing/mask/cigarette/syndicate(src) + +//For traitors with luck/class +/obj/item/storage/fancy/cigarettes/derringer/gold + name = "\improper Robust Gold packet" + desc = "Smoked by the truly robust." + icon_state = "robustg" + spawn_type = /obj/item/gun/ballistic/derringer/gold + +//For operatives, bound in a ka-tet. +/obj/item/storage/fancy/cigarettes/derringer/midworld + name = "\improper Midworld's Green Bend" + desc = "The wheel of Ka turns, Gunslinger." + icon_state = "slime" + spawn_type = /obj/item/gun/ballistic/derringer/nukeop + +/obj/item/storage/fancy/cigarettes/derringer/midworld/PopulateContents() + new spawn_type(src) + new /obj/item/ammo_casing/g4570(src) + new /obj/item/ammo_casing/g4570(src) + new /obj/item/ammo_casing/g4570(src) + new /obj/item/ammo_casing/g4570(src) + new /obj/item/clothing/mask/cigarette/xeno(src) + ///////////// //CIGAR BOX// ///////////// diff --git a/code/modules/projectiles/ammunition/ballistic/revolver.dm b/code/modules/projectiles/ammunition/ballistic/revolver.dm index c13a3c953d..ba5714812e 100644 --- a/code/modules/projectiles/ammunition/ballistic/revolver.dm +++ b/code/modules/projectiles/ammunition/ballistic/revolver.dm @@ -73,3 +73,10 @@ name = ".38 DumDum bullet casing" desc = "A .38 DumDum bullet casing." projectile_type = /obj/item/projectile/bullet/c38/dumdum + +//.45-70 GOVT (Gunslinger's Derringer) + +/obj/item/ammo_casing/g4570 + name= ".45-70 Govt bullet casing" + desc = "An exceedingly rare .45-70 Govt bullet casing." + projectile_type = /obj/item/projectile/bullet/g4570 diff --git a/code/modules/projectiles/boxes_magazines/internal/derringer.dm b/code/modules/projectiles/boxes_magazines/internal/derringer.dm new file mode 100644 index 0000000000..f2dd39ee3c --- /dev/null +++ b/code/modules/projectiles/boxes_magazines/internal/derringer.dm @@ -0,0 +1,19 @@ +/obj/item/ammo_box/magazine/internal/derr38 + name = "derringer muzzle" + ammo_type = /obj/item/ammo_casing/c38 + caliber = "38" + max_ammo = 2 + +/obj/item/ammo_box/magazine/internal/derr357 + name = "\improper derringer muzzle" + ammo_type = /obj/item/ammo_casing/a357 + caliber = "357" + max_ammo = 2 + multiload = FALSE + +/obj/item/ammo_box/internal/derr4570 + name = "\improper derringer muzzle" + ammo_type = /obj/item/ammo_casing/g4570 + caliber = "45-70" + max_ammo = 2 + multiload = FALSE diff --git a/code/modules/projectiles/guns/ballistic/derringer.dm b/code/modules/projectiles/guns/ballistic/derringer.dm new file mode 100644 index 0000000000..915fb35213 --- /dev/null +++ b/code/modules/projectiles/guns/ballistic/derringer.dm @@ -0,0 +1,44 @@ +/obj/item/gun/ballistic/derringer + name = ".38 Derringer" + desc = "A easily consealable derringer. Uses .38 ammo" + icon = 'icons/obj/guns/projectile.dmi' + icon_state = "derringer" + mag_type = /obj/item/ammo_box/magazine/internal/derr38 + fire_sound = 'sound/weapons/gun/revolver/shot_alt.ogg' + casing_ejector = FALSE + w_class = WEIGHT_CLASS_TINY + +/obj/item/gun/ballistic/derringer/Initialize() + ..() + transform *= 0.8 //Spriter too lazy to make icons smaller than default revolvers, local coder hacks in solution. + +/obj/item/gun/ballistic/derringer/get_ammo(countchambered = FALSE, countempties = TRUE) + var/boolets = 0 //legacy var name maturity + if (chambered && countchambered) + boolets++ + if (magazine) + boolets += magazine.ammo_count(countempties) + return boolets + +/obj/item/gun/ballistic/derringer/examine(mob/user) + . = ..() + var/live_ammo = get_ammo(FALSE, FALSE) + . += "[live_ammo ? live_ammo : "None"] of those are live rounds." + +/obj/item/gun/ballistic/derringer/traitor + name = "\improper .357 Syndicate Derringer" + desc = "An easily consealable derriger, if not for the bright red and black. Uses .357 ammo" + icon_state = "derringer_syndie" + mag_type = /obj/item/ammo_box/magazine/internal/derr357 + +/obj/item/gun/ballistic/derringer/gold + name = "\improper Golden Derringer" + desc = "The golden sheen is somewhat counterintuitive as a stealth weapon, but it looks cool. Uses .357 ammo" + icon_state = "derringer_gold" + mag_type = /obj/item/ammo_box/magazine/internal/derr357 + +/obj/item/gun/ballistic/derringer/nukeop + name = "\improper Gunslinger's Derringer" + desc = "Sandalwood grip, wellkempt blue-grey steel barrels, and a crash like thunder itself. Uses the exceedingly rare 45-70 Govt. ammo" + icon_state = "derringer_syndie" + mag_type = /obj/item/ammo_box/magazine/internal/derr4570 diff --git a/code/modules/projectiles/projectile/bullets/revolver.dm b/code/modules/projectiles/projectile/bullets/revolver.dm index ec3cadc31a..2fa70d49c5 100644 --- a/code/modules/projectiles/projectile/bullets/revolver.dm +++ b/code/modules/projectiles/projectile/bullets/revolver.dm @@ -138,3 +138,13 @@ embedding = list(embed_chance=90, fall_chance=2, jostle_chance=5, ignore_throwspeed_threshold=TRUE, pain_stam_pct=0.4, pain_mult=5, jostle_pain_mult=6, rip_time=10) wound_falloff_tile = -1 embed_falloff_tile = -5 + +//.45-70 GOVT (Gunslinger's Derringer) +//0bserver here. For all that is holy, do me a flavor, and do NOT allow people easy access to this ammo. This is meant for extremely lucky traitors, and nuclear operatives. + +/obj/item/projectile/bullet/g4570 + name = ".45-70 Govt bullet" + damage = 60 + armour_penetration = 40 + wound_bonus = -80 + diff --git a/code/modules/uplink/uplink_items/uplink_stealth.dm b/code/modules/uplink/uplink_items/uplink_stealth.dm index 1bd75fa2b1..25d90a0c2d 100644 --- a/code/modules/uplink/uplink_items/uplink_stealth.dm +++ b/code/modules/uplink/uplink_items/uplink_stealth.dm @@ -39,6 +39,26 @@ item = /obj/item/toy/plush/carpplushie/dehy_carp cost = 1 +datum/uplink_item/stealthy_weapons/derringerpack + name = "Compact Derringer" + desc = "An easily concealable handgun capable of firing .357 rounds. Comes in an inconspicuious packet of cigarettes with additional munitions." + item = /obj/item/storage/fancy/cigarettes/derringer + cost = 8 + surplus = 30 + +/datum/uplink_item/stealthy_weapons/derringerpack/purchase(mob/user, datum/component/uplink/U) + if(prob(1)) //For the 1% + item = /obj/item/storage/fancy/cigarettes/derringer/gold + ..() + +datum/uplink_item/stalthy_weapons/derringerpack_nukie + name = "Antique Derringer" + desc = "An easy to conceal, yet extremely deadly handgun, capable of firing .45-70 Govt rounds. Comes in a unique pack of cigarettes with additional munitions." + item = /obj/storage/fancy/cigarettes/derringer/midworld + include_modes = list(/datum/game_mode/nuclear) + cost = 10 + surplus = 2 + /datum/uplink_item/stealthy_weapons/edagger name = "Energy Dagger" desc = "A dagger made of energy that looks and functions as a pen when off." diff --git a/tgstation.dme b/tgstation.dme index f59457ed2f..91392c5f8e 100644 --- a/tgstation.dme +++ b/tgstation.dme @@ -3090,6 +3090,7 @@ #include "code\modules\projectiles\boxes_magazines\internal\_cylinder.dm" #include "code\modules\projectiles\boxes_magazines\internal\_internal.dm" #include "code\modules\projectiles\boxes_magazines\internal\bow.dm" +#include "code\modules\projectiles\boxes_magazines\internal\derringer.dm" #include "code\modules\projectiles\boxes_magazines\internal\grenade.dm" #include "code\modules\projectiles\boxes_magazines\internal\misc.dm" #include "code\modules\projectiles\boxes_magazines\internal\revolver.dm" @@ -3101,6 +3102,7 @@ #include "code\modules\projectiles\guns\magic.dm" #include "code\modules\projectiles\guns\ballistic\automatic.dm" #include "code\modules\projectiles\guns\ballistic\bow.dm" +#include "code\modules\projectiles\guns\ballistic\derringer.dm" #include "code\modules\projectiles\guns\ballistic\laser_gatling.dm" #include "code\modules\projectiles\guns\ballistic\launchers.dm" #include "code\modules\projectiles\guns\ballistic\magweapon.dm"