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
@@ -460,14 +460,14 @@ GLOBAL_LIST_EMPTY(teleportlocs)
|
||||
T = get_turf(src)
|
||||
var/area/A = get_area(T)
|
||||
if(isspaceturf(T)) // Turf never has gravity
|
||||
return 0
|
||||
return FALSE
|
||||
else if(A && A.has_gravity) // Areas which always has gravity
|
||||
return 1
|
||||
return TRUE
|
||||
else
|
||||
// There's a gravity generator on our z level
|
||||
if(T && GLOB.gravity_generators["[T.z]"] && length(GLOB.gravity_generators["[T.z]"]))
|
||||
return 1
|
||||
return 0
|
||||
return TRUE
|
||||
return FALSE
|
||||
|
||||
/area/proc/setup(a_name)
|
||||
name = a_name
|
||||
|
||||
@@ -115,8 +115,8 @@
|
||||
. = 0
|
||||
|
||||
//Called after a successful Move(). By this point, we've already moved
|
||||
/atom/movable/proc/Moved(atom/OldLoc, Dir)
|
||||
SendSignal(COMSIG_MOVABLE_MOVED, OldLoc, Dir)
|
||||
/atom/movable/proc/Moved(atom/OldLoc, Dir, Forced = FALSE)
|
||||
SendSignal(COMSIG_MOVABLE_MOVED, OldLoc, Dir, Forced)
|
||||
if (!inertia_moving)
|
||||
inertia_next_move = world.time + inertia_move_delay
|
||||
newtonian_move(Dir)
|
||||
@@ -219,7 +219,7 @@
|
||||
if(A)
|
||||
if(throwing)
|
||||
throwing.hit_atom(A)
|
||||
. = 1
|
||||
. = TRUE
|
||||
if(!A || QDELETED(A))
|
||||
return
|
||||
A.CollidedWith(src)
|
||||
@@ -260,8 +260,7 @@
|
||||
if(AM == src)
|
||||
continue
|
||||
AM.Crossed(src, oldloc)
|
||||
|
||||
Moved(oldloc, 0)
|
||||
Moved(oldloc, NONE, TRUE)
|
||||
. = TRUE
|
||||
|
||||
//If no destination, move the atom into nullspace (don't do this unless you know what you're doing)
|
||||
@@ -277,9 +276,9 @@
|
||||
/mob/living/forceMove(atom/destination)
|
||||
stop_pulling()
|
||||
if(buckled)
|
||||
buckled.unbuckle_mob(src,force=1)
|
||||
buckled.unbuckle_mob(src, force = TRUE)
|
||||
if(has_buckled_mobs())
|
||||
unbuckle_all_mobs(force=1)
|
||||
unbuckle_all_mobs(force = TRUE)
|
||||
. = ..()
|
||||
if(.)
|
||||
if(client)
|
||||
@@ -534,6 +533,7 @@
|
||||
acted_explosions += ex_id
|
||||
return TRUE
|
||||
|
||||
//TODO: Better floating
|
||||
/atom/movable/proc/float(on)
|
||||
if(throwing)
|
||||
return
|
||||
|
||||
@@ -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