mirror of
https://github.com/vgstation-coders/vgstation13.git
synced 2025-12-10 10:21:11 +00:00
Revert gun pool for now.
This commit is contained in:
@@ -114,7 +114,7 @@
|
||||
A.fired()
|
||||
*/
|
||||
proc/Emit()
|
||||
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)
|
||||
A.frequency = frequency
|
||||
A.damage = mega_energy * 500
|
||||
playsound(get_turf(src), 'sound/weapons/emitter.ogg', 25, 1)
|
||||
|
||||
@@ -92,7 +92,7 @@
|
||||
src.fire_delay = rand(20,100)
|
||||
src.shot_number = 0
|
||||
use_power(1000)
|
||||
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
|
||||
|
||||
@@ -292,7 +292,7 @@
|
||||
var/turf/T = get_turf(src)
|
||||
var/turf/U = get_turf(A)
|
||||
|
||||
var/obj/item/projectile/beam/LE = getFromPool(/obj/item/projectile/beam, loc)
|
||||
var/obj/item/projectile/beam/LE = new /obj/item/projectile/beam(loc)
|
||||
LE.icon = 'icons/effects/genetics.dmi'
|
||||
LE.icon_state = "eyelasers"
|
||||
playsound(usr.loc, 'sound/weapons/taser2.ogg', 75, 1)
|
||||
@@ -333,7 +333,7 @@
|
||||
"You hear the loud crackle of electricity!")
|
||||
var/datum/powernet/PN = cable.get_powernet()
|
||||
var/available = 0
|
||||
var/obj/item/projectile/beam/lightning/L = getFromPool(/obj/item/projectile/beam/lightning, loc)
|
||||
var/obj/item/projectile/beam/lightning/L = new /obj/item/projectile/beam/lightning/(get_turf(src))
|
||||
if(PN)
|
||||
available = PN.avail
|
||||
L.damage = PN.get_electrocute_damage()
|
||||
@@ -359,8 +359,7 @@
|
||||
s.set_up(5, 1, src)
|
||||
s.start()
|
||||
if(L.damage <= 0)
|
||||
//del(L)
|
||||
returnToPool(L)
|
||||
del(L)
|
||||
if(L)
|
||||
playsound(get_turf(src), 'sound/effects/eleczap.ogg', 75, 1)
|
||||
L.tang = L.adjustAngle(get_angle(U,T))
|
||||
|
||||
@@ -199,7 +199,7 @@ its easier to just keep the beam vertical.
|
||||
//Maxdistance is the longest range the beam will persist before it gives up.
|
||||
var/EndTime=world.time+time
|
||||
var/broken = 0
|
||||
var/obj/item/projectile/beam/lightning/light = getFromPool(/obj/item/projectile/beam/lightning)
|
||||
var/obj/item/projectile/beam/lightning/light = new
|
||||
while(BeamTarget&&world.time<EndTime&&get_dist(src,BeamTarget)<maxdistance&&z==BeamTarget.z)
|
||||
|
||||
//If the BeamTarget gets deleted, the time expires, or the BeamTarget gets out
|
||||
|
||||
@@ -1020,8 +1020,7 @@ Auto Patrol: []"},
|
||||
if((src.lasercolor == "b") && (src.disabled == 0))
|
||||
if(istype(Proj, /obj/item/projectile/beam/lastertag/red))
|
||||
src.disabled = 1
|
||||
//del (Proj)
|
||||
returnToPool(Proj)
|
||||
del (Proj)
|
||||
sleep(100)
|
||||
src.disabled = 0
|
||||
else
|
||||
@@ -1029,8 +1028,7 @@ Auto Patrol: []"},
|
||||
else if((src.lasercolor == "r") && (src.disabled == 0))
|
||||
if(istype(Proj, /obj/item/projectile/beam/lastertag/blue))
|
||||
src.disabled = 1
|
||||
//del (Proj)
|
||||
returnToPool(Proj)
|
||||
del (Proj)
|
||||
sleep(100)
|
||||
src.disabled = 0
|
||||
else
|
||||
|
||||
@@ -236,17 +236,17 @@
|
||||
if (src.lasers)
|
||||
switch(lasertype)
|
||||
if(1)
|
||||
A = getFromPool(/obj/item/projectile/beam, loc)
|
||||
A = new /obj/item/projectile/beam(loc)
|
||||
if(2)
|
||||
A = getFromPool(/obj/item/projectile/beam/heavylaser, loc)
|
||||
A = new /obj/item/projectile/beam/heavylaser(loc)
|
||||
if(3)
|
||||
A = getFromPool(/obj/item/projectile/beam/pulse, loc)
|
||||
A = new /obj/item/projectile/beam/pulse(loc)
|
||||
if(4)
|
||||
A = getFromPool(/obj/item/projectile/change, loc)
|
||||
A = new /obj/item/projectile/change(loc)
|
||||
if(5)
|
||||
A = getFromPool(/obj/item/projectile/beam/lastertag/blue, loc)
|
||||
A = new /obj/item/projectile/beam/lastertag/blue(loc)
|
||||
if(6)
|
||||
A = getFromPool(/obj/item/projectile/beam/lastertag/red, loc)
|
||||
A = new /obj/item/projectile/beam/lastertag/red(loc)
|
||||
A.original = target
|
||||
use_power(500)
|
||||
else
|
||||
|
||||
@@ -124,7 +124,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
|
||||
|
||||
@@ -67,19 +67,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
|
||||
@@ -168,8 +167,7 @@
|
||||
if(!istype(src, /obj/item/projectile/beam/lightning))
|
||||
density = 0
|
||||
invisibility = 101
|
||||
//del(src)
|
||||
returnToPool(src)
|
||||
del(src)
|
||||
return 1
|
||||
|
||||
|
||||
@@ -184,16 +182,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)
|
||||
@@ -205,11 +201,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)
|
||||
|
||||
@@ -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"
|
||||
@@ -195,17 +194,12 @@ 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--
|
||||
|
||||
@@ -245,19 +239,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))
|
||||
|
||||
@@ -192,12 +192,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
|
||||
|
||||
Reference in New Issue
Block a user