Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions classes/enemies/enemy_factory.js
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand All @@ -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);
Expand Down
30 changes: 26 additions & 4 deletions classes/room_generators/room_generator_combat.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);