Adds a variable to check for grenade loading, makes frags unloadable.

This commit is contained in:
Datraen
2016-02-16 12:58:17 -05:00
parent 2f0d10a336
commit 129965b1c4
5 changed files with 27 additions and 12 deletions

View File

@@ -40,6 +40,7 @@
//The radius of the circle used to launch projectiles. Lower values mean less projectiles are used but if set too low gaps may appear in the spread pattern
var/spread_range = 7
loadable = null
/obj/item/weapon/grenade/explosive/prime()
..()

View File

@@ -14,6 +14,7 @@
name = "fragmentation grenade"
desc = "A military fragmentation grenade, designed to explode in a deadly shower of fragments."
icon_state = "frag"
loadable = null
var/num_fragments = 200 //total number of fragments produced by the grenade
var/fragment_damage = 15

View File

@@ -12,6 +12,7 @@
var/active = 0
var/det_time = 50
var/loadable = 1
/obj/item/weapon/grenade/proc/clown_check(var/mob/living/user)
if((CLUMSY in user.mutations) && prob(50))

View File

@@ -43,13 +43,16 @@
user << "\A [chambered] is chambered."
/obj/item/weapon/gun/launcher/grenade/proc/load(obj/item/weapon/grenade/G, mob/user)
if(grenades.len >= max_grenades)
user << "<span class='warning'>[src] is full.</span>"
if(G.loadable)
if(grenades.len >= max_grenades)
user << "<span class='warning'>[src] is full.</span>"
return
user.remove_from_mob(G)
G.loc = src
grenades.Insert(1, G) //add to the head of the list, so that it is loaded on the next pump
user.visible_message("[user] inserts \a [G] into [src].", "<span class='notice'>You insert \a [G] into [src].</span>")
return
user.remove_from_mob(G)
G.loc = src
grenades.Insert(1, G) //add to the head of the list, so that it is loaded on the next pump
user.visible_message("[user] inserts \a [G] into [src].", "<span class='notice'>You insert \a [G] into [src].</span>")
user << "<span class='warning'>[G] doesn't seem to fit in the [src]!</span>"
/obj/item/weapon/gun/launcher/grenade/proc/unload(mob/user)
if(grenades.len)
@@ -99,13 +102,16 @@
//load and unload directly into chambered
/obj/item/weapon/gun/launcher/grenade/underslung/load(obj/item/weapon/grenade/G, mob/user)
if(chambered)
user << "<span class='warning'>[src] is already loaded.</span>"
if(G.loadable)
if(chambered)
user << "<span class='warning'>[src] is already loaded.</span>"
return
user.remove_from_mob(G)
G.loc = src
chambered = G
user.visible_message("[user] load \a [G] into [src].", "<span class='notice'>You load \a [G] into [src].</span>")
return
user.remove_from_mob(G)
G.loc = src
chambered = G
user.visible_message("[user] load \a [G] into [src].", "<span class='notice'>You load \a [G] into [src].</span>")
user << "<span class='warning'>[G] doesn't seem to fit in the [src]!</span>"
/obj/item/weapon/gun/launcher/grenade/underslung/unload(mob/user)
if(chambered)

View File

@@ -0,0 +1,6 @@
author: Datraen
delete-after: True
changes:
- tweak: "Fragmentation grenades are no longer launchable."