Merge pull request #14992 from KorPhaeron/flashlights

Adds laserguns with rechargeable, swappable magazines
This commit is contained in:
tkdrg
2016-02-06 16:36:03 -03:00
3 changed files with 74 additions and 16 deletions

View File

@@ -0,0 +1,47 @@
//Energy guns with swappable, rechargable, magazines.
/obj/item/ammo_box/magazine/recharge
name = "power pack"
icon_state = "oldrifle-20"
ammo_type = /obj/item/ammo_casing/caseless/laser
caliber = "laser"
max_ammo = 20
/obj/item/ammo_box/magazine/recharge/update_icon()
..()
icon_state = "oldrifle-[round(ammo_count(),4)]"
/obj/item/ammo_casing/caseless/laser
name = "laser casing"
desc = "You shouldn't be seeing this."
caliber = "laser"
icon_state = "s-casing-live"
projectile_type = /obj/item/projectile/beam
fire_sound = 'sound/weapons/Laser.ogg'
/obj/item/ammo_box/magazine/recharge/attack_self() //No popping out the "bullets"
return
/obj/item/weapon/gun/projectile/automatic/laser
name = "laser rifle"
desc = "Though sometimes mocked for the relatively weak firepower of their energy weapons, the logistic miracle of rechargable ammunition has given Nanotrasen a decisive edge over many a foe."
icon_state = "oldrifle"
item_state = "arg"
mag_type = /obj/item/ammo_box/magazine/recharge
fire_delay = 2
can_suppress = 0
burst_size = 0
action_button_name = null
/obj/item/weapon/gun/projectile/automatic/laser/process_chamber(eject_casing = 0, empty_chamber = 1)
..()
/obj/item/weapon/gun/projectile/automatic/laser/update_icon()
..()
icon_state = "oldrifle[magazine ? "-[Ceiling(get_ammo(0)/4)*4]" : ""]"
return