Skip to content

Commit

Permalink
Game is working now, not fully happy but it is not bad
Browse files Browse the repository at this point in the history
  • Loading branch information
eea88 committed Jul 18, 2024
1 parent 0a738f1 commit 84cfb09
Show file tree
Hide file tree
Showing 3 changed files with 349 additions and 344 deletions.
2 changes: 1 addition & 1 deletion battle.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ function extraBattle(battleArray,bottomContainer){
game.battleArray = game.soldiersTriarii;
bottomContainer = triariiContainerElement;
let soldierNumber= Math.floor(Math.random()*game.battleArray.length);
if(soldierNumber>2){
if(soldierNumber>0){
let woundedSoldier = game.battleArray[soldierNumber];
woundedSoldier.receivesDamage(20);
console.log(woundedSoldier.health);
Expand Down
4 changes: 2 additions & 2 deletions enemy.js
Original file line number Diff line number Diff line change
Expand Up @@ -130,15 +130,15 @@ class Enemy {

if (diceThrowAttacker + 1 < soldier.agility) {
this.stamina -= 10;
soldier.experience += 15;
soldier.experience += 15 *this.level;
soldier.stamina -= 2;
//console.log(`Soldier evaded with ${soldier.agility} vs ${diceThrowAttacker +2} `);
} else {
if (
this.attack * diceThrowAttacker >
soldier.defense * diceThrowDefender
) {
soldier.receivesDamage(this.strength * diceThrowAttacker);
soldier.receivesDamage(this.strength);
this.stamina -= 10;
soldier.stamina -= 10;
console.log("Orc hit you!");
Expand Down
Loading

0 comments on commit 84cfb09

Please sign in to comment.