Add warnings if phaser has next card too long and increase it's virtual HP consumption #151

Open
esavkin wants to merge 2 commits from esavkin/web2019:148-phaser-fix into master
3 changed files with 7 additions and 7 deletions
Showing only changes of commit 1123794b1a - Show all commits

6
package-lock.json generated
View File

@ -2815,9 +2815,9 @@
"dev": true
},
"node_modules/caniuse-lite": {
"version": "1.0.30001690",
"resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001690.tgz",
"integrity": "sha512-5ExiE3qQN6oF8Clf8ifIDcMRCRE/dMGcETG/XGMD8/XiXm6HXQgQTh1yZYLXXpSOsEUlJm1Xr7kGULZTuGtP/w==",
"version": "1.0.30001696",
"resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001696.tgz",
"integrity": "sha512-pDCPkvzfa39ehJtJ+OwGT/2yvT2SbjfHhiIW2LWOAcMQ7BzwxT/XuyUp4OTOd0XFWA6BKw0JalnBHgSi5DGJBQ==",
"dev": true,
"funding": [
{

File diff suppressed because one or more lines are too long

View File

@ -99,7 +99,7 @@ const Types = {
"phaser_next_card_long": {
level: "reminder",
trigger: phaser_next_card_long,
message: "Next card may interfere with this Phaser. Consider placing a short card after this Phaser."
message: "The next card may interfere with this Phaser. Consider placing a shorter card right after this Phaser."
},
"default": {
level: "warning",
@ -158,17 +158,17 @@ const crate_warnings = {
}
},
"phaser_not_fit": {
message: "Since one or more Phasers may interfere with their next cards, they may additional space, that wouldn't fit into the crate. Consider removing cards, placing short cards after Phaser(s), or choosing larger crate.",
message: "Phaser cards require additional space immediately after them, but the current crate lacks sufficient room. This may disrupt placement of subsequent cards. Consider removing cards, repositioning shorter cards after Phaser(s), or using a larger crate.",
Outdated
Review

"they may additional space"?

"they may additional space"?
Outdated
Review

And why "may interfere"? It's pretty clear whether they do or not.

And why "*may* interfere"? It's pretty clear whether they do or not.
level: "warning",
trigger: (crate, occupied) => {
const nbrHP = useShopStore.getState().crateParams(crate.crate_mode).hp;
const stacked_phasers = crate.items.filter((elem, index, data) => {
console.log(elem, index)
return (elem.name_codename === "Phaser") && ((index < data.length - 1) ? (
(data[index + 1].consumes && data[index + 1].consumes.depth && data[index + 1].consumes.depth >= 8.5)
) : (occupied >= nbrHP && nbrHP > 0))
}
).length;
// #!debug
console.log(stacked_phasers, occupied)
return stacked_phasers > 0 && (occupied + stacked_phasers*2 >= nbrHP) && nbrHP >0;
}