Skip to content

Commit

Permalink
Merge branch 'master' into syndie-tools-tweak
Browse files Browse the repository at this point in the history
  • Loading branch information
MrCastmer authored Apr 26, 2024
2 parents 8c2a57c + 4da9cdd commit 0c65c79
Show file tree
Hide file tree
Showing 36 changed files with 644 additions and 1 deletion.
1 change: 1 addition & 0 deletions code/__DEFINES/{dripstation_defines}/layers.dm
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
#define TEXT_EFFECT_PLANE 65
16 changes: 16 additions & 0 deletions code/controllers/subsystem/explosions.dm
Original file line number Diff line number Diff line change
Expand Up @@ -168,12 +168,19 @@ SUBSYSTEM_DEF(explosions)
A.color = null
A.maptext = ""

/* //Dripstation edit
/proc/dyn_explosion(turf/epicenter, power, flash_range, adminlog = TRUE, ignorecap = TRUE, flame_range = 0, silent = FALSE, smoke = TRUE)
*/
/proc/dyn_explosion(turf/epicenter, power, flash_range, adminlog = TRUE, ignorecap = TRUE, flame_range = 0, silent = FALSE, explosion_type = /datum/effect_system/explosion/smoke) //Dripstation edit
if(!power)
return
var/range = 0
range = round((2 * power)**GLOB.DYN_EX_SCALE)
/* //Dripstation edit
explosion(epicenter, round(range * 0.25), round(range * 0.5), round(range), flash_range*range, adminlog, ignorecap, flame_range*range, silent, smoke)
*/
explosion(epicenter, round(range * 0.25), round(range * 0.5), round(range), flash_range*range, adminlog, ignorecap, flame_range*range, silent, explosion_type) //Dripstation edit


// Using default dyn_ex scale:
// 100 explosion power is a (5, 10, 20) explosion.
Expand All @@ -184,7 +191,10 @@ SUBSYSTEM_DEF(explosions)
// 5 explosion power is a (0, 1, 3) explosion.
// 1 explosion power is a (0, 0, 1) explosion.

/* //Dripstation edit
/proc/explosion(atom/epicenter, devastation_range, heavy_impact_range, light_impact_range, flash_range, adminlog = TRUE, ignorecap = FALSE, flame_range = 0, silent = FALSE, smoke = FALSE)
*/
/proc/explosion(atom/epicenter, devastation_range, heavy_impact_range, light_impact_range, flash_range, adminlog = TRUE, ignorecap = FALSE, flame_range = 0, silent = FALSE, explosion_type = /datum/effect_system/explosion) //Dripstation edit
. = SSexplosions.explode(arglist(args))

#define CREAK_DELAY 5 SECONDS //Time taken for the creak to play after explosion, if applicable.
Expand All @@ -197,7 +207,10 @@ SUBSYSTEM_DEF(explosions)
#define FREQ_UPPER 40 //The upper limit for the randomly selected frequency.
#define FREQ_LOWER 25 //The lower of the above.

/*
/datum/controller/subsystem/explosions/proc/explode(atom/epicenter, devastation_range, heavy_impact_range, light_impact_range, flash_range, adminlog, ignorecap, flame_range, silent, smoke)
*/
/datum/controller/subsystem/explosions/proc/explode(atom/epicenter, devastation_range, heavy_impact_range, light_impact_range, flash_range, adminlog, ignorecap, flame_range, silent, explosion_type) //Dripstation edit
epicenter = get_turf(epicenter)
if(!epicenter)
return
Expand Down Expand Up @@ -308,11 +321,14 @@ SUBSYSTEM_DEF(explosions)
addtimer(CALLBACK(M, TYPE_PROC_REF(/mob, playsound_local), epicenter, null, rand(FREQ_LOWER, FREQ_UPPER), 1, frequency, null, null, FALSE, hull_creaking_sound, 0), CREAK_DELAY)

if(heavy_impact_range > 1)
/*
var/datum/effect_system/explosion/E
if(smoke)
E = new /datum/effect_system/explosion/smoke
else
E = new
*/
var/datum/effect_system/explosion/E = new explosion_type //Dripstation
E.set_up(epicenter)
E.start()

Expand Down
6 changes: 6 additions & 0 deletions code/datums/progressbar.dm
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,10 @@
return
goal = goal_number
bar_loc = target
/* //Dripstation edit
bar = image('icons/effects/progessbar.dmi', bar_loc, "prog_bar_0")
*/
bar = image('modular_dripstation/icons/effects/progressbar.dmi', bar_loc, "prog_bar_0") //Dripstation edit
SET_PLANE_EXPLICIT(bar, ABOVE_HUD_PLANE, User) //yogs change, increased so it draws ontop of ventcrawling overlays
bar.appearance_flags = APPEARANCE_UI_IGNORE_ALPHA
user = User
Expand Down Expand Up @@ -125,7 +128,10 @@
if(progress == last_progress)
return
last_progress = progress
/* //Dripstation edit
bar.icon_state = "prog_bar_[round(((progress / goal) * 100), 5)]"
*/
bar.icon_state = "prog_bar_[round(((progress / goal) * 100), 2.5)]" //Dripstation edit


///Called on progress end, be it successful or a failure. Wraps up things to delete the datum and bar.
Expand Down
3 changes: 3 additions & 0 deletions code/game/machinery/_machinery.dm
Original file line number Diff line number Diff line change
Expand Up @@ -634,7 +634,10 @@ Class Procs:
if(prob(60))
ex_act(EXPLODE_DEVASTATE)
else if (prob(50))
/* //Dripstation edits
explosion(src, 1, 2, 4, flame_range = 2, adminlog = FALSE, smoke = FALSE)
*/
explosion(src, 1, 2, 4, flame_range = 2, adminlog = FALSE) //Dripstation edits
if(tesla_flags & TESLA_OBJ_DAMAGE)
take_damage(power/2000, BURN, ENERGY)
if(prob(40))
Expand Down
5 changes: 5 additions & 0 deletions code/game/objects/effects/countdown.dm
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,10 @@
displayed_text = new_val

if(displayed_text)
/* //Dripstation edit
maptext = "<font size = [text_size]>[displayed_text]</font>"
*/
maptext = "<span class='maptext'><font size = [text_size]>[displayed_text]</font></span>"
else
maptext = null

Expand Down Expand Up @@ -121,11 +124,13 @@
text_size = 1
color = "#00ff80"

/*
/obj/effect/countdown/supermatter/get_value()
var/obj/machinery/power/supermatter_crystal/S = attached_to
if(!istype(S))
return
return "<div align='center' valign='middle' style='position:relative; top:0px; left:0px'>[round(S.get_integrity(), 1)]%</div>"
*/

/obj/effect/countdown/transformer
name = "transformer countdown"
Expand Down
4 changes: 4 additions & 0 deletions code/game/objects/items/clown_items.dm
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,11 @@
force_string = "robust... against germs"
var/uses = 100

/*
/obj/item/soap/Initialize(mapload)
. = ..()
AddComponent(/datum/component/slippery, 80)
*/

/obj/item/soap/examine(mob/user)
. = ..()
Expand Down Expand Up @@ -79,6 +81,7 @@
new /obj/effect/particle_effect/fluid/foam(loc)
return (TOXLOSS)

/*
/obj/item/soap/proc/decreaseUses(mob/user, amount = 1)
uses -= amount
if(uses <= 0)
Expand Down Expand Up @@ -147,6 +150,7 @@
target.wash_cream()
decreaseUses(user)
return
*/

/*
* Bike Horns
Expand Down
2 changes: 2 additions & 0 deletions code/game/objects/items/mop.dm
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
force_string = "robust... against germs"
var/insertable = TRUE

/*
/obj/item/mop/Initialize(mapload)
. = ..()
create_reagents(mopcap, REFILLABLE)
Expand Down Expand Up @@ -55,6 +56,7 @@
if(do_after(user, realspeed, T))
to_chat(user, span_notice("You finish mopping."))
clean(T)
*/


/obj/effect/attackby(obj/item/I, mob/user, params)
Expand Down
15 changes: 15 additions & 0 deletions code/modules/power/supermatter/supermatter.dm
Original file line number Diff line number Diff line change
Expand Up @@ -230,12 +230,18 @@ GLOBAL_DATUM(main_supermatter_engine, /obj/machinery/power/supermatter_crystal)
radio.keyslot = new radio_key
radio.listening = 0
radio.recalculateChannels()
//Dripstation edit start
distort = new(src)
add_overlay(distort)
add_emitter(/obj/emitter/sparkle, "supermatter_sparkle")
//Dripstation edit end
investigate_log("has been created.", INVESTIGATE_SUPERMATTER)
if(is_main_engine)
GLOB.main_supermatter_engine = src

soundloop = new(list(src), TRUE)

/* //Dripstation edit
/obj/machinery/power/supermatter_crystal/Destroy()
investigate_log("has been destroyed.", INVESTIGATE_SUPERMATTER)
SSair.stop_processing_machine(src)
Expand All @@ -246,6 +252,7 @@ GLOBAL_DATUM(main_supermatter_engine, /obj/machinery/power/supermatter_crystal)
GLOB.main_supermatter_engine = null
QDEL_NULL(soundloop)
return ..()
*/

/obj/machinery/power/supermatter_crystal/examine(mob/user)
. = ..()
Expand Down Expand Up @@ -611,6 +618,14 @@ GLOBAL_DATUM(main_supermatter_engine, /obj/machinery/power/supermatter_crystal)
hallucination_max_duration = 400 SECONDS,
)

//Dripstation edit start
// Checks if the status has changed, in order to update the displacement effect
var/current_status = get_status()
if(current_status != last_status)
last_status = current_status
update_displacement()

//Dripstation edit end
power -= ((power/500)**3) * powerloss_inhibitor

if(power > POWER_PENALTY_THRESHOLD || damage > damage_penalty_point)
Expand Down
3 changes: 3 additions & 0 deletions code/modules/power/supermatter/supermatter_delamination.dm
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,10 @@
else
message_admins("[src] has exploded")
INVOKE_ASYNC(GLOBAL_PROC, GLOBAL_PROC_REF(empulse), supermatter_turf, supermatter_explosion_power * explosion_mod, (supermatter_explosion_power * explosion_mod * 2) + (supermatter_explosion_power/4), TRUE, FALSE, FALSE, TRUE)
/* //Dripstation edit
explosion(supermatter_turf, supermatter_explosion_power * explosion_mod * 0.5, supermatter_explosion_power * explosion_mod + 2, supermatter_explosion_power * explosion_mod + 4, supermatter_explosion_power * explosion_mod + 6, 1, 1)
*/
explosion(supermatter_turf, supermatter_explosion_power * explosion_mod * 0.5, supermatter_explosion_power * explosion_mod + 2, supermatter_explosion_power * explosion_mod + 4, supermatter_explosion_power * explosion_mod + 6, 1, 1, explosion_type = /datum/effect_system/explosion/delamination) //Dripstation edit
radiation_pulse(supermatter_turf, (supermatter_radiation + 2400) * supermatter_explosion_power)

/datum/supermatter_delamination/proc/call_tesla()
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
/atom/movable/screen/plane_master/text_effect
name = "text effect plane"
plane = TEXT_EFFECT_PLANE
render_relay_planes = list(RENDER_PLANE_NON_GAME)
134 changes: 134 additions & 0 deletions modular_dripstation/code/datums/component/cleaner.dm
Original file line number Diff line number Diff line change
@@ -0,0 +1,134 @@
///Called from a cleaning tool to start cleaning something.
#define COMSIG_START_CLEANING "start_cleaning"

/// Marks an atom when the cleaning of it is first started, so that the cleaning overlay doesn't get removed prematurely
#define CURRENTLY_CLEANING "currently_cleaning"

/**
* Component that can be used to clean things.
* Takes care of duration and special cleaning interactions.
* A callback can be set by the datum holding the cleaner to add custom functionality.
* Soap uses a callback to decrease the amount of uses it has left after cleaning for example.
*/
/datum/component/cleaner
/// The time it takes to clean something, without reductions from the cleaning skill modifier.
var/base_cleaning_duration
/// Determines what this cleaner can wash off, [the available options are found here](code/__DEFINES/cleaning.html).
var/cleaning_strength
/// Gets called when something is successfully cleaned.
var/datum/callback/on_cleaned_callback

/datum/component/cleaner/Initialize(
base_cleaning_duration = 3 SECONDS,
cleaning_strength = CLEAN_SCRUB,
datum/callback/on_cleaned_callback = null,
)
src.base_cleaning_duration = base_cleaning_duration
src.cleaning_strength = cleaning_strength
src.on_cleaned_callback = on_cleaned_callback

/datum/component/cleaner/Destroy(force, silent)
on_cleaned_callback = null
return ..()

/datum/component/cleaner/RegisterWithParent()
RegisterSignal(parent, COMSIG_START_CLEANING, .proc/on_start_cleaning)

/datum/component/cleaner/UnregisterFromParent()
UnregisterSignal(parent, COMSIG_START_CLEANING)

/**
* Handles the COMSIG_START_CLEANING signal by calling the clean proc.
*
* Arguments
* * source the datum that sent the signal to start cleaning
* * target the thing being cleaned
* * user the person doing the cleaning
* * clean_target set this to false if the target should not be washed
*/
/datum/component/cleaner/proc/on_start_cleaning(datum/source, atom/target, mob/living/user, clean_target)
SIGNAL_HANDLER
INVOKE_ASYNC(src, .proc/clean, source, target, user, clean_target) //signal handlers can't have do_afters inside of them

/**
* Cleans something using this cleaner.
* The cleaning duration is modified by the cleaning skill of the user.
* Successfully cleaning gives cleaning experience to the user and invokes the on_cleaned_callback.
*
* Arguments
* * source the datum that sent the signal to start cleaning
* * target the thing being cleaned
* * user the person doing the cleaning
* * clean_target set this to false if the target should not be washed
*/
/datum/component/cleaner/proc/clean(datum/source, atom/target, mob/living/user, clean_target = TRUE)
//add the cleaning overlay
//make sure we don't attempt to clean something while it's already being cleaned
if(HAS_TRAIT(target, CURRENTLY_CLEANING))
return
//add the trait and overlay
ADD_TRAIT(target, CURRENTLY_CLEANING, REF(src))
// We need to update our planes on overlay changes
RegisterSignal(target, COMSIG_MOVABLE_Z_CHANGED, PROC_REF(cleaning_target_moved))
var/mutable_appearance/cleaning_bubbles = mutable_appearance('modular_dripstation/icons/effects/effects.dmi', "bubbles", FLOOR_CLEAN_LAYER, target, GAME_PLANE)
target.add_overlay(cleaning_bubbles)
//set the cleaning duration
var/cleaning_duration = base_cleaning_duration
//offsets the multiplier you get from cleaning skill, but doesn't allow the duration to be longer than the base duration
if(IS_JOB(user, "Janitor"))
cleaning_duration *= 0.8
//do the cleaning
user.visible_message(span_notice("[user] starts to clean [target]!"), span_notice("You start to clean [target]..."))
var/clean_succeeded = FALSE
playsound(target, 'modular_dripstation/sound/effects/mop.ogg', 25, 1)
if(do_after(user, cleaning_duration, target = target))
clean_succeeded = TRUE
user.visible_message(span_notice("[user] finishes cleaning [target]!"), span_notice("You finish cleaning [target]."))
if(clean_target)
for(var/obj/effect/decal/cleanable/cleanable_decal in target) //it's important to do this before you wash all of the cleanables off
if(istype(target, /obj/structure/window)) //window cleaning
target.set_opacity(initial(target.opacity))
target.remove_atom_colour(WASHABLE_COLOUR_PRIORITY)
var/obj/structure/window/window = target
if(window.bloodied)
for(var/obj/effect/decal/cleanable/blood/iter_blood in window)
window.vis_contents -= iter_blood
qdel(iter_blood)
window.bloodied = FALSE
if(istype(target, /obj/machinery/door))
var/obj/machinery/door/door = target
if(door.obj_flags && CMAGGED)
user.visible_message("[user] starts to clean the ooze off \the [door.name]'s access panel.", "You start to clean the ooze off \the [door.name]'s access panel.")
if(do_after(user, cleaning_duration, door))
user.visible_message(span_notice("[user] finishes cleaning off access panel of [target]!"), span_notice("You clean the ooze off [target]'s access panel."))
door.obj_flags &= ~CMAGGED
target.wash(cleaning_strength)

on_cleaned_callback?.Invoke(source, target, user, clean_target, clean_succeeded)
target.cut_overlay(cleaning_bubbles)
UnregisterSignal(target, COMSIG_MOVABLE_Z_CHANGED)
REMOVE_TRAIT(target, TRAIT_CURRENTLY_CLEANING, REF(src))

/**
* Starts cleaning something by sending the COMSIG_START_CLEANING signal.
* This signal is received by the [cleaner component](code/datums/components/cleaner.html).
*
* Arguments
* * source the datum to send the signal from
* * target the thing being cleaned
* * user the person doing the cleaning
* * clean_target set this to false if the target should not be washed and if experience should not be awarded to the user
*/
/atom/proc/start_cleaning(datum/source, atom/target, mob/living/user, clean_target = TRUE)
SEND_SIGNAL(source, COMSIG_START_CLEANING, target, user, clean_target)

/datum/component/cleaner/proc/cleaning_target_moved(atom/movable/source, turf/old_turf, turf/new_turf, same_z_layer)
if(same_z_layer)
return
// First, get rid of the old overlay
var/mutable_appearance/old_cleaning_bubbles = mutable_appearance('modular_dripstation/icons/effects/effects.dmi', "bubbles", FLOOR_CLEAN_LAYER, old_turf, GAME_PLANE)
source.cut_overlay(old_cleaning_bubbles)

// Now, add the new one
var/mutable_appearance/new_cleaning_bubbles = mutable_appearance('modular_dripstation/icons/effects/effects.dmi', "bubbles", FLOOR_CLEAN_LAYER, new_turf, GAME_PLANE)
source.add_overlay(new_cleaning_bubbles)
Loading

0 comments on commit 0c65c79

Please sign in to comment.