Skip to content
This repository has been archived by the owner on Nov 23, 2021. It is now read-only.

Commit

Permalink
Fix DeathLink protocol to be in line with Berserker's intention
Browse files Browse the repository at this point in the history
  • Loading branch information
LegendaryLinux committed Nov 8, 2021
1 parent def3797 commit 7cc277c
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 7 deletions.
2 changes: 1 addition & 1 deletion assets/globals.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ const CLIENT_VERSION = {
state: 'Beta',
major: 0,
minor: 12,
patch: 1,
patch: 2,
};

const ARCHIPELAGO_PROTOCOL_VERSION = {
Expand Down
12 changes: 7 additions & 5 deletions assets/serverSocket.js
Original file line number Diff line number Diff line change
Expand Up @@ -229,7 +229,8 @@ const connectToServer = (address, password = null) => {
tags: ['DeathLink'],
data: {
time: Math.floor(lastForcedDeath / 1000), // UNIX Timestamp
source: playerSlot, // Slot of the player who died
source: players.find((player) =>
(player.team === playerTeam && player.slot === command.data.source)).alias,
}
}]));
}
Expand Down Expand Up @@ -452,11 +453,12 @@ const connectToServer = (address, password = null) => {

// DeathLink handling
if (command.tags && command.tags.includes('DeathLink')) {
if (deathLinkEnabled && (command.data.source !== playerSlot)) {
// Has it been at least ten seconds since the last time Samus was forcibly killed?
if (deathLinkEnabled && (new Date().getTime() > (lastForcedDeath + 10000))) {
// Notify the player of the DeathLink occurrence, and who is to blame
const deadPlayer = players.find((player) =>
(player.team === playerTeam && player.slot === command.data.source)).alias;
appendConsoleMessage(`${deadPlayer} has died, and took you with them.`);
appendConsoleMessage(`${command.data.source} has died, and took you with them.`);

// Kill Samus
await killSamus();
}
}
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "super-metroid-client",
"version": "0.12.1",
"version": "0.12.2",
"author": "Chris Wilson",
"description": "A Super Metroid client for Archipelago.",
"license": "MIT",
Expand Down

0 comments on commit 7cc277c

Please sign in to comment.