Code edit (3 edits merged)
Please save this source code
User prompt
in harvester update, when self.harvestingMode == 3, add spice to the unit player not always to player1
Code edit (1 edits merged)
Please save this source code
Code edit (20 edits merged)
Please save this source code
User prompt
in unitharvester stopOtherActions, user unit player tint instead of 0xFFFFFF
User prompt
implent fog of war
Code edit (1 edits merged)
Please save this source code
Code edit (1 edits merged)
Please save this source code
User prompt
Update the findPath A* algorithm to take into account the range when openSet.length === 0
User prompt
Update the findPath A* algorithm to take into account the range
Code edit (5 edits merged)
Please save this source code
User prompt
add a new 'range' argument to findPath that give the desired range to destination. default is 0
User prompt
add a new 'range' argument to findPath and return the path when distance to destination is <= range
Code edit (2 edits merged)
Please save this source code
User prompt
in guard, only add units and building of other player in allTargets
Code edit (1 edits merged)
Please save this source code
User prompt
in guard function, also search for buildings
Code edit (1 edits merged)
Please save this source code
Code edit (4 edits merged)
Please save this source code
User prompt
in prepareMap, add 2 WindTraps for player 2
Code edit (1 edits merged)
Please save this source code
User prompt
if displayActionItems, also check if unit health > 0 before displaying actions
Code edit (1 edits merged)
Please save this source code
User prompt
in fire(), if target element health <=0 return to attackMode = 0
User prompt
in setOnElement, if element health <=0 hide the selector
===================================================================
--- original.js
+++ change.js
@@ -927,13 +927,14 @@
self.guard = function () {
//console.log("Guard area");
var enemies = [];
var allUnits = player1.units.concat(player2.units);
- allUnits.forEach(function (unit) {
- if (unit.playerId !== self.playerId) {
- var distance = calculateDistance(self, unit);
+ var allTargets = player1.buildings.concat(player2.buildings).concat(player1.units).concat(player2.units);
+ allTargets.forEach(function (target) {
+ if (target.playerId !== self.playerId) {
+ var distance = calculateDistance(self, target);
if (distance <= self.sightRange) {
- enemies.push(unit);
+ enemies.push(target);
}
}
});
if (enemies.length > 0) {
a tileable sand terrain tile.
A square tileable rock terrain tile WITHOUT BBORDER. Single Game Texture. In-Game asset. 2d. No shadows. No Border
Zenith view of Dune's Wind Trap power facility square fence. Ressembles a bit to Sydney's Opera. Zenith view Directly from above.
grey cancel icon. UI
thin white circle empty.
0x5e86ff
Zenith view of a white rectangular Harvester shape of a garbage truck with a triangular head. Harvesting on sand, with flowing spice in the back. inside a square fence. Zenith view. Directly overhead. Plumb view.
Minimal Ui icon of an right sign aside with an icon of a target. sand background
Minimal icon of a home with direction icon pointing to the home. sand background
3 white flat isometric concentric circles like a target.
Remove background
Gray background
Minimal Ui icon of target sign on a fire icon.. sand background
top view of an explosion effect.
Simple heavy army tank factory buiding a tank with a crane. Square fence... Zenith view Directly overhead. Plumb view.
an empty black popup UI. UI