Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Sanctification #1084

Draft
wants to merge 16 commits into
base: master
Choose a base branch
from
2 changes: 2 additions & 0 deletions code/__DEFINES/status_effects.dm
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@
#define STATUS_EFFECT_REPLACE 2
/// if it only allows one, and new instances just instead refresh the timer
#define STATUS_EFFECT_REFRESH 3
/// if it only allows one, and new instances add to the timer
#define STATUS_EFFECT_EXTEND 4

///Processing flags - used to define the speed at which the status will work
///This is fast - 0.2s between ticks (I believe!)
Expand Down
3 changes: 2 additions & 1 deletion code/_compile_options.dm
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,7 @@
/////////////////////// MISC PERFORMANCE

//uncomment this to load centcom and runtime station and thats it.
// #define LOWMEMORYMODE
#define LOWMEMORYMODE

//uncomment to enable the spatial grid debug proc.
// #define SPATIAL_GRID_ZLEVEL_STATS
Expand Down Expand Up @@ -243,6 +243,7 @@
#ifdef LOWMEMORYMODE
#define FORCE_MAP "runtimestation"
#define FORCE_MAP_DIRECTORY "_maps"
#warn LOW MEMORY MODE ENABLED.

Check warning on line 246 in code/_compile_options.dm

View workflow job for this annotation

GitHub Actions / Run Linters

#warn LOW MEMORY MODE ENABLED.
#endif

#ifdef DEBUG
Expand Down
3 changes: 3 additions & 0 deletions code/datums/mind.dm
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,9 @@
var/mob/living/current
var/active = FALSE

/// A copy of a corpse appearance, set when transferring a mind to a brainmob.
var/mutable_appearance/body_appearance

///a list of /datum/memories. assoc type of memory = memory datum. only one type of memory will be stored, new ones of the same type overriding the last.
var/list/memories = list()
///reference to the memory panel tgui
Expand Down
10 changes: 9 additions & 1 deletion code/datums/status_effects/_status_effect.dm
Original file line number Diff line number Diff line change
Expand Up @@ -129,12 +129,20 @@

/// Called when a status effect of status_type STATUS_EFFECT_REFRESH
/// has its duration refreshed in apply_status_effect - is passed New() args
/datum/status_effect/proc/refresh(effect, ...)
/datum/status_effect/proc/refresh(mob/living/parent, effect_path, ...)
var/original_duration = initial(duration)
if(original_duration == -1)
return
duration = world.time + original_duration

/// Called when a status effect of status_type STATUS_EFFECT_EXTEND
/// has its duration extended in apply_status_effect - is passed New() args
/datum/status_effect/proc/extend(mob/living/parent, effect_path, ...)
var/original_duration = initial(duration)
if(original_duration == -1)
return
duration += original_duration

/// Adds nextmove modifier multiplicatively to the owner while applied
/datum/status_effect/proc/nextmove_modifier()
return 1
Expand Down
5 changes: 5 additions & 0 deletions code/datums/status_effects/_status_effect_helpers.dm
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,13 @@
existing_effect.be_replaced()
// Refresh the existing type, then early return
if(STATUS_EFFECT_REFRESH)
arguments.Insert(1, new_effect)
existing_effect.refresh(arglist(arguments))
return
if(STATUS_EFFECT_EXTEND)
arguments.Insert(1, new_effect)
existing_effect.extend(arglist(arguments))
return

// Create the status effect with our mob + our arguments
var/datum/status_effect/new_instance = new new_effect(arguments)
Expand Down
2 changes: 1 addition & 1 deletion code/datums/status_effects/debuffs/debuffs.dm
Original file line number Diff line number Diff line change
Expand Up @@ -217,7 +217,7 @@
var/delta = world.time - last_dead_time
var/new_timeofdeath = owner.timeofdeath + delta
owner.timeofdeath = new_timeofdeath
owner.tod = stationtime2text(reference_time=new_timeofdeath)
owner.timeofdeath_as_ingame = stationtime2text(reference_time=new_timeofdeath)
last_dead_time = null
if(owner.stat == DEAD)
last_dead_time = world.time
Expand Down
23 changes: 1 addition & 22 deletions code/datums/status_effects/skill_modifiers/negative.dm
Original file line number Diff line number Diff line change
@@ -1,22 +1 @@
/datum/status_effect/skill_mod/witness_death
status_type = STATUS_EFFECT_REFRESH
duration = 20 MINUTES

skill_path = /datum/rpg_skill/willpower
modify_amt = -1
source = SKILL_SOURCE_WITNESS_DEATH

/datum/status_effect/skill_mod/witness_death/on_apply()
if(!owner.stats.cooldown_finished("death_resolve"))
return FALSE
return ..()

/datum/status_effect/skill_mod/witness_death/on_remove()
var/datum/roll_result/result = owner.stat_roll(13, /datum/rpg_skill/willpower)
switch(result.outcome)
if(CRIT_SUCCESS, SUCCESS)
to_chat(owner, result.create_tooltip("You come to terms with past events, strengthing your resolve for the road ahead."))
owner.stats.set_cooldown("death_resolve", INFINITY)
owner.stats.set_skill_modifier(1, /datum/rpg_skill/willpower, SKILL_SOURCE_DEATH_RESOLVE)

return ..()
//placeholder file
9 changes: 9 additions & 0 deletions code/datums/status_effects/skill_modifiers/positive.dm
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
/// Reward for sanctifying corpses
/datum/status_effect/skill_mod/sanctify_corpse
duration = 20 MINUTES
status_type = STATUS_EFFECT_EXTEND

skill_path = /datum/rpg_skill/willpower
modify_amt = 1
source = "Sanctified a corpse."

10 changes: 9 additions & 1 deletion code/datums/status_effects/skill_modifiers/rpg_modifiers.dm
Original file line number Diff line number Diff line change
@@ -1,3 +1,12 @@
/proc/status_effect_to_viewers(target, mod_path, message, range = world.view, exclude_mobs)
for(var/mob/living/carbon/human/M in viewers(target, range) - exclude_mobs)
if(M.is_blind() || M.stat != CONSCIOUS)
continue

M.apply_status_effect(mod_path)
if(message)
to_chat(M, message)

/datum/status_effect/stat_mod
tick_interval = -1
status_type = STATUS_EFFECT_MULTIPLE
Expand Down Expand Up @@ -41,4 +50,3 @@

/datum/status_effect/skill_mod/on_remove()
owner.stats.remove_skill_modifier(skill_path, source)

1 change: 0 additions & 1 deletion code/game/machinery/doors/airlock.dm
Original file line number Diff line number Diff line change
Expand Up @@ -1397,7 +1397,6 @@
A.state = AIRLOCK_ASSEMBLY_NEEDS_ELECTRONICS
A.created_name = name
A.previous_assembly = previous_airlock
A.update_name()
A.update_appearance()

if(!disassembled)
Expand Down
8 changes: 4 additions & 4 deletions code/game/objects/items/cigs_lighters.dm
Original file line number Diff line number Diff line change
Expand Up @@ -636,11 +636,11 @@ CIGARETTE PACKETS ARE IN FANCY.DM

/obj/item/clothing/mask/cigarette/pipe/Initialize(mapload)
. = ..()
update_name()
update_appearance(UPDATE_NAME)

/obj/item/clothing/mask/cigarette/pipe/update_name()
. = ..()
name = packeditem ? "[packeditem]-packed [initial(name)]" : "empty [initial(name)]"
return ..()

/obj/item/clothing/mask/cigarette/pipe/put_out(mob/user, done_early = FALSE)
lit = FALSE
Expand Down Expand Up @@ -672,7 +672,7 @@ CIGARETTE PACKETS ARE IN FANCY.DM
to_chat(user, span_notice("You stuff [to_smoke] into [src]."))
smoketime = 13 MINUTES
packeditem = to_smoke.name
update_name()
update_appearance(UPDATE_NAME)
if(to_smoke.reagents)
to_smoke.reagents.trans_to(src, to_smoke.reagents.total_volume, transfered_by = user)
qdel(to_smoke)
Expand All @@ -686,7 +686,7 @@ CIGARETTE PACKETS ARE IN FANCY.DM
packeditem = null
smoketime = 0
reagents.clear_reagents()
update_name()
update_appearance(UPDATE_NAME)
return
return ..()

Expand Down
4 changes: 1 addition & 3 deletions code/game/objects/structures/door_assembly.dm
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,6 @@
has_fill_overlays = initial(airlock_cast.has_fill_overlays)

update_appearance()
update_name()

AddComponent(/datum/component/simple_rotation)

Expand Down Expand Up @@ -299,7 +298,7 @@
qdel(src)
else
return ..()
update_name()

update_appearance()

/obj/structure/door_assembly/update_overlays()
Expand Down Expand Up @@ -350,7 +349,6 @@
target.electronics = source.electronics
source.electronics.forceMove(target)
target.update_appearance()
target.update_name()
qdel(source)

/obj/structure/door_assembly/deconstruct(disassembled = TRUE)
Expand Down
1 change: 1 addition & 0 deletions code/modules/admin/admin_verbs.dm
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,7 @@ GLOBAL_LIST_INIT(admin_verbs_fun, list(
/client/proc/admin_away,
/client/proc/add_mob_ability,
/client/proc/set_title_music,
/client/proc/restore_ghost_character,
/datum/admins/proc/station_traits_panel,
))
GLOBAL_PROTECT(admin_verbs_fun)
Expand Down
25 changes: 25 additions & 0 deletions code/modules/admin/verbs/adminfun.dm
Original file line number Diff line number Diff line change
Expand Up @@ -249,3 +249,28 @@
message_admins(msg)
admin_ticket_log(whom, msg)
log_admin("[key_name(src)] punished [key_name(whom)] with [punishment].")

/client/proc/restore_ghost_character()
set category = "Admin.Fun"
set name = "Restore Ghost Character"
set desc = "Sets your deadchat name and ghost appearance to your \
roundstart character."

if(!check_rights())
return

if(!isobserver(mob))
return

var/mob/dead/observer/observer_mob = mob
var/mob/living/carbon/human/dummy/consistent/template = new
if(prefs)
var/real_name = prefs.read_preference(/datum/preference/name/real_name)
observer_mob.deadchat_name = real_name
if(observer_mob.mind)
observer_mob.mind.ghostname = real_name
observer_mob.set_real_name(real_name)
prefs.apply_prefs_to(template)

observer_mob.set_ghost_appearance(template)
qdel(template)
2 changes: 1 addition & 1 deletion code/modules/admin/verbs/possess.dm
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
usr.name_archive = ""
if(ishuman(usr))
var/mob/living/carbon/human/H = usr
H.update_name()
H.update_appearance(UPDATE_NAME)

usr.forceMove(get_turf(usr.control_object))
usr.reset_perspective()
Expand Down
4 changes: 2 additions & 2 deletions code/modules/atmospherics/machinery/atmosmachinery.dm
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@

/obj/machinery/atmospherics/LateInitialize()
. = ..()
update_name()
update_appearance(UPDATE_NAME)

/obj/machinery/atmospherics/examine(mob/user)
. = ..()
Expand Down Expand Up @@ -482,7 +482,7 @@ GLOBAL_REAL_VAR(atmos_machinery_default_armor) = list(BLUNT = 25, PUNCTURE = 10,
if(can_unwrench)
add_atom_colour(obj_color, FIXED_COLOUR_PRIORITY)
pipe_color = obj_color
update_name()
update_appearance(UPDATE_NAME)
set_piping_layer(set_layer)
atmos_init()
var/list/nodes = pipeline_expansion()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,7 @@

var/area/vent_area = get_area(src)
if(!GLOB.air_vent_names[id_tag])
update_name()
update_appearance(UPDATE_NAME)
GLOB.air_vent_names[id_tag] = name

vent_area.air_vent_info[id_tag] = signal.data
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -197,7 +197,7 @@
if(!GLOB.air_vent_names[id_tag])
// If we do not have a name, assign one.
// Produces names like "Port Quarter Solar vent pump hZ2l6".
update_name()
update_appearance(UPDATE_NAME)
GLOB.air_vent_names[id_tag] = name

vent_area.air_vent_info[id_tag] = signal.data
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,7 @@
var/area/scrub_area = get_area(src)
if(!GLOB.air_scrub_names[id_tag])
// If we do not have a name, assign one
update_name()
update_appearance(UPDATE_NAME)
GLOB.air_scrub_names[id_tag] = name

scrub_area.air_scrub_info[id_tag] = signal.data
Expand Down
7 changes: 1 addition & 6 deletions code/modules/client/preferences/monochrome_ghost.dm
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,4 @@
if(!istype(M))
return

if(value && !M.started_as_observer)
if(locate(/datum/client_colour/ghostmono) in M.client_colours)
return
M.add_client_colour(/datum/client_colour/ghostmono)
else
M.remove_client_colour(/datum/client_colour/ghostmono)
M.update_monochrome()
5 changes: 3 additions & 2 deletions code/modules/mob/dead/new_player/new_player.dm
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@
if(QDELETED(src) || !src.client || (!skip_check && (this_is_like_playing_right != "Yes")))
ready = PLAYER_NOT_READY
src << browse(null, "window=playersetup") //closes the player setup window
npp.open()
npp?.open()
return FALSE

var/mob/dead/observer/observer = new(null, TRUE)
Expand All @@ -76,10 +76,11 @@
stack_trace("There's no freaking observer landmark available on this map or you're making observers before the map is initialised")
observer.key = key
observer.client = client
observer.restore_ghost_appearance()

if(observer.client && observer.client.prefs)
observer.set_real_name(observer.client.prefs.read_preference(/datum/preference/name/real_name))
observer.client.init_verbs()

observer.stop_sound_channel(CHANNEL_LOBBYMUSIC)
deadchat_broadcast(" has observed.", "<b>[observer.real_name]</b>", follow_target = observer, turf_target = get_turf(observer), message_type = DEADCHAT_DEATHRATTLE)
QDEL_NULL(mind)
Expand Down
3 changes: 1 addition & 2 deletions code/modules/mob/dead/observer/login.dm
Original file line number Diff line number Diff line change
Expand Up @@ -16,5 +16,4 @@
client.set_right_click_menu_mode(FALSE)
lighting_alpha = default_lighting_alpha()
update_sight()


update_monochrome()
Loading
Loading