Gunshot sounds, uplink references, less spammy tommygun, fixes

This commit is contained in:
Mieszko Jędrzejczak
2016-04-25 11:32:48 +02:00
parent 03c173aeaf
commit 0f7be5576f
11 changed files with 55 additions and 55 deletions

View File

@@ -55,24 +55,24 @@
/obj/item/ammo_casing/attackby(obj/item/ammo_box/box as obj, mob/user as mob, params)
if(!istype(box, /obj/item/ammo_box))
return
if(isturf(src.loc))
if(isturf(loc))
var/boolets = 0
for(var/obj/item/ammo_casing/pew in src.loc)
if (box.stored_ammo.len >= box.max_ammo)
for(var/obj/item/ammo_casing/pew in loc)
if(box.stored_ammo.len >= box.max_ammo)
break
if (pew.BB)
if (box.give_round(pew))
if(pew.BB)
if(box.give_round(pew))
boolets++
else
continue
if (boolets > 0)
if(boolets > 0)
box.update_icon()
user << "<span class='notice'>You collect [boolets] shell\s. [box] now contains [box.stored_ammo.len] shell\s.</span>"
to_chat(user, "<span class='notice'>You collect [boolets] shell\s. [box] now contains [box.stored_ammo.len] shell\s.</span>")
else
user << "<span class='notice'>You fail to collect anything.</span>"
to_chat(user, "<span class='notice'>You fail to collect anything.</span>")
/obj/item/ammo_casing/proc/newshot() //For energy weapons, shotgun shells and wands (!).
if (!BB)
if(!BB)
BB = new projectile_type(src)
return
@@ -104,19 +104,19 @@
update_icon()
/obj/item/ammo_box/proc/get_round(var/keep = 0)
if (!stored_ammo.len)
if(!stored_ammo.len)
return null
else
var/b = stored_ammo[stored_ammo.len]
stored_ammo -= b
if (keep)
if(keep)
stored_ammo.Insert(1,b)
return b
/obj/item/ammo_box/proc/give_round(var/obj/item/ammo_casing/r)
var/obj/item/ammo_casing/rb = r
if (rb)
if (stored_ammo.len < max_ammo && rb.caliber == caliber)
if(rb)
if(stored_ammo.len < max_ammo && rb.caliber == caliber)
stored_ammo += rb
rb.loc = src
return 1

View File

@@ -269,25 +269,25 @@
/obj/item/ammo_casing/caseless/foam_dart/update_icon()
..()
if (modified)
if(modified)
icon_state = "foamdart_empty"
desc = "Its nerf or nothing! ...Although, this one doesn't look too safe."
/obj/item/ammo_casing/caseless/foam_dart/attackby(var/obj/item/weapon/A as obj, mob/user as mob, params)
..()
if (istype(A, /obj/item/weapon/screwdriver) && !modified)
if(istype(A, /obj/item/weapon/screwdriver) && !modified)
modified = 1
BB.damage_type = BRUTE
icon_state = "foamdart_empty"
desc = "Its nerf or nothing! ...Although, this one doesn't look too safe."
user << "<span class='notice'>You pop the safety cap off of [src].</span>"
else if ((istype(A, /obj/item/weapon/pen)) && modified && !BB.contents.len)
if (!user.unEquip(A))
to_chat(user, "<span class='notice'>You pop the safety cap off of [src].</span>")
else if((istype(A, /obj/item/weapon/pen)) && modified && !BB.contents.len)
if(!user.unEquip(A))
return
A.loc = BB
A.forceMove(BB)
BB.damage = 5
BB.nodamage = 0
user << "<span class='notice'>You insert [A] into [src].</span>"
to_chat(user, "<span class='notice'>You insert [A] into [src].</span>")
return
/obj/item/ammo_casing/caseless/foam_dart/riot

View File

@@ -109,6 +109,9 @@
/obj/item/ammo_box/magazine/internal/shot/toy/crossbow
max_ammo = 5
/obj/item/ammo_box/magazine/internal/shot/toy/tommygun
max_ammo = 10
///////////EXTERNAL MAGAZINES////////////////
/obj/item/ammo_box/magazine/m10mm
@@ -344,8 +347,3 @@
/obj/item/ammo_box/magazine/toy/m762/update_icon()
..()
icon_state = "a762-[round(ammo_count(),10)]"
/obj/item/ammo_box/magazine/toy/tommygunm45
name = "little tommy's mag"
icon_state = "drum45"
max_ammo = 50

View File

@@ -20,7 +20,7 @@
/obj/item/weapon/gun/projectile/New()
..()
if (!magazine)
if(!magazine)
magazine = new mag_type(src)
chamber_round()
update_icon()
@@ -53,9 +53,9 @@
/obj/item/weapon/gun/projectile/proc/chamber_round()
if (chambered || !magazine)
if(chambered || !magazine)
return
else if (magazine.ammo_count())
else if(magazine.ammo_count())
chambered = magazine.get_round()
chambered.loc = src
return
@@ -63,9 +63,9 @@
/obj/item/weapon/gun/projectile/attackby(var/obj/item/A as obj, mob/user as mob, params)
..()
if (istype(A, /obj/item/ammo_box/magazine))
if(istype(A, /obj/item/ammo_box/magazine))
var/obj/item/ammo_box/magazine/AM = A
if (!magazine && istype(AM, text2path(mag_type)))
if(!magazine && istype(AM, text2path(mag_type)))
user.remove_from_mob(AM)
magazine = AM
magazine.loc = src
@@ -74,7 +74,7 @@
A.update_icon()
update_icon()
return 1
else if (magazine)
else if(magazine)
to_chat(user, "<span class='notice'>There's already a magazine in \the [src].</span>")
if(istype(A, /obj/item/weapon/suppressor))
var/obj/item/weapon/suppressor/S = A
@@ -135,9 +135,9 @@
/obj/item/weapon/gun/projectile/proc/get_ammo(var/countchambered = 1)
var/boolets = 0 //mature var names for mature people
if (chambered && countchambered)
if(chambered && countchambered)
boolets++
if (magazine)
if(magazine)
boolets += magazine.ammo_count()
return boolets

View File

@@ -5,7 +5,6 @@
icon_state = "saber"
item_state = "gun"
mag_type = "/obj/item/ammo_box/magazine/toy/smg"
fire_sound = 'sound/items/syringeproj.ogg'
force = 0
throwforce = 0
burst_size = 3
@@ -22,6 +21,7 @@
icon_state = "pistol"
w_class = 2
mag_type = "/obj/item/ammo_box/magazine/toy/pistol"
fire_sound = 'sound/weapons/Gunshot.ogg'
can_suppress = 0
burst_size = 1
fire_delay = 0
@@ -61,17 +61,7 @@
/obj/item/weapon/gun/projectile/automatic/l6_saw/toy/process_chambered()
return ..(0, 1)
/obj/item/weapon/gun/projectile/automatic/tommygun/toy
name = "tommy gun"
desc = "Looks almost like the real thing! Great for practicing Drive-bys. Ages 8 and up."
icon_state = "tommygun"
item_state = "shotgun"
w_class = 2
mag_type = "/obj/item/ammo_box/magazine/toy/tommygunm45"
fire_sound = 'sound/items/syringeproj.ogg'
/obj/item/weapon/gun/projectile/automatic/tommygun/toy/process_chambered()
return ..(0, 1)
/obj/item/weapon/gun/projectile/shotgun/toy
name = "foam force shotgun"
@@ -81,7 +71,6 @@
throwforce = 0
origin_tech = null
mag_type = "/obj/item/ammo_box/magazine/internal/shot/toy"
fire_sound = 'sound/items/syringeproj.ogg'
clumsy_check = 0
needs_permit = 0
@@ -97,5 +86,15 @@
icon_state = "crossbow"
item_state = "crossbow"
mag_type = "/obj/item/ammo_box/magazine/internal/shot/toy/crossbow"
fire_sound = 'sound/items/syringeproj.ogg'
slot_flags = SLOT_BELT
w_class = 2
/obj/item/weapon/gun/projectile/shotgun/toy/tommygun
name = "tommy gun"
desc = "Looks almost like the real thing! Great for practicing Drive-bys. Ages 8 and up."
icon = 'icons/obj/gun.dmi'
icon_state = "tommy"
item_state = "shotgun"
mag_type = "/obj/item/ammo_box/magazine/internal/shot/toy/tommygun"
w_class = 2