Merge pull request #4073 from Citadel-Station-13/upstream-merge-32937
[MIRROR] Simple wall turret buff
This commit is contained in:
@@ -73,6 +73,8 @@
|
|||||||
|
|
||||||
var/obj/machinery/turretid/cp = null
|
var/obj/machinery/turretid/cp = null
|
||||||
|
|
||||||
|
var/wall_turret_direction //The turret will try to shoot from a turf in that direction when in a wall
|
||||||
|
|
||||||
/obj/machinery/porta_turret/Initialize()
|
/obj/machinery/porta_turret/Initialize()
|
||||||
. = ..()
|
. = ..()
|
||||||
if(!base)
|
if(!base)
|
||||||
@@ -503,6 +505,20 @@
|
|||||||
if(!istype(T) || !istype(U))
|
if(!istype(T) || !istype(U))
|
||||||
return
|
return
|
||||||
|
|
||||||
|
//Wall turrets will try to find adjacent empty turf to shoot from to cover full arc
|
||||||
|
if(T.density)
|
||||||
|
if(wall_turret_direction)
|
||||||
|
var/turf/closer = get_step(T,wall_turret_direction)
|
||||||
|
if(istype(closer) && !is_blocked_turf(closer) && T.Adjacent(closer))
|
||||||
|
T = closer
|
||||||
|
else
|
||||||
|
var/target_dir = get_dir(T,target)
|
||||||
|
for(var/d in list(0,-45,45))
|
||||||
|
var/turf/closer = get_step(T,turn(target_dir,d))
|
||||||
|
if(istype(closer) && !is_blocked_turf(closer) && T.Adjacent(closer))
|
||||||
|
T = closer
|
||||||
|
break
|
||||||
|
|
||||||
update_icon()
|
update_icon()
|
||||||
var/obj/item/projectile/A
|
var/obj/item/projectile/A
|
||||||
//any emagged turrets drains 2x power and uses a different projectile?
|
//any emagged turrets drains 2x power and uses a different projectile?
|
||||||
@@ -517,10 +533,13 @@
|
|||||||
|
|
||||||
|
|
||||||
//Shooting Code:
|
//Shooting Code:
|
||||||
A.preparePixelProjectile(target, src)
|
A.preparePixelProjectile(target, T)
|
||||||
A.fire()
|
A.fire()
|
||||||
return A
|
return A
|
||||||
|
|
||||||
|
/obj/machinery/porta_turret/shuttleRotate(rotation)
|
||||||
|
if(wall_turret_direction)
|
||||||
|
wall_turret_direction = turn(wall_turret_direction,rotation)
|
||||||
|
|
||||||
/obj/machinery/porta_turret/proc/setState(on, mode)
|
/obj/machinery/porta_turret/proc/setState(on, mode)
|
||||||
if(controllock)
|
if(controllock)
|
||||||
|
|||||||
Reference in New Issue
Block a user