initial commit

This commit is contained in:
kevinz000
2020-02-06 00:03:17 -07:00
parent 927b9d0622
commit 9a4432b3ac
8 changed files with 183 additions and 175 deletions
+18 -4
View File
@@ -112,7 +112,6 @@
else
return ..()
/obj/structure/bookcase/attack_hand(mob/user)
. = ..()
if(.)
@@ -129,6 +128,17 @@
choice.forceMove(drop_location())
update_icon()
/obj/structure/bookcase/attack_ghost(mob/dead/observer/user)
. = ..()
if(!length(contents))
to_chat(user, "<span class='warning'>It's empty!</span>")
return
var/obj/item/book/choice = input("Which book would you like to read?") as null|obj in contents
if(choice)
if(!istype(choice)) //spellbook, cult tome, or the one weird bible storage
to_chat(user,"A mysterious force is keeping you from reading that.")
return
choice.attack_ghost(user)
/obj/structure/bookcase/deconstruct(disassembled = TRUE)
new /obj/item/stack/sheet/mineral/wood(loc, 4)
@@ -203,13 +213,17 @@
to_chat(user, "<span class='notice'>You skim through the book but can't comprehend any of it.</span>")
return
if(dat)
user << browse("<TT><I>Penned by [author].</I></TT> <BR>" + "[dat]", "window=book[window_size != null ? ";size=[window_size]" : ""]")
show_to(user)
user.visible_message("[user] opens a book titled \"[title]\" and begins reading intently.")
SEND_SIGNAL(user, COMSIG_ADD_MOOD_EVENT, "book_nerd", /datum/mood_event/book_nerd)
onclose(user, "book")
else
to_chat(user, "<span class='notice'>This book is completely blank!</span>")
/obj/item/book/attack_ghost(mob/dead/observer/O)
. = ..()
show_to(O)
/obj/item/book/proc/show_to(mob/user)
user << browse("<TT><I>Penned by [author].</I></TT> <BR>" + "[dat]", "window=book[window_size != null ? ";size=[window_size]" : ""]")
/obj/item/book/attackby(obj/item/I, mob/user, params)
if(istype(I, /obj/item/pen))
+34
View File
@@ -0,0 +1,34 @@
/datum/newscaster/feed_channel
var/channel_name = ""
var/list/datum/newscaster/feed_message/messages = list()
var/locked = FALSE
var/author = ""
var/censored = 0
var/list/authorCensorTime = list()
var/list/DclassCensorTime = list()
var/authorCensor
var/is_admin_channel = 0
/datum/newscaster/feed_channel/proc/returnAuthor(censor)
if(censor == -1)
censor = authorCensor
var/txt = "[GLOB.news_network.redactedText]"
if(!censor)
txt = author
return txt
/datum/newscaster/feed_channel/proc/toggleCensorDclass()
if(censored)
DclassCensorTime.Add(GLOB.news_network.lastAction*-1)
else
DclassCensorTime.Add(GLOB.news_network.lastAction)
censored = !censored
GLOB.news_network.lastAction ++
/datum/newscaster/feed_channel/proc/toggleCensorAuthor()
if(authorCensor)
authorCensorTime.Add(GLOB.news_network.lastAction*-1)
else
authorCensorTime.Add(GLOB.news_network.lastAction)
authorCensor = !authorCensor
GLOB.news_network.lastAction ++
+4
View File
@@ -0,0 +1,4 @@
/datum/newscaster/feed_comment
var/author = ""
var/body = ""
var/time_stamp = ""
+47
View File
@@ -0,0 +1,47 @@
/datum/newscaster/feed_message
var/author =""
var/body =""
var/list/authorCensorTime = list()
var/list/bodyCensorTime = list()
var/is_admin_message = 0
var/icon/img = null
var/time_stamp = ""
var/list/datum/newscaster/feed_comment/comments = list()
var/locked = FALSE
var/caption = ""
var/creationTime
var/authorCensor
var/bodyCensor
var/photo_file
/datum/newscaster/feed_message/proc/returnAuthor(censor)
if(censor == -1)
censor = authorCensor
var/txt = "[GLOB.news_network.redactedText]"
if(!censor)
txt = author
return txt
/datum/newscaster/feed_message/proc/returnBody(censor)
if(censor == -1)
censor = bodyCensor
var/txt = "[GLOB.news_network.redactedText]"
if(!censor)
txt = body
return txt
/datum/newscaster/feed_message/proc/toggleCensorAuthor()
if(authorCensor)
authorCensorTime.Add(GLOB.news_network.lastAction*-1)
else
authorCensorTime.Add(GLOB.news_network.lastAction)
authorCensor = !authorCensor
GLOB.news_network.lastAction ++
/datum/newscaster/feed_message/proc/toggleCensorBody()
if(bodyCensor)
bodyCensorTime.Add(GLOB.news_network.lastAction*-1)
else
bodyCensorTime.Add(GLOB.news_network.lastAction)
bodyCensor = !bodyCensor
GLOB.news_network.lastAction ++
+71
View File
@@ -0,0 +1,71 @@
GLOBAL_DATUM_INIT(news_network, /datum/newscaster/feed_network, new)
/datum/newscaster/feed_network
var/list/datum/newscaster/feed_channel/network_channels = list()
var/datum/newscaster/wanted_message/wanted_issue
var/lastAction
var/redactedText = "\[REDACTED\]"
/datum/newscaster/feed_network/New()
CreateFeedChannel("Station Announcements", "SS13", 1)
wanted_issue = new /datum/newscaster/wanted_message
/datum/newscaster/feed_network/proc/CreateFeedChannel(channel_name, author, locked, adminChannel = 0)
var/datum/newscaster/feed_channel/newChannel = new /datum/newscaster/feed_channel
newChannel.channel_name = channel_name
newChannel.author = author
newChannel.locked = locked
newChannel.is_admin_channel = adminChannel
network_channels += newChannel
/datum/newscaster/feed_network/proc/SubmitArticle(msg, author, channel_name, datum/picture/picture, adminMessage = 0, allow_comments = 1)
var/datum/newscaster/feed_message/newMsg = new /datum/newscaster/feed_message
newMsg.author = author
newMsg.body = msg
newMsg.time_stamp = STATION_TIME_TIMESTAMP("hh:mm:ss", world.time)
newMsg.is_admin_message = adminMessage
newMsg.locked = !allow_comments
if(picture)
newMsg.img = picture.picture_image
newMsg.caption = picture.caption
newMsg.photo_file = save_photo(picture.picture_image)
for(var/datum/newscaster/feed_channel/FC in network_channels)
if(FC.channel_name == channel_name)
FC.messages += newMsg
break
for(var/obj/machinery/newscaster/NEWSCASTER in GLOB.allCasters)
NEWSCASTER.newsAlert(channel_name)
lastAction ++
newMsg.creationTime = lastAction
/datum/newscaster/feed_network/proc/submitWanted(criminal, body, scanned_user, datum/picture/picture, adminMsg = 0, newMessage = 0)
wanted_issue.active = 1
wanted_issue.criminal = criminal
wanted_issue.body = body
wanted_issue.scannedUser = scanned_user
wanted_issue.isAdminMsg = adminMsg
if(picture)
wanted_issue.img = picture.picture_image
wanted_issue.photo_file = save_photo(picture.picture_image)
if(newMessage)
for(var/obj/machinery/newscaster/N in GLOB.allCasters)
N.newsAlert()
N.update_icon()
/datum/newscaster/feed_network/proc/deleteWanted()
wanted_issue.active = 0
wanted_issue.criminal = null
wanted_issue.body = null
wanted_issue.scannedUser = null
wanted_issue.img = null
for(var/obj/machinery/newscaster/NEWSCASTER in GLOB.allCasters)
NEWSCASTER.update_icon()
/datum/newscaster/feed_network/proc/save_photo(icon/photo)
var/photo_file = copytext_char(md5("\icon[photo]"), 1, 6)
if(!fexists("[GLOB.log_directory]/photos/[photo_file].png"))
//Clean up repeated frames
var/icon/clean = new /icon()
clean.Insert(photo, "", SOUTH, 1, 0)
fcopy(clean, "[GLOB.log_directory]/photos/[photo_file].png")
return photo_file
+1
View File
@@ -0,0 +1 @@
/datum/newscaster
@@ -1,175 +1,5 @@
GLOBAL_DATUM_INIT(news_network, /datum/newscaster/feed_network, new)
GLOBAL_LIST_EMPTY(allCasters)
/datum/newscaster
/datum/newscaster/feed_comment
var/author = ""
var/body = ""
var/time_stamp = ""
/datum/newscaster/feed_message
var/author =""
var/body =""
var/list/authorCensorTime = list()
var/list/bodyCensorTime = list()
var/is_admin_message = 0
var/icon/img = null
var/time_stamp = ""
var/list/datum/newscaster/feed_comment/comments = list()
var/locked = FALSE
var/caption = ""
var/creationTime
var/authorCensor
var/bodyCensor
var/photo_file
/datum/newscaster/feed_message/proc/returnAuthor(censor)
if(censor == -1)
censor = authorCensor
var/txt = "[GLOB.news_network.redactedText]"
if(!censor)
txt = author
return txt
/datum/newscaster/feed_message/proc/returnBody(censor)
if(censor == -1)
censor = bodyCensor
var/txt = "[GLOB.news_network.redactedText]"
if(!censor)
txt = body
return txt
/datum/newscaster/feed_message/proc/toggleCensorAuthor()
if(authorCensor)
authorCensorTime.Add(GLOB.news_network.lastAction*-1)
else
authorCensorTime.Add(GLOB.news_network.lastAction)
authorCensor = !authorCensor
GLOB.news_network.lastAction ++
/datum/newscaster/feed_message/proc/toggleCensorBody()
if(bodyCensor)
bodyCensorTime.Add(GLOB.news_network.lastAction*-1)
else
bodyCensorTime.Add(GLOB.news_network.lastAction)
bodyCensor = !bodyCensor
GLOB.news_network.lastAction ++
/datum/newscaster/feed_channel
var/channel_name = ""
var/list/datum/newscaster/feed_message/messages = list()
var/locked = FALSE
var/author = ""
var/censored = 0
var/list/authorCensorTime = list()
var/list/DclassCensorTime = list()
var/authorCensor
var/is_admin_channel = 0
/datum/newscaster/feed_channel/proc/returnAuthor(censor)
if(censor == -1)
censor = authorCensor
var/txt = "[GLOB.news_network.redactedText]"
if(!censor)
txt = author
return txt
/datum/newscaster/feed_channel/proc/toggleCensorDclass()
if(censored)
DclassCensorTime.Add(GLOB.news_network.lastAction*-1)
else
DclassCensorTime.Add(GLOB.news_network.lastAction)
censored = !censored
GLOB.news_network.lastAction ++
/datum/newscaster/feed_channel/proc/toggleCensorAuthor()
if(authorCensor)
authorCensorTime.Add(GLOB.news_network.lastAction*-1)
else
authorCensorTime.Add(GLOB.news_network.lastAction)
authorCensor = !authorCensor
GLOB.news_network.lastAction ++
/datum/newscaster/wanted_message
var/active
var/criminal
var/body
var/scannedUser
var/isAdminMsg
var/icon/img
var/photo_file
/datum/newscaster/feed_network
var/list/datum/newscaster/feed_channel/network_channels = list()
var/datum/newscaster/wanted_message/wanted_issue
var/lastAction
var/redactedText = "\[REDACTED\]"
/datum/newscaster/feed_network/New()
CreateFeedChannel("Station Announcements", "SS13", 1)
wanted_issue = new /datum/newscaster/wanted_message
/datum/newscaster/feed_network/proc/CreateFeedChannel(channel_name, author, locked, adminChannel = 0)
var/datum/newscaster/feed_channel/newChannel = new /datum/newscaster/feed_channel
newChannel.channel_name = channel_name
newChannel.author = author
newChannel.locked = locked
newChannel.is_admin_channel = adminChannel
network_channels += newChannel
/datum/newscaster/feed_network/proc/SubmitArticle(msg, author, channel_name, datum/picture/picture, adminMessage = 0, allow_comments = 1)
var/datum/newscaster/feed_message/newMsg = new /datum/newscaster/feed_message
newMsg.author = author
newMsg.body = msg
newMsg.time_stamp = STATION_TIME_TIMESTAMP("hh:mm:ss", world.time)
newMsg.is_admin_message = adminMessage
newMsg.locked = !allow_comments
if(picture)
newMsg.img = picture.picture_image
newMsg.caption = picture.caption
newMsg.photo_file = save_photo(picture.picture_image)
for(var/datum/newscaster/feed_channel/FC in network_channels)
if(FC.channel_name == channel_name)
FC.messages += newMsg
break
for(var/obj/machinery/newscaster/NEWSCASTER in GLOB.allCasters)
NEWSCASTER.newsAlert(channel_name)
lastAction ++
newMsg.creationTime = lastAction
/datum/newscaster/feed_network/proc/submitWanted(criminal, body, scanned_user, datum/picture/picture, adminMsg = 0, newMessage = 0)
wanted_issue.active = 1
wanted_issue.criminal = criminal
wanted_issue.body = body
wanted_issue.scannedUser = scanned_user
wanted_issue.isAdminMsg = adminMsg
if(picture)
wanted_issue.img = picture.picture_image
wanted_issue.photo_file = save_photo(picture.picture_image)
if(newMessage)
for(var/obj/machinery/newscaster/N in GLOB.allCasters)
N.newsAlert()
N.update_icon()
/datum/newscaster/feed_network/proc/deleteWanted()
wanted_issue.active = 0
wanted_issue.criminal = null
wanted_issue.body = null
wanted_issue.scannedUser = null
wanted_issue.img = null
for(var/obj/machinery/newscaster/NEWSCASTER in GLOB.allCasters)
NEWSCASTER.update_icon()
/datum/newscaster/feed_network/proc/save_photo(icon/photo)
var/photo_file = copytext_char(md5("\icon[photo]"), 1, 6)
if(!fexists("[GLOB.log_directory]/photos/[photo_file].png"))
//Clean up repeated frames
var/icon/clean = new /icon()
clean.Insert(photo, "", SOUTH, 1, 0)
fcopy(clean, "[GLOB.log_directory]/photos/[photo_file].png")
return photo_file
/obj/item/wallframe/newscaster
name = "newscaster frame"
desc = "Used to build newscasters, just secure to the wall."
@@ -177,7 +7,6 @@ GLOBAL_LIST_EMPTY(allCasters)
materials = list(MAT_METAL=14000, MAT_GLASS=8000)
result_path = /obj/machinery/newscaster
/obj/machinery/newscaster
name = "newscaster"
desc = "A standard Nanotrasen-licensed newsfeed handler for use in commercial space stations. All the news you absolutely have no use for, in one place!"
@@ -0,0 +1,8 @@
/datum/newscaster/wanted_message
var/active
var/criminal
var/body
var/scannedUser
var/isAdminMsg
var/icon/img
var/photo_file