mirror of
https://github.com/vgstation-coders/vgstation13.git
synced 2025-12-10 18:32:03 +00:00
Meteor guns!
It's a gun that fires meteors! Admin spawn only. They do not shoot 'real' meteors, they shoot a projectile that acts like meteors. Note: The meteor projectile calls 'meteorhit()' which some objects and turfs do not have, so some things won't really be affected by them. The gun itself has a potato battery, meaning it starts with a charge of 100 and has a maximum charge of 300. It costs 100 to fire and recharges 100 every 5 ticks. git-svn-id: http://tgstation13.googlecode.com/svn/trunk@4538 316c924e-a436-60f5-8080-3fe189b3f50e
This commit is contained in:
@@ -28,7 +28,7 @@
|
||||
|
||||
obj/item/weapon/gun/energy/staff
|
||||
name = "staff of change"
|
||||
desc = "an artefact that spits bolts of coruscating energy which cause the target's very form to reshape itself"
|
||||
desc = "An artefact that spits bolts of coruscating energy which cause the target's very form to reshape itself"
|
||||
icon = 'icons/obj/gun.dmi'
|
||||
icon_state = "staffofchange"
|
||||
item_state = "staffofchange"
|
||||
@@ -66,7 +66,7 @@ obj/item/weapon/gun/energy/staff
|
||||
name = "floral somatoray"
|
||||
desc = "A tool that discharges controlled radiation which induces mutation in plant cells."
|
||||
icon_state = "floramut100"
|
||||
item_state = "gun"
|
||||
item_state = "obj/item/gun.dmi"
|
||||
fire_sound = 'sound/effects/stealthoff.ogg'
|
||||
charge_cost = 100
|
||||
projectile_type = "/obj/item/projectile/energy/floramut"
|
||||
@@ -109,4 +109,45 @@ obj/item/weapon/gun/energy/staff
|
||||
projectile_type = "/obj/item/projectile/energy/floramut"
|
||||
modifystate = "floramut"
|
||||
update_icon()
|
||||
return
|
||||
return
|
||||
|
||||
/obj/item/weapon/gun/energy/meteorgun
|
||||
name = "meteor gun"
|
||||
desc = "For the love of god, make sure you're aiming this the right way!"
|
||||
icon_state = "riotgun"
|
||||
item_state = "c20r"
|
||||
w_class = 4
|
||||
projectile_type = "/obj/item/projectile/meteor"
|
||||
charge_cost = 100
|
||||
cell_type = "/obj/item/weapon/cell/potato"
|
||||
clumsy_check = 0 //Admin spawn only, might as well let clowns use it.
|
||||
var/charge_tick = 0
|
||||
var/recharge_time = 5 //Time it takes for shots to recharge (in ticks)
|
||||
|
||||
New()
|
||||
..()
|
||||
processing_objects.Add(src)
|
||||
|
||||
|
||||
Del()
|
||||
processing_objects.Remove(src)
|
||||
..()
|
||||
|
||||
process()
|
||||
charge_tick++
|
||||
if(charge_tick < recharge_time) return 0
|
||||
charge_tick = 0
|
||||
if(!power_supply) return 0
|
||||
power_supply.give(100)
|
||||
|
||||
update_icon()
|
||||
return
|
||||
|
||||
|
||||
/obj/item/weapon/gun/energy/meteorgun/pen
|
||||
name = "meteor pen"
|
||||
desc = "The pen is mightier than the sword."
|
||||
icon = 'icons/obj/bureaucracy.dmi'
|
||||
icon_state = "pen"
|
||||
item_state = "pen"
|
||||
w_class = 1
|
||||
@@ -17,7 +17,7 @@
|
||||
projectile_type = "/obj/item/projectile/energy/electrode"
|
||||
cell_type = "/obj/item/weapon/cell/secborg"
|
||||
var/charge_tick = 0
|
||||
var/recharge_time = 10 //Time it takes for shots to recharge (in seconds)
|
||||
var/recharge_time = 10 //Time it takes for shots to recharge (in ticks)
|
||||
|
||||
New()
|
||||
..()
|
||||
@@ -28,7 +28,7 @@
|
||||
processing_objects.Remove(src)
|
||||
..()
|
||||
|
||||
process() //Every [recharge_time] seconds, recharge a shot for the cyborg
|
||||
process() //Every [recharge_time] ticks, recharge a shot for the cyborg
|
||||
charge_tick++
|
||||
if(charge_tick < recharge_time) return 0
|
||||
charge_tick = 0
|
||||
|
||||
@@ -39,6 +39,36 @@
|
||||
M.bodytemperature = temperature
|
||||
return 1
|
||||
|
||||
/obj/item/projectile/meteor
|
||||
name = "meteor"
|
||||
icon = 'icons/obj/meteor.dmi'
|
||||
icon_state = "smallf"
|
||||
damage = 0
|
||||
damage_type = BRUTE
|
||||
nodamage = 1
|
||||
flag = "bullet"
|
||||
|
||||
Bump(atom/A as mob|obj|turf|area)
|
||||
if(A == firer)
|
||||
loc = A.loc
|
||||
return
|
||||
|
||||
sleep(-1) //Might not be important enough for a sleep(-1) but the sleep/spawn itself is necessary thanks to explosions and metoerhits
|
||||
|
||||
if(src)//Do not add to this if() statement, otherwise the meteor won't delete them
|
||||
if(A)
|
||||
|
||||
A.meteorhit(src)
|
||||
playsound(src.loc, 'sound/effects/meteorimpact.ogg', 40, 1)
|
||||
|
||||
for(var/mob/M in range(10, src))
|
||||
if(!M.stat && !istype(M, /mob/living/silicon/ai))\
|
||||
shake_camera(M, 3, 1)
|
||||
del(src)
|
||||
return 1
|
||||
else
|
||||
return 0
|
||||
|
||||
/obj/item/projectile/energy/floramut
|
||||
name = "alpha somatoray"
|
||||
icon_state = "energy"
|
||||
|
||||
Reference in New Issue
Block a user