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
+3 -3
View File
@@ -13,7 +13,7 @@
/obj/item/toy/blink = 2,
/obj/item/weapon/storage/box/fakesyndiesuit = 2,
/obj/item/toy/sword = 2,
/obj/item/toy/gun = 2,
/obj/item/weapon/gun/projectile/revolver/capgun = 2,
/obj/item/toy/crossbow = 2,
/obj/item/weapon/storage/fancy/crayons = 2,
/obj/item/toy/spinningtoy = 2,
@@ -60,8 +60,8 @@
var/prizeselect = pickweight(prizes)
new prizeselect(src.loc)
if(istype(prizeselect, /obj/item/toy/gun)) //Ammo comes with the gun
new /obj/item/toy/ammo/gun(src.loc)
if(istype(prizeselect, /obj/item/weapon/gun/projectile/revolver/capgun)) //Ammo comes with the gun
new /obj/item/ammo_box/caps(src.loc)
else if(istype(prizeselect, /obj/item/clothing/suit/syndicatefake)) //Helmet is part of the suit
new /obj/item/clothing/head/syndicatefake(src.loc)
-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,
+3 -3
View File
@@ -7,7 +7,7 @@
/obj/item/toy/blink = 2,
/obj/item/clothing/under/syndicate/tacticool = 2,
/obj/item/toy/sword = 2,
/obj/item/toy/gun = 2,
/obj/item/weapon/gun/projectile/revolver/capgun = 2,
/obj/item/toy/crossbow = 2,
/obj/item/clothing/suit/syndicatefake = 2,
/obj/item/weapon/storage/fancy/crayons = 2,
@@ -28,8 +28,8 @@
if(computer && !computer.stat)
var/prizeselect = pickweight(prizes)
new prizeselect(computer.loc)
if(istype(prizeselect, /obj/item/toy/gun)) //Ammo comes with the gun
new /obj/item/toy/ammo/gun(computer.loc)
if(istype(prizeselect, /obj/item/weapon/gun/projectile/revolver/capgun)) //Ammo comes with the gun
new /obj/item/ammo_box/caps(computer.loc)
else if(istype(prizeselect, /obj/item/clothing/suit/syndicatefake)) //Helmet is part of the suit
new /obj/item/clothing/head/syndicatefake(computer.loc)
feedback_inc("arcade_win_normal")
@@ -13,6 +13,11 @@
caliber = "38"
projectile_type = "/obj/item/projectile/bullet/weakbullet2/rubber"
/obj/item/ammo_casing/cap
desc = "A cap for children toys."
caliber = "caps"
projectile_type = "/obj/item/projectile/bullet/cap"
/obj/item/ammo_casing/c10mm
desc = "A 10mm bullet casing."
@@ -12,6 +12,13 @@
max_ammo = 6
multiple_sprites = 1
/obj/item/ammo_box/caps
name = "speed loader (caps)"
icon_state = "357"
ammo_type = /obj/item/ammo_casing/cap
max_ammo = 7
multiple_sprites = 1
/obj/item/ammo_box/c9mm
name = "ammo box (9mm)"
icon_state = "9mmbox"
@@ -36,6 +36,13 @@
caliber = "38"
max_ammo = 6
/obj/item/ammo_box/magazine/internal/cylinder/cap
name = "cap gun revolver cylinder"
desc = "Oh god, this shouldn't be here"
ammo_type = "/obj/item/ammo_casing/cap"
caliber = "cap"
max_ammo = 7
/obj/item/ammo_box/magazine/internal/shot
name = "shotgun internal magazine"
desc = "Oh god, this shouldn't be here"
@@ -64,8 +64,26 @@
..(user)
user << "[get_ammo(0,0)] of those are live rounds."
/obj/item/weapon/gun/projectile/revolver/proc/Spin()
set name = "Spin cylinder"
set desc = "Fun when you're bored out of your skull."
set category = "Object"
usr.visible_message("<span class='warning'>[usr] spins the chamber of the revolver.</span>", "<span class='warning'>You spin the revolver's chamber.</span>")
playsound(src.loc, 'sound/weapons/revolver_spin.ogg', 100, 1)
chambered = null
var/random = rand(1, magazine.max_ammo)
if(random <= get_ammo(0,0))
chamber_round()
update_icon()
/obj/item/weapon/gun/projectile/revolver/capgun
name = "cap gun"
desc = "Looks almost like the real thing! Ages 8 and up."
origin_tech = "combat=1;materials=1"
mag_type = "/obj/item/ammo_box/magazine/internal/cylinder/cap"
/obj/item/weapon/gun/projectile/revolver/detective
name = "\improper .38 Mars Special"
desc = "A cheap Martian knock-off of a classic law enforcement firearm. Uses .38-special rounds."
name = "revolver"
icon_state = "detective"
@@ -168,43 +186,11 @@
desc = "A Russian-made revolver for drinking games. Uses .357 ammo, and has a mechanism that spins the chamber before each trigger pull."
origin_tech = "combat=2;materials=2"
mag_type = "/obj/item/ammo_box/magazine/internal/cylinder/rus357"
var/spun = 0
/obj/item/weapon/gun/projectile/revolver/russian/New()
..()
Spin()
update_icon()
/obj/item/weapon/gun/projectile/revolver/russian/proc/Spin()
chambered = null
var/random = rand(1, magazine.max_ammo)
if(random <= get_ammo(0,0))
chamber_round()
spun = 1
/obj/item/weapon/gun/projectile/revolver/russian/attackby(var/obj/item/A as obj, mob/user as mob, params)
..()
user.visible_message("<span class='warning'>[user] spins the chamber of the revolver.</span>", "<span class='warning'>You spin the revolver's chamber.</span>")
if(get_ammo() > 0)
Spin()
update_icon()
A.update_icon()
return
/obj/item/weapon/gun/projectile/revolver/russian/attack_self(mob/user as mob)
if(!spun && get_ammo(0,0))
user.visible_message("<span class='warning'>[user] spins the chamber of the revolver.</span>", "<span class='warning'>You spin the revolver's chamber.</span>")
Spin()
else
..()
/obj/item/weapon/gun/projectile/revolver/russian/afterattack(atom/target as mob|obj|turf, mob/living/user as mob|obj, flag, params)
if (!spun)
Spin()
return
..()
spun = 0
/obj/item/weapon/gun/projectile/revolver/russian/attack(atom/target as mob|obj|turf|area, mob/living/user as mob|obj)
@@ -229,6 +215,5 @@
user.apply_damage(300, BRUTE, affecting, sharp=1) // You are dead, dead, dead.
return
spun = 0
..()
@@ -8,6 +8,17 @@
embed = 1
sharp = 1
/obj/item/projectile/bullet/cap
name = "cap"
damage = 0
nodamage = 1
embed = 0
sharp = 0
/obj/item/projectile/bullet/cap/process()
loc = null
qdel(src)
/obj/item/projectile/bullet/weakbullet //beanbag, heavy stamina damage
damage = 5
stamina = 80
Binary file not shown.