diff --git a/classes/enemies/enemy_factory.js b/classes/enemies/enemy_factory.js index 9e99d88..9dee7ba 100644 --- a/classes/enemies/enemy_factory.js +++ b/classes/enemies/enemy_factory.js @@ -27,7 +27,7 @@ EnemyFactory.create = function(name, superclass_name, definition) { DifficultyManager.onChange(function(newDifficulty) { // If this enemy gets to attack often, let's raise their attack var average_attacks = Math.max(AttacksMade.value(), 1); - var attack = Math.round(initial_attack * average_attacks * (newDifficulty * 5 + 0.5)); + var attack = Math.round(initial_attack * average_attacks * (newDifficulty * 2 + 0.8)); console.log(initial_attack, average_attacks, attack); if (attack !== EnemyClass.prototype.initial_attack) { @@ -41,7 +41,7 @@ EnemyFactory.create = function(name, superclass_name, definition) { // Thought: if you avoid every enemy, give it 1/3 the health // if you attack them all, give them 5/3 the health var avoidanceRatio = Engaged.valueOf(false); - var health = Math.ceil(initial_health * (1.33 * avoidanceRatio + 0.33) * (newDifficulty * 5 + 0.5)); + var health = Math.ceil(initial_health * (1.33 * avoidanceRatio + 0.33) * (newDifficulty * 2 + 0.8)); if (health !== EnemyClass.prototype.initial_health) { var change = (health > EnemyClass.prototype.initial_health ? 'tougher' : 'less tough'); Scenes.Transition.logChange(name + ' is getting ' + change); diff --git a/classes/room_generators/room_generator_combat.js b/classes/room_generators/room_generator_combat.js index 9720eea..48baf33 100644 --- a/classes/room_generators/room_generator_combat.js +++ b/classes/room_generators/room_generator_combat.js @@ -16,12 +16,34 @@ return background; }, + addSlime: function(room, engagement, x, y) { + var fightSlimes = Classes.Slime.prototype.Engaged.valueOf(false) + DifficultyManager.getDifficulty(); + if (fightSlimes >= engagement) { + this.addCharacter(room, new Classes.Slime(), x, y); + } + }, + + addBat: function(room, engagement, x, y) { + var fightBats = Classes.Bat.prototype.Engaged.valueOf(false) + DifficultyManager.getDifficulty(); + if (fightBats >= engagement) { + this.addCharacter(room, new Classes.Bat(), x, y); + } + }, + populateRoom: function(room) { // Add enemies and items to room - this.addCharacter(room, new Classes.Slime(), 2, 3); - this.addCharacter(room, new Classes.Slime(), 3, 3); - this.addCharacter(room, new Classes.Slime(), 4, 3); - this.addCharacter(room, new Classes.Bat(), 1, 2); + this.addBat(room, 0, 1, 2); + this.addBat(room, 0.4, 1, 1); + this.addBat(room, 0.8, 0, 0); + this.addBat(room, 1.2, -1, -1); + + this.addSlime(room, 0, 2, 3); + this.addSlime(room, 0.5, 3, 3); + this.addSlime(room, 0.7, -2, -2); + this.addSlime(room, 0.9, -2, 0); + this.addSlime(room, 1.1, -3, -3); + this.addSlime(room, 1.3, 2, -3); + this.addSlime(room, 1.5, -2, 2); } }); })(window);