mirror of
https://github.com/vgstation-coders/vgstation13.git
synced 2025-12-09 16:14:13 +00:00
Adds themes, better definition of rerun, 85% tested
This commit is contained in:
parent
f070c9ec6c
commit
0af42c2830
@@ -1508,15 +1508,15 @@ proc/formatPlayerPanel(var/mob/U,var/text="PP")
|
||||
|
||||
var/dat = "<center><B>Credits Panel</B></center><hr>"
|
||||
dat += "<center><B>Star Of The Show:</b></center>"
|
||||
dat += "Chosen Star: [isnull(end_credits.star) ? "(Will Select Automatically)" : end_credits.star] <A href='?src=\ref[src];credits=setstartext'>(Set Plaintext)</A> <A href='?src=\ref[src];credits=setstarmob'>(Set Mob From List)</A> "
|
||||
if(!isnull(end_credits.star) && !end_credits.drafted)
|
||||
dat += "Chosen Star: [end_credits.star == "" && end_credits.customized_star == "" ? "(Will Select Automatically)" : end_credits.star || end_credits.customized_star] <A href='?src=\ref[src];credits=setstartext'>(Set Plaintext)</A> <A href='?src=\ref[src];credits=setstarmob'>(Set Mob From List)</A> "
|
||||
if(end_credits.customized_star != "" && !end_credits.drafted)
|
||||
dat += "<A href='?src=\ref[src];credits=resetstar'>(Reset)</A> "
|
||||
if(!end_credits.drafted)
|
||||
dat += "<span style='color:red'><br>The round isn't over, so the featured star hasn't been picked yet.<br>You can manually set one now, or whichever human has talked the most this round will automatically be selected as the featured star when the round ends.</span>"
|
||||
dat += "<hr>"
|
||||
dat += "<center><B>Episode Name:</B></center>"
|
||||
dat += "Chosen Name: [end_credits.episode_name == "" ? "(Will Generate Automatically)" : end_credits.episode_name] <A href='?src=\ref[src];credits=setname'>(Set)</A> "
|
||||
if(end_credits.episode_name != "" && !end_credits.drafted)
|
||||
dat += "Chosen Name: [end_credits.episode_name == "" && end_credits.customized_name == "" ? "(Will Generate Automatically)" : end_credits.episode_name || end_credits.customized_name] <A href='?src=\ref[src];credits=setname'>(Set)</A> "
|
||||
if(end_credits.customized_name != "" && !end_credits.drafted)
|
||||
dat += "<A href='?src=\ref[src];credits=resetname'>(Reset)</A> "
|
||||
else if(end_credits.drafted)
|
||||
dat += "<A href='?src=\ref[src];credits=rerollname'>(Reroll!)</A> "
|
||||
|
||||
@@ -4836,37 +4836,36 @@
|
||||
switch(href_list["credits"])
|
||||
if("resetstar")
|
||||
if(!end_credits.drafted) //Just in case the button somehow gets clicked when it shouldn't
|
||||
end_credits.star = null
|
||||
end_credits.customized_star = ""
|
||||
log_admin("[key_name(usr)] reset the current round's featured star. A new one will automatically generate later.")
|
||||
message_admins("[key_name_admin(usr)] reset the current round's featured star. A new one will automatically generate later.")
|
||||
if("setstartext")
|
||||
var/newstar = thebigstar(input(usr,"Write the new star. In the final credits, it will be displayed as: 'Starring\[linebreak\]\[whatever you type here\]'. Mind your capitalization! You may also use HTML. Do not include the characters '%<splashbreak>' anywhere unless you know what you're doing, please.","in my dream, i am the star. its me",null) as text|null)
|
||||
var/newstar = thebigstar(input(usr,"Write the new star. In the final credits, it will be displayed as: 'Starring\[linebreak\]\[whatever you type here\]'. Mind your capitalization! You may also use HTML. Do not include the characters '%<splashbreak>' anywhere unless you know what you're doing, please.","in my dream, i am the star. its me", end_credits.star) as text|null)
|
||||
if(newstar)
|
||||
end_credits.star = newstar
|
||||
end_credits.customized_star = newstar
|
||||
log_admin("[key_name(usr)] forced the current round's featured star to be '[newstar]'")
|
||||
message_admins("[key_name_admin(usr)] forced the current round's featured star to be '[newstar]'")
|
||||
if("setstarmob")
|
||||
var/newstar = thebigstar(input(usr, "Who should be the featured star of this episode? WARNING: Only tested with humans.", "New star from moblist...") as null|anything in sortmobs())
|
||||
if(newstar)
|
||||
end_credits.star = newstar
|
||||
end_credits.customized_star = newstar
|
||||
log_admin("[key_name(usr)] forced the current round's featured star to be '[newstar]'")
|
||||
message_admins("[key_name_admin(usr)] forced the current round's featured star to be '[newstar]'")
|
||||
|
||||
if("resetname")
|
||||
if(!end_credits.drafted) //Just in case the button somehow gets clicked when it shouldn't
|
||||
end_credits.episode_name = ""
|
||||
end_credits.is_rerun = initial(end_credits.is_rerun)
|
||||
end_credits.customized_name = ""
|
||||
log_admin("[key_name(usr)] reset the current round's episode name. A new one will automatically generate later.")
|
||||
message_admins("[key_name_admin(usr)] reset the current round's episode name. A new one will automatically generate later.")
|
||||
if("rerollname")
|
||||
end_credits.pick_name()
|
||||
end_credits.customized_name = ""
|
||||
end_credits.finalize_name()
|
||||
log_admin("[key_name(usr)] re-rolled the current round's episode name. New name: '[end_credits.episode_name]'")
|
||||
message_admins("[key_name_admin(usr)] re-rolled the current round's episode name. New name: '[end_credits.episode_name]'")
|
||||
if("setname")
|
||||
var/newname = input(usr,"Write the name of this latest rerun...","New Episode Name") as text|null
|
||||
var/newname = input(usr,"Write the super original name of this masterpiece...","New Episode Name") as text|null
|
||||
if(newname)
|
||||
end_credits.episode_name = uppertext(newname)
|
||||
end_credits.is_rerun = FALSE
|
||||
end_credits.customized_name = uppertext(newname)
|
||||
log_admin("[key_name(usr)] forced the current round's episode name to '[newname]'")
|
||||
message_admins("[key_name_admin(usr)] forced the current round's episode name to '[newname]'")
|
||||
|
||||
|
||||
@@ -384,7 +384,7 @@ var/const/MAX_SAVE_SLOTS = 8
|
||||
<a href='?_src_=prefs;preference=special_popup'><b>[special_popup ? "Yes" : "No"]</b></a><br>
|
||||
<b>Attack Animations:<b>
|
||||
<a href='?_src_=prefs;preference=attack_animation'><b>[attack_animation ? (attack_animation == ITEM_ANIMATION? "Item Anim." : "Person Anim.") : "No"]</b></a><br>
|
||||
<b>Show Credits <span title=''No Reruns' will roll credits only if an admin set a special episode name, or if a rare and exclusive episode name was selected thanks to something uncommon happening that round.'>(?):</span><b>
|
||||
<b>Show Credits <span title=''No Reruns' will roll credits only if an admin customized something about this round's credits, or if a rare and exclusive episode name was selected thanks to something uncommon happening that round.'>(?):</span><b>
|
||||
<a href='?_src_=prefs;preference=credits'><b>[credits]</b></a><br>
|
||||
<b>Server Shutdown Jingle <span title='These jingles will only play if credits don't roll for you that round. 'Classics' will only play 'APC Destroyed' and 'Banging Donk', 'All' will play the previous plus retro videogame sounds.'>(?):</span><b>
|
||||
<a href='?_src_=prefs;preference=jingle'><b>[jingle]</b></a><br>
|
||||
|
||||
@@ -9,21 +9,24 @@ var/global/datum/credits/end_credits = new
|
||||
var/file = 'code/modules/credits/credits.html'
|
||||
|
||||
var/director = "Pomf Chicken Productions"
|
||||
var/theme = "NT"
|
||||
var/list/producers = list()
|
||||
var/mob/living/carbon/human/most_talked //Human that talked the most this round. Will become the star if admins don't set one.
|
||||
var/star //Is text returned by thebigstar(), not a mob.
|
||||
var/star = ""
|
||||
var/list/disclaimers = list()
|
||||
var/list/datum/episode_name/episode_names = list()
|
||||
var/episode_name = ""
|
||||
var/is_rerun = TRUE //A 'rerun' is defined as a round where no admin set a custom episode name and the rolled episode name wasn't of the /rare subtype.
|
||||
|
||||
var/episode_name = ""
|
||||
var/producers_string = ""
|
||||
var/episode_string = ""
|
||||
var/cast_string = ""
|
||||
var/disclaimers_string = ""
|
||||
var/star_string = ""
|
||||
|
||||
//If any of the following four are modified, the episode is considered "not a rerun".
|
||||
var/customized_name = ""
|
||||
var/customized_star = ""
|
||||
var/rare_episode_name = FALSE
|
||||
var/theme = "NT"
|
||||
|
||||
var/drafted = FALSE
|
||||
var/finalized = FALSE
|
||||
var/js_args = list()
|
||||
@@ -48,6 +51,12 @@ var/global/datum/credits/end_credits = new
|
||||
"http://ss13.moe/media/source/roundend/jinglenew/tfvictory.mp3"
|
||||
)
|
||||
|
||||
/datum/credits/proc/is_rerun()
|
||||
if(customized_name != "" || customized_star != "" || rare_episode_name == TRUE || theme != initial(theme))
|
||||
return FALSE
|
||||
else
|
||||
return TRUE
|
||||
|
||||
/*
|
||||
* draft():
|
||||
* Stage 1 of credit assembly. Called as soon as the rock cooks. Picks the episode names, staff, etc.
|
||||
@@ -76,8 +85,7 @@ var/global/datum/credits/end_credits = new
|
||||
if(!drafted) //In case the world is rebooted without the round ending normally.
|
||||
draft()
|
||||
|
||||
if(episode_name == "") //admin might've already set one
|
||||
pick_name()
|
||||
finalize_name()
|
||||
finalize_episodestring()
|
||||
finalize_starstring()
|
||||
finalize_disclaimerstring() //finalize it after the admins have had time to edit them
|
||||
@@ -86,7 +94,7 @@ var/global/datum/credits/end_credits = new
|
||||
var/splashytext = producers_string + star_string
|
||||
|
||||
finalized = TRUE
|
||||
js_args = list(scrollytext, splashytext, scroll_speed, splash_time) //arguments for the makeCredits function back in the javascript
|
||||
js_args = list(scrollytext, splashytext, theme, scroll_speed, splash_time) //arguments for the makeCredits function back in the javascript
|
||||
|
||||
/*
|
||||
* send2clients():
|
||||
@@ -140,7 +148,7 @@ var/global/datum/credits/end_credits = new
|
||||
if(CREDITS_ALWAYS)
|
||||
C.credits_audio()
|
||||
if(CREDITS_NO_RERUNS) //The time has come to decide. Shall we play credits audio, or preload the jingle audio instead?
|
||||
if(!is_rerun)
|
||||
if(!is_rerun())
|
||||
C.credits_audio()
|
||||
else
|
||||
C.jingle_audio(preload_only = TRUE)
|
||||
@@ -164,7 +172,10 @@ var/global/datum/credits/end_credits = new
|
||||
|
||||
|
||||
|
||||
/datum/credits/proc/pick_name()
|
||||
/datum/credits/proc/finalize_name()
|
||||
if(customized_name)
|
||||
episode_name = customized_name
|
||||
return
|
||||
var/list/drafted_names = list()
|
||||
var/list/is_rare_assoc_list = list()
|
||||
for(var/datum/episode_name/N in episode_names)
|
||||
@@ -172,13 +183,13 @@ var/global/datum/credits/end_credits = new
|
||||
is_rare_assoc_list["[N.thename]"] = N.rare
|
||||
episode_name = pickweight(drafted_names)
|
||||
if(is_rare_assoc_list[episode_name] == TRUE)
|
||||
is_rerun = FALSE
|
||||
rare_episode_name = TRUE
|
||||
|
||||
/datum/credits/proc/finalize_episodestring(var/thename)
|
||||
/datum/credits/proc/finalize_episodestring()
|
||||
var/season = rand(1,22)
|
||||
var/episodenum = rand(1,17) //Maybe we could do this cumulatively so that the round after 670 becomes 671 etc and the season is just the last 2 numbers of the current IRL year?
|
||||
episode_string = "<h1>SEASON [season] EPISODE [episodenum]<br>[episode_name]</h1><br><div style='padding-bottom: 75px;'></div>"
|
||||
log_game("So ends [is_rerun ? "another rerun of " : ""]SEASON [season] EPISODE [episodenum] - [episode_name]")
|
||||
episode_string = "<h1><span id='episodenumber'>SEASON [season] EPISODE [episodenum]</span><br><span id='episodename'>[episode_name]</span></h1><br><div style='padding-bottom: 75px;'></div>"
|
||||
log_game("So ends [is_rerun() ? "another rerun of " : ""]SEASON [season] EPISODE [episodenum] - [episode_name]")
|
||||
|
||||
/datum/credits/proc/finalize_disclaimerstring()
|
||||
disclaimers_string = "<div class='disclaimers'>"
|
||||
@@ -211,13 +222,19 @@ var/global/datum/credits/end_credits = new
|
||||
producers_string += "[producer]%<splashbreak>" //%<splashbreak> being an arbitrary "new splash card" char we use to split this string back in the javascript
|
||||
|
||||
/datum/credits/proc/draft_star()
|
||||
if(star)
|
||||
star = thebigstar(star)
|
||||
else if(most_talked)
|
||||
star = thebigstar(most_talked) //We want this ran now, in case the star gibs before the credits roll etc
|
||||
if(customized_star)
|
||||
star = customized_star
|
||||
return
|
||||
var/mob/living/carbon/human/most_talked
|
||||
for(var/mob/living/carbon/human/H in mob_list)
|
||||
if(!H.key || H.iscorpse)
|
||||
continue
|
||||
if(!most_talked || H.talkcount > most_talked.talkcount)
|
||||
most_talked = H
|
||||
star = thebigstar(most_talked)
|
||||
|
||||
/datum/credits/proc/finalize_starstring()
|
||||
if(star_string)
|
||||
if(star == "")
|
||||
return
|
||||
star_string = "<h1>Starring<br>[star]</h1><br>%<splashbreak>" //%<splashbreak> being an arbitrary "new splash card" char we use to split this string back in the javascript
|
||||
|
||||
@@ -227,9 +244,6 @@ var/global/datum/credits/end_credits = new
|
||||
for(var/mob/living/carbon/human/H in mob_list)
|
||||
if(!H.key || H.iscorpse)
|
||||
continue
|
||||
if(!most_talked || H.talkcount > most_talked.talkcount)
|
||||
most_talked = H
|
||||
|
||||
cast_string += "[gender_credits(H)]"
|
||||
|
||||
for(var/mob/living/silicon/S in mob_list)
|
||||
|
||||
@@ -118,12 +118,13 @@
|
||||
}
|
||||
}
|
||||
|
||||
function setupCredits(scrollyString, splashyString, newScrollSpeed, newSplashTime){
|
||||
function setupCredits(scrollyString, splashyString, theme, newScrollSpeed, newSplashTime){
|
||||
if(newSplashTime !== undefined) {splashTime = parseInt(newSplashTime)}
|
||||
if(newScrollSpeed !== undefined) {scrollSpeed = parseInt(newScrollSpeed)}
|
||||
|
||||
setScrollingText(scrollyString);
|
||||
setSplashyText(splashyString);
|
||||
applyTheme(theme);
|
||||
initialized = 1;
|
||||
}
|
||||
|
||||
@@ -164,6 +165,24 @@
|
||||
}, speed);
|
||||
}
|
||||
|
||||
function applyTheme(theme){
|
||||
if(!theme)
|
||||
return
|
||||
switch(theme){
|
||||
case "clown":
|
||||
var crayons = ['red', 'orange', 'yellow', 'green', 'cyan', 'purple'];
|
||||
var divs = document.getElementsByTagName('*');
|
||||
for(var i=0; i<divs.length; i++) {
|
||||
divs[i].style.color = crayons[Math.floor(Math.random() * crayons.length)]
|
||||
divs[i].style.fontFamily = "Comic Sans MS, cursive, sans-serif";
|
||||
}
|
||||
break;
|
||||
case "cooks":
|
||||
document.getElementsByTagName("style")[0].innerHTML += ".actorname, .actorrole, #splash, #episodename {color: rgb(230, 209, 64); font-family: Georgia, serif; font-variant: small-caps; font-style: italic; font-weight: 400; text-shadow: rgb(123, 96, 38) 1.5px 1.5px 0px, rgb(123, 96, 38) 1px 1px 0.1px; overflow: visible !important;} #episodename {font-size: 175%;}"
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
function debugMe(){
|
||||
document.documentElement.innerHTML = "<textarea rows='4' cols='50'>" + document.documentElement.innerHTML + "</" + "textarea>";
|
||||
runByond('byond://winset?id=mapwindow.credits;is-visible=true');
|
||||
|
||||
@@ -43,7 +43,7 @@
|
||||
|
||||
|
||||
/datum/episode_name/proc/make_div(var/admindatum) //This is just for the admin panel.
|
||||
. = "[weight]% <a href='?src=\ref[admindatum];credits=namedatumweight;nameref=\ref[src]'>(Set)</a> - "
|
||||
. = "[rare ? "<span style='color:green' title='Rare, not-a-rerun episode name!'>" + "[weight]" + "%</span>" : "[weight]" + "%"] <a href='?src=\ref[admindatum];credits=namedatumweight;nameref=\ref[src]'>(Set)</a> - "
|
||||
. += "[thename] - <a href='?src=\ref[admindatum];credits=namedatumedit;nameref=\ref[src]'>(Edit)</a> "
|
||||
. += "<a href='?src=\ref[admindatum];credits=namedatumremove;nameref=\ref[src]'>(Remove)</a> "
|
||||
. += "<span title='[reason]'>(?)</span>"
|
||||
@@ -84,7 +84,7 @@
|
||||
if(ticker.explosion_in_progress || ticker.station_was_nuked)
|
||||
episode_names += new /datum/episode_name/rare("[pick("THE CREW GETS NUKED", "THE CREW IS THE BOMB", "THE CREW BLASTS OFF AGAIN!", "THE 'BOOM' HEARD 'ROUND THE WORLD", 25;"THE BIG BANG THEORY")]", "The station was nuked!", 350)
|
||||
if((locate(/datum/dynamic_ruleset/roundstart/nuclear) in mode.executed_rules) || (locate(/datum/dynamic_ruleset/midround/from_ghosts/faction_based/nuclear) in mode.executed_rules))
|
||||
theme = "Syndie" //This really should use the nukeop's check_win(), but it wasn't coded like that.
|
||||
theme = "syndie" //This really should use the nukeop's check_win(), but the newcops gamemode wasn't coded like that.
|
||||
else
|
||||
if((locate(/datum/dynamic_ruleset/roundstart/nuclear) in mode.executed_rules) || (locate(/datum/dynamic_ruleset/midround/from_ghosts/faction_based/nuclear) in mode.executed_rules))
|
||||
episode_names += new /datum/episode_name/rare("[pick("THE CREW SOLVES THE NUCLEAR CRISIS", "BLAST, FOILED AGAIN", "FISSION MAILED", 50;"I OPENED THE WINDOW, AND IN FLEW COPS")]", "The crew defeated the nuclear operatives.", 350)
|
||||
@@ -219,12 +219,14 @@
|
||||
|
||||
if(clowncount > 3)
|
||||
episode_names += new /datum/episode_name/rare("CLOWNS GALORE", "There were [clowncount] clowns on the shuttle.", min(1500, clowncount*200))
|
||||
theme = "clown"
|
||||
if(mimecount > 3)
|
||||
episode_names += new /datum/episode_name/rare("THE SILENT SHUFFLE", "There were [mimecount] mimes on the shuttle.", min(1500, mimecount*200))
|
||||
if(chaplaincount > 2)
|
||||
episode_names += new /datum/episode_name/rare("COUNT YOUR BLESSINGS", "There were [chaplaincount] chaplains on the shuttle. Like, the real deal, not just clothes.", min(1500, chaplaincount*450))
|
||||
if(chefcount > 2)
|
||||
episode_names += new /datum/episode_name/rare("<span style='color: rgb(230, 209, 64); font-family: Georgia, serif; font-variant: small-caps; font-style: italic; font-weight: 400; font-size: 175%; text-shadow: rgb(123, 96, 38) 1.5px 1.5px 0px, rgb(123, 96, 38) 1.5px 1.5px 0.1px;'>Too Many Cooks</span>", "There were [chefcount] chefs on the shuttle.", min(1500, chefcount*450)) //intentionally not capitalized
|
||||
episode_names += new /datum/episode_name/rare("Too Many Cooks", "There were [chefcount] chefs on the shuttle.", min(1500, chefcount*450)) //intentionally not capitalized, as the theme will customize it
|
||||
theme = "cooks"
|
||||
if(assistantcount / human_escapees.len > 0.6 && human_escapees.len > 3)
|
||||
episode_names += new /datum/episode_name/rare("[pick("GREY GOO", "RISE OF THE GREYTIDE")]", "Most of the survivors were Assistants, or at least dressed like one.", min(1500, assistantcount*200))
|
||||
if(skeletoncount / human_escapees.len > 0.6 && human_escapees.len > 3)
|
||||
@@ -244,7 +246,7 @@
|
||||
var/mob/living/carbon/human/H = human_escapees[1]
|
||||
|
||||
if(istraitor(H) || isdoubleagent(H) || isnukeop(H))
|
||||
theme = "Syndie"
|
||||
theme = "syndie"
|
||||
|
||||
if(!H.isUnconscious() && H.mind && H.mind.assigned_role == "Chef")
|
||||
var/chance = 250
|
||||
@@ -264,6 +266,7 @@
|
||||
if(H.is_wearing_any(list(/obj/item/clothing/under/rank/clown, /obj/item/clothing/under/jester)))
|
||||
chance += 250
|
||||
episode_names += new /datum/episode_name/rare("[pick("COME HELL OR HIGH HONKER", "THE LAST LAUGH")]", "The Clown was the only survivor in the shuttle.", chance)
|
||||
theme = "clown"
|
||||
else if(!H.isUnconscious() && H.mind && H.mind.assigned_role == "Internal Affairs Agent")
|
||||
var/chance = 250
|
||||
if(H.is_holding_item(/obj/item/weapon/storage/briefcase))
|
||||
|
||||
BIN
icons/credits/4_themed_clown.png
Normal file
BIN
icons/credits/4_themed_clown.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 22 KiB |
BIN
icons/credits/4_themed_cooks.png
Normal file
BIN
icons/credits/4_themed_cooks.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 28 KiB |
Reference in New Issue
Block a user