Opened 11 years ago

Last modified 11 years ago

#2048 closed enhancement

[PATCH] Implement Auras — at Version 18

Reported by: sanderd17 Owned by:
Priority: Should Have Milestone: Alpha 15
Component: UI & Simulation Keywords: patch
Cc: Patch:

Description (last modified by sanderd17)

I have a patch for Aura implementation.

It works basically as ranged-based technologies. So you can edit every template value you want (at least the ones prepared for technologies).

I also made an AuraManager, basically, that keeps track of all the added bonuses to units in auras. A bit like the TechnologyManager.

The auras themselves can also be changed by technologies (f.e. a technology to enlarge the healing range of a temple). Recalculating all auras isn't a very cheap operation though, so it's best to not change auras too often.

As the changes depend on things needed by the technologyManager, some stuff isn't yet ready to be changeable:

  • Motion speeds can't be changed (at least I've found no way how). They probably aren't updated during the game
  • Automatic heal or damage aura (= negative healing) can't work until the Health/RegenRate is implemented
  • TraderGain isn't implemented yet

I switched the cpp interface to use the same functions as the JS interface. This does require a clean_workspaces, or at least a make clean.

I also changed the templates of a lot of heroes to reflect there aura description

Changed templates:

Temple and Tavern > added heal aura (doesn't work yet, until Health/RegenRate is implemented)

Female support unit > +10% build and gather speed for nearby CitizenSoldiers

HEROES

athen_hero_iphicrates.xml > Added speed and armour bonus to units in its range + 15% extra speed to all peltasts

athen_hero_pericles.xml > +20% building speed for units in his visions. 30% cheaper temples while he lives.

athen_hero_themistocles.xml > moved template to hele_hero_themistocles

brit_hero_boudicca_sword.xml > Aura TBD

brit_hero_boudicca.xml > moved template to celt_hero_boudicca

brit_hero_caratacos.xml > moved template to celt_hero_caratacos

brit_hero_cynvelin.xml > moved template to celt_hero_cynvelin

cart_hero_hamilcar.xml > Aura TBD

cart_hero_hannibal.xml > Aura TBD

cart_hero_maharbal.xml > +2 Attack for units in his aura

celt_hero_boudicca.xml > +5 Hack/Pierce attack and +15 speed for champions

celt_hero_brennus.xml > +5 loot (NOT IMPLEMENTED) would require changes in the Looter component

celt_hero_britomartus.xml > +50% gathering speed during his lifetime

celt_hero_caratacos.xml > +25% speed for units in his formation (doesn't work yet)

celt_hero_cynvelin.xml > Adds 0.5 to the RegenRate of nearby units (droped the idle requirement)

celt_hero_vercingetorix.xml > add 2 attack for units in his range

gaul_hero_brennus.xml > moved template to celt_hero_brennus

gaul_hero_britomartus.xml > moved template to celt_hero_britomanus

gaul_hero_vercingetorix.xml > moved template to celt_hero_vercingetorix

hele_hero_alexander.xml > "Imperialism" Bonus (+25% territory effect for all buildings while he lives.)

hele_hero_demetrius.xml > "Poliorkḗtēs" Aura (+5 Hack/Pierce/Crush attack and +10m range increase for sieges during his lifetime.)

hele_hero_leonidas.xml > +3 Hack attack for spear infantry. +1 armor level for spear infantry.

hele_hero_philip.xml > +3 Hack/Pierce/Crush attack for champion units

hele_hero_themistocles.xml > Ships are build 20% faster, and the ship he's garrisoned in moves 50% faster

hele_hero_xenophon.xml > Added +2 armour and +15% speed to units in his formation. And extra +15% speed to all peltasts

iber_hero_caros.xml > Aura TBD

iber_hero_indibil.xml > Aura TBD iber_hero_variato.xml > Aura TBD

mace_hero_alexander.xml > moved template to hele_hero_alexander + 25% extra territory

mace_hero_craterus.xml > moved template to hele_hero_craterus

mace_hero_demetrius.xml > moved template to hele_hero_demetrius

mace_hero_philip.xml > moved template to hele_hero_philip

maur_hero_ashoka.xml > Aura TBD

maur_hero_chanakya.xml > Aura TBD

maur_hero_maurya.xml > Aura TBD

pers_hero_cyrus.xml > Add +3 Hack/Crush/Pierce attack to nearby cavalry

pers_hero_darius.xml > Increase movement speed of infantry with 25%. +50% Trading gain bonus (not implemented in Trader.js yet)

pers_hero_xerxes_chariot.xml > +25% gather and build speed for units nearby

pers_hero_xerxes.xml > +25% gather and build speed for units nearby

rome_hero_marcellus.xml > Infantry have +20% greater attack within his aura.

rome_hero_maximus.xml > Nearby units +3 armor, all types.

rome_hero_scipio.xml > "Divide et Impera" Special (He has the ability to convert enemy units en masse at a great cost of metal).

spart_hero_agis.xml > "Last Stand" bonus. Has triple the Health of most infantry heroes. No other bonuses or auras.

spart_hero_brasidas.xml > +2 pierce attack and +3 pierce armour for nearby skirmishers

spart_hero_leonidas.xml > moved template to hele_hero_leonidas

Change History (19)

comment:1 by sanderd17, 11 years ago

Description: modified (diff)

comment:2 by sanderd17, 11 years ago

Added support for templates, although it doesn't work completely yet.

comment:3 by sanderd17, 11 years ago

Description: modified (diff)

comment:4 by sanderd17, 11 years ago

Description: modified (diff)

comment:5 by sanderd17, 11 years ago

Implemented the "don't stack auras" (i.e. don't apply the same aura twice).

comment:6 by sanderd17, 11 years ago

Added some code to chose for "Formation" or "InfiniteRadius" instead of giving a fixed radius.

The only problem is that a formation only exists as long as the units are walking. So it's rather useless for stuff that has something to do with attack values. As it disappears the moment they start to attack. But it can give extra armour/health/speed to a group of walking units.

comment:7 by sanderd17, 11 years ago

Solved some bugs with destroyed entities (now making sure the bonus is removed).

comment:8 by sanderd17, 11 years ago

I think we're getting there. Now you can choose between

  • Radius auras - apply on the chosen units in a radius around the entity with an aura
  • Template auras - apply on all chosen units and on templates
  • Formation auras - apply on all units inside the formation of the entity with an aura
  • Garrison auras - apply on the chosen structure an entity with an aura is in

All auras are also only applied once thanks to key-checking.

comment:9 by sanderd17, 11 years ago

Description: modified (diff)

comment:10 by sanderd17, 11 years ago

Description: modified (diff)

comment:11 by sanderd17, 11 years ago

Description: modified (diff)
Keywords: review added
Summary: [PATCH][WIP] Implement Auras[PATCH] Implement Auras

comment:12 by sanderd17, 11 years ago

Description: modified (diff)
Keywords: review removed

comment:13 by sanderd17, 11 years ago

Description: modified (diff)

comment:14 by sanderd17, 11 years ago

Description: modified (diff)

comment:15 by michael, 11 years ago

Description: modified (diff)

comment:16 by michael, 11 years ago

Changed some of the descriptions. Added the Roman hero bonuses.

I don't like how the Athenian, Spartan, Macedonian, Briton, and Gallic heroes don't have their own code and "inherit" from the hele_ and celt_ templates instead. Why are you doing this?

in reply to:  16 comment:17 by sanderd17, 11 years ago

Replying to michael:

I don't like how the Athenian, Spartan, Macedonian, Briton, and Gallic heroes don't have their own code and "inherit" from the hele_ and celt_ templates instead. Why are you doing this?

Well, from the "less is more" principle. If large parts are the same, there's no need to maintain them both. It's enough to maintain one, and let the other inherit from the first. If you want them to be different in some stats anyway, you can use the same inheritance to overwrite the different parts.

Maintaining 12 extra templates was a fair bit of work added.

comment:18 by sanderd17, 11 years ago

Description: modified (diff)

by sanderd17, 11 years ago

Attachment: auras_cpp.diff added
Note: See TracTickets for help on using tickets.