Adds prefloading to bitrunning (#1551)

## About The Pull Request

Adds a new disky to bitrunning, which allows you to load any of your
prefslots in, and then spawn in the domain as that character.

Also, I asked the admins about this, believable character rules wont
apply inside bitrunning domains. So you can bring your meme chars there
as well.

## Why It's Good For The Game

People keep bullying me to add sex to bitrunning and who am I to say no

## Proof Of Testing

It seemed to work without deleting my prefs

## Changelog


🆑
add: Adds prefloading to bitrunning
/🆑

---------

Co-authored-by: Cyprex <35031555+Cyprex@users.noreply.github.com>
This commit is contained in:
Waterpig
2024-06-03 10:30:32 +02:00
committed by GitHub
co-authored by Cyprex
parent 67f70bfd62
commit 04484b817f
4 changed files with 70 additions and 2 deletions
+9 -1
View File
@@ -315,7 +315,15 @@
if(isnull(wayout))
balloon_alert(neo, "out of bandwidth!")
return
current_avatar = server.generate_avatar(wayout, netsuit)
// BUBBER EDIT BEGIN - PREFS!
var/datum/preferences/pref
var/load_loadout = FALSE
var/obj/item/bitrunning_disk/prefs/prefdisk = locate() in neo.get_contents()
if(prefdisk)
load_loadout = prefdisk.include_loadout
pref = prefdisk.loaded_preference
current_avatar = server.generate_avatar(wayout, netsuit, pref, include_loadout = load_loadout) // Added the prefs argument
// BUBBER EDIT END
avatar_ref = WEAKREF(current_avatar)
server.stock_gear(current_avatar, neo, generated_domain)
@@ -36,9 +36,14 @@
return chosen_turf
/// Generates a new avatar for the bitrunner.
/obj/machinery/quantum_server/proc/generate_avatar(obj/structure/hololadder/wayout, datum/outfit/netsuit)
/obj/machinery/quantum_server/proc/generate_avatar(obj/structure/hololadder/wayout, datum/outfit/netsuit, datum/preferences/prefs, include_loadout = FALSE) // BUBBER EDIT - Prefs argument
var/mob/living/carbon/human/avatar = new(wayout.loc)
// BUBBER EDIT BEGIN - PREFS!
if(!isnull(prefs))
prefs.safe_transfer_prefs_to(avatar)
ADD_TRAIT(avatar, TRAIT_CANNOT_CRYSTALIZE, "Bitrunning") // Stops the funny ethereal bug
// BUBBER EDIT END
var/outfit_path = generated_domain.forced_outfit || netsuit
var/datum/outfit/to_wear = new outfit_path()
@@ -74,6 +79,8 @@
new /obj/item/flashlight,
)
if(include_loadout)
avatar.equip_outfit_and_loadout(new /datum/outfit(), prefs) // BUBBER EDIT - LOADOUTS
var/obj/item/card/id/outfit_id = avatar.wear_id
if(outfit_id)
outfit_id.assignment = "Bit Avatar"
@@ -0,0 +1,52 @@
/obj/item/bitrunning_disk/prefs
name = "DeForest biological simulation disk"
desc = "A disk containing the biological simulation data necessary to load custom characters into bitrunning domains."
icon = 'icons/obj/devices/circuitry_n_data.dmi'
base_icon_state = "datadisk"
icon_state = "datadisk0"
w_class = WEIGHT_CLASS_SMALL
var/datum/preferences/loaded_preference
var/include_loadout = FALSE
/obj/item/bitrunning_disk/prefs/examine(mob/user)
. = ..()
if(!isnull(loaded_preference))
var/name = loaded_preference.read_preference(/datum/preference/name/real_name)
. += "It currently has the character [name] loaded, with loadouts [(include_loadout ? "enabled" : "disabled")]"
. += span_notice("Ctrl-Click to change loadout loading")
/obj/item/bitrunning_disk/prefs/CtrlClick(mob/user)
. = ..()
include_loadout = !include_loadout // We just switch this around. Elegant!
balloon_alert(user, include_loadout ? "Loadout enabled" : "Loadout disabled")
/obj/item/bitrunning_disk/prefs/attack_self(mob/user, modifiers)
. = ..()
var/list/prefdata_names = user.client.prefs?.create_character_profiles()
if(isnull(prefdata_names))
return
var/response = tgui_alert(user, message = "Change selected prefs?", title = "Prefchange", buttons = list("Yes", "No"))
if(isnull(response) || response == "No")
return
var/choice = tgui_input_list(user, message = "Select a character", title = "Character selection", items = prefdata_names)
if(isnull(choice) || !user.is_holding(src))
return
loaded_preference = new(user.client)
loaded_preference.load_character(prefdata_names.Find(choice))
balloon_alert(user, "Character set")
to_chat(user, span_notice("Character set to [choice] sucessfully!"))
/datum/outfit/job/bitrunner
r_pocket = /obj/item/bitrunning_disk/prefs
/datum/orderable_item/bitrunning_tech/pref_item
cost_per_order = 500
item_path = /obj/item/bitrunning_disk/prefs
desc = "This disk contains a program that lets you load in custom characters."
+1
View File
@@ -8573,6 +8573,7 @@
#include "modular_zubbers\code\modules\atmospherics\machinery\air_alarm\_air_alarm.dm"
#include "modular_zubbers\code\modules\atmospherics\machinery\portable\canister.dm"
#include "modular_zubbers\code\modules\automapper\code\area_spawn_entries.dm"
#include "modular_zubbers\code\modules\bitrunning\disks.dm"
#include "modular_zubbers\code\modules\borer_hud\borer.dm"
#include "modular_zubbers\code\modules\bsrpd\code\bsrpd.dm"
#include "modular_zubbers\code\modules\cargo\expressconsole.dm"