Adds Derringers (Code) Initial Commit

This commit is contained in:
The0bserver
2021-04-11 04:20:12 -04:00
parent f06f54b75d
commit 55eb445a07
7 changed files with 157 additions and 0 deletions

View File

@@ -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, "<span class='notice'>You take \a [W] out of the pack.</span>")
else
to_chat(user, "<span class='notice'>There are no items left in the pack.</span>")
/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//
/////////////

View File

@@ -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

View File

@@ -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

View File

@@ -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

View File

@@ -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

View File

@@ -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."

View File

@@ -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"