Skip to content

Commit

Permalink
Add time sensitive sounds and text
Browse files Browse the repository at this point in the history
  • Loading branch information
Glamurio committed Dec 6, 2024
1 parent 0c136c0 commit 4158677
Show file tree
Hide file tree
Showing 4 changed files with 36 additions and 17 deletions.
2 changes: 2 additions & 0 deletions _std/macros/atom_properties.dm
Original file line number Diff line number Diff line change
Expand Up @@ -320,6 +320,8 @@ To remove:
#define PROP_ATOM_DO_LIQUID_CLICKS(x) x("do_liquid_clicks", APPLY_ATOM_PROPERTY_SIMPLE, REMOVE_ATOM_PROPERTY_SIMPLE)
///for tracking if a borg/cyborg frame was a roundstart one, for stats purposes
#define PROP_ATOM_ROUNDSTART_BORG(x) x("rounstart_borg", APPLY_ATOM_PROPERTY_SIMPLE, REMOVE_ATOM_PROPERTY_SIMPLE)
/// for adjusting temporal shenanigans
#define PROP_ATOM_TIME_SPEED_MULT(x) x("time_speed", APPLY_ATOM_PROPERTY_SUM, REMOVE_ATOM_PROPERTY_SUM)


// In lieu of comments, these are the indexes used for list access in the macros below.
Expand Down
26 changes: 24 additions & 2 deletions code/WorkInProgress/AzrunStuff.dm
Original file line number Diff line number Diff line change
Expand Up @@ -1234,9 +1234,10 @@ ADMIN_INTERACT_PROCS(/turf/unsimulated/floor, proc/sunset, proc/sunrise, proc/se
else
if(ismob(AM) || AM.throwing || istype(AM, /obj/projectile))
if(!locate(/obj/effect/status_area/slow_globe) in obounds(AM,0))
REMOVE_ATOM_PROPERTY(AM, PROP_ATOM_TIME_SPEED_MULT, src)
REMOVE_ATOM_PROPERTY(AM, PROP_MOB_HEARD_PITCH, src)
. = TRUE


strong
status_effect = "time_slowed_plus"
hue_shift = 30
Expand All @@ -1258,6 +1259,7 @@ ADMIN_INTERACT_PROCS(/turf/unsimulated/floor, proc/sunset, proc/sunrise, proc/se
icon_state = "slowed"
unique = 1
var/howMuch = 10
var/time_mult = 2
exclusiveGroup = "temporal"
movement_modifier = new /datum/movement_modifier/status_slowed
effect_quality = STATUS_QUALITY_NEGATIVE
Expand All @@ -1270,11 +1272,17 @@ ADMIN_INTERACT_PROCS(/turf/unsimulated/floor, proc/sunset, proc/sunrise, proc/se
status_source = source
var/atom/movable/AM = owner
var/scale_factor = (howMuch/2)
var/base_speed = 1/time_mult
if(howMuch<0)
scale_factor = -1/scale_factor
base_speed = -1*time_mult

movement_modifier.additive_slowdown = howMuch

// Adjust perceived sound / time based on current speed
APPLY_ATOM_PROPERTY(owner, PROP_ATOM_TIME_SPEED_MULT, status_source, time_mult)
APPLY_ATOM_PROPERTY(owner, PROP_MOB_HEARD_PITCH, status_source, base_speed)

if(istype(AM, /obj/projectile))
var/obj/projectile/B = AM
B.internal_speed = B.proj_data?.projectile_speed / scale_factor
Expand All @@ -1298,6 +1306,9 @@ ADMIN_INTERACT_PROCS(/turf/unsimulated/floor, proc/sunset, proc/sunrise, proc/se
var/atom/source = locate(/obj/effect/status_area/slow_globe) in obounds(M,0)
if(source)
M.changeStatus(src.id, 10 SECONDS, source)
else
REMOVE_ATOM_PROPERTY(AM, PROP_ATOM_TIME_SPEED_MULT, status_source)
REMOVE_ATOM_PROPERTY(AM, PROP_MOB_HEARD_PITCH, status_source)
else if(istype(AM, /obj/projectile))
var/obj/projectile/B = AM
if(B?.special_data && B.special_data[src.icon_state])
Expand All @@ -1311,21 +1322,31 @@ ADMIN_INTERACT_PROCS(/turf/unsimulated/floor, proc/sunset, proc/sunrise, proc/se

onUpdate(timePassed)
. = ..()
if(status_source && QDELETED(status_source))
var/mob/M = null
if (ismob(owner))
M = owner
var/obj/item/artifact/A = null
if(istype(status_source, /obj/item/artifact))
A = status_source
if(status_source && QDELETED(status_source) || (A && !A.artifact.activated) || (M && isdead(M)))
REMOVE_ATOM_PROPERTY(owner, PROP_ATOM_TIME_SPEED_MULT, status_source)
REMOVE_ATOM_PROPERTY(owner, PROP_MOB_HEARD_PITCH, status_source)
owner.delStatus(id)

extra
name = "Sloooowwwwed"
id = "time_slowed_plus"
desc = "You are severely slowed by a temporal anomaly.<br>Movement speed and action speed is reduced."
howMuch = 20
time_mult = 4

reversed
name = "Hastened"
desc = "You are sped up by a temporal anomaly.<br>Movement speed and action speed is increased."
id = "time_hasted"
icon_state = "hastened"
howMuch = -1
time_mult = -2
effect_quality = STATUS_QUALITY_POSITIVE

reversed_extra
Expand All @@ -1334,6 +1355,7 @@ ADMIN_INTERACT_PROCS(/turf/unsimulated/floor, proc/sunset, proc/sunrise, proc/se
id = "time_hasted_plus"
icon_state = "hastened"
howMuch = -5
time_mult = -4
effect_quality = STATUS_QUALITY_POSITIVE


Expand Down
10 changes: 2 additions & 8 deletions code/datums/controllers/action_controls.dm
Original file line number Diff line number Diff line change
Expand Up @@ -216,14 +216,8 @@ var/datum/action_controller/actions
var/atom/movable/A = owner
if(owner != null)
// Slow / Speed up duration if we're under temporal influence
if(src.owner.hasStatus("time_slowed"))
duration *= 2
if(src.owner.hasStatus("time_slowed_plus"))
duration *= 4
if(src.owner.hasStatus("time_hasted"))
duration /= 2
if(src.owner.hasStatus("time_hasted_plus"))
duration /= 4
var/speed_multiplier = (HAS_ATOM_PROPERTY(owner, PROP_ATOM_TIME_SPEED_MULT) ? GET_ATOM_PROPERTY(owner, PROP_ATOM_TIME_SPEED_MULT) : 1)
duration *= speed_multiplier
bar = new /obj/actions/bar
border = new /obj/actions/border
border.set_icon_state(src.border_icon_state)
Expand Down
15 changes: 8 additions & 7 deletions code/modules/speech/floating_chat.dm
Original file line number Diff line number Diff line change
Expand Up @@ -68,12 +68,12 @@
src.unique_id = 0
..()

proc/bump_up(how_much = 8, invis = 0)
proc/bump_up(how_much = 8, invis = 0, time = 4)
src.bumped++
if(invis)
animate(src, alpha = 0, maptext_y = src.maptext_y + how_much, time = 4)
animate(src, alpha = 0, maptext_y = src.maptext_y + how_much, time = time)
else
animate(src, maptext_y = src.maptext_y + how_much, time = 4)
animate(src, maptext_y = src.maptext_y + how_much, time = time)

proc/show_to(var/client/who)
if(!istype(who))
Expand Down Expand Up @@ -124,12 +124,13 @@ proc/make_chat_maptext(atom/target, msg, style = "", alpha = 255, force = 0, tim

holder.notify_nonempty()

animate(text, alpha = alpha, maptext_y = 34, time = 4, flags = ANIMATION_END_NOW)
var/speed_multiplier = (HAS_ATOM_PROPERTY(target, PROP_ATOM_TIME_SPEED_MULT) ? GET_ATOM_PROPERTY(target, PROP_ATOM_TIME_SPEED_MULT) : 1)
animate(text, alpha = alpha, maptext_y = 34, time = 4 * speed_multiplier, flags = ANIMATION_END_NOW)
var/text_id = text.unique_id
SPAWN(time)
SPAWN(time * speed_multiplier)
if(text_id == text.unique_id)
text.bump_up(invis=1)
sleep(0.5 SECONDS)
text.bump_up(invis=1, time = 4 * speed_multiplier)
sleep(0.5 SECONDS * speed_multiplier)
qdel(text)
if (holder && !length(holder.lines))
holder.notify_empty()
Expand Down

0 comments on commit 4158677

Please sign in to comment.