Files
Bubberstation/code/modules/bitrunning/objects/loot_box.dm
Thunder12345 058cb039eb Bitrunning 1.5: Secondary Objectives (#81828)
## About The Pull Request

Added secondary objective lockboxes to bitrunning. These pull from a
list of secondary objective loot on the domain, with a limited quantity
of items. Once there are no items left to pull, the secondary objective
disappears. If multiple secondary objective markers are placed, they
will be placed until all markers have been used, or all the items in the
loot pool are already spoken for.

To support this functionality, adds SSbitrunning, which stores all
domains as instances, instead of checking the hardcoded types as
previously. SSbitrunning manages listing domains for the quantum
console, and rolling secondary loot.

As an example of this functionality, added a side path to Glacier Grind
with a polar bear and some loot.

## Why It's Good For The Game

Secondary objectives give mappers ways to encourage players to venture
into a wider range of domains by offering non-trivial loot beyond the
fluff items given in the main caches. The absolute limit on the number
of items available ensures these items can't be farmed.

As well as supporting secondary objectives, SSbitrunning allows for
future support of features relying on mid-round modification of domains,
for instance adding custom domains.

## Changelog
🆑
add: Added secondary objectives to bitrunning!
add: Pick up encrypted curiosities and return them to the safehouse to
claim their contents.
add: Glacier Grind has been given a secondary objective, look out for
the limited edition hat.
add: Bitrunning domains can now be modified during the round by admins.
/🆑
2024-03-09 22:42:23 +01:00

54 lines
1.9 KiB
Plaintext

/obj/item/storage/lockbox/bitrunning
name = "base class curiosity"
desc = "Talk to a coder."
req_access = list(ACCESS_INACCESSIBLE)
icon_state = "bitrunning+l"
inhand_icon_state = "bitrunning"
base_icon_state = "bitrunning"
icon_locked = "bitrunning+l"
icon_closed = "bitrunning"
icon_broken = "bitrunning+b"
/obj/item/storage/lockbox/bitrunning/encrypted
name = "encrypted curiosity"
desc = "Needs to be decrypted at the safehouse to be opened."
resistance_flags = INDESTRUCTIBLE | LAVA_PROOF | FIRE_PROOF | UNACIDABLE | ACID_PROOF
/// Path for the loot we are assigned
var/loot_path
/obj/item/storage/lockbox/bitrunning/encrypted/emag_act(mob/user, obj/item/card/emag/emag_card)
return FALSE
/obj/item/storage/lockbox/bitrunning/decrypted
name = "decrypted curiosity"
desc = "Compiled from the virtual domain. An extra reward of a successful bitrunner."
/// What virtual domain did we come from.
var/datum/lazy_template/virtual_domain/source_domain
/obj/item/storage/lockbox/bitrunning/decrypted/Initialize(
mapload,
datum/lazy_template/virtual_domain/completed_domain,
)
if(isnull(completed_domain))
log_runtime("Decrypted curiosity was created with no source domain.")
return INITIALIZE_HINT_QDEL
if(!istype(completed_domain, /datum/lazy_template/virtual_domain)) // Check if this is a proper virtual domain before doing anything with it
log_runtime("Decrypted curiosity was created with an invalid source domain. [completed_domain.name] ([completed_domain.type]).")
return INITIALIZE_HINT_QDEL
source_domain = completed_domain
. = ..()
atom_storage.max_specific_storage = WEIGHT_CLASS_NORMAL
atom_storage.max_slots = 1
atom_storage.max_total_storage = 3
atom_storage.locked = STORAGE_NOT_LOCKED
icon_state = icon_closed
playsound(src, 'sound/magic/blink.ogg', 50, TRUE)
/obj/item/storage/lockbox/bitrunning/decrypted/PopulateContents()
var/choice = SSbitrunning.pick_secondary_loot(source_domain)
new choice(src)