[MIRROR] Fixes tags on ordered pizza (#3344)

* Fixes tags on ordered pizza (#56369)

Box tags

    Fixes bug where box tags weren't updating correctly on creation
    Adds box tag flavours for the pizzas without them (i.e. Donk Pocket -> Bangin' Donk, Dank -> Fresh Herb, Sassysage -> Sausage Lovers, Arnold -> 9mm Pepperoni)

Randomised pizza crates

    Pizza crates can now come with any five pizzas, weighted by disruptiveness
    Small chance of getting one pizza bomb in a pizza crate (either armed or not) per shift

Armed pizza bomb

    Adds an armed variant of the bomb pizza box, which has the boxtag "Meat Explosion", contains a meat pizza and explodes 5 seconds after opening
    Makes the pizza party spawner use the armed bomb pizza box, instead of giving whoever a free syndicate pizza bomb they probably aren't allowed to use anyway

Secure kitchen crate

    Adds the secure kitchen crate from my previous PR
    Adds a secure pizza crate variant to KiloStation's cargo warehouse where the freezer crate was, which contains the pizza party and is locked with kitchen access

Ghost examines

    Adds ghost examine messages for pizza boxes with bombs or the nanomachine pizza in them

* Fixes tags on ordered pizza

Co-authored-by: cacogen <25089914+cacogen@users.noreply.github.com>
This commit is contained in:
SkyratBot
2021-02-13 11:13:43 +01:00
committed by GitHub
parent 27b9b8c6c7
commit c430e11d0b
8 changed files with 163 additions and 58 deletions
+55 -5
View File
@@ -1801,7 +1801,8 @@
/datum/supply_pack/organic/pizza
name = "Pizza Crate"
desc = "Best prices on this side of the galaxy. All deliveries are guaranteed to be 99% anomaly-free!"
desc = "Why visit the kitchen when you can have five random pizzas in a fraction of the time? \
Best prices this side of the galaxy! All deliveries are guaranteed to be 99% anomaly-free."
cost = CARGO_CRATE_VALUE * 10 // Best prices this side of the galaxy.
contains = list(/obj/item/pizzabox/margherita,
/obj/item/pizzabox/mushroom,
@@ -1809,15 +1810,37 @@
/obj/item/pizzabox/vegetable,
/obj/item/pizzabox/pineapple)
crate_name = "pizza crate"
///Whether we've provided an infinite pizza box already this shift or not.
var/static/anomalous_box_provided = FALSE
///The percentage chance (per pizza) of this supply pack to spawn an anomalous pizza box.
var/anna_molly_box_chance = 1
///Total tickets in our figurative lottery (per pizza) to decide if we create a bomb box, and if so what type. 1 to 3 create a bomb. The rest do nothing.
var/boombox_tickets = 100
///Whether we've provided a bomb pizza box already this shift or not.
var/boombox_provided = FALSE
/datum/supply_pack/organic/pizza/fill(obj/structure/closet/crate/C)
. = ..()
if(!anomalous_box_provided)
for(var/obj/item/pizzabox/P in C)
if(prob(1)) //1% chance for each box, so 4% total chance per order
var/list/pizza_types = list(
/obj/item/food/pizza/margherita = 10,
/obj/item/food/pizza/meat = 10,
/obj/item/food/pizza/mushroom = 10,
/obj/item/food/pizza/vegetable = 10,
/obj/item/food/pizza/donkpocket = 10,
/obj/item/food/pizza/dank = 7,
/obj/item/food/pizza/sassysage = 10,
/obj/item/food/pizza/pineapple = 10,
/obj/item/food/pizza/arnold = 3
) //weighted by chance to disrupt eaters' rounds
for(var/obj/item/pizzabox/P in C)
if(!anomalous_box_provided)
if(prob(anna_molly_box_chance)) //1% chance for each box, so 4% total chance per order
var/obj/item/pizzabox/infinite/fourfiveeight = new(C)
fourfiveeight.boxtag = P.boxtag
fourfiveeight.boxtag_set = TRUE
fourfiveeight.update_icon()
qdel(P)
anomalous_box_provided = TRUE
log_game("An anomalous pizza box was provided in a pizza crate at during cargo delivery")
@@ -1825,7 +1848,34 @@
addtimer(CALLBACK(src, .proc/anomalous_pizza_report), rand(300, 1800))
else
message_admins("An anomalous pizza box was silently created with no command report in a pizza crate delivery.")
break
continue
if(!boombox_provided)
var/boombox_lottery = rand(1,boombox_tickets)
var/boombox_type
switch(boombox_lottery)
if(1 to 2)
boombox_type = /obj/item/pizzabox/bomb/armed //explodes after opening
if(3)
boombox_type = /obj/item/pizzabox/bomb //free bomb
if(boombox_type)
new boombox_type(C)
qdel(P)
boombox_provided = TRUE
log_game("A bomb pizza box was created by a pizza crate delivery.")
message_admins("A bomb pizza box has arrived in a pizza crate delivery.")
continue
//here we randomly replace our pizzas for a chance at the full range
var/obj/item/food/pizza/replacement_type = pickweight(pizza_types)
pizza_types -= replacement_type
if(replacement_type && !istype(P.pizza, replacement_type))
QDEL_NULL(P.pizza)
P.pizza = new replacement_type
P.boxtag = P.pizza.boxtag
P.boxtag_set = TRUE
P.update_icon()
/datum/supply_pack/organic/pizza/proc/anomalous_pizza_report()
print_command_report("[station_name()], our anomalous materials divison has reported a missing object that is highly likely to have been sent to your station during a routine cargo \