Opened 10 years ago

Last modified 9 years ago

#2620 closed task

Define "Advanced" and "Elite" bonuses as technologies — at Version 2

Reported by: sanderd17 Owned by:
Priority: Should Have Milestone: Alpha 19
Component: UI & Simulation Keywords:
Cc: alpha123, scythetwirler Patch:

Description (last modified by sanderd17)

Currently, Soldiers have a template where they're based on (like template_unit_infantry_ranged_javelinist.xml for units/athen_infantry_jevelinist_b.xml).

But all CitizenSoldiers have a Basic version, an Advanced and an Elite. Those always redefine a whole lot of the stats.

Every Advanced unit has -25% gather speed for example. But if you want to buff or nerf that, you have to edit over 100 files.

Also, sometimes, only the base template is edited, and Elite or Advanced units end up with worse stats than their Basic versions.

Basically, there should be a few global technologies that add modify stats of Advanced and Elite units. So the Advanced and Elite templates would be pretty much empty, apart from the Identity component (to overwrite the rank), the Promotion component (to overwrite the next upgrade) and the visual actor.

So we only have to edit those 200-ish files once, and be done with it.

The technologies would be quite simple, like

{
	"genericName": "Advanced stats",
	"autoResearch": true,
	"description": "Modifications for the advanced units",
	"modifications": [
		{"value": "Health/Max", "add": 10},
                {"value": "Attack/Ranged/MaxRange", "multiply": 1.1},
		{"value": "ResourceGather/BaseSpeed", "multiply": 0.75},
                ...
	],
	"affects": ["Advanced Unit"]
}

As for modifying the files, a simple script would do. For every file ending in *_a.xml and *_e.xml, remove every line that doesn't contain

xml, Entity, Identity, Rank, Promotion, Actor

So as a oneliner (should be checked for corectness):

find *_[ae].xml -type f -exec sed -i '/xml\|Entity\|Identity\|Rank\|Promotion\|Actor/!d' {} \;

Change History (2)

comment:1 by sanderd17, 10 years ago

Type: defecttask

comment:2 by sanderd17, 10 years ago

Description: modified (diff)
Note: See TracTickets for help on using tickets.