Merge pull request #4818 from yogstation13/upstream-merge-43168

[MIRROR] [s] adds logging to cloning
This commit is contained in:
Nichlas Pihl
2019-03-21 15:14:18 +00:00
committed by GitHub
8 changed files with 39 additions and 11 deletions

View File

@@ -37,6 +37,7 @@
#define LOG_ASAY (1 << 14)
#define LOG_MECHA (1 << 15)
#define LOG_VIRUS (1 << 16)
#define LOG_CLONING (1 << 17)
//Individual logging panel pages
#define INDIVIDUAL_ATTACK_LOG (LOG_ATTACK)

View File

@@ -66,6 +66,10 @@
if (CONFIG_GET(flag/log_virus))
WRITE_LOG(GLOB.world_virus_log, "VIRUS: [text]")
/proc/log_cloning(text, mob/initiator)
if(CONFIG_GET(flag/log_cloning))
WRITE_LOG(GLOB.world_cloning_log, "CLONING: [text]")
/proc/log_asset(text)
WRITE_LOG(GLOB.world_asset_log, "ASSET: [text]")

View File

@@ -32,6 +32,8 @@ GLOBAL_VAR(world_virus_log)
GLOBAL_PROTECT(world_virus_log)
GLOBAL_VAR(world_asset_log)
GLOBAL_PROTECT(world_asset_log)
GLOBAL_VAR(world_cloning_log)
GLOBAL_PROTECT(world_cloning_log)
GLOBAL_LIST_EMPTY(bombers)
GLOBAL_PROTECT(bombers)

View File

@@ -42,6 +42,8 @@
/datum/config_entry/flag/log_virus // log virology data
/datum/config_entry/flag/log_cloning // log cloning actions.
/datum/config_entry/flag/log_vote // log voting
/datum/config_entry/flag/log_whisper // log client whisper

View File

@@ -237,17 +237,20 @@
if(!is_operational()) //Autoeject if power is lost
if(mob_occupant)
log_cloning("[mob_occupant] ejected from [src] at [AREACOORD(src)] due to power loss.")
go_out()
connected_message("Clone Ejected: Loss of power.")
else if(mob_occupant && (mob_occupant.loc == src))
if(SSeconomy.full_ancap)
if(!current_insurance)
log_cloning("[mob_occupant] ejected from [src] at [AREACOORD(src)] due to invalid bank account.")
go_out()
connected_message("Clone Ejected: No bank account.")
if(internal_radio)
SPEAK("The cloning of [mob_occupant.real_name] has been terminated due to no bank account to draw payment from.")
else if(!current_insurance.adjust_money(-fair_market_price))
log_cloning("[mob_occupant] ejected from [src] at [AREACOORD(src)] due to insufficient funds.")
go_out()
connected_message("Clone Ejected: Out of Money.")
if(internal_radio)
@@ -261,6 +264,7 @@
if(internal_radio)
SPEAK("The cloning of [mob_occupant.real_name] has been \
aborted due to unrecoverable tissue failure.")
log_cloning("[mob_occupant] ejected from [src] at [AREACOORD(src)] after suiciding.")
go_out()
else if(mob_occupant && mob_occupant.cloneloss > (100 - heal_level))
@@ -288,6 +292,7 @@
else if(mob_occupant && (mob_occupant.cloneloss <= (100 - heal_level)))
connected_message("Cloning Process Complete.")
log_cloning("[mob_occupant] completed cloning cycle - [src] at [AREACOORD(src)].")
if(internal_radio)
SPEAK("The cloning cycle of [mob_occupant.real_name] is complete.")
@@ -347,6 +352,8 @@
to_chat(user, "<span class='danger'>Error: Pod has no occupant.</span>")
return
else
log_cloning("[user] manually ejected [mob_occupant] from [src] at [AREACOORD(src)].")
log_combat(user, mob_occupant, "ejected", W, "from [src]")
connected_message("Emergency Ejection")
SPEAK("An emergency ejection of [clonemind.name] has occurred. Survival not guaranteed.")
to_chat(user, "<span class='notice'>You force an emergency ejection. </span>")
@@ -359,6 +366,8 @@
return
to_chat(user, "<span class='warning'>You corrupt the genetic compiler.</span>")
malfunction()
log_cloning("[user] emagged [src] at [AREACOORD(src)], causing it to malfunction.")
log_combat(user, src, "emagged", null, occupant ? "[occupant] inside, killing them via malfunction." : null)
//Put messages in the connected computer's temp var for display.
/obj/machinery/clonepod/proc/connected_message(message)
@@ -426,8 +435,9 @@
mob_occupant.grab_ghost() // We really just want to make you suffer.
flash_color(mob_occupant, flash_color="#960000", flash_time=100)
to_chat(mob_occupant, "<span class='warning'><b>Agony blazes across your consciousness as your body is torn apart.</b><br><i>Is this what dying is like? Yes it is.</i></span>")
playsound(loc, 'sound/machines/warning-buzzer.ogg', 50, 0)
playsound(src, 'sound/machines/warning-buzzer.ogg', 50)
SEND_SOUND(mob_occupant, sound('sound/hallucinations/veryfar_noise.ogg',0,1,50))
log_cloning("[mob_occupant] destroyed within [src] at [AREACOORD(src)] due to malfunction.")
QDEL_IN(mob_occupant, 40)
/obj/machinery/clonepod/relaymove(mob/user)
@@ -442,6 +452,7 @@
if (!(. & EMP_PROTECT_SELF))
var/mob/living/mob_occupant = occupant
if(mob_occupant && prob(100/(severity*efficiency)))
log_cloning("[mob_occupant] ejected from [src] at [AREACOORD(src)] due to EMP pulse.")
connected_message(Gibberish("EMP-caused Accidental Ejection", 0))
SPEAK(Gibberish("Exposure to electromagnetic fields has caused the ejection of [mob_occupant.real_name] prematurely." ,0))
go_out()
@@ -458,10 +469,10 @@
/obj/machinery/clonepod/proc/horrifyingsound()
for(var/i in 1 to 5)
playsound(loc,pick('sound/hallucinations/growl1.ogg','sound/hallucinations/growl2.ogg','sound/hallucinations/growl3.ogg'), 100, rand(0.95,1.05))
playsound(src,pick('sound/hallucinations/growl1.ogg','sound/hallucinations/growl2.ogg','sound/hallucinations/growl3.ogg'), 100, rand(0.95,1.05))
sleep(1)
sleep(10)
playsound(loc,'sound/hallucinations/wail.ogg',100,1)
playsound(src,'sound/hallucinations/wail.ogg', 100, TRUE)
/obj/machinery/clonepod/deconstruct(disassembled = TRUE)
if(occupant)

View File

@@ -1,4 +1,3 @@
#define AUTOCLONING_MINIMAL_LEVEL 3
/obj/machinery/computer/cloning
@@ -85,6 +84,7 @@
var/result = grow_clone_from_record(pod, R)
if(result & CLONING_SUCCESS)
temp = "[R.fields["name"]] => <font class='good'>Cloning cycle in progress...</font>"
log_cloning("Cloning of [R.fields["name"]] automatically started via autoprocess - [src] at [AREACOORD(src)]. Pod: [pod] at [AREACOORD(pod)].")
if(result & CLONING_DELETE_RECORD)
records -= R
@@ -400,6 +400,7 @@
else if (menu == 4)
log_cloning("[usr] deleted [active_record.fields["name"]]'s cloning records from [src] at [AREACOORD(src)].")
temp = "[active_record.fields["name"]] => Record deleted."
records.Remove(active_record)
active_record = null
@@ -432,6 +433,7 @@
if(include_se)
overwrite_field_if_available(active_record, diskette, "SE")
log_cloning("[usr] uploaded [active_record.fields["name"]]'s cloning records to [src] at [AREACOORD(src)] via [diskette].")
temp = "Load successful."
playsound(src, 'sound/machines/terminal_prompt_confirm.ogg', 50, 0)
@@ -447,6 +449,7 @@
playsound(src, 'sound/machines/terminal_prompt_deny.ogg', 50, 0)
return
log_cloning("[usr] added [active_record.fields["name"]]'s cloning records to [diskette] via [src] at [AREACOORD(src)].")
diskette.fields = active_record.fields.Copy()
diskette.name = "data disk - '[diskette.fields["name"]]'"
temp = "Save successful."
@@ -484,6 +487,7 @@
active_record = null
menu = 1
success = TRUE
log_cloning("[usr] initiated cloning of [C.fields["name"]] - [src] at [AREACOORD(src)]. Pod: [pod] at [AREACOORD(pod)].")
if(result & CLONING_DELETE_RECORD)
if(active_record == C)
active_record = null

View File

@@ -105,6 +105,7 @@ GLOBAL_VAR(restart_counter)
GLOB.world_game_log = "[GLOB.log_directory]/game.log"
GLOB.world_mecha_log = "[GLOB.log_directory]/mecha.log"
GLOB.world_virus_log = "[GLOB.log_directory]/virus.log"
GLOB.world_cloning_log = "[GLOB.log_directory]/cloning.log"
GLOB.world_asset_log = "[GLOB.log_directory]/asset.log"
GLOB.world_attack_log = "[GLOB.log_directory]/attack.log"
GLOB.world_pda_log = "[GLOB.log_directory]/pda.log"

View File

@@ -140,6 +140,9 @@ LOG_MANIFEST
## log virus and actions
LOG_VIRUS
## log cloning actions
LOG_CLONING
##Log camera pictures - Must have picture logging enabled
PICTURE_LOGGING_CAMERA