mirror of
https://github.com/ParadiseSS13/Paradise.git
synced 2026-08-24 20:47:10 +01:00
Nukes recursive effects (#14936)
* [WIP] Nukes recursive effects * Finishes the rest of the stuff * Mochi tweaks
This commit is contained in:
File diff suppressed because it is too large
Load Diff
@@ -1,140 +1,15 @@
|
||||
/////////////////////////////////////////////
|
||||
//////// Attach a trail to any object, that spawns when it moves (like for the jetpack)
|
||||
/// just pass in the object to attach it to in set_up
|
||||
/// Then do start() to start it and stop() to stop it, obviously
|
||||
/// and don't call start() in a loop that will be repeated otherwise it'll get spammed!
|
||||
/////////////////////////////////////////////
|
||||
|
||||
/datum/effect_system/trail_follow
|
||||
var/turf/oldposition
|
||||
var/processing = 1
|
||||
var/on = 1
|
||||
|
||||
/datum/effect_system/trail_follow/set_up(atom/atom)
|
||||
attach(atom)
|
||||
oldposition = get_turf(atom)
|
||||
|
||||
/datum/effect_system/trail_follow/Destroy()
|
||||
oldposition = null
|
||||
return ..()
|
||||
|
||||
/datum/effect_system/trail_follow/proc/stop()
|
||||
processing = 0
|
||||
on = 0
|
||||
oldposition = null
|
||||
|
||||
/datum/effect_system/trail_follow/steam
|
||||
effect_type = /obj/effect/particle_effect/steam
|
||||
|
||||
/datum/effect_system/trail_follow/steam/start() //Whoever is responsible for this abomination of code should become an hero
|
||||
if(!on)
|
||||
on = 1
|
||||
processing = 1
|
||||
if(!oldposition)
|
||||
oldposition = get_turf(holder)
|
||||
if(processing)
|
||||
processing = 0
|
||||
if(number < 3)
|
||||
var/obj/effect/particle_effect/steam/I = new effect_type(oldposition)
|
||||
number++
|
||||
I.dir = holder.dir
|
||||
oldposition = get_turf(holder)
|
||||
spawn(10)
|
||||
qdel(I)
|
||||
number--
|
||||
spawn(2)
|
||||
if(on)
|
||||
processing = 1
|
||||
start()
|
||||
|
||||
/// Ion trails for spacepods and other space-flying things
|
||||
/obj/effect/particle_effect/ion_trails
|
||||
name = "ion trails"
|
||||
icon_state = "ion_trails"
|
||||
anchored = 1
|
||||
anchored = TRUE
|
||||
|
||||
/datum/effect_system/trail_follow/ion
|
||||
effect_type = /obj/effect/particle_effect/ion_trails
|
||||
|
||||
/datum/effect_system/trail_follow/ion/start() //Whoever is responsible for this abomination of code should become an hero
|
||||
if(!on)
|
||||
on = 1
|
||||
processing = 1
|
||||
if(processing)
|
||||
processing = 0
|
||||
var/turf/T = get_turf(src.holder)
|
||||
if(T != oldposition)
|
||||
if(!has_gravity(T))
|
||||
var/obj/effect/particle_effect/ion_trails/I = new effect_type(oldposition)
|
||||
I.dir = holder.dir
|
||||
flick("ion_fade", I)
|
||||
I.icon_state = ""
|
||||
spawn(20)
|
||||
qdel(I)
|
||||
oldposition = T
|
||||
spawn(2)
|
||||
if(on)
|
||||
processing = 1
|
||||
start()
|
||||
|
||||
/datum/effect_system/trail_follow/ion/space_trail
|
||||
var/turf/oldloc // secondary ion trail loc
|
||||
var/turf/currloc
|
||||
|
||||
/datum/effect_system/trail_follow/ion/space_trail/Destroy()
|
||||
oldloc = null
|
||||
currloc = null
|
||||
return ..()
|
||||
|
||||
/datum/effect_system/trail_follow/ion/space_trail/start()
|
||||
if(!on)
|
||||
on = 1
|
||||
processing = 1
|
||||
if(processing)
|
||||
processing = 0
|
||||
spawn(0)
|
||||
var/turf/T = get_turf(src.holder)
|
||||
if(currloc != T)
|
||||
switch(holder.dir)
|
||||
if(NORTH)
|
||||
src.oldposition = T
|
||||
src.oldposition = get_step(oldposition, SOUTH)
|
||||
src.oldloc = get_step(oldposition,EAST)
|
||||
//src.oldloc = get_step(oldloc, SOUTH)
|
||||
if(SOUTH) // More difficult, offset to the north!
|
||||
src.oldposition = get_step(holder,NORTH)
|
||||
src.oldposition = get_step(oldposition,NORTH)
|
||||
src.oldloc = get_step(oldposition,EAST)
|
||||
//src.oldloc = get_step(oldloc,NORTH)
|
||||
if(EAST) // Just one to the north should suffice
|
||||
src.oldposition = T
|
||||
src.oldposition = get_step(oldposition, WEST)
|
||||
src.oldloc = get_step(oldposition,NORTH)
|
||||
//src.oldloc = get_step(oldloc,WEST)
|
||||
if(WEST) // One to the east and north from there
|
||||
src.oldposition = get_step(holder,EAST)
|
||||
src.oldposition = get_step(oldposition,EAST)
|
||||
src.oldloc = get_step(oldposition,NORTH)
|
||||
//src.oldloc = get_step(oldloc,EAST)
|
||||
if(istype(T, /turf/space))
|
||||
var/obj/effect/particle_effect/ion_trails/I = new effect_type(oldposition)
|
||||
var/obj/effect/particle_effect/ion_trails/II = new effect_type(oldloc)
|
||||
//src.oldposition = T
|
||||
I.dir = holder.dir
|
||||
II.dir = holder.dir
|
||||
flick("ion_fade", I)
|
||||
flick("ion_fade", II)
|
||||
I.icon_state = ""
|
||||
II.icon_state = ""
|
||||
spawn(20)
|
||||
if(I)
|
||||
qdel(I)
|
||||
if(II)
|
||||
qdel(II)
|
||||
spawn(2)
|
||||
if(on)
|
||||
processing = 1
|
||||
start()
|
||||
currloc = T
|
||||
/obj/effect/particle_effect/ion_trails/Initialize(mapload, targetdir)
|
||||
. = ..()
|
||||
dir = targetdir
|
||||
flick("ion_fade", src)
|
||||
icon_state = null
|
||||
QDEL_IN(src, 2 SECONDS)
|
||||
|
||||
//Reagent-based explosion effect
|
||||
/datum/effect_system/reagents_explosion
|
||||
|
||||
@@ -5,20 +5,16 @@
|
||||
w_class = WEIGHT_CLASS_BULKY
|
||||
item_state = "jetpack"
|
||||
distribute_pressure = ONE_ATMOSPHERE*O2STANDARD
|
||||
var/datum/effect_system/trail_follow/ion/ion_trail
|
||||
actions_types = list(/datum/action/item_action/set_internals, /datum/action/item_action/toggle_jetpack, /datum/action/item_action/jetpack_stabilization)
|
||||
var/on = 0
|
||||
var/stabilizers = 0
|
||||
var/volume_rate = 500 //Needed for borg jetpack transfer
|
||||
|
||||
/obj/item/tank/jetpack/New()
|
||||
..()
|
||||
ion_trail = new /datum/effect_system/trail_follow/ion()
|
||||
ion_trail.set_up(src)
|
||||
|
||||
/obj/item/tank/jetpack/Destroy()
|
||||
QDEL_NULL(ion_trail)
|
||||
return ..()
|
||||
/obj/item/tank/jetpack/on_mob_move(direction, mob/user)
|
||||
if(on)
|
||||
var/turf/T = get_step(src, GetOppositeDir(direction))
|
||||
if(!has_gravity(T))
|
||||
new /obj/effect/particle_effect/ion_trails(T, direction)
|
||||
|
||||
/obj/item/tank/jetpack/ui_action_click(mob/user, actiontype)
|
||||
if(actiontype == /datum/action/item_action/toggle_jetpack)
|
||||
@@ -59,14 +55,11 @@
|
||||
/obj/item/tank/jetpack/proc/turn_on(mob/user)
|
||||
on = TRUE
|
||||
icon_state = "[initial(icon_state)]-on"
|
||||
ion_trail.start()
|
||||
|
||||
/obj/item/tank/jetpack/proc/turn_off(mob/user)
|
||||
on = FALSE
|
||||
stabilizers = FALSE
|
||||
icon_state = initial(icon_state)
|
||||
ion_trail.stop()
|
||||
|
||||
|
||||
/obj/item/tank/jetpack/proc/allow_thrust(num, mob/living/user)
|
||||
if(!on)
|
||||
@@ -150,8 +143,6 @@
|
||||
|
||||
/obj/item/tank/jetpack/carbondioxide/New()
|
||||
..()
|
||||
ion_trail = new /datum/effect_system/trail_follow/ion()
|
||||
ion_trail.set_up(src)
|
||||
air_contents.carbon_dioxide = (6*ONE_ATMOSPHERE)*volume/(R_IDEAL_GAS_EQUATION*T20C)
|
||||
|
||||
/obj/item/tank/jetpack/carbondioxide/examine(mob/user)
|
||||
|
||||
@@ -107,7 +107,6 @@ GLOBAL_LIST_INIT(robot_verbs_default, list(
|
||||
var/magpulse = 0
|
||||
var/ionpulse = 0 // Jetpack-like effect.
|
||||
var/ionpulse_on = 0 // Jetpack-like effect.
|
||||
var/datum/effect_system/trail_follow/ion/ion_trail // Ionpulse effect.
|
||||
|
||||
var/datum/action/item_action/toggle_research_scanner/scanner = null
|
||||
var/list/module_actions = list()
|
||||
@@ -176,6 +175,13 @@ GLOBAL_LIST_INIT(robot_verbs_default, list(
|
||||
diag_hud_set_borgcell()
|
||||
scanner = new(src)
|
||||
scanner.Grant(src)
|
||||
RegisterSignal(src, COMSIG_MOVABLE_MOVED, .proc/create_trail)
|
||||
|
||||
/mob/living/silicon/robot/proc/create_trail(datum/source, atom/oldloc, _dir, forced)
|
||||
if(ionpulse_on)
|
||||
var/turf/T = get_turf(oldloc)
|
||||
if(!has_gravity(T))
|
||||
new /obj/effect/particle_effect/ion_trails(T, _dir)
|
||||
|
||||
/mob/living/silicon/robot/proc/init(alien, connect_to_AI = TRUE, mob/living/silicon/ai/ai_to_sync_to = null)
|
||||
aiCamera = new/obj/item/camera/siliconcam/robot_camera(src)
|
||||
@@ -609,16 +615,8 @@ GLOBAL_LIST_INIT(robot_verbs_default, list(
|
||||
to_chat(src, "<span class='notice'>No thrusters are installed!</span>")
|
||||
return
|
||||
|
||||
if(!ion_trail)
|
||||
ion_trail = new
|
||||
ion_trail.set_up(src)
|
||||
|
||||
ionpulse_on = !ionpulse_on
|
||||
to_chat(src, "<span class='notice'>You [ionpulse_on ? null :"de"]activate your ion thrusters.</span>")
|
||||
if(ionpulse_on)
|
||||
ion_trail.start()
|
||||
else
|
||||
ion_trail.stop()
|
||||
if(thruster_button)
|
||||
thruster_button.icon_state = "ionpulse[ionpulse_on]"
|
||||
|
||||
|
||||
@@ -29,16 +29,18 @@
|
||||
faction = list("malf_drone")
|
||||
deathmessage = "suddenly breaks apart."
|
||||
del_on_death = 1
|
||||
var/datum/effect_system/trail_follow/ion/ion_trail
|
||||
var/passive_mode = TRUE // if true, don't target anything.
|
||||
|
||||
/mob/living/simple_animal/hostile/malf_drone/Initialize(mapload)
|
||||
. = ..()
|
||||
ion_trail = new
|
||||
ion_trail.set_up(src)
|
||||
ion_trail.start()
|
||||
RegisterSignal(src, COMSIG_MOVABLE_MOVED, .proc/create_trail)
|
||||
update_icons()
|
||||
|
||||
/mob/living/simple_animal/hostile/malf_drone/proc/create_trail(datum/source, atom/oldloc, _dir, forced)
|
||||
var/turf/T = get_turf(oldloc)
|
||||
if(!has_gravity(T))
|
||||
new /obj/effect/particle_effect/ion_trails(T, _dir)
|
||||
|
||||
/mob/living/simple_animal/hostile/malf_drone/Process_Spacemove(check_drift = 0)
|
||||
return 1
|
||||
|
||||
|
||||
@@ -38,8 +38,6 @@
|
||||
var/obj/machinery/portable_atmospherics/canister/internal_tank
|
||||
var/use_internal_tank = 0
|
||||
|
||||
var/datum/effect_system/trail_follow/ion/space_trail/ion_trail
|
||||
|
||||
var/hatch_open = 0
|
||||
|
||||
var/next_firetime = 0
|
||||
@@ -111,9 +109,6 @@
|
||||
battery = new battery_type(src)
|
||||
add_cabin()
|
||||
add_airtank()
|
||||
src.ion_trail = new /datum/effect_system/trail_follow/ion/space_trail()
|
||||
src.ion_trail.set_up(src)
|
||||
src.ion_trail.start()
|
||||
src.use_internal_tank = 1
|
||||
equipment_system = new(src)
|
||||
equipment_system.installed_modules += battery
|
||||
@@ -124,6 +119,29 @@
|
||||
cargo_hold.max_w_class = 5 //fit almost anything
|
||||
cargo_hold.max_combined_w_class = 0 //you can optimize your stash with larger items
|
||||
START_PROCESSING(SSobj, src)
|
||||
RegisterSignal(src, COMSIG_MOVABLE_MOVED, .proc/create_trail)
|
||||
|
||||
/obj/spacepod/proc/create_trail()
|
||||
var/turf/T = get_turf(src)
|
||||
var/atom/oldposition
|
||||
var/atom/oldloc
|
||||
switch(dir)
|
||||
if(NORTH)
|
||||
oldposition = get_step(T, SOUTH)
|
||||
oldloc = get_step(oldposition, EAST)
|
||||
if(SOUTH) // More difficult, offset to the north!
|
||||
oldposition = get_step(get_step(src, NORTH), NORTH)
|
||||
oldloc = get_step(oldposition, EAST)
|
||||
if(EAST) // Just one to the north should suffice
|
||||
oldposition = get_step(T, WEST)
|
||||
oldloc = get_step(oldposition, NORTH)
|
||||
if(WEST) // One to the east and north from there
|
||||
oldposition = get_step(get_step(src, EAST), EAST)
|
||||
oldloc = get_step(oldposition, NORTH)
|
||||
|
||||
if(!has_gravity(T))
|
||||
new /obj/effect/particle_effect/ion_trails(oldposition, dir)
|
||||
new /obj/effect/particle_effect/ion_trails(oldloc, dir)
|
||||
|
||||
/obj/spacepod/Destroy()
|
||||
if(equipment_system.cargo_system)
|
||||
@@ -133,7 +151,6 @@
|
||||
QDEL_NULL(battery)
|
||||
QDEL_NULL(cabin_air)
|
||||
QDEL_NULL(internal_tank)
|
||||
QDEL_NULL(ion_trail)
|
||||
occupant_sanity_check()
|
||||
if(pilot)
|
||||
eject_pilot()
|
||||
@@ -280,7 +297,6 @@
|
||||
H.forceMove(get_turf(src))
|
||||
H.ex_act(severity + 1)
|
||||
to_chat(H, "<span class='warning'>You are forcefully thrown from [src]!</span>")
|
||||
qdel(ion_trail)
|
||||
qdel(src)
|
||||
if(2)
|
||||
deal_damage(100)
|
||||
|
||||
Reference in New Issue
Block a user