From 8ff32f45666331cea764a4ab1af3a7c144b2f77a Mon Sep 17 00:00:00 2001 From: Fox-McCloud Date: Mon, 18 Apr 2016 22:53:31 -0400 Subject: [PATCH] fixes --- code/game/gamemodes/game_mode.dm | 26 +++++++++++++++++++ .../miniantags/abduction/abduction.dm | 17 +++++++++--- .../miniantags/abduction/abduction_gear.dm | 4 +-- .../machinery/computer/camera_advanced.dm | 16 +++++++++--- code/game/objects/objs.dm | 8 +++++- code/modules/events/abductor.dm | 3 +++ code/modules/events/event.dm | 4 +++ interface/stylesheet.dm | 1 + 8 files changed, 69 insertions(+), 10 deletions(-) diff --git a/code/game/gamemodes/game_mode.dm b/code/game/gamemodes/game_mode.dm index fc69cd8a79e..4001eba338b 100644 --- a/code/game/gamemodes/game_mode.dm +++ b/code/game/gamemodes/game_mode.dm @@ -448,3 +448,29 @@ proc/get_nt_opposed() else message_admins("[M] ([M.key] has been converted into [role_type] with an active antagonist jobban for said role since no ghost has volunteered to take their place.") to_chat(M, "You have been converted into [role_type] with an active jobban. Any further violations of the rules on your part are likely to result in a permanent ban.") + +/datum/game_mode/proc/printplayer(datum/mind/ply, fleecheck) + var/text = "
[ply.key] was [ply.name] the [ply.assigned_role] and" + if(ply.current) + if(ply.current.stat == DEAD) + text += " died" + else + text += " survived" + if(fleecheck && ply.current.z > ZLEVEL_STATION) + text += " while fleeing the station" + if(ply.current.real_name != ply.name) + text += " as [ply.current.real_name]" + else + text += " had their body destroyed" + return text + +/datum/game_mode/proc/printobjectives(datum/mind/ply) + var/text = "" + var/count = 1 + for(var/datum/objective/objective in ply.objectives) + if(objective.check_completion()) + text += "
Objective #[count]: [objective.explanation_text] Success!" + else + text += "
Objective #[count]: [objective.explanation_text] Fail." + count++ + return text \ No newline at end of file diff --git a/code/game/gamemodes/miniantags/abduction/abduction.dm b/code/game/gamemodes/miniantags/abduction/abduction.dm index d1b16c6b8c1..7416d3a2b49 100644 --- a/code/game/gamemodes/miniantags/abduction/abduction.dm +++ b/code/game/gamemodes/miniantags/abduction/abduction.dm @@ -286,11 +286,20 @@ return 1 /datum/game_mode/proc/auto_declare_completion_abduction() + var/text = "" if(abductors.len) - to_chat(world, "Abductors:") - for(var/datum/mind/M in abductors) - to_chat(world, "Abductor [M.current ? M.current.name : "Abductor"]([M.key])") - return + text += "
The abductors were:" + for(var/datum/mind/abductor_mind in abductors) + text += printplayer(abductor_mind) + text += printobjectives(abductor_mind) + text += "
" + if(abductees.len) + text += "
The abductees were:" + for(var/datum/mind/abductee_mind in abductees) + text += printplayer(abductee_mind) + text += printobjectives(abductee_mind) + text += "
" + to_chat(world, text) //Landmarks // TODO: Split into seperate landmarks for prettier ships diff --git a/code/game/gamemodes/miniantags/abduction/abduction_gear.dm b/code/game/gamemodes/miniantags/abduction/abduction_gear.dm index d2614ecaa08..b102ae8d908 100644 --- a/code/game/gamemodes/miniantags/abduction/abduction_gear.dm +++ b/code/game/gamemodes/miniantags/abduction/abduction_gear.dm @@ -135,7 +135,7 @@ desc = "A dual-mode tool for retrieving specimens and scanning appearances. Scanning can be done through cameras." icon = 'icons/obj/abductor.dmi' icon_state = "gizmo_scan" - item_state = "silencer" + item_state = "gizmo" origin_tech = "materials=5;magnets=5;bluespace=6;abductor=4" var/mode = GIZMO_SCAN var/mob/living/marked = null @@ -216,7 +216,7 @@ desc = "A compact device used to shut down communications equipment." icon = 'icons/obj/abductor.dmi' icon_state = "silencer" - item_state = "gizmo" + item_state = "silencer" origin_tech = "materials=5;magnets=5;abductor=3" /obj/item/device/abductor/silencer/attack(mob/living/M, mob/user) diff --git a/code/game/machinery/computer/camera_advanced.dm b/code/game/machinery/computer/camera_advanced.dm index cd87fc1f5a7..16242f5a58e 100644 --- a/code/game/machinery/computer/camera_advanced.dm +++ b/code/game/machinery/computer/camera_advanced.dm @@ -20,12 +20,22 @@ jump_action.Grant(user) /obj/machinery/computer/camera_advanced/check_eye(mob/user) - if (get_dist(user, src) > 1 || user.eye_blind) - if(user == current_user) - off_action.Activate() + if((stat & (NOPOWER|BROKEN)) || !Adjacent(user) || user.eye_blind || user.incapacitated()) + user.unset_machine() return 0 return 1 +/obj/machinery/computer/camera_advanced/Destroy() + if(current_user) + current_user.unset_machine() + if(eyeobj) + qdel(eyeobj) + return ..() + +/obj/machinery/computer/camera_advanced/on_unset_machine(mob/M) + if(M == current_user) + off_action.Activate() + /obj/machinery/computer/camera_advanced/attack_hand(mob/user) if(..()) return diff --git a/code/game/objects/objs.dm b/code/game/objects/objs.dm index 8f40f7a9848..cf72da26b0b 100644 --- a/code/game/objects/objs.dm +++ b/code/game/objects/objs.dm @@ -129,7 +129,13 @@ return /mob/proc/unset_machine() - src.machine = null + if(machine) + machine.on_unset_machine(src) + machine = null + +//called when the user unsets the machine. +/atom/movable/proc/on_unset_machine(mob/user) + return /mob/proc/set_machine(var/obj/O) if(src.machine) diff --git a/code/modules/events/abductor.dm b/code/modules/events/abductor.dm index 988da3f86b6..18d75f3ef30 100644 --- a/code/modules/events/abductor.dm +++ b/code/modules/events/abductor.dm @@ -1,6 +1,8 @@ /datum/event/abductor /datum/event/abductor/start() + //spawn abductor team + processing = 0 //so it won't fire again in next tick if(!makeAbductorTeam()) message_admins("Abductor event failed to find players. Retrying in 30s.") spawn(300) @@ -44,6 +46,7 @@ if(ticker.mode.config_tag != "abduction") ticker.mode.abductors |= temp.abductors + processing = 1 //So it will get gc'd return 1 else return 0 \ No newline at end of file diff --git a/code/modules/events/event.dm b/code/modules/events/event.dm index d5ad22e2afd..0f5c43059e8 100644 --- a/code/modules/events/event.dm +++ b/code/modules/events/event.dm @@ -48,6 +48,7 @@ return 0*/ /datum/event //NOTE: Times are measured in master controller ticks! + var/processing = 1 var/startWhen = 0 //When in the lifetime to call start(). var/announceWhen = 0 //When in the lifetime to call announce(). var/endWhen = 0 //When in the lifetime the event should end. @@ -105,6 +106,9 @@ //Do not override this proc, instead use the appropiate procs. //This proc will handle the calls to the appropiate procs. /datum/event/proc/process() + if(!processing) + return + if(activeFor > startWhen && activeFor < endWhen || noAutoEnd) tick() diff --git a/interface/stylesheet.dm b/interface/stylesheet.dm index 0fef4765bd0..2f178d751bb 100644 --- a/interface/stylesheet.dm +++ b/interface/stylesheet.dm @@ -64,6 +64,7 @@ h1.alert, h2.alert {color: #000000;} .warning {color: #ff0000; font-style: italic;} .announce {color: #228b22; font-weight: bold;} .boldannounce {color: #ff0000; font-weight: bold;} +.greenannounce {color: #00ff00; font-weight: bold;} .rose {color: #ff5050;} .info {color: #0000CC;} .notice {color: #000099;}