Page MenuHomeWildfire Games

Allow Promotion to add arbitrary modifiers when a unit reaches the next rank instead of changing entities
Needs ReviewPublic

Authored by wraitii on Sun, Aug 18, 6:46 PM.
This revision needs review, but there are no reviewers specified.

Details

Reviewers
None
Summary

With D274, Promotion can be made to add modifiers every time a unit gains a "level", instead of promoting to a different entity.
This is great for RPG or tower-defense mods. This allows creating entities that can gain a small amount of HP every time they gain a level, for example.
The system is designed with some flexibility, one can designate "ranges" where modifiers can differ (see tests).

With a bit more work, and a few more details, this could replace the existing Promotion->Entity system entirely, and would allow removing the Advanced and Elite technology hacks.

Test Plan

Check out the briton Hero caratacos, he gains 100 HP when he gains a level. But he can only gain one level for now.

Diff Detail

Repository
rP 0 A.D. Public Repository
Branch
D274_techOverhaul
Lint
Lint OK
Unit
No Unit Test Coverage
Build Status
Buildable 8911
Build 14625: Vulcan BuildJenkins
Build 14624: arc lint + arc unit

Event Timeline

wraitii created this revision.Sun, Aug 18, 6:46 PM

Build failure - The Moirai have given mortals hearts that can endure.

Link to build: https://jenkins.wildfiregames.com/job/docker-differential/416/display/redirect

Stan added a subscriber: Stan.Sun, Aug 18, 7:12 PM

What's the difference between this and a status effect ?

binaries/data/mods/public/simulation/components/Promotion.js
149

Capital.

185

delete ?

In D2188#91103, @Stan wrote:

What's the difference between this and a status effect ?

This deals with "when to add a promotion modifier", and "what to add". I guess the "what" could be a permanent status effect... Needs some thinking.

Nescio added a subscriber: Nescio.Mon, Aug 19, 11:20 AM
Nescio added inline comments.
binaries/data/mods/public/simulation/templates/units/brit_hero_caratacos.xml
11

This sounds great, but wouldn't it be better to follow the template format? E.g.

<Promotion>
  <Whatever from="0" until="1">
    <RequiredXp>10</RequiredXp>
    <Modifiers>
      <Health>
        <Max op="add">100</Max>
      </Health>
    </Modifiers>
  </Whatever>
</Promotion>

Also, I don't understand the necessity of the <Whatever> wrapper.

It could indeed be a permanent status effect.

binaries/data/mods/public/simulation/components/Promotion.js
202

When there is no requiredXP, it does not necesarrily mean XP is not to be added?
There may be scripted use cases (I do not have any yet). So we might consider moving this down to under the addition?

Stan added inline comments.Tue, Sep 10, 5:28 PM
binaries/data/mods/public/simulation/templates/units/brit_hero_caratacos.xml
11

It would be used for different levels

like level1 to level2 etc.

Angen added a subscriber: Angen.Tue, Sep 10, 7:06 PM
Angen added inline comments.
binaries/data/mods/public/simulation/components/Promotion.js
201

!! cheat promote unit is replacing requiredXp with 0, so this is breaking cheats