[MDB Ignore][Bounty][Complete Refactor] Papercode Redux: Too Many Damn Files <Map Conflict Edition> (#68612)

Papercode refactor
This commit is contained in:
Timberpoes
2022-08-02 19:27:42 +02:00
committed by GitHub
parent ffad9f06b8
commit 786ac5c855
130 changed files with 2061 additions and 1551 deletions
@@ -1,7 +1,7 @@
/obj/item/paper/crumpled/muddy/fluff/cannon_instructions
name = "Mast of Cannon's Past's Cannon Instructions"
desc = "A quickly written note detailing the basics of firing a cannon. Who wrote this?"
info = @{"
default_raw_text = @{"
Ye don't know how to load cannon, and ye call yerself a fearsome pirate? I think ye be more alike a space sailor under the space monarchy's flag! Alas, everyone must learn how to blast holes in enemy ships. And thus:<br>
@@ -44,9 +44,10 @@
//Sad trombone
if(pickednum == 1)
var/obj/item/paper/P = new /obj/item/paper(src)
P.name = "\improper IOU"
P.info = "Sorry man, we needed the money so we sold your stash. It's ok, we'll double our money for sure this time!"
var/obj/item/paper/paper = new /obj/item/paper(src)
paper.name = "\improper IOU"
paper.add_raw_text("Sorry man, we needed the money so we sold your stash. It's ok, we'll double our money for sure this time!")
paper.update_appearance()
//Iron (common ore)
if(pickednum >= 2)
+1 -1
View File
@@ -212,7 +212,7 @@ GLOBAL_LIST_EMPTY(bodycontainers) //Let them act as spawnpoints for revenants an
/obj/item/paper/guides/jobs/medical/morgue
name = "morgue memo"
info = "<font size='2'>Since this station's medbay never seems to fail to be staffed by the mindless monkeys meant for genetics experiments, I'm leaving a reminder here for anyone handling the pile of cadavers the quacks are sure to leave.</font><BR><BR><font size='4'><font color=red>Red lights mean there's a plain ol' dead body inside.</font><BR><BR><font color=orange>Yellow lights mean there's non-body objects inside.</font><BR><font size='2'>Probably stuff pried off a corpse someone grabbed, or if you're lucky it's stashed booze.</font><BR><BR><font color=green>Green lights mean the morgue system detects the body may be able to be brought back to life.</font></font><BR><font size='2'>I don't know how that works, but keep it away from the kitchen and go yell at the geneticists.</font><BR><BR>- CentCom medical inspector"
default_raw_text = "<font size='2'>Since this station's medbay never seems to fail to be staffed by the mindless monkeys meant for genetics experiments, I'm leaving a reminder here for anyone handling the pile of cadavers the quacks are sure to leave.</font><BR><BR><font size='4'><font color=red>Red lights mean there's a plain ol' dead body inside.</font><BR><BR><font color=orange>Yellow lights mean there's non-body objects inside.</font><BR><font size='2'>Probably stuff pried off a corpse someone grabbed, or if you're lucky it's stashed booze.</font><BR><BR><font color=green>Green lights mean the morgue system detects the body may be able to be brought back to life.</font></font><BR><font size='2'>I don't know how that works, but keep it away from the kitchen and go yell at the geneticists.</font><BR><BR>- CentCom medical inspector"
/*
* Crematorium
+22 -13
View File
@@ -116,9 +116,13 @@
voted += voter_card
to_chat(user,span_notice("You cast your vote."))
/obj/structure/votebox/proc/valid_vote(obj/item/paper/I)
if(I.get_info_length() > VOTE_TEXT_LIMIT || findtext(I.info,"<h1>Voting Results:</h1><hr><ol>"))
/obj/structure/votebox/proc/valid_vote(obj/item/paper/voting_slip)
if(voting_slip.get_total_length() > VOTE_TEXT_LIMIT)
return FALSE
for(var/datum/paper_input/text as anything in voting_slip.raw_text_inputs)
if(findtext(text.raw_text, "<h1>Voting Results:</h1><hr><ol>"))
return FALSE
return TRUE
/obj/structure/votebox/proc/shred(mob/user)
@@ -163,21 +167,26 @@
/obj/structure/votebox/proc/print_tally(mob/user)
var/list/results = list()
var/i = 0
for(var/obj/item/paper/P in contents)
for(var/obj/item/paper/paper_content in contents)
if(i++ > MAX_VOTES)
break
var/text = P.info
if(!valid_vote(P))
if(!valid_vote(paper_content))
continue
if(!results[text])
results[text] = 1
var/full_vote_text = ""
for(var/datum/paper_input/text as anything in paper_content.raw_text_inputs)
full_vote_text += "[text.raw_text]<br>"
if(!results[full_vote_text])
results[full_vote_text] = 1
else
results[text] += 1
results[full_vote_text] += 1
sortTim(results, cmp=/proc/cmp_numeric_dsc, associative = TRUE)
if(!COOLDOWN_FINISHED(src, vote_print_cooldown))
return
COOLDOWN_START(src, vote_print_cooldown, 60 SECONDS)
var/obj/item/paper/P = new(drop_location())
var/obj/item/paper/vote_tally_paper = new(drop_location())
var/list/tally = list()
tally += {"
<style>
@@ -203,10 +212,10 @@
tally += "<li>\"<div class='vote_box_content'>[option]</div>\" - [results[option]] Vote[results[option] > 1 ? "s" : ""].</li>"
tally += "</ol>"
P.info = tally.Join()
P.name = "Voting Results"
P.update_appearance()
user.put_in_hands(P)
vote_tally_paper.add_raw_text(tally.Join())
vote_tally_paper.name = "Voting Results"
vote_tally_paper.update_appearance()
user.put_in_hands(vote_tally_paper)
to_chat(user,span_notice("[src] prints out the voting tally."))
/obj/structure/votebox/update_icon_state()