From 9d76032058cc12022da1080f1bb720d28c4e0284 Mon Sep 17 00:00:00 2001 From: Erthilo Date: Tue, 15 May 2012 03:56:32 +0100 Subject: [PATCH] Adds logging to holodeck controls. Allows AI to toggle saferty on and off, unless emagged. Fixes mech weapons not firing. Add ADVANCED INTERROGATION TECHNIQUES (smashing peoples faces with tables). Grab someone once and then click on a table. Fixes sleep button not waking you up. --- .../machinery/computer/HolodeckControl.dm | 36 +++++++++++++++---- code/game/mecha/equipment/weapons/weapons.dm | 6 ++-- code/game/objects/tables_racks.dm | 19 +++++++++- code/modules/mob/screen.dm | 3 +- html/changelog.html | 4 +++ 5 files changed, 56 insertions(+), 12 deletions(-) diff --git a/code/game/machinery/computer/HolodeckControl.dm b/code/game/machinery/computer/HolodeckControl.dm index 5fe12567668..19e009ea666 100644 --- a/code/game/machinery/computer/HolodeckControl.dm +++ b/code/game/machinery/computer/HolodeckControl.dm @@ -8,7 +8,7 @@ var/list/holographic_items = list() var/damaged = 0 var/last_change = 0 - + var/safety = 1 attack_ai(var/mob/user as mob) return src.attack_hand(user) @@ -35,7 +35,11 @@ dat += "Please ensure that only holographic weapons are used in the holodeck if a combat simulation has been loaded.
" - if(emagged) + if(!safety) + if(issilicon(user) && (emagged)) + dat += "ERROR: SAFETY PROTOCOLS UNRESPONSIVE
" + else if(issilicon(user) && (!emagged)) + dat += "(Enable Safety Protocols?)
" dat += "(Begin Atmospheric Burn Simulation)
" dat += "Ensure the holodeck is empty before testing.
" dat += "
" @@ -43,12 +47,11 @@ dat += "Ensure the holodeck is empty before testing.
" dat += "
" dat += "Safety Protocols are DISABLED
" - else + else if(safety) if(issilicon(user)) - dat += "(Override Safety Protocols?)
" + dat += "(Disable Safety Protocols?)
" dat += "
" dat += "Safety Protocols are ENABLED
" - user << browse(dat, "window=computer;size=400x500") onclose(user, "computer") @@ -101,7 +104,13 @@ else if(href_list["AIoverride"]) if(!issilicon(usr)) return - emagged = 1 + safety = 0 + log_admin("[usr] ([usr.ckey]) disabled Holodeck Safeties.") + message_admins("[usr] ([usr.ckey]) disabled Holodeck Safeties.") + + else if(href_list["AIrelock"]) + if(!issilicon(usr)) return + safety = 1 src.add_fingerprint(usr) src.updateUsrDialog() @@ -141,8 +150,11 @@ if(istype(D, /obj/item/weapon/card/emag) && !emagged) playsound(src.loc, 'sparks4.ogg', 75, 1) emagged = 1 + safety = 0 user << "\blue You vastly increase projector power and override the safety and security protocols." user << "Warning. Automatic shutoff and derezing protocols have been corrupted. Please call Nanotrasen maintence and do not use the simulator." + log_admin("[user] ([user.ckey]) emagged Holodeck Safeties.") + message_admins("[user] ([user.ckey]) emagged Holodeck Safeties.") src.updateUsrDialog() return @@ -340,7 +352,17 @@ if (istype(W, /obj/item/weapon/grab) && get_dist(src,user)<2) var/obj/item/weapon/grab/G = W if(G.state<2) - user << "\red You need a better grip to do that!" + if(ishuman(G.affecting)) + var/mob/living/carbon/human/H = G.affecting + var/datum/organ/external/affecting = H.get_organ("head") + affecting.take_damage(4, 0) + H.UpdateDamageIcon() + H.updatehealth() + playsound(src.loc, 'punch1.ogg', 50, 1, -3) + src.add_blood(G.affecting) + for(var/mob/O in viewers(world.view, src)) + if (O.client) + O << text("\red [] smashes []'s head on the table!", G.assailant, G.affecting) return G.affecting.loc = src.loc G.affecting.Weaken(5) diff --git a/code/game/mecha/equipment/weapons/weapons.dm b/code/game/mecha/equipment/weapons/weapons.dm index 8c4be94eae0..a24b4bad417 100644 --- a/code/game/mecha/equipment/weapons/weapons.dm +++ b/code/game/mecha/equipment/weapons/weapons.dm @@ -32,7 +32,7 @@ A.yo = targloc.y - curloc.y A.xo = targloc.x - curloc.x chassis.use_power(energy_drain) - A.process() + A.fired() chassis.log_message("Fired from [src.name], targeting [target].") do_after_cooldown() return @@ -215,7 +215,7 @@ A.yo = targloc.y - curloc.y A.xo = targloc.x - curloc.x set_ready_state(0) - A.process() + A.fired() log_message("Fired from [src.name], targeting [target].") do_after_cooldown() return @@ -256,7 +256,7 @@ A.current = curloc A.yo = targloc.y - curloc.y A.xo = targloc.x - curloc.x - A.process() + A.fired() sleep(2) set_ready_state(0) log_message("Fired from [src.name], targeting [target].") diff --git a/code/game/objects/tables_racks.dm b/code/game/objects/tables_racks.dm index 904f3bb8e10..57fecf8889d 100644 --- a/code/game/objects/tables_racks.dm +++ b/code/game/objects/tables_racks.dm @@ -149,7 +149,24 @@ TABLE AND RACK OBJECT INTERATIONS if (istype(W, /obj/item/weapon/grab) && get_dist(src,user)<2) var/obj/item/weapon/grab/G = W if(G.state<2) - user << "\red You need a better grip to do that!" + if(ishuman(G.affecting)) + G.affecting.attack_log += text("\[[time_stamp()]\] Has been smashed on a table by [G.assailant.name] ([G.assailant.ckey])") + G.assailant.attack_log += text("\[[time_stamp()]\] Smashed [G.affecting.name] ([G.affecting.ckey]) on a table.") + + log_admin("ATTACK: [G.assailant] ([G.assailant.ckey]) smashed [G.affecting] ([G.affecting.ckey]) on a table.") + message_admins("ATTACK: [G.assailant] ([G.assailant.ckey]) smashed [G.affecting] ([G.affecting.ckey]) on a table.") + log_attack("[G.assailant] ([G.assailant.ckey]) smashed [G.affecting] ([G.affecting.ckey]) on a table.") + + var/mob/living/carbon/human/H = G.affecting + var/datum/organ/external/affecting = H.get_organ("head") + affecting.take_damage(4, 0) + H.UpdateDamageIcon() + H.updatehealth() + playsound(src.loc, 'punch1.ogg', 50, 1, -3) + src.add_blood(G.affecting) + for(var/mob/O in viewers(world.view, src)) + if (O.client) + O << text("\red [] smashes []'s head on the table!", G.assailant, G.affecting) return G.affecting.loc = src.loc G.affecting.Weaken(5) diff --git a/code/modules/mob/screen.dm b/code/modules/mob/screen.dm index 4cc9c33b0a5..c0cc284533e 100644 --- a/code/modules/mob/screen.dm +++ b/code/modules/mob/screen.dm @@ -439,7 +439,8 @@ usr.pulling = null if("sleep") if(usr.sleeping && usr.sleeping_willingly) - return + usr.sleeping = 0 + usr.sleeping_willingly = 0 else if(!usr.sleeping) usr.sleeping = 20 //Short nap usr.sleeping_willingly = 1 diff --git a/html/changelog.html b/html/changelog.html index 9bff742d948..019abf109c1 100644 --- a/html/changelog.html +++ b/html/changelog.html @@ -62,6 +62,10 @@ should be listed in the changelog upon commit though. Thanks. -->