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:
johnsonmt88@gmail.com
2012-08-25 16:39:18 +00:00
parent 6e274cd395
commit 240d910679
5 changed files with 78 additions and 54 deletions

View File

@@ -68,7 +68,7 @@ obj
else
return null
/atom/proc/meteorhit(obj/effect/meteor as obj)
/atom/proc/meteorhit(obj/meteor as obj)
return
/atom/proc/allow_drop()

View File

@@ -164,50 +164,3 @@
del(src)
return
..()
/*
//Testing purposes only!
/obj/item/weapon/meteorgun
name = "Meteor Gun"
desc = "This beast fires meteors!. TESTING PURPOSES ONLY, This gun is <b>incomplete</b>!"
icon = 'icons/obj/gun.dmi'
icon_state = "lasercannon"
item_state = "gun"
/obj/item/weapon/meteorgun/attack_self()
var/start_x = usr.loc.x
var/start_y = usr.loc.y
var/start_z = usr.loc.z
var/end_x = 0
var/end_y = 0
var/end_z = 0
switch(usr.dir)
if(NORTH)
end_x = start_x
end_y = world.maxy-TRANSITIONEDGE
if(SOUTH)
end_x = start_x
end_y = TRANSITIONEDGE
if(EAST)
end_x = world.maxx-TRANSITIONEDGE
end_y = start_y
if(WEST)
end_x = TRANSITIONEDGE
end_y = start_y
else //north
end_x = start_x
end_y = TRANSITIONEDGE
end_z = start_z
var/start = locate(start_x, start_y, start_z)
var/end = locate(end_x, end_y, end_z)
var/obj/effect/meteor/M = new /obj/effect/meteor(start)
M.dest = end
spawn(0)
walk_towards(M, M.dest, 1)
return
*/

View File

@@ -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"
@@ -110,3 +110,44 @@ obj/item/weapon/gun/energy/staff
modifystate = "floramut"
update_icon()
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

View File

@@ -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

View File

@@ -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"