Page MenuHomeWildfire Games

Ranged units attacks melee when target in minimum ranged attack range
AbandonedPublic

Authored by Silier on Jul 8 2018, 10:50 AM.

Details

Reviewers
None
Summary

Ranged units should use melee attack when their target reached their minimal range for range attack.
(now it is 2.0 - maybe too far ?)
Just athenians and romans has melee animation now, which is also taken from women attack

Test Plan

need some testing

Diff Detail

Repository
rP 0 A.D. Public Repository
Branch
/ps/trunk
Lint
Lint OK
Unit
No Unit Test Coverage
Build Status
Buildable 6281
Build 10424: Vulcan BuildJenkins
Build 10423: arc lint + arc unit

Event Timeline

Silier created this revision.Jul 8 2018, 10:50 AM
Owners added a subscriber: Restricted Owners Package.Jul 8 2018, 10:50 AM
Vulcan added a subscriber: Vulcan.Jul 8 2018, 10:54 AM

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 (spaced-comment):
|    | Expected space or tab after '//' in comment.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/Attack.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/Attack.js
| 507| 507| 
| 508| 508| 		let horizSpeed = +this.template[type].ProjectileSpeed;
| 509| 509| 		let gravity = +this.template[type].Gravity;
| 510|    |-		//horizSpeed /= 2; gravity /= 2; // slow it down for testing
|    | 510|+		// horizSpeed /= 2; gravity /= 2; // slow it down for testing
| 511| 511| 
| 512| 512| 		let cmpPosition = Engine.QueryInterface(this.entity, IID_Position);
| 513| 513| 		if (!cmpPosition || !cmpPosition.IsInWorld())
|    | [NORMAL] ESLintBear (no-trailing-spaces):
|    | Trailing spaces not allowed.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/Attack.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/Attack.js
| 556| 556| 		let launchPoint = selfPosition.clone();
| 557| 557| 		// TODO: remove this when all the ranged unit templates are updated with Projectile/Launchpoint
| 558| 558| 		launchPoint.y += 3;
| 559|    |-		
|    | 559|+
| 560| 560| 		let cmpVisual = Engine.QueryInterface(this.entity, IID_Visual);
| 561| 561| 		if (cmpVisual)
| 562| 562| 		{
|    | [NORMAL] ESLintBear (curly):
|    | Unnecessary { after 'else'.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/Attack.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/Attack.js
| 627| 627| 			});
| 628| 628| 	}
| 629| 629| 	else
| 630|    |-	{
|    | 630|+	
| 631| 631| 		// Melee attack - hurt the target immediately
| 632| 632| 		cmpDamage.CauseDamage({
| 633| 633| 			"strengths": this.GetAttackStrengths(type),
| 637| 637| 			"type": type,
| 638| 638| 			"attackerOwner": attackerOwner
| 639| 639| 		});
| 640|    |-	}
|    | 640|+	
| 641| 641| };
| 642| 642| 
| 643| 643| /**

binaries/data/mods/public/simulation/components/Attack.js
| 395| »   »   if·(cmpThisPosition·&&·cmpTargetPosition)·{
|    | [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/Attack.js
| 497| ·»   let·cmpDamage·=·Engine.QueryInterface(SYSTEM_ENTITY,·IID_Damage);
|    | [NORMAL] ESLintBear (no-mixed-spaces-and-tabs):
|    | Mixed spaces and tabs.

binaries/data/mods/public/simulation/components/Attack.js
| 602| »   »   cmpTimer.SetTimeout(SYSTEM_ENTITY,·IID_Damage,·"MissileHit",·timeToTarget·*·1000·+·+this.template.Ranged.Delay,·data);
|    | [NORMAL] JSHintBear:
|    | Confusing plusses.

Link to build: https://jenkins.wildfiregames.com/job/differential/676/display/redirect

Silier added a subscriber: Restricted Owners Package.Jul 8 2018, 10:58 AM
Stan added subscribers: bb, Stan.Jul 8 2018, 11:00 AM

Have you seen #252 from @bb

Stan added a reviewer: Restricted Owners Package.Mar 9 2019, 10:50 AM
Silier removed a reviewer: Restricted Owners Package.Nov 25 2019, 11:35 AM