mirror of
https://github.com/ParadiseSS13/Paradise.git
synced 2026-08-22 19:47:22 +01:00
Committing Smoke Carter's "News Caster Alerts" update.
I slightly modified it so that damage overlays work and so that wanted and alerts are visible at the same time. All credits to Smoke Carter. git-svn-id: http://tgstation13.googlecode.com/svn/trunk@3133 316c924e-a436-60f5-8080-3fe189b3f50e
This commit is contained in:
@@ -53,6 +53,9 @@ var/list/obj/machinery/newscaster/allCasters = list() //list that will contain r
|
||||
var/wanted_issue = 0
|
||||
// 0 = there's no WANTED issued, we don't need a special icon_state
|
||||
// 1 = Guess what.
|
||||
var/alert = 0
|
||||
// 0 = there hasn't been a news/wanted update in the last minutes
|
||||
// 1 = there has
|
||||
var/scanned_user = "Unknown" //Will contain the name of the person who currently uses the newscaster
|
||||
var/msg = ""; //Feed message
|
||||
var/channel_name = ""; //the feed channel which will be receiving the feed, or being created
|
||||
@@ -82,20 +85,23 @@ var/list/obj/machinery/newscaster/allCasters = list() //list that will contain r
|
||||
/obj/machinery/newscaster/update_icon()
|
||||
if(!ispowered || isbroken)
|
||||
icon_state = "newscaster_off"
|
||||
if(isbroken) //If the thing is smashed, we use add the cracks on top of the unpowered sprite.
|
||||
if(isbroken) //If the thing is smashed, add crack overlay on top of the unpowered sprite.
|
||||
src.overlays = null
|
||||
src.overlays += image(src.icon, "crack3")
|
||||
return
|
||||
if(wanted_issue)
|
||||
|
||||
src.overlays = null //reset overlays
|
||||
if(alert) //new message alert overlay
|
||||
src.overlays += "newscaster_alert"
|
||||
if(hitstaken > 0) //Cosmetic damage overlay
|
||||
src.overlays += image(src.icon, "crack[hitstaken]")
|
||||
|
||||
if(wanted_issue) //wanted icon state
|
||||
icon_state = "newscaster_wanted"
|
||||
return
|
||||
|
||||
icon_state = "newscaster_normal"
|
||||
if(hitstaken > 0) //Right, looks like it's hit but still in working condition
|
||||
src.overlays = null
|
||||
src.overlays += image(src.icon, "crack[hitstaken]")
|
||||
return
|
||||
|
||||
|
||||
return
|
||||
|
||||
/obj/machinery/newscaster/power_change()
|
||||
if(isbroken) //Broken shit can't be powered.
|
||||
@@ -360,14 +366,6 @@ var/list/obj/machinery/newscaster/allCasters = list() //list that will contain r
|
||||
human_user << browse(dat, "window=newscaster_main;size=400x600")
|
||||
onclose(human_user, "newscaster_main")
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
/*if(src.isbroken) //debugging shit
|
||||
return
|
||||
src.hitstaken++
|
||||
@@ -445,6 +443,10 @@ var/list/obj/machinery/newscaster/allCasters = list() //list that will contain r
|
||||
FC.messages += newMsg // To avoid further confusion, this one for adds the message to all existing newscasters' channel_list's channels.
|
||||
break // Another for to go through newscasters is not needed. Due to the nature of submit_new_CHANNEL, every reference
|
||||
src.screen=4 // to a channel in ANY newscaster is the same. Editing one will edit them all.
|
||||
|
||||
for(var/obj/machinery/newscaster/NEWSCASTER in allCasters)
|
||||
NEWSCASTER.newsAlert(src.channel_name)
|
||||
|
||||
src.updateUsrDialog()
|
||||
|
||||
else if(href_list["create_channel"])
|
||||
@@ -513,6 +515,7 @@ var/list/obj/machinery/newscaster/allCasters = list() //list that will contain r
|
||||
for(var/obj/machinery/newscaster/NEWSCASTER in allCasters)
|
||||
NEWSCASTER.wanted = WANTED
|
||||
NEWSCASTER.wanted_issue = 1
|
||||
NEWSCASTER.newsAlert()
|
||||
NEWSCASTER.update_icon()
|
||||
src.screen = 15
|
||||
else
|
||||
@@ -824,7 +827,17 @@ obj/item/weapon/newspaper/attackby(obj/item/weapon/W as obj, mob/user as mob)
|
||||
return
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
/obj/machinery/newscaster/proc/newsAlert(channel)
|
||||
var/turf/T = get_turf(src)
|
||||
if(channel)
|
||||
for(var/mob/O in hearers(world.view-1, T))
|
||||
O.show_message("<font color=Maroon><B>[src.name]</B> beeps, \"Breaking news from [channel]!</font>\"",2)
|
||||
src.alert = 1
|
||||
src.update_icon()
|
||||
spawn(600)
|
||||
src.alert = 0
|
||||
src.update_icon()
|
||||
else
|
||||
for(var/mob/O in hearers(world.view-1, T))
|
||||
O.show_message("<font color=Maroon><B>[src.name]</B> beeps, \"Wanted notice posted!</font>\"",2)
|
||||
playsound(src.loc, 'twobeep.ogg', 75, 1)
|
||||
+8
-4
@@ -92,6 +92,13 @@ should be listed in the changelog upon commit tho. Thanks. -->
|
||||
|
||||
<!-- To take advantage of the pretty new format (well it was new when I wrote this anyway), open the "add-to-changelog.html" file in any browser and add the stuff and then generate the html code and paste it here -->
|
||||
|
||||
<div class="commit sansserif">
|
||||
<h2 class="date">16 February 2012</h2>
|
||||
<h3 class="author">Smoke Carter updated:</h3>
|
||||
<ul class="changes bgimages16">
|
||||
<li class="rscadd">Newscasters now alert people of new feeds and wanted-alerts simultaneously.</li>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
<div class="commit sansserif">
|
||||
<h2 class="date">15 February 2012</h2>
|
||||
@@ -99,13 +106,10 @@ should be listed in the changelog upon commit tho. Thanks. -->
|
||||
<ul class="changes bgimages16">
|
||||
<li class="tweak">Terrorists Win! Desert Eagles and Riot Shields now spawn on the syndicate shuttle, replacing the c20r</li>
|
||||
<li class="tweak">The Detectives gun still uses .38, but they're now fully lethal bullets. Go ahead, make his day.</li>
|
||||
<li class="tweak>The Veil Render has been nerfed, the Nar-Sie it spawns will not pull anchored objects. This is a temporary measure, more nerfs/reworking to come</li>
|
||||
<li class="tweak">The Veil Render has been nerfed, the Nar-Sie it spawns will not pull anchored objects. This is a temporary measure, more nerfs/reworking to come</li>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
<div class="commit sansserif">
|
||||
<h2 class="date">14 February 2012</h2>
|
||||
<h3 class="author">Carn updated:</h3>
|
||||
|
||||
Binary file not shown.
|
Before Width: | Height: | Size: 16 KiB After Width: | Height: | Size: 17 KiB |
Reference in New Issue
Block a user