mirror of
https://github.com/CHOMPStation2/CHOMPStation2.git
synced 2025-12-10 10:12:45 +00:00
[MIRROR] cleans up some left over things (#10168)
Co-authored-by: Kashargul <144968721+Kashargul@users.noreply.github.com>
This commit is contained in:
committed by
GitHub
parent
90e86a173a
commit
9ffe6f5fcb
@@ -91,24 +91,23 @@ The "dust" will damage the hull of the station causin minor hull breaches.
|
|||||||
qdel(src)
|
qdel(src)
|
||||||
|
|
||||||
/obj/effect/space_dust/Bump(atom/A)
|
/obj/effect/space_dust/Bump(atom/A)
|
||||||
spawn(0)
|
if(prob(50))
|
||||||
if(prob(50))
|
for(var/mob/M in range(10, src))
|
||||||
for(var/mob/M in range(10, src))
|
if(!M.stat && !isAI(M))
|
||||||
if(!M.stat && !isAI(M))
|
shake_camera(M, 3, 1)
|
||||||
shake_camera(M, 3, 1)
|
if (A)
|
||||||
if (A)
|
playsound(src, 'sound/effects/meteorimpact.ogg', 40, 1)
|
||||||
playsound(src, 'sound/effects/meteorimpact.ogg', 40, 1)
|
|
||||||
|
|
||||||
if(ismob(A))
|
if(ismob(A))
|
||||||
A.ex_act(strength)//This should work for now I guess
|
A.ex_act(strength)//This should work for now I guess
|
||||||
else if(!istype(A,/obj/machinery/power/emitter) && !istype(A,/obj/machinery/field_generator)) //Protect the singularity from getting released every round!
|
else if(!istype(A,/obj/machinery/power/emitter) && !istype(A,/obj/machinery/field_generator)) //Protect the singularity from getting released every round!
|
||||||
A.ex_act(strength) //Changing emitter/field gen ex_act would make it immune to bombs and C4
|
A.ex_act(strength) //Changing emitter/field gen ex_act would make it immune to bombs and C4
|
||||||
|
|
||||||
life--
|
life--
|
||||||
if(life <= 0)
|
if(life <= 0)
|
||||||
walk(src,0)
|
walk(src,0)
|
||||||
qdel(src)
|
qdel(src)
|
||||||
return
|
return
|
||||||
return
|
return
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -485,7 +485,7 @@
|
|||||||
name = "Diskette Box"
|
name = "Diskette Box"
|
||||||
icon_state = "disk_kit"
|
icon_state = "disk_kit"
|
||||||
|
|
||||||
/obj/item/storage/box/Initialize()
|
/obj/item/storage/box/disks/Initialize()
|
||||||
. = ..()
|
. = ..()
|
||||||
new /obj/item/disk/body_record(src)
|
new /obj/item/disk/body_record(src)
|
||||||
new /obj/item/disk/body_record(src)
|
new /obj/item/disk/body_record(src)
|
||||||
|
|||||||
@@ -26,8 +26,7 @@
|
|||||||
dropped.density = FALSE
|
dropped.density = FALSE
|
||||||
dropped.opacity = FALSE
|
dropped.opacity = FALSE
|
||||||
animate(dropped, pixel_y = initial_y, pixel_x = initial_x , time = 7)
|
animate(dropped, pixel_y = initial_y, pixel_x = initial_x , time = 7)
|
||||||
spawn(7)
|
addtimer(CALLBACK(dropped, TYPE_PROC_REF(/atom/movable,end_fall), crushing), 0.7 SECONDS)
|
||||||
dropped.end_fall(crushing)
|
|
||||||
qdel(src)
|
qdel(src)
|
||||||
|
|
||||||
/atom/movable/proc/end_fall(var/crushing = FALSE)
|
/atom/movable/proc/end_fall(var/crushing = FALSE)
|
||||||
|
|||||||
@@ -512,8 +512,7 @@
|
|||||||
playsound(src, 'sound/effects/explosionfar.ogg', 50, 0, 0)
|
playsound(src, 'sound/effects/explosionfar.ogg', 50, 0, 0)
|
||||||
for(var/mob/M in range(10, src)) // Checks range
|
for(var/mob/M in range(10, src)) // Checks range
|
||||||
if(!M.stat && !isAI(M)) // Checks to make sure whoever's getting shaken is alive/not the AI
|
if(!M.stat && !isAI(M)) // Checks to make sure whoever's getting shaken is alive/not the AI
|
||||||
sleep(2) // Short delay to match up with the explosion sound
|
addtimer(CALLBACK(GLOBAL_PROC, GLOBAL_PROC_REF(shake_camera), M, 2, 1), 0.2 SECONDS)
|
||||||
shake_camera(M, 2, 1)
|
|
||||||
else
|
else
|
||||||
to_chat(user, span_warning("Nothing happens."))
|
to_chat(user, span_warning("Nothing happens."))
|
||||||
|
|
||||||
|
|||||||
@@ -437,8 +437,14 @@
|
|||||||
|
|
||||||
if(ticker < burst)
|
if(ticker < burst)
|
||||||
addtimer(CALLBACK(src, PROC_REF(handle_gunfire),target, user, clickparams, pointblank, reflex, ++ticker, TRUE), burst_delay, TIMER_DELETE_ME)
|
addtimer(CALLBACK(src, PROC_REF(handle_gunfire),target, user, clickparams, pointblank, reflex, ++ticker, TRUE), burst_delay, TIMER_DELETE_ME)
|
||||||
|
return
|
||||||
|
|
||||||
|
if(ticker == burst)
|
||||||
|
if(muzzle_flash)
|
||||||
|
if(gun_light)
|
||||||
|
addtimer(CALLBACK(src, TYPE_PROC_REF(/atom, set_light),light_brightness), burst_delay, TIMER_DELETE_ME)
|
||||||
|
else
|
||||||
|
addtimer(CALLBACK(src, TYPE_PROC_REF(/atom, set_light),0), burst_delay, TIMER_DELETE_ME)
|
||||||
|
|
||||||
// Similar to the above proc, but does not require a user, which is ideal for things like turrets.
|
// Similar to the above proc, but does not require a user, which is ideal for things like turrets.
|
||||||
/obj/item/gun/proc/Fire_userless(atom/target)
|
/obj/item/gun/proc/Fire_userless(atom/target)
|
||||||
@@ -594,8 +600,7 @@
|
|||||||
to_chat(user, span_warning("You struggle to hold \the [src] steady!"))
|
to_chat(user, span_warning("You struggle to hold \the [src] steady!"))
|
||||||
|
|
||||||
if(recoil)
|
if(recoil)
|
||||||
spawn()
|
shake_camera(user, recoil+1, recoil)
|
||||||
shake_camera(user, recoil+1, recoil)
|
|
||||||
update_icon()
|
update_icon()
|
||||||
|
|
||||||
/obj/item/gun/proc/process_point_blank(obj/projectile, mob/user, atom/target)
|
/obj/item/gun/proc/process_point_blank(obj/projectile, mob/user, atom/target)
|
||||||
|
|||||||
@@ -109,7 +109,7 @@
|
|||||||
/obj/item/projectile/meteor
|
/obj/item/projectile/meteor
|
||||||
name = "meteor"
|
name = "meteor"
|
||||||
icon = 'icons/obj/meteor.dmi'
|
icon = 'icons/obj/meteor.dmi'
|
||||||
icon_state = "smallf"
|
icon_state = "small"
|
||||||
damage = 0
|
damage = 0
|
||||||
damage_type = BRUTE
|
damage_type = BRUTE
|
||||||
nodamage = 1
|
nodamage = 1
|
||||||
@@ -121,8 +121,6 @@
|
|||||||
loc = A.loc
|
loc = A.loc
|
||||||
return
|
return
|
||||||
|
|
||||||
sleep(-1) //Might not be important enough for a sleep(-1) but the sleep/spawn itself is necessary thanks to explosions and metoerhits
|
|
||||||
|
|
||||||
if(src)//Do not add to this if() statement, otherwise the meteor won't delete them
|
if(src)//Do not add to this if() statement, otherwise the meteor won't delete them
|
||||||
if(A)
|
if(A)
|
||||||
|
|
||||||
|
|||||||
@@ -41,11 +41,14 @@
|
|||||||
for(var/area/A in shuttle_area)
|
for(var/area/A in shuttle_area)
|
||||||
for(var/mob/living/L in A)
|
for(var/mob/living/L in A)
|
||||||
victims += L
|
victims += L
|
||||||
spawn(0)
|
shake_camera(L,2 SECONDS,4)
|
||||||
shake_camera(L,2 SECONDS,4)
|
|
||||||
|
|
||||||
//SHAKA SHAKA SHAKA
|
//SHAKA SHAKA SHAKA
|
||||||
sleep(2 SECONDS)
|
addtimer(CALLBACK(src, PROC_REF(after_crash), victims, target), 2 SECONDS)
|
||||||
|
|
||||||
|
/datum/shuttle/proc/after_crash(var/list/victims, var/obj/effect/shuttle_landmark/target)
|
||||||
|
PRIVATE_PROC(TRUE)
|
||||||
|
SHOULD_NOT_OVERRIDE(TRUE)
|
||||||
|
|
||||||
// Move the shuttle
|
// Move the shuttle
|
||||||
if (!attempt_move(target))
|
if (!attempt_move(target))
|
||||||
|
|||||||
@@ -330,22 +330,21 @@
|
|||||||
TA.ChangeTurf(get_base_turf_by_area(TA), 1, 1)
|
TA.ChangeTurf(get_base_turf_by_area(TA), 1, 1)
|
||||||
if(knockdown)
|
if(knockdown)
|
||||||
for(var/mob/living/M in A)
|
for(var/mob/living/M in A)
|
||||||
spawn(0)
|
if(M.buckled)
|
||||||
if(M.buckled)
|
to_chat(M, span_red("Sudden acceleration presses you into \the [M.buckled]!"))
|
||||||
to_chat(M, span_red("Sudden acceleration presses you into \the [M.buckled]!"))
|
shake_camera(M, 3, 1)
|
||||||
shake_camera(M, 3, 1)
|
else
|
||||||
else
|
to_chat(M, span_red("The floor lurches beneath you!"))
|
||||||
to_chat(M, span_red("The floor lurches beneath you!"))
|
shake_camera(M, 10, 1)
|
||||||
shake_camera(M, 10, 1)
|
// TODO - tossing?
|
||||||
// TODO - tossing?
|
//M.visible_message(span_warning("[M.name] is tossed around by the sudden acceleration!"))
|
||||||
//M.visible_message(span_warning("[M.name] is tossed around by the sudden acceleration!"))
|
//M.throw_at_random(FALSE, 4, 1)
|
||||||
//M.throw_at_random(FALSE, 4, 1)
|
if(istype(M, /mob/living/carbon))
|
||||||
if(istype(M, /mob/living/carbon))
|
M.Weaken(3)
|
||||||
M.Weaken(3)
|
//VOREStation Add
|
||||||
//VOREStation Add
|
if(move_direction)
|
||||||
if(move_direction)
|
throw_a_mob(M,move_direction)
|
||||||
throw_a_mob(M,move_direction)
|
//VOREStation Add End
|
||||||
//VOREStation Add End
|
|
||||||
// We only need to rebuild powernets for our cables. No need to check machines because they are on top of cables.
|
// We only need to rebuild powernets for our cables. No need to check machines because they are on top of cables.
|
||||||
for(var/obj/structure/cable/C in A)
|
for(var/obj/structure/cable/C in A)
|
||||||
powernets |= C.powernet
|
powernets |= C.powernet
|
||||||
|
|||||||
@@ -64,14 +64,14 @@
|
|||||||
/datum/tgui_say/proc/load()
|
/datum/tgui_say/proc/load()
|
||||||
window_open = FALSE
|
window_open = FALSE
|
||||||
|
|
||||||
var/minimumHeight = client?.prefs?.read_preference(/datum/preference/numeric/tgui_say_height) || 1
|
var/minimum_height = client?.prefs?.read_preference(/datum/preference/numeric/tgui_say_height) || 1
|
||||||
var/minimumWidth = client?.prefs?.read_preference(/datum/preference/numeric/tgui_say_width) || 1
|
var/minimu_width = client?.prefs?.read_preference(/datum/preference/numeric/tgui_say_width) || 1
|
||||||
winset(client, "tgui_say", "pos=410,400;size=360,30;is-visible=0;")
|
winset(client, "tgui_say", "pos=410,400;size=360,30;is-visible=0;")
|
||||||
|
|
||||||
window.send_message("props", list(
|
window.send_message("props", list(
|
||||||
lightMode = client?.prefs?.read_preference(/datum/preference/toggle/tgui_say_light),
|
lightMode = client?.prefs?.read_preference(/datum/preference/toggle/tgui_say_light),
|
||||||
minimumHeight = minimumHeight,
|
minimumHeight = minimum_height,
|
||||||
minimumWidth = minimumWidth,
|
minimumWidth = minimu_width,
|
||||||
maxLength = max_length,
|
maxLength = max_length,
|
||||||
))
|
))
|
||||||
|
|
||||||
|
|||||||
@@ -61,7 +61,17 @@ class HubStorageBackend {
|
|||||||
class StorageProxy {
|
class StorageProxy {
|
||||||
constructor() {
|
constructor() {
|
||||||
this.backendPromise = (async () => {
|
this.backendPromise = (async () => {
|
||||||
if (!Byond.TRIDENT && testHubStorage()) {
|
if (!Byond.TRIDENT) {
|
||||||
|
if (!testHubStorage()) {
|
||||||
|
return new Promise((resolve) => {
|
||||||
|
const listener = () => {
|
||||||
|
document.removeEventListener('byondstorageupdated', listener);
|
||||||
|
resolve(new HubStorageBackend());
|
||||||
|
};
|
||||||
|
|
||||||
|
document.addEventListener('byondstorageupdated', listener);
|
||||||
|
});
|
||||||
|
}
|
||||||
return new HubStorageBackend();
|
return new HubStorageBackend();
|
||||||
}
|
}
|
||||||
})();
|
})();
|
||||||
|
|||||||
@@ -130,7 +130,7 @@ export function TguiSay() {
|
|||||||
const prefix = currentPrefix ?? '';
|
const prefix = currentPrefix ?? '';
|
||||||
const grunt = iterator.isSay() ? prefix + value : value;
|
const grunt = iterator.isSay() ? prefix + value : value;
|
||||||
|
|
||||||
messages.current.forceSayMsg(grunt, iterator.current());
|
messages.current.forceSayMsg(grunt);
|
||||||
unloadChat();
|
unloadChat();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -140,10 +140,26 @@ export function TguiSay() {
|
|||||||
iterator.next();
|
iterator.next();
|
||||||
setButtonContent(iterator.current());
|
setButtonContent(iterator.current());
|
||||||
setCurrentPrefix(null);
|
setCurrentPrefix(null);
|
||||||
messages.current.channelIncrementMsg(iterator.isVisible());
|
messages.current.channelIncrementMsg(
|
||||||
|
iterator.isVisible(),
|
||||||
|
iterator.current(),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
function handleDecrementChannel() {
|
||||||
|
const iterator = channelIterator.current;
|
||||||
|
|
||||||
|
iterator.prev();
|
||||||
|
setButtonContent(iterator.current());
|
||||||
|
setCurrentPrefix(null);
|
||||||
|
messages.current.channelIncrementMsg(
|
||||||
|
iterator.isVisible(),
|
||||||
|
iterator.current(),
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
function handleInput(event: FormEvent<HTMLTextAreaElement>): void {
|
function handleInput(event: FormEvent<HTMLTextAreaElement>): void {
|
||||||
|
const iterator = channelIterator.current;
|
||||||
let newValue = event.currentTarget.value;
|
let newValue = event.currentTarget.value;
|
||||||
|
|
||||||
let newPrefix = getPrefix(newValue) || currentPrefix;
|
let newPrefix = getPrefix(newValue) || currentPrefix;
|
||||||
@@ -160,7 +176,7 @@ export function TguiSay() {
|
|||||||
|
|
||||||
// Handles typing indicators
|
// Handles typing indicators
|
||||||
if (channelIterator.current.isVisible() && newPrefix !== ',b ') {
|
if (channelIterator.current.isVisible() && newPrefix !== ',b ') {
|
||||||
messages.current.typingMsg();
|
messages.current.typingMsg(iterator.current());
|
||||||
}
|
}
|
||||||
|
|
||||||
setValue(newValue);
|
setValue(newValue);
|
||||||
@@ -236,6 +252,10 @@ export function TguiSay() {
|
|||||||
|
|
||||||
case KEY.Tab:
|
case KEY.Tab:
|
||||||
event.preventDefault();
|
event.preventDefault();
|
||||||
|
if (event.shiftKey) {
|
||||||
|
handleDecrementChannel();
|
||||||
|
break;
|
||||||
|
}
|
||||||
handleIncrementChannel();
|
handleIncrementChannel();
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
|||||||
@@ -48,7 +48,7 @@ function setWindowVisibility(visible: boolean): void {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
const CHANNEL_REGEX = /^[:.]|,b\w\s/;
|
const CHANNEL_REGEX = /^[:.]\w|,b\s/;
|
||||||
|
|
||||||
/** Tests for a channel prefix, returning it or none */
|
/** Tests for a channel prefix, returning it or none */
|
||||||
export function getPrefix(
|
export function getPrefix(
|
||||||
|
|||||||
@@ -8,15 +8,18 @@ const SECONDS = 1000;
|
|||||||
export const byondMessages = {
|
export const byondMessages = {
|
||||||
// Debounce: Prevents spamming the server
|
// Debounce: Prevents spamming the server
|
||||||
channelIncrementMsg: debounce(
|
channelIncrementMsg: debounce(
|
||||||
(visible: boolean) => Byond.sendMessage('thinking', { visible }),
|
(visible: boolean, channel: Channel) =>
|
||||||
|
Byond.sendMessage('thinking', { visible, channel }),
|
||||||
0.4 * SECONDS,
|
0.4 * SECONDS,
|
||||||
),
|
),
|
||||||
forceSayMsg: debounce(
|
forceSayMsg: debounce(
|
||||||
(entry: string, channel: Channel) =>
|
(entry: string) => Byond.sendMessage('force', { entry, channel: 'Say' }),
|
||||||
Byond.sendMessage('force', { entry, channel }),
|
|
||||||
1 * SECONDS,
|
1 * SECONDS,
|
||||||
true,
|
true,
|
||||||
),
|
),
|
||||||
// Throttle: Prevents spamming the server
|
// Throttle: Prevents spamming the server
|
||||||
typingMsg: throttle(() => Byond.sendMessage('typing'), 4 * SECONDS),
|
typingMsg: throttle(
|
||||||
|
(channel: string) => Byond.sendMessage('typing', { channel }),
|
||||||
|
4 * SECONDS,
|
||||||
|
),
|
||||||
} as const;
|
} as const;
|
||||||
|
|||||||
@@ -311,43 +311,6 @@ export const useBackend = <TData>() => {
|
|||||||
*/
|
*/
|
||||||
type StateWithSetter<T> = [T, (nextState: T) => void];
|
type StateWithSetter<T> = [T, (nextState: T) => void];
|
||||||
|
|
||||||
/**
|
|
||||||
* Allocates state on Redux store without sharing it with other clients.
|
|
||||||
*
|
|
||||||
* Use it when you want to have a stateful variable in your component
|
|
||||||
* that persists between renders, but will be forgotten after you close
|
|
||||||
* the UI.
|
|
||||||
*
|
|
||||||
* It is a lot more performant than `setSharedState`.
|
|
||||||
*
|
|
||||||
* @param context React context.
|
|
||||||
* @param key Key which uniquely identifies this state in Redux store.
|
|
||||||
* @param initialState Initializes your global variable with this value.
|
|
||||||
* @deprecated Use useState and useEffect when you can. Pass the state as a prop.
|
|
||||||
*/
|
|
||||||
export const useLocalState = <T>(
|
|
||||||
key: string,
|
|
||||||
initialState: T,
|
|
||||||
): StateWithSetter<T> => {
|
|
||||||
const state = globalStore?.getState()?.backend;
|
|
||||||
const sharedStates = state?.shared ?? {};
|
|
||||||
const sharedState = key in sharedStates ? sharedStates[key] : initialState;
|
|
||||||
return [
|
|
||||||
sharedState,
|
|
||||||
(nextState) => {
|
|
||||||
globalStore.dispatch(
|
|
||||||
backendSetSharedState({
|
|
||||||
key,
|
|
||||||
nextState:
|
|
||||||
typeof nextState === 'function'
|
|
||||||
? nextState(sharedState)
|
|
||||||
: nextState,
|
|
||||||
}),
|
|
||||||
);
|
|
||||||
},
|
|
||||||
];
|
|
||||||
};
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Allocates state on Redux store, and **shares** it with other clients
|
* Allocates state on Redux store, and **shares** it with other clients
|
||||||
* in the game.
|
* in the game.
|
||||||
|
|||||||
Reference in New Issue
Block a user