This commit is contained in:
Geeves
2021-02-14 19:08:06 +01:00
committed by GitHub
parent c4c785ea18
commit 656da99177
5 changed files with 56 additions and 4 deletions
@@ -122,12 +122,11 @@
var/obj/item/stack/cable_coil/C = W
if(buildstate == 3)
if(C.use(10))
to_chat(user, "<span class='notice'>You tie the lengths of cable to the shotgun, making a sling.</span>")
var/obj/item/gun/projectile/shotgun/improvised/G = new(get_turf(src))
G.fail_chance = rand(1,100)
to_chat(user, "<span class='notice'>You tie the lengths of cable to the pipegun, making a sling.</span>")
new /obj/item/gun/projectile/shotgun/pump/rifle/pipegun(get_turf(src))
qdel(src)
else
to_chat(user, "<span class='notice'>You need at least ten lengths of cable if you want to make a sling!.</span>")
to_chat(user, "<span class='notice'>You need at least ten lengths of cable if you want to make a sling!</span>")
return
..()
@@ -50,6 +50,48 @@
slot_flags = SLOT_BELT|SLOT_HOLSTER
can_bayonet = FALSE
/obj/item/gun/projectile/shotgun/pump/rifle/pipegun
name = "pipegun"
desc = "An excellent weapon for flushing out tunnel rats and enemy assistants, but its rifling leaves much to be desired."
icon = 'icons/obj/guns/pipegun.dmi'
icon_state = "pipegun"
item_state = "pipegun"
caliber = "a556"
ammo_type = null
magazine_type = null
max_shells = 4
can_sawoff = FALSE
jam_chance = 0
/obj/item/gun/projectile/shotgun/pump/rifle/pipegun/examine(mob/user)
. = ..()
switch(jam_chance)
if(10 to 20)
to_chat(user, SPAN_NOTICE("\The [src] is starting to accumulate fouling. Might want to grab a rag."))
if(20 to 40)
to_chat(user, SPAN_WARNING("\The [src] looks reasonably fouled up. Maybe you should clean it with a rag."))
if(40 to 80)
to_chat(user, SPAN_WARNING("\The [src] is starting to look quite gunked up. You should clean it with a rag."))
if(80 to INFINITY)
to_chat(user, SPAN_DANGER("\The [src] is completely fouled. You're going to be extremely lucky to get a shot off. Clean it with a rag."))
/obj/item/gun/projectile/shotgun/pump/rifle/pipegun/attackby(obj/item/A, mob/user)
if(istype(A, /obj/item/reagent_containers/glass/rag))
if(!jam_chance || jam_chance == initial(jam_chance))
to_chat(user, SPAN_WARNING("There's no fouling present on \the [src]."))
return
user.visible_message("<b>[user]</b> starts cleaning \the [src] with \the [A].", SPAN_NOTICE("You start cleaning \the [src] with \the [A]."))
if(do_after(user, jam_chance * 5))
to_chat(user, SPAN_WARNING("You completely clean \the [src]."))
jam_chance = initial(jam_chance)
return
return ..()
/obj/item/gun/projectile/shotgun/pump/rifle/pipegun/handle_post_fire(mob/user)
. = ..()
jam_chance = min(jam_chance + 5, 100)
/obj/item/gun/projectile/contender
name = "pocket rifle"
desc = "A perfect, pristine replica of an ancient one-shot hand-cannon. This one has been modified to work almost like a bolt-action. Uses 5.56mm rounds."
@@ -65,6 +65,10 @@
return null
/obj/item/gun/projectile/shotgun/pump/attack_self(mob/living/user)
if(jam_num)
return ..()
else if(unjam_cooldown + 2 SECONDS > world.time)
return
if(world.time >= recentpump + 10)
pump(user)
recentpump = world.time