Skip to content
Merged
Show file tree
Hide file tree
Changes from 5 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
47 changes: 47 additions & 0 deletions code/game/objects/effects/overlays.dm
Original file line number Diff line number Diff line change
Expand Up @@ -226,6 +226,53 @@
icon = 'icons/obj/items/weapons/projectiles.dmi'
icon_state = "laser_target3"

//animation of the OB shell actually hitting the ground
/obj/effect/overlay/temp/ob_impact
name = "ob impact animation"
effect_duration = 12
var/atom/shell
var/size_mod

/obj/effect/overlay/temp/ob_impact/Initialize(mapload, atom/owner, size)
. = ..()
if (!owner)
log_debug("Created a [type] without `owner`")
qdel(src)
return
shell = owner
size_mod = size
appearance = shell.appearance
transform = matrix().Turn(-90)
transform *= size_mod
add_filter("motionblur", 1, motion_blur_filter(x = 5, y = 0)) //either im stupid and dont know what its supposed to look like or it needs to be x because it got rotated
layer = initial(layer)
mouse_opacity = MOUSE_OPACITY_TRANSPARENT
pixel_y = 6000
animate(src, pixel_y = -100, time=10)
animate(icon_state=null, icon=null, time=2) // to vanish it immediately

//same as above but for mortar shells
/obj/effect/overlay/temp/mortar_impact
name = "mortar impact animation"
effect_duration = 22
var/atom/shell

/obj/effect/overlay/temp/mortar_impact/Initialize(mapload, atom/owner)
. = ..()
if (!owner)
log_debug("Created a [type] without `owner`")
qdel(src)
return
shell = owner
appearance = shell.appearance
transform = matrix().Turn(-180)
add_filter("motionblur", 1, motion_blur_filter(x = 0, y = 1))
layer = initial(layer)
mouse_opacity = MOUSE_OPACITY_TRANSPARENT
pixel_y = 3000
animate(src, pixel_y = -50, time=2 SECONDS)
animate(icon_state=null, icon=null, time=2) // to vanish it immediately

/obj/effect/overlay/temp/emp_sparks
icon = 'icons/effects/effects.dmi'
icon_state = "empdisable"
Expand Down
2 changes: 1 addition & 1 deletion code/modules/admin/tabs/event_tab.dm
Original file line number Diff line number Diff line change
Expand Up @@ -1051,7 +1051,7 @@
return

message_admins("[key_name(usr)] has fired \an [warhead.name] at ([target.x],[target.y],[target.z]).")
warhead.warhead_impact(target)
warhead.warhead_impact(target, warhead)

else
warhead.forceMove(target)
Expand Down
1 change: 1 addition & 0 deletions code/modules/cm_marines/equipment/mortar/mortars.dm
Original file line number Diff line number Diff line change
Expand Up @@ -533,6 +533,7 @@
)
if(MODE_HAS_MODIFIER(/datum/gamemode_modifier/mortar_laser_warning))
new /obj/effect/overlay/temp/blinking_laser(target)
new /obj/effect/overlay/temp/mortar_impact (target, shell)
sleep(2 SECONDS) // Wait out the rest of the landing time
target.ceiling_debris_check(2)
if(!protected_by_pylon(TURF_PROTECTION_MORTAR, target))
Expand Down
19 changes: 11 additions & 8 deletions code/modules/cm_marines/orbital_cannon.dm
Original file line number Diff line number Diff line change
Expand Up @@ -245,7 +245,7 @@ GLOBAL_LIST_EMPTY(orbital_cannon_cancellation)
var/obj/structure/ob_ammo/warhead/warhead = tray.warhead
tray.warhead = null
warhead.moveToNullspace()
warhead.warhead_impact(target)
warhead.warhead_impact(target, warhead)

sleep(OB_CRASHING_DOWN)

Expand Down Expand Up @@ -467,12 +467,13 @@ GLOBAL_LIST_EMPTY(orbital_cannon_cancellation)
var/clear_delay = 3
var/double_explosion_delay = 6

/obj/structure/ob_ammo/warhead/explosive/warhead_impact(turf/target)
/obj/structure/ob_ammo/warhead/explosive/warhead_impact(turf/target, obj/structure/ob_ammo/warhead/warhead)
. = ..()
if (!.)
return

new /obj/effect/overlay/temp/blinking_laser (target)
new /obj/effect/overlay/temp/ob_impact (target, warhead, 1.5)
sleep(10)
var/datum/cause_data/cause_data = create_cause_data(initial(name), source_mob)
cell_explosion(target, clear_power, clear_falloff, EXPLOSION_FALLOFF_SHAPE_LINEAR, null, cause_data) //break shit around
Expand Down Expand Up @@ -515,12 +516,13 @@ GLOBAL_LIST_EMPTY(orbital_cannon_cancellation)
var/fire_color = LIGHT_COLOR_CYAN
var/fire_type = "white"

/obj/structure/ob_ammo/warhead/incendiary/warhead_impact(turf/target)
/obj/structure/ob_ammo/warhead/incendiary/warhead_impact(turf/target, obj/structure/ob_ammo/warhead/warhead)
. = ..()
if (!.)
return

new /obj/effect/overlay/temp/blinking_laser (target)
new /obj/effect/overlay/temp/ob_impact (target, warhead)
sleep(10)
var/datum/cause_data/cause_data = create_cause_data(initial(name), source_mob)
cell_explosion(target, clear_power, clear_falloff, EXPLOSION_FALLOFF_SHAPE_LINEAR, null, cause_data) //break shit around
Expand All @@ -543,14 +545,14 @@ GLOBAL_LIST_EMPTY(orbital_cannon_cancellation)
var/explosion_falloff = 150
var/delay_between_clusters = 0.4 SECONDS // how long between each firing?

/obj/structure/ob_ammo/warhead/cluster/warhead_impact(turf/target)
/obj/structure/ob_ammo/warhead/cluster/warhead_impact(turf/target, obj/structure/ob_ammo/warhead/warhead)
. = ..()
if (!.)
return

start_cluster(target)
start_cluster(target, warhead)

/obj/structure/ob_ammo/warhead/cluster/proc/start_cluster(turf/target)
/obj/structure/ob_ammo/warhead/cluster/proc/start_cluster(turf/target, obj/structure/ob_ammo/warhead/warhead)
set waitfor = 0

var/range_num = 12
Expand All @@ -564,13 +566,14 @@ GLOBAL_LIST_EMPTY(orbital_cannon_cancellation)
var/area/selected_area = get_area(selected_turf)
if(CEILING_IS_PROTECTED(selected_area?.ceiling, CEILING_PROTECTION_TIER_4))
continue
fire_in_a_hole(selected_turf)
fire_in_a_hole(selected_turf, warhead)

sleep(delay_between_clusters)
QDEL_IN(src, 5 SECONDS) // Leave time for last handle_ob_shake below

/obj/structure/ob_ammo/warhead/cluster/proc/fire_in_a_hole(turf/loc)
/obj/structure/ob_ammo/warhead/cluster/proc/fire_in_a_hole(turf/loc, obj/structure/ob_ammo/warhead/warhead)
new /obj/effect/overlay/temp/blinking_laser (loc)
new /obj/effect/overlay/temp/ob_impact (loc, warhead, 0.5)
addtimer(CALLBACK(GLOBAL_PROC, GLOBAL_PROC_REF(cell_explosion), loc, explosion_power, explosion_falloff, EXPLOSION_FALLOFF_SHAPE_LINEAR, null, create_cause_data(initial(name), source_mob)), 1 SECONDS)
addtimer(CALLBACK(src, PROC_REF(handle_ob_shake), loc), 1 SECONDS)

Expand Down