Page MenuHomeWildfire Games

DamageTypes lowercase.
AbandonedPublic

Authored by Freagarach on Jun 2 2019, 8:47 AM.

Details

Reviewers
None
Group Reviewers
Restricted Owners Package(Owns No Changed Paths)
Summary

This changes the codes of DamageTypes to lowercase, as the Resources are.

Note: This is not necessary I guess, only for consistency. If we want to save modders work, we should either work on this to get it landed ASAP or just abandon this entirely,,,

Test Plan

Pray that nothing is overlooked ;)

Diff Detail

Repository
rP 0 A.D. Public Repository
Branch
/ps/trunk
Lint
Lint OK
Unit
No Unit Test Coverage
Build Status
Buildable 7739
Build 12606: Vulcan Build
Build 12605: arc lint + arc unit

Event Timeline

Freagarach created this revision.Jun 2 2019, 8:47 AM
Freagarach created this object with visibility "No One".
Owners added a subscriber: Restricted Owners Package.Jun 2 2019, 8:47 AM
Freagarach edited the summary of this revision. (Show Details)Jun 2 2019, 8:49 AM
Freagarach removed a subscriber: Restricted Owners Package.
Freagarach updated this revision to Diff 8527.Jun 16 2019, 10:00 PM
Freagarach edited the summary of this revision. (Show Details)
Freagarach edited the test plan for this revision. (Show Details)
Freagarach added a reviewer: Restricted Owners Package.
Freagarach changed the visibility from "No One" to "Public (No Login Required)".

Updated following D1950.

Owners added a subscriber: Restricted Owners Package.Jun 16 2019, 10:00 PM
Freagarach edited the summary of this revision. (Show Details)Jun 16 2019, 10:03 PM

Successful build - Chance fights ever on the side of the prudent.

Linter detected issues:
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
| 524| 524| 
| 525| 525| 		let horizSpeed = +this.template[type].Projectile.Speed;
| 526| 526| 		let gravity = +this.template[type].Projectile.Gravity;
| 527|    |-		//horizSpeed /= 2; gravity /= 2; // slow it down for testing
|    | 527|+		// horizSpeed /= 2; gravity /= 2; // slow it down for testing
| 528| 528| 
| 529| 529| 		let cmpPosition = Engine.QueryInterface(this.entity, IID_Position);
| 530| 530| 		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
| 571| 571| 		// TODO: Use unit rotation to implement x/z offsets.
| 572| 572| 		let deltaLaunchPoint = new Vector3D(0, this.template[type].Projectile.LaunchPoint["@y"], 0.0);
| 573| 573| 		let launchPoint = Vector3D.add(selfPosition, deltaLaunchPoint);
| 574|    |-		
|    | 574|+
| 575| 575| 		let cmpVisual = Engine.QueryInterface(this.entity, IID_Visual);
| 576| 576| 		if (cmpVisual)
| 577| 577| 		{
|    | [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
| 643| 643| 			});
| 644| 644| 	}
| 645| 645| 	else
| 646|    |-	{
|    | 646|+	
| 647| 647| 		// Melee attack - hurt the target immediately
| 648| 648| 		cmpDamage.CauseDamage({
| 649| 649| 			"strengths": this.GetAttackStrengths(type),
| 653| 653| 			"type": type,
| 654| 654| 			"attackerOwner": attackerOwner
| 655| 655| 		});
| 656|    |-	}
|    | 656|+	
| 657| 657| };
| 658| 658| 
| 659| 659| /**

binaries/data/mods/public/simulation/components/Attack.js
| 514| ·»   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
| 618| »   »   cmpTimer.SetTimeout(SYSTEM_ENTITY,·IID_Damage,·"MissileHit",·timeToTarget·*·1000·+·+this.template[type].Delay,·data);
|    | [NORMAL] JSHintBear:
|    | Confusing plusses.
|    | [NORMAL] ESLintBear (curly):
|    | Unnecessary { after 'for-of'.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/ai/common-api/entity.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/ai/common-api/entity.js
|  33|  33| 		{
|  34|  34| 			let args = string.split("/");
|  35|  35| 			for (let arg of args)
|  36|    |-			{
|    |  36|+			
|  37|  37| 				if (value[arg])
|  38|  38| 					value = value[arg];
|  39|  39| 				else
|  41|  41| 					value = undefined;
|  42|  42| 					break;
|  43|  43| 				}
|  44|    |-			}
|    |  44|+			
|  45|  45| 			this._tpCache.set(string, value);
|  46|  46| 		}
|  47|  47| 		return this._tpCache.get(string);
|    | [NORMAL] ESLintBear (curly):
|    | Unnecessary { after 'if' condition.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/ai/common-api/entity.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/ai/common-api/entity.js
| 308| 308| 			return undefined;
| 309| 309| 
| 310| 310| 		if (this.get("Attack/" + type + "/Bonuses"))
| 311|    |-		{
|    | 311|+		
| 312| 312| 			for (let b in this.get("Attack/" + type + "/Bonuses"))
| 313| 313| 			{
| 314| 314| 				let bonusClasses = this.get("Attack/" + type + "/Bonuses/" + b + "/Classes");
| 318| 318| 					if (bcl == againstClass)
| 319| 319| 						return +this.get("Attack/" + type + "/Bonuses/" + b + "/Multiplier");
| 320| 320| 			}
| 321|    |-		}
|    | 321|+		
| 322| 322| 		return 1;
| 323| 323| 	},
| 324| 324| 

binaries/data/mods/public/simulation/ai/common-api/entity.js
| 798| »   »   if·(this.position()·!==·undefined)·{
|    | [NORMAL] ESLintBear (brace-rules/brace-on-same-line):
|    | Opening curly brace appears on the same line as controlling statement.

binaries/data/mods/public/simulation/ai/common-api/entity.js
| 815| »   »   if·(this.position()·!==·undefined·&&·unitToFleeFrom.position()·!==·undefined)·{
|    | [NORMAL] ESLintBear (brace-rules/brace-on-same-line):
|    | Opening curly brace appears on the same line as controlling statement.
|    | [NORMAL] ESLintBear (curly):
|    | Unnecessary { after 'for-in'.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/TechnologyManager.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/TechnologyManager.js
|  10|  10| 
|  11|  11| 	var ret = {};
|  12|  12| 	for (var i in this)
|  13|    |-	{
|    |  13|+	
|  14|  14| 		if (this.hasOwnProperty(i))
|  15|  15| 			ret[i] = this[i];
|  16|    |-	}
|    |  16|+	
|  17|  17| 	ret.modificationCache = {};
|  18|  18| 	return ret;
|  19|  19| };
|    | [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/TechnologyManager.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/TechnologyManager.js
|  64|  64| 	for (let key of this.unresearchedAutoResearchTechs)
|  65|  65| 	{
|  66|  66| 		let tech = TechnologyTemplates.Get(key);
|  67|    |-		if ((tech.autoResearch && this.CanResearch(key))
|  68|    |-			|| (tech.top && (this.IsTechnologyResearched(tech.top) || this.IsTechnologyResearched(tech.bottom))))
|    |  67|+		if ((tech.autoResearch && this.CanResearch(key)) ||
|    |  68|+			(tech.top && (this.IsTechnologyResearched(tech.top) || this.IsTechnologyResearched(tech.bottom))))
|  69|  69| 		{
|  70|  70| 			this.unresearchedAutoResearchTechs.delete(key);
|  71|  71| 			this.ResearchTechnology(key);
|    | [NORMAL] ESLintBear (space-before-function-paren):
|    | Unexpected space before function parentheses.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/TechnologyManager.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/TechnologyManager.js
|  75|  75| };
|  76|  76| 
|  77|  77| // Checks an entity template to see if its technology requirements have been met
|  78|    |-TechnologyManager.prototype.CanProduce = function (templateName)
|    |  78|+TechnologyManager.prototype.CanProduce = function(templateName)
|  79|  79| {
|  80|  80| 	var cmpTempManager = Engine.QueryInterface(SYSTEM_ENTITY, IID_TemplateManager);
|  81|  81| 	var template = cmpTempManager.GetTemplate(templateName);
|    | [NORMAL] ESLintBear (curly):
|    | Unnecessary { after 'if' condition.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/TechnologyManager.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/TechnologyManager.js
| 193| 193| 		var classes = cmpIdentity.GetClassesList();
| 194| 194| 		// don't use foundations for the class counts but check if techs apply (e.g. health increase)
| 195| 195| 		if (!Engine.QueryInterface(msg.entity, IID_Foundation))
| 196|    |-		{
|    | 196|+		
| 197| 197| 			for (let cls of classes)
| 198| 198| 			{
| 199| 199| 				this.classCounts[cls] = this.classCounts[cls] || 0;
| 203| 203| 				this.typeCountsByClass[cls][template] = this.typeCountsByClass[cls][template] || 0;
| 204| 204| 				this.typeCountsByClass[cls][template] += 1;
| 205| 205| 			}
| 206|    |-		}
|    | 206|+		
| 207| 207| 
| 208| 208| 		// Newly created entity, check if any researched techs might apply
| 209| 209| 		// (only do this for new entities because even if an entity is converted or captured,
|    | [NORMAL] ESLintBear (curly):
|    | Unnecessary { after 'if' condition.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/TechnologyManager.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/TechnologyManager.js
| 286| 286| 	}
| 287| 287| 
| 288| 288| 	if (template.replaces && template.replaces.length > 0)
| 289|    |-	{
|    | 289|+	
| 290| 290| 		for (var i of template.replaces)
| 291| 291| 		{
| 292| 292| 			if (!i || this.IsTechnologyResearched(i))
| 304| 304| 					cmpPlayerEntityLimits.UpdateLimitsFromTech(i);
| 305| 305| 			}
| 306| 306| 		}
| 307|    |-	}
|    | 307|+	
| 308| 308| 
| 309| 309| 	this.UpdateAutoResearch();
| 310| 310| 
|    | [NORMAL] ESLintBear (object-curly-spacing):
|    | A space is required after '{'.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/TechnologyManager.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/TechnologyManager.js
| 322| 322| 		cmpPlayerEntityLimits.UpdateLimitsFromTech(tech);
| 323| 323| 
| 324| 324| 	// always send research finished message
| 325|    |-	Engine.PostMessage(this.entity, MT_ResearchFinished, {"player": playerID, "tech": tech});
|    | 325|+	Engine.PostMessage(this.entity, MT_ResearchFinished, { "player": playerID, "tech": tech});
| 326| 326| 
| 327| 327| 	for (var component in modifiedComponents)
| 328| 328| 	{
|    | [NORMAL] ESLintBear (object-curly-spacing):
|    | A space is required before '}'.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/TechnologyManager.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/TechnologyManager.js
| 322| 322| 		cmpPlayerEntityLimits.UpdateLimitsFromTech(tech);
| 323| 323| 
| 324| 324| 	// always send research finished message
| 325|    |-	Engine.PostMessage(this.entity, MT_ResearchFinished, {"player": playerID, "tech": tech});
|    | 325|+	Engine.PostMessage(this.entity, MT_ResearchFinished, {"player": playerID, "tech": tech });
| 326| 326| 
| 327| 327| 	for (var component in modifiedComponents)
| 328| 328| 	{
|    | [NORMAL] ESLintBear (object-curly-spacing):
|    | A space is required before '}'.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/TechnologyManager.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/TechnologyManager.js
| 326| 326| 
| 327| 327| 	for (var component in modifiedComponents)
| 328| 328| 	{
| 329|    |-		Engine.PostMessage(SYSTEM_ENTITY, MT_TemplateModification, { "player": playerID, "component": component, "valueNames": modifiedComponents[component]});
|    | 329|+		Engine.PostMessage(SYSTEM_ENTITY, MT_TemplateModification, { "player": playerID, "component": component, "valueNames": modifiedComponents[component] });
| 330| 330| 		Engine.BroadcastMessage(MT_ValueModification, { "entities": ents, "component": component, "valueNames": modifiedComponents[component]});
| 331| 331| 	}
| 332| 332| 
|    | [NORMAL] ESLintBear (object-curly-spacing):
|    | A space is required before '}'.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/TechnologyManager.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/TechnologyManager.js
| 327| 327| 	for (var component in modifiedComponents)
| 328| 328| 	{
| 329| 329| 		Engine.PostMessage(SYSTEM_ENTITY, MT_TemplateModification, { "player": playerID, "component": component, "valueNames": modifiedComponents[component]});
| 330|    |-		Engine.BroadcastMessage(MT_ValueModification, { "entities": ents, "component": component, "valueNames": modifiedComponents[component]});
|    | 330|+		Engine.BroadcastMessage(MT_ValueModification, { "entities": ents, "component": component, "valueNames": modifiedComponents[component] });
| 331| 331| 	}
| 332| 332| 
| 333| 333| 	if (tech.startsWith("phase") && !template.autoResearch)
|    | [NORMAL] ESLintBear (semi):
|    | Missing semicolon.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/TechnologyManager.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/TechnologyManager.js
| 449| 449|  */
| 450| 450| TechnologyManager.prototype.GetResearcher = function(tech)
| 451| 451| {
| 452|    |-	return this.researchQueued.get(tech)
|    | 452|+	return this.researchQueued.get(tech);
| 453| 453| };
| 454| 454| 
| 455| 455| /**

binaries/data/mods/public/simulation/components/TechnologyManager.js
| 150| »   »   »   switch·(type)
|    | [NORMAL] ESLintBear (default-case):
|    | Expected a default case.

binaries/data/mods/public/simulation/components/TechnologyManager.js
| 165| »   switch·(entity.check)
|    | [NORMAL] ESLintBear (default-case):
|    | Expected a default case.

binaries/data/mods/public/simulation/components/TechnologyManager.js
| 220| ·»   »   »   »   »   if·(DoesModificationApply(modif,·classes))
|    | [NORMAL] ESLintBear (no-mixed-spaces-and-tabs):
|    | Mixed spaces and tabs.

binaries/data/mods/public/simulation/components/TechnologyManager.js
|  68| »   »   »   ||·(tech.top·&&·(this.IsTechnologyResearched(tech.top)·||·this.IsTechnologyResearched(tech.bottom))))
|    | [NORMAL] JSHintBear:
|    | Misleading line break before '||'; readers may interpret this as an expression boundary.

binaries/data/mods/public/simulation/components/TechnologyManager.js
| 229| »   »   »   for·(var·component·in·modifiedComponents)
|    | [NORMAL] JSHintBear:
|    | 'component' is already defined.

binaries/data/mods/public/simulation/components/TechnologyManager.js
| 235| »   »   var·cmpTemplateManager·=·Engine.QueryInterface(SYSTEM_ENTITY,·IID_TemplateManager);
|    | [NORMAL] JSHintBear:
|    | 'cmpTemplateManager' is already defined.

binaries/data/mods/public/simulation/components/TechnologyManager.js
| 236| »   »   var·template·=·cmpTemplateManager.GetCurrentTemplateName(msg.entity);
|    | [NORMAL] JSHintBear:
|    | 'template' is already defined.

binaries/data/mods/public/simulation/components/TechnologyManager.js
| 241| »   »   »   var·cmpIdentity·=·Engine.QueryInterface(msg.entity,·IID_Identity);
|    | [NORMAL] JSHintBear:
|    | 'cmpIdentity' is already defined.

binaries/data/mods/public/simulation/components/TechnologyManager.js
| 244| »   »   »   »   var·classes·=·cmpIdentity.GetClassesList();
|    | [NORMAL] JSHintBear:
|    | 'classes' is already defined.

binaries/data/mods/public/simulation/components/TechnologyManager.js
| 452| »   return·this.researchQueued.get(tech)
|    | [NORMAL] JSHintBear:
|    | Missing semicolon.
|    | [NORMAL] ESLintBear (curly):
|    | Unnecessary { after 'for-of'.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/ai/petra/entityExtend.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/ai/petra/entityExtend.js
| 325| 325| m.getHolder = function(gameState, ent)
| 326| 326| {
| 327| 327| 	for (let holder of gameState.getEntities().values())
| 328|    |-	{
|    | 328|+	
| 329| 329| 		if (holder.isGarrisonHolder() && holder.garrisoned().indexOf(ent.id()) !== -1)
| 330| 330| 			return holder;
| 331|    |-	}
|    | 331|+	
| 332| 332| 	return undefined;
| 333| 333| };
| 334| 334| 
Executing section cli...

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

Stan added a subscriber: Stan.Jun 16 2019, 10:26 PM

I'm not really for this. If anything resource should start with a capital instead.

Freagarach abandoned this revision.Jun 17 2019, 6:58 AM

Forgot this will become obselete when D1938 lands.