mirror of
https://github.com/Bubberstation/Bubberstation.git
synced 2025-12-11 18:22:14 +00:00
[READY] Execute Protocol Crab-17: Phase 3 - The one where Floyd actually finishes the PR (#43338)
* protocol crab 17: phase 2 * k * meme * fix * k * fixes * more stuff * makes qust's code not bad * fixes time * MFW (my face when) face when floyd doesnt make the fix commit * makes it leave properly * fixes more shit * gets rid of stupid variable * asdf * wa la * wa la ^2 * tadaa * adds * i fixed some of them but what do the others mean * untested and ready to merge
This commit is contained in:
@@ -46,7 +46,7 @@ SUBSYSTEM_DEF(economy)
|
||||
"adamantine" = 750,
|
||||
// tier 4
|
||||
"rainbow" = 1000)
|
||||
var/list/bank_accounts = list()
|
||||
var/list/bank_accounts = list() //List of normal accounts (not department accounts)
|
||||
var/list/dep_cards = list()
|
||||
|
||||
/datum/controller/subsystem/economy/Initialize(timeofday)
|
||||
|
||||
@@ -197,7 +197,13 @@
|
||||
return
|
||||
to_chat(user, "<span class='warning'>The account ID number provided is invalid.</span>")
|
||||
return
|
||||
var/amount_to_remove = FLOOR(input(user, "How much do you want to withdraw? Current Balance: [registered_account.account_balance]", "Withdraw Funds", 5) as num, 1)
|
||||
|
||||
if (world.time < registered_account.withdrawDelay)
|
||||
registered_account.bank_card_talk("<span class='warning'>ERROR: UNABLE TO LOGIN DUE TO SCHEDULED MAINTENANCE. MAINTENANCE IS SCHEDULED TO COMPLETE IN [(registered_account.withdrawDelay - world.time)/10] SECONDS.</span>", TRUE)
|
||||
return
|
||||
|
||||
var/amount_to_remove = FLOOR(input(user, "How much do you want to withdraw? Current Balance: [registered_account.account_balance]", "Withdraw Funds", 5) as num, 1)
|
||||
|
||||
if(!amount_to_remove || amount_to_remove < 0)
|
||||
to_chat(user, "<span class='warning'>You're pretty sure that's not how money works.</span>")
|
||||
return
|
||||
|
||||
226
code/game/objects/items/crab17.dm
Normal file
226
code/game/objects/items/crab17.dm
Normal file
@@ -0,0 +1,226 @@
|
||||
/obj/item/suspiciousphone
|
||||
name = "suspicious phone"
|
||||
desc = "This device raises pink levels to unknown highs."
|
||||
icon = 'icons/obj/items_and_weapons.dmi'
|
||||
icon_state = "suspiciousphone"
|
||||
w_class = WEIGHT_CLASS_SMALL
|
||||
attack_verb = list("dumped")
|
||||
var/dumped = FALSE
|
||||
|
||||
/obj/item/suspiciousphone/attack_self(mob/user)
|
||||
if(!ishuman(user))
|
||||
to_chat(user, "<span class='warning'>This device is too advanced for you!</span>")
|
||||
return
|
||||
if(dumped)
|
||||
to_chat(user, "<span class='warning'>You already activated Protocol CRAB-17.</span>")
|
||||
return FALSE
|
||||
if(alert(user, "Are you sure you want to crash this market with no survivors?", "Protocol CRAB-17", "Yes", "No") == "Yes")
|
||||
if(dumped || QDELETED(src)) //Prevents fuckers from cheesing alert
|
||||
return FALSE
|
||||
var/turf/targetturf = get_random_station_turf()
|
||||
new /obj/effect/dumpeetTarget(targetturf, user)
|
||||
dumped = TRUE
|
||||
|
||||
/obj/structure/checkoutmachine
|
||||
name = "Nanotrasen Space-Coin Market"
|
||||
desc = "This is good for spacecoin because"
|
||||
icon = 'icons/obj/money_machine.dmi'
|
||||
icon_state = "bogdanoff"
|
||||
layer = TABLE_LAYER //So that the crate inside doesn't appear underneath
|
||||
armor = list("melee" = 30, "bullet" = 50, "laser" = 50, "energy" = 100, "bomb" = 100, "bio" = 0, "rad" = 0, "fire" = 100, "acid" = 80)
|
||||
density = TRUE
|
||||
pixel_z = -8
|
||||
layer = LARGE_MOB_LAYER
|
||||
max_integrity = 3000
|
||||
var/list/accounts_to_rob
|
||||
var/mob/living/carbon/human/bogdanoff
|
||||
var/canwalk = FALSE
|
||||
|
||||
/obj/structure/checkoutmachine/examine(mob/living/user)
|
||||
..()
|
||||
to_chat(user, "<span class='info'>It's integrated integrity meter reads: <b>HEALTH: [obj_integrity]</b>.</span>")
|
||||
|
||||
/obj/structure/checkoutmachine/proc/check_if_finished()
|
||||
for(var/i in accounts_to_rob)
|
||||
var/datum/bank_account/B = i
|
||||
if (B.being_dumped)
|
||||
return FALSE
|
||||
return TRUE
|
||||
|
||||
/obj/structure/checkoutmachine/attackby(obj/item/W, mob/user, params)
|
||||
if(check_if_finished())
|
||||
qdel(src)
|
||||
return
|
||||
if(istype(W, /obj/item/card/id))
|
||||
var/obj/item/card/id/card = W
|
||||
if(!card.registered_account)
|
||||
to_chat(user, "<span class='warning'>This card does not have a registered account!</span>")
|
||||
return
|
||||
if(!card.registered_account.being_dumped)
|
||||
to_chat(user, "<span class='warning'>It appears that your funds are safe from draining!</span>")
|
||||
return
|
||||
if(do_after(user, 40, target = src))
|
||||
if(!card.registered_account.being_dumped)
|
||||
return
|
||||
to_chat(user, "<span class='warning'>You quickly cash out your funds to a more secure banking location. Funds are safu.</span>")
|
||||
card.registered_account.being_dumped = FALSE
|
||||
card.registered_account.withdrawDelay = 0
|
||||
if(check_if_finished())
|
||||
qdel(src)
|
||||
return
|
||||
else
|
||||
return ..()
|
||||
|
||||
/obj/structure/checkoutmachine/Initialize(mapload, mob/living/user)
|
||||
. = ..()
|
||||
bogdanoff = user
|
||||
add_overlay("flaps")
|
||||
add_overlay("hatch")
|
||||
add_overlay("legs_retracted")
|
||||
addtimer(CALLBACK(src, .proc/startUp), 50)
|
||||
START_PROCESSING(SSfastprocess, src)
|
||||
|
||||
/obj/structure/checkoutmachine/proc/startUp() //very VERY snowflake code that adds a neat animation when the pod lands.
|
||||
start_dumping() //The machine doesnt move during this time, giving people close by a small window to grab their funds before it starts running around
|
||||
sleep(10)
|
||||
if(QDELETED(src))
|
||||
return
|
||||
playsound(src, 'sound/machines/click.ogg', 15, 1, -3)
|
||||
cut_overlay("flaps")
|
||||
sleep(10)
|
||||
if(QDELETED(src))
|
||||
return
|
||||
playsound(src, 'sound/machines/click.ogg', 15, 1, -3)
|
||||
cut_overlay("hatch")
|
||||
sleep(30)
|
||||
if(QDELETED(src))
|
||||
return
|
||||
playsound(src,'sound/machines/twobeep.ogg',50,0)
|
||||
var/mutable_appearance/hologram = mutable_appearance(icon, "hologram")
|
||||
hologram.pixel_y = 16
|
||||
add_overlay(hologram)
|
||||
var/mutable_appearance/holosign = mutable_appearance(icon, "holosign")
|
||||
holosign.pixel_y = 16
|
||||
add_overlay(holosign)
|
||||
add_overlay("legs_extending")
|
||||
cut_overlay("legs_retracted")
|
||||
pixel_z += 4
|
||||
sleep(5)
|
||||
if(QDELETED(src))
|
||||
return
|
||||
add_overlay("legs_extended")
|
||||
cut_overlay("legs_extending")
|
||||
pixel_z += 4
|
||||
sleep(20)
|
||||
if(QDELETED(src))
|
||||
return
|
||||
add_overlay("screen_lines")
|
||||
sleep(5)
|
||||
if(QDELETED(src))
|
||||
return
|
||||
cut_overlay("screen_lines")
|
||||
sleep(5)
|
||||
if(QDELETED(src))
|
||||
return
|
||||
add_overlay("screen_lines")
|
||||
add_overlay("screen")
|
||||
sleep(5)
|
||||
if(QDELETED(src))
|
||||
return
|
||||
playsound(src,'sound/machines/triple_beep.ogg',50,0)
|
||||
add_overlay("text")
|
||||
sleep(10)
|
||||
if(QDELETED(src))
|
||||
return
|
||||
add_overlay("legs")
|
||||
cut_overlay("legs_extended")
|
||||
cut_overlay("screen")
|
||||
add_overlay("screen")
|
||||
cut_overlay("screen_lines")
|
||||
add_overlay("screen_lines")
|
||||
cut_overlay("text")
|
||||
add_overlay("text")
|
||||
canwalk = TRUE
|
||||
|
||||
/obj/structure/checkoutmachine/Destroy()
|
||||
stop_dumping()
|
||||
STOP_PROCESSING(SSfastprocess, src)
|
||||
priority_announce("The credit deposit machine at [get_area(src).name] has been destroyed. Station funds have stopped draining!", sender_override = "CRAB-17 Protocol")
|
||||
explosion(src, 0,0,1, flame_range = 2)
|
||||
return ..()
|
||||
|
||||
/obj/structure/checkoutmachine/proc/start_dumping()
|
||||
accounts_to_rob = SSeconomy.bank_accounts.Copy()
|
||||
accounts_to_rob -= bogdanoff.get_bank_account()
|
||||
for(var/i in accounts_to_rob)
|
||||
var/datum/bank_account/B = i
|
||||
B.dumpeet()
|
||||
dump()
|
||||
|
||||
/obj/structure/checkoutmachine/proc/dump()
|
||||
var/percentage_lost = (rand(1, 10) / 100)
|
||||
for(var/i in accounts_to_rob)
|
||||
var/datum/bank_account/B = i
|
||||
if(!B.being_dumped)
|
||||
continue
|
||||
var/amount = B.account_balance * percentage_lost
|
||||
bogdanoff.get_bank_account().transfer_money(B, amount)
|
||||
B.bank_card_talk("You have lost [percentage_lost * 100]% of your funds! A spacecoin credit deposit machine is located at: [get_area(src).name].")
|
||||
addtimer(CALLBACK(src, .proc/dump), 150) //Drain every 15 seconds
|
||||
|
||||
/obj/structure/checkoutmachine/process()
|
||||
if(!canwalk)
|
||||
return
|
||||
var/anydir = pick(GLOB.cardinals)
|
||||
if(Process_Spacemove(anydir))
|
||||
Move(get_step(src, anydir), anydir)
|
||||
|
||||
/obj/structure/checkoutmachine/proc/stop_dumping()
|
||||
for(var/i in accounts_to_rob)
|
||||
var/datum/bank_account/B = i
|
||||
B.being_dumped = FALSE
|
||||
|
||||
/obj/effect/dumpeetFall //Falling pod
|
||||
name = ""
|
||||
icon = 'icons/obj/money_machine_64.dmi'
|
||||
pixel_z = 300
|
||||
desc = "Get out of the way!"
|
||||
layer = FLY_LAYER//that wasnt flying, that was falling with style!
|
||||
icon_state = "missile_blur"
|
||||
|
||||
/obj/effect/dumpeetTarget
|
||||
name = "Landing Zone Indicator"
|
||||
desc = "A holographic projection designating the landing zone of something. It's probably best to stand back."
|
||||
icon = 'icons/mob/actions/actions_items.dmi'
|
||||
icon_state = "sniper_zoom"
|
||||
layer = PROJECTILE_HIT_THRESHHOLD_LAYER
|
||||
light_range = 2
|
||||
var/obj/effect/dumpeetFall/DF
|
||||
var/obj/structure/checkoutmachine/dump
|
||||
var/mob/living/carbon/human/bogdanoff
|
||||
|
||||
/obj/effect/ex_act()
|
||||
return
|
||||
|
||||
/obj/effect/dumpeetTarget/Initialize(mapload, user)
|
||||
. = ..()
|
||||
bogdanoff = user
|
||||
addtimer(CALLBACK(src, .proc/startLaunch), 100)
|
||||
sound_to_playing_players('sound/items/dump_it.ogg', 75)
|
||||
deadchat_broadcast("<span class='deadsay'>Protocol CRAB-17 has been activated. A space-coin market has been launched at the station!</span>", turf_target = get_turf(src))
|
||||
|
||||
/obj/effect/dumpeetTarget/proc/startLaunch()
|
||||
DF = new /obj/effect/dumpeetFall(drop_location())
|
||||
dump = new /obj/structure/checkoutmachine(null, bogdanoff)
|
||||
priority_announce("The spacecoin bubble has popped! Get to the credit deposit machine at [get_area(src).name] and cash out before you lose all of your funds!", sender_override = "CRAB-17 Protocol")
|
||||
animate(DF, pixel_z = -8, time = 5, , easing = LINEAR_EASING)
|
||||
playsound(src, 'sound/weapons/mortar_whistle.ogg', 80, 1, 6)
|
||||
addtimer(CALLBACK(src, .proc/endLaunch), 5, TIMER_CLIENT_TIME) //Go onto the last step after a very short falling animation
|
||||
|
||||
|
||||
|
||||
/obj/effect/dumpeetTarget/proc/endLaunch()
|
||||
QDEL_NULL(DF) //Delete the falling machine effect, because at this point its animation is over. We dont use temp_visual because we want to manually delete it as soon as the pod appears
|
||||
playsound(src, "explosion", 80, 1)
|
||||
dump.forceMove(get_turf(src))
|
||||
qdel(src) //The target's purpose is complete. It can rest easy now
|
||||
@@ -1,3 +1,5 @@
|
||||
#define DUMPTIME 3000
|
||||
|
||||
/datum/bank_account
|
||||
var/account_holder = "Rusty Venture"
|
||||
var/account_balance = 0
|
||||
@@ -6,6 +8,8 @@
|
||||
var/add_to_accounts = TRUE
|
||||
var/account_id
|
||||
var/welfare = FALSE
|
||||
var/being_dumped = FALSE //pink levels are rising
|
||||
var/withdrawDelay = 0
|
||||
|
||||
/datum/bank_account/New(newname, job)
|
||||
if(add_to_accounts)
|
||||
@@ -19,6 +23,10 @@
|
||||
SSeconomy.bank_accounts -= src
|
||||
return ..()
|
||||
|
||||
/datum/bank_account/proc/dumpeet()
|
||||
being_dumped = TRUE
|
||||
withdrawDelay = world.time + DUMPTIME
|
||||
|
||||
/datum/bank_account/proc/_adjust_money(amt)
|
||||
account_balance += amt
|
||||
if(account_balance < 0)
|
||||
@@ -95,3 +103,5 @@
|
||||
account_balance = budget
|
||||
account_holder = SSeconomy.department_accounts[dep_id]
|
||||
SSeconomy.generated_accounts += src
|
||||
|
||||
#undef DUMPTIME
|
||||
|
||||
@@ -1417,6 +1417,14 @@ GLOBAL_LIST_INIT(uplink_items, subtypesof(/datum/uplink_item))
|
||||
include_modes = list(/datum/game_mode/nuclear, /datum/game_mode/nuclear/clown_ops)
|
||||
restricted = TRUE
|
||||
|
||||
|
||||
/datum/uplink_item/device_tools/suspiciousphone
|
||||
name = "Protocol CRAB-17 Phone"
|
||||
desc = "The Protocol CRAB-17 Phone, a phone borrowed from an unknown third party, it can be used to crash the space market, funneling the losses of the crew to your bank account.\
|
||||
The crew can move their funds to a new banking site though, unless they HODL, in which case they deserve it."
|
||||
item = /obj/item/suspiciousphone
|
||||
cost = 7
|
||||
|
||||
// Implants
|
||||
/datum/uplink_item/implants
|
||||
category = "Implants"
|
||||
|
||||
Binary file not shown.
|
Before Width: | Height: | Size: 125 KiB After Width: | Height: | Size: 126 KiB |
BIN
icons/obj/money_machine.dmi
Normal file
BIN
icons/obj/money_machine.dmi
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 4.6 KiB |
BIN
icons/obj/money_machine_64.dmi
Normal file
BIN
icons/obj/money_machine_64.dmi
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 2.3 KiB |
BIN
sound/items/dump_it.ogg
Normal file
BIN
sound/items/dump_it.ogg
Normal file
Binary file not shown.
@@ -802,6 +802,7 @@
|
||||
#include "code\game\objects\items\control_wand.dm"
|
||||
#include "code\game\objects\items\cosmetics.dm"
|
||||
#include "code\game\objects\items\courtroom.dm"
|
||||
#include "code\game\objects\items\crab17.dm"
|
||||
#include "code\game\objects\items\crayons.dm"
|
||||
#include "code\game\objects\items\credit_holochip.dm"
|
||||
#include "code\game\objects\items\defib.dm"
|
||||
|
||||
Reference in New Issue
Block a user