mirror of
https://github.com/Bubberstation/Bubberstation.git
synced 2026-08-28 23:58:07 +01:00
bitrunning hotfix 2 [NO GBP] (#78633)
Bitrunning releated fixes --------- Co-authored-by: LemonInTheDark <58055496+LemonInTheDark@users.noreply.github.com>
This commit is contained in:
co-authored by
LemonInTheDark
parent
cd2c25a8de
commit
88c3f4bfa4
@@ -147,7 +147,7 @@
|
||||
if(isindestructiblefloor(T))
|
||||
continue
|
||||
if(!isindestructiblewall(T))
|
||||
T.ChangeTurf(/turf/open/misc/asteroid/basalt/lava_land_surface, flags = CHANGETURF_INHERIT_AIR)
|
||||
T.TerraformTurf(/turf/open/misc/asteroid/basalt/lava_land_surface, flags = CHANGETURF_INHERIT_AIR)
|
||||
else
|
||||
indestructible_turfs += T
|
||||
SLEEP_CHECK_DEATH(1 SECONDS, owner) // give them a bit of time to realize what attack is actually happening
|
||||
|
||||
@@ -36,6 +36,9 @@
|
||||
/turf/cordon/ScrapeAway(amount, flags)
|
||||
return src // :devilcat:
|
||||
|
||||
/turf/cordon/TerraformTurf(path, list/new_baseturfs, flags)
|
||||
return
|
||||
|
||||
/turf/cordon/bullet_act(obj/projectile/hitting_projectile, def_zone, piercing_hit)
|
||||
return BULLET_ACT_HIT
|
||||
|
||||
|
||||
@@ -23,17 +23,18 @@
|
||||
if(!isliving(parent) || !isliving(old_body) || !server.is_operational || !pod.is_operational)
|
||||
return COMPONENT_INCOMPATIBLE
|
||||
|
||||
old_mind_ref = WEAKREF(old_mind)
|
||||
old_body_ref = WEAKREF(old_body)
|
||||
netpod_ref = WEAKREF(pod)
|
||||
server_ref = WEAKREF(server)
|
||||
|
||||
var/mob/living/avatar = parent
|
||||
|
||||
netpod_ref = WEAKREF(pod)
|
||||
old_body_ref = WEAKREF(old_body)
|
||||
old_mind_ref = WEAKREF(old_mind)
|
||||
pod.avatar_ref = WEAKREF(avatar)
|
||||
server_ref = WEAKREF(server)
|
||||
server.avatar_connection_refs.Add(WEAKREF(src))
|
||||
|
||||
avatar.key = old_body.key
|
||||
ADD_TRAIT(old_body, TRAIT_MIND_TEMPORARILY_GONE, REF(src))
|
||||
ADD_TRAIT(avatar, TRAIT_TEMPORARY_BODY, REF(src))
|
||||
|
||||
connect_avatar_signals(avatar)
|
||||
RegisterSignal(pod, COMSIG_BITRUNNER_CROWBAR_ALERT, PROC_REF(on_netpod_crowbar))
|
||||
RegisterSignal(pod, COMSIG_BITRUNNER_NETPOD_INTEGRITY, PROC_REF(on_netpod_damaged))
|
||||
RegisterSignal(pod, COMSIG_BITRUNNER_SEVER_AVATAR, PROC_REF(on_sever_connection))
|
||||
@@ -45,8 +46,6 @@
|
||||
RegisterSignal(avatar.mind, COMSIG_MIND_TRANSFERRED, PROC_REF(on_mind_transfer))
|
||||
#endif
|
||||
|
||||
server.avatar_connection_refs.Add(WEAKREF(src))
|
||||
|
||||
if(!locate(/datum/action/avatar_domain_info) in avatar.actions)
|
||||
var/datum/avatar_help_text/help_datum = new(help_text)
|
||||
var/datum/action/avatar_domain_info/action = new(help_datum)
|
||||
@@ -61,77 +60,39 @@
|
||||
if(isnull(pod))
|
||||
return COMPONENT_INCOMPATIBLE
|
||||
|
||||
var/mob/living/avatar = parent
|
||||
if(!isliving(avatar))
|
||||
if(!isliving(parent))
|
||||
return COMPONENT_INCOMPATIBLE
|
||||
|
||||
/// One hop of avatar connection - needs called any time the pilot swaps avatars
|
||||
/datum/component/avatar_connection/proc/connect_avatar_signals(mob/living/target)
|
||||
var/obj/machinery/netpod/pod = netpod_ref?.resolve()
|
||||
pod.avatar_ref = WEAKREF(parent)
|
||||
|
||||
if(parent != target)
|
||||
target.TakeComponent(src)
|
||||
/datum/component/avatar_connection/RegisterWithParent()
|
||||
ADD_TRAIT(parent, TRAIT_TEMPORARY_BODY, REF(src))
|
||||
RegisterSignal(parent, COMSIG_BITRUNNER_SAFE_DISCONNECT, PROC_REF(on_safe_disconnect))
|
||||
RegisterSignal(parent, COMSIG_LIVING_DEATH, PROC_REF(on_sever_connection), override = TRUE)
|
||||
RegisterSignal(parent, COMSIG_MOB_APPLY_DAMAGE, PROC_REF(on_linked_damage))
|
||||
|
||||
var/mob/living/avatar = parent
|
||||
if(isnull(pod))
|
||||
avatar.dust()
|
||||
return
|
||||
|
||||
pod.avatar_ref = WEAKREF(target)
|
||||
RegisterSignal(avatar, COMSIG_BITRUNNER_SAFE_DISCONNECT, PROC_REF(on_safe_disconnect))
|
||||
RegisterSignal(avatar, COMSIG_LIVING_DEATH, PROC_REF(on_sever_connection), override = TRUE)
|
||||
RegisterSignal(avatar, COMSIG_MOB_APPLY_DAMAGE, PROC_REF(on_linked_damage))
|
||||
|
||||
/// Disconnects the old body's signals and actions
|
||||
/datum/component/avatar_connection/proc/disconnect_avatar_signals()
|
||||
var/mob/living/avatar = parent
|
||||
var/datum/action/avatar_domain_info/action = locate() in avatar.actions
|
||||
if(action)
|
||||
action.Remove(avatar)
|
||||
|
||||
UnregisterSignal(avatar, COMSIG_BITRUNNER_SAFE_DISCONNECT)
|
||||
UnregisterSignal(avatar, COMSIG_LIVING_DEATH)
|
||||
UnregisterSignal(avatar, COMSIG_MOB_APPLY_DAMAGE)
|
||||
/datum/component/avatar_connection/UnregisterFromParent()
|
||||
REMOVE_TRAIT(parent, TRAIT_TEMPORARY_BODY, REF(src))
|
||||
UnregisterSignal(parent, COMSIG_BITRUNNER_SAFE_DISCONNECT)
|
||||
UnregisterSignal(parent, COMSIG_LIVING_DEATH)
|
||||
UnregisterSignal(parent, COMSIG_MOB_APPLY_DAMAGE)
|
||||
|
||||
/// Disconnects the avatar and returns the mind to the old_body.
|
||||
/datum/component/avatar_connection/proc/full_avatar_disconnect(forced = FALSE, obj/machinery/netpod/broken_netpod)
|
||||
var/mob/living/old_body = old_body_ref?.resolve()
|
||||
if(isnull(old_body))
|
||||
return
|
||||
|
||||
var/mob/living/avatar = parent
|
||||
|
||||
disconnect_avatar_signals()
|
||||
UnregisterSignal(avatar, COMSIG_BITRUNNER_SAFE_DISCONNECT)
|
||||
#ifndef UNIT_TESTS
|
||||
UnregisterSignal(avatar.mind, COMSIG_MIND_TRANSFERRED)
|
||||
#endif
|
||||
UnregisterSignal(old_body, COMSIG_LIVING_DEATH)
|
||||
UnregisterSignal(old_body, COMSIG_LIVING_STATUS_UNCONSCIOUS)
|
||||
UnregisterSignal(old_body, COMSIG_MOVABLE_MOVED)
|
||||
|
||||
var/obj/machinery/netpod/hosting_netpod = netpod_ref?.resolve() || broken_netpod
|
||||
if(isnull(hosting_netpod))
|
||||
return
|
||||
|
||||
UnregisterSignal(hosting_netpod, COMSIG_BITRUNNER_CROWBAR_ALERT)
|
||||
UnregisterSignal(hosting_netpod, COMSIG_BITRUNNER_NETPOD_INTEGRITY)
|
||||
UnregisterSignal(hosting_netpod, COMSIG_BITRUNNER_SEVER_AVATAR)
|
||||
|
||||
var/obj/machinery/quantum_server/server = server_ref?.resolve()
|
||||
if(server)
|
||||
server.avatar_connection_refs.Remove(WEAKREF(src))
|
||||
UnregisterSignal(server, COMSIG_BITRUNNER_DOMAIN_COMPLETE)
|
||||
UnregisterSignal(server, COMSIG_BITRUNNER_SEVER_AVATAR)
|
||||
UnregisterSignal(server, COMSIG_BITRUNNER_SHUTDOWN_ALERT)
|
||||
UnregisterSignal(server, COMSIG_BITRUNNER_THREAT_CREATED)
|
||||
|
||||
/datum/component/avatar_connection/proc/full_avatar_disconnect(forced = FALSE, datum/source)
|
||||
return_to_old_body()
|
||||
|
||||
hosting_netpod.disconnect_occupant(forced)
|
||||
var/obj/machinery/netpod/hosting_netpod = netpod_ref?.resolve()
|
||||
if(isnull(hosting_netpod) && istype(source, /obj/machinery/netpod))
|
||||
hosting_netpod = source
|
||||
|
||||
hosting_netpod?.disconnect_occupant(forced)
|
||||
|
||||
var/obj/machinery/quantum_server/server = server_ref?.resolve()
|
||||
server?.avatar_connection_refs.Remove(WEAKREF(src))
|
||||
|
||||
qdel(src)
|
||||
|
||||
/// Triggers whenever the server gets a loot crate pushed to send area
|
||||
/// Triggers whenever the server gets a loot crate pushed to goal area
|
||||
/datum/component/avatar_connection/proc/on_domain_completed(datum/source, atom/entered)
|
||||
SIGNAL_HANDLER
|
||||
|
||||
@@ -171,10 +132,8 @@
|
||||
var/datum/action/avatar_domain_info/action = locate() in previous_body.actions
|
||||
if(action)
|
||||
action.Grant(source.current)
|
||||
action.Remove(previous_body)
|
||||
|
||||
disconnect_avatar_signals()
|
||||
connect_avatar_signals(source.current)
|
||||
source.current.TakeComponent(src)
|
||||
|
||||
/// Triggers when someone starts prying open our netpod
|
||||
/datum/component/avatar_connection/proc/on_netpod_crowbar(datum/source, mob/living/intruder)
|
||||
@@ -206,10 +165,10 @@
|
||||
full_avatar_disconnect()
|
||||
|
||||
/// Helper for calling sever with forced variables
|
||||
/datum/component/avatar_connection/proc/on_sever_connection(datum/source, obj/machinery/netpod/broken_netpod)
|
||||
/datum/component/avatar_connection/proc/on_sever_connection(datum/source)
|
||||
SIGNAL_HANDLER
|
||||
|
||||
full_avatar_disconnect(forced = TRUE, broken_netpod = broken_netpod)
|
||||
full_avatar_disconnect(forced = TRUE, source = source)
|
||||
|
||||
/// Triggers when the server is shutting down
|
||||
/datum/component/avatar_connection/proc/on_shutting_down(datum/source, mob/living/hackerman)
|
||||
@@ -238,24 +197,18 @@
|
||||
/datum/component/avatar_connection/proc/return_to_old_body()
|
||||
var/datum/mind/old_mind = old_mind_ref?.resolve()
|
||||
var/mob/living/old_body = old_body_ref?.resolve()
|
||||
|
||||
if(!old_mind || !old_body)
|
||||
return
|
||||
|
||||
var/mob/living/avatar = parent
|
||||
|
||||
#ifdef UNIT_TESTS
|
||||
// no minds during test so let's just yeet
|
||||
return
|
||||
#endif
|
||||
|
||||
var/mob/dead/observer/ghost = avatar.ghostize()
|
||||
if(!ghost)
|
||||
if(isnull(ghost))
|
||||
ghost = avatar.get_ghost()
|
||||
|
||||
if(!ghost)
|
||||
if(isnull(ghost))
|
||||
CRASH("[src] belonging to [parent] was completely unable to find a ghost to put back into a body!")
|
||||
|
||||
if(isnull(old_mind) || isnull(old_body))
|
||||
return
|
||||
|
||||
ghost.mind = old_mind
|
||||
if(old_body.stat != DEAD)
|
||||
old_mind.transfer_to(old_body, force_key_move = TRUE)
|
||||
@@ -263,7 +216,3 @@
|
||||
old_mind.set_current(old_body)
|
||||
|
||||
REMOVE_TRAIT(old_body, TRAIT_MIND_TEMPORARILY_GONE, REF(src))
|
||||
REMOVE_TRAIT(avatar, TRAIT_TEMPORARY_BODY, REF(src))
|
||||
|
||||
old_mind = null
|
||||
old_body = null
|
||||
|
||||
@@ -62,8 +62,8 @@
|
||||
|
||||
/// Handles generating random numbers & calculating loot totals
|
||||
/obj/structure/closet/crate/secure/bitrunning/decrypted/proc/calculate_loot(reward_points, rewards_multiplier, ore_multiplier)
|
||||
var/base = 1 * (rewards_multiplier + reward_points)
|
||||
var/random_sum = (rand() * 1.0 + 0.5) * base
|
||||
var/base = rewards_multiplier + reward_points
|
||||
var/random_sum = (rand() + 0.5) * base
|
||||
return ROUND_UP(random_sum * ore_multiplier)
|
||||
|
||||
/// Handles spawning extra loot. This tries to handle bad flat and assoc lists
|
||||
|
||||
@@ -33,6 +33,7 @@
|
||||
. = ..()
|
||||
|
||||
disconnect_damage = BASE_DISCONNECT_DAMAGE
|
||||
find_server()
|
||||
|
||||
RegisterSignals(src, list(
|
||||
COMSIG_QDELETING,
|
||||
@@ -408,10 +409,7 @@
|
||||
examine_text += span_notice("It is currently occupied by [occupant].")
|
||||
examine_text += span_notice("It can be pried open with a crowbar, but its safety mechanisms will alert the occupant.")
|
||||
|
||||
/// On unbuckle or break, make sure the occupant ref is null
|
||||
/obj/machinery/netpod/proc/unprotect_and_signal()
|
||||
unprotect_occupant(occupant)
|
||||
SEND_SIGNAL(src, COMSIG_BITRUNNER_SEVER_AVATAR, src)
|
||||
|
||||
|
||||
/// When the server is upgraded, drops brain damage a little
|
||||
/obj/machinery/netpod/proc/on_server_upgraded(datum/source, servo_rating)
|
||||
@@ -450,6 +448,11 @@
|
||||
target.extinguish_mob()
|
||||
update_use_power(ACTIVE_POWER_USE)
|
||||
|
||||
/// On unbuckle or break, make sure the occupant ref is null
|
||||
/obj/machinery/netpod/proc/unprotect_and_signal()
|
||||
unprotect_occupant(occupant)
|
||||
SEND_SIGNAL(src, COMSIG_BITRUNNER_SEVER_AVATAR)
|
||||
|
||||
/// Removes the occupant from netpod stasis
|
||||
/obj/machinery/netpod/proc/unprotect_occupant(mob/living/target)
|
||||
var/datum/component/netpod_healing/healing_eff = target?.GetComponent(/datum/component/netpod_healing)
|
||||
|
||||
@@ -17,7 +17,7 @@
|
||||
/obj/machinery/computer/quantum_console/LateInitialize()
|
||||
. = ..()
|
||||
|
||||
if(isnull(server_ref))
|
||||
if(isnull(server_ref?.resolve()))
|
||||
find_server()
|
||||
|
||||
/obj/machinery/computer/quantum_console/ui_interact(mob/user, datum/tgui/ui)
|
||||
@@ -26,7 +26,7 @@
|
||||
if(!is_operational)
|
||||
return
|
||||
|
||||
if(isnull(server_ref))
|
||||
if(isnull(server_ref?.resolve()))
|
||||
find_server()
|
||||
|
||||
ui = SStgui.try_update_ui(user, src, ui)
|
||||
@@ -106,5 +106,3 @@
|
||||
server_ref = WEAKREF(nearby_server)
|
||||
nearby_server.console_ref = WEAKREF(src)
|
||||
return nearby_server
|
||||
|
||||
return
|
||||
|
||||
@@ -174,6 +174,7 @@
|
||||
|
||||
creature.dust() // sometimes mobs just don't die
|
||||
|
||||
avatar_connection_refs.Cut()
|
||||
exit_turfs = list()
|
||||
generated_domain = null
|
||||
generated_safehouse = null
|
||||
|
||||
@@ -34,6 +34,8 @@
|
||||
var/list/datum/weakref/spawned_threat_refs = list()
|
||||
/// Scales loot with extra players
|
||||
var/multiplayer_bonus = 1.1
|
||||
///The radio the console can speak into
|
||||
var/obj/item/radio/radio
|
||||
/// The amount of points in the system, used to purchase maps
|
||||
var/points = 0
|
||||
/// Keeps track of the number of times someone has built a hololadder
|
||||
@@ -60,6 +62,12 @@
|
||||
if(isnull(console_ref))
|
||||
find_console()
|
||||
|
||||
radio = new(src)
|
||||
radio.set_frequency(FREQ_SUPPLY)
|
||||
radio.subspace_transmission = TRUE
|
||||
radio.canhear_range = 0
|
||||
radio.recalculateChannels()
|
||||
|
||||
RegisterSignals(src, list(COMSIG_MACHINERY_BROKEN, COMSIG_MACHINERY_POWER_LOST), PROC_REF(on_broken))
|
||||
RegisterSignal(src, COMSIG_QDELETING, PROC_REF(on_delete))
|
||||
RegisterSignal(src, COMSIG_ATOM_EXAMINE, PROC_REF(on_examine))
|
||||
@@ -79,6 +87,7 @@
|
||||
QDEL_NULL(receive_turfs)
|
||||
QDEL_NULL(generated_domain)
|
||||
QDEL_NULL(generated_safehouse)
|
||||
QDEL_NULL(radio)
|
||||
|
||||
/obj/machinery/quantum_server/update_appearance(updates)
|
||||
if(isnull(generated_domain) || !is_operational)
|
||||
@@ -140,4 +149,4 @@
|
||||
|
||||
servo_bonus = servo_rating
|
||||
|
||||
SEND_SIGNAL(src, COMSIG_BITRUNNER_SERVER_UPGRADED, scanner_tier)
|
||||
SEND_SIGNAL(src, COMSIG_BITRUNNER_SERVER_UPGRADED, servo_rating)
|
||||
|
||||
@@ -5,6 +5,7 @@
|
||||
/obj/machinery/quantum_server/proc/cool_off()
|
||||
is_ready = TRUE
|
||||
update_appearance()
|
||||
radio.talk_into(src, "Thermal systems within operational parameters. Proceeding to domain configuration.", RADIO_CHANNEL_SUPPLY)
|
||||
|
||||
/// Attempts to connect to a quantum console
|
||||
/obj/machinery/quantum_server/proc/find_console()
|
||||
|
||||
@@ -70,7 +70,10 @@
|
||||
return ..()
|
||||
|
||||
/mob/living/simple_animal/hostile/megafauna/death(gibbed, list/force_grant)
|
||||
if(health > 0)
|
||||
if(gibbed) // in case they've been force dusted
|
||||
return ..()
|
||||
|
||||
if(health > 0) // prevents instakills
|
||||
return
|
||||
var/datum/status_effect/crusher_damage/crusher_dmg = has_status_effect(/datum/status_effect/crusher_damage)
|
||||
///Whether we killed the megafauna with primarily crusher damage or not
|
||||
@@ -95,8 +98,8 @@
|
||||
/mob/living/simple_animal/hostile/megafauna/gib()
|
||||
if(health > 0)
|
||||
return
|
||||
else
|
||||
..()
|
||||
|
||||
return ..()
|
||||
|
||||
/mob/living/simple_animal/hostile/megafauna/singularity_act()
|
||||
set_health(0)
|
||||
@@ -105,8 +108,11 @@
|
||||
/mob/living/simple_animal/hostile/megafauna/dust(just_ash, drop_items, force)
|
||||
if(!force && health > 0)
|
||||
return
|
||||
else
|
||||
..()
|
||||
|
||||
crusher_loot.Cut()
|
||||
loot.Cut()
|
||||
|
||||
return ..()
|
||||
|
||||
/mob/living/simple_animal/hostile/megafauna/AttackingTarget()
|
||||
if(recovery_time >= world.time)
|
||||
|
||||
@@ -272,7 +272,7 @@
|
||||
if(!isclosedturf(T) && !islava(T))
|
||||
var/lava_turf = /turf/open/lava/smooth
|
||||
var/reset_turf = T.type
|
||||
T.ChangeTurf(lava_turf, flags = CHANGETURF_INHERIT_AIR)
|
||||
T.TerraformTurf(lava_turf, flags = CHANGETURF_INHERIT_AIR)
|
||||
addtimer(CALLBACK(T, TYPE_PROC_REF(/turf, ChangeTurf), reset_turf, null, CHANGETURF_INHERIT_AIR), reset_time, TIMER_OVERRIDE|TIMER_UNIQUE)
|
||||
|
||||
/obj/effect/temp_visual/drakewall
|
||||
|
||||
@@ -449,19 +449,21 @@
|
||||
drop_loot()
|
||||
if(dextrous)
|
||||
drop_all_held_items()
|
||||
|
||||
if(del_on_death)
|
||||
..()
|
||||
//Prevent infinite loops if the mob Destroy() is overridden in such
|
||||
//a manner as to cause a call to death() again //Pain
|
||||
del_on_death = FALSE
|
||||
qdel(src)
|
||||
else
|
||||
health = 0
|
||||
icon_state = icon_dead
|
||||
if(flip_on_death)
|
||||
transform = transform.Turn(180)
|
||||
ADD_TRAIT(src, TRAIT_UNDENSE, BASIC_MOB_DEATH_TRAIT)
|
||||
..()
|
||||
return
|
||||
|
||||
health = 0
|
||||
icon_state = icon_dead
|
||||
if(flip_on_death)
|
||||
transform = transform.Turn(180)
|
||||
ADD_TRAIT(src, TRAIT_UNDENSE, BASIC_MOB_DEATH_TRAIT)
|
||||
return ..()
|
||||
|
||||
/mob/living/simple_animal/proc/CanAttack(atom/the_target)
|
||||
if(!isatom(the_target)) // no
|
||||
|
||||
@@ -316,7 +316,7 @@ const DisplayDetails = (props: DisplayDetailsProps, context) => {
|
||||
const { amount = 0, color, icon = 'star' } = props;
|
||||
|
||||
if (amount === 0) {
|
||||
return <TableCell color="label">None</TableCell>;
|
||||
return <TableCell color="label">No bandwidth</TableCell>;
|
||||
}
|
||||
|
||||
if (typeof amount === 'string') {
|
||||
|
||||
Reference in New Issue
Block a user