Remove SetDefaultAnimationVariant from leave so units can keep their old variants when moving to a new common state. For example, units coming to idle from attacking will show their weapons while units coming to idle from gathering resources will show the carried resources.
Also reset formation animations after leaving walking state, since units can leave the walking state without receiving a MoveCompleted message in which case they'd keep their formation-specific animations.
Details
- Reviewers
wraitii - Group Reviewers
Restricted Owners Package (Owns No Changed Paths)
Test that units have the correct animations.
For formation animations, test e.g. with spears in phalanx formation with shields in front of them whereas normally they have shields on their side.
Diff Detail
- Repository
- rP 0 A.D. Public Repository
- Branch
- /ps/trunk
- Lint
Lint OK - Unit
No Unit Test Coverage - Build Status
Buildable 5186 Build 8866: Vulcan Build Jenkins Build 8864: arc lint + arc unit
Event Timeline
Successful build - Chance fights ever on the side of the prudent.
Linter detected issues: Executing section Default... Executing section Source... Executing section JS... | | [NORMAL] ESLintBear (quote-props): | | Unquoted property 'targetVisibleEnemies' found. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | 73| 73| // do worry around armies slaughtering the guy standing next to you), etc. | 74| 74| var g_Stances = { | 75| 75| "violent": { | 76| |- targetVisibleEnemies: true, | | 76|+ "targetVisibleEnemies": true, | 77| 77| targetAttackersAlways: true, | 78| 78| respondFlee: false, | 79| 79| respondChase: true, | | [NORMAL] ESLintBear (quote-props): | | Unquoted property 'targetAttackersAlways' found. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | 74| 74| var g_Stances = { | 75| 75| "violent": { | 76| 76| targetVisibleEnemies: true, | 77| |- targetAttackersAlways: true, | | 77|+ "targetAttackersAlways": true, | 78| 78| respondFlee: false, | 79| 79| respondChase: true, | 80| 80| respondChaseBeyondVision: true, | | [NORMAL] ESLintBear (quote-props): | | Unquoted property 'respondFlee' found. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | 75| 75| "violent": { | 76| 76| targetVisibleEnemies: true, | 77| 77| targetAttackersAlways: true, | 78| |- respondFlee: false, | | 78|+ "respondFlee": false, | 79| 79| respondChase: true, | 80| 80| respondChaseBeyondVision: true, | 81| 81| respondStandGround: false, | | [NORMAL] ESLintBear (quote-props): | | Unquoted property 'respondChase' found. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | 76| 76| targetVisibleEnemies: true, | 77| 77| targetAttackersAlways: true, | 78| 78| respondFlee: false, | 79| |- respondChase: true, | | 79|+ "respondChase": true, | 80| 80| respondChaseBeyondVision: true, | 81| 81| respondStandGround: false, | 82| 82| respondHoldGround: false, | | [NORMAL] ESLintBear (quote-props): | | Unquoted property 'respondChaseBeyondVision' found. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | 77| 77| targetAttackersAlways: true, | 78| 78| respondFlee: false, | 79| 79| respondChase: true, | 80| |- respondChaseBeyondVision: true, | | 80|+ "respondChaseBeyondVision": true, | 81| 81| respondStandGround: false, | 82| 82| respondHoldGround: false, | 83| 83| }, | | [NORMAL] ESLintBear (quote-props): | | Unquoted property 'respondStandGround' found. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | 78| 78| respondFlee: false, | 79| 79| respondChase: true, | 80| 80| respondChaseBeyondVision: true, | 81| |- respondStandGround: false, | | 81|+ "respondStandGround": false, | 82| 82| respondHoldGround: false, | 83| 83| }, | 84| 84| "aggressive": { | | [NORMAL] ESLintBear (quote-props): | | Unquoted property 'respondHoldGround' found. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | 79| 79| respondChase: true, | 80| 80| respondChaseBeyondVision: true, | 81| 81| respondStandGround: false, | 82| |- respondHoldGround: false, | | 82|+ "respondHoldGround": false, | 83| 83| }, | 84| 84| "aggressive": { | 85| 85| targetVisibleEnemies: true, | | [NORMAL] ESLintBear (quote-props): | | Unquoted property 'targetVisibleEnemies' found. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | 82| 82| respondHoldGround: false, | 83| 83| }, | 84| 84| "aggressive": { | 85| |- targetVisibleEnemies: true, | | 85|+ "targetVisibleEnemies": true, | 86| 86| targetAttackersAlways: false, | 87| 87| respondFlee: false, | 88| 88| respondChase: true, | | [NORMAL] ESLintBear (quote-props): | | Unquoted property 'targetAttackersAlways' found. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | 83| 83| }, | 84| 84| "aggressive": { | 85| 85| targetVisibleEnemies: true, | 86| |- targetAttackersAlways: false, | | 86|+ "targetAttackersAlways": false, | 87| 87| respondFlee: false, | 88| 88| respondChase: true, | 89| 89| respondChaseBeyondVision: false, | | [NORMAL] ESLintBear (quote-props): | | Unquoted property 'respondFlee' found. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | 84| 84| "aggressive": { | 85| 85| targetVisibleEnemies: true, | 86| 86| targetAttackersAlways: false, | 87| |- respondFlee: false, | | 87|+ "respondFlee": false, | 88| 88| respondChase: true, | 89| 89| respondChaseBeyondVision: false, | 90| 90| respondStandGround: false, | | [NORMAL] ESLintBear (quote-props): | | Unquoted property 'respondChase' found. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | 85| 85| targetVisibleEnemies: true, | 86| 86| targetAttackersAlways: false, | 87| 87| respondFlee: false, | 88| |- respondChase: true, | | 88|+ "respondChase": true, | 89| 89| respondChaseBeyondVision: false, | 90| 90| respondStandGround: false, | 91| 91| respondHoldGround: false, | | [NORMAL] ESLintBear (quote-props): | | Unquoted property 'respondChaseBeyondVision' found. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | 86| 86| targetAttackersAlways: false, | 87| 87| respondFlee: false, | 88| 88| respondChase: true, | 89| |- respondChaseBeyondVision: false, | | 89|+ "respondChaseBeyondVision": false, | 90| 90| respondStandGround: false, | 91| 91| respondHoldGround: false, | 92| 92| }, | | [NORMAL] ESLintBear (quote-props): | | Unquoted property 'respondStandGround' found. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | 87| 87| respondFlee: false, | 88| 88| respondChase: true, | 89| 89| respondChaseBeyondVision: false, | 90| |- respondStandGround: false, | | 90|+ "respondStandGround": false, | 91| 91| respondHoldGround: false, | 92| 92| }, | 93| 93| "defensive": { | | [NORMAL] ESLintBear (quote-props): | | Unquoted property 'respondHoldGround' found. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | 88| 88| respondChase: true, | 89| 89| respondChaseBeyondVision: false, | 90| 90| respondStandGround: false, | 91| |- respondHoldGround: false, | | 91|+ "respondHoldGround": false, | 92| 92| }, | 93| 93| "defensive": { | 94| 94| targetVisibleEnemies: true, | | [NORMAL] ESLintBear (quote-props): | | Unquoted property 'targetVisibleEnemies' found. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | 91| 91| respondHoldGround: false, | 92| 92| }, | 93| 93| "defensive": { | 94| |- targetVisibleEnemies: true, | | 94|+ "targetVisibleEnemies": true, | 95| 95| targetAttackersAlways: false, | 96| 96| respondFlee: false, | 97| 97| respondChase: false, | | [NORMAL] ESLintBear (quote-props): | | Unquoted property 'targetAttackersAlways' found. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | 92| 92| }, | 93| 93| "defensive": { | 94| 94| targetVisibleEnemies: true, | 95| |- targetAttackersAlways: false, | | 95|+ "targetAttackersAlways": false, | 96| 96| respondFlee: false, | 97| 97| respondChase: false, | 98| 98| respondChaseBeyondVision: false, | | [NORMAL] ESLintBear (quote-props): | | Unquoted property 'respondFlee' found. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | 93| 93| "defensive": { | 94| 94| targetVisibleEnemies: true, | 95| 95| targetAttackersAlways: false, | 96| |- respondFlee: false, | | 96|+ "respondFlee": false, | 97| 97| respondChase: false, | 98| 98| respondChaseBeyondVision: false, | 99| 99| respondStandGround: false, | | [NORMAL] ESLintBear (quote-props): | | Unquoted property 'respondChase' found. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | 94| 94| targetVisibleEnemies: true, | 95| 95| targetAttackersAlways: false, | 96| 96| respondFlee: false, | 97| |- respondChase: false, | | 97|+ "respondChase": false, | 98| 98| respondChaseBeyondVision: false, | 99| 99| respondStandGround: false, | 100| 100| respondHoldGround: true, | | [NORMAL] ESLintBear (quote-props): | | Unquoted property 'respondChaseBeyondVision' found. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | 95| 95| targetAttackersAlways: false, | 96| 96| respondFlee: false, | 97| 97| respondChase: false, | 98| |- respondChaseBeyondVision: false, | | 98|+ "respondChaseBeyondVision": false, | 99| 99| respondStandGround: false, | 100| 100| respondHoldGround: true, | 101| 101| }, | | [NORMAL] ESLintBear (quote-props): | | Unquoted property 'respondStandGround' found. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | 96| 96| respondFlee: false, | 97| 97| respondChase: false, | 98| 98| respondChaseBeyondVision: false, | 99| |- respondStandGround: false, | | 99|+ "respondStandGround": false, | 100| 100| respondHoldGround: true, | 101| 101| }, | 102| 102| "passive": { | | [NORMAL] ESLintBear (quote-props): | | Unquoted property 'respondHoldGround' found. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | 97| 97| respondChase: false, | 98| 98| respondChaseBeyondVision: false, | 99| 99| respondStandGround: false, | 100| |- respondHoldGround: true, | | 100|+ "respondHoldGround": true, | 101| 101| }, | 102| 102| "passive": { | 103| 103| targetVisibleEnemies: false, | | [NORMAL] ESLintBear (quote-props): | | Unquoted property 'targetVisibleEnemies' found. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | 100| 100| respondHoldGround: true, | 101| 101| }, | 102| 102| "passive": { | 103| |- targetVisibleEnemies: false, | | 103|+ "targetVisibleEnemies": false, | 104| 104| targetAttackersAlways: false, | 105| 105| respondFlee: true, | 106| 106| respondChase: false, | | [NORMAL] ESLintBear (quote-props): | | Unquoted property 'targetAttackersAlways' found. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | 101| 101| }, | 102| 102| "passive": { | 103| 103| targetVisibleEnemies: false, | 104| |- targetAttackersAlways: false, | | 104|+ "targetAttackersAlways": false, | 105| 105| respondFlee: true, | 106| 106| respondChase: false, | 107| 107| respondChaseBeyondVision: false, | | [NORMAL] ESLintBear (quote-props): | | Unquoted property 'respondFlee' found. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | 102| 102| "passive": { | 103| 103| targetVisibleEnemies: false, | 104| 104| targetAttackersAlways: false, | 105| |- respondFlee: true, | | 105|+ "respondFlee": true, | 106| 106| respondChase: false, | 107| 107| respondChaseBeyondVision: false, | 108| 108| respondStandGround: false, | | [NORMAL] ESLintBear (quote-props): | | Unquoted property 'respondChase' found. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | 103| 103| targetVisibleEnemies: false, | 104| 104| targetAttackersAlways: false, | 105| 105| respondFlee: true, | 106| |- respondChase: false, | | 106|+ "respondChase": false, | 107| 107| respondChaseBeyondVision: false, | 108| 108| respondStandGround: false, | 109| 109| respondHoldGround: false, | | [NORMAL] ESLintBear (quote-props): | | Unquoted property 'respondChaseBeyondVision' found. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | 104| 104| targetAttackersAlways: false, | 105| 105| respondFlee: true, | 106| 106| respondChase: false, | 107| |- respondChaseBeyondVision: false, | | 107|+ "respondChaseBeyondVision": false, | 108| 108| respondStandGround: false, | 109| 109| respondHoldGround: false, | 110| 110| }, | | [NORMAL] ESLintBear (quote-props): | | Unquoted property 'respondStandGround' found. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | 105| 105| respondFlee: true, | 106| 106| respondChase: false, | 107| 107| respondChaseBeyondVision: false, | 108| |- respondStandGround: false, | | 108|+ "respondStandGround": false, | 109| 109| respondHoldGround: false, | 110| 110| }, | 111| 111| "standground": { | | [NORMAL] ESLintBear (quote-props): | | Unquoted property 'respondHoldGround' found. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | 106| 106| respondChase: false, | 107| 107| respondChaseBeyondVision: false, | 108| 108| respondStandGround: false, | 109| |- respondHoldGround: false, | | 109|+ "respondHoldGround": false, | 110| 110| }, | 111| 111| "standground": { | 112| 112| targetVisibleEnemies: true, | | [NORMAL] ESLintBear (quote-props): | | Unquoted property 'targetVisibleEnemies' found. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | 109| 109| respondHoldGround: false, | 110| 110| }, | 111| 111| "standground": { | 112| |- targetVisibleEnemies: true, | | 112|+ "targetVisibleEnemies": true, | 113| 113| targetAttackersAlways: false, | 114| 114| respondFlee: false, | 115| 115| respondChase: false, | | [NORMAL] ESLintBear (quote-props): | | Unquoted property 'targetAttackersAlways' found. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | 110| 110| }, | 111| 111| "standground": { | 112| 112| targetVisibleEnemies: true, | 113| |- targetAttackersAlways: false, | | 113|+ "targetAttackersAlways": false, | 114| 114| respondFlee: false, | 115| 115| respondChase: false, | 116| 116| respondChaseBeyondVision: false, | | [NORMAL] ESLintBear (quote-props): | | Unquoted property 'respondFlee' found. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | 111| 111| "standground": { | 112| 112| targetVisibleEnemies: true, | 113| 113| targetAttackersAlways: false, | 114| |- respondFlee: false, | | 114|+ "respondFlee": false, | 115| 115| respondChase: false, | 116| 116| respondChaseBeyondVision: false, | 117| 117| respondStandGround: true, | | [NORMAL] ESLintBear (quote-props): | | Unquoted property 'respondChase' found. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | 112| 112| targetVisibleEnemies: true, | 113| 113| targetAttackersAlways: false, | 114| 114| respondFlee: false, | 115| |- respondChase: false, | | 115|+ "respondChase": false, | 116| 116| respondChaseBeyondVision: false, | 117| 117| respondStandGround: true, | 118| 118| respondHoldGround: false, | | [NORMAL] ESLintBear (quote-props): | | Unquoted property 'respondChaseBeyondVision' found. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | 113| 113| targetAttackersAlways: false, | 114| 114| respondFlee: false, | 115| 115| respondChase: false, | 116| |- respondChaseBeyondVision: false, | | 116|+ "respondChaseBeyondVision": false, | 117| 117| respondStandGround: true, | 118| 118| respondHoldGround: false, | 119| 119| }, | | [NORMAL] ESLintBear (quote-props): | | Unquoted property 'respondStandGround' found. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | 114| 114| respondFlee: false, | 115| 115| respondChase: false, | 116| 116| respondChaseBeyondVision: false, | 117| |- respondStandGround: true, | | 117|+ "respondStandGround": true, | 118| 118| respondHoldGround: false, | 119| 119| }, | 120| 120| }; | | [NORMAL] ESLintBear (quote-props): | | Unquoted property 'respondHoldGround' found. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | 115| 115| respondChase: false, | 116| 116| respondChaseBeyondVision: false, | 117| 117| respondStandGround: true, | 118| |- respondHoldGround: false, | | 118|+ "respondHoldGround": false, | 119| 119| }, | 120| 120| }; | 121| 121| | | [NORMAL] ESLintBear (curly): | | Unnecessary { after 'if' condition. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | 216| 216| // Move a tile outside the building | 217| 217| let range = 4; | 218| 218| if (this.MoveToTargetRangeExplicit(msg.data.target, range, range)) | 219| |- { | | 219|+ | 220| 220| // We've started walking to the given point | 221| 221| this.SetNextState("INDIVIDUAL.WALKING"); | 222| |- } | | 222|+ | 223| 223| else | 224| 224| { | 225| 225| // We are already at the target, or can't move at all | | [NORMAL] ESLintBear (curly): | | Unnecessary { after 'else'. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | 221| 221| this.SetNextState("INDIVIDUAL.WALKING"); | 222| 222| } | 223| 223| else | 224| |- { | | 224|+ | 225| 225| // We are already at the target, or can't move at all | 226| 226| this.FinishOrder(); | 227| |- } | | 227|+ | 228| 228| }, | 229| 229| | 230| 230| // Individual orders: | | [NORMAL] ESLintBear (curly): | | Unnecessary { after 'if' condition. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | 326| 326| | 327| 327| var ok = this.MoveToTarget(this.order.data.target); | 328| 328| if (ok) | 329| |- { | | 329|+ | 330| 330| // We've started walking to the given point | 331| 331| if (this.IsAnimal()) | 332| 332| this.SetNextState("ANIMAL.WALKING"); | 333| 333| else | 334| 334| this.SetNextState("INDIVIDUAL.WALKING"); | 335| |- } | | 335|+ | 336| 336| else | 337| 337| { | 338| 338| // We are already at the target, or can't move at all | | [NORMAL] ESLintBear (curly): | | Unnecessary { after 'if' condition. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | 354| 354| var cmpPosition = Engine.QueryInterface(this.entity, IID_Position); | 355| 355| if (this.lastShorelinePosition && cmpPosition && (this.lastShorelinePosition.x == cmpPosition.GetPosition().x) | 356| 356| && (this.lastShorelinePosition.z == cmpPosition.GetPosition().z)) | 357| |- { | | 357|+ | 358| 358| // we were already on the shoreline, and have not moved since | 359| 359| if (DistanceBetweenEntities(this.entity, this.order.data.target) < 50) | 360| 360| needToMove = false; | 361| |- } | | 361|+ | 362| 362| | 363| 363| // TODO: what if the units are on a cliff ? the ship will go below the cliff | 364| 364| // and the units won't be able to garrison. Should go to the nearest (accessible) shore | | [NORMAL] ESLintBear (operator-linebreak): | | '&&' should be placed at the end of the line. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | 352| 352| // Check if we need to move TODO implement a better way to know if we are on the shoreline | 353| 353| var needToMove = true; | 354| 354| var cmpPosition = Engine.QueryInterface(this.entity, IID_Position); | 355| |- if (this.lastShorelinePosition && cmpPosition && (this.lastShorelinePosition.x == cmpPosition.GetPosition().x) | 356| |- && (this.lastShorelinePosition.z == cmpPosition.GetPosition().z)) | | 355|+ if (this.lastShorelinePosition && cmpPosition && (this.lastShorelinePosition.x == cmpPosition.GetPosition().x) && | | 356|+ (this.lastShorelinePosition.z == cmpPosition.GetPosition().z)) | 357| 357| { | 358| 358| // we were already on the shoreline, and have not moved since | 359| 359| if (DistanceBetweenEntities(this.entity, this.order.data.target) < 50) | | [NORMAL] ESLintBear (curly): | | Unnecessary { after 'if' condition. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | 363| 363| // TODO: what if the units are on a cliff ? the ship will go below the cliff | 364| 364| // and the units won't be able to garrison. Should go to the nearest (accessible) shore | 365| 365| if (needToMove && this.MoveToTarget(this.order.data.target)) | 366| |- { | | 366|+ | 367| 367| this.SetNextState("INDIVIDUAL.PICKUP.APPROACHING"); | 368| |- } | | 368|+ | 369| 369| else | 370| 370| { | 371| 371| // We are already at the target, or can't move at all | | [NORMAL] ESLintBear (curly): | | Unnecessary { after 'if' condition. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | 392| 392| var distance = DistanceBetweenEntities(this.entity, this.order.data.target) + (+this.template.FleeDistance); | 393| 393| var cmpUnitMotion = Engine.QueryInterface(this.entity, IID_UnitMotion); | 394| 394| if (cmpUnitMotion.MoveToTargetRange(this.order.data.target, distance, -1)) | 395| |- { | | 395|+ | 396| 396| // We've started fleeing from the given target | 397| 397| if (this.IsAnimal()) | 398| 398| this.SetNextState("ANIMAL.FLEEING"); | 399| 399| else | 400| 400| this.SetNextState("INDIVIDUAL.FLEEING"); | 401| |- } | | 401|+ | 402| 402| else | 403| 403| { | 404| 404| // We are already at the target, or can't move at all | | [NORMAL] ESLintBear (curly): | | Unnecessary { after 'if' condition. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | 448| 448| } | 449| 449| | 450| 450| if (this.order.data.attackType == this.oldAttackType) | 451| |- { | | 451|+ | 452| 452| if (this.IsAnimal()) | 453| 453| this.SetNextState("ANIMAL.COMBAT.ATTACKING"); | 454| 454| else | 455| 455| this.SetNextState("INDIVIDUAL.COMBAT.ATTACKING"); | 456| |- } | | 456|+ | 457| 457| else | 458| 458| { | 459| 459| if (this.IsAnimal()) | | [NORMAL] ESLintBear (curly): | | Unnecessary { after 'else'. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | 455| 455| this.SetNextState("INDIVIDUAL.COMBAT.ATTACKING"); | 456| 456| } | 457| 457| else | 458| |- { | | 458|+ | 459| 459| if (this.IsAnimal()) | 460| 460| this.SetNextStateAlwaysEntering("ANIMAL.COMBAT.ATTACKING"); | 461| 461| else | 462| 462| this.SetNextStateAlwaysEntering("INDIVIDUAL.COMBAT.ATTACKING"); | 463| |- } | | 463|+ | 464| 464| return; | 465| 465| } | 466| 466| | | [NORMAL] ESLintBear (curly): | | Unnecessary { after 'else'. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | 593| 593| this.PushOrderFront("Walk", this.order.data.lastPos); | 594| 594| } | 595| 595| else | 596| |- { | | 596|+ | 597| 597| // We couldn't move there, or the target moved away | 598| 598| this.FinishOrder(); | 599| |- } | | 599|+ | 600| 600| return; | 601| 601| } | 602| 602| | | [NORMAL] ESLintBear (curly): | | Unnecessary { after 'if' condition. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | 606| 606| | 607| 607| // Try to move within range | 608| 608| if (this.MoveToTargetRange(this.order.data.target, IID_ResourceGatherer)) | 609| |- { | | 609|+ | 610| 610| // We've started walking to the given point | 611| 611| this.SetNextState("INDIVIDUAL.GATHER.APPROACHING"); | 612| |- } | | 612|+ | 613| 613| else | 614| 614| { | 615| 615| // We are already at the target, or can't move at all, | | [NORMAL] ESLintBear (curly): | | Unnecessary { after 'if' condition. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | 683| 683| "Order.Repair": function(msg) { | 684| 684| // Try to move within range | 685| 685| if (this.MoveToTargetRange(this.order.data.target, IID_Builder)) | 686| |- { | | 686|+ | 687| 687| // We've started walking to the given point | 688| 688| this.SetNextState("INDIVIDUAL.REPAIR.APPROACHING"); | 689| |- } | | 689|+ | 690| 690| else | 691| 691| { | 692| 692| // We are already at the target, or can't move at all, | | [NORMAL] ESLintBear (curly): | | Unnecessary { after 'if' condition. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | 720| 720| } | 721| 721| | 722| 722| if (this.MoveToGarrisonRange(this.order.data.target)) | 723| |- { | | 723|+ | 724| 724| this.SetNextState("INDIVIDUAL.GARRISON.APPROACHING"); | 725| |- } | | 725|+ | 726| 726| else | 727| 727| { | 728| 728| // We do a range check before actually garrisoning | | [NORMAL] ESLintBear (curly): | | Unnecessary { after 'if' condition. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | 858| 858| if (!this.CheckTargetAttackRange(target, target)) | 859| 859| { | 860| 860| if (this.TargetIsAlive(target) && this.CheckTargetVisible(target)) | 861| |- { | | 861|+ | 862| 862| if (this.MoveToTargetAttackRange(target, target)) | 863| 863| { | 864| 864| this.SetNextState("COMBAT.APPROACHING"); | 865| 865| return; | 866| 866| } | 867| |- } | | 867|+ | 868| 868| this.FinishOrder(); | 869| 869| return; | 870| 870| } | | [NORMAL] ESLintBear (curly): | | Unnecessary { after 'if' condition. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | 883| 883| } | 884| 884| // Check if we are already in range, otherwise walk there | 885| 885| if (!this.CheckGarrisonRange(msg.data.target)) | 886| |- { | | 886|+ | 887| 887| if (!this.CheckTargetVisible(msg.data.target)) | 888| 888| { | 889| 889| this.FinishOrder(); | 898| 898| return; | 899| 899| } | 900| 900| } | 901| |- } | | 901|+ | 902| 902| | 903| 903| this.SetNextState("GARRISON.GARRISONING"); | 904| 904| }, | | [NORMAL] ESLintBear (curly): | | Unnecessary { after 'else'. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | 890| 890| return; | 891| 891| } | 892| 892| else | 893| |- { | | 893|+ | 894| 894| // Out of range; move there in formation | 895| 895| if (this.MoveToGarrisonRange(msg.data.target)) | 896| 896| { | 897| 897| this.SetNextState("GARRISON.APPROACHING"); | 898| 898| return; | 899| 899| } | 900| |- } | | 900|+ | 901| 901| } | 902| 902| | 903| 903| this.SetNextState("GARRISON.GARRISONING"); | | [NORMAL] ESLintBear (no-else-return): | | Unnecessary 'else' after 'return'. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | 889| 889| this.FinishOrder(); | 890| 890| return; | 891| 891| } | 892| |- else | 893| |- { | | 892|+ | 894| 893| // Out of range; move there in formation | 895| 894| if (this.MoveToGarrisonRange(msg.data.target)) | 896| 895| { | 897| 896| this.SetNextState("GARRISON.APPROACHING"); | 898| 897| return; | 899| 898| } | 900| |- } | | 899|+ | 901| 900| } | 902| 901| | 903| 902| this.SetNextState("GARRISON.GARRISONING"); | | [NORMAL] ESLintBear (curly): | | Unnecessary { after 'else'. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | 916| 916| this.PushOrderFront("Walk", msg.data.lastPos); | 917| 917| } | 918| 918| else | 919| |- { | | 919|+ | 920| 920| // We couldn't move there, or the target moved away | 921| 921| this.FinishOrder(); | 922| |- } | | 922|+ | 923| 923| return; | 924| 924| } | 925| 925| | | [NORMAL] ESLintBear (key-spacing): | | Missing space before value for key 'GARRISON'. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js |1137|1137| }, |1138|1138| }, |1139|1139| |1140| |- "GARRISON":{ | |1140|+ "GARRISON": { |1141|1141| "enter": function() { |1142|1142| // If the garrisonholder should pickup, warn it so it can take needed action |1143|1143| var cmpGarrisonHolder = Engine.QueryInterface(this.order.data.target, IID_GarrisonHolder); | | [NORMAL] ESLintBear (curly): | | Unnecessary { after 'if' condition. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js |1318|1318| // If the controller handled an order but some members rejected it, |1319|1319| // they will have no orders and be in the FORMATIONMEMBER.IDLE state. |1320|1320| if (this.orderQueue.length) |1321| |- { | |1321|+ |1322|1322| // We're leaving the formation, so stop our FormationWalk order |1323|1323| if (this.FinishOrder()) |1324|1324| return; |1325| |- } | |1325|+ |1326|1326| |1327|1327| // No orders left, we're an individual now |1328|1328| if (this.IsAnimal()) | | [NORMAL] ESLintBear (curly): | | Unnecessary { after 'if' condition. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js |1346|1346| // Move a tile outside the building |1347|1347| let range = 4; |1348|1348| if (this.MoveToTargetRangeExplicit(msg.data.target, range, range)) |1349| |- { | |1349|+ |1350|1350| // We've started walking to the given point |1351|1351| this.SetNextState("WALKINGTOPOINT"); |1352| |- } | |1352|+ |1353|1353| else |1354|1354| { |1355|1355| // We are already at the target, or can't move at all | | [NORMAL] ESLintBear (curly): | | Unnecessary { after 'else'. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js |1351|1351| this.SetNextState("WALKINGTOPOINT"); |1352|1352| } |1353|1353| else |1354| |- { | |1354|+ |1355|1355| // We are already at the target, or can't move at all |1356|1356| this.FinishOrder(); |1357| |- } | |1357|+ |1358|1358| }, |1359|1359| |1360|1360| | | [NORMAL] ESLintBear (space-before-function-paren): | | Unexpected space before function parentheses. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js |1369|1369| }, |1370|1370| |1371|1371| "WALKING": { |1372| |- "enter": function () { | |1372|+ "enter": function() { |1373|1373| var cmpFormation = Engine.QueryInterface(this.formationController, IID_Formation); |1374|1374| var cmpVisual = Engine.QueryInterface(this.entity, IID_Visual); |1375|1375| if (cmpFormation && cmpVisual) | | [NORMAL] ESLintBear (curly): | | Unnecessary { after 'if' condition. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js |1555|1555| |1556|1556| "LosRangeUpdate": function(msg) { |1557|1557| if (this.GetStance().targetVisibleEnemies) |1558| |- { | |1558|+ |1559|1559| // Start attacking one of the newly-seen enemy (if any) |1560|1560| this.AttackEntitiesByPreference(msg.data.added); |1561| |- } | |1561|+ |1562|1562| }, |1563|1563| |1564|1564| "LosHealRangeUpdate": function(msg) { | | [NORMAL] ESLintBear (space-before-function-paren): | | Unexpected space before function parentheses. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js |1583|1583| }, |1584|1584| |1585|1585| "WALKING": { |1586| |- "enter": function () { | |1586|+ "enter": function() { |1587|1587| this.SelectAnimation("move"); |1588|1588| }, |1589|1589| | | [NORMAL] ESLintBear (space-before-function-paren): | | Unexpected space before function parentheses. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js |1593|1593| }, |1594|1594| |1595|1595| "WALKINGANDFIGHTING": { |1596| |- "enter": function () { | |1596|+ "enter": function() { |1597|1597| // Show weapons rather than carried resources. |1598|1598| this.SetAnimationVariant("combat"); |1599|1599| | | [NORMAL] ESLintBear (space-before-function-paren): | | Unexpected space before function parentheses. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js |1615|1615| }, |1616|1616| |1617|1617| "PATROL": { |1618| |- "enter": function () { | |1618|+ "enter": function() { |1619|1619| // Memorize the origin position in case that we want to go back |1620|1620| let cmpPosition = Engine.QueryInterface(this.entity, IID_Position); |1621|1621| if (!cmpPosition || !cmpPosition.IsInWorld()) | | [NORMAL] ESLintBear (space-before-function-paren): | | Unexpected space before function parentheses. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js |1659|1659| }, |1660|1660| |1661|1661| "ESCORTING": { |1662| |- "enter": function () { | |1662|+ "enter": function() { |1663|1663| // Show weapons rather than carried resources. |1664|1664| this.SetAnimationVariant("combat"); |1665|1665| | | [NORMAL] ESLintBear (space-before-function-paren): | | Unexpected space before function parentheses. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js |1708|1708| }, |1709|1709| |1710|1710| "GUARDING": { |1711| |- "enter": function () { | |1711|+ "enter": function() { |1712|1712| this.StartTimer(1000, 1000); |1713|1713| this.SetHeldPositionOnEntity(this.entity); |1714|1714| this.SelectAnimation("idle"); | | [NORMAL] ESLintBear (curly): | | Unnecessary { after 'if' condition. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js |1736|1736| // if nothing better to do, check if the guarded needs to be healed or repaired |1737|1737| var cmpHealth = Engine.QueryInterface(this.isGuardOf, IID_Health); |1738|1738| if (cmpHealth && (cmpHealth.GetHitpoints() < cmpHealth.GetMaxHitpoints())) |1739| |- { | |1739|+ |1740|1740| if (this.CanHeal(this.isGuardOf)) |1741|1741| this.PushOrderFront("Heal", { "target": this.isGuardOf, "force": false }); |1742|1742| else if (this.CanRepair(this.isGuardOf)) |1743|1743| this.PushOrderFront("Repair", { "target": this.isGuardOf, "autocontinue": false, "force": false }); |1744| |- } | |1744|+ |1745|1745| } |1746|1746| }, |1747|1747| | | [NORMAL] ESLintBear (space-before-function-paren): | | Unexpected space before function parentheses. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js |1793|1793| }, |1794|1794| |1795|1795| "APPROACHING": { |1796| |- "enter": function () { | |1796|+ "enter": function() { |1797|1797| // Show weapons rather than carried resources. |1798|1798| this.SetAnimationVariant("combat"); |1799|1799| | | [NORMAL] ESLintBear (curly): | | Unnecessary { after 'if' condition. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js |1823|1823| "MoveCompleted": function() { |1824|1824| |1825|1825| if (this.CheckTargetAttackRange(this.order.data.target, this.order.data.attackType)) |1826| |- { | |1826|+ |1827|1827| // If the unit needs to unpack, do so |1828|1828| if (this.CanUnpack()) |1829|1829| { |1832|1832| } |1833|1833| else |1834|1834| this.SetNextState("ATTACKING"); |1835| |- } | |1835|+ |1836|1836| else |1837|1837| { |1838|1838| if (this.MoveToTargetAttackRange(this.order.data.target, this.order.data.attackType)) | | [NORMAL] ESLintBear (no-else-return): | | Unnecessary 'else' after 'return'. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js |1830|1830| this.PushOrderFront("Unpack", { "force": true }); |1831|1831| return; |1832|1832| } |1833| |- else |1834| |- this.SetNextState("ATTACKING"); | |1833|+ this.SetNextState("ATTACKING"); |1835|1834| } |1836|1835| else |1837|1836| { | | [NORMAL] ESLintBear (curly): | | Unnecessary { after 'else'. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js |1834|1834| this.SetNextState("ATTACKING"); |1835|1835| } |1836|1836| else |1837| |- { | |1837|+ |1838|1838| if (this.MoveToTargetAttackRange(this.order.data.target, this.order.data.attackType)) |1839|1839| { |1840|1840| this.SetNextState("APPROACHING"); |1844|1844| // Give up |1845|1845| this.FinishOrder(); |1846|1846| } |1847| |- } | |1847|+ |1848|1848| }, |1849|1849| }, |1850|1850| | | [NORMAL] ESLintBear (curly): | | Unnecessary { after 'if' condition. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js |1836|1836| else |1837|1837| { |1838|1838| if (this.MoveToTargetAttackRange(this.order.data.target, this.order.data.attackType)) |1839| |- { | |1839|+ |1840|1840| this.SetNextState("APPROACHING"); |1841| |- } | |1841|+ |1842|1842| else |1843|1843| { |1844|1844| // Give up | | [NORMAL] ESLintBear (curly): | | Unnecessary { after 'else'. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js |1840|1840| this.SetNextState("APPROACHING"); |1841|1841| } |1842|1842| else |1843| |- { | |1843|+ |1844|1844| // Give up |1845|1845| this.FinishOrder(); |1846| |- } | |1846|+ |1847|1847| } |1848|1848| }, |1849|1849| }, | | [NORMAL] ESLintBear (curly): | | Unnecessary { after 'if' condition. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js |1861|1861| } |1862|1862| // Check the target is still alive and attackable |1863|1863| if (this.CanAttack(target) && !this.CheckTargetAttackRange(target, this.order.data.attackType)) |1864| |- { | |1864|+ |1865|1865| // Can't reach it - try to chase after it |1866|1866| if (this.ShouldChaseTargetedEntity(target, this.order.data.force)) |1867|1867| { |1871|1871| return; |1872|1872| } |1873|1873| } |1874| |- } | |1874|+ |1875|1875| |1876|1876| var cmpAttack = Engine.QueryInterface(this.entity, IID_Attack); |1877|1877| this.attackTimers = cmpAttack.GetTimers(this.order.data.attackType); | | [NORMAL] ESLintBear (curly): | | Unnecessary { after 'if' condition. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js |1864|1864| { |1865|1865| // Can't reach it - try to chase after it |1866|1866| if (this.ShouldChaseTargetedEntity(target, this.order.data.force)) |1867| |- { | |1867|+ |1868|1868| if (this.MoveToTargetAttackRange(target, this.order.data.attackType)) |1869|1869| { |1870|1870| this.SetNextState("COMBAT.CHASING"); |1871|1871| return; |1872|1872| } |1873| |- } | |1873|+ |1874|1874| } |1875|1875| |1876|1876| var cmpAttack = Engine.QueryInterface(this.entity, IID_Attack); | | [NORMAL] ESLintBear (no-unneeded-ternary): | | Unnecessary use of boolean literals in conditional expression. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js |1901|1901| // TODO: we should probably only bother syncing projectile attacks, not melee |1902|1902| |1903|1903| // If using a non-default prepare time, re-sync the animation when the timer runs. |1904| |- this.resyncAnimation = (prepare != this.attackTimers.prepare) ? true : false; | |1904|+ this.resyncAnimation = (prepare != this.attackTimers.prepare); |1905|1905| |1906|1906| this.FaceTowardsTarget(this.order.data.target); |1907|1907| | | [NORMAL] ESLintBear (curly): | | Unnecessary { after 'if' condition. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js |1975|1975| |1976|1976| // Can't reach it - try to chase after it |1977|1977| if (this.ShouldChaseTargetedEntity(target, this.order.data.force)) |1978| |- { | |1978|+ |1979|1979| if (this.MoveToTargetRange(target, IID_Attack, this.order.data.attackType)) |1980|1980| { |1981|1981| this.SetNextState("COMBAT.CHASING"); |1982|1982| return; |1983|1983| } |1984| |- } | |1984|+ |1985|1985| } |1986|1986| |1987|1987| // if we're targetting a formation, find a new member of that formation | | [NORMAL] ESLintBear (operator-linebreak): | | '&&' should be placed at the end of the line. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js |2022|2022| |2023|2023| "Attacked": function(msg) { |2024|2024| // If we are capturing and are attacked by something that we would not capture, attack that entity instead |2025| |- if (this.order.data.attackType == "Capture" && (this.GetStance().targetAttackersAlways || !this.order.data.force) |2026| |- && this.order.data.target != msg.data.attacker && this.GetBestAttackAgainst(msg.data.attacker, true) != "Capture") | |2025|+ if (this.order.data.attackType == "Capture" && (this.GetStance().targetAttackersAlways || !this.order.data.force) && | |2026|+ this.order.data.target != msg.data.attacker && this.GetBestAttackAgainst(msg.data.attacker, true) != "Capture") |2027|2027| this.RespondToTargetedEntities([msg.data.attacker]); |2028|2028| }, |2029|2029| }, | | [NORMAL] ESLintBear (space-before-function-paren): | | Unexpected space before function parentheses. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js |2029|2029| }, |2030|2030| |2031|2031| "CHASING": { |2032| |- "enter": function () { | |2032|+ "enter": function() { |2033|2033| // Show weapons rather than carried resources. |2034|2034| this.SetAnimationVariant("combat"); |2035|2035| | | [NORMAL] ESLintBear (space-before-function-paren): | | Unexpected space before function parentheses. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js |2104|2104| |2105|2105| // Try to find another nearby target of the same specific type |2106|2106| // Also don't switch to a different type of huntable animal |2107| |- var nearby = this.FindNearbyResource(function (ent, type, template) { | |2107|+ var nearby = this.FindNearbyResource(function(ent, type, template) { |2108|2108| return ( |2109|2109| ent != oldTarget |2110|2110| && ((type.generic == "treasure" && oldType.generic == "treasure") | | [NORMAL] ESLintBear (operator-linebreak): | | '&&' should be placed at the end of the line. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js |2106|2106| // Also don't switch to a different type of huntable animal |2107|2107| var nearby = this.FindNearbyResource(function (ent, type, template) { |2108|2108| return ( |2109| |- ent != oldTarget |2110| |- && ((type.generic == "treasure" && oldType.generic == "treasure") | |2109|+ ent != oldTarget && | |2110|+ ((type.generic == "treasure" && oldType.generic == "treasure") |2111|2111| || (type.specific == oldType.specific |2112|2112| && (type.specific != "meat" || oldTemplate == template))) |2113|2113| ); | | [NORMAL] ESLintBear (operator-linebreak): | | '||' should be placed at the end of the line. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js |2107|2107| var nearby = this.FindNearbyResource(function (ent, type, template) { |2108|2108| return ( |2109|2109| ent != oldTarget |2110| |- && ((type.generic == "treasure" && oldType.generic == "treasure") |2111| |- || (type.specific == oldType.specific | |2110|+ && ((type.generic == "treasure" && oldType.generic == "treasure") || | |2111|+ (type.specific == oldType.specific |2112|2112| && (type.specific != "meat" || oldTemplate == template))) |2113|2113| ); |2114|2114| }, oldTarget); | | [NORMAL] ESLintBear (operator-linebreak): | | '&&' should be placed at the end of the line. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js |2108|2108| return ( |2109|2109| ent != oldTarget |2110|2110| && ((type.generic == "treasure" && oldType.generic == "treasure") |2111| |- || (type.specific == oldType.specific |2112| |- && (type.specific != "meat" || oldTemplate == template))) | |2111|+ || (type.specific == oldType.specific && | |2112|+ (type.specific != "meat" || oldTemplate == template))) |2113|2113| ); |2114|2114| }, oldTarget); |2115|2115| if (nearby) | | [NORMAL] ESLintBear (no-else-return): | | Unnecessary 'else' after 'return'. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js |2117|2117| this.PerformGather(nearby, false, false); |2118|2118| return true; |2119|2119| } |2120| |- else |2121| |- { | |2120|+ |2122|2121| // It's probably better in this case, to avoid units getting stuck around a dropsite |2123|2122| // in a "Target is far away, full, nearby are no good resources, return to dropsite" loop |2124|2123| // to order it to GatherNear the resource position. |2139|2138| return true; |2140|2139| } |2141|2140| } |2142| |- } | |2141|+ |2143|2142| return true; |2144|2143| } |2145|2144| return false; | | [NORMAL] ESLintBear (no-else-return): | | Unnecessary 'else' after 'return'. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js |2129|2129| this.GatherNearPosition(pos.x, pos.z, oldType, oldTemplate); |2130|2130| return true; |2131|2131| } |2132| |- else |2133| |- { | |2132|+ |2134|2133| // we're kind of stuck here. Return resource. |2135|2134| var nearby = this.FindNearestDropsite(oldType.generic); |2136|2135| if (nearby) |2138|2137| this.PushOrderFront("ReturnResource", { "target": nearby, "force": false }); |2139|2138| return true; |2140|2139| } |2141| |- } | |2140|+ |2142|2141| } |2143|2142| return true; |2144|2143| } | | [NORMAL] ESLintBear (space-before-function-paren): | | Unexpected space before function parentheses. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js |2169|2169| |2170|2170| // Try to find another nearby target of the same specific type |2171|2171| // Also don't switch to a different type of huntable animal |2172| |- var nearby = this.FindNearbyResource(function (ent, type, template) { | |2172|+ var nearby = this.FindNearbyResource(function(ent, type, template) { |2173|2173| return ( |2174|2174| ent != oldTarget |2175|2175| && ((type.generic == "treasure" && oldType.generic == "treasure") | | [NORMAL] ESLintBear (operator-linebreak): | | '&&' should be placed at the end of the line. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js |2171|2171| // Also don't switch to a different type of huntable animal |2172|2172| var nearby = this.FindNearbyResource(function (ent, type, template) { |2173|2173| return ( |2174| |- ent != oldTarget |2175| |- && ((type.generic == "treasure" && oldType.generic == "treasure") | |2174|+ ent != oldTarget && | |2175|+ ((type.generic == "treasure" && oldType.generic == "treasure") |2176|2176| || (type.specific == oldType.specific |2177|2177| && (type.specific != "meat" || oldTemplate == template))) |2178|2178| ); | | [NORMAL] ESLintBear (operator-linebreak): | | '||' should be placed at the end of the line. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js |2172|2172| var nearby = this.FindNearbyResource(function (ent, type, template) { |2173|2173| return ( |2174|2174| ent != oldTarget |2175| |- && ((type.generic == "treasure" && oldType.generic == "treasure") |2176| |- || (type.specific == oldType.specific | |2175|+ && ((type.generic == "treasure" && oldType.generic == "treasure") || | |2176|+ (type.specific == oldType.specific |2177|2177| && (type.specific != "meat" || oldTemplate == template))) |2178|2178| ); |2179|2179| }); | | [NORMAL] ESLintBear (operator-linebreak): | | '&&' should be placed at the end of the line. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js |2173|2173| return ( |2174|2174| ent != oldTarget |2175|2175| && ((type.generic == "treasure" && oldType.generic == "treasure") |2176| |- || (type.specific == oldType.specific |2177| |- && (type.specific != "meat" || oldTemplate == template))) | |2176|+ || (type.specific == oldType.specific && | |2177|+ (type.specific != "meat" || oldTemplate == template))) |2178|2178| ); |2179|2179| }); |2180|2180| if (nearby) | | [NORMAL] ESLintBear (space-before-function-paren): | | Unexpected space before function parentheses. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js |2215|2215| |2216|2216| // Try to find another nearby target of the same specific type |2217|2217| // Also don't switch to a different type of huntable animal |2218| |- var nearby = this.FindNearbyResource(function (ent, type, template) { | |2218|+ var nearby = this.FindNearbyResource(function(ent, type, template) { |2219|2219| return ( |2220|2220| (type.generic == "treasure" && resourceType.generic == "treasure") |2221|2221| || (type.specific == resourceType.specific | | [NORMAL] ESLintBear (operator-linebreak): | | '||' should be placed at the end of the line. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js |2217|2217| // Also don't switch to a different type of huntable animal |2218|2218| var nearby = this.FindNearbyResource(function (ent, type, template) { |2219|2219| return ( |2220| |- (type.generic == "treasure" && resourceType.generic == "treasure") |2221| |- || (type.specific == resourceType.specific | |2220|+ (type.generic == "treasure" && resourceType.generic == "treasure") || | |2221|+ (type.specific == resourceType.specific |2222|2222| && (type.specific != "meat" || resourceTemplate == template)) |2223|2223| ); |2224|2224| }); | | [NORMAL] ESLintBear (operator-linebreak): | | '&&' should be placed at the end of the line. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js |2218|2218| var nearby = this.FindNearbyResource(function (ent, type, template) { |2219|2219| return ( |2220|2220| (type.generic == "treasure" && resourceType.generic == "treasure") |2221| |- || (type.specific == resourceType.specific |2222| |- && (type.specific != "meat" || resourceTemplate == template)) | |2221|+ || (type.specific == resourceType.specific && | |2222|+ (type.specific != "meat" || resourceTemplate == template)) |2223|2223| ); |2224|2224| }); |2225|2225| | | [NORMAL] ESLintBear (curly): | | Unnecessary { after 'if' condition. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js |2334|2334| |2335|2335| var cmpSupply = Engine.QueryInterface(this.gatheringTarget, IID_ResourceSupply); |2336|2336| if (cmpSupply && cmpSupply.IsAvailable(cmpOwnership.GetOwner(), this.entity)) |2337| |- { | |2337|+ |2338|2338| // Check we can still reach and gather from the target |2339|2339| if (this.CheckTargetRange(this.gatheringTarget, IID_ResourceGatherer) && this.CanGather(this.gatheringTarget)) |2340|2340| { |2400|2400| return; |2401|2401| } |2402|2402| } |2403| |- } | |2403|+ |2404|2404| |2405|2405| // We're already in range, can't get anywhere near it or the target is exhausted. |2406|2406| | | [NORMAL] ESLintBear (space-before-function-paren): | | Unexpected space before function parentheses. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js |2424|2424| |2425|2425| // Try to find a new resource of the same specific type near our current position: |2426|2426| // Also don't switch to a different type of huntable animal |2427| |- var nearby = this.FindNearbyResource(function (ent, type, template) { | |2427|+ var nearby = this.FindNearbyResource(function(ent, type, template) { |2428|2428| return ( |2429|2429| (type.generic == "treasure" && resourceType.generic == "treasure") |2430|2430| || (type.specific == resourceType.specific | | [NORMAL] ESLintBear (operator-linebreak): | | '||' should be placed at the end of the line. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js |2426|2426| // Also don't switch to a different type of huntable animal |2427|2427| var nearby = this.FindNearbyResource(function (ent, type, template) { |2428|2428| return ( |2429| |- (type.generic == "treasure" && resourceType.generic == "treasure") |2430| |- || (type.specific == resourceType.specific | |2429|+ (type.generic == "treasure" && resourceType.generic == "treasure") || | |2430|+ (type.specific == resourceType.specific |2431|2431| && (type.specific != "meat" || resourceTemplate == template)) |2432|2432| ); |2433|2433| }); | | [NORMAL] ESLintBear (operator-linebreak): | | '&&' should be placed at the end of the line. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js |2427|2427| var nearby = this.FindNearbyResource(function (ent, type, template) { |2428|2428| return ( |2429|2429| (type.generic == "treasure" && resourceType.generic == "treasure") |2430| |- || (type.specific == resourceType.specific |2431| |- && (type.specific != "meat" || resourceTemplate == template)) | |2430|+ || (type.specific == resourceType.specific && | |2431|+ (type.specific != "meat" || resourceTemplate == template)) |2432|2432| ); |2433|2433| }); |2434|2434| if (nearby) | | [NORMAL] ESLintBear (space-before-function-paren): | | Unexpected space before function parentheses. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js |2468|2468| }, |2469|2469| |2470|2470| "APPROACHING": { |2471| |- "enter": function () { | |2471|+ "enter": function() { |2472|2472| this.SelectAnimation("move"); |2473|2473| this.StartTimer(1000, 1000); |2474|2474| }, | | [NORMAL] ESLintBear (no-unneeded-ternary): | | Unnecessary use of boolean literals in conditional expression. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js |2514|2514| this.StartTimer(prepare, this.healTimers.repeat); |2515|2515| |2516|2516| // If using a non-default prepare time, re-sync the animation when the timer runs. |2517| |- this.resyncAnimation = (prepare != this.healTimers.prepare) ? true : false; | |2517|+ this.resyncAnimation = (prepare != this.healTimers.prepare); |2518|2518| |2519|2519| this.FaceTowardsTarget(this.order.data.target); |2520|2520| }, | | [NORMAL] ESLintBear (curly): | | Unnecessary { after 'if' condition. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js |2547|2547| } |2548|2548| // Can't reach it - try to chase after it |2549|2549| if (this.ShouldChaseTargetedEntity(target, this.order.data.force)) |2550| |- { | |2550|+ |2551|2551| if (this.MoveToTargetRange(target, IID_Heal)) |2552|2552| { |2553|2553| this.SetNextState("HEAL.CHASING"); |2554|2554| return; |2555|2555| } |2556| |- } | |2556|+ |2557|2557| } |2558|2558| // Can't reach it, healed to max hp or doesn't exist any more - give up |2559|2559| if (this.FinishOrder()) | | [NORMAL] ESLintBear (space-before-function-paren): | | Unexpected space before function parentheses. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js |2569|2569| }, |2570|2570| }, |2571|2571| "CHASING": { |2572| |- "enter": function () { | |2572|+ "enter": function() { |2573|2573| this.SelectAnimation("move"); |2574|2574| this.StartTimer(1000, 1000); |2575|2575| }, | | [NORMAL] ESLintBear (space-before-function-paren): | | Unexpected space before function parentheses. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js |2574|2574| this.StartTimer(1000, 1000); |2575|2575| }, |2576|2576| |2577| |- "leave": function () { | |2577|+ "leave": function() { |2578|2578| this.StopTimer(); |2579|2579| }, |2580|2580| "Timer": function(msg) { | | [NORMAL] ESLintBear (space-before-function-paren): | | Unexpected space before function parentheses. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js |2588|2588| this.WalkToHeldPosition(); |2589|2589| } |2590|2590| }, |2591| |- "MoveCompleted": function () { | |2591|+ "MoveCompleted": function() { |2592|2592| this.SetNextState("HEALING"); |2593|2593| }, |2594|2594| }, | | [NORMAL] ESLintBear (space-before-function-paren): | | Unexpected space before function parentheses. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js |2597|2597| // Returning to dropsite |2598|2598| "RETURNRESOURCE": { |2599|2599| "APPROACHING": { |2600| |- "enter": function () { | |2600|+ "enter": function() { |2601|2601| this.SelectAnimation("move"); |2602|2602| }, |2603|2603| | | [NORMAL] ESLintBear (space-before-function-paren): | | Unexpected space before function parentheses. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js |2655|2655| }, |2656|2656| |2657|2657| "APPROACHINGMARKET": { |2658| |- "enter": function () { | |2658|+ "enter": function() { |2659|2659| this.SelectAnimation("move"); |2660|2660| }, |2661|2661| | | [NORMAL] ESLintBear (space-before-function-paren): | | Unexpected space before function parentheses. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js |2683|2683| |2684|2684| "REPAIR": { |2685|2685| "APPROACHING": { |2686| |- "enter": function () { | |2686|+ "enter": function() { |2687|2687| this.SelectAnimation("move"); |2688|2688| }, |2689|2689| | | [NORMAL] ESLintBear (object-curly-spacing): | | A space is required after '{'. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js |2724|2724| { |2725|2725| // The building was already finished/fully repaired before we arrived; |2726|2726| // let the ConstructionFinished handler handle this. |2727| |- this.OnGlobalConstructionFinished({"entity": this.repairTarget, "newentity": this.repairTarget}); | |2727|+ this.OnGlobalConstructionFinished({ "entity": this.repairTarget, "newentity": this.repairTarget}); |2728|2728| return true; |2729|2729| } |2730|2730| | | [NORMAL] ESLintBear (object-curly-spacing): | | A space is required before '}'. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js |2724|2724| { |2725|2725| // The building was already finished/fully repaired before we arrived; |2726|2726| // let the ConstructionFinished handler handle this. |2727| |- this.OnGlobalConstructionFinished({"entity": this.repairTarget, "newentity": this.repairTarget}); | |2727|+ this.OnGlobalConstructionFinished({"entity": this.repairTarget, "newentity": this.repairTarget }); |2728|2728| return true; |2729|2729| } |2730|2730| | | [NORMAL] ESLintBear (spaced-comment): | | Expected space or tab after '//' in comment. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js |2764|2764| if (this.MoveToTargetRange(this.repairTarget, IID_Builder)) |2765|2765| this.SetNextState("APPROACHING"); |2766|2766| else if (!this.CheckTargetRange(this.repairTarget, IID_Builder)) |2767| |- this.FinishOrder(); //can't approach and isn't in reach | |2767|+ this.FinishOrder(); // can't approach and isn't in reach |2768|2768| }, |2769|2769| }, |2770|2770| | | [NORMAL] ESLintBear (space-before-function-paren): | | Unexpected space before function parentheses. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js |2831|2831| var types = cmpResourceDropsite.GetTypes(); |2832|2832| // TODO: Slightly undefined behavior here, we don't know what type of resource will be collected, |2833|2833| // may cause problems for AIs (especially hunting fast animals), but avoid ugly hacks to fix that! |2834| |- var nearby = this.FindNearbyResource(function (ent, type, template) { | |2834|+ var nearby = this.FindNearbyResource(function(ent, type, template) { |2835|2835| return (types.indexOf(type.generic) != -1); |2836|2836| }, msg.data.newentity); |2837|2837| if (nearby) | | [NORMAL] ESLintBear (curly): | | Unnecessary { after 'if' condition. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js |2851|2851| |2852|2852| // Unit was approaching and there's nothing to do now, so switch to walking |2853|2853| if (oldState === "INDIVIDUAL.REPAIR.APPROACHING") |2854| |- { | |2854|+ |2855|2855| // We're already walking to the given point, so add this as a order. |2856|2856| this.WalkToTarget(msg.data.newentity, true); |2857| |- } | |2857|+ |2858|2858| }, |2859|2859| }, |2860|2860| | | [NORMAL] ESLintBear (curly): | | Unnecessary { after 'if' condition. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js |2901|2901| |2902|2902| // Check that we can garrison here |2903|2903| if (this.CanGarrison(target)) |2904| |- { | |2904|+ |2905|2905| // Check that we're in range of the garrison target |2906|2906| if (this.CheckGarrisonRange(target)) |2907|2907| { |2977|2977| return false; |2978|2978| } |2979|2979| } |2980| |- } | |2980|+ |2981|2981| // Garrisoning failed for some reason, so finish the order |2982|2982| this.FinishOrder(); |2983|2983| return true; | | [NORMAL] ESLintBear (curly): | | Unnecessary { after 'if' condition. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js |3094|3094| "Attacked": function(msg) { |3095|3095| if (this.template.NaturalBehaviour == "skittish" || |3096|3096| this.template.NaturalBehaviour == "passive") |3097| |- { | |3097|+ |3098|3098| this.Flee(msg.data.attacker, false); |3099| |- } | |3099|+ |3100|3100| else if (this.IsDangerousAnimal() || this.template.NaturalBehaviour == "defensive") |3101|3101| { |3102|3102| if (this.CanAttack(msg.data.attacker)) | | [NORMAL] ESLintBear (curly): | | Unnecessary { after 'if' condition. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js |3103|3103| this.Attack(msg.data.attacker, false); |3104|3104| } |3105|3105| else if (this.template.NaturalBehaviour == "domestic") |3106| |- { | |3106|+ |3107|3107| // Never flee, stop what we were doing |3108|3108| this.SetNextState("IDLE"); |3109| |- } | |3109|+ |3110|3110| }, |3111|3111| |3112|3112| "Order.LeaveFoundation": function(msg) { | | [NORMAL] ESLintBear (curly): | | Unnecessary { after 'if' condition. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js |3113|3113| // Move a tile outside the building |3114|3114| var range = 4; |3115|3115| if (this.MoveToTargetRangeExplicit(msg.data.target, range, range)) |3116| |- { | |3116|+ |3117|3117| // We've started walking to the given point |3118|3118| this.SetNextState("WALKING"); |3119| |- } | |3119|+ |3120|3120| else |3121|3121| { |3122|3122| // We are already at the target, or can't move at all | | [NORMAL] ESLintBear (curly): | | Unnecessary { after 'else'. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js |3118|3118| this.SetNextState("WALKING"); |3119|3119| } |3120|3120| else |3121| |- { | |3121|+ |3122|3122| // We are already at the target, or can't move at all |3123|3123| this.FinishOrder(); |3124| |- } | |3124|+ |3125|3125| }, |3126|3126| |3127|3127| "IDLE": { | | [NORMAL] ESLintBear (curly): | | Unnecessary { after 'if' condition. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js |3160|3160| } |3161|3161| // Start attacking one of the newly-seen enemy (if any) |3162|3162| else if (this.IsDangerousAnimal()) |3163| |- { | |3163|+ |3164|3164| this.AttackVisibleEntity(msg.data.added); |3165| |- } | |3165|+ |3166|3166| |3167|3167| // TODO: if two units enter our range together, we'll attack the |3168|3168| // first and then the second won't trigger another LosRangeUpdate | | [NORMAL] ESLintBear (curly): | | Unnecessary { after 'if' condition. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js |3203|3203| } |3204|3204| // Start attacking one of the newly-seen enemy (if any) |3205|3205| else if (this.template.NaturalBehaviour == "violent") |3206| |- { | |3206|+ |3207|3207| this.AttackVisibleEntity(msg.data.added); |3208| |- } | |3208|+ |3209|3209| }, |3210|3210| |3211|3211| "MoveCompleted": function() { }, | | [NORMAL] ESLintBear (indent): | | Expected indentation of 2 tabs but found 7. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js |3220|3220| "COMBAT": "INDIVIDUAL.COMBAT", // reuse the same combat behaviour for animals |3221|3221| |3222|3222| "WALKING": "INDIVIDUAL.WALKING", // reuse the same walking behaviour for animals |3223| |- // only used for domestic animals | |3223|+ // only used for domestic animals |3224|3224| }, |3225|3225| }; |3226|3226| | | [NORMAL] ESLintBear (no-unneeded-ternary): | | Unnecessary use of boolean literals in conditional expression. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js |3282|3282| |3283|3283| UnitAI.prototype.IsAnimal = function() |3284|3284| { |3285| |- return (this.template.NaturalBehaviour ? true : false); | |3285|+ return (!!this.template.NaturalBehaviour); |3286|3286| }; |3287|3287| |3288|3288| UnitAI.prototype.IsDangerousAnimal = function() | | [NORMAL] ESLintBear (curly): | | Unnecessary { after 'if' condition. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js |3320|3320| UnitAI.prototype.GetGarrisonHolder = function() |3321|3321| { |3322|3322| if (this.IsGarrisoned()) |3323| |- { | |3323|+ |3324|3324| for (let order of this.orderQueue) |3325|3325| if (order.type == "Garrison" || order.type == "Autogarrison") |3326|3326| return order.data.target; |3327| |- } | |3327|+ |3328|3328| return INVALID_ENTITY; |3329|3329| }; |3330|3330| | | [NORMAL] ESLintBear (comma-spacing): | | A space is required after ','. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js |3401|3401| { |3402|3402| let index = this.GetCurrentState().indexOf("."); |3403|3403| if (index != -1) |3404| |- this.UnitFsm.SwitchToNextState(this, this.GetCurrentState().slice(0,index)); | |3404|+ this.UnitFsm.SwitchToNextState(this, this.GetCurrentState().slice(0, index)); |3405|3405| this.Stop(false); |3406|3406| } |3407|3407| | | [NORMAL] ESLintBear (object-curly-spacing): | | A space is required after '{'. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js |3457|3457| if (this.orderQueue[i].type != "PickupUnit" || this.orderQueue[i].data.target != msg.entity) |3458|3458| continue; |3459|3459| if (i == 0) |3460| |- this.UnitFsm.ProcessMessage(this, {"type": "PickupCanceled", "data": msg}); | |3460|+ this.UnitFsm.ProcessMessage(this, { "type": "PickupCanceled", "data": msg}); |3461|3461| else |3462|3462| this.orderQueue.splice(i, 1); |3463|3463| Engine.PostMessage(this.entity, MT_UnitAIOrderDataChanged, { "to": this.GetOrderData() }); | | [NORMAL] ESLintBear (object-curly-spacing): | | A space is required before '}'. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js |3457|3457| if (this.orderQueue[i].type != "PickupUnit" || this.orderQueue[i].data.target != msg.entity) |3458|3458| continue; |3459|3459| if (i == 0) |3460| |- this.UnitFsm.ProcessMessage(this, {"type": "PickupCanceled", "data": msg}); | |3460|+ this.UnitFsm.ProcessMessage(this, {"type": "PickupCanceled", "data": msg }); |3461|3461| else |3462|3462| this.orderQueue.splice(i, 1); |3463|3463| Engine.PostMessage(this.entity, MT_UnitAIOrderDataChanged, { "to": this.GetOrderData() }); | | [NORMAL] ESLintBear (spaced-comment): | | Expected space or tab after '//' in comment. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js |3541|3541| }; |3542|3542| |3543|3543| |3544| |-//// FSM linkage functions //// | |3544|+// // FSM linkage functions //// |3545|3545| |3546|3546| UnitAI.prototype.SetNextState = function(state) |3547|3547| { | | [NORMAL] ESLintBear (object-curly-spacing): | | A space is required after '{'. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js |3592|3592| if (this.orderQueue.length) |3593|3593| { |3594|3594| let ret = this.UnitFsm.ProcessMessage(this, |3595| |- {"type": "Order."+this.order.type, "data": this.order.data} | |3595|+ { "type": "Order."+this.order.type, "data": this.order.data} |3596|3596| ); |3597|3597| |3598|3598| Engine.PostMessage(this.entity, MT_UnitAIOrderDataChanged, { "to": this.GetOrderData() }); | | [NORMAL] ESLintBear (object-curly-spacing): | | A space is required before '}'. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js |3592|3592| if (this.orderQueue.length) |3593|3593| { |3594|3594| let ret = this.UnitFsm.ProcessMessage(this, |3595| |- {"type": "Order."+this.order.type, "data": this.order.data} | |3595|+ {"type": "Order."+this.order.type, "data": this.order.data } |3596|3596| ); |3597|3597| |3598|3598| Engine.PostMessage(this.entity, MT_UnitAIOrderDataChanged, { "to": this.GetOrderData() }); | | [NORMAL] ESLintBear (no-else-return): | | Unnecessary 'else' after 'return'. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js |3605|3605| // Otherwise we've successfully processed a new order |3606|3606| return true; |3607|3607| } |3608| |- else |3609| |- { | |3608|+ |3610|3609| this.SetNextState("IDLE"); |3611|3610| |3612|3611| Engine.PostMessage(this.entity, MT_UnitAIOrderDataChanged, { "to": this.GetOrderData() }); |3627|3626| } |3628|3627| |3629|3628| return false; |3630| |- } | |3629|+ |3631|3630| }; |3632|3631| |3633|3632| /** | | [NORMAL] ESLintBear (object-curly-spacing): | | A space is required after '{'. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js |3644|3644| { |3645|3645| this.order = order; |3646|3646| let ret = this.UnitFsm.ProcessMessage(this, |3647| |- {"type": "Order."+this.order.type, "data": this.order.data} | |3647|+ { "type": "Order."+this.order.type, "data": this.order.data} |3648|3648| ); |3649|3649| |3650|3650| // If the order was rejected then immediately take it off | | [NORMAL] ESLintBear (object-curly-spacing): | | A space is required before '}'. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js |3644|3644| { |3645|3645| this.order = order; |3646|3646| let ret = this.UnitFsm.ProcessMessage(this, |3647| |- {"type": "Order."+this.order.type, "data": this.order.data} | |3647|+ {"type": "Order."+this.order.type, "data": this.order.data } |3648|3648| ); |3649|3649| |3650|3650| // If the order was rejected then immediately take it off | | [NORMAL] ESLintBear (object-curly-spacing): | | A space is required after '{'. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js |3680|3680| this.orderQueue.unshift(order); |3681|3681| this.order = order; |3682|3682| let ret = this.UnitFsm.ProcessMessage(this, |3683| |- {"type": "Order."+this.order.type, "data": this.order.data} | |3683|+ { "type": "Order."+this.order.type, "data": this.order.data} |3684|3684| ); |3685|3685| |3686|3686| // If the order was rejected then immediately take it off again; | | [NORMAL] ESLintBear (object-curly-spacing): | | A space is required before '}'. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js |3680|3680| this.orderQueue.unshift(order); |3681|3681| this.order = order; |3682|3682| let ret = this.UnitFsm.ProcessMessage(this, |3683| |- {"type": "Order."+this.order.type, "data": this.order.data} | |3683|+ {"type": "Order."+this.order.type, "data": this.order.data } |3684|3684| ); |3685|3685| |3686|3686| // If the order was rejected then immediately take it off again; | | [NORMAL] ESLintBear (object-curly-spacing): | | A space is required after '{'. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js |3714|3714| continue; |3715|3715| if (this.orderQueue[i].type == type) |3716|3716| continue; |3717| |- this.orderQueue.splice(i, 0, {"type": type, "data": data}); | |3717|+ this.orderQueue.splice(i, 0, { "type": type, "data": data}); |3718|3718| Engine.PostMessage(this.entity, MT_UnitAIOrderDataChanged, { "to": this.GetOrderData() }); |3719|3719| return; |3720|3720| } | | [NORMAL] ESLintBear (object-curly-spacing): | | A space is required before '}'. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js |3714|3714| continue; |3715|3715| if (this.orderQueue[i].type == type) |3716|3716| continue; |3717| |- this.orderQueue.splice(i, 0, {"type": type, "data": data}); | |3717|+ this.orderQueue.splice(i, 0, {"type": type, "data": data }); |3718|3718| Engine.PostMessage(this.entity, MT_UnitAIOrderDataChanged, { "to": this.GetOrderData() }); |3719|3719| return; |3720|3720| } | | [NORMAL] ESLintBear (curly): | | Unnecessary { after 'if' condition. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js |3728|3728| { |3729|3729| // Remember the previous work orders to be able to go back to them later if required |3730|3730| if (data && data.force) |3731| |- { | |3731|+ |3732|3732| if (this.IsFormationController()) |3733|3733| this.CallMemberFunction("UpdateWorkOrders", [type]); |3734|3734| else |3735|3735| this.UpdateWorkOrders(type); |3736| |- } | |3736|+ |3737|3737| |3738|3738| let garrisonHolder = this.IsGarrisoned() && type != "Ungarrison" ? this.GetGarrisonHolder() : null; |3739|3739| | | [NORMAL] ESLintBear (curly): | | Unnecessary { after 'if' condition. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js |3805|3805| { |3806|3806| var cmpUnitAI = Engine.QueryInterface(this.formationController, IID_UnitAI); |3807|3807| if (cmpUnitAI) |3808| |- { | |3808|+ |3809|3809| for (var i = 0; i < cmpUnitAI.orderQueue.length; ++i) |3810|3810| { |3811|3811| if (isWorkType(cmpUnitAI.orderQueue[i].type)) |3814|3814| return; |3815|3815| } |3816|3816| } |3817| |- } | |3817|+ |3818|3818| } |3819|3819| |3820|3820| // If nothing found, take the unit orders | | [NORMAL] ESLintBear (curly): | | Unnecessary { after 'for' condition. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js |3807|3807| if (cmpUnitAI) |3808|3808| { |3809|3809| for (var i = 0; i < cmpUnitAI.orderQueue.length; ++i) |3810| |- { | |3810|+ |3811|3811| if (isWorkType(cmpUnitAI.orderQueue[i].type)) |3812|3812| { |3813|3813| this.workOrders = cmpUnitAI.orderQueue.slice(i); |3814|3814| return; |3815|3815| } |3816| |- } | |3816|+ |3817|3817| } |3818|3818| } |3819|3819| | | [NORMAL] ESLintBear (curly): | | Unnecessary { after 'for' condition. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js |3819|3819| |3820|3820| // If nothing found, take the unit orders |3821|3821| for (var i = 0; i < this.orderQueue.length; ++i) |3822| |- { | |3822|+ |3823|3823| if (isWorkType(this.orderQueue[i].type)) |3824|3824| { |3825|3825| this.workOrders = this.orderQueue.slice(i); |3826|3826| return; |3827|3827| } |3828| |- } | |3828|+ |3829|3829| }; |3830|3830| |3831|3831| UnitAI.prototype.BackToWork = function() | | [NORMAL] ESLintBear (object-curly-spacing): | | A space is required after '{'. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js |3885|3885| if (data.timerRepeat === undefined) |3886|3886| this.timer = undefined; |3887|3887| |3888| |- this.UnitFsm.ProcessMessage(this, {"type": "Timer", "data": data, "lateness": lateness}); | |3888|+ this.UnitFsm.ProcessMessage(this, { "type": "Timer", "data": data, "lateness": lateness}); |3889|3889| }; |3890|3890| |3891|3891| /** | | [NORMAL] ESLintBear (object-curly-spacing): | | A space is required before '}'. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js |3885|3885| if (data.timerRepeat === undefined) |3886|3886| this.timer = undefined; |3887|3887| |3888| |- this.UnitFsm.ProcessMessage(this, {"type": "Timer", "data": data, "lateness": lateness}); | |3888|+ this.UnitFsm.ProcessMessage(this, {"type": "Timer", "data": data, "lateness": lateness }); |3889|3889| }; |3890|3890| |3891|3891| /** | | [NORMAL] ESLintBear (spaced-comment): | | Expected space or tab after '//' in comment. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js |3920|3920| this.timer = undefined; |3921|3921| }; |3922|3922| |3923| |-//// Message handlers ///// | |3923|+// // Message handlers ///// |3924|3924| |3925|3925| UnitAI.prototype.OnMotionChanged = function(msg) |3926|3926| { | | [NORMAL] ESLintBear (object-curly-spacing): | | A space is required after '{'. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js |3925|3925| UnitAI.prototype.OnMotionChanged = function(msg) |3926|3926| { |3927|3927| if (msg.starting && !msg.error) |3928| |- this.UnitFsm.ProcessMessage(this, {"type": "MoveStarted", "data": msg}); | |3928|+ this.UnitFsm.ProcessMessage(this, { "type": "MoveStarted", "data": msg}); |3929|3929| else if (!msg.starting || msg.error) |3930|3930| this.UnitFsm.ProcessMessage(this, {"type": "MoveCompleted", "data": msg}); |3931|3931| }; | | [NORMAL] ESLintBear (object-curly-spacing): | | A space is required before '}'. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js |3925|3925| UnitAI.prototype.OnMotionChanged = function(msg) |3926|3926| { |3927|3927| if (msg.starting && !msg.error) |3928| |- this.UnitFsm.ProcessMessage(this, {"type": "MoveStarted", "data": msg}); | |3928|+ this.UnitFsm.ProcessMessage(this, {"type": "MoveStarted", "data": msg }); |3929|3929| else if (!msg.starting || msg.error) |3930|3930| this.UnitFsm.ProcessMessage(this, {"type": "MoveCompleted", "data": msg}); |3931|3931| }; | | [NORMAL] ESLintBear (object-curly-spacing): | | A space is required after '{'. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js |3927|3927| if (msg.starting && !msg.error) |3928|3928| this.UnitFsm.ProcessMessage(this, {"type": "MoveStarted", "data": msg}); |3929|3929| else if (!msg.starting || msg.error) |3930| |- this.UnitFsm.ProcessMessage(this, {"type": "MoveCompleted", "data": msg}); | |3930|+ this.UnitFsm.ProcessMessage(this, { "type": "MoveCompleted", "data": msg}); |3931|3931| }; |3932|3932| |3933|3933| UnitAI.prototype.OnGlobalConstructionFinished = function(msg) | | [NORMAL] ESLintBear (object-curly-spacing): | | A space is required before '}'. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js |3927|3927| if (msg.starting && !msg.error) |3928|3928| this.UnitFsm.ProcessMessage(this, {"type": "MoveStarted", "data": msg}); |3929|3929| else if (!msg.starting || msg.error) |3930| |- this.UnitFsm.ProcessMessage(this, {"type": "MoveCompleted", "data": msg}); | |3930|+ this.UnitFsm.ProcessMessage(this, {"type": "MoveCompleted", "data": msg }); |3931|3931| }; |3932|3932| |3933|3933| UnitAI.prototype.OnGlobalConstructionFinished = function(msg) | | [NORMAL] ESLintBear (object-curly-spacing): | | A space is required after '{'. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js |3935|3935| // TODO: This is a bit inefficient since every unit listens to every |3936|3936| // construction message - ideally we could scope it to only the one we're building |3937|3937| |3938| |- this.UnitFsm.ProcessMessage(this, {"type": "ConstructionFinished", "data": msg}); | |3938|+ this.UnitFsm.ProcessMessage(this, { "type": "ConstructionFinished", "data": msg}); |3939|3939| }; |3940|3940| |3941|3941| UnitAI.prototype.OnGlobalEntityRenamed = function(msg) | | [NORMAL] ESLintBear (object-curly-spacing): | | A space is required before '}'. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js |3935|3935| // TODO: This is a bit inefficient since every unit listens to every |3936|3936| // construction message - ideally we could scope it to only the one we're building |3937|3937| |3938| |- this.UnitFsm.ProcessMessage(this, {"type": "ConstructionFinished", "data": msg}); | |3938|+ this.UnitFsm.ProcessMessage(this, {"type": "ConstructionFinished", "data": msg }); |3939|3939| }; |3940|3940| |3941|3941| UnitAI.prototype.OnGlobalEntityRenamed = function(msg) | | [NORMAL] ESLintBear (object-curly-spacing): | | A space is required after '{'. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js |3960|3960| |3961|3961| UnitAI.prototype.OnAttacked = function(msg) |3962|3962| { |3963| |- this.UnitFsm.ProcessMessage(this, {"type": "Attacked", "data": msg}); | |3963|+ this.UnitFsm.ProcessMessage(this, { "type": "Attacked", "data": msg}); |3964|3964| }; |3965|3965| |3966|3966| UnitAI.prototype.OnGuardedAttacked = function(msg) | | [NORMAL] ESLintBear (object-curly-spacing): | | A space is required before '}'. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js |3960|3960| |3961|3961| UnitAI.prototype.OnAttacked = function(msg) |3962|3962| { |3963| |- this.UnitFsm.ProcessMessage(this, {"type": "Attacked", "data": msg}); | |3963|+ this.UnitFsm.ProcessMessage(this, {"type": "Attacked", "data": msg }); |3964|3964| }; |3965|3965| |3966|3966| UnitAI.prototype.OnGuardedAttacked = function(msg) | | [NORMAL] ESLintBear (object-curly-spacing): | | A space is required after '{'. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js |3965|3965| |3966|3966| UnitAI.prototype.OnGuardedAttacked = function(msg) |3967|3967| { |3968| |- this.UnitFsm.ProcessMessage(this, {"type": "GuardedAttacked", "data": msg.data}); | |3968|+ this.UnitFsm.ProcessMessage(this, { "type": "GuardedAttacked", "data": msg.data}); |3969|3969| }; |3970|3970| |3971|3971| UnitAI.prototype.OnHealthChanged = function(msg) | | [NORMAL] ESLintBear (object-curly-spacing): | | A space is required before '}'. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js |3965|3965| |3966|3966| UnitAI.prototype.OnGuardedAttacked = function(msg) |3967|3967| { |3968| |- this.UnitFsm.ProcessMessage(this, {"type": "GuardedAttacked", "data": msg.data}); | |3968|+ this.UnitFsm.ProcessMessage(this, {"type": "GuardedAttacked", "data": msg.data }); |3969|3969| }; |3970|3970| |3971|3971| UnitAI.prototype.OnHealthChanged = function(msg) | | [NORMAL] ESLintBear (object-curly-spacing): | | A space is required after '{'. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js |3970|3970| |3971|3971| UnitAI.prototype.OnHealthChanged = function(msg) |3972|3972| { |3973| |- this.UnitFsm.ProcessMessage(this, {"type": "HealthChanged", "from": msg.from, "to": msg.to}); | |3973|+ this.UnitFsm.ProcessMessage(this, { "type": "HealthChanged", "from": msg.from, "to": msg.to}); |3974|3974| }; |3975|3975| |3976|3976| UnitAI.prototype.OnRangeUpdate = function(msg) | | [NORMAL] ESLintBear (object-curly-spacing): | | A space is required before '}'. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js |3970|3970| |3971|3971| UnitAI.prototype.OnHealthChanged = function(msg) |3972|3972| { |3973| |- this.UnitFsm.ProcessMessage(this, {"type": "HealthChanged", "from": msg.from, "to": msg.to}); | |3973|+ this.UnitFsm.ProcessMessage(this, {"type": "HealthChanged", "from": msg.from, "to": msg.to }); |3974|3974| }; |3975|3975| |3976|3976| UnitAI.prototype.OnRangeUpdate = function(msg) | | [NORMAL] ESLintBear (object-curly-spacing): | | A space is required after '{'. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js |3976|3976| UnitAI.prototype.OnRangeUpdate = function(msg) |3977|3977| { |3978|3978| if (msg.tag == this.losRangeQuery) |3979| |- this.UnitFsm.ProcessMessage(this, {"type": "LosRangeUpdate", "data": msg}); | |3979|+ this.UnitFsm.ProcessMessage(this, { "type": "LosRangeUpdate", "data": msg}); |3980|3980| else if (msg.tag == this.losHealRangeQuery) |3981|3981| this.UnitFsm.ProcessMessage(this, {"type": "LosHealRangeUpdate", "data": msg}); |3982|3982| }; | | [NORMAL] ESLintBear (object-curly-spacing): | | A space is required before '}'. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js |3976|3976| UnitAI.prototype.OnRangeUpdate = function(msg) |3977|3977| { |3978|3978| if (msg.tag == this.losRangeQuery) |3979| |- this.UnitFsm.ProcessMessage(this, {"type": "LosRangeUpdate", "data": msg}); | |3979|+ this.UnitFsm.ProcessMessage(this, {"type": "LosRangeUpdate", "data": msg }); |3980|3980| else if (msg.tag == this.losHealRangeQuery) |3981|3981| this.UnitFsm.ProcessMessage(this, {"type": "LosHealRangeUpdate", "data": msg}); |3982|3982| }; | | [NORMAL] ESLintBear (object-curly-spacing): | | A space is required after '{'. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js |3978|3978| if (msg.tag == this.losRangeQuery) |3979|3979| this.UnitFsm.ProcessMessage(this, {"type": "LosRangeUpdate", "data": msg}); |3980|3980| else if (msg.tag == this.losHealRangeQuery) |3981| |- this.UnitFsm.ProcessMessage(this, {"type": "LosHealRangeUpdate", "data": msg}); | |3981|+ this.UnitFsm.ProcessMessage(this, { "type": "LosHealRangeUpdate", "data": msg}); |3982|3982| }; |3983|3983| |3984|3984| UnitAI.prototype.OnPackFinished = function(msg) | | [NORMAL] ESLintBear (object-curly-spacing): | | A space is required before '}'. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js |3978|3978| if (msg.tag == this.losRangeQuery) |3979|3979| this.UnitFsm.ProcessMessage(this, {"type": "LosRangeUpdate", "data": msg}); |3980|3980| else if (msg.tag == this.losHealRangeQuery) |3981| |- this.UnitFsm.ProcessMessage(this, {"type": "LosHealRangeUpdate", "data": msg}); | |3981|+ this.UnitFsm.ProcessMessage(this, {"type": "LosHealRangeUpdate", "data": msg }); |3982|3982| }; |3983|3983| |3984|3984| UnitAI.prototype.OnPackFinished = function(msg) | | [NORMAL] ESLintBear (object-curly-spacing): | | A space is required after '{'. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js |3983|3983| |3984|3984| UnitAI.prototype.OnPackFinished = function(msg) |3985|3985| { |3986| |- this.UnitFsm.ProcessMessage(this, {"type": "PackFinished", "packed": msg.packed}); | |3986|+ this.UnitFsm.ProcessMessage(this, { "type": "PackFinished", "packed": msg.packed}); |3987|3987| }; |3988|3988| |3989|3989| //// Helper functions to be called by the FSM //// | | [NORMAL] ESLintBear (object-curly-spacing): | | A space is required before '}'. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js |3983|3983| |3984|3984| UnitAI.prototype.OnPackFinished = function(msg) |3985|3985| { |3986| |- this.UnitFsm.ProcessMessage(this, {"type": "PackFinished", "packed": msg.packed}); | |3986|+ this.UnitFsm.ProcessMessage(this, {"type": "PackFinished", "packed": msg.packed }); |3987|3987| }; |3988|3988| |3989|3989| //// Helper functions to be called by the FSM //// | | [NORMAL] ESLintBear (spaced-comment): | | Expected space or tab after '//' in comment. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js |3986|3986| this.UnitFsm.ProcessMessage(this, {"type": "PackFinished", "packed": msg.packed}); |3987|3987| }; |3988|3988| |3989| |-//// Helper functions to be called by the FSM //// | |3989|+// // Helper functions to be called by the FSM //// |3990|3990| |3991|3991| UnitAI.prototype.GetWalkSpeed = function() |3992|3992| { | | [NORMAL] ESLintBear (semi): | | Missing semicolon. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js |4090|4090| if (!cmpOwnership || cmpOwnership.GetOwner() == INVALID_PLAYER) |4091|4091| return undefined; |4092|4092| |4093| |- let cmpPosition = Engine.QueryInterface(this.entity, IID_Position) | |4093|+ let cmpPosition = Engine.QueryInterface(this.entity, IID_Position); |4094|4094| if (!cmpPosition) |4095|4095| return undefined; |4096|4096| | | [NORMAL] ESLintBear (curly): | | Unnecessary { after 'else'. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js |4175|4175| PlaySound(name, member); |4176|4176| } |4177|4177| else |4178| |- { | |4178|+ |4179|4179| // Otherwise use our own sounds |4180|4180| PlaySound(name, this.entity); |4181| |- } | |4181|+ |4182|4182| }; |4183|4183| |4184|4184| /* | | [NORMAL] ESLintBear (spaced-comment): | | Expected space or tab after '//' in comment. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js |4362|4362| else |4363|4363| // return false? Or hope you come close enough? |4364|4364| var parabolicMaxRange = 0; |4365| |- //return false; | |4365|+ // return false; |4366|4366| |4367|4367| // the parabole changes while walking, take something in the middle |4368|4368| var guessedMaxRange = (range.max + parabolicMaxRange)/2; | | [NORMAL] ESLintBear (operator-linebreak): | | '&&' should be placed at the end of the line. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js |4427|4427| if (this.IsFormationMember()) |4428|4428| { |4429|4429| var cmpFormationUnitAI = Engine.QueryInterface(this.formationController, IID_UnitAI); |4430| |- if (cmpFormationUnitAI && cmpFormationUnitAI.IsAttackingAsFormation() |4431| |- && cmpFormationUnitAI.order.data.target == target) | |4430|+ if (cmpFormationUnitAI && cmpFormationUnitAI.IsAttackingAsFormation() && | |4431|+ cmpFormationUnitAI.order.data.target == target) |4432|4432| return true; |4433|4433| } |4434|4434| | | [NORMAL] ESLintBear (object-curly-spacing): | | A space is required after '{'. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js |4547|4547| var pos = cmpPosition.GetPosition(); |4548|4548| var heldPosition = this.heldPosition; |4549|4549| if (heldPosition === undefined) |4550| |- heldPosition = {"x": pos.x, "z": pos.z}; | |4550|+ heldPosition = { "x": pos.x, "z": pos.z}; |4551|4551| |4552|4552| return Math.euclidDistance2D(pos.x, pos.z, heldPosition.x, heldPosition.z) < halfvision + range.max; |4553|4553| }; | | [NORMAL] ESLintBear (object-curly-spacing): | | A space is required before '}'. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js |4547|4547| var pos = cmpPosition.GetPosition(); |4548|4548| var heldPosition = this.heldPosition; |4549|4549| if (heldPosition === undefined) |4550| |- heldPosition = {"x": pos.x, "z": pos.z}; | |4550|+ heldPosition = {"x": pos.x, "z": pos.z }; |4551|4551| |4552|4552| return Math.euclidDistance2D(pos.x, pos.z, heldPosition.x, heldPosition.z) < halfvision + range.max; |4553|4553| }; | | [NORMAL] ESLintBear (operator-linebreak): | | '&&' should be placed at the end of the line. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js |4595|4595| UnitAI.prototype.AttackEntityInZone = function(ents) |4596|4596| { |4597|4597| var target = ents.find(target => |4598| |- this.CanAttack(target) |4599| |- && this.CheckTargetDistanceFromHeldPosition(target, IID_Attack, this.GetBestAttackAgainst(target, true)) | |4598|+ this.CanAttack(target) && | |4599|+ this.CheckTargetDistanceFromHeldPosition(target, IID_Attack, this.GetBestAttackAgainst(target, true)) |4600|4600| && (this.GetStance().respondChaseBeyondVision || this.CheckTargetIsInVisionRange(target)) |4601|4601| ); |4602|4602| if (!target) | | [NORMAL] ESLintBear (operator-linebreak): | | '&&' should be placed at the end of the line. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js |4596|4596| { |4597|4597| var target = ents.find(target => |4598|4598| this.CanAttack(target) |4599| |- && this.CheckTargetDistanceFromHeldPosition(target, IID_Attack, this.GetBestAttackAgainst(target, true)) |4600| |- && (this.GetStance().respondChaseBeyondVision || this.CheckTargetIsInVisionRange(target)) | |4599|+ && this.CheckTargetDistanceFromHeldPosition(target, IID_Attack, this.GetBestAttackAgainst(target, true)) && | |4600|+ (this.GetStance().respondChaseBeyondVision || this.CheckTargetIsInVisionRange(target)) |4601|4601| ); |4602|4602| if (!target) |4603|4603| return false; | | [NORMAL] ESLintBear (no-multi-spaces): | | Multiple spaces found before 'Engine'. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js |4660|4660| // If we are guarding/escorting, don't abandon as long as the guarded unit is in target range of the attacker |4661|4661| if (this.isGuardOf) |4662|4662| { |4663| |- var cmpUnitAI = Engine.QueryInterface(target, IID_UnitAI); | |4663|+ var cmpUnitAI = Engine.QueryInterface(target, IID_UnitAI); |4664|4664| var cmpAttack = Engine.QueryInterface(target, IID_Attack); |4665|4665| if (cmpUnitAI && cmpAttack && |4666|4666| cmpAttack.GetAttackTypes().some(type => cmpUnitAI.CheckTargetAttackRange(this.isGuardOf, type))) | | [NORMAL] ESLintBear (indent): | | Expected indentation of 3 tabs but found 4. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js |4664|4664| var cmpAttack = Engine.QueryInterface(target, IID_Attack); |4665|4665| if (cmpUnitAI && cmpAttack && |4666|4666| cmpAttack.GetAttackTypes().some(type => cmpUnitAI.CheckTargetAttackRange(this.isGuardOf, type))) |4667| |- return false; | |4667|+ return false; |4668|4668| } |4669|4669| |4670|4670| // Stop if we're in hold-ground mode and it's too far from the holding point | | [NORMAL] ESLintBear (curly): | | Unnecessary { after 'if' condition. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js |4669|4669| |4670|4670| // Stop if we're in hold-ground mode and it's too far from the holding point |4671|4671| if (this.GetStance().respondHoldGround) |4672| |- { | |4672|+ |4673|4673| if (!this.CheckTargetDistanceFromHeldPosition(target, iid, type)) |4674|4674| return true; |4675| |- } | |4675|+ |4676|4676| |4677|4677| // Stop if it's left our vision range, unless we're especially persistent |4678|4678| if (!this.GetStance().respondChaseBeyondVision) | | [NORMAL] ESLintBear (curly): | | Unnecessary { after 'if' condition. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js |4676|4676| |4677|4677| // Stop if it's left our vision range, unless we're especially persistent |4678|4678| if (!this.GetStance().respondChaseBeyondVision) |4679| |- { | |4679|+ |4680|4680| if (!this.CheckTargetIsInVisionRange(target)) |4681|4681| return true; |4682| |- } | |4682|+ |4683|4683| |4684|4684| // (Note that CCmpUnitMotion will detect if the target is lost in FoW, |4685|4685| // and will continue moving to its last seen position and then stop) | | [NORMAL] ESLintBear (no-multi-spaces): | | Multiple spaces found before 'Engine'. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js |4707|4707| // If we are guarding/escorting, chase at least as long as the guarded unit is in target range of the attacker |4708|4708| if (this.isGuardOf) |4709|4709| { |4710| |- var cmpUnitAI = Engine.QueryInterface(target, IID_UnitAI); | |4710|+ var cmpUnitAI = Engine.QueryInterface(target, IID_UnitAI); |4711|4711| var cmpAttack = Engine.QueryInterface(target, IID_Attack); |4712|4712| if (cmpUnitAI && cmpAttack && |4713|4713| cmpAttack.GetAttackTypes().some(type => cmpUnitAI.CheckTargetAttackRange(this.isGuardOf, type))) | | [NORMAL] ESLintBear (spaced-comment): | | Expected space or tab after '//' in comment. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js |4720|4720| return false; |4721|4721| }; |4722|4722| |4723| |-//// External interface functions //// | |4723|+// // External interface functions //// |4724|4724| |4725|4725| UnitAI.prototype.SetFormationController = function(ent) |4726|4726| { | | [NORMAL] ESLintBear (curly): | | Unnecessary { after 'if' condition. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js |4730|4730| // of our own formation (or ourself if not in formation) |4731|4731| var cmpObstruction = Engine.QueryInterface(this.entity, IID_Obstruction); |4732|4732| if (cmpObstruction) |4733| |- { | |4733|+ |4734|4734| if (ent == INVALID_ENTITY) |4735|4735| cmpObstruction.SetControlGroup(this.entity); |4736|4736| else |4737|4737| cmpObstruction.SetControlGroup(ent); |4738| |- } | |4738|+ |4739|4739| |4740|4740| // If we were removed from a formation, let the FSM switch back to INDIVIDUAL |4741|4741| if (ent == INVALID_ENTITY) | | [NORMAL] ESLintBear (curly): | | Unnecessary { after 'if' condition. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js |4873|4873| // if we already had an old guard order, do nothing if the target is the same |4874|4874| // and the order is running, otherwise remove the previous order |4875|4875| if (this.isGuardOf) |4876| |- { | |4876|+ |4877|4877| if (this.isGuardOf == target && this.order && this.order.type == "Guard") |4878|4878| return; |4879|4879| else |4880|4880| this.RemoveGuard(); |4881| |- } | |4881|+ |4882|4882| |4883|4883| this.AddOrder("Guard", { "target": target, "force": false }, queued); |4884|4884| }; | | [NORMAL] ESLintBear (no-else-return): | | Unnecessary 'else' after 'return'. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js |4876|4876| { |4877|4877| if (this.isGuardOf == target && this.order && this.order.type == "Guard") |4878|4878| return; |4879| |- else |4880| |- this.RemoveGuard(); | |4879|+ this.RemoveGuard(); |4881|4880| } |4882|4881| |4883|4882| this.AddOrder("Guard", { "target": target, "force": false }, queued); | | [NORMAL] ESLintBear (object-curly-spacing): | | A space is required after '{'. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js |4918|4918| return; |4919|4919| |4920|4920| if (this.order.type == "Guard") |4921| |- this.UnitFsm.ProcessMessage(this, {"type": "RemoveGuard"}); | |4921|+ this.UnitFsm.ProcessMessage(this, { "type": "RemoveGuard"}); |4922|4922| else |4923|4923| for (let i = 1; i < this.orderQueue.length; ++i) |4924|4924| if (this.orderQueue[i].type == "Guard") | | [NORMAL] ESLintBear (object-curly-spacing): | | A space is required before '}'. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js |4918|4918| return; |4919|4919| |4920|4920| if (this.order.type == "Guard") |4921| |- this.UnitFsm.ProcessMessage(this, {"type": "RemoveGuard"}); | |4921|+ this.UnitFsm.ProcessMessage(this, {"type": "RemoveGuard" }); |4922|4922| else |4923|4923| for (let i = 1; i < this.orderQueue.length; ++i) |4924|4924| if (this.orderQueue[i].type == "Guard") | | [NORMAL] ESLintBear (object-curly-spacing): | | A space is required before '}'. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js |5047|5047| this.WalkToTarget(target, queued); |5048|5048| return; |5049|5049| } |5050| |- this.AddOrder("Attack", { "target": target, "force": true, "allowCapture": allowCapture}, queued); | |5050|+ this.AddOrder("Attack", { "target": target, "force": true, "allowCapture": allowCapture }, queued); |5051|5051| }; |5052|5052| |5053|5053| /** | | [NORMAL] ESLintBear (operator-linebreak): | | '&&' should be placed at the end of the line. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js |5462|5462| { |5463|5463| var cmpIdentity = Engine.QueryInterface(targ, IID_Identity); |5464|5464| var targetClasses = this.order.data.targetClasses; |5465| |- if (targetClasses.attack && cmpIdentity |5466| |- && !MatchesClassList(cmpIdentity.GetClassesList(), targetClasses.attack)) | |5465|+ if (targetClasses.attack && cmpIdentity && | |5466|+ !MatchesClassList(cmpIdentity.GetClassesList(), targetClasses.attack)) |5467|5467| continue; |5468|5468| if (targetClasses.avoid && cmpIdentity |5469|5469| && MatchesClassList(cmpIdentity.GetClassesList(), targetClasses.avoid)) | | [NORMAL] ESLintBear (operator-linebreak): | | '&&' should be placed at the end of the line. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js |5465|5465| if (targetClasses.attack && cmpIdentity |5466|5466| && !MatchesClassList(cmpIdentity.GetClassesList(), targetClasses.attack)) |5467|5467| continue; |5468| |- if (targetClasses.avoid && cmpIdentity |5469| |- && MatchesClassList(cmpIdentity.GetClassesList(), targetClasses.avoid)) | |5468|+ if (targetClasses.avoid && cmpIdentity && | |5469|+ MatchesClassList(cmpIdentity.GetClassesList(), targetClasses.avoid)) |5470|5470| continue; |5471|5471| // Only used by the AIs to prevent some choices of targets |5472|5472| if (targetClasses.vetoEntities && targetClasses.vetoEntities[targ]) | | [NORMAL] ESLintBear (operator-linebreak): | | '&&' should be placed at the end of the line. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js |5488|5488| { |5489|5489| var cmpIdentity = Engine.QueryInterface(targ, IID_Identity); |5490|5490| var targetClasses = this.order.data.targetClasses; |5491| |- if (cmpIdentity && targetClasses.attack |5492| |- && !MatchesClassList(cmpIdentity.GetClassesList(), targetClasses.attack)) | |5491|+ if (cmpIdentity && targetClasses.attack && | |5492|+ !MatchesClassList(cmpIdentity.GetClassesList(), targetClasses.attack)) |5493|5493| continue; |5494|5494| if (cmpIdentity && targetClasses.avoid |5495|5495| && MatchesClassList(cmpIdentity.GetClassesList(), targetClasses.avoid)) | | [NORMAL] ESLintBear (operator-linebreak): | | '&&' should be placed at the end of the line. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js |5491|5491| if (cmpIdentity && targetClasses.attack |5492|5492| && !MatchesClassList(cmpIdentity.GetClassesList(), targetClasses.attack)) |5493|5493| continue; |5494| |- if (cmpIdentity && targetClasses.avoid |5495| |- && MatchesClassList(cmpIdentity.GetClassesList(), targetClasses.avoid)) | |5494|+ if (cmpIdentity && targetClasses.avoid && | |5495|+ MatchesClassList(cmpIdentity.GetClassesList(), targetClasses.avoid)) |5496|5496| continue; |5497|5497| // Only used by the AIs to prevent some choices of targets |5498|5498| if (targetClasses.vetoEntities && targetClasses.vetoEntities[targ]) | | [NORMAL] ESLintBear (space-before-function-paren): | | Unexpected space before function parentheses. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js |5531|5531| |5532|5532| var cmpRangeManager = Engine.QueryInterface(SYSTEM_ENTITY, IID_RangeManager); |5533|5533| var entities = cmpRangeManager.ResetActiveQuery(this.losRangeQuery); |5534| |- var targets = entities.filter(function (v) { return cmpAttack.CanAttack(v) && attackfilter(v); }) | |5534|+ var targets = entities.filter(function(v) { return cmpAttack.CanAttack(v) && attackfilter(v); }) |5535|5535| .sort(function (a, b) { return cmpAttack.CompareEntitiesByPreference(a, b); }); |5536|5536| |5537|5537| return targets; | | [NORMAL] ESLintBear (space-before-function-paren): | | Unexpected space before function parentheses. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js |5532|5532| var cmpRangeManager = Engine.QueryInterface(SYSTEM_ENTITY, IID_RangeManager); |5533|5533| var entities = cmpRangeManager.ResetActiveQuery(this.losRangeQuery); |5534|5534| var targets = entities.filter(function (v) { return cmpAttack.CanAttack(v) && attackfilter(v); }) |5535| |- .sort(function (a, b) { return cmpAttack.CompareEntitiesByPreference(a, b); }); | |5535|+ .sort(function(a, b) { return cmpAttack.CompareEntitiesByPreference(a, b); }); |5536|5536| |5537|5537| return targets; |5538|5538| }; | | [NORMAL] ESLintBear (object-curly-spacing): | | A space is required after '{'. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js |5621|5621| |5622|5622| UnitAI.prototype.SetHeldPosition = function(x, z) |5623|5623| { |5624| |- this.heldPosition = {"x": x, "z": z}; | |5624|+ this.heldPosition = { "x": x, "z": z}; |5625|5625| }; |5626|5626| |5627|5627| UnitAI.prototype.SetHeldPositionOnEntity = function(entity) | | [NORMAL] ESLintBear (object-curly-spacing): | | A space is required before '}'. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js |5621|5621| |5622|5622| UnitAI.prototype.SetHeldPosition = function(x, z) |5623|5623| { |5624| |- this.heldPosition = {"x": x, "z": z}; | |5624|+ this.heldPosition = {"x": x, "z": z }; |5625|5625| }; |5626|5626| |5627|5627| UnitAI.prototype.SetHeldPositionOnEntity = function(entity) | | [NORMAL] ESLintBear (spaced-comment): | | Expected space or tab after '//' in comment. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js |5648|5648| return false; |5649|5649| }; |5650|5650| |5651| |-//// Helper functions //// | |5651|+// // Helper functions //// |5652|5652| |5653|5653| UnitAI.prototype.CanAttack = function(target) |5654|5654| { | | [NORMAL] ESLintBear (spaced-comment): | | Expected space or tab after '//' in comment. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js |5852|5852| return (cmpPack && cmpPack.IsPacking()); |5853|5853| }; |5854|5854| |5855| |-//// Formation specific functions //// | |5855|+// // Formation specific functions //// |5856|5856| |5857|5857| UnitAI.prototype.IsAttackingAsFormation = function() |5858|5858| { | | [NORMAL] ESLintBear (operator-linebreak): | | '&&' should be placed at the end of the line. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js |5857|5857| UnitAI.prototype.IsAttackingAsFormation = function() |5858|5858| { |5859|5859| var cmpAttack = Engine.QueryInterface(this.entity, IID_Attack); |5860| |- return cmpAttack && cmpAttack.CanAttackAsFormation() |5861| |- && this.GetCurrentState() == "FORMATIONCONTROLLER.COMBAT.ATTACKING"; | |5860|+ return cmpAttack && cmpAttack.CanAttackAsFormation() && | |5861|+ this.GetCurrentState() == "FORMATIONCONTROLLER.COMBAT.ATTACKING"; |5862|5862| }; |5863|5863| |5864|5864| //// Animal specific functions //// | | [NORMAL] ESLintBear (spaced-comment): | | Expected space or tab after '//' in comment. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js |5861|5861| && this.GetCurrentState() == "FORMATIONCONTROLLER.COMBAT.ATTACKING"; |5862|5862| }; |5863|5863| |5864| |-//// Animal specific functions //// | |5864|+// // Animal specific functions //// |5865|5865| |5866|5866| UnitAI.prototype.MoveRandomly = function(distance) |5867|5867| { binaries/data/mods/public/simulation/components/UnitAI.js |2416| » » » » » » let·nearby·=·this.FindNearestDropsite(resourceType.generic); | | [NORMAL] ESLintBear (no-shadow): | | 'nearby' is already declared in the upper scope. binaries/data/mods/public/simulation/components/UnitAI.js |3790| » var·isWorkType·=·type·=>·type·==·"Gather"·||·type·==·"Trade"·||·type·==·"Repair"·||·type·==·"ReturnResource"; | | [NORMAL] ESLintBear (no-shadow): | | 'type' is already declared in the upper scope. binaries/data/mods/public/simulation/components/UnitAI.js |4582| » var·target·=·ents.find(target·=>·this.CanAttack(target)); | | [NORMAL] ESLintBear (no-shadow): | | 'target' is already declared in the upper scope. binaries/data/mods/public/simulation/components/UnitAI.js |4597| » var·target·=·ents.find(target·=> | | [NORMAL] ESLintBear (no-shadow): | | 'target' is already declared in the upper scope. binaries/data/mods/public/simulation/components/UnitAI.js |4643| » var·ent·=·ents.find(ent·=>·this.CanHeal(ent)); | | [NORMAL] ESLintBear (no-shadow): | | 'ent' is already declared in the upper scope. binaries/data/mods/public/simulation/components/UnitAI.js |4666| » » ····cmpAttack.GetAttackTypes().some(type·=>·cmpUnitAI.CheckTargetAttackRange(this.isGuardOf,·type))) | | [NORMAL] ESLintBear (no-shadow): | | 'type' is already declared in the upper scope. binaries/data/mods/public/simulation/components/UnitAI.js |5127| » var·lastPos·=·undefined; | | [NORMAL] ESLintBear (no-undef-init): | | It's not necessary to initialize 'lastPos' to undefined. binaries/data/mods/public/simulation/components/UnitAI.js | 356| » » ····&&·(this.lastShorelinePosition.z·==·cmpPosition.GetPosition().z)) | | [NORMAL] JSHintBear: | | Misleading line break before '&&'; readers may interpret this as an expression boundary. binaries/data/mods/public/simulation/components/UnitAI.js |1894| » » » » » » var·cmpFormation·=·Engine.QueryInterface(this.formationController,·IID_Formation); | | [NORMAL] JSHintBear: | | 'cmpFormation' is already defined. binaries/data/mods/public/simulation/components/UnitAI.js |2026| » » » » » » &&·this.order.data.target·!=·msg.data.attacker·&&·this.GetBestAttackAgainst(msg.data.attacker,·true)·!=·"Capture") | | [NORMAL] JSHintBear: | | Misleading line break before '&&'; readers may interpret this as an expression boundary. binaries/data/mods/public/simulation/components/UnitAI.js |2110| » » » » » » » » ·&&·((type.generic·==·"treasure"·&&·oldType.generic·==·"treasure") | | [NORMAL] JSHintBear: | | Misleading line break before '&&'; readers may interpret this as an expression boundary. binaries/data/mods/public/simulation/components/UnitAI.js |2111| » » » » » » » » ·||·(type.specific·==·oldType.specific | | [NORMAL] JSHintBear: | | Misleading line break before '||'; readers may interpret this as an expression boundary. binaries/data/mods/public/simulation/components/UnitAI.js |2112| » » » » » » » » ·&&·(type.specific·!=·"meat"·||·oldTemplate·==·template))) | | [NORMAL] JSHintBear: | | Misleading line break before '&&'; readers may interpret this as an expression boundary. binaries/data/mods/public/simulation/components/UnitAI.js |2135| » » » » » » » » var·nearby·=·this.FindNearestDropsite(oldType.generic); | | [NORMAL] JSHintBear: | | 'nearby' is already defined. binaries/data/mods/public/simulation/components/UnitAI.js |2175| » » » » » » » » &&·((type.generic·==·"treasure"·&&·oldType.generic·==·"treasure") | | [NORMAL] JSHintBear: | | Misleading line break before '&&'; readers may interpret this as an expression boundary. binaries/data/mods/public/simulation/components/UnitAI.js |2176| » » » » » » » » ||·(type.specific·==·oldType.specific | | [NORMAL] JSHintBear: | | Misleading line break before '||'; readers may interpret this as an expression boundary. binaries/data/mods/public/simulation/components/UnitAI.js |2177| » » » » » » » » &&·(type.specific·!=·"meat"·||·oldTemplate·==·template))) | | [NORMAL] JSHintBear: | | Misleading line break before '&&'; readers may interpret this as an expression boundary. binaries/data/mods/public/simulation/components/UnitAI.js |2221| » » » » » » » ||·(type.specific·==·resourceType.specific | | [NORMAL] JSHintBear: | | Misleading line break before '||'; readers may interpret this as an expression boundary. binaries/data/mods/public/simulation/components/UnitAI.js |2222| » » » » » » » &&·(type.specific·!=·"meat"·||·resourceTemplate·==·template)) | | [NORMAL] JSHintBear: | | Misleading line break before '&&'; readers may interpret this as an expression boundary. binaries/data/mods/public/simulation/components/UnitAI.js |2238| » » » » » var·nearby·=·this.FindNearestDropsite(resourceType.generic); | | [NORMAL] JSHintBear: | | 'nearby' is already defined. binaries/data/mods/public/simulation/components/UnitAI.js |2411| » » » » » var·cmpResourceGatherer·=·Engine.QueryInterface(this.entity,·IID_ResourceGatherer); | | [NORMAL] JSHintBear: | | 'cmpResourceGatherer' is already defined. binaries/data/mods/public/simulation/components/UnitAI.js |2427| » » » » » var·nearby·=·this.FindNearbyResource(function·(ent,·type,·template)·{ | | [NORMAL] JSHintBear: | | 'nearby' is already defined. binaries/data/mods/public/simulation/components/UnitAI.js |2430| » » » » » » » ||·(type.specific·==·resourceType.specific | | [NORMAL] JSHintBear: | | Misleading line break before '||'; readers may interpret this as an expression boundary. binaries/data/mods/public/simulation/components/UnitAI.js |2431| » » » » » » » &&·(type.specific·!=·"meat"·||·resourceTemplate·==·template)) | | [NORMAL] JSHintBear: | | Misleading line break before '&&'; readers may interpret this as an expression boundary. binaries/data/mods/public/simulation/components/UnitAI.js |2451| » » » » » var·nearby·=·this.FindNearestDropsite(resourceType.generic); | | [NORMAL] JSHintBear: | | 'nearby' is already defined. binaries/data/mods/public/simulation/components/UnitAI.js |2635| » » » » » var·cmpResourceGatherer·=·Engine.QueryInterface(this.entity,·IID_ResourceGatherer); | | [NORMAL] JSHintBear: | | 'cmpResourceGatherer' is already defined. binaries/data/mods/public/simulation/components/UnitAI.js |2830| » » » » » var·cmpResourceDropsite·=·Engine.QueryInterface(msg.data.newentity,·IID_ResourceDropsite); | | [NORMAL] JSHintBear: | | 'cmpResourceDropsite' is already defined. binaries/data/mods/public/simulation/components/UnitAI.js |2903| » » » » » if·(this.CanGarrison(target)) | | [NORMAL] JSHintBear: | | 'target' used out of scope. binaries/data/mods/public/simulation/components/UnitAI.js |2906| » » » » » » if·(this.CheckGarrisonRange(target)) | | [NORMAL] JSHintBear: | | 'target' used out of scope. binaries/data/mods/public/simulation/components/UnitAI.js |2908| » » » » » » » var·cmpGarrisonHolder·=·Engine.QueryInterface(target,·IID_GarrisonHolder); | | [NORMAL] JSHintBear: | | 'target' used out of scope. binaries/data/mods/public/simulation/components/UnitAI.js |2930| » » » » » » » » var·cmpResourceDropsite·=·Engine.QueryInterface(target,·IID_ResourceDropsite); | | [NORMAL] JSHintBear: | | 'target' used out of scope. binaries/data/mods/public/simulation/components/UnitAI.js |2931| » » » » » » » » if·(cmpResourceDropsite·&&·this.CanReturnResource(target,·true)) | | [NORMAL] JSHintBear: | | 'target' used out of scope. binaries/data/mods/public/simulation/components/UnitAI.js |2946| » » » » » » » » » var·cmpHolderPosition·=·Engine.QueryInterface(target,·IID_Position); | | [NORMAL] JSHintBear: | | 'target' used out of scope. binaries/data/mods/public/simulation/components/UnitAI.js |2947| » » » » » » » » » var·cmpHolderUnitAI·=·Engine.QueryInterface(target,·IID_UnitAI); | | [NORMAL] JSHintBear: | | 'target' used out of scope. binaries/data/mods/public/simulation/components/UnitAI.js |2974| » » » » » » » if·(this.MoveToTarget(target)) | | [NORMAL] JSHintBear: | | 'target' used out of scope. binaries/data/mods/public/simulation/components/UnitAI.js |3752| » » var·order·=·{·"type":·type,·"data":·data·}; | | [NORMAL] JSHintBear: | | 'order' is already defined. binaries/data/mods/public/simulation/components/UnitAI.js |3821| » for·(var·i·=·0;·i·<·this.orderQueue.length;·++i) | | [NORMAL] JSHintBear: | | 'i' is already defined. binaries/data/mods/public/simulation/components/UnitAI.js |4093| » let·cmpPosition·=·Engine.QueryInterface(this.entity,·IID_Position) | | [NORMAL] JSHintBear: | | Missing semicolon. binaries/data/mods/public/simulation/components/UnitAI.js |4364| » » var·parabolicMaxRange·=·0; | | [NORMAL] JSHintBear: | | 'parabolicMaxRange' is already defined. binaries/data/mods/public/simulation/components/UnitAI.js |4368| » var·guessedMaxRange·=·(range.max·+·parabolicMaxRange)/2; | | [NORMAL] JSHintBear: | | 'parabolicMaxRange' used out of scope. binaries/data/mods/public/simulation/components/UnitAI.js |4375| » return·cmpUnitMotion.MoveToTargetRange(target,·range.min,·Math.min(range.max,·parabolicMaxRange)); | | [NORMAL] JSHintBear: | | 'parabolicMaxRange' used out of scope. binaries/data/mods/public/simulation/components/UnitAI.js |4431| » » » &&·cmpFormationUnitAI.order.data.target·==·target) | | [NORMAL] JSHintBear: | | Misleading line break before '&&'; readers may interpret this as an expression boundary. binaries/data/mods/public/simulation/components/UnitAI.js |4599| » » &&·this.CheckTargetDistanceFromHeldPosition(target,·IID_Attack,·this.GetBestAttackAgainst(target,·true)) | | [NORMAL] JSHintBear: | | Misleading line break before '&&'; readers may interpret this as an expression boundary. binaries/data/mods/public/simulation/components/UnitAI.js |4600| » » &&·(this.GetStance().respondChaseBeyondVision·||·this.CheckTargetIsInVisionRange(target)) | | [NORMAL] JSHintBear: | | Misleading line break before '&&'; readers may interpret this as an expression boundary. binaries/data/mods/public/simulation/components/UnitAI.js |5127| » var·lastPos·=·undefined; | | [NORMAL] JSHintBear: | | It's not necessary to initialize 'lastPos' to 'undefined'. binaries/data/mods/public/simulation/components/UnitAI.js |5466| » » » » » » &&·!MatchesClassList(cmpIdentity.GetClassesList(),·targetClasses.attack)) | | [NORMAL] JSHintBear: | | Misleading line break before '&&'; readers may interpret this as an expression boundary. binaries/data/mods/public/simulation/components/UnitAI.js |5469| » » » » » » &&·MatchesClassList(cmpIdentity.GetClassesList(),·targetClasses.avoid)) | | [NORMAL] JSHintBear: | | Misleading line break before '&&'; readers may interpret this as an expression boundary. binaries/data/mods/public/simulation/components/UnitAI.js |5482| » var·targets·=·this.GetTargetsFromUnit(); | | [NORMAL] JSHintBear: | | 'targets' is already defined. binaries/data/mods/public/simulation/components/UnitAI.js |5483| » for·(var·targ·of·targets) | | [NORMAL] JSHintBear: | | 'targ' is already defined. binaries/data/mods/public/simulation/components/UnitAI.js |5489| » » » var·cmpIdentity·=·Engine.QueryInterface(targ,·IID_Identity); | | [NORMAL] JSHintBear: | | 'cmpIdentity' is already defined. binaries/data/mods/public/simulation/components/UnitAI.js |5490| » » » var·targetClasses·=·this.order.data.targetClasses; | | [NORMAL] JSHintBear: | | 'targetClasses' is already defined. binaries/data/mods/public/simulation/components/UnitAI.js |5492| » » » » &&·!MatchesClassList(cmpIdentity.GetClassesList(),·targetClasses.attack)) | | [NORMAL] JSHintBear: | | Misleading line break before '&&'; readers may interpret this as an expression boundary. binaries/data/mods/public/simulation/components/UnitAI.js |5495| » » » » &&·MatchesClassList(cmpIdentity.GetClassesList(),·targetClasses.avoid)) | | [NORMAL] JSHintBear: | | Misleading line break before '&&'; readers may interpret this as an expression boundary. binaries/data/mods/public/simulation/components/UnitAI.js |5570| » » var·range·=·cmpVision.GetRange(); | | [NORMAL] JSHintBear: | | 'range' is already defined. binaries/data/mods/public/simulation/components/UnitAI.js |5575| » » var·cmpRanged·=·Engine.QueryInterface(this.entity,·iid); | | [NORMAL] JSHintBear: | | 'cmpRanged' is already defined. binaries/data/mods/public/simulation/components/UnitAI.js |5578| » » var·range·=·iid·!==·IID_Attack·?·cmpRanged.GetRange()·:·cmpRanged.GetFullAttackRange(); | | [NORMAL] JSHintBear: | | 'range' is already defined. binaries/data/mods/public/simulation/components/UnitAI.js |5579| » » var·cmpVision·=·Engine.QueryInterface(this.entity,·IID_Vision); | | [NORMAL] JSHintBear: | | 'cmpVision' is already defined. binaries/data/mods/public/simulation/components/UnitAI.js |5579| » » var·cmpVision·=·Engine.QueryInterface(this.entity,·IID_Vision); | | [MAJOR] JSHintBear: | | Too many errors. (93% scanned).
Link to build: https://jenkins.wildfiregames.com/job/differential/35/display/redirect
We could do a this.SetAnimationVariant("formation"); and then this.SetDefaultAnimationVariant(); while we're at it and avoid showing units with resources while walking in formation (in particular units gliding with resources).
Set an animation variant while walking in formation so units don't show resources (and glide with them).
Build failure - The Moirai have given mortals hearts that can endure.
Linter detected issues: Executing section Default... Executing section Source... Executing section JS... | | [NORMAL] ESLintBear (quote-props): | | Unquoted property 'targetVisibleEnemies' found. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | 73| 73| // do worry around armies slaughtering the guy standing next to you), etc. | 74| 74| var g_Stances = { | 75| 75| "violent": { | 76| |- targetVisibleEnemies: true, | | 76|+ "targetVisibleEnemies": true, | 77| 77| targetAttackersAlways: true, | 78| 78| respondFlee: false, | 79| 79| respondChase: true, | | [NORMAL] ESLintBear (quote-props): | | Unquoted property 'targetAttackersAlways' found. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | 74| 74| var g_Stances = { | 75| 75| "violent": { | 76| 76| targetVisibleEnemies: true, | 77| |- targetAttackersAlways: true, | | 77|+ "targetAttackersAlways": true, | 78| 78| respondFlee: false, | 79| 79| respondChase: true, | 80| 80| respondChaseBeyondVision: true, | | [NORMAL] ESLintBear (quote-props): | | Unquoted property 'respondFlee' found. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | 75| 75| "violent": { | 76| 76| targetVisibleEnemies: true, | 77| 77| targetAttackersAlways: true, | 78| |- respondFlee: false, | | 78|+ "respondFlee": false, | 79| 79| respondChase: true, | 80| 80| respondChaseBeyondVision: true, | 81| 81| respondStandGround: false, | | [NORMAL] ESLintBear (quote-props): | | Unquoted property 'respondChase' found. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | 76| 76| targetVisibleEnemies: true, | 77| 77| targetAttackersAlways: true, | 78| 78| respondFlee: false, | 79| |- respondChase: true, | | 79|+ "respondChase": true, | 80| 80| respondChaseBeyondVision: true, | 81| 81| respondStandGround: false, | 82| 82| respondHoldGround: false, | | [NORMAL] ESLintBear (quote-props): | | Unquoted property 'respondChaseBeyondVision' found. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | 77| 77| targetAttackersAlways: true, | 78| 78| respondFlee: false, | 79| 79| respondChase: true, | 80| |- respondChaseBeyondVision: true, | | 80|+ "respondChaseBeyondVision": true, | 81| 81| respondStandGround: false, | 82| 82| respondHoldGround: false, | 83| 83| }, | | [NORMAL] ESLintBear (quote-props): | | Unquoted property 'respondStandGround' found. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | 78| 78| respondFlee: false, | 79| 79| respondChase: true, | 80| 80| respondChaseBeyondVision: true, | 81| |- respondStandGround: false, | | 81|+ "respondStandGround": false, | 82| 82| respondHoldGround: false, | 83| 83| }, | 84| 84| "aggressive": { | | [NORMAL] ESLintBear (quote-props): | | Unquoted property 'respondHoldGround' found. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | 79| 79| respondChase: true, | 80| 80| respondChaseBeyondVision: true, | 81| 81| respondStandGround: false, | 82| |- respondHoldGround: false, | | 82|+ "respondHoldGround": false, | 83| 83| }, | 84| 84| "aggressive": { | 85| 85| targetVisibleEnemies: true, | | [NORMAL] ESLintBear (quote-props): | | Unquoted property 'targetVisibleEnemies' found. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | 82| 82| respondHoldGround: false, | 83| 83| }, | 84| 84| "aggressive": { | 85| |- targetVisibleEnemies: true, | | 85|+ "targetVisibleEnemies": true, | 86| 86| targetAttackersAlways: false, | 87| 87| respondFlee: false, | 88| 88| respondChase: true, | | [NORMAL] ESLintBear (quote-props): | | Unquoted property 'targetAttackersAlways' found. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | 83| 83| }, | 84| 84| "aggressive": { | 85| 85| targetVisibleEnemies: true, | 86| |- targetAttackersAlways: false, | | 86|+ "targetAttackersAlways": false, | 87| 87| respondFlee: false, | 88| 88| respondChase: true, | 89| 89| respondChaseBeyondVision: false, | | [NORMAL] ESLintBear (quote-props): | | Unquoted property 'respondFlee' found. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | 84| 84| "aggressive": { | 85| 85| targetVisibleEnemies: true, | 86| 86| targetAttackersAlways: false, | 87| |- respondFlee: false, | | 87|+ "respondFlee": false, | 88| 88| respondChase: true, | 89| 89| respondChaseBeyondVision: false, | 90| 90| respondStandGround: false, | | [NORMAL] ESLintBear (quote-props): | | Unquoted property 'respondChase' found. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | 85| 85| targetVisibleEnemies: true, | 86| 86| targetAttackersAlways: false, | 87| 87| respondFlee: false, | 88| |- respondChase: true, | | 88|+ "respondChase": true, | 89| 89| respondChaseBeyondVision: false, | 90| 90| respondStandGround: false, | 91| 91| respondHoldGround: false, | | [NORMAL] ESLintBear (quote-props): | | Unquoted property 'respondChaseBeyondVision' found. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | 86| 86| targetAttackersAlways: false, | 87| 87| respondFlee: false, | 88| 88| respondChase: true, | 89| |- respondChaseBeyondVision: false, | | 89|+ "respondChaseBeyondVision": false, | 90| 90| respondStandGround: false, | 91| 91| respondHoldGround: false, | 92| 92| }, | | [NORMAL] ESLintBear (quote-props): | | Unquoted property 'respondStandGround' found. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | 87| 87| respondFlee: false, | 88| 88| respondChase: true, | 89| 89| respondChaseBeyondVision: false, | 90| |- respondStandGround: false, | | 90|+ "respondStandGround": false, | 91| 91| respondHoldGround: false, | 92| 92| }, | 93| 93| "defensive": { | | [NORMAL] ESLintBear (quote-props): | | Unquoted property 'respondHoldGround' found. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | 88| 88| respondChase: true, | 89| 89| respondChaseBeyondVision: false, | 90| 90| respondStandGround: false, | 91| |- respondHoldGround: false, | | 91|+ "respondHoldGround": false, | 92| 92| }, | 93| 93| "defensive": { | 94| 94| targetVisibleEnemies: true, | | [NORMAL] ESLintBear (quote-props): | | Unquoted property 'targetVisibleEnemies' found. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | 91| 91| respondHoldGround: false, | 92| 92| }, | 93| 93| "defensive": { | 94| |- targetVisibleEnemies: true, | | 94|+ "targetVisibleEnemies": true, | 95| 95| targetAttackersAlways: false, | 96| 96| respondFlee: false, | 97| 97| respondChase: false, | | [NORMAL] ESLintBear (quote-props): | | Unquoted property 'targetAttackersAlways' found. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | 92| 92| }, | 93| 93| "defensive": { | 94| 94| targetVisibleEnemies: true, | 95| |- targetAttackersAlways: false, | | 95|+ "targetAttackersAlways": false, | 96| 96| respondFlee: false, | 97| 97| respondChase: false, | 98| 98| respondChaseBeyondVision: false, | | [NORMAL] ESLintBear (quote-props): | | Unquoted property 'respondFlee' found. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | 93| 93| "defensive": { | 94| 94| targetVisibleEnemies: true, | 95| 95| targetAttackersAlways: false, | 96| |- respondFlee: false, | | 96|+ "respondFlee": false, | 97| 97| respondChase: false, | 98| 98| respondChaseBeyondVision: false, | 99| 99| respondStandGround: false, | | [NORMAL] ESLintBear (quote-props): | | Unquoted property 'respondChase' found. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | 94| 94| targetVisibleEnemies: true, | 95| 95| targetAttackersAlways: false, | 96| 96| respondFlee: false, | 97| |- respondChase: false, | | 97|+ "respondChase": false, | 98| 98| respondChaseBeyondVision: false, | 99| 99| respondStandGround: false, | 100| 100| respondHoldGround: true, | | [NORMAL] ESLintBear (quote-props): | | Unquoted property 'respondChaseBeyondVision' found. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | 95| 95| targetAttackersAlways: false, | 96| 96| respondFlee: false, | 97| 97| respondChase: false, | 98| |- respondChaseBeyondVision: false, | | 98|+ "respondChaseBeyondVision": false, | 99| 99| respondStandGround: false, | 100| 100| respondHoldGround: true, | 101| 101| }, | | [NORMAL] ESLintBear (quote-props): | | Unquoted property 'respondStandGround' found. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | 96| 96| respondFlee: false, | 97| 97| respondChase: false, | 98| 98| respondChaseBeyondVision: false, | 99| |- respondStandGround: false, | | 99|+ "respondStandGround": false, | 100| 100| respondHoldGround: true, | 101| 101| }, | 102| 102| "passive": { | | [NORMAL] ESLintBear (quote-props): | | Unquoted property 'respondHoldGround' found. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | 97| 97| respondChase: false, | 98| 98| respondChaseBeyondVision: false, | 99| 99| respondStandGround: false, | 100| |- respondHoldGround: true, | | 100|+ "respondHoldGround": true, | 101| 101| }, | 102| 102| "passive": { | 103| 103| targetVisibleEnemies: false, | | [NORMAL] ESLintBear (quote-props): | | Unquoted property 'targetVisibleEnemies' found. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | 100| 100| respondHoldGround: true, | 101| 101| }, | 102| 102| "passive": { | 103| |- targetVisibleEnemies: false, | | 103|+ "targetVisibleEnemies": false, | 104| 104| targetAttackersAlways: false, | 105| 105| respondFlee: true, | 106| 106| respondChase: false, | | [NORMAL] ESLintBear (quote-props): | | Unquoted property 'targetAttackersAlways' found. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | 101| 101| }, | 102| 102| "passive": { | 103| 103| targetVisibleEnemies: false, | 104| |- targetAttackersAlways: false, | | 104|+ "targetAttackersAlways": false, | 105| 105| respondFlee: true, | 106| 106| respondChase: false, | 107| 107| respondChaseBeyondVision: false, | | [NORMAL] ESLintBear (quote-props): | | Unquoted property 'respondFlee' found. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | 102| 102| "passive": { | 103| 103| targetVisibleEnemies: false, | 104| 104| targetAttackersAlways: false, | 105| |- respondFlee: true, | | 105|+ "respondFlee": true, | 106| 106| respondChase: false, | 107| 107| respondChaseBeyondVision: false, | 108| 108| respondStandGround: false, | | [NORMAL] ESLintBear (quote-props): | | Unquoted property 'respondChase' found. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | 103| 103| targetVisibleEnemies: false, | 104| 104| targetAttackersAlways: false, | 105| 105| respondFlee: true, | 106| |- respondChase: false, | | 106|+ "respondChase": false, | 107| 107| respondChaseBeyondVision: false, | 108| 108| respondStandGround: false, | 109| 109| respondHoldGround: false, | | [NORMAL] ESLintBear (quote-props): | | Unquoted property 'respondChaseBeyondVision' found. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | 104| 104| targetAttackersAlways: false, | 105| 105| respondFlee: true, | 106| 106| respondChase: false, | 107| |- respondChaseBeyondVision: false, | | 107|+ "respondChaseBeyondVision": false, | 108| 108| respondStandGround: false, | 109| 109| respondHoldGround: false, | 110| 110| }, | | [NORMAL] ESLintBear (quote-props): | | Unquoted property 'respondStandGround' found. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | 105| 105| respondFlee: true, | 106| 106| respondChase: false, | 107| 107| respondChaseBeyondVision: false, | 108| |- respondStandGround: false, | | 108|+ "respondStandGround": false, | 109| 109| respondHoldGround: false, | 110| 110| }, | 111| 111| "standground": { | | [NORMAL] ESLintBear (quote-props): | | Unquoted property 'respondHoldGround' found. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | 106| 106| respondChase: false, | 107| 107| respondChaseBeyondVision: false, | 108| 108| respondStandGround: false, | 109| |- respondHoldGround: false, | | 109|+ "respondHoldGround": false, | 110| 110| }, | 111| 111| "standground": { | 112| 112| targetVisibleEnemies: true, | | [NORMAL] ESLintBear (quote-props): | | Unquoted property 'targetVisibleEnemies' found. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | 109| 109| respondHoldGround: false, | 110| 110| }, | 111| 111| "standground": { | 112| |- targetVisibleEnemies: true, | | 112|+ "targetVisibleEnemies": true, | 113| 113| targetAttackersAlways: false, | 114| 114| respondFlee: false, | 115| 115| respondChase: false, | | [NORMAL] ESLintBear (quote-props): | | Unquoted property 'targetAttackersAlways' found. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | 110| 110| }, | 111| 111| "standground": { | 112| 112| targetVisibleEnemies: true, | 113| |- targetAttackersAlways: false, | | 113|+ "targetAttackersAlways": false, | 114| 114| respondFlee: false, | 115| 115| respondChase: false, | 116| 116| respondChaseBeyondVision: false, | | [NORMAL] ESLintBear (quote-props): | | Unquoted property 'respondFlee' found. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | 111| 111| "standground": { | 112| 112| targetVisibleEnemies: true, | 113| 113| targetAttackersAlways: false, | 114| |- respondFlee: false, | | 114|+ "respondFlee": false, | 115| 115| respondChase: false, | 116| 116| respondChaseBeyondVision: false, | 117| 117| respondStandGround: true, | | [NORMAL] ESLintBear (quote-props): | | Unquoted property 'respondChase' found. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | 112| 112| targetVisibleEnemies: true, | 113| 113| targetAttackersAlways: false, | 114| 114| respondFlee: false, | 115| |- respondChase: false, | | 115|+ "respondChase": false, | 116| 116| respondChaseBeyondVision: false, | 117| 117| respondStandGround: true, | 118| 118| respondHoldGround: false, | | [NORMAL] ESLintBear (quote-props): | | Unquoted property 'respondChaseBeyondVision' found. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | 113| 113| targetAttackersAlways: false, | 114| 114| respondFlee: false, | 115| 115| respondChase: false, | 116| |- respondChaseBeyondVision: false, | | 116|+ "respondChaseBeyondVision": false, | 117| 117| respondStandGround: true, | 118| 118| respondHoldGround: false, | 119| 119| }, | | [NORMAL] ESLintBear (quote-props): | | Unquoted property 'respondStandGround' found. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | 114| 114| respondFlee: false, | 115| 115| respondChase: false, | 116| 116| respondChaseBeyondVision: false, | 117| |- respondStandGround: true, | | 117|+ "respondStandGround": true, | 118| 118| respondHoldGround: false, | 119| 119| }, | 120| 120| }; | | [NORMAL] ESLintBear (quote-props): | | Unquoted property 'respondHoldGround' found. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | 115| 115| respondChase: false, | 116| 116| respondChaseBeyondVision: false, | 117| 117| respondStandGround: true, | 118| |- respondHoldGround: false, | | 118|+ "respondHoldGround": false, | 119| 119| }, | 120| 120| }; | 121| 121| | | [NORMAL] ESLintBear (curly): | | Unnecessary { after 'if' condition. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | 216| 216| // Move a tile outside the building | 217| 217| let range = 4; | 218| 218| if (this.MoveToTargetRangeExplicit(msg.data.target, range, range)) | 219| |- { | | 219|+ | 220| 220| // We've started walking to the given point | 221| 221| this.SetNextState("INDIVIDUAL.WALKING"); | 222| |- } | | 222|+ | 223| 223| else | 224| 224| { | 225| 225| // We are already at the target, or can't move at all | | [NORMAL] ESLintBear (curly): | | Unnecessary { after 'else'. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | 221| 221| this.SetNextState("INDIVIDUAL.WALKING"); | 222| 222| } | 223| 223| else | 224| |- { | | 224|+ | 225| 225| // We are already at the target, or can't move at all | 226| 226| this.FinishOrder(); | 227| |- } | | 227|+ | 228| 228| }, | 229| 229| | 230| 230| // Individual orders: | | [NORMAL] ESLintBear (curly): | | Unnecessary { after 'if' condition. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | 326| 326| | 327| 327| var ok = this.MoveToTarget(this.order.data.target); | 328| 328| if (ok) | 329| |- { | | 329|+ | 330| 330| // We've started walking to the given point | 331| 331| if (this.IsAnimal()) | 332| 332| this.SetNextState("ANIMAL.WALKING"); | 333| 333| else | 334| 334| this.SetNextState("INDIVIDUAL.WALKING"); | 335| |- } | | 335|+ | 336| 336| else | 337| 337| { | 338| 338| // We are already at the target, or can't move at all | | [NORMAL] ESLintBear (curly): | | Unnecessary { after 'if' condition. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | 354| 354| var cmpPosition = Engine.QueryInterface(this.entity, IID_Position); | 355| 355| if (this.lastShorelinePosition && cmpPosition && (this.lastShorelinePosition.x == cmpPosition.GetPosition().x) | 356| 356| && (this.lastShorelinePosition.z == cmpPosition.GetPosition().z)) | 357| |- { | | 357|+ | 358| 358| // we were already on the shoreline, and have not moved since | 359| 359| if (DistanceBetweenEntities(this.entity, this.order.data.target) < 50) | 360| 360| needToMove = false; | 361| |- } | | 361|+ | 362| 362| | 363| 363| // TODO: what if the units are on a cliff ? the ship will go below the cliff | 364| 364| // and the units won't be able to garrison. Should go to the nearest (accessible) shore | | [NORMAL] ESLintBear (operator-linebreak): | | '&&' should be placed at the end of the line. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | 352| 352| // Check if we need to move TODO implement a better way to know if we are on the shoreline | 353| 353| var needToMove = true; | 354| 354| var cmpPosition = Engine.QueryInterface(this.entity, IID_Position); | 355| |- if (this.lastShorelinePosition && cmpPosition && (this.lastShorelinePosition.x == cmpPosition.GetPosition().x) | 356| |- && (this.lastShorelinePosition.z == cmpPosition.GetPosition().z)) | | 355|+ if (this.lastShorelinePosition && cmpPosition && (this.lastShorelinePosition.x == cmpPosition.GetPosition().x) && | | 356|+ (this.lastShorelinePosition.z == cmpPosition.GetPosition().z)) | 357| 357| { | 358| 358| // we were already on the shoreline, and have not moved since | 359| 359| if (DistanceBetweenEntities(this.entity, this.order.data.target) < 50) | | [NORMAL] ESLintBear (curly): | | Unnecessary { after 'if' condition. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | 363| 363| // TODO: what if the units are on a cliff ? the ship will go below the cliff | 364| 364| // and the units won't be able to garrison. Should go to the nearest (accessible) shore | 365| 365| if (needToMove && this.MoveToTarget(this.order.data.target)) | 366| |- { | | 366|+ | 367| 367| this.SetNextState("INDIVIDUAL.PICKUP.APPROACHING"); | 368| |- } | | 368|+ | 369| 369| else | 370| 370| { | 371| 371| // We are already at the target, or can't move at all | | [NORMAL] ESLintBear (curly): | | Unnecessary { after 'if' condition. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | 392| 392| var distance = DistanceBetweenEntities(this.entity, this.order.data.target) + (+this.template.FleeDistance); | 393| 393| var cmpUnitMotion = Engine.QueryInterface(this.entity, IID_UnitMotion); | 394| 394| if (cmpUnitMotion.MoveToTargetRange(this.order.data.target, distance, -1)) | 395| |- { | | 395|+ | 396| 396| // We've started fleeing from the given target | 397| 397| if (this.IsAnimal()) | 398| 398| this.SetNextState("ANIMAL.FLEEING"); | 399| 399| else | 400| 400| this.SetNextState("INDIVIDUAL.FLEEING"); | 401| |- } | | 401|+ | 402| 402| else | 403| 403| { | 404| 404| // We are already at the target, or can't move at all | | [NORMAL] ESLintBear (curly): | | Unnecessary { after 'if' condition. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | 448| 448| } | 449| 449| | 450| 450| if (this.order.data.attackType == this.oldAttackType) | 451| |- { | | 451|+ | 452| 452| if (this.IsAnimal()) | 453| 453| this.SetNextState("ANIMAL.COMBAT.ATTACKING"); | 454| 454| else | 455| 455| this.SetNextState("INDIVIDUAL.COMBAT.ATTACKING"); | 456| |- } | | 456|+ | 457| 457| else | 458| 458| { | 459| 459| if (this.IsAnimal()) | | [NORMAL] ESLintBear (curly): | | Unnecessary { after 'else'. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | 455| 455| this.SetNextState("INDIVIDUAL.COMBAT.ATTACKING"); | 456| 456| } | 457| 457| else | 458| |- { | | 458|+ | 459| 459| if (this.IsAnimal()) | 460| 460| this.SetNextStateAlwaysEntering("ANIMAL.COMBAT.ATTACKING"); | 461| 461| else | 462| 462| this.SetNextStateAlwaysEntering("INDIVIDUAL.COMBAT.ATTACKING"); | 463| |- } | | 463|+ | 464| 464| return; | 465| 465| } | 466| 466| | | [NORMAL] ESLintBear (curly): | | Unnecessary { after 'else'. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | 593| 593| this.PushOrderFront("Walk", this.order.data.lastPos); | 594| 594| } | 595| 595| else | 596| |- { | | 596|+ | 597| 597| // We couldn't move there, or the target moved away | 598| 598| this.FinishOrder(); | 599| |- } | | 599|+ | 600| 600| return; | 601| 601| } | 602| 602| | | [NORMAL] ESLintBear (curly): | | Unnecessary { after 'if' condition. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | 606| 606| | 607| 607| // Try to move within range | 608| 608| if (this.MoveToTargetRange(this.order.data.target, IID_ResourceGatherer)) | 609| |- { | | 609|+ | 610| 610| // We've started walking to the given point | 611| 611| this.SetNextState("INDIVIDUAL.GATHER.APPROACHING"); | 612| |- } | | 612|+ | 613| 613| else | 614| 614| { | 615| 615| // We are already at the target, or can't move at all, | | [NORMAL] ESLintBear (curly): | | Unnecessary { after 'if' condition. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | 683| 683| "Order.Repair": function(msg) { | 684| 684| // Try to move within range | 685| 685| if (this.MoveToTargetRange(this.order.data.target, IID_Builder)) | 686| |- { | | 686|+ | 687| 687| // We've started walking to the given point | 688| 688| this.SetNextState("INDIVIDUAL.REPAIR.APPROACHING"); | 689| |- } | | 689|+ | 690| 690| else | 691| 691| { | 692| 692| // We are already at the target, or can't move at all, | | [NORMAL] ESLintBear (curly): | | Unnecessary { after 'if' condition. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | 720| 720| } | 721| 721| | 722| 722| if (this.MoveToGarrisonRange(this.order.data.target)) | 723| |- { | | 723|+ | 724| 724| this.SetNextState("INDIVIDUAL.GARRISON.APPROACHING"); | 725| |- } | | 725|+ | 726| 726| else | 727| 727| { | 728| 728| // We do a range check before actually garrisoning | | [NORMAL] ESLintBear (curly): | | Unnecessary { after 'if' condition. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | 858| 858| if (!this.CheckTargetAttackRange(target, target)) | 859| 859| { | 860| 860| if (this.TargetIsAlive(target) && this.CheckTargetVisible(target)) | 861| |- { | | 861|+ | 862| 862| if (this.MoveToTargetAttackRange(target, target)) | 863| 863| { | 864| 864| this.SetNextState("COMBAT.APPROACHING"); | 865| 865| return; | 866| 866| } | 867| |- } | | 867|+ | 868| 868| this.FinishOrder(); | 869| 869| return; | 870| 870| } | | [NORMAL] ESLintBear (curly): | | Unnecessary { after 'if' condition. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | 883| 883| } | 884| 884| // Check if we are already in range, otherwise walk there | 885| 885| if (!this.CheckGarrisonRange(msg.data.target)) | 886| |- { | | 886|+ | 887| 887| if (!this.CheckTargetVisible(msg.data.target)) | 888| 888| { | 889| 889| this.FinishOrder(); | 898| 898| return; | 899| 899| } | 900| 900| } | 901| |- } | | 901|+ | 902| 902| | 903| 903| this.SetNextState("GARRISON.GARRISONING"); | 904| 904| }, | | [NORMAL] ESLintBear (curly): | | Unnecessary { after 'else'. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | 890| 890| return; | 891| 891| } | 892| 892| else | 893| |- { | | 893|+ | 894| 894| // Out of range; move there in formation | 895| 895| if (this.MoveToGarrisonRange(msg.data.target)) | 896| 896| { | 897| 897| this.SetNextState("GARRISON.APPROACHING"); | 898| 898| return; | 899| 899| } | 900| |- } | | 900|+ | 901| 901| } | 902| 902| | 903| 903| this.SetNextState("GARRISON.GARRISONING"); | | [NORMAL] ESLintBear (no-else-return): | | Unnecessary 'else' after 'return'. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | 889| 889| this.FinishOrder(); | 890| 890| return; | 891| 891| } | 892| |- else | 893| |- { | | 892|+ | 894| 893| // Out of range; move there in formation | 895| 894| if (this.MoveToGarrisonRange(msg.data.target)) | 896| 895| { | 897| 896| this.SetNextState("GARRISON.APPROACHING"); | 898| 897| return; | 899| 898| } | 900| |- } | | 899|+ | 901| 900| } | 902| 901| | 903| 902| this.SetNextState("GARRISON.GARRISONING"); | | [NORMAL] ESLintBear (curly): | | Unnecessary { after 'else'. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | 916| 916| this.PushOrderFront("Walk", msg.data.lastPos); | 917| 917| } | 918| 918| else | 919| |- { | | 919|+ | 920| 920| // We couldn't move there, or the target moved away | 921| 921| this.FinishOrder(); | 922| |- } | | 922|+ | 923| 923| return; | 924| 924| } | 925| 925| | | [NORMAL] ESLintBear (key-spacing): | | Missing space before value for key 'GARRISON'. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js |1137|1137| }, |1138|1138| }, |1139|1139| |1140| |- "GARRISON":{ | |1140|+ "GARRISON": { |1141|1141| "enter": function() { |1142|1142| // If the garrisonholder should pickup, warn it so it can take needed action |1143|1143| var cmpGarrisonHolder = Engine.QueryInterface(this.order.data.target, IID_GarrisonHolder); | | [NORMAL] ESLintBear (curly): | | Unnecessary { after 'if' condition. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js |1318|1318| // If the controller handled an order but some members rejected it, |1319|1319| // they will have no orders and be in the FORMATIONMEMBER.IDLE state. |1320|1320| if (this.orderQueue.length) |1321| |- { | |1321|+ |1322|1322| // We're leaving the formation, so stop our FormationWalk order |1323|1323| if (this.FinishOrder()) |1324|1324| return; |1325| |- } | |1325|+ |1326|1326| |1327|1327| // No orders left, we're an individual now |1328|1328| if (this.IsAnimal()) | | [NORMAL] ESLintBear (curly): | | Unnecessary { after 'if' condition. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js |1346|1346| // Move a tile outside the building |1347|1347| let range = 4; |1348|1348| if (this.MoveToTargetRangeExplicit(msg.data.target, range, range)) |1349| |- { | |1349|+ |1350|1350| // We've started walking to the given point |1351|1351| this.SetNextState("WALKINGTOPOINT"); |1352| |- } | |1352|+ |1353|1353| else |1354|1354| { |1355|1355| // We are already at the target, or can't move at all | | [NORMAL] ESLintBear (curly): | | Unnecessary { after 'else'. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js |1351|1351| this.SetNextState("WALKINGTOPOINT"); |1352|1352| } |1353|1353| else |1354| |- { | |1354|+ |1355|1355| // We are already at the target, or can't move at all |1356|1356| this.FinishOrder(); |1357| |- } | |1357|+ |1358|1358| }, |1359|1359| |1360|1360| | | [NORMAL] ESLintBear (space-before-function-paren): | | Unexpected space before function parentheses. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js |1369|1369| }, |1370|1370| |1371|1371| "WALKING": { |1372| |- "enter": function () { | |1372|+ "enter": function() { |1373|1373| var cmpFormation = Engine.QueryInterface(this.formationController, IID_Formation); |1374|1374| var cmpVisual = Engine.QueryInterface(this.entity, IID_Visual); |1375|1375| if (cmpFormation && cmpVisual) | | [NORMAL] ESLintBear (curly): | | Unnecessary { after 'if' condition. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js |1557|1557| |1558|1558| "LosRangeUpdate": function(msg) { |1559|1559| if (this.GetStance().targetVisibleEnemies) |1560| |- { | |1560|+ |1561|1561| // Start attacking one of the newly-seen enemy (if any) |1562|1562| this.AttackEntitiesByPreference(msg.data.added); |1563| |- } | |1563|+ |1564|1564| }, |1565|1565| |1566|1566| "LosHealRangeUpdate": function(msg) { | | [NORMAL] ESLintBear (space-before-function-paren): | | Unexpected space before function parentheses. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js |1585|1585| }, |1586|1586| |1587|1587| "WALKING": { |1588| |- "enter": function () { | |1588|+ "enter": function() { |1589|1589| this.SelectAnimation("move"); |1590|1590| }, |1591|1591| | | [NORMAL] ESLintBear (space-before-function-paren): | | Unexpected space before function parentheses. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js |1595|1595| }, |1596|1596| |1597|1597| "WALKINGANDFIGHTING": { |1598| |- "enter": function () { | |1598|+ "enter": function() { |1599|1599| // Show weapons rather than carried resources. |1600|1600| this.SetAnimationVariant("combat"); |1601|1601| | | [NORMAL] ESLintBear (space-before-function-paren): | | Unexpected space before function parentheses. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js |1617|1617| }, |1618|1618| |1619|1619| "PATROL": { |1620| |- "enter": function () { | |1620|+ "enter": function() { |1621|1621| // Memorize the origin position in case that we want to go back |1622|1622| let cmpPosition = Engine.QueryInterface(this.entity, IID_Position); |1623|1623| if (!cmpPosition || !cmpPosition.IsInWorld()) | | [NORMAL] ESLintBear (space-before-function-paren): | | Unexpected space before function parentheses. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js |1661|1661| }, |1662|1662| |1663|1663| "ESCORTING": { |1664| |- "enter": function () { | |1664|+ "enter": function() { |1665|1665| // Show weapons rather than carried resources. |1666|1666| this.SetAnimationVariant("combat"); |1667|1667| | | [NORMAL] ESLintBear (space-before-function-paren): | | Unexpected space before function parentheses. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js |1710|1710| }, |1711|1711| |1712|1712| "GUARDING": { |1713| |- "enter": function () { | |1713|+ "enter": function() { |1714|1714| this.StartTimer(1000, 1000); |1715|1715| this.SetHeldPositionOnEntity(this.entity); |1716|1716| this.SelectAnimation("idle"); | | [NORMAL] ESLintBear (curly): | | Unnecessary { after 'if' condition. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js |1738|1738| // if nothing better to do, check if the guarded needs to be healed or repaired |1739|1739| var cmpHealth = Engine.QueryInterface(this.isGuardOf, IID_Health); |1740|1740| if (cmpHealth && (cmpHealth.GetHitpoints() < cmpHealth.GetMaxHitpoints())) |1741| |- { | |1741|+ |1742|1742| if (this.CanHeal(this.isGuardOf)) |1743|1743| this.PushOrderFront("Heal", { "target": this.isGuardOf, "force": false }); |1744|1744| else if (this.CanRepair(this.isGuardOf)) |1745|1745| this.PushOrderFront("Repair", { "target": this.isGuardOf, "autocontinue": false, "force": false }); |1746| |- } | |1746|+ |1747|1747| } |1748|1748| }, |1749|1749| | | [NORMAL] ESLintBear (space-before-function-paren): | | Unexpected space before function parentheses. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js |1795|1795| }, |1796|1796| |1797|1797| "APPROACHING": { |1798| |- "enter": function () { | |1798|+ "enter": function() { |1799|1799| // Show weapons rather than carried resources. |1800|1800| this.SetAnimationVariant("combat"); |1801|1801| | | [NORMAL] ESLintBear (curly): | | Unnecessary { after 'if' condition. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js |1825|1825| "MoveCompleted": function() { |1826|1826| |1827|1827| if (this.CheckTargetAttackRange(this.order.data.target, this.order.data.attackType)) |1828| |- { | |1828|+ |1829|1829| // If the unit needs to unpack, do so |1830|1830| if (this.CanUnpack()) |1831|1831| { |1834|1834| } |1835|1835| else |1836|1836| this.SetNextState("ATTACKING"); |1837| |- } | |1837|+ |1838|1838| else |1839|1839| { |1840|1840| if (this.MoveToTargetAttackRange(this.order.data.target, this.order.data.attackType)) | | [NORMAL] ESLintBear (no-else-return): | | Unnecessary 'else' after 'return'. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js |1832|1832| this.PushOrderFront("Unpack", { "force": true }); |1833|1833| return; |1834|1834| } |1835| |- else |1836| |- this.SetNextState("ATTACKING"); | |1835|+ this.SetNextState("ATTACKING"); |1837|1836| } |1838|1837| else |1839|1838| { | | [NORMAL] ESLintBear (curly): | | Unnecessary { after 'else'. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js |1836|1836| this.SetNextState("ATTACKING"); |1837|1837| } |1838|1838| else |1839| |- { | |1839|+ |1840|1840| if (this.MoveToTargetAttackRange(this.order.data.target, this.order.data.attackType)) |1841|1841| { |1842|1842| this.SetNextState("APPROACHING"); |1846|1846| // Give up |1847|1847| this.FinishOrder(); |1848|1848| } |1849| |- } | |1849|+ |1850|1850| }, |1851|1851| }, |1852|1852| | | [NORMAL] ESLintBear (curly): | | Unnecessary { after 'if' condition. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js |1838|1838| else |1839|1839| { |1840|1840| if (this.MoveToTargetAttackRange(this.order.data.target, this.order.data.attackType)) |1841| |- { | |1841|+ |1842|1842| this.SetNextState("APPROACHING"); |1843| |- } | |1843|+ |1844|1844| else |1845|1845| { |1846|1846| // Give up | | [NORMAL] ESLintBear (curly): | | Unnecessary { after 'else'. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js |1842|1842| this.SetNextState("APPROACHING"); |1843|1843| } |1844|1844| else |1845| |- { | |1845|+ |1846|1846| // Give up |1847|1847| this.FinishOrder(); |1848| |- } | |1848|+ |1849|1849| } |1850|1850| }, |1851|1851| }, | | [NORMAL] ESLintBear (curly): | | Unnecessary { after 'if' condition. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js |1863|1863| } |1864|1864| // Check the target is still alive and attackable |1865|1865| if (this.CanAttack(target) && !this.CheckTargetAttackRange(target, this.order.data.attackType)) |1866| |- { | |1866|+ |1867|1867| // Can't reach it - try to chase after it |1868|1868| if (this.ShouldChaseTargetedEntity(target, this.order.data.force)) |1869|1869| { |1873|1873| return; |1874|1874| } |1875|1875| } |1876| |- } | |1876|+ |1877|1877| |1878|1878| var cmpAttack = Engine.QueryInterface(this.entity, IID_Attack); |1879|1879| this.attackTimers = cmpAttack.GetTimers(this.order.data.attackType); | | [NORMAL] ESLintBear (curly): | | Unnecessary { after 'if' condition. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js |1866|1866| { |1867|1867| // Can't reach it - try to chase after it |1868|1868| if (this.ShouldChaseTargetedEntity(target, this.order.data.force)) |1869| |- { | |1869|+ |1870|1870| if (this.MoveToTargetAttackRange(target, this.order.data.attackType)) |1871|1871| { |1872|1872| this.SetNextState("COMBAT.CHASING"); |1873|1873| return; |1874|1874| } |1875| |- } | |1875|+ |1876|1876| } |1877|1877| |1878|1878| var cmpAttack = Engine.QueryInterface(this.entity, IID_Attack); | | [NORMAL] ESLintBear (no-unneeded-ternary): | | Unnecessary use of boolean literals in conditional expression. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js |1903|1903| // TODO: we should probably only bother syncing projectile attacks, not melee |1904|1904| |1905|1905| // If using a non-default prepare time, re-sync the animation when the timer runs. |1906| |- this.resyncAnimation = (prepare != this.attackTimers.prepare) ? true : false; | |1906|+ this.resyncAnimation = (prepare != this.attackTimers.prepare); |1907|1907| |1908|1908| this.FaceTowardsTarget(this.order.data.target); |1909|1909| | | [NORMAL] ESLintBear (curly): | | Unnecessary { after 'if' condition. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js |1977|1977| |1978|1978| // Can't reach it - try to chase after it |1979|1979| if (this.ShouldChaseTargetedEntity(target, this.order.data.force)) |1980| |- { | |1980|+ |1981|1981| if (this.MoveToTargetRange(target, IID_Attack, this.order.data.attackType)) |1982|1982| { |1983|1983| this.SetNextState("COMBAT.CHASING"); |1984|1984| return; |1985|1985| } |1986| |- } | |1986|+ |1987|1987| } |1988|1988| |1989|1989| // if we're targetting a formation, find a new member of that formation | | [NORMAL] ESLintBear (operator-linebreak): | | '&&' should be placed at the end of the line. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js |2024|2024| |2025|2025| "Attacked": function(msg) { |2026|2026| // If we are capturing and are attacked by something that we would not capture, attack that entity instead |2027| |- if (this.order.data.attackType == "Capture" && (this.GetStance().targetAttackersAlways || !this.order.data.force) |2028| |- && this.order.data.target != msg.data.attacker && this.GetBestAttackAgainst(msg.data.attacker, true) != "Capture") | |2027|+ if (this.order.data.attackType == "Capture" && (this.GetStance().targetAttackersAlways || !this.order.data.force) && | |2028|+ this.order.data.target != msg.data.attacker && this.GetBestAttackAgainst(msg.data.attacker, true) != "Capture") |2029|2029| this.RespondToTargetedEntities([msg.data.attacker]); |2030|2030| }, |2031|2031| }, | | [NORMAL] ESLintBear (space-before-function-paren): | | Unexpected space before function parentheses. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js |2031|2031| }, |2032|2032| |2033|2033| "CHASING": { |2034| |- "enter": function () { | |2034|+ "enter": function() { |2035|2035| // Show weapons rather than carried resources. |2036|2036| this.SetAnimationVariant("combat"); |2037|2037| | | [NORMAL] ESLintBear (space-before-function-paren): | | Unexpected space before function parentheses. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js |2106|2106| |2107|2107| // Try to find another nearby target of the same specific type |2108|2108| // Also don't switch to a different type of huntable animal |2109| |- var nearby = this.FindNearbyResource(function (ent, type, template) { | |2109|+ var nearby = this.FindNearbyResource(function(ent, type, template) { |2110|2110| return ( |2111|2111| ent != oldTarget |2112|2112| && ((type.generic == "treasure" && oldType.generic == "treasure") | | [NORMAL] ESLintBear (operator-linebreak): | | '&&' should be placed at the end of the line. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js |2108|2108| // Also don't switch to a different type of huntable animal |2109|2109| var nearby = this.FindNearbyResource(function (ent, type, template) { |2110|2110| return ( |2111| |- ent != oldTarget |2112| |- && ((type.generic == "treasure" && oldType.generic == "treasure") | |2111|+ ent != oldTarget && | |2112|+ ((type.generic == "treasure" && oldType.generic == "treasure") |2113|2113| || (type.specific == oldType.specific |2114|2114| && (type.specific != "meat" || oldTemplate == template))) |2115|2115| ); | | [NORMAL] ESLintBear (operator-linebreak): | | '||' should be placed at the end of the line. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js |2109|2109| var nearby = this.FindNearbyResource(function (ent, type, template) { |2110|2110| return ( |2111|2111| ent != oldTarget |2112| |- && ((type.generic == "treasure" && oldType.generic == "treasure") |2113| |- || (type.specific == oldType.specific | |2112|+ && ((type.generic == "treasure" && oldType.generic == "treasure") || | |2113|+ (type.specific == oldType.specific |2114|2114| && (type.specific != "meat" || oldTemplate == template))) |2115|2115| ); |2116|2116| }, oldTarget); | | [NORMAL] ESLintBear (operator-linebreak): | | '&&' should be placed at the end of the line. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js |2110|2110| return ( |2111|2111| ent != oldTarget |2112|2112| && ((type.generic == "treasure" && oldType.generic == "treasure") |2113| |- || (type.specific == oldType.specific |2114| |- && (type.specific != "meat" || oldTemplate == template))) | |2113|+ || (type.specific == oldType.specific && | |2114|+ (type.specific != "meat" || oldTemplate == template))) |2115|2115| ); |2116|2116| }, oldTarget); |2117|2117| if (nearby) | | [NORMAL] ESLintBear (no-else-return): | | Unnecessary 'else' after 'return'. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js |2119|2119| this.PerformGather(nearby, false, false); |2120|2120| return true; |2121|2121| } |2122| |- else |2123| |- { | |2122|+ |2124|2123| // It's probably better in this case, to avoid units getting stuck around a dropsite |2125|2124| // in a "Target is far away, full, nearby are no good resources, return to dropsite" loop |2126|2125| // to order it to GatherNear the resource position. |2141|2140| return true; |2142|2141| } |2143|2142| } |2144| |- } | |2143|+ |2145|2144| return true; |2146|2145| } |2147|2146| return false; | | [NORMAL] ESLintBear (no-else-return): | | Unnecessary 'else' after 'return'. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js |2131|2131| this.GatherNearPosition(pos.x, pos.z, oldType, oldTemplate); |2132|2132| return true; |2133|2133| } |2134| |- else |2135| |- { | |2134|+ |2136|2135| // we're kind of stuck here. Return resource. |2137|2136| var nearby = this.FindNearestDropsite(oldType.generic); |2138|2137| if (nearby) |2140|2139| this.PushOrderFront("ReturnResource", { "target": nearby, "force": false }); |2141|2140| return true; |2142|2141| } |2143| |- } | |2142|+ |2144|2143| } |2145|2144| return true; |2146|2145| } | | [NORMAL] ESLintBear (space-before-function-paren): | | Unexpected space before function parentheses. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js |2171|2171| |2172|2172| // Try to find another nearby target of the same specific type |2173|2173| // Also don't switch to a different type of huntable animal |2174| |- var nearby = this.FindNearbyResource(function (ent, type, template) { | |2174|+ var nearby = this.FindNearbyResource(function(ent, type, template) { |2175|2175| return ( |2176|2176| ent != oldTarget |2177|2177| && ((type.generic == "treasure" && oldType.generic == "treasure") | | [NORMAL] ESLintBear (operator-linebreak): | | '&&' should be placed at the end of the line. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js |2173|2173| // Also don't switch to a different type of huntable animal |2174|2174| var nearby = this.FindNearbyResource(function (ent, type, template) { |2175|2175| return ( |2176| |- ent != oldTarget |2177| |- && ((type.generic == "treasure" && oldType.generic == "treasure") | |2176|+ ent != oldTarget && | |2177|+ ((type.generic == "treasure" && oldType.generic == "treasure") |2178|2178| || (type.specific == oldType.specific |2179|2179| && (type.specific != "meat" || oldTemplate == template))) |2180|2180| ); | | [NORMAL] ESLintBear (operator-linebreak): | | '||' should be placed at the end of the line. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js |2174|2174| var nearby = this.FindNearbyResource(function (ent, type, template) { |2175|2175| return ( |2176|2176| ent != oldTarget |2177| |- && ((type.generic == "treasure" && oldType.generic == "treasure") |2178| |- || (type.specific == oldType.specific | |2177|+ && ((type.generic == "treasure" && oldType.generic == "treasure") || | |2178|+ (type.specific == oldType.specific |2179|2179| && (type.specific != "meat" || oldTemplate == template))) |2180|2180| ); |2181|2181| }); | | [NORMAL] ESLintBear (operator-linebreak): | | '&&' should be placed at the end of the line. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js |2175|2175| return ( |2176|2176| ent != oldTarget |2177|2177| && ((type.generic == "treasure" && oldType.generic == "treasure") |2178| |- || (type.specific == oldType.specific |2179| |- && (type.specific != "meat" || oldTemplate == template))) | |2178|+ || (type.specific == oldType.specific && | |2179|+ (type.specific != "meat" || oldTemplate == template))) |2180|2180| ); |2181|2181| }); |2182|2182| if (nearby) | | [NORMAL] ESLintBear (space-before-function-paren): | | Unexpected space before function parentheses. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js |2217|2217| |2218|2218| // Try to find another nearby target of the same specific type |2219|2219| // Also don't switch to a different type of huntable animal |2220| |- var nearby = this.FindNearbyResource(function (ent, type, template) { | |2220|+ var nearby = this.FindNearbyResource(function(ent, type, template) { |2221|2221| return ( |2222|2222| (type.generic == "treasure" && resourceType.generic == "treasure") |2223|2223| || (type.specific == resourceType.specific | | [NORMAL] ESLintBear (operator-linebreak): | | '||' should be placed at the end of the line. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js |2219|2219| // Also don't switch to a different type of huntable animal |2220|2220| var nearby = this.FindNearbyResource(function (ent, type, template) { |2221|2221| return ( |2222| |- (type.generic == "treasure" && resourceType.generic == "treasure") |2223| |- || (type.specific == resourceType.specific | |2222|+ (type.generic == "treasure" && resourceType.generic == "treasure") || | |2223|+ (type.specific == resourceType.specific |2224|2224| && (type.specific != "meat" || resourceTemplate == template)) |2225|2225| ); |2226|2226| }); | | [NORMAL] ESLintBear (operator-linebreak): | | '&&' should be placed at the end of the line. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js |2220|2220| var nearby = this.FindNearbyResource(function (ent, type, template) { |2221|2221| return ( |2222|2222| (type.generic == "treasure" && resourceType.generic == "treasure") |2223| |- || (type.specific == resourceType.specific |2224| |- && (type.specific != "meat" || resourceTemplate == template)) | |2223|+ || (type.specific == resourceType.specific && | |2224|+ (type.specific != "meat" || resourceTemplate == template)) |2225|2225| ); |2226|2226| }); |2227|2227| | | [NORMAL] ESLintBear (curly): | | Unnecessary { after 'if' condition. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js |2336|2336| |2337|2337| var cmpSupply = Engine.QueryInterface(this.gatheringTarget, IID_ResourceSupply); |2338|2338| if (cmpSupply && cmpSupply.IsAvailable(cmpOwnership.GetOwner(), this.entity)) |2339| |- { | |2339|+ |2340|2340| // Check we can still reach and gather from the target |2341|2341| if (this.CheckTargetRange(this.gatheringTarget, IID_ResourceGatherer) && this.CanGather(this.gatheringTarget)) |2342|2342| { |2402|2402| return; |2403|2403| } |2404|2404| } |2405| |- } | |2405|+ |2406|2406| |2407|2407| // We're already in range, can't get anywhere near it or the target is exhausted. |2408|2408| | | [NORMAL] ESLintBear (space-before-function-paren): | | Unexpected space before function parentheses. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js |2426|2426| |2427|2427| // Try to find a new resource of the same specific type near our current position: |2428|2428| // Also don't switch to a different type of huntable animal |2429| |- var nearby = this.FindNearbyResource(function (ent, type, template) { | |2429|+ var nearby = this.FindNearbyResource(function(ent, type, template) { |2430|2430| return ( |2431|2431| (type.generic == "treasure" && resourceType.generic == "treasure") |2432|2432| || (type.specific == resourceType.specific | | [NORMAL] ESLintBear (operator-linebreak): | | '||' should be placed at the end of the line. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js |2428|2428| // Also don't switch to a different type of huntable animal |2429|2429| var nearby = this.FindNearbyResource(function (ent, type, template) { |2430|2430| return ( |2431| |- (type.generic == "treasure" && resourceType.generic == "treasure") |2432| |- || (type.specific == resourceType.specific | |2431|+ (type.generic == "treasure" && resourceType.generic == "treasure") || | |2432|+ (type.specific == resourceType.specific |2433|2433| && (type.specific != "meat" || resourceTemplate == template)) |2434|2434| ); |2435|2435| }); | | [NORMAL] ESLintBear (operator-linebreak): | | '&&' should be placed at the end of the line. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js |2429|2429| var nearby = this.FindNearbyResource(function (ent, type, template) { |2430|2430| return ( |2431|2431| (type.generic == "treasure" && resourceType.generic == "treasure") |2432| |- || (type.specific == resourceType.specific |2433| |- && (type.specific != "meat" || resourceTemplate == template)) | |2432|+ || (type.specific == resourceType.specific && | |2433|+ (type.specific != "meat" || resourceTemplate == template)) |2434|2434| ); |2435|2435| }); |2436|2436| if (nearby) | | [NORMAL] ESLintBear (space-before-function-paren): | | Unexpected space before function parentheses. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js |2470|2470| }, |2471|2471| |2472|2472| "APPROACHING": { |2473| |- "enter": function () { | |2473|+ "enter": function() { |2474|2474| this.SelectAnimation("move"); |2475|2475| this.StartTimer(1000, 1000); |2476|2476| }, | | [NORMAL] ESLintBear (no-unneeded-ternary): | | Unnecessary use of boolean literals in conditional expression. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js |2516|2516| this.StartTimer(prepare, this.healTimers.repeat); |2517|2517| |2518|2518| // If using a non-default prepare time, re-sync the animation when the timer runs. |2519| |- this.resyncAnimation = (prepare != this.healTimers.prepare) ? true : false; | |2519|+ this.resyncAnimation = (prepare != this.healTimers.prepare); |2520|2520| |2521|2521| this.FaceTowardsTarget(this.order.data.target); |2522|2522| }, | | [NORMAL] ESLintBear (curly): | | Unnecessary { after 'if' condition. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js |2549|2549| } |2550|2550| // Can't reach it - try to chase after it |2551|2551| if (this.ShouldChaseTargetedEntity(target, this.order.data.force)) |2552| |- { | |2552|+ |2553|2553| if (this.MoveToTargetRange(target, IID_Heal)) |2554|2554| { |2555|2555| this.SetNextState("HEAL.CHASING"); |2556|2556| return; |2557|2557| } |2558| |- } | |2558|+ |2559|2559| } |2560|2560| // Can't reach it, healed to max hp or doesn't exist any more - give up |2561|2561| if (this.FinishOrder()) | | [NORMAL] ESLintBear (space-before-function-paren): | | Unexpected space before function parentheses. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js |2571|2571| }, |2572|2572| }, |2573|2573| "CHASING": { |2574| |- "enter": function () { | |2574|+ "enter": function() { |2575|2575| this.SelectAnimation("move"); |2576|2576| this.StartTimer(1000, 1000); |2577|2577| }, | | [NORMAL] ESLintBear (space-before-function-paren): | | Unexpected space before function parentheses. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js |2576|2576| this.StartTimer(1000, 1000); |2577|2577| }, |2578|2578| |2579| |- "leave": function () { | |2579|+ "leave": function() { |2580|2580| this.StopTimer(); |2581|2581| }, |2582|2582| "Timer": function(msg) { | | [NORMAL] ESLintBear (space-before-function-paren): | | Unexpected space before function parentheses. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js |2590|2590| this.WalkToHeldPosition(); |2591|2591| } |2592|2592| }, |2593| |- "MoveCompleted": function () { | |2593|+ "MoveCompleted": function() { |2594|2594| this.SetNextState("HEALING"); |2595|2595| }, |2596|2596| }, | | [NORMAL] ESLintBear (space-before-function-paren): | | Unexpected space before function parentheses. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js |2599|2599| // Returning to dropsite |2600|2600| "RETURNRESOURCE": { |2601|2601| "APPROACHING": { |2602| |- "enter": function () { | |2602|+ "enter": function() { |2603|2603| this.SelectAnimation("move"); |2604|2604| }, |2605|2605| | | [NORMAL] ESLintBear (space-before-function-paren): | | Unexpected space before function parentheses. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js |2657|2657| }, |2658|2658| |2659|2659| "APPROACHINGMARKET": { |2660| |- "enter": function () { | |2660|+ "enter": function() { |2661|2661| this.SelectAnimation("move"); |2662|2662| }, |2663|2663| | | [NORMAL] ESLintBear (space-before-function-paren): | | Unexpected space before function parentheses. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js |2685|2685| |2686|2686| "REPAIR": { |2687|2687| "APPROACHING": { |2688| |- "enter": function () { | |2688|+ "enter": function() { |2689|2689| this.SelectAnimation("move"); |2690|2690| }, |2691|2691| | | [NORMAL] ESLintBear (object-curly-spacing): | | A space is required after '{'. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js |2726|2726| { |2727|2727| // The building was already finished/fully repaired before we arrived; |2728|2728| // let the ConstructionFinished handler handle this. |2729| |- this.OnGlobalConstructionFinished({"entity": this.repairTarget, "newentity": this.repairTarget}); | |2729|+ this.OnGlobalConstructionFinished({ "entity": this.repairTarget, "newentity": this.repairTarget}); |2730|2730| return true; |2731|2731| } |2732|2732| | | [NORMAL] ESLintBear (object-curly-spacing): | | A space is required before '}'. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js |2726|2726| { |2727|2727| // The building was already finished/fully repaired before we arrived; |2728|2728| // let the ConstructionFinished handler handle this. |2729| |- this.OnGlobalConstructionFinished({"entity": this.repairTarget, "newentity": this.repairTarget}); | |2729|+ this.OnGlobalConstructionFinished({"entity": this.repairTarget, "newentity": this.repairTarget }); |2730|2730| return true; |2731|2731| } |2732|2732| | | [NORMAL] ESLintBear (spaced-comment): | | Expected space or tab after '//' in comment. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js |2766|2766| if (this.MoveToTargetRange(this.repairTarget, IID_Builder)) |2767|2767| this.SetNextState("APPROACHING"); |2768|2768| else if (!this.CheckTargetRange(this.repairTarget, IID_Builder)) |2769| |- this.FinishOrder(); //can't approach and isn't in reach | |2769|+ this.FinishOrder(); // can't approach and isn't in reach |2770|2770| }, |2771|2771| }, |2772|2772| | | [NORMAL] ESLintBear (space-before-function-paren): | | Unexpected space before function parentheses. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js |2833|2833| var types = cmpResourceDropsite.GetTypes(); |2834|2834| // TODO: Slightly undefined behavior here, we don't know what type of resource will be collected, |2835|2835| // may cause problems for AIs (especially hunting fast animals), but avoid ugly hacks to fix that! |2836| |- var nearby = this.FindNearbyResource(function (ent, type, template) { | |2836|+ var nearby = this.FindNearbyResource(function(ent, type, template) { |2837|2837| return (types.indexOf(type.generic) != -1); |2838|2838| }, msg.data.newentity); |2839|2839| if (nearby) | | [NORMAL] ESLintBear (curly): | | Unnecessary { after 'if' condition. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js |2853|2853| |2854|2854| // Unit was approaching and there's nothing to do now, so switch to walking |2855|2855| if (oldState === "INDIVIDUAL.REPAIR.APPROACHING") |2856| |- { | |2856|+ |2857|2857| // We're already walking to the given point, so add this as a order. |2858|2858| this.WalkToTarget(msg.data.newentity, true); |2859| |- } | |2859|+ |2860|2860| }, |2861|2861| }, |2862|2862| | | [NORMAL] ESLintBear (curly): | | Unnecessary { after 'if' condition. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js |2903|2903| |2904|2904| // Check that we can garrison here |2905|2905| if (this.CanGarrison(target)) |2906| |- { | |2906|+ |2907|2907| // Check that we're in range of the garrison target |2908|2908| if (this.CheckGarrisonRange(target)) |2909|2909| { |2979|2979| return false; |2980|2980| } |2981|2981| } |2982| |- } | |2982|+ |2983|2983| // Garrisoning failed for some reason, so finish the order |2984|2984| this.FinishOrder(); |2985|2985| return true; | | [NORMAL] ESLintBear (curly): | | Unnecessary { after 'if' condition. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js |3096|3096| "Attacked": function(msg) { |3097|3097| if (this.template.NaturalBehaviour == "skittish" || |3098|3098| this.template.NaturalBehaviour == "passive") |3099| |- { | |3099|+ |3100|3100| this.Flee(msg.data.attacker, false); |3101| |- } | |3101|+ |3102|3102| else if (this.IsDangerousAnimal() || this.template.NaturalBehaviour == "defensive") |3103|3103| { |3104|3104| if (this.CanAttack(msg.data.attacker)) | | [NORMAL] ESLintBear (curly): | | Unnecessary { after 'if' condition. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js |3105|3105| this.Attack(msg.data.attacker, false); |3106|3106| } |3107|3107| else if (this.template.NaturalBehaviour == "domestic") |3108| |- { | |3108|+ |3109|3109| // Never flee, stop what we were doing |3110|3110| this.SetNextState("IDLE"); |3111| |- } | |3111|+ |3112|3112| }, |3113|3113| |3114|3114| "Order.LeaveFoundation": function(msg) { | | [NORMAL] ESLintBear (curly): | | Unnecessary { after 'if' condition. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js |3115|3115| // Move a tile outside the building |3116|3116| var range = 4; |3117|3117| if (this.MoveToTargetRangeExplicit(msg.data.target, range, range)) |3118| |- { | |3118|+ |3119|3119| // We've started walking to the given point |3120|3120| this.SetNextState("WALKING"); |3121| |- } | |3121|+ |3122|3122| else |3123|3123| { |3124|3124| // We are already at the target, or can't move at all | | [NORMAL] ESLintBear (curly): | | Unnecessary { after 'else'. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js |3120|3120| this.SetNextState("WALKING"); |3121|3121| } |3122|3122| else |3123| |- { | |3123|+ |3124|3124| // We are already at the target, or can't move at all |3125|3125| this.FinishOrder(); |3126| |- } | |3126|+ |3127|3127| }, |3128|3128| |3129|3129| "IDLE": { | | [NORMAL] ESLintBear (curly): | | Unnecessary { after 'if' condition. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js |3162|3162| } |3163|3163| // Start attacking one of the newly-seen enemy (if any) |3164|3164| else if (this.IsDangerousAnimal()) |3165| |- { | |3165|+ |3166|3166| this.AttackVisibleEntity(msg.data.added); |3167| |- } | |3167|+ |3168|3168| |3169|3169| // TODO: if two units enter our range together, we'll attack the |3170|3170| // first and then the second won't trigger another LosRangeUpdate | | [NORMAL] ESLintBear (curly): | | Unnecessary { after 'if' condition. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js |3205|3205| } |3206|3206| // Start attacking one of the newly-seen enemy (if any) |3207|3207| else if (this.template.NaturalBehaviour == "violent") |3208| |- { | |3208|+ |3209|3209| this.AttackVisibleEntity(msg.data.added); |3210| |- } | |3210|+ |3211|3211| }, |3212|3212| |3213|3213| "MoveCompleted": function() { }, | | [NORMAL] ESLintBear (indent): | | Expected indentation of 2 tabs but found 7. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js |3222|3222| "COMBAT": "INDIVIDUAL.COMBAT", // reuse the same combat behaviour for animals |3223|3223| |3224|3224| "WALKING": "INDIVIDUAL.WALKING", // reuse the same walking behaviour for animals |3225| |- // only used for domestic animals | |3225|+ // only used for domestic animals |3226|3226| }, |3227|3227| }; |3228|3228| | | [NORMAL] ESLintBear (no-unneeded-ternary): | | Unnecessary use of boolean literals in conditional expression. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js |3284|3284| |3285|3285| UnitAI.prototype.IsAnimal = function() |3286|3286| { |3287| |- return (this.template.NaturalBehaviour ? true : false); | |3287|+ return (!!this.template.NaturalBehaviour); |3288|3288| }; |3289|3289| |3290|3290| UnitAI.prototype.IsDangerousAnimal = function() | | [NORMAL] ESLintBear (curly): | | Unnecessary { after 'if' condition. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js |3322|3322| UnitAI.prototype.GetGarrisonHolder = function() |3323|3323| { |3324|3324| if (this.IsGarrisoned()) |3325| |- { | |3325|+ |3326|3326| for (let order of this.orderQueue) |3327|3327| if (order.type == "Garrison" || order.type == "Autogarrison") |3328|3328| return order.data.target; |3329| |- } | |3329|+ |3330|3330| return INVALID_ENTITY; |3331|3331| }; |3332|3332| | | [NORMAL] ESLintBear (comma-spacing): | | A space is required after ','. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js |3403|3403| { |3404|3404| let index = this.GetCurrentState().indexOf("."); |3405|3405| if (index != -1) |3406| |- this.UnitFsm.SwitchToNextState(this, this.GetCurrentState().slice(0,index)); | |3406|+ this.UnitFsm.SwitchToNextState(this, this.GetCurrentState().slice(0, index)); |3407|3407| this.Stop(false); |3408|3408| } |3409|3409| | | [NORMAL] ESLintBear (object-curly-spacing): | | A space is required after '{'. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js |3459|3459| if (this.orderQueue[i].type != "PickupUnit" || this.orderQueue[i].data.target != msg.entity) |3460|3460| continue; |3461|3461| if (i == 0) |3462| |- this.UnitFsm.ProcessMessage(this, {"type": "PickupCanceled", "data": msg}); | |3462|+ this.UnitFsm.ProcessMessage(this, { "type": "PickupCanceled", "data": msg}); |3463|3463| else |3464|3464| this.orderQueue.splice(i, 1); |3465|3465| Engine.PostMessage(this.entity, MT_UnitAIOrderDataChanged, { "to": this.GetOrderData() }); | | [NORMAL] ESLintBear (object-curly-spacing): | | A space is required before '}'. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js |3459|3459| if (this.orderQueue[i].type != "PickupUnit" || this.orderQueue[i].data.target != msg.entity) |3460|3460| continue; |3461|3461| if (i == 0) |3462| |- this.UnitFsm.ProcessMessage(this, {"type": "PickupCanceled", "data": msg}); | |3462|+ this.UnitFsm.ProcessMessage(this, {"type": "PickupCanceled", "data": msg }); |3463|3463| else |3464|3464| this.orderQueue.splice(i, 1); |3465|3465| Engine.PostMessage(this.entity, MT_UnitAIOrderDataChanged, { "to": this.GetOrderData() }); | | [NORMAL] ESLintBear (spaced-comment): | | Expected space or tab after '//' in comment. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js |3543|3543| }; |3544|3544| |3545|3545| |3546| |-//// FSM linkage functions //// | |3546|+// // FSM linkage functions //// |3547|3547| |3548|3548| UnitAI.prototype.SetNextState = function(state) |3549|3549| { | | [NORMAL] ESLintBear (object-curly-spacing): | | A space is required after '{'. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js |3594|3594| if (this.orderQueue.length) |3595|3595| { |3596|3596| let ret = this.UnitFsm.ProcessMessage(this, |3597| |- {"type": "Order."+this.order.type, "data": this.order.data} | |3597|+ { "type": "Order."+this.order.type, "data": this.order.data} |3598|3598| ); |3599|3599| |3600|3600| Engine.PostMessage(this.entity, MT_UnitAIOrderDataChanged, { "to": this.GetOrderData() }); | | [NORMAL] ESLintBear (object-curly-spacing): | | A space is required before '}'. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js |3594|3594| if (this.orderQueue.length) |3595|3595| { |3596|3596| let ret = this.UnitFsm.ProcessMessage(this, |3597| |- {"type": "Order."+this.order.type, "data": this.order.data} | |3597|+ {"type": "Order."+this.order.type, "data": this.order.data } |3598|3598| ); |3599|3599| |3600|3600| Engine.PostMessage(this.entity, MT_UnitAIOrderDataChanged, { "to": this.GetOrderData() }); | | [NORMAL] ESLintBear (no-else-return): | | Unnecessary 'else' after 'return'. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js |3607|3607| // Otherwise we've successfully processed a new order |3608|3608| return true; |3609|3609| } |3610| |- else |3611| |- { | |3610|+ |3612|3611| this.SetNextState("IDLE"); |3613|3612| |3614|3613| Engine.PostMessage(this.entity, MT_UnitAIOrderDataChanged, { "to": this.GetOrderData() }); |3629|3628| } |3630|3629| |3631|3630| return false; |3632| |- } | |3631|+ |3633|3632| }; |3634|3633| |3635|3634| /** | | [NORMAL] ESLintBear (object-curly-spacing): | | A space is required after '{'. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js |3646|3646| { |3647|3647| this.order = order; |3648|3648| let ret = this.UnitFsm.ProcessMessage(this, |3649| |- {"type": "Order."+this.order.type, "data": this.order.data} | |3649|+ { "type": "Order."+this.order.type, "data": this.order.data} |3650|3650| ); |3651|3651| |3652|3652| // If the order was rejected then immediately take it off | | [NORMAL] ESLintBear (object-curly-spacing): | | A space is required before '}'. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js |3646|3646| { |3647|3647| this.order = order; |3648|3648| let ret = this.UnitFsm.ProcessMessage(this, |3649| |- {"type": "Order."+this.order.type, "data": this.order.data} | |3649|+ {"type": "Order."+this.order.type, "data": this.order.data } |3650|3650| ); |3651|3651| |3652|3652| // If the order was rejected then immediately take it off | | [NORMAL] ESLintBear (object-curly-spacing): | | A space is required after '{'. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js |3682|3682| this.orderQueue.unshift(order); |3683|3683| this.order = order; |3684|3684| let ret = this.UnitFsm.ProcessMessage(this, |3685| |- {"type": "Order."+this.order.type, "data": this.order.data} | |3685|+ { "type": "Order."+this.order.type, "data": this.order.data} |3686|3686| ); |3687|3687| |3688|3688| // If the order was rejected then immediately take it off again; | | [NORMAL] ESLintBear (object-curly-spacing): | | A space is required before '}'. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js |3682|3682| this.orderQueue.unshift(order); |3683|3683| this.order = order; |3684|3684| let ret = this.UnitFsm.ProcessMessage(this, |3685| |- {"type": "Order."+this.order.type, "data": this.order.data} | |3685|+ {"type": "Order."+this.order.type, "data": this.order.data } |3686|3686| ); |3687|3687| |3688|3688| // If the order was rejected then immediately take it off again; | | [NORMAL] ESLintBear (object-curly-spacing): | | A space is required after '{'. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js |3716|3716| continue; |3717|3717| if (this.orderQueue[i].type == type) |3718|3718| continue; |3719| |- this.orderQueue.splice(i, 0, {"type": type, "data": data}); | |3719|+ this.orderQueue.splice(i, 0, { "type": type, "data": data}); |3720|3720| Engine.PostMessage(this.entity, MT_UnitAIOrderDataChanged, { "to": this.GetOrderData() }); |3721|3721| return; |3722|3722| } | | [NORMAL] ESLintBear (object-curly-spacing): | | A space is required before '}'. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js |3716|3716| continue; |3717|3717| if (this.orderQueue[i].type == type) |3718|3718| continue; |3719| |- this.orderQueue.splice(i, 0, {"type": type, "data": data}); | |3719|+ this.orderQueue.splice(i, 0, {"type": type, "data": data }); |3720|3720| Engine.PostMessage(this.entity, MT_UnitAIOrderDataChanged, { "to": this.GetOrderData() }); |3721|3721| return; |3722|3722| } | | [NORMAL] ESLintBear (curly): | | Unnecessary { after 'if' condition. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js |3730|3730| { |3731|3731| // Remember the previous work orders to be able to go back to them later if required |3732|3732| if (data && data.force) |3733| |- { | |3733|+ |3734|3734| if (this.IsFormationController()) |3735|3735| this.CallMemberFunction("UpdateWorkOrders", [type]); |3736|3736| else |3737|3737| this.UpdateWorkOrders(type); |3738| |- } | |3738|+ |3739|3739| |3740|3740| let garrisonHolder = this.IsGarrisoned() && type != "Ungarrison" ? this.GetGarrisonHolder() : null; |3741|3741| | | [NORMAL] ESLintBear (curly): | | Unnecessary { after 'if' condition. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js |3807|3807| { |3808|3808| var cmpUnitAI = Engine.QueryInterface(this.formationController, IID_UnitAI); |3809|3809| if (cmpUnitAI) |3810| |- { | |3810|+ |3811|3811| for (var i = 0; i < cmpUnitAI.orderQueue.length; ++i) |3812|3812| { |3813|3813| if (isWorkType(cmpUnitAI.orderQueue[i].type)) |3816|3816| return; |3817|3817| } |3818|3818| } |3819| |- } | |3819|+ |3820|3820| } |3821|3821| |3822|3822| // If nothing found, take the unit orders | | [NORMAL] ESLintBear (curly): | | Unnecessary { after 'for' condition. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js |3809|3809| if (cmpUnitAI) |3810|3810| { |3811|3811| for (var i = 0; i < cmpUnitAI.orderQueue.length; ++i) |3812| |- { | |3812|+ |3813|3813| if (isWorkType(cmpUnitAI.orderQueue[i].type)) |3814|3814| { |3815|3815| this.workOrders = cmpUnitAI.orderQueue.slice(i); |3816|3816| return; |3817|3817| } |3818| |- } | |3818|+ |3819|3819| } |3820|3820| } |3821|3821| | | [NORMAL] ESLintBear (curly): | | Unnecessary { after 'for' condition. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js |3821|3821| |3822|3822| // If nothing found, take the unit orders |3823|3823| for (var i = 0; i < this.orderQueue.length; ++i) |3824| |- { | |3824|+ |3825|3825| if (isWorkType(this.orderQueue[i].type)) |3826|3826| { |3827|3827| this.workOrders = this.orderQueue.slice(i); |3828|3828| return; |3829|3829| } |3830| |- } | |3830|+ |3831|3831| }; |3832|3832| |3833|3833| UnitAI.prototype.BackToWork = function() | | [NORMAL] ESLintBear (object-curly-spacing): | | A space is required after '{'. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js |3887|3887| if (data.timerRepeat === undefined) |3888|3888| this.timer = undefined; |3889|3889| |3890| |- this.UnitFsm.ProcessMessage(this, {"type": "Timer", "data": data, "lateness": lateness}); | |3890|+ this.UnitFsm.ProcessMessage(this, { "type": "Timer", "data": data, "lateness": lateness}); |3891|3891| }; |3892|3892| |3893|3893| /** | | [NORMAL] ESLintBear (object-curly-spacing): | | A space is required before '}'. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js |3887|3887| if (data.timerRepeat === undefined) |3888|3888| this.timer = undefined; |3889|3889| |3890| |- this.UnitFsm.ProcessMessage(this, {"type": "Timer", "data": data, "lateness": lateness}); | |3890|+ this.UnitFsm.ProcessMessage(this, {"type": "Timer", "data": data, "lateness": lateness }); |3891|3891| }; |3892|3892| |3893|3893| /** | | [NORMAL] ESLintBear (spaced-comment): | | Expected space or tab after '//' in comment. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js |3922|3922| this.timer = undefined; |3923|3923| }; |3924|3924| |3925| |-//// Message handlers ///// | |3925|+// // Message handlers ///// |3926|3926| |3927|3927| UnitAI.prototype.OnMotionChanged = function(msg) |3928|3928| { | | [NORMAL] ESLintBear (object-curly-spacing): | | A space is required after '{'. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js |3927|3927| UnitAI.prototype.OnMotionChanged = function(msg) |3928|3928| { |3929|3929| if (msg.starting && !msg.error) |3930| |- this.UnitFsm.ProcessMessage(this, {"type": "MoveStarted", "data": msg}); | |3930|+ this.UnitFsm.ProcessMessage(this, { "type": "MoveStarted", "data": msg}); |3931|3931| else if (!msg.starting || msg.error) |3932|3932| this.UnitFsm.ProcessMessage(this, {"type": "MoveCompleted", "data": msg}); |3933|3933| }; | | [NORMAL] ESLintBear (object-curly-spacing): | | A space is required before '}'. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js |3927|3927| UnitAI.prototype.OnMotionChanged = function(msg) |3928|3928| { |3929|3929| if (msg.starting && !msg.error) |3930| |- this.UnitFsm.ProcessMessage(this, {"type": "MoveStarted", "data": msg}); | |3930|+ this.UnitFsm.ProcessMessage(this, {"type": "MoveStarted", "data": msg }); |3931|3931| else if (!msg.starting || msg.error) |3932|3932| this.UnitFsm.ProcessMessage(this, {"type": "MoveCompleted", "data": msg}); |3933|3933| }; | | [NORMAL] ESLintBear (object-curly-spacing): | | A space is required after '{'. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js |3929|3929| if (msg.starting && !msg.error) |3930|3930| this.UnitFsm.ProcessMessage(this, {"type": "MoveStarted", "data": msg}); |3931|3931| else if (!msg.starting || msg.error) |3932| |- this.UnitFsm.ProcessMessage(this, {"type": "MoveCompleted", "data": msg}); | |3932|+ this.UnitFsm.ProcessMessage(this, { "type": "MoveCompleted", "data": msg}); |3933|3933| }; |3934|3934| |3935|3935| UnitAI.prototype.OnGlobalConstructionFinished = function(msg) | | [NORMAL] ESLintBear (object-curly-spacing): | | A space is required before '}'. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js |3929|3929| if (msg.starting && !msg.error) |3930|3930| this.UnitFsm.ProcessMessage(this, {"type": "MoveStarted", "data": msg}); |3931|3931| else if (!msg.starting || msg.error) |3932| |- this.UnitFsm.ProcessMessage(this, {"type": "MoveCompleted", "data": msg}); | |3932|+ this.UnitFsm.ProcessMessage(this, {"type": "MoveCompleted", "data": msg }); |3933|3933| }; |3934|3934| |3935|3935| UnitAI.prototype.OnGlobalConstructionFinished = function(msg) | | [NORMAL] ESLintBear (object-curly-spacing): | | A space is required after '{'. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js |3937|3937| // TODO: This is a bit inefficient since every unit listens to every |3938|3938| // construction message - ideally we could scope it to only the one we're building |3939|3939| |3940| |- this.UnitFsm.ProcessMessage(this, {"type": "ConstructionFinished", "data": msg}); | |3940|+ this.UnitFsm.ProcessMessage(this, { "type": "ConstructionFinished", "data": msg}); |3941|3941| }; |3942|3942| |3943|3943| UnitAI.prototype.OnGlobalEntityRenamed = function(msg) | | [NORMAL] ESLintBear (object-curly-spacing): | | A space is required before '}'. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js |3937|3937| // TODO: This is a bit inefficient since every unit listens to every |3938|3938| // construction message - ideally we could scope it to only the one we're building |3939|3939| |3940| |- this.UnitFsm.ProcessMessage(this, {"type": "ConstructionFinished", "data": msg}); | |3940|+ this.UnitFsm.ProcessMessage(this, {"type": "ConstructionFinished", "data": msg }); |3941|3941| }; |3942|3942| |3943|3943| UnitAI.prototype.OnGlobalEntityRenamed = function(msg) | | [NORMAL] ESLintBear (object-curly-spacing): | | A space is required after '{'. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js |3962|3962| |3963|3963| UnitAI.prototype.OnAttacked = function(msg) |3964|3964| { |3965| |- this.UnitFsm.ProcessMessage(this, {"type": "Attacked", "data": msg}); | |3965|+ this.UnitFsm.ProcessMessage(this, { "type": "Attacked", "data": msg}); |3966|3966| }; |3967|3967| |3968|3968| UnitAI.prototype.OnGuardedAttacked = function(msg) | | [NORMAL] ESLintBear (object-curly-spacing): | | A space is required before '}'. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js |3962|3962| |3963|3963| UnitAI.prototype.OnAttacked = function(msg) |3964|3964| { |3965| |- this.UnitFsm.ProcessMessage(this, {"type": "Attacked", "data": msg}); | |3965|+ this.UnitFsm.ProcessMessage(this, {"type": "Attacked", "data": msg }); |3966|3966| }; |3967|3967| |3968|3968| UnitAI.prototype.OnGuardedAttacked = function(msg) | | [NORMAL] ESLintBear (object-curly-spacing): | | A space is required after '{'. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js |3967|3967| |3968|3968| UnitAI.prototype.OnGuardedAttacked = function(msg) |3969|3969| { |3970| |- this.UnitFsm.ProcessMessage(this, {"type": "GuardedAttacked", "data": msg.data}); | |3970|+ this.UnitFsm.ProcessMessage(this, { "type": "GuardedAttacked", "data": msg.data}); |3971|3971| }; |3972|3972| |3973|3973| UnitAI.prototype.OnHealthChanged = function(msg) | | [NORMAL] ESLintBear (object-curly-spacing): | | A space is required before '}'. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js |3967|3967| |3968|3968| UnitAI.prototype.OnGuardedAttacked = function(msg) |3969|3969| { |3970| |- this.UnitFsm.ProcessMessage(this, {"type": "GuardedAttacked", "data": msg.data}); | |3970|+ this.UnitFsm.ProcessMessage(this, {"type": "GuardedAttacked", "data": msg.data }); |3971|3971| }; |3972|3972| |3973|3973| UnitAI.prototype.OnHealthChanged = function(msg) | | [NORMAL] ESLintBear (object-curly-spacing): | | A space is required after '{'. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js |3972|3972| |3973|3973| UnitAI.prototype.OnHealthChanged = function(msg) |3974|3974| { |3975| |- this.UnitFsm.ProcessMessage(this, {"type": "HealthChanged", "from": msg.from, "to": msg.to}); | |3975|+ this.UnitFsm.ProcessMessage(this, { "type": "HealthChanged", "from": msg.from, "to": msg.to}); |3976|3976| }; |3977|3977| |3978|3978| UnitAI.prototype.OnRangeUpdate = function(msg) | | [NORMAL] ESLintBear (object-curly-spacing): | | A space is required before '}'. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js |3972|3972| |3973|3973| UnitAI.prototype.OnHealthChanged = function(msg) |3974|3974| { |3975| |- this.UnitFsm.ProcessMessage(this, {"type": "HealthChanged", "from": msg.from, "to": msg.to}); | |3975|+ this.UnitFsm.ProcessMessage(this, {"type": "HealthChanged", "from": msg.from, "to": msg.to }); |3976|3976| }; |3977|3977| |3978|3978| UnitAI.prototype.OnRangeUpdate = function(msg) | | [NORMAL] ESLintBear (object-curly-spacing): | | A space is required after '{'. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js |3978|3978| UnitAI.prototype.OnRangeUpdate = function(msg) |3979|3979| { |3980|3980| if (msg.tag == this.losRangeQuery) |3981| |- this.UnitFsm.ProcessMessage(this, {"type": "LosRangeUpdate", "data": msg}); | |3981|+ this.UnitFsm.ProcessMessage(this, { "type": "LosRangeUpdate", "data": msg}); |3982|3982| else if (msg.tag == this.losHealRangeQuery) |3983|3983| this.UnitFsm.ProcessMessage(this, {"type": "LosHealRangeUpdate", "data": msg}); |3984|3984| }; | | [NORMAL] ESLintBear (object-curly-spacing): | | A space is required before '}'. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js |3978|3978| UnitAI.prototype.OnRangeUpdate = function(msg) |3979|3979| { |3980|3980| if (msg.tag == this.losRangeQuery) |3981| |- this.UnitFsm.ProcessMessage(this, {"type": "LosRangeUpdate", "data": msg}); | |3981|+ this.UnitFsm.ProcessMessage(this, {"type": "LosRangeUpdate", "data": msg }); |3982|3982| else if (msg.tag == this.losHealRangeQuery) |3983|3983| this.UnitFsm.ProcessMessage(this, {"type": "LosHealRangeUpdate", "data": msg}); |3984|3984| }; | | [NORMAL] ESLintBear (object-curly-spacing): | | A space is required after '{'. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js |3980|3980| if (msg.tag == this.losRangeQuery) |3981|3981| this.UnitFsm.ProcessMessage(this, {"type": "LosRangeUpdate", "data": msg}); |3982|3982| else if (msg.tag == this.losHealRangeQuery) |3983| |- this.UnitFsm.ProcessMessage(this, {"type": "LosHealRangeUpdate", "data": msg}); | |3983|+ this.UnitFsm.ProcessMessage(this, { "type": "LosHealRangeUpdate", "data": msg}); |3984|3984| }; |3985|3985| |3986|3986| UnitAI.prototype.OnPackFinished = function(msg) | | [NORMAL] ESLintBear (object-curly-spacing): | | A space is required before '}'. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js |3980|3980| if (msg.tag == this.losRangeQuery) |3981|3981| this.UnitFsm.ProcessMessage(this, {"type": "LosRangeUpdate", "data": msg}); |3982|3982| else if (msg.tag == this.losHealRangeQuery) |3983| |- this.UnitFsm.ProcessMessage(this, {"type": "LosHealRangeUpdate", "data": msg}); | |3983|+ this.UnitFsm.ProcessMessage(this, {"type": "LosHealRangeUpdate", "data": msg }); |3984|3984| }; |3985|3985| |3986|3986| UnitAI.prototype.OnPackFinished = function(msg) | | [NORMAL] ESLintBear (object-curly-spacing): | | A space is required after '{'. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js |3985|3985| |3986|3986| UnitAI.prototype.OnPackFinished = function(msg) |3987|3987| { |3988| |- this.UnitFsm.ProcessMessage(this, {"type": "PackFinished", "packed": msg.packed}); | |3988|+ this.UnitFsm.ProcessMessage(this, { "type": "PackFinished", "packed": msg.packed}); |3989|3989| }; |3990|3990| |3991|3991| //// Helper functions to be called by the FSM //// | | [NORMAL] ESLintBear (object-curly-spacing): | | A space is required before '}'. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js |3985|3985| |3986|3986| UnitAI.prototype.OnPackFinished = function(msg) |3987|3987| { |3988| |- this.UnitFsm.ProcessMessage(this, {"type": "PackFinished", "packed": msg.packed}); | |3988|+ this.UnitFsm.ProcessMessage(this, {"type": "PackFinished", "packed": msg.packed }); |3989|3989| }; |3990|3990| |3991|3991| //// Helper functions to be called by the FSM //// | | [NORMAL] ESLintBear (spaced-comment): | | Expected space or tab after '//' in comment. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js |3988|3988| this.UnitFsm.ProcessMessage(this, {"type": "PackFinished", "packed": msg.packed}); |3989|3989| }; |3990|3990| |3991| |-//// Helper functions to be called by the FSM //// | |3991|+// // Helper functions to be called by the FSM //// |3992|3992| |3993|3993| UnitAI.prototype.GetWalkSpeed = function() |3994|3994| { | | [NORMAL] ESLintBear (semi): | | Missing semicolon. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js |4092|4092| if (!cmpOwnership || cmpOwnership.GetOwner() == INVALID_PLAYER) |4093|4093| return undefined; |4094|4094| |4095| |- let cmpPosition = Engine.QueryInterface(this.entity, IID_Position) | |4095|+ let cmpPosition = Engine.QueryInterface(this.entity, IID_Position); |4096|4096| if (!cmpPosition || !cmpPosition.IsInWorld()) |4097|4097| return undefined; |4098|4098| | | [NORMAL] ESLintBear (curly): | | Unnecessary { after 'else'. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js |4177|4177| PlaySound(name, member); |4178|4178| } |4179|4179| else |4180| |- { | |4180|+ |4181|4181| // Otherwise use our own sounds |4182|4182| PlaySound(name, this.entity); |4183| |- } | |4183|+ |4184|4184| }; |4185|4185| |4186|4186| /* | | [NORMAL] ESLintBear (spaced-comment): | | Expected space or tab after '//' in comment. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js |4364|4364| else |4365|4365| // return false? Or hope you come close enough? |4366|4366| var parabolicMaxRange = 0; |4367| |- //return false; | |4367|+ // return false; |4368|4368| |4369|4369| // the parabole changes while walking, take something in the middle |4370|4370| var guessedMaxRange = (range.max + parabolicMaxRange)/2; | | [NORMAL] ESLintBear (operator-linebreak): | | '&&' should be placed at the end of the line. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js |4429|4429| if (this.IsFormationMember()) |4430|4430| { |4431|4431| var cmpFormationUnitAI = Engine.QueryInterface(this.formationController, IID_UnitAI); |4432| |- if (cmpFormationUnitAI && cmpFormationUnitAI.IsAttackingAsFormation() |4433| |- && cmpFormationUnitAI.order.data.target == target) | |4432|+ if (cmpFormationUnitAI && cmpFormationUnitAI.IsAttackingAsFormation() && | |4433|+ cmpFormationUnitAI.order.data.target == target) |4434|4434| return true; |4435|4435| } |4436|4436| | | [NORMAL] ESLintBear (object-curly-spacing): | | A space is required after '{'. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js |4549|4549| var pos = cmpPosition.GetPosition(); |4550|4550| var heldPosition = this.heldPosition; |4551|4551| if (heldPosition === undefined) |4552| |- heldPosition = {"x": pos.x, "z": pos.z}; | |4552|+ heldPosition = { "x": pos.x, "z": pos.z}; |4553|4553| |4554|4554| return Math.euclidDistance2D(pos.x, pos.z, heldPosition.x, heldPosition.z) < halfvision + range.max; |4555|4555| }; | | [NORMAL] ESLintBear (object-curly-spacing): | | A space is required before '}'. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js |4549|4549| var pos = cmpPosition.GetPosition(); |4550|4550| var heldPosition = this.heldPosition; |4551|4551| if (heldPosition === undefined) |4552| |- heldPosition = {"x": pos.x, "z": pos.z}; | |4552|+ heldPosition = {"x": pos.x, "z": pos.z }; |4553|4553| |4554|4554| return Math.euclidDistance2D(pos.x, pos.z, heldPosition.x, heldPosition.z) < halfvision + range.max; |4555|4555| }; | | [NORMAL] ESLintBear (operator-linebreak): | | '&&' should be placed at the end of the line. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js |4597|4597| UnitAI.prototype.AttackEntityInZone = function(ents) |4598|4598| { |4599|4599| var target = ents.find(target => |4600| |- this.CanAttack(target) |4601| |- && this.CheckTargetDistanceFromHeldPosition(target, IID_Attack, this.GetBestAttackAgainst(target, true)) | |4600|+ this.CanAttack(target) && | |4601|+ this.CheckTargetDistanceFromHeldPosition(target, IID_Attack, this.GetBestAttackAgainst(target, true)) |4602|4602| && (this.GetStance().respondChaseBeyondVision || this.CheckTargetIsInVisionRange(target)) |4603|4603| ); |4604|4604| if (!target) | | [NORMAL] ESLintBear (operator-linebreak): | | '&&' should be placed at the end of the line. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js |4598|4598| { |4599|4599| var target = ents.find(target => |4600|4600| this.CanAttack(target) |4601| |- && this.CheckTargetDistanceFromHeldPosition(target, IID_Attack, this.GetBestAttackAgainst(target, true)) |4602| |- && (this.GetStance().respondChaseBeyondVision || this.CheckTargetIsInVisionRange(target)) | |4601|+ && this.CheckTargetDistanceFromHeldPosition(target, IID_Attack, this.GetBestAttackAgainst(target, true)) && | |4602|+ (this.GetStance().respondChaseBeyondVision || this.CheckTargetIsInVisionRange(target)) |4603|4603| ); |4604|4604| if (!target) |4605|4605| return false; | | [NORMAL] ESLintBear (no-multi-spaces): | | Multiple spaces found before 'Engine'. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js |4662|4662| // If we are guarding/escorting, don't abandon as long as the guarded unit is in target range of the attacker |4663|4663| if (this.isGuardOf) |4664|4664| { |4665| |- var cmpUnitAI = Engine.QueryInterface(target, IID_UnitAI); | |4665|+ var cmpUnitAI = Engine.QueryInterface(target, IID_UnitAI); |4666|4666| var cmpAttack = Engine.QueryInterface(target, IID_Attack); |4667|4667| if (cmpUnitAI && cmpAttack && |4668|4668| cmpAttack.GetAttackTypes().some(type => cmpUnitAI.CheckTargetAttackRange(this.isGuardOf, type))) | | [NORMAL] ESLintBear (indent): | | Expected indentation of 3 tabs but found 4. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js |4666|4666| var cmpAttack = Engine.QueryInterface(target, IID_Attack); |4667|4667| if (cmpUnitAI && cmpAttack && |4668|4668| cmpAttack.GetAttackTypes().some(type => cmpUnitAI.CheckTargetAttackRange(this.isGuardOf, type))) |4669| |- return false; | |4669|+ return false; |4670|4670| } |4671|4671| |4672|4672| // Stop if we're in hold-ground mode and it's too far from the holding point | | [NORMAL] ESLintBear (curly): | | Unnecessary { after 'if' condition. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js |4671|4671| |4672|4672| // Stop if we're in hold-ground mode and it's too far from the holding point |4673|4673| if (this.GetStance().respondHoldGround) |4674| |- { | |4674|+ |4675|4675| if (!this.CheckTargetDistanceFromHeldPosition(target, iid, type)) |4676|4676| return true; |4677| |- } | |4677|+ |4678|4678| |4679|4679| // Stop if it's left our vision range, unless we're especially persistent |4680|4680| if (!this.GetStance().respondChaseBeyondVision) | | [NORMAL] ESLintBear (curly): | | Unnecessary { after 'if' condition. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js |4678|4678| |4679|4679| // Stop if it's left our vision range, unless we're especially persistent |4680|4680| if (!this.GetStance().respondChaseBeyondVision) |4681| |- { | |4681|+ |4682|4682| if (!this.CheckTargetIsInVisionRange(target)) |4683|4683| return true; |4684| |- } | |4684|+ |4685|4685| |4686|4686| // (Note that CCmpUnitMotion will detect if the target is lost in FoW, |4687|4687| // and will continue moving to its last seen position and then stop) | | [NORMAL] ESLintBear (no-multi-spaces): | | Multiple spaces found before 'Engine'. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js |4709|4709| // If we are guarding/escorting, chase at least as long as the guarded unit is in target range of the attacker |4710|4710| if (this.isGuardOf) |4711|4711| { |4712| |- var cmpUnitAI = Engine.QueryInterface(target, IID_UnitAI); | |4712|+ var cmpUnitAI = Engine.QueryInterface(target, IID_UnitAI); |4713|4713| var cmpAttack = Engine.QueryInterface(target, IID_Attack); |4714|4714| if (cmpUnitAI && cmpAttack && |4715|4715| cmpAttack.GetAttackTypes().some(type => cmpUnitAI.CheckTargetAttackRange(this.isGuardOf, type))) | | [NORMAL] ESLintBear (spaced-comment): | | Expected space or tab after '//' in comment. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js |4722|4722| return false; |4723|4723| }; |4724|4724| |4725| |-//// External interface functions //// | |4725|+// // External interface functions //// |4726|4726| |4727|4727| UnitAI.prototype.SetFormationController = function(ent) |4728|4728| { | | [NORMAL] ESLintBear (curly): | | Unnecessary { after 'if' condition. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js |4732|4732| // of our own formation (or ourself if not in formation) |4733|4733| var cmpObstruction = Engine.QueryInterface(this.entity, IID_Obstruction); |4734|4734| if (cmpObstruction) |4735| |- { | |4735|+ |4736|4736| if (ent == INVALID_ENTITY) |4737|4737| cmpObstruction.SetControlGroup(this.entity); |4738|4738| else |4739|4739| cmpObstruction.SetControlGroup(ent); |4740| |- } | |4740|+ |4741|4741| |4742|4742| // If we were removed from a formation, let the FSM switch back to INDIVIDUAL |4743|4743| if (ent == INVALID_ENTITY) | | [NORMAL] ESLintBear (curly): | | Unnecessary { after 'if' condition. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js |4875|4875| // if we already had an old guard order, do nothing if the target is the same |4876|4876| // and the order is running, otherwise remove the previous order |4877|4877| if (this.isGuardOf) |4878| |- { | |4878|+ |4879|4879| if (this.isGuardOf == target && this.order && this.order.type == "Guard") |4880|4880| return; |4881|4881| else |4882|4882| this.RemoveGuard(); |4883| |- } | |4883|+ |4884|4884| |4885|4885| this.AddOrder("Guard", { "target": target, "force": false }, queued); |4886|4886| }; | | [NORMAL] ESLintBear (no-else-return): | | Unnecessary 'else' after 'return'. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js |4878|4878| { |4879|4879| if (this.isGuardOf == target && this.order && this.order.type == "Guard") |4880|4880| return; |4881| |- else |4882| |- this.RemoveGuard(); | |4881|+ this.RemoveGuard(); |4883|4882| } |4884|4883| |4885|4884| this.AddOrder("Guard", { "target": target, "force": false }, queued); | | [NORMAL] ESLintBear (object-curly-spacing): | | A space is required after '{'. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js |4920|4920| return; |4921|4921| |4922|4922| if (this.order.type == "Guard") |4923| |- this.UnitFsm.ProcessMessage(this, {"type": "RemoveGuard"}); | |4923|+ this.UnitFsm.ProcessMessage(this, { "type": "RemoveGuard"}); |4924|4924| else |4925|4925| for (let i = 1; i < this.orderQueue.length; ++i) |4926|4926| if (this.orderQueue[i].type == "Guard") | | [NORMAL] ESLintBear (object-curly-spacing): | | A space is required before '}'. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js |4920|4920| return; |4921|4921| |4922|4922| if (this.order.type == "Guard") |4923| |- this.UnitFsm.ProcessMessage(this, {"type": "RemoveGuard"}); | |4923|+ this.UnitFsm.ProcessMessage(this, {"type": "RemoveGuard" }); |4924|4924| else |4925|4925| for (let i = 1; i < this.orderQueue.length; ++i) |4926|4926| if (this.orderQueue[i].type == "Guard") | | [NORMAL] ESLintBear (object-curly-spacing): | | A space is required before '}'. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js |5049|5049| this.WalkToTarget(target, queued); |5050|5050| return; |5051|5051| } |5052| |- this.AddOrder("Attack", { "target": target, "force": true, "allowCapture": allowCapture}, queued); | |5052|+ this.AddOrder("Attack", { "target": target, "force": true, "allowCapture": allowCapture }, queued); |5053|5053| }; |5054|5054| |5055|5055| /** | | [NORMAL] ESLintBear (no-trailing-spaces): | | Trailing spaces not allowed. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js |5198|5198| this.workOrders.length && this.workOrders[0].type == "Trade") |5199|5199| { |5200|5200| let cmpTrader = Engine.QueryInterface(this.entity, IID_Trader); |5201| |- if (cmpTrader.HasBothMarkets() && | |5201|+ if (cmpTrader.HasBothMarkets() && |5202|5202| (cmpTrader.GetFirstMarket() == target && cmpTrader.GetSecondMarket() == source || |5203|5203| cmpTrader.GetFirstMarket() == source && cmpTrader.GetSecondMarket() == target)) |5204|5204| { | | [NORMAL] ESLintBear (operator-linebreak): | | '&&' should be placed at the end of the line. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js |5479|5479| { |5480|5480| var cmpIdentity = Engine.QueryInterface(targ, IID_Identity); |5481|5481| var targetClasses = this.order.data.targetClasses; |5482| |- if (targetClasses.attack && cmpIdentity |5483| |- && !MatchesClassList(cmpIdentity.GetClassesList(), targetClasses.attack)) | |5482|+ if (targetClasses.attack && cmpIdentity && | |5483|+ !MatchesClassList(cmpIdentity.GetClassesList(), targetClasses.attack)) |5484|5484| continue; |5485|5485| if (targetClasses.avoid && cmpIdentity |5486|5486| && MatchesClassList(cmpIdentity.GetClassesList(), targetClasses.avoid)) | | [NORMAL] ESLintBear (operator-linebreak): | | '&&' should be placed at the end of the line. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js |5482|5482| if (targetClasses.attack && cmpIdentity |5483|5483| && !MatchesClassList(cmpIdentity.GetClassesList(), targetClasses.attack)) |5484|5484| continue; |5485| |- if (targetClasses.avoid && cmpIdentity |5486| |- && MatchesClassList(cmpIdentity.GetClassesList(), targetClasses.avoid)) | |5485|+ if (targetClasses.avoid && cmpIdentity && | |5486|+ MatchesClassList(cmpIdentity.GetClassesList(), targetClasses.avoid)) |5487|5487| continue; |5488|5488| // Only used by the AIs to prevent some choices of targets |5489|5489| if (targetClasses.vetoEntities && targetClasses.vetoEntities[targ]) | | [NORMAL] ESLintBear (operator-linebreak): | | '&&' should be placed at the end of the line. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js |5505|5505| { |5506|5506| var cmpIdentity = Engine.QueryInterface(targ, IID_Identity); |5507|5507| var targetClasses = this.order.data.targetClasses; |5508| |- if (cmpIdentity && targetClasses.attack |5509| |- && !MatchesClassList(cmpIdentity.GetClassesList(), targetClasses.attack)) | |5508|+ if (cmpIdentity && targetClasses.attack && | |5509|+ !MatchesClassList(cmpIdentity.GetClassesList(), targetClasses.attack)) |5510|5510| continue; |5511|5511| if (cmpIdentity && targetClasses.avoid |5512|5512| && MatchesClassList(cmpIdentity.GetClassesList(), targetClasses.avoid)) | | [NORMAL] ESLintBear (operator-linebreak): | | '&&' should be placed at the end of the line. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js |5508|5508| if (cmpIdentity && targetClasses.attack |5509|5509| && !MatchesClassList(cmpIdentity.GetClassesList(), targetClasses.attack)) |5510|5510| continue; |5511| |- if (cmpIdentity && targetClasses.avoid |5512| |- && MatchesClassList(cmpIdentity.GetClassesList(), targetClasses.avoid)) | |5511|+ if (cmpIdentity && targetClasses.avoid && | |5512|+ MatchesClassList(cmpIdentity.GetClassesList(), targetClasses.avoid)) |5513|5513| continue; |5514|5514| // Only used by the AIs to prevent some choices of targets |5515|5515| if (targetClasses.vetoEntities && targetClasses.vetoEntities[targ]) | | [NORMAL] ESLintBear (space-before-function-paren): | | Unexpected space before function parentheses. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js |5548|5548| |5549|5549| var cmpRangeManager = Engine.QueryInterface(SYSTEM_ENTITY, IID_RangeManager); |5550|5550| var entities = cmpRangeManager.ResetActiveQuery(this.losRangeQuery); |5551| |- var targets = entities.filter(function (v) { return cmpAttack.CanAttack(v) && attackfilter(v); }) | |5551|+ var targets = entities.filter(function(v) { return cmpAttack.CanAttack(v) && attackfilter(v); }) |5552|5552| .sort(function (a, b) { return cmpAttack.CompareEntitiesByPreference(a, b); }); |5553|5553| |5554|5554| return targets; | | [NORMAL] ESLintBear (space-before-function-paren): | | Unexpected space before function parentheses. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js |5549|5549| var cmpRangeManager = Engine.QueryInterface(SYSTEM_ENTITY, IID_RangeManager); |5550|5550| var entities = cmpRangeManager.ResetActiveQuery(this.losRangeQuery); |5551|5551| var targets = entities.filter(function (v) { return cmpAttack.CanAttack(v) && attackfilter(v); }) |5552| |- .sort(function (a, b) { return cmpAttack.CompareEntitiesByPreference(a, b); }); | |5552|+ .sort(function(a, b) { return cmpAttack.CompareEntitiesByPreference(a, b); }); |5553|5553| |5554|5554| return targets; |5555|5555| }; | | [NORMAL] ESLintBear (object-curly-spacing): | | A space is required after '{'. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js |5638|5638| |5639|5639| UnitAI.prototype.SetHeldPosition = function(x, z) |5640|5640| { |5641| |- this.heldPosition = {"x": x, "z": z}; | |5641|+ this.heldPosition = { "x": x, "z": z}; |5642|5642| }; |5643|5643| |5644|5644| UnitAI.prototype.SetHeldPositionOnEntity = function(entity) | | [NORMAL] ESLintBear (object-curly-spacing): | | A space is required before '}'. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js |5638|5638| |5639|5639| UnitAI.prototype.SetHeldPosition = function(x, z) |5640|5640| { |5641| |- this.heldPosition = {"x": x, "z": z}; | |5641|+ this.heldPosition = {"x": x, "z": z }; |5642|5642| }; |5643|5643| |5644|5644| UnitAI.prototype.SetHeldPositionOnEntity = function(entity) | | [NORMAL] ESLintBear (spaced-comment): | | Expected space or tab after '//' in comment. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js |5665|5665| return false; |5666|5666| }; |5667|5667| |5668| |-//// Helper functions //// | |5668|+// // Helper functions //// |5669|5669| |5670|5670| UnitAI.prototype.CanAttack = function(target) |5671|5671| { | | [NORMAL] ESLintBear (spaced-comment): | | Expected space or tab after '//' in comment. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js |5869|5869| return (cmpPack && cmpPack.IsPacking()); |5870|5870| }; |5871|5871| |5872| |-//// Formation specific functions //// | |5872|+// // Formation specific functions //// |5873|5873| |5874|5874| UnitAI.prototype.IsAttackingAsFormation = function() |5875|5875| { | | [NORMAL] ESLintBear (operator-linebreak): | | '&&' should be placed at the end of the line. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js |5874|5874| UnitAI.prototype.IsAttackingAsFormation = function() |5875|5875| { |5876|5876| var cmpAttack = Engine.QueryInterface(this.entity, IID_Attack); |5877| |- return cmpAttack && cmpAttack.CanAttackAsFormation() |5878| |- && this.GetCurrentState() == "FORMATIONCONTROLLER.COMBAT.ATTACKING"; | |5877|+ return cmpAttack && cmpAttack.CanAttackAsFormation() && | |5878|+ this.GetCurrentState() == "FORMATIONCONTROLLER.COMBAT.ATTACKING"; |5879|5879| }; |5880|5880| |5881|5881| //// Animal specific functions //// | | [NORMAL] ESLintBear (spaced-comment): | | Expected space or tab after '//' in comment. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js |5878|5878| && this.GetCurrentState() == "FORMATIONCONTROLLER.COMBAT.ATTACKING"; |5879|5879| }; |5880|5880| |5881| |-//// Animal specific functions //// | |5881|+// // Animal specific functions //// |5882|5882| |5883|5883| UnitAI.prototype.MoveRandomly = function(distance) |5884|5884| { binaries/data/mods/public/simulation/components/UnitAI.js |2418| » » » » » » let·nearby·=·this.FindNearestDropsite(resourceType.generic); | | [NORMAL] ESLintBear (no-shadow): | | 'nearby' is already declared in the upper scope. binaries/data/mods/public/simulation/components/UnitAI.js |3792| » var·isWorkType·=·type·=>·type·==·"Gather"·||·type·==·"Trade"·||·type·==·"Repair"·||·type·==·"ReturnResource"; | | [NORMAL] ESLintBear (no-shadow): | | 'type' is already declared in the upper scope. binaries/data/mods/public/simulation/components/UnitAI.js |4584| » var·target·=·ents.find(target·=>·this.CanAttack(target)); | | [NORMAL] ESLintBear (no-shadow): | | 'target' is already declared in the upper scope. binaries/data/mods/public/simulation/components/UnitAI.js |4599| » var·target·=·ents.find(target·=> | | [NORMAL] ESLintBear (no-shadow): | | 'target' is already declared in the upper scope. binaries/data/mods/public/simulation/components/UnitAI.js |4645| » var·ent·=·ents.find(ent·=>·this.CanHeal(ent)); | | [NORMAL] ESLintBear (no-shadow): | | 'ent' is already declared in the upper scope. binaries/data/mods/public/simulation/components/UnitAI.js |4668| » » ····cmpAttack.GetAttackTypes().some(type·=>·cmpUnitAI.CheckTargetAttackRange(this.isGuardOf,·type))) | | [NORMAL] ESLintBear (no-shadow): | | 'type' is already declared in the upper scope. binaries/data/mods/public/simulation/components/UnitAI.js |5129| » var·lastPos·=·undefined; | | [NORMAL] ESLintBear (no-undef-init): | | It's not necessary to initialize 'lastPos' to undefined. binaries/data/mods/public/simulation/components/UnitAI.js | 356| » » ····&&·(this.lastShorelinePosition.z·==·cmpPosition.GetPosition().z)) | | [NORMAL] JSHintBear: | | Misleading line break before '&&'; readers may interpret this as an expression boundary. binaries/data/mods/public/simulation/components/UnitAI.js |1896| » » » » » » var·cmpFormation·=·Engine.QueryInterface(this.formationController,·IID_Formation); | | [NORMAL] JSHintBear: | | 'cmpFormation' is already defined. binaries/data/mods/public/simulation/components/UnitAI.js |2028| » » » » » » &&·this.order.data.target·!=·msg.data.attacker·&&·this.GetBestAttackAgainst(msg.data.attacker,·true)·!=·"Capture") | | [NORMAL] JSHintBear: | | Misleading line break before '&&'; readers may interpret this as an expression boundary. binaries/data/mods/public/simulation/components/UnitAI.js |2112| » » » » » » » » ·&&·((type.generic·==·"treasure"·&&·oldType.generic·==·"treasure") | | [NORMAL] JSHintBear: | | Misleading line break before '&&'; readers may interpret this as an expression boundary. binaries/data/mods/public/simulation/components/UnitAI.js |2113| » » » » » » » » ·||·(type.specific·==·oldType.specific | | [NORMAL] JSHintBear: | | Misleading line break before '||'; readers may interpret this as an expression boundary. binaries/data/mods/public/simulation/components/UnitAI.js |2114| » » » » » » » » ·&&·(type.specific·!=·"meat"·||·oldTemplate·==·template))) | | [NORMAL] JSHintBear: | | Misleading line break before '&&'; readers may interpret this as an expression boundary. binaries/data/mods/public/simulation/components/UnitAI.js |2137| » » » » » » » » var·nearby·=·this.FindNearestDropsite(oldType.generic); | | [NORMAL] JSHintBear: | | 'nearby' is already defined. binaries/data/mods/public/simulation/components/UnitAI.js |2177| » » » » » » » » &&·((type.generic·==·"treasure"·&&·oldType.generic·==·"treasure") | | [NORMAL] JSHintBear: | | Misleading line break before '&&'; readers may interpret this as an expression boundary. binaries/data/mods/public/simulation/components/UnitAI.js |2178| » » » » » » » » ||·(type.specific·==·oldType.specific | | [NORMAL] JSHintBear: | | Misleading line break before '||'; readers may interpret this as an expression boundary. binaries/data/mods/public/simulation/components/UnitAI.js |2179| » » » » » » » » &&·(type.specific·!=·"meat"·||·oldTemplate·==·template))) | | [NORMAL] JSHintBear: | | Misleading line break before '&&'; readers may interpret this as an expression boundary. binaries/data/mods/public/simulation/components/UnitAI.js |2223| » » » » » » » ||·(type.specific·==·resourceType.specific | | [NORMAL] JSHintBear: | | Misleading line break before '||'; readers may interpret this as an expression boundary. binaries/data/mods/public/simulation/components/UnitAI.js |2224| » » » » » » » &&·(type.specific·!=·"meat"·||·resourceTemplate·==·template)) | | [NORMAL] JSHintBear: | | Misleading line break before '&&'; readers may interpret this as an expression boundary. binaries/data/mods/public/simulation/components/UnitAI.js |2240| » » » » » var·nearby·=·this.FindNearestDropsite(resourceType.generic); | | [NORMAL] JSHintBear: | | 'nearby' is already defined. binaries/data/mods/public/simulation/components/UnitAI.js |2413| » » » » » var·cmpResourceGatherer·=·Engine.QueryInterface(this.entity,·IID_ResourceGatherer); | | [NORMAL] JSHintBear: | | 'cmpResourceGatherer' is already defined. binaries/data/mods/public/simulation/components/UnitAI.js |2429| » » » » » var·nearby·=·this.FindNearbyResource(function·(ent,·type,·template)·{ | | [NORMAL] JSHintBear: | | 'nearby' is already defined. binaries/data/mods/public/simulation/components/UnitAI.js |2432| » » » » » » » ||·(type.specific·==·resourceType.specific | | [NORMAL] JSHintBear: | | Misleading line break before '||'; readers may interpret this as an expression boundary. binaries/data/mods/public/simulation/components/UnitAI.js |2433| » » » » » » » &&·(type.specific·!=·"meat"·||·resourceTemplate·==·template)) | | [NORMAL] JSHintBear: | | Misleading line break before '&&'; readers may interpret this as an expression boundary. binaries/data/mods/public/simulation/components/UnitAI.js |2453| » » » » » var·nearby·=·this.FindNearestDropsite(resourceType.generic); | | [NORMAL] JSHintBear: | | 'nearby' is already defined. binaries/data/mods/public/simulation/components/UnitAI.js |2637| » » » » » var·cmpResourceGatherer·=·Engine.QueryInterface(this.entity,·IID_ResourceGatherer); | | [NORMAL] JSHintBear: | | 'cmpResourceGatherer' is already defined. binaries/data/mods/public/simulation/components/UnitAI.js |2832| » » » » » var·cmpResourceDropsite·=·Engine.QueryInterface(msg.data.newentity,·IID_ResourceDropsite); | | [NORMAL] JSHintBear: | | 'cmpResourceDropsite' is already defined. binaries/data/mods/public/simulation/components/UnitAI.js |2905| » » » » » if·(this.CanGarrison(target)) | | [NORMAL] JSHintBear: | | 'target' used out of scope. binaries/data/mods/public/simulation/components/UnitAI.js |2908| » » » » » » if·(this.CheckGarrisonRange(target)) | | [NORMAL] JSHintBear: | | 'target' used out of scope. binaries/data/mods/public/simulation/components/UnitAI.js |2910| » » » » » » » var·cmpGarrisonHolder·=·Engine.QueryInterface(target,·IID_GarrisonHolder); | | [NORMAL] JSHintBear: | | 'target' used out of scope. binaries/data/mods/public/simulation/components/UnitAI.js |2932| » » » » » » » » var·cmpResourceDropsite·=·Engine.QueryInterface(target,·IID_ResourceDropsite); | | [NORMAL] JSHintBear: | | 'target' used out of scope. binaries/data/mods/public/simulation/components/UnitAI.js |2933| » » » » » » » » if·(cmpResourceDropsite·&&·this.CanReturnResource(target,·true)) | | [NORMAL] JSHintBear: | | 'target' used out of scope. binaries/data/mods/public/simulation/components/UnitAI.js |2948| » » » » » » » » » var·cmpHolderPosition·=·Engine.QueryInterface(target,·IID_Position); | | [NORMAL] JSHintBear: | | 'target' used out of scope. binaries/data/mods/public/simulation/components/UnitAI.js |2949| » » » » » » » » » var·cmpHolderUnitAI·=·Engine.QueryInterface(target,·IID_UnitAI); | | [NORMAL] JSHintBear: | | 'target' used out of scope. binaries/data/mods/public/simulation/components/UnitAI.js |2976| » » » » » » » if·(this.MoveToTarget(target)) | | [NORMAL] JSHintBear: | | 'target' used out of scope. binaries/data/mods/public/simulation/components/UnitAI.js |3754| » » var·order·=·{·"type":·type,·"data":·data·}; | | [NORMAL] JSHintBear: | | 'order' is already defined. binaries/data/mods/public/simulation/components/UnitAI.js |3823| » for·(var·i·=·0;·i·<·this.orderQueue.length;·++i) | | [NORMAL] JSHintBear: | | 'i' is already defined. binaries/data/mods/public/simulation/components/UnitAI.js |4095| » let·cmpPosition·=·Engine.QueryInterface(this.entity,·IID_Position) | | [NORMAL] JSHintBear: | | Missing semicolon. binaries/data/mods/public/simulation/components/UnitAI.js |4366| » » var·parabolicMaxRange·=·0; | | [NORMAL] JSHintBear: | | 'parabolicMaxRange' is already defined. binaries/data/mods/public/simulation/components/UnitAI.js |4370| » var·guessedMaxRange·=·(range.max·+·parabolicMaxRange)/2; | | [NORMAL] JSHintBear: | | 'parabolicMaxRange' used out of scope. binaries/data/mods/public/simulation/components/UnitAI.js |4377| » return·cmpUnitMotion.MoveToTargetRange(target,·range.min,·Math.min(range.max,·parabolicMaxRange)); | | [NORMAL] JSHintBear: | | 'parabolicMaxRange' used out of scope. binaries/data/mods/public/simulation/components/UnitAI.js |4433| » » » &&·cmpFormationUnitAI.order.data.target·==·target) | | [NORMAL] JSHintBear: | | Misleading line break before '&&'; readers may interpret this as an expression boundary. binaries/data/mods/public/simulation/components/UnitAI.js |4601| » » &&·this.CheckTargetDistanceFromHeldPosition(target,·IID_Attack,·this.GetBestAttackAgainst(target,·true)) | | [NORMAL] JSHintBear: | | Misleading line break before '&&'; readers may interpret this as an expression boundary. binaries/data/mods/public/simulation/components/UnitAI.js |4602| » » &&·(this.GetStance().respondChaseBeyondVision·||·this.CheckTargetIsInVisionRange(target)) | | [NORMAL] JSHintBear: | | Misleading line break before '&&'; readers may interpret this as an expression boundary. binaries/data/mods/public/simulation/components/UnitAI.js |5129| » var·lastPos·=·undefined; | | [NORMAL] JSHintBear: | | It's not necessary to initialize 'lastPos' to 'undefined'. binaries/data/mods/public/simulation/components/UnitAI.js |5483| » » » » » » &&·!MatchesClassList(cmpIdentity.GetClassesList(),·targetClasses.attack)) | | [NORMAL] JSHintBear: | | Misleading line break before '&&'; readers may interpret this as an expression boundary. binaries/data/mods/public/simulation/components/UnitAI.js |5486| » » » » » » &&·MatchesClassList(cmpIdentity.GetClassesList(),·targetClasses.avoid)) | | [NORMAL] JSHintBear: | | Misleading line break before '&&'; readers may interpret this as an expression boundary. binaries/data/mods/public/simulation/components/UnitAI.js |5499| » var·targets·=·this.GetTargetsFromUnit(); | | [NORMAL] JSHintBear: | | 'targets' is already defined. binaries/data/mods/public/simulation/components/UnitAI.js |5500| » for·(var·targ·of·targets) | | [NORMAL] JSHintBear: | | 'targ' is already defined. binaries/data/mods/public/simulation/components/UnitAI.js |5506| » » » var·cmpIdentity·=·Engine.QueryInterface(targ,·IID_Identity); | | [NORMAL] JSHintBear: | | 'cmpIdentity' is already defined. binaries/data/mods/public/simulation/components/UnitAI.js |5507| » » » var·targetClasses·=·this.order.data.targetClasses; | | [NORMAL] JSHintBear: | | 'targetClasses' is already defined. binaries/data/mods/public/simulation/components/UnitAI.js |5509| » » » » &&·!MatchesClassList(cmpIdentity.GetClassesList(),·targetClasses.attack)) | | [NORMAL] JSHintBear: | | Misleading line break before '&&'; readers may interpret this as an expression boundary. binaries/data/mods/public/simulation/components/UnitAI.js |5512| » » » » &&·MatchesClassList(cmpIdentity.GetClassesList(),·targetClasses.avoid)) | | [NORMAL] JSHintBear: | | Misleading line break before '&&'; readers may interpret this as an expression boundary. binaries/data/mods/public/simulation/components/UnitAI.js |5587| » » var·range·=·cmpVision.GetRange(); | | [NORMAL] JSHintBear: | | 'range' is already defined. binaries/data/mods/public/simulation/components/UnitAI.js |5592| » » var·cmpRanged·=·Engine.QueryInterface(this.entity,·iid); | | [NORMAL] JSHintBear: | | 'cmpRanged' is already defined. binaries/data/mods/public/simulation/components/UnitAI.js |5595| » » var·range·=·iid·!==·IID_Attack·?·cmpRanged.GetRange()·:·cmpRanged.GetFullAttackRange(); | | [NORMAL] JSHintBear: | | 'range' is already defined. binaries/data/mods/public/simulation/components/UnitAI.js |5596| » » var·cmpVision·=·Engine.QueryInterface(this.entity,·IID_Vision); | | [NORMAL] JSHintBear: | | 'cmpVision' is already defined. binaries/data/mods/public/simulation/components/UnitAI.js |5596| » » var·cmpVision·=·Engine.QueryInterface(this.entity,·IID_Vision); | | [MAJOR] JSHintBear: | | Too many errors. (93% scanned).
Link to build: https://jenkins.wildfiregames.com/job/differential/60/display/redirect
Give them to formation, to gather, stop them and they have weapons.
Release formation, do the same, they have sources.
I think there should be on behaviour, or?
I was going to say that we use one idle state and can't tell what units were doing previously, e.g. walking in formation or gathering resources. But actually we can, if we don't reset the animation variants upon leaving the previous state (which we shouldn't have to do anyway). So let me update the patch with that change.
Mostly removed SetDefaultAnimationVariant upon leaving, so that e.g. units idling after gathering resources show resources while units idling after attacking show weapons.
Added SetDefaultAnimationVariant to gather and return resource states since in those we want to show resources rather than weapons. (Perhaps the function could be better named.)
Used SetAnimationVariant("heal"), so in the future units can have special heal walk animations, etc.
Really seems like we should make special variants for formations.
Successful build - Chance fights ever on the side of the prudent.
Linter detected issues: Executing section Default... Executing section Source... Executing section JS... | | [NORMAL] ESLintBear (quote-props): | | Unquoted property 'SetInterval' found. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | 35| 35| | 36| 36| | 37| 37| AddMock(SYSTEM_ENTITY, IID_Timer, { | 38| |- SetInterval: function() { }, | | 38|+ "SetInterval": function() { }, | 39| 39| SetTimeout: function() { }, | 40| 40| }); | 41| 41| | | [NORMAL] ESLintBear (quote-props): | | Unquoted property 'SetTimeout' found. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | 36| 36| | 37| 37| AddMock(SYSTEM_ENTITY, IID_Timer, { | 38| 38| SetInterval: function() { }, | 39| |- SetTimeout: function() { }, | | 39|+ "SetTimeout": function() { }, | 40| 40| }); | 41| 41| | 42| 42| AddMock(SYSTEM_ENTITY, IID_RangeManager, { | | [NORMAL] ESLintBear (quote-props): | | Unquoted property 'CreateActiveQuery' found. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | 40| 40| }); | 41| 41| | 42| 42| AddMock(SYSTEM_ENTITY, IID_RangeManager, { | 43| |- CreateActiveQuery: function(ent, minRange, maxRange, players, iid, flags) { | | 43|+ "CreateActiveQuery": function(ent, minRange, maxRange, players, iid, flags) { | 44| 44| return 1; | 45| 45| }, | 46| 46| EnableActiveQuery: function(id) { }, | | [NORMAL] ESLintBear (quote-props): | | Unquoted property 'EnableActiveQuery' found. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | 43| 43| CreateActiveQuery: function(ent, minRange, maxRange, players, iid, flags) { | 44| 44| return 1; | 45| 45| }, | 46| |- EnableActiveQuery: function(id) { }, | | 46|+ "EnableActiveQuery": function(id) { }, | 47| 47| ResetActiveQuery: function(id) { if (mode == 0) return []; else return [enemy]; }, | 48| 48| DisableActiveQuery: function(id) { }, | 49| 49| GetEntityFlagMask: function(identifier) { }, | | [NORMAL] ESLintBear (quote-props): | | Unquoted property 'ResetActiveQuery' found. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | 44| 44| return 1; | 45| 45| }, | 46| 46| EnableActiveQuery: function(id) { }, | 47| |- ResetActiveQuery: function(id) { if (mode == 0) return []; else return [enemy]; }, | | 47|+ "ResetActiveQuery": function(id) { if (mode == 0) return []; else return [enemy]; }, | 48| 48| DisableActiveQuery: function(id) { }, | 49| 49| GetEntityFlagMask: function(identifier) { }, | 50| 50| }); | | [NORMAL] ESLintBear (no-else-return): | | Unnecessary 'else' after 'return'. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | 44| 44| return 1; | 45| 45| }, | 46| 46| EnableActiveQuery: function(id) { }, | 47| |- ResetActiveQuery: function(id) { if (mode == 0) return []; else return [enemy]; }, | | 47|+ ResetActiveQuery: function(id) { if (mode == 0) return []; return [enemy]; }, | 48| 48| DisableActiveQuery: function(id) { }, | 49| 49| GetEntityFlagMask: function(identifier) { }, | 50| 50| }); | | [NORMAL] ESLintBear (quote-props): | | Unquoted property 'DisableActiveQuery' found. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | 45| 45| }, | 46| 46| EnableActiveQuery: function(id) { }, | 47| 47| ResetActiveQuery: function(id) { if (mode == 0) return []; else return [enemy]; }, | 48| |- DisableActiveQuery: function(id) { }, | | 48|+ "DisableActiveQuery": function(id) { }, | 49| 49| GetEntityFlagMask: function(identifier) { }, | 50| 50| }); | 51| 51| | | [NORMAL] ESLintBear (quote-props): | | Unquoted property 'GetEntityFlagMask' found. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | 46| 46| EnableActiveQuery: function(id) { }, | 47| 47| ResetActiveQuery: function(id) { if (mode == 0) return []; else return [enemy]; }, | 48| 48| DisableActiveQuery: function(id) { }, | 49| |- GetEntityFlagMask: function(identifier) { }, | | 49|+ "GetEntityFlagMask": function(identifier) { }, | 50| 50| }); | 51| 51| | 52| 52| AddMock(SYSTEM_ENTITY, IID_TemplateManager, { | | [NORMAL] ESLintBear (quote-props): | | Unquoted property 'GetCurrentTemplateName' found. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | 50| 50| }); | 51| 51| | 52| 52| AddMock(SYSTEM_ENTITY, IID_TemplateManager, { | 53| |- GetCurrentTemplateName: function(ent) { return "special/formations/line_closed"; }, | | 53|+ "GetCurrentTemplateName": function(ent) { return "special/formations/line_closed"; }, | 54| 54| }); | 55| 55| | 56| 56| AddMock(SYSTEM_ENTITY, IID_PlayerManager, { | | [NORMAL] ESLintBear (quote-props): | | Unquoted property 'GetPlayerByID' found. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | 54| 54| }); | 55| 55| | 56| 56| AddMock(SYSTEM_ENTITY, IID_PlayerManager, { | 57| |- GetPlayerByID: function(id) { return playerEntity; }, | | 57|+ "GetPlayerByID": function(id) { return playerEntity; }, | 58| 58| GetNumPlayers: function() { return 2; }, | 59| 59| }); | 60| 60| | | [NORMAL] ESLintBear (quote-props): | | Unquoted property 'GetNumPlayers' found. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | 55| 55| | 56| 56| AddMock(SYSTEM_ENTITY, IID_PlayerManager, { | 57| 57| GetPlayerByID: function(id) { return playerEntity; }, | 58| |- GetNumPlayers: function() { return 2; }, | | 58|+ "GetNumPlayers": function() { return 2; }, | 59| 59| }); | 60| 60| | 61| 61| AddMock(playerEntity, IID_Player, { | | [NORMAL] ESLintBear (quote-props): | | Unquoted property 'IsAlly' found. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | 59| 59| }); | 60| 60| | 61| 61| AddMock(playerEntity, IID_Player, { | 62| |- IsAlly: function() { return false; }, | | 62|+ "IsAlly": function() { return false; }, | 63| 63| IsEnemy: function() { return true; }, | 64| 64| GetEnemies: function() { return []; }, | 65| 65| }); | | [NORMAL] ESLintBear (quote-props): | | Unquoted property 'IsEnemy' found. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | 60| 60| | 61| 61| AddMock(playerEntity, IID_Player, { | 62| 62| IsAlly: function() { return false; }, | 63| |- IsEnemy: function() { return true; }, | | 63|+ "IsEnemy": function() { return true; }, | 64| 64| GetEnemies: function() { return []; }, | 65| 65| }); | 66| 66| | | [NORMAL] ESLintBear (quote-props): | | Unquoted property 'GetEnemies' found. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | 61| 61| AddMock(playerEntity, IID_Player, { | 62| 62| IsAlly: function() { return false; }, | 63| 63| IsEnemy: function() { return true; }, | 64| |- GetEnemies: function() { return []; }, | | 64|+ "GetEnemies": function() { return []; }, | 65| 65| }); | 66| 66| | 67| 67| | | [NORMAL] ESLintBear (quote-props): | | Unquoted property 'GetClassesList' found. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | 68| 68| var unitAI = ConstructComponent(unit, "UnitAI", { "FormationController": "false", "DefaultStance": "aggressive" }); | 69| 69| | 70| 70| AddMock(unit, IID_Identity, { | 71| |- GetClassesList: function() { return []; }, | | 71|+ "GetClassesList": function() { return []; }, | 72| 72| }); | 73| 73| | 74| 74| AddMock(unit, IID_Ownership, { | | [NORMAL] ESLintBear (quote-props): | | Unquoted property 'GetOwner' found. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | 72| 72| }); | 73| 73| | 74| 74| AddMock(unit, IID_Ownership, { | 75| |- GetOwner: function() { return 1; }, | | 75|+ "GetOwner": function() { return 1; }, | 76| 76| }); | 77| 77| | 78| 78| AddMock(unit, IID_Position, { | | [NORMAL] ESLintBear (quote-props): | | Unquoted property 'GetTurretParent' found. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | 76| 76| }); | 77| 77| | 78| 78| AddMock(unit, IID_Position, { | 79| |- GetTurretParent: function() { return INVALID_ENTITY; }, | | 79|+ "GetTurretParent": function() { return INVALID_ENTITY; }, | 80| 80| GetPosition: function() { return new Vector3D(); }, | 81| 81| GetPosition2D: function() { return new Vector2D(); }, | 82| 82| GetRotation: function() { return { "y": 0 }; }, | | [NORMAL] ESLintBear (quote-props): | | Unquoted property 'GetPosition' found. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | 77| 77| | 78| 78| AddMock(unit, IID_Position, { | 79| 79| GetTurretParent: function() { return INVALID_ENTITY; }, | 80| |- GetPosition: function() { return new Vector3D(); }, | | 80|+ "GetPosition": function() { return new Vector3D(); }, | 81| 81| GetPosition2D: function() { return new Vector2D(); }, | 82| 82| GetRotation: function() { return { "y": 0 }; }, | 83| 83| IsInWorld: function() { return true; }, | | [NORMAL] ESLintBear (quote-props): | | Unquoted property 'GetPosition2D' found. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | 78| 78| AddMock(unit, IID_Position, { | 79| 79| GetTurretParent: function() { return INVALID_ENTITY; }, | 80| 80| GetPosition: function() { return new Vector3D(); }, | 81| |- GetPosition2D: function() { return new Vector2D(); }, | | 81|+ "GetPosition2D": function() { return new Vector2D(); }, | 82| 82| GetRotation: function() { return { "y": 0 }; }, | 83| 83| IsInWorld: function() { return true; }, | 84| 84| }); | | [NORMAL] ESLintBear (quote-props): | | Unquoted property 'GetRotation' found. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | 79| 79| GetTurretParent: function() { return INVALID_ENTITY; }, | 80| 80| GetPosition: function() { return new Vector3D(); }, | 81| 81| GetPosition2D: function() { return new Vector2D(); }, | 82| |- GetRotation: function() { return { "y": 0 }; }, | | 82|+ "GetRotation": function() { return { "y": 0 }; }, | 83| 83| IsInWorld: function() { return true; }, | 84| 84| }); | 85| 85| | | [NORMAL] ESLintBear (quote-props): | | Unquoted property 'IsInWorld' found. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | 80| 80| GetPosition: function() { return new Vector3D(); }, | 81| 81| GetPosition2D: function() { return new Vector2D(); }, | 82| 82| GetRotation: function() { return { "y": 0 }; }, | 83| |- IsInWorld: function() { return true; }, | | 83|+ "IsInWorld": function() { return true; }, | 84| 84| }); | 85| 85| | 86| 86| AddMock(unit, IID_UnitMotion, { | | [NORMAL] ESLintBear (quote-props): | | Unquoted property 'GetWalkSpeed' found. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | 84| 84| }); | 85| 85| | 86| 86| AddMock(unit, IID_UnitMotion, { | 87| |- GetWalkSpeed: function() { return 1; }, | | 87|+ "GetWalkSpeed": function() { return 1; }, | 88| 88| MoveToFormationOffset: function(target, x, z) { }, | 89| 89| IsInTargetRange: function(target, min, max) { return true; }, | 90| 90| MoveToTargetRange: function(target, min, max) { }, | | [NORMAL] ESLintBear (quote-props): | | Unquoted property 'MoveToFormationOffset' found. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | 85| 85| | 86| 86| AddMock(unit, IID_UnitMotion, { | 87| 87| GetWalkSpeed: function() { return 1; }, | 88| |- MoveToFormationOffset: function(target, x, z) { }, | | 88|+ "MoveToFormationOffset": function(target, x, z) { }, | 89| 89| IsInTargetRange: function(target, min, max) { return true; }, | 90| 90| MoveToTargetRange: function(target, min, max) { }, | 91| 91| StopMoving: function() { }, | | [NORMAL] ESLintBear (quote-props): | | Unquoted property 'IsInTargetRange' found. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | 86| 86| AddMock(unit, IID_UnitMotion, { | 87| 87| GetWalkSpeed: function() { return 1; }, | 88| 88| MoveToFormationOffset: function(target, x, z) { }, | 89| |- IsInTargetRange: function(target, min, max) { return true; }, | | 89|+ "IsInTargetRange": function(target, min, max) { return true; }, | 90| 90| MoveToTargetRange: function(target, min, max) { }, | 91| 91| StopMoving: function() { }, | 92| 92| GetPassabilityClassName: function() { return "default"; }, | | [NORMAL] ESLintBear (quote-props): | | Unquoted property 'MoveToTargetRange' found. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | 87| 87| GetWalkSpeed: function() { return 1; }, | 88| 88| MoveToFormationOffset: function(target, x, z) { }, | 89| 89| IsInTargetRange: function(target, min, max) { return true; }, | 90| |- MoveToTargetRange: function(target, min, max) { }, | | 90|+ "MoveToTargetRange": function(target, min, max) { }, | 91| 91| StopMoving: function() { }, | 92| 92| GetPassabilityClassName: function() { return "default"; }, | 93| 93| }); | | [NORMAL] ESLintBear (quote-props): | | Unquoted property 'StopMoving' found. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | 88| 88| MoveToFormationOffset: function(target, x, z) { }, | 89| 89| IsInTargetRange: function(target, min, max) { return true; }, | 90| 90| MoveToTargetRange: function(target, min, max) { }, | 91| |- StopMoving: function() { }, | | 91|+ "StopMoving": function() { }, | 92| 92| GetPassabilityClassName: function() { return "default"; }, | 93| 93| }); | 94| 94| | | [NORMAL] ESLintBear (quote-props): | | Unquoted property 'GetPassabilityClassName' found. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | 89| 89| IsInTargetRange: function(target, min, max) { return true; }, | 90| 90| MoveToTargetRange: function(target, min, max) { }, | 91| 91| StopMoving: function() { }, | 92| |- GetPassabilityClassName: function() { return "default"; }, | | 92|+ "GetPassabilityClassName": function() { return "default"; }, | 93| 93| }); | 94| 94| | 95| 95| AddMock(unit, IID_Vision, { | | [NORMAL] ESLintBear (quote-props): | | Unquoted property 'GetRange' found. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | 93| 93| }); | 94| 94| | 95| 95| AddMock(unit, IID_Vision, { | 96| |- GetRange: function() { return 10; }, | | 96|+ "GetRange": function() { return 10; }, | 97| 97| }); | 98| 98| | 99| 99| AddMock(unit, IID_Attack, { | | [NORMAL] ESLintBear (quote-props): | | Unquoted property 'GetRange' found. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | 97| 97| }); | 98| 98| | 99| 99| AddMock(unit, IID_Attack, { | 100| |- GetRange: function() { return { "max": 10, "min": 0}; }, | | 100|+ "GetRange": function() { return { "max": 10, "min": 0}; }, | 101| 101| GetFullAttackRange: function() { return { "max": 40, "min": 0}; }, | 102| 102| GetBestAttackAgainst: function(t) { return "melee"; }, | 103| 103| GetPreference: function(t) { return 0; }, | | [NORMAL] ESLintBear (object-curly-spacing): | | A space is required before '}'. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | 97| 97| }); | 98| 98| | 99| 99| AddMock(unit, IID_Attack, { | 100| |- GetRange: function() { return { "max": 10, "min": 0}; }, | | 100|+ GetRange: function() { return { "max": 10, "min": 0 }; }, | 101| 101| GetFullAttackRange: function() { return { "max": 40, "min": 0}; }, | 102| 102| GetBestAttackAgainst: function(t) { return "melee"; }, | 103| 103| GetPreference: function(t) { return 0; }, | | [NORMAL] ESLintBear (quote-props): | | Unquoted property 'GetFullAttackRange' found. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | 98| 98| | 99| 99| AddMock(unit, IID_Attack, { | 100| 100| GetRange: function() { return { "max": 10, "min": 0}; }, | 101| |- GetFullAttackRange: function() { return { "max": 40, "min": 0}; }, | | 101|+ "GetFullAttackRange": function() { return { "max": 40, "min": 0}; }, | 102| 102| GetBestAttackAgainst: function(t) { return "melee"; }, | 103| 103| GetPreference: function(t) { return 0; }, | 104| 104| GetTimers: function() { return { "prepare": 500, "repeat": 1000 }; }, | | [NORMAL] ESLintBear (object-curly-spacing): | | A space is required before '}'. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | 98| 98| | 99| 99| AddMock(unit, IID_Attack, { | 100| 100| GetRange: function() { return { "max": 10, "min": 0}; }, | 101| |- GetFullAttackRange: function() { return { "max": 40, "min": 0}; }, | | 101|+ GetFullAttackRange: function() { return { "max": 40, "min": 0 }; }, | 102| 102| GetBestAttackAgainst: function(t) { return "melee"; }, | 103| 103| GetPreference: function(t) { return 0; }, | 104| 104| GetTimers: function() { return { "prepare": 500, "repeat": 1000 }; }, | | [NORMAL] ESLintBear (quote-props): | | Unquoted property 'GetBestAttackAgainst' found. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | 99| 99| AddMock(unit, IID_Attack, { | 100| 100| GetRange: function() { return { "max": 10, "min": 0}; }, | 101| 101| GetFullAttackRange: function() { return { "max": 40, "min": 0}; }, | 102| |- GetBestAttackAgainst: function(t) { return "melee"; }, | | 102|+ "GetBestAttackAgainst": function(t) { return "melee"; }, | 103| 103| GetPreference: function(t) { return 0; }, | 104| 104| GetTimers: function() { return { "prepare": 500, "repeat": 1000 }; }, | 105| 105| CanAttack: function(v) { return true; }, | | [NORMAL] ESLintBear (quote-props): | | Unquoted property 'GetPreference' found. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | 100| 100| GetRange: function() { return { "max": 10, "min": 0}; }, | 101| 101| GetFullAttackRange: function() { return { "max": 40, "min": 0}; }, | 102| 102| GetBestAttackAgainst: function(t) { return "melee"; }, | 103| |- GetPreference: function(t) { return 0; }, | | 103|+ "GetPreference": function(t) { return 0; }, | 104| 104| GetTimers: function() { return { "prepare": 500, "repeat": 1000 }; }, | 105| 105| CanAttack: function(v) { return true; }, | 106| 106| CompareEntitiesByPreference: function(a, b) { return 0; }, | | [NORMAL] ESLintBear (quote-props): | | Unquoted property 'GetTimers' found. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | 101| 101| GetFullAttackRange: function() { return { "max": 40, "min": 0}; }, | 102| 102| GetBestAttackAgainst: function(t) { return "melee"; }, | 103| 103| GetPreference: function(t) { return 0; }, | 104| |- GetTimers: function() { return { "prepare": 500, "repeat": 1000 }; }, | | 104|+ "GetTimers": function() { return { "prepare": 500, "repeat": 1000 }; }, | 105| 105| CanAttack: function(v) { return true; }, | 106| 106| CompareEntitiesByPreference: function(a, b) { return 0; }, | 107| 107| }); | | [NORMAL] ESLintBear (quote-props): | | Unquoted property 'CanAttack' found. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | 102| 102| GetBestAttackAgainst: function(t) { return "melee"; }, | 103| 103| GetPreference: function(t) { return 0; }, | 104| 104| GetTimers: function() { return { "prepare": 500, "repeat": 1000 }; }, | 105| |- CanAttack: function(v) { return true; }, | | 105|+ "CanAttack": function(v) { return true; }, | 106| 106| CompareEntitiesByPreference: function(a, b) { return 0; }, | 107| 107| }); | 108| 108| | | [NORMAL] ESLintBear (quote-props): | | Unquoted property 'CompareEntitiesByPreference' found. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | 103| 103| GetPreference: function(t) { return 0; }, | 104| 104| GetTimers: function() { return { "prepare": 500, "repeat": 1000 }; }, | 105| 105| CanAttack: function(v) { return true; }, | 106| |- CompareEntitiesByPreference: function(a, b) { return 0; }, | | 106|+ "CompareEntitiesByPreference": function(a, b) { return 0; }, | 107| 107| }); | 108| 108| | 109| 109| unitAI.OnCreate(); | | [NORMAL] ESLintBear (quote-props): | | Unquoted property 'GetHitpoints' found. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | 114| 114| if (mode == 1) | 115| 115| { | 116| 116| AddMock(enemy, IID_Health, { | 117| |- GetHitpoints: function() { return 10; }, | | 117|+ "GetHitpoints": function() { return 10; }, | 118| 118| }); | 119| 119| AddMock(enemy, IID_UnitAI, { | 120| 120| IsAnimal: function() { return false; } | | [NORMAL] ESLintBear (quote-props): | | Unquoted property 'IsAnimal' found. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | 117| 117| GetHitpoints: function() { return 10; }, | 118| 118| }); | 119| 119| AddMock(enemy, IID_UnitAI, { | 120| |- IsAnimal: function() { return false; } | | 120|+ "IsAnimal": function() { return false; } | 121| 121| }); | 122| 122| } | 123| 123| else if (mode == 2) | | [NORMAL] ESLintBear (quote-props): | | Unquoted property 'GetHitpoints' found. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | 122| 122| } | 123| 123| else if (mode == 2) | 124| 124| AddMock(enemy, IID_Health, { | 125| |- GetHitpoints: function() { return 0; }, | | 125|+ "GetHitpoints": function() { return 0; }, | 126| 126| }); | 127| 127| | 128| 128| var controllerFormation = ConstructComponent(controller, "Formation", {"FormationName": "Line Closed", "FormationShape": "square", "ShiftRows": "false", "SortingClasses": "", "WidthDepthRatio": 1, "UnitSeparationWidthMultiplier": 1, "UnitSeparationDepthMultiplier": 1, "SpeedMultiplier": 1, "Sloppyness": 0}); | | [NORMAL] ESLintBear (object-curly-spacing): | | A space is required after '{'. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | 125| 125| GetHitpoints: function() { return 0; }, | 126| 126| }); | 127| 127| | 128| |- var controllerFormation = ConstructComponent(controller, "Formation", {"FormationName": "Line Closed", "FormationShape": "square", "ShiftRows": "false", "SortingClasses": "", "WidthDepthRatio": 1, "UnitSeparationWidthMultiplier": 1, "UnitSeparationDepthMultiplier": 1, "SpeedMultiplier": 1, "Sloppyness": 0}); | | 128|+ var controllerFormation = ConstructComponent(controller, "Formation", { "FormationName": "Line Closed", "FormationShape": "square", "ShiftRows": "false", "SortingClasses": "", "WidthDepthRatio": 1, "UnitSeparationWidthMultiplier": 1, "UnitSeparationDepthMultiplier": 1, "SpeedMultiplier": 1, "Sloppyness": 0}); | 129| 129| var controllerAI = ConstructComponent(controller, "UnitAI", { "FormationController": "true", "DefaultStance": "aggressive" }); | 130| 130| | 131| 131| AddMock(controller, IID_Position, { | | [NORMAL] ESLintBear (object-curly-spacing): | | A space is required before '}'. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | 125| 125| GetHitpoints: function() { return 0; }, | 126| 126| }); | 127| 127| | 128| |- var controllerFormation = ConstructComponent(controller, "Formation", {"FormationName": "Line Closed", "FormationShape": "square", "ShiftRows": "false", "SortingClasses": "", "WidthDepthRatio": 1, "UnitSeparationWidthMultiplier": 1, "UnitSeparationDepthMultiplier": 1, "SpeedMultiplier": 1, "Sloppyness": 0}); | | 128|+ var controllerFormation = ConstructComponent(controller, "Formation", {"FormationName": "Line Closed", "FormationShape": "square", "ShiftRows": "false", "SortingClasses": "", "WidthDepthRatio": 1, "UnitSeparationWidthMultiplier": 1, "UnitSeparationDepthMultiplier": 1, "SpeedMultiplier": 1, "Sloppyness": 0 }); | 129| 129| var controllerAI = ConstructComponent(controller, "UnitAI", { "FormationController": "true", "DefaultStance": "aggressive" }); | 130| 130| | 131| 131| AddMock(controller, IID_Position, { | | [NORMAL] ESLintBear (quote-props): | | Unquoted property 'JumpTo' found. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | 129| 129| var controllerAI = ConstructComponent(controller, "UnitAI", { "FormationController": "true", "DefaultStance": "aggressive" }); | 130| 130| | 131| 131| AddMock(controller, IID_Position, { | 132| |- JumpTo: function(x, z) { this.x = x; this.z = z; }, | | 132|+ "JumpTo": function(x, z) { this.x = x; this.z = z; }, | 133| 133| GetTurretParent: function() { return INVALID_ENTITY; }, | 134| 134| GetPosition: function() { return new Vector3D(this.x, 0, this.z); }, | 135| 135| GetPosition2D: function() { return new Vector2D(this.x, this.z); }, | | [NORMAL] ESLintBear (quote-props): | | Unquoted property 'GetTurretParent' found. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | 130| 130| | 131| 131| AddMock(controller, IID_Position, { | 132| 132| JumpTo: function(x, z) { this.x = x; this.z = z; }, | 133| |- GetTurretParent: function() { return INVALID_ENTITY; }, | | 133|+ "GetTurretParent": function() { return INVALID_ENTITY; }, | 134| 134| GetPosition: function() { return new Vector3D(this.x, 0, this.z); }, | 135| 135| GetPosition2D: function() { return new Vector2D(this.x, this.z); }, | 136| 136| GetRotation: function() { return { "y": 0 }; }, | | [NORMAL] ESLintBear (quote-props): | | Unquoted property 'GetPosition' found. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | 131| 131| AddMock(controller, IID_Position, { | 132| 132| JumpTo: function(x, z) { this.x = x; this.z = z; }, | 133| 133| GetTurretParent: function() { return INVALID_ENTITY; }, | 134| |- GetPosition: function() { return new Vector3D(this.x, 0, this.z); }, | | 134|+ "GetPosition": function() { return new Vector3D(this.x, 0, this.z); }, | 135| 135| GetPosition2D: function() { return new Vector2D(this.x, this.z); }, | 136| 136| GetRotation: function() { return { "y": 0 }; }, | 137| 137| IsInWorld: function() { return true; }, | | [NORMAL] ESLintBear (quote-props): | | Unquoted property 'GetPosition2D' found. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | 132| 132| JumpTo: function(x, z) { this.x = x; this.z = z; }, | 133| 133| GetTurretParent: function() { return INVALID_ENTITY; }, | 134| 134| GetPosition: function() { return new Vector3D(this.x, 0, this.z); }, | 135| |- GetPosition2D: function() { return new Vector2D(this.x, this.z); }, | | 135|+ "GetPosition2D": function() { return new Vector2D(this.x, this.z); }, | 136| 136| GetRotation: function() { return { "y": 0 }; }, | 137| 137| IsInWorld: function() { return true; }, | 138| 138| }); | | [NORMAL] ESLintBear (quote-props): | | Unquoted property 'GetRotation' found. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | 133| 133| GetTurretParent: function() { return INVALID_ENTITY; }, | 134| 134| GetPosition: function() { return new Vector3D(this.x, 0, this.z); }, | 135| 135| GetPosition2D: function() { return new Vector2D(this.x, this.z); }, | 136| |- GetRotation: function() { return { "y": 0 }; }, | | 136|+ "GetRotation": function() { return { "y": 0 }; }, | 137| 137| IsInWorld: function() { return true; }, | 138| 138| }); | 139| 139| | | [NORMAL] ESLintBear (quote-props): | | Unquoted property 'IsInWorld' found. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | 134| 134| GetPosition: function() { return new Vector3D(this.x, 0, this.z); }, | 135| 135| GetPosition2D: function() { return new Vector2D(this.x, this.z); }, | 136| 136| GetRotation: function() { return { "y": 0 }; }, | 137| |- IsInWorld: function() { return true; }, | | 137|+ "IsInWorld": function() { return true; }, | 138| 138| }); | 139| 139| | 140| 140| AddMock(controller, IID_UnitMotion, { | | [NORMAL] ESLintBear (quote-props): | | Unquoted property 'SetSpeed' found. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | 138| 138| }); | 139| 139| | 140| 140| AddMock(controller, IID_UnitMotion, { | 141| |- SetSpeed: function(speed) { }, | | 141|+ "SetSpeed": function(speed) { }, | 142| 142| MoveToPointRange: function(x, z, minRange, maxRange) { }, | 143| 143| GetPassabilityClassName: function() { return "default"; }, | 144| 144| }); | | [NORMAL] ESLintBear (quote-props): | | Unquoted property 'MoveToPointRange' found. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | 139| 139| | 140| 140| AddMock(controller, IID_UnitMotion, { | 141| 141| SetSpeed: function(speed) { }, | 142| |- MoveToPointRange: function(x, z, minRange, maxRange) { }, | | 142|+ "MoveToPointRange": function(x, z, minRange, maxRange) { }, | 143| 143| GetPassabilityClassName: function() { return "default"; }, | 144| 144| }); | 145| 145| | | [NORMAL] ESLintBear (quote-props): | | Unquoted property 'GetPassabilityClassName' found. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | 140| 140| AddMock(controller, IID_UnitMotion, { | 141| 141| SetSpeed: function(speed) { }, | 142| 142| MoveToPointRange: function(x, z, minRange, maxRange) { }, | 143| |- GetPassabilityClassName: function() { return "default"; }, | | 143|+ "GetPassabilityClassName": function() { return "default"; }, | 144| 144| }); | 145| 145| | 146| 146| controllerAI.OnCreate(); | | [NORMAL] ESLintBear (quote-props): | | Unquoted property 'SetInterval' found. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | 181| 181| var unitAIs = []; | 182| 182| | 183| 183| AddMock(SYSTEM_ENTITY, IID_Timer, { | 184| |- SetInterval: function() { }, | | 184|+ "SetInterval": function() { }, | 185| 185| SetTimeout: function() { }, | 186| 186| }); | 187| 187| | | [NORMAL] ESLintBear (quote-props): | | Unquoted property 'SetTimeout' found. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | 182| 182| | 183| 183| AddMock(SYSTEM_ENTITY, IID_Timer, { | 184| 184| SetInterval: function() { }, | 185| |- SetTimeout: function() { }, | | 185|+ "SetTimeout": function() { }, | 186| 186| }); | 187| 187| | 188| 188| | | [NORMAL] ESLintBear (quote-props): | | Unquoted property 'CreateActiveQuery' found. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | 187| 187| | 188| 188| | 189| 189| AddMock(SYSTEM_ENTITY, IID_RangeManager, { | 190| |- CreateActiveQuery: function(ent, minRange, maxRange, players, iid, flags) { | | 190|+ "CreateActiveQuery": function(ent, minRange, maxRange, players, iid, flags) { | 191| 191| return 1; | 192| 192| }, | 193| 193| EnableActiveQuery: function(id) { }, | | [NORMAL] ESLintBear (quote-props): | | Unquoted property 'EnableActiveQuery' found. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | 190| 190| CreateActiveQuery: function(ent, minRange, maxRange, players, iid, flags) { | 191| 191| return 1; | 192| 192| }, | 193| |- EnableActiveQuery: function(id) { }, | | 193|+ "EnableActiveQuery": function(id) { }, | 194| 194| ResetActiveQuery: function(id) { return [enemy]; }, | 195| 195| DisableActiveQuery: function(id) { }, | 196| 196| GetEntityFlagMask: function(identifier) { }, | | [NORMAL] ESLintBear (quote-props): | | Unquoted property 'ResetActiveQuery' found. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | 191| 191| return 1; | 192| 192| }, | 193| 193| EnableActiveQuery: function(id) { }, | 194| |- ResetActiveQuery: function(id) { return [enemy]; }, | | 194|+ "ResetActiveQuery": function(id) { return [enemy]; }, | 195| 195| DisableActiveQuery: function(id) { }, | 196| 196| GetEntityFlagMask: function(identifier) { }, | 197| 197| }); | | [NORMAL] ESLintBear (quote-props): | | Unquoted property 'DisableActiveQuery' found. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | 192| 192| }, | 193| 193| EnableActiveQuery: function(id) { }, | 194| 194| ResetActiveQuery: function(id) { return [enemy]; }, | 195| |- DisableActiveQuery: function(id) { }, | | 195|+ "DisableActiveQuery": function(id) { }, | 196| 196| GetEntityFlagMask: function(identifier) { }, | 197| 197| }); | 198| 198| | | [NORMAL] ESLintBear (quote-props): | | Unquoted property 'GetEntityFlagMask' found. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | 193| 193| EnableActiveQuery: function(id) { }, | 194| 194| ResetActiveQuery: function(id) { return [enemy]; }, | 195| 195| DisableActiveQuery: function(id) { }, | 196| |- GetEntityFlagMask: function(identifier) { }, | | 196|+ "GetEntityFlagMask": function(identifier) { }, | 197| 197| }); | 198| 198| | 199| 199| AddMock(SYSTEM_ENTITY, IID_TemplateManager, { | | [NORMAL] ESLintBear (quote-props): | | Unquoted property 'GetCurrentTemplateName' found. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | 197| 197| }); | 198| 198| | 199| 199| AddMock(SYSTEM_ENTITY, IID_TemplateManager, { | 200| |- GetCurrentTemplateName: function(ent) { return "special/formations/line_closed"; }, | | 200|+ "GetCurrentTemplateName": function(ent) { return "special/formations/line_closed"; }, | 201| 201| }); | 202| 202| | 203| 203| AddMock(SYSTEM_ENTITY, IID_PlayerManager, { | | [NORMAL] ESLintBear (quote-props): | | Unquoted property 'GetPlayerByID' found. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | 201| 201| }); | 202| 202| | 203| 203| AddMock(SYSTEM_ENTITY, IID_PlayerManager, { | 204| |- GetPlayerByID: function(id) { return playerEntity; }, | | 204|+ "GetPlayerByID": function(id) { return playerEntity; }, | 205| 205| GetNumPlayers: function() { return 2; }, | 206| 206| }); | 207| 207| | | [NORMAL] ESLintBear (quote-props): | | Unquoted property 'GetNumPlayers' found. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | 202| 202| | 203| 203| AddMock(SYSTEM_ENTITY, IID_PlayerManager, { | 204| 204| GetPlayerByID: function(id) { return playerEntity; }, | 205| |- GetNumPlayers: function() { return 2; }, | | 205|+ "GetNumPlayers": function() { return 2; }, | 206| 206| }); | 207| 207| | 208| 208| AddMock(playerEntity, IID_Player, { | | [NORMAL] ESLintBear (quote-props): | | Unquoted property 'IsAlly' found. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | 206| 206| }); | 207| 207| | 208| 208| AddMock(playerEntity, IID_Player, { | 209| |- IsAlly: function() { return false; }, | | 209|+ "IsAlly": function() { return false; }, | 210| 210| IsEnemy: function() { return true; }, | 211| 211| GetEnemies: function() { return []; }, | 212| 212| }); | | [NORMAL] ESLintBear (quote-props): | | Unquoted property 'IsEnemy' found. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | 207| 207| | 208| 208| AddMock(playerEntity, IID_Player, { | 209| 209| IsAlly: function() { return false; }, | 210| |- IsEnemy: function() { return true; }, | | 210|+ "IsEnemy": function() { return true; }, | 211| 211| GetEnemies: function() { return []; }, | 212| 212| }); | 213| 213| | | [NORMAL] ESLintBear (quote-props): | | Unquoted property 'GetEnemies' found. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | 208| 208| AddMock(playerEntity, IID_Player, { | 209| 209| IsAlly: function() { return false; }, | 210| 210| IsEnemy: function() { return true; }, | 211| |- GetEnemies: function() { return []; }, | | 211|+ "GetEnemies": function() { return []; }, | 212| 212| }); | 213| 213| | 214| 214| // create units | | [NORMAL] ESLintBear (quote-props): | | Unquoted property 'GetClassesList' found. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | 219| 219| var unitAI = ConstructComponent(unit + i, "UnitAI", { "FormationController": "false", "DefaultStance": "aggressive" }); | 220| 220| | 221| 221| AddMock(unit + i, IID_Identity, { | 222| |- GetClassesList: function() { return []; }, | | 222|+ "GetClassesList": function() { return []; }, | 223| 223| }); | 224| 224| | 225| 225| AddMock(unit + i, IID_Ownership, { | | [NORMAL] ESLintBear (quote-props): | | Unquoted property 'GetOwner' found. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | 223| 223| }); | 224| 224| | 225| 225| AddMock(unit + i, IID_Ownership, { | 226| |- GetOwner: function() { return 1; }, | | 226|+ "GetOwner": function() { return 1; }, | 227| 227| }); | 228| 228| | 229| 229| AddMock(unit + i, IID_Position, { | | [NORMAL] ESLintBear (quote-props): | | Unquoted property 'GetTurretParent' found. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | 227| 227| }); | 228| 228| | 229| 229| AddMock(unit + i, IID_Position, { | 230| |- GetTurretParent: function() { return INVALID_ENTITY; }, | | 230|+ "GetTurretParent": function() { return INVALID_ENTITY; }, | 231| 231| GetPosition: function() { return new Vector3D(); }, | 232| 232| GetPosition2D: function() { return new Vector2D(); }, | 233| 233| GetRotation: function() { return { "y": 0 }; }, | | [NORMAL] ESLintBear (quote-props): | | Unquoted property 'GetPosition' found. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | 228| 228| | 229| 229| AddMock(unit + i, IID_Position, { | 230| 230| GetTurretParent: function() { return INVALID_ENTITY; }, | 231| |- GetPosition: function() { return new Vector3D(); }, | | 231|+ "GetPosition": function() { return new Vector3D(); }, | 232| 232| GetPosition2D: function() { return new Vector2D(); }, | 233| 233| GetRotation: function() { return { "y": 0 }; }, | 234| 234| IsInWorld: function() { return true; }, | | [NORMAL] ESLintBear (quote-props): | | Unquoted property 'GetPosition2D' found. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | 229| 229| AddMock(unit + i, IID_Position, { | 230| 230| GetTurretParent: function() { return INVALID_ENTITY; }, | 231| 231| GetPosition: function() { return new Vector3D(); }, | 232| |- GetPosition2D: function() { return new Vector2D(); }, | | 232|+ "GetPosition2D": function() { return new Vector2D(); }, | 233| 233| GetRotation: function() { return { "y": 0 }; }, | 234| 234| IsInWorld: function() { return true; }, | 235| 235| }); | | [NORMAL] ESLintBear (quote-props): | | Unquoted property 'GetRotation' found. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | 230| 230| GetTurretParent: function() { return INVALID_ENTITY; }, | 231| 231| GetPosition: function() { return new Vector3D(); }, | 232| 232| GetPosition2D: function() { return new Vector2D(); }, | 233| |- GetRotation: function() { return { "y": 0 }; }, | | 233|+ "GetRotation": function() { return { "y": 0 }; }, | 234| 234| IsInWorld: function() { return true; }, | 235| 235| }); | 236| 236| | | [NORMAL] ESLintBear (quote-props): | | Unquoted property 'IsInWorld' found. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | 231| 231| GetPosition: function() { return new Vector3D(); }, | 232| 232| GetPosition2D: function() { return new Vector2D(); }, | 233| 233| GetRotation: function() { return { "y": 0 }; }, | 234| |- IsInWorld: function() { return true; }, | | 234|+ "IsInWorld": function() { return true; }, | 235| 235| }); | 236| 236| | 237| 237| AddMock(unit + i, IID_UnitMotion, { | | [NORMAL] ESLintBear (quote-props): | | Unquoted property 'GetWalkSpeed' found. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | 235| 235| }); | 236| 236| | 237| 237| AddMock(unit + i, IID_UnitMotion, { | 238| |- GetWalkSpeed: function() { return 1; }, | | 238|+ "GetWalkSpeed": function() { return 1; }, | 239| 239| MoveToFormationOffset: function(target, x, z) { }, | 240| 240| IsInTargetRange: function(target, min, max) { return true; }, | 241| 241| MoveToTargetRange: function(target, min, max) { }, | | [NORMAL] ESLintBear (quote-props): | | Unquoted property 'MoveToFormationOffset' found. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | 236| 236| | 237| 237| AddMock(unit + i, IID_UnitMotion, { | 238| 238| GetWalkSpeed: function() { return 1; }, | 239| |- MoveToFormationOffset: function(target, x, z) { }, | | 239|+ "MoveToFormationOffset": function(target, x, z) { }, | 240| 240| IsInTargetRange: function(target, min, max) { return true; }, | 241| 241| MoveToTargetRange: function(target, min, max) { }, | 242| 242| StopMoving: function() { }, | | [NORMAL] ESLintBear (quote-props): | | Unquoted property 'IsInTargetRange' found. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | 237| 237| AddMock(unit + i, IID_UnitMotion, { | 238| 238| GetWalkSpeed: function() { return 1; }, | 239| 239| MoveToFormationOffset: function(target, x, z) { }, | 240| |- IsInTargetRange: function(target, min, max) { return true; }, | | 240|+ "IsInTargetRange": function(target, min, max) { return true; }, | 241| 241| MoveToTargetRange: function(target, min, max) { }, | 242| 242| StopMoving: function() { }, | 243| 243| GetPassabilityClassName: function() { return "default"; }, | | [NORMAL] ESLintBear (quote-props): | | Unquoted property 'MoveToTargetRange' found. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | 238| 238| GetWalkSpeed: function() { return 1; }, | 239| 239| MoveToFormationOffset: function(target, x, z) { }, | 240| 240| IsInTargetRange: function(target, min, max) { return true; }, | 241| |- MoveToTargetRange: function(target, min, max) { }, | | 241|+ "MoveToTargetRange": function(target, min, max) { }, | 242| 242| StopMoving: function() { }, | 243| 243| GetPassabilityClassName: function() { return "default"; }, | 244| 244| }); | | [NORMAL] ESLintBear (quote-props): | | Unquoted property 'StopMoving' found. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | 239| 239| MoveToFormationOffset: function(target, x, z) { }, | 240| 240| IsInTargetRange: function(target, min, max) { return true; }, | 241| 241| MoveToTargetRange: function(target, min, max) { }, | 242| |- StopMoving: function() { }, | | 242|+ "StopMoving": function() { }, | 243| 243| GetPassabilityClassName: function() { return "default"; }, | 244| 244| }); | 245| 245| | | [NORMAL] ESLintBear (quote-props): | | Unquoted property 'GetPassabilityClassName' found. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | 240| 240| IsInTargetRange: function(target, min, max) { return true; }, | 241| 241| MoveToTargetRange: function(target, min, max) { }, | 242| 242| StopMoving: function() { }, | 243| |- GetPassabilityClassName: function() { return "default"; }, | | 243|+ "GetPassabilityClassName": function() { return "default"; }, | 244| 244| }); | 245| 245| | 246| 246| AddMock(unit + i, IID_Vision, { | | [NORMAL] ESLintBear (quote-props): | | Unquoted property 'GetRange' found. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | 244| 244| }); | 245| 245| | 246| 246| AddMock(unit + i, IID_Vision, { | 247| |- GetRange: function() { return 10; }, | | 247|+ "GetRange": function() { return 10; }, | 248| 248| }); | 249| 249| | 250| 250| AddMock(unit + i, IID_Attack, { | | [NORMAL] ESLintBear (quote-props): | | Unquoted property 'GetRange' found. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | 248| 248| }); | 249| 249| | 250| 250| AddMock(unit + i, IID_Attack, { | 251| |- GetRange: function() { return {"max":10, "min": 0}; }, | | 251|+ "GetRange": function() { return {"max":10, "min": 0}; }, | 252| 252| GetFullAttackRange: function() { return { "max": 40, "min": 0}; }, | 253| 253| GetBestAttackAgainst: function(t) { return "melee"; }, | 254| 254| GetTimers: function() { return { "prepare": 500, "repeat": 1000 }; }, | | [NORMAL] ESLintBear (object-curly-spacing): | | A space is required after '{'. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | 248| 248| }); | 249| 249| | 250| 250| AddMock(unit + i, IID_Attack, { | 251| |- GetRange: function() { return {"max":10, "min": 0}; }, | | 251|+ GetRange: function() { return { "max":10, "min": 0}; }, | 252| 252| GetFullAttackRange: function() { return { "max": 40, "min": 0}; }, | 253| 253| GetBestAttackAgainst: function(t) { return "melee"; }, | 254| 254| GetTimers: function() { return { "prepare": 500, "repeat": 1000 }; }, | | [NORMAL] ESLintBear (key-spacing): | | Missing space before value for key 'max'. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | 248| 248| }); | 249| 249| | 250| 250| AddMock(unit + i, IID_Attack, { | 251| |- GetRange: function() { return {"max":10, "min": 0}; }, | | 251|+ GetRange: function() { return {"max": 10, "min": 0}; }, | 252| 252| GetFullAttackRange: function() { return { "max": 40, "min": 0}; }, | 253| 253| GetBestAttackAgainst: function(t) { return "melee"; }, | 254| 254| GetTimers: function() { return { "prepare": 500, "repeat": 1000 }; }, | | [NORMAL] ESLintBear (object-curly-spacing): | | A space is required before '}'. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | 248| 248| }); | 249| 249| | 250| 250| AddMock(unit + i, IID_Attack, { | 251| |- GetRange: function() { return {"max":10, "min": 0}; }, | | 251|+ GetRange: function() { return {"max":10, "min": 0 }; }, | 252| 252| GetFullAttackRange: function() { return { "max": 40, "min": 0}; }, | 253| 253| GetBestAttackAgainst: function(t) { return "melee"; }, | 254| 254| GetTimers: function() { return { "prepare": 500, "repeat": 1000 }; }, | | [NORMAL] ESLintBear (quote-props): | | Unquoted property 'GetFullAttackRange' found. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | 249| 249| | 250| 250| AddMock(unit + i, IID_Attack, { | 251| 251| GetRange: function() { return {"max":10, "min": 0}; }, | 252| |- GetFullAttackRange: function() { return { "max": 40, "min": 0}; }, | | 252|+ "GetFullAttackRange": function() { return { "max": 40, "min": 0}; }, | 253| 253| GetBestAttackAgainst: function(t) { return "melee"; }, | 254| 254| GetTimers: function() { return { "prepare": 500, "repeat": 1000 }; }, | 255| 255| CanAttack: function(v) { return true; }, | | [NORMAL] ESLintBear (object-curly-spacing): | | A space is required before '}'. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | 249| 249| | 250| 250| AddMock(unit + i, IID_Attack, { | 251| 251| GetRange: function() { return {"max":10, "min": 0}; }, | 252| |- GetFullAttackRange: function() { return { "max": 40, "min": 0}; }, | | 252|+ GetFullAttackRange: function() { return { "max": 40, "min": 0 }; }, | 253| 253| GetBestAttackAgainst: function(t) { return "melee"; }, | 254| 254| GetTimers: function() { return { "prepare": 500, "repeat": 1000 }; }, | 255| 255| CanAttack: function(v) { return true; }, | | [NORMAL] ESLintBear (quote-props): | | Unquoted property 'GetBestAttackAgainst' found. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | 250| 250| AddMock(unit + i, IID_Attack, { | 251| 251| GetRange: function() { return {"max":10, "min": 0}; }, | 252| 252| GetFullAttackRange: function() { return { "max": 40, "min": 0}; }, | 253| |- GetBestAttackAgainst: function(t) { return "melee"; }, | | 253|+ "GetBestAttackAgainst": function(t) { return "melee"; }, | 254| 254| GetTimers: function() { return { "prepare": 500, "repeat": 1000 }; }, | 255| 255| CanAttack: function(v) { return true; }, | 256| 256| CompareEntitiesByPreference: function(a, b) { return 0; }, | | [NORMAL] ESLintBear (quote-props): | | Unquoted property 'GetTimers' found. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | 251| 251| GetRange: function() { return {"max":10, "min": 0}; }, | 252| 252| GetFullAttackRange: function() { return { "max": 40, "min": 0}; }, | 253| 253| GetBestAttackAgainst: function(t) { return "melee"; }, | 254| |- GetTimers: function() { return { "prepare": 500, "repeat": 1000 }; }, | | 254|+ "GetTimers": function() { return { "prepare": 500, "repeat": 1000 }; }, | 255| 255| CanAttack: function(v) { return true; }, | 256| 256| CompareEntitiesByPreference: function(a, b) { return 0; }, | 257| 257| }); | | [NORMAL] ESLintBear (quote-props): | | Unquoted property 'CanAttack' found. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | 252| 252| GetFullAttackRange: function() { return { "max": 40, "min": 0}; }, | 253| 253| GetBestAttackAgainst: function(t) { return "melee"; }, | 254| 254| GetTimers: function() { return { "prepare": 500, "repeat": 1000 }; }, | 255| |- CanAttack: function(v) { return true; }, | | 255|+ "CanAttack": function(v) { return true; }, | 256| 256| CompareEntitiesByPreference: function(a, b) { return 0; }, | 257| 257| }); | 258| 258| | | [NORMAL] ESLintBear (quote-props): | | Unquoted property 'CompareEntitiesByPreference' found. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | 253| 253| GetBestAttackAgainst: function(t) { return "melee"; }, | 254| 254| GetTimers: function() { return { "prepare": 500, "repeat": 1000 }; }, | 255| 255| CanAttack: function(v) { return true; }, | 256| |- CompareEntitiesByPreference: function(a, b) { return 0; }, | | 256|+ "CompareEntitiesByPreference": function(a, b) { return 0; }, | 257| 257| }); | 258| 258| | 259| 259| unitAI.OnCreate(); | | [NORMAL] ESLintBear (quote-props): | | Unquoted property 'GetHitpoints' found. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | 265| 265| | 266| 266| // create enemy | 267| 267| AddMock(enemy, IID_Health, { | 268| |- GetHitpoints: function() { return 40; }, | | 268|+ "GetHitpoints": function() { return 40; }, | 269| 269| }); | 270| 270| | 271| 271| var controllerFormation = ConstructComponent(controller, "Formation", {"FormationName": "Line Closed", "FormationShape": "square", "ShiftRows": "false", "SortingClasses": "", "WidthDepthRatio": 1, "UnitSeparationWidthMultiplier": 1, "UnitSeparationDepthMultiplier": 1, "SpeedMultiplier": 1, "Sloppyness": 0}); | | [NORMAL] ESLintBear (object-curly-spacing): | | A space is required after '{'. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | 268| 268| GetHitpoints: function() { return 40; }, | 269| 269| }); | 270| 270| | 271| |- var controllerFormation = ConstructComponent(controller, "Formation", {"FormationName": "Line Closed", "FormationShape": "square", "ShiftRows": "false", "SortingClasses": "", "WidthDepthRatio": 1, "UnitSeparationWidthMultiplier": 1, "UnitSeparationDepthMultiplier": 1, "SpeedMultiplier": 1, "Sloppyness": 0}); | | 271|+ var controllerFormation = ConstructComponent(controller, "Formation", { "FormationName": "Line Closed", "FormationShape": "square", "ShiftRows": "false", "SortingClasses": "", "WidthDepthRatio": 1, "UnitSeparationWidthMultiplier": 1, "UnitSeparationDepthMultiplier": 1, "SpeedMultiplier": 1, "Sloppyness": 0}); | 272| 272| var controllerAI = ConstructComponent(controller, "UnitAI", { "FormationController": "true", "DefaultStance": "aggressive" }); | 273| 273| | 274| 274| AddMock(controller, IID_Position, { | | [NORMAL] ESLintBear (object-curly-spacing): | | A space is required before '}'. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | 268| 268| GetHitpoints: function() { return 40; }, | 269| 269| }); | 270| 270| | 271| |- var controllerFormation = ConstructComponent(controller, "Formation", {"FormationName": "Line Closed", "FormationShape": "square", "ShiftRows": "false", "SortingClasses": "", "WidthDepthRatio": 1, "UnitSeparationWidthMultiplier": 1, "UnitSeparationDepthMultiplier": 1, "SpeedMultiplier": 1, "Sloppyness": 0}); | | 271|+ var controllerFormation = ConstructComponent(controller, "Formation", {"FormationName": "Line Closed", "FormationShape": "square", "ShiftRows": "false", "SortingClasses": "", "WidthDepthRatio": 1, "UnitSeparationWidthMultiplier": 1, "UnitSeparationDepthMultiplier": 1, "SpeedMultiplier": 1, "Sloppyness": 0 }); | 272| 272| var controllerAI = ConstructComponent(controller, "UnitAI", { "FormationController": "true", "DefaultStance": "aggressive" }); | 273| 273| | 274| 274| AddMock(controller, IID_Position, { | | [NORMAL] ESLintBear (quote-props): | | Unquoted property 'GetTurretParent' found. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | 272| 272| var controllerAI = ConstructComponent(controller, "UnitAI", { "FormationController": "true", "DefaultStance": "aggressive" }); | 273| 273| | 274| 274| AddMock(controller, IID_Position, { | 275| |- GetTurretParent: function() { return INVALID_ENTITY; }, | | 275|+ "GetTurretParent": function() { return INVALID_ENTITY; }, | 276| 276| JumpTo: function(x, z) { this.x = x; this.z = z; }, | 277| 277| GetPosition: function() { return new Vector3D(this.x, 0, this.z); }, | 278| 278| GetPosition2D: function() { return new Vector2D(this.x, this.z); }, | | [NORMAL] ESLintBear (quote-props): | | Unquoted property 'JumpTo' found. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | 273| 273| | 274| 274| AddMock(controller, IID_Position, { | 275| 275| GetTurretParent: function() { return INVALID_ENTITY; }, | 276| |- JumpTo: function(x, z) { this.x = x; this.z = z; }, | | 276|+ "JumpTo": function(x, z) { this.x = x; this.z = z; }, | 277| 277| GetPosition: function() { return new Vector3D(this.x, 0, this.z); }, | 278| 278| GetPosition2D: function() { return new Vector2D(this.x, this.z); }, | 279| 279| GetRotation: function() { return { "y": 0 }; }, | | [NORMAL] ESLintBear (quote-props): | | Unquoted property 'GetPosition' found. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | 274| 274| AddMock(controller, IID_Position, { | 275| 275| GetTurretParent: function() { return INVALID_ENTITY; }, | 276| 276| JumpTo: function(x, z) { this.x = x; this.z = z; }, | 277| |- GetPosition: function() { return new Vector3D(this.x, 0, this.z); }, | | 277|+ "GetPosition": function() { return new Vector3D(this.x, 0, this.z); }, | 278| 278| GetPosition2D: function() { return new Vector2D(this.x, this.z); }, | 279| 279| GetRotation: function() { return { "y": 0 }; }, | 280| 280| IsInWorld: function() { return true; }, | | [NORMAL] ESLintBear (quote-props): | | Unquoted property 'GetPosition2D' found. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | 275| 275| GetTurretParent: function() { return INVALID_ENTITY; }, | 276| 276| JumpTo: function(x, z) { this.x = x; this.z = z; }, | 277| 277| GetPosition: function() { return new Vector3D(this.x, 0, this.z); }, | 278| |- GetPosition2D: function() { return new Vector2D(this.x, this.z); }, | | 278|+ "GetPosition2D": function() { return new Vector2D(this.x, this.z); }, | 279| 279| GetRotation: function() { return { "y": 0 }; }, | 280| 280| IsInWorld: function() { return true; }, | 281| 281| }); | | [NORMAL] ESLintBear (quote-props): | | Unquoted property 'GetRotation' found. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | 276| 276| JumpTo: function(x, z) { this.x = x; this.z = z; }, | 277| 277| GetPosition: function() { return new Vector3D(this.x, 0, this.z); }, | 278| 278| GetPosition2D: function() { return new Vector2D(this.x, this.z); }, | 279| |- GetRotation: function() { return { "y": 0 }; }, | | 279|+ "GetRotation": function() { return { "y": 0 }; }, | 280| 280| IsInWorld: function() { return true; }, | 281| 281| }); | 282| 282| | | [NORMAL] ESLintBear (quote-props): | | Unquoted property 'IsInWorld' found. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | 277| 277| GetPosition: function() { return new Vector3D(this.x, 0, this.z); }, | 278| 278| GetPosition2D: function() { return new Vector2D(this.x, this.z); }, | 279| 279| GetRotation: function() { return { "y": 0 }; }, | 280| |- IsInWorld: function() { return true; }, | | 280|+ "IsInWorld": function() { return true; }, | 281| 281| }); | 282| 282| | 283| 283| AddMock(controller, IID_UnitMotion, { | | [NORMAL] ESLintBear (quote-props): | | Unquoted property 'SetSpeed' found. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | 281| 281| }); | 282| 282| | 283| 283| AddMock(controller, IID_UnitMotion, { | 284| |- SetSpeed: function(speed) { }, | | 284|+ "SetSpeed": function(speed) { }, | 285| 285| MoveToPointRange: function(x, z, minRange, maxRange) { }, | 286| 286| IsInTargetRange: function(target, min, max) { return true; }, | 287| 287| GetPassabilityClassName: function() { return "default"; }, | | [NORMAL] ESLintBear (quote-props): | | Unquoted property 'MoveToPointRange' found. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | 282| 282| | 283| 283| AddMock(controller, IID_UnitMotion, { | 284| 284| SetSpeed: function(speed) { }, | 285| |- MoveToPointRange: function(x, z, minRange, maxRange) { }, | | 285|+ "MoveToPointRange": function(x, z, minRange, maxRange) { }, | 286| 286| IsInTargetRange: function(target, min, max) { return true; }, | 287| 287| GetPassabilityClassName: function() { return "default"; }, | 288| 288| }); | | [NORMAL] ESLintBear (quote-props): | | Unquoted property 'IsInTargetRange' found. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | 283| 283| AddMock(controller, IID_UnitMotion, { | 284| 284| SetSpeed: function(speed) { }, | 285| 285| MoveToPointRange: function(x, z, minRange, maxRange) { }, | 286| |- IsInTargetRange: function(target, min, max) { return true; }, | | 286|+ "IsInTargetRange": function(target, min, max) { return true; }, | 287| 287| GetPassabilityClassName: function() { return "default"; }, | 288| 288| }); | 289| 289| | | [NORMAL] ESLintBear (quote-props): | | Unquoted property 'GetPassabilityClassName' found. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | 284| 284| SetSpeed: function(speed) { }, | 285| 285| MoveToPointRange: function(x, z, minRange, maxRange) { }, | 286| 286| IsInTargetRange: function(target, min, max) { return true; }, | 287| |- GetPassabilityClassName: function() { return "default"; }, | | 287|+ "GetPassabilityClassName": function() { return "default"; }, | 288| 288| }); | 289| 289| | 290| 290| AddMock(controller, IID_Attack, { | | [NORMAL] ESLintBear (quote-props): | | Unquoted property 'GetRange' found. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | 288| 288| }); | 289| 289| | 290| 290| AddMock(controller, IID_Attack, { | 291| |- GetRange: function() { return {"max":10, "min": 0}; }, | | 291|+ "GetRange": function() { return {"max":10, "min": 0}; }, | 292| 292| CanAttackAsFormation: function() { return false; }, | 293| 293| }); | 294| 294| | | [NORMAL] ESLintBear (object-curly-spacing): | | A space is required after '{'. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | 288| 288| }); | 289| 289| | 290| 290| AddMock(controller, IID_Attack, { | 291| |- GetRange: function() { return {"max":10, "min": 0}; }, | | 291|+ GetRange: function() { return { "max":10, "min": 0}; }, | 292| 292| CanAttackAsFormation: function() { return false; }, | 293| 293| }); | 294| 294| | | [NORMAL] ESLintBear (key-spacing): | | Missing space before value for key 'max'. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | 288| 288| }); | 289| 289| | 290| 290| AddMock(controller, IID_Attack, { | 291| |- GetRange: function() { return {"max":10, "min": 0}; }, | | 291|+ GetRange: function() { return {"max": 10, "min": 0}; }, | 292| 292| CanAttackAsFormation: function() { return false; }, | 293| 293| }); | 294| 294| | | [NORMAL] ESLintBear (object-curly-spacing): | | A space is required before '}'. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | 288| 288| }); | 289| 289| | 290| 290| AddMock(controller, IID_Attack, { | 291| |- GetRange: function() { return {"max":10, "min": 0}; }, | | 291|+ GetRange: function() { return {"max":10, "min": 0 }; }, | 292| 292| CanAttackAsFormation: function() { return false; }, | 293| 293| }); | 294| 294| | | [NORMAL] ESLintBear (quote-props): | | Unquoted property 'CanAttackAsFormation' found. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | 289| 289| | 290| 290| AddMock(controller, IID_Attack, { | 291| 291| GetRange: function() { return {"max":10, "min": 0}; }, | 292| |- CanAttackAsFormation: function() { return false; }, | | 292|+ "CanAttackAsFormation": function() { return false; }, | 293| 293| }); | 294| 294| | 295| 295| controllerAI.OnCreate(); | | [NORMAL] ESLintBear (object-curly-spacing): | | A space is required after '{'. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | 301| 301| for (var ent of unitAIs) | 302| 302| TS_ASSERT_EQUALS(unitAI.fsmStateName, "INDIVIDUAL.COMBAT.ATTACKING"); | 303| 303| | 304| |- controllerAI.MoveIntoFormation({"name": "Circle"}); | | 304|+ controllerAI.MoveIntoFormation({ "name": "Circle"}); | 305| 305| | 306| 306| // let all units be in position | 307| 307| for (var ent of unitAIs) | | [NORMAL] ESLintBear (object-curly-spacing): | | A space is required before '}'. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | 301| 301| for (var ent of unitAIs) | 302| 302| TS_ASSERT_EQUALS(unitAI.fsmStateName, "INDIVIDUAL.COMBAT.ATTACKING"); | 303| 303| | 304| |- controllerAI.MoveIntoFormation({"name": "Circle"}); | | 304|+ controllerAI.MoveIntoFormation({"name": "Circle" }); | 305| 305| | 306| 306| // let all units be in position | 307| 307| for (var ent of unitAIs) binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | 47| » » ResetActiveQuery:·function(id)·{·if·(mode·==·0)·return·[];·else·return·[enemy];·}, | | [NORMAL] ESLintBear (brace-rules/brace-on-same-line): | | Closing curly brace appears on the same line as the subsequent block. binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | 215| » for·(var·i·=·0;·i·<·unitCount;·i++)·{ | | [NORMAL] ESLintBear (brace-rules/brace-on-same-line): | | Opening curly brace appears on the same line as controlling statement. binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | 307| » for·(var·ent·of·unitAIs) | | [NORMAL] JSHintBear: | | 'ent' is already defined. binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | 310| » for·(var·ent·of·unitAIs) | | [NORMAL] JSHintBear: | | 'ent' is already defined. binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | 302| » » TS_ASSERT_EQUALS(unitAI.fsmStateName,·"INDIVIDUAL.COMBAT.ATTACKING"); | | [NORMAL] JSHintBear: | | 'unitAI' used out of scope. binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | 311| » » TS_ASSERT_EQUALS(unitAI.fsmStateName,·"INDIVIDUAL.COMBAT.ATTACKING"); | | [NORMAL] JSHintBear: | | 'unitAI' used out of scope. | | [NORMAL] ESLintBear (quote-props): | | Unquoted property 'targetVisibleEnemies' found. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | 73| 73| // do worry around armies slaughtering the guy standing next to you), etc. | 74| 74| var g_Stances = { | 75| 75| "violent": { | 76| |- targetVisibleEnemies: true, | | 76|+ "targetVisibleEnemies": true, | 77| 77| targetAttackersAlways: true, | 78| 78| respondFlee: false, | 79| 79| respondChase: true, | | [NORMAL] ESLintBear (quote-props): | | Unquoted property 'targetAttackersAlways' found. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | 74| 74| var g_Stances = { | 75| 75| "violent": { | 76| 76| targetVisibleEnemies: true, | 77| |- targetAttackersAlways: true, | | 77|+ "targetAttackersAlways": true, | 78| 78| respondFlee: false, | 79| 79| respondChase: true, | 80| 80| respondChaseBeyondVision: true, | | [NORMAL] ESLintBear (quote-props): | | Unquoted property 'respondFlee' found. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | 75| 75| "violent": { | 76| 76| targetVisibleEnemies: true, | 77| 77| targetAttackersAlways: true, | 78| |- respondFlee: false, | | 78|+ "respondFlee": false, | 79| 79| respondChase: true, | 80| 80| respondChaseBeyondVision: true, | 81| 81| respondStandGround: false, | | [NORMAL] ESLintBear (quote-props): | | Unquoted property 'respondChase' found. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | 76| 76| targetVisibleEnemies: true, | 77| 77| targetAttackersAlways: true, | 78| 78| respondFlee: false, | 79| |- respondChase: true, | | 79|+ "respondChase": true, | 80| 80| respondChaseBeyondVision: true, | 81| 81| respondStandGround: false, | 82| 82| respondHoldGround: false, | | [NORMAL] ESLintBear (quote-props): | | Unquoted property 'respondChaseBeyondVision' found. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | 77| 77| targetAttackersAlways: true, | 78| 78| respondFlee: false, | 79| 79| respondChase: true, | 80| |- respondChaseBeyondVision: true, | | 80|+ "respondChaseBeyondVision": true, | 81| 81| respondStandGround: false, | 82| 82| respondHoldGround: false, | 83| 83| }, | | [NORMAL] ESLintBear (quote-props): | | Unquoted property 'respondStandGround' found. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | 78| 78| respondFlee: false, | 79| 79| respondChase: true, | 80| 80| respondChaseBeyondVision: true, | 81| |- respondStandGround: false, | | 81|+ "respondStandGround": false, | 82| 82| respondHoldGround: false, | 83| 83| }, | 84| 84| "aggressive": { | | [NORMAL] ESLintBear (quote-props): | | Unquoted property 'respondHoldGround' found. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | 79| 79| respondChase: true, | 80| 80| respondChaseBeyondVision: true, | 81| 81| respondStandGround: false, | 82| |- respondHoldGround: false, | | 82|+ "respondHoldGround": false, | 83| 83| }, | 84| 84| "aggressive": { | 85| 85| targetVisibleEnemies: true, | | [NORMAL] ESLintBear (quote-props): | | Unquoted property 'targetVisibleEnemies' found. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | 82| 82| respondHoldGround: false, | 83| 83| }, | 84| 84| "aggressive": { | 85| |- targetVisibleEnemies: true, | | 85|+ "targetVisibleEnemies": true, | 86| 86| targetAttackersAlways: false, | 87| 87| respondFlee: false, | 88| 88| respondChase: true, | | [NORMAL] ESLintBear (quote-props): | | Unquoted property 'targetAttackersAlways' found. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | 83| 83| }, | 84| 84| "aggressive": { | 85| 85| targetVisibleEnemies: true, | 86| |- targetAttackersAlways: false, | | 86|+ "targetAttackersAlways": false, | 87| 87| respondFlee: false, | 88| 88| respondChase: true, | 89| 89| respondChaseBeyondVision: false, | | [NORMAL] ESLintBear (quote-props): | | Unquoted property 'respondFlee' found. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | 84| 84| "aggressive": { | 85| 85| targetVisibleEnemies: true, | 86| 86| targetAttackersAlways: false, | 87| |- respondFlee: false, | | 87|+ "respondFlee": false, | 88| 88| respondChase: true, | 89| 89| respondChaseBeyondVision: false, | 90| 90| respondStandGround: false, | | [NORMAL] ESLintBear (quote-props): | | Unquoted property 'respondChase' found. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | 85| 85| targetVisibleEnemies: true, | 86| 86| targetAttackersAlways: false, | 87| 87| respondFlee: false, | 88| |- respondChase: true, | | 88|+ "respondChase": true, | 89| 89| respondChaseBeyondVision: false, | 90| 90| respondStandGround: false, | 91| 91| respondHoldGround: false, | | [NORMAL] ESLintBear (quote-props): | | Unquoted property 'respondChaseBeyondVision' found. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | 86| 86| targetAttackersAlways: false, | 87| 87| respondFlee: false, | 88| 88| respondChase: true, | 89| |- respondChaseBeyondVision: false, | | 89|+ "respondChaseBeyondVision": false, | 90| 90| respondStandGround: false, | 91| 91| respondHoldGround: false, | 92| 92| }, | | [NORMAL] ESLintBear (quote-props): | | Unquoted property 'respondStandGround' found. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | 87| 87| respondFlee: false, | 88| 88| respondChase: true, | 89| 89| respondChaseBeyondVision: false, | 90| |- respondStandGround: false, | | 90|+ "respondStandGround": false, | 91| 91| respondHoldGround: false, | 92| 92| }, | 93| 93| "defensive": { | | [NORMAL] ESLintBear (quote-props): | | Unquoted property 'respondHoldGround' found. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | 88| 88| respondChase: true, | 89| 89| respondChaseBeyondVision: false, | 90| 90| respondStandGround: false, | 91| |- respondHoldGround: false, | | 91|+ "respondHoldGround": false, | 92| 92| }, | 93| 93| "defensive": { | 94| 94| targetVisibleEnemies: true, | | [NORMAL] ESLintBear (quote-props): | | Unquoted property 'targetVisibleEnemies' found. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | 91| 91| respondHoldGround: false, | 92| 92| }, | 93| 93| "defensive": { | 94| |- targetVisibleEnemies: true, | | 94|+ "targetVisibleEnemies": true, | 95| 95| targetAttackersAlways: false, | 96| 96| respondFlee: false, | 97| 97| respondChase: false, | | [NORMAL] ESLintBear (quote-props): | | Unquoted property 'targetAttackersAlways' found. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | 92| 92| }, | 93| 93| "defensive": { | 94| 94| targetVisibleEnemies: true, | 95| |- targetAttackersAlways: false, | | 95|+ "targetAttackersAlways": false, | 96| 96| respondFlee: false, | 97| 97| respondChase: false, | 98| 98| respondChaseBeyondVision: false, | | [NORMAL] ESLintBear (quote-props): | | Unquoted property 'respondFlee' found. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | 93| 93| "defensive": { | 94| 94| targetVisibleEnemies: true, | 95| 95| targetAttackersAlways: false, | 96| |- respondFlee: false, | | 96|+ "respondFlee": false, | 97| 97| respondChase: false, | 98| 98| respondChaseBeyondVision: false, | 99| 99| respondStandGround: false, | | [NORMAL] ESLintBear (quote-props): | | Unquoted property 'respondChase' found. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | 94| 94| targetVisibleEnemies: true, | 95| 95| targetAttackersAlways: false, | 96| 96| respondFlee: false, | 97| |- respondChase: false, | | 97|+ "respondChase": false, | 98| 98| respondChaseBeyondVision: false, | 99| 99| respondStandGround: false, | 100| 100| respondHoldGround: true, | | [NORMAL] ESLintBear (quote-props): | | Unquoted property 'respondChaseBeyondVision' found. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | 95| 95| targetAttackersAlways: false, | 96| 96| respondFlee: false, | 97| 97| respondChase: false, | 98| |- respondChaseBeyondVision: false, | | 98|+ "respondChaseBeyondVision": false, | 99| 99| respondStandGround: false, | 100| 100| respondHoldGround: true, | 101| 101| }, | | [NORMAL] ESLintBear (quote-props): | | Unquoted property 'respondStandGround' found. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | 96| 96| respondFlee: false, | 97| 97| respondChase: false, | 98| 98| respondChaseBeyondVision: false, | 99| |- respondStandGround: false, | | 99|+ "respondStandGround": false, | 100| 100| respondHoldGround: true, | 101| 101| }, | 102| 102| "passive": { | | [NORMAL] ESLintBear (quote-props): | | Unquoted property 'respondHoldGround' found. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | 97| 97| respondChase: false, | 98| 98| respondChaseBeyondVision: false, | 99| 99| respondStandGround: false, | 100| |- respondHoldGround: true, | | 100|+ "respondHoldGround": true, | 101| 101| }, | 102| 102| "passive": { | 103| 103| targetVisibleEnemies: false, | | [NORMAL] ESLintBear (quote-props): | | Unquoted property 'targetVisibleEnemies' found. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | 100| 100| respondHoldGround: true, | 101| 101| }, | 102| 102| "passive": { | 103| |- targetVisibleEnemies: false, | | 103|+ "targetVisibleEnemies": false, | 104| 104| targetAttackersAlways: false, | 105| 105| respondFlee: true, | 106| 106| respondChase: false, | | [NORMAL] ESLintBear (quote-props): | | Unquoted property 'targetAttackersAlways' found. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | 101| 101| }, | 102| 102| "passive": { | 103| 103| targetVisibleEnemies: false, | 104| |- targetAttackersAlways: false, | | 104|+ "targetAttackersAlways": false, | 105| 105| respondFlee: true, | 106| 106| respondChase: false, | 107| 107| respondChaseBeyondVision: false, | | [NORMAL] ESLintBear (quote-props): | | Unquoted property 'respondFlee' found. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | 102| 102| "passive": { | 103| 103| targetVisibleEnemies: false, | 104| 104| targetAttackersAlways: false, | 105| |- respondFlee: true, | | 105|+ "respondFlee": true, | 106| 106| respondChase: false, | 107| 107| respondChaseBeyondVision: false, | 108| 108| respondStandGround: false, | | [NORMAL] ESLintBear (quote-props): | | Unquoted property 'respondChase' found. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | 103| 103| targetVisibleEnemies: false, | 104| 104| targetAttackersAlways: false, | 105| 105| respondFlee: true, | 106| |- respondChase: false, | | 106|+ "respondChase": false, | 107| 107| respondChaseBeyondVision: false, | 108| 108| respondStandGround: false, | 109| 109| respondHoldGround: false, | | [NORMAL] ESLintBear (quote-props): | | Unquoted property 'respondChaseBeyondVision' found. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | 104| 104| targetAttackersAlways: false, | 105| 105| respondFlee: true, | 106| 106| respondChase: false, | 107| |- respondChaseBeyondVision: false, | | 107|+ "respondChaseBeyondVision": false, | 108| 108| respondStandGround: false, | 109| 109| respondHoldGround: false, | 110| 110| }, | | [NORMAL] ESLintBear (quote-props): | | Unquoted property 'respondStandGround' found. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | 105| 105| respondFlee: true, | 106| 106| respondChase: false, | 107| 107| respondChaseBeyondVision: false, | 108| |- respondStandGround: false, | | 108|+ "respondStandGround": false, | 109| 109| respondHoldGround: false, | 110| 110| }, | 111| 111| "standground": { | | [NORMAL] ESLintBear (quote-props): | | Unquoted property 'respondHoldGround' found. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | 106| 106| respondChase: false, | 107| 107| respondChaseBeyondVision: false, | 108| 108| respondStandGround: false, | 109| |- respondHoldGround: false, | | 109|+ "respondHoldGround": false, | 110| 110| }, | 111| 111| "standground": { | 112| 112| targetVisibleEnemies: true, | | [NORMAL] ESLintBear (quote-props): | | Unquoted property 'targetVisibleEnemies' found. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | 109| 109| respondHoldGround: false, | 110| 110| }, | 111| 111| "standground": { | 112| |- targetVisibleEnemies: true, | | 112|+ "targetVisibleEnemies": true, | 113| 113| targetAttackersAlways: false, | 114| 114| respondFlee: false, | 115| 115| respondChase: false, | | [NORMAL] ESLintBear (quote-props): | | Unquoted property 'targetAttackersAlways' found. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | 110| 110| }, | 111| 111| "standground": { | 112| 112| targetVisibleEnemies: true, | 113| |- targetAttackersAlways: false, | | 113|+ "targetAttackersAlways": false, | 114| 114| respondFlee: false, | 115| 115| respondChase: false, | 116| 116| respondChaseBeyondVision: false, | | [NORMAL] ESLintBear (quote-props): | | Unquoted property 'respondFlee' found. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | 111| 111| "standground": { | 112| 112| targetVisibleEnemies: true, | 113| 113| targetAttackersAlways: false, | 114| |- respondFlee: false, | | 114|+ "respondFlee": false, | 115| 115| respondChase: false, | 116| 116| respondChaseBeyondVision: false, | 117| 117| respondStandGround: true, | | [NORMAL] ESLintBear (quote-props): | | Unquoted property 'respondChase' found. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | 112| 112| targetVisibleEnemies: true, | 113| 113| targetAttackersAlways: false, | 114| 114| respondFlee: false, | 115| |- respondChase: false, | | 115|+ "respondChase": false, | 116| 116| respondChaseBeyondVision: false, | 117| 117| respondStandGround: true, | 118| 118| respondHoldGround: false, | | [NORMAL] ESLintBear (quote-props): | | Unquoted property 'respondChaseBeyondVision' found. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | 113| 113| targetAttackersAlways: false, | 114| 114| respondFlee: false, | 115| 115| respondChase: false, | 116| |- respondChaseBeyondVision: false, | | 116|+ "respondChaseBeyondVision": false, | 117| 117| respondStandGround: true, | 118| 118| respondHoldGround: false, | 119| 119| }, | | [NORMAL] ESLintBear (quote-props): | | Unquoted property 'respondStandGround' found. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | 114| 114| respondFlee: false, | 115| 115| respondChase: false, | 116| 116| respondChaseBeyondVision: false, | 117| |- respondStandGround: true, | | 117|+ "respondStandGround": true, | 118| 118| respondHoldGround: false, | 119| 119| }, | 120| 120| }; | | [NORMAL] ESLintBear (quote-props): | | Unquoted property 'respondHoldGround' found. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | 115| 115| respondChase: false, | 116| 116| respondChaseBeyondVision: false, | 117| 117| respondStandGround: true, | 118| |- respondHoldGround: false, | | 118|+ "respondHoldGround": false, | 119| 119| }, | 120| 120| }; | 121| 121| | | [NORMAL] ESLintBear (curly): | | Unnecessary { after 'if' condition. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | 216| 216| // Move a tile outside the building | 217| 217| let range = 4; | 218| 218| if (this.MoveToTargetRangeExplicit(msg.data.target, range, range)) | 219| |- { | | 219|+ | 220| 220| // We've started walking to the given point | 221| 221| this.SetNextState("INDIVIDUAL.WALKING"); | 222| |- } | | 222|+ | 223| 223| else | 224| 224| { | 225| 225| // We are already at the target, or can't move at all | | [NORMAL] ESLintBear (curly): | | Unnecessary { after 'else'. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | 221| 221| this.SetNextState("INDIVIDUAL.WALKING"); | 222| 222| } | 223| 223| else | 224| |- { | | 224|+ | 225| 225| // We are already at the target, or can't move at all | 226| 226| this.FinishOrder(); | 227| |- } | | 227|+ | 228| 228| }, | 229| 229| | 230| 230| // Individual orders: | | [NORMAL] ESLintBear (curly): | | Unnecessary { after 'if' condition. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | 326| 326| | 327| 327| var ok = this.MoveToTarget(this.order.data.target); | 328| 328| if (ok) | 329| |- { | | 329|+ | 330| 330| // We've started walking to the given point | 331| 331| if (this.IsAnimal()) | 332| 332| this.SetNextState("ANIMAL.WALKING"); | 333| 333| else | 334| 334| this.SetNextState("INDIVIDUAL.WALKING"); | 335| |- } | | 335|+ | 336| 336| else | 337| 337| { | 338| 338| // We are already at the target, or can't move at all | | [NORMAL] ESLintBear (curly): | | Unnecessary { after 'if' condition. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | 354| 354| var cmpPosition = Engine.QueryInterface(this.entity, IID_Position); | 355| 355| if (this.lastShorelinePosition && cmpPosition && (this.lastShorelinePosition.x == cmpPosition.GetPosition().x) | 356| 356| && (this.lastShorelinePosition.z == cmpPosition.GetPosition().z)) | 357| |- { | | 357|+ | 358| 358| // we were already on the shoreline, and have not moved since | 359| 359| if (DistanceBetweenEntities(this.entity, this.order.data.target) < 50) | 360| 360| needToMove = false; | 361| |- } | | 361|+ | 362| 362| | 363| 363| // TODO: what if the units are on a cliff ? the ship will go below the cliff | 364| 364| // and the units won't be able to garrison. Should go to the nearest (accessible) shore | | [NORMAL] ESLintBear (operator-linebreak): | | '&&' should be placed at the end of the line. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | 352| 352| // Check if we need to move TODO implement a better way to know if we are on the shoreline | 353| 353| var needToMove = true; | 354| 354| var cmpPosition = Engine.QueryInterface(this.entity, IID_Position); | 355| |- if (this.lastShorelinePosition && cmpPosition && (this.lastShorelinePosition.x == cmpPosition.GetPosition().x) | 356| |- && (this.lastShorelinePosition.z == cmpPosition.GetPosition().z)) | | 355|+ if (this.lastShorelinePosition && cmpPosition && (this.lastShorelinePosition.x == cmpPosition.GetPosition().x) && | | 356|+ (this.lastShorelinePosition.z == cmpPosition.GetPosition().z)) | 357| 357| { | 358| 358| // we were already on the shoreline, and have not moved since | 359| 359| if (DistanceBetweenEntities(this.entity, this.order.data.target) < 50) | | [NORMAL] ESLintBear (curly): | | Unnecessary { after 'if' condition. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | 363| 363| // TODO: what if the units are on a cliff ? the ship will go below the cliff | 364| 364| // and the units won't be able to garrison. Should go to the nearest (accessible) shore | 365| 365| if (needToMove && this.MoveToTarget(this.order.data.target)) | 366| |- { | | 366|+ | 367| 367| this.SetNextState("INDIVIDUAL.PICKUP.APPROACHING"); | 368| |- } | | 368|+ | 369| 369| else | 370| 370| { | 371| 371| // We are already at the target, or can't move at all | | [NORMAL] ESLintBear (curly): | | Unnecessary { after 'if' condition. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | 392| 392| var distance = DistanceBetweenEntities(this.entity, this.order.data.target) + (+this.template.FleeDistance); | 393| 393| var cmpUnitMotion = Engine.QueryInterface(this.entity, IID_UnitMotion); | 394| 394| if (cmpUnitMotion.MoveToTargetRange(this.order.data.target, distance, -1)) | 395| |- { | | 395|+ | 396| 396| // We've started fleeing from the given target | 397| 397| if (this.IsAnimal()) | 398| 398| this.SetNextState("ANIMAL.FLEEING"); | 399| 399| else | 400| 400| this.SetNextState("INDIVIDUAL.FLEEING"); | 401| |- } | | 401|+ | 402| 402| else | 403| 403| { | 404| 404| // We are already at the target, or can't move at all | | [NORMAL] ESLintBear (curly): | | Unnecessary { after 'if' condition. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | 448| 448| } | 449| 449| | 450| 450| if (this.order.data.attackType == this.oldAttackType) | 451| |- { | | 451|+ | 452| 452| if (this.IsAnimal()) | 453| 453| this.SetNextState("ANIMAL.COMBAT.ATTACKING"); | 454| 454| else | 455| 455| this.SetNextState("INDIVIDUAL.COMBAT.ATTACKING"); | 456| |- } | | 456|+ | 457| 457| else | 458| 458| { | 459| 459| if (this.IsAnimal()) | | [NORMAL] ESLintBear (curly): | | Unnecessary { after 'else'. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | 455| 455| this.SetNextState("INDIVIDUAL.COMBAT.ATTACKING"); | 456| 456| } | 457| 457| else | 458| |- { | | 458|+ | 459| 459| if (this.IsAnimal()) | 460| 460| this.SetNextStateAlwaysEntering("ANIMAL.COMBAT.ATTACKING"); | 461| 461| else | 462| 462| this.SetNextStateAlwaysEntering("INDIVIDUAL.COMBAT.ATTACKING"); | 463| |- } | | 463|+ | 464| 464| return; | 465| 465| } | 466| 466| | | [NORMAL] ESLintBear (curly): | | Unnecessary { after 'else'. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | 593| 593| this.PushOrderFront("Walk", this.order.data.lastPos); | 594| 594| } | 595| 595| else | 596| |- { | | 596|+ | 597| 597| // We couldn't move there, or the target moved away | 598| 598| this.FinishOrder(); | 599| |- } | | 599|+ | 600| 600| return; | 601| 601| } | 602| 602| | | [NORMAL] ESLintBear (curly): | | Unnecessary { after 'if' condition. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | 606| 606| | 607| 607| // Try to move within range | 608| 608| if (this.MoveToTargetRange(this.order.data.target, IID_ResourceGatherer)) | 609| |- { | | 609|+ | 610| 610| // We've started walking to the given point | 611| 611| this.SetNextState("INDIVIDUAL.GATHER.APPROACHING"); | 612| |- } | | 612|+ | 613| 613| else | 614| 614| { | 615| 615| // We are already at the target, or can't move at all, | | [NORMAL] ESLintBear (curly): | | Unnecessary { after 'if' condition. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | 683| 683| "Order.Repair": function(msg) { | 684| 684| // Try to move within range | 685| 685| if (this.MoveToTargetRange(this.order.data.target, IID_Builder)) | 686| |- { | | 686|+ | 687| 687| // We've started walking to the given point | 688| 688| this.SetNextState("INDIVIDUAL.REPAIR.APPROACHING"); | 689| |- } | | 689|+ | 690| 690| else | 691| 691| { | 692| 692| // We are already at the target, or can't move at all, | | [NORMAL] ESLintBear (curly): | | Unnecessary { after 'if' condition. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | 720| 720| } | 721| 721| | 722| 722| if (this.MoveToGarrisonRange(this.order.data.target)) | 723| |- { | | 723|+ | 724| 724| this.SetNextState("INDIVIDUAL.GARRISON.APPROACHING"); | 725| |- } | | 725|+ | 726| 726| else | 727| 727| { | 728| 728| // We do a range check before actually garrisoning | | [NORMAL] ESLintBear (curly): | | Unnecessary { after 'if' condition. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | 858| 858| if (!this.CheckTargetAttackRange(target, target)) | 859| 859| { | 860| 860| if (this.TargetIsAlive(target) && this.CheckTargetVisible(target)) | 861| |- { | | 861|+ | 862| 862| if (this.MoveToTargetAttackRange(target, target)) | 863| 863| { | 864| 864| this.SetNextState("COMBAT.APPROACHING"); | 865| 865| return; | 866| 866| } | 867| |- } | | 867|+ | 868| 868| this.FinishOrder(); | 869| 869| return; | 870| 870| } | | [NORMAL] ESLintBear (curly): | | Unnecessary { after 'if' condition. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | 883| 883| } | 884| 884| // Check if we are already in range, otherwise walk there | 885| 885| if (!this.CheckGarrisonRange(msg.data.target)) | 886| |- { | | 886|+ | 887| 887| if (!this.CheckTargetVisible(msg.data.target)) | 888| 888| { | 889| 889| this.FinishOrder(); | 898| 898| return; | 899| 899| } | 900| 900| } | 901| |- } | | 901|+ | 902| 902| | 903| 903| this.SetNextState("GARRISON.GARRISONING"); | 904| 904| }, | | [NORMAL] ESLintBear (curly): | | Unnecessary { after 'else'. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | 890| 890| return; | 891| 891| } | 892| 892| else | 893| |- { | | 893|+ | 894| 894| // Out of range; move there in formation | 895| 895| if (this.MoveToGarrisonRange(msg.data.target)) | 896| 896| { | 897| 897| this.SetNextState("GARRISON.APPROACHING"); | 898| 898| return; | 899| 899| } | 900| |- } | | 900|+ | 901| 901| } | 902| 902| | 903| 903| this.SetNextState("GARRISON.GARRISONING"); | | [NORMAL] ESLintBear (no-else-return): | | Unnecessary 'else' after 'return'. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | 889| 889| this.FinishOrder(); | 890| 890| return; | 891| 891| } | 892| |- else | 893| |- { | | 892|+ | 894| 893| // Out of range; move there in formation | 895| 894| if (this.MoveToGarrisonRange(msg.data.target)) | 896| 895| { | 897| 896| this.SetNextState("GARRISON.APPROACHING"); | 898| 897| return; | 899| 898| } | 900| |- } | | 899|+ | 901| 900| } | 902| 901| | 903| 902| this.SetNextState("GARRISON.GARRISONING"); | | [NORMAL] ESLintBear (curly): | | Unnecessary { after 'else'. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | 916| 916| this.PushOrderFront("Walk", msg.data.lastPos); | 917| 917| } | 918| 918| else | 919| |- { | | 919|+ | 920| 920| // We couldn't move there, or the target moved away | 921| 921| this.FinishOrder(); | 922| |- } | | 922|+ | 923| 923| return; | 924| 924| } | 925| 925| | | [NORMAL] ESLintBear (key-spacing): | | Missing space before value for key 'GARRISON'. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js |1137|1137| }, |1138|1138| }, |1139|1139| |1140| |- "GARRISON":{ | |1140|+ "GARRISON": { |1141|1141| "enter": function() { |1142|1142| // If the garrisonholder should pickup, warn it so it can take needed action |1143|1143| var cmpGarrisonHolder = Engine.QueryInterface(this.order.data.target, IID_GarrisonHolder); | | [NORMAL] ESLintBear (curly): | | Unnecessary { after 'if' condition. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js |1318|1318| // If the controller handled an order but some members rejected it, |1319|1319| // they will have no orders and be in the FORMATIONMEMBER.IDLE state. |1320|1320| if (this.orderQueue.length) |1321| |- { | |1321|+ |1322|1322| // We're leaving the formation, so stop our FormationWalk order |1323|1323| if (this.FinishOrder()) |1324|1324| return; |1325| |- } | |1325|+ |1326|1326| |1327|1327| // No orders left, we're an individual now |1328|1328| if (this.IsAnimal()) | | [NORMAL] ESLintBear (curly): | | Unnecessary { after 'if' condition. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js |1346|1346| // Move a tile outside the building |1347|1347| let range = 4; |1348|1348| if (this.MoveToTargetRangeExplicit(msg.data.target, range, range)) |1349| |- { | |1349|+ |1350|1350| // We've started walking to the given point |1351|1351| this.SetNextState("WALKINGTOPOINT"); |1352| |- } | |1352|+ |1353|1353| else |1354|1354| { |1355|1355| // We are already at the target, or can't move at all | | [NORMAL] ESLintBear (curly): | | Unnecessary { after 'else'. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js |1351|1351| this.SetNextState("WALKINGTOPOINT"); |1352|1352| } |1353|1353| else |1354| |- { | |1354|+ |1355|1355| // We are already at the target, or can't move at all |1356|1356| this.FinishOrder(); |1357| |- } | |1357|+ |1358|1358| }, |1359|1359| |1360|1360| | | [NORMAL] ESLintBear (space-before-function-paren): | | Unexpected space before function parentheses. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js |1369|1369| }, |1370|1370| |1371|1371| "WALKING": { |1372| |- "enter": function () { | |1372|+ "enter": function() { |1373|1373| var cmpFormation = Engine.QueryInterface(this.formationController, IID_Formation); |1374|1374| var cmpVisual = Engine.QueryInterface(this.entity, IID_Visual); |1375|1375| if (cmpFormation && cmpVisual) | | [NORMAL] ESLintBear (curly): | | Unnecessary { after 'if' condition. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js |1559|1559| |1560|1560| "LosRangeUpdate": function(msg) { |1561|1561| if (this.GetStance().targetVisibleEnemies) |1562| |- { | |1562|+ |1563|1563| // Start attacking one of the newly-seen enemy (if any) |1564|1564| this.AttackEntitiesByPreference(msg.data.added); |1565| |- } | |1565|+ |1566|1566| }, |1567|1567| |1568|1568| "LosHealRangeUpdate": function(msg) { | | [NORMAL] ESLintBear (space-before-function-paren): | | Unexpected space before function parentheses. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js |1579|1579| }, |1580|1580| |1581|1581| "WALKING": { |1582| |- "enter": function () { | |1582|+ "enter": function() { |1583|1583| this.SelectAnimation("move"); |1584|1584| }, |1585|1585| | | [NORMAL] ESLintBear (space-before-function-paren): | | Unexpected space before function parentheses. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js |1589|1589| }, |1590|1590| |1591|1591| "WALKINGANDFIGHTING": { |1592| |- "enter": function () { | |1592|+ "enter": function() { |1593|1593| // Show weapons rather than carried resources. |1594|1594| this.SetAnimationVariant("combat"); |1595|1595| | | [NORMAL] ESLintBear (space-before-function-paren): | | Unexpected space before function parentheses. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js |1612|1612| }, |1613|1613| |1614|1614| "PATROL": { |1615| |- "enter": function () { | |1615|+ "enter": function() { |1616|1616| // Memorize the origin position in case that we want to go back |1617|1617| let cmpPosition = Engine.QueryInterface(this.entity, IID_Position); |1618|1618| if (!cmpPosition || !cmpPosition.IsInWorld()) | | [NORMAL] ESLintBear (space-before-function-paren): | | Unexpected space before function parentheses. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js |1658|1658| }, |1659|1659| |1660|1660| "ESCORTING": { |1661| |- "enter": function () { | |1661|+ "enter": function() { |1662|1662| // Show weapons rather than carried resources. |1663|1663| this.SetAnimationVariant("combat"); |1664|1664| | | [NORMAL] ESLintBear (space-before-function-paren): | | Unexpected space before function parentheses. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js |1708|1708| }, |1709|1709| |1710|1710| "GUARDING": { |1711| |- "enter": function () { | |1711|+ "enter": function() { |1712|1712| this.StartTimer(1000, 1000); |1713|1713| this.SetHeldPositionOnEntity(this.entity); |1714|1714| this.SetAnimationVariant("combat"); | | [NORMAL] ESLintBear (curly): | | Unnecessary { after 'if' condition. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js |1737|1737| // if nothing better to do, check if the guarded needs to be healed or repaired |1738|1738| var cmpHealth = Engine.QueryInterface(this.isGuardOf, IID_Health); |1739|1739| if (cmpHealth && (cmpHealth.GetHitpoints() < cmpHealth.GetMaxHitpoints())) |1740| |- { | |1740|+ |1741|1741| if (this.CanHeal(this.isGuardOf)) |1742|1742| this.PushOrderFront("Heal", { "target": this.isGuardOf, "force": false }); |1743|1743| else if (this.CanRepair(this.isGuardOf)) |1744|1744| this.PushOrderFront("Repair", { "target": this.isGuardOf, "autocontinue": false, "force": false }); |1745| |- } | |1745|+ |1746|1746| } |1747|1747| }, |1748|1748| | | [NORMAL] ESLintBear (space-before-function-paren): | | Unexpected space before function parentheses. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js |1795|1795| }, |1796|1796| |1797|1797| "APPROACHING": { |1798| |- "enter": function () { | |1798|+ "enter": function() { |1799|1799| // Show weapons rather than carried resources. |1800|1800| this.SetAnimationVariant("combat"); |1801|1801| | | [NORMAL] ESLintBear (curly): | | Unnecessary { after 'if' condition. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js |1825|1825| "MoveCompleted": function() { |1826|1826| |1827|1827| if (this.CheckTargetAttackRange(this.order.data.target, this.order.data.attackType)) |1828| |- { | |1828|+ |1829|1829| // If the unit needs to unpack, do so |1830|1830| if (this.CanUnpack()) |1831|1831| { |1834|1834| } |1835|1835| else |1836|1836| this.SetNextState("ATTACKING"); |1837| |- } | |1837|+ |1838|1838| else |1839|1839| { |1840|1840| if (this.MoveToTargetAttackRange(this.order.data.target, this.order.data.attackType)) | | [NORMAL] ESLintBear (no-else-return): | | Unnecessary 'else' after 'return'. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js |1832|1832| this.PushOrderFront("Unpack", { "force": true }); |1833|1833| return; |1834|1834| } |1835| |- else |1836| |- this.SetNextState("ATTACKING"); | |1835|+ this.SetNextState("ATTACKING"); |1837|1836| } |1838|1837| else |1839|1838| { | | [NORMAL] ESLintBear (curly): | | Unnecessary { after 'else'. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js |1836|1836| this.SetNextState("ATTACKING"); |1837|1837| } |1838|1838| else |1839| |- { | |1839|+ |1840|1840| if (this.MoveToTargetAttackRange(this.order.data.target, this.order.data.attackType)) |1841|1841| { |1842|1842| this.SetNextState("APPROACHING"); |1846|1846| // Give up |1847|1847| this.FinishOrder(); |1848|1848| } |1849| |- } | |1849|+ |1850|1850| }, |1851|1851| }, |1852|1852| | | [NORMAL] ESLintBear (curly): | | Unnecessary { after 'if' condition. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js |1838|1838| else |1839|1839| { |1840|1840| if (this.MoveToTargetAttackRange(this.order.data.target, this.order.data.attackType)) |1841| |- { | |1841|+ |1842|1842| this.SetNextState("APPROACHING"); |1843| |- } | |1843|+ |1844|1844| else |1845|1845| { |1846|1846| // Give up | | [NORMAL] ESLintBear (curly): | | Unnecessary { after 'else'. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js |1842|1842| this.SetNextState("APPROACHING"); |1843|1843| } |1844|1844| else |1845| |- { | |1845|+ |1846|1846| // Give up |1847|1847| this.FinishOrder(); |1848| |- } | |1848|+ |1849|1849| } |1850|1850| }, |1851|1851| }, | | [NORMAL] ESLintBear (curly): | | Unnecessary { after 'if' condition. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js |1863|1863| } |1864|1864| // Check the target is still alive and attackable |1865|1865| if (this.CanAttack(target) && !this.CheckTargetAttackRange(target, this.order.data.attackType)) |1866| |- { | |1866|+ |1867|1867| // Can't reach it - try to chase after it |1868|1868| if (this.ShouldChaseTargetedEntity(target, this.order.data.force)) |1869|1869| { |1873|1873| return; |1874|1874| } |1875|1875| } |1876| |- } | |1876|+ |1877|1877| |1878|1878| var cmpAttack = Engine.QueryInterface(this.entity, IID_Attack); |1879|1879| this.attackTimers = cmpAttack.GetTimers(this.order.data.attackType); | | [NORMAL] ESLintBear (curly): | | Unnecessary { after 'if' condition. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js |1866|1866| { |1867|1867| // Can't reach it - try to chase after it |1868|1868| if (this.ShouldChaseTargetedEntity(target, this.order.data.force)) |1869| |- { | |1869|+ |1870|1870| if (this.MoveToTargetAttackRange(target, this.order.data.attackType)) |1871|1871| { |1872|1872| this.SetNextState("COMBAT.CHASING"); |1873|1873| return; |1874|1874| } |1875| |- } | |1875|+ |1876|1876| } |1877|1877| |1878|1878| var cmpAttack = Engine.QueryInterface(this.entity, IID_Attack); | | [NORMAL] ESLintBear (no-unneeded-ternary): | | Unnecessary use of boolean literals in conditional expression. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js |1904|1904| // TODO: we should probably only bother syncing projectile attacks, not melee |1905|1905| |1906|1906| // If using a non-default prepare time, re-sync the animation when the timer runs. |1907| |- this.resyncAnimation = (prepare != this.attackTimers.prepare) ? true : false; | |1907|+ this.resyncAnimation = (prepare != this.attackTimers.prepare); |1908|1908| |1909|1909| this.FaceTowardsTarget(this.order.data.target); |1910|1910| | | [NORMAL] ESLintBear (curly): | | Unnecessary { after 'if' condition. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js |1979|1979| |1980|1980| // Can't reach it - try to chase after it |1981|1981| if (this.ShouldChaseTargetedEntity(target, this.order.data.force)) |1982| |- { | |1982|+ |1983|1983| if (this.MoveToTargetRange(target, IID_Attack, this.order.data.attackType)) |1984|1984| { |1985|1985| this.SetNextState("COMBAT.CHASING"); |1986|1986| return; |1987|1987| } |1988| |- } | |1988|+ |1989|1989| } |1990|1990| |1991|1991| // if we're targetting a formation, find a new member of that formation | | [NORMAL] ESLintBear (operator-linebreak): | | '&&' should be placed at the end of the line. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js |2026|2026| |2027|2027| "Attacked": function(msg) { |2028|2028| // If we are capturing and are attacked by something that we would not capture, attack that entity instead |2029| |- if (this.order.data.attackType == "Capture" && (this.GetStance().targetAttackersAlways || !this.order.data.force) |2030| |- && this.order.data.target != msg.data.attacker && this.GetBestAttackAgainst(msg.data.attacker, true) != "Capture") | |2029|+ if (this.order.data.attackType == "Capture" && (this.GetStance().targetAttackersAlways || !this.order.data.force) && | |2030|+ this.order.data.target != msg.data.attacker && this.GetBestAttackAgainst(msg.data.attacker, true) != "Capture") |2031|2031| this.RespondToTargetedEntities([msg.data.attacker]); |2032|2032| }, |2033|2033| }, | | [NORMAL] ESLintBear (space-before-function-paren): | | Unexpected space before function parentheses. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js |2033|2033| }, |2034|2034| |2035|2035| "CHASING": { |2036| |- "enter": function () { | |2036|+ "enter": function() { |2037|2037| // Show weapons rather than carried resources. |2038|2038| this.SetAnimationVariant("combat"); |2039|2039| | | [NORMAL] ESLintBear (space-before-function-paren): | | Unexpected space before function parentheses. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js |2108|2108| |2109|2109| // Try to find another nearby target of the same specific type |2110|2110| // Also don't switch to a different type of huntable animal |2111| |- var nearby = this.FindNearbyResource(function (ent, type, template) { | |2111|+ var nearby = this.FindNearbyResource(function(ent, type, template) { |2112|2112| return ( |2113|2113| ent != oldTarget |2114|2114| && ((type.generic == "treasure" && oldType.generic == "treasure") | | [NORMAL] ESLintBear (operator-linebreak): | | '&&' should be placed at the end of the line. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js |2110|2110| // Also don't switch to a different type of huntable animal |2111|2111| var nearby = this.FindNearbyResource(function (ent, type, template) { |2112|2112| return ( |2113| |- ent != oldTarget |2114| |- && ((type.generic == "treasure" && oldType.generic == "treasure") | |2113|+ ent != oldTarget && | |2114|+ ((type.generic == "treasure" && oldType.generic == "treasure") |2115|2115| || (type.specific == oldType.specific |2116|2116| && (type.specific != "meat" || oldTemplate == template))) |2117|2117| ); | | [NORMAL] ESLintBear (operator-linebreak): | | '||' should be placed at the end of the line. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js |2111|2111| var nearby = this.FindNearbyResource(function (ent, type, template) { |2112|2112| return ( |2113|2113| ent != oldTarget |2114| |- && ((type.generic == "treasure" && oldType.generic == "treasure") |2115| |- || (type.specific == oldType.specific | |2114|+ && ((type.generic == "treasure" && oldType.generic == "treasure") || | |2115|+ (type.specific == oldType.specific |2116|2116| && (type.specific != "meat" || oldTemplate == template))) |2117|2117| ); |2118|2118| }, oldTarget); | | [NORMAL] ESLintBear (operator-linebreak): | | '&&' should be placed at the end of the line. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js |2112|2112| return ( |2113|2113| ent != oldTarget |2114|2114| && ((type.generic == "treasure" && oldType.generic == "treasure") |2115| |- || (type.specific == oldType.specific |2116| |- && (type.specific != "meat" || oldTemplate == template))) | |2115|+ || (type.specific == oldType.specific && | |2116|+ (type.specific != "meat" || oldTemplate == template))) |2117|2117| ); |2118|2118| }, oldTarget); |2119|2119| if (nearby) | | [NORMAL] ESLintBear (no-else-return): | | Unnecessary 'else' after 'return'. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js |2121|2121| this.PerformGather(nearby, false, false); |2122|2122| return true; |2123|2123| } |2124| |- else |2125| |- { | |2124|+ |2126|2125| // It's probably better in this case, to avoid units getting stuck around a dropsite |2127|2126| // in a "Target is far away, full, nearby are no good resources, return to dropsite" loop |2128|2127| // to order it to GatherNear the resource position. |2143|2142| return true; |2144|2143| } |2145|2144| } |2146| |- } | |2145|+ |2147|2146| return true; |2148|2147| } |2149|2148| return false; | | [NORMAL] ESLintBear (no-else-return): | | Unnecessary 'else' after 'return'. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js |2133|2133| this.GatherNearPosition(pos.x, pos.z, oldType, oldTemplate); |2134|2134| return true; |2135|2135| } |2136| |- else |2137| |- { | |2136|+ |2138|2137| // we're kind of stuck here. Return resource. |2139|2138| var nearby = this.FindNearestDropsite(oldType.generic); |2140|2139| if (nearby) |2142|2141| this.PushOrderFront("ReturnResource", { "target": nearby, "force": false }); |2143|2142| return true; |2144|2143| } |2145| |- } | |2144|+ |2146|2145| } |2147|2146| return true; |2148|2147| } | | [NORMAL] ESLintBear (space-before-function-paren): | | Unexpected space before function parentheses. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js |2173|2173| |2174|2174| // Try to find another nearby target of the same specific type |2175|2175| // Also don't switch to a different type of huntable animal |2176| |- var nearby = this.FindNearbyResource(function (ent, type, template) { | |2176|+ var nearby = this.FindNearbyResource(function(ent, type, template) { |2177|2177| return ( |2178|2178| ent != oldTarget |2179|2179| && ((type.generic == "treasure" && oldType.generic == "treasure") | | [NORMAL] ESLintBear (operator-linebreak): | | '&&' should be placed at the end of the line. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js |2175|2175| // Also don't switch to a different type of huntable animal |2176|2176| var nearby = this.FindNearbyResource(function (ent, type, template) { |2177|2177| return ( |2178| |- ent != oldTarget |2179| |- && ((type.generic == "treasure" && oldType.generic == "treasure") | |2178|+ ent != oldTarget && | |2179|+ ((type.generic == "treasure" && oldType.generic == "treasure") |2180|2180| || (type.specific == oldType.specific |2181|2181| && (type.specific != "meat" || oldTemplate == template))) |2182|2182| ); | | [NORMAL] ESLintBear (operator-linebreak): | | '||' should be placed at the end of the line. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js |2176|2176| var nearby = this.FindNearbyResource(function (ent, type, template) { |2177|2177| return ( |2178|2178| ent != oldTarget |2179| |- && ((type.generic == "treasure" && oldType.generic == "treasure") |2180| |- || (type.specific == oldType.specific | |2179|+ && ((type.generic == "treasure" && oldType.generic == "treasure") || | |2180|+ (type.specific == oldType.specific |2181|2181| && (type.specific != "meat" || oldTemplate == template))) |2182|2182| ); |2183|2183| }); | | [NORMAL] ESLintBear (operator-linebreak): | | '&&' should be placed at the end of the line. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js |2177|2177| return ( |2178|2178| ent != oldTarget |2179|2179| && ((type.generic == "treasure" && oldType.generic == "treasure") |2180| |- || (type.specific == oldType.specific |2181| |- && (type.specific != "meat" || oldTemplate == template))) | |2180|+ || (type.specific == oldType.specific && | |2181|+ (type.specific != "meat" || oldTemplate == template))) |2182|2182| ); |2183|2183| }); |2184|2184| if (nearby) | | [NORMAL] ESLintBear (space-before-function-paren): | | Unexpected space before function parentheses. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js |2220|2220| |2221|2221| // Try to find another nearby target of the same specific type |2222|2222| // Also don't switch to a different type of huntable animal |2223| |- var nearby = this.FindNearbyResource(function (ent, type, template) { | |2223|+ var nearby = this.FindNearbyResource(function(ent, type, template) { |2224|2224| return ( |2225|2225| (type.generic == "treasure" && resourceType.generic == "treasure") |2226|2226| || (type.specific == resourceType.specific | | [NORMAL] ESLintBear (operator-linebreak): | | '||' should be placed at the end of the line. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js |2222|2222| // Also don't switch to a different type of huntable animal |2223|2223| var nearby = this.FindNearbyResource(function (ent, type, template) { |2224|2224| return ( |2225| |- (type.generic == "treasure" && resourceType.generic == "treasure") |2226| |- || (type.specific == resourceType.specific | |2225|+ (type.generic == "treasure" && resourceType.generic == "treasure") || | |2226|+ (type.specific == resourceType.specific |2227|2227| && (type.specific != "meat" || resourceTemplate == template)) |2228|2228| ); |2229|2229| }); | | [NORMAL] ESLintBear (operator-linebreak): | | '&&' should be placed at the end of the line. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js |2223|2223| var nearby = this.FindNearbyResource(function (ent, type, template) { |2224|2224| return ( |2225|2225| (type.generic == "treasure" && resourceType.generic == "treasure") |2226| |- || (type.specific == resourceType.specific |2227| |- && (type.specific != "meat" || resourceTemplate == template)) | |2226|+ || (type.specific == resourceType.specific && | |2227|+ (type.specific != "meat" || resourceTemplate == template)) |2228|2228| ); |2229|2229| }); |2230|2230| | | [NORMAL] ESLintBear (curly): | | Unnecessary { after 'if' condition. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js |2339|2339| |2340|2340| var cmpSupply = Engine.QueryInterface(this.gatheringTarget, IID_ResourceSupply); |2341|2341| if (cmpSupply && cmpSupply.IsAvailable(cmpOwnership.GetOwner(), this.entity)) |2342| |- { | |2342|+ |2343|2343| // Check we can still reach and gather from the target |2344|2344| if (this.CheckTargetRange(this.gatheringTarget, IID_ResourceGatherer) && this.CanGather(this.gatheringTarget)) |2345|2345| { |2405|2405| return; |2406|2406| } |2407|2407| } |2408| |- } | |2408|+ |2409|2409| |2410|2410| // We're already in range, can't get anywhere near it or the target is exhausted. |2411|2411| | | [NORMAL] ESLintBear (space-before-function-paren): | | Unexpected space before function parentheses. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js |2429|2429| |2430|2430| // Try to find a new resource of the same specific type near our current position: |2431|2431| // Also don't switch to a different type of huntable animal |2432| |- var nearby = this.FindNearbyResource(function (ent, type, template) { | |2432|+ var nearby = this.FindNearbyResource(function(ent, type, template) { |2433|2433| return ( |2434|2434| (type.generic == "treasure" && resourceType.generic == "treasure") |2435|2435| || (type.specific == resourceType.specific | | [NORMAL] ESLintBear (operator-linebreak): | | '||' should be placed at the end of the line. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js |2431|2431| // Also don't switch to a different type of huntable animal |2432|2432| var nearby = this.FindNearbyResource(function (ent, type, template) { |2433|2433| return ( |2434| |- (type.generic == "treasure" && resourceType.generic == "treasure") |2435| |- || (type.specific == resourceType.specific | |2434|+ (type.generic == "treasure" && resourceType.generic == "treasure") || | |2435|+ (type.specific == resourceType.specific |2436|2436| && (type.specific != "meat" || resourceTemplate == template)) |2437|2437| ); |2438|2438| }); | | [NORMAL] ESLintBear (operator-linebreak): | | '&&' should be placed at the end of the line. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js |2432|2432| var nearby = this.FindNearbyResource(function (ent, type, template) { |2433|2433| return ( |2434|2434| (type.generic == "treasure" && resourceType.generic == "treasure") |2435| |- || (type.specific == resourceType.specific |2436| |- && (type.specific != "meat" || resourceTemplate == template)) | |2435|+ || (type.specific == resourceType.specific && | |2436|+ (type.specific != "meat" || resourceTemplate == template)) |2437|2437| ); |2438|2438| }); |2439|2439| if (nearby) | | [NORMAL] ESLintBear (space-before-function-paren): | | Unexpected space before function parentheses. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js |2473|2473| }, |2474|2474| |2475|2475| "APPROACHING": { |2476| |- "enter": function () { | |2476|+ "enter": function() { |2477|2477| this.SelectAnimation("move"); |2478|2478| this.StartTimer(1000, 1000); |2479|2479| }, | | [NORMAL] ESLintBear (no-unneeded-ternary): | | Unnecessary use of boolean literals in conditional expression. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js |2519|2519| this.StartTimer(prepare, this.healTimers.repeat); |2520|2520| |2521|2521| // If using a non-default prepare time, re-sync the animation when the timer runs. |2522| |- this.resyncAnimation = (prepare != this.healTimers.prepare) ? true : false; | |2522|+ this.resyncAnimation = (prepare != this.healTimers.prepare); |2523|2523| |2524|2524| this.FaceTowardsTarget(this.order.data.target); |2525|2525| }, | | [NORMAL] ESLintBear (curly): | | Unnecessary { after 'if' condition. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js |2552|2552| } |2553|2553| // Can't reach it - try to chase after it |2554|2554| if (this.ShouldChaseTargetedEntity(target, this.order.data.force)) |2555| |- { | |2555|+ |2556|2556| if (this.MoveToTargetRange(target, IID_Heal)) |2557|2557| { |2558|2558| this.SetNextState("HEAL.CHASING"); |2559|2559| return; |2560|2560| } |2561| |- } | |2561|+ |2562|2562| } |2563|2563| // Can't reach it, healed to max hp or doesn't exist any more - give up |2564|2564| if (this.FinishOrder()) | | [NORMAL] ESLintBear (space-before-function-paren): | | Unexpected space before function parentheses. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js |2574|2574| }, |2575|2575| }, |2576|2576| "CHASING": { |2577| |- "enter": function () { | |2577|+ "enter": function() { |2578|2578| this.SelectAnimation("move"); |2579|2579| this.StartTimer(1000, 1000); |2580|2580| }, | | [NORMAL] ESLintBear (space-before-function-paren): | | Unexpected space before function parentheses. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js |2579|2579| this.StartTimer(1000, 1000); |2580|2580| }, |2581|2581| |2582| |- "leave": function () { | |2582|+ "leave": function() { |2583|2583| this.StopTimer(); |2584|2584| }, |2585|2585| "Timer": function(msg) { | | [NORMAL] ESLintBear (space-before-function-paren): | | Unexpected space before function parentheses. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js |2593|2593| this.WalkToHeldPosition(); |2594|2594| } |2595|2595| }, |2596| |- "MoveCompleted": function () { | |2596|+ "MoveCompleted": function() { |2597|2597| this.SetNextState("HEALING"); |2598|2598| }, |2599|2599| }, | | [NORMAL] ESLintBear (space-before-function-paren): | | Unexpected space before function parentheses. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js |2602|2602| // Returning to dropsite |2603|2603| "RETURNRESOURCE": { |2604|2604| "APPROACHING": { |2605| |- "enter": function () { | |2605|+ "enter": function() { |2606|2606| this.SelectAnimation("move"); |2607|2607| }, |2608|2608| | | [NORMAL] ESLintBear (space-before-function-paren): | | Unexpected space before function parentheses. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js |2656|2656| }, |2657|2657| |2658|2658| "APPROACHINGMARKET": { |2659| |- "enter": function () { | |2659|+ "enter": function() { |2660|2660| this.SelectAnimation("move"); |2661|2661| }, |2662|2662| | | [NORMAL] ESLintBear (space-before-function-paren): | | Unexpected space before function parentheses. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js |2684|2684| |2685|2685| "REPAIR": { |2686|2686| "APPROACHING": { |2687| |- "enter": function () { | |2687|+ "enter": function() { |2688|2688| this.SelectAnimation("move"); |2689|2689| }, |2690|2690| | | [NORMAL] ESLintBear (object-curly-spacing): | | A space is required after '{'. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js |2725|2725| { |2726|2726| // The building was already finished/fully repaired before we arrived; |2727|2727| // let the ConstructionFinished handler handle this. |2728| |- this.OnGlobalConstructionFinished({"entity": this.repairTarget, "newentity": this.repairTarget}); | |2728|+ this.OnGlobalConstructionFinished({ "entity": this.repairTarget, "newentity": this.repairTarget}); |2729|2729| return true; |2730|2730| } |2731|2731| | | [NORMAL] ESLintBear (object-curly-spacing): | | A space is required before '}'. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js |2725|2725| { |2726|2726| // The building was already finished/fully repaired before we arrived; |2727|2727| // let the ConstructionFinished handler handle this. |2728| |- this.OnGlobalConstructionFinished({"entity": this.repairTarget, "newentity": this.repairTarget}); | |2728|+ this.OnGlobalConstructionFinished({"entity": this.repairTarget, "newentity": this.repairTarget }); |2729|2729| return true; |2730|2730| } |2731|2731| | | [NORMAL] ESLintBear (spaced-comment): | | Expected space or tab after '//' in comment. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js |2765|2765| if (this.MoveToTargetRange(this.repairTarget, IID_Builder)) |2766|2766| this.SetNextState("APPROACHING"); |2767|2767| else if (!this.CheckTargetRange(this.repairTarget, IID_Builder)) |2768| |- this.FinishOrder(); //can't approach and isn't in reach | |2768|+ this.FinishOrder(); // can't approach and isn't in reach |2769|2769| }, |2770|2770| }, |2771|2771| | | [NORMAL] ESLintBear (space-before-function-paren): | | Unexpected space before function parentheses. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js |2832|2832| var types = cmpResourceDropsite.GetTypes(); |2833|2833| // TODO: Slightly undefined behavior here, we don't know what type of resource will be collected, |2834|2834| // may cause problems for AIs (especially hunting fast animals), but avoid ugly hacks to fix that! |2835| |- var nearby = this.FindNearbyResource(function (ent, type, template) { | |2835|+ var nearby = this.FindNearbyResource(function(ent, type, template) { |2836|2836| return (types.indexOf(type.generic) != -1); |2837|2837| }, msg.data.newentity); |2838|2838| if (nearby) | | [NORMAL] ESLintBear (curly): | | Unnecessary { after 'if' condition. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js |2852|2852| |2853|2853| // Unit was approaching and there's nothing to do now, so switch to walking |2854|2854| if (oldState === "INDIVIDUAL.REPAIR.APPROACHING") |2855| |- { | |2855|+ |2856|2856| // We're already walking to the given point, so add this as a order. |2857|2857| this.WalkToTarget(msg.data.newentity, true); |2858| |- } | |2858|+ |2859|2859| }, |2860|2860| }, |2861|2861| | | [NORMAL] ESLintBear (curly): | | Unnecessary { after 'if' condition. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js |2902|2902| |2903|2903| // Check that we can garrison here |2904|2904| if (this.CanGarrison(target)) |2905| |- { | |2905|+ |2906|2906| // Check that we're in range of the garrison target |2907|2907| if (this.CheckGarrisonRange(target)) |2908|2908| { |2978|2978| return false; |2979|2979| } |2980|2980| } |2981| |- } | |2981|+ |2982|2982| // Garrisoning failed for some reason, so finish the order |2983|2983| this.FinishOrder(); |2984|2984| return true; | | [NORMAL] ESLintBear (curly): | | Unnecessary { after 'if' condition. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js |3095|3095| "Attacked": function(msg) { |3096|3096| if (this.template.NaturalBehaviour == "skittish" || |3097|3097| this.template.NaturalBehaviour == "passive") |3098| |- { | |3098|+ |3099|3099| this.Flee(msg.data.attacker, false); |3100| |- } | |3100|+ |3101|3101| else if (this.IsDangerousAnimal() || this.template.NaturalBehaviour == "defensive") |3102|3102| { |3103|3103| if (this.CanAttack(msg.data.attacker)) | | [NORMAL] ESLintBear (curly): | | Unnecessary { after 'if' condition. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js |3104|3104| this.Attack(msg.data.attacker, false); |3105|3105| } |3106|3106| else if (this.template.NaturalBehaviour == "domestic") |3107| |- { | |3107|+ |3108|3108| // Never flee, stop what we were doing |3109|3109| this.SetNextState("IDLE"); |3110| |- } | |3110|+ |3111|3111| }, |3112|3112| |3113|3113| "Order.LeaveFoundation": function(msg) { | | [NORMAL] ESLintBear (curly): | | Unnecessary { after 'if' condition. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js |3114|3114| // Move a tile outside the building |3115|3115| var range = 4; |3116|3116| if (this.MoveToTargetRangeExplicit(msg.data.target, range, range)) |3117| |- { | |3117|+ |3118|3118| // We've started walking to the given point |3119|3119| this.SetNextState("WALKING"); |3120| |- } | |3120|+ |3121|3121| else |3122|3122| { |3123|3123| // We are already at the target, or can't move at all | | [NORMAL] ESLintBear (curly): | | Unnecessary { after 'else'. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js |3119|3119| this.SetNextState("WALKING"); |3120|3120| } |3121|3121| else |3122| |- { | |3122|+ |3123|3123| // We are already at the target, or can't move at all |3124|3124| this.FinishOrder(); |3125| |- } | |3125|+ |3126|3126| }, |3127|3127| |3128|3128| "IDLE": { | | [NORMAL] ESLintBear (curly): | | Unnecessary { after 'if' condition. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js |3161|3161| } |3162|3162| // Start attacking one of the newly-seen enemy (if any) |3163|3163| else if (this.IsDangerousAnimal()) |3164| |- { | |3164|+ |3165|3165| this.AttackVisibleEntity(msg.data.added); |3166| |- } | |3166|+ |3167|3167| |3168|3168| // TODO: if two units enter our range together, we'll attack the |3169|3169| // first and then the second won't trigger another LosRangeUpdate | | [NORMAL] ESLintBear (curly): | | Unnecessary { after 'if' condition. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js |3204|3204| } |3205|3205| // Start attacking one of the newly-seen enemy (if any) |3206|3206| else if (this.template.NaturalBehaviour == "violent") |3207| |- { | |3207|+ |3208|3208| this.AttackVisibleEntity(msg.data.added); |3209| |- } | |3209|+ |3210|3210| }, |3211|3211| |3212|3212| "MoveCompleted": function() { }, | | [NORMAL] ESLintBear (indent): | | Expected indentation of 2 tabs but found 7. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js |3221|3221| "COMBAT": "INDIVIDUAL.COMBAT", // reuse the same combat behaviour for animals |3222|3222| |3223|3223| "WALKING": "INDIVIDUAL.WALKING", // reuse the same walking behaviour for animals |3224| |- // only used for domestic animals | |3224|+ // only used for domestic animals |3225|3225| }, |3226|3226| }; |3227|3227| | | [NORMAL] ESLintBear (no-unneeded-ternary): | | Unnecessary use of boolean literals in conditional expression. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js |3283|3283| |3284|3284| UnitAI.prototype.IsAnimal = function() |3285|3285| { |3286| |- return (this.template.NaturalBehaviour ? true : false); | |3286|+ return (!!this.template.NaturalBehaviour); |3287|3287| }; |3288|3288| |3289|3289| UnitAI.prototype.IsDangerousAnimal = function() | | [NORMAL] ESLintBear (curly): | | Unnecessary { after 'if' condition. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js |3321|3321| UnitAI.prototype.GetGarrisonHolder = function() |3322|3322| { |3323|3323| if (this.IsGarrisoned()) |3324| |- { | |3324|+ |3325|3325| for (let order of this.orderQueue) |3326|3326| if (order.type == "Garrison" || order.type == "Autogarrison") |3327|3327| return order.data.target; |3328| |- } | |3328|+ |3329|3329| return INVALID_ENTITY; |3330|3330| }; |3331|3331| | | [NORMAL] ESLintBear (comma-spacing): | | A space is required after ','. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js |3402|3402| { |3403|3403| let index = this.GetCurrentState().indexOf("."); |3404|3404| if (index != -1) |3405| |- this.UnitFsm.SwitchToNextState(this, this.GetCurrentState().slice(0,index)); | |3405|+ this.UnitFsm.SwitchToNextState(this, this.GetCurrentState().slice(0, index)); |3406|3406| this.Stop(false); |3407|3407| } |3408|3408| | | [NORMAL] ESLintBear (object-curly-spacing): | | A space is required after '{'. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js |3458|3458| if (this.orderQueue[i].type != "PickupUnit" || this.orderQueue[i].data.target != msg.entity) |3459|3459| continue; |3460|3460| if (i == 0) |3461| |- this.UnitFsm.ProcessMessage(this, {"type": "PickupCanceled", "data": msg}); | |3461|+ this.UnitFsm.ProcessMessage(this, { "type": "PickupCanceled", "data": msg}); |3462|3462| else |3463|3463| this.orderQueue.splice(i, 1); |3464|3464| Engine.PostMessage(this.entity, MT_UnitAIOrderDataChanged, { "to": this.GetOrderData() }); | | [NORMAL] ESLintBear (object-curly-spacing): | | A space is required before '}'. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js |3458|3458| if (this.orderQueue[i].type != "PickupUnit" || this.orderQueue[i].data.target != msg.entity) |3459|3459| continue; |3460|3460| if (i == 0) |3461| |- this.UnitFsm.ProcessMessage(this, {"type": "PickupCanceled", "data": msg}); | |3461|+ this.UnitFsm.ProcessMessage(this, {"type": "PickupCanceled", "data": msg }); |3462|3462| else |3463|3463| this.orderQueue.splice(i, 1); |3464|3464| Engine.PostMessage(this.entity, MT_UnitAIOrderDataChanged, { "to": this.GetOrderData() }); | | [NORMAL] ESLintBear (spaced-comment): | | Expected space or tab after '//' in comment. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js |3542|3542| }; |3543|3543| |3544|3544| |3545| |-//// FSM linkage functions //// | |3545|+// // FSM linkage functions //// |3546|3546| |3547|3547| UnitAI.prototype.SetNextState = function(state) |3548|3548| { | | [NORMAL] ESLintBear (object-curly-spacing): | | A space is required after '{'. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js |3593|3593| if (this.orderQueue.length) |3594|3594| { |3595|3595| let ret = this.UnitFsm.ProcessMessage(this, |3596| |- {"type": "Order."+this.order.type, "data": this.order.data} | |3596|+ { "type": "Order."+this.order.type, "data": this.order.data} |3597|3597| ); |3598|3598| |3599|3599| Engine.PostMessage(this.entity, MT_UnitAIOrderDataChanged, { "to": this.GetOrderData() }); | | [NORMAL] ESLintBear (object-curly-spacing): | | A space is required before '}'. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js |3593|3593| if (this.orderQueue.length) |3594|3594| { |3595|3595| let ret = this.UnitFsm.ProcessMessage(this, |3596| |- {"type": "Order."+this.order.type, "data": this.order.data} | |3596|+ {"type": "Order."+this.order.type, "data": this.order.data } |3597|3597| ); |3598|3598| |3599|3599| Engine.PostMessage(this.entity, MT_UnitAIOrderDataChanged, { "to": this.GetOrderData() }); | | [NORMAL] ESLintBear (no-else-return): | | Unnecessary 'else' after 'return'. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js |3606|3606| // Otherwise we've successfully processed a new order |3607|3607| return true; |3608|3608| } |3609| |- else |3610| |- { | |3609|+ |3611|3610| this.SetNextState("IDLE"); |3612|3611| |3613|3612| Engine.PostMessage(this.entity, MT_UnitAIOrderDataChanged, { "to": this.GetOrderData() }); |3628|3627| } |3629|3628| |3630|3629| return false; |3631| |- } | |3630|+ |3632|3631| }; |3633|3632| |3634|3633| /** | | [NORMAL] ESLintBear (object-curly-spacing): | | A space is required after '{'. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js |3645|3645| { |3646|3646| this.order = order; |3647|3647| let ret = this.UnitFsm.ProcessMessage(this, |3648| |- {"type": "Order."+this.order.type, "data": this.order.data} | |3648|+ { "type": "Order."+this.order.type, "data": this.order.data} |3649|3649| ); |3650|3650| |3651|3651| // If the order was rejected then immediately take it off | | [NORMAL] ESLintBear (object-curly-spacing): | | A space is required before '}'. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js |3645|3645| { |3646|3646| this.order = order; |3647|3647| let ret = this.UnitFsm.ProcessMessage(this, |3648| |- {"type": "Order."+this.order.type, "data": this.order.data} | |3648|+ {"type": "Order."+this.order.type, "data": this.order.data } |3649|3649| ); |3650|3650| |3651|3651| // If the order was rejected then immediately take it off | | [NORMAL] ESLintBear (object-curly-spacing): | | A space is required after '{'. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js |3681|3681| this.orderQueue.unshift(order); |3682|3682| this.order = order; |3683|3683| let ret = this.UnitFsm.ProcessMessage(this, |3684| |- {"type": "Order."+this.order.type, "data": this.order.data} | |3684|+ { "type": "Order."+this.order.type, "data": this.order.data} |3685|3685| ); |3686|3686| |3687|3687| // If the order was rejected then immediately take it off again; | | [NORMAL] ESLintBear (object-curly-spacing): | | A space is required before '}'. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js |3681|3681| this.orderQueue.unshift(order); |3682|3682| this.order = order; |3683|3683| let ret = this.UnitFsm.ProcessMessage(this, |3684| |- {"type": "Order."+this.order.type, "data": this.order.data} | |3684|+ {"type": "Order."+this.order.type, "data": this.order.data } |3685|3685| ); |3686|3686| |3687|3687| // If the order was rejected then immediately take it off again; | | [NORMAL] ESLintBear (object-curly-spacing): | | A space is required after '{'. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js |3715|3715| continue; |3716|3716| if (this.orderQueue[i].type == type) |3717|3717| continue; |3718| |- this.orderQueue.splice(i, 0, {"type": type, "data": data}); | |3718|+ this.orderQueue.splice(i, 0, { "type": type, "data": data}); |3719|3719| Engine.PostMessage(this.entity, MT_UnitAIOrderDataChanged, { "to": this.GetOrderData() }); |3720|3720| return; |3721|3721| } | | [NORMAL] ESLintBear (object-curly-spacing): | | A space is required before '}'. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js |3715|3715| continue; |3716|3716| if (this.orderQueue[i].type == type) |3717|3717| continue; |3718| |- this.orderQueue.splice(i, 0, {"type": type, "data": data}); | |3718|+ this.orderQueue.splice(i, 0, {"type": type, "data": data }); |3719|3719| Engine.PostMessage(this.entity, MT_UnitAIOrderDataChanged, { "to": this.GetOrderData() }); |3720|3720| return; |3721|3721| } | | [NORMAL] ESLintBear (curly): | | Unnecessary { after 'if' condition. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js |3729|3729| { |3730|3730| // Remember the previous work orders to be able to go back to them later if required |3731|3731| if (data && data.force) |3732| |- { | |3732|+ |3733|3733| if (this.IsFormationController()) |3734|3734| this.CallMemberFunction("UpdateWorkOrders", [type]); |3735|3735| else |3736|3736| this.UpdateWorkOrders(type); |3737| |- } | |3737|+ |3738|3738| |3739|3739| let garrisonHolder = this.IsGarrisoned() && type != "Ungarrison" ? this.GetGarrisonHolder() : null; |3740|3740| | | [NORMAL] ESLintBear (curly): | | Unnecessary { after 'if' condition. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js |3806|3806| { |3807|3807| var cmpUnitAI = Engine.QueryInterface(this.formationController, IID_UnitAI); |3808|3808| if (cmpUnitAI) |3809| |- { | |3809|+ |3810|3810| for (var i = 0; i < cmpUnitAI.orderQueue.length; ++i) |3811|3811| { |3812|3812| if (isWorkType(cmpUnitAI.orderQueue[i].type)) |3815|3815| return; |3816|3816| } |3817|3817| } |3818| |- } | |3818|+ |3819|3819| } |3820|3820| |3821|3821| // If nothing found, take the unit orders | | [NORMAL] ESLintBear (curly): | | Unnecessary { after 'for' condition. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js |3808|3808| if (cmpUnitAI) |3809|3809| { |3810|3810| for (var i = 0; i < cmpUnitAI.orderQueue.length; ++i) |3811| |- { | |3811|+ |3812|3812| if (isWorkType(cmpUnitAI.orderQueue[i].type)) |3813|3813| { |3814|3814| this.workOrders = cmpUnitAI.orderQueue.slice(i); |3815|3815| return; |3816|3816| } |3817| |- } | |3817|+ |3818|3818| } |3819|3819| } |3820|3820| | | [NORMAL] ESLintBear (curly): | | Unnecessary { after 'for' condition. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js |3820|3820| |3821|3821| // If nothing found, take the unit orders |3822|3822| for (var i = 0; i < this.orderQueue.length; ++i) |3823| |- { | |3823|+ |3824|3824| if (isWorkType(this.orderQueue[i].type)) |3825|3825| { |3826|3826| this.workOrders = this.orderQueue.slice(i); |3827|3827| return; |3828|3828| } |3829| |- } | |3829|+ |3830|3830| }; |3831|3831| |3832|3832| UnitAI.prototype.BackToWork = function() | | [NORMAL] ESLintBear (object-curly-spacing): | | A space is required after '{'. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js |3886|3886| if (data.timerRepeat === undefined) |3887|3887| this.timer = undefined; |3888|3888| |3889| |- this.UnitFsm.ProcessMessage(this, {"type": "Timer", "data": data, "lateness": lateness}); | |3889|+ this.UnitFsm.ProcessMessage(this, { "type": "Timer", "data": data, "lateness": lateness}); |3890|3890| }; |3891|3891| |3892|3892| /** | | [NORMAL] ESLintBear (object-curly-spacing): | | A space is required before '}'. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js |3886|3886| if (data.timerRepeat === undefined) |3887|3887| this.timer = undefined; |3888|3888| |3889| |- this.UnitFsm.ProcessMessage(this, {"type": "Timer", "data": data, "lateness": lateness}); | |3889|+ this.UnitFsm.ProcessMessage(this, {"type": "Timer", "data": data, "lateness": lateness }); |3890|3890| }; |3891|3891| |3892|3892| /** | | [NORMAL] ESLintBear (spaced-comment): | | Expected space or tab after '//' in comment. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js |3921|3921| this.timer = undefined; |3922|3922| }; |3923|3923| |3924| |-//// Message handlers ///// | |3924|+// // Message handlers ///// |3925|3925| |3926|3926| UnitAI.prototype.OnMotionChanged = function(msg) |3927|3927| { | | [NORMAL] ESLintBear (object-curly-spacing): | | A space is required after '{'. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js |3926|3926| UnitAI.prototype.OnMotionChanged = function(msg) |3927|3927| { |3928|3928| if (msg.starting && !msg.error) |3929| |- this.UnitFsm.ProcessMessage(this, {"type": "MoveStarted", "data": msg}); | |3929|+ this.UnitFsm.ProcessMessage(this, { "type": "MoveStarted", "data": msg}); |3930|3930| else if (!msg.starting || msg.error) |3931|3931| this.UnitFsm.ProcessMessage(this, {"type": "MoveCompleted", "data": msg}); |3932|3932| }; | | [NORMAL] ESLintBear (object-curly-spacing): | | A space is required before '}'. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js |3926|3926| UnitAI.prototype.OnMotionChanged = function(msg) |3927|3927| { |3928|3928| if (msg.starting && !msg.error) |3929| |- this.UnitFsm.ProcessMessage(this, {"type": "MoveStarted", "data": msg}); | |3929|+ this.UnitFsm.ProcessMessage(this, {"type": "MoveStarted", "data": msg }); |3930|3930| else if (!msg.starting || msg.error) |3931|3931| this.UnitFsm.ProcessMessage(this, {"type": "MoveCompleted", "data": msg}); |3932|3932| }; | | [NORMAL] ESLintBear (object-curly-spacing): | | A space is required after '{'. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js |3928|3928| if (msg.starting && !msg.error) |3929|3929| this.UnitFsm.ProcessMessage(this, {"type": "MoveStarted", "data": msg}); |3930|3930| else if (!msg.starting || msg.error) |3931| |- this.UnitFsm.ProcessMessage(this, {"type": "MoveCompleted", "data": msg}); | |3931|+ this.UnitFsm.ProcessMessage(this, { "type": "MoveCompleted", "data": msg}); |3932|3932| }; |3933|3933| |3934|3934| UnitAI.prototype.OnGlobalConstructionFinished = function(msg) | | [NORMAL] ESLintBear (object-curly-spacing): | | A space is required before '}'. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js |3928|3928| if (msg.starting && !msg.error) |3929|3929| this.UnitFsm.ProcessMessage(this, {"type": "MoveStarted", "data": msg}); |3930|3930| else if (!msg.starting || msg.error) |3931| |- this.UnitFsm.ProcessMessage(this, {"type": "MoveCompleted", "data": msg}); | |3931|+ this.UnitFsm.ProcessMessage(this, {"type": "MoveCompleted", "data": msg }); |3932|3932| }; |3933|3933| |3934|3934| UnitAI.prototype.OnGlobalConstructionFinished = function(msg) | | [NORMAL] ESLintBear (object-curly-spacing): | | A space is required after '{'. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js |3936|3936| // TODO: This is a bit inefficient since every unit listens to every |3937|3937| // construction message - ideally we could scope it to only the one we're building |3938|3938| |3939| |- this.UnitFsm.ProcessMessage(this, {"type": "ConstructionFinished", "data": msg}); | |3939|+ this.UnitFsm.ProcessMessage(this, { "type": "ConstructionFinished", "data": msg}); |3940|3940| }; |3941|3941| |3942|3942| UnitAI.prototype.OnGlobalEntityRenamed = function(msg) | | [NORMAL] ESLintBear (object-curly-spacing): | | A space is required before '}'. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js |3936|3936| // TODO: This is a bit inefficient since every unit listens to every |3937|3937| // construction message - ideally we could scope it to only the one we're building |3938|3938| |3939| |- this.UnitFsm.ProcessMessage(this, {"type": "ConstructionFinished", "data": msg}); | |3939|+ this.UnitFsm.ProcessMessage(this, {"type": "ConstructionFinished", "data": msg }); |3940|3940| }; |3941|3941| |3942|3942| UnitAI.prototype.OnGlobalEntityRenamed = function(msg) | | [NORMAL] ESLintBear (object-curly-spacing): | | A space is required after '{'. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js |3961|3961| |3962|3962| UnitAI.prototype.OnAttacked = function(msg) |3963|3963| { |3964| |- this.UnitFsm.ProcessMessage(this, {"type": "Attacked", "data": msg}); | |3964|+ this.UnitFsm.ProcessMessage(this, { "type": "Attacked", "data": msg}); |3965|3965| }; |3966|3966| |3967|3967| UnitAI.prototype.OnGuardedAttacked = function(msg) | | [NORMAL] ESLintBear (object-curly-spacing): | | A space is required before '}'. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js |3961|3961| |3962|3962| UnitAI.prototype.OnAttacked = function(msg) |3963|3963| { |3964| |- this.UnitFsm.ProcessMessage(this, {"type": "Attacked", "data": msg}); | |3964|+ this.UnitFsm.ProcessMessage(this, {"type": "Attacked", "data": msg }); |3965|3965| }; |3966|3966| |3967|3967| UnitAI.prototype.OnGuardedAttacked = function(msg) | | [NORMAL] ESLintBear (object-curly-spacing): | | A space is required after '{'. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js |3966|3966| |3967|3967| UnitAI.prototype.OnGuardedAttacked = function(msg) |3968|3968| { |3969| |- this.UnitFsm.ProcessMessage(this, {"type": "GuardedAttacked", "data": msg.data}); | |3969|+ this.UnitFsm.ProcessMessage(this, { "type": "GuardedAttacked", "data": msg.data}); |3970|3970| }; |3971|3971| |3972|3972| UnitAI.prototype.OnHealthChanged = function(msg) | | [NORMAL] ESLintBear (object-curly-spacing): | | A space is required before '}'. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js |3966|3966| |3967|3967| UnitAI.prototype.OnGuardedAttacked = function(msg) |3968|3968| { |3969| |- this.UnitFsm.ProcessMessage(this, {"type": "GuardedAttacked", "data": msg.data}); | |3969|+ this.UnitFsm.ProcessMessage(this, {"type": "GuardedAttacked", "data": msg.data }); |3970|3970| }; |3971|3971| |3972|3972| UnitAI.prototype.OnHealthChanged = function(msg) | | [NORMAL] ESLintBear (object-curly-spacing): | | A space is required after '{'. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js |3971|3971| |3972|3972| UnitAI.prototype.OnHealthChanged = function(msg) |3973|3973| { |3974| |- this.UnitFsm.ProcessMessage(this, {"type": "HealthChanged", "from": msg.from, "to": msg.to}); | |3974|+ this.UnitFsm.ProcessMessage(this, { "type": "HealthChanged", "from": msg.from, "to": msg.to}); |3975|3975| }; |3976|3976| |3977|3977| UnitAI.prototype.OnRangeUpdate = function(msg) | | [NORMAL] ESLintBear (object-curly-spacing): | | A space is required before '}'. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js |3971|3971| |3972|3972| UnitAI.prototype.OnHealthChanged = function(msg) |3973|3973| { |3974| |- this.UnitFsm.ProcessMessage(this, {"type": "HealthChanged", "from": msg.from, "to": msg.to}); | |3974|+ this.UnitFsm.ProcessMessage(this, {"type": "HealthChanged", "from": msg.from, "to": msg.to }); |3975|3975| }; |3976|3976| |3977|3977| UnitAI.prototype.OnRangeUpdate = function(msg) | | [NORMAL] ESLintBear (object-curly-spacing): | | A space is required after '{'. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js |3977|3977| UnitAI.prototype.OnRangeUpdate = function(msg) |3978|3978| { |3979|3979| if (msg.tag == this.losRangeQuery) |3980| |- this.UnitFsm.ProcessMessage(this, {"type": "LosRangeUpdate", "data": msg}); | |3980|+ this.UnitFsm.ProcessMessage(this, { "type": "LosRangeUpdate", "data": msg}); |3981|3981| else if (msg.tag == this.losHealRangeQuery) |3982|3982| this.UnitFsm.ProcessMessage(this, {"type": "LosHealRangeUpdate", "data": msg}); |3983|3983| }; | | [NORMAL] ESLintBear (object-curly-spacing): | | A space is required before '}'. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js |3977|3977| UnitAI.prototype.OnRangeUpdate = function(msg) |3978|3978| { |3979|3979| if (msg.tag == this.losRangeQuery) |3980| |- this.UnitFsm.ProcessMessage(this, {"type": "LosRangeUpdate", "data": msg}); | |3980|+ this.UnitFsm.ProcessMessage(this, {"type": "LosRangeUpdate", "data": msg }); |3981|3981| else if (msg.tag == this.losHealRangeQuery) |3982|3982| this.UnitFsm.ProcessMessage(this, {"type": "LosHealRangeUpdate", "data": msg}); |3983|3983| }; | | [NORMAL] ESLintBear (object-curly-spacing): | | A space is required after '{'. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js |3979|3979| if (msg.tag == this.losRangeQuery) |3980|3980| this.UnitFsm.ProcessMessage(this, {"type": "LosRangeUpdate", "data": msg}); |3981|3981| else if (msg.tag == this.losHealRangeQuery) |3982| |- this.UnitFsm.ProcessMessage(this, {"type": "LosHealRangeUpdate", "data": msg}); | |3982|+ this.UnitFsm.ProcessMessage(this, { "type": "LosHealRangeUpdate", "data": msg}); |3983|3983| }; |3984|3984| |3985|3985| UnitAI.prototype.OnPackFinished = function(msg) | | [NORMAL] ESLintBear (object-curly-spacing): | | A space is required before '}'. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js |3979|3979| if (msg.tag == this.losRangeQuery) |3980|3980| this.UnitFsm.ProcessMessage(this, {"type": "LosRangeUpdate", "data": msg}); |3981|3981| else if (msg.tag == this.losHealRangeQuery) |3982| |- this.UnitFsm.ProcessMessage(this, {"type": "LosHealRangeUpdate", "data": msg}); | |3982|+ this.UnitFsm.ProcessMessage(this, {"type": "LosHealRangeUpdate", "data": msg }); |3983|3983| }; |3984|3984| |3985|3985| UnitAI.prototype.OnPackFinished = function(msg) | | [NORMAL] ESLintBear (object-curly-spacing): | | A space is required after '{'. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js |3984|3984| |3985|3985| UnitAI.prototype.OnPackFinished = function(msg) |3986|3986| { |3987| |- this.UnitFsm.ProcessMessage(this, {"type": "PackFinished", "packed": msg.packed}); | |3987|+ this.UnitFsm.ProcessMessage(this, { "type": "PackFinished", "packed": msg.packed}); |3988|3988| }; |3989|3989| |3990|3990| //// Helper functions to be called by the FSM //// | | [NORMAL] ESLintBear (object-curly-spacing): | | A space is required before '}'. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js |3984|3984| |3985|3985| UnitAI.prototype.OnPackFinished = function(msg) |3986|3986| { |3987| |- this.UnitFsm.ProcessMessage(this, {"type": "PackFinished", "packed": msg.packed}); | |3987|+ this.UnitFsm.ProcessMessage(this, {"type": "PackFinished", "packed": msg.packed }); |3988|3988| }; |3989|3989| |3990|3990| //// Helper functions to be called by the FSM //// | | [NORMAL] ESLintBear (spaced-comment): | | Expected space or tab after '//' in comment. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js |3987|3987| this.UnitFsm.ProcessMessage(this, {"type": "PackFinished", "packed": msg.packed}); |3988|3988| }; |3989|3989| |3990| |-//// Helper functions to be called by the FSM //// | |3990|+// // Helper functions to be called by the FSM //// |3991|3991| |3992|3992| UnitAI.prototype.GetWalkSpeed = function() |3993|3993| { | | [NORMAL] ESLintBear (semi): | | Missing semicolon. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js |4091|4091| if (!cmpOwnership || cmpOwnership.GetOwner() == INVALID_PLAYER) |4092|4092| return undefined; |4093|4093| |4094| |- let cmpPosition = Engine.QueryInterface(this.entity, IID_Position) | |4094|+ let cmpPosition = Engine.QueryInterface(this.entity, IID_Position); |4095|4095| if (!cmpPosition || !cmpPosition.IsInWorld()) |4096|4096| return undefined; |4097|4097| | | [NORMAL] ESLintBear (curly): | | Unnecessary { after 'else'. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js |4176|4176| PlaySound(name, member); |4177|4177| } |4178|4178| else |4179| |- { | |4179|+ |4180|4180| // Otherwise use our own sounds |4181|4181| PlaySound(name, this.entity); |4182| |- } | |4182|+ |4183|4183| }; |4184|4184| |4185|4185| /* | | [NORMAL] ESLintBear (spaced-comment): | | Expected space or tab after '//' in comment. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js |4363|4363| else |4364|4364| // return false? Or hope you come close enough? |4365|4365| var parabolicMaxRange = 0; |4366| |- //return false; | |4366|+ // return false; |4367|4367| |4368|4368| // the parabole changes while walking, take something in the middle |4369|4369| var guessedMaxRange = (range.max + parabolicMaxRange)/2; | | [NORMAL] ESLintBear (operator-linebreak): | | '&&' should be placed at the end of the line. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js |4428|4428| if (this.IsFormationMember()) |4429|4429| { |4430|4430| var cmpFormationUnitAI = Engine.QueryInterface(this.formationController, IID_UnitAI); |4431| |- if (cmpFormationUnitAI && cmpFormationUnitAI.IsAttackingAsFormation() |4432| |- && cmpFormationUnitAI.order.data.target == target) | |4431|+ if (cmpFormationUnitAI && cmpFormationUnitAI.IsAttackingAsFormation() && | |4432|+ cmpFormationUnitAI.order.data.target == target) |4433|4433| return true; |4434|4434| } |4435|4435| | | [NORMAL] ESLintBear (object-curly-spacing): | | A space is required after '{'. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js |4548|4548| var pos = cmpPosition.GetPosition(); |4549|4549| var heldPosition = this.heldPosition; |4550|4550| if (heldPosition === undefined) |4551| |- heldPosition = {"x": pos.x, "z": pos.z}; | |4551|+ heldPosition = { "x": pos.x, "z": pos.z}; |4552|4552| |4553|4553| return Math.euclidDistance2D(pos.x, pos.z, heldPosition.x, heldPosition.z) < halfvision + range.max; |4554|4554| }; | | [NORMAL] ESLintBear (object-curly-spacing): | | A space is required before '}'. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js |4548|4548| var pos = cmpPosition.GetPosition(); |4549|4549| var heldPosition = this.heldPosition; |4550|4550| if (heldPosition === undefined) |4551| |- heldPosition = {"x": pos.x, "z": pos.z}; | |4551|+ heldPosition = {"x": pos.x, "z": pos.z }; |4552|4552| |4553|4553| return Math.euclidDistance2D(pos.x, pos.z, heldPosition.x, heldPosition.z) < halfvision + range.max; |4554|4554| }; | | [NORMAL] ESLintBear (operator-linebreak): | | '&&' should be placed at the end of the line. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js |4596|4596| UnitAI.prototype.AttackEntityInZone = function(ents) |4597|4597| { |4598|4598| var target = ents.find(target => |4599| |- this.CanAttack(target) |4600| |- && this.CheckTargetDistanceFromHeldPosition(target, IID_Attack, this.GetBestAttackAgainst(target, true)) | |4599|+ this.CanAttack(target) && | |4600|+ this.CheckTargetDistanceFromHeldPosition(target, IID_Attack, this.GetBestAttackAgainst(target, true)) |4601|4601| && (this.GetStance().respondChaseBeyondVision || this.CheckTargetIsInVisionRange(target)) |4602|4602| ); |4603|4603| if (!target) | | [NORMAL] ESLintBear (operator-linebreak): | | '&&' should be placed at the end of the line. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js |4597|4597| { |4598|4598| var target = ents.find(target => |4599|4599| this.CanAttack(target) |4600| |- && this.CheckTargetDistanceFromHeldPosition(target, IID_Attack, this.GetBestAttackAgainst(target, true)) |4601| |- && (this.GetStance().respondChaseBeyondVision || this.CheckTargetIsInVisionRange(target)) | |4600|+ && this.CheckTargetDistanceFromHeldPosition(target, IID_Attack, this.GetBestAttackAgainst(target, true)) && | |4601|+ (this.GetStance().respondChaseBeyondVision || this.CheckTargetIsInVisionRange(target)) |4602|4602| ); |4603|4603| if (!target) |4604|4604| return false; | | [NORMAL] ESLintBear (no-multi-spaces): | | Multiple spaces found before 'Engine'. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js |4661|4661| // If we are guarding/escorting, don't abandon as long as the guarded unit is in target range of the attacker |4662|4662| if (this.isGuardOf) |4663|4663| { |4664| |- var cmpUnitAI = Engine.QueryInterface(target, IID_UnitAI); | |4664|+ var cmpUnitAI = Engine.QueryInterface(target, IID_UnitAI); |4665|4665| var cmpAttack = Engine.QueryInterface(target, IID_Attack); |4666|4666| if (cmpUnitAI && cmpAttack && |4667|4667| cmpAttack.GetAttackTypes().some(type => cmpUnitAI.CheckTargetAttackRange(this.isGuardOf, type))) | | [NORMAL] ESLintBear (indent): | | Expected indentation of 3 tabs but found 4. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js |4665|4665| var cmpAttack = Engine.QueryInterface(target, IID_Attack); |4666|4666| if (cmpUnitAI && cmpAttack && |4667|4667| cmpAttack.GetAttackTypes().some(type => cmpUnitAI.CheckTargetAttackRange(this.isGuardOf, type))) |4668| |- return false; | |4668|+ return false; |4669|4669| } |4670|4670| |4671|4671| // Stop if we're in hold-ground mode and it's too far from the holding point | | [NORMAL] ESLintBear (curly): | | Unnecessary { after 'if' condition. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js |4670|4670| |4671|4671| // Stop if we're in hold-ground mode and it's too far from the holding point |4672|4672| if (this.GetStance().respondHoldGround) |4673| |- { | |4673|+ |4674|4674| if (!this.CheckTargetDistanceFromHeldPosition(target, iid, type)) |4675|4675| return true; |4676| |- } | |4676|+ |4677|4677| |4678|4678| // Stop if it's left our vision range, unless we're especially persistent |4679|4679| if (!this.GetStance().respondChaseBeyondVision) | | [NORMAL] ESLintBear (curly): | | Unnecessary { after 'if' condition. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js |4677|4677| |4678|4678| // Stop if it's left our vision range, unless we're especially persistent |4679|4679| if (!this.GetStance().respondChaseBeyondVision) |4680| |- { | |4680|+ |4681|4681| if (!this.CheckTargetIsInVisionRange(target)) |4682|4682| return true; |4683| |- } | |4683|+ |4684|4684| |4685|4685| // (Note that CCmpUnitMotion will detect if the target is lost in FoW, |4686|4686| // and will continue moving to its last seen position and then stop) | | [NORMAL] ESLintBear (no-multi-spaces): | | Multiple spaces found before 'Engine'. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js |4708|4708| // If we are guarding/escorting, chase at least as long as the guarded unit is in target range of the attacker |4709|4709| if (this.isGuardOf) |4710|4710| { |4711| |- var cmpUnitAI = Engine.QueryInterface(target, IID_UnitAI); | |4711|+ var cmpUnitAI = Engine.QueryInterface(target, IID_UnitAI); |4712|4712| var cmpAttack = Engine.QueryInterface(target, IID_Attack); |4713|4713| if (cmpUnitAI && cmpAttack && |4714|4714| cmpAttack.GetAttackTypes().some(type => cmpUnitAI.CheckTargetAttackRange(this.isGuardOf, type))) | | [NORMAL] ESLintBear (spaced-comment): | | Expected space or tab after '//' in comment. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js |4721|4721| return false; |4722|4722| }; |4723|4723| |4724| |-//// External interface functions //// | |4724|+// // External interface functions //// |4725|4725| |4726|4726| UnitAI.prototype.SetFormationController = function(ent) |4727|4727| { | | [NORMAL] ESLintBear (curly): | | Unnecessary { after 'if' condition. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js |4731|4731| // of our own formation (or ourself if not in formation) |4732|4732| var cmpObstruction = Engine.QueryInterface(this.entity, IID_Obstruction); |4733|4733| if (cmpObstruction) |4734| |- { | |4734|+ |4735|4735| if (ent == INVALID_ENTITY) |4736|4736| cmpObstruction.SetControlGroup(this.entity); |4737|4737| else |4738|4738| cmpObstruction.SetControlGroup(ent); |4739| |- } | |4739|+ |4740|4740| |4741|4741| // If we were removed from a formation, let the FSM switch back to INDIVIDUAL |4742|4742| if (ent == INVALID_ENTITY) | | [NORMAL] ESLintBear (curly): | | Unnecessary { after 'if' condition. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js |4874|4874| // if we already had an old guard order, do nothing if the target is the same |4875|4875| // and the order is running, otherwise remove the previous order |4876|4876| if (this.isGuardOf) |4877| |- { | |4877|+ |4878|4878| if (this.isGuardOf == target && this.order && this.order.type == "Guard") |4879|4879| return; |4880|4880| else |4881|4881| this.RemoveGuard(); |4882| |- } | |4882|+ |4883|4883| |4884|4884| this.AddOrder("Guard", { "target": target, "force": false }, queued); |4885|4885| }; | | [NORMAL] ESLintBear (no-else-return): | | Unnecessary 'else' after 'return'. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js |4877|4877| { |4878|4878| if (this.isGuardOf == target && this.order && this.order.type == "Guard") |4879|4879| return; |4880| |- else |4881| |- this.RemoveGuard(); | |4880|+ this.RemoveGuard(); |4882|4881| } |4883|4882| |4884|4883| this.AddOrder("Guard", { "target": target, "force": false }, queued); | | [NORMAL] ESLintBear (object-curly-spacing): | | A space is required after '{'. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js |4919|4919| return; |4920|4920| |4921|4921| if (this.order.type == "Guard") |4922| |- this.UnitFsm.ProcessMessage(this, {"type": "RemoveGuard"}); | |4922|+ this.UnitFsm.ProcessMessage(this, { "type": "RemoveGuard"}); |4923|4923| else |4924|4924| for (let i = 1; i < this.orderQueue.length; ++i) |4925|4925| if (this.orderQueue[i].type == "Guard") | | [NORMAL] ESLintBear (object-curly-spacing): | | A space is required before '}'. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js |4919|4919| return; |4920|4920| |4921|4921| if (this.order.type == "Guard") |4922| |- this.UnitFsm.ProcessMessage(this, {"type": "RemoveGuard"}); | |4922|+ this.UnitFsm.ProcessMessage(this, {"type": "RemoveGuard" }); |4923|4923| else |4924|4924| for (let i = 1; i < this.orderQueue.length; ++i) |4925|4925| if (this.orderQueue[i].type == "Guard") | | [NORMAL] ESLintBear (object-curly-spacing): | | A space is required before '}'. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js |5048|5048| this.WalkToTarget(target, queued); |5049|5049| return; |5050|5050| } |5051| |- this.AddOrder("Attack", { "target": target, "force": true, "allowCapture": allowCapture}, queued); | |5051|+ this.AddOrder("Attack", { "target": target, "force": true, "allowCapture": allowCapture }, queued); |5052|5052| }; |5053|5053| |5054|5054| /** | | [NORMAL] ESLintBear (no-trailing-spaces): | | Trailing spaces not allowed. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js |5197|5197| this.workOrders.length && this.workOrders[0].type == "Trade") |5198|5198| { |5199|5199| let cmpTrader = Engine.QueryInterface(this.entity, IID_Trader); |5200| |- if (cmpTrader.HasBothMarkets() && | |5200|+ if (cmpTrader.HasBothMarkets() && |5201|5201| (cmpTrader.GetFirstMarket() == target && cmpTrader.GetSecondMarket() == source || |5202|5202| cmpTrader.GetFirstMarket() == source && cmpTrader.GetSecondMarket() == target)) |5203|5203| { | | [NORMAL] ESLintBear (operator-linebreak): | | '&&' should be placed at the end of the line. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js |5478|5478| { |5479|5479| var cmpIdentity = Engine.QueryInterface(targ, IID_Identity); |5480|5480| var targetClasses = this.order.data.targetClasses; |5481| |- if (targetClasses.attack && cmpIdentity |5482| |- && !MatchesClassList(cmpIdentity.GetClassesList(), targetClasses.attack)) | |5481|+ if (targetClasses.attack && cmpIdentity && | |5482|+ !MatchesClassList(cmpIdentity.GetClassesList(), targetClasses.attack)) |5483|5483| continue; |5484|5484| if (targetClasses.avoid && cmpIdentity |5485|5485| && MatchesClassList(cmpIdentity.GetClassesList(), targetClasses.avoid)) | | [NORMAL] ESLintBear (operator-linebreak): | | '&&' should be placed at the end of the line. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js |5481|5481| if (targetClasses.attack && cmpIdentity |5482|5482| && !MatchesClassList(cmpIdentity.GetClassesList(), targetClasses.attack)) |5483|5483| continue; |5484| |- if (targetClasses.avoid && cmpIdentity |5485| |- && MatchesClassList(cmpIdentity.GetClassesList(), targetClasses.avoid)) | |5484|+ if (targetClasses.avoid && cmpIdentity && | |5485|+ MatchesClassList(cmpIdentity.GetClassesList(), targetClasses.avoid)) |5486|5486| continue; |5487|5487| // Only used by the AIs to prevent some choices of targets |5488|5488| if (targetClasses.vetoEntities && targetClasses.vetoEntities[targ]) | | [NORMAL] ESLintBear (operator-linebreak): | | '&&' should be placed at the end of the line. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js |5504|5504| { |5505|5505| var cmpIdentity = Engine.QueryInterface(targ, IID_Identity); |5506|5506| var targetClasses = this.order.data.targetClasses; |5507| |- if (cmpIdentity && targetClasses.attack |5508| |- && !MatchesClassList(cmpIdentity.GetClassesList(), targetClasses.attack)) | |5507|+ if (cmpIdentity && targetClasses.attack && | |5508|+ !MatchesClassList(cmpIdentity.GetClassesList(), targetClasses.attack)) |5509|5509| continue; |5510|5510| if (cmpIdentity && targetClasses.avoid |5511|5511| && MatchesClassList(cmpIdentity.GetClassesList(), targetClasses.avoid)) | | [NORMAL] ESLintBear (operator-linebreak): | | '&&' should be placed at the end of the line. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js |5507|5507| if (cmpIdentity && targetClasses.attack |5508|5508| && !MatchesClassList(cmpIdentity.GetClassesList(), targetClasses.attack)) |5509|5509| continue; |5510| |- if (cmpIdentity && targetClasses.avoid |5511| |- && MatchesClassList(cmpIdentity.GetClassesList(), targetClasses.avoid)) | |5510|+ if (cmpIdentity && targetClasses.avoid && | |5511|+ MatchesClassList(cmpIdentity.GetClassesList(), targetClasses.avoid)) |5512|5512| continue; |5513|5513| // Only used by the AIs to prevent some choices of targets |5514|5514| if (targetClasses.vetoEntities && targetClasses.vetoEntities[targ]) | | [NORMAL] ESLintBear (space-before-function-paren): | | Unexpected space before function parentheses. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js |5547|5547| |5548|5548| var cmpRangeManager = Engine.QueryInterface(SYSTEM_ENTITY, IID_RangeManager); |5549|5549| var entities = cmpRangeManager.ResetActiveQuery(this.losRangeQuery); |5550| |- var targets = entities.filter(function (v) { return cmpAttack.CanAttack(v) && attackfilter(v); }) | |5550|+ var targets = entities.filter(function(v) { return cmpAttack.CanAttack(v) && attackfilter(v); }) |5551|5551| .sort(function (a, b) { return cmpAttack.CompareEntitiesByPreference(a, b); }); |5552|5552| |5553|5553| return targets; | | [NORMAL] ESLintBear (space-before-function-paren): | | Unexpected space before function parentheses. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js |5548|5548| var cmpRangeManager = Engine.QueryInterface(SYSTEM_ENTITY, IID_RangeManager); |5549|5549| var entities = cmpRangeManager.ResetActiveQuery(this.losRangeQuery); |5550|5550| var targets = entities.filter(function (v) { return cmpAttack.CanAttack(v) && attackfilter(v); }) |5551| |- .sort(function (a, b) { return cmpAttack.CompareEntitiesByPreference(a, b); }); | |5551|+ .sort(function(a, b) { return cmpAttack.CompareEntitiesByPreference(a, b); }); |5552|5552| |5553|5553| return targets; |5554|5554| }; | | [NORMAL] ESLintBear (object-curly-spacing): | | A space is required after '{'. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js |5637|5637| |5638|5638| UnitAI.prototype.SetHeldPosition = function(x, z) |5639|5639| { |5640| |- this.heldPosition = {"x": x, "z": z}; | |5640|+ this.heldPosition = { "x": x, "z": z}; |5641|5641| }; |5642|5642| |5643|5643| UnitAI.prototype.SetHeldPositionOnEntity = function(entity) | | [NORMAL] ESLintBear (object-curly-spacing): | | A space is required before '}'. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js |5637|5637| |5638|5638| UnitAI.prototype.SetHeldPosition = function(x, z) |5639|5639| { |5640| |- this.heldPosition = {"x": x, "z": z}; | |5640|+ this.heldPosition = {"x": x, "z": z }; |5641|5641| }; |5642|5642| |5643|5643| UnitAI.prototype.SetHeldPositionOnEntity = function(entity) | | [NORMAL] ESLintBear (spaced-comment): | | Expected space or tab after '//' in comment. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js |5664|5664| return false; |5665|5665| }; |5666|5666| |5667| |-//// Helper functions //// | |5667|+// // Helper functions //// |5668|5668| |5669|5669| UnitAI.prototype.CanAttack = function(target) |5670|5670| { | | [NORMAL] ESLintBear (spaced-comment): | | Expected space or tab after '//' in comment. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js |5868|5868| return (cmpPack && cmpPack.IsPacking()); |5869|5869| }; |5870|5870| |5871| |-//// Formation specific functions //// | |5871|+// // Formation specific functions //// |5872|5872| |5873|5873| UnitAI.prototype.IsAttackingAsFormation = function() |5874|5874| { | | [NORMAL] ESLintBear (operator-linebreak): | | '&&' should be placed at the end of the line. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js |5873|5873| UnitAI.prototype.IsAttackingAsFormation = function() |5874|5874| { |5875|5875| var cmpAttack = Engine.QueryInterface(this.entity, IID_Attack); |5876| |- return cmpAttack && cmpAttack.CanAttackAsFormation() |5877| |- && this.GetCurrentState() == "FORMATIONCONTROLLER.COMBAT.ATTACKING"; | |5876|+ return cmpAttack && cmpAttack.CanAttackAsFormation() && | |5877|+ this.GetCurrentState() == "FORMATIONCONTROLLER.COMBAT.ATTACKING"; |5878|5878| }; |5879|5879| |5880|5880| //// Animal specific functions //// | | [NORMAL] ESLintBear (spaced-comment): | | Expected space or tab after '//' in comment. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js |5877|5877| && this.GetCurrentState() == "FORMATIONCONTROLLER.COMBAT.ATTACKING"; |5878|5878| }; |5879|5879| |5880| |-//// Animal specific functions //// | |5880|+// // Animal specific functions //// |5881|5881| |5882|5882| UnitAI.prototype.MoveRandomly = function(distance) |5883|5883| { binaries/data/mods/public/simulation/components/UnitAI.js |2421| » » » » » » let·nearby·=·this.FindNearestDropsite(resourceType.generic); | | [NORMAL] ESLintBear (no-shadow): | | 'nearby' is already declared in the upper scope. binaries/data/mods/public/simulation/components/UnitAI.js |3791| » var·isWorkType·=·type·=>·type·==·"Gather"·||·type·==·"Trade"·||·type·==·"Repair"·||·type·==·"ReturnResource"; | | [NORMAL] ESLintBear (no-shadow): | | 'type' is already declared in the upper scope. binaries/data/mods/public/simulation/components/UnitAI.js |4583| » var·target·=·ents.find(target·=>·this.CanAttack(target)); | | [NORMAL] ESLintBear (no-shadow): | | 'target' is already declared in the upper scope. binaries/data/mods/public/simulation/components/UnitAI.js |4598| » var·target·=·ents.find(target·=> | | [NORMAL] ESLintBear (no-shadow): | | 'target' is already declared in the upper scope. binaries/data/mods/public/simulation/components/UnitAI.js |4644| » var·ent·=·ents.find(ent·=>·this.CanHeal(ent)); | | [NORMAL] ESLintBear (no-shadow): | | 'ent' is already declared in the upper scope. binaries/data/mods/public/simulation/components/UnitAI.js |4667| » » ····cmpAttack.GetAttackTypes().some(type·=>·cmpUnitAI.CheckTargetAttackRange(this.isGuardOf,·type))) | | [NORMAL] ESLintBear (no-shadow): | | 'type' is already declared in the upper scope. binaries/data/mods/public/simulation/components/UnitAI.js |5128| » var·lastPos·=·undefined; | | [NORMAL] ESLintBear (no-undef-init): | | It's not necessary to initialize 'lastPos' to undefined. binaries/data/mods/public/simulation/components/UnitAI.js | 356| » » ····&&·(this.lastShorelinePosition.z·==·cmpPosition.GetPosition().z)) | | [NORMAL] JSHintBear: | | Misleading line break before '&&'; readers may interpret this as an expression boundary. binaries/data/mods/public/simulation/components/UnitAI.js |1896| » » » » » » var·cmpFormation·=·Engine.QueryInterface(this.formationController,·IID_Formation); | | [NORMAL] JSHintBear: | | 'cmpFormation' is already defined. binaries/data/mods/public/simulation/components/UnitAI.js |2030| » » » » » » &&·this.order.data.target·!=·msg.data.attacker·&&·this.GetBestAttackAgainst(msg.data.attacker,·true)·!=·"Capture") | | [NORMAL] JSHintBear: | | Misleading line break before '&&'; readers may interpret this as an expression boundary. binaries/data/mods/public/simulation/components/UnitAI.js |2114| » » » » » » » » ·&&·((type.generic·==·"treasure"·&&·oldType.generic·==·"treasure") | | [NORMAL] JSHintBear: | | Misleading line break before '&&'; readers may interpret this as an expression boundary. binaries/data/mods/public/simulation/components/UnitAI.js |2115| » » » » » » » » ·||·(type.specific·==·oldType.specific | | [NORMAL] JSHintBear: | | Misleading line break before '||'; readers may interpret this as an expression boundary. binaries/data/mods/public/simulation/components/UnitAI.js |2116| » » » » » » » » ·&&·(type.specific·!=·"meat"·||·oldTemplate·==·template))) | | [NORMAL] JSHintBear: | | Misleading line break before '&&'; readers may interpret this as an expression boundary. binaries/data/mods/public/simulation/components/UnitAI.js |2139| » » » » » » » » var·nearby·=·this.FindNearestDropsite(oldType.generic); | | [NORMAL] JSHintBear: | | 'nearby' is already defined. binaries/data/mods/public/simulation/components/UnitAI.js |2179| » » » » » » » » &&·((type.generic·==·"treasure"·&&·oldType.generic·==·"treasure") | | [NORMAL] JSHintBear: | | Misleading line break before '&&'; readers may interpret this as an expression boundary. binaries/data/mods/public/simulation/components/UnitAI.js |2180| » » » » » » » » ||·(type.specific·==·oldType.specific | | [NORMAL] JSHintBear: | | Misleading line break before '||'; readers may interpret this as an expression boundary. binaries/data/mods/public/simulation/components/UnitAI.js |2181| » » » » » » » » &&·(type.specific·!=·"meat"·||·oldTemplate·==·template))) | | [NORMAL] JSHintBear: | | Misleading line break before '&&'; readers may interpret this as an expression boundary. binaries/data/mods/public/simulation/components/UnitAI.js |2226| » » » » » » » ||·(type.specific·==·resourceType.specific | | [NORMAL] JSHintBear: | | Misleading line break before '||'; readers may interpret this as an expression boundary. binaries/data/mods/public/simulation/components/UnitAI.js |2227| » » » » » » » &&·(type.specific·!=·"meat"·||·resourceTemplate·==·template)) | | [NORMAL] JSHintBear: | | Misleading line break before '&&'; readers may interpret this as an expression boundary. binaries/data/mods/public/simulation/components/UnitAI.js |2243| » » » » » var·nearby·=·this.FindNearestDropsite(resourceType.generic); | | [NORMAL] JSHintBear: | | 'nearby' is already defined. binaries/data/mods/public/simulation/components/UnitAI.js |2416| » » » » » var·cmpResourceGatherer·=·Engine.QueryInterface(this.entity,·IID_ResourceGatherer); | | [NORMAL] JSHintBear: | | 'cmpResourceGatherer' is already defined. binaries/data/mods/public/simulation/components/UnitAI.js |2432| » » » » » var·nearby·=·this.FindNearbyResource(function·(ent,·type,·template)·{ | | [NORMAL] JSHintBear: | | 'nearby' is already defined. binaries/data/mods/public/simulation/components/UnitAI.js |2435| » » » » » » » ||·(type.specific·==·resourceType.specific | | [NORMAL] JSHintBear: | | Misleading line break before '||'; readers may interpret this as an expression boundary. binaries/data/mods/public/simulation/components/UnitAI.js |2436| » » » » » » » &&·(type.specific·!=·"meat"·||·resourceTemplate·==·template)) | | [NORMAL] JSHintBear: | | Misleading line break before '&&'; readers may interpret this as an expression boundary. binaries/data/mods/public/simulation/components/UnitAI.js |2456| » » » » » var·nearby·=·this.FindNearestDropsite(resourceType.generic); | | [NORMAL] JSHintBear: | | 'nearby' is already defined. binaries/data/mods/public/simulation/components/UnitAI.js |2636| » » » » » var·cmpResourceGatherer·=·Engine.QueryInterface(this.entity,·IID_ResourceGatherer); | | [NORMAL] JSHintBear: | | 'cmpResourceGatherer' is already defined. binaries/data/mods/public/simulation/components/UnitAI.js |2831| » » » » » var·cmpResourceDropsite·=·Engine.QueryInterface(msg.data.newentity,·IID_ResourceDropsite); | | [NORMAL] JSHintBear: | | 'cmpResourceDropsite' is already defined. binaries/data/mods/public/simulation/components/UnitAI.js |2904| » » » » » if·(this.CanGarrison(target)) | | [NORMAL] JSHintBear: | | 'target' used out of scope. binaries/data/mods/public/simulation/components/UnitAI.js |2907| » » » » » » if·(this.CheckGarrisonRange(target)) | | [NORMAL] JSHintBear: | | 'target' used out of scope. binaries/data/mods/public/simulation/components/UnitAI.js |2909| » » » » » » » var·cmpGarrisonHolder·=·Engine.QueryInterface(target,·IID_GarrisonHolder); | | [NORMAL] JSHintBear: | | 'target' used out of scope. binaries/data/mods/public/simulation/components/UnitAI.js |2931| » » » » » » » » var·cmpResourceDropsite·=·Engine.QueryInterface(target,·IID_ResourceDropsite); | | [NORMAL] JSHintBear: | | 'target' used out of scope. binaries/data/mods/public/simulation/components/UnitAI.js |2932| » » » » » » » » if·(cmpResourceDropsite·&&·this.CanReturnResource(target,·true)) | | [NORMAL] JSHintBear: | | 'target' used out of scope. binaries/data/mods/public/simulation/components/UnitAI.js |2947| » » » » » » » » » var·cmpHolderPosition·=·Engine.QueryInterface(target,·IID_Position); | | [NORMAL] JSHintBear: | | 'target' used out of scope. binaries/data/mods/public/simulation/components/UnitAI.js |2948| » » » » » » » » » var·cmpHolderUnitAI·=·Engine.QueryInterface(target,·IID_UnitAI); | | [NORMAL] JSHintBear: | | 'target' used out of scope. binaries/data/mods/public/simulation/components/UnitAI.js |2975| » » » » » » » if·(this.MoveToTarget(target)) | | [NORMAL] JSHintBear: | | 'target' used out of scope. binaries/data/mods/public/simulation/components/UnitAI.js |3753| » » var·order·=·{·"type":·type,·"data":·data·}; | | [NORMAL] JSHintBear: | | 'order' is already defined. binaries/data/mods/public/simulation/components/UnitAI.js |3822| » for·(var·i·=·0;·i·<·this.orderQueue.length;·++i) | | [NORMAL] JSHintBear: | | 'i' is already defined. binaries/data/mods/public/simulation/components/UnitAI.js |4094| » let·cmpPosition·=·Engine.QueryInterface(this.entity,·IID_Position) | | [NORMAL] JSHintBear: | | Missing semicolon. binaries/data/mods/public/simulation/components/UnitAI.js |4365| » » var·parabolicMaxRange·=·0; | | [NORMAL] JSHintBear: | | 'parabolicMaxRange' is already defined. binaries/data/mods/public/simulation/components/UnitAI.js |4369| » var·guessedMaxRange·=·(range.max·+·parabolicMaxRange)/2; | | [NORMAL] JSHintBear: | | 'parabolicMaxRange' used out of scope. binaries/data/mods/public/simulation/components/UnitAI.js |4376| » return·cmpUnitMotion.MoveToTargetRange(target,·range.min,·Math.min(range.max,·parabolicMaxRange)); | | [NORMAL] JSHintBear: | | 'parabolicMaxRange' used out of scope. binaries/data/mods/public/simulation/components/UnitAI.js |4432| » » » &&·cmpFormationUnitAI.order.data.target·==·target) | | [NORMAL] JSHintBear: | | Misleading line break before '&&'; readers may interpret this as an expression boundary. binaries/data/mods/public/simulation/components/UnitAI.js |4600| » » &&·this.CheckTargetDistanceFromHeldPosition(target,·IID_Attack,·this.GetBestAttackAgainst(target,·true)) | | [NORMAL] JSHintBear: | | Misleading line break before '&&'; readers may interpret this as an expression boundary. binaries/data/mods/public/simulation/components/UnitAI.js |4601| » » &&·(this.GetStance().respondChaseBeyondVision·||·this.CheckTargetIsInVisionRange(target)) | | [NORMAL] JSHintBear: | | Misleading line break before '&&'; readers may interpret this as an expression boundary. binaries/data/mods/public/simulation/components/UnitAI.js |5128| » var·lastPos·=·undefined; | | [NORMAL] JSHintBear: | | It's not necessary to initialize 'lastPos' to 'undefined'. binaries/data/mods/public/simulation/components/UnitAI.js |5482| » » » » » » &&·!MatchesClassList(cmpIdentity.GetClassesList(),·targetClasses.attack)) | | [NORMAL] JSHintBear: | | Misleading line break before '&&'; readers may interpret this as an expression boundary. binaries/data/mods/public/simulation/components/UnitAI.js |5485| » » » » » » &&·MatchesClassList(cmpIdentity.GetClassesList(),·targetClasses.avoid)) | | [NORMAL] JSHintBear: | | Misleading line break before '&&'; readers may interpret this as an expression boundary. binaries/data/mods/public/simulation/components/UnitAI.js |5498| » var·targets·=·this.GetTargetsFromUnit(); | | [NORMAL] JSHintBear: | | 'targets' is already defined. binaries/data/mods/public/simulation/components/UnitAI.js |5499| » for·(var·targ·of·targets) | | [NORMAL] JSHintBear: | | 'targ' is already defined. binaries/data/mods/public/simulation/components/UnitAI.js |5505| » » » var·cmpIdentity·=·Engine.QueryInterface(targ,·IID_Identity); | | [NORMAL] JSHintBear: | | 'cmpIdentity' is already defined. binaries/data/mods/public/simulation/components/UnitAI.js |5506| » » » var·targetClasses·=·this.order.data.targetClasses; | | [NORMAL] JSHintBear: | | 'targetClasses' is already defined. binaries/data/mods/public/simulation/components/UnitAI.js |5508| » » » » &&·!MatchesClassList(cmpIdentity.GetClassesList(),·targetClasses.attack)) | | [NORMAL] JSHintBear: | | Misleading line break before '&&'; readers may interpret this as an expression boundary. binaries/data/mods/public/simulation/components/UnitAI.js |5511| » » » » &&·MatchesClassList(cmpIdentity.GetClassesList(),·targetClasses.avoid)) | | [NORMAL] JSHintBear: | | Misleading line break before '&&'; readers may interpret this as an expression boundary. binaries/data/mods/public/simulation/components/UnitAI.js |5586| » » var·range·=·cmpVision.GetRange(); | | [NORMAL] JSHintBear: | | 'range' is already defined. binaries/data/mods/public/simulation/components/UnitAI.js |5591| » » var·cmpRanged·=·Engine.QueryInterface(this.entity,·iid); | | [NORMAL] JSHintBear: | | 'cmpRanged' is already defined. binaries/data/mods/public/simulation/components/UnitAI.js |5594| » » var·range·=·iid·!==·IID_Attack·?·cmpRanged.GetRange()·:·cmpRanged.GetFullAttackRange(); | | [NORMAL] JSHintBear: | | 'range' is already defined. binaries/data/mods/public/simulation/components/UnitAI.js |5595| » » var·cmpVision·=·Engine.QueryInterface(this.entity,·IID_Vision); | | [NORMAL] JSHintBear: | | 'cmpVision' is already defined. binaries/data/mods/public/simulation/components/UnitAI.js |5595| » » var·cmpVision·=·Engine.QueryInterface(this.entity,·IID_Vision); | | [MAJOR] JSHintBear: | | Too many errors. (93% scanned).
Link to build: https://jenkins.wildfiregames.com/job/differential/83/display/redirect
Successful build - Chance fights ever on the side of the prudent.
Linter detected issues: Executing section Default... Executing section Source... Executing section JS... | | [NORMAL] ESLintBear (quote-props): | | Unquoted property 'SetInterval' found. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | 35| 35| | 36| 36| | 37| 37| AddMock(SYSTEM_ENTITY, IID_Timer, { | 38| |- SetInterval: function() { }, | | 38|+ "SetInterval": function() { }, | 39| 39| SetTimeout: function() { }, | 40| 40| }); | 41| 41| | | [NORMAL] ESLintBear (quote-props): | | Unquoted property 'SetTimeout' found. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | 36| 36| | 37| 37| AddMock(SYSTEM_ENTITY, IID_Timer, { | 38| 38| SetInterval: function() { }, | 39| |- SetTimeout: function() { }, | | 39|+ "SetTimeout": function() { }, | 40| 40| }); | 41| 41| | 42| 42| AddMock(SYSTEM_ENTITY, IID_RangeManager, { | | [NORMAL] ESLintBear (quote-props): | | Unquoted property 'CreateActiveQuery' found. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | 40| 40| }); | 41| 41| | 42| 42| AddMock(SYSTEM_ENTITY, IID_RangeManager, { | 43| |- CreateActiveQuery: function(ent, minRange, maxRange, players, iid, flags) { | | 43|+ "CreateActiveQuery": function(ent, minRange, maxRange, players, iid, flags) { | 44| 44| return 1; | 45| 45| }, | 46| 46| EnableActiveQuery: function(id) { }, | | [NORMAL] ESLintBear (quote-props): | | Unquoted property 'EnableActiveQuery' found. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | 43| 43| CreateActiveQuery: function(ent, minRange, maxRange, players, iid, flags) { | 44| 44| return 1; | 45| 45| }, | 46| |- EnableActiveQuery: function(id) { }, | | 46|+ "EnableActiveQuery": function(id) { }, | 47| 47| ResetActiveQuery: function(id) { if (mode == 0) return []; else return [enemy]; }, | 48| 48| DisableActiveQuery: function(id) { }, | 49| 49| GetEntityFlagMask: function(identifier) { }, | | [NORMAL] ESLintBear (quote-props): | | Unquoted property 'ResetActiveQuery' found. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | 44| 44| return 1; | 45| 45| }, | 46| 46| EnableActiveQuery: function(id) { }, | 47| |- ResetActiveQuery: function(id) { if (mode == 0) return []; else return [enemy]; }, | | 47|+ "ResetActiveQuery": function(id) { if (mode == 0) return []; else return [enemy]; }, | 48| 48| DisableActiveQuery: function(id) { }, | 49| 49| GetEntityFlagMask: function(identifier) { }, | 50| 50| }); | | [NORMAL] ESLintBear (no-else-return): | | Unnecessary 'else' after 'return'. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | 44| 44| return 1; | 45| 45| }, | 46| 46| EnableActiveQuery: function(id) { }, | 47| |- ResetActiveQuery: function(id) { if (mode == 0) return []; else return [enemy]; }, | | 47|+ ResetActiveQuery: function(id) { if (mode == 0) return []; return [enemy]; }, | 48| 48| DisableActiveQuery: function(id) { }, | 49| 49| GetEntityFlagMask: function(identifier) { }, | 50| 50| }); | | [NORMAL] ESLintBear (quote-props): | | Unquoted property 'DisableActiveQuery' found. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | 45| 45| }, | 46| 46| EnableActiveQuery: function(id) { }, | 47| 47| ResetActiveQuery: function(id) { if (mode == 0) return []; else return [enemy]; }, | 48| |- DisableActiveQuery: function(id) { }, | | 48|+ "DisableActiveQuery": function(id) { }, | 49| 49| GetEntityFlagMask: function(identifier) { }, | 50| 50| }); | 51| 51| | | [NORMAL] ESLintBear (quote-props): | | Unquoted property 'GetEntityFlagMask' found. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | 46| 46| EnableActiveQuery: function(id) { }, | 47| 47| ResetActiveQuery: function(id) { if (mode == 0) return []; else return [enemy]; }, | 48| 48| DisableActiveQuery: function(id) { }, | 49| |- GetEntityFlagMask: function(identifier) { }, | | 49|+ "GetEntityFlagMask": function(identifier) { }, | 50| 50| }); | 51| 51| | 52| 52| AddMock(SYSTEM_ENTITY, IID_TemplateManager, { | | [NORMAL] ESLintBear (quote-props): | | Unquoted property 'GetCurrentTemplateName' found. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | 50| 50| }); | 51| 51| | 52| 52| AddMock(SYSTEM_ENTITY, IID_TemplateManager, { | 53| |- GetCurrentTemplateName: function(ent) { return "special/formations/line_closed"; }, | | 53|+ "GetCurrentTemplateName": function(ent) { return "special/formations/line_closed"; }, | 54| 54| }); | 55| 55| | 56| 56| AddMock(SYSTEM_ENTITY, IID_PlayerManager, { | | [NORMAL] ESLintBear (quote-props): | | Unquoted property 'GetPlayerByID' found. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | 54| 54| }); | 55| 55| | 56| 56| AddMock(SYSTEM_ENTITY, IID_PlayerManager, { | 57| |- GetPlayerByID: function(id) { return playerEntity; }, | | 57|+ "GetPlayerByID": function(id) { return playerEntity; }, | 58| 58| GetNumPlayers: function() { return 2; }, | 59| 59| }); | 60| 60| | | [NORMAL] ESLintBear (quote-props): | | Unquoted property 'GetNumPlayers' found. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | 55| 55| | 56| 56| AddMock(SYSTEM_ENTITY, IID_PlayerManager, { | 57| 57| GetPlayerByID: function(id) { return playerEntity; }, | 58| |- GetNumPlayers: function() { return 2; }, | | 58|+ "GetNumPlayers": function() { return 2; }, | 59| 59| }); | 60| 60| | 61| 61| AddMock(playerEntity, IID_Player, { | | [NORMAL] ESLintBear (quote-props): | | Unquoted property 'IsAlly' found. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | 59| 59| }); | 60| 60| | 61| 61| AddMock(playerEntity, IID_Player, { | 62| |- IsAlly: function() { return false; }, | | 62|+ "IsAlly": function() { return false; }, | 63| 63| IsEnemy: function() { return true; }, | 64| 64| GetEnemies: function() { return []; }, | 65| 65| }); | | [NORMAL] ESLintBear (quote-props): | | Unquoted property 'IsEnemy' found. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | 60| 60| | 61| 61| AddMock(playerEntity, IID_Player, { | 62| 62| IsAlly: function() { return false; }, | 63| |- IsEnemy: function() { return true; }, | | 63|+ "IsEnemy": function() { return true; }, | 64| 64| GetEnemies: function() { return []; }, | 65| 65| }); | 66| 66| | | [NORMAL] ESLintBear (quote-props): | | Unquoted property 'GetEnemies' found. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | 61| 61| AddMock(playerEntity, IID_Player, { | 62| 62| IsAlly: function() { return false; }, | 63| 63| IsEnemy: function() { return true; }, | 64| |- GetEnemies: function() { return []; }, | | 64|+ "GetEnemies": function() { return []; }, | 65| 65| }); | 66| 66| | 67| 67| | | [NORMAL] ESLintBear (quote-props): | | Unquoted property 'GetClassesList' found. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | 68| 68| var unitAI = ConstructComponent(unit, "UnitAI", { "FormationController": "false", "DefaultStance": "aggressive" }); | 69| 69| | 70| 70| AddMock(unit, IID_Identity, { | 71| |- GetClassesList: function() { return []; }, | | 71|+ "GetClassesList": function() { return []; }, | 72| 72| }); | 73| 73| | 74| 74| AddMock(unit, IID_Ownership, { | | [NORMAL] ESLintBear (quote-props): | | Unquoted property 'GetOwner' found. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | 72| 72| }); | 73| 73| | 74| 74| AddMock(unit, IID_Ownership, { | 75| |- GetOwner: function() { return 1; }, | | 75|+ "GetOwner": function() { return 1; }, | 76| 76| }); | 77| 77| | 78| 78| AddMock(unit, IID_Position, { | | [NORMAL] ESLintBear (quote-props): | | Unquoted property 'GetTurretParent' found. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | 76| 76| }); | 77| 77| | 78| 78| AddMock(unit, IID_Position, { | 79| |- GetTurretParent: function() { return INVALID_ENTITY; }, | | 79|+ "GetTurretParent": function() { return INVALID_ENTITY; }, | 80| 80| GetPosition: function() { return new Vector3D(); }, | 81| 81| GetPosition2D: function() { return new Vector2D(); }, | 82| 82| GetRotation: function() { return { "y": 0 }; }, | | [NORMAL] ESLintBear (quote-props): | | Unquoted property 'GetPosition' found. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | 77| 77| | 78| 78| AddMock(unit, IID_Position, { | 79| 79| GetTurretParent: function() { return INVALID_ENTITY; }, | 80| |- GetPosition: function() { return new Vector3D(); }, | | 80|+ "GetPosition": function() { return new Vector3D(); }, | 81| 81| GetPosition2D: function() { return new Vector2D(); }, | 82| 82| GetRotation: function() { return { "y": 0 }; }, | 83| 83| IsInWorld: function() { return true; }, | | [NORMAL] ESLintBear (quote-props): | | Unquoted property 'GetPosition2D' found. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | 78| 78| AddMock(unit, IID_Position, { | 79| 79| GetTurretParent: function() { return INVALID_ENTITY; }, | 80| 80| GetPosition: function() { return new Vector3D(); }, | 81| |- GetPosition2D: function() { return new Vector2D(); }, | | 81|+ "GetPosition2D": function() { return new Vector2D(); }, | 82| 82| GetRotation: function() { return { "y": 0 }; }, | 83| 83| IsInWorld: function() { return true; }, | 84| 84| }); | | [NORMAL] ESLintBear (quote-props): | | Unquoted property 'GetRotation' found. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | 79| 79| GetTurretParent: function() { return INVALID_ENTITY; }, | 80| 80| GetPosition: function() { return new Vector3D(); }, | 81| 81| GetPosition2D: function() { return new Vector2D(); }, | 82| |- GetRotation: function() { return { "y": 0 }; }, | | 82|+ "GetRotation": function() { return { "y": 0 }; }, | 83| 83| IsInWorld: function() { return true; }, | 84| 84| }); | 85| 85| | | [NORMAL] ESLintBear (quote-props): | | Unquoted property 'IsInWorld' found. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | 80| 80| GetPosition: function() { return new Vector3D(); }, | 81| 81| GetPosition2D: function() { return new Vector2D(); }, | 82| 82| GetRotation: function() { return { "y": 0 }; }, | 83| |- IsInWorld: function() { return true; }, | | 83|+ "IsInWorld": function() { return true; }, | 84| 84| }); | 85| 85| | 86| 86| AddMock(unit, IID_UnitMotion, { | | [NORMAL] ESLintBear (quote-props): | | Unquoted property 'GetWalkSpeed' found. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | 84| 84| }); | 85| 85| | 86| 86| AddMock(unit, IID_UnitMotion, { | 87| |- GetWalkSpeed: function() { return 1; }, | | 87|+ "GetWalkSpeed": function() { return 1; }, | 88| 88| MoveToFormationOffset: function(target, x, z) { }, | 89| 89| IsInTargetRange: function(target, min, max) { return true; }, | 90| 90| MoveToTargetRange: function(target, min, max) { }, | | [NORMAL] ESLintBear (quote-props): | | Unquoted property 'MoveToFormationOffset' found. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | 85| 85| | 86| 86| AddMock(unit, IID_UnitMotion, { | 87| 87| GetWalkSpeed: function() { return 1; }, | 88| |- MoveToFormationOffset: function(target, x, z) { }, | | 88|+ "MoveToFormationOffset": function(target, x, z) { }, | 89| 89| IsInTargetRange: function(target, min, max) { return true; }, | 90| 90| MoveToTargetRange: function(target, min, max) { }, | 91| 91| StopMoving: function() { }, | | [NORMAL] ESLintBear (quote-props): | | Unquoted property 'IsInTargetRange' found. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | 86| 86| AddMock(unit, IID_UnitMotion, { | 87| 87| GetWalkSpeed: function() { return 1; }, | 88| 88| MoveToFormationOffset: function(target, x, z) { }, | 89| |- IsInTargetRange: function(target, min, max) { return true; }, | | 89|+ "IsInTargetRange": function(target, min, max) { return true; }, | 90| 90| MoveToTargetRange: function(target, min, max) { }, | 91| 91| StopMoving: function() { }, | 92| 92| GetPassabilityClassName: function() { return "default"; }, | | [NORMAL] ESLintBear (quote-props): | | Unquoted property 'MoveToTargetRange' found. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | 87| 87| GetWalkSpeed: function() { return 1; }, | 88| 88| MoveToFormationOffset: function(target, x, z) { }, | 89| 89| IsInTargetRange: function(target, min, max) { return true; }, | 90| |- MoveToTargetRange: function(target, min, max) { }, | | 90|+ "MoveToTargetRange": function(target, min, max) { }, | 91| 91| StopMoving: function() { }, | 92| 92| GetPassabilityClassName: function() { return "default"; }, | 93| 93| }); | | [NORMAL] ESLintBear (quote-props): | | Unquoted property 'StopMoving' found. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | 88| 88| MoveToFormationOffset: function(target, x, z) { }, | 89| 89| IsInTargetRange: function(target, min, max) { return true; }, | 90| 90| MoveToTargetRange: function(target, min, max) { }, | 91| |- StopMoving: function() { }, | | 91|+ "StopMoving": function() { }, | 92| 92| GetPassabilityClassName: function() { return "default"; }, | 93| 93| }); | 94| 94| | | [NORMAL] ESLintBear (quote-props): | | Unquoted property 'GetPassabilityClassName' found. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | 89| 89| IsInTargetRange: function(target, min, max) { return true; }, | 90| 90| MoveToTargetRange: function(target, min, max) { }, | 91| 91| StopMoving: function() { }, | 92| |- GetPassabilityClassName: function() { return "default"; }, | | 92|+ "GetPassabilityClassName": function() { return "default"; }, | 93| 93| }); | 94| 94| | 95| 95| AddMock(unit, IID_Vision, { | | [NORMAL] ESLintBear (quote-props): | | Unquoted property 'GetRange' found. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | 93| 93| }); | 94| 94| | 95| 95| AddMock(unit, IID_Vision, { | 96| |- GetRange: function() { return 10; }, | | 96|+ "GetRange": function() { return 10; }, | 97| 97| }); | 98| 98| | 99| 99| AddMock(unit, IID_Attack, { | | [NORMAL] ESLintBear (quote-props): | | Unquoted property 'GetRange' found. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | 97| 97| }); | 98| 98| | 99| 99| AddMock(unit, IID_Attack, { | 100| |- GetRange: function() { return { "max": 10, "min": 0}; }, | | 100|+ "GetRange": function() { return { "max": 10, "min": 0}; }, | 101| 101| GetFullAttackRange: function() { return { "max": 40, "min": 0}; }, | 102| 102| GetBestAttackAgainst: function(t) { return "melee"; }, | 103| 103| GetPreference: function(t) { return 0; }, | | [NORMAL] ESLintBear (object-curly-spacing): | | A space is required before '}'. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | 97| 97| }); | 98| 98| | 99| 99| AddMock(unit, IID_Attack, { | 100| |- GetRange: function() { return { "max": 10, "min": 0}; }, | | 100|+ GetRange: function() { return { "max": 10, "min": 0 }; }, | 101| 101| GetFullAttackRange: function() { return { "max": 40, "min": 0}; }, | 102| 102| GetBestAttackAgainst: function(t) { return "melee"; }, | 103| 103| GetPreference: function(t) { return 0; }, | | [NORMAL] ESLintBear (quote-props): | | Unquoted property 'GetFullAttackRange' found. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | 98| 98| | 99| 99| AddMock(unit, IID_Attack, { | 100| 100| GetRange: function() { return { "max": 10, "min": 0}; }, | 101| |- GetFullAttackRange: function() { return { "max": 40, "min": 0}; }, | | 101|+ "GetFullAttackRange": function() { return { "max": 40, "min": 0}; }, | 102| 102| GetBestAttackAgainst: function(t) { return "melee"; }, | 103| 103| GetPreference: function(t) { return 0; }, | 104| 104| GetTimers: function() { return { "prepare": 500, "repeat": 1000 }; }, | | [NORMAL] ESLintBear (object-curly-spacing): | | A space is required before '}'. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | 98| 98| | 99| 99| AddMock(unit, IID_Attack, { | 100| 100| GetRange: function() { return { "max": 10, "min": 0}; }, | 101| |- GetFullAttackRange: function() { return { "max": 40, "min": 0}; }, | | 101|+ GetFullAttackRange: function() { return { "max": 40, "min": 0 }; }, | 102| 102| GetBestAttackAgainst: function(t) { return "melee"; }, | 103| 103| GetPreference: function(t) { return 0; }, | 104| 104| GetTimers: function() { return { "prepare": 500, "repeat": 1000 }; }, | | [NORMAL] ESLintBear (quote-props): | | Unquoted property 'GetBestAttackAgainst' found. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | 99| 99| AddMock(unit, IID_Attack, { | 100| 100| GetRange: function() { return { "max": 10, "min": 0}; }, | 101| 101| GetFullAttackRange: function() { return { "max": 40, "min": 0}; }, | 102| |- GetBestAttackAgainst: function(t) { return "melee"; }, | | 102|+ "GetBestAttackAgainst": function(t) { return "melee"; }, | 103| 103| GetPreference: function(t) { return 0; }, | 104| 104| GetTimers: function() { return { "prepare": 500, "repeat": 1000 }; }, | 105| 105| CanAttack: function(v) { return true; }, | | [NORMAL] ESLintBear (quote-props): | | Unquoted property 'GetPreference' found. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | 100| 100| GetRange: function() { return { "max": 10, "min": 0}; }, | 101| 101| GetFullAttackRange: function() { return { "max": 40, "min": 0}; }, | 102| 102| GetBestAttackAgainst: function(t) { return "melee"; }, | 103| |- GetPreference: function(t) { return 0; }, | | 103|+ "GetPreference": function(t) { return 0; }, | 104| 104| GetTimers: function() { return { "prepare": 500, "repeat": 1000 }; }, | 105| 105| CanAttack: function(v) { return true; }, | 106| 106| CompareEntitiesByPreference: function(a, b) { return 0; }, | | [NORMAL] ESLintBear (quote-props): | | Unquoted property 'GetTimers' found. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | 101| 101| GetFullAttackRange: function() { return { "max": 40, "min": 0}; }, | 102| 102| GetBestAttackAgainst: function(t) { return "melee"; }, | 103| 103| GetPreference: function(t) { return 0; }, | 104| |- GetTimers: function() { return { "prepare": 500, "repeat": 1000 }; }, | | 104|+ "GetTimers": function() { return { "prepare": 500, "repeat": 1000 }; }, | 105| 105| CanAttack: function(v) { return true; }, | 106| 106| CompareEntitiesByPreference: function(a, b) { return 0; }, | 107| 107| }); | | [NORMAL] ESLintBear (quote-props): | | Unquoted property 'CanAttack' found. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | 102| 102| GetBestAttackAgainst: function(t) { return "melee"; }, | 103| 103| GetPreference: function(t) { return 0; }, | 104| 104| GetTimers: function() { return { "prepare": 500, "repeat": 1000 }; }, | 105| |- CanAttack: function(v) { return true; }, | | 105|+ "CanAttack": function(v) { return true; }, | 106| 106| CompareEntitiesByPreference: function(a, b) { return 0; }, | 107| 107| }); | 108| 108| | | [NORMAL] ESLintBear (quote-props): | | Unquoted property 'CompareEntitiesByPreference' found. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | 103| 103| GetPreference: function(t) { return 0; }, | 104| 104| GetTimers: function() { return { "prepare": 500, "repeat": 1000 }; }, | 105| 105| CanAttack: function(v) { return true; }, | 106| |- CompareEntitiesByPreference: function(a, b) { return 0; }, | | 106|+ "CompareEntitiesByPreference": function(a, b) { return 0; }, | 107| 107| }); | 108| 108| | 109| 109| unitAI.OnCreate(); | | [NORMAL] ESLintBear (quote-props): | | Unquoted property 'GetHitpoints' found. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | 114| 114| if (mode == 1) | 115| 115| { | 116| 116| AddMock(enemy, IID_Health, { | 117| |- GetHitpoints: function() { return 10; }, | | 117|+ "GetHitpoints": function() { return 10; }, | 118| 118| }); | 119| 119| AddMock(enemy, IID_UnitAI, { | 120| 120| IsAnimal: function() { return false; } | | [NORMAL] ESLintBear (quote-props): | | Unquoted property 'IsAnimal' found. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | 117| 117| GetHitpoints: function() { return 10; }, | 118| 118| }); | 119| 119| AddMock(enemy, IID_UnitAI, { | 120| |- IsAnimal: function() { return false; } | | 120|+ "IsAnimal": function() { return false; } | 121| 121| }); | 122| 122| } | 123| 123| else if (mode == 2) | | [NORMAL] ESLintBear (quote-props): | | Unquoted property 'GetHitpoints' found. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | 122| 122| } | 123| 123| else if (mode == 2) | 124| 124| AddMock(enemy, IID_Health, { | 125| |- GetHitpoints: function() { return 0; }, | | 125|+ "GetHitpoints": function() { return 0; }, | 126| 126| }); | 127| 127| | 128| 128| var controllerFormation = ConstructComponent(controller, "Formation", {"FormationName": "Line Closed", "FormationShape": "square", "ShiftRows": "false", "SortingClasses": "", "WidthDepthRatio": 1, "UnitSeparationWidthMultiplier": 1, "UnitSeparationDepthMultiplier": 1, "SpeedMultiplier": 1, "Sloppyness": 0}); | | [NORMAL] ESLintBear (object-curly-spacing): | | A space is required after '{'. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | 125| 125| GetHitpoints: function() { return 0; }, | 126| 126| }); | 127| 127| | 128| |- var controllerFormation = ConstructComponent(controller, "Formation", {"FormationName": "Line Closed", "FormationShape": "square", "ShiftRows": "false", "SortingClasses": "", "WidthDepthRatio": 1, "UnitSeparationWidthMultiplier": 1, "UnitSeparationDepthMultiplier": 1, "SpeedMultiplier": 1, "Sloppyness": 0}); | | 128|+ var controllerFormation = ConstructComponent(controller, "Formation", { "FormationName": "Line Closed", "FormationShape": "square", "ShiftRows": "false", "SortingClasses": "", "WidthDepthRatio": 1, "UnitSeparationWidthMultiplier": 1, "UnitSeparationDepthMultiplier": 1, "SpeedMultiplier": 1, "Sloppyness": 0}); | 129| 129| var controllerAI = ConstructComponent(controller, "UnitAI", { "FormationController": "true", "DefaultStance": "aggressive" }); | 130| 130| | 131| 131| AddMock(controller, IID_Position, { | | [NORMAL] ESLintBear (object-curly-spacing): | | A space is required before '}'. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | 125| 125| GetHitpoints: function() { return 0; }, | 126| 126| }); | 127| 127| | 128| |- var controllerFormation = ConstructComponent(controller, "Formation", {"FormationName": "Line Closed", "FormationShape": "square", "ShiftRows": "false", "SortingClasses": "", "WidthDepthRatio": 1, "UnitSeparationWidthMultiplier": 1, "UnitSeparationDepthMultiplier": 1, "SpeedMultiplier": 1, "Sloppyness": 0}); | | 128|+ var controllerFormation = ConstructComponent(controller, "Formation", {"FormationName": "Line Closed", "FormationShape": "square", "ShiftRows": "false", "SortingClasses": "", "WidthDepthRatio": 1, "UnitSeparationWidthMultiplier": 1, "UnitSeparationDepthMultiplier": 1, "SpeedMultiplier": 1, "Sloppyness": 0 }); | 129| 129| var controllerAI = ConstructComponent(controller, "UnitAI", { "FormationController": "true", "DefaultStance": "aggressive" }); | 130| 130| | 131| 131| AddMock(controller, IID_Position, { | | [NORMAL] ESLintBear (quote-props): | | Unquoted property 'JumpTo' found. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | 129| 129| var controllerAI = ConstructComponent(controller, "UnitAI", { "FormationController": "true", "DefaultStance": "aggressive" }); | 130| 130| | 131| 131| AddMock(controller, IID_Position, { | 132| |- JumpTo: function(x, z) { this.x = x; this.z = z; }, | | 132|+ "JumpTo": function(x, z) { this.x = x; this.z = z; }, | 133| 133| GetTurretParent: function() { return INVALID_ENTITY; }, | 134| 134| GetPosition: function() { return new Vector3D(this.x, 0, this.z); }, | 135| 135| GetPosition2D: function() { return new Vector2D(this.x, this.z); }, | | [NORMAL] ESLintBear (quote-props): | | Unquoted property 'GetTurretParent' found. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | 130| 130| | 131| 131| AddMock(controller, IID_Position, { | 132| 132| JumpTo: function(x, z) { this.x = x; this.z = z; }, | 133| |- GetTurretParent: function() { return INVALID_ENTITY; }, | | 133|+ "GetTurretParent": function() { return INVALID_ENTITY; }, | 134| 134| GetPosition: function() { return new Vector3D(this.x, 0, this.z); }, | 135| 135| GetPosition2D: function() { return new Vector2D(this.x, this.z); }, | 136| 136| GetRotation: function() { return { "y": 0 }; }, | | [NORMAL] ESLintBear (quote-props): | | Unquoted property 'GetPosition' found. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | 131| 131| AddMock(controller, IID_Position, { | 132| 132| JumpTo: function(x, z) { this.x = x; this.z = z; }, | 133| 133| GetTurretParent: function() { return INVALID_ENTITY; }, | 134| |- GetPosition: function() { return new Vector3D(this.x, 0, this.z); }, | | 134|+ "GetPosition": function() { return new Vector3D(this.x, 0, this.z); }, | 135| 135| GetPosition2D: function() { return new Vector2D(this.x, this.z); }, | 136| 136| GetRotation: function() { return { "y": 0 }; }, | 137| 137| IsInWorld: function() { return true; }, | | [NORMAL] ESLintBear (quote-props): | | Unquoted property 'GetPosition2D' found. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | 132| 132| JumpTo: function(x, z) { this.x = x; this.z = z; }, | 133| 133| GetTurretParent: function() { return INVALID_ENTITY; }, | 134| 134| GetPosition: function() { return new Vector3D(this.x, 0, this.z); }, | 135| |- GetPosition2D: function() { return new Vector2D(this.x, this.z); }, | | 135|+ "GetPosition2D": function() { return new Vector2D(this.x, this.z); }, | 136| 136| GetRotation: function() { return { "y": 0 }; }, | 137| 137| IsInWorld: function() { return true; }, | 138| 138| }); | | [NORMAL] ESLintBear (quote-props): | | Unquoted property 'GetRotation' found. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | 133| 133| GetTurretParent: function() { return INVALID_ENTITY; }, | 134| 134| GetPosition: function() { return new Vector3D(this.x, 0, this.z); }, | 135| 135| GetPosition2D: function() { return new Vector2D(this.x, this.z); }, | 136| |- GetRotation: function() { return { "y": 0 }; }, | | 136|+ "GetRotation": function() { return { "y": 0 }; }, | 137| 137| IsInWorld: function() { return true; }, | 138| 138| }); | 139| 139| | | [NORMAL] ESLintBear (quote-props): | | Unquoted property 'IsInWorld' found. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | 134| 134| GetPosition: function() { return new Vector3D(this.x, 0, this.z); }, | 135| 135| GetPosition2D: function() { return new Vector2D(this.x, this.z); }, | 136| 136| GetRotation: function() { return { "y": 0 }; }, | 137| |- IsInWorld: function() { return true; }, | | 137|+ "IsInWorld": function() { return true; }, | 138| 138| }); | 139| 139| | 140| 140| AddMock(controller, IID_UnitMotion, { | | [NORMAL] ESLintBear (quote-props): | | Unquoted property 'SetSpeed' found. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | 138| 138| }); | 139| 139| | 140| 140| AddMock(controller, IID_UnitMotion, { | 141| |- SetSpeed: function(speed) { }, | | 141|+ "SetSpeed": function(speed) { }, | 142| 142| MoveToPointRange: function(x, z, minRange, maxRange) { }, | 143| 143| GetPassabilityClassName: function() { return "default"; }, | 144| 144| }); | | [NORMAL] ESLintBear (quote-props): | | Unquoted property 'MoveToPointRange' found. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | 139| 139| | 140| 140| AddMock(controller, IID_UnitMotion, { | 141| 141| SetSpeed: function(speed) { }, | 142| |- MoveToPointRange: function(x, z, minRange, maxRange) { }, | | 142|+ "MoveToPointRange": function(x, z, minRange, maxRange) { }, | 143| 143| GetPassabilityClassName: function() { return "default"; }, | 144| 144| }); | 145| 145| | | [NORMAL] ESLintBear (quote-props): | | Unquoted property 'GetPassabilityClassName' found. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | 140| 140| AddMock(controller, IID_UnitMotion, { | 141| 141| SetSpeed: function(speed) { }, | 142| 142| MoveToPointRange: function(x, z, minRange, maxRange) { }, | 143| |- GetPassabilityClassName: function() { return "default"; }, | | 143|+ "GetPassabilityClassName": function() { return "default"; }, | 144| 144| }); | 145| 145| | 146| 146| controllerAI.OnCreate(); | | [NORMAL] ESLintBear (quote-props): | | Unquoted property 'SetInterval' found. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | 181| 181| var unitAIs = []; | 182| 182| | 183| 183| AddMock(SYSTEM_ENTITY, IID_Timer, { | 184| |- SetInterval: function() { }, | | 184|+ "SetInterval": function() { }, | 185| 185| SetTimeout: function() { }, | 186| 186| }); | 187| 187| | | [NORMAL] ESLintBear (quote-props): | | Unquoted property 'SetTimeout' found. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | 182| 182| | 183| 183| AddMock(SYSTEM_ENTITY, IID_Timer, { | 184| 184| SetInterval: function() { }, | 185| |- SetTimeout: function() { }, | | 185|+ "SetTimeout": function() { }, | 186| 186| }); | 187| 187| | 188| 188| | | [NORMAL] ESLintBear (quote-props): | | Unquoted property 'CreateActiveQuery' found. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | 187| 187| | 188| 188| | 189| 189| AddMock(SYSTEM_ENTITY, IID_RangeManager, { | 190| |- CreateActiveQuery: function(ent, minRange, maxRange, players, iid, flags) { | | 190|+ "CreateActiveQuery": function(ent, minRange, maxRange, players, iid, flags) { | 191| 191| return 1; | 192| 192| }, | 193| 193| EnableActiveQuery: function(id) { }, | | [NORMAL] ESLintBear (quote-props): | | Unquoted property 'EnableActiveQuery' found. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | 190| 190| CreateActiveQuery: function(ent, minRange, maxRange, players, iid, flags) { | 191| 191| return 1; | 192| 192| }, | 193| |- EnableActiveQuery: function(id) { }, | | 193|+ "EnableActiveQuery": function(id) { }, | 194| 194| ResetActiveQuery: function(id) { return [enemy]; }, | 195| 195| DisableActiveQuery: function(id) { }, | 196| 196| GetEntityFlagMask: function(identifier) { }, | | [NORMAL] ESLintBear (quote-props): | | Unquoted property 'ResetActiveQuery' found. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | 191| 191| return 1; | 192| 192| }, | 193| 193| EnableActiveQuery: function(id) { }, | 194| |- ResetActiveQuery: function(id) { return [enemy]; }, | | 194|+ "ResetActiveQuery": function(id) { return [enemy]; }, | 195| 195| DisableActiveQuery: function(id) { }, | 196| 196| GetEntityFlagMask: function(identifier) { }, | 197| 197| }); | | [NORMAL] ESLintBear (quote-props): | | Unquoted property 'DisableActiveQuery' found. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | 192| 192| }, | 193| 193| EnableActiveQuery: function(id) { }, | 194| 194| ResetActiveQuery: function(id) { return [enemy]; }, | 195| |- DisableActiveQuery: function(id) { }, | | 195|+ "DisableActiveQuery": function(id) { }, | 196| 196| GetEntityFlagMask: function(identifier) { }, | 197| 197| }); | 198| 198| | | [NORMAL] ESLintBear (quote-props): | | Unquoted property 'GetEntityFlagMask' found. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | 193| 193| EnableActiveQuery: function(id) { }, | 194| 194| ResetActiveQuery: function(id) { return [enemy]; }, | 195| 195| DisableActiveQuery: function(id) { }, | 196| |- GetEntityFlagMask: function(identifier) { }, | | 196|+ "GetEntityFlagMask": function(identifier) { }, | 197| 197| }); | 198| 198| | 199| 199| AddMock(SYSTEM_ENTITY, IID_TemplateManager, { | | [NORMAL] ESLintBear (quote-props): | | Unquoted property 'GetCurrentTemplateName' found. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | 197| 197| }); | 198| 198| | 199| 199| AddMock(SYSTEM_ENTITY, IID_TemplateManager, { | 200| |- GetCurrentTemplateName: function(ent) { return "special/formations/line_closed"; }, | | 200|+ "GetCurrentTemplateName": function(ent) { return "special/formations/line_closed"; }, | 201| 201| }); | 202| 202| | 203| 203| AddMock(SYSTEM_ENTITY, IID_PlayerManager, { | | [NORMAL] ESLintBear (quote-props): | | Unquoted property 'GetPlayerByID' found. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | 201| 201| }); | 202| 202| | 203| 203| AddMock(SYSTEM_ENTITY, IID_PlayerManager, { | 204| |- GetPlayerByID: function(id) { return playerEntity; }, | | 204|+ "GetPlayerByID": function(id) { return playerEntity; }, | 205| 205| GetNumPlayers: function() { return 2; }, | 206| 206| }); | 207| 207| | | [NORMAL] ESLintBear (quote-props): | | Unquoted property 'GetNumPlayers' found. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | 202| 202| | 203| 203| AddMock(SYSTEM_ENTITY, IID_PlayerManager, { | 204| 204| GetPlayerByID: function(id) { return playerEntity; }, | 205| |- GetNumPlayers: function() { return 2; }, | | 205|+ "GetNumPlayers": function() { return 2; }, | 206| 206| }); | 207| 207| | 208| 208| AddMock(playerEntity, IID_Player, { | | [NORMAL] ESLintBear (quote-props): | | Unquoted property 'IsAlly' found. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | 206| 206| }); | 207| 207| | 208| 208| AddMock(playerEntity, IID_Player, { | 209| |- IsAlly: function() { return false; }, | | 209|+ "IsAlly": function() { return false; }, | 210| 210| IsEnemy: function() { return true; }, | 211| 211| GetEnemies: function() { return []; }, | 212| 212| }); | | [NORMAL] ESLintBear (quote-props): | | Unquoted property 'IsEnemy' found. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | 207| 207| | 208| 208| AddMock(playerEntity, IID_Player, { | 209| 209| IsAlly: function() { return false; }, | 210| |- IsEnemy: function() { return true; }, | | 210|+ "IsEnemy": function() { return true; }, | 211| 211| GetEnemies: function() { return []; }, | 212| 212| }); | 213| 213| | | [NORMAL] ESLintBear (quote-props): | | Unquoted property 'GetEnemies' found. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | 208| 208| AddMock(playerEntity, IID_Player, { | 209| 209| IsAlly: function() { return false; }, | 210| 210| IsEnemy: function() { return true; }, | 211| |- GetEnemies: function() { return []; }, | | 211|+ "GetEnemies": function() { return []; }, | 212| 212| }); | 213| 213| | 214| 214| // create units | | [NORMAL] ESLintBear (quote-props): | | Unquoted property 'GetClassesList' found. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | 219| 219| var unitAI = ConstructComponent(unit + i, "UnitAI", { "FormationController": "false", "DefaultStance": "aggressive" }); | 220| 220| | 221| 221| AddMock(unit + i, IID_Identity, { | 222| |- GetClassesList: function() { return []; }, | | 222|+ "GetClassesList": function() { return []; }, | 223| 223| }); | 224| 224| | 225| 225| AddMock(unit + i, IID_Ownership, { | | [NORMAL] ESLintBear (quote-props): | | Unquoted property 'GetOwner' found. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | 223| 223| }); | 224| 224| | 225| 225| AddMock(unit + i, IID_Ownership, { | 226| |- GetOwner: function() { return 1; }, | | 226|+ "GetOwner": function() { return 1; }, | 227| 227| }); | 228| 228| | 229| 229| AddMock(unit + i, IID_Position, { | | [NORMAL] ESLintBear (quote-props): | | Unquoted property 'GetTurretParent' found. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | 227| 227| }); | 228| 228| | 229| 229| AddMock(unit + i, IID_Position, { | 230| |- GetTurretParent: function() { return INVALID_ENTITY; }, | | 230|+ "GetTurretParent": function() { return INVALID_ENTITY; }, | 231| 231| GetPosition: function() { return new Vector3D(); }, | 232| 232| GetPosition2D: function() { return new Vector2D(); }, | 233| 233| GetRotation: function() { return { "y": 0 }; }, | | [NORMAL] ESLintBear (quote-props): | | Unquoted property 'GetPosition' found. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | 228| 228| | 229| 229| AddMock(unit + i, IID_Position, { | 230| 230| GetTurretParent: function() { return INVALID_ENTITY; }, | 231| |- GetPosition: function() { return new Vector3D(); }, | | 231|+ "GetPosition": function() { return new Vector3D(); }, | 232| 232| GetPosition2D: function() { return new Vector2D(); }, | 233| 233| GetRotation: function() { return { "y": 0 }; }, | 234| 234| IsInWorld: function() { return true; }, | | [NORMAL] ESLintBear (quote-props): | | Unquoted property 'GetPosition2D' found. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | 229| 229| AddMock(unit + i, IID_Position, { | 230| 230| GetTurretParent: function() { return INVALID_ENTITY; }, | 231| 231| GetPosition: function() { return new Vector3D(); }, | 232| |- GetPosition2D: function() { return new Vector2D(); }, | | 232|+ "GetPosition2D": function() { return new Vector2D(); }, | 233| 233| GetRotation: function() { return { "y": 0 }; }, | 234| 234| IsInWorld: function() { return true; }, | 235| 235| }); | | [NORMAL] ESLintBear (quote-props): | | Unquoted property 'GetRotation' found. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | 230| 230| GetTurretParent: function() { return INVALID_ENTITY; }, | 231| 231| GetPosition: function() { return new Vector3D(); }, | 232| 232| GetPosition2D: function() { return new Vector2D(); }, | 233| |- GetRotation: function() { return { "y": 0 }; }, | | 233|+ "GetRotation": function() { return { "y": 0 }; }, | 234| 234| IsInWorld: function() { return true; }, | 235| 235| }); | 236| 236| | | [NORMAL] ESLintBear (quote-props): | | Unquoted property 'IsInWorld' found. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | 231| 231| GetPosition: function() { return new Vector3D(); }, | 232| 232| GetPosition2D: function() { return new Vector2D(); }, | 233| 233| GetRotation: function() { return { "y": 0 }; }, | 234| |- IsInWorld: function() { return true; }, | | 234|+ "IsInWorld": function() { return true; }, | 235| 235| }); | 236| 236| | 237| 237| AddMock(unit + i, IID_UnitMotion, { | | [NORMAL] ESLintBear (quote-props): | | Unquoted property 'GetWalkSpeed' found. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | 235| 235| }); | 236| 236| | 237| 237| AddMock(unit + i, IID_UnitMotion, { | 238| |- GetWalkSpeed: function() { return 1; }, | | 238|+ "GetWalkSpeed": function() { return 1; }, | 239| 239| MoveToFormationOffset: function(target, x, z) { }, | 240| 240| IsInTargetRange: function(target, min, max) { return true; }, | 241| 241| MoveToTargetRange: function(target, min, max) { }, | | [NORMAL] ESLintBear (quote-props): | | Unquoted property 'MoveToFormationOffset' found. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | 236| 236| | 237| 237| AddMock(unit + i, IID_UnitMotion, { | 238| 238| GetWalkSpeed: function() { return 1; }, | 239| |- MoveToFormationOffset: function(target, x, z) { }, | | 239|+ "MoveToFormationOffset": function(target, x, z) { }, | 240| 240| IsInTargetRange: function(target, min, max) { return true; }, | 241| 241| MoveToTargetRange: function(target, min, max) { }, | 242| 242| StopMoving: function() { }, | | [NORMAL] ESLintBear (quote-props): | | Unquoted property 'IsInTargetRange' found. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | 237| 237| AddMock(unit + i, IID_UnitMotion, { | 238| 238| GetWalkSpeed: function() { return 1; }, | 239| 239| MoveToFormationOffset: function(target, x, z) { }, | 240| |- IsInTargetRange: function(target, min, max) { return true; }, | | 240|+ "IsInTargetRange": function(target, min, max) { return true; }, | 241| 241| MoveToTargetRange: function(target, min, max) { }, | 242| 242| StopMoving: function() { }, | 243| 243| GetPassabilityClassName: function() { return "default"; }, | | [NORMAL] ESLintBear (quote-props): | | Unquoted property 'MoveToTargetRange' found. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | 238| 238| GetWalkSpeed: function() { return 1; }, | 239| 239| MoveToFormationOffset: function(target, x, z) { }, | 240| 240| IsInTargetRange: function(target, min, max) { return true; }, | 241| |- MoveToTargetRange: function(target, min, max) { }, | | 241|+ "MoveToTargetRange": function(target, min, max) { }, | 242| 242| StopMoving: function() { }, | 243| 243| GetPassabilityClassName: function() { return "default"; }, | 244| 244| }); | | [NORMAL] ESLintBear (quote-props): | | Unquoted property 'StopMoving' found. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | 239| 239| MoveToFormationOffset: function(target, x, z) { }, | 240| 240| IsInTargetRange: function(target, min, max) { return true; }, | 241| 241| MoveToTargetRange: function(target, min, max) { }, | 242| |- StopMoving: function() { }, | | 242|+ "StopMoving": function() { }, | 243| 243| GetPassabilityClassName: function() { return "default"; }, | 244| 244| }); | 245| 245| | | [NORMAL] ESLintBear (quote-props): | | Unquoted property 'GetPassabilityClassName' found. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | 240| 240| IsInTargetRange: function(target, min, max) { return true; }, | 241| 241| MoveToTargetRange: function(target, min, max) { }, | 242| 242| StopMoving: function() { }, | 243| |- GetPassabilityClassName: function() { return "default"; }, | | 243|+ "GetPassabilityClassName": function() { return "default"; }, | 244| 244| }); | 245| 245| | 246| 246| AddMock(unit + i, IID_Vision, { | | [NORMAL] ESLintBear (quote-props): | | Unquoted property 'GetRange' found. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | 244| 244| }); | 245| 245| | 246| 246| AddMock(unit + i, IID_Vision, { | 247| |- GetRange: function() { return 10; }, | | 247|+ "GetRange": function() { return 10; }, | 248| 248| }); | 249| 249| | 250| 250| AddMock(unit + i, IID_Attack, { | | [NORMAL] ESLintBear (quote-props): | | Unquoted property 'GetRange' found. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | 248| 248| }); | 249| 249| | 250| 250| AddMock(unit + i, IID_Attack, { | 251| |- GetRange: function() { return {"max":10, "min": 0}; }, | | 251|+ "GetRange": function() { return {"max":10, "min": 0}; }, | 252| 252| GetFullAttackRange: function() { return { "max": 40, "min": 0}; }, | 253| 253| GetBestAttackAgainst: function(t) { return "melee"; }, | 254| 254| GetTimers: function() { return { "prepare": 500, "repeat": 1000 }; }, | | [NORMAL] ESLintBear (object-curly-spacing): | | A space is required after '{'. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | 248| 248| }); | 249| 249| | 250| 250| AddMock(unit + i, IID_Attack, { | 251| |- GetRange: function() { return {"max":10, "min": 0}; }, | | 251|+ GetRange: function() { return { "max":10, "min": 0}; }, | 252| 252| GetFullAttackRange: function() { return { "max": 40, "min": 0}; }, | 253| 253| GetBestAttackAgainst: function(t) { return "melee"; }, | 254| 254| GetTimers: function() { return { "prepare": 500, "repeat": 1000 }; }, | | [NORMAL] ESLintBear (key-spacing): | | Missing space before value for key 'max'. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | 248| 248| }); | 249| 249| | 250| 250| AddMock(unit + i, IID_Attack, { | 251| |- GetRange: function() { return {"max":10, "min": 0}; }, | | 251|+ GetRange: function() { return {"max": 10, "min": 0}; }, | 252| 252| GetFullAttackRange: function() { return { "max": 40, "min": 0}; }, | 253| 253| GetBestAttackAgainst: function(t) { return "melee"; }, | 254| 254| GetTimers: function() { return { "prepare": 500, "repeat": 1000 }; }, | | [NORMAL] ESLintBear (object-curly-spacing): | | A space is required before '}'. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | 248| 248| }); | 249| 249| | 250| 250| AddMock(unit + i, IID_Attack, { | 251| |- GetRange: function() { return {"max":10, "min": 0}; }, | | 251|+ GetRange: function() { return {"max":10, "min": 0 }; }, | 252| 252| GetFullAttackRange: function() { return { "max": 40, "min": 0}; }, | 253| 253| GetBestAttackAgainst: function(t) { return "melee"; }, | 254| 254| GetTimers: function() { return { "prepare": 500, "repeat": 1000 }; }, | | [NORMAL] ESLintBear (quote-props): | | Unquoted property 'GetFullAttackRange' found. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | 249| 249| | 250| 250| AddMock(unit + i, IID_Attack, { | 251| 251| GetRange: function() { return {"max":10, "min": 0}; }, | 252| |- GetFullAttackRange: function() { return { "max": 40, "min": 0}; }, | | 252|+ "GetFullAttackRange": function() { return { "max": 40, "min": 0}; }, | 253| 253| GetBestAttackAgainst: function(t) { return "melee"; }, | 254| 254| GetTimers: function() { return { "prepare": 500, "repeat": 1000 }; }, | 255| 255| CanAttack: function(v) { return true; }, | | [NORMAL] ESLintBear (object-curly-spacing): | | A space is required before '}'. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | 249| 249| | 250| 250| AddMock(unit + i, IID_Attack, { | 251| 251| GetRange: function() { return {"max":10, "min": 0}; }, | 252| |- GetFullAttackRange: function() { return { "max": 40, "min": 0}; }, | | 252|+ GetFullAttackRange: function() { return { "max": 40, "min": 0 }; }, | 253| 253| GetBestAttackAgainst: function(t) { return "melee"; }, | 254| 254| GetTimers: function() { return { "prepare": 500, "repeat": 1000 }; }, | 255| 255| CanAttack: function(v) { return true; }, | | [NORMAL] ESLintBear (quote-props): | | Unquoted property 'GetBestAttackAgainst' found. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | 250| 250| AddMock(unit + i, IID_Attack, { | 251| 251| GetRange: function() { return {"max":10, "min": 0}; }, | 252| 252| GetFullAttackRange: function() { return { "max": 40, "min": 0}; }, | 253| |- GetBestAttackAgainst: function(t) { return "melee"; }, | | 253|+ "GetBestAttackAgainst": function(t) { return "melee"; }, | 254| 254| GetTimers: function() { return { "prepare": 500, "repeat": 1000 }; }, | 255| 255| CanAttack: function(v) { return true; }, | 256| 256| CompareEntitiesByPreference: function(a, b) { return 0; }, | | [NORMAL] ESLintBear (quote-props): | | Unquoted property 'GetTimers' found. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | 251| 251| GetRange: function() { return {"max":10, "min": 0}; }, | 252| 252| GetFullAttackRange: function() { return { "max": 40, "min": 0}; }, | 253| 253| GetBestAttackAgainst: function(t) { return "melee"; }, | 254| |- GetTimers: function() { return { "prepare": 500, "repeat": 1000 }; }, | | 254|+ "GetTimers": function() { return { "prepare": 500, "repeat": 1000 }; }, | 255| 255| CanAttack: function(v) { return true; }, | 256| 256| CompareEntitiesByPreference: function(a, b) { return 0; }, | 257| 257| }); | | [NORMAL] ESLintBear (quote-props): | | Unquoted property 'CanAttack' found. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | 252| 252| GetFullAttackRange: function() { return { "max": 40, "min": 0}; }, | 253| 253| GetBestAttackAgainst: function(t) { return "melee"; }, | 254| 254| GetTimers: function() { return { "prepare": 500, "repeat": 1000 }; }, | 255| |- CanAttack: function(v) { return true; }, | | 255|+ "CanAttack": function(v) { return true; }, | 256| 256| CompareEntitiesByPreference: function(a, b) { return 0; }, | 257| 257| }); | 258| 258| | | [NORMAL] ESLintBear (quote-props): | | Unquoted property 'CompareEntitiesByPreference' found. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | 253| 253| GetBestAttackAgainst: function(t) { return "melee"; }, | 254| 254| GetTimers: function() { return { "prepare": 500, "repeat": 1000 }; }, | 255| 255| CanAttack: function(v) { return true; }, | 256| |- CompareEntitiesByPreference: function(a, b) { return 0; }, | | 256|+ "CompareEntitiesByPreference": function(a, b) { return 0; }, | 257| 257| }); | 258| 258| | 259| 259| unitAI.OnCreate(); | | [NORMAL] ESLintBear (quote-props): | | Unquoted property 'GetHitpoints' found. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | 265| 265| | 266| 266| // create enemy | 267| 267| AddMock(enemy, IID_Health, { | 268| |- GetHitpoints: function() { return 40; }, | | 268|+ "GetHitpoints": function() { return 40; }, | 269| 269| }); | 270| 270| | 271| 271| var controllerFormation = ConstructComponent(controller, "Formation", {"FormationName": "Line Closed", "FormationShape": "square", "ShiftRows": "false", "SortingClasses": "", "WidthDepthRatio": 1, "UnitSeparationWidthMultiplier": 1, "UnitSeparationDepthMultiplier": 1, "SpeedMultiplier": 1, "Sloppyness": 0}); | | [NORMAL] ESLintBear (object-curly-spacing): | | A space is required after '{'. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | 268| 268| GetHitpoints: function() { return 40; }, | 269| 269| }); | 270| 270| | 271| |- var controllerFormation = ConstructComponent(controller, "Formation", {"FormationName": "Line Closed", "FormationShape": "square", "ShiftRows": "false", "SortingClasses": "", "WidthDepthRatio": 1, "UnitSeparationWidthMultiplier": 1, "UnitSeparationDepthMultiplier": 1, "SpeedMultiplier": 1, "Sloppyness": 0}); | | 271|+ var controllerFormation = ConstructComponent(controller, "Formation", { "FormationName": "Line Closed", "FormationShape": "square", "ShiftRows": "false", "SortingClasses": "", "WidthDepthRatio": 1, "UnitSeparationWidthMultiplier": 1, "UnitSeparationDepthMultiplier": 1, "SpeedMultiplier": 1, "Sloppyness": 0}); | 272| 272| var controllerAI = ConstructComponent(controller, "UnitAI", { "FormationController": "true", "DefaultStance": "aggressive" }); | 273| 273| | 274| 274| AddMock(controller, IID_Position, { | | [NORMAL] ESLintBear (object-curly-spacing): | | A space is required before '}'. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | 268| 268| GetHitpoints: function() { return 40; }, | 269| 269| }); | 270| 270| | 271| |- var controllerFormation = ConstructComponent(controller, "Formation", {"FormationName": "Line Closed", "FormationShape": "square", "ShiftRows": "false", "SortingClasses": "", "WidthDepthRatio": 1, "UnitSeparationWidthMultiplier": 1, "UnitSeparationDepthMultiplier": 1, "SpeedMultiplier": 1, "Sloppyness": 0}); | | 271|+ var controllerFormation = ConstructComponent(controller, "Formation", {"FormationName": "Line Closed", "FormationShape": "square", "ShiftRows": "false", "SortingClasses": "", "WidthDepthRatio": 1, "UnitSeparationWidthMultiplier": 1, "UnitSeparationDepthMultiplier": 1, "SpeedMultiplier": 1, "Sloppyness": 0 }); | 272| 272| var controllerAI = ConstructComponent(controller, "UnitAI", { "FormationController": "true", "DefaultStance": "aggressive" }); | 273| 273| | 274| 274| AddMock(controller, IID_Position, { | | [NORMAL] ESLintBear (quote-props): | | Unquoted property 'GetTurretParent' found. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | 272| 272| var controllerAI = ConstructComponent(controller, "UnitAI", { "FormationController": "true", "DefaultStance": "aggressive" }); | 273| 273| | 274| 274| AddMock(controller, IID_Position, { | 275| |- GetTurretParent: function() { return INVALID_ENTITY; }, | | 275|+ "GetTurretParent": function() { return INVALID_ENTITY; }, | 276| 276| JumpTo: function(x, z) { this.x = x; this.z = z; }, | 277| 277| GetPosition: function() { return new Vector3D(this.x, 0, this.z); }, | 278| 278| GetPosition2D: function() { return new Vector2D(this.x, this.z); }, | | [NORMAL] ESLintBear (quote-props): | | Unquoted property 'JumpTo' found. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | 273| 273| | 274| 274| AddMock(controller, IID_Position, { | 275| 275| GetTurretParent: function() { return INVALID_ENTITY; }, | 276| |- JumpTo: function(x, z) { this.x = x; this.z = z; }, | | 276|+ "JumpTo": function(x, z) { this.x = x; this.z = z; }, | 277| 277| GetPosition: function() { return new Vector3D(this.x, 0, this.z); }, | 278| 278| GetPosition2D: function() { return new Vector2D(this.x, this.z); }, | 279| 279| GetRotation: function() { return { "y": 0 }; }, | | [NORMAL] ESLintBear (quote-props): | | Unquoted property 'GetPosition' found. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | 274| 274| AddMock(controller, IID_Position, { | 275| 275| GetTurretParent: function() { return INVALID_ENTITY; }, | 276| 276| JumpTo: function(x, z) { this.x = x; this.z = z; }, | 277| |- GetPosition: function() { return new Vector3D(this.x, 0, this.z); }, | | 277|+ "GetPosition": function() { return new Vector3D(this.x, 0, this.z); }, | 278| 278| GetPosition2D: function() { return new Vector2D(this.x, this.z); }, | 279| 279| GetRotation: function() { return { "y": 0 }; }, | 280| 280| IsInWorld: function() { return true; }, | | [NORMAL] ESLintBear (quote-props): | | Unquoted property 'GetPosition2D' found. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | 275| 275| GetTurretParent: function() { return INVALID_ENTITY; }, | 276| 276| JumpTo: function(x, z) { this.x = x; this.z = z; }, | 277| 277| GetPosition: function() { return new Vector3D(this.x, 0, this.z); }, | 278| |- GetPosition2D: function() { return new Vector2D(this.x, this.z); }, | | 278|+ "GetPosition2D": function() { return new Vector2D(this.x, this.z); }, | 279| 279| GetRotation: function() { return { "y": 0 }; }, | 280| 280| IsInWorld: function() { return true; }, | 281| 281| }); | | [NORMAL] ESLintBear (quote-props): | | Unquoted property 'GetRotation' found. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | 276| 276| JumpTo: function(x, z) { this.x = x; this.z = z; }, | 277| 277| GetPosition: function() { return new Vector3D(this.x, 0, this.z); }, | 278| 278| GetPosition2D: function() { return new Vector2D(this.x, this.z); }, | 279| |- GetRotation: function() { return { "y": 0 }; }, | | 279|+ "GetRotation": function() { return { "y": 0 }; }, | 280| 280| IsInWorld: function() { return true; }, | 281| 281| }); | 282| 282| | | [NORMAL] ESLintBear (quote-props): | | Unquoted property 'IsInWorld' found. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | 277| 277| GetPosition: function() { return new Vector3D(this.x, 0, this.z); }, | 278| 278| GetPosition2D: function() { return new Vector2D(this.x, this.z); }, | 279| 279| GetRotation: function() { return { "y": 0 }; }, | 280| |- IsInWorld: function() { return true; }, | | 280|+ "IsInWorld": function() { return true; }, | 281| 281| }); | 282| 282| | 283| 283| AddMock(controller, IID_UnitMotion, { | | [NORMAL] ESLintBear (quote-props): | | Unquoted property 'SetSpeed' found. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | 281| 281| }); | 282| 282| | 283| 283| AddMock(controller, IID_UnitMotion, { | 284| |- SetSpeed: function(speed) { }, | | 284|+ "SetSpeed": function(speed) { }, | 285| 285| MoveToPointRange: function(x, z, minRange, maxRange) { }, | 286| 286| IsInTargetRange: function(target, min, max) { return true; }, | 287| 287| GetPassabilityClassName: function() { return "default"; }, | | [NORMAL] ESLintBear (quote-props): | | Unquoted property 'MoveToPointRange' found. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | 282| 282| | 283| 283| AddMock(controller, IID_UnitMotion, { | 284| 284| SetSpeed: function(speed) { }, | 285| |- MoveToPointRange: function(x, z, minRange, maxRange) { }, | | 285|+ "MoveToPointRange": function(x, z, minRange, maxRange) { }, | 286| 286| IsInTargetRange: function(target, min, max) { return true; }, | 287| 287| GetPassabilityClassName: function() { return "default"; }, | 288| 288| }); | | [NORMAL] ESLintBear (quote-props): | | Unquoted property 'IsInTargetRange' found. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | 283| 283| AddMock(controller, IID_UnitMotion, { | 284| 284| SetSpeed: function(speed) { }, | 285| 285| MoveToPointRange: function(x, z, minRange, maxRange) { }, | 286| |- IsInTargetRange: function(target, min, max) { return true; }, | | 286|+ "IsInTargetRange": function(target, min, max) { return true; }, | 287| 287| GetPassabilityClassName: function() { return "default"; }, | 288| 288| }); | 289| 289| | | [NORMAL] ESLintBear (quote-props): | | Unquoted property 'GetPassabilityClassName' found. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | 284| 284| SetSpeed: function(speed) { }, | 285| 285| MoveToPointRange: function(x, z, minRange, maxRange) { }, | 286| 286| IsInTargetRange: function(target, min, max) { return true; }, | 287| |- GetPassabilityClassName: function() { return "default"; }, | | 287|+ "GetPassabilityClassName": function() { return "default"; }, | 288| 288| }); | 289| 289| | 290| 290| AddMock(controller, IID_Attack, { | | [NORMAL] ESLintBear (quote-props): | | Unquoted property 'GetRange' found. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | 288| 288| }); | 289| 289| | 290| 290| AddMock(controller, IID_Attack, { | 291| |- GetRange: function() { return {"max":10, "min": 0}; }, | | 291|+ "GetRange": function() { return {"max":10, "min": 0}; }, | 292| 292| CanAttackAsFormation: function() { return false; }, | 293| 293| }); | 294| 294| | | [NORMAL] ESLintBear (object-curly-spacing): | | A space is required after '{'. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | 288| 288| }); | 289| 289| | 290| 290| AddMock(controller, IID_Attack, { | 291| |- GetRange: function() { return {"max":10, "min": 0}; }, | | 291|+ GetRange: function() { return { "max":10, "min": 0}; }, | 292| 292| CanAttackAsFormation: function() { return false; }, | 293| 293| }); | 294| 294| | | [NORMAL] ESLintBear (key-spacing): | | Missing space before value for key 'max'. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | 288| 288| }); | 289| 289| | 290| 290| AddMock(controller, IID_Attack, { | 291| |- GetRange: function() { return {"max":10, "min": 0}; }, | | 291|+ GetRange: function() { return {"max": 10, "min": 0}; }, | 292| 292| CanAttackAsFormation: function() { return false; }, | 293| 293| }); | 294| 294| | | [NORMAL] ESLintBear (object-curly-spacing): | | A space is required before '}'. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | 288| 288| }); | 289| 289| | 290| 290| AddMock(controller, IID_Attack, { | 291| |- GetRange: function() { return {"max":10, "min": 0}; }, | | 291|+ GetRange: function() { return {"max":10, "min": 0 }; }, | 292| 292| CanAttackAsFormation: function() { return false; }, | 293| 293| }); | 294| 294| | | [NORMAL] ESLintBear (quote-props): | | Unquoted property 'CanAttackAsFormation' found. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | 289| 289| | 290| 290| AddMock(controller, IID_Attack, { | 291| 291| GetRange: function() { return {"max":10, "min": 0}; }, | 292| |- CanAttackAsFormation: function() { return false; }, | | 292|+ "CanAttackAsFormation": function() { return false; }, | 293| 293| }); | 294| 294| | 295| 295| controllerAI.OnCreate(); | | [NORMAL] ESLintBear (object-curly-spacing): | | A space is required after '{'. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | 301| 301| for (var ent of unitAIs) | 302| 302| TS_ASSERT_EQUALS(unitAI.fsmStateName, "INDIVIDUAL.COMBAT.ATTACKING"); | 303| 303| | 304| |- controllerAI.MoveIntoFormation({"name": "Circle"}); | | 304|+ controllerAI.MoveIntoFormation({ "name": "Circle"}); | 305| 305| | 306| 306| // let all units be in position | 307| 307| for (var ent of unitAIs) | | [NORMAL] ESLintBear (object-curly-spacing): | | A space is required before '}'. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | 301| 301| for (var ent of unitAIs) | 302| 302| TS_ASSERT_EQUALS(unitAI.fsmStateName, "INDIVIDUAL.COMBAT.ATTACKING"); | 303| 303| | 304| |- controllerAI.MoveIntoFormation({"name": "Circle"}); | | 304|+ controllerAI.MoveIntoFormation({"name": "Circle" }); | 305| 305| | 306| 306| // let all units be in position | 307| 307| for (var ent of unitAIs) binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | 47| » » ResetActiveQuery:·function(id)·{·if·(mode·==·0)·return·[];·else·return·[enemy];·}, | | [NORMAL] ESLintBear (brace-rules/brace-on-same-line): | | Closing curly brace appears on the same line as the subsequent block. binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | 215| » for·(var·i·=·0;·i·<·unitCount;·i++)·{ | | [NORMAL] ESLintBear (brace-rules/brace-on-same-line): | | Opening curly brace appears on the same line as controlling statement. binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | 307| » for·(var·ent·of·unitAIs) | | [NORMAL] JSHintBear: | | 'ent' is already defined. binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | 310| » for·(var·ent·of·unitAIs) | | [NORMAL] JSHintBear: | | 'ent' is already defined. binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | 302| » » TS_ASSERT_EQUALS(unitAI.fsmStateName,·"INDIVIDUAL.COMBAT.ATTACKING"); | | [NORMAL] JSHintBear: | | 'unitAI' used out of scope. binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | 311| » » TS_ASSERT_EQUALS(unitAI.fsmStateName,·"INDIVIDUAL.COMBAT.ATTACKING"); | | [NORMAL] JSHintBear: | | 'unitAI' used out of scope. | | [NORMAL] ESLintBear (quote-props): | | Unquoted property 'targetVisibleEnemies' found. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | 73| 73| // do worry around armies slaughtering the guy standing next to you), etc. | 74| 74| var g_Stances = { | 75| 75| "violent": { | 76| |- targetVisibleEnemies: true, | | 76|+ "targetVisibleEnemies": true, | 77| 77| targetAttackersAlways: true, | 78| 78| respondFlee: false, | 79| 79| respondChase: true, | | [NORMAL] ESLintBear (quote-props): | | Unquoted property 'targetAttackersAlways' found. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | 74| 74| var g_Stances = { | 75| 75| "violent": { | 76| 76| targetVisibleEnemies: true, | 77| |- targetAttackersAlways: true, | | 77|+ "targetAttackersAlways": true, | 78| 78| respondFlee: false, | 79| 79| respondChase: true, | 80| 80| respondChaseBeyondVision: true, | | [NORMAL] ESLintBear (quote-props): | | Unquoted property 'respondFlee' found. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | 75| 75| "violent": { | 76| 76| targetVisibleEnemies: true, | 77| 77| targetAttackersAlways: true, | 78| |- respondFlee: false, | | 78|+ "respondFlee": false, | 79| 79| respondChase: true, | 80| 80| respondChaseBeyondVision: true, | 81| 81| respondStandGround: false, | | [NORMAL] ESLintBear (quote-props): | | Unquoted property 'respondChase' found. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | 76| 76| targetVisibleEnemies: true, | 77| 77| targetAttackersAlways: true, | 78| 78| respondFlee: false, | 79| |- respondChase: true, | | 79|+ "respondChase": true, | 80| 80| respondChaseBeyondVision: true, | 81| 81| respondStandGround: false, | 82| 82| respondHoldGround: false, | | [NORMAL] ESLintBear (quote-props): | | Unquoted property 'respondChaseBeyondVision' found. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | 77| 77| targetAttackersAlways: true, | 78| 78| respondFlee: false, | 79| 79| respondChase: true, | 80| |- respondChaseBeyondVision: true, | | 80|+ "respondChaseBeyondVision": true, | 81| 81| respondStandGround: false, | 82| 82| respondHoldGround: false, | 83| 83| }, | | [NORMAL] ESLintBear (quote-props): | | Unquoted property 'respondStandGround' found. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | 78| 78| respondFlee: false, | 79| 79| respondChase: true, | 80| 80| respondChaseBeyondVision: true, | 81| |- respondStandGround: false, | | 81|+ "respondStandGround": false, | 82| 82| respondHoldGround: false, | 83| 83| }, | 84| 84| "aggressive": { | | [NORMAL] ESLintBear (quote-props): | | Unquoted property 'respondHoldGround' found. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | 79| 79| respondChase: true, | 80| 80| respondChaseBeyondVision: true, | 81| 81| respondStandGround: false, | 82| |- respondHoldGround: false, | | 82|+ "respondHoldGround": false, | 83| 83| }, | 84| 84| "aggressive": { | 85| 85| targetVisibleEnemies: true, | | [NORMAL] ESLintBear (quote-props): | | Unquoted property 'targetVisibleEnemies' found. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | 82| 82| respondHoldGround: false, | 83| 83| }, | 84| 84| "aggressive": { | 85| |- targetVisibleEnemies: true, | | 85|+ "targetVisibleEnemies": true, | 86| 86| targetAttackersAlways: false, | 87| 87| respondFlee: false, | 88| 88| respondChase: true, | | [NORMAL] ESLintBear (quote-props): | | Unquoted property 'targetAttackersAlways' found. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | 83| 83| }, | 84| 84| "aggressive": { | 85| 85| targetVisibleEnemies: true, | 86| |- targetAttackersAlways: false, | | 86|+ "targetAttackersAlways": false, | 87| 87| respondFlee: false, | 88| 88| respondChase: true, | 89| 89| respondChaseBeyondVision: false, | | [NORMAL] ESLintBear (quote-props): | | Unquoted property 'respondFlee' found. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | 84| 84| "aggressive": { | 85| 85| targetVisibleEnemies: true, | 86| 86| targetAttackersAlways: false, | 87| |- respondFlee: false, | | 87|+ "respondFlee": false, | 88| 88| respondChase: true, | 89| 89| respondChaseBeyondVision: false, | 90| 90| respondStandGround: false, | | [NORMAL] ESLintBear (quote-props): | | Unquoted property 'respondChase' found. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | 85| 85| targetVisibleEnemies: true, | 86| 86| targetAttackersAlways: false, | 87| 87| respondFlee: false, | 88| |- respondChase: true, | | 88|+ "respondChase": true, | 89| 89| respondChaseBeyondVision: false, | 90| 90| respondStandGround: false, | 91| 91| respondHoldGround: false, | | [NORMAL] ESLintBear (quote-props): | | Unquoted property 'respondChaseBeyondVision' found. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | 86| 86| targetAttackersAlways: false, | 87| 87| respondFlee: false, | 88| 88| respondChase: true, | 89| |- respondChaseBeyondVision: false, | | 89|+ "respondChaseBeyondVision": false, | 90| 90| respondStandGround: false, | 91| 91| respondHoldGround: false, | 92| 92| }, | | [NORMAL] ESLintBear (quote-props): | | Unquoted property 'respondStandGround' found. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | 87| 87| respondFlee: false, | 88| 88| respondChase: true, | 89| 89| respondChaseBeyondVision: false, | 90| |- respondStandGround: false, | | 90|+ "respondStandGround": false, | 91| 91| respondHoldGround: false, | 92| 92| }, | 93| 93| "defensive": { | | [NORMAL] ESLintBear (quote-props): | | Unquoted property 'respondHoldGround' found. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | 88| 88| respondChase: true, | 89| 89| respondChaseBeyondVision: false, | 90| 90| respondStandGround: false, | 91| |- respondHoldGround: false, | | 91|+ "respondHoldGround": false, | 92| 92| }, | 93| 93| "defensive": { | 94| 94| targetVisibleEnemies: true, | | [NORMAL] ESLintBear (quote-props): | | Unquoted property 'targetVisibleEnemies' found. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | 91| 91| respondHoldGround: false, | 92| 92| }, | 93| 93| "defensive": { | 94| |- targetVisibleEnemies: true, | | 94|+ "targetVisibleEnemies": true, | 95| 95| targetAttackersAlways: false, | 96| 96| respondFlee: false, | 97| 97| respondChase: false, | | [NORMAL] ESLintBear (quote-props): | | Unquoted property 'targetAttackersAlways' found. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | 92| 92| }, | 93| 93| "defensive": { | 94| 94| targetVisibleEnemies: true, | 95| |- targetAttackersAlways: false, | | 95|+ "targetAttackersAlways": false, | 96| 96| respondFlee: false, | 97| 97| respondChase: false, | 98| 98| respondChaseBeyondVision: false, | | [NORMAL] ESLintBear (quote-props): | | Unquoted property 'respondFlee' found. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | 93| 93| "defensive": { | 94| 94| targetVisibleEnemies: true, | 95| 95| targetAttackersAlways: false, | 96| |- respondFlee: false, | | 96|+ "respondFlee": false, | 97| 97| respondChase: false, | 98| 98| respondChaseBeyondVision: false, | 99| 99| respondStandGround: false, | | [NORMAL] ESLintBear (quote-props): | | Unquoted property 'respondChase' found. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | 94| 94| targetVisibleEnemies: true, | 95| 95| targetAttackersAlways: false, | 96| 96| respondFlee: false, | 97| |- respondChase: false, | | 97|+ "respondChase": false, | 98| 98| respondChaseBeyondVision: false, | 99| 99| respondStandGround: false, | 100| 100| respondHoldGround: true, | | [NORMAL] ESLintBear (quote-props): | | Unquoted property 'respondChaseBeyondVision' found. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | 95| 95| targetAttackersAlways: false, | 96| 96| respondFlee: false, | 97| 97| respondChase: false, | 98| |- respondChaseBeyondVision: false, | | 98|+ "respondChaseBeyondVision": false, | 99| 99| respondStandGround: false, | 100| 100| respondHoldGround: true, | 101| 101| }, | | [NORMAL] ESLintBear (quote-props): | | Unquoted property 'respondStandGround' found. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | 96| 96| respondFlee: false, | 97| 97| respondChase: false, | 98| 98| respondChaseBeyondVision: false, | 99| |- respondStandGround: false, | | 99|+ "respondStandGround": false, | 100| 100| respondHoldGround: true, | 101| 101| }, | 102| 102| "passive": { | | [NORMAL] ESLintBear (quote-props): | | Unquoted property 'respondHoldGround' found. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | 97| 97| respondChase: false, | 98| 98| respondChaseBeyondVision: false, | 99| 99| respondStandGround: false, | 100| |- respondHoldGround: true, | | 100|+ "respondHoldGround": true, | 101| 101| }, | 102| 102| "passive": { | 103| 103| targetVisibleEnemies: false, | | [NORMAL] ESLintBear (quote-props): | | Unquoted property 'targetVisibleEnemies' found. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | 100| 100| respondHoldGround: true, | 101| 101| }, | 102| 102| "passive": { | 103| |- targetVisibleEnemies: false, | | 103|+ "targetVisibleEnemies": false, | 104| 104| targetAttackersAlways: false, | 105| 105| respondFlee: true, | 106| 106| respondChase: false, | | [NORMAL] ESLintBear (quote-props): | | Unquoted property 'targetAttackersAlways' found. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | 101| 101| }, | 102| 102| "passive": { | 103| 103| targetVisibleEnemies: false, | 104| |- targetAttackersAlways: false, | | 104|+ "targetAttackersAlways": false, | 105| 105| respondFlee: true, | 106| 106| respondChase: false, | 107| 107| respondChaseBeyondVision: false, | | [NORMAL] ESLintBear (quote-props): | | Unquoted property 'respondFlee' found. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | 102| 102| "passive": { | 103| 103| targetVisibleEnemies: false, | 104| 104| targetAttackersAlways: false, | 105| |- respondFlee: true, | | 105|+ "respondFlee": true, | 106| 106| respondChase: false, | 107| 107| respondChaseBeyondVision: false, | 108| 108| respondStandGround: false, | | [NORMAL] ESLintBear (quote-props): | | Unquoted property 'respondChase' found. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | 103| 103| targetVisibleEnemies: false, | 104| 104| targetAttackersAlways: false, | 105| 105| respondFlee: true, | 106| |- respondChase: false, | | 106|+ "respondChase": false, | 107| 107| respondChaseBeyondVision: false, | 108| 108| respondStandGround: false, | 109| 109| respondHoldGround: false, | | [NORMAL] ESLintBear (quote-props): | | Unquoted property 'respondChaseBeyondVision' found. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | 104| 104| targetAttackersAlways: false, | 105| 105| respondFlee: true, | 106| 106| respondChase: false, | 107| |- respondChaseBeyondVision: false, | | 107|+ "respondChaseBeyondVision": false, | 108| 108| respondStandGround: false, | 109| 109| respondHoldGround: false, | 110| 110| }, | | [NORMAL] ESLintBear (quote-props): | | Unquoted property 'respondStandGround' found. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | 105| 105| respondFlee: true, | 106| 106| respondChase: false, | 107| 107| respondChaseBeyondVision: false, | 108| |- respondStandGround: false, | | 108|+ "respondStandGround": false, | 109| 109| respondHoldGround: false, | 110| 110| }, | 111| 111| "standground": { | | [NORMAL] ESLintBear (quote-props): | | Unquoted property 'respondHoldGround' found. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | 106| 106| respondChase: false, | 107| 107| respondChaseBeyondVision: false, | 108| 108| respondStandGround: false, | 109| |- respondHoldGround: false, | | 109|+ "respondHoldGround": false, | 110| 110| }, | 111| 111| "standground": { | 112| 112| targetVisibleEnemies: true, | | [NORMAL] ESLintBear (quote-props): | | Unquoted property 'targetVisibleEnemies' found. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | 109| 109| respondHoldGround: false, | 110| 110| }, | 111| 111| "standground": { | 112| |- targetVisibleEnemies: true, | | 112|+ "targetVisibleEnemies": true, | 113| 113| targetAttackersAlways: false, | 114| 114| respondFlee: false, | 115| 115| respondChase: false, | | [NORMAL] ESLintBear (quote-props): | | Unquoted property 'targetAttackersAlways' found. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | 110| 110| }, | 111| 111| "standground": { | 112| 112| targetVisibleEnemies: true, | 113| |- targetAttackersAlways: false, | | 113|+ "targetAttackersAlways": false, | 114| 114| respondFlee: false, | 115| 115| respondChase: false, | 116| 116| respondChaseBeyondVision: false, | | [NORMAL] ESLintBear (quote-props): | | Unquoted property 'respondFlee' found. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | 111| 111| "standground": { | 112| 112| targetVisibleEnemies: true, | 113| 113| targetAttackersAlways: false, | 114| |- respondFlee: false, | | 114|+ "respondFlee": false, | 115| 115| respondChase: false, | 116| 116| respondChaseBeyondVision: false, | 117| 117| respondStandGround: true, | | [NORMAL] ESLintBear (quote-props): | | Unquoted property 'respondChase' found. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | 112| 112| targetVisibleEnemies: true, | 113| 113| targetAttackersAlways: false, | 114| 114| respondFlee: false, | 115| |- respondChase: false, | | 115|+ "respondChase": false, | 116| 116| respondChaseBeyondVision: false, | 117| 117| respondStandGround: true, | 118| 118| respondHoldGround: false, | | [NORMAL] ESLintBear (quote-props): | | Unquoted property 'respondChaseBeyondVision' found. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | 113| 113| targetAttackersAlways: false, | 114| 114| respondFlee: false, | 115| 115| respondChase: false, | 116| |- respondChaseBeyondVision: false, | | 116|+ "respondChaseBeyondVision": false, | 117| 117| respondStandGround: true, | 118| 118| respondHoldGround: false, | 119| 119| }, | | [NORMAL] ESLintBear (quote-props): | | Unquoted property 'respondStandGround' found. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | 114| 114| respondFlee: false, | 115| 115| respondChase: false, | 116| 116| respondChaseBeyondVision: false, | 117| |- respondStandGround: true, | | 117|+ "respondStandGround": true, | 118| 118| respondHoldGround: false, | 119| 119| }, | 120| 120| }; | | [NORMAL] ESLintBear (quote-props): | | Unquoted property 'respondHoldGround' found. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | 115| 115| respondChase: false, | 116| 116| respondChaseBeyondVision: false, | 117| 117| respondStandGround: true, | 118| |- respondHoldGround: false, | | 118|+ "respondHoldGround": false, | 119| 119| }, | 120| 120| }; | 121| 121| | | [NORMAL] ESLintBear (curly): | | Unnecessary { after 'if' condition. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | 216| 216| // Move a tile outside the building | 217| 217| let range = 4; | 218| 218| if (this.MoveToTargetRangeExplicit(msg.data.target, range, range)) | 219| |- { | | 219|+ | 220| 220| // We've started walking to the given point | 221| 221| this.SetNextState("INDIVIDUAL.WALKING"); | 222| |- } | | 222|+ | 223| 223| else | 224| 224| { | 225| 225| // We are already at the target, or can't move at all | | [NORMAL] ESLintBear (curly): | | Unnecessary { after 'else'. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | 221| 221| this.SetNextState("INDIVIDUAL.WALKING"); | 222| 222| } | 223| 223| else | 224| |- { | | 224|+ | 225| 225| // We are already at the target, or can't move at all | 226| 226| this.FinishOrder(); | 227| |- } | | 227|+ | 228| 228| }, | 229| 229| | 230| 230| // Individual orders: | | [NORMAL] ESLintBear (curly): | | Unnecessary { after 'if' condition. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | 326| 326| | 327| 327| var ok = this.MoveToTarget(this.order.data.target); | 328| 328| if (ok) | 329| |- { | | 329|+ | 330| 330| // We've started walking to the given point | 331| 331| if (this.IsAnimal()) | 332| 332| this.SetNextState("ANIMAL.WALKING"); | 333| 333| else | 334| 334| this.SetNextState("INDIVIDUAL.WALKING"); | 335| |- } | | 335|+ | 336| 336| else | 337| 337| { | 338| 338| // We are already at the target, or can't move at all | | [NORMAL] ESLintBear (curly): | | Unnecessary { after 'if' condition. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | 354| 354| var cmpPosition = Engine.QueryInterface(this.entity, IID_Position); | 355| 355| if (this.lastShorelinePosition && cmpPosition && (this.lastShorelinePosition.x == cmpPosition.GetPosition().x) | 356| 356| && (this.lastShorelinePosition.z == cmpPosition.GetPosition().z)) | 357| |- { | | 357|+ | 358| 358| // we were already on the shoreline, and have not moved since | 359| 359| if (DistanceBetweenEntities(this.entity, this.order.data.target) < 50) | 360| 360| needToMove = false; | 361| |- } | | 361|+ | 362| 362| | 363| 363| // TODO: what if the units are on a cliff ? the ship will go below the cliff | 364| 364| // and the units won't be able to garrison. Should go to the nearest (accessible) shore | | [NORMAL] ESLintBear (operator-linebreak): | | '&&' should be placed at the end of the line. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | 352| 352| // Check if we need to move TODO implement a better way to know if we are on the shoreline | 353| 353| var needToMove = true; | 354| 354| var cmpPosition = Engine.QueryInterface(this.entity, IID_Position); | 355| |- if (this.lastShorelinePosition && cmpPosition && (this.lastShorelinePosition.x == cmpPosition.GetPosition().x) | 356| |- && (this.lastShorelinePosition.z == cmpPosition.GetPosition().z)) | | 355|+ if (this.lastShorelinePosition && cmpPosition && (this.lastShorelinePosition.x == cmpPosition.GetPosition().x) && | | 356|+ (this.lastShorelinePosition.z == cmpPosition.GetPosition().z)) | 357| 357| { | 358| 358| // we were already on the shoreline, and have not moved since | 359| 359| if (DistanceBetweenEntities(this.entity, this.order.data.target) < 50) | | [NORMAL] ESLintBear (curly): | | Unnecessary { after 'if' condition. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | 363| 363| // TODO: what if the units are on a cliff ? the ship will go below the cliff | 364| 364| // and the units won't be able to garrison. Should go to the nearest (accessible) shore | 365| 365| if (needToMove && this.MoveToTarget(this.order.data.target)) | 366| |- { | | 366|+ | 367| 367| this.SetNextState("INDIVIDUAL.PICKUP.APPROACHING"); | 368| |- } | | 368|+ | 369| 369| else | 370| 370| { | 371| 371| // We are already at the target, or can't move at all | | [NORMAL] ESLintBear (curly): | | Unnecessary { after 'if' condition. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | 392| 392| var distance = DistanceBetweenEntities(this.entity, this.order.data.target) + (+this.template.FleeDistance); | 393| 393| var cmpUnitMotion = Engine.QueryInterface(this.entity, IID_UnitMotion); | 394| 394| if (cmpUnitMotion.MoveToTargetRange(this.order.data.target, distance, -1)) | 395| |- { | | 395|+ | 396| 396| // We've started fleeing from the given target | 397| 397| if (this.IsAnimal()) | 398| 398| this.SetNextState("ANIMAL.FLEEING"); | 399| 399| else | 400| 400| this.SetNextState("INDIVIDUAL.FLEEING"); | 401| |- } | | 401|+ | 402| 402| else | 403| 403| { | 404| 404| // We are already at the target, or can't move at all | | [NORMAL] ESLintBear (curly): | | Unnecessary { after 'if' condition. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | 448| 448| } | 449| 449| | 450| 450| if (this.order.data.attackType == this.oldAttackType) | 451| |- { | | 451|+ | 452| 452| if (this.IsAnimal()) | 453| 453| this.SetNextState("ANIMAL.COMBAT.ATTACKING"); | 454| 454| else | 455| 455| this.SetNextState("INDIVIDUAL.COMBAT.ATTACKING"); | 456| |- } | | 456|+ | 457| 457| else | 458| 458| { | 459| 459| if (this.IsAnimal()) | | [NORMAL] ESLintBear (curly): | | Unnecessary { after 'else'. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | 455| 455| this.SetNextState("INDIVIDUAL.COMBAT.ATTACKING"); | 456| 456| } | 457| 457| else | 458| |- { | | 458|+ | 459| 459| if (this.IsAnimal()) | 460| 460| this.SetNextStateAlwaysEntering("ANIMAL.COMBAT.ATTACKING"); | 461| 461| else | 462| 462| this.SetNextStateAlwaysEntering("INDIVIDUAL.COMBAT.ATTACKING"); | 463| |- } | | 463|+ | 464| 464| return; | 465| 465| } | 466| 466| | | [NORMAL] ESLintBear (curly): | | Unnecessary { after 'else'. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | 593| 593| this.PushOrderFront("Walk", this.order.data.lastPos); | 594| 594| } | 595| 595| else | 596| |- { | | 596|+ | 597| 597| // We couldn't move there, or the target moved away | 598| 598| this.FinishOrder(); | 599| |- } | | 599|+ | 600| 600| return; | 601| 601| } | 602| 602| | | [NORMAL] ESLintBear (curly): | | Unnecessary { after 'if' condition. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | 606| 606| | 607| 607| // Try to move within range | 608| 608| if (this.MoveToTargetRange(this.order.data.target, IID_ResourceGatherer)) | 609| |- { | | 609|+ | 610| 610| // We've started walking to the given point | 611| 611| this.SetNextState("INDIVIDUAL.GATHER.APPROACHING"); | 612| |- } | | 612|+ | 613| 613| else | 614| 614| { | 615| 615| // We are already at the target, or can't move at all, | | [NORMAL] ESLintBear (curly): | | Unnecessary { after 'if' condition. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | 683| 683| "Order.Repair": function(msg) { | 684| 684| // Try to move within range | 685| 685| if (this.MoveToTargetRange(this.order.data.target, IID_Builder)) | 686| |- { | | 686|+ | 687| 687| // We've started walking to the given point | 688| 688| this.SetNextState("INDIVIDUAL.REPAIR.APPROACHING"); | 689| |- } | | 689|+ | 690| 690| else | 691| 691| { | 692| 692| // We are already at the target, or can't move at all, | | [NORMAL] ESLintBear (curly): | | Unnecessary { after 'if' condition. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | 720| 720| } | 721| 721| | 722| 722| if (this.MoveToGarrisonRange(this.order.data.target)) | 723| |- { | | 723|+ | 724| 724| this.SetNextState("INDIVIDUAL.GARRISON.APPROACHING"); | 725| |- } | | 725|+ | 726| 726| else | 727| 727| { | 728| 728| // We do a range check before actually garrisoning | | [NORMAL] ESLintBear (curly): | | Unnecessary { after 'if' condition. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | 858| 858| if (!this.CheckTargetAttackRange(target, target)) | 859| 859| { | 860| 860| if (this.TargetIsAlive(target) && this.CheckTargetVisible(target)) | 861| |- { | | 861|+ | 862| 862| if (this.MoveToTargetAttackRange(target, target)) | 863| 863| { | 864| 864| this.SetNextState("COMBAT.APPROACHING"); | 865| 865| return; | 866| 866| } | 867| |- } | | 867|+ | 868| 868| this.FinishOrder(); | 869| 869| return; | 870| 870| } | | [NORMAL] ESLintBear (curly): | | Unnecessary { after 'if' condition. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | 883| 883| } | 884| 884| // Check if we are already in range, otherwise walk there | 885| 885| if (!this.CheckGarrisonRange(msg.data.target)) | 886| |- { | | 886|+ | 887| 887| if (!this.CheckTargetVisible(msg.data.target)) | 888| 888| { | 889| 889| this.FinishOrder(); | 898| 898| return; | 899| 899| } | 900| 900| } | 901| |- } | | 901|+ | 902| 902| | 903| 903| this.SetNextState("GARRISON.GARRISONING"); | 904| 904| }, | | [NORMAL] ESLintBear (curly): | | Unnecessary { after 'else'. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | 890| 890| return; | 891| 891| } | 892| 892| else | 893| |- { | | 893|+ | 894| 894| // Out of range; move there in formation | 895| 895| if (this.MoveToGarrisonRange(msg.data.target)) | 896| 896| { | 897| 897| this.SetNextState("GARRISON.APPROACHING"); | 898| 898| return; | 899| 899| } | 900| |- } | | 900|+ | 901| 901| } | 902| 902| | 903| 903| this.SetNextState("GARRISON.GARRISONING"); | | [NORMAL] ESLintBear (no-else-return): | | Unnecessary 'else' after 'return'. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | 889| 889| this.FinishOrder(); | 890| 890| return; | 891| 891| } | 892| |- else | 893| |- { | | 892|+ | 894| 893| // Out of range; move there in formation | 895| 894| if (this.MoveToGarrisonRange(msg.data.target)) | 896| 895| { | 897| 896| this.SetNextState("GARRISON.APPROACHING"); | 898| 897| return; | 899| 898| } | 900| |- } | | 899|+ | 901| 900| } | 902| 901| | 903| 902| this.SetNextState("GARRISON.GARRISONING"); | | [NORMAL] ESLintBear (curly): | | Unnecessary { after 'else'. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | 916| 916| this.PushOrderFront("Walk", msg.data.lastPos); | 917| 917| } | 918| 918| else | 919| |- { | | 919|+ | 920| 920| // We couldn't move there, or the target moved away | 921| 921| this.FinishOrder(); | 922| |- } | | 922|+ | 923| 923| return; | 924| 924| } | 925| 925| | | [NORMAL] ESLintBear (key-spacing): | | Missing space before value for key 'GARRISON'. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js |1137|1137| }, |1138|1138| }, |1139|1139| |1140| |- "GARRISON":{ | |1140|+ "GARRISON": { |1141|1141| "enter": function() { |1142|1142| // If the garrisonholder should pickup, warn it so it can take needed action |1143|1143| var cmpGarrisonHolder = Engine.QueryInterface(this.order.data.target, IID_GarrisonHolder); | | [NORMAL] ESLintBear (curly): | | Unnecessary { after 'if' condition. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js |1318|1318| // If the controller handled an order but some members rejected it, |1319|1319| // they will have no orders and be in the FORMATIONMEMBER.IDLE state. |1320|1320| if (this.orderQueue.length) |1321| |- { | |1321|+ |1322|1322| // We're leaving the formation, so stop our FormationWalk order |1323|1323| if (this.FinishOrder()) |1324|1324| return; |1325| |- } | |1325|+ |1326|1326| |1327|1327| // No orders left, we're an individual now |1328|1328| if (this.IsAnimal()) | | [NORMAL] ESLintBear (curly): | | Unnecessary { after 'if' condition. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js |1346|1346| // Move a tile outside the building |1347|1347| let range = 4; |1348|1348| if (this.MoveToTargetRangeExplicit(msg.data.target, range, range)) |1349| |- { | |1349|+ |1350|1350| // We've started walking to the given point |1351|1351| this.SetNextState("WALKINGTOPOINT"); |1352| |- } | |1352|+ |1353|1353| else |1354|1354| { |1355|1355| // We are already at the target, or can't move at all | | [NORMAL] ESLintBear (curly): | | Unnecessary { after 'else'. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js |1351|1351| this.SetNextState("WALKINGTOPOINT"); |1352|1352| } |1353|1353| else |1354| |- { | |1354|+ |1355|1355| // We are already at the target, or can't move at all |1356|1356| this.FinishOrder(); |1357| |- } | |1357|+ |1358|1358| }, |1359|1359| |1360|1360| | | [NORMAL] ESLintBear (space-before-function-paren): | | Unexpected space before function parentheses. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js |1370|1370| }, |1371|1371| |1372|1372| "WALKING": { |1373| |- "enter": function () { | |1373|+ "enter": function() { |1374|1374| var cmpFormation = Engine.QueryInterface(this.formationController, IID_Formation); |1375|1375| var cmpVisual = Engine.QueryInterface(this.entity, IID_Visual); |1376|1376| if (cmpFormation && cmpVisual) | | [NORMAL] ESLintBear (curly): | | Unnecessary { after 'if' condition. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js |1557|1557| |1558|1558| "LosRangeUpdate": function(msg) { |1559|1559| if (this.GetStance().targetVisibleEnemies) |1560| |- { | |1560|+ |1561|1561| // Start attacking one of the newly-seen enemy (if any) |1562|1562| this.AttackEntitiesByPreference(msg.data.added); |1563| |- } | |1563|+ |1564|1564| }, |1565|1565| |1566|1566| "LosHealRangeUpdate": function(msg) { | | [NORMAL] ESLintBear (space-before-function-paren): | | Unexpected space before function parentheses. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js |1577|1577| }, |1578|1578| |1579|1579| "WALKING": { |1580| |- "enter": function () { | |1580|+ "enter": function() { |1581|1581| this.SelectAnimation("move"); |1582|1582| }, |1583|1583| | | [NORMAL] ESLintBear (space-before-function-paren): | | Unexpected space before function parentheses. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js |1587|1587| }, |1588|1588| |1589|1589| "WALKINGANDFIGHTING": { |1590| |- "enter": function () { | |1590|+ "enter": function() { |1591|1591| // Show weapons rather than carried resources. |1592|1592| this.SetAnimationVariant("combat"); |1593|1593| | | [NORMAL] ESLintBear (space-before-function-paren): | | Unexpected space before function parentheses. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js |1609|1609| }, |1610|1610| |1611|1611| "PATROL": { |1612| |- "enter": function () { | |1612|+ "enter": function() { |1613|1613| // Memorize the origin position in case that we want to go back |1614|1614| let cmpPosition = Engine.QueryInterface(this.entity, IID_Position); |1615|1615| if (!cmpPosition || !cmpPosition.IsInWorld()) | | [NORMAL] ESLintBear (space-before-function-paren): | | Unexpected space before function parentheses. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js |1654|1654| }, |1655|1655| |1656|1656| "ESCORTING": { |1657| |- "enter": function () { | |1657|+ "enter": function() { |1658|1658| // Show weapons rather than carried resources. |1659|1659| this.SetAnimationVariant("combat"); |1660|1660| | | [NORMAL] ESLintBear (space-before-function-paren): | | Unexpected space before function parentheses. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js |1703|1703| }, |1704|1704| |1705|1705| "GUARDING": { |1706| |- "enter": function () { | |1706|+ "enter": function() { |1707|1707| this.StartTimer(1000, 1000); |1708|1708| this.SetHeldPositionOnEntity(this.entity); |1709|1709| this.SetAnimationVariant("combat"); | | [NORMAL] ESLintBear (curly): | | Unnecessary { after 'if' condition. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js |1732|1732| // if nothing better to do, check if the guarded needs to be healed or repaired |1733|1733| var cmpHealth = Engine.QueryInterface(this.isGuardOf, IID_Health); |1734|1734| if (cmpHealth && (cmpHealth.GetHitpoints() < cmpHealth.GetMaxHitpoints())) |1735| |- { | |1735|+ |1736|1736| if (this.CanHeal(this.isGuardOf)) |1737|1737| this.PushOrderFront("Heal", { "target": this.isGuardOf, "force": false }); |1738|1738| else if (this.CanRepair(this.isGuardOf)) |1739|1739| this.PushOrderFront("Repair", { "target": this.isGuardOf, "autocontinue": false, "force": false }); |1740| |- } | |1740|+ |1741|1741| } |1742|1742| }, |1743|1743| | | [NORMAL] ESLintBear (space-before-function-paren): | | Unexpected space before function parentheses. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js |1789|1789| }, |1790|1790| |1791|1791| "APPROACHING": { |1792| |- "enter": function () { | |1792|+ "enter": function() { |1793|1793| // Show weapons rather than carried resources. |1794|1794| this.SetAnimationVariant("combat"); |1795|1795| | | [NORMAL] ESLintBear (curly): | | Unnecessary { after 'if' condition. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js |1816|1816| "MoveCompleted": function() { |1817|1817| |1818|1818| if (this.CheckTargetAttackRange(this.order.data.target, this.order.data.attackType)) |1819| |- { | |1819|+ |1820|1820| // If the unit needs to unpack, do so |1821|1821| if (this.CanUnpack()) |1822|1822| { |1825|1825| } |1826|1826| else |1827|1827| this.SetNextState("ATTACKING"); |1828| |- } | |1828|+ |1829|1829| else |1830|1830| { |1831|1831| if (this.MoveToTargetAttackRange(this.order.data.target, this.order.data.attackType)) | | [NORMAL] ESLintBear (no-else-return): | | Unnecessary 'else' after 'return'. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js |1823|1823| this.PushOrderFront("Unpack", { "force": true }); |1824|1824| return; |1825|1825| } |1826| |- else |1827| |- this.SetNextState("ATTACKING"); | |1826|+ this.SetNextState("ATTACKING"); |1828|1827| } |1829|1828| else |1830|1829| { | | [NORMAL] ESLintBear (curly): | | Unnecessary { after 'else'. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js |1827|1827| this.SetNextState("ATTACKING"); |1828|1828| } |1829|1829| else |1830| |- { | |1830|+ |1831|1831| if (this.MoveToTargetAttackRange(this.order.data.target, this.order.data.attackType)) |1832|1832| { |1833|1833| this.SetNextState("APPROACHING"); |1837|1837| // Give up |1838|1838| this.FinishOrder(); |1839|1839| } |1840| |- } | |1840|+ |1841|1841| }, |1842|1842| }, |1843|1843| | | [NORMAL] ESLintBear (curly): | | Unnecessary { after 'if' condition. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js |1829|1829| else |1830|1830| { |1831|1831| if (this.MoveToTargetAttackRange(this.order.data.target, this.order.data.attackType)) |1832| |- { | |1832|+ |1833|1833| this.SetNextState("APPROACHING"); |1834| |- } | |1834|+ |1835|1835| else |1836|1836| { |1837|1837| // Give up | | [NORMAL] ESLintBear (curly): | | Unnecessary { after 'else'. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js |1833|1833| this.SetNextState("APPROACHING"); |1834|1834| } |1835|1835| else |1836| |- { | |1836|+ |1837|1837| // Give up |1838|1838| this.FinishOrder(); |1839| |- } | |1839|+ |1840|1840| } |1841|1841| }, |1842|1842| }, | | [NORMAL] ESLintBear (curly): | | Unnecessary { after 'if' condition. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js |1854|1854| } |1855|1855| // Check the target is still alive and attackable |1856|1856| if (this.CanAttack(target) && !this.CheckTargetAttackRange(target, this.order.data.attackType)) |1857| |- { | |1857|+ |1858|1858| // Can't reach it - try to chase after it |1859|1859| if (this.ShouldChaseTargetedEntity(target, this.order.data.force)) |1860|1860| { |1864|1864| return; |1865|1865| } |1866|1866| } |1867| |- } | |1867|+ |1868|1868| |1869|1869| var cmpAttack = Engine.QueryInterface(this.entity, IID_Attack); |1870|1870| this.attackTimers = cmpAttack.GetTimers(this.order.data.attackType); | | [NORMAL] ESLintBear (curly): | | Unnecessary { after 'if' condition. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js |1857|1857| { |1858|1858| // Can't reach it - try to chase after it |1859|1859| if (this.ShouldChaseTargetedEntity(target, this.order.data.force)) |1860| |- { | |1860|+ |1861|1861| if (this.MoveToTargetAttackRange(target, this.order.data.attackType)) |1862|1862| { |1863|1863| this.SetNextState("COMBAT.CHASING"); |1864|1864| return; |1865|1865| } |1866| |- } | |1866|+ |1867|1867| } |1868|1868| |1869|1869| var cmpAttack = Engine.QueryInterface(this.entity, IID_Attack); | | [NORMAL] ESLintBear (no-unneeded-ternary): | | Unnecessary use of boolean literals in conditional expression. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js |1895|1895| // TODO: we should probably only bother syncing projectile attacks, not melee |1896|1896| |1897|1897| // If using a non-default prepare time, re-sync the animation when the timer runs. |1898| |- this.resyncAnimation = (prepare != this.attackTimers.prepare) ? true : false; | |1898|+ this.resyncAnimation = (prepare != this.attackTimers.prepare); |1899|1899| |1900|1900| this.FaceTowardsTarget(this.order.data.target); |1901|1901| | | [NORMAL] ESLintBear (curly): | | Unnecessary { after 'if' condition. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js |1969|1969| |1970|1970| // Can't reach it - try to chase after it |1971|1971| if (this.ShouldChaseTargetedEntity(target, this.order.data.force)) |1972| |- { | |1972|+ |1973|1973| if (this.MoveToTargetRange(target, IID_Attack, this.order.data.attackType)) |1974|1974| { |1975|1975| this.SetNextState("COMBAT.CHASING"); |1976|1976| return; |1977|1977| } |1978| |- } | |1978|+ |1979|1979| } |1980|1980| |1981|1981| // if we're targetting a formation, find a new member of that formation | | [NORMAL] ESLintBear (operator-linebreak): | | '&&' should be placed at the end of the line. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js |2016|2016| |2017|2017| "Attacked": function(msg) { |2018|2018| // If we are capturing and are attacked by something that we would not capture, attack that entity instead |2019| |- if (this.order.data.attackType == "Capture" && (this.GetStance().targetAttackersAlways || !this.order.data.force) |2020| |- && this.order.data.target != msg.data.attacker && this.GetBestAttackAgainst(msg.data.attacker, true) != "Capture") | |2019|+ if (this.order.data.attackType == "Capture" && (this.GetStance().targetAttackersAlways || !this.order.data.force) && | |2020|+ this.order.data.target != msg.data.attacker && this.GetBestAttackAgainst(msg.data.attacker, true) != "Capture") |2021|2021| this.RespondToTargetedEntities([msg.data.attacker]); |2022|2022| }, |2023|2023| }, | | [NORMAL] ESLintBear (space-before-function-paren): | | Unexpected space before function parentheses. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js |2023|2023| }, |2024|2024| |2025|2025| "CHASING": { |2026| |- "enter": function () { | |2026|+ "enter": function() { |2027|2027| // Show weapons rather than carried resources. |2028|2028| this.SetAnimationVariant("combat"); |2029|2029| | | [NORMAL] ESLintBear (space-before-function-paren): | | Unexpected space before function parentheses. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js |2097|2097| |2098|2098| // Try to find another nearby target of the same specific type |2099|2099| // Also don't switch to a different type of huntable animal |2100| |- var nearby = this.FindNearbyResource(function (ent, type, template) { | |2100|+ var nearby = this.FindNearbyResource(function(ent, type, template) { |2101|2101| return ( |2102|2102| ent != oldTarget |2103|2103| && ((type.generic == "treasure" && oldType.generic == "treasure") | | [NORMAL] ESLintBear (operator-linebreak): | | '&&' should be placed at the end of the line. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js |2099|2099| // Also don't switch to a different type of huntable animal |2100|2100| var nearby = this.FindNearbyResource(function (ent, type, template) { |2101|2101| return ( |2102| |- ent != oldTarget |2103| |- && ((type.generic == "treasure" && oldType.generic == "treasure") | |2102|+ ent != oldTarget && | |2103|+ ((type.generic == "treasure" && oldType.generic == "treasure") |2104|2104| || (type.specific == oldType.specific |2105|2105| && (type.specific != "meat" || oldTemplate == template))) |2106|2106| ); | | [NORMAL] ESLintBear (operator-linebreak): | | '||' should be placed at the end of the line. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js |2100|2100| var nearby = this.FindNearbyResource(function (ent, type, template) { |2101|2101| return ( |2102|2102| ent != oldTarget |2103| |- && ((type.generic == "treasure" && oldType.generic == "treasure") |2104| |- || (type.specific == oldType.specific | |2103|+ && ((type.generic == "treasure" && oldType.generic == "treasure") || | |2104|+ (type.specific == oldType.specific |2105|2105| && (type.specific != "meat" || oldTemplate == template))) |2106|2106| ); |2107|2107| }, oldTarget); | | [NORMAL] ESLintBear (operator-linebreak): | | '&&' should be placed at the end of the line. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js |2101|2101| return ( |2102|2102| ent != oldTarget |2103|2103| && ((type.generic == "treasure" && oldType.generic == "treasure") |2104| |- || (type.specific == oldType.specific |2105| |- && (type.specific != "meat" || oldTemplate == template))) | |2104|+ || (type.specific == oldType.specific && | |2105|+ (type.specific != "meat" || oldTemplate == template))) |2106|2106| ); |2107|2107| }, oldTarget); |2108|2108| if (nearby) | | [NORMAL] ESLintBear (no-else-return): | | Unnecessary 'else' after 'return'. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js |2110|2110| this.PerformGather(nearby, false, false); |2111|2111| return true; |2112|2112| } |2113| |- else |2114| |- { | |2113|+ |2115|2114| // It's probably better in this case, to avoid units getting stuck around a dropsite |2116|2115| // in a "Target is far away, full, nearby are no good resources, return to dropsite" loop |2117|2116| // to order it to GatherNear the resource position. |2132|2131| return true; |2133|2132| } |2134|2133| } |2135| |- } | |2134|+ |2136|2135| return true; |2137|2136| } |2138|2137| return false; | | [NORMAL] ESLintBear (no-else-return): | | Unnecessary 'else' after 'return'. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js |2122|2122| this.GatherNearPosition(pos.x, pos.z, oldType, oldTemplate); |2123|2123| return true; |2124|2124| } |2125| |- else |2126| |- { | |2125|+ |2127|2126| // we're kind of stuck here. Return resource. |2128|2127| var nearby = this.FindNearestDropsite(oldType.generic); |2129|2128| if (nearby) |2131|2130| this.PushOrderFront("ReturnResource", { "target": nearby, "force": false }); |2132|2131| return true; |2133|2132| } |2134| |- } | |2133|+ |2135|2134| } |2136|2135| return true; |2137|2136| } | | [NORMAL] ESLintBear (space-before-function-paren): | | Unexpected space before function parentheses. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js |2162|2162| |2163|2163| // Try to find another nearby target of the same specific type |2164|2164| // Also don't switch to a different type of huntable animal |2165| |- var nearby = this.FindNearbyResource(function (ent, type, template) { | |2165|+ var nearby = this.FindNearbyResource(function(ent, type, template) { |2166|2166| return ( |2167|2167| ent != oldTarget |2168|2168| && ((type.generic == "treasure" && oldType.generic == "treasure") | | [NORMAL] ESLintBear (operator-linebreak): | | '&&' should be placed at the end of the line. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js |2164|2164| // Also don't switch to a different type of huntable animal |2165|2165| var nearby = this.FindNearbyResource(function (ent, type, template) { |2166|2166| return ( |2167| |- ent != oldTarget |2168| |- && ((type.generic == "treasure" && oldType.generic == "treasure") | |2167|+ ent != oldTarget && | |2168|+ ((type.generic == "treasure" && oldType.generic == "treasure") |2169|2169| || (type.specific == oldType.specific |2170|2170| && (type.specific != "meat" || oldTemplate == template))) |2171|2171| ); | | [NORMAL] ESLintBear (operator-linebreak): | | '||' should be placed at the end of the line. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js |2165|2165| var nearby = this.FindNearbyResource(function (ent, type, template) { |2166|2166| return ( |2167|2167| ent != oldTarget |2168| |- && ((type.generic == "treasure" && oldType.generic == "treasure") |2169| |- || (type.specific == oldType.specific | |2168|+ && ((type.generic == "treasure" && oldType.generic == "treasure") || | |2169|+ (type.specific == oldType.specific |2170|2170| && (type.specific != "meat" || oldTemplate == template))) |2171|2171| ); |2172|2172| }); | | [NORMAL] ESLintBear (operator-linebreak): | | '&&' should be placed at the end of the line. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js |2166|2166| return ( |2167|2167| ent != oldTarget |2168|2168| && ((type.generic == "treasure" && oldType.generic == "treasure") |2169| |- || (type.specific == oldType.specific |2170| |- && (type.specific != "meat" || oldTemplate == template))) | |2169|+ || (type.specific == oldType.specific && | |2170|+ (type.specific != "meat" || oldTemplate == template))) |2171|2171| ); |2172|2172| }); |2173|2173| if (nearby) | | [NORMAL] ESLintBear (space-before-function-paren): | | Unexpected space before function parentheses. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js |2209|2209| |2210|2210| // Try to find another nearby target of the same specific type |2211|2211| // Also don't switch to a different type of huntable animal |2212| |- var nearby = this.FindNearbyResource(function (ent, type, template) { | |2212|+ var nearby = this.FindNearbyResource(function(ent, type, template) { |2213|2213| return ( |2214|2214| (type.generic == "treasure" && resourceType.generic == "treasure") |2215|2215| || (type.specific == resourceType.specific | | [NORMAL] ESLintBear (operator-linebreak): | | '||' should be placed at the end of the line. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js |2211|2211| // Also don't switch to a different type of huntable animal |2212|2212| var nearby = this.FindNearbyResource(function (ent, type, template) { |2213|2213| return ( |2214| |- (type.generic == "treasure" && resourceType.generic == "treasure") |2215| |- || (type.specific == resourceType.specific | |2214|+ (type.generic == "treasure" && resourceType.generic == "treasure") || | |2215|+ (type.specific == resourceType.specific |2216|2216| && (type.specific != "meat" || resourceTemplate == template)) |2217|2217| ); |2218|2218| }); | | [NORMAL] ESLintBear (operator-linebreak): | | '&&' should be placed at the end of the line. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js |2212|2212| var nearby = this.FindNearbyResource(function (ent, type, template) { |2213|2213| return ( |2214|2214| (type.generic == "treasure" && resourceType.generic == "treasure") |2215| |- || (type.specific == resourceType.specific |2216| |- && (type.specific != "meat" || resourceTemplate == template)) | |2215|+ || (type.specific == resourceType.specific && | |2216|+ (type.specific != "meat" || resourceTemplate == template)) |2217|2217| ); |2218|2218| }); |2219|2219| | | [NORMAL] ESLintBear (curly): | | Unnecessary { after 'if' condition. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js |2328|2328| |2329|2329| var cmpSupply = Engine.QueryInterface(this.gatheringTarget, IID_ResourceSupply); |2330|2330| if (cmpSupply && cmpSupply.IsAvailable(cmpOwnership.GetOwner(), this.entity)) |2331| |- { | |2331|+ |2332|2332| // Check we can still reach and gather from the target |2333|2333| if (this.CheckTargetRange(this.gatheringTarget, IID_ResourceGatherer) && this.CanGather(this.gatheringTarget)) |2334|2334| { |2394|2394| return; |2395|2395| } |2396|2396| } |2397| |- } | |2397|+ |2398|2398| |2399|2399| // We're already in range, can't get anywhere near it or the target is exhausted. |2400|2400| | | [NORMAL] ESLintBear (space-before-function-paren): | | Unexpected space before function parentheses. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js |2418|2418| |2419|2419| // Try to find a new resource of the same specific type near our current position: |2420|2420| // Also don't switch to a different type of huntable animal |2421| |- var nearby = this.FindNearbyResource(function (ent, type, template) { | |2421|+ var nearby = this.FindNearbyResource(function(ent, type, template) { |2422|2422| return ( |2423|2423| (type.generic == "treasure" && resourceType.generic == "treasure") |2424|2424| || (type.specific == resourceType.specific | | [NORMAL] ESLintBear (operator-linebreak): | | '||' should be placed at the end of the line. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js |2420|2420| // Also don't switch to a different type of huntable animal |2421|2421| var nearby = this.FindNearbyResource(function (ent, type, template) { |2422|2422| return ( |2423| |- (type.generic == "treasure" && resourceType.generic == "treasure") |2424| |- || (type.specific == resourceType.specific | |2423|+ (type.generic == "treasure" && resourceType.generic == "treasure") || | |2424|+ (type.specific == resourceType.specific |2425|2425| && (type.specific != "meat" || resourceTemplate == template)) |2426|2426| ); |2427|2427| }); | | [NORMAL] ESLintBear (operator-linebreak): | | '&&' should be placed at the end of the line. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js |2421|2421| var nearby = this.FindNearbyResource(function (ent, type, template) { |2422|2422| return ( |2423|2423| (type.generic == "treasure" && resourceType.generic == "treasure") |2424| |- || (type.specific == resourceType.specific |2425| |- && (type.specific != "meat" || resourceTemplate == template)) | |2424|+ || (type.specific == resourceType.specific && | |2425|+ (type.specific != "meat" || resourceTemplate == template)) |2426|2426| ); |2427|2427| }); |2428|2428| if (nearby) | | [NORMAL] ESLintBear (space-before-function-paren): | | Unexpected space before function parentheses. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js |2462|2462| }, |2463|2463| |2464|2464| "APPROACHING": { |2465| |- "enter": function () { | |2465|+ "enter": function() { |2466|2466| this.SetAnimationVariant("heal"); |2467|2467| this.SelectAnimation("move"); |2468|2468| this.StartTimer(1000, 1000); | | [NORMAL] ESLintBear (no-unneeded-ternary): | | Unnecessary use of boolean literals in conditional expression. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js |2510|2510| this.StartTimer(prepare, this.healTimers.repeat); |2511|2511| |2512|2512| // If using a non-default prepare time, re-sync the animation when the timer runs. |2513| |- this.resyncAnimation = (prepare != this.healTimers.prepare) ? true : false; | |2513|+ this.resyncAnimation = (prepare != this.healTimers.prepare); |2514|2514| |2515|2515| this.FaceTowardsTarget(this.order.data.target); |2516|2516| }, | | [NORMAL] ESLintBear (curly): | | Unnecessary { after 'if' condition. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js |2543|2543| } |2544|2544| // Can't reach it - try to chase after it |2545|2545| if (this.ShouldChaseTargetedEntity(target, this.order.data.force)) |2546| |- { | |2546|+ |2547|2547| if (this.MoveToTargetRange(target, IID_Heal)) |2548|2548| { |2549|2549| this.SetNextState("HEAL.CHASING"); |2550|2550| return; |2551|2551| } |2552| |- } | |2552|+ |2553|2553| } |2554|2554| // Can't reach it, healed to max hp or doesn't exist any more - give up |2555|2555| if (this.FinishOrder()) | | [NORMAL] ESLintBear (space-before-function-paren): | | Unexpected space before function parentheses. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js |2565|2565| }, |2566|2566| }, |2567|2567| "CHASING": { |2568| |- "enter": function () { | |2568|+ "enter": function() { |2569|2569| this.SetDefaultAnimationVariant("heal"); |2570|2570| this.SelectAnimation("move"); |2571|2571| this.StartTimer(1000, 1000); | | [NORMAL] ESLintBear (space-before-function-paren): | | Unexpected space before function parentheses. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js |2571|2571| this.StartTimer(1000, 1000); |2572|2572| }, |2573|2573| |2574| |- "leave": function () { | |2574|+ "leave": function() { |2575|2575| this.StopTimer(); |2576|2576| }, |2577|2577| "Timer": function(msg) { | | [NORMAL] ESLintBear (space-before-function-paren): | | Unexpected space before function parentheses. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js |2585|2585| this.WalkToHeldPosition(); |2586|2586| } |2587|2587| }, |2588| |- "MoveCompleted": function () { | |2588|+ "MoveCompleted": function() { |2589|2589| this.SetNextState("HEALING"); |2590|2590| }, |2591|2591| }, | | [NORMAL] ESLintBear (space-before-function-paren): | | Unexpected space before function parentheses. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js |2594|2594| // Returning to dropsite |2595|2595| "RETURNRESOURCE": { |2596|2596| "APPROACHING": { |2597| |- "enter": function () { | |2597|+ "enter": function() { |2598|2598| this.SetDefaultAnimationVariant(); |2599|2599| this.SelectAnimation("move"); |2600|2600| }, | | [NORMAL] ESLintBear (space-before-function-paren): | | Unexpected space before function parentheses. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js |2649|2649| }, |2650|2650| |2651|2651| "APPROACHINGMARKET": { |2652| |- "enter": function () { | |2652|+ "enter": function() { |2653|2653| this.SelectAnimation("move"); |2654|2654| }, |2655|2655| | | [NORMAL] ESLintBear (space-before-function-paren): | | Unexpected space before function parentheses. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js |2677|2677| |2678|2678| "REPAIR": { |2679|2679| "APPROACHING": { |2680| |- "enter": function () { | |2680|+ "enter": function() { |2681|2681| this.SelectAnimation("move"); |2682|2682| }, |2683|2683| | | [NORMAL] ESLintBear (object-curly-spacing): | | A space is required after '{'. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js |2718|2718| { |2719|2719| // The building was already finished/fully repaired before we arrived; |2720|2720| // let the ConstructionFinished handler handle this. |2721| |- this.OnGlobalConstructionFinished({"entity": this.repairTarget, "newentity": this.repairTarget}); | |2721|+ this.OnGlobalConstructionFinished({ "entity": this.repairTarget, "newentity": this.repairTarget}); |2722|2722| return true; |2723|2723| } |2724|2724| | | [NORMAL] ESLintBear (object-curly-spacing): | | A space is required before '}'. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js |2718|2718| { |2719|2719| // The building was already finished/fully repaired before we arrived; |2720|2720| // let the ConstructionFinished handler handle this. |2721| |- this.OnGlobalConstructionFinished({"entity": this.repairTarget, "newentity": this.repairTarget}); | |2721|+ this.OnGlobalConstructionFinished({"entity": this.repairTarget, "newentity": this.repairTarget }); |2722|2722| return true; |2723|2723| } |2724|2724| | | [NORMAL] ESLintBear (spaced-comment): | | Expected space or tab after '//' in comment. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js |2758|2758| if (this.MoveToTargetRange(this.repairTarget, IID_Builder)) |2759|2759| this.SetNextState("APPROACHING"); |2760|2760| else if (!this.CheckTargetRange(this.repairTarget, IID_Builder)) |2761| |- this.FinishOrder(); //can't approach and isn't in reach | |2761|+ this.FinishOrder(); // can't approach and isn't in reach |2762|2762| }, |2763|2763| }, |2764|2764| | | [NORMAL] ESLintBear (space-before-function-paren): | | Unexpected space before function parentheses. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js |2825|2825| var types = cmpResourceDropsite.GetTypes(); |2826|2826| // TODO: Slightly undefined behavior here, we don't know what type of resource will be collected, |2827|2827| // may cause problems for AIs (especially hunting fast animals), but avoid ugly hacks to fix that! |2828| |- var nearby = this.FindNearbyResource(function (ent, type, template) { | |2828|+ var nearby = this.FindNearbyResource(function(ent, type, template) { |2829|2829| return (types.indexOf(type.generic) != -1); |2830|2830| }, msg.data.newentity); |2831|2831| if (nearby) | | [NORMAL] ESLintBear (curly): | | Unnecessary { after 'if' condition. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js |2845|2845| |2846|2846| // Unit was approaching and there's nothing to do now, so switch to walking |2847|2847| if (oldState === "INDIVIDUAL.REPAIR.APPROACHING") |2848| |- { | |2848|+ |2849|2849| // We're already walking to the given point, so add this as a order. |2850|2850| this.WalkToTarget(msg.data.newentity, true); |2851| |- } | |2851|+ |2852|2852| }, |2853|2853| }, |2854|2854| | | [NORMAL] ESLintBear (curly): | | Unnecessary { after 'if' condition. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js |2895|2895| |2896|2896| // Check that we can garrison here |2897|2897| if (this.CanGarrison(target)) |2898| |- { | |2898|+ |2899|2899| // Check that we're in range of the garrison target |2900|2900| if (this.CheckGarrisonRange(target)) |2901|2901| { |2971|2971| return false; |2972|2972| } |2973|2973| } |2974| |- } | |2974|+ |2975|2975| // Garrisoning failed for some reason, so finish the order |2976|2976| this.FinishOrder(); |2977|2977| return true; | | [NORMAL] ESLintBear (curly): | | Unnecessary { after 'if' condition. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js |3088|3088| "Attacked": function(msg) { |3089|3089| if (this.template.NaturalBehaviour == "skittish" || |3090|3090| this.template.NaturalBehaviour == "passive") |3091| |- { | |3091|+ |3092|3092| this.Flee(msg.data.attacker, false); |3093| |- } | |3093|+ |3094|3094| else if (this.IsDangerousAnimal() || this.template.NaturalBehaviour == "defensive") |3095|3095| { |3096|3096| if (this.CanAttack(msg.data.attacker)) | | [NORMAL] ESLintBear (curly): | | Unnecessary { after 'if' condition. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js |3097|3097| this.Attack(msg.data.attacker, false); |3098|3098| } |3099|3099| else if (this.template.NaturalBehaviour == "domestic") |3100| |- { | |3100|+ |3101|3101| // Never flee, stop what we were doing |3102|3102| this.SetNextState("IDLE"); |3103| |- } | |3103|+ |3104|3104| }, |3105|3105| |3106|3106| "Order.LeaveFoundation": function(msg) { | | [NORMAL] ESLintBear (curly): | | Unnecessary { after 'if' condition. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js |3107|3107| // Move a tile outside the building |3108|3108| var range = 4; |3109|3109| if (this.MoveToTargetRangeExplicit(msg.data.target, range, range)) |3110| |- { | |3110|+ |3111|3111| // We've started walking to the given point |3112|3112| this.SetNextState("WALKING"); |3113| |- } | |3113|+ |3114|3114| else |3115|3115| { |3116|3116| // We are already at the target, or can't move at all | | [NORMAL] ESLintBear (curly): | | Unnecessary { after 'else'. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js |3112|3112| this.SetNextState("WALKING"); |3113|3113| } |3114|3114| else |3115| |- { | |3115|+ |3116|3116| // We are already at the target, or can't move at all |3117|3117| this.FinishOrder(); |3118| |- } | |3118|+ |3119|3119| }, |3120|3120| |3121|3121| "IDLE": { | | [NORMAL] ESLintBear (curly): | | Unnecessary { after 'if' condition. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js |3154|3154| } |3155|3155| // Start attacking one of the newly-seen enemy (if any) |3156|3156| else if (this.IsDangerousAnimal()) |3157| |- { | |3157|+ |3158|3158| this.AttackVisibleEntity(msg.data.added); |3159| |- } | |3159|+ |3160|3160| |3161|3161| // TODO: if two units enter our range together, we'll attack the |3162|3162| // first and then the second won't trigger another LosRangeUpdate | | [NORMAL] ESLintBear (curly): | | Unnecessary { after 'if' condition. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js |3197|3197| } |3198|3198| // Start attacking one of the newly-seen enemy (if any) |3199|3199| else if (this.template.NaturalBehaviour == "violent") |3200| |- { | |3200|+ |3201|3201| this.AttackVisibleEntity(msg.data.added); |3202| |- } | |3202|+ |3203|3203| }, |3204|3204| |3205|3205| "MoveCompleted": function() { }, | | [NORMAL] ESLintBear (indent): | | Expected indentation of 2 tabs but found 7. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js |3214|3214| "COMBAT": "INDIVIDUAL.COMBAT", // reuse the same combat behaviour for animals |3215|3215| |3216|3216| "WALKING": "INDIVIDUAL.WALKING", // reuse the same walking behaviour for animals |3217| |- // only used for domestic animals | |3217|+ // only used for domestic animals |3218|3218| }, |3219|3219| }; |3220|3220| | | [NORMAL] ESLintBear (no-unneeded-ternary): | | Unnecessary use of boolean literals in conditional expression. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js |3276|3276| |3277|3277| UnitAI.prototype.IsAnimal = function() |3278|3278| { |3279| |- return (this.template.NaturalBehaviour ? true : false); | |3279|+ return (!!this.template.NaturalBehaviour); |3280|3280| }; |3281|3281| |3282|3282| UnitAI.prototype.IsDangerousAnimal = function() | | [NORMAL] ESLintBear (curly): | | Unnecessary { after 'if' condition. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js |3314|3314| UnitAI.prototype.GetGarrisonHolder = function() |3315|3315| { |3316|3316| if (this.IsGarrisoned()) |3317| |- { | |3317|+ |3318|3318| for (let order of this.orderQueue) |3319|3319| if (order.type == "Garrison" || order.type == "Autogarrison") |3320|3320| return order.data.target; |3321| |- } | |3321|+ |3322|3322| return INVALID_ENTITY; |3323|3323| }; |3324|3324| | | [NORMAL] ESLintBear (comma-spacing): | | A space is required after ','. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js |3395|3395| { |3396|3396| let index = this.GetCurrentState().indexOf("."); |3397|3397| if (index != -1) |3398| |- this.UnitFsm.SwitchToNextState(this, this.GetCurrentState().slice(0,index)); | |3398|+ this.UnitFsm.SwitchToNextState(this, this.GetCurrentState().slice(0, index)); |3399|3399| this.Stop(false); |3400|3400| } |3401|3401| | | [NORMAL] ESLintBear (object-curly-spacing): | | A space is required after '{'. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js |3451|3451| if (this.orderQueue[i].type != "PickupUnit" || this.orderQueue[i].data.target != msg.entity) |3452|3452| continue; |3453|3453| if (i == 0) |3454| |- this.UnitFsm.ProcessMessage(this, {"type": "PickupCanceled", "data": msg}); | |3454|+ this.UnitFsm.ProcessMessage(this, { "type": "PickupCanceled", "data": msg}); |3455|3455| else |3456|3456| this.orderQueue.splice(i, 1); |3457|3457| Engine.PostMessage(this.entity, MT_UnitAIOrderDataChanged, { "to": this.GetOrderData() }); | | [NORMAL] ESLintBear (object-curly-spacing): | | A space is required before '}'. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js |3451|3451| if (this.orderQueue[i].type != "PickupUnit" || this.orderQueue[i].data.target != msg.entity) |3452|3452| continue; |3453|3453| if (i == 0) |3454| |- this.UnitFsm.ProcessMessage(this, {"type": "PickupCanceled", "data": msg}); | |3454|+ this.UnitFsm.ProcessMessage(this, {"type": "PickupCanceled", "data": msg }); |3455|3455| else |3456|3456| this.orderQueue.splice(i, 1); |3457|3457| Engine.PostMessage(this.entity, MT_UnitAIOrderDataChanged, { "to": this.GetOrderData() }); | | [NORMAL] ESLintBear (spaced-comment): | | Expected space or tab after '//' in comment. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js |3535|3535| }; |3536|3536| |3537|3537| |3538| |-//// FSM linkage functions //// | |3538|+// // FSM linkage functions //// |3539|3539| |3540|3540| UnitAI.prototype.SetNextState = function(state) |3541|3541| { | | [NORMAL] ESLintBear (object-curly-spacing): | | A space is required after '{'. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js |3586|3586| if (this.orderQueue.length) |3587|3587| { |3588|3588| let ret = this.UnitFsm.ProcessMessage(this, |3589| |- {"type": "Order."+this.order.type, "data": this.order.data} | |3589|+ { "type": "Order."+this.order.type, "data": this.order.data} |3590|3590| ); |3591|3591| |3592|3592| Engine.PostMessage(this.entity, MT_UnitAIOrderDataChanged, { "to": this.GetOrderData() }); | | [NORMAL] ESLintBear (object-curly-spacing): | | A space is required before '}'. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js |3586|3586| if (this.orderQueue.length) |3587|3587| { |3588|3588| let ret = this.UnitFsm.ProcessMessage(this, |3589| |- {"type": "Order."+this.order.type, "data": this.order.data} | |3589|+ {"type": "Order."+this.order.type, "data": this.order.data } |3590|3590| ); |3591|3591| |3592|3592| Engine.PostMessage(this.entity, MT_UnitAIOrderDataChanged, { "to": this.GetOrderData() }); | | [NORMAL] ESLintBear (no-else-return): | | Unnecessary 'else' after 'return'. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js |3599|3599| // Otherwise we've successfully processed a new order |3600|3600| return true; |3601|3601| } |3602| |- else |3603| |- { | |3602|+ |3604|3603| this.SetNextState("IDLE"); |3605|3604| |3606|3605| Engine.PostMessage(this.entity, MT_UnitAIOrderDataChanged, { "to": this.GetOrderData() }); |3621|3620| } |3622|3621| |3623|3622| return false; |3624| |- } | |3623|+ |3625|3624| }; |3626|3625| |3627|3626| /** | | [NORMAL] ESLintBear (object-curly-spacing): | | A space is required after '{'. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js |3638|3638| { |3639|3639| this.order = order; |3640|3640| let ret = this.UnitFsm.ProcessMessage(this, |3641| |- {"type": "Order."+this.order.type, "data": this.order.data} | |3641|+ { "type": "Order."+this.order.type, "data": this.order.data} |3642|3642| ); |3643|3643| |3644|3644| // If the order was rejected then immediately take it off | | [NORMAL] ESLintBear (object-curly-spacing): | | A space is required before '}'. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js |3638|3638| { |3639|3639| this.order = order; |3640|3640| let ret = this.UnitFsm.ProcessMessage(this, |3641| |- {"type": "Order."+this.order.type, "data": this.order.data} | |3641|+ {"type": "Order."+this.order.type, "data": this.order.data } |3642|3642| ); |3643|3643| |3644|3644| // If the order was rejected then immediately take it off | | [NORMAL] ESLintBear (object-curly-spacing): | | A space is required after '{'. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js |3674|3674| this.orderQueue.unshift(order); |3675|3675| this.order = order; |3676|3676| let ret = this.UnitFsm.ProcessMessage(this, |3677| |- {"type": "Order."+this.order.type, "data": this.order.data} | |3677|+ { "type": "Order."+this.order.type, "data": this.order.data} |3678|3678| ); |3679|3679| |3680|3680| // If the order was rejected then immediately take it off again; | | [NORMAL] ESLintBear (object-curly-spacing): | | A space is required before '}'. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js |3674|3674| this.orderQueue.unshift(order); |3675|3675| this.order = order; |3676|3676| let ret = this.UnitFsm.ProcessMessage(this, |3677| |- {"type": "Order."+this.order.type, "data": this.order.data} | |3677|+ {"type": "Order."+this.order.type, "data": this.order.data } |3678|3678| ); |3679|3679| |3680|3680| // If the order was rejected then immediately take it off again; | | [NORMAL] ESLintBear (object-curly-spacing): | | A space is required after '{'. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js |3708|3708| continue; |3709|3709| if (this.orderQueue[i].type == type) |3710|3710| continue; |3711| |- this.orderQueue.splice(i, 0, {"type": type, "data": data}); | |3711|+ this.orderQueue.splice(i, 0, { "type": type, "data": data}); |3712|3712| Engine.PostMessage(this.entity, MT_UnitAIOrderDataChanged, { "to": this.GetOrderData() }); |3713|3713| return; |3714|3714| } | | [NORMAL] ESLintBear (object-curly-spacing): | | A space is required before '}'. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js |3708|3708| continue; |3709|3709| if (this.orderQueue[i].type == type) |3710|3710| continue; |3711| |- this.orderQueue.splice(i, 0, {"type": type, "data": data}); | |3711|+ this.orderQueue.splice(i, 0, {"type": type, "data": data }); |3712|3712| Engine.PostMessage(this.entity, MT_UnitAIOrderDataChanged, { "to": this.GetOrderData() }); |3713|3713| return; |3714|3714| } | | [NORMAL] ESLintBear (curly): | | Unnecessary { after 'if' condition. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js |3722|3722| { |3723|3723| // Remember the previous work orders to be able to go back to them later if required |3724|3724| if (data && data.force) |3725| |- { | |3725|+ |3726|3726| if (this.IsFormationController()) |3727|3727| this.CallMemberFunction("UpdateWorkOrders", [type]); |3728|3728| else |3729|3729| this.UpdateWorkOrders(type); |3730| |- } | |3730|+ |3731|3731| |3732|3732| let garrisonHolder = this.IsGarrisoned() && type != "Ungarrison" ? this.GetGarrisonHolder() : null; |3733|3733| | | [NORMAL] ESLintBear (curly): | | Unnecessary { after 'if' condition. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js |3799|3799| { |3800|3800| var cmpUnitAI = Engine.QueryInterface(this.formationController, IID_UnitAI); |3801|3801| if (cmpUnitAI) |3802| |- { | |3802|+ |3803|3803| for (var i = 0; i < cmpUnitAI.orderQueue.length; ++i) |3804|3804| { |3805|3805| if (isWorkType(cmpUnitAI.orderQueue[i].type)) |3808|3808| return; |3809|3809| } |3810|3810| } |3811| |- } | |3811|+ |3812|3812| } |3813|3813| |3814|3814| // If nothing found, take the unit orders | | [NORMAL] ESLintBear (curly): | | Unnecessary { after 'for' condition. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js |3801|3801| if (cmpUnitAI) |3802|3802| { |3803|3803| for (var i = 0; i < cmpUnitAI.orderQueue.length; ++i) |3804| |- { | |3804|+ |3805|3805| if (isWorkType(cmpUnitAI.orderQueue[i].type)) |3806|3806| { |3807|3807| this.workOrders = cmpUnitAI.orderQueue.slice(i); |3808|3808| return; |3809|3809| } |3810| |- } | |3810|+ |3811|3811| } |3812|3812| } |3813|3813| | | [NORMAL] ESLintBear (curly): | | Unnecessary { after 'for' condition. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js |3813|3813| |3814|3814| // If nothing found, take the unit orders |3815|3815| for (var i = 0; i < this.orderQueue.length; ++i) |3816| |- { | |3816|+ |3817|3817| if (isWorkType(this.orderQueue[i].type)) |3818|3818| { |3819|3819| this.workOrders = this.orderQueue.slice(i); |3820|3820| return; |3821|3821| } |3822| |- } | |3822|+ |3823|3823| }; |3824|3824| |3825|3825| UnitAI.prototype.BackToWork = function() | | [NORMAL] ESLintBear (object-curly-spacing): | | A space is required after '{'. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js |3879|3879| if (data.timerRepeat === undefined) |3880|3880| this.timer = undefined; |3881|3881| |3882| |- this.UnitFsm.ProcessMessage(this, {"type": "Timer", "data": data, "lateness": lateness}); | |3882|+ this.UnitFsm.ProcessMessage(this, { "type": "Timer", "data": data, "lateness": lateness}); |3883|3883| }; |3884|3884| |3885|3885| /** | | [NORMAL] ESLintBear (object-curly-spacing): | | A space is required before '}'. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js |3879|3879| if (data.timerRepeat === undefined) |3880|3880| this.timer = undefined; |3881|3881| |3882| |- this.UnitFsm.ProcessMessage(this, {"type": "Timer", "data": data, "lateness": lateness}); | |3882|+ this.UnitFsm.ProcessMessage(this, {"type": "Timer", "data": data, "lateness": lateness }); |3883|3883| }; |3884|3884| |3885|3885| /** | | [NORMAL] ESLintBear (spaced-comment): | | Expected space or tab after '//' in comment. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js |3914|3914| this.timer = undefined; |3915|3915| }; |3916|3916| |3917| |-//// Message handlers ///// | |3917|+// // Message handlers ///// |3918|3918| |3919|3919| UnitAI.prototype.OnMotionChanged = function(msg) |3920|3920| { | | [NORMAL] ESLintBear (object-curly-spacing): | | A space is required after '{'. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js |3919|3919| UnitAI.prototype.OnMotionChanged = function(msg) |3920|3920| { |3921|3921| if (msg.starting && !msg.error) |3922| |- this.UnitFsm.ProcessMessage(this, {"type": "MoveStarted", "data": msg}); | |3922|+ this.UnitFsm.ProcessMessage(this, { "type": "MoveStarted", "data": msg}); |3923|3923| else if (!msg.starting || msg.error) |3924|3924| this.UnitFsm.ProcessMessage(this, {"type": "MoveCompleted", "data": msg}); |3925|3925| }; | | [NORMAL] ESLintBear (object-curly-spacing): | | A space is required before '}'. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js |3919|3919| UnitAI.prototype.OnMotionChanged = function(msg) |3920|3920| { |3921|3921| if (msg.starting && !msg.error) |3922| |- this.UnitFsm.ProcessMessage(this, {"type": "MoveStarted", "data": msg}); | |3922|+ this.UnitFsm.ProcessMessage(this, {"type": "MoveStarted", "data": msg }); |3923|3923| else if (!msg.starting || msg.error) |3924|3924| this.UnitFsm.ProcessMessage(this, {"type": "MoveCompleted", "data": msg}); |3925|3925| }; | | [NORMAL] ESLintBear (object-curly-spacing): | | A space is required after '{'. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js |3921|3921| if (msg.starting && !msg.error) |3922|3922| this.UnitFsm.ProcessMessage(this, {"type": "MoveStarted", "data": msg}); |3923|3923| else if (!msg.starting || msg.error) |3924| |- this.UnitFsm.ProcessMessage(this, {"type": "MoveCompleted", "data": msg}); | |3924|+ this.UnitFsm.ProcessMessage(this, { "type": "MoveCompleted", "data": msg}); |3925|3925| }; |3926|3926| |3927|3927| UnitAI.prototype.OnGlobalConstructionFinished = function(msg) | | [NORMAL] ESLintBear (object-curly-spacing): | | A space is required before '}'. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js |3921|3921| if (msg.starting && !msg.error) |3922|3922| this.UnitFsm.ProcessMessage(this, {"type": "MoveStarted", "data": msg}); |3923|3923| else if (!msg.starting || msg.error) |3924| |- this.UnitFsm.ProcessMessage(this, {"type": "MoveCompleted", "data": msg}); | |3924|+ this.UnitFsm.ProcessMessage(this, {"type": "MoveCompleted", "data": msg }); |3925|3925| }; |3926|3926| |3927|3927| UnitAI.prototype.OnGlobalConstructionFinished = function(msg) | | [NORMAL] ESLintBear (object-curly-spacing): | | A space is required after '{'. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js |3929|3929| // TODO: This is a bit inefficient since every unit listens to every |3930|3930| // construction message - ideally we could scope it to only the one we're building |3931|3931| |3932| |- this.UnitFsm.ProcessMessage(this, {"type": "ConstructionFinished", "data": msg}); | |3932|+ this.UnitFsm.ProcessMessage(this, { "type": "ConstructionFinished", "data": msg}); |3933|3933| }; |3934|3934| |3935|3935| UnitAI.prototype.OnGlobalEntityRenamed = function(msg) | | [NORMAL] ESLintBear (object-curly-spacing): | | A space is required before '}'. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js |3929|3929| // TODO: This is a bit inefficient since every unit listens to every |3930|3930| // construction message - ideally we could scope it to only the one we're building |3931|3931| |3932| |- this.UnitFsm.ProcessMessage(this, {"type": "ConstructionFinished", "data": msg}); | |3932|+ this.UnitFsm.ProcessMessage(this, {"type": "ConstructionFinished", "data": msg }); |3933|3933| }; |3934|3934| |3935|3935| UnitAI.prototype.OnGlobalEntityRenamed = function(msg) | | [NORMAL] ESLintBear (object-curly-spacing): | | A space is required after '{'. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js |3954|3954| |3955|3955| UnitAI.prototype.OnAttacked = function(msg) |3956|3956| { |3957| |- this.UnitFsm.ProcessMessage(this, {"type": "Attacked", "data": msg}); | |3957|+ this.UnitFsm.ProcessMessage(this, { "type": "Attacked", "data": msg}); |3958|3958| }; |3959|3959| |3960|3960| UnitAI.prototype.OnGuardedAttacked = function(msg) | | [NORMAL] ESLintBear (object-curly-spacing): | | A space is required before '}'. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js |3954|3954| |3955|3955| UnitAI.prototype.OnAttacked = function(msg) |3956|3956| { |3957| |- this.UnitFsm.ProcessMessage(this, {"type": "Attacked", "data": msg}); | |3957|+ this.UnitFsm.ProcessMessage(this, {"type": "Attacked", "data": msg }); |3958|3958| }; |3959|3959| |3960|3960| UnitAI.prototype.OnGuardedAttacked = function(msg) | | [NORMAL] ESLintBear (object-curly-spacing): | | A space is required after '{'. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js |3959|3959| |3960|3960| UnitAI.prototype.OnGuardedAttacked = function(msg) |3961|3961| { |3962| |- this.UnitFsm.ProcessMessage(this, {"type": "GuardedAttacked", "data": msg.data}); | |3962|+ this.UnitFsm.ProcessMessage(this, { "type": "GuardedAttacked", "data": msg.data}); |3963|3963| }; |3964|3964| |3965|3965| UnitAI.prototype.OnHealthChanged = function(msg) | | [NORMAL] ESLintBear (object-curly-spacing): | | A space is required before '}'. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js |3959|3959| |3960|3960| UnitAI.prototype.OnGuardedAttacked = function(msg) |3961|3961| { |3962| |- this.UnitFsm.ProcessMessage(this, {"type": "GuardedAttacked", "data": msg.data}); | |3962|+ this.UnitFsm.ProcessMessage(this, {"type": "GuardedAttacked", "data": msg.data }); |3963|3963| }; |3964|3964| |3965|3965| UnitAI.prototype.OnHealthChanged = function(msg) | | [NORMAL] ESLintBear (object-curly-spacing): | | A space is required after '{'. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js |3964|3964| |3965|3965| UnitAI.prototype.OnHealthChanged = function(msg) |3966|3966| { |3967| |- this.UnitFsm.ProcessMessage(this, {"type": "HealthChanged", "from": msg.from, "to": msg.to}); | |3967|+ this.UnitFsm.ProcessMessage(this, { "type": "HealthChanged", "from": msg.from, "to": msg.to}); |3968|3968| }; |3969|3969| |3970|3970| UnitAI.prototype.OnRangeUpdate = function(msg) | | [NORMAL] ESLintBear (object-curly-spacing): | | A space is required before '}'. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js |3964|3964| |3965|3965| UnitAI.prototype.OnHealthChanged = function(msg) |3966|3966| { |3967| |- this.UnitFsm.ProcessMessage(this, {"type": "HealthChanged", "from": msg.from, "to": msg.to}); | |3967|+ this.UnitFsm.ProcessMessage(this, {"type": "HealthChanged", "from": msg.from, "to": msg.to }); |3968|3968| }; |3969|3969| |3970|3970| UnitAI.prototype.OnRangeUpdate = function(msg) | | [NORMAL] ESLintBear (object-curly-spacing): | | A space is required after '{'. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js |3970|3970| UnitAI.prototype.OnRangeUpdate = function(msg) |3971|3971| { |3972|3972| if (msg.tag == this.losRangeQuery) |3973| |- this.UnitFsm.ProcessMessage(this, {"type": "LosRangeUpdate", "data": msg}); | |3973|+ this.UnitFsm.ProcessMessage(this, { "type": "LosRangeUpdate", "data": msg}); |3974|3974| else if (msg.tag == this.losHealRangeQuery) |3975|3975| this.UnitFsm.ProcessMessage(this, {"type": "LosHealRangeUpdate", "data": msg}); |3976|3976| }; | | [NORMAL] ESLintBear (object-curly-spacing): | | A space is required before '}'. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js |3970|3970| UnitAI.prototype.OnRangeUpdate = function(msg) |3971|3971| { |3972|3972| if (msg.tag == this.losRangeQuery) |3973| |- this.UnitFsm.ProcessMessage(this, {"type": "LosRangeUpdate", "data": msg}); | |3973|+ this.UnitFsm.ProcessMessage(this, {"type": "LosRangeUpdate", "data": msg }); |3974|3974| else if (msg.tag == this.losHealRangeQuery) |3975|3975| this.UnitFsm.ProcessMessage(this, {"type": "LosHealRangeUpdate", "data": msg}); |3976|3976| }; | | [NORMAL] ESLintBear (object-curly-spacing): | | A space is required after '{'. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js |3972|3972| if (msg.tag == this.losRangeQuery) |3973|3973| this.UnitFsm.ProcessMessage(this, {"type": "LosRangeUpdate", "data": msg}); |3974|3974| else if (msg.tag == this.losHealRangeQuery) |3975| |- this.UnitFsm.ProcessMessage(this, {"type": "LosHealRangeUpdate", "data": msg}); | |3975|+ this.UnitFsm.ProcessMessage(this, { "type": "LosHealRangeUpdate", "data": msg}); |3976|3976| }; |3977|3977| |3978|3978| UnitAI.prototype.OnPackFinished = function(msg) | | [NORMAL] ESLintBear (object-curly-spacing): | | A space is required before '}'. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js |3972|3972| if (msg.tag == this.losRangeQuery) |3973|3973| this.UnitFsm.ProcessMessage(this, {"type": "LosRangeUpdate", "data": msg}); |3974|3974| else if (msg.tag == this.losHealRangeQuery) |3975| |- this.UnitFsm.ProcessMessage(this, {"type": "LosHealRangeUpdate", "data": msg}); | |3975|+ this.UnitFsm.ProcessMessage(this, {"type": "LosHealRangeUpdate", "data": msg }); |3976|3976| }; |3977|3977| |3978|3978| UnitAI.prototype.OnPackFinished = function(msg) | | [NORMAL] ESLintBear (object-curly-spacing): | | A space is required after '{'. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js |3977|3977| |3978|3978| UnitAI.prototype.OnPackFinished = function(msg) |3979|3979| { |3980| |- this.UnitFsm.ProcessMessage(this, {"type": "PackFinished", "packed": msg.packed}); | |3980|+ this.UnitFsm.ProcessMessage(this, { "type": "PackFinished", "packed": msg.packed}); |3981|3981| }; |3982|3982| |3983|3983| //// Helper functions to be called by the FSM //// | | [NORMAL] ESLintBear (object-curly-spacing): | | A space is required before '}'. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js |3977|3977| |3978|3978| UnitAI.prototype.OnPackFinished = function(msg) |3979|3979| { |3980| |- this.UnitFsm.ProcessMessage(this, {"type": "PackFinished", "packed": msg.packed}); | |3980|+ this.UnitFsm.ProcessMessage(this, {"type": "PackFinished", "packed": msg.packed }); |3981|3981| }; |3982|3982| |3983|3983| //// Helper functions to be called by the FSM //// | | [NORMAL] ESLintBear (spaced-comment): | | Expected space or tab after '//' in comment. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js |3980|3980| this.UnitFsm.ProcessMessage(this, {"type": "PackFinished", "packed": msg.packed}); |3981|3981| }; |3982|3982| |3983| |-//// Helper functions to be called by the FSM //// | |3983|+// // Helper functions to be called by the FSM //// |3984|3984| |3985|3985| UnitAI.prototype.GetWalkSpeed = function() |3986|3986| { | | [NORMAL] ESLintBear (semi): | | Missing semicolon. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js |4084|4084| if (!cmpOwnership || cmpOwnership.GetOwner() == INVALID_PLAYER) |4085|4085| return undefined; |4086|4086| |4087| |- let cmpPosition = Engine.QueryInterface(this.entity, IID_Position) | |4087|+ let cmpPosition = Engine.QueryInterface(this.entity, IID_Position); |4088|4088| if (!cmpPosition || !cmpPosition.IsInWorld()) |4089|4089| return undefined; |4090|4090| | | [NORMAL] ESLintBear (curly): | | Unnecessary { after 'else'. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js |4169|4169| PlaySound(name, member); |4170|4170| } |4171|4171| else |4172| |- { | |4172|+ |4173|4173| // Otherwise use our own sounds |4174|4174| PlaySound(name, this.entity); |4175| |- } | |4175|+ |4176|4176| }; |4177|4177| |4178|4178| /* | | [NORMAL] ESLintBear (spaced-comment): | | Expected space or tab after '//' in comment. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js |4356|4356| else |4357|4357| // return false? Or hope you come close enough? |4358|4358| var parabolicMaxRange = 0; |4359| |- //return false; | |4359|+ // return false; |4360|4360| |4361|4361| // the parabole changes while walking, take something in the middle |4362|4362| var guessedMaxRange = (range.max + parabolicMaxRange)/2; | | [NORMAL] ESLintBear (operator-linebreak): | | '&&' should be placed at the end of the line. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js |4421|4421| if (this.IsFormationMember()) |4422|4422| { |4423|4423| var cmpFormationUnitAI = Engine.QueryInterface(this.formationController, IID_UnitAI); |4424| |- if (cmpFormationUnitAI && cmpFormationUnitAI.IsAttackingAsFormation() |4425| |- && cmpFormationUnitAI.order.data.target == target) | |4424|+ if (cmpFormationUnitAI && cmpFormationUnitAI.IsAttackingAsFormation() && | |4425|+ cmpFormationUnitAI.order.data.target == target) |4426|4426| return true; |4427|4427| } |4428|4428| | | [NORMAL] ESLintBear (object-curly-spacing): | | A space is required after '{'. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js |4541|4541| var pos = cmpPosition.GetPosition(); |4542|4542| var heldPosition = this.heldPosition; |4543|4543| if (heldPosition === undefined) |4544| |- heldPosition = {"x": pos.x, "z": pos.z}; | |4544|+ heldPosition = { "x": pos.x, "z": pos.z}; |4545|4545| |4546|4546| return Math.euclidDistance2D(pos.x, pos.z, heldPosition.x, heldPosition.z) < halfvision + range.max; |4547|4547| }; | | [NORMAL] ESLintBear (object-curly-spacing): | | A space is required before '}'. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js |4541|4541| var pos = cmpPosition.GetPosition(); |4542|4542| var heldPosition = this.heldPosition; |4543|4543| if (heldPosition === undefined) |4544| |- heldPosition = {"x": pos.x, "z": pos.z}; | |4544|+ heldPosition = {"x": pos.x, "z": pos.z }; |4545|4545| |4546|4546| return Math.euclidDistance2D(pos.x, pos.z, heldPosition.x, heldPosition.z) < halfvision + range.max; |4547|4547| }; | | [NORMAL] ESLintBear (operator-linebreak): | | '&&' should be placed at the end of the line. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js |4589|4589| UnitAI.prototype.AttackEntityInZone = function(ents) |4590|4590| { |4591|4591| var target = ents.find(target => |4592| |- this.CanAttack(target) |4593| |- && this.CheckTargetDistanceFromHeldPosition(target, IID_Attack, this.GetBestAttackAgainst(target, true)) | |4592|+ this.CanAttack(target) && | |4593|+ this.CheckTargetDistanceFromHeldPosition(target, IID_Attack, this.GetBestAttackAgainst(target, true)) |4594|4594| && (this.GetStance().respondChaseBeyondVision || this.CheckTargetIsInVisionRange(target)) |4595|4595| ); |4596|4596| if (!target) | | [NORMAL] ESLintBear (operator-linebreak): | | '&&' should be placed at the end of the line. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js |4590|4590| { |4591|4591| var target = ents.find(target => |4592|4592| this.CanAttack(target) |4593| |- && this.CheckTargetDistanceFromHeldPosition(target, IID_Attack, this.GetBestAttackAgainst(target, true)) |4594| |- && (this.GetStance().respondChaseBeyondVision || this.CheckTargetIsInVisionRange(target)) | |4593|+ && this.CheckTargetDistanceFromHeldPosition(target, IID_Attack, this.GetBestAttackAgainst(target, true)) && | |4594|+ (this.GetStance().respondChaseBeyondVision || this.CheckTargetIsInVisionRange(target)) |4595|4595| ); |4596|4596| if (!target) |4597|4597| return false; | | [NORMAL] ESLintBear (no-multi-spaces): | | Multiple spaces found before 'Engine'. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js |4654|4654| // If we are guarding/escorting, don't abandon as long as the guarded unit is in target range of the attacker |4655|4655| if (this.isGuardOf) |4656|4656| { |4657| |- var cmpUnitAI = Engine.QueryInterface(target, IID_UnitAI); | |4657|+ var cmpUnitAI = Engine.QueryInterface(target, IID_UnitAI); |4658|4658| var cmpAttack = Engine.QueryInterface(target, IID_Attack); |4659|4659| if (cmpUnitAI && cmpAttack && |4660|4660| cmpAttack.GetAttackTypes().some(type => cmpUnitAI.CheckTargetAttackRange(this.isGuardOf, type))) | | [NORMAL] ESLintBear (indent): | | Expected indentation of 3 tabs but found 4. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js |4658|4658| var cmpAttack = Engine.QueryInterface(target, IID_Attack); |4659|4659| if (cmpUnitAI && cmpAttack && |4660|4660| cmpAttack.GetAttackTypes().some(type => cmpUnitAI.CheckTargetAttackRange(this.isGuardOf, type))) |4661| |- return false; | |4661|+ return false; |4662|4662| } |4663|4663| |4664|4664| // Stop if we're in hold-ground mode and it's too far from the holding point | | [NORMAL] ESLintBear (curly): | | Unnecessary { after 'if' condition. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js |4663|4663| |4664|4664| // Stop if we're in hold-ground mode and it's too far from the holding point |4665|4665| if (this.GetStance().respondHoldGround) |4666| |- { | |4666|+ |4667|4667| if (!this.CheckTargetDistanceFromHeldPosition(target, iid, type)) |4668|4668| return true; |4669| |- } | |4669|+ |4670|4670| |4671|4671| // Stop if it's left our vision range, unless we're especially persistent |4672|4672| if (!this.GetStance().respondChaseBeyondVision) | | [NORMAL] ESLintBear (curly): | | Unnecessary { after 'if' condition. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js |4670|4670| |4671|4671| // Stop if it's left our vision range, unless we're especially persistent |4672|4672| if (!this.GetStance().respondChaseBeyondVision) |4673| |- { | |4673|+ |4674|4674| if (!this.CheckTargetIsInVisionRange(target)) |4675|4675| return true; |4676| |- } | |4676|+ |4677|4677| |4678|4678| // (Note that CCmpUnitMotion will detect if the target is lost in FoW, |4679|4679| // and will continue moving to its last seen position and then stop) | | [NORMAL] ESLintBear (no-multi-spaces): | | Multiple spaces found before 'Engine'. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js |4701|4701| // If we are guarding/escorting, chase at least as long as the guarded unit is in target range of the attacker |4702|4702| if (this.isGuardOf) |4703|4703| { |4704| |- var cmpUnitAI = Engine.QueryInterface(target, IID_UnitAI); | |4704|+ var cmpUnitAI = Engine.QueryInterface(target, IID_UnitAI); |4705|4705| var cmpAttack = Engine.QueryInterface(target, IID_Attack); |4706|4706| if (cmpUnitAI && cmpAttack && |4707|4707| cmpAttack.GetAttackTypes().some(type => cmpUnitAI.CheckTargetAttackRange(this.isGuardOf, type))) | | [NORMAL] ESLintBear (spaced-comment): | | Expected space or tab after '//' in comment. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js |4714|4714| return false; |4715|4715| }; |4716|4716| |4717| |-//// External interface functions //// | |4717|+// // External interface functions //// |4718|4718| |4719|4719| UnitAI.prototype.SetFormationController = function(ent) |4720|4720| { | | [NORMAL] ESLintBear (curly): | | Unnecessary { after 'if' condition. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js |4724|4724| // of our own formation (or ourself if not in formation) |4725|4725| var cmpObstruction = Engine.QueryInterface(this.entity, IID_Obstruction); |4726|4726| if (cmpObstruction) |4727| |- { | |4727|+ |4728|4728| if (ent == INVALID_ENTITY) |4729|4729| cmpObstruction.SetControlGroup(this.entity); |4730|4730| else |4731|4731| cmpObstruction.SetControlGroup(ent); |4732| |- } | |4732|+ |4733|4733| |4734|4734| // If we were removed from a formation, let the FSM switch back to INDIVIDUAL |4735|4735| if (ent == INVALID_ENTITY) | | [NORMAL] ESLintBear (curly): | | Unnecessary { after 'if' condition. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js |4867|4867| // if we already had an old guard order, do nothing if the target is the same |4868|4868| // and the order is running, otherwise remove the previous order |4869|4869| if (this.isGuardOf) |4870| |- { | |4870|+ |4871|4871| if (this.isGuardOf == target && this.order && this.order.type == "Guard") |4872|4872| return; |4873|4873| else |4874|4874| this.RemoveGuard(); |4875| |- } | |4875|+ |4876|4876| |4877|4877| this.AddOrder("Guard", { "target": target, "force": false }, queued); |4878|4878| }; | | [NORMAL] ESLintBear (no-else-return): | | Unnecessary 'else' after 'return'. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js |4870|4870| { |4871|4871| if (this.isGuardOf == target && this.order && this.order.type == "Guard") |4872|4872| return; |4873| |- else |4874| |- this.RemoveGuard(); | |4873|+ this.RemoveGuard(); |4875|4874| } |4876|4875| |4877|4876| this.AddOrder("Guard", { "target": target, "force": false }, queued); | | [NORMAL] ESLintBear (object-curly-spacing): | | A space is required after '{'. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js |4912|4912| return; |4913|4913| |4914|4914| if (this.order.type == "Guard") |4915| |- this.UnitFsm.ProcessMessage(this, {"type": "RemoveGuard"}); | |4915|+ this.UnitFsm.ProcessMessage(this, { "type": "RemoveGuard"}); |4916|4916| else |4917|4917| for (let i = 1; i < this.orderQueue.length; ++i) |4918|4918| if (this.orderQueue[i].type == "Guard") | | [NORMAL] ESLintBear (object-curly-spacing): | | A space is required before '}'. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js |4912|4912| return; |4913|4913| |4914|4914| if (this.order.type == "Guard") |4915| |- this.UnitFsm.ProcessMessage(this, {"type": "RemoveGuard"}); | |4915|+ this.UnitFsm.ProcessMessage(this, {"type": "RemoveGuard" }); |4916|4916| else |4917|4917| for (let i = 1; i < this.orderQueue.length; ++i) |4918|4918| if (this.orderQueue[i].type == "Guard") | | [NORMAL] ESLintBear (object-curly-spacing): | | A space is required before '}'. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js |5041|5041| this.WalkToTarget(target, queued); |5042|5042| return; |5043|5043| } |5044| |- this.AddOrder("Attack", { "target": target, "force": true, "allowCapture": allowCapture}, queued); | |5044|+ this.AddOrder("Attack", { "target": target, "force": true, "allowCapture": allowCapture }, queued); |5045|5045| }; |5046|5046| |5047|5047| /** | | [NORMAL] ESLintBear (no-trailing-spaces): | | Trailing spaces not allowed. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js |5190|5190| this.workOrders.length && this.workOrders[0].type == "Trade") |5191|5191| { |5192|5192| let cmpTrader = Engine.QueryInterface(this.entity, IID_Trader); |5193| |- if (cmpTrader.HasBothMarkets() && | |5193|+ if (cmpTrader.HasBothMarkets() && |5194|5194| (cmpTrader.GetFirstMarket() == target && cmpTrader.GetSecondMarket() == source || |5195|5195| cmpTrader.GetFirstMarket() == source && cmpTrader.GetSecondMarket() == target)) |5196|5196| { | | [NORMAL] ESLintBear (operator-linebreak): | | '&&' should be placed at the end of the line. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js |5471|5471| { |5472|5472| var cmpIdentity = Engine.QueryInterface(targ, IID_Identity); |5473|5473| var targetClasses = this.order.data.targetClasses; |5474| |- if (targetClasses.attack && cmpIdentity |5475| |- && !MatchesClassList(cmpIdentity.GetClassesList(), targetClasses.attack)) | |5474|+ if (targetClasses.attack && cmpIdentity && | |5475|+ !MatchesClassList(cmpIdentity.GetClassesList(), targetClasses.attack)) |5476|5476| continue; |5477|5477| if (targetClasses.avoid && cmpIdentity |5478|5478| && MatchesClassList(cmpIdentity.GetClassesList(), targetClasses.avoid)) | | [NORMAL] ESLintBear (operator-linebreak): | | '&&' should be placed at the end of the line. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js |5474|5474| if (targetClasses.attack && cmpIdentity |5475|5475| && !MatchesClassList(cmpIdentity.GetClassesList(), targetClasses.attack)) |5476|5476| continue; |5477| |- if (targetClasses.avoid && cmpIdentity |5478| |- && MatchesClassList(cmpIdentity.GetClassesList(), targetClasses.avoid)) | |5477|+ if (targetClasses.avoid && cmpIdentity && | |5478|+ MatchesClassList(cmpIdentity.GetClassesList(), targetClasses.avoid)) |5479|5479| continue; |5480|5480| // Only used by the AIs to prevent some choices of targets |5481|5481| if (targetClasses.vetoEntities && targetClasses.vetoEntities[targ]) | | [NORMAL] ESLintBear (operator-linebreak): | | '&&' should be placed at the end of the line. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js |5497|5497| { |5498|5498| var cmpIdentity = Engine.QueryInterface(targ, IID_Identity); |5499|5499| var targetClasses = this.order.data.targetClasses; |5500| |- if (cmpIdentity && targetClasses.attack |5501| |- && !MatchesClassList(cmpIdentity.GetClassesList(), targetClasses.attack)) | |5500|+ if (cmpIdentity && targetClasses.attack && | |5501|+ !MatchesClassList(cmpIdentity.GetClassesList(), targetClasses.attack)) |5502|5502| continue; |5503|5503| if (cmpIdentity && targetClasses.avoid |5504|5504| && MatchesClassList(cmpIdentity.GetClassesList(), targetClasses.avoid)) | | [NORMAL] ESLintBear (operator-linebreak): | | '&&' should be placed at the end of the line. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js |5500|5500| if (cmpIdentity && targetClasses.attack |5501|5501| && !MatchesClassList(cmpIdentity.GetClassesList(), targetClasses.attack)) |5502|5502| continue; |5503| |- if (cmpIdentity && targetClasses.avoid |5504| |- && MatchesClassList(cmpIdentity.GetClassesList(), targetClasses.avoid)) | |5503|+ if (cmpIdentity && targetClasses.avoid && | |5504|+ MatchesClassList(cmpIdentity.GetClassesList(), targetClasses.avoid)) |5505|5505| continue; |5506|5506| // Only used by the AIs to prevent some choices of targets |5507|5507| if (targetClasses.vetoEntities && targetClasses.vetoEntities[targ]) | | [NORMAL] ESLintBear (space-before-function-paren): | | Unexpected space before function parentheses. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js |5540|5540| |5541|5541| var cmpRangeManager = Engine.QueryInterface(SYSTEM_ENTITY, IID_RangeManager); |5542|5542| var entities = cmpRangeManager.ResetActiveQuery(this.losRangeQuery); |5543| |- var targets = entities.filter(function (v) { return cmpAttack.CanAttack(v) && attackfilter(v); }) | |5543|+ var targets = entities.filter(function(v) { return cmpAttack.CanAttack(v) && attackfilter(v); }) |5544|5544| .sort(function (a, b) { return cmpAttack.CompareEntitiesByPreference(a, b); }); |5545|5545| |5546|5546| return targets; | | [NORMAL] ESLintBear (space-before-function-paren): | | Unexpected space before function parentheses. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js |5541|5541| var cmpRangeManager = Engine.QueryInterface(SYSTEM_ENTITY, IID_RangeManager); |5542|5542| var entities = cmpRangeManager.ResetActiveQuery(this.losRangeQuery); |5543|5543| var targets = entities.filter(function (v) { return cmpAttack.CanAttack(v) && attackfilter(v); }) |5544| |- .sort(function (a, b) { return cmpAttack.CompareEntitiesByPreference(a, b); }); | |5544|+ .sort(function(a, b) { return cmpAttack.CompareEntitiesByPreference(a, b); }); |5545|5545| |5546|5546| return targets; |5547|5547| }; | | [NORMAL] ESLintBear (object-curly-spacing): | | A space is required after '{'. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js |5630|5630| |5631|5631| UnitAI.prototype.SetHeldPosition = function(x, z) |5632|5632| { |5633| |- this.heldPosition = {"x": x, "z": z}; | |5633|+ this.heldPosition = { "x": x, "z": z}; |5634|5634| }; |5635|5635| |5636|5636| UnitAI.prototype.SetHeldPositionOnEntity = function(entity) | | [NORMAL] ESLintBear (object-curly-spacing): | | A space is required before '}'. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js |5630|5630| |5631|5631| UnitAI.prototype.SetHeldPosition = function(x, z) |5632|5632| { |5633| |- this.heldPosition = {"x": x, "z": z}; | |5633|+ this.heldPosition = {"x": x, "z": z }; |5634|5634| }; |5635|5635| |5636|5636| UnitAI.prototype.SetHeldPositionOnEntity = function(entity) | | [NORMAL] ESLintBear (spaced-comment): | | Expected space or tab after '//' in comment. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js |5657|5657| return false; |5658|5658| }; |5659|5659| |5660| |-//// Helper functions //// | |5660|+// // Helper functions //// |5661|5661| |5662|5662| UnitAI.prototype.CanAttack = function(target) |5663|5663| { | | [NORMAL] ESLintBear (spaced-comment): | | Expected space or tab after '//' in comment. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js |5861|5861| return (cmpPack && cmpPack.IsPacking()); |5862|5862| }; |5863|5863| |5864| |-//// Formation specific functions //// | |5864|+// // Formation specific functions //// |5865|5865| |5866|5866| UnitAI.prototype.IsAttackingAsFormation = function() |5867|5867| { | | [NORMAL] ESLintBear (operator-linebreak): | | '&&' should be placed at the end of the line. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js |5866|5866| UnitAI.prototype.IsAttackingAsFormation = function() |5867|5867| { |5868|5868| var cmpAttack = Engine.QueryInterface(this.entity, IID_Attack); |5869| |- return cmpAttack && cmpAttack.CanAttackAsFormation() |5870| |- && this.GetCurrentState() == "FORMATIONCONTROLLER.COMBAT.ATTACKING"; | |5869|+ return cmpAttack && cmpAttack.CanAttackAsFormation() && | |5870|+ this.GetCurrentState() == "FORMATIONCONTROLLER.COMBAT.ATTACKING"; |5871|5871| }; |5872|5872| |5873|5873| //// Animal specific functions //// | | [NORMAL] ESLintBear (spaced-comment): | | Expected space or tab after '//' in comment. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js |5870|5870| && this.GetCurrentState() == "FORMATIONCONTROLLER.COMBAT.ATTACKING"; |5871|5871| }; |5872|5872| |5873| |-//// Animal specific functions //// | |5873|+// // Animal specific functions //// |5874|5874| |5875|5875| UnitAI.prototype.MoveRandomly = function(distance) |5876|5876| { binaries/data/mods/public/simulation/components/UnitAI.js |2410| » » » » » » let·nearby·=·this.FindNearestDropsite(resourceType.generic); | | [NORMAL] ESLintBear (no-shadow): | | 'nearby' is already declared in the upper scope. binaries/data/mods/public/simulation/components/UnitAI.js |3784| » var·isWorkType·=·type·=>·type·==·"Gather"·||·type·==·"Trade"·||·type·==·"Repair"·||·type·==·"ReturnResource"; | | [NORMAL] ESLintBear (no-shadow): | | 'type' is already declared in the upper scope. binaries/data/mods/public/simulation/components/UnitAI.js |4576| » var·target·=·ents.find(target·=>·this.CanAttack(target)); | | [NORMAL] ESLintBear (no-shadow): | | 'target' is already declared in the upper scope. binaries/data/mods/public/simulation/components/UnitAI.js |4591| » var·target·=·ents.find(target·=> | | [NORMAL] ESLintBear (no-shadow): | | 'target' is already declared in the upper scope. binaries/data/mods/public/simulation/components/UnitAI.js |4637| » var·ent·=·ents.find(ent·=>·this.CanHeal(ent)); | | [NORMAL] ESLintBear (no-shadow): | | 'ent' is already declared in the upper scope. binaries/data/mods/public/simulation/components/UnitAI.js |4660| » » ····cmpAttack.GetAttackTypes().some(type·=>·cmpUnitAI.CheckTargetAttackRange(this.isGuardOf,·type))) | | [NORMAL] ESLintBear (no-shadow): | | 'type' is already declared in the upper scope. binaries/data/mods/public/simulation/components/UnitAI.js |5121| » var·lastPos·=·undefined; | | [NORMAL] ESLintBear (no-undef-init): | | It's not necessary to initialize 'lastPos' to undefined. binaries/data/mods/public/simulation/components/UnitAI.js | 356| » » ····&&·(this.lastShorelinePosition.z·==·cmpPosition.GetPosition().z)) | | [NORMAL] JSHintBear: | | Misleading line break before '&&'; readers may interpret this as an expression boundary. binaries/data/mods/public/simulation/components/UnitAI.js |1887| » » » » » » var·cmpFormation·=·Engine.QueryInterface(this.formationController,·IID_Formation); | | [NORMAL] JSHintBear: | | 'cmpFormation' is already defined. binaries/data/mods/public/simulation/components/UnitAI.js |2020| » » » » » » &&·this.order.data.target·!=·msg.data.attacker·&&·this.GetBestAttackAgainst(msg.data.attacker,·true)·!=·"Capture") | | [NORMAL] JSHintBear: | | Misleading line break before '&&'; readers may interpret this as an expression boundary. binaries/data/mods/public/simulation/components/UnitAI.js |2103| » » » » » » » » ·&&·((type.generic·==·"treasure"·&&·oldType.generic·==·"treasure") | | [NORMAL] JSHintBear: | | Misleading line break before '&&'; readers may interpret this as an expression boundary. binaries/data/mods/public/simulation/components/UnitAI.js |2104| » » » » » » » » ·||·(type.specific·==·oldType.specific | | [NORMAL] JSHintBear: | | Misleading line break before '||'; readers may interpret this as an expression boundary. binaries/data/mods/public/simulation/components/UnitAI.js |2105| » » » » » » » » ·&&·(type.specific·!=·"meat"·||·oldTemplate·==·template))) | | [NORMAL] JSHintBear: | | Misleading line break before '&&'; readers may interpret this as an expression boundary. binaries/data/mods/public/simulation/components/UnitAI.js |2128| » » » » » » » » var·nearby·=·this.FindNearestDropsite(oldType.generic); | | [NORMAL] JSHintBear: | | 'nearby' is already defined. binaries/data/mods/public/simulation/components/UnitAI.js |2168| » » » » » » » » &&·((type.generic·==·"treasure"·&&·oldType.generic·==·"treasure") | | [NORMAL] JSHintBear: | | Misleading line break before '&&'; readers may interpret this as an expression boundary. binaries/data/mods/public/simulation/components/UnitAI.js |2169| » » » » » » » » ||·(type.specific·==·oldType.specific | | [NORMAL] JSHintBear: | | Misleading line break before '||'; readers may interpret this as an expression boundary. binaries/data/mods/public/simulation/components/UnitAI.js |2170| » » » » » » » » &&·(type.specific·!=·"meat"·||·oldTemplate·==·template))) | | [NORMAL] JSHintBear: | | Misleading line break before '&&'; readers may interpret this as an expression boundary. binaries/data/mods/public/simulation/components/UnitAI.js |2215| » » » » » » » ||·(type.specific·==·resourceType.specific | | [NORMAL] JSHintBear: | | Misleading line break before '||'; readers may interpret this as an expression boundary. binaries/data/mods/public/simulation/components/UnitAI.js |2216| » » » » » » » &&·(type.specific·!=·"meat"·||·resourceTemplate·==·template)) | | [NORMAL] JSHintBear: | | Misleading line break before '&&'; readers may interpret this as an expression boundary. binaries/data/mods/public/simulation/components/UnitAI.js |2232| » » » » » var·nearby·=·this.FindNearestDropsite(resourceType.generic); | | [NORMAL] JSHintBear: | | 'nearby' is already defined. binaries/data/mods/public/simulation/components/UnitAI.js |2405| » » » » » var·cmpResourceGatherer·=·Engine.QueryInterface(this.entity,·IID_ResourceGatherer); | | [NORMAL] JSHintBear: | | 'cmpResourceGatherer' is already defined. binaries/data/mods/public/simulation/components/UnitAI.js |2421| » » » » » var·nearby·=·this.FindNearbyResource(function·(ent,·type,·template)·{ | | [NORMAL] JSHintBear: | | 'nearby' is already defined. binaries/data/mods/public/simulation/components/UnitAI.js |2424| » » » » » » » ||·(type.specific·==·resourceType.specific | | [NORMAL] JSHintBear: | | Misleading line break before '||'; readers may interpret this as an expression boundary. binaries/data/mods/public/simulation/components/UnitAI.js |2425| » » » » » » » &&·(type.specific·!=·"meat"·||·resourceTemplate·==·template)) | | [NORMAL] JSHintBear: | | Misleading line break before '&&'; readers may interpret this as an expression boundary. binaries/data/mods/public/simulation/components/UnitAI.js |2445| » » » » » var·nearby·=·this.FindNearestDropsite(resourceType.generic); | | [NORMAL] JSHintBear: | | 'nearby' is already defined. binaries/data/mods/public/simulation/components/UnitAI.js |2629| » » » » » var·cmpResourceGatherer·=·Engine.QueryInterface(this.entity,·IID_ResourceGatherer); | | [NORMAL] JSHintBear: | | 'cmpResourceGatherer' is already defined. binaries/data/mods/public/simulation/components/UnitAI.js |2824| » » » » » var·cmpResourceDropsite·=·Engine.QueryInterface(msg.data.newentity,·IID_ResourceDropsite); | | [NORMAL] JSHintBear: | | 'cmpResourceDropsite' is already defined. binaries/data/mods/public/simulation/components/UnitAI.js |2897| » » » » » if·(this.CanGarrison(target)) | | [NORMAL] JSHintBear: | | 'target' used out of scope. binaries/data/mods/public/simulation/components/UnitAI.js |2900| » » » » » » if·(this.CheckGarrisonRange(target)) | | [NORMAL] JSHintBear: | | 'target' used out of scope. binaries/data/mods/public/simulation/components/UnitAI.js |2902| » » » » » » » var·cmpGarrisonHolder·=·Engine.QueryInterface(target,·IID_GarrisonHolder); | | [NORMAL] JSHintBear: | | 'target' used out of scope. binaries/data/mods/public/simulation/components/UnitAI.js |2924| » » » » » » » » var·cmpResourceDropsite·=·Engine.QueryInterface(target,·IID_ResourceDropsite); | | [NORMAL] JSHintBear: | | 'target' used out of scope. binaries/data/mods/public/simulation/components/UnitAI.js |2925| » » » » » » » » if·(cmpResourceDropsite·&&·this.CanReturnResource(target,·true)) | | [NORMAL] JSHintBear: | | 'target' used out of scope. binaries/data/mods/public/simulation/components/UnitAI.js |2940| » » » » » » » » » var·cmpHolderPosition·=·Engine.QueryInterface(target,·IID_Position); | | [NORMAL] JSHintBear: | | 'target' used out of scope. binaries/data/mods/public/simulation/components/UnitAI.js |2941| » » » » » » » » » var·cmpHolderUnitAI·=·Engine.QueryInterface(target,·IID_UnitAI); | | [NORMAL] JSHintBear: | | 'target' used out of scope. binaries/data/mods/public/simulation/components/UnitAI.js |2968| » » » » » » » if·(this.MoveToTarget(target)) | | [NORMAL] JSHintBear: | | 'target' used out of scope. binaries/data/mods/public/simulation/components/UnitAI.js |3746| » » var·order·=·{·"type":·type,·"data":·data·}; | | [NORMAL] JSHintBear: | | 'order' is already defined. binaries/data/mods/public/simulation/components/UnitAI.js |3815| » for·(var·i·=·0;·i·<·this.orderQueue.length;·++i) | | [NORMAL] JSHintBear: | | 'i' is already defined. binaries/data/mods/public/simulation/components/UnitAI.js |4087| » let·cmpPosition·=·Engine.QueryInterface(this.entity,·IID_Position) | | [NORMAL] JSHintBear: | | Missing semicolon. binaries/data/mods/public/simulation/components/UnitAI.js |4358| » » var·parabolicMaxRange·=·0; | | [NORMAL] JSHintBear: | | 'parabolicMaxRange' is already defined. binaries/data/mods/public/simulation/components/UnitAI.js |4362| » var·guessedMaxRange·=·(range.max·+·parabolicMaxRange)/2; | | [NORMAL] JSHintBear: | | 'parabolicMaxRange' used out of scope. binaries/data/mods/public/simulation/components/UnitAI.js |4369| » return·cmpUnitMotion.MoveToTargetRange(target,·range.min,·Math.min(range.max,·parabolicMaxRange)); | | [NORMAL] JSHintBear: | | 'parabolicMaxRange' used out of scope. binaries/data/mods/public/simulation/components/UnitAI.js |4425| » » » &&·cmpFormationUnitAI.order.data.target·==·target) | | [NORMAL] JSHintBear: | | Misleading line break before '&&'; readers may interpret this as an expression boundary. binaries/data/mods/public/simulation/components/UnitAI.js |4593| » » &&·this.CheckTargetDistanceFromHeldPosition(target,·IID_Attack,·this.GetBestAttackAgainst(target,·true)) | | [NORMAL] JSHintBear: | | Misleading line break before '&&'; readers may interpret this as an expression boundary. binaries/data/mods/public/simulation/components/UnitAI.js |4594| » » &&·(this.GetStance().respondChaseBeyondVision·||·this.CheckTargetIsInVisionRange(target)) | | [NORMAL] JSHintBear: | | Misleading line break before '&&'; readers may interpret this as an expression boundary. binaries/data/mods/public/simulation/components/UnitAI.js |5121| » var·lastPos·=·undefined; | | [NORMAL] JSHintBear: | | It's not necessary to initialize 'lastPos' to 'undefined'. binaries/data/mods/public/simulation/components/UnitAI.js |5475| » » » » » » &&·!MatchesClassList(cmpIdentity.GetClassesList(),·targetClasses.attack)) | | [NORMAL] JSHintBear: | | Misleading line break before '&&'; readers may interpret this as an expression boundary. binaries/data/mods/public/simulation/components/UnitAI.js |5478| » » » » » » &&·MatchesClassList(cmpIdentity.GetClassesList(),·targetClasses.avoid)) | | [NORMAL] JSHintBear: | | Misleading line break before '&&'; readers may interpret this as an expression boundary. binaries/data/mods/public/simulation/components/UnitAI.js |5491| » var·targets·=·this.GetTargetsFromUnit(); | | [NORMAL] JSHintBear: | | 'targets' is already defined. binaries/data/mods/public/simulation/components/UnitAI.js |5492| » for·(var·targ·of·targets) | | [NORMAL] JSHintBear: | | 'targ' is already defined. binaries/data/mods/public/simulation/components/UnitAI.js |5498| » » » var·cmpIdentity·=·Engine.QueryInterface(targ,·IID_Identity); | | [NORMAL] JSHintBear: | | 'cmpIdentity' is already defined. binaries/data/mods/public/simulation/components/UnitAI.js |5499| » » » var·targetClasses·=·this.order.data.targetClasses; | | [NORMAL] JSHintBear: | | 'targetClasses' is already defined. binaries/data/mods/public/simulation/components/UnitAI.js |5501| » » » » &&·!MatchesClassList(cmpIdentity.GetClassesList(),·targetClasses.attack)) | | [NORMAL] JSHintBear: | | Misleading line break before '&&'; readers may interpret this as an expression boundary. binaries/data/mods/public/simulation/components/UnitAI.js |5504| » » » » &&·MatchesClassList(cmpIdentity.GetClassesList(),·targetClasses.avoid)) | | [NORMAL] JSHintBear: | | Misleading line break before '&&'; readers may interpret this as an expression boundary. binaries/data/mods/public/simulation/components/UnitAI.js |5579| » » var·range·=·cmpVision.GetRange(); | | [NORMAL] JSHintBear: | | 'range' is already defined. binaries/data/mods/public/simulation/components/UnitAI.js |5584| » » var·cmpRanged·=·Engine.QueryInterface(this.entity,·iid); | | [NORMAL] JSHintBear: | | 'cmpRanged' is already defined. binaries/data/mods/public/simulation/components/UnitAI.js |5587| » » var·range·=·iid·!==·IID_Attack·?·cmpRanged.GetRange()·:·cmpRanged.GetFullAttackRange(); | | [NORMAL] JSHintBear: | | 'range' is already defined. binaries/data/mods/public/simulation/components/UnitAI.js |5588| » » var·cmpVision·=·Engine.QueryInterface(this.entity,·IID_Vision); | | [NORMAL] JSHintBear: | | 'cmpVision' is already defined. binaries/data/mods/public/simulation/components/UnitAI.js |5588| » » var·cmpVision·=·Engine.QueryInterface(this.entity,·IID_Vision); | | [MAJOR] JSHintBear: | | Too many errors. (93% scanned).
Link to build: https://jenkins.wildfiregames.com/job/differential/84/display/redirect
Remove SetDefaultAnimationVariant from gather approaching and walking, since they shouldn't show resources until they've started gathering.
When troops in formation have resources and you order them to move somewhere, they have weapons.
But if you do the same with individuals, they have resources.
Plus.
When you order unit with resources to attack, and then move somewhere even before attack starts, it ends with weapon not resources. This one is probably state problem, maybe not I am not sure which one is wanted.
Successful build - Chance fights ever on the side of the prudent.
Linter detected issues: Executing section Default... Executing section Source... Executing section JS... | | [NORMAL] ESLintBear (quote-props): | | Unquoted property 'SetInterval' found. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | 35| 35| | 36| 36| | 37| 37| AddMock(SYSTEM_ENTITY, IID_Timer, { | 38| |- SetInterval: function() { }, | | 38|+ "SetInterval": function() { }, | 39| 39| SetTimeout: function() { }, | 40| 40| }); | 41| 41| | | [NORMAL] ESLintBear (quote-props): | | Unquoted property 'SetTimeout' found. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | 36| 36| | 37| 37| AddMock(SYSTEM_ENTITY, IID_Timer, { | 38| 38| SetInterval: function() { }, | 39| |- SetTimeout: function() { }, | | 39|+ "SetTimeout": function() { }, | 40| 40| }); | 41| 41| | 42| 42| AddMock(SYSTEM_ENTITY, IID_RangeManager, { | | [NORMAL] ESLintBear (quote-props): | | Unquoted property 'CreateActiveQuery' found. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | 40| 40| }); | 41| 41| | 42| 42| AddMock(SYSTEM_ENTITY, IID_RangeManager, { | 43| |- CreateActiveQuery: function(ent, minRange, maxRange, players, iid, flags) { | | 43|+ "CreateActiveQuery": function(ent, minRange, maxRange, players, iid, flags) { | 44| 44| return 1; | 45| 45| }, | 46| 46| EnableActiveQuery: function(id) { }, | | [NORMAL] ESLintBear (quote-props): | | Unquoted property 'EnableActiveQuery' found. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | 43| 43| CreateActiveQuery: function(ent, minRange, maxRange, players, iid, flags) { | 44| 44| return 1; | 45| 45| }, | 46| |- EnableActiveQuery: function(id) { }, | | 46|+ "EnableActiveQuery": function(id) { }, | 47| 47| ResetActiveQuery: function(id) { if (mode == 0) return []; else return [enemy]; }, | 48| 48| DisableActiveQuery: function(id) { }, | 49| 49| GetEntityFlagMask: function(identifier) { }, | | [NORMAL] ESLintBear (quote-props): | | Unquoted property 'ResetActiveQuery' found. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | 44| 44| return 1; | 45| 45| }, | 46| 46| EnableActiveQuery: function(id) { }, | 47| |- ResetActiveQuery: function(id) { if (mode == 0) return []; else return [enemy]; }, | | 47|+ "ResetActiveQuery": function(id) { if (mode == 0) return []; else return [enemy]; }, | 48| 48| DisableActiveQuery: function(id) { }, | 49| 49| GetEntityFlagMask: function(identifier) { }, | 50| 50| }); | | [NORMAL] ESLintBear (no-else-return): | | Unnecessary 'else' after 'return'. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | 44| 44| return 1; | 45| 45| }, | 46| 46| EnableActiveQuery: function(id) { }, | 47| |- ResetActiveQuery: function(id) { if (mode == 0) return []; else return [enemy]; }, | | 47|+ ResetActiveQuery: function(id) { if (mode == 0) return []; return [enemy]; }, | 48| 48| DisableActiveQuery: function(id) { }, | 49| 49| GetEntityFlagMask: function(identifier) { }, | 50| 50| }); | | [NORMAL] ESLintBear (quote-props): | | Unquoted property 'DisableActiveQuery' found. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | 45| 45| }, | 46| 46| EnableActiveQuery: function(id) { }, | 47| 47| ResetActiveQuery: function(id) { if (mode == 0) return []; else return [enemy]; }, | 48| |- DisableActiveQuery: function(id) { }, | | 48|+ "DisableActiveQuery": function(id) { }, | 49| 49| GetEntityFlagMask: function(identifier) { }, | 50| 50| }); | 51| 51| | | [NORMAL] ESLintBear (quote-props): | | Unquoted property 'GetEntityFlagMask' found. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | 46| 46| EnableActiveQuery: function(id) { }, | 47| 47| ResetActiveQuery: function(id) { if (mode == 0) return []; else return [enemy]; }, | 48| 48| DisableActiveQuery: function(id) { }, | 49| |- GetEntityFlagMask: function(identifier) { }, | | 49|+ "GetEntityFlagMask": function(identifier) { }, | 50| 50| }); | 51| 51| | 52| 52| AddMock(SYSTEM_ENTITY, IID_TemplateManager, { | | [NORMAL] ESLintBear (quote-props): | | Unquoted property 'GetCurrentTemplateName' found. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | 50| 50| }); | 51| 51| | 52| 52| AddMock(SYSTEM_ENTITY, IID_TemplateManager, { | 53| |- GetCurrentTemplateName: function(ent) { return "special/formations/line_closed"; }, | | 53|+ "GetCurrentTemplateName": function(ent) { return "special/formations/line_closed"; }, | 54| 54| }); | 55| 55| | 56| 56| AddMock(SYSTEM_ENTITY, IID_PlayerManager, { | | [NORMAL] ESLintBear (quote-props): | | Unquoted property 'GetPlayerByID' found. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | 54| 54| }); | 55| 55| | 56| 56| AddMock(SYSTEM_ENTITY, IID_PlayerManager, { | 57| |- GetPlayerByID: function(id) { return playerEntity; }, | | 57|+ "GetPlayerByID": function(id) { return playerEntity; }, | 58| 58| GetNumPlayers: function() { return 2; }, | 59| 59| }); | 60| 60| | | [NORMAL] ESLintBear (quote-props): | | Unquoted property 'GetNumPlayers' found. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | 55| 55| | 56| 56| AddMock(SYSTEM_ENTITY, IID_PlayerManager, { | 57| 57| GetPlayerByID: function(id) { return playerEntity; }, | 58| |- GetNumPlayers: function() { return 2; }, | | 58|+ "GetNumPlayers": function() { return 2; }, | 59| 59| }); | 60| 60| | 61| 61| AddMock(playerEntity, IID_Player, { | | [NORMAL] ESLintBear (quote-props): | | Unquoted property 'IsAlly' found. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | 59| 59| }); | 60| 60| | 61| 61| AddMock(playerEntity, IID_Player, { | 62| |- IsAlly: function() { return false; }, | | 62|+ "IsAlly": function() { return false; }, | 63| 63| IsEnemy: function() { return true; }, | 64| 64| GetEnemies: function() { return []; }, | 65| 65| }); | | [NORMAL] ESLintBear (quote-props): | | Unquoted property 'IsEnemy' found. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | 60| 60| | 61| 61| AddMock(playerEntity, IID_Player, { | 62| 62| IsAlly: function() { return false; }, | 63| |- IsEnemy: function() { return true; }, | | 63|+ "IsEnemy": function() { return true; }, | 64| 64| GetEnemies: function() { return []; }, | 65| 65| }); | 66| 66| | | [NORMAL] ESLintBear (quote-props): | | Unquoted property 'GetEnemies' found. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | 61| 61| AddMock(playerEntity, IID_Player, { | 62| 62| IsAlly: function() { return false; }, | 63| 63| IsEnemy: function() { return true; }, | 64| |- GetEnemies: function() { return []; }, | | 64|+ "GetEnemies": function() { return []; }, | 65| 65| }); | 66| 66| | 67| 67| | | [NORMAL] ESLintBear (quote-props): | | Unquoted property 'GetClassesList' found. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | 68| 68| var unitAI = ConstructComponent(unit, "UnitAI", { "FormationController": "false", "DefaultStance": "aggressive" }); | 69| 69| | 70| 70| AddMock(unit, IID_Identity, { | 71| |- GetClassesList: function() { return []; }, | | 71|+ "GetClassesList": function() { return []; }, | 72| 72| }); | 73| 73| | 74| 74| AddMock(unit, IID_Ownership, { | | [NORMAL] ESLintBear (quote-props): | | Unquoted property 'GetOwner' found. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | 72| 72| }); | 73| 73| | 74| 74| AddMock(unit, IID_Ownership, { | 75| |- GetOwner: function() { return 1; }, | | 75|+ "GetOwner": function() { return 1; }, | 76| 76| }); | 77| 77| | 78| 78| AddMock(unit, IID_Position, { | | [NORMAL] ESLintBear (quote-props): | | Unquoted property 'GetTurretParent' found. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | 76| 76| }); | 77| 77| | 78| 78| AddMock(unit, IID_Position, { | 79| |- GetTurretParent: function() { return INVALID_ENTITY; }, | | 79|+ "GetTurretParent": function() { return INVALID_ENTITY; }, | 80| 80| GetPosition: function() { return new Vector3D(); }, | 81| 81| GetPosition2D: function() { return new Vector2D(); }, | 82| 82| GetRotation: function() { return { "y": 0 }; }, | | [NORMAL] ESLintBear (quote-props): | | Unquoted property 'GetPosition' found. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | 77| 77| | 78| 78| AddMock(unit, IID_Position, { | 79| 79| GetTurretParent: function() { return INVALID_ENTITY; }, | 80| |- GetPosition: function() { return new Vector3D(); }, | | 80|+ "GetPosition": function() { return new Vector3D(); }, | 81| 81| GetPosition2D: function() { return new Vector2D(); }, | 82| 82| GetRotation: function() { return { "y": 0 }; }, | 83| 83| IsInWorld: function() { return true; }, | | [NORMAL] ESLintBear (quote-props): | | Unquoted property 'GetPosition2D' found. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | 78| 78| AddMock(unit, IID_Position, { | 79| 79| GetTurretParent: function() { return INVALID_ENTITY; }, | 80| 80| GetPosition: function() { return new Vector3D(); }, | 81| |- GetPosition2D: function() { return new Vector2D(); }, | | 81|+ "GetPosition2D": function() { return new Vector2D(); }, | 82| 82| GetRotation: function() { return { "y": 0 }; }, | 83| 83| IsInWorld: function() { return true; }, | 84| 84| }); | | [NORMAL] ESLintBear (quote-props): | | Unquoted property 'GetRotation' found. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | 79| 79| GetTurretParent: function() { return INVALID_ENTITY; }, | 80| 80| GetPosition: function() { return new Vector3D(); }, | 81| 81| GetPosition2D: function() { return new Vector2D(); }, | 82| |- GetRotation: function() { return { "y": 0 }; }, | | 82|+ "GetRotation": function() { return { "y": 0 }; }, | 83| 83| IsInWorld: function() { return true; }, | 84| 84| }); | 85| 85| | | [NORMAL] ESLintBear (quote-props): | | Unquoted property 'IsInWorld' found. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | 80| 80| GetPosition: function() { return new Vector3D(); }, | 81| 81| GetPosition2D: function() { return new Vector2D(); }, | 82| 82| GetRotation: function() { return { "y": 0 }; }, | 83| |- IsInWorld: function() { return true; }, | | 83|+ "IsInWorld": function() { return true; }, | 84| 84| }); | 85| 85| | 86| 86| AddMock(unit, IID_UnitMotion, { | | [NORMAL] ESLintBear (quote-props): | | Unquoted property 'GetWalkSpeed' found. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | 84| 84| }); | 85| 85| | 86| 86| AddMock(unit, IID_UnitMotion, { | 87| |- GetWalkSpeed: function() { return 1; }, | | 87|+ "GetWalkSpeed": function() { return 1; }, | 88| 88| MoveToFormationOffset: function(target, x, z) { }, | 89| 89| IsInTargetRange: function(target, min, max) { return true; }, | 90| 90| MoveToTargetRange: function(target, min, max) { }, | | [NORMAL] ESLintBear (quote-props): | | Unquoted property 'MoveToFormationOffset' found. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | 85| 85| | 86| 86| AddMock(unit, IID_UnitMotion, { | 87| 87| GetWalkSpeed: function() { return 1; }, | 88| |- MoveToFormationOffset: function(target, x, z) { }, | | 88|+ "MoveToFormationOffset": function(target, x, z) { }, | 89| 89| IsInTargetRange: function(target, min, max) { return true; }, | 90| 90| MoveToTargetRange: function(target, min, max) { }, | 91| 91| StopMoving: function() { }, | | [NORMAL] ESLintBear (quote-props): | | Unquoted property 'IsInTargetRange' found. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | 86| 86| AddMock(unit, IID_UnitMotion, { | 87| 87| GetWalkSpeed: function() { return 1; }, | 88| 88| MoveToFormationOffset: function(target, x, z) { }, | 89| |- IsInTargetRange: function(target, min, max) { return true; }, | | 89|+ "IsInTargetRange": function(target, min, max) { return true; }, | 90| 90| MoveToTargetRange: function(target, min, max) { }, | 91| 91| StopMoving: function() { }, | 92| 92| GetPassabilityClassName: function() { return "default"; }, | | [NORMAL] ESLintBear (quote-props): | | Unquoted property 'MoveToTargetRange' found. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | 87| 87| GetWalkSpeed: function() { return 1; }, | 88| 88| MoveToFormationOffset: function(target, x, z) { }, | 89| 89| IsInTargetRange: function(target, min, max) { return true; }, | 90| |- MoveToTargetRange: function(target, min, max) { }, | | 90|+ "MoveToTargetRange": function(target, min, max) { }, | 91| 91| StopMoving: function() { }, | 92| 92| GetPassabilityClassName: function() { return "default"; }, | 93| 93| }); | | [NORMAL] ESLintBear (quote-props): | | Unquoted property 'StopMoving' found. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | 88| 88| MoveToFormationOffset: function(target, x, z) { }, | 89| 89| IsInTargetRange: function(target, min, max) { return true; }, | 90| 90| MoveToTargetRange: function(target, min, max) { }, | 91| |- StopMoving: function() { }, | | 91|+ "StopMoving": function() { }, | 92| 92| GetPassabilityClassName: function() { return "default"; }, | 93| 93| }); | 94| 94| | | [NORMAL] ESLintBear (quote-props): | | Unquoted property 'GetPassabilityClassName' found. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | 89| 89| IsInTargetRange: function(target, min, max) { return true; }, | 90| 90| MoveToTargetRange: function(target, min, max) { }, | 91| 91| StopMoving: function() { }, | 92| |- GetPassabilityClassName: function() { return "default"; }, | | 92|+ "GetPassabilityClassName": function() { return "default"; }, | 93| 93| }); | 94| 94| | 95| 95| AddMock(unit, IID_Vision, { | | [NORMAL] ESLintBear (quote-props): | | Unquoted property 'GetRange' found. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | 93| 93| }); | 94| 94| | 95| 95| AddMock(unit, IID_Vision, { | 96| |- GetRange: function() { return 10; }, | | 96|+ "GetRange": function() { return 10; }, | 97| 97| }); | 98| 98| | 99| 99| AddMock(unit, IID_Attack, { | | [NORMAL] ESLintBear (quote-props): | | Unquoted property 'GetRange' found. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | 97| 97| }); | 98| 98| | 99| 99| AddMock(unit, IID_Attack, { | 100| |- GetRange: function() { return { "max": 10, "min": 0}; }, | | 100|+ "GetRange": function() { return { "max": 10, "min": 0}; }, | 101| 101| GetFullAttackRange: function() { return { "max": 40, "min": 0}; }, | 102| 102| GetBestAttackAgainst: function(t) { return "melee"; }, | 103| 103| GetPreference: function(t) { return 0; }, | | [NORMAL] ESLintBear (object-curly-spacing): | | A space is required before '}'. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | 97| 97| }); | 98| 98| | 99| 99| AddMock(unit, IID_Attack, { | 100| |- GetRange: function() { return { "max": 10, "min": 0}; }, | | 100|+ GetRange: function() { return { "max": 10, "min": 0 }; }, | 101| 101| GetFullAttackRange: function() { return { "max": 40, "min": 0}; }, | 102| 102| GetBestAttackAgainst: function(t) { return "melee"; }, | 103| 103| GetPreference: function(t) { return 0; }, | | [NORMAL] ESLintBear (quote-props): | | Unquoted property 'GetFullAttackRange' found. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | 98| 98| | 99| 99| AddMock(unit, IID_Attack, { | 100| 100| GetRange: function() { return { "max": 10, "min": 0}; }, | 101| |- GetFullAttackRange: function() { return { "max": 40, "min": 0}; }, | | 101|+ "GetFullAttackRange": function() { return { "max": 40, "min": 0}; }, | 102| 102| GetBestAttackAgainst: function(t) { return "melee"; }, | 103| 103| GetPreference: function(t) { return 0; }, | 104| 104| GetTimers: function() { return { "prepare": 500, "repeat": 1000 }; }, | | [NORMAL] ESLintBear (object-curly-spacing): | | A space is required before '}'. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | 98| 98| | 99| 99| AddMock(unit, IID_Attack, { | 100| 100| GetRange: function() { return { "max": 10, "min": 0}; }, | 101| |- GetFullAttackRange: function() { return { "max": 40, "min": 0}; }, | | 101|+ GetFullAttackRange: function() { return { "max": 40, "min": 0 }; }, | 102| 102| GetBestAttackAgainst: function(t) { return "melee"; }, | 103| 103| GetPreference: function(t) { return 0; }, | 104| 104| GetTimers: function() { return { "prepare": 500, "repeat": 1000 }; }, | | [NORMAL] ESLintBear (quote-props): | | Unquoted property 'GetBestAttackAgainst' found. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | 99| 99| AddMock(unit, IID_Attack, { | 100| 100| GetRange: function() { return { "max": 10, "min": 0}; }, | 101| 101| GetFullAttackRange: function() { return { "max": 40, "min": 0}; }, | 102| |- GetBestAttackAgainst: function(t) { return "melee"; }, | | 102|+ "GetBestAttackAgainst": function(t) { return "melee"; }, | 103| 103| GetPreference: function(t) { return 0; }, | 104| 104| GetTimers: function() { return { "prepare": 500, "repeat": 1000 }; }, | 105| 105| CanAttack: function(v) { return true; }, | | [NORMAL] ESLintBear (quote-props): | | Unquoted property 'GetPreference' found. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | 100| 100| GetRange: function() { return { "max": 10, "min": 0}; }, | 101| 101| GetFullAttackRange: function() { return { "max": 40, "min": 0}; }, | 102| 102| GetBestAttackAgainst: function(t) { return "melee"; }, | 103| |- GetPreference: function(t) { return 0; }, | | 103|+ "GetPreference": function(t) { return 0; }, | 104| 104| GetTimers: function() { return { "prepare": 500, "repeat": 1000 }; }, | 105| 105| CanAttack: function(v) { return true; }, | 106| 106| CompareEntitiesByPreference: function(a, b) { return 0; }, | | [NORMAL] ESLintBear (quote-props): | | Unquoted property 'GetTimers' found. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | 101| 101| GetFullAttackRange: function() { return { "max": 40, "min": 0}; }, | 102| 102| GetBestAttackAgainst: function(t) { return "melee"; }, | 103| 103| GetPreference: function(t) { return 0; }, | 104| |- GetTimers: function() { return { "prepare": 500, "repeat": 1000 }; }, | | 104|+ "GetTimers": function() { return { "prepare": 500, "repeat": 1000 }; }, | 105| 105| CanAttack: function(v) { return true; }, | 106| 106| CompareEntitiesByPreference: function(a, b) { return 0; }, | 107| 107| }); | | [NORMAL] ESLintBear (quote-props): | | Unquoted property 'CanAttack' found. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | 102| 102| GetBestAttackAgainst: function(t) { return "melee"; }, | 103| 103| GetPreference: function(t) { return 0; }, | 104| 104| GetTimers: function() { return { "prepare": 500, "repeat": 1000 }; }, | 105| |- CanAttack: function(v) { return true; }, | | 105|+ "CanAttack": function(v) { return true; }, | 106| 106| CompareEntitiesByPreference: function(a, b) { return 0; }, | 107| 107| }); | 108| 108| | | [NORMAL] ESLintBear (quote-props): | | Unquoted property 'CompareEntitiesByPreference' found. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | 103| 103| GetPreference: function(t) { return 0; }, | 104| 104| GetTimers: function() { return { "prepare": 500, "repeat": 1000 }; }, | 105| 105| CanAttack: function(v) { return true; }, | 106| |- CompareEntitiesByPreference: function(a, b) { return 0; }, | | 106|+ "CompareEntitiesByPreference": function(a, b) { return 0; }, | 107| 107| }); | 108| 108| | 109| 109| unitAI.OnCreate(); | | [NORMAL] ESLintBear (quote-props): | | Unquoted property 'GetHitpoints' found. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | 114| 114| if (mode == 1) | 115| 115| { | 116| 116| AddMock(enemy, IID_Health, { | 117| |- GetHitpoints: function() { return 10; }, | | 117|+ "GetHitpoints": function() { return 10; }, | 118| 118| }); | 119| 119| AddMock(enemy, IID_UnitAI, { | 120| 120| IsAnimal: function() { return false; } | | [NORMAL] ESLintBear (quote-props): | | Unquoted property 'IsAnimal' found. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | 117| 117| GetHitpoints: function() { return 10; }, | 118| 118| }); | 119| 119| AddMock(enemy, IID_UnitAI, { | 120| |- IsAnimal: function() { return false; } | | 120|+ "IsAnimal": function() { return false; } | 121| 121| }); | 122| 122| } | 123| 123| else if (mode == 2) | | [NORMAL] ESLintBear (quote-props): | | Unquoted property 'GetHitpoints' found. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | 122| 122| } | 123| 123| else if (mode == 2) | 124| 124| AddMock(enemy, IID_Health, { | 125| |- GetHitpoints: function() { return 0; }, | | 125|+ "GetHitpoints": function() { return 0; }, | 126| 126| }); | 127| 127| | 128| 128| var controllerFormation = ConstructComponent(controller, "Formation", {"FormationName": "Line Closed", "FormationShape": "square", "ShiftRows": "false", "SortingClasses": "", "WidthDepthRatio": 1, "UnitSeparationWidthMultiplier": 1, "UnitSeparationDepthMultiplier": 1, "SpeedMultiplier": 1, "Sloppyness": 0}); | | [NORMAL] ESLintBear (object-curly-spacing): | | A space is required after '{'. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | 125| 125| GetHitpoints: function() { return 0; }, | 126| 126| }); | 127| 127| | 128| |- var controllerFormation = ConstructComponent(controller, "Formation", {"FormationName": "Line Closed", "FormationShape": "square", "ShiftRows": "false", "SortingClasses": "", "WidthDepthRatio": 1, "UnitSeparationWidthMultiplier": 1, "UnitSeparationDepthMultiplier": 1, "SpeedMultiplier": 1, "Sloppyness": 0}); | | 128|+ var controllerFormation = ConstructComponent(controller, "Formation", { "FormationName": "Line Closed", "FormationShape": "square", "ShiftRows": "false", "SortingClasses": "", "WidthDepthRatio": 1, "UnitSeparationWidthMultiplier": 1, "UnitSeparationDepthMultiplier": 1, "SpeedMultiplier": 1, "Sloppyness": 0}); | 129| 129| var controllerAI = ConstructComponent(controller, "UnitAI", { "FormationController": "true", "DefaultStance": "aggressive" }); | 130| 130| | 131| 131| AddMock(controller, IID_Position, { | | [NORMAL] ESLintBear (object-curly-spacing): | | A space is required before '}'. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | 125| 125| GetHitpoints: function() { return 0; }, | 126| 126| }); | 127| 127| | 128| |- var controllerFormation = ConstructComponent(controller, "Formation", {"FormationName": "Line Closed", "FormationShape": "square", "ShiftRows": "false", "SortingClasses": "", "WidthDepthRatio": 1, "UnitSeparationWidthMultiplier": 1, "UnitSeparationDepthMultiplier": 1, "SpeedMultiplier": 1, "Sloppyness": 0}); | | 128|+ var controllerFormation = ConstructComponent(controller, "Formation", {"FormationName": "Line Closed", "FormationShape": "square", "ShiftRows": "false", "SortingClasses": "", "WidthDepthRatio": 1, "UnitSeparationWidthMultiplier": 1, "UnitSeparationDepthMultiplier": 1, "SpeedMultiplier": 1, "Sloppyness": 0 }); | 129| 129| var controllerAI = ConstructComponent(controller, "UnitAI", { "FormationController": "true", "DefaultStance": "aggressive" }); | 130| 130| | 131| 131| AddMock(controller, IID_Position, { | | [NORMAL] ESLintBear (quote-props): | | Unquoted property 'JumpTo' found. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | 129| 129| var controllerAI = ConstructComponent(controller, "UnitAI", { "FormationController": "true", "DefaultStance": "aggressive" }); | 130| 130| | 131| 131| AddMock(controller, IID_Position, { | 132| |- JumpTo: function(x, z) { this.x = x; this.z = z; }, | | 132|+ "JumpTo": function(x, z) { this.x = x; this.z = z; }, | 133| 133| GetTurretParent: function() { return INVALID_ENTITY; }, | 134| 134| GetPosition: function() { return new Vector3D(this.x, 0, this.z); }, | 135| 135| GetPosition2D: function() { return new Vector2D(this.x, this.z); }, | | [NORMAL] ESLintBear (quote-props): | | Unquoted property 'GetTurretParent' found. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | 130| 130| | 131| 131| AddMock(controller, IID_Position, { | 132| 132| JumpTo: function(x, z) { this.x = x; this.z = z; }, | 133| |- GetTurretParent: function() { return INVALID_ENTITY; }, | | 133|+ "GetTurretParent": function() { return INVALID_ENTITY; }, | 134| 134| GetPosition: function() { return new Vector3D(this.x, 0, this.z); }, | 135| 135| GetPosition2D: function() { return new Vector2D(this.x, this.z); }, | 136| 136| GetRotation: function() { return { "y": 0 }; }, | | [NORMAL] ESLintBear (quote-props): | | Unquoted property 'GetPosition' found. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | 131| 131| AddMock(controller, IID_Position, { | 132| 132| JumpTo: function(x, z) { this.x = x; this.z = z; }, | 133| 133| GetTurretParent: function() { return INVALID_ENTITY; }, | 134| |- GetPosition: function() { return new Vector3D(this.x, 0, this.z); }, | | 134|+ "GetPosition": function() { return new Vector3D(this.x, 0, this.z); }, | 135| 135| GetPosition2D: function() { return new Vector2D(this.x, this.z); }, | 136| 136| GetRotation: function() { return { "y": 0 }; }, | 137| 137| IsInWorld: function() { return true; }, | | [NORMAL] ESLintBear (quote-props): | | Unquoted property 'GetPosition2D' found. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | 132| 132| JumpTo: function(x, z) { this.x = x; this.z = z; }, | 133| 133| GetTurretParent: function() { return INVALID_ENTITY; }, | 134| 134| GetPosition: function() { return new Vector3D(this.x, 0, this.z); }, | 135| |- GetPosition2D: function() { return new Vector2D(this.x, this.z); }, | | 135|+ "GetPosition2D": function() { return new Vector2D(this.x, this.z); }, | 136| 136| GetRotation: function() { return { "y": 0 }; }, | 137| 137| IsInWorld: function() { return true; }, | 138| 138| }); | | [NORMAL] ESLintBear (quote-props): | | Unquoted property 'GetRotation' found. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | 133| 133| GetTurretParent: function() { return INVALID_ENTITY; }, | 134| 134| GetPosition: function() { return new Vector3D(this.x, 0, this.z); }, | 135| 135| GetPosition2D: function() { return new Vector2D(this.x, this.z); }, | 136| |- GetRotation: function() { return { "y": 0 }; }, | | 136|+ "GetRotation": function() { return { "y": 0 }; }, | 137| 137| IsInWorld: function() { return true; }, | 138| 138| }); | 139| 139| | | [NORMAL] ESLintBear (quote-props): | | Unquoted property 'IsInWorld' found. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | 134| 134| GetPosition: function() { return new Vector3D(this.x, 0, this.z); }, | 135| 135| GetPosition2D: function() { return new Vector2D(this.x, this.z); }, | 136| 136| GetRotation: function() { return { "y": 0 }; }, | 137| |- IsInWorld: function() { return true; }, | | 137|+ "IsInWorld": function() { return true; }, | 138| 138| }); | 139| 139| | 140| 140| AddMock(controller, IID_UnitMotion, { | | [NORMAL] ESLintBear (quote-props): | | Unquoted property 'SetSpeed' found. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | 138| 138| }); | 139| 139| | 140| 140| AddMock(controller, IID_UnitMotion, { | 141| |- SetSpeed: function(speed) { }, | | 141|+ "SetSpeed": function(speed) { }, | 142| 142| MoveToPointRange: function(x, z, minRange, maxRange) { }, | 143| 143| GetPassabilityClassName: function() { return "default"; }, | 144| 144| }); | | [NORMAL] ESLintBear (quote-props): | | Unquoted property 'MoveToPointRange' found. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | 139| 139| | 140| 140| AddMock(controller, IID_UnitMotion, { | 141| 141| SetSpeed: function(speed) { }, | 142| |- MoveToPointRange: function(x, z, minRange, maxRange) { }, | | 142|+ "MoveToPointRange": function(x, z, minRange, maxRange) { }, | 143| 143| GetPassabilityClassName: function() { return "default"; }, | 144| 144| }); | 145| 145| | | [NORMAL] ESLintBear (quote-props): | | Unquoted property 'GetPassabilityClassName' found. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | 140| 140| AddMock(controller, IID_UnitMotion, { | 141| 141| SetSpeed: function(speed) { }, | 142| 142| MoveToPointRange: function(x, z, minRange, maxRange) { }, | 143| |- GetPassabilityClassName: function() { return "default"; }, | | 143|+ "GetPassabilityClassName": function() { return "default"; }, | 144| 144| }); | 145| 145| | 146| 146| controllerAI.OnCreate(); | | [NORMAL] ESLintBear (quote-props): | | Unquoted property 'SetInterval' found. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | 181| 181| var unitAIs = []; | 182| 182| | 183| 183| AddMock(SYSTEM_ENTITY, IID_Timer, { | 184| |- SetInterval: function() { }, | | 184|+ "SetInterval": function() { }, | 185| 185| SetTimeout: function() { }, | 186| 186| }); | 187| 187| | | [NORMAL] ESLintBear (quote-props): | | Unquoted property 'SetTimeout' found. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | 182| 182| | 183| 183| AddMock(SYSTEM_ENTITY, IID_Timer, { | 184| 184| SetInterval: function() { }, | 185| |- SetTimeout: function() { }, | | 185|+ "SetTimeout": function() { }, | 186| 186| }); | 187| 187| | 188| 188| | | [NORMAL] ESLintBear (quote-props): | | Unquoted property 'CreateActiveQuery' found. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | 187| 187| | 188| 188| | 189| 189| AddMock(SYSTEM_ENTITY, IID_RangeManager, { | 190| |- CreateActiveQuery: function(ent, minRange, maxRange, players, iid, flags) { | | 190|+ "CreateActiveQuery": function(ent, minRange, maxRange, players, iid, flags) { | 191| 191| return 1; | 192| 192| }, | 193| 193| EnableActiveQuery: function(id) { }, | | [NORMAL] ESLintBear (quote-props): | | Unquoted property 'EnableActiveQuery' found. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | 190| 190| CreateActiveQuery: function(ent, minRange, maxRange, players, iid, flags) { | 191| 191| return 1; | 192| 192| }, | 193| |- EnableActiveQuery: function(id) { }, | | 193|+ "EnableActiveQuery": function(id) { }, | 194| 194| ResetActiveQuery: function(id) { return [enemy]; }, | 195| 195| DisableActiveQuery: function(id) { }, | 196| 196| GetEntityFlagMask: function(identifier) { }, | | [NORMAL] ESLintBear (quote-props): | | Unquoted property 'ResetActiveQuery' found. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | 191| 191| return 1; | 192| 192| }, | 193| 193| EnableActiveQuery: function(id) { }, | 194| |- ResetActiveQuery: function(id) { return [enemy]; }, | | 194|+ "ResetActiveQuery": function(id) { return [enemy]; }, | 195| 195| DisableActiveQuery: function(id) { }, | 196| 196| GetEntityFlagMask: function(identifier) { }, | 197| 197| }); | | [NORMAL] ESLintBear (quote-props): | | Unquoted property 'DisableActiveQuery' found. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | 192| 192| }, | 193| 193| EnableActiveQuery: function(id) { }, | 194| 194| ResetActiveQuery: function(id) { return [enemy]; }, | 195| |- DisableActiveQuery: function(id) { }, | | 195|+ "DisableActiveQuery": function(id) { }, | 196| 196| GetEntityFlagMask: function(identifier) { }, | 197| 197| }); | 198| 198| | | [NORMAL] ESLintBear (quote-props): | | Unquoted property 'GetEntityFlagMask' found. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | 193| 193| EnableActiveQuery: function(id) { }, | 194| 194| ResetActiveQuery: function(id) { return [enemy]; }, | 195| 195| DisableActiveQuery: function(id) { }, | 196| |- GetEntityFlagMask: function(identifier) { }, | | 196|+ "GetEntityFlagMask": function(identifier) { }, | 197| 197| }); | 198| 198| | 199| 199| AddMock(SYSTEM_ENTITY, IID_TemplateManager, { | | [NORMAL] ESLintBear (quote-props): | | Unquoted property 'GetCurrentTemplateName' found. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | 197| 197| }); | 198| 198| | 199| 199| AddMock(SYSTEM_ENTITY, IID_TemplateManager, { | 200| |- GetCurrentTemplateName: function(ent) { return "special/formations/line_closed"; }, | | 200|+ "GetCurrentTemplateName": function(ent) { return "special/formations/line_closed"; }, | 201| 201| }); | 202| 202| | 203| 203| AddMock(SYSTEM_ENTITY, IID_PlayerManager, { | | [NORMAL] ESLintBear (quote-props): | | Unquoted property 'GetPlayerByID' found. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | 201| 201| }); | 202| 202| | 203| 203| AddMock(SYSTEM_ENTITY, IID_PlayerManager, { | 204| |- GetPlayerByID: function(id) { return playerEntity; }, | | 204|+ "GetPlayerByID": function(id) { return playerEntity; }, | 205| 205| GetNumPlayers: function() { return 2; }, | 206| 206| }); | 207| 207| | | [NORMAL] ESLintBear (quote-props): | | Unquoted property 'GetNumPlayers' found. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | 202| 202| | 203| 203| AddMock(SYSTEM_ENTITY, IID_PlayerManager, { | 204| 204| GetPlayerByID: function(id) { return playerEntity; }, | 205| |- GetNumPlayers: function() { return 2; }, | | 205|+ "GetNumPlayers": function() { return 2; }, | 206| 206| }); | 207| 207| | 208| 208| AddMock(playerEntity, IID_Player, { | | [NORMAL] ESLintBear (quote-props): | | Unquoted property 'IsAlly' found. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | 206| 206| }); | 207| 207| | 208| 208| AddMock(playerEntity, IID_Player, { | 209| |- IsAlly: function() { return false; }, | | 209|+ "IsAlly": function() { return false; }, | 210| 210| IsEnemy: function() { return true; }, | 211| 211| GetEnemies: function() { return []; }, | 212| 212| }); | | [NORMAL] ESLintBear (quote-props): | | Unquoted property 'IsEnemy' found. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | 207| 207| | 208| 208| AddMock(playerEntity, IID_Player, { | 209| 209| IsAlly: function() { return false; }, | 210| |- IsEnemy: function() { return true; }, | | 210|+ "IsEnemy": function() { return true; }, | 211| 211| GetEnemies: function() { return []; }, | 212| 212| }); | 213| 213| | | [NORMAL] ESLintBear (quote-props): | | Unquoted property 'GetEnemies' found. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | 208| 208| AddMock(playerEntity, IID_Player, { | 209| 209| IsAlly: function() { return false; }, | 210| 210| IsEnemy: function() { return true; }, | 211| |- GetEnemies: function() { return []; }, | | 211|+ "GetEnemies": function() { return []; }, | 212| 212| }); | 213| 213| | 214| 214| // create units | | [NORMAL] ESLintBear (quote-props): | | Unquoted property 'GetClassesList' found. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | 219| 219| var unitAI = ConstructComponent(unit + i, "UnitAI", { "FormationController": "false", "DefaultStance": "aggressive" }); | 220| 220| | 221| 221| AddMock(unit + i, IID_Identity, { | 222| |- GetClassesList: function() { return []; }, | | 222|+ "GetClassesList": function() { return []; }, | 223| 223| }); | 224| 224| | 225| 225| AddMock(unit + i, IID_Ownership, { | | [NORMAL] ESLintBear (quote-props): | | Unquoted property 'GetOwner' found. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | 223| 223| }); | 224| 224| | 225| 225| AddMock(unit + i, IID_Ownership, { | 226| |- GetOwner: function() { return 1; }, | | 226|+ "GetOwner": function() { return 1; }, | 227| 227| }); | 228| 228| | 229| 229| AddMock(unit + i, IID_Position, { | | [NORMAL] ESLintBear (quote-props): | | Unquoted property 'GetTurretParent' found. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | 227| 227| }); | 228| 228| | 229| 229| AddMock(unit + i, IID_Position, { | 230| |- GetTurretParent: function() { return INVALID_ENTITY; }, | | 230|+ "GetTurretParent": function() { return INVALID_ENTITY; }, | 231| 231| GetPosition: function() { return new Vector3D(); }, | 232| 232| GetPosition2D: function() { return new Vector2D(); }, | 233| 233| GetRotation: function() { return { "y": 0 }; }, | | [NORMAL] ESLintBear (quote-props): | | Unquoted property 'GetPosition' found. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | 228| 228| | 229| 229| AddMock(unit + i, IID_Position, { | 230| 230| GetTurretParent: function() { return INVALID_ENTITY; }, | 231| |- GetPosition: function() { return new Vector3D(); }, | | 231|+ "GetPosition": function() { return new Vector3D(); }, | 232| 232| GetPosition2D: function() { return new Vector2D(); }, | 233| 233| GetRotation: function() { return { "y": 0 }; }, | 234| 234| IsInWorld: function() { return true; }, | | [NORMAL] ESLintBear (quote-props): | | Unquoted property 'GetPosition2D' found. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | 229| 229| AddMock(unit + i, IID_Position, { | 230| 230| GetTurretParent: function() { return INVALID_ENTITY; }, | 231| 231| GetPosition: function() { return new Vector3D(); }, | 232| |- GetPosition2D: function() { return new Vector2D(); }, | | 232|+ "GetPosition2D": function() { return new Vector2D(); }, | 233| 233| GetRotation: function() { return { "y": 0 }; }, | 234| 234| IsInWorld: function() { return true; }, | 235| 235| }); | | [NORMAL] ESLintBear (quote-props): | | Unquoted property 'GetRotation' found. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | 230| 230| GetTurretParent: function() { return INVALID_ENTITY; }, | 231| 231| GetPosition: function() { return new Vector3D(); }, | 232| 232| GetPosition2D: function() { return new Vector2D(); }, | 233| |- GetRotation: function() { return { "y": 0 }; }, | | 233|+ "GetRotation": function() { return { "y": 0 }; }, | 234| 234| IsInWorld: function() { return true; }, | 235| 235| }); | 236| 236| | | [NORMAL] ESLintBear (quote-props): | | Unquoted property 'IsInWorld' found. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | 231| 231| GetPosition: function() { return new Vector3D(); }, | 232| 232| GetPosition2D: function() { return new Vector2D(); }, | 233| 233| GetRotation: function() { return { "y": 0 }; }, | 234| |- IsInWorld: function() { return true; }, | | 234|+ "IsInWorld": function() { return true; }, | 235| 235| }); | 236| 236| | 237| 237| AddMock(unit + i, IID_UnitMotion, { | | [NORMAL] ESLintBear (quote-props): | | Unquoted property 'GetWalkSpeed' found. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | 235| 235| }); | 236| 236| | 237| 237| AddMock(unit + i, IID_UnitMotion, { | 238| |- GetWalkSpeed: function() { return 1; }, | | 238|+ "GetWalkSpeed": function() { return 1; }, | 239| 239| MoveToFormationOffset: function(target, x, z) { }, | 240| 240| IsInTargetRange: function(target, min, max) { return true; }, | 241| 241| MoveToTargetRange: function(target, min, max) { }, | | [NORMAL] ESLintBear (quote-props): | | Unquoted property 'MoveToFormationOffset' found. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | 236| 236| | 237| 237| AddMock(unit + i, IID_UnitMotion, { | 238| 238| GetWalkSpeed: function() { return 1; }, | 239| |- MoveToFormationOffset: function(target, x, z) { }, | | 239|+ "MoveToFormationOffset": function(target, x, z) { }, | 240| 240| IsInTargetRange: function(target, min, max) { return true; }, | 241| 241| MoveToTargetRange: function(target, min, max) { }, | 242| 242| StopMoving: function() { }, | | [NORMAL] ESLintBear (quote-props): | | Unquoted property 'IsInTargetRange' found. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | 237| 237| AddMock(unit + i, IID_UnitMotion, { | 238| 238| GetWalkSpeed: function() { return 1; }, | 239| 239| MoveToFormationOffset: function(target, x, z) { }, | 240| |- IsInTargetRange: function(target, min, max) { return true; }, | | 240|+ "IsInTargetRange": function(target, min, max) { return true; }, | 241| 241| MoveToTargetRange: function(target, min, max) { }, | 242| 242| StopMoving: function() { }, | 243| 243| GetPassabilityClassName: function() { return "default"; }, | | [NORMAL] ESLintBear (quote-props): | | Unquoted property 'MoveToTargetRange' found. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | 238| 238| GetWalkSpeed: function() { return 1; }, | 239| 239| MoveToFormationOffset: function(target, x, z) { }, | 240| 240| IsInTargetRange: function(target, min, max) { return true; }, | 241| |- MoveToTargetRange: function(target, min, max) { }, | | 241|+ "MoveToTargetRange": function(target, min, max) { }, | 242| 242| StopMoving: function() { }, | 243| 243| GetPassabilityClassName: function() { return "default"; }, | 244| 244| }); | | [NORMAL] ESLintBear (quote-props): | | Unquoted property 'StopMoving' found. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | 239| 239| MoveToFormationOffset: function(target, x, z) { }, | 240| 240| IsInTargetRange: function(target, min, max) { return true; }, | 241| 241| MoveToTargetRange: function(target, min, max) { }, | 242| |- StopMoving: function() { }, | | 242|+ "StopMoving": function() { }, | 243| 243| GetPassabilityClassName: function() { return "default"; }, | 244| 244| }); | 245| 245| | | [NORMAL] ESLintBear (quote-props): | | Unquoted property 'GetPassabilityClassName' found. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | 240| 240| IsInTargetRange: function(target, min, max) { return true; }, | 241| 241| MoveToTargetRange: function(target, min, max) { }, | 242| 242| StopMoving: function() { }, | 243| |- GetPassabilityClassName: function() { return "default"; }, | | 243|+ "GetPassabilityClassName": function() { return "default"; }, | 244| 244| }); | 245| 245| | 246| 246| AddMock(unit + i, IID_Vision, { | | [NORMAL] ESLintBear (quote-props): | | Unquoted property 'GetRange' found. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | 244| 244| }); | 245| 245| | 246| 246| AddMock(unit + i, IID_Vision, { | 247| |- GetRange: function() { return 10; }, | | 247|+ "GetRange": function() { return 10; }, | 248| 248| }); | 249| 249| | 250| 250| AddMock(unit + i, IID_Attack, { | | [NORMAL] ESLintBear (quote-props): | | Unquoted property 'GetRange' found. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | 248| 248| }); | 249| 249| | 250| 250| AddMock(unit + i, IID_Attack, { | 251| |- GetRange: function() { return {"max":10, "min": 0}; }, | | 251|+ "GetRange": function() { return {"max":10, "min": 0}; }, | 252| 252| GetFullAttackRange: function() { return { "max": 40, "min": 0}; }, | 253| 253| GetBestAttackAgainst: function(t) { return "melee"; }, | 254| 254| GetTimers: function() { return { "prepare": 500, "repeat": 1000 }; }, | | [NORMAL] ESLintBear (object-curly-spacing): | | A space is required after '{'. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | 248| 248| }); | 249| 249| | 250| 250| AddMock(unit + i, IID_Attack, { | 251| |- GetRange: function() { return {"max":10, "min": 0}; }, | | 251|+ GetRange: function() { return { "max":10, "min": 0}; }, | 252| 252| GetFullAttackRange: function() { return { "max": 40, "min": 0}; }, | 253| 253| GetBestAttackAgainst: function(t) { return "melee"; }, | 254| 254| GetTimers: function() { return { "prepare": 500, "repeat": 1000 }; }, | | [NORMAL] ESLintBear (key-spacing): | | Missing space before value for key 'max'. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | 248| 248| }); | 249| 249| | 250| 250| AddMock(unit + i, IID_Attack, { | 251| |- GetRange: function() { return {"max":10, "min": 0}; }, | | 251|+ GetRange: function() { return {"max": 10, "min": 0}; }, | 252| 252| GetFullAttackRange: function() { return { "max": 40, "min": 0}; }, | 253| 253| GetBestAttackAgainst: function(t) { return "melee"; }, | 254| 254| GetTimers: function() { return { "prepare": 500, "repeat": 1000 }; }, | | [NORMAL] ESLintBear (object-curly-spacing): | | A space is required before '}'. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | 248| 248| }); | 249| 249| | 250| 250| AddMock(unit + i, IID_Attack, { | 251| |- GetRange: function() { return {"max":10, "min": 0}; }, | | 251|+ GetRange: function() { return {"max":10, "min": 0 }; }, | 252| 252| GetFullAttackRange: function() { return { "max": 40, "min": 0}; }, | 253| 253| GetBestAttackAgainst: function(t) { return "melee"; }, | 254| 254| GetTimers: function() { return { "prepare": 500, "repeat": 1000 }; }, | | [NORMAL] ESLintBear (quote-props): | | Unquoted property 'GetFullAttackRange' found. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | 249| 249| | 250| 250| AddMock(unit + i, IID_Attack, { | 251| 251| GetRange: function() { return {"max":10, "min": 0}; }, | 252| |- GetFullAttackRange: function() { return { "max": 40, "min": 0}; }, | | 252|+ "GetFullAttackRange": function() { return { "max": 40, "min": 0}; }, | 253| 253| GetBestAttackAgainst: function(t) { return "melee"; }, | 254| 254| GetTimers: function() { return { "prepare": 500, "repeat": 1000 }; }, | 255| 255| CanAttack: function(v) { return true; }, | | [NORMAL] ESLintBear (object-curly-spacing): | | A space is required before '}'. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | 249| 249| | 250| 250| AddMock(unit + i, IID_Attack, { | 251| 251| GetRange: function() { return {"max":10, "min": 0}; }, | 252| |- GetFullAttackRange: function() { return { "max": 40, "min": 0}; }, | | 252|+ GetFullAttackRange: function() { return { "max": 40, "min": 0 }; }, | 253| 253| GetBestAttackAgainst: function(t) { return "melee"; }, | 254| 254| GetTimers: function() { return { "prepare": 500, "repeat": 1000 }; }, | 255| 255| CanAttack: function(v) { return true; }, | | [NORMAL] ESLintBear (quote-props): | | Unquoted property 'GetBestAttackAgainst' found. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | 250| 250| AddMock(unit + i, IID_Attack, { | 251| 251| GetRange: function() { return {"max":10, "min": 0}; }, | 252| 252| GetFullAttackRange: function() { return { "max": 40, "min": 0}; }, | 253| |- GetBestAttackAgainst: function(t) { return "melee"; }, | | 253|+ "GetBestAttackAgainst": function(t) { return "melee"; }, | 254| 254| GetTimers: function() { return { "prepare": 500, "repeat": 1000 }; }, | 255| 255| CanAttack: function(v) { return true; }, | 256| 256| CompareEntitiesByPreference: function(a, b) { return 0; }, | | [NORMAL] ESLintBear (quote-props): | | Unquoted property 'GetTimers' found. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | 251| 251| GetRange: function() { return {"max":10, "min": 0}; }, | 252| 252| GetFullAttackRange: function() { return { "max": 40, "min": 0}; }, | 253| 253| GetBestAttackAgainst: function(t) { return "melee"; }, | 254| |- GetTimers: function() { return { "prepare": 500, "repeat": 1000 }; }, | | 254|+ "GetTimers": function() { return { "prepare": 500, "repeat": 1000 }; }, | 255| 255| CanAttack: function(v) { return true; }, | 256| 256| CompareEntitiesByPreference: function(a, b) { return 0; }, | 257| 257| }); | | [NORMAL] ESLintBear (quote-props): | | Unquoted property 'CanAttack' found. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | 252| 252| GetFullAttackRange: function() { return { "max": 40, "min": 0}; }, | 253| 253| GetBestAttackAgainst: function(t) { return "melee"; }, | 254| 254| GetTimers: function() { return { "prepare": 500, "repeat": 1000 }; }, | 255| |- CanAttack: function(v) { return true; }, | | 255|+ "CanAttack": function(v) { return true; }, | 256| 256| CompareEntitiesByPreference: function(a, b) { return 0; }, | 257| 257| }); | 258| 258| | | [NORMAL] ESLintBear (quote-props): | | Unquoted property 'CompareEntitiesByPreference' found. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | 253| 253| GetBestAttackAgainst: function(t) { return "melee"; }, | 254| 254| GetTimers: function() { return { "prepare": 500, "repeat": 1000 }; }, | 255| 255| CanAttack: function(v) { return true; }, | 256| |- CompareEntitiesByPreference: function(a, b) { return 0; }, | | 256|+ "CompareEntitiesByPreference": function(a, b) { return 0; }, | 257| 257| }); | 258| 258| | 259| 259| unitAI.OnCreate(); | | [NORMAL] ESLintBear (quote-props): | | Unquoted property 'GetHitpoints' found. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | 265| 265| | 266| 266| // create enemy | 267| 267| AddMock(enemy, IID_Health, { | 268| |- GetHitpoints: function() { return 40; }, | | 268|+ "GetHitpoints": function() { return 40; }, | 269| 269| }); | 270| 270| | 271| 271| var controllerFormation = ConstructComponent(controller, "Formation", {"FormationName": "Line Closed", "FormationShape": "square", "ShiftRows": "false", "SortingClasses": "", "WidthDepthRatio": 1, "UnitSeparationWidthMultiplier": 1, "UnitSeparationDepthMultiplier": 1, "SpeedMultiplier": 1, "Sloppyness": 0}); | | [NORMAL] ESLintBear (object-curly-spacing): | | A space is required after '{'. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | 268| 268| GetHitpoints: function() { return 40; }, | 269| 269| }); | 270| 270| | 271| |- var controllerFormation = ConstructComponent(controller, "Formation", {"FormationName": "Line Closed", "FormationShape": "square", "ShiftRows": "false", "SortingClasses": "", "WidthDepthRatio": 1, "UnitSeparationWidthMultiplier": 1, "UnitSeparationDepthMultiplier": 1, "SpeedMultiplier": 1, "Sloppyness": 0}); | | 271|+ var controllerFormation = ConstructComponent(controller, "Formation", { "FormationName": "Line Closed", "FormationShape": "square", "ShiftRows": "false", "SortingClasses": "", "WidthDepthRatio": 1, "UnitSeparationWidthMultiplier": 1, "UnitSeparationDepthMultiplier": 1, "SpeedMultiplier": 1, "Sloppyness": 0}); | 272| 272| var controllerAI = ConstructComponent(controller, "UnitAI", { "FormationController": "true", "DefaultStance": "aggressive" }); | 273| 273| | 274| 274| AddMock(controller, IID_Position, { | | [NORMAL] ESLintBear (object-curly-spacing): | | A space is required before '}'. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | 268| 268| GetHitpoints: function() { return 40; }, | 269| 269| }); | 270| 270| | 271| |- var controllerFormation = ConstructComponent(controller, "Formation", {"FormationName": "Line Closed", "FormationShape": "square", "ShiftRows": "false", "SortingClasses": "", "WidthDepthRatio": 1, "UnitSeparationWidthMultiplier": 1, "UnitSeparationDepthMultiplier": 1, "SpeedMultiplier": 1, "Sloppyness": 0}); | | 271|+ var controllerFormation = ConstructComponent(controller, "Formation", {"FormationName": "Line Closed", "FormationShape": "square", "ShiftRows": "false", "SortingClasses": "", "WidthDepthRatio": 1, "UnitSeparationWidthMultiplier": 1, "UnitSeparationDepthMultiplier": 1, "SpeedMultiplier": 1, "Sloppyness": 0 }); | 272| 272| var controllerAI = ConstructComponent(controller, "UnitAI", { "FormationController": "true", "DefaultStance": "aggressive" }); | 273| 273| | 274| 274| AddMock(controller, IID_Position, { | | [NORMAL] ESLintBear (quote-props): | | Unquoted property 'GetTurretParent' found. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | 272| 272| var controllerAI = ConstructComponent(controller, "UnitAI", { "FormationController": "true", "DefaultStance": "aggressive" }); | 273| 273| | 274| 274| AddMock(controller, IID_Position, { | 275| |- GetTurretParent: function() { return INVALID_ENTITY; }, | | 275|+ "GetTurretParent": function() { return INVALID_ENTITY; }, | 276| 276| JumpTo: function(x, z) { this.x = x; this.z = z; }, | 277| 277| GetPosition: function() { return new Vector3D(this.x, 0, this.z); }, | 278| 278| GetPosition2D: function() { return new Vector2D(this.x, this.z); }, | | [NORMAL] ESLintBear (quote-props): | | Unquoted property 'JumpTo' found. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | 273| 273| | 274| 274| AddMock(controller, IID_Position, { | 275| 275| GetTurretParent: function() { return INVALID_ENTITY; }, | 276| |- JumpTo: function(x, z) { this.x = x; this.z = z; }, | | 276|+ "JumpTo": function(x, z) { this.x = x; this.z = z; }, | 277| 277| GetPosition: function() { return new Vector3D(this.x, 0, this.z); }, | 278| 278| GetPosition2D: function() { return new Vector2D(this.x, this.z); }, | 279| 279| GetRotation: function() { return { "y": 0 }; }, | | [NORMAL] ESLintBear (quote-props): | | Unquoted property 'GetPosition' found. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | 274| 274| AddMock(controller, IID_Position, { | 275| 275| GetTurretParent: function() { return INVALID_ENTITY; }, | 276| 276| JumpTo: function(x, z) { this.x = x; this.z = z; }, | 277| |- GetPosition: function() { return new Vector3D(this.x, 0, this.z); }, | | 277|+ "GetPosition": function() { return new Vector3D(this.x, 0, this.z); }, | 278| 278| GetPosition2D: function() { return new Vector2D(this.x, this.z); }, | 279| 279| GetRotation: function() { return { "y": 0 }; }, | 280| 280| IsInWorld: function() { return true; }, | | [NORMAL] ESLintBear (quote-props): | | Unquoted property 'GetPosition2D' found. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | 275| 275| GetTurretParent: function() { return INVALID_ENTITY; }, | 276| 276| JumpTo: function(x, z) { this.x = x; this.z = z; }, | 277| 277| GetPosition: function() { return new Vector3D(this.x, 0, this.z); }, | 278| |- GetPosition2D: function() { return new Vector2D(this.x, this.z); }, | | 278|+ "GetPosition2D": function() { return new Vector2D(this.x, this.z); }, | 279| 279| GetRotation: function() { return { "y": 0 }; }, | 280| 280| IsInWorld: function() { return true; }, | 281| 281| }); | | [NORMAL] ESLintBear (quote-props): | | Unquoted property 'GetRotation' found. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | 276| 276| JumpTo: function(x, z) { this.x = x; this.z = z; }, | 277| 277| GetPosition: function() { return new Vector3D(this.x, 0, this.z); }, | 278| 278| GetPosition2D: function() { return new Vector2D(this.x, this.z); }, | 279| |- GetRotation: function() { return { "y": 0 }; }, | | 279|+ "GetRotation": function() { return { "y": 0 }; }, | 280| 280| IsInWorld: function() { return true; }, | 281| 281| }); | 282| 282| | | [NORMAL] ESLintBear (quote-props): | | Unquoted property 'IsInWorld' found. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | 277| 277| GetPosition: function() { return new Vector3D(this.x, 0, this.z); }, | 278| 278| GetPosition2D: function() { return new Vector2D(this.x, this.z); }, | 279| 279| GetRotation: function() { return { "y": 0 }; }, | 280| |- IsInWorld: function() { return true; }, | | 280|+ "IsInWorld": function() { return true; }, | 281| 281| }); | 282| 282| | 283| 283| AddMock(controller, IID_UnitMotion, { | | [NORMAL] ESLintBear (quote-props): | | Unquoted property 'SetSpeed' found. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | 281| 281| }); | 282| 282| | 283| 283| AddMock(controller, IID_UnitMotion, { | 284| |- SetSpeed: function(speed) { }, | | 284|+ "SetSpeed": function(speed) { }, | 285| 285| MoveToPointRange: function(x, z, minRange, maxRange) { }, | 286| 286| IsInTargetRange: function(target, min, max) { return true; }, | 287| 287| GetPassabilityClassName: function() { return "default"; }, | | [NORMAL] ESLintBear (quote-props): | | Unquoted property 'MoveToPointRange' found. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | 282| 282| | 283| 283| AddMock(controller, IID_UnitMotion, { | 284| 284| SetSpeed: function(speed) { }, | 285| |- MoveToPointRange: function(x, z, minRange, maxRange) { }, | | 285|+ "MoveToPointRange": function(x, z, minRange, maxRange) { }, | 286| 286| IsInTargetRange: function(target, min, max) { return true; }, | 287| 287| GetPassabilityClassName: function() { return "default"; }, | 288| 288| }); | | [NORMAL] ESLintBear (quote-props): | | Unquoted property 'IsInTargetRange' found. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | 283| 283| AddMock(controller, IID_UnitMotion, { | 284| 284| SetSpeed: function(speed) { }, | 285| 285| MoveToPointRange: function(x, z, minRange, maxRange) { }, | 286| |- IsInTargetRange: function(target, min, max) { return true; }, | | 286|+ "IsInTargetRange": function(target, min, max) { return true; }, | 287| 287| GetPassabilityClassName: function() { return "default"; }, | 288| 288| }); | 289| 289| | | [NORMAL] ESLintBear (quote-props): | | Unquoted property 'GetPassabilityClassName' found. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | 284| 284| SetSpeed: function(speed) { }, | 285| 285| MoveToPointRange: function(x, z, minRange, maxRange) { }, | 286| 286| IsInTargetRange: function(target, min, max) { return true; }, | 287| |- GetPassabilityClassName: function() { return "default"; }, | | 287|+ "GetPassabilityClassName": function() { return "default"; }, | 288| 288| }); | 289| 289| | 290| 290| AddMock(controller, IID_Attack, { | | [NORMAL] ESLintBear (quote-props): | | Unquoted property 'GetRange' found. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | 288| 288| }); | 289| 289| | 290| 290| AddMock(controller, IID_Attack, { | 291| |- GetRange: function() { return {"max":10, "min": 0}; }, | | 291|+ "GetRange": function() { return {"max":10, "min": 0}; }, | 292| 292| CanAttackAsFormation: function() { return false; }, | 293| 293| }); | 294| 294| | | [NORMAL] ESLintBear (object-curly-spacing): | | A space is required after '{'. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | 288| 288| }); | 289| 289| | 290| 290| AddMock(controller, IID_Attack, { | 291| |- GetRange: function() { return {"max":10, "min": 0}; }, | | 291|+ GetRange: function() { return { "max":10, "min": 0}; }, | 292| 292| CanAttackAsFormation: function() { return false; }, | 293| 293| }); | 294| 294| | | [NORMAL] ESLintBear (key-spacing): | | Missing space before value for key 'max'. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | 288| 288| }); | 289| 289| | 290| 290| AddMock(controller, IID_Attack, { | 291| |- GetRange: function() { return {"max":10, "min": 0}; }, | | 291|+ GetRange: function() { return {"max": 10, "min": 0}; }, | 292| 292| CanAttackAsFormation: function() { return false; }, | 293| 293| }); | 294| 294| | | [NORMAL] ESLintBear (object-curly-spacing): | | A space is required before '}'. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | 288| 288| }); | 289| 289| | 290| 290| AddMock(controller, IID_Attack, { | 291| |- GetRange: function() { return {"max":10, "min": 0}; }, | | 291|+ GetRange: function() { return {"max":10, "min": 0 }; }, | 292| 292| CanAttackAsFormation: function() { return false; }, | 293| 293| }); | 294| 294| | | [NORMAL] ESLintBear (quote-props): | | Unquoted property 'CanAttackAsFormation' found. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | 289| 289| | 290| 290| AddMock(controller, IID_Attack, { | 291| 291| GetRange: function() { return {"max":10, "min": 0}; }, | 292| |- CanAttackAsFormation: function() { return false; }, | | 292|+ "CanAttackAsFormation": function() { return false; }, | 293| 293| }); | 294| 294| | 295| 295| controllerAI.OnCreate(); | | [NORMAL] ESLintBear (object-curly-spacing): | | A space is required after '{'. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | 301| 301| for (var ent of unitAIs) | 302| 302| TS_ASSERT_EQUALS(unitAI.fsmStateName, "INDIVIDUAL.COMBAT.ATTACKING"); | 303| 303| | 304| |- controllerAI.MoveIntoFormation({"name": "Circle"}); | | 304|+ controllerAI.MoveIntoFormation({ "name": "Circle"}); | 305| 305| | 306| 306| // let all units be in position | 307| 307| for (var ent of unitAIs) | | [NORMAL] ESLintBear (object-curly-spacing): | | A space is required before '}'. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | 301| 301| for (var ent of unitAIs) | 302| 302| TS_ASSERT_EQUALS(unitAI.fsmStateName, "INDIVIDUAL.COMBAT.ATTACKING"); | 303| 303| | 304| |- controllerAI.MoveIntoFormation({"name": "Circle"}); | | 304|+ controllerAI.MoveIntoFormation({"name": "Circle" }); | 305| 305| | 306| 306| // let all units be in position | 307| 307| for (var ent of unitAIs) binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | 47| » » ResetActiveQuery:·function(id)·{·if·(mode·==·0)·return·[];·else·return·[enemy];·}, | | [NORMAL] ESLintBear (brace-rules/brace-on-same-line): | | Closing curly brace appears on the same line as the subsequent block. binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | 215| » for·(var·i·=·0;·i·<·unitCount;·i++)·{ | | [NORMAL] ESLintBear (brace-rules/brace-on-same-line): | | Opening curly brace appears on the same line as controlling statement. binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | 307| » for·(var·ent·of·unitAIs) | | [NORMAL] JSHintBear: | | 'ent' is already defined. binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | 310| » for·(var·ent·of·unitAIs) | | [NORMAL] JSHintBear: | | 'ent' is already defined. binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | 302| » » TS_ASSERT_EQUALS(unitAI.fsmStateName,·"INDIVIDUAL.COMBAT.ATTACKING"); | | [NORMAL] JSHintBear: | | 'unitAI' used out of scope. binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | 311| » » TS_ASSERT_EQUALS(unitAI.fsmStateName,·"INDIVIDUAL.COMBAT.ATTACKING"); | | [NORMAL] JSHintBear: | | 'unitAI' used out of scope. | | [NORMAL] ESLintBear (quote-props): | | Unquoted property 'targetVisibleEnemies' found. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | 70| 70| // do worry around armies slaughtering the guy standing next to you), etc. | 71| 71| var g_Stances = { | 72| 72| "violent": { | 73| |- targetVisibleEnemies: true, | | 73|+ "targetVisibleEnemies": true, | 74| 74| targetAttackersAlways: true, | 75| 75| respondFlee: false, | 76| 76| respondChase: true, | | [NORMAL] ESLintBear (quote-props): | | Unquoted property 'targetAttackersAlways' found. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | 71| 71| var g_Stances = { | 72| 72| "violent": { | 73| 73| targetVisibleEnemies: true, | 74| |- targetAttackersAlways: true, | | 74|+ "targetAttackersAlways": true, | 75| 75| respondFlee: false, | 76| 76| respondChase: true, | 77| 77| respondChaseBeyondVision: true, | | [NORMAL] ESLintBear (quote-props): | | Unquoted property 'respondFlee' found. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | 72| 72| "violent": { | 73| 73| targetVisibleEnemies: true, | 74| 74| targetAttackersAlways: true, | 75| |- respondFlee: false, | | 75|+ "respondFlee": false, | 76| 76| respondChase: true, | 77| 77| respondChaseBeyondVision: true, | 78| 78| respondStandGround: false, | | [NORMAL] ESLintBear (quote-props): | | Unquoted property 'respondChase' found. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | 73| 73| targetVisibleEnemies: true, | 74| 74| targetAttackersAlways: true, | 75| 75| respondFlee: false, | 76| |- respondChase: true, | | 76|+ "respondChase": true, | 77| 77| respondChaseBeyondVision: true, | 78| 78| respondStandGround: false, | 79| 79| respondHoldGround: false, | | [NORMAL] ESLintBear (quote-props): | | Unquoted property 'respondChaseBeyondVision' found. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | 74| 74| targetAttackersAlways: true, | 75| 75| respondFlee: false, | 76| 76| respondChase: true, | 77| |- respondChaseBeyondVision: true, | | 77|+ "respondChaseBeyondVision": true, | 78| 78| respondStandGround: false, | 79| 79| respondHoldGround: false, | 80| 80| }, | | [NORMAL] ESLintBear (quote-props): | | Unquoted property 'respondStandGround' found. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | 75| 75| respondFlee: false, | 76| 76| respondChase: true, | 77| 77| respondChaseBeyondVision: true, | 78| |- respondStandGround: false, | | 78|+ "respondStandGround": false, | 79| 79| respondHoldGround: false, | 80| 80| }, | 81| 81| "aggressive": { | | [NORMAL] ESLintBear (quote-props): | | Unquoted property 'respondHoldGround' found. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | 76| 76| respondChase: true, | 77| 77| respondChaseBeyondVision: true, | 78| 78| respondStandGround: false, | 79| |- respondHoldGround: false, | | 79|+ "respondHoldGround": false, | 80| 80| }, | 81| 81| "aggressive": { | 82| 82| targetVisibleEnemies: true, | | [NORMAL] ESLintBear (quote-props): | | Unquoted property 'targetVisibleEnemies' found. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | 79| 79| respondHoldGround: false, | 80| 80| }, | 81| 81| "aggressive": { | 82| |- targetVisibleEnemies: true, | | 82|+ "targetVisibleEnemies": true, | 83| 83| targetAttackersAlways: false, | 84| 84| respondFlee: false, | 85| 85| respondChase: true, | | [NORMAL] ESLintBear (quote-props): | | Unquoted property 'targetAttackersAlways' found. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | 80| 80| }, | 81| 81| "aggressive": { | 82| 82| targetVisibleEnemies: true, | 83| |- targetAttackersAlways: false, | | 83|+ "targetAttackersAlways": false, | 84| 84| respondFlee: false, | 85| 85| respondChase: true, | 86| 86| respondChaseBeyondVision: false, | | [NORMAL] ESLintBear (quote-props): | | Unquoted property 'respondFlee' found. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | 81| 81| "aggressive": { | 82| 82| targetVisibleEnemies: true, | 83| 83| targetAttackersAlways: false, | 84| |- respondFlee: false, | | 84|+ "respondFlee": false, | 85| 85| respondChase: true, | 86| 86| respondChaseBeyondVision: false, | 87| 87| respondStandGround: false, | | [NORMAL] ESLintBear (quote-props): | | Unquoted property 'respondChase' found. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | 82| 82| targetVisibleEnemies: true, | 83| 83| targetAttackersAlways: false, | 84| 84| respondFlee: false, | 85| |- respondChase: true, | | 85|+ "respondChase": true, | 86| 86| respondChaseBeyondVision: false, | 87| 87| respondStandGround: false, | 88| 88| respondHoldGround: false, | | [NORMAL] ESLintBear (quote-props): | | Unquoted property 'respondChaseBeyondVision' found. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | 83| 83| targetAttackersAlways: false, | 84| 84| respondFlee: false, | 85| 85| respondChase: true, | 86| |- respondChaseBeyondVision: false, | | 86|+ "respondChaseBeyondVision": false, | 87| 87| respondStandGround: false, | 88| 88| respondHoldGround: false, | 89| 89| }, | | [NORMAL] ESLintBear (quote-props): | | Unquoted property 'respondStandGround' found. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | 84| 84| respondFlee: false, | 85| 85| respondChase: true, | 86| 86| respondChaseBeyondVision: false, | 87| |- respondStandGround: false, | | 87|+ "respondStandGround": false, | 88| 88| respondHoldGround: false, | 89| 89| }, | 90| 90| "defensive": { | | [NORMAL] ESLintBear (quote-props): | | Unquoted property 'respondHoldGround' found. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | 85| 85| respondChase: true, | 86| 86| respondChaseBeyondVision: false, | 87| 87| respondStandGround: false, | 88| |- respondHoldGround: false, | | 88|+ "respondHoldGround": false, | 89| 89| }, | 90| 90| "defensive": { | 91| 91| targetVisibleEnemies: true, | | [NORMAL] ESLintBear (quote-props): | | Unquoted property 'targetVisibleEnemies' found. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | 88| 88| respondHoldGround: false, | 89| 89| }, | 90| 90| "defensive": { | 91| |- targetVisibleEnemies: true, | | 91|+ "targetVisibleEnemies": true, | 92| 92| targetAttackersAlways: false, | 93| 93| respondFlee: false, | 94| 94| respondChase: false, | | [NORMAL] ESLintBear (quote-props): | | Unquoted property 'targetAttackersAlways' found. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | 89| 89| }, | 90| 90| "defensive": { | 91| 91| targetVisibleEnemies: true, | 92| |- targetAttackersAlways: false, | | 92|+ "targetAttackersAlways": false, | 93| 93| respondFlee: false, | 94| 94| respondChase: false, | 95| 95| respondChaseBeyondVision: false, | | [NORMAL] ESLintBear (quote-props): | | Unquoted property 'respondFlee' found. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | 90| 90| "defensive": { | 91| 91| targetVisibleEnemies: true, | 92| 92| targetAttackersAlways: false, | 93| |- respondFlee: false, | | 93|+ "respondFlee": false, | 94| 94| respondChase: false, | 95| 95| respondChaseBeyondVision: false, | 96| 96| respondStandGround: false, | | [NORMAL] ESLintBear (quote-props): | | Unquoted property 'respondChase' found. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | 91| 91| targetVisibleEnemies: true, | 92| 92| targetAttackersAlways: false, | 93| 93| respondFlee: false, | 94| |- respondChase: false, | | 94|+ "respondChase": false, | 95| 95| respondChaseBeyondVision: false, | 96| 96| respondStandGround: false, | 97| 97| respondHoldGround: true, | | [NORMAL] ESLintBear (quote-props): | | Unquoted property 'respondChaseBeyondVision' found. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | 92| 92| targetAttackersAlways: false, | 93| 93| respondFlee: false, | 94| 94| respondChase: false, | 95| |- respondChaseBeyondVision: false, | | 95|+ "respondChaseBeyondVision": false, | 96| 96| respondStandGround: false, | 97| 97| respondHoldGround: true, | 98| 98| }, | | [NORMAL] ESLintBear (quote-props): | | Unquoted property 'respondStandGround' found. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | 93| 93| respondFlee: false, | 94| 94| respondChase: false, | 95| 95| respondChaseBeyondVision: false, | 96| |- respondStandGround: false, | | 96|+ "respondStandGround": false, | 97| 97| respondHoldGround: true, | 98| 98| }, | 99| 99| "passive": { | | [NORMAL] ESLintBear (quote-props): | | Unquoted property 'respondHoldGround' found. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | 94| 94| respondChase: false, | 95| 95| respondChaseBeyondVision: false, | 96| 96| respondStandGround: false, | 97| |- respondHoldGround: true, | | 97|+ "respondHoldGround": true, | 98| 98| }, | 99| 99| "passive": { | 100| 100| targetVisibleEnemies: false, | | [NORMAL] ESLintBear (quote-props): | | Unquoted property 'targetVisibleEnemies' found. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | 97| 97| respondHoldGround: true, | 98| 98| }, | 99| 99| "passive": { | 100| |- targetVisibleEnemies: false, | | 100|+ "targetVisibleEnemies": false, | 101| 101| targetAttackersAlways: false, | 102| 102| respondFlee: true, | 103| 103| respondChase: false, | | [NORMAL] ESLintBear (quote-props): | | Unquoted property 'targetAttackersAlways' found. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | 98| 98| }, | 99| 99| "passive": { | 100| 100| targetVisibleEnemies: false, | 101| |- targetAttackersAlways: false, | | 101|+ "targetAttackersAlways": false, | 102| 102| respondFlee: true, | 103| 103| respondChase: false, | 104| 104| respondChaseBeyondVision: false, | | [NORMAL] ESLintBear (quote-props): | | Unquoted property 'respondFlee' found. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | 99| 99| "passive": { | 100| 100| targetVisibleEnemies: false, | 101| 101| targetAttackersAlways: false, | 102| |- respondFlee: true, | | 102|+ "respondFlee": true, | 103| 103| respondChase: false, | 104| 104| respondChaseBeyondVision: false, | 105| 105| respondStandGround: false, | | [NORMAL] ESLintBear (quote-props): | | Unquoted property 'respondChase' found. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | 100| 100| targetVisibleEnemies: false, | 101| 101| targetAttackersAlways: false, | 102| 102| respondFlee: true, | 103| |- respondChase: false, | | 103|+ "respondChase": false, | 104| 104| respondChaseBeyondVision: false, | 105| 105| respondStandGround: false, | 106| 106| respondHoldGround: false, | | [NORMAL] ESLintBear (quote-props): | | Unquoted property 'respondChaseBeyondVision' found. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | 101| 101| targetAttackersAlways: false, | 102| 102| respondFlee: true, | 103| 103| respondChase: false, | 104| |- respondChaseBeyondVision: false, | | 104|+ "respondChaseBeyondVision": false, | 105| 105| respondStandGround: false, | 106| 106| respondHoldGround: false, | 107| 107| }, | | [NORMAL] ESLintBear (quote-props): | | Unquoted property 'respondStandGround' found. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | 102| 102| respondFlee: true, | 103| 103| respondChase: false, | 104| 104| respondChaseBeyondVision: false, | 105| |- respondStandGround: false, | | 105|+ "respondStandGround": false, | 106| 106| respondHoldGround: false, | 107| 107| }, | 108| 108| "standground": { | | [NORMAL] ESLintBear (quote-props): | | Unquoted property 'respondHoldGround' found. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | 103| 103| respondChase: false, | 104| 104| respondChaseBeyondVision: false, | 105| 105| respondStandGround: false, | 106| |- respondHoldGround: false, | | 106|+ "respondHoldGround": false, | 107| 107| }, | 108| 108| "standground": { | 109| 109| targetVisibleEnemies: true, | | [NORMAL] ESLintBear (quote-props): | | Unquoted property 'targetVisibleEnemies' found. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | 106| 106| respondHoldGround: false, | 107| 107| }, | 108| 108| "standground": { | 109| |- targetVisibleEnemies: true, | | 109|+ "targetVisibleEnemies": true, | 110| 110| targetAttackersAlways: false, | 111| 111| respondFlee: false, | 112| 112| respondChase: false, | | [NORMAL] ESLintBear (quote-props): | | Unquoted property 'targetAttackersAlways' found. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | 107| 107| }, | 108| 108| "standground": { | 109| 109| targetVisibleEnemies: true, | 110| |- targetAttackersAlways: false, | | 110|+ "targetAttackersAlways": false, | 111| 111| respondFlee: false, | 112| 112| respondChase: false, | 113| 113| respondChaseBeyondVision: false, | | [NORMAL] ESLintBear (quote-props): | | Unquoted property 'respondFlee' found. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | 108| 108| "standground": { | 109| 109| targetVisibleEnemies: true, | 110| 110| targetAttackersAlways: false, | 111| |- respondFlee: false, | | 111|+ "respondFlee": false, | 112| 112| respondChase: false, | 113| 113| respondChaseBeyondVision: false, | 114| 114| respondStandGround: true, | | [NORMAL] ESLintBear (quote-props): | | Unquoted property 'respondChase' found. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | 109| 109| targetVisibleEnemies: true, | 110| 110| targetAttackersAlways: false, | 111| 111| respondFlee: false, | 112| |- respondChase: false, | | 112|+ "respondChase": false, | 113| 113| respondChaseBeyondVision: false, | 114| 114| respondStandGround: true, | 115| 115| respondHoldGround: false, | | [NORMAL] ESLintBear (quote-props): | | Unquoted property 'respondChaseBeyondVision' found. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | 110| 110| targetAttackersAlways: false, | 111| 111| respondFlee: false, | 112| 112| respondChase: false, | 113| |- respondChaseBeyondVision: false, | | 113|+ "respondChaseBeyondVision": false, | 114| 114| respondStandGround: true, | 115| 115| respondHoldGround: false, | 116| 116| }, | | [NORMAL] ESLintBear (quote-props): | | Unquoted property 'respondStandGround' found. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | 111| 111| respondFlee: false, | 112| 112| respondChase: false, | 113| 113| respondChaseBeyondVision: false, | 114| |- respondStandGround: true, | | 114|+ "respondStandGround": true, | 115| 115| respondHoldGround: false, | 116| 116| }, | 117| 117| }; | | [NORMAL] ESLintBear (quote-props): | | Unquoted property 'respondHoldGround' found. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | 112| 112| respondChase: false, | 113| 113| respondChaseBeyondVision: false, | 114| 114| respondStandGround: true, | 115| |- respondHoldGround: false, | | 115|+ "respondHoldGround": false, | 116| 116| }, | 117| 117| }; | 118| 118| | | [NORMAL] ESLintBear (curly): | | Unnecessary { after 'if' condition. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | 213| 213| // Move a tile outside the building | 214| 214| let range = 4; | 215| 215| if (this.MoveToTargetRangeExplicit(msg.data.target, range, range)) | 216| |- { | | 216|+ | 217| 217| // We've started walking to the given point | 218| 218| this.SetNextState("INDIVIDUAL.WALKING"); | 219| |- } | | 219|+ | 220| 220| else | 221| 221| { | 222| 222| // We are already at the target, or can't move at all | | [NORMAL] ESLintBear (curly): | | Unnecessary { after 'else'. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | 218| 218| this.SetNextState("INDIVIDUAL.WALKING"); | 219| 219| } | 220| 220| else | 221| |- { | | 221|+ | 222| 222| // We are already at the target, or can't move at all | 223| 223| this.FinishOrder(); | 224| |- } | | 224|+ | 225| 225| }, | 226| 226| | 227| 227| // Individual orders: | | [NORMAL] ESLintBear (curly): | | Unnecessary { after 'if' condition. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | 323| 323| | 324| 324| var ok = this.MoveToTarget(this.order.data.target); | 325| 325| if (ok) | 326| |- { | | 326|+ | 327| 327| // We've started walking to the given point | 328| 328| if (this.IsAnimal()) | 329| 329| this.SetNextState("ANIMAL.WALKING"); | 330| 330| else | 331| 331| this.SetNextState("INDIVIDUAL.WALKING"); | 332| |- } | | 332|+ | 333| 333| else | 334| 334| { | 335| 335| // We are already at the target, or can't move at all | | [NORMAL] ESLintBear (curly): | | Unnecessary { after 'if' condition. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | 351| 351| var cmpPosition = Engine.QueryInterface(this.entity, IID_Position); | 352| 352| if (this.lastShorelinePosition && cmpPosition && (this.lastShorelinePosition.x == cmpPosition.GetPosition().x) | 353| 353| && (this.lastShorelinePosition.z == cmpPosition.GetPosition().z)) | 354| |- { | | 354|+ | 355| 355| // we were already on the shoreline, and have not moved since | 356| 356| if (DistanceBetweenEntities(this.entity, this.order.data.target) < 50) | 357| 357| needToMove = false; | 358| |- } | | 358|+ | 359| 359| | 360| 360| // TODO: what if the units are on a cliff ? the ship will go below the cliff | 361| 361| // and the units won't be able to garrison. Should go to the nearest (accessible) shore | | [NORMAL] ESLintBear (operator-linebreak): | | '&&' should be placed at the end of the line. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | 349| 349| // Check if we need to move TODO implement a better way to know if we are on the shoreline | 350| 350| var needToMove = true; | 351| 351| var cmpPosition = Engine.QueryInterface(this.entity, IID_Position); | 352| |- if (this.lastShorelinePosition && cmpPosition && (this.lastShorelinePosition.x == cmpPosition.GetPosition().x) | 353| |- && (this.lastShorelinePosition.z == cmpPosition.GetPosition().z)) | | 352|+ if (this.lastShorelinePosition && cmpPosition && (this.lastShorelinePosition.x == cmpPosition.GetPosition().x) && | | 353|+ (this.lastShorelinePosition.z == cmpPosition.GetPosition().z)) | 354| 354| { | 355| 355| // we were already on the shoreline, and have not moved since | 356| 356| if (DistanceBetweenEntities(this.entity, this.order.data.target) < 50) | | [NORMAL] ESLintBear (curly): | | Unnecessary { after 'if' condition. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | 360| 360| // TODO: what if the units are on a cliff ? the ship will go below the cliff | 361| 361| // and the units won't be able to garrison. Should go to the nearest (accessible) shore | 362| 362| if (needToMove && this.MoveToTarget(this.order.data.target)) | 363| |- { | | 363|+ | 364| 364| this.SetNextState("INDIVIDUAL.PICKUP.APPROACHING"); | 365| |- } | | 365|+ | 366| 366| else | 367| 367| { | 368| 368| // We are already at the target, or can't move at all | | [NORMAL] ESLintBear (curly): | | Unnecessary { after 'if' condition. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | 389| 389| var distance = DistanceBetweenEntities(this.entity, this.order.data.target) + (+this.template.FleeDistance); | 390| 390| var cmpUnitMotion = Engine.QueryInterface(this.entity, IID_UnitMotion); | 391| 391| if (cmpUnitMotion.MoveToTargetRange(this.order.data.target, distance, -1)) | 392| |- { | | 392|+ | 393| 393| // We've started fleeing from the given target | 394| 394| if (this.IsAnimal()) | 395| 395| this.SetNextState("ANIMAL.FLEEING"); | 396| 396| else | 397| 397| this.SetNextState("INDIVIDUAL.FLEEING"); | 398| |- } | | 398|+ | 399| 399| else | 400| 400| { | 401| 401| // We are already at the target, or can't move at all | | [NORMAL] ESLintBear (curly): | | Unnecessary { after 'if' condition. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | 445| 445| } | 446| 446| | 447| 447| if (this.order.data.attackType == this.oldAttackType) | 448| |- { | | 448|+ | 449| 449| if (this.IsAnimal()) | 450| 450| this.SetNextState("ANIMAL.COMBAT.ATTACKING"); | 451| 451| else | 452| 452| this.SetNextState("INDIVIDUAL.COMBAT.ATTACKING"); | 453| |- } | | 453|+ | 454| 454| else | 455| 455| { | 456| 456| if (this.IsAnimal()) | | [NORMAL] ESLintBear (curly): | | Unnecessary { after 'else'. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | 452| 452| this.SetNextState("INDIVIDUAL.COMBAT.ATTACKING"); | 453| 453| } | 454| 454| else | 455| |- { | | 455|+ | 456| 456| if (this.IsAnimal()) | 457| 457| this.SetNextStateAlwaysEntering("ANIMAL.COMBAT.ATTACKING"); | 458| 458| else | 459| 459| this.SetNextStateAlwaysEntering("INDIVIDUAL.COMBAT.ATTACKING"); | 460| |- } | | 460|+ | 461| 461| return; | 462| 462| } | 463| 463| | | [NORMAL] ESLintBear (curly): | | Unnecessary { after 'else'. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | 590| 590| this.PushOrderFront("Walk", this.order.data.lastPos); | 591| 591| } | 592| 592| else | 593| |- { | | 593|+ | 594| 594| // We couldn't move there, or the target moved away | 595| 595| this.FinishOrder(); | 596| |- } | | 596|+ | 597| 597| return; | 598| 598| } | 599| 599| | | [NORMAL] ESLintBear (curly): | | Unnecessary { after 'if' condition. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | 603| 603| | 604| 604| // Try to move within range | 605| 605| if (this.MoveToTargetRange(this.order.data.target, IID_ResourceGatherer)) | 606| |- { | | 606|+ | 607| 607| // We've started walking to the given point | 608| 608| this.SetNextState("INDIVIDUAL.GATHER.APPROACHING"); | 609| |- } | | 609|+ | 610| 610| else | 611| 611| { | 612| 612| // We are already at the target, or can't move at all, | | [NORMAL] ESLintBear (curly): | | Unnecessary { after 'if' condition. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | 680| 680| "Order.Repair": function(msg) { | 681| 681| // Try to move within range | 682| 682| if (this.MoveToTargetRange(this.order.data.target, IID_Builder)) | 683| |- { | | 683|+ | 684| 684| // We've started walking to the given point | 685| 685| this.SetNextState("INDIVIDUAL.REPAIR.APPROACHING"); | 686| |- } | | 686|+ | 687| 687| else | 688| 688| { | 689| 689| // We are already at the target, or can't move at all, | | [NORMAL] ESLintBear (curly): | | Unnecessary { after 'if' condition. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | 717| 717| } | 718| 718| | 719| 719| if (this.MoveToGarrisonRange(this.order.data.target)) | 720| |- { | | 720|+ | 721| 721| this.SetNextState("INDIVIDUAL.GARRISON.APPROACHING"); | 722| |- } | | 722|+ | 723| 723| else | 724| 724| { | 725| 725| // We do a range check before actually garrisoning | | [NORMAL] ESLintBear (curly): | | Unnecessary { after 'if' condition. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | 855| 855| if (!this.CheckTargetAttackRange(target, target)) | 856| 856| { | 857| 857| if (this.TargetIsAlive(target) && this.CheckTargetVisible(target)) | 858| |- { | | 858|+ | 859| 859| if (this.MoveToTargetAttackRange(target, target)) | 860| 860| { | 861| 861| this.SetNextState("COMBAT.APPROACHING"); | 862| 862| return; | 863| 863| } | 864| |- } | | 864|+ | 865| 865| this.FinishOrder(); | 866| 866| return; | 867| 867| } | | [NORMAL] ESLintBear (curly): | | Unnecessary { after 'if' condition. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | 880| 880| } | 881| 881| // Check if we are already in range, otherwise walk there | 882| 882| if (!this.CheckGarrisonRange(msg.data.target)) | 883| |- { | | 883|+ | 884| 884| if (!this.CheckTargetVisible(msg.data.target)) | 885| 885| { | 886| 886| this.FinishOrder(); | 895| 895| return; | 896| 896| } | 897| 897| } | 898| |- } | | 898|+ | 899| 899| | 900| 900| this.SetNextState("GARRISON.GARRISONING"); | 901| 901| }, | | [NORMAL] ESLintBear (curly): | | Unnecessary { after 'else'. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | 887| 887| return; | 888| 888| } | 889| 889| else | 890| |- { | | 890|+ | 891| 891| // Out of range; move there in formation | 892| 892| if (this.MoveToGarrisonRange(msg.data.target)) | 893| 893| { | 894| 894| this.SetNextState("GARRISON.APPROACHING"); | 895| 895| return; | 896| 896| } | 897| |- } | | 897|+ | 898| 898| } | 899| 899| | 900| 900| this.SetNextState("GARRISON.GARRISONING"); | | [NORMAL] ESLintBear (no-else-return): | | Unnecessary 'else' after 'return'. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | 886| 886| this.FinishOrder(); | 887| 887| return; | 888| 888| } | 889| |- else | 890| |- { | | 889|+ | 891| 890| // Out of range; move there in formation | 892| 891| if (this.MoveToGarrisonRange(msg.data.target)) | 893| 892| { | 894| 893| this.SetNextState("GARRISON.APPROACHING"); | 895| 894| return; | 896| 895| } | 897| |- } | | 896|+ | 898| 897| } | 899| 898| | 900| 899| this.SetNextState("GARRISON.GARRISONING"); | | [NORMAL] ESLintBear (curly): | | Unnecessary { after 'else'. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | 913| 913| this.PushOrderFront("Walk", msg.data.lastPos); | 914| 914| } | 915| 915| else | 916| |- { | | 916|+ | 917| 917| // We couldn't move there, or the target moved away | 918| 918| this.FinishOrder(); | 919| |- } | | 919|+ | 920| 920| return; | 921| 921| } | 922| 922| | | [NORMAL] ESLintBear (key-spacing): | | Missing space before value for key 'GARRISON'. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js |1134|1134| }, |1135|1135| }, |1136|1136| |1137| |- "GARRISON":{ | |1137|+ "GARRISON": { |1138|1138| "enter": function() { |1139|1139| // If the garrisonholder should pickup, warn it so it can take needed action |1140|1140| var cmpGarrisonHolder = Engine.QueryInterface(this.order.data.target, IID_GarrisonHolder); | | [NORMAL] ESLintBear (curly): | | Unnecessary { after 'if' condition. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js |1315|1315| // If the controller handled an order but some members rejected it, |1316|1316| // they will have no orders and be in the FORMATIONMEMBER.IDLE state. |1317|1317| if (this.orderQueue.length) |1318| |- { | |1318|+ |1319|1319| // We're leaving the formation, so stop our FormationWalk order |1320|1320| if (this.FinishOrder()) |1321|1321| return; |1322| |- } | |1322|+ |1323|1323| |1324|1324| // No orders left, we're an individual now |1325|1325| if (this.IsAnimal()) | | [NORMAL] ESLintBear (curly): | | Unnecessary { after 'if' condition. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js |1343|1343| // Move a tile outside the building |1344|1344| let range = 4; |1345|1345| if (this.MoveToTargetRangeExplicit(msg.data.target, range, range)) |1346| |- { | |1346|+ |1347|1347| // We've started walking to the given point |1348|1348| this.SetNextState("WALKINGTOPOINT"); |1349| |- } | |1349|+ |1350|1350| else |1351|1351| { |1352|1352| // We are already at the target, or can't move at all | | [NORMAL] ESLintBear (curly): | | Unnecessary { after 'else'. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js |1348|1348| this.SetNextState("WALKINGTOPOINT"); |1349|1349| } |1350|1350| else |1351| |- { | |1351|+ |1352|1352| // We are already at the target, or can't move at all |1353|1353| this.FinishOrder(); |1354| |- } | |1354|+ |1355|1355| }, |1356|1356| |1357|1357| | | [NORMAL] ESLintBear (space-before-function-paren): | | Unexpected space before function parentheses. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js |1367|1367| }, |1368|1368| |1369|1369| "WALKING": { |1370| |- "enter": function () { | |1370|+ "enter": function() { |1371|1371| var cmpFormation = Engine.QueryInterface(this.formationController, IID_Formation); |1372|1372| var cmpVisual = Engine.QueryInterface(this.entity, IID_Visual); |1373|1373| if (cmpFormation && cmpVisual) | | [NORMAL] ESLintBear (curly): | | Unnecessary { after 'if' condition. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js |1554|1554| |1555|1555| "LosRangeUpdate": function(msg) { |1556|1556| if (this.GetStance().targetVisibleEnemies) |1557| |- { | |1557|+ |1558|1558| // Start attacking one of the newly-seen enemy (if any) |1559|1559| this.AttackEntitiesByPreference(msg.data.added); |1560| |- } | |1560|+ |1561|1561| }, |1562|1562| |1563|1563| "LosHealRangeUpdate": function(msg) { | | [NORMAL] ESLintBear (space-before-function-paren): | | Unexpected space before function parentheses. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js |1574|1574| }, |1575|1575| |1576|1576| "WALKING": { |1577| |- "enter": function () { | |1577|+ "enter": function() { |1578|1578| this.SelectAnimation("move"); |1579|1579| }, |1580|1580| | | [NORMAL] ESLintBear (space-before-function-paren): | | Unexpected space before function parentheses. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js |1584|1584| }, |1585|1585| |1586|1586| "WALKINGANDFIGHTING": { |1587| |- "enter": function () { | |1587|+ "enter": function() { |1588|1588| // Show weapons rather than carried resources. |1589|1589| this.SetAnimationVariant("combat"); |1590|1590| | | [NORMAL] ESLintBear (space-before-function-paren): | | Unexpected space before function parentheses. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js |1606|1606| }, |1607|1607| |1608|1608| "PATROL": { |1609| |- "enter": function () { | |1609|+ "enter": function() { |1610|1610| // Memorize the origin position in case that we want to go back |1611|1611| let cmpPosition = Engine.QueryInterface(this.entity, IID_Position); |1612|1612| if (!cmpPosition || !cmpPosition.IsInWorld()) | | [NORMAL] ESLintBear (space-before-function-paren): | | Unexpected space before function parentheses. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js |1651|1651| }, |1652|1652| |1653|1653| "ESCORTING": { |1654| |- "enter": function () { | |1654|+ "enter": function() { |1655|1655| // Show weapons rather than carried resources. |1656|1656| this.SetAnimationVariant("combat"); |1657|1657| | | [NORMAL] ESLintBear (space-before-function-paren): | | Unexpected space before function parentheses. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js |1700|1700| }, |1701|1701| |1702|1702| "GUARDING": { |1703| |- "enter": function () { | |1703|+ "enter": function() { |1704|1704| this.StartTimer(1000, 1000); |1705|1705| this.SetHeldPositionOnEntity(this.entity); |1706|1706| this.SetAnimationVariant("combat"); | | [NORMAL] ESLintBear (curly): | | Unnecessary { after 'if' condition. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js |1729|1729| // if nothing better to do, check if the guarded needs to be healed or repaired |1730|1730| var cmpHealth = Engine.QueryInterface(this.isGuardOf, IID_Health); |1731|1731| if (cmpHealth && (cmpHealth.GetHitpoints() < cmpHealth.GetMaxHitpoints())) |1732| |- { | |1732|+ |1733|1733| if (this.CanHeal(this.isGuardOf)) |1734|1734| this.PushOrderFront("Heal", { "target": this.isGuardOf, "force": false }); |1735|1735| else if (this.CanRepair(this.isGuardOf)) |1736|1736| this.PushOrderFront("Repair", { "target": this.isGuardOf, "autocontinue": false, "force": false }); |1737| |- } | |1737|+ |1738|1738| } |1739|1739| }, |1740|1740| | | [NORMAL] ESLintBear (space-before-function-paren): | | Unexpected space before function parentheses. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js |1786|1786| }, |1787|1787| |1788|1788| "APPROACHING": { |1789| |- "enter": function () { | |1789|+ "enter": function() { |1790|1790| // Show weapons rather than carried resources. |1791|1791| this.SetAnimationVariant("combat"); |1792|1792| | | [NORMAL] ESLintBear (curly): | | Unnecessary { after 'if' condition. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js |1813|1813| "MoveCompleted": function() { |1814|1814| |1815|1815| if (this.CheckTargetAttackRange(this.order.data.target, this.order.data.attackType)) |1816| |- { | |1816|+ |1817|1817| // If the unit needs to unpack, do so |1818|1818| if (this.CanUnpack()) |1819|1819| { |1822|1822| } |1823|1823| else |1824|1824| this.SetNextState("ATTACKING"); |1825| |- } | |1825|+ |1826|1826| else |1827|1827| { |1828|1828| if (this.MoveToTargetAttackRange(this.order.data.target, this.order.data.attackType)) | | [NORMAL] ESLintBear (no-else-return): | | Unnecessary 'else' after 'return'. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js |1820|1820| this.PushOrderFront("Unpack", { "force": true }); |1821|1821| return; |1822|1822| } |1823| |- else |1824| |- this.SetNextState("ATTACKING"); | |1823|+ this.SetNextState("ATTACKING"); |1825|1824| } |1826|1825| else |1827|1826| { | | [NORMAL] ESLintBear (curly): | | Unnecessary { after 'else'. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js |1824|1824| this.SetNextState("ATTACKING"); |1825|1825| } |1826|1826| else |1827| |- { | |1827|+ |1828|1828| if (this.MoveToTargetAttackRange(this.order.data.target, this.order.data.attackType)) |1829|1829| { |1830|1830| this.SetNextState("APPROACHING"); |1834|1834| // Give up |1835|1835| this.FinishOrder(); |1836|1836| } |1837| |- } | |1837|+ |1838|1838| }, |1839|1839| }, |1840|1840| | | [NORMAL] ESLintBear (curly): | | Unnecessary { after 'if' condition. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js |1826|1826| else |1827|1827| { |1828|1828| if (this.MoveToTargetAttackRange(this.order.data.target, this.order.data.attackType)) |1829| |- { | |1829|+ |1830|1830| this.SetNextState("APPROACHING"); |1831| |- } | |1831|+ |1832|1832| else |1833|1833| { |1834|1834| // Give up | | [NORMAL] ESLintBear (curly): | | Unnecessary { after 'else'. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js |1830|1830| this.SetNextState("APPROACHING"); |1831|1831| } |1832|1832| else |1833| |- { | |1833|+ |1834|1834| // Give up |1835|1835| this.FinishOrder(); |1836| |- } | |1836|+ |1837|1837| } |1838|1838| }, |1839|1839| }, | | [NORMAL] ESLintBear (curly): | | Unnecessary { after 'if' condition. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js |1851|1851| } |1852|1852| // Check the target is still alive and attackable |1853|1853| if (this.CanAttack(target) && !this.CheckTargetAttackRange(target, this.order.data.attackType)) |1854| |- { | |1854|+ |1855|1855| // Can't reach it - try to chase after it |1856|1856| if (this.ShouldChaseTargetedEntity(target, this.order.data.force)) |1857|1857| { |1861|1861| return; |1862|1862| } |1863|1863| } |1864| |- } | |1864|+ |1865|1865| |1866|1866| var cmpAttack = Engine.QueryInterface(this.entity, IID_Attack); |1867|1867| this.attackTimers = cmpAttack.GetTimers(this.order.data.attackType); | | [NORMAL] ESLintBear (curly): | | Unnecessary { after 'if' condition. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js |1854|1854| { |1855|1855| // Can't reach it - try to chase after it |1856|1856| if (this.ShouldChaseTargetedEntity(target, this.order.data.force)) |1857| |- { | |1857|+ |1858|1858| if (this.MoveToTargetAttackRange(target, this.order.data.attackType)) |1859|1859| { |1860|1860| this.SetNextState("COMBAT.CHASING"); |1861|1861| return; |1862|1862| } |1863| |- } | |1863|+ |1864|1864| } |1865|1865| |1866|1866| var cmpAttack = Engine.QueryInterface(this.entity, IID_Attack); | | [NORMAL] ESLintBear (no-unneeded-ternary): | | Unnecessary use of boolean literals in conditional expression. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js |1892|1892| // TODO: we should probably only bother syncing projectile attacks, not melee |1893|1893| |1894|1894| // If using a non-default prepare time, re-sync the animation when the timer runs. |1895| |- this.resyncAnimation = (prepare != this.attackTimers.prepare) ? true : false; | |1895|+ this.resyncAnimation = (prepare != this.attackTimers.prepare); |1896|1896| |1897|1897| this.FaceTowardsTarget(this.order.data.target); |1898|1898| | | [NORMAL] ESLintBear (curly): | | Unnecessary { after 'if' condition. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js |1966|1966| |1967|1967| // Can't reach it - try to chase after it |1968|1968| if (this.ShouldChaseTargetedEntity(target, this.order.data.force)) |1969| |- { | |1969|+ |1970|1970| if (this.MoveToTargetRange(target, IID_Attack, this.order.data.attackType)) |1971|1971| { |1972|1972| this.SetNextState("COMBAT.CHASING"); |1973|1973| return; |1974|1974| } |1975| |- } | |1975|+ |1976|1976| } |1977|1977| |1978|1978| // if we're targetting a formation, find a new member of that formation | | [NORMAL] ESLintBear (operator-linebreak): | | '&&' should be placed at the end of the line. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js |2013|2013| |2014|2014| "Attacked": function(msg) { |2015|2015| // If we are capturing and are attacked by something that we would not capture, attack that entity instead |2016| |- if (this.order.data.attackType == "Capture" && (this.GetStance().targetAttackersAlways || !this.order.data.force) |2017| |- && this.order.data.target != msg.data.attacker && this.GetBestAttackAgainst(msg.data.attacker, true) != "Capture") | |2016|+ if (this.order.data.attackType == "Capture" && (this.GetStance().targetAttackersAlways || !this.order.data.force) && | |2017|+ this.order.data.target != msg.data.attacker && this.GetBestAttackAgainst(msg.data.attacker, true) != "Capture") |2018|2018| this.RespondToTargetedEntities([msg.data.attacker]); |2019|2019| }, |2020|2020| }, | | [NORMAL] ESLintBear (space-before-function-paren): | | Unexpected space before function parentheses. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js |2020|2020| }, |2021|2021| |2022|2022| "CHASING": { |2023| |- "enter": function () { | |2023|+ "enter": function() { |2024|2024| // Show weapons rather than carried resources. |2025|2025| this.SetAnimationVariant("combat"); |2026|2026| | | [NORMAL] ESLintBear (space-before-function-paren): | | Unexpected space before function parentheses. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js |2093|2093| |2094|2094| // Try to find another nearby target of the same specific type |2095|2095| // Also don't switch to a different type of huntable animal |2096| |- var nearby = this.FindNearbyResource(function (ent, type, template) { | |2096|+ var nearby = this.FindNearbyResource(function(ent, type, template) { |2097|2097| return ( |2098|2098| ent != oldTarget |2099|2099| && ((type.generic == "treasure" && oldType.generic == "treasure") | | [NORMAL] ESLintBear (operator-linebreak): | | '&&' should be placed at the end of the line. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js |2095|2095| // Also don't switch to a different type of huntable animal |2096|2096| var nearby = this.FindNearbyResource(function (ent, type, template) { |2097|2097| return ( |2098| |- ent != oldTarget |2099| |- && ((type.generic == "treasure" && oldType.generic == "treasure") | |2098|+ ent != oldTarget && | |2099|+ ((type.generic == "treasure" && oldType.generic == "treasure") |2100|2100| || (type.specific == oldType.specific |2101|2101| && (type.specific != "meat" || oldTemplate == template))) |2102|2102| ); | | [NORMAL] ESLintBear (operator-linebreak): | | '||' should be placed at the end of the line. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js |2096|2096| var nearby = this.FindNearbyResource(function (ent, type, template) { |2097|2097| return ( |2098|2098| ent != oldTarget |2099| |- && ((type.generic == "treasure" && oldType.generic == "treasure") |2100| |- || (type.specific == oldType.specific | |2099|+ && ((type.generic == "treasure" && oldType.generic == "treasure") || | |2100|+ (type.specific == oldType.specific |2101|2101| && (type.specific != "meat" || oldTemplate == template))) |2102|2102| ); |2103|2103| }, oldTarget); | | [NORMAL] ESLintBear (operator-linebreak): | | '&&' should be placed at the end of the line. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js |2097|2097| return ( |2098|2098| ent != oldTarget |2099|2099| && ((type.generic == "treasure" && oldType.generic == "treasure") |2100| |- || (type.specific == oldType.specific |2101| |- && (type.specific != "meat" || oldTemplate == template))) | |2100|+ || (type.specific == oldType.specific && | |2101|+ (type.specific != "meat" || oldTemplate == template))) |2102|2102| ); |2103|2103| }, oldTarget); |2104|2104| if (nearby) | | [NORMAL] ESLintBear (no-else-return): | | Unnecessary 'else' after 'return'. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js |2106|2106| this.PerformGather(nearby, false, false); |2107|2107| return true; |2108|2108| } |2109| |- else |2110| |- { | |2109|+ |2111|2110| // It's probably better in this case, to avoid units getting stuck around a dropsite |2112|2111| // in a "Target is far away, full, nearby are no good resources, return to dropsite" loop |2113|2112| // to order it to GatherNear the resource position. |2128|2127| return true; |2129|2128| } |2130|2129| } |2131| |- } | |2130|+ |2132|2131| return true; |2133|2132| } |2134|2133| return false; | | [NORMAL] ESLintBear (no-else-return): | | Unnecessary 'else' after 'return'. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js |2118|2118| this.GatherNearPosition(pos.x, pos.z, oldType, oldTemplate); |2119|2119| return true; |2120|2120| } |2121| |- else |2122| |- { | |2121|+ |2123|2122| // we're kind of stuck here. Return resource. |2124|2123| var nearby = this.FindNearestDropsite(oldType.generic); |2125|2124| if (nearby) |2127|2126| this.PushOrderFront("ReturnResource", { "target": nearby, "force": false }); |2128|2127| return true; |2129|2128| } |2130| |- } | |2129|+ |2131|2130| } |2132|2131| return true; |2133|2132| } | | [NORMAL] ESLintBear (space-before-function-paren): | | Unexpected space before function parentheses. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js |2158|2158| |2159|2159| // Try to find another nearby target of the same specific type |2160|2160| // Also don't switch to a different type of huntable animal |2161| |- var nearby = this.FindNearbyResource(function (ent, type, template) { | |2161|+ var nearby = this.FindNearbyResource(function(ent, type, template) { |2162|2162| return ( |2163|2163| ent != oldTarget |2164|2164| && ((type.generic == "treasure" && oldType.generic == "treasure") | | [NORMAL] ESLintBear (operator-linebreak): | | '&&' should be placed at the end of the line. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js |2160|2160| // Also don't switch to a different type of huntable animal |2161|2161| var nearby = this.FindNearbyResource(function (ent, type, template) { |2162|2162| return ( |2163| |- ent != oldTarget |2164| |- && ((type.generic == "treasure" && oldType.generic == "treasure") | |2163|+ ent != oldTarget && | |2164|+ ((type.generic == "treasure" && oldType.generic == "treasure") |2165|2165| || (type.specific == oldType.specific |2166|2166| && (type.specific != "meat" || oldTemplate == template))) |2167|2167| ); | | [NORMAL] ESLintBear (operator-linebreak): | | '||' should be placed at the end of the line. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js |2161|2161| var nearby = this.FindNearbyResource(function (ent, type, template) { |2162|2162| return ( |2163|2163| ent != oldTarget |2164| |- && ((type.generic == "treasure" && oldType.generic == "treasure") |2165| |- || (type.specific == oldType.specific | |2164|+ && ((type.generic == "treasure" && oldType.generic == "treasure") || | |2165|+ (type.specific == oldType.specific |2166|2166| && (type.specific != "meat" || oldTemplate == template))) |2167|2167| ); |2168|2168| }); | | [NORMAL] ESLintBear (operator-linebreak): | | '&&' should be placed at the end of the line. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js |2162|2162| return ( |2163|2163| ent != oldTarget |2164|2164| && ((type.generic == "treasure" && oldType.generic == "treasure") |2165| |- || (type.specific == oldType.specific |2166| |- && (type.specific != "meat" || oldTemplate == template))) | |2165|+ || (type.specific == oldType.specific && | |2166|+ (type.specific != "meat" || oldTemplate == template))) |2167|2167| ); |2168|2168| }); |2169|2169| if (nearby) | | [NORMAL] ESLintBear (space-before-function-paren): | | Unexpected space before function parentheses. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js |2204|2204| |2205|2205| // Try to find another nearby target of the same specific type |2206|2206| // Also don't switch to a different type of huntable animal |2207| |- var nearby = this.FindNearbyResource(function (ent, type, template) { | |2207|+ var nearby = this.FindNearbyResource(function(ent, type, template) { |2208|2208| return ( |2209|2209| (type.generic == "treasure" && resourceType.generic == "treasure") |2210|2210| || (type.specific == resourceType.specific | | [NORMAL] ESLintBear (operator-linebreak): | | '||' should be placed at the end of the line. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js |2206|2206| // Also don't switch to a different type of huntable animal |2207|2207| var nearby = this.FindNearbyResource(function (ent, type, template) { |2208|2208| return ( |2209| |- (type.generic == "treasure" && resourceType.generic == "treasure") |2210| |- || (type.specific == resourceType.specific | |2209|+ (type.generic == "treasure" && resourceType.generic == "treasure") || | |2210|+ (type.specific == resourceType.specific |2211|2211| && (type.specific != "meat" || resourceTemplate == template)) |2212|2212| ); |2213|2213| }); | | [NORMAL] ESLintBear (operator-linebreak): | | '&&' should be placed at the end of the line. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js |2207|2207| var nearby = this.FindNearbyResource(function (ent, type, template) { |2208|2208| return ( |2209|2209| (type.generic == "treasure" && resourceType.generic == "treasure") |2210| |- || (type.specific == resourceType.specific |2211| |- && (type.specific != "meat" || resourceTemplate == template)) | |2210|+ || (type.specific == resourceType.specific && | |2211|+ (type.specific != "meat" || resourceTemplate == template)) |2212|2212| ); |2213|2213| }); |2214|2214| | | [NORMAL] ESLintBear (curly): | | Unnecessary { after 'if' condition. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js |2323|2323| |2324|2324| var cmpSupply = Engine.QueryInterface(this.gatheringTarget, IID_ResourceSupply); |2325|2325| if (cmpSupply && cmpSupply.IsAvailable(cmpOwnership.GetOwner(), this.entity)) |2326| |- { | |2326|+ |2327|2327| // Check we can still reach and gather from the target |2328|2328| if (this.CheckTargetRange(this.gatheringTarget, IID_ResourceGatherer) && this.CanGather(this.gatheringTarget)) |2329|2329| { |2389|2389| return; |2390|2390| } |2391|2391| } |2392| |- } | |2392|+ |2393|2393| |2394|2394| // We're already in range, can't get anywhere near it or the target is exhausted. |2395|2395| | | [NORMAL] ESLintBear (space-before-function-paren): | | Unexpected space before function parentheses. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js |2413|2413| |2414|2414| // Try to find a new resource of the same specific type near our current position: |2415|2415| // Also don't switch to a different type of huntable animal |2416| |- var nearby = this.FindNearbyResource(function (ent, type, template) { | |2416|+ var nearby = this.FindNearbyResource(function(ent, type, template) { |2417|2417| return ( |2418|2418| (type.generic == "treasure" && resourceType.generic == "treasure") |2419|2419| || (type.specific == resourceType.specific | | [NORMAL] ESLintBear (operator-linebreak): | | '||' should be placed at the end of the line. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js |2415|2415| // Also don't switch to a different type of huntable animal |2416|2416| var nearby = this.FindNearbyResource(function (ent, type, template) { |2417|2417| return ( |2418| |- (type.generic == "treasure" && resourceType.generic == "treasure") |2419| |- || (type.specific == resourceType.specific | |2418|+ (type.generic == "treasure" && resourceType.generic == "treasure") || | |2419|+ (type.specific == resourceType.specific |2420|2420| && (type.specific != "meat" || resourceTemplate == template)) |2421|2421| ); |2422|2422| }); | | [NORMAL] ESLintBear (operator-linebreak): | | '&&' should be placed at the end of the line. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js |2416|2416| var nearby = this.FindNearbyResource(function (ent, type, template) { |2417|2417| return ( |2418|2418| (type.generic == "treasure" && resourceType.generic == "treasure") |2419| |- || (type.specific == resourceType.specific |2420| |- && (type.specific != "meat" || resourceTemplate == template)) | |2419|+ || (type.specific == resourceType.specific && | |2420|+ (type.specific != "meat" || resourceTemplate == template)) |2421|2421| ); |2422|2422| }); |2423|2423| if (nearby) | | [NORMAL] ESLintBear (space-before-function-paren): | | Unexpected space before function parentheses. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js |2457|2457| }, |2458|2458| |2459|2459| "APPROACHING": { |2460| |- "enter": function () { | |2460|+ "enter": function() { |2461|2461| this.SetAnimationVariant("heal"); |2462|2462| this.SelectAnimation("move"); |2463|2463| this.StartTimer(1000, 1000); | | [NORMAL] ESLintBear (no-unneeded-ternary): | | Unnecessary use of boolean literals in conditional expression. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js |2505|2505| this.StartTimer(prepare, this.healTimers.repeat); |2506|2506| |2507|2507| // If using a non-default prepare time, re-sync the animation when the timer runs. |2508| |- this.resyncAnimation = (prepare != this.healTimers.prepare) ? true : false; | |2508|+ this.resyncAnimation = (prepare != this.healTimers.prepare); |2509|2509| |2510|2510| this.FaceTowardsTarget(this.order.data.target); |2511|2511| }, | | [NORMAL] ESLintBear (curly): | | Unnecessary { after 'if' condition. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js |2538|2538| } |2539|2539| // Can't reach it - try to chase after it |2540|2540| if (this.ShouldChaseTargetedEntity(target, this.order.data.force)) |2541| |- { | |2541|+ |2542|2542| if (this.MoveToTargetRange(target, IID_Heal)) |2543|2543| { |2544|2544| this.SetNextState("HEAL.CHASING"); |2545|2545| return; |2546|2546| } |2547| |- } | |2547|+ |2548|2548| } |2549|2549| // Can't reach it, healed to max hp or doesn't exist any more - give up |2550|2550| if (this.FinishOrder()) | | [NORMAL] ESLintBear (space-before-function-paren): | | Unexpected space before function parentheses. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js |2560|2560| }, |2561|2561| }, |2562|2562| "CHASING": { |2563| |- "enter": function () { | |2563|+ "enter": function() { |2564|2564| this.SetDefaultAnimationVariant("heal"); |2565|2565| this.SelectAnimation("move"); |2566|2566| this.StartTimer(1000, 1000); | | [NORMAL] ESLintBear (space-before-function-paren): | | Unexpected space before function parentheses. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js |2566|2566| this.StartTimer(1000, 1000); |2567|2567| }, |2568|2568| |2569| |- "leave": function () { | |2569|+ "leave": function() { |2570|2570| this.StopTimer(); |2571|2571| }, |2572|2572| "Timer": function(msg) { | | [NORMAL] ESLintBear (space-before-function-paren): | | Unexpected space before function parentheses. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js |2580|2580| this.WalkToHeldPosition(); |2581|2581| } |2582|2582| }, |2583| |- "MoveCompleted": function () { | |2583|+ "MoveCompleted": function() { |2584|2584| this.SetNextState("HEALING"); |2585|2585| }, |2586|2586| }, | | [NORMAL] ESLintBear (space-before-function-paren): | | Unexpected space before function parentheses. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js |2589|2589| // Returning to dropsite |2590|2590| "RETURNRESOURCE": { |2591|2591| "APPROACHING": { |2592| |- "enter": function () { | |2592|+ "enter": function() { |2593|2593| this.SetDefaultAnimationVariant(); |2594|2594| this.SelectAnimation("move"); |2595|2595| }, | | [NORMAL] ESLintBear (space-before-function-paren): | | Unexpected space before function parentheses. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js |2644|2644| }, |2645|2645| |2646|2646| "APPROACHINGMARKET": { |2647| |- "enter": function () { | |2647|+ "enter": function() { |2648|2648| this.SelectAnimation("move"); |2649|2649| }, |2650|2650| | | [NORMAL] ESLintBear (space-before-function-paren): | | Unexpected space before function parentheses. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js |2672|2672| |2673|2673| "REPAIR": { |2674|2674| "APPROACHING": { |2675| |- "enter": function () { | |2675|+ "enter": function() { |2676|2676| this.SelectAnimation("move"); |2677|2677| }, |2678|2678| | | [NORMAL] ESLintBear (object-curly-spacing): | | A space is required after '{'. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js |2713|2713| { |2714|2714| // The building was already finished/fully repaired before we arrived; |2715|2715| // let the ConstructionFinished handler handle this. |2716| |- this.OnGlobalConstructionFinished({"entity": this.repairTarget, "newentity": this.repairTarget}); | |2716|+ this.OnGlobalConstructionFinished({ "entity": this.repairTarget, "newentity": this.repairTarget}); |2717|2717| return true; |2718|2718| } |2719|2719| | | [NORMAL] ESLintBear (object-curly-spacing): | | A space is required before '}'. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js |2713|2713| { |2714|2714| // The building was already finished/fully repaired before we arrived; |2715|2715| // let the ConstructionFinished handler handle this. |2716| |- this.OnGlobalConstructionFinished({"entity": this.repairTarget, "newentity": this.repairTarget}); | |2716|+ this.OnGlobalConstructionFinished({"entity": this.repairTarget, "newentity": this.repairTarget }); |2717|2717| return true; |2718|2718| } |2719|2719| | | [NORMAL] ESLintBear (spaced-comment): | | Expected space or tab after '//' in comment. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js |2753|2753| if (this.MoveToTargetRange(this.repairTarget, IID_Builder)) |2754|2754| this.SetNextState("APPROACHING"); |2755|2755| else if (!this.CheckTargetRange(this.repairTarget, IID_Builder)) |2756| |- this.FinishOrder(); //can't approach and isn't in reach | |2756|+ this.FinishOrder(); // can't approach and isn't in reach |2757|2757| }, |2758|2758| }, |2759|2759| | | [NORMAL] ESLintBear (space-before-function-paren): | | Unexpected space before function parentheses. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js |2820|2820| var types = cmpResourceDropsite.GetTypes(); |2821|2821| // TODO: Slightly undefined behavior here, we don't know what type of resource will be collected, |2822|2822| // may cause problems for AIs (especially hunting fast animals), but avoid ugly hacks to fix that! |2823| |- var nearby = this.FindNearbyResource(function (ent, type, template) { | |2823|+ var nearby = this.FindNearbyResource(function(ent, type, template) { |2824|2824| return (types.indexOf(type.generic) != -1); |2825|2825| }, msg.data.newentity); |2826|2826| if (nearby) | | [NORMAL] ESLintBear (curly): | | Unnecessary { after 'if' condition. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js |2840|2840| |2841|2841| // Unit was approaching and there's nothing to do now, so switch to walking |2842|2842| if (oldState === "INDIVIDUAL.REPAIR.APPROACHING") |2843| |- { | |2843|+ |2844|2844| // We're already walking to the given point, so add this as a order. |2845|2845| this.WalkToTarget(msg.data.newentity, true); |2846| |- } | |2846|+ |2847|2847| }, |2848|2848| }, |2849|2849| | | [NORMAL] ESLintBear (curly): | | Unnecessary { after 'if' condition. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js |2890|2890| |2891|2891| // Check that we can garrison here |2892|2892| if (this.CanGarrison(target)) |2893| |- { | |2893|+ |2894|2894| // Check that we're in range of the garrison target |2895|2895| if (this.CheckGarrisonRange(target)) |2896|2896| { |2966|2966| return false; |2967|2967| } |2968|2968| } |2969| |- } | |2969|+ |2970|2970| // Garrisoning failed for some reason, so finish the order |2971|2971| this.FinishOrder(); |2972|2972| return true; | | [NORMAL] ESLintBear (curly): | | Unnecessary { after 'if' condition. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js |3083|3083| "Attacked": function(msg) { |3084|3084| if (this.template.NaturalBehaviour == "skittish" || |3085|3085| this.template.NaturalBehaviour == "passive") |3086| |- { | |3086|+ |3087|3087| this.Flee(msg.data.attacker, false); |3088| |- } | |3088|+ |3089|3089| else if (this.IsDangerousAnimal() || this.template.NaturalBehaviour == "defensive") |3090|3090| { |3091|3091| if (this.CanAttack(msg.data.attacker)) | | [NORMAL] ESLintBear (curly): | | Unnecessary { after 'if' condition. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js |3092|3092| this.Attack(msg.data.attacker, false); |3093|3093| } |3094|3094| else if (this.template.NaturalBehaviour == "domestic") |3095| |- { | |3095|+ |3096|3096| // Never flee, stop what we were doing |3097|3097| this.SetNextState("IDLE"); |3098| |- } | |3098|+ |3099|3099| }, |3100|3100| |3101|3101| "Order.LeaveFoundation": function(msg) { | | [NORMAL] ESLintBear (curly): | | Unnecessary { after 'if' condition. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js |3102|3102| // Move a tile outside the building |3103|3103| var range = 4; |3104|3104| if (this.MoveToTargetRangeExplicit(msg.data.target, range, range)) |3105| |- { | |3105|+ |3106|3106| // We've started walking to the given point |3107|3107| this.SetNextState("WALKING"); |3108| |- } | |3108|+ |3109|3109| else |3110|3110| { |3111|3111| // We are already at the target, or can't move at all | | [NORMAL] ESLintBear (curly): | | Unnecessary { after 'else'. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js |3107|3107| this.SetNextState("WALKING"); |3108|3108| } |3109|3109| else |3110| |- { | |3110|+ |3111|3111| // We are already at the target, or can't move at all |3112|3112| this.FinishOrder(); |3113| |- } | |3113|+ |3114|3114| }, |3115|3115| |3116|3116| "IDLE": { | | [NORMAL] ESLintBear (curly): | | Unnecessary { after 'if' condition. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js |3149|3149| } |3150|3150| // Start attacking one of the newly-seen enemy (if any) |3151|3151| else if (this.IsDangerousAnimal()) |3152| |- { | |3152|+ |3153|3153| this.AttackVisibleEntity(msg.data.added); |3154| |- } | |3154|+ |3155|3155| |3156|3156| // TODO: if two units enter our range together, we'll attack the |3157|3157| // first and then the second won't trigger another LosRangeUpdate | | [NORMAL] ESLintBear (curly): | | Unnecessary { after 'if' condition. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js |3192|3192| } |3193|3193| // Start attacking one of the newly-seen enemy (if any) |3194|3194| else if (this.template.NaturalBehaviour == "violent") |3195| |- { | |3195|+ |3196|3196| this.AttackVisibleEntity(msg.data.added); |3197| |- } | |3197|+ |3198|3198| }, |3199|3199| |3200|3200| "MoveCompleted": function() { }, | | [NORMAL] ESLintBear (indent): | | Expected indentation of 2 tabs but found 7. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js |3209|3209| "COMBAT": "INDIVIDUAL.COMBAT", // reuse the same combat behaviour for animals |3210|3210| |3211|3211| "WALKING": "INDIVIDUAL.WALKING", // reuse the same walking behaviour for animals |3212| |- // only used for domestic animals | |3212|+ // only used for domestic animals |3213|3213| }, |3214|3214| }; |3215|3215| | | [NORMAL] ESLintBear (no-unneeded-ternary): | | Unnecessary use of boolean literals in conditional expression. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js |3266|3266| |3267|3267| UnitAI.prototype.IsAnimal = function() |3268|3268| { |3269| |- return (this.template.NaturalBehaviour ? true : false); | |3269|+ return (!!this.template.NaturalBehaviour); |3270|3270| }; |3271|3271| |3272|3272| UnitAI.prototype.IsDangerousAnimal = function() | | [NORMAL] ESLintBear (curly): | | Unnecessary { after 'if' condition. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js |3304|3304| UnitAI.prototype.GetGarrisonHolder = function() |3305|3305| { |3306|3306| if (this.IsGarrisoned()) |3307| |- { | |3307|+ |3308|3308| for (let order of this.orderQueue) |3309|3309| if (order.type == "Garrison" || order.type == "Autogarrison") |3310|3310| return order.data.target; |3311| |- } | |3311|+ |3312|3312| return INVALID_ENTITY; |3313|3313| }; |3314|3314| | | [NORMAL] ESLintBear (comma-spacing): | | A space is required after ','. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js |3385|3385| { |3386|3386| let index = this.GetCurrentState().indexOf("."); |3387|3387| if (index != -1) |3388| |- this.UnitFsm.SwitchToNextState(this, this.GetCurrentState().slice(0,index)); | |3388|+ this.UnitFsm.SwitchToNextState(this, this.GetCurrentState().slice(0, index)); |3389|3389| this.Stop(false); |3390|3390| } |3391|3391| | | [NORMAL] ESLintBear (object-curly-spacing): | | A space is required after '{'. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js |3441|3441| if (this.orderQueue[i].type != "PickupUnit" || this.orderQueue[i].data.target != msg.entity) |3442|3442| continue; |3443|3443| if (i == 0) |3444| |- this.UnitFsm.ProcessMessage(this, {"type": "PickupCanceled", "data": msg}); | |3444|+ this.UnitFsm.ProcessMessage(this, { "type": "PickupCanceled", "data": msg}); |3445|3445| else |3446|3446| this.orderQueue.splice(i, 1); |3447|3447| Engine.PostMessage(this.entity, MT_UnitAIOrderDataChanged, { "to": this.GetOrderData() }); | | [NORMAL] ESLintBear (object-curly-spacing): | | A space is required before '}'. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js |3441|3441| if (this.orderQueue[i].type != "PickupUnit" || this.orderQueue[i].data.target != msg.entity) |3442|3442| continue; |3443|3443| if (i == 0) |3444| |- this.UnitFsm.ProcessMessage(this, {"type": "PickupCanceled", "data": msg}); | |3444|+ this.UnitFsm.ProcessMessage(this, {"type": "PickupCanceled", "data": msg }); |3445|3445| else |3446|3446| this.orderQueue.splice(i, 1); |3447|3447| Engine.PostMessage(this.entity, MT_UnitAIOrderDataChanged, { "to": this.GetOrderData() }); | | [NORMAL] ESLintBear (spaced-comment): | | Expected space or tab after '//' in comment. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js |3525|3525| }; |3526|3526| |3527|3527| |3528| |-//// FSM linkage functions //// | |3528|+// // FSM linkage functions //// |3529|3529| |3530|3530| UnitAI.prototype.SetNextState = function(state) |3531|3531| { | | [NORMAL] ESLintBear (object-curly-spacing): | | A space is required after '{'. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js |3576|3576| if (this.orderQueue.length) |3577|3577| { |3578|3578| let ret = this.UnitFsm.ProcessMessage(this, |3579| |- {"type": "Order."+this.order.type, "data": this.order.data} | |3579|+ { "type": "Order."+this.order.type, "data": this.order.data} |3580|3580| ); |3581|3581| |3582|3582| Engine.PostMessage(this.entity, MT_UnitAIOrderDataChanged, { "to": this.GetOrderData() }); | | [NORMAL] ESLintBear (object-curly-spacing): | | A space is required before '}'. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js |3576|3576| if (this.orderQueue.length) |3577|3577| { |3578|3578| let ret = this.UnitFsm.ProcessMessage(this, |3579| |- {"type": "Order."+this.order.type, "data": this.order.data} | |3579|+ {"type": "Order."+this.order.type, "data": this.order.data } |3580|3580| ); |3581|3581| |3582|3582| Engine.PostMessage(this.entity, MT_UnitAIOrderDataChanged, { "to": this.GetOrderData() }); | | [NORMAL] ESLintBear (no-else-return): | | Unnecessary 'else' after 'return'. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js |3589|3589| // Otherwise we've successfully processed a new order |3590|3590| return true; |3591|3591| } |3592| |- else |3593| |- { | |3592|+ |3594|3593| this.SetNextState("IDLE"); |3595|3594| |3596|3595| Engine.PostMessage(this.entity, MT_UnitAIOrderDataChanged, { "to": this.GetOrderData() }); |3611|3610| } |3612|3611| |3613|3612| return false; |3614| |- } | |3613|+ |3615|3614| }; |3616|3615| |3617|3616| /** | | [NORMAL] ESLintBear (object-curly-spacing): | | A space is required after '{'. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js |3628|3628| { |3629|3629| this.order = order; |3630|3630| let ret = this.UnitFsm.ProcessMessage(this, |3631| |- {"type": "Order."+this.order.type, "data": this.order.data} | |3631|+ { "type": "Order."+this.order.type, "data": this.order.data} |3632|3632| ); |3633|3633| |3634|3634| // If the order was rejected then immediately take it off | | [NORMAL] ESLintBear (object-curly-spacing): | | A space is required before '}'. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js |3628|3628| { |3629|3629| this.order = order; |3630|3630| let ret = this.UnitFsm.ProcessMessage(this, |3631| |- {"type": "Order."+this.order.type, "data": this.order.data} | |3631|+ {"type": "Order."+this.order.type, "data": this.order.data } |3632|3632| ); |3633|3633| |3634|3634| // If the order was rejected then immediately take it off | | [NORMAL] ESLintBear (object-curly-spacing): | | A space is required after '{'. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js |3664|3664| this.orderQueue.unshift(order); |3665|3665| this.order = order; |3666|3666| let ret = this.UnitFsm.ProcessMessage(this, |3667| |- {"type": "Order."+this.order.type, "data": this.order.data} | |3667|+ { "type": "Order."+this.order.type, "data": this.order.data} |3668|3668| ); |3669|3669| |3670|3670| // If the order was rejected then immediately take it off again; | | [NORMAL] ESLintBear (object-curly-spacing): | | A space is required before '}'. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js |3664|3664| this.orderQueue.unshift(order); |3665|3665| this.order = order; |3666|3666| let ret = this.UnitFsm.ProcessMessage(this, |3667| |- {"type": "Order."+this.order.type, "data": this.order.data} | |3667|+ {"type": "Order."+this.order.type, "data": this.order.data } |3668|3668| ); |3669|3669| |3670|3670| // If the order was rejected then immediately take it off again; | | [NORMAL] ESLintBear (object-curly-spacing): | | A space is required after '{'. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js |3698|3698| continue; |3699|3699| if (this.orderQueue[i].type == type) |3700|3700| continue; |3701| |- this.orderQueue.splice(i, 0, {"type": type, "data": data}); | |3701|+ this.orderQueue.splice(i, 0, { "type": type, "data": data}); |3702|3702| Engine.PostMessage(this.entity, MT_UnitAIOrderDataChanged, { "to": this.GetOrderData() }); |3703|3703| return; |3704|3704| } | | [NORMAL] ESLintBear (object-curly-spacing): | | A space is required before '}'. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js |3698|3698| continue; |3699|3699| if (this.orderQueue[i].type == type) |3700|3700| continue; |3701| |- this.orderQueue.splice(i, 0, {"type": type, "data": data}); | |3701|+ this.orderQueue.splice(i, 0, {"type": type, "data": data }); |3702|3702| Engine.PostMessage(this.entity, MT_UnitAIOrderDataChanged, { "to": this.GetOrderData() }); |3703|3703| return; |3704|3704| } | | [NORMAL] ESLintBear (curly): | | Unnecessary { after 'if' condition. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js |3712|3712| { |3713|3713| // Remember the previous work orders to be able to go back to them later if required |3714|3714| if (data && data.force) |3715| |- { | |3715|+ |3716|3716| if (this.IsFormationController()) |3717|3717| this.CallMemberFunction("UpdateWorkOrders", [type]); |3718|3718| else |3719|3719| this.UpdateWorkOrders(type); |3720| |- } | |3720|+ |3721|3721| |3722|3722| let garrisonHolder = this.IsGarrisoned() && type != "Ungarrison" ? this.GetGarrisonHolder() : null; |3723|3723| | | [NORMAL] ESLintBear (curly): | | Unnecessary { after 'if' condition. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js |3789|3789| { |3790|3790| var cmpUnitAI = Engine.QueryInterface(this.formationController, IID_UnitAI); |3791|3791| if (cmpUnitAI) |3792| |- { | |3792|+ |3793|3793| for (var i = 0; i < cmpUnitAI.orderQueue.length; ++i) |3794|3794| { |3795|3795| if (isWorkType(cmpUnitAI.orderQueue[i].type)) |3798|3798| return; |3799|3799| } |3800|3800| } |3801| |- } | |3801|+ |3802|3802| } |3803|3803| |3804|3804| // If nothing found, take the unit orders | | [NORMAL] ESLintBear (curly): | | Unnecessary { after 'for' condition. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js |3791|3791| if (cmpUnitAI) |3792|3792| { |3793|3793| for (var i = 0; i < cmpUnitAI.orderQueue.length; ++i) |3794| |- { | |3794|+ |3795|3795| if (isWorkType(cmpUnitAI.orderQueue[i].type)) |3796|3796| { |3797|3797| this.workOrders = cmpUnitAI.orderQueue.slice(i); |3798|3798| return; |3799|3799| } |3800| |- } | |3800|+ |3801|3801| } |3802|3802| } |3803|3803| | | [NORMAL] ESLintBear (curly): | | Unnecessary { after 'for' condition. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js |3803|3803| |3804|3804| // If nothing found, take the unit orders |3805|3805| for (var i = 0; i < this.orderQueue.length; ++i) |3806| |- { | |3806|+ |3807|3807| if (isWorkType(this.orderQueue[i].type)) |3808|3808| { |3809|3809| this.workOrders = this.orderQueue.slice(i); |3810|3810| return; |3811|3811| } |3812| |- } | |3812|+ |3813|3813| }; |3814|3814| |3815|3815| UnitAI.prototype.BackToWork = function() | | [NORMAL] ESLintBear (object-curly-spacing): | | A space is required after '{'. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js |3869|3869| if (data.timerRepeat === undefined) |3870|3870| this.timer = undefined; |3871|3871| |3872| |- this.UnitFsm.ProcessMessage(this, {"type": "Timer", "data": data, "lateness": lateness}); | |3872|+ this.UnitFsm.ProcessMessage(this, { "type": "Timer", "data": data, "lateness": lateness}); |3873|3873| }; |3874|3874| |3875|3875| /** | | [NORMAL] ESLintBear (object-curly-spacing): | | A space is required before '}'. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js |3869|3869| if (data.timerRepeat === undefined) |3870|3870| this.timer = undefined; |3871|3871| |3872| |- this.UnitFsm.ProcessMessage(this, {"type": "Timer", "data": data, "lateness": lateness}); | |3872|+ this.UnitFsm.ProcessMessage(this, {"type": "Timer", "data": data, "lateness": lateness }); |3873|3873| }; |3874|3874| |3875|3875| /** | | [NORMAL] ESLintBear (spaced-comment): | | Expected space or tab after '//' in comment. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js |3904|3904| this.timer = undefined; |3905|3905| }; |3906|3906| |3907| |-//// Message handlers ///// | |3907|+// // Message handlers ///// |3908|3908| |3909|3909| UnitAI.prototype.OnMotionChanged = function(msg) |3910|3910| { | | [NORMAL] ESLintBear (object-curly-spacing): | | A space is required after '{'. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js |3909|3909| UnitAI.prototype.OnMotionChanged = function(msg) |3910|3910| { |3911|3911| if (msg.starting && !msg.error) |3912| |- this.UnitFsm.ProcessMessage(this, {"type": "MoveStarted", "data": msg}); | |3912|+ this.UnitFsm.ProcessMessage(this, { "type": "MoveStarted", "data": msg}); |3913|3913| else if (!msg.starting || msg.error) |3914|3914| this.UnitFsm.ProcessMessage(this, {"type": "MoveCompleted", "data": msg}); |3915|3915| }; | | [NORMAL] ESLintBear (object-curly-spacing): | | A space is required before '}'. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js |3909|3909| UnitAI.prototype.OnMotionChanged = function(msg) |3910|3910| { |3911|3911| if (msg.starting && !msg.error) |3912| |- this.UnitFsm.ProcessMessage(this, {"type": "MoveStarted", "data": msg}); | |3912|+ this.UnitFsm.ProcessMessage(this, {"type": "MoveStarted", "data": msg }); |3913|3913| else if (!msg.starting || msg.error) |3914|3914| this.UnitFsm.ProcessMessage(this, {"type": "MoveCompleted", "data": msg}); |3915|3915| }; | | [NORMAL] ESLintBear (object-curly-spacing): | | A space is required after '{'. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js |3911|3911| if (msg.starting && !msg.error) |3912|3912| this.UnitFsm.ProcessMessage(this, {"type": "MoveStarted", "data": msg}); |3913|3913| else if (!msg.starting || msg.error) |3914| |- this.UnitFsm.ProcessMessage(this, {"type": "MoveCompleted", "data": msg}); | |3914|+ this.UnitFsm.ProcessMessage(this, { "type": "MoveCompleted", "data": msg}); |3915|3915| }; |3916|3916| |3917|3917| UnitAI.prototype.OnGlobalConstructionFinished = function(msg) | | [NORMAL] ESLintBear (object-curly-spacing): | | A space is required before '}'. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js |3911|3911| if (msg.starting && !msg.error) |3912|3912| this.UnitFsm.ProcessMessage(this, {"type": "MoveStarted", "data": msg}); |3913|3913| else if (!msg.starting || msg.error) |3914| |- this.UnitFsm.ProcessMessage(this, {"type": "MoveCompleted", "data": msg}); | |3914|+ this.UnitFsm.ProcessMessage(this, {"type": "MoveCompleted", "data": msg }); |3915|3915| }; |3916|3916| |3917|3917| UnitAI.prototype.OnGlobalConstructionFinished = function(msg) | | [NORMAL] ESLintBear (object-curly-spacing): | | A space is required after '{'. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js |3919|3919| // TODO: This is a bit inefficient since every unit listens to every |3920|3920| // construction message - ideally we could scope it to only the one we're building |3921|3921| |3922| |- this.UnitFsm.ProcessMessage(this, {"type": "ConstructionFinished", "data": msg}); | |3922|+ this.UnitFsm.ProcessMessage(this, { "type": "ConstructionFinished", "data": msg}); |3923|3923| }; |3924|3924| |3925|3925| UnitAI.prototype.OnGlobalEntityRenamed = function(msg) | | [NORMAL] ESLintBear (object-curly-spacing): | | A space is required before '}'. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js |3919|3919| // TODO: This is a bit inefficient since every unit listens to every |3920|3920| // construction message - ideally we could scope it to only the one we're building |3921|3921| |3922| |- this.UnitFsm.ProcessMessage(this, {"type": "ConstructionFinished", "data": msg}); | |3922|+ this.UnitFsm.ProcessMessage(this, {"type": "ConstructionFinished", "data": msg }); |3923|3923| }; |3924|3924| |3925|3925| UnitAI.prototype.OnGlobalEntityRenamed = function(msg) | | [NORMAL] ESLintBear (object-curly-spacing): | | A space is required after '{'. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js |3944|3944| |3945|3945| UnitAI.prototype.OnAttacked = function(msg) |3946|3946| { |3947| |- this.UnitFsm.ProcessMessage(this, {"type": "Attacked", "data": msg}); | |3947|+ this.UnitFsm.ProcessMessage(this, { "type": "Attacked", "data": msg}); |3948|3948| }; |3949|3949| |3950|3950| UnitAI.prototype.OnGuardedAttacked = function(msg) | | [NORMAL] ESLintBear (object-curly-spacing): | | A space is required before '}'. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js |3944|3944| |3945|3945| UnitAI.prototype.OnAttacked = function(msg) |3946|3946| { |3947| |- this.UnitFsm.ProcessMessage(this, {"type": "Attacked", "data": msg}); | |3947|+ this.UnitFsm.ProcessMessage(this, {"type": "Attacked", "data": msg }); |3948|3948| }; |3949|3949| |3950|3950| UnitAI.prototype.OnGuardedAttacked = function(msg) | | [NORMAL] ESLintBear (object-curly-spacing): | | A space is required after '{'. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js |3949|3949| |3950|3950| UnitAI.prototype.OnGuardedAttacked = function(msg) |3951|3951| { |3952| |- this.UnitFsm.ProcessMessage(this, {"type": "GuardedAttacked", "data": msg.data}); | |3952|+ this.UnitFsm.ProcessMessage(this, { "type": "GuardedAttacked", "data": msg.data}); |3953|3953| }; |3954|3954| |3955|3955| UnitAI.prototype.OnHealthChanged = function(msg) | | [NORMAL] ESLintBear (object-curly-spacing): | | A space is required before '}'. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js |3949|3949| |3950|3950| UnitAI.prototype.OnGuardedAttacked = function(msg) |3951|3951| { |3952| |- this.UnitFsm.ProcessMessage(this, {"type": "GuardedAttacked", "data": msg.data}); | |3952|+ this.UnitFsm.ProcessMessage(this, {"type": "GuardedAttacked", "data": msg.data }); |3953|3953| }; |3954|3954| |3955|3955| UnitAI.prototype.OnHealthChanged = function(msg) | | [NORMAL] ESLintBear (object-curly-spacing): | | A space is required after '{'. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js |3954|3954| |3955|3955| UnitAI.prototype.OnHealthChanged = function(msg) |3956|3956| { |3957| |- this.UnitFsm.ProcessMessage(this, {"type": "HealthChanged", "from": msg.from, "to": msg.to}); | |3957|+ this.UnitFsm.ProcessMessage(this, { "type": "HealthChanged", "from": msg.from, "to": msg.to}); |3958|3958| }; |3959|3959| |3960|3960| UnitAI.prototype.OnRangeUpdate = function(msg) | | [NORMAL] ESLintBear (object-curly-spacing): | | A space is required before '}'. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js |3954|3954| |3955|3955| UnitAI.prototype.OnHealthChanged = function(msg) |3956|3956| { |3957| |- this.UnitFsm.ProcessMessage(this, {"type": "HealthChanged", "from": msg.from, "to": msg.to}); | |3957|+ this.UnitFsm.ProcessMessage(this, {"type": "HealthChanged", "from": msg.from, "to": msg.to }); |3958|3958| }; |3959|3959| |3960|3960| UnitAI.prototype.OnRangeUpdate = function(msg) | | [NORMAL] ESLintBear (object-curly-spacing): | | A space is required after '{'. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js |3960|3960| UnitAI.prototype.OnRangeUpdate = function(msg) |3961|3961| { |3962|3962| if (msg.tag == this.losRangeQuery) |3963| |- this.UnitFsm.ProcessMessage(this, {"type": "LosRangeUpdate", "data": msg}); | |3963|+ this.UnitFsm.ProcessMessage(this, { "type": "LosRangeUpdate", "data": msg}); |3964|3964| else if (msg.tag == this.losHealRangeQuery) |3965|3965| this.UnitFsm.ProcessMessage(this, {"type": "LosHealRangeUpdate", "data": msg}); |3966|3966| }; | | [NORMAL] ESLintBear (object-curly-spacing): | | A space is required before '}'. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js |3960|3960| UnitAI.prototype.OnRangeUpdate = function(msg) |3961|3961| { |3962|3962| if (msg.tag == this.losRangeQuery) |3963| |- this.UnitFsm.ProcessMessage(this, {"type": "LosRangeUpdate", "data": msg}); | |3963|+ this.UnitFsm.ProcessMessage(this, {"type": "LosRangeUpdate", "data": msg }); |3964|3964| else if (msg.tag == this.losHealRangeQuery) |3965|3965| this.UnitFsm.ProcessMessage(this, {"type": "LosHealRangeUpdate", "data": msg}); |3966|3966| }; | | [NORMAL] ESLintBear (object-curly-spacing): | | A space is required after '{'. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js |3962|3962| if (msg.tag == this.losRangeQuery) |3963|3963| this.UnitFsm.ProcessMessage(this, {"type": "LosRangeUpdate", "data": msg}); |3964|3964| else if (msg.tag == this.losHealRangeQuery) |3965| |- this.UnitFsm.ProcessMessage(this, {"type": "LosHealRangeUpdate", "data": msg}); | |3965|+ this.UnitFsm.ProcessMessage(this, { "type": "LosHealRangeUpdate", "data": msg}); |3966|3966| }; |3967|3967| |3968|3968| UnitAI.prototype.OnPackFinished = function(msg) | | [NORMAL] ESLintBear (object-curly-spacing): | | A space is required before '}'. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js |3962|3962| if (msg.tag == this.losRangeQuery) |3963|3963| this.UnitFsm.ProcessMessage(this, {"type": "LosRangeUpdate", "data": msg}); |3964|3964| else if (msg.tag == this.losHealRangeQuery) |3965| |- this.UnitFsm.ProcessMessage(this, {"type": "LosHealRangeUpdate", "data": msg}); | |3965|+ this.UnitFsm.ProcessMessage(this, {"type": "LosHealRangeUpdate", "data": msg }); |3966|3966| }; |3967|3967| |3968|3968| UnitAI.prototype.OnPackFinished = function(msg) | | [NORMAL] ESLintBear (object-curly-spacing): | | A space is required after '{'. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js |3967|3967| |3968|3968| UnitAI.prototype.OnPackFinished = function(msg) |3969|3969| { |3970| |- this.UnitFsm.ProcessMessage(this, {"type": "PackFinished", "packed": msg.packed}); | |3970|+ this.UnitFsm.ProcessMessage(this, { "type": "PackFinished", "packed": msg.packed}); |3971|3971| }; |3972|3972| |3973|3973| //// Helper functions to be called by the FSM //// | | [NORMAL] ESLintBear (object-curly-spacing): | | A space is required before '}'. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js |3967|3967| |3968|3968| UnitAI.prototype.OnPackFinished = function(msg) |3969|3969| { |3970| |- this.UnitFsm.ProcessMessage(this, {"type": "PackFinished", "packed": msg.packed}); | |3970|+ this.UnitFsm.ProcessMessage(this, {"type": "PackFinished", "packed": msg.packed }); |3971|3971| }; |3972|3972| |3973|3973| //// Helper functions to be called by the FSM //// | | [NORMAL] ESLintBear (spaced-comment): | | Expected space or tab after '//' in comment. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js |3970|3970| this.UnitFsm.ProcessMessage(this, {"type": "PackFinished", "packed": msg.packed}); |3971|3971| }; |3972|3972| |3973| |-//// Helper functions to be called by the FSM //// | |3973|+// // Helper functions to be called by the FSM //// |3974|3974| |3975|3975| UnitAI.prototype.GetWalkSpeed = function() |3976|3976| { | | [NORMAL] ESLintBear (semi): | | Missing semicolon. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js |4074|4074| if (!cmpOwnership || cmpOwnership.GetOwner() == INVALID_PLAYER) |4075|4075| return undefined; |4076|4076| |4077| |- let cmpPosition = Engine.QueryInterface(this.entity, IID_Position) | |4077|+ let cmpPosition = Engine.QueryInterface(this.entity, IID_Position); |4078|4078| if (!cmpPosition || !cmpPosition.IsInWorld()) |4079|4079| return undefined; |4080|4080| | | [NORMAL] ESLintBear (curly): | | Unnecessary { after 'else'. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js |4159|4159| PlaySound(name, member); |4160|4160| } |4161|4161| else |4162| |- { | |4162|+ |4163|4163| // Otherwise use our own sounds |4164|4164| PlaySound(name, this.entity); |4165| |- } | |4165|+ |4166|4166| }; |4167|4167| |4168|4168| /* | | [NORMAL] ESLintBear (spaced-comment): | | Expected space or tab after '//' in comment. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js |4346|4346| else |4347|4347| // return false? Or hope you come close enough? |4348|4348| var parabolicMaxRange = 0; |4349| |- //return false; | |4349|+ // return false; |4350|4350| |4351|4351| // the parabole changes while walking, take something in the middle |4352|4352| var guessedMaxRange = (range.max + parabolicMaxRange)/2; | | [NORMAL] ESLintBear (operator-linebreak): | | '&&' should be placed at the end of the line. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js |4411|4411| if (this.IsFormationMember()) |4412|4412| { |4413|4413| var cmpFormationUnitAI = Engine.QueryInterface(this.formationController, IID_UnitAI); |4414| |- if (cmpFormationUnitAI && cmpFormationUnitAI.IsAttackingAsFormation() |4415| |- && cmpFormationUnitAI.order.data.target == target) | |4414|+ if (cmpFormationUnitAI && cmpFormationUnitAI.IsAttackingAsFormation() && | |4415|+ cmpFormationUnitAI.order.data.target == target) |4416|4416| return true; |4417|4417| } |4418|4418| | | [NORMAL] ESLintBear (object-curly-spacing): | | A space is required after '{'. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js |4531|4531| var pos = cmpPosition.GetPosition(); |4532|4532| var heldPosition = this.heldPosition; |4533|4533| if (heldPosition === undefined) |4534| |- heldPosition = {"x": pos.x, "z": pos.z}; | |4534|+ heldPosition = { "x": pos.x, "z": pos.z}; |4535|4535| |4536|4536| return Math.euclidDistance2D(pos.x, pos.z, heldPosition.x, heldPosition.z) < halfvision + range.max; |4537|4537| }; | | [NORMAL] ESLintBear (object-curly-spacing): | | A space is required before '}'. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js |4531|4531| var pos = cmpPosition.GetPosition(); |4532|4532| var heldPosition = this.heldPosition; |4533|4533| if (heldPosition === undefined) |4534| |- heldPosition = {"x": pos.x, "z": pos.z}; | |4534|+ heldPosition = {"x": pos.x, "z": pos.z }; |4535|4535| |4536|4536| return Math.euclidDistance2D(pos.x, pos.z, heldPosition.x, heldPosition.z) < halfvision + range.max; |4537|4537| }; | | [NORMAL] ESLintBear (operator-linebreak): | | '&&' should be placed at the end of the line. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js |4579|4579| UnitAI.prototype.AttackEntityInZone = function(ents) |4580|4580| { |4581|4581| var target = ents.find(target => |4582| |- this.CanAttack(target) |4583| |- && this.CheckTargetDistanceFromHeldPosition(target, IID_Attack, this.GetBestAttackAgainst(target, true)) | |4582|+ this.CanAttack(target) && | |4583|+ this.CheckTargetDistanceFromHeldPosition(target, IID_Attack, this.GetBestAttackAgainst(target, true)) |4584|4584| && (this.GetStance().respondChaseBeyondVision || this.CheckTargetIsInVisionRange(target)) |4585|4585| ); |4586|4586| if (!target) | | [NORMAL] ESLintBear (operator-linebreak): | | '&&' should be placed at the end of the line. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js |4580|4580| { |4581|4581| var target = ents.find(target => |4582|4582| this.CanAttack(target) |4583| |- && this.CheckTargetDistanceFromHeldPosition(target, IID_Attack, this.GetBestAttackAgainst(target, true)) |4584| |- && (this.GetStance().respondChaseBeyondVision || this.CheckTargetIsInVisionRange(target)) | |4583|+ && this.CheckTargetDistanceFromHeldPosition(target, IID_Attack, this.GetBestAttackAgainst(target, true)) && | |4584|+ (this.GetStance().respondChaseBeyondVision || this.CheckTargetIsInVisionRange(target)) |4585|4585| ); |4586|4586| if (!target) |4587|4587| return false; | | [NORMAL] ESLintBear (no-multi-spaces): | | Multiple spaces found before 'Engine'. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js |4644|4644| // If we are guarding/escorting, don't abandon as long as the guarded unit is in target range of the attacker |4645|4645| if (this.isGuardOf) |4646|4646| { |4647| |- var cmpUnitAI = Engine.QueryInterface(target, IID_UnitAI); | |4647|+ var cmpUnitAI = Engine.QueryInterface(target, IID_UnitAI); |4648|4648| var cmpAttack = Engine.QueryInterface(target, IID_Attack); |4649|4649| if (cmpUnitAI && cmpAttack && |4650|4650| cmpAttack.GetAttackTypes().some(type => cmpUnitAI.CheckTargetAttackRange(this.isGuardOf, type))) | | [NORMAL] ESLintBear (indent): | | Expected indentation of 3 tabs but found 4. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js |4648|4648| var cmpAttack = Engine.QueryInterface(target, IID_Attack); |4649|4649| if (cmpUnitAI && cmpAttack && |4650|4650| cmpAttack.GetAttackTypes().some(type => cmpUnitAI.CheckTargetAttackRange(this.isGuardOf, type))) |4651| |- return false; | |4651|+ return false; |4652|4652| } |4653|4653| |4654|4654| // Stop if we're in hold-ground mode and it's too far from the holding point | | [NORMAL] ESLintBear (curly): | | Unnecessary { after 'if' condition. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js |4653|4653| |4654|4654| // Stop if we're in hold-ground mode and it's too far from the holding point |4655|4655| if (this.GetStance().respondHoldGround) |4656| |- { | |4656|+ |4657|4657| if (!this.CheckTargetDistanceFromHeldPosition(target, iid, type)) |4658|4658| return true; |4659| |- } | |4659|+ |4660|4660| |4661|4661| // Stop if it's left our vision range, unless we're especially persistent |4662|4662| if (!this.GetStance().respondChaseBeyondVision) | | [NORMAL] ESLintBear (curly): | | Unnecessary { after 'if' condition. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js |4660|4660| |4661|4661| // Stop if it's left our vision range, unless we're especially persistent |4662|4662| if (!this.GetStance().respondChaseBeyondVision) |4663| |- { | |4663|+ |4664|4664| if (!this.CheckTargetIsInVisionRange(target)) |4665|4665| return true; |4666| |- } | |4666|+ |4667|4667| |4668|4668| // (Note that CCmpUnitMotion will detect if the target is lost in FoW, |4669|4669| // and will continue moving to its last seen position and then stop) | | [NORMAL] ESLintBear (no-multi-spaces): | | Multiple spaces found before 'Engine'. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js |4691|4691| // If we are guarding/escorting, chase at least as long as the guarded unit is in target range of the attacker |4692|4692| if (this.isGuardOf) |4693|4693| { |4694| |- var cmpUnitAI = Engine.QueryInterface(target, IID_UnitAI); | |4694|+ var cmpUnitAI = Engine.QueryInterface(target, IID_UnitAI); |4695|4695| var cmpAttack = Engine.QueryInterface(target, IID_Attack); |4696|4696| if (cmpUnitAI && cmpAttack && |4697|4697| cmpAttack.GetAttackTypes().some(type => cmpUnitAI.CheckTargetAttackRange(this.isGuardOf, type))) | | [NORMAL] ESLintBear (spaced-comment): | | Expected space or tab after '//' in comment. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js |4704|4704| return false; |4705|4705| }; |4706|4706| |4707| |-//// External interface functions //// | |4707|+// // External interface functions //// |4708|4708| |4709|4709| UnitAI.prototype.SetFormationController = function(ent) |4710|4710| { | | [NORMAL] ESLintBear (curly): | | Unnecessary { after 'if' condition. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js |4714|4714| // of our own formation (or ourself if not in formation) |4715|4715| var cmpObstruction = Engine.QueryInterface(this.entity, IID_Obstruction); |4716|4716| if (cmpObstruction) |4717| |- { | |4717|+ |4718|4718| if (ent == INVALID_ENTITY) |4719|4719| cmpObstruction.SetControlGroup(this.entity); |4720|4720| else |4721|4721| cmpObstruction.SetControlGroup(ent); |4722| |- } | |4722|+ |4723|4723| |4724|4724| // If we were removed from a formation, let the FSM switch back to INDIVIDUAL |4725|4725| if (ent == INVALID_ENTITY) | | [NORMAL] ESLintBear (curly): | | Unnecessary { after 'if' condition. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js |4857|4857| // if we already had an old guard order, do nothing if the target is the same |4858|4858| // and the order is running, otherwise remove the previous order |4859|4859| if (this.isGuardOf) |4860| |- { | |4860|+ |4861|4861| if (this.isGuardOf == target && this.order && this.order.type == "Guard") |4862|4862| return; |4863|4863| else |4864|4864| this.RemoveGuard(); |4865| |- } | |4865|+ |4866|4866| |4867|4867| this.AddOrder("Guard", { "target": target, "force": false }, queued); |4868|4868| }; | | [NORMAL] ESLintBear (no-else-return): | | Unnecessary 'else' after 'return'. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js |4860|4860| { |4861|4861| if (this.isGuardOf == target && this.order && this.order.type == "Guard") |4862|4862| return; |4863| |- else |4864| |- this.RemoveGuard(); | |4863|+ this.RemoveGuard(); |4865|4864| } |4866|4865| |4867|4866| this.AddOrder("Guard", { "target": target, "force": false }, queued); | | [NORMAL] ESLintBear (object-curly-spacing): | | A space is required after '{'. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js |4902|4902| return; |4903|4903| |4904|4904| if (this.order.type == "Guard") |4905| |- this.UnitFsm.ProcessMessage(this, {"type": "RemoveGuard"}); | |4905|+ this.UnitFsm.ProcessMessage(this, { "type": "RemoveGuard"}); |4906|4906| else |4907|4907| for (let i = 1; i < this.orderQueue.length; ++i) |4908|4908| if (this.orderQueue[i].type == "Guard") | | [NORMAL] ESLintBear (object-curly-spacing): | | A space is required before '}'. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js |4902|4902| return; |4903|4903| |4904|4904| if (this.order.type == "Guard") |4905| |- this.UnitFsm.ProcessMessage(this, {"type": "RemoveGuard"}); | |4905|+ this.UnitFsm.ProcessMessage(this, {"type": "RemoveGuard" }); |4906|4906| else |4907|4907| for (let i = 1; i < this.orderQueue.length; ++i) |4908|4908| if (this.orderQueue[i].type == "Guard") | | [NORMAL] ESLintBear (object-curly-spacing): | | A space is required before '}'. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js |5031|5031| this.WalkToTarget(target, queued); |5032|5032| return; |5033|5033| } |5034| |- this.AddOrder("Attack", { "target": target, "force": true, "allowCapture": allowCapture}, queued); | |5034|+ this.AddOrder("Attack", { "target": target, "force": true, "allowCapture": allowCapture }, queued); |5035|5035| }; |5036|5036| |5037|5037| /** | | [NORMAL] ESLintBear (no-trailing-spaces): | | Trailing spaces not allowed. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js |5180|5180| this.workOrders.length && this.workOrders[0].type == "Trade") |5181|5181| { |5182|5182| let cmpTrader = Engine.QueryInterface(this.entity, IID_Trader); |5183| |- if (cmpTrader.HasBothMarkets() && | |5183|+ if (cmpTrader.HasBothMarkets() && |5184|5184| (cmpTrader.GetFirstMarket() == target && cmpTrader.GetSecondMarket() == source || |5185|5185| cmpTrader.GetFirstMarket() == source && cmpTrader.GetSecondMarket() == target)) |5186|5186| { | | [NORMAL] ESLintBear (operator-linebreak): | | '&&' should be placed at the end of the line. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js |5461|5461| { |5462|5462| var cmpIdentity = Engine.QueryInterface(targ, IID_Identity); |5463|5463| var targetClasses = this.order.data.targetClasses; |5464| |- if (targetClasses.attack && cmpIdentity |5465| |- && !MatchesClassList(cmpIdentity.GetClassesList(), targetClasses.attack)) | |5464|+ if (targetClasses.attack && cmpIdentity && | |5465|+ !MatchesClassList(cmpIdentity.GetClassesList(), targetClasses.attack)) |5466|5466| continue; |5467|5467| if (targetClasses.avoid && cmpIdentity |5468|5468| && MatchesClassList(cmpIdentity.GetClassesList(), targetClasses.avoid)) | | [NORMAL] ESLintBear (operator-linebreak): | | '&&' should be placed at the end of the line. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js |5464|5464| if (targetClasses.attack && cmpIdentity |5465|5465| && !MatchesClassList(cmpIdentity.GetClassesList(), targetClasses.attack)) |5466|5466| continue; |5467| |- if (targetClasses.avoid && cmpIdentity |5468| |- && MatchesClassList(cmpIdentity.GetClassesList(), targetClasses.avoid)) | |5467|+ if (targetClasses.avoid && cmpIdentity && | |5468|+ MatchesClassList(cmpIdentity.GetClassesList(), targetClasses.avoid)) |5469|5469| continue; |5470|5470| // Only used by the AIs to prevent some choices of targets |5471|5471| if (targetClasses.vetoEntities && targetClasses.vetoEntities[targ]) | | [NORMAL] ESLintBear (operator-linebreak): | | '&&' should be placed at the end of the line. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js |5487|5487| { |5488|5488| var cmpIdentity = Engine.QueryInterface(targ, IID_Identity); |5489|5489| var targetClasses = this.order.data.targetClasses; |5490| |- if (cmpIdentity && targetClasses.attack |5491| |- && !MatchesClassList(cmpIdentity.GetClassesList(), targetClasses.attack)) | |5490|+ if (cmpIdentity && targetClasses.attack && | |5491|+ !MatchesClassList(cmpIdentity.GetClassesList(), targetClasses.attack)) |5492|5492| continue; |5493|5493| if (cmpIdentity && targetClasses.avoid |5494|5494| && MatchesClassList(cmpIdentity.GetClassesList(), targetClasses.avoid)) | | [NORMAL] ESLintBear (operator-linebreak): | | '&&' should be placed at the end of the line. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js |5490|5490| if (cmpIdentity && targetClasses.attack |5491|5491| && !MatchesClassList(cmpIdentity.GetClassesList(), targetClasses.attack)) |5492|5492| continue; |5493| |- if (cmpIdentity && targetClasses.avoid |5494| |- && MatchesClassList(cmpIdentity.GetClassesList(), targetClasses.avoid)) | |5493|+ if (cmpIdentity && targetClasses.avoid && | |5494|+ MatchesClassList(cmpIdentity.GetClassesList(), targetClasses.avoid)) |5495|5495| continue; |5496|5496| // Only used by the AIs to prevent some choices of targets |5497|5497| if (targetClasses.vetoEntities && targetClasses.vetoEntities[targ]) | | [NORMAL] ESLintBear (space-before-function-paren): | | Unexpected space before function parentheses. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js |5530|5530| |5531|5531| var cmpRangeManager = Engine.QueryInterface(SYSTEM_ENTITY, IID_RangeManager); |5532|5532| var entities = cmpRangeManager.ResetActiveQuery(this.losRangeQuery); |5533| |- var targets = entities.filter(function (v) { return cmpAttack.CanAttack(v) && attackfilter(v); }) | |5533|+ var targets = entities.filter(function(v) { return cmpAttack.CanAttack(v) && attackfilter(v); }) |5534|5534| .sort(function (a, b) { return cmpAttack.CompareEntitiesByPreference(a, b); }); |5535|5535| |5536|5536| return targets; | | [NORMAL] ESLintBear (space-before-function-paren): | | Unexpected space before function parentheses. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js |5531|5531| var cmpRangeManager = Engine.QueryInterface(SYSTEM_ENTITY, IID_RangeManager); |5532|5532| var entities = cmpRangeManager.ResetActiveQuery(this.losRangeQuery); |5533|5533| var targets = entities.filter(function (v) { return cmpAttack.CanAttack(v) && attackfilter(v); }) |5534| |- .sort(function (a, b) { return cmpAttack.CompareEntitiesByPreference(a, b); }); | |5534|+ .sort(function(a, b) { return cmpAttack.CompareEntitiesByPreference(a, b); }); |5535|5535| |5536|5536| return targets; |5537|5537| }; | | [NORMAL] ESLintBear (object-curly-spacing): | | A space is required after '{'. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js |5620|5620| |5621|5621| UnitAI.prototype.SetHeldPosition = function(x, z) |5622|5622| { |5623| |- this.heldPosition = {"x": x, "z": z}; | |5623|+ this.heldPosition = { "x": x, "z": z}; |5624|5624| }; |5625|5625| |5626|5626| UnitAI.prototype.SetHeldPositionOnEntity = function(entity) | | [NORMAL] ESLintBear (object-curly-spacing): | | A space is required before '}'. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js |5620|5620| |5621|5621| UnitAI.prototype.SetHeldPosition = function(x, z) |5622|5622| { |5623| |- this.heldPosition = {"x": x, "z": z}; | |5623|+ this.heldPosition = {"x": x, "z": z }; |5624|5624| }; |5625|5625| |5626|5626| UnitAI.prototype.SetHeldPositionOnEntity = function(entity) | | [NORMAL] ESLintBear (spaced-comment): | | Expected space or tab after '//' in comment. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js |5647|5647| return false; |5648|5648| }; |5649|5649| |5650| |-//// Helper functions //// | |5650|+// // Helper functions //// |5651|5651| |5652|5652| UnitAI.prototype.CanAttack = function(target) |5653|5653| { | | [NORMAL] ESLintBear (spaced-comment): | | Expected space or tab after '//' in comment. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js |5851|5851| return (cmpPack && cmpPack.IsPacking()); |5852|5852| }; |5853|5853| |5854| |-//// Formation specific functions //// | |5854|+// // Formation specific functions //// |5855|5855| |5856|5856| UnitAI.prototype.IsAttackingAsFormation = function() |5857|5857| { | | [NORMAL] ESLintBear (operator-linebreak): | | '&&' should be placed at the end of the line. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js |5856|5856| UnitAI.prototype.IsAttackingAsFormation = function() |5857|5857| { |5858|5858| var cmpAttack = Engine.QueryInterface(this.entity, IID_Attack); |5859| |- return cmpAttack && cmpAttack.CanAttackAsFormation() |5860| |- && this.GetCurrentState() == "FORMATIONCONTROLLER.COMBAT.ATTACKING"; | |5859|+ return cmpAttack && cmpAttack.CanAttackAsFormation() && | |5860|+ this.GetCurrentState() == "FORMATIONCONTROLLER.COMBAT.ATTACKING"; |5861|5861| }; |5862|5862| |5863|5863| //// Animal specific functions //// | | [NORMAL] ESLintBear (spaced-comment): | | Expected space or tab after '//' in comment. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js |5860|5860| && this.GetCurrentState() == "FORMATIONCONTROLLER.COMBAT.ATTACKING"; |5861|5861| }; |5862|5862| |5863| |-//// Animal specific functions //// | |5863|+// // Animal specific functions //// |5864|5864| |5865|5865| UnitAI.prototype.MoveRandomly = function(distance) |5866|5866| { binaries/data/mods/public/simulation/components/UnitAI.js |2405| » » » » » » let·nearby·=·this.FindNearestDropsite(resourceType.generic); | | [NORMAL] ESLintBear (no-shadow): | | 'nearby' is already declared in the upper scope. binaries/data/mods/public/simulation/components/UnitAI.js |3774| » var·isWorkType·=·type·=>·type·==·"Gather"·||·type·==·"Trade"·||·type·==·"Repair"·||·type·==·"ReturnResource"; | | [NORMAL] ESLintBear (no-shadow): | | 'type' is already declared in the upper scope. binaries/data/mods/public/simulation/components/UnitAI.js |4566| » var·target·=·ents.find(target·=>·this.CanAttack(target)); | | [NORMAL] ESLintBear (no-shadow): | | 'target' is already declared in the upper scope. binaries/data/mods/public/simulation/components/UnitAI.js |4581| » var·target·=·ents.find(target·=> | | [NORMAL] ESLintBear (no-shadow): | | 'target' is already declared in the upper scope. binaries/data/mods/public/simulation/components/UnitAI.js |4627| » var·ent·=·ents.find(ent·=>·this.CanHeal(ent)); | | [NORMAL] ESLintBear (no-shadow): | | 'ent' is already declared in the upper scope. binaries/data/mods/public/simulation/components/UnitAI.js |4650| » » ····cmpAttack.GetAttackTypes().some(type·=>·cmpUnitAI.CheckTargetAttackRange(this.isGuardOf,·type))) | | [NORMAL] ESLintBear (no-shadow): | | 'type' is already declared in the upper scope. binaries/data/mods/public/simulation/components/UnitAI.js |5111| » var·lastPos·=·undefined; | | [NORMAL] ESLintBear (no-undef-init): | | It's not necessary to initialize 'lastPos' to undefined. binaries/data/mods/public/simulation/components/UnitAI.js | 353| » » ····&&·(this.lastShorelinePosition.z·==·cmpPosition.GetPosition().z)) | | [NORMAL] JSHintBear: | | Misleading line break before '&&'; readers may interpret this as an expression boundary. binaries/data/mods/public/simulation/components/UnitAI.js |1884| » » » » » » var·cmpFormation·=·Engine.QueryInterface(this.formationController,·IID_Formation); | | [NORMAL] JSHintBear: | | 'cmpFormation' is already defined. binaries/data/mods/public/simulation/components/UnitAI.js |2017| » » » » » » &&·this.order.data.target·!=·msg.data.attacker·&&·this.GetBestAttackAgainst(msg.data.attacker,·true)·!=·"Capture") | | [NORMAL] JSHintBear: | | Misleading line break before '&&'; readers may interpret this as an expression boundary. binaries/data/mods/public/simulation/components/UnitAI.js |2099| » » » » » » » » ·&&·((type.generic·==·"treasure"·&&·oldType.generic·==·"treasure") | | [NORMAL] JSHintBear: | | Misleading line break before '&&'; readers may interpret this as an expression boundary. binaries/data/mods/public/simulation/components/UnitAI.js |2100| » » » » » » » » ·||·(type.specific·==·oldType.specific | | [NORMAL] JSHintBear: | | Misleading line break before '||'; readers may interpret this as an expression boundary. binaries/data/mods/public/simulation/components/UnitAI.js |2101| » » » » » » » » ·&&·(type.specific·!=·"meat"·||·oldTemplate·==·template))) | | [NORMAL] JSHintBear: | | Misleading line break before '&&'; readers may interpret this as an expression boundary. binaries/data/mods/public/simulation/components/UnitAI.js |2124| » » » » » » » » var·nearby·=·this.FindNearestDropsite(oldType.generic); | | [NORMAL] JSHintBear: | | 'nearby' is already defined. binaries/data/mods/public/simulation/components/UnitAI.js |2164| » » » » » » » » &&·((type.generic·==·"treasure"·&&·oldType.generic·==·"treasure") | | [NORMAL] JSHintBear: | | Misleading line break before '&&'; readers may interpret this as an expression boundary. binaries/data/mods/public/simulation/components/UnitAI.js |2165| » » » » » » » » ||·(type.specific·==·oldType.specific | | [NORMAL] JSHintBear: | | Misleading line break before '||'; readers may interpret this as an expression boundary. binaries/data/mods/public/simulation/components/UnitAI.js |2166| » » » » » » » » &&·(type.specific·!=·"meat"·||·oldTemplate·==·template))) | | [NORMAL] JSHintBear: | | Misleading line break before '&&'; readers may interpret this as an expression boundary. binaries/data/mods/public/simulation/components/UnitAI.js |2210| » » » » » » » ||·(type.specific·==·resourceType.specific | | [NORMAL] JSHintBear: | | Misleading line break before '||'; readers may interpret this as an expression boundary. binaries/data/mods/public/simulation/components/UnitAI.js |2211| » » » » » » » &&·(type.specific·!=·"meat"·||·resourceTemplate·==·template)) | | [NORMAL] JSHintBear: | | Misleading line break before '&&'; readers may interpret this as an expression boundary. binaries/data/mods/public/simulation/components/UnitAI.js |2227| » » » » » var·nearby·=·this.FindNearestDropsite(resourceType.generic); | | [NORMAL] JSHintBear: | | 'nearby' is already defined. binaries/data/mods/public/simulation/components/UnitAI.js |2400| » » » » » var·cmpResourceGatherer·=·Engine.QueryInterface(this.entity,·IID_ResourceGatherer); | | [NORMAL] JSHintBear: | | 'cmpResourceGatherer' is already defined. binaries/data/mods/public/simulation/components/UnitAI.js |2416| » » » » » var·nearby·=·this.FindNearbyResource(function·(ent,·type,·template)·{ | | [NORMAL] JSHintBear: | | 'nearby' is already defined. binaries/data/mods/public/simulation/components/UnitAI.js |2419| » » » » » » » ||·(type.specific·==·resourceType.specific | | [NORMAL] JSHintBear: | | Misleading line break before '||'; readers may interpret this as an expression boundary. binaries/data/mods/public/simulation/components/UnitAI.js |2420| » » » » » » » &&·(type.specific·!=·"meat"·||·resourceTemplate·==·template)) | | [NORMAL] JSHintBear: | | Misleading line break before '&&'; readers may interpret this as an expression boundary. binaries/data/mods/public/simulation/components/UnitAI.js |2440| » » » » » var·nearby·=·this.FindNearestDropsite(resourceType.generic); | | [NORMAL] JSHintBear: | | 'nearby' is already defined. binaries/data/mods/public/simulation/components/UnitAI.js |2624| » » » » » var·cmpResourceGatherer·=·Engine.QueryInterface(this.entity,·IID_ResourceGatherer); | | [NORMAL] JSHintBear: | | 'cmpResourceGatherer' is already defined. binaries/data/mods/public/simulation/components/UnitAI.js |2819| » » » » » var·cmpResourceDropsite·=·Engine.QueryInterface(msg.data.newentity,·IID_ResourceDropsite); | | [NORMAL] JSHintBear: | | 'cmpResourceDropsite' is already defined. binaries/data/mods/public/simulation/components/UnitAI.js |2892| » » » » » if·(this.CanGarrison(target)) | | [NORMAL] JSHintBear: | | 'target' used out of scope. binaries/data/mods/public/simulation/components/UnitAI.js |2895| » » » » » » if·(this.CheckGarrisonRange(target)) | | [NORMAL] JSHintBear: | | 'target' used out of scope. binaries/data/mods/public/simulation/components/UnitAI.js |2897| » » » » » » » var·cmpGarrisonHolder·=·Engine.QueryInterface(target,·IID_GarrisonHolder); | | [NORMAL] JSHintBear: | | 'target' used out of scope. binaries/data/mods/public/simulation/components/UnitAI.js |2919| » » » » » » » » var·cmpResourceDropsite·=·Engine.QueryInterface(target,·IID_ResourceDropsite); | | [NORMAL] JSHintBear: | | 'target' used out of scope. binaries/data/mods/public/simulation/components/UnitAI.js |2920| » » » » » » » » if·(cmpResourceDropsite·&&·this.CanReturnResource(target,·true)) | | [NORMAL] JSHintBear: | | 'target' used out of scope. binaries/data/mods/public/simulation/components/UnitAI.js |2935| » » » » » » » » » var·cmpHolderPosition·=·Engine.QueryInterface(target,·IID_Position); | | [NORMAL] JSHintBear: | | 'target' used out of scope. binaries/data/mods/public/simulation/components/UnitAI.js |2936| » » » » » » » » » var·cmpHolderUnitAI·=·Engine.QueryInterface(target,·IID_UnitAI); | | [NORMAL] JSHintBear: | | 'target' used out of scope. binaries/data/mods/public/simulation/components/UnitAI.js |2963| » » » » » » » if·(this.MoveToTarget(target)) | | [NORMAL] JSHintBear: | | 'target' used out of scope. binaries/data/mods/public/simulation/components/UnitAI.js |3736| » » var·order·=·{·"type":·type,·"data":·data·}; | | [NORMAL] JSHintBear: | | 'order' is already defined. binaries/data/mods/public/simulation/components/UnitAI.js |3805| » for·(var·i·=·0;·i·<·this.orderQueue.length;·++i) | | [NORMAL] JSHintBear: | | 'i' is already defined. binaries/data/mods/public/simulation/components/UnitAI.js |4077| » let·cmpPosition·=·Engine.QueryInterface(this.entity,·IID_Position) | | [NORMAL] JSHintBear: | | Missing semicolon. binaries/data/mods/public/simulation/components/UnitAI.js |4348| » » var·parabolicMaxRange·=·0; | | [NORMAL] JSHintBear: | | 'parabolicMaxRange' is already defined. binaries/data/mods/public/simulation/components/UnitAI.js |4352| » var·guessedMaxRange·=·(range.max·+·parabolicMaxRange)/2; | | [NORMAL] JSHintBear: | | 'parabolicMaxRange' used out of scope. binaries/data/mods/public/simulation/components/UnitAI.js |4359| » return·cmpUnitMotion.MoveToTargetRange(target,·range.min,·Math.min(range.max,·parabolicMaxRange)); | | [NORMAL] JSHintBear: | | 'parabolicMaxRange' used out of scope. binaries/data/mods/public/simulation/components/UnitAI.js |4415| » » » &&·cmpFormationUnitAI.order.data.target·==·target) | | [NORMAL] JSHintBear: | | Misleading line break before '&&'; readers may interpret this as an expression boundary. binaries/data/mods/public/simulation/components/UnitAI.js |4583| » » &&·this.CheckTargetDistanceFromHeldPosition(target,·IID_Attack,·this.GetBestAttackAgainst(target,·true)) | | [NORMAL] JSHintBear: | | Misleading line break before '&&'; readers may interpret this as an expression boundary. binaries/data/mods/public/simulation/components/UnitAI.js |4584| » » &&·(this.GetStance().respondChaseBeyondVision·||·this.CheckTargetIsInVisionRange(target)) | | [NORMAL] JSHintBear: | | Misleading line break before '&&'; readers may interpret this as an expression boundary. binaries/data/mods/public/simulation/components/UnitAI.js |5111| » var·lastPos·=·undefined; | | [NORMAL] JSHintBear: | | It's not necessary to initialize 'lastPos' to 'undefined'. binaries/data/mods/public/simulation/components/UnitAI.js |5465| » » » » » » &&·!MatchesClassList(cmpIdentity.GetClassesList(),·targetClasses.attack)) | | [NORMAL] JSHintBear: | | Misleading line break before '&&'; readers may interpret this as an expression boundary. binaries/data/mods/public/simulation/components/UnitAI.js |5468| » » » » » » &&·MatchesClassList(cmpIdentity.GetClassesList(),·targetClasses.avoid)) | | [NORMAL] JSHintBear: | | Misleading line break before '&&'; readers may interpret this as an expression boundary. binaries/data/mods/public/simulation/components/UnitAI.js |5481| » var·targets·=·this.GetTargetsFromUnit(); | | [NORMAL] JSHintBear: | | 'targets' is already defined. binaries/data/mods/public/simulation/components/UnitAI.js |5482| » for·(var·targ·of·targets) | | [NORMAL] JSHintBear: | | 'targ' is already defined. binaries/data/mods/public/simulation/components/UnitAI.js |5488| » » » var·cmpIdentity·=·Engine.QueryInterface(targ,·IID_Identity); | | [NORMAL] JSHintBear: | | 'cmpIdentity' is already defined. binaries/data/mods/public/simulation/components/UnitAI.js |5489| » » » var·targetClasses·=·this.order.data.targetClasses; | | [NORMAL] JSHintBear: | | 'targetClasses' is already defined. binaries/data/mods/public/simulation/components/UnitAI.js |5491| » » » » &&·!MatchesClassList(cmpIdentity.GetClassesList(),·targetClasses.attack)) | | [NORMAL] JSHintBear: | | Misleading line break before '&&'; readers may interpret this as an expression boundary. binaries/data/mods/public/simulation/components/UnitAI.js |5494| » » » » &&·MatchesClassList(cmpIdentity.GetClassesList(),·targetClasses.avoid)) | | [NORMAL] JSHintBear: | | Misleading line break before '&&'; readers may interpret this as an expression boundary. binaries/data/mods/public/simulation/components/UnitAI.js |5569| » » var·range·=·cmpVision.GetRange(); | | [NORMAL] JSHintBear: | | 'range' is already defined. binaries/data/mods/public/simulation/components/UnitAI.js |5574| » » var·cmpRanged·=·Engine.QueryInterface(this.entity,·iid); | | [NORMAL] JSHintBear: | | 'cmpRanged' is already defined. binaries/data/mods/public/simulation/components/UnitAI.js |5577| » » var·range·=·iid·!==·IID_Attack·?·cmpRanged.GetRange()·:·cmpRanged.GetFullAttackRange(); | | [NORMAL] JSHintBear: | | 'range' is already defined. binaries/data/mods/public/simulation/components/UnitAI.js |5578| » » var·cmpVision·=·Engine.QueryInterface(this.entity,·IID_Vision); | | [NORMAL] JSHintBear: | | 'cmpVision' is already defined. binaries/data/mods/public/simulation/components/UnitAI.js |5578| » » var·cmpVision·=·Engine.QueryInterface(this.entity,·IID_Vision); | | [MAJOR] JSHintBear: | | Too many errors. (93% scanned).
Link to build: https://jenkins.wildfiregames.com/job/differential/90/display/redirect
This is a bit of a philosophy change. Existing structure was mostly to do all the logic in "setDefaultAnimationVariant", and try using special states as little a possible.
I'd like some more justification for the change, so requesting changes, but I could be swayed.