Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(Panic): 🐛 Add correct index for 0-6 results on the table #175

Merged
merged 1 commit into from
Sep 24, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 11 additions & 4 deletions src/utils/RollTable.js
Original file line number Diff line number Diff line change
Expand Up @@ -59,10 +59,6 @@ class RollTable extends Map {
return Math.min(...this.keys());
}

/* ------------------------------------------ */
/* Map Methods */
/* ------------------------------------------ */

// /**
// * The highest reference.
// * @type {number}
Expand All @@ -72,6 +68,17 @@ class RollTable extends Map {
// return this.rollFn();
// }

/* ------------------------------------------ */
/* Map Methods */
/* ------------------------------------------ */

/**
* Sets an entry in the table at a defined index.
* @param {number} key The numbered index for the table value
* @param {any} value The value to return at this index
* @param {boolean} [sort=true] Whether to sort the table after setting this entry
* @returns {this}
*/
set(key, value, sort = true) {
if (typeof key === 'string') key = +key;
if (typeof key === 'number' && !isNaN(key)) {
Expand Down
2 changes: 1 addition & 1 deletion src/yearzero/gamedata/de/table-alien-panic-effects.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
$name: alien-panic
$roll: true
0:
6:
icon: 😅
name: ZUSAMMENREISSEN
description: Du schaffst es, deine Nerven im Griff zu behalten. Gerade so.
Expand Down
2 changes: 1 addition & 1 deletion src/yearzero/gamedata/en-US/table-alien-panic-effects.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
$name: alien-panic
$roll: true
0:
6:
icon: 😅
name: KEEPING IT TOGETHER
description: You manage to keep your nerves in check. Barely.
Expand Down