Resource fixes!
[browser-rts.git] / src / tasks / fight.ts
index 7be73a6031d50f9562f7230a363b2b542b3f5e8f..484c07c2e435ebdbc1512974c7e3e8d016d2066b 100644 (file)
@@ -54,16 +54,16 @@ export const fight = new Task<ArmyQueue>('fights', async (task, job) => {
             defenders: Math.floor(attacked.defenders * 0.05),
             sp_attackers: Math.floor(attacked.sp_attackers * 0.05),
             sp_defenders: Math.floor(attacked.sp_defenders * 0.05),
-            gold: Math.floor(attacked.gold * 0.2),
-            logs: Math.floor(attacked.logs * 0.2),
-            ore: Math.floor(attacked.ore * 0.2),
+            credits: Math.floor(attacked.credits * 0.2),
+            energy: Math.floor(attacked.energy * 0.2),
+            alloys: Math.floor(attacked.alloys * 0.2),
             land: Math.floor(attacked.totalSpace * 0.15),
         };
 
         // ok you have everything, lets return you home
-        attacker.gold += defenderLosses.gold;
-        attacker.logs += defenderLosses.gold;
-        attacker.ore += defenderLosses.ore;
+        attacker.credits += defenderLosses.credits;
+        attacker.energy += defenderLosses.credits;
+        attacker.alloys += defenderLosses.alloys;
         attacker.totalSpace += defenderLosses.land;
 
         attacker.soldiers += (army.soldiers - attackerLosses.soldiers);
@@ -77,9 +77,9 @@ export const fight = new Task<ArmyQueue>('fights', async (task, job) => {
         attacked.defenders -= defenderLosses.defenders;
         attacked.sp_attackers -= defenderLosses.sp_attackers;
         attacked.sp_defenders -= defenderLosses.sp_defenders;
-        attacked.gold -= defenderLosses.gold;
-        attacked.logs -= defenderLosses.logs;
-        attacked.ore -= defenderLosses.ore;
+        attacked.credits -= defenderLosses.credits;
+        attacked.energy -= defenderLosses.energy;
+        attacked.alloys -= defenderLosses.alloys;
         attacked.totalSpace -= defenderLosses.land;
 
         await Promise.all([
@@ -95,16 +95,16 @@ export const fight = new Task<ArmyQueue>('fights', async (task, job) => {
                 You pillaged:
                 <table>
                 <tr>
-                    <th>Gold</th><td>${defenderLosses.gold}</td>
+                    <th>Credits</th><td>${defenderLosses.credits}</td>
                 </tr>
                 <tr>
-                    <th>Logs</th><td>${defenderLosses.logs}</td>
+                    <th>Energy</th><td>${defenderLosses.energy}</td>
                 </tr>
                 <tr>
-                    <th>Ore</th><td>${defenderLosses.ore}</td>
+                    <th>Alloys</th><td>${defenderLosses.alloys}</td>
                 </tr>
                 <tr>
-                    <th>Land</th><td>${defenderLosses.land}</td>
+                    <th>Space</th><td>${defenderLosses.land}</td>
                 </tr>
                 </table?>
 
@@ -138,16 +138,16 @@ export const fight = new Task<ArmyQueue>('fights', async (task, job) => {
                 You Lost:
                 <table>
                 <tr>
-                    <th>Gold</th><td>${defenderLosses.gold}</td>
+                    <th>Credits</th><td>${defenderLosses.credits}</td>
                 </tr>
                 <tr>
-                    <th>Logs</th><td>${defenderLosses.logs}</td>
+                    <th>Energy</th><td>${defenderLosses.energy}</td>
                 </tr>
                 <tr>
-                    <th>Ore</th><td>${defenderLosses.ore}</td>
+                    <th>Alloys</th><td>${defenderLosses.alloys}</td>
                 </tr>
                 <tr>
-                    <th>Land</th><td>${defenderLosses.land}</td>
+                    <th>Space</th><td>${defenderLosses.land}</td>
                 </tr>
                 <tr>
                     <th>Soldiers</th><td>${attackerLosses.soldiers}</td>
@@ -259,4 +259,4 @@ export const fight = new Task<ArmyQueue>('fights', async (task, job) => {
         ]);
     }
 
-});
\ No newline at end of file
+});