[MIRROR] Makes emitters hitscan (#3047)

* Makes emitters hitscan (#56579)

* Makes emitters hitscan

* a

Co-authored-by: NotRanged <rangedvdk@gmail.com>
Co-authored-by: Gandalf2k15 <jzo123@hotmail.com>
This commit is contained in:
SkyratBot
2021-02-03 23:37:40 +01:00
committed by GitHub
parent 200fb23a54
commit b511bc53e6
10 changed files with 41 additions and 7 deletions
@@ -36,3 +36,7 @@
/obj/effect/projectile/impact/wormhole
icon_state = "wormhole_g"
/obj/effect/projectile/impact/laser/emitter
name = "emitter impact"
icon_state = "impact_emitter"
@@ -28,3 +28,7 @@
/obj/effect/projectile/muzzle/wormhole
icon_state = "wormhole_g"
/obj/effect/projectile/muzzle/laser/emitter
name = "emitter flash"
icon_state = "muzzle_emitter"
@@ -66,3 +66,7 @@
/obj/effect/projectile/tracer/wormhole
icon_state = "wormhole_g"
/obj/effect/projectile/tracer/laser/emitter
name = "emitter beam"
icon_state = "emitter"
+1 -1
View File
@@ -26,7 +26,7 @@
var/locked = FALSE
var/allow_switch_interact = TRUE
var/projectile_type = /obj/projectile/beam/emitter
var/projectile_type = /obj/projectile/beam/emitter/hitscan
var/projectile_sound = 'sound/weapons/emitter.ogg'
var/datum/effect_system/spark_spread/sparks
+11 -2
View File
@@ -95,6 +95,8 @@
//Hitscan
var/hitscan = FALSE //Whether this is hitscan. If it is, speed is basically ignored.
var/list/beam_segments //assoc list of datum/point or datum/point/vector, start = end. Used for hitscan effect generation.
/// Last turf an angle was changed in for hitscan projectiles.
var/turf/last_angle_set_hitscan_store
var/datum/point/beam_index
var/turf/hitscan_last //last turf touched during hitscanning.
var/tracer_type
@@ -690,7 +692,7 @@
START_PROCESSING(SSprojectiles, src)
pixel_move(1, FALSE) //move it now!
/obj/projectile/proc/setAngle(new_angle) //wrapper for overrides.
/obj/projectile/proc/setAngle(new_angle) //wrapper for overrides.
Angle = new_angle
if(!nondirectional_sprite)
var/matrix/M = new
@@ -698,6 +700,13 @@
transform = M
if(trajectory)
trajectory.set_angle(new_angle)
if(fired && hitscan && isloc(loc) && (loc != last_angle_set_hitscan_store))
last_angle_set_hitscan_store = loc
var/datum/point/pcache = new (src)
var/list/coordinates = trajectory.return_coordinates()
pcache.initialize_location(coordinates[1], coordinates[2], coordinates[3]) // Take the center of the hitscan collision tile, so it looks good on reflector boxes and the like
trajectory.initialize_location(coordinates[1], coordinates[2], coordinates[3]) // Sets the trajectory to it as well, to prevent a strange visual bug
store_hitscan_collision(pcache)
return TRUE
/obj/projectile/forceMove(atom/target)
@@ -744,7 +753,7 @@
beam_segments[beam_index] = null //record start.
/obj/projectile/proc/process_hitscan()
var/safety = range * 3
var/safety = range * 10
record_hitscan_start(RETURN_POINT_VECTOR_INCREMENT(src, Angle, MUZZLE_EFFECT_PIXEL_INCREMENT, 1))
while(loc && !QDELETED(src))
if(paused)
+17 -1
View File
@@ -134,7 +134,7 @@
/obj/projectile/beam/emitter
name = "emitter beam"
icon_state = "emitter" //ICON OVERRIDEN IN SKYRAT AESTHETICS - SEE MODULE
icon_state = "emitter"
damage = 30
impact_effect_type = /obj/effect/temp_visual/impact_effect/green_laser
light_color = LIGHT_COLOR_GREEN
@@ -144,6 +144,22 @@
/obj/projectile/beam/emitter/singularity_pull()
return //don't want the emitters to miss
/obj/projectile/beam/emitter/hitscan
hitscan = TRUE
muzzle_type = /obj/effect/projectile/muzzle/laser/emitter
tracer_type = /obj/effect/projectile/tracer/laser/emitter
impact_type = /obj/effect/projectile/impact/laser/emitter
impact_effect_type = null
hitscan_light_intensity = 3
hitscan_light_range = 0.75
hitscan_light_color_override = COLOR_LIME
muzzle_flash_intensity = 6
muzzle_flash_range = 2
muzzle_flash_color_override = COLOR_LIME
impact_light_intensity = 7
impact_light_range = 2.5
impact_light_color_override = COLOR_LIME
/obj/projectile/beam/lasertag
name = "laser tag beam"
icon_state = "omnilaser"
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: 26 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 5.4 KiB

After

Width:  |  Height:  |  Size: 5.4 KiB

@@ -11,6 +11,3 @@
/obj/machinery/power/rad_collector
icon = 'modular_skyrat/modules/aesthetics/emitter/icons/emitter.dmi'
/obj/projectile/beam/emitter
icon = 'modular_skyrat/modules/aesthetics/emitter/icons/emitter.dmi'
icon_state = "emitter_beam"