mirror of
https://github.com/ParadiseSS13/Paradise.git
synced 2026-08-29 23:17:02 +01:00
Object pool for beam projectile, minor changes to object pool.
Conflicts: code/WorkInProgress/Cael_Aislinn/Rust/gyrotron.dm code/WorkInProgress/Cael_Aislinn/Supermatter/ZeroPointLaser.dm code/game/objects/structures/grille.dm code/modules/power/singularity/emitter.dm code/modules/projectiles/projectile.dm code/modules/projectiles/projectile/beams.dm
This commit is contained in:
@@ -1,12 +1,21 @@
|
||||
/*
|
||||
* Use: Caches beam state images and holds turfs that had these images overlaid.
|
||||
* Structure:
|
||||
* beam_master
|
||||
* icon_states/dirs of beams
|
||||
* image for that beam
|
||||
* references for fired beams
|
||||
* icon_states/dirs for each placed beam image
|
||||
* turfs that have that icon_state/dir
|
||||
*/
|
||||
var/list/beam_master = list()
|
||||
//Use: Caches beam state images and holds turfs that had these images overlaid.
|
||||
//Structure:
|
||||
//beam_master
|
||||
// icon_states/dirs of beams
|
||||
// image for that beam
|
||||
// references for fired beams
|
||||
// icon_states/dirs for each placed beam image
|
||||
// turfs that have that icon_state/dir
|
||||
|
||||
|
||||
//Special laser the captains gun uses
|
||||
/obj/item/projectile/beam/captain
|
||||
name = "captain laser"
|
||||
damage = 40
|
||||
|
||||
|
||||
/obj/item/projectile/beam/lightning
|
||||
invisibility = 101
|
||||
@@ -22,6 +31,7 @@ var/list/beam_master = list()
|
||||
layer = 3
|
||||
var/turf/last = null
|
||||
kill_count = 6
|
||||
|
||||
proc/adjustAngle(angle)
|
||||
angle = round(angle) + 45
|
||||
if(angle > 180)
|
||||
@@ -168,6 +178,11 @@ var/list/beam_master = list()
|
||||
M.playsound_local(src, "explosion", 50, 1)
|
||||
..()
|
||||
|
||||
resetVariables()
|
||||
tang = initial(tang)
|
||||
last = initial(last)
|
||||
return ..()
|
||||
|
||||
/obj/item/projectile/beam
|
||||
name = "laser"
|
||||
icon_state = "laser"
|
||||
@@ -187,12 +202,14 @@ 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
|
||||
//del(src) //Delete if it passes the world edge
|
||||
returnToPool(src)
|
||||
return
|
||||
step_towards(src, current) //Move~
|
||||
|
||||
if(kill_count < 1)
|
||||
del(src)
|
||||
//del(src)
|
||||
returnToPool(src)
|
||||
kill_count--
|
||||
|
||||
if(!bumped && !isturf(original))
|
||||
@@ -287,6 +304,11 @@ var/list/beam_master = list()
|
||||
return
|
||||
|
||||
|
||||
resetVariables()
|
||||
frequency = initial(frequency)
|
||||
return ..()
|
||||
|
||||
|
||||
/obj/item/projectile/beam/practice
|
||||
name = "laser"
|
||||
icon_state = "laser"
|
||||
|
||||
Reference in New Issue
Block a user