From 2399e8d5617f5c1d76ebdd06257904ad0fc352fb Mon Sep 17 00:00:00 2001 From: "giacomand@gmail.com" Date: Sun, 22 Jul 2012 20:56:47 +0000 Subject: [PATCH] -PDA notes and uplink notes are working again. -Added light flickering -Ghosts can now make lights flicker a little bit with a minute cooldown. (People voted for it http://www.kamletos.si/tgdb/ingamepolls.php) -PDAs are sorted correctly on the Message Monitor -Added some light flickering to the following events: High levels of radiation, Grey Tide virus. git-svn-id: http://tgstation13.googlecode.com/svn/trunk@4143 316c924e-a436-60f5-8080-3fe189b3f50e --- code/defines/mob/dead/observer.dm | 3 ++- code/game/gamemodes/events.dm | 16 ++++++++++++ code/game/machinery/computer/message.dm | 2 +- code/game/objects/devices/PDA/PDA.dm | 12 ++++----- code/modules/mob/dead/observer/observer.dm | 14 ++++++++++ code/modules/power/lighting.dm | 30 +++++++++++++++++----- 6 files changed, 63 insertions(+), 14 deletions(-) diff --git a/code/defines/mob/dead/observer.dm b/code/defines/mob/dead/observer.dm index 3a3af24c7b..bf94240f4b 100644 --- a/code/defines/mob/dead/observer.dm +++ b/code/defines/mob/dead/observer.dm @@ -10,4 +10,5 @@ blinded = 0 anchored = 1 // don't get pushed around var/mob/corpse = null // observer mode - var/datum/hud/living/carbon/hud = null // hud \ No newline at end of file + var/datum/hud/living/carbon/hud = null // hud + var/bootime = 0 \ No newline at end of file diff --git a/code/game/gamemodes/events.dm b/code/game/gamemodes/events.dm index 23020437bd..7bd9351933 100644 --- a/code/game/gamemodes/events.dm +++ b/code/game/gamemodes/events.dm @@ -141,6 +141,7 @@ C.cell.charge = 0 /proc/power_restore() + command_alert("Power has been restored to [station_name()]. We apologize for the inconvenience.", "Power Systems Nominal") world << sound('poweron.ogg') for(var/obj/machinery/power/apc/C in world) @@ -273,6 +274,11 @@ world << sound('aliens.ogg') /proc/high_radiation_event() + + for(var/obj/machinery/light/L in world) + if(L.z != 1) continue + L.flicker(50) + sleep(100) command_alert("High levels of radiation detected near the station. Please report to the Med-bay if you feel strange.", "Anomaly Alert") world << sound('radiation.ogg') for(var/mob/living/carbon/human/H in world) @@ -289,9 +295,19 @@ domutcheck(H,null,1) for(var/mob/living/carbon/monkey/M in world) M.apply_effect((rand(15,75)),IRRADIATE,0) + sleep(300) + command_alert("High levels of radiation has ceased. Please report to the Med-bay if you feel strange.", "Anomaly Alert") + + //Changing this to affect the main station. Blame Urist. --Pete /proc/prison_break() // -- Callagan + + for(var/obj/machinery/light/L in world) + if(!istype(get_area(L), /area/security/prison) && !istype(get_area(L), /area/security/brig)) continue + L.flicker(10) + sleep(100) + for (var/obj/machinery/power/apc/temp_apc in world) if(istype(get_area(temp_apc), /area/security/prison)) temp_apc.overload_lighting() diff --git a/code/game/machinery/computer/message.dm b/code/game/machinery/computer/message.dm index f125fc41e2..3adc6437fd 100644 --- a/code/game/machinery/computer/message.dm +++ b/code/game/machinery/computer/message.dm @@ -402,7 +402,7 @@ if(!P.owner || P.toff) continue sendPDAs += P if(PDAs && PDAs.len > 0) - customrecepient = input(usr, "Select a PDA from the list.") as null|anything in sortNames(sendPDAs) + customrecepient = input(usr, "Select a PDA from the list.") as null|anything in sortAtom(sendPDAs) else customrecepient = null diff --git a/code/game/objects/devices/PDA/PDA.dm b/code/game/objects/devices/PDA/PDA.dm index 0402bd3664..a62fb9af4b 100644 --- a/code/game/objects/devices/PDA/PDA.dm +++ b/code/game/objects/devices/PDA/PDA.dm @@ -32,8 +32,8 @@ var/global/list/obj/item/device/pda/PDAs = list() var/ttone = "beep" //The ringtone! var/honkamt = 0 //How many honks left when infected with honk.exe var/mimeamt = 0 //How many silence left when infected with mime.exe - var/note = "" //Current note in the notepad function, without HTML. - var/notehtml = "Congratulations, your station has chosen the Thinktronic 5230 Personal Data Assistant!" //Current note in the notepad function, with HTML. + var/note = "Congratulations, your station has chosen the Thinktronic 5230 Personal Data Assistant!" //Current note in the notepad function + var/notehtml = "" var/cart = "" //A place to stick cartridge menu information var/detonate = 1 // Can the PDA be blown up? @@ -334,7 +334,7 @@ var/global/list/obj/item/device/pda/PDAs = list() dat += " Lock
" else dat += " Edit
" - dat += notehtml + dat += note if (2) dat += "

SpaceMessenger V3.9.4

" @@ -533,12 +533,12 @@ var/global/list/obj/item/device/pda/PDAs = list() //MESSENGER/NOTE FUNCTIONS=================================== if ("Edit") - var/n = input(U, "Please enter message", name, note) as message + var/n = input(U, "Please enter message", name, notehtml) as message if (in_range(src, U) && loc == U) n = copytext(adminscrub(n), 1, MAX_MESSAGE_LEN) if (mode == 1) - notehtml = dd_replacetext(n, "\n", "
") - note = n + note = dd_replacetext(n, "\n", "
") + notehtml = n else U << browse(null, "window=pda") return diff --git a/code/modules/mob/dead/observer/observer.dm b/code/modules/mob/dead/observer/observer.dm index 9f71ee13c6..91be625ef0 100644 --- a/code/modules/mob/dead/observer/observer.dm +++ b/code/modules/mob/dead/observer/observer.dm @@ -156,6 +156,7 @@ This is the proc mobs get to turn into a ghost. Forked from ghostize due to comp L+=T usr.loc = pick(L) + /mob/dead/observer/verb/jumptomob() //Moves the ghost instead of just changing the ghosts's eye -Nodrak set category = "Ghost" set name = "Jump to Mob" @@ -182,6 +183,19 @@ This is the proc mobs get to turn into a ghost. Forked from ghostize due to comp else A << "This mob is not located in the game world." +/mob/dead/observer/verb/boo() + set category = "Ghost" + set name = "Boo!" + set desc= "Scare your crew members because of boredom!" + + if(bootime > world.time) return + var/obj/machinery/light/L = locate(/obj/machinery/light) in view(1, src) + if(L) + L.flicker() + bootime = world.time + 600 + return + //Maybe in the future we can add more spooky code here! + return /mob/dead/observer/verb/toggle_alien_candidate() set name = "Toggle Be Alien Candidate" diff --git a/code/modules/power/lighting.dm b/code/modules/power/lighting.dm index 877842563b..a9523acb5e 100644 --- a/code/modules/power/lighting.dm +++ b/code/modules/power/lighting.dm @@ -226,7 +226,7 @@ var/on_gs = 0 var/brightness = 8 // luminosity when on, also used in power calculation var/status = LIGHT_OK // LIGHT_OK, _EMPTY, _BURNED or _BROKEN - + var/flickering = 0 var/light_type = /obj/item/weapon/light/tube // the type of light item var/fitting = "tube" var/switchcount = 0 // count of number of times switched on/off @@ -280,9 +280,7 @@ // A.update_lights() ..() - -// update the icon_state and luminosity of the light depending on its state -/obj/machinery/light/proc/update() +/obj/machinery/light/update_icon() switch(status) // set icon_states if(LIGHT_OK) @@ -296,6 +294,12 @@ if(LIGHT_BROKEN) icon_state = "[base_state]-broken" on = 0 + return + +// update the icon_state and luminosity of the light depending on its state +/obj/machinery/light/proc/update(var/trigger = 1) + + update_icon() if(!on) use_power = 1 else @@ -310,7 +314,7 @@ switchcount++ // now check to see if the bulb is burned out - if(status == LIGHT_OK) + if(status == LIGHT_OK && trigger) if(on && rigged) explode() if( prob( min(60, switchcount*switchcount*0.01) ) ) @@ -447,10 +451,24 @@ var/area/A = src.loc.loc return A.master.lightswitch && A.master.power_light +/obj/machinery/light/proc/flicker(var/amount = rand(10, 20)) + if(flickering) return + flickering = 1 + spawn(0) + if(on && status == LIGHT_OK) + for(var/i = 0; i < amount; i++) + if(status != LIGHT_OK) break + on = !on + update(0) + sleep(rand(5, 15)) + on = (status == LIGHT_OK) + update(0) + flickering = 0 -// ai attack - do nothing +// ai attack - make lights flicker, because why not /obj/machinery/light/attack_ai(mob/user) + src.flicker(1) return // Aliens smash the bulb but do not get electrocuted./N