Changeset 25020
- Timestamp:
- Mar 6, 2021, 7:12:07 AM (3 years ago)
- Location:
- ps/trunk/binaries/data
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
ps/trunk/binaries/data/config/default.cfg
r24986 r25020 320 320 repair = "J" ; Modifier to repair when clicking on building/mechanical unit 321 321 queue = Shift ; Modifier to queue unit orders instead of replacing 322 322 323 orderone = Alt ; Modifier to order only one entity in selection. 323 324 batchtrain = Shift ; Modifier to train units in batches -
ps/trunk/binaries/data/mods/public/gui/session/input.js
r24752 r25020 1233 1233 popOneFromSelection(action) || g_Selection.toList(); 1234 1234 // If the session.queue hotkey is down, add the order to the unit's order queue instead 1235 // of running it immediately. 1236 return g_UnitActions[action.type].execute(target, action, selection, Engine.HotkeyIsPressed("session.queue")); 1235 // of running it immediately. If the pushorderfront hotkey is down, execute the order 1236 // immidiately and continue the rest of the queue afterwards. 1237 return g_UnitActions[action.type].execute( 1238 target, 1239 action, 1240 selection, 1241 Engine.HotkeyIsPressed("session.queue"), 1242 Engine.HotkeyIsPressed("session.pushorderfront")); 1237 1243 } 1238 1244 -
ps/trunk/binaries/data/mods/public/gui/session/unit_actions.js
r24999 r25020 46 46 "move": 47 47 { 48 "execute": function(target, action, selection, queued )48 "execute": function(target, action, selection, queued) 49 49 { 50 50 Engine.PostNetworkCommand({ … … 54 54 "z": target.z, 55 55 "queued": queued, 56 56 57 "formation": g_AutoFormation.getDefault() 57 58 }); … … 90 91 "attack-move": 91 92 { 92 "execute": function(target, action, selection, queued )93 "execute": function(target, action, selection, queued) 93 94 { 94 95 let targetClasses; … … 105 106 "targetClasses": targetClasses, 106 107 "queued": queued, 108 107 109 "formation": g_AutoFormation.getNull() 108 110 }); … … 142 144 "capture": 143 145 { 144 "execute": function(target, action, selection, queued )146 "execute": function(target, action, selection, queued) 145 147 { 146 148 Engine.PostNetworkCommand({ … … 150 152 "allowCapture": true, 151 153 "queued": queued, 154 152 155 "formation": g_AutoFormation.getNull() 153 156 }); … … 188 191 "attack": 189 192 { 190 "execute": function(target, action, selection, queued )193 "execute": function(target, action, selection, queued) 191 194 { 192 195 Engine.PostNetworkCommand({ … … 195 198 "target": action.target, 196 199 "queued": queued, 200 197 201 "allowCapture": false, 198 202 "formation": g_AutoFormation.getNull() … … 239 243 "patrol": 240 244 { 241 "execute": function(target, action, selection, queued )245 "execute": function(target, action, selection, queued) 242 246 { 243 247 Engine.PostNetworkCommand({ … … 293 297 "heal": 294 298 { 295 "execute": function(target, action, selection, queued )299 "execute": function(target, action, selection, queued) 296 300 { 297 301 Engine.PostNetworkCommand({ … … 300 304 "target": action.target, 301 305 "queued": queued, 306 302 307 "formation": g_AutoFormation.getNull() 303 308 }); … … 358 363 "repair": 359 364 { 360 "execute": function(target, action, selection, queued )365 "execute": function(target, action, selection, queued) 361 366 { 362 367 Engine.PostNetworkCommand({ … … 366 371 "autocontinue": true, 367 372 "queued": queued, 373 368 374 "formation": g_AutoFormation.getNull() 369 375 }); … … 417 423 "gather": 418 424 { 419 "execute": function(target, action, selection, queued )425 "execute": function(target, action, selection, queued) 420 426 { 421 427 Engine.PostNetworkCommand({ … … 424 430 "target": action.target, 425 431 "queued": queued, 432 426 433 "formation": g_AutoFormation.getNull() 427 434 }); … … 468 475 "returnresource": 469 476 { 470 "execute": function(target, action, selection, queued )477 "execute": function(target, action, selection, queued) 471 478 { 472 479 Engine.PostNetworkCommand({ … … 475 482 "target": action.target, 476 483 "queued": queued, 484 477 485 "formation": g_AutoFormation.getNull() 478 486 }); … … 526 534 "cancel-setup-trade-route": 527 535 { 528 "execute": function(target, action, selection, queued )536 "execute": function(target, action, selection, queued) 529 537 { 530 538 Engine.PostNetworkCommand({ … … 679 687 "garrison": 680 688 { 681 "execute": function(target, action, selection, queued )689 "execute": function(target, action, selection, queued) 682 690 { 683 691 Engine.PostNetworkCommand({ … … 686 694 "target": action.target, 687 695 "queued": queued, 696 688 697 "formation": g_AutoFormation.getNull() 689 698 }); … … 752 761 "guard": 753 762 { 754 "execute": function(target, action, selection, queued )763 "execute": function(target, action, selection, queued) 755 764 { 756 765 Engine.PostNetworkCommand({ … … 759 768 "target": action.target, 760 769 "queued": queued, 770 761 771 "formation": g_AutoFormation.getNull() 762 772 }); … … 850 860 "remove-guard": 851 861 { 852 "execute": function(target, action, selection, queued )862 "execute": function(target, action, selection, queued) 853 863 { 854 864 Engine.PostNetworkCommand({ … … 856 866 "entities": selection, 857 867 "target": action.target, 858 "queued": queued 868 "queued": queued, 869 "pushFront": pushFront 859 870 }); 860 871 … … 891 902 "set-rallypoint": 892 903 { 893 "execute": function(target, action, selection, queued )904 "execute": function(target, action, selection, queued) 894 905 { 895 906 // if there is a position set in the action then use this so that when setting a … … 1099 1110 "unset-rallypoint": 1100 1111 { 1101 "execute": function(target, action, selection, queued )1112 "execute": function(target, action, selection, queued) 1102 1113 { 1103 1114 Engine.PostNetworkCommand({ -
ps/trunk/binaries/data/mods/public/simulation/ai/common-api/entity.js
r24999 r25020 808 808 }, 809 809 810 "move": function(x, z, queued = false ) {811 Engine.PostCommand(PlayerID, { "type": "walk", "entities": [this.id()], "x": x, "z": z, "queued": queued });812 return this; 813 }, 814 815 "moveToRange": function(x, z, min, max, queued = false ) {816 Engine.PostCommand(PlayerID, { "type": "walk-to-range", "entities": [this.id()], "x": x, "z": z, "min": min, "max": max, "queued": queued });817 return this; 818 }, 819 820 "attackMove": function(x, z, targetClasses, allowCapture = true, queued = false ) {821 Engine.PostCommand(PlayerID, { "type": "attack-walk", "entities": [this.id()], "x": x, "z": z, "targetClasses": targetClasses, "allowCapture": allowCapture, "queued": queued });810 "move": function(x, z, queued = false) { 811 Engine.PostCommand(PlayerID, { "type": "walk", "entities": [this.id()], "x": x, "z": z, "queued": queued }); 812 return this; 813 }, 814 815 "moveToRange": function(x, z, min, max, queued = false) { 816 Engine.PostCommand(PlayerID, { "type": "walk-to-range", "entities": [this.id()], "x": x, "z": z, "min": min, "max": max, "queued": queued }); 817 return this; 818 }, 819 820 "attackMove": function(x, z, targetClasses, allowCapture = true, queued = false) { 821 Engine.PostCommand(PlayerID, { "type": "attack-walk", "entities": [this.id()], "x": x, "z": z, "targetClasses": targetClasses, "allowCapture": allowCapture, "queued": queued }); 822 822 return this; 823 823 }, 824 824 825 825 // violent, aggressive, defensive, passive, standground 826 "setStance": function(stance, queued = false ) {826 "setStance": function(stance, queued = false) { 827 827 if (this.getStance() === undefined) 828 828 return undefined; 829 Engine.PostCommand(PlayerID, { "type": "stance", "entities": [this.id()], "name": stance, "queued": queued });829 Engine.PostCommand(PlayerID, { "type": "stance", "entities": [this.id()], "name": stance, "queued": queued }); 830 830 return this; 831 831 }, 832 832 833 833 "stopMoving": function() { 834 Engine.PostCommand(PlayerID, { "type": "stop", "entities": [this.id()], "queued": false });834 Engine.PostCommand(PlayerID, { "type": "stop", "entities": [this.id()], "queued": false }); 835 835 }, 836 836 … … 883 883 direction[1] /= norm; 884 884 } 885 Engine.PostCommand(PlayerID, { "type": "walk", "entities": [this.id()], "x": this.position()[0] + direction[0]*dist, "z": this.position()[1] + direction[1]*dist, "queued": false });885 Engine.PostCommand(PlayerID, { "type": "walk", "entities": [this.id()], "x": this.position()[0] + direction[0]*dist, "z": this.position()[1] + direction[1]*dist, "queued": false }); 886 886 } 887 887 return this; … … 897 897 FleeDirection[1] = 40 * FleeDirection[1]/dist; 898 898 899 Engine.PostCommand(PlayerID, { "type": "walk", "entities": [this.id()], "x": this.position()[0] + FleeDirection[0], "z": this.position()[1] + FleeDirection[1], "queued": false });900 } 901 return this; 902 }, 903 904 "gather": function(target, queued = false ) {905 Engine.PostCommand(PlayerID, { "type": "gather", "entities": [this.id()], "target": target.id(), "queued": queued });906 return this; 907 }, 908 909 "repair": function(target, autocontinue = false, queued = false ) {910 Engine.PostCommand(PlayerID, { "type": "repair", "entities": [this.id()], "target": target.id(), "autocontinue": autocontinue, "queued": queued });911 return this; 912 }, 913 914 "returnResources": function(target, queued = false ) {915 Engine.PostCommand(PlayerID, { "type": "returnresource", "entities": [this.id()], "target": target.id(), "queued": queued });899 Engine.PostCommand(PlayerID, { "type": "walk", "entities": [this.id()], "x": this.position()[0] + FleeDirection[0], "z": this.position()[1] + FleeDirection[1], "queued": false }); 900 } 901 return this; 902 }, 903 904 "gather": function(target, queued = false) { 905 Engine.PostCommand(PlayerID, { "type": "gather", "entities": [this.id()], "target": target.id(), "queued": queued }); 906 return this; 907 }, 908 909 "repair": function(target, autocontinue = false, queued = false) { 910 Engine.PostCommand(PlayerID, { "type": "repair", "entities": [this.id()], "target": target.id(), "autocontinue": autocontinue, "queued": queued }); 911 return this; 912 }, 913 914 "returnResources": function(target, queued = false) { 915 Engine.PostCommand(PlayerID, { "type": "returnresource", "entities": [this.id()], "target": target.id(), "queued": queued }); 916 916 return this; 917 917 }, … … 928 928 929 929 "tradeRoute": function(target, source) { 930 Engine.PostCommand(PlayerID, { "type": "setup-trade-route", "entities": [this.id()], "target": target.id(), "source": source.id(), "route": undefined, "queued": false });930 Engine.PostCommand(PlayerID, { "type": "setup-trade-route", "entities": [this.id()], "target": target.id(), "source": source.id(), "route": undefined, "queued": false }); 931 931 return this; 932 932 }, … … 982 982 "autocontinue": false, 983 983 "queued": false, 984 984 985 "metadata": metadata // can be undefined 985 986 }); … … 1007 1008 }, 1008 1009 1009 "guard": function(target, queued = false ) {1010 Engine.PostCommand(PlayerID, { "type": "guard", "entities": [this.id()], "target": target.id(), "queued": queued });1010 "guard": function(target, queued = false) { 1011 Engine.PostCommand(PlayerID, { "type": "guard", "entities": [this.id()], "target": target.id(), "queued": queued }); 1011 1012 return this; 1012 1013 }, -
ps/trunk/binaries/data/mods/public/simulation/components/UnitAI.js
r25000 r25020 5350 5350 }; 5351 5351 5352 UnitAI.prototype.AddOrder = function(type, data, queued )5352 UnitAI.prototype.AddOrder = function(type, data, queued) 5353 5353 { 5354 5354 if (this.expectedRoute) 5355 5355 this.expectedRoute = undefined; 5356 5356 5357 if (queued) 5357 if (pushFront) 5358 this.PushOrderFront(type, data); 5359 else if (queued) 5358 5360 this.PushOrder(type, data); 5359 5361 else … … 5370 5372 * Adds guard/escort order to the queue, forced by the player. 5371 5373 */ 5372 UnitAI.prototype.Guard = function(target, queued )5374 UnitAI.prototype.Guard = function(target, queued) 5373 5375 { 5374 5376 if (!this.CanGuard()) … … 5389 5391 } 5390 5392 5391 this.AddOrder("Guard", { "target": target, "force": false }, queued );5393 this.AddOrder("Guard", { "target": target, "force": false }, queued); 5392 5394 }; 5393 5395 … … 5471 5473 * Adds walk order to queue, forced by the player. 5472 5474 */ 5473 UnitAI.prototype.Walk = function(x, z, queued )5474 { 5475 if ( this.expectedRoute && queued)5475 UnitAI.prototype.Walk = function(x, z, queued) 5476 { 5477 if (this.expectedRoute && queued) 5476 5478 this.expectedRoute.push({ "x": x, "z": z }); 5477 5479 else 5478 this.AddOrder("Walk", { "x": x, "z": z, "force": true }, queued );5480 this.AddOrder("Walk", { "x": x, "z": z, "force": true }, queued); 5479 5481 }; 5480 5482 … … 5482 5484 * Adds walk to point range order to queue, forced by the player. 5483 5485 */ 5484 UnitAI.prototype.WalkToPointRange = function(x, z, min, max, queued )5485 { 5486 this.AddOrder("Walk", { "x": x, "z": z, "min": min, "max": max, "force": true }, queued );5486 UnitAI.prototype.WalkToPointRange = function(x, z, min, max, queued) 5487 { 5488 this.AddOrder("Walk", { "x": x, "z": z, "min": min, "max": max, "force": true }, queued); 5487 5489 }; 5488 5490 … … 5490 5492 * Adds stop order to queue, forced by the player. 5491 5493 */ 5492 UnitAI.prototype.Stop = function(queued )5493 { 5494 this.AddOrder("Stop", { "force": true }, queued );5494 UnitAI.prototype.Stop = function(queued) 5495 { 5496 this.AddOrder("Stop", { "force": true }, queued); 5495 5497 }; 5496 5498 … … 5499 5501 * to a player order, and so is forced. 5500 5502 */ 5501 UnitAI.prototype.WalkToTarget = function(target, queued )5502 { 5503 this.AddOrder("WalkToTarget", { "target": target, "force": true }, queued );5503 UnitAI.prototype.WalkToTarget = function(target, queued) 5504 { 5505 this.AddOrder("WalkToTarget", { "target": target, "force": true }, queued); 5504 5506 }; 5505 5507 … … 5509 5511 * If targetClasses is given, only entities matching the targetClasses can be attacked. 5510 5512 */ 5511 UnitAI.prototype.WalkAndFight = function(x, z, targetClasses, allowCapture = true, queued = false )5512 { 5513 this.AddOrder("WalkAndFight", { "x": x, "z": z, "targetClasses": targetClasses, "allowCapture": allowCapture, "force": true }, queued );5514 }; 5515 5516 UnitAI.prototype.Patrol = function(x, z, targetClasses, allowCapture = true, queued = false )5513 UnitAI.prototype.WalkAndFight = function(x, z, targetClasses, allowCapture = true, queued = false) 5514 { 5515 this.AddOrder("WalkAndFight", { "x": x, "z": z, "targetClasses": targetClasses, "allowCapture": allowCapture, "force": true }, queued); 5516 }; 5517 5518 UnitAI.prototype.Patrol = function(x, z, targetClasses, allowCapture = true, queued = false) 5517 5519 { 5518 5520 if (!this.CanPatrol()) … … 5522 5524 } 5523 5525 5524 this.AddOrder("Patrol", { "x": x, "z": z, "targetClasses": targetClasses, "allowCapture": allowCapture, "force": true }, queued );5526 this.AddOrder("Patrol", { "x": x, "z": z, "targetClasses": targetClasses, "allowCapture": allowCapture, "force": true }, queued); 5525 5527 }; 5526 5528 … … 5552 5554 * Adds attack order to the queue, forced by the player. 5553 5555 */ 5554 UnitAI.prototype.Attack = function(target, allowCapture = true, queued = false )5556 UnitAI.prototype.Attack = function(target, allowCapture = true, queued = false) 5555 5557 { 5556 5558 if (!this.CanAttack(target)) … … 5561 5563 this.MoveToTargetRange(target, IID_Heal); 5562 5564 else 5563 this.WalkToTarget(target, queued );5565 this.WalkToTarget(target, queued); 5564 5566 return; 5565 5567 } … … 5583 5585 } 5584 5586 5585 this.AddOrder("Attack", order, queued );5587 this.AddOrder("Attack", order, queued); 5586 5588 }; 5587 5589 … … 5589 5591 * Adds garrison order to the queue, forced by the player. 5590 5592 */ 5591 UnitAI.prototype.Garrison = function(target, queued )5593 UnitAI.prototype.Garrison = function(target, queued) 5592 5594 { 5593 5595 if (target == this.entity) … … 5598 5600 return; 5599 5601 } 5600 this.AddOrder("Garrison", { "target": target, "force": true }, queued );5602 this.AddOrder("Garrison", { "target": target, "force": true }, queued); 5601 5603 }; 5602 5604 … … 5626 5628 * until the target is reached 5627 5629 */ 5628 UnitAI.prototype.Gather = function(target, queued )5629 { 5630 this.PerformGather(target, queued, true );5630 UnitAI.prototype.Gather = function(target, queued) 5631 { 5632 this.PerformGather(target, queued, true); 5631 5633 }; 5632 5634 … … 5634 5636 * Internal function to abstract the force parameter. 5635 5637 */ 5636 UnitAI.prototype.PerformGather = function(target, queued, force )5638 UnitAI.prototype.PerformGather = function(target, queued, force) 5637 5639 { 5638 5640 if (!this.CanGather(target)) … … 5679 5681 } 5680 5682 5681 this.AddOrder("Gather", order, queued );5683 this.AddOrder("Gather", order, queued); 5682 5684 }; 5683 5685 … … 5686 5688 * interrupted by attacks. 5687 5689 */ 5688 UnitAI.prototype.GatherNearPosition = function(x, z, type, template, queued )5690 UnitAI.prototype.GatherNearPosition = function(x, z, type, template, queued) 5689 5691 { 5690 5692 if (template.indexOf("resource|") != -1) … … 5692 5694 5693 5695 if (this.IsFormationController() || Engine.QueryInterface(this.entity, IID_ResourceGatherer)) 5694 this.AddOrder("GatherNearPosition", { "type": type, "template": template, "x": x, "z": z, "force": false }, queued );5696 this.AddOrder("GatherNearPosition", { "type": type, "template": template, "x": x, "z": z, "force": false }, queued); 5695 5697 else 5696 this.AddOrder("Walk", { "x": x, "z": z, "force": false }, queued );5698 this.AddOrder("Walk", { "x": x, "z": z, "force": false }, queued); 5697 5699 }; 5698 5700 … … 5700 5702 * Adds heal order to the queue, forced by the player. 5701 5703 */ 5702 UnitAI.prototype.Heal = function(target, queued )5704 UnitAI.prototype.Heal = function(target, queued) 5703 5705 { 5704 5706 if (!this.CanHeal(target)) … … 5716 5718 } 5717 5719 5718 this.AddOrder("Heal", { "target": target, "force": true }, queued );5720 this.AddOrder("Heal", { "target": target, "force": true }, queued); 5719 5721 }; 5720 5722 … … 5722 5724 * Adds return resource order to the queue, forced by the player. 5723 5725 */ 5724 UnitAI.prototype.ReturnResource = function(target, queued )5726 UnitAI.prototype.ReturnResource = function(target, queued) 5725 5727 { 5726 5728 if (!this.CanReturnResource(target, true)) … … 5730 5732 } 5731 5733 5732 this.AddOrder("ReturnResource", { "target": target, "force": true }, queued );5734 this.AddOrder("ReturnResource", { "target": target, "force": true }, queued); 5733 5735 }; 5734 5736 … … 5776 5778 * if coming from a RallyPoint, or through this.expectedRoute if a user command. 5777 5779 */ 5778 UnitAI.prototype.SetupTradeRoute = function(target, source, route, queued )5780 UnitAI.prototype.SetupTradeRoute = function(target, source, route, queued) 5779 5781 { 5780 5782 if (!this.CanTrade(target)) … … 5827 5829 } 5828 5830 else 5829 this.AddOrder("Trade", data, queued );5831 this.AddOrder("Trade", data, queued); 5830 5832 } 5831 5833 else 5832 5834 { 5833 5835 if (this.IsFormationController()) 5834 this.CallMemberFunction("WalkToTarget", [cmpTrader.GetFirstMarket(), queued ]);5836 this.CallMemberFunction("WalkToTarget", [cmpTrader.GetFirstMarket(), queued]); 5835 5837 else 5836 this.WalkToTarget(cmpTrader.GetFirstMarket(), queued );5838 this.WalkToTarget(cmpTrader.GetFirstMarket(), queued); 5837 5839 this.expectedRoute = []; 5838 5840 } … … 5922 5924 * until the target is reached 5923 5925 */ 5924 UnitAI.prototype.Repair = function(target, autocontinue, queued )5926 UnitAI.prototype.Repair = function(target, autocontinue, queued) 5925 5927 { 5926 5928 if (!this.CanRepair(target)) … … 5939 5941 } 5940 5942 5941 this.AddOrder("Repair", { "target": target, "autocontinue": autocontinue, "force": true }, queued );5943 this.AddOrder("Repair", { "target": target, "autocontinue": autocontinue, "force": true }, queued); 5942 5944 }; 5943 5945 … … 5946 5948 * interrupted by attacks. 5947 5949 */ 5948 UnitAI.prototype.Flee = function(target, queued )5949 { 5950 this.AddOrder("Flee", { "target": target, "force": false }, queued );5950 UnitAI.prototype.Flee = function(target, queued) 5951 { 5952 this.AddOrder("Flee", { "target": target, "force": false }, queued); 5951 5953 }; 5952 5954 … … 5956 5958 }; 5957 5959 5958 UnitAI.prototype.Pack = function(queued )5960 UnitAI.prototype.Pack = function(queued) 5959 5961 { 5960 5962 if (this.CanPack()) 5961 this.AddOrder("Pack", { "force": true }, queued );5962 }; 5963 5964 UnitAI.prototype.Unpack = function(queued )5963 this.AddOrder("Pack", { "force": true }, queued); 5964 }; 5965 5966 UnitAI.prototype.Unpack = function(queued) 5965 5967 { 5966 5968 if (this.CanUnpack()) 5967 this.AddOrder("Unpack", { "force": true }, queued );5968 }; 5969 5970 UnitAI.prototype.CancelPack = function(queued )5969 this.AddOrder("Unpack", { "force": true }, queued); 5970 }; 5971 5972 UnitAI.prototype.CancelPack = function(queued) 5971 5973 { 5972 5974 var cmpPack = Engine.QueryInterface(this.entity, IID_Pack); 5973 5975 if (cmpPack && cmpPack.IsPacking() && !cmpPack.IsPacked()) 5974 this.AddOrder("CancelPack", { "force": true }, queued );5975 }; 5976 5977 UnitAI.prototype.CancelUnpack = function(queued )5976 this.AddOrder("CancelPack", { "force": true }, queued); 5977 }; 5978 5979 UnitAI.prototype.CancelUnpack = function(queued) 5978 5980 { 5979 5981 var cmpPack = Engine.QueryInterface(this.entity, IID_Pack); 5980 5982 if (cmpPack && cmpPack.IsPacking() && cmpPack.IsPacked()) 5981 this.AddOrder("CancelUnpack", { "force": true }, queued );5983 this.AddOrder("CancelUnpack", { "force": true }, queued); 5982 5984 }; 5983 5985 … … 6299 6301 if (this.heldPosition) 6300 6302 { 6301 this.AddOrder("Walk", { "x": this.heldPosition.x, "z": this.heldPosition.z, "force": false }, false );6303 this.AddOrder("Walk", { "x": this.heldPosition.x, "z": this.heldPosition.z, "force": false }, false); 6302 6304 return true; 6303 6305 } -
ps/trunk/binaries/data/mods/public/simulation/helpers/Commands.js
r24999 r25020 159 159 { 160 160 GetFormationUnitAIs(data.entities, player, cmd, data.formation).forEach(cmpUnitAI => { 161 cmpUnitAI.Walk(cmd.x, cmd.z, cmd.queued );161 cmpUnitAI.Walk(cmd.x, cmd.z, cmd.queued); 162 162 }); 163 163 }, … … 167 167 for (let ent in data.entities) 168 168 GetFormationUnitAIs([data.entities[ent]], player, cmd, data.formation).forEach(cmpUnitAI => { 169 cmpUnitAI.Walk(cmd.targetPositions[ent].x, cmd.targetPositions[ent].y, cmd.queued );169 cmpUnitAI.Walk(cmd.targetPositions[ent].x, cmd.targetPositions[ent].y, cmd.queued); 170 170 }); 171 171 }, … … 178 178 var cmpUnitAI = Engine.QueryInterface(ent, IID_UnitAI); 179 179 if (cmpUnitAI) 180 cmpUnitAI.WalkToPointRange(cmd.x, cmd.z, cmd.min, cmd.max, cmd.queued );180 cmpUnitAI.WalkToPointRange(cmd.x, cmd.z, cmd.min, cmd.max, cmd.queued); 181 181 } 182 182 }, … … 187 187 188 188 GetFormationUnitAIs(data.entities, player, cmd, data.formation).forEach(cmpUnitAI => { 189 cmpUnitAI.WalkAndFight(cmd.x, cmd.z, cmd.targetClasses, allowCapture, cmd.queued );189 cmpUnitAI.WalkAndFight(cmd.x, cmd.z, cmd.targetClasses, allowCapture, cmd.queued); 190 190 }); 191 191 }, … … 196 196 for (let ent in data.entities) 197 197 GetFormationUnitAIs([data.entities[ent]], player, cmd, data.formation).forEach(cmpUnitAI => { 198 cmpUnitAI.WalkAndFight(cmd.targetPositions[ent].x, cmd.targetPositions[ent].y, cmd.targetClasses, allowCapture, cmd.queued );198 cmpUnitAI.WalkAndFight(cmd.targetPositions[ent].x, cmd.targetPositions[ent].y, cmd.targetClasses, allowCapture, cmd.queued); 199 199 }); 200 200 }, … … 209 209 210 210 GetFormationUnitAIs(data.entities, player, cmd, data.formation).forEach(cmpUnitAI => { 211 cmpUnitAI.Attack(cmd.target, allowCapture, cmd.queued );211 cmpUnitAI.Attack(cmd.target, allowCapture, cmd.queued); 212 212 }); 213 213 }, … … 228 228 229 229 GetFormationUnitAIs(data.entities, player, cmd, data.formation).forEach(cmpUnitAI => { 230 cmpUnitAI.Heal(cmd.target, cmd.queued );230 cmpUnitAI.Heal(cmd.target, cmd.queued); 231 231 }); 232 232 }, … … 239 239 240 240 GetFormationUnitAIs(data.entities, player, cmd, data.formation).forEach(cmpUnitAI => { 241 cmpUnitAI.Repair(cmd.target, cmd.autocontinue, cmd.queued );241 cmpUnitAI.Repair(cmd.target, cmd.autocontinue, cmd.queued); 242 242 }); 243 243 }, … … 249 249 250 250 GetFormationUnitAIs(data.entities, player, cmd, data.formation).forEach(cmpUnitAI => { 251 cmpUnitAI.Gather(cmd.target, cmd.queued );251 cmpUnitAI.Gather(cmd.target, cmd.queued); 252 252 }); 253 253 }, … … 256 256 { 257 257 GetFormationUnitAIs(data.entities, player, cmd, data.formation).forEach(cmpUnitAI => { 258 cmpUnitAI.GatherNearPosition(cmd.x, cmd.z, cmd.resourceType, cmd.resourceTemplate, cmd.queued );258 cmpUnitAI.GatherNearPosition(cmd.x, cmd.z, cmd.resourceType, cmd.resourceTemplate, cmd.queued); 259 259 }); 260 260 }, … … 266 266 267 267 GetFormationUnitAIs(data.entities, player, cmd, data.formation).forEach(cmpUnitAI => { 268 cmpUnitAI.ReturnResource(cmd.target, cmd.queued );268 cmpUnitAI.ReturnResource(cmd.target, cmd.queued); 269 269 }); 270 270 }, … … 473 473 474 474 GetFormationUnitAIs(data.entities, player, cmd, data.formation).forEach(cmpUnitAI => { 475 cmpUnitAI.Garrison(cmd.target, cmd.queued );475 cmpUnitAI.Garrison(cmd.target, cmd.queued); 476 476 }); 477 477 }, … … 487 487 488 488 GetFormationUnitAIs(data.entities, player, cmd, data.formation).forEach(cmpUnitAI => { 489 cmpUnitAI.Guard(cmd.target, cmd.queued );489 cmpUnitAI.Guard(cmd.target, cmd.queued); 490 490 }); 491 491 }, … … 685 685 686 686 if (cmd.pack) 687 cmpUnitAI.Pack(cmd.queued );687 cmpUnitAI.Pack(cmd.queued); 688 688 else 689 cmpUnitAI.Unpack(cmd.queued );689 cmpUnitAI.Unpack(cmd.queued); 690 690 } 691 691 }, … … 700 700 701 701 if (cmd.pack) 702 cmpUnitAI.CancelPack(cmd.queued );702 cmpUnitAI.CancelPack(cmd.queued); 703 703 else 704 cmpUnitAI.CancelUnpack(cmd.queued );704 cmpUnitAI.CancelUnpack(cmd.queued); 705 705 } 706 706 },
Note:
See TracChangeset
for help on using the changeset viewer.