mirror of
https://github.com/VOREStation/VOREStation.git
synced 2026-08-22 03:27:46 +01:00
Adds New PoI Features + Bonus PoI
This commit is contained in:
@@ -1,78 +1,78 @@
|
||||
// Creates effects like smoke clouds every so often.
|
||||
/obj/effect/map_effect/interval/effect_emitter
|
||||
var/datum/effect/effect/system/effect_system = null
|
||||
var/effect_system_type = null // Which effect system to attach.
|
||||
|
||||
var/effect_amount = 10 // How many effect objects to create on each interval. Note that there's a hard cap on certain effect_systems.
|
||||
var/effect_cardinals_only = FALSE // If true, effects only move in cardinal directions.
|
||||
var/effect_forced_dir = null // If set, effects emitted will always move in this direction.
|
||||
|
||||
/obj/effect/map_effect/interval/effect_emitter/Initialize()
|
||||
effect_system = new effect_system_type()
|
||||
effect_system.attach(src)
|
||||
configure_effects()
|
||||
return ..()
|
||||
|
||||
/obj/effect/map_effect/interval/effect_emitter/interval/Destroy()
|
||||
QDEL_NULL(effect_system)
|
||||
return ..()
|
||||
|
||||
/obj/effect/map_effect/interval/effect_emitter/proc/configure_effects()
|
||||
effect_system.set_up(effect_amount, effect_cardinals_only, usr.loc, effect_forced_dir)
|
||||
|
||||
/obj/effect/map_effect/interval/effect_emitter/trigger()
|
||||
configure_effects() // We do this every interval in case it changes.
|
||||
effect_system.start()
|
||||
..()
|
||||
|
||||
|
||||
// Creates smoke clouds every so often.
|
||||
/obj/effect/map_effect/interval/effect_emitter/smoke
|
||||
name = "smoke emitter"
|
||||
icon_state = "smoke_emitter"
|
||||
effect_system_type = /datum/effect/effect/system/smoke_spread
|
||||
|
||||
interval_lower_bound = 1 SECOND
|
||||
interval_upper_bound = 1 SECOND
|
||||
effect_amount = 2
|
||||
|
||||
/obj/effect/map_effect/interval/effect_emitter/smoke/bad
|
||||
name = "bad smoke emitter"
|
||||
effect_system_type = /datum/effect/effect/system/smoke_spread/bad
|
||||
|
||||
/obj/effect/map_effect/interval/effect_emitter/smoke/fire
|
||||
name = "fire smoke emitter"
|
||||
effect_system_type = /datum/effect/effect/system/smoke_spread/fire
|
||||
|
||||
/obj/effect/map_effect/interval/effect_emitter/smoke/frost
|
||||
name = "frost smoke emitter"
|
||||
effect_system_type = /datum/effect/effect/system/smoke_spread/frost
|
||||
|
||||
/obj/effect/map_effect/interval/effect_emitter/smoke/shock
|
||||
name = "shock smoke emitter"
|
||||
effect_system_type = /datum/effect/effect/system/smoke_spread/shock
|
||||
|
||||
/obj/effect/map_effect/interval/effect_emitter/smoke/mist
|
||||
name = "mist smoke emitter"
|
||||
effect_system_type = /datum/effect/effect/system/smoke_spread/mist
|
||||
|
||||
|
||||
// Makes sparks.
|
||||
/obj/effect/map_effect/interval/effect_emitter/sparks
|
||||
name = "spark emitter"
|
||||
icon_state = "spark_emitter"
|
||||
effect_system_type = /datum/effect/effect/system/spark_spread
|
||||
|
||||
interval_lower_bound = 3 SECONDS
|
||||
interval_upper_bound = 7 SECONDS
|
||||
|
||||
/obj/effect/map_effect/interval/effect_emitter/sparks/frequent
|
||||
effect_amount = 4 // Otherwise it caps out fast.
|
||||
interval_lower_bound = 1
|
||||
interval_upper_bound = 3 SECONDS
|
||||
|
||||
// Makes ""steam"" that looks like fire extinguisher water except it does nothing.
|
||||
/obj/effect/map_effect/interval/effect_emitter/steam
|
||||
name = "steam emitter"
|
||||
icon_state = "smoke_emitter"
|
||||
effect_system_type = /datum/effect/effect/system/steam_spread
|
||||
// Creates effects like smoke clouds every so often.
|
||||
/obj/effect/map_effect/interval/effect_emitter
|
||||
var/datum/effect/effect/system/effect_system = null
|
||||
var/effect_system_type = null // Which effect system to attach.
|
||||
|
||||
var/effect_amount = 10 // How many effect objects to create on each interval. Note that there's a hard cap on certain effect_systems.
|
||||
var/effect_cardinals_only = FALSE // If true, effects only move in cardinal directions.
|
||||
var/effect_forced_dir = null // If set, effects emitted will always move in this direction.
|
||||
|
||||
/obj/effect/map_effect/interval/effect_emitter/Initialize()
|
||||
effect_system = new effect_system_type()
|
||||
effect_system.attach(src)
|
||||
configure_effects()
|
||||
return ..()
|
||||
|
||||
/obj/effect/map_effect/interval/effect_emitter/interval/Destroy()
|
||||
QDEL_NULL(effect_system)
|
||||
return ..()
|
||||
|
||||
/obj/effect/map_effect/interval/effect_emitter/proc/configure_effects()
|
||||
effect_system.set_up(effect_amount, effect_cardinals_only, src.loc, effect_forced_dir)
|
||||
|
||||
/obj/effect/map_effect/interval/effect_emitter/trigger()
|
||||
configure_effects() // We do this every interval in case it changes.
|
||||
effect_system.start()
|
||||
..()
|
||||
|
||||
|
||||
// Creates smoke clouds every so often.
|
||||
/obj/effect/map_effect/interval/effect_emitter/smoke
|
||||
name = "smoke emitter"
|
||||
icon_state = "smoke_emitter"
|
||||
effect_system_type = /datum/effect/effect/system/smoke_spread
|
||||
|
||||
interval_lower_bound = 1 SECOND
|
||||
interval_upper_bound = 1 SECOND
|
||||
effect_amount = 2
|
||||
|
||||
/obj/effect/map_effect/interval/effect_emitter/smoke/bad
|
||||
name = "bad smoke emitter"
|
||||
effect_system_type = /datum/effect/effect/system/smoke_spread/bad
|
||||
|
||||
/obj/effect/map_effect/interval/effect_emitter/smoke/fire
|
||||
name = "fire smoke emitter"
|
||||
effect_system_type = /datum/effect/effect/system/smoke_spread/fire
|
||||
|
||||
/obj/effect/map_effect/interval/effect_emitter/smoke/frost
|
||||
name = "frost smoke emitter"
|
||||
effect_system_type = /datum/effect/effect/system/smoke_spread/frost
|
||||
|
||||
/obj/effect/map_effect/interval/effect_emitter/smoke/shock
|
||||
name = "shock smoke emitter"
|
||||
effect_system_type = /datum/effect/effect/system/smoke_spread/shock
|
||||
|
||||
/obj/effect/map_effect/interval/effect_emitter/smoke/mist
|
||||
name = "mist smoke emitter"
|
||||
effect_system_type = /datum/effect/effect/system/smoke_spread/mist
|
||||
|
||||
|
||||
// Makes sparks.
|
||||
/obj/effect/map_effect/interval/effect_emitter/sparks
|
||||
name = "spark emitter"
|
||||
icon_state = "spark_emitter"
|
||||
effect_system_type = /datum/effect/effect/system/spark_spread
|
||||
|
||||
interval_lower_bound = 3 SECONDS
|
||||
interval_upper_bound = 7 SECONDS
|
||||
|
||||
/obj/effect/map_effect/interval/effect_emitter/sparks/frequent
|
||||
effect_amount = 4 // Otherwise it caps out fast.
|
||||
interval_lower_bound = 1
|
||||
interval_upper_bound = 3 SECONDS
|
||||
|
||||
// Makes ""steam"" that looks like fire extinguisher water except it does nothing.
|
||||
/obj/effect/map_effect/interval/effect_emitter/steam
|
||||
name = "steam emitter"
|
||||
icon_state = "smoke_emitter"
|
||||
effect_system_type = /datum/effect/effect/system/steam_spread
|
||||
|
||||
@@ -1,71 +1,72 @@
|
||||
// These are objects you can use inside special maps (like PoIs), or for adminbuse.
|
||||
// Players cannot see or interact with these.
|
||||
/obj/effect/map_effect
|
||||
anchored = TRUE
|
||||
invisibility = 99 // So a badmin can go view these by changing their see_invisible.
|
||||
icon = 'icons/effects/map_effects.dmi'
|
||||
|
||||
// Below vars concern check_for_player_proximity() and is used to not waste effort if nobody is around to appreciate the effects.
|
||||
var/always_run = FALSE // If true, the game will not try to suppress this from firing if nobody is around to see it.
|
||||
var/proximity_needed = 12 // How many tiles a mob with a client must be for this to run.
|
||||
var/ignore_ghosts = FALSE // If true, ghosts won't satisfy the above requirement.
|
||||
var/ignore_afk = TRUE // If true, AFK people (5 minutes) won't satisfy it as well.
|
||||
var/retry_delay = 3 SECONDS // How long until we check for players again.
|
||||
|
||||
/obj/effect/map_effect/ex_act()
|
||||
return
|
||||
|
||||
/obj/effect/map_effect/singularity_pull()
|
||||
return
|
||||
|
||||
/obj/effect/map_effect/singularity_act()
|
||||
return
|
||||
|
||||
// Base type for effects that run on variable intervals.
|
||||
/obj/effect/map_effect/interval
|
||||
var/interval_lower_bound = 5 SECONDS // Lower number for how often the map_effect will trigger.
|
||||
var/interval_upper_bound = 5 SECONDS // Higher number for above.
|
||||
var/halt = FALSE // Set to true to stop the loop when it reaches the next iteration.
|
||||
|
||||
/obj/effect/map_effect/interval/Initialize()
|
||||
handle_interval_delay()
|
||||
return ..()
|
||||
|
||||
/obj/effect/map_effect/interval/Destroy()
|
||||
halt = TRUE // Shouldn't need it to GC but just in case.
|
||||
return ..()
|
||||
|
||||
// Override this for the specific thing to do. Be sure to call parent to keep looping.
|
||||
/obj/effect/map_effect/interval/proc/trigger()
|
||||
handle_interval_delay()
|
||||
|
||||
// Handles the delay and making sure it doesn't run when it would be bad.
|
||||
/obj/effect/map_effect/interval/proc/handle_interval_delay()
|
||||
// Check to see if we're useful first.
|
||||
if(halt)
|
||||
return // Do not pass .(), do not recursively collect 200 thaler.
|
||||
|
||||
if(!always_run && !check_for_player_proximity(src, proximity_needed, ignore_ghosts, ignore_afk))
|
||||
spawn(retry_delay) // Maybe someday we'll have fancy TG timers/schedulers.
|
||||
if(!QDELETED(src))
|
||||
.()
|
||||
|
||||
var/next_interval = rand(interval_lower_bound, interval_upper_bound)
|
||||
spawn(next_interval)
|
||||
if(!QDELETED(src))
|
||||
trigger()
|
||||
|
||||
// Helper proc to optimize the use of effects by making sure they do not run if nobody is around to perceive it.
|
||||
/proc/check_for_player_proximity(var/atom/proximity_to, var/radius = 12, var/ignore_ghosts = FALSE, var/ignore_afk = TRUE)
|
||||
if(!proximity_to)
|
||||
return FALSE
|
||||
|
||||
for(var/thing in player_list)
|
||||
var/mob/M = thing // Avoiding typechecks for more speed, player_list will only contain mobs anyways.
|
||||
if(ignore_ghosts && isobserver(M))
|
||||
continue
|
||||
if(ignore_afk && M.client && M.client.is_afk(5 MINUTES))
|
||||
continue
|
||||
if(M.z == proximity_to.z && get_dist(M, proximity_to) <= radius)
|
||||
return TRUE
|
||||
// These are objects you can use inside special maps (like PoIs), or for adminbuse.
|
||||
// Players cannot see or interact with these.
|
||||
/obj/effect/map_effect
|
||||
anchored = TRUE
|
||||
invisibility = 99 // So a badmin can go view these by changing their see_invisible.
|
||||
icon = 'icons/effects/map_effects.dmi'
|
||||
|
||||
// Below vars concern check_for_player_proximity() and is used to not waste effort if nobody is around to appreciate the effects.
|
||||
var/always_run = FALSE // If true, the game will not try to suppress this from firing if nobody is around to see it.
|
||||
var/proximity_needed = 12 // How many tiles a mob with a client must be for this to run.
|
||||
var/ignore_ghosts = FALSE // If true, ghosts won't satisfy the above requirement.
|
||||
var/ignore_afk = TRUE // If true, AFK people (5 minutes) won't satisfy it as well.
|
||||
var/retry_delay = 3 SECONDS // How long until we check for players again.
|
||||
|
||||
/obj/effect/map_effect/ex_act()
|
||||
return
|
||||
|
||||
/obj/effect/map_effect/singularity_pull()
|
||||
return
|
||||
|
||||
/obj/effect/map_effect/singularity_act()
|
||||
return
|
||||
|
||||
// Base type for effects that run on variable intervals.
|
||||
/obj/effect/map_effect/interval
|
||||
var/interval_lower_bound = 5 SECONDS // Lower number for how often the map_effect will trigger.
|
||||
var/interval_upper_bound = 5 SECONDS // Higher number for above.
|
||||
var/halt = FALSE // Set to true to stop the loop when it reaches the next iteration.
|
||||
|
||||
/obj/effect/map_effect/interval/Initialize()
|
||||
handle_interval_delay()
|
||||
return ..()
|
||||
|
||||
/obj/effect/map_effect/interval/Destroy()
|
||||
halt = TRUE // Shouldn't need it to GC but just in case.
|
||||
return ..()
|
||||
|
||||
// Override this for the specific thing to do. Be sure to call parent to keep looping.
|
||||
/obj/effect/map_effect/interval/proc/trigger()
|
||||
handle_interval_delay()
|
||||
|
||||
// Handles the delay and making sure it doesn't run when it would be bad.
|
||||
/obj/effect/map_effect/interval/proc/handle_interval_delay()
|
||||
// Check to see if we're useful first.
|
||||
if(halt)
|
||||
return // Do not pass .(), do not recursively collect 200 thaler.
|
||||
|
||||
if(!always_run && !check_for_player_proximity(src, proximity_needed, ignore_ghosts, ignore_afk))
|
||||
spawn(retry_delay) // Maybe someday we'll have fancy TG timers/schedulers.
|
||||
if(!QDELETED(src))
|
||||
.()
|
||||
return
|
||||
|
||||
var/next_interval = rand(interval_lower_bound, interval_upper_bound)
|
||||
spawn(next_interval)
|
||||
if(!QDELETED(src))
|
||||
trigger()
|
||||
|
||||
// Helper proc to optimize the use of effects by making sure they do not run if nobody is around to perceive it.
|
||||
/proc/check_for_player_proximity(var/atom/proximity_to, var/radius = 12, var/ignore_ghosts = FALSE, var/ignore_afk = TRUE)
|
||||
if(!proximity_to)
|
||||
return FALSE
|
||||
|
||||
for(var/thing in player_list)
|
||||
var/mob/M = thing // Avoiding typechecks for more speed, player_list will only contain mobs anyways.
|
||||
if(ignore_ghosts && isobserver(M))
|
||||
continue
|
||||
if(ignore_afk && M.client && M.client.is_afk(5 MINUTES))
|
||||
continue
|
||||
if(M.z == proximity_to.z && get_dist(M, proximity_to) <= radius)
|
||||
return TRUE
|
||||
return FALSE
|
||||
@@ -10,6 +10,7 @@
|
||||
var/mineitemtype = /obj/item/weapon/mine
|
||||
var/panel_open = 0
|
||||
var/datum/wires/mines/wires = null
|
||||
register_as_dangerous_object = TRUE
|
||||
|
||||
/obj/effect/mine/New()
|
||||
icon_state = "uglyminearmed"
|
||||
@@ -271,4 +272,10 @@
|
||||
/obj/item/weapon/mine/incendiary
|
||||
name = "incendiary mine"
|
||||
desc = "A small explosive mine with a fire symbol on the side."
|
||||
minetype = /obj/effect/mine/incendiary
|
||||
minetype = /obj/effect/mine/incendiary
|
||||
|
||||
// This tells AI mobs to not be dumb and step on mines willingly.
|
||||
/obj/item/weapon/mine/is_safe_to_step(mob/living/L)
|
||||
if(!L.hovering)
|
||||
return FALSE
|
||||
return ..()
|
||||
@@ -3,7 +3,8 @@
|
||||
/obj/effect/step_trigger
|
||||
var/affect_ghosts = 0
|
||||
var/stopper = 1 // stops throwers
|
||||
invisibility = 101 // nope cant see this shit
|
||||
invisibility = 99 // nope cant see this shit
|
||||
plane = ABOVE_PLANE
|
||||
anchored = 1
|
||||
|
||||
/obj/effect/step_trigger/proc/Trigger(var/atom/movable/A)
|
||||
@@ -93,21 +94,56 @@
|
||||
var/teleport_y = 0
|
||||
var/teleport_z = 0
|
||||
|
||||
Trigger(var/atom/movable/A)
|
||||
if(teleport_x && teleport_y && teleport_z)
|
||||
var/turf/T = locate(teleport_x, teleport_y, teleport_z)
|
||||
if(isliving(A))
|
||||
var/mob/living/L = A
|
||||
if(L.pulling)
|
||||
var/atom/movable/P = L.pulling
|
||||
L.stop_pulling()
|
||||
P.forceMove(T)
|
||||
L.forceMove(T)
|
||||
L.start_pulling(P)
|
||||
else
|
||||
A.forceMove(T)
|
||||
else
|
||||
A.forceMove(T)
|
||||
/obj/effect/step_trigger/teleporter/Trigger(atom/movable/AM)
|
||||
if(teleport_x && teleport_y && teleport_z)
|
||||
var/turf/T = locate(teleport_x, teleport_y, teleport_z)
|
||||
move_object(AM, T)
|
||||
|
||||
|
||||
/obj/effect/step_trigger/teleporter/proc/move_object(atom/movable/AM, turf/T)
|
||||
if(AM.anchored)
|
||||
return
|
||||
|
||||
if(isliving(AM))
|
||||
var/mob/living/L = AM
|
||||
if(L.pulling)
|
||||
var/atom/movable/P = L.pulling
|
||||
L.stop_pulling()
|
||||
P.forceMove(T)
|
||||
L.forceMove(T)
|
||||
L.start_pulling(P)
|
||||
else
|
||||
L.forceMove(T)
|
||||
else
|
||||
AM.forceMove(T)
|
||||
|
||||
/* Moves things by an offset, useful for 'Bridges'. Uses dir and a distance var to work with maploader direction changes. */
|
||||
/obj/effect/step_trigger/teleporter/offset
|
||||
icon = 'icons/effects/effects.dmi'
|
||||
icon_state = "arrow"
|
||||
var/distance = 3
|
||||
|
||||
/obj/effect/step_trigger/teleporter/offset/north
|
||||
dir = NORTH
|
||||
|
||||
/obj/effect/step_trigger/teleporter/offset/south
|
||||
dir = SOUTH
|
||||
|
||||
/obj/effect/step_trigger/teleporter/offset/east
|
||||
dir = EAST
|
||||
|
||||
/obj/effect/step_trigger/teleporter/offset/west
|
||||
dir = WEST
|
||||
|
||||
/obj/effect/step_trigger/teleporter/offset/Trigger(atom/movable/AM)
|
||||
var/turf/T = get_turf(src)
|
||||
for(var/i = 1 to distance)
|
||||
T = get_step(T, dir)
|
||||
if(!istype(T))
|
||||
return
|
||||
move_object(AM, T)
|
||||
|
||||
|
||||
|
||||
/* Random teleporter, teleports atoms to locations ranging from teleport_x - teleport_x_offset, etc */
|
||||
|
||||
|
||||
Reference in New Issue
Block a user