Merge remote-tracking branch 'refs/remotes/PolarisSS13/master' into GunsGunsGuns

# Conflicts:
#	code/modules/projectiles/gun.dm
This commit is contained in:
Spades
2016-06-03 20:29:19 -04:00
14 changed files with 286 additions and 78 deletions
+103
View File
@@ -82,6 +82,13 @@
var/tmp/told_cant_shoot = 0 //So that it doesn't spam them with the fact they cannot hit them.
var/tmp/lock_time = -100
var/dna_lock = 0 //whether or not the gun is locked to dna
var/list/stored_dna = list() //list of the dna stored in the gun, used to allow users to use it or not
var/safety_level = 0 //either 0 or 1, at 0 the game buzzes and tells the user they can't use it, at 1 it self destructs after 10 seconds
var/controller_dna = null //The dna of the person who is the primary controller of the gun
var/controller_lock = 0 //whether or not the gun is locked by the primar controller, 0 or 1, at 1 it is locked and does not allow
var/exploding = 0
/obj/item/weapon/gun/New()
..()
for(var/i in 1 to firemodes.len)
@@ -90,6 +97,11 @@
if(isnull(scoped_accuracy))
scoped_accuracy = accuracy
if(!dna_lock)
verbs -= /obj/item/weapon/gun/verb/remove_dna
verbs -= /obj/item/weapon/gun/verb/give_dna
verbs -= /obj/item/weapon/gun/verb/allow_dna
/obj/item/weapon/gun/update_held_icon()
if(requires_two_hands)
var/mob/living/M = loc
@@ -114,6 +126,20 @@
return 0
var/mob/living/M = user
if(dna_lock && stored_dna)
if(!authorized_user(user))
if(safety_level == 0)
M << "<span class='danger'>\The [src] buzzes in dissapoint and displays an invalid DNA symbol.</span>"
return 0
if(!exploding)
if(safety_level == 1)
M << "<span class='danger'>\The [src] hisses in dissapointment.</span>"
visible_message("<span class='game say'><span class='name'>\The [src]</span> announces, \"Self-destruct occurring in ten seconds.\"</span>", "<span class='game say'><span class='name'>\The [src]</span> announces, \"Self-destruct occurring in ten seconds.\"</span>")
sleep(100)
explosion(src, -1, 0, 2, 3, 0)
exploding = 1
qdel(src)
return 0
if(HULK in M.mutations)
M << "<span class='danger'>Your fingers are much too large for the trigger guard!</span>"
return 0
@@ -429,3 +455,80 @@
/obj/item/weapon/gun/attack_self(mob/user)
switch_firemodes(user)
<<<<<<< HEAD
=======
/obj/item/weapon/gun/proc/get_dna(mob/user)
var/mob/living/M = user
if(!controller_lock)
if(!stored_dna && !(M.dna in stored_dna))
M << "<span class='warning'>\The [src] buzzes and displays a symbol showing the gun already contains your DNA.</span>"
return 0
else
stored_dna += M.dna
M << "<span class='notice'>\The [src] pings and a needle flicks out from the grip, taking a DNA sample from you.</span>"
if(!controller_dna)
controller_dna = M.dna
M << "<span class='notice'>\The [src] processes the dna sample and pings, acknowledging you as the primary controller.</span>"
return 1
else
M << "<span class='warning'>\The [src] buzzes and displays a locked symbol. It is not allowing DNA samples at this time.</span>"
return 0
/obj/item/weapon/gun/verb/give_dna()
set name = "Give DNA"
set category = "Object"
set src in usr
get_dna(usr)
/obj/item/weapon/gun/proc/clear_dna(mob/user)
var/mob/living/M = user
if(!controller_lock)
if(!authorized_user(M))
M << "<span class='warning'>\The [src] buzzes and displays an invalid user symbol.</span>"
return 0
else
stored_dna -= user.dna
M << "<span class='notice'>\The [src] beeps and clears the DNA it has stored.</span>"
if(M.dna == controller_dna)
controller_dna = null
M << "<span class='notice'>\The [src] beeps and removes you as the primary controller.</span>"
if(controller_lock)
controller_lock = 0
return 1
else
M << "<span class='warning'>\The [src] buzzes and displays a locked symbol. It is not allowing DNA modifcation at this time.</span>"
return 0
/obj/item/weapon/gun/verb/remove_dna()
set name = "Remove DNA"
set category = "Object"
set src in usr
clear_dna(usr)
/obj/item/weapon/gun/proc/toggledna(mob/user)
var/mob/living/M = user
if(authorized_user(M) && user.dna == controller_dna)
if(!controller_lock)
controller_lock = 1
M << "<span class='notice'>\The [src] beeps and displays a locked symbol, informing you it will no longer allow DNA samples.</span>"
else
controller_lock = 0
M << "<span class='notice'>\The [src] beeps and displays an unlocked symbol, informing you it will now allow DNA samples.</span>"
else
M << "<span class='warning'>\The [src] buzzes and displays an invalid user symbol.</span>"
/obj/item/weapon/gun/verb/allow_dna()
set name = "Toggle DNA Samples Allowance"
set category = "Object"
set src in usr
toggledna(usr)
/obj/item/weapon/gun/proc/authorized_user(mob/user)
if(!stored_dna || !stored_dna.len)
return 1
if(!(user.dna in stored_dna))
return 0
return 1
>>>>>>> refs/remotes/PolarisSS13/master