news reading
This commit is contained in:
@@ -0,0 +1,2 @@
|
||||
/datum/news
|
||||
var/author = ""
|
||||
@@ -2,7 +2,6 @@
|
||||
var/channel_name = ""
|
||||
var/list/datum/news/feed_message/messages = list()
|
||||
var/locked = FALSE
|
||||
var/author = ""
|
||||
var/censored = 0
|
||||
var/list/authorCensorTime = list()
|
||||
var/list/DclassCensorTime = list()
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
/datum/news/feed_comment
|
||||
var/author = ""
|
||||
var/body = ""
|
||||
var/time_stamp = ""
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
/datum/news/feed_message
|
||||
var/author =""
|
||||
var/body =""
|
||||
var/list/authorCensorTime = list()
|
||||
var/list/bodyCensorTime = list()
|
||||
|
||||
@@ -0,0 +1,49 @@
|
||||
/mob/dead/observer/verb/read_news()
|
||||
var/datum/browser/popup = new(user, "ghost_news_list", 450, 600)
|
||||
popup.set_content(render_news_channel_list())
|
||||
popup.open()
|
||||
|
||||
/mob/dead/observer/Topic(href, href_list)
|
||||
. = ..()
|
||||
if(href_list["show_news_channel"])
|
||||
var/datum/D = locate(href_list["show_news_channel"])
|
||||
if(istype(D, /datum/news/feed_channel)) //safety
|
||||
render_news_channel(D)
|
||||
|
||||
/mob/dead/observer/proc/render_news_channel_list()
|
||||
var/datum/news_network = GLOB.news_network()
|
||||
var/list/content = list()
|
||||
for(var/i in news_network.network_channels)
|
||||
var/datum/news/feed_channel/FC = i
|
||||
content += "<b><a href='?_src_=[REF(src)];show_news_channel=[REF(FC)]'>[FC.name] ([length(FC.messages)] messages)[FC.locked? " (LOCKED)":""][FC.censored? " (CENSORED)":""][FC.is_admin_channel? " (ADMIN)":""]</a></b>"
|
||||
return content.Join("<br>")
|
||||
|
||||
/mob/dead/observer/proc/render_news_channel(datum/news/feed_channel/FC)
|
||||
var/list/content = list()
|
||||
content += "<B>[viewing_channel.channel_name]: </B><FONT SIZE=1>\[created by: <FONT COLOR='maroon'>[viewing_channel.returnAuthor(-1)]</FONT>\]</FONT><HR>"
|
||||
if(FC.censored)
|
||||
content += "<FONT COLOR='red'><B>ATTENTION: </B></FONT>This channel has been deemed as threatening to the welfare of the station, and marked with a Nanotrasen D-Notice.<BR>"
|
||||
content += "No further feed story additions are allowed while the D-Notice is in effect.</FONT><BR><BR>"
|
||||
if(!length(FC.messages))
|
||||
content += "<b>This channel is empty.<b><BR>"
|
||||
for(var/i in FC.messages)
|
||||
var/datum/feed_message/FM = i
|
||||
content += "
|
||||
content += "-[FM.returnBody(-1)] <BR>"
|
||||
if(FM.img)
|
||||
src << browse_rsc(FM.img, "tmp_photo[i].png")
|
||||
content += "<img src='tmp_photo[i].png' width = '180'><BR>"
|
||||
if(FC.caption)
|
||||
content += "[FM.caption]<BR>"
|
||||
content += "<BR>"
|
||||
content += "<FONT SIZE=1>\[Story by <FONT COLOR='maroon'>[FM.returnAuthor(-1)] </FONT>\] - ([FM.time_stamp])</FONT><BR>"
|
||||
content += "<b><font size=1>[FM.comments.len] comment[FM.comments.len > 1 ? "s" : ""]</font></b><br>"
|
||||
for(var/i in FM.comments)
|
||||
var/datum/news/feed_comment/FC = i
|
||||
content += "<font size=1><small>[FC.body]</font><br><font size=1><small><small><small>[FC.author] [FC.time_stamp]</small></small></small></small></font><br>"
|
||||
if(FM.locked)
|
||||
content += "<b>Comments locked</b><br>"
|
||||
var/datum/browser/popup = new(src, "ghost_news_channel", 450, 900)
|
||||
popup.set_content(content.Join(""))
|
||||
popup.open()
|
||||
|
||||
@@ -1 +0,0 @@
|
||||
/datum/news
|
||||
-176
@@ -672,7 +672,6 @@ GLOBAL_LIST_EMPTY(allCasters)
|
||||
NEWSPAPER.creationTime = GLOB.news_network.lastAction
|
||||
paper_remaining--
|
||||
|
||||
|
||||
/obj/machinery/newscaster/proc/remove_alert()
|
||||
alert = FALSE
|
||||
update_icon()
|
||||
@@ -687,178 +686,3 @@ GLOBAL_LIST_EMPTY(allCasters)
|
||||
else
|
||||
say("Attention! Wanted issue distributed!")
|
||||
playsound(loc, 'sound/machines/warning-buzzer.ogg', 75, 1)
|
||||
|
||||
|
||||
/obj/item/newspaper
|
||||
name = "newspaper"
|
||||
desc = "An issue of The Griffon, the newspaper circulating aboard Nanotrasen Space Stations."
|
||||
icon = 'icons/obj/bureaucracy.dmi'
|
||||
icon_state = "newspaper"
|
||||
lefthand_file = 'icons/mob/inhands/misc/books_lefthand.dmi'
|
||||
righthand_file = 'icons/mob/inhands/misc/books_righthand.dmi'
|
||||
w_class = WEIGHT_CLASS_SMALL
|
||||
attack_verb = list("bapped")
|
||||
var/screen = 0
|
||||
var/pages = 0
|
||||
var/curr_page = 0
|
||||
var/list/datum/news/feed_channel/news_content = list()
|
||||
var/scribble=""
|
||||
var/scribble_page = null
|
||||
var/wantedAuthor
|
||||
var/wantedCriminal
|
||||
var/wantedBody
|
||||
var/wantedPhoto
|
||||
var/creationTime
|
||||
|
||||
/obj/item/newspaper/suicide_act(mob/user)
|
||||
user.visible_message("<span class='suicide'>[user] is focusing intently on [src]! It looks like [user.p_theyre()] trying to commit sudoku... until [user.p_their()] eyes light up with realization!</span>")
|
||||
user.say(";JOURNALISM IS MY CALLING! EVERYBODY APPRECIATES UNBIASED REPORTI-GLORF", forced="newspaper suicide")
|
||||
var/mob/living/carbon/human/H = user
|
||||
var/obj/W = new /obj/item/reagent_containers/food/drinks/bottle/whiskey(H.loc)
|
||||
playsound(H.loc, 'sound/items/drink.ogg', rand(10,50), 1)
|
||||
W.reagents.trans_to(H, W.reagents.total_volume)
|
||||
user.visible_message("<span class='suicide'>[user] downs the contents of [W.name] in one gulp! Shoulda stuck to sudoku!</span>")
|
||||
|
||||
return(TOXLOSS)
|
||||
|
||||
/obj/item/newspaper/attack_self(mob/user)
|
||||
if(ishuman(user))
|
||||
var/mob/living/carbon/human/human_user = user
|
||||
var/dat
|
||||
pages = 0
|
||||
switch(screen)
|
||||
if(0) //Cover
|
||||
dat+="<DIV ALIGN='center'><B><FONT SIZE=6>The Griffon</FONT></B></div>"
|
||||
dat+="<DIV ALIGN='center'><FONT SIZE=2>Nanotrasen-standard newspaper, for use on Nanotrasen? Space Facilities</FONT></div><HR>"
|
||||
if(isemptylist(news_content))
|
||||
if(wantedAuthor)
|
||||
dat+="Contents:<BR><ul><B><FONT COLOR='red'>**</FONT>Important Security Announcement<FONT COLOR='red'>**</FONT></B> <FONT SIZE=2>\[page [pages+2]\]</FONT><BR></ul>"
|
||||
else
|
||||
dat+="<I>Other than the title, the rest of the newspaper is unprinted...</I>"
|
||||
else
|
||||
dat+="Contents:<BR><ul>"
|
||||
for(var/datum/news/feed_channel/NP in news_content)
|
||||
pages++
|
||||
if(wantedAuthor)
|
||||
dat+="<B><FONT COLOR='red'>**</FONT>Important Security Announcement<FONT COLOR='red'>**</FONT></B> <FONT SIZE=2>\[page [pages+2]\]</FONT><BR>"
|
||||
var/temp_page=0
|
||||
for(var/datum/news/feed_channel/NP in news_content)
|
||||
temp_page++
|
||||
dat+="<B>[NP.channel_name]</B> <FONT SIZE=2>\[page [temp_page+1]\]</FONT><BR>"
|
||||
dat+="</ul>"
|
||||
if(scribble_page==curr_page)
|
||||
dat+="<BR><I>There is a small scribble near the end of this page... It reads: \"[scribble]\"</I>"
|
||||
dat+= "<HR><DIV STYLE='float:right;'><A href='?src=[REF(src)];next_page=1'>Next Page</A></DIV> <div style='float:left;'><A href='?src=[REF(human_user)];mach_close=newspaper_main'>Done reading</A></DIV>"
|
||||
if(1) // X channel pages inbetween.
|
||||
for(var/datum/news/feed_channel/NP in news_content)
|
||||
pages++
|
||||
var/datum/news/feed_channel/C = news_content[curr_page]
|
||||
dat += "<FONT SIZE=4><B>[C.channel_name]</B></FONT><FONT SIZE=1> \[created by: <FONT COLOR='maroon'>[C.returnAuthor(notContent(C.authorCensorTime))]</FONT>\]</FONT><BR><BR>"
|
||||
if(notContent(C.DclassCensorTime))
|
||||
dat+="This channel was deemed dangerous to the general welfare of the station and therefore marked with a <B><FONT COLOR='red'>D-Notice</B></FONT>. Its contents were not transferred to the newspaper at the time of printing."
|
||||
else
|
||||
if(isemptylist(C.messages))
|
||||
dat+="No Feed stories stem from this channel..."
|
||||
else
|
||||
var/i = 0
|
||||
for(var/datum/news/feed_message/MESSAGE in C.messages)
|
||||
if(MESSAGE.creationTime > creationTime)
|
||||
if(i == 0)
|
||||
dat+="No Feed stories stem from this channel..."
|
||||
break
|
||||
if(i == 0)
|
||||
dat+="<ul>"
|
||||
i++
|
||||
dat+="-[MESSAGE.returnBody(notContent(MESSAGE.bodyCensorTime))] <BR>"
|
||||
if(MESSAGE.img)
|
||||
user << browse_rsc(MESSAGE.img, "tmp_photo[i].png")
|
||||
dat+="<img src='tmp_photo[i].png' width = '180'><BR>"
|
||||
dat+="<FONT SIZE=1>\[Story by <FONT COLOR='maroon'>[MESSAGE.returnAuthor(notContent(MESSAGE.authorCensorTime))]</FONT>\]</FONT><BR><BR>"
|
||||
dat+="</ul>"
|
||||
if(scribble_page==curr_page)
|
||||
dat+="<BR><I>There is a small scribble near the end of this page... It reads: \"[scribble]\"</I>"
|
||||
dat+= "<BR><HR><DIV STYLE='float:left;'><A href='?src=[REF(src)];prev_page=1'>Previous Page</A></DIV> <DIV STYLE='float:right;'><A href='?src=[REF(src)];next_page=1'>Next Page</A></DIV>"
|
||||
if(2) //Last page
|
||||
for(var/datum/news/feed_channel/NP in news_content)
|
||||
pages++
|
||||
if(wantedAuthor!=null)
|
||||
dat+="<DIV STYLE='float:center;'><FONT SIZE=4><B>Wanted Issue:</B></FONT SIZE></DIV><BR><BR>"
|
||||
dat+="<B>Criminal name</B>: <FONT COLOR='maroon'>[wantedCriminal]</FONT><BR>"
|
||||
dat+="<B>Description</B>: [wantedBody]<BR>"
|
||||
dat+="<B>Photo:</B>: "
|
||||
if(wantedPhoto)
|
||||
user << browse_rsc(wantedPhoto, "tmp_photow.png")
|
||||
dat+="<BR><img src='tmp_photow.png' width = '180'>"
|
||||
else
|
||||
dat+="None"
|
||||
else
|
||||
dat+="<I>Apart from some uninteresting classified ads, there's nothing on this page...</I>"
|
||||
if(scribble_page==curr_page)
|
||||
dat+="<BR><I>There is a small scribble near the end of this page... It reads: \"[scribble]\"</I>"
|
||||
dat+= "<HR><DIV STYLE='float:left;'><A href='?src=[REF(src)];prev_page=1'>Previous Page</A></DIV>"
|
||||
dat+="<BR><HR><div align='center'>[curr_page+1]</div>"
|
||||
human_user << browse(dat, "window=newspaper_main;size=300x400")
|
||||
onclose(human_user, "newspaper_main")
|
||||
else
|
||||
to_chat(user, "The paper is full of unintelligible symbols!")
|
||||
|
||||
/obj/item/newspaper/proc/notContent(list/L)
|
||||
if(!L.len)
|
||||
return 0
|
||||
for(var/i=L.len;i>0;i--)
|
||||
var/num = abs(L[i])
|
||||
if(creationTime <= num)
|
||||
continue
|
||||
else
|
||||
if(L[i] > 0)
|
||||
return 1
|
||||
else
|
||||
return 0
|
||||
return 0
|
||||
|
||||
/obj/item/newspaper/Topic(href, href_list)
|
||||
var/mob/living/U = usr
|
||||
..()
|
||||
if((src in U.contents) || (isturf(loc) && in_range(src, U)))
|
||||
U.set_machine(src)
|
||||
if(href_list["next_page"])
|
||||
if(curr_page == pages+1)
|
||||
return //Don't need that at all, but anyway.
|
||||
if(curr_page == pages) //We're at the middle, get to the end
|
||||
screen = 2
|
||||
else
|
||||
if(curr_page == 0) //We're at the start, get to the middle
|
||||
screen=1
|
||||
curr_page++
|
||||
playsound(loc, "pageturn", 50, 1)
|
||||
else if(href_list["prev_page"])
|
||||
if(curr_page == 0)
|
||||
return
|
||||
if(curr_page == 1)
|
||||
screen = 0
|
||||
else
|
||||
if(curr_page == pages+1) //we're at the end, let's go back to the middle.
|
||||
screen = 1
|
||||
curr_page--
|
||||
playsound(loc, "pageturn", 50, 1)
|
||||
if(ismob(loc))
|
||||
attack_self(loc)
|
||||
|
||||
/obj/item/newspaper/attackby(obj/item/W, mob/user, params)
|
||||
if(istype(W, /obj/item/pen))
|
||||
if(!user.is_literate())
|
||||
to_chat(user, "<span class='notice'>You scribble illegibly on [src]!</span>")
|
||||
return
|
||||
if(scribble_page == curr_page)
|
||||
to_chat(user, "<span class='notice'>There's already a scribble in this page... You wouldn't want to make things too cluttered, would you?</span>")
|
||||
else
|
||||
var/s = stripped_input(user, "Write something", "Newspaper")
|
||||
if (!s)
|
||||
return
|
||||
if(!user.canUseTopic(src, BE_CLOSE))
|
||||
return
|
||||
scribble_page = curr_page
|
||||
scribble = s
|
||||
attack_self(user)
|
||||
else
|
||||
return ..()
|
||||
@@ -0,0 +1,173 @@
|
||||
/obj/item/newspaper
|
||||
name = "newspaper"
|
||||
desc = "An issue of The Griffon, the newspaper circulating aboard Nanotrasen Space Stations."
|
||||
icon = 'icons/obj/bureaucracy.dmi'
|
||||
icon_state = "newspaper"
|
||||
lefthand_file = 'icons/mob/inhands/misc/books_lefthand.dmi'
|
||||
righthand_file = 'icons/mob/inhands/misc/books_righthand.dmi'
|
||||
w_class = WEIGHT_CLASS_SMALL
|
||||
attack_verb = list("bapped")
|
||||
var/screen = 0
|
||||
var/pages = 0
|
||||
var/curr_page = 0
|
||||
var/list/datum/news/feed_channel/news_content = list()
|
||||
var/scribble=""
|
||||
var/scribble_page = null
|
||||
var/wantedAuthor
|
||||
var/wantedCriminal
|
||||
var/wantedBody
|
||||
var/wantedPhoto
|
||||
var/creationTime
|
||||
|
||||
/obj/item/newspaper/suicide_act(mob/user)
|
||||
user.visible_message("<span class='suicide'>[user] is focusing intently on [src]! It looks like [user.p_theyre()] trying to commit sudoku... until [user.p_their()] eyes light up with realization!</span>")
|
||||
user.say(";JOURNALISM IS MY CALLING! EVERYBODY APPRECIATES UNBIASED REPORTI-GLORF", forced="newspaper suicide")
|
||||
var/mob/living/carbon/human/H = user
|
||||
var/obj/W = new /obj/item/reagent_containers/food/drinks/bottle/whiskey(H.loc)
|
||||
playsound(H.loc, 'sound/items/drink.ogg', rand(10,50), 1)
|
||||
W.reagents.trans_to(H, W.reagents.total_volume)
|
||||
user.visible_message("<span class='suicide'>[user] downs the contents of [W.name] in one gulp! Shoulda stuck to sudoku!</span>")
|
||||
|
||||
return(TOXLOSS)
|
||||
|
||||
/obj/item/newspaper/attack_self(mob/user)
|
||||
if(ishuman(user))
|
||||
var/mob/living/carbon/human/human_user = user
|
||||
var/dat
|
||||
pages = 0
|
||||
switch(screen)
|
||||
if(0) //Cover
|
||||
dat+="<DIV ALIGN='center'><B><FONT SIZE=6>The Griffon</FONT></B></div>"
|
||||
dat+="<DIV ALIGN='center'><FONT SIZE=2>Nanotrasen-standard newspaper, for use on Nanotrasen? Space Facilities</FONT></div><HR>"
|
||||
if(isemptylist(news_content))
|
||||
if(wantedAuthor)
|
||||
dat+="Contents:<BR><ul><B><FONT COLOR='red'>**</FONT>Important Security Announcement<FONT COLOR='red'>**</FONT></B> <FONT SIZE=2>\[page [pages+2]\]</FONT><BR></ul>"
|
||||
else
|
||||
dat+="<I>Other than the title, the rest of the newspaper is unprinted...</I>"
|
||||
else
|
||||
dat+="Contents:<BR><ul>"
|
||||
for(var/datum/news/feed_channel/NP in news_content)
|
||||
pages++
|
||||
if(wantedAuthor)
|
||||
dat+="<B><FONT COLOR='red'>**</FONT>Important Security Announcement<FONT COLOR='red'>**</FONT></B> <FONT SIZE=2>\[page [pages+2]\]</FONT><BR>"
|
||||
var/temp_page=0
|
||||
for(var/datum/news/feed_channel/NP in news_content)
|
||||
temp_page++
|
||||
dat+="<B>[NP.channel_name]</B> <FONT SIZE=2>\[page [temp_page+1]\]</FONT><BR>"
|
||||
dat+="</ul>"
|
||||
if(scribble_page==curr_page)
|
||||
dat+="<BR><I>There is a small scribble near the end of this page... It reads: \"[scribble]\"</I>"
|
||||
dat+= "<HR><DIV STYLE='float:right;'><A href='?src=[REF(src)];next_page=1'>Next Page</A></DIV> <div style='float:left;'><A href='?src=[REF(human_user)];mach_close=newspaper_main'>Done reading</A></DIV>"
|
||||
if(1) // X channel pages inbetween.
|
||||
for(var/datum/news/feed_channel/NP in news_content)
|
||||
pages++
|
||||
var/datum/news/feed_channel/C = news_content[curr_page]
|
||||
dat += "<FONT SIZE=4><B>[C.channel_name]</B></FONT><FONT SIZE=1> \[created by: <FONT COLOR='maroon'>[C.returnAuthor(notContent(C.authorCensorTime))]</FONT>\]</FONT><BR><BR>"
|
||||
if(notContent(C.DclassCensorTime))
|
||||
dat+="This channel was deemed dangerous to the general welfare of the station and therefore marked with a <B><FONT COLOR='red'>D-Notice</B></FONT>. Its contents were not transferred to the newspaper at the time of printing."
|
||||
else
|
||||
if(isemptylist(C.messages))
|
||||
dat+="No Feed stories stem from this channel..."
|
||||
else
|
||||
var/i = 0
|
||||
for(var/datum/news/feed_message/MESSAGE in C.messages)
|
||||
if(MESSAGE.creationTime > creationTime)
|
||||
if(i == 0)
|
||||
dat+="No Feed stories stem from this channel..."
|
||||
break
|
||||
if(i == 0)
|
||||
dat+="<ul>"
|
||||
i++
|
||||
dat+="-[MESSAGE.returnBody(notContent(MESSAGE.bodyCensorTime))] <BR>"
|
||||
if(MESSAGE.img)
|
||||
user << browse_rsc(MESSAGE.img, "tmp_photo[i].png")
|
||||
dat+="<img src='tmp_photo[i].png' width = '180'><BR>"
|
||||
dat+="<FONT SIZE=1>\[Story by <FONT COLOR='maroon'>[MESSAGE.returnAuthor(notContent(MESSAGE.authorCensorTime))]</FONT>\]</FONT><BR><BR>"
|
||||
dat+="</ul>"
|
||||
if(scribble_page==curr_page)
|
||||
dat+="<BR><I>There is a small scribble near the end of this page... It reads: \"[scribble]\"</I>"
|
||||
dat+= "<BR><HR><DIV STYLE='float:left;'><A href='?src=[REF(src)];prev_page=1'>Previous Page</A></DIV> <DIV STYLE='float:right;'><A href='?src=[REF(src)];next_page=1'>Next Page</A></DIV>"
|
||||
if(2) //Last page
|
||||
for(var/datum/news/feed_channel/NP in news_content)
|
||||
pages++
|
||||
if(wantedAuthor!=null)
|
||||
dat+="<DIV STYLE='float:center;'><FONT SIZE=4><B>Wanted Issue:</B></FONT SIZE></DIV><BR><BR>"
|
||||
dat+="<B>Criminal name</B>: <FONT COLOR='maroon'>[wantedCriminal]</FONT><BR>"
|
||||
dat+="<B>Description</B>: [wantedBody]<BR>"
|
||||
dat+="<B>Photo:</B>: "
|
||||
if(wantedPhoto)
|
||||
user << browse_rsc(wantedPhoto, "tmp_photow.png")
|
||||
dat+="<BR><img src='tmp_photow.png' width = '180'>"
|
||||
else
|
||||
dat+="None"
|
||||
else
|
||||
dat+="<I>Apart from some uninteresting classified ads, there's nothing on this page...</I>"
|
||||
if(scribble_page==curr_page)
|
||||
dat+="<BR><I>There is a small scribble near the end of this page... It reads: \"[scribble]\"</I>"
|
||||
dat+= "<HR><DIV STYLE='float:left;'><A href='?src=[REF(src)];prev_page=1'>Previous Page</A></DIV>"
|
||||
dat+="<BR><HR><div align='center'>[curr_page+1]</div>"
|
||||
human_user << browse(dat, "window=newspaper_main;size=300x400")
|
||||
onclose(human_user, "newspaper_main")
|
||||
else
|
||||
to_chat(user, "The paper is full of unintelligible symbols!")
|
||||
|
||||
/obj/item/newspaper/proc/notContent(list/L)
|
||||
if(!L.len)
|
||||
return 0
|
||||
for(var/i=L.len;i>0;i--)
|
||||
var/num = abs(L[i])
|
||||
if(creationTime <= num)
|
||||
continue
|
||||
else
|
||||
if(L[i] > 0)
|
||||
return 1
|
||||
else
|
||||
return 0
|
||||
return 0
|
||||
|
||||
/obj/item/newspaper/Topic(href, href_list)
|
||||
var/mob/living/U = usr
|
||||
..()
|
||||
if((src in U.contents) || (isturf(loc) && in_range(src, U)))
|
||||
U.set_machine(src)
|
||||
if(href_list["next_page"])
|
||||
if(curr_page == pages+1)
|
||||
return //Don't need that at all, but anyway.
|
||||
if(curr_page == pages) //We're at the middle, get to the end
|
||||
screen = 2
|
||||
else
|
||||
if(curr_page == 0) //We're at the start, get to the middle
|
||||
screen=1
|
||||
curr_page++
|
||||
playsound(loc, "pageturn", 50, 1)
|
||||
else if(href_list["prev_page"])
|
||||
if(curr_page == 0)
|
||||
return
|
||||
if(curr_page == 1)
|
||||
screen = 0
|
||||
else
|
||||
if(curr_page == pages+1) //we're at the end, let's go back to the middle.
|
||||
screen = 1
|
||||
curr_page--
|
||||
playsound(loc, "pageturn", 50, 1)
|
||||
if(ismob(loc))
|
||||
attack_self(loc)
|
||||
|
||||
/obj/item/newspaper/attackby(obj/item/W, mob/user, params)
|
||||
if(istype(W, /obj/item/pen))
|
||||
if(!user.is_literate())
|
||||
to_chat(user, "<span class='notice'>You scribble illegibly on [src]!</span>")
|
||||
return
|
||||
if(scribble_page == curr_page)
|
||||
to_chat(user, "<span class='notice'>There's already a scribble in this page... You wouldn't want to make things too cluttered, would you?</span>")
|
||||
else
|
||||
var/s = stripped_input(user, "Write something", "Newspaper")
|
||||
if (!s)
|
||||
return
|
||||
if(!user.canUseTopic(src, BE_CLOSE))
|
||||
return
|
||||
scribble_page = curr_page
|
||||
scribble = s
|
||||
attack_self(user)
|
||||
else
|
||||
return ..()
|
||||
Reference in New Issue
Block a user