Flying mobs now clip past non flying mobs, various flightsuit/iontrail/movement tweaks/code improvements/bugfixes
This commit is contained in:
committed by
CitadelStationBot
parent
b9c07e7f66
commit
77d6420db0
@@ -8,8 +8,13 @@
|
||||
|
||||
/datum/effect_system/trail_follow
|
||||
var/turf/oldposition
|
||||
var/processing = TRUE
|
||||
var/on = TRUE
|
||||
var/active = FALSE
|
||||
var/allow_overlap = FALSE
|
||||
var/auto_process = TRUE
|
||||
var/qdel_in_time = 10
|
||||
var/fadetype = "ion_fade"
|
||||
var/fade = TRUE
|
||||
var/nograv_required = FALSE
|
||||
|
||||
/datum/effect_system/trail_follow/set_up(atom/atom)
|
||||
attach(atom)
|
||||
@@ -17,37 +22,49 @@
|
||||
|
||||
/datum/effect_system/trail_follow/Destroy()
|
||||
oldposition = null
|
||||
stop()
|
||||
return ..()
|
||||
|
||||
/datum/effect_system/trail_follow/proc/stop()
|
||||
processing = FALSE
|
||||
on = FALSE
|
||||
oldposition = null
|
||||
STOP_PROCESSING(SSfastprocess, src)
|
||||
active = FALSE
|
||||
return TRUE
|
||||
|
||||
/datum/effect_system/trail_follow/start()
|
||||
oldposition = get_turf(holder)
|
||||
if(!check_conditions())
|
||||
return FALSE
|
||||
if(auto_process)
|
||||
START_PROCESSING(SSfastprocess, src)
|
||||
active = TRUE
|
||||
return TRUE
|
||||
|
||||
/datum/effect_system/trail_follow/process()
|
||||
generate_effect()
|
||||
|
||||
/datum/effect_system/trail_follow/generate_effect()
|
||||
if(!check_conditions())
|
||||
return stop()
|
||||
if(oldposition && !(oldposition == get_turf(holder)))
|
||||
if(!oldposition.has_gravity() || !nograv_required)
|
||||
var/obj/effect/E = new effect_type(oldposition)
|
||||
set_dir(E)
|
||||
if(fade)
|
||||
flick(fadetype, E)
|
||||
E.icon_state = ""
|
||||
if(qdel_in_time)
|
||||
QDEL_IN(E, qdel_in_time)
|
||||
oldposition = get_turf(holder)
|
||||
|
||||
/datum/effect_system/trail_follow/proc/check_conditions()
|
||||
if(!get_turf(holder))
|
||||
return FALSE
|
||||
return TRUE
|
||||
|
||||
/datum/effect_system/trail_follow/steam
|
||||
effect_type = /obj/effect/particle_effect/steam
|
||||
|
||||
/datum/effect_system/trail_follow/steam/start()
|
||||
if(!on)
|
||||
on = TRUE
|
||||
processing = TRUE
|
||||
if(!oldposition)
|
||||
oldposition = get_turf(holder)
|
||||
if(processing)
|
||||
processing = FALSE
|
||||
if(number < 3)
|
||||
var/obj/effect/particle_effect/steam/I = new /obj/effect/particle_effect/steam(oldposition)
|
||||
number++
|
||||
I.setDir(holder.dir)
|
||||
oldposition = get_turf(holder)
|
||||
spawn(10)
|
||||
qdel(I)
|
||||
number--
|
||||
spawn(2)
|
||||
if(on)
|
||||
processing = TRUE
|
||||
start()
|
||||
|
||||
/obj/effect/particle_effect/ion_trails
|
||||
name = "ion trails"
|
||||
icon_state = "ion_trails"
|
||||
@@ -58,47 +75,23 @@
|
||||
|
||||
/datum/effect_system/trail_follow/ion
|
||||
effect_type = /obj/effect/particle_effect/ion_trails
|
||||
var/fadetype = "ion_fade"
|
||||
var/fade = 1
|
||||
var/nograv_required = 1
|
||||
nograv_required = TRUE
|
||||
qdel_in_time = 20
|
||||
|
||||
/datum/effect_system/trail_follow/ion/start() //Whoever is responsible for this abomination of code should become an hero
|
||||
if(!on)
|
||||
on = TRUE
|
||||
processing = TRUE
|
||||
if(!oldposition)
|
||||
oldposition = get_turf(holder)
|
||||
if(processing)
|
||||
processing = FALSE
|
||||
var/turf/T = get_turf(holder)
|
||||
if(T != oldposition)
|
||||
if(!T.has_gravity() || !nograv_required)
|
||||
var/obj/effect/particle_effect/ion_trails/I = new effect_type(oldposition)
|
||||
set_dir(I)
|
||||
if(fade)
|
||||
flick(fadetype, I)
|
||||
I.icon_state = ""
|
||||
spawn(20)
|
||||
qdel(I)
|
||||
oldposition = T
|
||||
spawn(2)
|
||||
if(on)
|
||||
processing = TRUE
|
||||
start()
|
||||
|
||||
/datum/effect_system/trail_follow/ion/proc/set_dir(obj/effect/particle_effect/ion_trails/I)
|
||||
/datum/effect_system/trail_follow/proc/set_dir(obj/effect/particle_effect/ion_trails/I)
|
||||
I.setDir(holder.dir)
|
||||
|
||||
/datum/effect_system/trail_follow/ion/flight
|
||||
effect_type = /obj/effect/particle_effect/ion_trails/flight
|
||||
fadetype = "ion_fade_flight"
|
||||
nograv_required = 0
|
||||
nograv_required = FALSE
|
||||
auto_process = FALSE
|
||||
|
||||
/datum/effect_system/trail_follow/ion/flight/set_dir(obj/effect/particle_effect/ion_trails/I)
|
||||
if(istype(holder, /obj/item/device/flightpack))
|
||||
var/obj/item/device/flightpack/F = holder
|
||||
I.setDir(F.suit.user.dir)
|
||||
|
||||
if(istype(F.wearer))
|
||||
I.setDir(F.wearer.dir)
|
||||
|
||||
//Reagent-based explosion effect
|
||||
|
||||
|
||||
@@ -189,7 +189,7 @@
|
||||
/obj/proc/check_uplink_validity()
|
||||
return 1
|
||||
|
||||
/obj/proc/on_mob_move(dir, mob, oldLoc)
|
||||
/obj/proc/on_mob_move(dir, mob, oldLoc, forced)
|
||||
return
|
||||
|
||||
/obj/proc/on_mob_turn(dir, mob)
|
||||
|
||||
Reference in New Issue
Block a user