mirror of
https://github.com/Bubberstation/Bubberstation.git
synced 2026-07-18 19:44:58 +01:00
-Adds firing pin box define
-Examining a gun now shows its pin -You can now emag a firing pin to make it function without checks. -Loyalty pins unable to be constructed
This commit is contained in:
@@ -433,6 +433,21 @@
|
||||
new /obj/item/weapon/cartridge/security(src)
|
||||
new /obj/item/weapon/cartridge/security(src)
|
||||
|
||||
/obj/item/weapon/storage/box/firingpins
|
||||
name = "box of standard firing pins"
|
||||
desc = "A box full of standard firing pins, to allow newly-developed firearms to operate."
|
||||
icon_state = "id"
|
||||
|
||||
/obj/item/weapon/storage/box/firingpins/New()
|
||||
..()
|
||||
new /obj/item/device/firing_pin(src)
|
||||
new /obj/item/device/firing_pin(src)
|
||||
new /obj/item/device/firing_pin(src)
|
||||
new /obj/item/device/firing_pin(src)
|
||||
new /obj/item/device/firing_pin(src)
|
||||
new /obj/item/device/firing_pin(src)
|
||||
new /obj/item/device/firing_pin(src)
|
||||
|
||||
/obj/item/weapon/storage/box/handcuffs
|
||||
name = "box of spare handcuffs"
|
||||
desc = "A box full of handcuffs."
|
||||
|
||||
@@ -36,24 +36,37 @@
|
||||
var/obj/item/device/flashlight/F = null
|
||||
var/can_flashlight = 0
|
||||
|
||||
|
||||
/obj/item/weapon/gun/New()
|
||||
..()
|
||||
if(pin)
|
||||
pin = new pin(src)
|
||||
|
||||
|
||||
/obj/item/weapon/gun/examine(mob/user)
|
||||
..()
|
||||
if(pin)
|
||||
user << "It has a [pin] installed."
|
||||
else
|
||||
user << "It doesn't have a firing pin installed, and won't fire."
|
||||
|
||||
|
||||
/obj/item/weapon/gun/proc/process_chamber()
|
||||
return 0
|
||||
|
||||
|
||||
//check if there's enough ammo/energy/whatever to shoot one time
|
||||
//i.e if clicking would make it shoot
|
||||
/obj/item/weapon/gun/proc/can_shoot()
|
||||
return 1
|
||||
|
||||
|
||||
/obj/item/weapon/gun/proc/shoot_with_empty_chamber(mob/living/user as mob|obj)
|
||||
user << "<span class='danger'>*click*</span>"
|
||||
playsound(user, 'sound/weapons/empty.ogg', 100, 1)
|
||||
return
|
||||
|
||||
|
||||
/obj/item/weapon/gun/proc/shoot_live_shot(mob/living/user as mob|obj, var/pointblank = 0, var/mob/pbtarget = null, var/message = 1)
|
||||
if(recoil)
|
||||
spawn()
|
||||
@@ -70,10 +83,12 @@
|
||||
else
|
||||
user.visible_message("<span class='danger'>[user] fires [src]!</span>", "<span class='danger'>You fire [src]!</span>", "You hear a [istype(src, /obj/item/weapon/gun/energy) ? "laser blast" : "gunshot"]!")
|
||||
|
||||
|
||||
/obj/item/weapon/gun/emp_act(severity)
|
||||
for(var/obj/O in contents)
|
||||
O.emp_act(severity)
|
||||
|
||||
|
||||
/obj/item/weapon/gun/afterattack(atom/target as mob|obj|turf, mob/living/carbon/human/user as mob|obj, flag, params)//TODO: go over this
|
||||
if(flag) //It's adjacent, is the user, or is on the user's person
|
||||
if(istype(target, /mob/) && target != user && !(target in user.contents)) //We make sure that it is a mob, it's not us or part of us.
|
||||
@@ -99,11 +114,13 @@
|
||||
|
||||
process_fire(target,user,1,params)
|
||||
|
||||
|
||||
/obj/item/weapon/gun/proc/can_trigger_gun(mob/living/carbon/user)
|
||||
if (!user.IsAdvancedToolUser())
|
||||
user << "<span class='notice'>You don't have the dexterity to do this!</span>"
|
||||
return 0
|
||||
|
||||
|
||||
if(trigger_guard)
|
||||
if(istype(user) && user.dna)
|
||||
if(user.dna.check_mutation(HULK))
|
||||
@@ -114,9 +131,10 @@
|
||||
return 0
|
||||
return 1
|
||||
|
||||
|
||||
/obj/item/weapon/gun/proc/handle_pins(mob/living/user)
|
||||
if(pin)
|
||||
if(pin.pin_auth(user))
|
||||
if(pin.pin_auth(user) || pin.emagged)
|
||||
return 1
|
||||
else
|
||||
user << "<span class='warning'>INVALID USER.</span>"
|
||||
@@ -125,6 +143,7 @@
|
||||
user << "<span class='notice'>\The [src]'s trigger is locked. This weapon doesn't have a firing pin installed!</span>"
|
||||
return 0
|
||||
|
||||
|
||||
/obj/item/weapon/gun/proc/process_fire(atom/target as mob|obj|turf, mob/living/user as mob|obj, var/message = 1, params)
|
||||
add_fingerprint(user)
|
||||
|
||||
|
||||
@@ -84,4 +84,5 @@
|
||||
force = 10
|
||||
m_amt = 4000
|
||||
suppressed = 0
|
||||
mag_type = /obj/item/ammo_box/magazine/internal/cylinder/crossbow/large
|
||||
mag_type = /obj/item/ammo_box/magazine/internal/cylinder/crossbow/large
|
||||
pin = null
|
||||
@@ -58,19 +58,6 @@
|
||||
origin_tech = "combat=2;materials=2"
|
||||
mag_type = /obj/item/ammo_box/magazine/internal/cylinder/rev38
|
||||
|
||||
/*
|
||||
/obj/item/weapon/gun/projectile/revolver/detective/special_check(var/mob/living/carbon/human/M)
|
||||
if(magazine.caliber == initial(magazine.caliber))
|
||||
return 1
|
||||
if(prob(70 - (magazine.ammo_count() * 10))) //minimum probability of 10, maximum of 60
|
||||
playsound(M, fire_sound, 50, 1)
|
||||
M << "<span class='danger'>[src] blows up in your face!</span>"
|
||||
M.take_organ_damage(0,20)
|
||||
M.drop_item()
|
||||
qdel(src)
|
||||
return 0
|
||||
return 1
|
||||
*/
|
||||
/obj/item/weapon/gun/projectile/revolver/detective/process_fire(atom/target as mob|obj|turf, mob/living/user as mob|obj, var/message = 1, params)
|
||||
if(magazine.caliber != initial(magazine.caliber))
|
||||
if(prob(70 - (magazine.ammo_count() * 10))) //minimum probability of 10, maximum of 60
|
||||
@@ -83,7 +70,6 @@
|
||||
..()
|
||||
|
||||
|
||||
|
||||
/obj/item/weapon/gun/projectile/revolver/detective/verb/rename_gun()
|
||||
set name = "Name Gun"
|
||||
set category = "Object"
|
||||
|
||||
@@ -7,6 +7,7 @@
|
||||
flags = CONDUCT
|
||||
w_class = 1
|
||||
attack_verb = list("poked")
|
||||
var/emagged = 0
|
||||
|
||||
/obj/item/device/firing_pin/afterattack(atom/target, mob/user, proximity_flag)
|
||||
if(proximity_flag)
|
||||
@@ -19,6 +20,11 @@
|
||||
else
|
||||
user << "<span class ='notice'>This firearm already has a firing pin installed.</span>"
|
||||
|
||||
/obj/item/device/firing_pin/emag_act(mob/user)
|
||||
if(!emagged)
|
||||
emagged = 1
|
||||
user << "<span class='notice'>You override the authentication mechanism.</span>"
|
||||
|
||||
/obj/item/device/firing_pin/proc/pin_auth(mob/living/user)
|
||||
return 1
|
||||
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
|
||||
/datum/design/pin_testing
|
||||
name = "test-range firing pin"
|
||||
desc = "This safety firing pin allows weapons to be fired within proximity to a firing range."
|
||||
desc = "This safety firing pin allows firearms to be operated within proximity to a firing range."
|
||||
id = "pin_testing"
|
||||
req_tech = list("combat" = 1, "materials" = 2)
|
||||
build_type = PROTOLATHE
|
||||
@@ -16,7 +16,7 @@
|
||||
name = "loyalty firing pin"
|
||||
desc = "This is a security firing pin which only authorizes users who are loyalty-implanted."
|
||||
id = "pin_loyalty"
|
||||
req_tech = list("combat" = 5, "materials" = 3, "powerstorage" = 3)
|
||||
req_tech = list("combat" = 10, "materials" = 3, "powerstorage" = 3)
|
||||
build_type = PROTOLATHE
|
||||
materials = list("$silver" = 600, "$diamond" = 600, "$uranium" = 200)
|
||||
build_path = /obj/item/device/firing_pin/implant/loyalty
|
||||
|
||||
Reference in New Issue
Block a user