Skateside / pocket-grimoire

A mobile version of the Blood on the Clocktower grimoire
https://www.pocketgrimoire.co.uk
GNU General Public License v3.0
34 stars 14 forks source link

The cannibal doesn't appear in the night order list #74

Open EhdiB opened 10 months ago

EhdiB commented 10 months ago

I understand that the Cannibal should wake up in place of the recently killed executee, but would it be possible to add it at the top?

Saw that even custom script pdfs don't make it appear in the night order. Is there a reason for this? I feel like it is more likely to make the mistake of forgetting to wake the Cannibal than to wake them up at the wrong moment.

WDYT?

Skateside commented 9 months ago

Sadly, the Cannibal can't be included in the night order list because the character data for the cannibal says that it doesn't do anything overnight. The Cannibal is an awkward character because its night order should change depending on the character that was most recently executed. The Pocket Grimoire doesn't make a distinction between "executed" and "died" - it's just adding a shroud - so I wouldn't be able to detect when the Cannibal's night order would have changed.

With the Pocket Grimoire in its current state, I'm afraid that I can't add the Cannibal into the night order

EhdiB commented 9 months ago

night_order

I still feel like a reminder would be super helpful to not forget to run the cannibal during the night. Something like the Poppygrower at the top of the night order list to remind the ST about effects triggered.

This sentence sums it up nicely: "If someone was executed last night: The Cannibal now has that player's ability (poisoned if evil). Wake the Cannibal when this character would normally wake."

I may be biased as I have forgotten (twice) to run the Cannibal's ability at night, when a one liner at the top of the night order sheet would have saved me from this.

Skateside commented 9 months ago

@EhdiB the problem is that the position in the night order for the Cannibal would move around. I get the night order from the official script tool and the Cannibal just isn't in there. Even if I manually add it in, it'd disappear whenever I get a new list (which happens whenever a new character is added)

Skateside commented 9 months ago

@EhdiB I've asked in the unofficial discord server to see if the Cannibal can be added to the Night Order. If it gets added, it'll show up in the Pocket Grimoire. https://discord.com/channels/569683781800296501/696695228496871436/1182336184932905060

Skateside commented 6 months ago

Reopening because I wonder if it'd be possible to work out which token is closest to the cannibal's reminder and highlight the night order table entry... something to play around with ...

EhdiB commented 6 months ago

Awesome news! Again, this could be something super simple, just having it at the top of the night order with a simple "Wake the Cannibal when this character would normally wake" would already be a nice enhancement! I am sure you understand these better than I do!

Thanks for your work!

netcall-jlo commented 6 months ago

Just thinking aloud for the code to do that:

// Find all tokens and centre point, group by "characer" and "reminder".
var tokens = Object.groupBy(
    $$(".js--token--wrapper").map((token) => [
        token,
        {
            x: token.offsetLeft + (token.clientWidth / 2),
            y: token.offsetTop + (token.clientHeight / 2)
        }
    ]),
    ([button]) => button.dataset.token
);
// Find Cannibal reminder.
var marker = tokens.reminder.find(([button]) => button.dataset.reminder === "cannibal:1");
// Find distance between reminder and all characters, sort by closest.
var distances = tokens.character
    .map(([button, coords]) => [
        button,
        Math.hypot(coords.x - marker[1].x, coords.y - marker[1].y)
    ])
    .sort((a, b) => a[1] - b[1]);
// `distances[0][0]` is the token element with the "Died today" reminder.