Skip to content

Commit

Permalink
[MIRROR] Emagging the communications console now lets you purchase da…
Browse files Browse the repository at this point in the history
…ngerous shuttles. Moves some to this system (including Disco Inferno and the Oh, Hi Daniel) (#1145)

* Emagging the communications console now lets you purchase dangerous shuttles. Moves some to this system (including Disco Inferno and the Oh, Hi Daniel) (#62056)

Emagging the shuttle will now let you buy dangerous shuttles (anything marked emag_only).

This includes:

Disco Inferno (which returns, at 10,000 credits)
Oh, Hi Daniel (which returns, at 10,000 credits)
Hyperfractal Gigashuttle (which has been moved over, and now costs 10,000 credits)
Grand Corporate Monastery (which has been moved over, and now costs 18,000 credits)
Purchasing a shuttle while it's emagged will censor your name.

Adding the capability for emag shuttles allows for some fun design space. Previously, shuttles like the Disco Inferno and Oh, Hi Daniel were removed for being grief messes, but now that an antagonist is (in most cases) required to purchase, this now becomes an act of in-game chaos, rather than just grief.

This can also help administrative efforts. Buying grief shuttles presently just makes you valid to the crew, which is tough considering the people who buy this are the ones in command. Now, buying grief shuttles not only requires an emag (which a basic griefer cannot get), but can now be deemed as a traitorous act.

* Emagging the communications console now lets you purchase dangerous shuttles. Moves some to this system (including Disco Inferno and the Oh, Hi Daniel)

Co-authored-by: Mothblocks <[email protected]>
  • Loading branch information
ms-mirror-bot and Mothblocks authored Oct 19, 2021
1 parent cc6b2a2 commit 99940f5
Show file tree
Hide file tree
Showing 3 changed files with 33 additions and 20 deletions.
21 changes: 15 additions & 6 deletions code/datums/shuttles.dm
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
#define EMAG_LOCKED_SHUTTLE_COST (CARGO_CRATE_VALUE * 50)

/datum/map_template/shuttle
name = "Base Shuttle Template"
var/prefix = "_maps/shuttles/"
Expand All @@ -12,6 +14,8 @@
var/credit_cost = INFINITY
/// What job accesses can buy this shuttle? If null, this shuttle cannot be bought.
var/list/who_can_purchase = list(ACCESS_CAPTAIN)
/// Whether or not this shuttle is locked to emags only.
var/emag_only = FALSE
/// If set, overrides default movement_force on shuttle
var/list/movement_force

Expand Down Expand Up @@ -233,7 +237,8 @@
name = "Grand Corporate Monastery"
description = "Originally built for a public station, this grand edifice to religion, due to budget cuts, is now available as an escape shuttle for the right... donation. Due to its large size and callous owners, this shuttle may cause collateral damage."
admin_notes = "WARNING: This shuttle WILL destroy a fourth of the station, likely picking up a lot of objects with it."
credit_cost = CARGO_CRATE_VALUE * 250
emag_only = TRUE
credit_cost = EMAG_LOCKED_SHUTTLE_COST * 1.8
movement_force = list("KNOCKDOWN" = 3, "THROW" = 5)

/datum/map_template/shuttle/emergency/luxury
Expand All @@ -259,8 +264,8 @@
name = "Disco Inferno"
description = "The glorious results of centuries of plasma research done by Nanotrasen employees. This is the reason why you are here. Get on and dance like you're on fire, burn baby burn!"
admin_notes = "Flaming hot. The main area has a dance machine as well as plasma floor tiles that will be ignited by players every single time."
credit_cost = CARGO_CRATE_VALUE * 20
who_can_purchase = null
emag_only = TRUE
credit_cost = EMAG_LOCKED_SHUTTLE_COST

/datum/map_template/shuttle/emergency/arena
suffix = "arena"
Expand Down Expand Up @@ -393,7 +398,8 @@
Outside of admin intervention, it cannot explode. \
It does, however, still dust anything on contact, emits high levels of radiation, and induce hallucinations in anyone looking at it without protective goggles. \
Emitters spawn powered on, expect admin notices, they are harmless."
credit_cost = CARGO_CRATE_VALUE * 200
emag_only = TRUE
credit_cost = EMAG_LOCKED_SHUTTLE_COST
movement_force = list("KNOCKDOWN" = 3, "THROW" = 2)

/datum/map_template/shuttle/emergency/imfedupwiththisworld
Expand All @@ -402,7 +408,8 @@
description = "How was space work today? Oh, pretty good. We got a new space station and the company will make a lot of money. What space station? I cannot tell you; it's space confidential. \
Aw, come space on. Why not? No, I can't. Anyway, how is your space roleplay life?"
admin_notes = "Tiny, with a single airlock and wooden walls. What could go wrong?"
who_can_purchase = null
emag_only = TRUE
credit_cost = EMAG_LOCKED_SHUTTLE_COST
movement_force = list("KNOCKDOWN" = 3, "THROW" = 2)

/datum/map_template/shuttle/emergency/goon
Expand Down Expand Up @@ -447,7 +454,7 @@
description = "A large shuttle with a center biodome that is flourishing with life. Frolick with the monkeys! (Extra monkeys are stored on the bridge.)"
admin_notes = "Pretty freakin' large, almost as big as Raven or Cere. Excercise caution with it."
credit_cost = CARGO_CRATE_VALUE * 16

/datum/map_template/shuttle/emergency/casino
suffix = "casino"
name = "Lucky Jackpot Casino Shuttle"
Expand Down Expand Up @@ -709,3 +716,5 @@
/datum/map_template/shuttle/snowdin/excavation
suffix = "excavation"
name = "Snowdin Excavation Elevator"

#undef EMAG_LOCKED_SHUTTLE_COST
19 changes: 8 additions & 11 deletions code/game/machinery/computer/communications.dm
Original file line number Diff line number Diff line change
Expand Up @@ -229,7 +229,10 @@
SSshuttle.existing_shuttle = SSshuttle.emergency
SSshuttle.action_load(shuttle, replace = TRUE)
bank_account.adjust_money(-shuttle.credit_cost)
minor_announce("[usr.real_name] has purchased [shuttle.name] for [shuttle.credit_cost] credits.[shuttle.extra_desc ? " [shuttle.extra_desc]" : ""]" , "Shuttle Purchase")

var/purchaser_name = (obj_flags & EMAGGED) ? scramble_message_replace_chars("AUTHENTICATION FAILURE: CVE-2018-17107", 60) : usr.real_name
minor_announce("[purchaser_name] has purchased [shuttle.name] for [shuttle.credit_cost] credits.[shuttle.extra_desc ? " [shuttle.extra_desc]" : ""]" , "Shuttle Purchase")

message_admins("[ADMIN_LOOKUPFLW(usr)] purchased [shuttle.name].")
log_shuttle("[key_name(usr)] has purchased [shuttle.name].")
SSblackbox.record_feedback("text", "shuttle_purchase", 1, shuttle.name)
Expand Down Expand Up @@ -522,20 +525,11 @@
if (!can_purchase_this_shuttle(shuttle_template))
continue

var/has_access = FALSE

for (var/purchase_access in shuttle_template.who_can_purchase)
if (purchase_access in authorize_access)
has_access = TRUE
break

if (!has_access)
continue

shuttles += list(list(
"name" = shuttle_template.name,
"description" = shuttle_template.description,
"creditCost" = shuttle_template.credit_cost,
"emagOnly" = shuttle_template.emag_only,
"prerequisites" = shuttle_template.prerequisites,
"ref" = REF(shuttle_template),
))
Expand Down Expand Up @@ -628,6 +622,9 @@
if (isnull(shuttle_template.who_can_purchase))
return FALSE

if (shuttle_template.emag_only)
return !!(obj_flags & EMAGGED)

for (var/access in authorize_access)
if (access in shuttle_template.who_can_purchase)
return TRUE
Expand Down
13 changes: 10 additions & 3 deletions tgui/packages/tgui/interfaces/CommunicationsConsole.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,13 @@ const STATE_MESSAGES = "messages";
// Used for whether or not you need to swipe to confirm an alert level change
const SWIPE_NEEDED = "SWIPE_NEEDED";

const sortByCreditCost = sortBy(shuttle => shuttle.creditCost);
const EMAG_SHUTTLE_NOTICE
= "This shuttle is deemed significantly dangerous to the crew, and is only supplied by the Syndicate.";

const sortShuttles = sortBy(
shuttle => !shuttle.emagOnly,
shuttle => shuttle.creditCost
);

const AlertButton = (props, context) => {
const { act, data } = useBackend(context);
Expand Down Expand Up @@ -157,7 +163,7 @@ const PageBuyingShuttle = (props, context) => {
Budget: <b>{data.budget.toLocaleString()}</b> credits
</Section>

{sortByCreditCost(data.shuttles).map(shuttle => (
{sortShuttles(data.shuttles).map(shuttle => (
<Section
title={(
<span
Expand All @@ -172,14 +178,15 @@ const PageBuyingShuttle = (props, context) => {
buttons={(
<Button
content={`${shuttle.creditCost.toLocaleString()} credits`}
color={shuttle.emagOnly ? "red" : "default"}
disabled={data.budget < shuttle.creditCost}
onClick={() => act("purchaseShuttle", {
shuttle: shuttle.ref,
})}
tooltip={
data.budget < shuttle.creditCost
? `You need ${shuttle.creditCost - data.budget} more credits.`
: undefined
: (shuttle.emagOnly ? EMAG_SHUTTLE_NOTICE : undefined)
}
tooltipPosition="left"
/>
Expand Down

0 comments on commit 99940f5

Please sign in to comment.