Revert gun pool for now.

Conflicts:
	code/game/machinery/turrets.dm
	code/modules/projectiles/projectile/beams.dm
This commit is contained in:
ESwordTheCat
2014-05-19 19:34:20 -04:00
committed by ZomgPonies
parent 54db12f702
commit a6ee8dc678
10 changed files with 32 additions and 51 deletions
+1 -1
View File
@@ -121,7 +121,7 @@
else
src.fire_delay = rand(20,100)
src.shot_number = 0
var/obj/item/projectile/beam/emitter/A = getFromPool(/obj/item/projectile/beam/emitter, loc)
var/obj/item/projectile/beam/emitter/A = new /obj/item/projectile/beam/emitter(src.loc)
playsound(get_turf(src), 'sound/weapons/emitter.ogg', 25, 1)
if(prob(35))
var/datum/effect/effect/system/spark_spread/s = new /datum/effect/effect/system/spark_spread
+8 -14
View File
@@ -68,19 +68,18 @@
proc/check_fire(var/mob/living/target as mob, var/mob/living/user as mob) //Checks if you can hit them or not.
if(!istype(target) || !istype(user))
return 0
var/obj/item/projectile/test/in_chamber = getFromPool(/obj/item/projectile/test, get_step_to(user, target)) //Making the test....
var/obj/item/projectile/test/in_chamber = new /obj/item/projectile/test(get_step_to(user,target)) //Making the test....
in_chamber.target = target
in_chamber.flags = flags //Set the flags...
in_chamber.pass_flags = pass_flags //And the pass flags to that of the real projectile...
in_chamber.firer = user
var/output = in_chamber.process() //Test it!
//del(in_chamber) //No need for it anymore
returnToPool(in_chamber)
del(in_chamber) //No need for it anymore
return output //Send it back to the gun!
Bump(atom/A as mob|obj|turf|area)
if(A == firer)
//loc = A.loc
loc = A.loc
return 0 //cannot shoot yourself
if(bumped) return 0
@@ -152,8 +151,7 @@
if(!istype(src, /obj/item/projectile/beam/lightning))
density = 0
invisibility = 101
//del(src)
returnToPool(src)
del(src)
return 1
@@ -168,16 +166,14 @@
process()
if(kill_count < 1)
//del(src)
returnToPool(src)
del(src)
return
kill_count--
spawn while(src)
if((!( current ) || loc == current))
current = locate(min(max(x + xo, 1), world.maxx), min(max(y + yo, 1), world.maxy), z)
if((x == 1 || x == world.maxx || y == 1 || y == world.maxy))
//del(src)
returnToPool(src)
del(src)
return
step_towards(src, current)
sleep(1)
@@ -190,11 +186,9 @@
return
proc/dumbfire(var/dir) // for spacepods, go snowflake go
if(!dir)
//del(src)
returnToPool(src)
del(src)
if(kill_count < 1)
//del(src)
returnToPool(src)
del(src)
kill_count--
spawn while(src)
var/turf/T = get_step(src, dir)
+7 -15
View File
@@ -163,8 +163,7 @@ var/list/beam_master = list()
if(src.loc != current)
tang = adjustAngle(get_angle(src.loc,current))
icon_state = "[tang]"
//del(src)
returnToPool(src)
del(src)
return
/*cleanup(reference) //Waits .3 seconds then removes the overlay.
//world << "setting invisibility"
@@ -196,17 +195,13 @@ var/list/beam_master = list()
if((!( current ) || loc == current)) //If we pass our target
current = locate(min(max(x + xo, 1), world.maxx), min(max(y + yo, 1), world.maxy), z)
if((x == 1 || x == world.maxx || y == 1 || y == world.maxy))
//del(src) //Delete if it passes the world edge
returnToPool(src)
del(src) //Delete if it passes the world edge
return
step_towards(src, current) //Move~
if (isnull(loc))
return
if(kill_count < 1)
//del(src)
returnToPool(src)
del(src)
return
kill_count--
if(!bumped && !isturf(original))
@@ -245,19 +240,16 @@ var/list/beam_master = list()
var/reference = "\ref[src]" //So we do not have to recalculate it a ton
var/first = 1 //So we don't make the overlay in the same tile as the firer
if(!dir)
//del(src)
returnToPool(src)
del(src)
spawn while(src) //Move until we hit something
if((x == 1 || x == world.maxx || y == 1 || y == world.maxy))
//del(src) //Delete if it passes the world edge
returnToPool(src)
del(src) //Delete if it passes the world edge
return
var/turf/T = get_step(src, dir)
step_towards(src, T) //Move~
if(kill_count < 1)
//del(src)
returnToPool(src)
del(src)
kill_count--
if(!bumped && !isturf(original))
@@ -202,12 +202,10 @@ obj/item/projectile/kinetic/New()
// Now we bump as a bullet, if the atom is a non-turf.
if(!isturf(A))
..(A)
//qdel(src) // Comment this out if you want to shoot through the asteroid, ERASER-style.
returnToPool(src) // Comment this out if you want to shoot through the asteroid, ERASER-style.
qdel(src) // Comment this out if you want to shoot through the asteroid, ERASER-style.
return 1
else
//qdel(src)
returnToPool(src)
qdel(src)
return 0
/obj/item/effect/kinetic_blast