Timestamp:
Apr 12, 2021, 8:51:39 AM (3 years ago)
Author:
Freagarach
Message:

Attack using cmpAttack instead of UnitAI.

Keep responsibilities separated, allow easier modding of attacking behaviour.
Ideally the BuildingAI attacking routine would be merged in here as well, but not done for now.

Part of #5810
Differential revision: D3816
Comments by: @smiley, @Stan

File:
1 edited

Legend:

Unmodified
Added
Removed
  • ps/trunk/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js

    r25208 r25235  
    150150    });
    151151
    152     AddMock(SYSTEM_ENTITY, IID_ObstructionManager, {
    153         "IsInTargetRange": () => true,
    154         "IsInPointRange": () => true
    155     });
    156 
    157152    var unitAI = ConstructComponent(unit, "UnitAI", { "FormationController": "false", "DefaultStance": "aggressive" });
    158153
     
    195190        "CanAttack": function(v) { return true; },
    196191        "CompareEntitiesByPreference": function(a, b) { return 0; },
     192
     193
    197194    });
    198195
     
    371368            "CanAttack": function(v) { return true; },
    372369            "CompareEntitiesByPreference": function(a, b) { return 0; },
     370
     371
     372
    373373        });
    374374
Note: See TracChangeset for help on using the changeset viewer.