Skip to content

Commit

Permalink
more fixes & balancing
Browse files Browse the repository at this point in the history
  • Loading branch information
Yrahcaz7 committed Nov 18, 2023
1 parent 87e85c1 commit 8d55c0d
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 20 deletions.
4 changes: 2 additions & 2 deletions js/cards.js
Original file line number Diff line number Diff line change
Expand Up @@ -39,11 +39,11 @@ const attributes = {
},
1001: {
name: "heat wave",
desc: "Deal 8 damage to\nan enemy, and apply\n2 burn to all\nenemies.",
desc: "Deal 7 damage to\nan enemy, and apply\n2 burn to all\nenemies.",
rarity: 2,
cost: 2,
anim: "attack",
damage: 8,
damage: 7,
attack() {
for (let index = 0; index < game.enemies.length; index++) {
if (game.enemies[index].eff.burn) game.enemies[index].eff.burn += 2;
Expand Down
14 changes: 6 additions & 8 deletions js/functions.js
Original file line number Diff line number Diff line change
Expand Up @@ -171,16 +171,14 @@ function discardHand() {

const AURA_BLADE = 200;

function dealDamage(amount, exMod = 1, enemy = game.enemyAtt[1]) {
// extra damage
let exDamage = get.extraDamage();
if (exMod) {
exDamage = Math.floor(exDamage * exMod);
};
let damage = amount + exDamage;
function dealDamage(amount, exMod = 1, enemy = +game.enemyAtt[1], attacking = true) {
// setup
let damage = amount;
// increase damage
if (attacking) damage += get.extraDamage() * exMod;
// multiply damage
let mulDamage = 1;
if (game.eff.weakness) mulDamage = 0.75;
if (game.eff.weakness && attacking) mulDamage = 0.75;
damage = Math.floor(damage * mulDamage);
// damage enemy
if (damage < game.enemies[enemy].shield) {
Expand Down
12 changes: 5 additions & 7 deletions js/game.js
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ function startTurn() {
// end of enemy turn effects
for (let index = 0; index < game.enemies.length; index++) {
if (game.enemies[index].eff.burn) {
dealDamage(game.enemies[index].eff.burn, NaN, index);
dealDamage(game.enemies[index].eff.burn, 0, index, false);
game.enemies[index].eff.burn--;
};
};
Expand Down Expand Up @@ -226,13 +226,11 @@ function playerTurn() {
};

function enemyTurn() {
if (game.enemyNum >= game.enemies.length) {
game.enemyNum = 0;
startTurn();
if (game.enemyNum < game.enemies.length) {
if (game.enemyStage === ENDING) game.enemies[game.enemyNum].finishAction();
else if (game.enemyStage === MIDDLE) game.enemies[game.enemyNum].middleAction();
else if (game.enemyStage !== PENDING) game.enemies[game.enemyNum].startAction();
};
if (game.enemyStage === ENDING) game.enemies[game.enemyNum].finishAction();
else if (game.enemyStage === MIDDLE) game.enemies[game.enemyNum].middleAction();
else if (game.enemyStage !== PENDING) game.enemies[game.enemyNum].startAction();
};

function selection() {
Expand Down
4 changes: 1 addition & 3 deletions js/graphics.js
Original file line number Diff line number Diff line change
Expand Up @@ -621,9 +621,7 @@ function enemyGraphics() {
if (tempAnim[0] >= 7) {
tempAnim = [0, -1, STARTING, -1];
game.enemyStage = ENDING;
} else if (game.enemyStage === MIDDLE) {
game.enemyStage = PENDING;
} else if (tempAnim[0] >= 4) {
} else if (tempAnim[0] == 4) {
game.enemyStage = MIDDLE;
} else {
game.enemyStage = PENDING;
Expand Down

0 comments on commit 8d55c0d

Please sign in to comment.