Pipegun Buff (#12365)

This commit is contained in:
Geeves
2021-08-31 18:05:02 +02:00
committed by GitHub
parent 996fa086bc
commit 6c5e9aa111
12 changed files with 83 additions and 30 deletions
+18 -17
View File
@@ -3,23 +3,24 @@
#define CANDLE_LUM 3 // For how bright candles are.
// Item inventory slot bitmasks.
#define SLOT_OCLOTHING (1<<0)
#define SLOT_ICLOTHING (1<<1)
#define SLOT_GLOVES (1<<2)
#define SLOT_EYES (1<<3)
#define SLOT_EARS (1<<4)
#define SLOT_MASK (1<<5)
#define SLOT_HEAD (1<<6)
#define SLOT_FEET (1<<7)
#define SLOT_ID (1<<8)
#define SLOT_BELT (1<<9)
#define SLOT_BACK (1<<10)
#define SLOT_POCKET (1<<11) // This is to allow items with a w_class of 3 or 4 to fit in pockets.
#define SLOT_DENYPOCKET (1<<12) // This is to deny items with a w_class of 2 or 1 from fitting in pockets.
#define SLOT_TWOEARS (1<<13)
#define SLOT_TIE (1<<14)
#define SLOT_HOLSTER (1<<15)
#define SLOT_WRISTS (1<<16)
#define SLOT_OCLOTHING BITFLAG(0)
#define SLOT_ICLOTHING BITFLAG(1)
#define SLOT_GLOVES BITFLAG(2)
#define SLOT_EYES BITFLAG(3)
#define SLOT_EARS BITFLAG(4)
#define SLOT_MASK BITFLAG(5)
#define SLOT_HEAD BITFLAG(6)
#define SLOT_FEET BITFLAG(7)
#define SLOT_ID BITFLAG(8)
#define SLOT_BELT BITFLAG(9)
#define SLOT_BACK BITFLAG(10)
#define SLOT_POCKET BITFLAG(11) // This is to allow items with a w_class of 3 or 4 to fit in pockets.
#define SLOT_DENYPOCKET BITFLAG(12) // This is to deny items with a w_class of 2 or 1 from fitting in pockets.
#define SLOT_TWOEARS BITFLAG(13)
#define SLOT_TIE BITFLAG(14)
#define SLOT_HOLSTER BITFLAG(15)
#define SLOT_WRISTS BITFLAG(16)
#define SLOT_S_STORE BITFLAG(17)
// Flags bitmasks.
#define NOBLUDGEON 0x1 // When an item has this it produces no "X has been hit by Y with Z" message with the default handler.
+7 -3
View File
@@ -396,7 +396,8 @@ var/list/global/slot_flags_enumeration = list(
"[slot_w_uniform]" = SLOT_ICLOTHING,
"[slot_wear_id]" = SLOT_ID,
"[slot_tie]" = SLOT_TIE,
"[slot_wrists]" = SLOT_WRISTS
"[slot_wrists]" = SLOT_WRISTS,
"[slot_s_store]" = SLOT_S_STORE
)
//the mob M is attempting to equip this item into the slot passed through as 'slot'. Return 1 if it can do this and 0 if it can't.
@@ -462,13 +463,16 @@ var/list/global/slot_flags_enumeration = list(
if( w_class > 2 && !(slot_flags & SLOT_POCKET) )
return 0
if(slot_s_store)
if(isvaurca(H) && src.w_class <= ITEMSIZE_SMALL)
var/can_hold_s_store = (slot_flags & SLOT_S_STORE)
if(!can_hold_s_store && H.species.can_hold_s_store(src))
can_hold_s_store = TRUE
if(can_hold_s_store)
return TRUE
if(!H.wear_suit && (slot_wear_suit in mob_equip))
if(!disable_warning)
to_chat(H, "<span class='warning'>You need a suit before you can attach this [name].</span>")
return 0
if(!H.wear_suit.allowed)
if(!H.wear_suit?.allowed)
if(!disable_warning)
to_chat(usr, "<span class='warning'>You somehow have a suit with no defined allowed items for suit storage, stop that.</span>")
return 0
@@ -114,6 +114,7 @@
recipes += new /datum/stack_recipe_list("[display_name] weaponry",
list(
new /datum/stack_recipe("makeshift magazine (5.56mm)", /obj/item/ammo_magazine/a556/makeshift/empty, 5, time = 20),
new /datum/stack_recipe("grenade casing", /obj/item/grenade/chem_grenade),
new /datum/stack_recipe("firearm receiver", /obj/item/receivergun, 15, time = 25, one_per_turf = 0, on_floor = 0),
new /datum/stack_recipe("shield fittings", /obj/item/material/shieldbits, 10, time = 25),
@@ -93,7 +93,12 @@ This saves us from having to call add_fingerprint() any time something is put in
if (wear_suit.flags_inv & HIDEJUMPSUIT)
update_uniform = 1
if(s_store)
if(!(isvaurca(src) && s_store.w_class <= ITEMSIZE_SMALL))
var/can_keep_s_store = FALSE
if(s_store.slot_flags & SLOT_S_STORE)
can_keep_s_store = TRUE
if(!can_keep_s_store && species.can_hold_s_store(s_store))
can_keep_s_store = TRUE
if(!can_keep_s_store)
drop_from_inventory(s_store)
wear_suit = null
update_inv_wear_suit()
@@ -774,4 +774,7 @@
if(C?.can_support)
stance_damage -=2
return stance_damage
return stance_damage
/datum/species/proc/can_hold_s_store(var/obj/item/I)
return FALSE
@@ -159,3 +159,8 @@
/datum/species/bug/is_naturally_insulated()
return TRUE
/datum/species/bug/can_hold_s_store(obj/item/I)
if(I.w_class <= ITEMSIZE_SMALL)
return TRUE
return FALSE
+11 -1
View File
@@ -236,7 +236,7 @@
max_ammo = 15
/obj/item/ammo_magazine/a556/carbine/empty
max_ammo = 0
initial_ammo = 0
/obj/item/ammo_magazine/a556/carbine/practice
name = "carbine magazine (5.56mm practice)"
@@ -248,6 +248,16 @@
origin_tech = list(TECH_COMBAT = 3)
ammo_type = /obj/item/ammo_casing/a556/ap
/obj/item/ammo_magazine/a556/makeshift
name = "makeshift magazine (5.56mm)"
icon_state = "5.56m"
origin_tech = list(TECH_COMBAT = 1)
matter = list(DEFAULT_WALL_MATERIAL = 600)
max_ammo = 7
/obj/item/ammo_magazine/a556/makeshift/empty
initial_ammo = 0
/obj/item/ammo_magazine/a50
name = "magazine (.50)"
icon_state = "50ae"
@@ -90,6 +90,7 @@
to_chat(user, "<span class='danger'>\The [src] jams!</span>")
balloon_alert(user, SPAN_RED("JAM"))
jam_num = rand(2, 5) // gotta attackself two to five times to unjam
return FALSE
return TRUE
/obj/item/gun/projectile/proc/process_chambered()
@@ -59,13 +59,25 @@
caliber = "a556"
ammo_type = null
magazine_type = null
max_shells = 4
allowed_magazines = list(/obj/item/ammo_magazine/a556/makeshift)
load_method = MAGAZINE
max_shells = 7
can_sawoff = FALSE
needspin = FALSE
has_safety = FALSE
jam_chance = 0
slot_flags = SLOT_BACK|SLOT_S_STORE // can be stored in suit slot due to built in sling
jam_chance = -10
/obj/item/gun/projectile/shotgun/pump/rifle/pipegun/handle_pump_loading()
if(ammo_magazine && length(ammo_magazine.stored_ammo))
var/obj/item/ammo_casing/AC = ammo_magazine.stored_ammo[1] //load next casing.
if(AC)
AC.forceMove(src)
ammo_magazine.stored_ammo -= AC
chambered = AC
/obj/item/gun/projectile/shotgun/pump/rifle/pipegun/examine(mob/user)
. = ..()
@@ -68,8 +68,7 @@
/obj/item/gun/projectile/shotgun/pump/unique_action(mob/living/user)
if(jam_num)
return
else if(unjam_cooldown + 2 SECONDS > world.time)
to_chat(user, SPAN_WARNING("\The [src] is jammed!"))
return
if(world.time >= recentpump + 10)
pump(user)
@@ -88,14 +87,17 @@
playsound(src.loc, chambered.drop_sound, DROP_SOUND_VOLUME, FALSE, required_asfx_toggles = ASFX_DROPSOUND)
chambered = null
handle_pump_loading()
update_maptext()
update_icon()
/obj/item/gun/projectile/shotgun/pump/proc/handle_pump_loading()
if(length(loaded))
var/obj/item/ammo_casing/AC = loaded[1] //load next casing.
loaded -= AC //Remove casing from loaded list.
chambered = AC
update_maptext()
update_icon()
/obj/item/gun/projectile/shotgun/pump/combat
name = "combat shotgun"
desc = "Built for close quarters combat, the Hephaestus Industries KS-40 is widely regarded as a weapon of choice for repelling boarders."
+9
View File
@@ -0,0 +1,9 @@
author: Geeves
delete-after: True
changes:
- rscadd: "Pipeguns now take a makeshift 5.56mm magazine, crafted with steel sheets under the Steel Weaponry tab. It holds 7 rounds."
- rscadd: "Pipeguns can now be held on the suit storage slot regardless of what's in your suit slot."
- tweak: "Pipeguns can now fire three guaranteed shots before the chance of jamming sets in, per clean."
- bugfix: "Cleaned up some funkiness with the jam mechanics, should feel nicer now."
Binary file not shown.

Before

Width:  |  Height:  |  Size: 35 KiB

After

Width:  |  Height:  |  Size: 36 KiB