[MIRROR] A "postal workers strike" negative station trait. (can be positive) [MDB IGNORE] (#25874)

* A "postal workers strike" negative station trait. (can be positive)

* Update shuttle_loan_datum.dm

---------

Co-authored-by: Ghom <42542238+Ghommie@users.noreply.github.com>
Co-authored-by: Gandalf <9026500+Gandalf2k15@users.noreply.github.com>
This commit is contained in:
SkyratBot
2023-12-29 18:25:27 +00:00
committed by GitHub
co-authored by Ghom Gandalf
parent 4b1815fd05
commit 75cd7f69f6
10 changed files with 286 additions and 28 deletions
@@ -7,7 +7,7 @@
/// What the shuttle says about it.
var/shuttle_transit_text = "Unset transit text"
/// Supply points earned for taking the deal.
var/bonus_points = 10000
var/bonus_points = CARGO_CRATE_VALUE * 50
/// Response for taking the deal.
var/thanks_msg = "The cargo shuttle should return in five minutes. Have some supply points for your trouble."
/// Small description of the loan for easier log reading.
@@ -21,7 +21,7 @@
bonus_points *= 1.15
/// Spawns paths added to `spawn_list`, and passes empty shuttle turfs so you can spawn more complicated things like dead bodies.
/datum/shuttle_loan_situation/proc/spawn_items(list/spawn_list, list/empty_shuttle_turfs)
/datum/shuttle_loan_situation/proc/spawn_items(list/spawn_list, list/empty_shuttle_turfs, list/blocked_shutte_turfs)
SHOULD_CALL_PARENT(FALSE)
CRASH("Unimplemented get_spawned_items() on [src.type].")
@@ -31,7 +31,7 @@
shuttle_transit_text = "Virus samples incoming."
logging_desc = "Virus shuttle"
/datum/shuttle_loan_situation/antidote/spawn_items(list/spawn_list, list/empty_shuttle_turfs)
/datum/shuttle_loan_situation/antidote/spawn_items(list/spawn_list, list/empty_shuttle_turfs, list/blocked_shutte_turfs)
var/obj/effect/mob_spawn/corpse/human/assistant/infected_assistant = pick(list(
/obj/effect/mob_spawn/corpse/human/assistant/beesease_infection,
/obj/effect/mob_spawn/corpse/human/assistant/brainrot_infection,
@@ -58,7 +58,7 @@
bonus_points = 0
logging_desc = "Resupply packages"
/datum/shuttle_loan_situation/department_resupply/spawn_items(list/spawn_list, list/empty_shuttle_turfs)
/datum/shuttle_loan_situation/department_resupply/spawn_items(list/spawn_list, list/empty_shuttle_turfs, list/blocked_shutte_turfs)
var/list/crate_types = list(
/datum/supply_pack/emergency/equipment,
/datum/supply_pack/security/supplies,
@@ -84,7 +84,7 @@
shuttle_transit_text = "Syndicate hijack team incoming."
logging_desc = "Syndicate boarding party"
/datum/shuttle_loan_situation/syndiehijacking/spawn_items(list/spawn_list, list/empty_shuttle_turfs)
/datum/shuttle_loan_situation/syndiehijacking/spawn_items(list/spawn_list, list/empty_shuttle_turfs, list/blocked_shutte_turfs)
var/datum/supply_pack/pack = SSshuttle.supply_packs[/datum/supply_pack/imports/specialops]
pack.generate(pick_n_take(empty_shuttle_turfs))
@@ -99,10 +99,10 @@
sender = "CentCom Janitorial Division"
announcement_text = "One of our freighters carrying a bee shipment has been attacked by eco-terrorists. Can you clean up the mess for us?"
shuttle_transit_text = "Biohazard cleanup incoming."
bonus_points = 20000 //Toxin bees can be unbeelievably lethal
bonus_points = CARGO_CRATE_VALUE * 100 //Toxin bees can be unbeelievably lethal
logging_desc = "Shuttle full of bees"
/datum/shuttle_loan_situation/lots_of_bees/spawn_items(list/spawn_list, list/empty_shuttle_turfs)
/datum/shuttle_loan_situation/lots_of_bees/spawn_items(list/spawn_list, list/empty_shuttle_turfs, list/blocked_shutte_turfs)
var/datum/supply_pack/pack = SSshuttle.supply_packs[/datum/supply_pack/organic/hydroponics/beekeeping_fullkit]
pack.generate(pick_n_take(empty_shuttle_turfs))
@@ -135,10 +135,10 @@
announcement_text = "We have discovered an active Syndicate bomb near our VIP shuttle's fuel lines. If you feel up to the task, we will pay you for defusing it."
shuttle_transit_text = "Live explosive ordnance incoming. Exercise extreme caution."
thanks_msg = "Live explosive ordnance incoming via supply shuttle. Evacuating cargo bay is recommended."
bonus_points = 45000 //If you mess up, people die and the shuttle gets turned into swiss cheese
bonus_points = CARGO_CRATE_VALUE * 225 //If you mess up, people die and the shuttle gets turned into swiss cheese
logging_desc = "Shuttle with a ticking bomb"
/datum/shuttle_loan_situation/jc_a_bomb/spawn_items(list/spawn_list, list/empty_shuttle_turfs)
/datum/shuttle_loan_situation/jc_a_bomb/spawn_items(list/spawn_list, list/empty_shuttle_turfs, list/blocked_shutte_turfs)
spawn_list.Add(/obj/machinery/syndicatebomb/shuttle_loan)
if(prob(95))
spawn_list.Add(/obj/item/paper/fluff/cargo/bomb)
@@ -153,7 +153,7 @@
bonus_points = 0 //Payout is made when the stamped papers are returned
logging_desc = "Paperwork shipment"
/datum/shuttle_loan_situation/papers_please/spawn_items(list/spawn_list, list/empty_shuttle_turfs)
/datum/shuttle_loan_situation/papers_please/spawn_items(list/spawn_list, list/empty_shuttle_turfs, list/blocked_shutte_turfs)
spawn_list += subtypesof(/obj/item/paperwork) - typesof(/obj/item/paperwork/photocopy) - typesof(/obj/item/paperwork/ancient)
/datum/shuttle_loan_situation/pizza_delivery
@@ -164,8 +164,8 @@
bonus_points = 0
logging_desc = "Pizza delivery"
/datum/shuttle_loan_situation/pizza_delivery/spawn_items(list/spawn_list, list/empty_shuttle_turfs)
var/naughtypizza = list(/obj/item/pizzabox/bomb /*/obj/item/pizzabox/margherita/robo*/) // SKYRAT EDIT: oh look another blacklist, for pizza nonetheless! removes borg pizza
/datum/shuttle_loan_situation/pizza_delivery/spawn_items(list/spawn_list, list/empty_shuttle_turfs, list/blocked_shutte_turfs)
var/naughtypizza = list(/obj/item/pizzabox/bomb, /obj/item/pizzabox/margherita/robo) //oh look another blacklist, for pizza nonetheless!
var/nicepizza = list(/obj/item/pizzabox/margherita, /obj/item/pizzabox/meat, /obj/item/pizzabox/vegetable, /obj/item/pizzabox/mushroom)
for(var/i in 1 to 6)
spawn_list.Add(pick(prob(5) ? naughtypizza : nicepizza))
@@ -176,7 +176,7 @@
shuttle_transit_text = "Partying Russians incoming."
logging_desc = "Russian party squad"
/datum/shuttle_loan_situation/russian_party/spawn_items(list/spawn_list, list/empty_shuttle_turfs)
/datum/shuttle_loan_situation/russian_party/spawn_items(list/spawn_list, list/empty_shuttle_turfs, list/blocked_shutte_turfs)
var/datum/supply_pack/pack = SSshuttle.supply_packs[/datum/supply_pack/service/party]
pack.generate(pick_n_take(empty_shuttle_turfs))
@@ -194,7 +194,7 @@
shuttle_transit_text = "Spider Clan gift incoming."
logging_desc = "Shuttle full of spiders"
/datum/shuttle_loan_situation/spider_gift/spawn_items(list/spawn_list, list/empty_shuttle_turfs)
/datum/shuttle_loan_situation/spider_gift/spawn_items(list/spawn_list, list/empty_shuttle_turfs, list/blocked_shutte_turfs)
var/datum/supply_pack/pack = SSshuttle.supply_packs[/datum/supply_pack/imports/specialops]
pack.generate(pick_n_take(empty_shuttle_turfs))
@@ -213,3 +213,82 @@
for(var/i in 1 to 5)
var/turf/web_turf = pick_n_take(empty_shuttle_turfs)
new /obj/structure/spider/stickyweb(web_turf)
#define DENT_WALL "dent"
#define CHANGE_WALL "change"
#define DISMANTLE_WALL "dismantle"
#define BREAK_TILE "break"
#define PLATING_TILE "plating"
#define RUST_TILE "rust"
/**
* A special shuttle loan situation enabled by the 'mail blocked' station trait.
* It sends back a lot of mail to the station, at the cost of wrecking the cargo shuttle a little.
*/
/datum/shuttle_loan_situation/mail_strike
sender = "Spinward Mail Workers Union"
announcement_text = "The Mail Workers Union wants to borrow your cargo shuttle to employ \"advanced union strike tactics\" with. Payment is strictly in mails."
bonus_points = 0
thanks_msg = "The cargo shuttle should return in five minutes."
shuttle_transit_text = "Nothing stops the mail."
logging_desc = "Shuttle full of shady mail"
/datum/shuttle_loan_situation/mail_strike/spawn_items(list/spawn_list, list/empty_shuttle_turfs, list/blocked_shutte_turfs)
for(var/i in 1 to rand(7, 12))
var/turf/closed/wall/wall = pick_n_take(blocked_shutte_turfs)
if(!istype(wall))
continue
var/static/list/wall_bad_stuff = list(DENT_WALL = 85, CHANGE_WALL = 13, DISMANTLE_WALL = 2)
var/static/list/possible_new_walls = list(
/turf/closed/wall/mineral/sandstone,
/turf/closed/wall/mineral/wood,
/turf/closed/wall/mineral/iron,
/turf/closed/wall/metal_foam_base,
/turf/closed/wall/r_wall,
)
var/damage_done = pick_weight(wall_bad_stuff)
switch(damage_done)
if(DENT_WALL)
for(var/dent in 1 to rand(1, MAX_DENT_DECALS))
wall.add_dent(prob(90) ? WALL_DENT_SHOT : WALL_DENT_HIT)
if(CHANGE_WALL)
wall.ChangeTurf(pick(possible_new_walls - wall.type))
if(prob(25))
for(var/dent in 1 to rand(1, MAX_DENT_DECALS))
wall.add_dent(prob(90) ? WALL_DENT_SHOT : WALL_DENT_HIT)
if(DISMANTLE_WALL)
wall.dismantle_wall()
for(var/i in 1 to rand(7, 12))
var/turf/open/floor/floor = pick_n_take(empty_shuttle_turfs)
if(!istype(floor))
continue
var/static/list/floor_bad_stuff = list(BREAK_TILE = 65, PLATING_TILE = 25, RUST_TILE = 10)
var/damage_done = pick_weight(floor_bad_stuff)
switch(damage_done)
if(BREAK_TILE)
if(prob(50))
floor.break_tile()
else
floor.burn_tile()
if(PLATING_TILE)
if(prob(25))
floor.remove_tile()
else
floor.make_plating()
if(RUST_TILE)
floor.ChangeTurf(/turf/open/floor/plating/rust)
if(prob(25))
spawn_list += pick(/obj/effect/gibspawner/robot, /obj/effect/gibspawner/human)
for(var/i in 1 to rand(4, 7))
spawn_list += /obj/structure/closet/crate/mail/full/mail_strike
#undef BREAK_TILE
#undef PLATING_TILE
#undef RUST_TILE
#undef DENT_WALL
#undef CHANGE_WALL
#undef DISMANTLE_WALL
@@ -8,7 +8,8 @@
description = "If cargo accepts the offer, fills the shuttle with loot and/or enemies."
///The types of loan events already run (and to be excluded if the event triggers).
admin_setup = list(/datum/event_admin_setup/listed_options/shuttle_loan)
var/list/run_situations = list()
///A list of normally unavailable (or already run) situations datums
var/list/unavailable_situations = list(/datum/shuttle_loan_situation/mail_strike)
/datum/round_event_control/shuttle_loan/can_spawn_event(players_amt, allow_magic = FALSE)
. = ..()
@@ -28,14 +29,14 @@
var/datum/round_event_control/shuttle_loan/loan_control = control
//by this point if situation is admin picked, it is a type, not an instance.
if(!situation)
var/list/valid_situations = subtypesof(/datum/shuttle_loan_situation) - loan_control.run_situations
var/list/valid_situations = subtypesof(/datum/shuttle_loan_situation) - loan_control.unavailable_situations
if(!valid_situations.len)
//If we somehow run out of loans (fking campbell), they all become available again
loan_control.run_situations.Cut()
loan_control.unavailable_situations.Cut()
valid_situations = subtypesof(/datum/shuttle_loan_situation)
situation = pick(valid_situations)
loan_control.run_situations.Add(situation)
loan_control.unavailable_situations.Add(situation)
situation = new situation()
/datum/round_event/shuttle_loan/announce(fake)
@@ -76,10 +77,12 @@
//get empty turfs
var/list/empty_shuttle_turfs = list()
var/list/blocked_shutte_turfs = list()
var/list/area/shuttle/shuttle_areas = SSshuttle.supply.shuttle_areas
for(var/area/shuttle/shuttle_area as anything in shuttle_areas)
for(var/turf/open/floor/shuttle_turf in shuttle_area)
if(shuttle_turf.is_blocked_turf())
blocked_shutte_turfs += shuttle_turf
continue
empty_shuttle_turfs += shuttle_turf
if(!empty_shuttle_turfs.len)
@@ -87,7 +90,7 @@
//let the situation spawn its items
var/list/spawn_list = list()
situation.spawn_items(spawn_list, empty_shuttle_turfs)
situation.spawn_items(spawn_list, empty_shuttle_turfs, blocked_shutte_turfs)
var/false_positive = 0
while(spawn_list.len && empty_shuttle_turfs.len)
@@ -103,7 +106,7 @@
/datum/event_admin_setup/listed_options/shuttle_loan/get_list()
var/datum/round_event_control/shuttle_loan/loan_event = event_control
var/list/valid_situations = subtypesof(/datum/shuttle_loan_situation) - loan_event.run_situations
var/list/valid_situations = subtypesof(/datum/shuttle_loan_situation) - loan_event.unavailable_situations
return valid_situations
/datum/event_admin_setup/listed_options/shuttle_loan/apply_to_event(datum/round_event/shuttle_loan/event)