Code edit (1 edits merged)
Please save this source code
User prompt
Please fix the bug: 'ReferenceError: ENEMY_BOSS_HEALTH is not defined' in or related to this line: 'self.health = ENEMY_BOSS_HEALTH;' Line Number: 921
Code edit (3 edits merged)
Please save this source code
User prompt
add ENEMY_BOSS_PROJECTILE_COUNT projectileBoss instances to the boss, uniformly rotated
Code edit (1 edits merged)
Please save this source code
User prompt
add a projectileBoss asset to the ProjectileBoss class
User prompt
Add a new, empty ProjectileBoss class that inherits from the ConfigContainer class
Code edit (1 edits merged)
Please save this source code
User prompt
Add a new EnemyBoss class
Code edit (6 edits merged)
Please save this source code
User prompt
add an enabled variable and a setEnabled function to the enemy spawner class. Prevent spawning enemies if not enabled
User prompt
Please fix the bug: 'ReferenceError: graphics is not defined' in or related to this line: 'self.parent.addChild(new ProjectileEnemy({' Line Number: 888
Code edit (1 edits merged)
Please save this source code
Code edit (3 edits merged)
Please save this source code
User prompt
change the slightly brown tint to #FFEADB instead
User prompt
change the slightly brown tint to #FFD9BD instead
User prompt
change the slightly brown tint to #f5cfb3 instead
User prompt
change the slightly brown tint to C7AD99
Code edit (1 edits merged)
Please save this source code
User prompt
tint the uiBoonBackground and uiBoonUpgrade assets of the UiBoonSelection class slightly brown
Code edit (2 edits merged)
Please save this source code
User prompt
Rename the uiBoonButton asset to uiBoonSelection and update all usages in the code
Code edit (5 edits merged)
Please save this source code
User prompt
Please fix the bug: 'ReferenceError: ENEMY_RANGED_ATTACK_COOLDOWN is not defined' in or related to this line: 'self.attackCooldown = ENEMY_RANGED_ATTACK_COOLDOWN;' Line Number: 855
Code edit (2 edits merged)
Please save this source code
===================================================================
--- original.js
+++ change.js
@@ -164,22 +164,23 @@
return self;
});
var UiBoonSelection = ConfigContainer.expand(function (config) {
var self = ConfigContainer.call(this, config);
+ var selectedBoons;
var availableBoons = Object.keys(config.boons).filter(function (boon) {
- return config.boons[boon] < 3;
+ return config.boons[boon] < BOON_MAX_LEVEL;
});
- var selectedBoons = [];
- if (availableBoons.length <= 3) {
+ if (availableBoons.length <= BOON_OPTIONS) {
selectedBoons = availableBoons;
} else {
- while (selectedBoons.length < 3 && availableBoons.length > 0) {
+ selectedBoons = [];
+ while (selectedBoons.length < BOON_OPTIONS && availableBoons.length > 0) {
var boonIndex = Math.floor(Math.random() * availableBoons.length);
selectedBoons.push(availableBoons.splice(boonIndex, 1)[0]);
}
}
- if (selectedBoons.length < 3) {
- selectedBoons.push(config.type === 'Minor' ? 'Minor Heal' : 'Full Heal');
+ if (selectedBoons.length < BOON_OPTIONS) {
+ selectedBoons.push(config.type === 'Minor' ? BOON_MINOR_HEAL : BOON_FULL_HEAL);
}
self.attachAsset('uiBoonBackground', {
y: 50,
anchorX: 0.5,
@@ -223,9 +224,8 @@
anchorX: 0,
anchorY: .5
}));
}
- return self;
});
var ProgressBar = ConfigContainer.expand(function (config) {
var self = ConfigContainer.call(this, config);
var width = config.width || 120;
@@ -1085,8 +1085,10 @@
var HERO_XP_REQUIRED = 20;
var HERO_XP_SCALING = 1.2;
;
// Boon settings
+var BOON_OPTIONS = 3;
+var BOON_MAX_LEVEL = 3;
var BOON_MAJOR_LEVEL = 5;
var BOON_LUCK = 'Luck';
var BOON_SCALE = 'Scale';
var BOON_RANGE = 'Range';
@@ -1096,8 +1098,10 @@
var BOON_HEALTH = 'Health';
var BOON_SPEED = 'Speed';
var BOON_GROWTH = 'Growth';
var BOON_SPLIT = 'Split';
+var BOON_FULL_HEAL = 'Full Heal';
+var BOON_MINOR_HEAL = 'Minor Heal';
;
// Weapon settings
var WEAPON_HEIGHT_BASE = 50;
var WEAPON_HEIGHT_PERIOD = 10;
@@ -1171,8 +1175,9 @@
var ENEMY_RANGED_SPAWN_CHANCE_MIN = 0.4;
var ENEMY_RANGED_SPAWN_CHANCE_FACTOR = 0.5;
var ENEMY_RANGED_PROJECTILE_SPEED = 10;
var ENEMY_RANGED_PROJECTILE_RADIUS = 100;
+var ENEMY_RANGED_ATTACK_COOLDOWN = GAME_TICKS * 2;
;
// Pickup settings
var PICKUP_HEAL_MINOR = 0.1;
var PICKUP_HEAL_MAJOR = 1.0;
@@ -1266,9 +1271,9 @@
y: GAME_HEIGHT - 750,
size: 200,
callback: function callback() {
if (minorBoonCount + majorBoonCount > 0) {
- // showBoonSelection();
+ showBoonSelection();
}
}
}));
var countdownTimer = interfaceContainer.addChild(new UiCountdownTimer({
@@ -1294,5 +1299,57 @@
//==============================================================================
;
function checkBounds(x, y, border) {
return !(x < border || x > GAME_WIDTH - border || y < border || y > GAME_HEIGHT - border);
+}
+function showBoonSelection() {
+ var boonSelection;
+ if (minorBoonCount) {
+ boonSelection = LK.gui.center.addChild(new UiBoonSelection({
+ boons: minorBoonLevels,
+ type: 'Minor',
+ count: minorBoonCount,
+ callback: function callback(boon) {
+ minorBoonCount--;
+ if (checkBoonActions(boon)) {
+ minorBoonLevels[boon]++;
+ upgradeButton.setCount(minorBoonCount + majorBoonCount);
+ }
+ showBoonSelection();
+ }
+ }));
+ } else if (majorBoonCount) {
+ boonSelection = LK.gui.center.addChild(new UiBoonSelection({
+ boons: majorBoonLevels,
+ type: 'Major',
+ count: majorBoonCount,
+ callback: function callback(boon) {
+ majorBoonCount--;
+ if (!checkBoonActions(boon)) {
+ majorBoonLevels[boon]++;
+ upgradeButton.setCount(minorBoonCount + majorBoonCount);
+ }
+ showBoonSelection();
+ }
+ }));
+ }
+ isPaused = !!boonSelection;
+ upgradeButton.setHidden(isPaused);
+}
+function checkBoonActions(boon) {
+ switch (boon) {
+ case BOON_HEALTH:
+ hero.healthMax += HERO_HEALTH_BONUS;
+ hero.healPercentage(0); // Update the health bar
+ return true;
+ case BOON_SPEED:
+ hero.speed += HERO_SPEED_BONUS;
+ return true;
+ case BOON_MINOR_HEAL:
+ hero.healPercentage(PICKUP_HEAL_MINOR);
+ return false;
+ case BOON_FULL_HEAL:
+ hero.healPercentage(PICKUP_HEAL_MAJOR);
+ return false;
+ }
+ return true;
}
\ No newline at end of file
pixel art cross with blue accents Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.
pixel art of a white orb. Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.
pixel art of a white orb with a halo. Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.
pixel art of a pulsating white heart with a halo. Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.
pixel art of a dark goo projectile with red highlights. Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.
pixel art tall blue fireball. Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.
pixel art of an evil fantasy sword facing downward. Minor red details. Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.
backgroundAmbient
Sound effect
heroHealed
Sound effect
pickupExperience
Sound effect
heroLeveled
Sound effect
weaponCrossImpact
Sound effect
heroImpact
Sound effect
enemyDeath
Sound effect
pickupWeapon
Sound effect
pickupCrucifix
Sound effect
weaponCrossLaunch
Sound effect
heroDeath
Sound effect
enemyRoar
Sound effect
clockChime
Sound effect