AncientBeast icon indicating copy to clipboard operation
AncientBeast copied to clipboard

unit status for current round only [bounty: 12 XTR]

Open DreadKnight opened this issue 9 years ago • 7 comments

In the unit queue at the top, the creatures that are duplicated (meaning have not yet acted in current round and also show up for the next round), shouldn't have the fatigue meter affected in the next round as well (like remaining endurance and fatigue), because that stuff gets reset, except when maximum endurance is lowered or the unit becomes Fragile.

DreadKnight avatar Aug 02 '16 17:08 DreadKnight

@DreadKnight could you explain this a little better? maybe with some visuals?

shouldn't have the fatigue meter affected in the next round as well (like remaining endurance and fatigue), because that stuff gets reset, except when maximum endurance is lowered or the unit becomes Fragile.

tristanmkernan avatar Jun 24 '18 14:06 tristanmkernan

@russon77 In the unit queue, the box under the inactive units shows their status (usually endurance), but that stuff usually gets reset each round. Sometimes you can see a certain unit there in current and next round, but most statuses get reset each round, meaning the box that's after the round indicator showcase that better. This might be a little trickier, hmm

DreadKnight avatar Jun 24 '18 14:06 DreadKnight

@DreadKnight for example, the summoning sickness / "sickness" status that only lasts one turn?

tristanmkernan avatar Jun 24 '18 14:06 tristanmkernan

@russon77 yeah, perfect example! :100: No need to show that one as status for the next round as well.

DreadKnight avatar Jun 24 '18 14:06 DreadKnight

@DreadKnight what if units in any round that's not the current do not display the status box? or display a message like 'queued' until it's the next round.

I found the code that updates the status. i have a feeling that each status is unique, meaning that the code to keep the status up to date between rounds would quickly become unwieldy / very tough to change.

	updateFatigue() {
		let game = this.game;

		game.creatures.forEach(creature => {
			if (creature instanceof Creature) {
				let textElement = $j('#queuewrapper .vignette[creatureid="' + creature.id + '"]').children(
					'.stats'
				);

				textElement.css({
					background: 'black'
				});

				let text;
				if (creature.stats.frozen) {
					text = 'Frozen';
					textElement.css({
						background: 'darkturquoise'
					});
				} else if (creature.materializationSickness) {
					text = 'Sickened';
				} else if (creature.protectedFromFatigue || creature.stats.fatigueImmunity) {
					text = 'Protected';
				} else if (creature.endurance > 0) {
					text = creature.endurance + '/' + creature.stats.endurance;
				} else if (creature.stats.endurance === 0) {
					text = 'Fragile';
					// Display message if the creature has first become fragile
					if (creature.fatigueText !== text) {
						game.log('%CreatureName' + creature.id + '% has become fragile');
					}
				} else {
					text = 'Fatigued';
				}

				if (creature.type == '--') {
					// If Dark Priest
					creature.abilities[0].require(); // Update protectedFromFatigue
				}

				textElement.text(text);
				this.fatigueText = text;
			}
		});
	}

tristanmkernan avatar Jun 25 '18 22:06 tristanmkernan

@russon77 I was afraid of not making this into a beast hard to deal with as well. Those display statuses are pretty good idea, the Queued one might do nicely I think, but we should display that for avatars after the next round marker only for units that haven't acted in the current round yet, I think it makes most sense.

DreadKnight avatar Jun 26 '18 01:06 DreadKnight

display that for avatars after the next round marker only for units that haven't acted in the current round yet

that makes a lot of sense and would be a lot easier to implement. basically count the times the unit has been seen, and if it's more than once, then change stat display to Queued

tristanmkernan avatar Jun 26 '18 02:06 tristanmkernan