converts contraband file into poster file, makes holiday posters work (kind of) (#72131)

## About The Pull Request

The first part of this is just something that bothered me when I was
messing around with something that I will PR in the new year,
contraband.dm and dmi is ONLY posters. There's nothing else in there and
there are plenty of official posters, and if with #71717 we will also
add holiday posters to the mix then I think that its time to retire
contraband and make it poster.

Some small things I did while messing with it was change some variables
that were single letters into actual variable names, but overall this
part of the pr is not a player facing change.

That said, speaking of #71717 I think that it didn't work? Or didn't
work the way that it was supposed to? All of the spawned posters aren't
instances of festive posters, they are instances of normal posters, so
the code on initialize was not doing anything and the only reason the
holiday_none poster was showing up was because of the proc in randomize
spawning the posters in as those other posters. Because it didn't
actually _become_ poster/official/festive it never could do the proc
that turns it into a poster for the holiday that is actually occurring.

But then when I made it work and it turned into the generic posters I
decided that it would be better if instead of 30% of all posters being a
half finished mess, that if there wasn't a holiday poster it just
wouldn't replace them at all. I have poster Ideas and Dreams so I will
try to help with adding to more holiday posters but not in this PR.

What IS in this PR though, is a new traitor poster that appears during
the holidays.

![dreamseeker_MxxBzXIxiy](https://user-images.githubusercontent.com/116288367/208793262-9d4a45dc-f7bb-4208-b3c3-78cb68cf9af5.png)

This is a generic evil holiday poster that will replace normal evil
posters in the evil poster objective, because I agree with #72003 that
it should be a feature.

## Why It's Good For The Game

Contraband file is just posters already, this is easier for people to
find the posters.
I like holiday posters and think that we should have them and add more,
it is a fun easy thing to add to a lot of the microholidays to make them
more visible in addition to the name generation, but I don't want to see
the unfinished holiday poster so I do think that it's better to only
have them spawn if the holiday actually has a poster. Looking forward to
febuary!

## Changelog

🆑
add: during holidays the spread syndicate propaganda through posters
objective has a chance of spawning evil holiday poster
fix: framework for holiday posters is more functional and modular
code: contraband.dm file and contraband.dmi file are both now poster.dm
and poster.dmi
/🆑
This commit is contained in:
Sol N
2022-12-24 23:44:49 +00:00
committed by GitHub
parent e65ee1100a
commit cba002fa91
6 changed files with 42 additions and 28 deletions
@@ -14,7 +14,7 @@
/obj/item/poster
name = "poorly coded poster"
desc = "You probably shouldn't be holding this."
icon = 'icons/obj/contraband.dmi'
icon = 'icons/obj/poster.dmi'
force = 0
resistance_flags = FLAMMABLE
var/poster_type
@@ -101,7 +101,7 @@
name = "poster"
var/original_name
desc = "A large piece of space-resistant printed paper."
icon = 'icons/obj/contraband.dmi'
icon = 'icons/obj/poster.dmi'
anchored = TRUE
buildable_sign = FALSE //Cannot be unwrenched from a wall.
var/ruined = FALSE
@@ -149,14 +149,11 @@
/obj/structure/sign/poster/proc/randomise(base_type)
var/list/poster_types = subtypesof(base_type)
var/list/approved_types = list()
for(var/t in poster_types)
var/obj/structure/sign/poster/T = t
if(initial(T.icon_state) && !initial(T.never_random))
approved_types |= T
for(var/obj/structure/sign/poster/type_of_poster as anything in poster_types)
if(initial(type_of_poster.icon_state) && !initial(type_of_poster.never_random))
approved_types |= type_of_poster
var/obj/structure/sign/poster/selected = pick(approved_types)
if(length(GLOB.holidays) && prob(30)) // its the holidays! lets get festive
selected = /obj/structure/sign/poster/official/festive
name = initial(selected.name)
desc = initial(selected.desc)
@@ -165,11 +162,26 @@
poster_item_desc = initial(selected.poster_item_desc)
poster_item_icon_state = initial(selected.poster_item_icon_state)
ruined = initial(selected.ruined)
if(length(GLOB.holidays) && prob(30)) // its the holidays! lets get festive
apply_holiday()
update_appearance()
/obj/structure/sign/poster/attackby(obj/item/I, mob/user, params)
if(I.tool_behaviour == TOOL_WIRECUTTER)
I.play_tool_sound(src, 100)
/// allows for posters to become festive posters during holidays
/obj/structure/sign/poster/proc/apply_holiday()
if(!length(GLOB.holidays))
return
var/active_holiday = pick(GLOB.holidays)
var/datum/holiday/holi_data = GLOB.holidays[active_holiday]
if(holi_data.poster_name == "generic celebration poster")
return
name = holi_data.poster_name
desc = holi_data.poster_desc
icon_state = holi_data.poster_icon
/obj/structure/sign/poster/attackby(obj/item/tool, mob/user, params)
if(tool.tool_behaviour == TOOL_WIRECUTTER)
tool.play_tool_sound(src, 100)
if(ruined)
to_chat(user, span_notice("You remove the remnants of the poster."))
qdel(src)
@@ -1048,15 +1060,4 @@ MAPPING_DIRECTIONAL_HELPERS(/obj/structure/sign/poster/official/random, 32)
desc = "A poster that informs of active holidays. None are today, so you should get back to work."
icon_state = "holiday_none"
/obj/structure/sign/poster/official/festive/Initialize()
. = ..()
if(!length(GLOB.holidays))
return
var/active_holiday = pick(GLOB.holidays)
var/datum/holiday/holi_data = GLOB.holidays[active_holiday]
name = holi_data.poster_name
desc = holi_data.poster_desc
icon_state = holi_data.poster_icon
#undef PLACE_SPEED
+3 -3
View File
@@ -8,7 +8,7 @@
*/
/obj/item/poster/wanted
icon_state = "rolled_poster"
icon_state = "rolled_poster_legit"
var/postHeaderText = "WANTED" // MAX 7 Characters
var/postHeaderColor = "#FF0000"
var/background = "wanted_background"
@@ -67,8 +67,8 @@
print_across_top(the_icon, postHeaderText, postHeaderColor)
the_icon.Insert(the_icon, "wanted")
the_icon.Insert(icon('icons/obj/contraband.dmi', "poster_being_set"), "poster_being_set")
the_icon.Insert(icon('icons/obj/contraband.dmi', "poster_ripped"), "poster_ripped")
the_icon.Insert(icon('icons/obj/poster.dmi', "poster_being_set"), "poster_being_set")
the_icon.Insert(icon('icons/obj/poster.dmi', "poster_ripped"), "poster_ripped")
icon = the_icon
@@ -91,13 +91,19 @@
/// Proximity sensor to make people sad if they're nearby
var/datum/proximity_monitor/advanced/demoraliser/demoraliser
/obj/structure/sign/poster/traitor/apply_holiday()
var/obj/structure/sign/poster/traitor/holi_data = /obj/structure/sign/poster/traitor/festive
name = initial(holi_data.name)
desc = initial(holi_data.desc)
icon_state = initial(holi_data.icon_state)
/obj/structure/sign/poster/traitor/on_placed_poster(mob/user)
var/datum/demoralise_moods/poster/mood_category = new()
demoraliser = new(src, 7, TRUE, mood_category)
return ..()
/obj/structure/sign/poster/traitor/attackby(obj/item/I, mob/user, params)
if (I.tool_behaviour == TOOL_WIRECUTTER)
/obj/structure/sign/poster/traitor/attackby(obj/item/tool, mob/user, params)
if (tool.tool_behaviour == TOOL_WIRECUTTER)
QDEL_NULL(demoraliser)
return ..()
@@ -155,3 +161,10 @@
name = "They Are Poisoning You"
desc = "This poster claims that in the modern age it is impossible to die of starvation. 'That feeling you get when you haven't eaten in a while isn't hunger, it's withdrawal.'"
icon_state = "traitor_hungry"
/// syndicate can get festive too
/obj/structure/sign/poster/traitor/festive
name = "Working For The Holidays."
desc = "Don't you know it's a holiday? What are you doing at work?"
icon_state = "traitor_festive"
never_random = TRUE
Binary file not shown.

Before

Width:  |  Height:  |  Size: 102 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 104 KiB

+1 -1
View File
@@ -1567,7 +1567,6 @@
#include "code\game\objects\effects\anomaly_dimensional_themes.dm"
#include "code\game\objects\effects\blessing.dm"
#include "code\game\objects\effects\bump_teleporter.dm"
#include "code\game\objects\effects\contraband.dm"
#include "code\game\objects\effects\countdown.dm"
#include "code\game\objects\effects\effects.dm"
#include "code\game\objects\effects\forcefields.dm"
@@ -1580,6 +1579,7 @@
#include "code\game\objects\effects\particle_holder.dm"
#include "code\game\objects\effects\phased_mob.dm"
#include "code\game\objects\effects\portals.dm"
#include "code\game\objects\effects\poster.dm"
#include "code\game\objects\effects\powerup.dm"
#include "code\game\objects\effects\spiderwebs.dm"
#include "code\game\objects\effects\step_triggers.dm"