Merge pull request #7387 from Citadel-Station-13/wormhole_update

wormhole guns now pass through mobs without doing anything but gain hitscan
This commit is contained in:
deathride58
2018-07-28 09:17:00 -04:00
committed by GitHub
10 changed files with 38 additions and 12 deletions
+7 -1
View File
@@ -27,6 +27,7 @@
var/turf/open/atmos_destination //Atmos link destination
var/allow_anchored = FALSE
var/innate_accuracy_penalty = 0
var/last_effect = 0
/obj/effect/portal/anom
name = "wormhole"
@@ -154,7 +155,12 @@
return
if(ismegafauna(M))
message_admins("[M] has used a portal at [ADMIN_VERBOSEJMP(src)] made by [usr].")
if(do_teleport(M, real_target, innate_accuracy_penalty))
var/no_effect = FALSE
if(last_effect == world.time)
no_effect = TRUE
else
last_effect = world.time
if(do_teleport(M, real_target, innate_accuracy_penalty, no_effects = no_effect))
if(istype(M, /obj/item/projectile))
var/obj/item/projectile/P = M
P.ignore_source_check = TRUE
@@ -33,3 +33,6 @@
/obj/effect/projectile/impact/heavy_laser
name = "heavy laser impact"
icon_state = "impact_beam_heavy"
/obj/effect/projectile/impact/wormhole
icon_state = "wormhole_g"
@@ -25,3 +25,6 @@
/obj/effect/projectile/muzzle/heavy_laser
icon_state = "muzzle_beam_heavy"
/obj/effect/projectile/muzzle/wormhole
icon_state = "wormhole_g"
@@ -51,6 +51,10 @@
pixel_x += round((sin(angle_override)+16*sin(angle_override)*2), 1)
pixel_y += round((cos(angle_override)+16*cos(angle_override)*2), 1)
/obj/effect/projectile_lighting/Initialize(mapload, color, range, intensity)
/obj/effect/projectile_lighting
var/owner
/obj/effect/projectile_lighting/Initialize(mapload, color, range, intensity, owner_key)
. = ..()
set_light(range, intensity, color)
owner = owner_key
@@ -1,4 +1,4 @@
/proc/generate_tracer_between_points(datum/point/starting, datum/point/ending, beam_type, color, qdel_in = 5, light_range = 2, light_color_override, light_intensity = 1) //Do not pass z-crossing points as that will not be properly (and likely will never be properly until it's absolutely needed) supported!
/proc/generate_tracer_between_points(datum/point/starting, datum/point/ending, beam_type, color, qdel_in = 5, light_range = 2, light_color_override, light_intensity = 1, instance_key) //Do not pass z-crossing points as that will not be properly (and likely will never be properly until it's absolutely needed) supported!
if(!istype(starting) || !istype(ending) || !ispath(beam_type))
return
var/datum/point/midpoint = point_midpoint_points(starting, ending)
@@ -9,9 +9,13 @@
. = PB
if(light_range > 0 && light_intensity > 0)
var/list/turf/line = getline(starting.return_turf(), ending.return_turf())
for(var/i in line)
var/turf/T = i
QDEL_IN(new /obj/effect/projectile_lighting(T, light_color_override, light_range, light_intensity), qdel_in > 0? qdel_in : 5)
tracing_line:
for(var/i in line)
var/turf/T = i
for(var/obj/effect/projectile_lighting/PL in T)
if(PL.owner == instance_key)
continue tracing_line
QDEL_IN(new /obj/effect/projectile_lighting(T, light_color_override, light_range, light_intensity, instance_key), qdel_in > 0? qdel_in : 5)
line = null
if(qdel_in)
QDEL_IN(PB, qdel_in)
@@ -57,3 +61,6 @@
/obj/effect/projectile/tracer/tracer/aiming
icon_state = "pixelbeam_greyscale"
/obj/effect/projectile/tracer/wormhole
icon_state = "wormhole_g"
+2 -1
View File
@@ -597,8 +597,9 @@
if(!length(beam_segments))
return
if(tracer_type)
var/tempref = REF(src)
for(var/datum/point/p in beam_segments)
generate_tracer_between_points(p, beam_segments[p], tracer_type, color, duration, hitscan_light_range, hitscan_light_color_override, hitscan_light_intensity)
generate_tracer_between_points(p, beam_segments[p], tracer_type, color, duration, hitscan_light_range, hitscan_light_color_override, hitscan_light_intensity, tempref)
if(muzzle_type && duration > 0)
var/datum/point/p = beam_segments[1]
var/atom/movable/thing = new muzzle_type
@@ -2,9 +2,15 @@
name = "bluespace beam"
icon_state = "spark"
hitsound = "sparks"
damage = 3
damage = 0
nodamage = TRUE
hitscan = TRUE
pass_flags = PASSGLASS | PASSTABLE | PASSGRILLE | PASSMOB
var/obj/item/gun/energy/wormhole_projector/gun
color = "#33CCFF"
tracer_type = /obj/effect/projectile/tracer/wormhole
impact_type = /obj/effect/projectile/impact/wormhole
muzzle_type = /obj/effect/projectile/muzzle/wormhole
/obj/item/projectile/beam/wormhole/orange
name = "orange bluespace beam"
@@ -16,10 +22,6 @@
gun = casing.gun
/obj/item/projectile/beam/wormhole/on_hit(atom/target)
if(ismob(target))
var/turf/portal_destination = pick(orange(6, src))
do_teleport(target, portal_destination)
return ..()
if(!gun)
qdel(src)
gun.create_portal(src, get_turf(src))
Binary file not shown.

Before

Width:  |  Height:  |  Size: 24 KiB

After

Width:  |  Height:  |  Size: 24 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 25 KiB

After

Width:  |  Height:  |  Size: 25 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 5.3 KiB

After

Width:  |  Height:  |  Size: 5.4 KiB