mirror of
https://github.com/Bubberstation/Bubberstation.git
synced 2026-08-21 20:20:33 +01:00
Overhaul mecha logging (revival of oranges's PR) (#40664)
* Overhaul mecha logging Removes user access to the log, not needed and that log can get large removes all the internal log vars and passes all logging through to a new log file, the mecha log * somehow this makes it compile * add it to the config too
This commit is contained in:
committed by
oranges
parent
0396c7f298
commit
6f26dfd1df
@@ -33,6 +33,7 @@
|
||||
#define LOG_GAME (1 << 12)
|
||||
#define LOG_ADMIN_PRIVATE (1 << 13)
|
||||
#define LOG_ASAY (1 << 14)
|
||||
#define LOG_MECHA (1 << 15)
|
||||
|
||||
//Individual logging panel pages
|
||||
#define INDIVIDUAL_ATTACK_LOG (LOG_ATTACK)
|
||||
|
||||
@@ -58,6 +58,10 @@
|
||||
if (CONFIG_GET(flag/log_game))
|
||||
WRITE_LOG(GLOB.world_game_log, "GAME: [text]")
|
||||
|
||||
/proc/log_mecha(text)
|
||||
if (CONFIG_GET(flag/log_mecha))
|
||||
WRITE_LOG(GLOB.world_mecha_log, "MECHA: [text]")
|
||||
|
||||
/proc/log_access(text)
|
||||
if (CONFIG_GET(flag/log_access))
|
||||
WRITE_LOG(GLOB.world_game_log, "ACCESS: [text]")
|
||||
|
||||
@@ -26,6 +26,8 @@ GLOBAL_VAR(query_debug_log)
|
||||
GLOBAL_PROTECT(query_debug_log)
|
||||
GLOBAL_VAR(world_job_debug_log)
|
||||
GLOBAL_PROTECT(world_job_debug_log)
|
||||
GLOBAL_VAR(world_mecha_log)
|
||||
GLOBAL_PROTECT(world_mecha_log)
|
||||
|
||||
GLOBAL_LIST_EMPTY(bombers)
|
||||
GLOBAL_PROTECT(bombers)
|
||||
|
||||
@@ -36,6 +36,8 @@
|
||||
|
||||
/datum/config_entry/flag/log_game // log game events
|
||||
|
||||
/datum/config_entry/flag/log_mecha // log mech data
|
||||
|
||||
/datum/config_entry/flag/log_vote // log voting
|
||||
|
||||
/datum/config_entry/flag/log_whisper // log client whisper
|
||||
|
||||
+3
-1
@@ -641,6 +641,8 @@
|
||||
log_game(log_text)
|
||||
if(LOG_GAME)
|
||||
log_game(log_text)
|
||||
if(LOG_MECHA)
|
||||
log_mecha(log_text)
|
||||
else
|
||||
stack_trace("Invalid individual logging type: [message_type]. Defaulting to [LOG_GAME] (LOG_GAME).")
|
||||
log_game(log_text)
|
||||
@@ -713,4 +715,4 @@ Proc for attack log creation, because really why not
|
||||
|
||||
/atom/movable/proc/get_filter(name)
|
||||
if(filter_data && filter_data[name])
|
||||
return filters[filter_data.Find(name)]
|
||||
return filters[filter_data.Find(name)]
|
||||
|
||||
@@ -36,14 +36,13 @@
|
||||
chassis.selected = null
|
||||
src.update_chassis_page()
|
||||
chassis.occupant_message("<span class='danger'>[src] is destroyed!</span>")
|
||||
chassis.log_append_to_last("[src] is destroyed.",1)
|
||||
log_message("[src] is destroyed.", LOG_MECHA)
|
||||
SEND_SOUND(chassis.occupant, sound(istype(src, /obj/item/mecha_parts/mecha_equipment/weapon) ? 'sound/mecha/weapdestr.ogg' : 'sound/mecha/critdestr.ogg', volume=50))
|
||||
chassis = null
|
||||
return ..()
|
||||
|
||||
/obj/item/mecha_parts/mecha_equipment/proc/critfail()
|
||||
if(chassis)
|
||||
log_message("Critical failure", color="red")
|
||||
log_message("Critical failure", LOG_MECHA, color="red")
|
||||
|
||||
/obj/item/mecha_parts/mecha_equipment/proc/get_equip_info()
|
||||
if(!chassis)
|
||||
@@ -113,10 +112,10 @@
|
||||
M.equipment += src
|
||||
chassis = M
|
||||
forceMove(M)
|
||||
M.log_message("[src] initialized.")
|
||||
log_message("[src] initialized.", LOG_MECHA)
|
||||
if(!M.selected && selectable)
|
||||
M.selected = src
|
||||
src.update_chassis_page()
|
||||
update_chassis_page()
|
||||
return
|
||||
|
||||
/obj/item/mecha_parts/mecha_equipment/proc/detach(atom/moveto=null)
|
||||
@@ -126,7 +125,7 @@
|
||||
if(chassis.selected == src)
|
||||
chassis.selected = null
|
||||
update_chassis_page()
|
||||
chassis.log_message("[src] removed from equipment.")
|
||||
log_message("[src] removed from equipment.", LOG_MECHA)
|
||||
chassis = null
|
||||
set_ready_state(1)
|
||||
return
|
||||
@@ -149,10 +148,9 @@
|
||||
|
||||
/obj/item/mecha_parts/mecha_equipment/log_message(message, message_type=LOG_GAME, color=null, log_globally)
|
||||
if(chassis)
|
||||
chassis.log_message("([src]) [message]", message_type, color)
|
||||
chassis.log_message("ATTACHMENT: [src] [message]", message_type, color)
|
||||
else
|
||||
..()
|
||||
return
|
||||
|
||||
|
||||
//Used for reloading weapons/tools etc. that use some form of resource
|
||||
|
||||
@@ -66,7 +66,7 @@
|
||||
update_equip_info()
|
||||
occupant_message("<span class='notice'>[target] successfully loaded into [src]. Life support functions engaged.</span>")
|
||||
chassis.visible_message("<span class='warning'>[chassis] loads [target] into [src].</span>")
|
||||
log_message("[target] loaded. Life support functions engaged.")
|
||||
log_message("[target] loaded. Life support functions engaged.", LOG_MECHA)
|
||||
|
||||
/obj/item/mecha_parts/mecha_equipment/medical/sleeper/proc/patient_insertion_check(mob/living/carbon/target)
|
||||
if(target.buckled)
|
||||
@@ -85,7 +85,7 @@
|
||||
return
|
||||
patient.forceMove(get_turf(src))
|
||||
occupant_message("[patient] ejected. Life support functions disabled.")
|
||||
log_message("[patient] ejected. Life support functions disabled.")
|
||||
log_message("[patient] ejected. Life support functions disabled.", LOG_MECHA)
|
||||
STOP_PROCESSING(SSobj, src)
|
||||
patient = null
|
||||
update_equip_info()
|
||||
@@ -193,7 +193,7 @@
|
||||
var/to_inject = min(R.volume, inject_amount)
|
||||
if(to_inject && patient.reagents.get_reagent_amount(R.id) + to_inject <= inject_amount*2)
|
||||
occupant_message("Injecting [patient] with [to_inject] units of [R.name].")
|
||||
log_message("Injecting [patient] with [to_inject] units of [R.name].")
|
||||
log_message("Injecting [patient] with [to_inject] units of [R.name].", LOG_MECHA)
|
||||
log_combat(chassis.occupant, patient, "injected", "[name] ([R] - [to_inject] units)")
|
||||
SG.reagents.trans_id_to(patient,R.id,to_inject)
|
||||
update_equip_info()
|
||||
@@ -216,7 +216,7 @@
|
||||
return
|
||||
if(!chassis.has_charge(energy_drain))
|
||||
set_ready_state(1)
|
||||
log_message("Deactivated.")
|
||||
log_message("Deactivated.", LOG_MECHA)
|
||||
occupant_message("[src] deactivated - no power.")
|
||||
STOP_PROCESSING(SSobj, src)
|
||||
return
|
||||
@@ -313,7 +313,7 @@
|
||||
mechsyringe.icon = 'icons/obj/chemical.dmi'
|
||||
mechsyringe.icon_state = "syringeproj"
|
||||
playsound(chassis, 'sound/items/syringeproj.ogg', 50, 1)
|
||||
log_message("Launched [mechsyringe] from [src], targeting [target].")
|
||||
log_message("Launched [mechsyringe] from [src], targeting [target].", LOG_MECHA)
|
||||
var/mob/originaloccupant = chassis.occupant
|
||||
spawn(0)
|
||||
src = null //if src is deleted, still process the syringe
|
||||
@@ -378,7 +378,7 @@
|
||||
START_PROCESSING(SSobj, src)
|
||||
occupant_message(message)
|
||||
occupant_message("Reagent processing started.")
|
||||
log_message("Reagent processing started.")
|
||||
log_message("Reagent processing started.", LOG_MECHA)
|
||||
return
|
||||
if(afilter.get("show_reagents"))
|
||||
chassis.occupant << browse(get_reagents_page(),"window=msyringegun")
|
||||
@@ -513,7 +513,7 @@
|
||||
return
|
||||
if(!processed_reagents.len || reagents.total_volume >= reagents.maximum_volume || !chassis.has_charge(energy_drain))
|
||||
occupant_message("<span class=\"alert\">Reagent processing stopped.</a>")
|
||||
log_message("Reagent processing stopped.")
|
||||
log_message("Reagent processing stopped.", LOG_MECHA)
|
||||
STOP_PROCESSING(SSobj, src)
|
||||
return
|
||||
var/amount = synth_speed / processed_reagents.len
|
||||
|
||||
@@ -35,7 +35,7 @@
|
||||
|
||||
if(do_after_cooldown(target))
|
||||
set_ready_state(FALSE)
|
||||
log_message("Started drilling [target]")
|
||||
log_message("Started drilling [target]", LOG_MECHA)
|
||||
if(isturf(target))
|
||||
var/turf/T = target
|
||||
T.drill_act(src)
|
||||
@@ -59,13 +59,13 @@
|
||||
|
||||
/turf/closed/wall/drill_act(obj/item/mecha_parts/mecha_equipment/drill/drill)
|
||||
if(drill.do_after_mecha(src, 60 / drill.drill_level))
|
||||
drill.log_message("Drilled through [src]")
|
||||
drill.log_message("Drilled through [src]", LOG_MECHA)
|
||||
dismantle_wall(TRUE, FALSE)
|
||||
|
||||
/turf/closed/wall/r_wall/drill_act(obj/item/mecha_parts/mecha_equipment/drill/drill)
|
||||
if(drill.drill_level >= DRILL_HARDENED)
|
||||
if(drill.do_after_mecha(src, 120 / drill.drill_level))
|
||||
drill.log_message("Drilled through [src]")
|
||||
drill.log_message("Drilled through [src]", LOG_MECHA)
|
||||
dismantle_wall(TRUE, FALSE)
|
||||
else
|
||||
drill.occupant_message("<span class='danger'>[src] is too durable to drill through.</span>")
|
||||
@@ -74,14 +74,14 @@
|
||||
for(var/turf/closed/mineral/M in range(drill.chassis,1))
|
||||
if(get_dir(drill.chassis,M)&drill.chassis.dir)
|
||||
M.gets_drilled()
|
||||
drill.log_message("Drilled through [src]")
|
||||
drill.log_message("Drilled through [src]", LOG_MECHA)
|
||||
drill.move_ores()
|
||||
|
||||
/turf/open/floor/plating/asteroid/drill_act(obj/item/mecha_parts/mecha_equipment/drill/drill)
|
||||
for(var/turf/open/floor/plating/asteroid/M in range(1, drill.chassis))
|
||||
if((get_dir(drill.chassis,M)&drill.chassis.dir) && !M.dug)
|
||||
M.getDug()
|
||||
drill.log_message("Drilled through [src]")
|
||||
drill.log_message("Drilled through [src]", LOG_MECHA)
|
||||
drill.move_ores()
|
||||
|
||||
|
||||
|
||||
@@ -216,12 +216,12 @@
|
||||
if(equip_ready)
|
||||
START_PROCESSING(SSobj, src)
|
||||
droid_overlay = new(src.icon, icon_state = "repair_droid_a")
|
||||
log_message("Activated.")
|
||||
log_message("Activated.", LOG_MECHA)
|
||||
set_ready_state(0)
|
||||
else
|
||||
STOP_PROCESSING(SSobj, src)
|
||||
droid_overlay = new(src.icon, icon_state = "repair_droid")
|
||||
log_message("Deactivated.")
|
||||
log_message("Deactivated.", LOG_MECHA)
|
||||
set_ready_state(1)
|
||||
chassis.add_overlay(droid_overlay)
|
||||
send_byjax(chassis.occupant,"exosuit.browser","[REF(src)]",src.get_equip_info())
|
||||
@@ -304,11 +304,11 @@
|
||||
if(equip_ready) //inactive
|
||||
START_PROCESSING(SSobj, src)
|
||||
set_ready_state(0)
|
||||
log_message("Activated.")
|
||||
log_message("Activated.", LOG_MECHA)
|
||||
else
|
||||
STOP_PROCESSING(SSobj, src)
|
||||
set_ready_state(1)
|
||||
log_message("Deactivated.")
|
||||
log_message("Deactivated.", LOG_MECHA)
|
||||
|
||||
/obj/item/mecha_parts/mecha_equipment/tesla_energy_relay/get_equip_info()
|
||||
if(!chassis)
|
||||
@@ -379,11 +379,11 @@
|
||||
if(equip_ready) //inactive
|
||||
set_ready_state(0)
|
||||
START_PROCESSING(SSobj, src)
|
||||
log_message("Activated.")
|
||||
log_message("Activated.", LOG_MECHA)
|
||||
else
|
||||
set_ready_state(1)
|
||||
STOP_PROCESSING(SSobj, src)
|
||||
log_message("Deactivated.")
|
||||
log_message("Deactivated.", LOG_MECHA)
|
||||
|
||||
/obj/item/mecha_parts/mecha_equipment/generator/get_equip_info()
|
||||
var/output = ..()
|
||||
@@ -441,14 +441,14 @@
|
||||
return
|
||||
if(fuel.amount<=0)
|
||||
STOP_PROCESSING(SSobj, src)
|
||||
log_message("Deactivated - no fuel.")
|
||||
log_message("Deactivated - no fuel.", LOG_MECHA)
|
||||
set_ready_state(1)
|
||||
return
|
||||
var/cur_charge = chassis.get_charge()
|
||||
if(isnull(cur_charge))
|
||||
set_ready_state(1)
|
||||
occupant_message("No powercell detected.")
|
||||
log_message("Deactivated.")
|
||||
log_message("Deactivated.", LOG_MECHA)
|
||||
STOP_PROCESSING(SSobj, src)
|
||||
return
|
||||
var/use_fuel = fuel_per_cycle_idle
|
||||
|
||||
@@ -43,7 +43,7 @@
|
||||
O.forceMove(chassis)
|
||||
O.anchored = FALSE
|
||||
occupant_message("<span class='notice'>[target] successfully loaded.</span>")
|
||||
log_message("Loaded [O]. Cargo compartment capacity: [cargo_holder.cargo_capacity - cargo_holder.cargo.len]")
|
||||
log_message("Loaded [O]. Cargo compartment capacity: [cargo_holder.cargo_capacity - cargo_holder.cargo.len]", LOG_MECHA)
|
||||
else
|
||||
O.anchored = initial(O.anchored)
|
||||
else
|
||||
@@ -103,7 +103,7 @@
|
||||
O.forceMove(chassis)
|
||||
O.anchored = FALSE
|
||||
occupant_message("<span class='notice'>[target] successfully loaded.</span>")
|
||||
log_message("Loaded [O]. Cargo compartment capacity: [cargo_holder.cargo_capacity - cargo_holder.cargo.len]")
|
||||
log_message("Loaded [O]. Cargo compartment capacity: [cargo_holder.cargo_capacity - cargo_holder.cargo.len]", LOG_MECHA)
|
||||
else
|
||||
O.anchored = initial(O.anchored)
|
||||
else
|
||||
@@ -386,7 +386,7 @@
|
||||
if(href_list["toggle"])
|
||||
set_ready_state(!equip_ready)
|
||||
occupant_message("[src] [equip_ready?"dea":"a"]ctivated.")
|
||||
log_message("[equip_ready?"Dea":"A"]ctivated.")
|
||||
log_message("[equip_ready?"Dea":"A"]ctivated.", LOG_MECHA)
|
||||
return
|
||||
if(href_list["cut"])
|
||||
if(cable && cable.amount)
|
||||
@@ -409,7 +409,7 @@
|
||||
if(!cable || cable.amount<1)
|
||||
set_ready_state(1)
|
||||
occupant_message("Cable depleted, [src] deactivated.")
|
||||
log_message("Cable depleted, [src] deactivated.")
|
||||
log_message("Cable depleted, [src] deactivated.", LOG_MECHA)
|
||||
return
|
||||
if(cable.amount < amount)
|
||||
occupant_message("No enough cable to finish the task.")
|
||||
|
||||
@@ -53,7 +53,7 @@
|
||||
|
||||
if(kickback)
|
||||
chassis.newtonian_move(turn(chassis.dir,180))
|
||||
chassis.log_message("Fired from [src.name], targeting [target].")
|
||||
chassis.log_message("Fired from [src.name], targeting [target].", LOG_MECHA)
|
||||
return 1
|
||||
|
||||
|
||||
@@ -184,7 +184,7 @@
|
||||
else
|
||||
M.Jitter(500)
|
||||
|
||||
log_message("Honked from [src.name]. HONK!")
|
||||
log_message("Honked from [src.name]. HONK!", LOG_MECHA)
|
||||
var/turf/T = get_turf(src)
|
||||
message_admins("[ADMIN_LOOKUPFLW(chassis.occupant)] used a Mecha Honker in [ADMIN_VERBOSEJMP(T)]")
|
||||
log_game("[key_name(chassis.occupant)] used a Mecha Honker in [AREACOORD(T)]")
|
||||
@@ -220,7 +220,7 @@
|
||||
projectiles_to_add--
|
||||
chassis.use_power(projectile_energy_cost)
|
||||
send_byjax(chassis.occupant,"exosuit.browser","[REF(src)]",src.get_equip_info())
|
||||
log_message("Rearmed [src.name].")
|
||||
log_message("Rearmed [src.name].", LOG_MECHA)
|
||||
return 1
|
||||
|
||||
|
||||
@@ -311,7 +311,7 @@
|
||||
return
|
||||
var/obj/O = new projectile(chassis.loc)
|
||||
playsound(chassis, fire_sound, 50, 1)
|
||||
log_message("Launched a [O.name] from [name], targeting [target].")
|
||||
log_message("Launched a [O.name] from [name], targeting [target].", LOG_MECHA)
|
||||
projectiles--
|
||||
proj_init(O)
|
||||
O.throw_at(target, missile_range, missile_speed, chassis.occupant, FALSE, diagonals_first = diags_first)
|
||||
|
||||
+12
-23
@@ -38,7 +38,6 @@
|
||||
var/list/facing_modifiers = list(FRONT_ARMOUR = 1.5, SIDE_ARMOUR = 1, BACK_ARMOUR = 0.5)
|
||||
var/obj/item/stock_parts/cell/cell
|
||||
var/state = 0
|
||||
var/list/log = new
|
||||
var/last_message = 0
|
||||
var/add_req_access = 1
|
||||
var/maint_access = 0
|
||||
@@ -135,7 +134,7 @@
|
||||
add_cell()
|
||||
START_PROCESSING(SSobj, src)
|
||||
GLOB.poi_list |= src
|
||||
log_message("[src.name] created.")
|
||||
log_message("[src.name] created.", LOG_MECHA)
|
||||
GLOB.mechas_list += src //global mech list
|
||||
prepare_huds()
|
||||
for(var/datum/atom_hud/data/diagnostic/diag_hud in GLOB.huds)
|
||||
@@ -482,7 +481,7 @@
|
||||
events.fireEvent("onMove",get_turf(src))
|
||||
if (internal_tank.disconnect()) // Something moved us and broke connection
|
||||
occupant_message("<span class='warning'>Air port connection teared off!</span>")
|
||||
log_message("Lost connection to gas port.")
|
||||
log_message("Lost connection to gas port.", LOG_MECHA)
|
||||
|
||||
/obj/mecha/Process_Spacemove(var/movement_dir = 0)
|
||||
. = ..()
|
||||
@@ -626,7 +625,7 @@
|
||||
|
||||
/obj/mecha/proc/setInternalDamage(int_dam_flag)
|
||||
internal_damage |= int_dam_flag
|
||||
log_append_to_last("Internal damage of type [int_dam_flag].",1)
|
||||
log_message("Internal damage of type [int_dam_flag].", LOG_MECHA)
|
||||
SEND_SOUND(occupant, sound('sound/machines/warning-buzzer.ogg',wait=0))
|
||||
diag_hud_set_mechstat()
|
||||
return
|
||||
@@ -809,10 +808,10 @@
|
||||
return
|
||||
if(!ishuman(user)) // no silicons or drones in mechas.
|
||||
return
|
||||
log_message("[user] tries to move in.")
|
||||
log_message("[user] tries to move in.", LOG_MECHA)
|
||||
if (occupant)
|
||||
to_chat(usr, "<span class='warning'>The [name] is already occupied!</span>")
|
||||
log_append_to_last("Permission denied.")
|
||||
log_message("Permission denied (Occupied).", LOG_MECHA)
|
||||
return
|
||||
if(dna_lock)
|
||||
var/passed = FALSE
|
||||
@@ -822,18 +821,19 @@
|
||||
passed = TRUE
|
||||
if (!passed)
|
||||
to_chat(user, "<span class='warning'>Access denied. [name] is secured with a DNA lock.</span>")
|
||||
log_append_to_last("Permission denied.")
|
||||
log_message("Permission denied (DNA LOCK).", LOG_MECHA)
|
||||
return
|
||||
if(!operation_allowed(user))
|
||||
to_chat(user, "<span class='warning'>Access denied. Insufficient operation keycodes.</span>")
|
||||
log_append_to_last("Permission denied.")
|
||||
log_message("Permission denied (No keycode).", LOG_MECHA)
|
||||
return
|
||||
if(user.buckled)
|
||||
to_chat(user, "<span class='warning'>You are currently buckled and cannot move.</span>")
|
||||
log_append_to_last("Permission denied.")
|
||||
log_message("Permission denied (Buckled).", LOG_MECHA)
|
||||
return
|
||||
if(user.has_buckled_mobs()) //mob attached to us
|
||||
to_chat(user, "<span class='warning'>You can't enter the exosuit with other creatures attached to you!</span>")
|
||||
log_message("Permission denied (Attached mobs).", LOG_MECHA)
|
||||
return
|
||||
|
||||
visible_message("[user] starts to climb into [name].")
|
||||
@@ -861,7 +861,7 @@
|
||||
add_fingerprint(H)
|
||||
GrantActions(H, human_occupant=1)
|
||||
forceMove(loc)
|
||||
log_append_to_last("[H] moved in as pilot.")
|
||||
log_message("[H] moved in as pilot.", LOG_MECHA)
|
||||
icon_state = initial(icon_state)
|
||||
setDir(dir_in)
|
||||
playsound(src, 'sound/machines/windowdoor.ogg', 50, 1)
|
||||
@@ -919,7 +919,7 @@
|
||||
icon_state = initial(icon_state)
|
||||
update_icon()
|
||||
setDir(dir_in)
|
||||
log_message("[mmi_as_oc] moved in as pilot.")
|
||||
log_message("[mmi_as_oc] moved in as pilot.", LOG_MECHA)
|
||||
if(!internal_damage)
|
||||
SEND_SOUND(occupant, sound('sound/mecha/nominal.ogg',volume=50))
|
||||
GrantActions(brainmob)
|
||||
@@ -970,7 +970,7 @@
|
||||
var/mob/living/L = occupant
|
||||
occupant = null //we need it null when forceMove calls Exited().
|
||||
if(mob_container.forceMove(newloc))//ejecting mob container
|
||||
log_message("[mob_container] moved out.")
|
||||
log_message("[mob_container] moved out.", LOG_MECHA)
|
||||
L << browse(null, "window=exosuit")
|
||||
|
||||
if(istype(mob_container, /obj/item/mmi))
|
||||
@@ -1015,17 +1015,6 @@
|
||||
to_chat(occupant, "[icon2html(src, occupant)] [message]")
|
||||
return
|
||||
|
||||
/obj/mecha/log_message(message as text, message_type=LOG_GAME, color=null, log_globally)
|
||||
log.len++
|
||||
log[log.len] = list("time"="[station_time_timestamp()]","date","year"="[GLOB.year_integer+540]","message"="[color?"<font color='[color]'>":null][message][color?"</font>":null]")
|
||||
..()
|
||||
return log.len
|
||||
|
||||
/obj/mecha/proc/log_append_to_last(message as text,red=null)
|
||||
var/list/last_entry = log[log.len]
|
||||
last_entry["message"] += "<br>[red?"<font color='red'>":null][message][red?"</font>":null]"
|
||||
return
|
||||
|
||||
GLOBAL_VAR_INIT(year, time2text(world.realtime,"YYYY"))
|
||||
GLOBAL_VAR_INIT(year_integer, text2num(year)) // = 2013???
|
||||
|
||||
|
||||
@@ -56,7 +56,7 @@
|
||||
chassis.use_internal_tank = !chassis.use_internal_tank
|
||||
button_icon_state = "mech_internals_[chassis.use_internal_tank ? "on" : "off"]"
|
||||
chassis.occupant_message("Now taking air from [chassis.use_internal_tank?"internal airtank":"environment"].")
|
||||
chassis.log_message("Now taking air from [chassis.use_internal_tank?"internal airtank":"environment"].")
|
||||
chassis.log_message("Now taking air from [chassis.use_internal_tank?"internal airtank":"environment"].", LOG_MECHA)
|
||||
UpdateButtonIcon()
|
||||
|
||||
/datum/action/innate/mecha/mech_cycle_equip
|
||||
@@ -114,7 +114,7 @@
|
||||
chassis.set_light(-chassis.lights_power)
|
||||
button_icon_state = "mech_lights_off"
|
||||
chassis.occupant_message("Toggled lights [chassis.lights?"on":"off"].")
|
||||
chassis.log_message("Toggled lights [chassis.lights?"on":"off"].")
|
||||
chassis.log_message("Toggled lights [chassis.lights?"on":"off"].", LOG_MECHA)
|
||||
UpdateButtonIcon()
|
||||
|
||||
/datum/action/innate/mecha/mech_view_stats
|
||||
@@ -145,7 +145,7 @@
|
||||
strafe = !strafe
|
||||
|
||||
occupant_message("Toggled strafing mode [strafe?"on":"off"].")
|
||||
log_message("Toggled strafing mode [strafe?"on":"off"].")
|
||||
log_message("Toggled strafing mode [strafe?"on":"off"].", LOG_MECHA)
|
||||
strafing_action.UpdateButtonIcon()
|
||||
|
||||
//////////////////////////////////////// Specific Ability Actions ///////////////////////////////////////////////
|
||||
@@ -161,7 +161,7 @@
|
||||
if(chassis.get_charge() > 0)
|
||||
chassis.thrusters_active = !chassis.thrusters_active
|
||||
button_icon_state = "mech_thrusters_[chassis.thrusters_active ? "on" : "off"]"
|
||||
chassis.log_message("Toggled thrusters.")
|
||||
chassis.log_message("Toggled thrusters.", LOG_MECHA)
|
||||
chassis.occupant_message("<font color='[chassis.thrusters_active ?"blue":"red"]'>Thrusters [chassis.thrusters_active ?"en":"dis"]abled.")
|
||||
|
||||
|
||||
@@ -183,7 +183,7 @@
|
||||
else
|
||||
chassis.deflect_chance = initial(chassis.deflect_chance)
|
||||
chassis.occupant_message("<span class='danger'>You disable [chassis] defence mode.</span>")
|
||||
chassis.log_message("Toggled defence mode.")
|
||||
chassis.log_message("Toggled defence mode.", LOG_MECHA)
|
||||
UpdateButtonIcon()
|
||||
|
||||
/datum/action/innate/mecha/mech_overload_mode
|
||||
@@ -198,7 +198,7 @@
|
||||
else
|
||||
chassis.leg_overload_mode = !chassis.leg_overload_mode
|
||||
button_icon_state = "mech_overload_[chassis.leg_overload_mode ? "on" : "off"]"
|
||||
chassis.log_message("Toggled leg actuators overload.")
|
||||
chassis.log_message("Toggled leg actuators overload.", LOG_MECHA)
|
||||
if(chassis.leg_overload_mode)
|
||||
chassis.leg_overload_mode = 1
|
||||
chassis.bumpsmash = 1
|
||||
@@ -238,7 +238,7 @@
|
||||
if(owner.client)
|
||||
chassis.zoom_mode = !chassis.zoom_mode
|
||||
button_icon_state = "mech_zoom_[chassis.zoom_mode ? "on" : "off"]"
|
||||
chassis.log_message("Toggled zoom mode.")
|
||||
chassis.log_message("Toggled zoom mode.", LOG_MECHA)
|
||||
chassis.occupant_message("<font color='[chassis.zoom_mode?"blue":"red"]'>Zoom mode [chassis.zoom_mode?"en":"dis"]abled.</font>")
|
||||
if(chassis.zoom_mode)
|
||||
owner.client.change_view(12)
|
||||
|
||||
@@ -22,12 +22,11 @@
|
||||
if(answer)
|
||||
dat += {"<hr>[answer]<br/>
|
||||
<a href='?src=[REF(src)];send_message=[REF(TR)]'>Send message</a><br/>
|
||||
<a href='?src=[REF(src)];get_log=[REF(TR)]'>Show exosuit log</a> | <a style='color: #f00;' href='?src=[REF(src)];shock=[REF(TR)]'>(EMP pulse)</a><br>"}
|
||||
|
||||
if(screen==1)
|
||||
dat += "<h3>Log contents</h3>"
|
||||
dat += "<a href='?src=[REF(src)];return=1'>Return</a><hr>"
|
||||
dat += "[stored_data]"
|
||||
dat += {"<h3>Log contents</h3>"
|
||||
<a href='?src=[REF(src)];return=1'>Return</a><hr>"
|
||||
[stored_data]"}
|
||||
|
||||
dat += "<A href='?src=[REF(src)];refresh=1'>(Refresh)</A><BR>"
|
||||
dat += "</body></html>"
|
||||
@@ -49,10 +48,6 @@
|
||||
if(href_list["shock"])
|
||||
var/obj/item/mecha_parts/mecha_tracking/MT = afilter.getObj("shock")
|
||||
MT.shock()
|
||||
if(href_list["get_log"])
|
||||
var/obj/item/mecha_parts/mecha_tracking/MT = afilter.getObj("get_log")
|
||||
stored_data = MT.get_mecha_log()
|
||||
screen = 1
|
||||
if(href_list["return"])
|
||||
screen = 0
|
||||
updateUsrDialog()
|
||||
@@ -107,13 +102,6 @@
|
||||
M.emp_act(EMP_LIGHT)
|
||||
qdel(src)
|
||||
|
||||
/obj/item/mecha_parts/mecha_tracking/proc/get_mecha_log()
|
||||
if(!ismecha(loc))
|
||||
return 0
|
||||
var/obj/mecha/M = src.loc
|
||||
return M.get_log_html()
|
||||
|
||||
|
||||
/obj/item/mecha_parts/mecha_tracking/ai_control
|
||||
name = "exosuit AI control beacon"
|
||||
desc = "A device used to transmit exosuit data. Also allows active AI units to take control of said exosuit."
|
||||
|
||||
@@ -21,7 +21,7 @@
|
||||
check_for_internal_damage(list(MECHA_INT_FIRE,MECHA_INT_TEMP_CONTROL,MECHA_INT_TANK_BREACH,MECHA_INT_CONTROL_LOST,MECHA_INT_SHORT_CIRCUIT))
|
||||
if(. >= 5 || prob(33))
|
||||
occupant_message("<span class='userdanger'>Taking damage!</span>")
|
||||
log_append_to_last("Took [damage_amount] points of damage. Damage type: \"[damage_type]\".",1)
|
||||
log_message("Took [damage_amount] points of damage. Damage type: [damage_type]", LOG_MECHA)
|
||||
|
||||
/obj/mecha/run_obj_armor(damage_amount, damage_type, damage_flag = 0, attack_dir)
|
||||
. = ..()
|
||||
@@ -48,7 +48,7 @@
|
||||
booster_deflection_modifier *= facing_modifier
|
||||
if(prob(deflect_chance * booster_deflection_modifier))
|
||||
visible_message("<span class='danger'>[src]'s armour deflects the attack!</span>")
|
||||
log_append_to_last("Armor saved.")
|
||||
log_message("Armor saved.", LOG_MECHA)
|
||||
return 0
|
||||
if(.)
|
||||
. *= booster_damage_modifier
|
||||
@@ -62,20 +62,19 @@
|
||||
user.do_attack_animation(src, ATTACK_EFFECT_PUNCH)
|
||||
playsound(loc, 'sound/weapons/tap.ogg', 40, 1, -1)
|
||||
user.visible_message("<span class='danger'>[user] hits [name]. Nothing happens</span>", null, null, COMBAT_MESSAGE_RANGE)
|
||||
log_message("Attack by hand/paw. Attacker - [user].", color="red")
|
||||
log_append_to_last("Armor saved.")
|
||||
log_message("Attack by hand/paw. Attacker - [user].", LOG_MECHA, color="red")
|
||||
|
||||
/obj/mecha/attack_paw(mob/user as mob)
|
||||
return attack_hand(user)
|
||||
|
||||
|
||||
/obj/mecha/attack_alien(mob/living/user)
|
||||
log_message("Attack by alien. Attacker - [user].", color="red")
|
||||
log_message("Attack by alien. Attacker - [user].", LOG_MECHA, color="red")
|
||||
playsound(src.loc, 'sound/weapons/slash.ogg', 100, 1)
|
||||
attack_generic(user, 15, BRUTE, "melee", 0)
|
||||
|
||||
/obj/mecha/attack_animal(mob/living/simple_animal/user)
|
||||
log_message("Attack by simple animal. Attacker - [user].", color="red")
|
||||
log_message("Attack by simple animal. Attacker - [user].", LOG_MECHA, color="red")
|
||||
if(!user.melee_damage_upper && !user.obj_damage)
|
||||
user.emote("custom", message = "[user.friendly] [src].")
|
||||
return 0
|
||||
@@ -99,7 +98,7 @@
|
||||
/obj/mecha/attack_hulk(mob/living/carbon/human/user)
|
||||
. = ..()
|
||||
if(.)
|
||||
log_message("Attack by hulk. Attacker - [user].", color="red")
|
||||
log_message("Attack by hulk. Attacker - [user].", LOG_MECHA, color="red")
|
||||
log_combat(user, src, "punched", "hulk powers")
|
||||
|
||||
/obj/mecha/blob_act(obj/structure/blob/B)
|
||||
@@ -109,19 +108,19 @@
|
||||
return
|
||||
|
||||
/obj/mecha/hitby(atom/movable/A as mob|obj) //wrapper
|
||||
log_message("Hit by [A].", color="red")
|
||||
log_message("Hit by [A].", LOG_MECHA, color="red")
|
||||
. = ..()
|
||||
|
||||
|
||||
/obj/mecha/bullet_act(obj/item/projectile/Proj) //wrapper
|
||||
log_message("Hit by projectile. Type: [Proj.name]([Proj.flag]).", color="red")
|
||||
log_message("Hit by projectile. Type: [Proj.name]([Proj.flag]).", LOG_MECHA, color="red")
|
||||
. = ..()
|
||||
|
||||
/obj/mecha/ex_act(severity, target)
|
||||
log_message("Affected by explosion of severity: [severity].", color="red")
|
||||
log_message("Affected by explosion of severity: [severity].", LOG_MECHA, color="red")
|
||||
if(prob(deflect_chance))
|
||||
severity++
|
||||
log_append_to_last("Armor saved, changing severity to [severity].")
|
||||
log_message("Armor saved, changing severity to [severity]", LOG_MECHA)
|
||||
. = ..()
|
||||
|
||||
/obj/mecha/contents_explosion(severity, target)
|
||||
@@ -148,12 +147,12 @@
|
||||
if(get_charge())
|
||||
use_power((cell.charge/3)/(severity*2))
|
||||
take_damage(30 / severity, BURN, "energy", 1)
|
||||
log_message("EMP detected", color="red")
|
||||
log_message("EMP detected", LOG_MECHA, color="red")
|
||||
check_for_internal_damage(list(MECHA_INT_FIRE,MECHA_INT_TEMP_CONTROL,MECHA_INT_CONTROL_LOST,MECHA_INT_SHORT_CIRCUIT),1)
|
||||
|
||||
/obj/mecha/temperature_expose(datum/gas_mixture/air, exposed_temperature, exposed_volume)
|
||||
if(exposed_temperature>max_temperature)
|
||||
log_message("Exposed to dangerous temperature.", color="red")
|
||||
log_message("Exposed to dangerous temperature.", LOG_MECHA, color="red")
|
||||
take_damage(5, BURN, 0, 1)
|
||||
|
||||
/obj/mecha/attackby(obj/item/W as obj, mob/user as mob, params)
|
||||
@@ -225,7 +224,7 @@
|
||||
cell = null
|
||||
state = 4
|
||||
to_chat(user, "<span class='notice'>You unscrew and pry out the powercell.</span>")
|
||||
log_message("Powercell removed")
|
||||
log_message("Powercell removed", LOG_MECHA)
|
||||
else if(state==4 && cell)
|
||||
state=3
|
||||
to_chat(user, "<span class='notice'>You screw the cell in place.</span>")
|
||||
@@ -239,7 +238,7 @@
|
||||
var/obj/item/stock_parts/cell/C = W
|
||||
to_chat(user, "<span class='notice'>You install the powercell.</span>")
|
||||
cell = C
|
||||
log_message("Powercell installed")
|
||||
log_message("Powercell installed", LOG_MECHA)
|
||||
else
|
||||
to_chat(user, "<span class='notice'>There's already a powercell installed.</span>")
|
||||
return
|
||||
@@ -273,7 +272,7 @@
|
||||
return ..()
|
||||
|
||||
/obj/mecha/attacked_by(obj/item/I, mob/living/user)
|
||||
log_message("Attacked by [I]. Attacker - [user]")
|
||||
log_message("Attacked by [I]. Attacker - [user]", LOG_MECHA)
|
||||
..()
|
||||
|
||||
/obj/mecha/proc/mech_toxin_damage(mob/living/target)
|
||||
|
||||
@@ -117,7 +117,6 @@
|
||||
<a href='?src=[REF(src)];toggle_maint_access=1'><span id='t_maint_access'>[maint_access?"Forbid":"Permit"] maintenance protocols</span></a><br>
|
||||
<a href='?src=[REF(src)];toggle_port_connection=1'><span id='t_port_connection'>[internal_tank.connected_port?"Disconnect from":"Connect to"] gas port</span></a><br>
|
||||
<a href='?src=[REF(src)];dna_lock=1'>DNA-lock</a><br>
|
||||
<a href='?src=[REF(src)];view_log=1'>View internal log</a><br>
|
||||
<a href='?src=[REF(src)];change_name=1'>Change exosuit name</a><br>
|
||||
</div>
|
||||
</div>
|
||||
@@ -148,15 +147,6 @@
|
||||
|
||||
|
||||
|
||||
/obj/mecha/proc/get_log_html()
|
||||
. = "<html><head><title>[src.name] Log</title></head><body style='font: 13px 'Courier', monospace;'>"
|
||||
for(var/list/entry in log)
|
||||
. += {"<div style='font-weight: bold;'>[entry["time"]] [time2text(entry["date"],"MMM DD")] [entry["year"]]</div>
|
||||
<div style='margin-left:15px; margin-bottom:10px;'>[entry["message"]]</div>
|
||||
"}
|
||||
. += "</body></html>"
|
||||
|
||||
|
||||
|
||||
/obj/mecha/proc/output_access_dialog(obj/item/card/id/id_card, mob/user)
|
||||
if(!id_card || !user)
|
||||
@@ -289,10 +279,6 @@
|
||||
radio.set_frequency(new_frequency)
|
||||
send_byjax(src.occupant,"exosuit.browser","rfreq","[format_frequency(radio.frequency)]")
|
||||
|
||||
if (href_list["view_log"])
|
||||
src.occupant << browse(src.get_log_html(), "window=exosuit_log")
|
||||
onclose(occupant, "exosuit_log")
|
||||
|
||||
if (href_list["change_name"])
|
||||
var/newname = stripped_input(occupant,"Choose new exosuit name","Rename exosuit","", MAX_NAME_LEN)
|
||||
if(newname && trim(newname))
|
||||
@@ -315,7 +301,7 @@
|
||||
if(internal_tank.connected_port)
|
||||
if(internal_tank.disconnect())
|
||||
occupant_message("Disconnected from the air system port.")
|
||||
log_message("Disconnected from gas port.")
|
||||
log_message("Disconnected from gas port.", LOG_MECHA)
|
||||
else
|
||||
occupant_message("<span class='warning'>Unable to disconnect from the air system port!</span>")
|
||||
return
|
||||
@@ -323,7 +309,7 @@
|
||||
var/obj/machinery/atmospherics/components/unary/portables_connector/possible_port = locate() in loc
|
||||
if(internal_tank.connect(possible_port))
|
||||
occupant_message("Connected to the air system port.")
|
||||
log_message("Connected to gas port.")
|
||||
log_message("Connected to gas port.", LOG_MECHA)
|
||||
else
|
||||
occupant_message("<span class='warning'>Unable to connect with air system port!</span>")
|
||||
return
|
||||
@@ -341,14 +327,14 @@
|
||||
|
||||
if(href_list["repair_int_control_lost"])
|
||||
occupant_message("Recalibrating coordination system...")
|
||||
log_message("Recalibration of coordination system started.")
|
||||
log_message("Recalibration of coordination system started.", LOG_MECHA)
|
||||
var/T = loc
|
||||
spawn(100)
|
||||
if(T == loc)
|
||||
clearInternalDamage(MECHA_INT_CONTROL_LOST)
|
||||
occupant_message("<span class='notice'>Recalibration successful.</span>")
|
||||
log_message("Recalibration of coordination system finished with 0 errors.")
|
||||
log_message("Recalibration of coordination system finished with 0 errors.", LOG_MECHA)
|
||||
else
|
||||
occupant_message("<span class='warning'>Recalibration failed!</span>")
|
||||
log_message("Recalibration of coordination system failed with 1 error.", color="red")
|
||||
log_message("Recalibration of coordination system failed with 1 error.", LOG_MECHA, color="red")
|
||||
|
||||
|
||||
@@ -147,7 +147,7 @@
|
||||
occupant_message("<span class='notice'>You unload [O].</span>")
|
||||
O.forceMove(drop_location())
|
||||
cargo -= O
|
||||
log_message("Unloaded [O]. Cargo compartment capacity: [cargo_capacity - src.cargo.len]")
|
||||
log_message("Unloaded [O]. Cargo compartment capacity: [cargo_capacity - src.cargo.len]", LOG_MECHA)
|
||||
return
|
||||
|
||||
|
||||
|
||||
@@ -97,6 +97,7 @@ GLOBAL_VAR(restart_counter)
|
||||
GLOB.picture_log_directory = "data/picture_logs/[override_dir]"
|
||||
|
||||
GLOB.world_game_log = "[GLOB.log_directory]/game.log"
|
||||
GLOB.world_mecha_log = "[GLOB.log_directory]/mecha.log"
|
||||
GLOB.world_attack_log = "[GLOB.log_directory]/attack.log"
|
||||
GLOB.world_pda_log = "[GLOB.log_directory]/pda.log"
|
||||
GLOB.world_telecomms_log = "[GLOB.log_directory]/telecomms.log"
|
||||
|
||||
@@ -134,6 +134,9 @@ LOG_MANIFEST
|
||||
## Enable logging pictures
|
||||
# LOG_PICTURES
|
||||
|
||||
## log mecha actions
|
||||
# LOG_MECHA
|
||||
|
||||
##Log camera pictures - Must have picture logging enabled
|
||||
PICTURE_LOGGING_CAMERA
|
||||
|
||||
|
||||
Reference in New Issue
Block a user