chore: update combat engine formatting and battle scene animations
- Normalize whitespace and alignment in `src/combat/CombatEngine.js` (variable assignments and filter calls). - Extend projectile tween duration in `src/scenes/BattleScene.js` from 350ms to 2000ms for smoother visual effect. - Adjust sprite pulse animation scale range from 0.8–1.5 to 0.5–1.0 for a more subtle effect. - Update binary assets: new `smite2.mp3`, modified `fortify.mp3` and `smite-cast.mp3`, updated `attacks.png` and `attacks.psd`, removed duplicate `attacks (1).png`.
This commit is contained in:
parent
1c99dc233d
commit
b2981cd389
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
|
Before Width: | Height: | Size: 6.2 MiB |
Binary file not shown.
|
Before Width: | Height: | Size: 7.9 MiB After Width: | Height: | Size: 7.9 MiB |
Binary file not shown.
|
|
@ -273,7 +273,7 @@ export class CombatEngine {
|
||||||
// Pre-attack passive/on_attack skills (flurry, valor — pierce now fires in preAttack phase)
|
// Pre-attack passive/on_attack skills (flurry, valor — pierce now fires in preAttack phase)
|
||||||
for (const s of attacker.skills) {
|
for (const s of attacker.skills) {
|
||||||
if (['flurry', 'valor'].includes(s.name) &&
|
if (['flurry', 'valor'].includes(s.name) &&
|
||||||
['on_attack', 'passive'].includes(s.trigger)) {
|
['on_attack', 'passive'].includes(s.trigger)) {
|
||||||
const passiveCtx = { ...context };
|
const passiveCtx = { ...context };
|
||||||
this.skillProcessor.process(s, attacker, target,
|
this.skillProcessor.process(s, attacker, target,
|
||||||
alliedLanes.filter(c => c.currentHP > 0),
|
alliedLanes.filter(c => c.currentHP > 0),
|
||||||
|
|
@ -421,7 +421,7 @@ export class CombatEngine {
|
||||||
}
|
}
|
||||||
// Check if both sides are out of cards
|
// Check if both sides are out of cards
|
||||||
if (this.playerDeckIdx >= this.playerDeck.length &&
|
if (this.playerDeckIdx >= this.playerDeck.length &&
|
||||||
this.playerHand.length === 0 && this.playerLanes.length === 0) {
|
this.playerHand.length === 0 && this.playerLanes.length === 0) {
|
||||||
this.winner = 'opponent';
|
this.winner = 'opponent';
|
||||||
this._log('Player ran out of cards — Opponent wins!');
|
this._log('Player ran out of cards — Opponent wins!');
|
||||||
return true;
|
return true;
|
||||||
|
|
@ -536,7 +536,7 @@ export class CombatEngine {
|
||||||
const sanctifyFires = [];
|
const sanctifyFires = [];
|
||||||
const overchargeFires = [];
|
const overchargeFires = [];
|
||||||
const fortifyFires = [];
|
const fortifyFires = [];
|
||||||
const liveAllies = allies.filter(c => c.currentHP > 0);
|
const liveAllies = allies.filter(c => c.currentHP > 0);
|
||||||
const liveEnemies = enemies.filter(c => c.currentHP > 0);
|
const liveEnemies = enemies.filter(c => c.currentHP > 0);
|
||||||
for (const card of cards) {
|
for (const card of cards) {
|
||||||
if (card.currentHP <= 0) continue;
|
if (card.currentHP <= 0) continue;
|
||||||
|
|
@ -672,12 +672,12 @@ export class CombatEngine {
|
||||||
this._smitePhase();
|
this._smitePhase();
|
||||||
this._moltPhase();
|
this._moltPhase();
|
||||||
|
|
||||||
const firstSide = this.playerGoesFirst ? 'player' : 'opponent';
|
const firstSide = this.playerGoesFirst ? 'player' : 'opponent';
|
||||||
const otherSide = this.playerGoesFirst ? 'opponent' : 'player';
|
const otherSide = this.playerGoesFirst ? 'opponent' : 'player';
|
||||||
const firstCmd = this.playerGoesFirst ? this.playerCommander : this.opponentCommander;
|
const firstCmd = this.playerGoesFirst ? this.playerCommander : this.opponentCommander;
|
||||||
const otherCmd = this.playerGoesFirst ? this.opponentCommander : this.playerCommander;
|
const otherCmd = this.playerGoesFirst ? this.opponentCommander : this.playerCommander;
|
||||||
const firstLanes = this.playerGoesFirst ? [...this.playerLanes] : [...this.opponentLanes];
|
const firstLanes = this.playerGoesFirst ? [...this.playerLanes] : [...this.opponentLanes];
|
||||||
const otherLanes = this.playerGoesFirst ? [...this.opponentLanes] : [...this.playerLanes];
|
const otherLanes = this.playerGoesFirst ? [...this.opponentLanes] : [...this.playerLanes];
|
||||||
const firstAllies = [firstCmd, ...firstLanes];
|
const firstAllies = [firstCmd, ...firstLanes];
|
||||||
const otherAllies = [otherCmd, ...otherLanes];
|
const otherAllies = [otherCmd, ...otherLanes];
|
||||||
|
|
||||||
|
|
@ -741,7 +741,7 @@ export class CombatEngine {
|
||||||
// Process skills with trigger === 'preAttack' (e.g. mortar) before damage resolves.
|
// Process skills with trigger === 'preAttack' (e.g. mortar) before damage resolves.
|
||||||
const preAttackFires = [];
|
const preAttackFires = [];
|
||||||
const liveEnemies = pending.enemyLanes.filter(c => c.currentHP > 0);
|
const liveEnemies = pending.enemyLanes.filter(c => c.currentHP > 0);
|
||||||
const liveAllies = pending.alliedLanes.filter(c => c.currentHP > 0);
|
const liveAllies = pending.alliedLanes.filter(c => c.currentHP > 0);
|
||||||
for (const s of pending.attacker.skills) {
|
for (const s of pending.attacker.skills) {
|
||||||
if (s.trigger !== 'preAttack') continue;
|
if (s.trigger !== 'preAttack') continue;
|
||||||
const ctx = { rng: this.rng, enemyCommander: pending.enemyCommander, enemyLaneCards: pending.enemyLanes };
|
const ctx = { rng: this.rng, enemyCommander: pending.enemyCommander, enemyLaneCards: pending.enemyLanes };
|
||||||
|
|
@ -970,7 +970,7 @@ export class CombatEngine {
|
||||||
defender: (pending.target?.currentHP > 0) ? pending.target : null,
|
defender: (pending.target?.currentHP > 0) ? pending.target : null,
|
||||||
side: pending.side,
|
side: pending.side,
|
||||||
alliedLanes: pending.alliedLanes.filter(c => c.currentHP > 0),
|
alliedLanes: pending.alliedLanes.filter(c => c.currentHP > 0),
|
||||||
enemyLanes: pending.enemyLanes.filter(c => c.currentHP > 0),
|
enemyLanes: pending.enemyLanes.filter(c => c.currentHP > 0),
|
||||||
enemyCommander: pending.enemyCommander,
|
enemyCommander: pending.enemyCommander,
|
||||||
pierceRestores: []
|
pierceRestores: []
|
||||||
});
|
});
|
||||||
|
|
@ -1013,7 +1013,7 @@ export class CombatEngine {
|
||||||
defender: (pending.target?.currentHP > 0) ? pending.target : null,
|
defender: (pending.target?.currentHP > 0) ? pending.target : null,
|
||||||
side: pending.side,
|
side: pending.side,
|
||||||
alliedLanes: pending.alliedLanes.filter(c => c.currentHP > 0),
|
alliedLanes: pending.alliedLanes.filter(c => c.currentHP > 0),
|
||||||
enemyLanes: pending.enemyLanes.filter(c => c.currentHP > 0),
|
enemyLanes: pending.enemyLanes.filter(c => c.currentHP > 0),
|
||||||
enemyCommander: pending.enemyCommander,
|
enemyCommander: pending.enemyCommander,
|
||||||
pierceRestores,
|
pierceRestores,
|
||||||
swarmRevert
|
swarmRevert
|
||||||
|
|
@ -1044,7 +1044,7 @@ export class CombatEngine {
|
||||||
if (!card._tempBuffs?.length) continue;
|
if (!card._tempBuffs?.length) continue;
|
||||||
for (const buff of card._tempBuffs) {
|
for (const buff of card._tempBuffs) {
|
||||||
if (buff.stat === 'currentAttack') card.currentAttack = Math.max(0, card.currentAttack - buff.amount);
|
if (buff.stat === 'currentAttack') card.currentAttack = Math.max(0, card.currentAttack - buff.amount);
|
||||||
if (buff.stat === 'currentArmor') card.currentArmor = Math.max(0, card.currentArmor - buff.amount);
|
if (buff.stat === 'currentArmor') card.currentArmor = Math.max(0, card.currentArmor - buff.amount);
|
||||||
if (buff.stat === 'skillValues') {
|
if (buff.stat === 'skillValues') {
|
||||||
for (const { index, amount } of buff.amounts) {
|
for (const { index, amount } of buff.amounts) {
|
||||||
if (card.skills[index]) card.skills[index].value = (card.skills[index].value || 0) + amount;
|
if (card.skills[index]) card.skills[index].value = (card.skills[index].value || 0) + amount;
|
||||||
|
|
@ -1061,11 +1061,11 @@ export class CombatEngine {
|
||||||
// playerGoesFirst was already flipped in beginCommit, so !playerGoesFirst = who went first this turn.
|
// playerGoesFirst was already flipped in beginCommit, so !playerGoesFirst = who went first this turn.
|
||||||
_postBattlePhase() {
|
_postBattlePhase() {
|
||||||
const firstWasPlayer = !this.playerGoesFirst;
|
const firstWasPlayer = !this.playerGoesFirst;
|
||||||
const firstSide = firstWasPlayer ? 'player' : 'opponent';
|
const firstSide = firstWasPlayer ? 'player' : 'opponent';
|
||||||
const otherSide = firstWasPlayer ? 'opponent' : 'player';
|
const otherSide = firstWasPlayer ? 'opponent' : 'player';
|
||||||
const firstCmd = firstWasPlayer ? this.playerCommander : this.opponentCommander;
|
const firstCmd = firstWasPlayer ? this.playerCommander : this.opponentCommander;
|
||||||
const otherCmd = firstWasPlayer ? this.opponentCommander : this.playerCommander;
|
const otherCmd = firstWasPlayer ? this.opponentCommander : this.playerCommander;
|
||||||
const firstLanes = firstWasPlayer ? [...this.playerLanes] : [...this.opponentLanes];
|
const firstLanes = firstWasPlayer ? [...this.playerLanes] : [...this.opponentLanes];
|
||||||
const otherLanes = firstWasPlayer ? [...this.opponentLanes] : [...this.playerLanes];
|
const otherLanes = firstWasPlayer ? [...this.opponentLanes] : [...this.playerLanes];
|
||||||
|
|
||||||
// Steps 1–2: commander defensive debuffs (placeholder)
|
// Steps 1–2: commander defensive debuffs (placeholder)
|
||||||
|
|
|
||||||
|
|
@ -3932,7 +3932,7 @@ export class BattleScene extends Phaser.Scene {
|
||||||
this.tweens.add({
|
this.tweens.add({
|
||||||
targets: projectile,
|
targets: projectile,
|
||||||
x: targetObj.x, y: targetObj.y,
|
x: targetObj.x, y: targetObj.y,
|
||||||
duration: 350,
|
duration: 2000,
|
||||||
ease: 'Quad.In',
|
ease: 'Quad.In',
|
||||||
onComplete: () => {
|
onComplete: () => {
|
||||||
if (projectile.scene) projectile.destroy();
|
if (projectile.scene) projectile.destroy();
|
||||||
|
|
@ -4302,8 +4302,8 @@ export class BattleScene extends Phaser.Scene {
|
||||||
// Pulse: grow and shrink twice (yoyo × 2)
|
// Pulse: grow and shrink twice (yoyo × 2)
|
||||||
this.tweens.add({
|
this.tweens.add({
|
||||||
targets: sprite,
|
targets: sprite,
|
||||||
scaleX: { from: 0.8, to: 1.5 },
|
scaleX: { from: 0.5, to: 1 },
|
||||||
scaleY: { from: 0.8, to: 1.5 },
|
scaleY: { from: 0.5, to: 1 },
|
||||||
duration: 220,
|
duration: 220,
|
||||||
yoyo: true,
|
yoyo: true,
|
||||||
repeat: 1,
|
repeat: 1,
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue