Revolver stuff

This commit is contained in:
ZomgPonies
2015-12-03 23:18:03 -05:00
parent a4b36540d8
commit 62f4f5cf66
10 changed files with 57 additions and 115 deletions
-73
View File
@@ -3,7 +3,6 @@
* Balloons
* Fake telebeacon
* Fake singularity
* Toy gun
* Toy crossbow
* Toy Tommy Gun
* Toy swords
@@ -125,78 +124,6 @@
icon = 'icons/obj/singularity.dmi'
icon_state = "singularity_s1"
/*
* Toy gun: Why isnt this an /obj/item/weapon/gun?
*/
/obj/item/toy/gun
name = "cap gun"
desc = "There are 0 caps left. Looks almost like the real thing! Ages 8 and up. Please recycle in an autolathe when you're out of caps!"
icon = 'icons/obj/gun.dmi'
icon_state = "revolver"
item_state = "gun"
lefthand_file = 'icons/mob/inhands/guns_lefthand.dmi'
righthand_file = 'icons/mob/inhands/guns_righthand.dmi'
flags = CONDUCT
slot_flags = SLOT_BELT
w_class = 3.0
materials = list(MAT_METAL=10, MAT_GLASS=10)
attack_verb = list("struck", "pistol whipped", "hit", "bashed")
var/bullets = 7.0
examine(mob/user)
if(..(user, 0))
user << "There are [bullets] caps\s left. Looks almost like the real thing! Ages 8 and up."
attackby(obj/item/toy/ammo/gun/A as obj, mob/user as mob, params)
if (istype(A, /obj/item/toy/ammo/gun))
if (src.bullets >= 7)
user << "\blue It's already fully loaded!"
return 1
if (A.amount_left <= 0)
user << "\red There is no more caps!"
return 1
if (A.amount_left < (7 - src.bullets))
src.bullets += A.amount_left
user << text("\red You reload [] caps\s!", A.amount_left)
A.amount_left = 0
else
user << text("\red You reload [] caps\s!", 7 - src.bullets)
A.amount_left -= 7 - src.bullets
src.bullets = 7
A.update_icon()
return 1
return
afterattack(atom/target as mob|obj|turf|area, mob/user as mob, flag)
if (flag)
return
if (!user.IsAdvancedToolUser())
user << "<span class='warning'>You don't have the dexterity to do this!</span>"
return
src.add_fingerprint(user)
if (src.bullets < 1)
user.show_message("<span class='alert'>*click* *click*</span>", 2)
playsound(user, 'sound/weapons/empty.ogg', 100, 1)
return
playsound(user, 'sound/weapons/Gunshot.ogg', 100, 1)
src.bullets--
user.visible_message("<span class='danger'>[user] fires a cap gun at [target]!</span>", null, "You hear a gunshot.")
/obj/item/toy/ammo/gun
name = "ammo-caps"
desc = "There are 7 caps left! Make sure to recyle the box in an autolathe when it gets empty."
icon = 'icons/obj/ammo.dmi'
icon_state = "357-7"
flags = CONDUCT
w_class = 1.0
materials = list(MAT_METAL=10, MAT_GLASS=10)
var/amount_left = 7.0
update_icon()
src.icon_state = text("357-[]", src.amount_left)
src.desc = text("There are [] caps\s left! Make sure to recycle the box in an autolathe when it gets empty.", src.amount_left)
return
/*
* Toy crossbow
@@ -84,7 +84,7 @@
/obj/item/toy/balloon,
/obj/item/toy/blink,
/obj/item/toy/crossbow,
/obj/item/toy/gun,
/obj/item/weapon/gun/projectile/revolver/capgun,
/obj/item/toy/katana,
/obj/item/toy/prize/deathripley,
/obj/item/toy/prize/durand,