1
0
forked from 0ad/0ad

brit + cart hero auras + small code fixes

This was SVN commit r14246.
This commit is contained in:
sanderd17 2013-11-29 10:57:44 +00:00
parent d403545620
commit ca9944b09c
12 changed files with 69 additions and 20 deletions

View File

@ -155,11 +155,9 @@ Auras.prototype.Clean = function()
if (!affectedPlayers.length)
continue;
if (this.IsGlobalAura(name))
this.ApplyTemplateBonus(name, affectedPlayers);
if (!this.IsRangeAura(name))
continue;
this[name].rangeQuery = cmpRangeManager.CreateActiveQuery(
this.entity,
0,
@ -169,8 +167,14 @@ Auras.prototype.Clean = function()
cmpRangeManager.GetEntityFlagMask("normal")
);
cmpRangeManager.EnableActiveQuery(this[name].rangeQuery);
// Add self to your own query for consistency with templates.
this.OnRangeUpdate({"tag":this[name].rangeQuery, "added":[this.entity], "removed":[]});
if (this.IsGlobalAura(name))
{
// update stats in for all templates
this.ApplyTemplateBonus(name, affectedPlayers);
// Add self to your own query for consistency with templates.
this.OnRangeUpdate({"tag":this[name].rangeQuery, "added":[this.entity], "removed":[]});
}
}
};

View File

@ -44,7 +44,7 @@ Health.prototype.Init = function()
// Default to <Initial>, but use <Max> if it's undefined or zero
// (Allowing 0 initial HP would break our death detection code)
this.hitpoints = +(this.template.Initial || this.GetMaxHitpoints());
this.regenRate = +this.template.RegenRate;
this.regenRate = ApplyValueModificationsToEntity("Health/RegenRate", +this.template.RegenRate, this.entity);
this.CheckRegenTimer();
};
@ -131,7 +131,7 @@ Health.prototype.CheckRegenTimer = function()
return;
}
// we need a timer, enable is one doesn't exist
// we need a timer, enable if one doesn't exist
if (this.regenTimer)
return;
@ -344,9 +344,6 @@ Health.prototype.OnValueModification = function(msg)
var oldRegenRate = this.regenRate;
this.regenRate = ApplyValueModificationsToEntity("Health/RegenRate", +this.template.RegenRate, this.entity);
if (this.IsUnhealable())
this.regenRate = Math.min(0,this.regenRate);
if (this.regenRate != oldRegenRate)
this.CheckRegenTimer();
};

View File

@ -0,0 +1,5 @@
{
"affects":["Champion"],
"affectedPlayers":["Player"],
"modifications":[{"value":"Attack/Ranged/Pierce","add":5},{"value":"Attack/Melee/Hack","add":5}]
}

View File

@ -0,0 +1,5 @@
{
"affects":["Champion"],
"affectedPlayers":["Player"],
"modifications":[{"value":"UnitMotion/WalkSpeed","multiply":1.25}]
}

View File

@ -1,5 +0,0 @@
{
"affects":["Ship"],
"affectedPlayers":["Player","MutualAlly"],
"modifications":[{"value":"UnitMotion/WalkSpeed","multiply":1.5}]
}

View File

@ -0,0 +1,5 @@
{
"affects":["Unit"],
"affectedPlayers":["Ally"],
"modifications":[{"value":"Attack/Ranged/Pierce","add":2},{"value":"Attack/Melee/Hack","add":2}]
}

View File

@ -1,5 +1,13 @@
<?xml version="1.0" encoding="utf-8"?>
<Entity parent="template_unit_hero_cavalry_javelinist">
<Auras>
<champion_speed_25>
<Type>global</Type>
</champion_speed_25>
<champion_attack_5>
<Type>global</Type>
</champion_attack_5>
</Auras>
<Armour>
<Hack>7</Hack>
<Pierce>7</Pierce>
@ -22,7 +30,7 @@
<Civ>brit</Civ>
<Classes datatype="tokens">Chariot</Classes>
<SpecificName>Boudicca</SpecificName>
<Tooltip>Hero Aura: Increased Attack and Speed for Champion Units.</Tooltip>
<Tooltip>Hero Aura: +5 Attack and +25% Speed for Champion Units.</Tooltip>
<History>Ammianus Marcellinus described how difficult it would be for a band of foreigners to deal with a Celt if he called in the help of his wife. For she was stronger than he was and could rain blows and kicks upon the assailants equal in force to the shots of a catapult. Boudicca, queen of the Iceni, was said to be 'very tall and terrifying in appearance; her voice was very harsh and a great mass of red hair fell over her shoulders. She wore a tunic of many colors over which a thick cloak was fastened by a brooch.</History>
<Icon>units/celt_hero_boudicca.png</Icon>
</Identity>

View File

@ -1,5 +1,13 @@
<?xml version="1.0" encoding="utf-8"?>
<Entity parent="template_unit_hero_infantry_swordsman">
<Auras>
<champion_speed_25>
<Type>global</Type>
</champion_speed_25>
<champion_attack_5>
<Type>global</Type>
</champion_attack_5>
</Auras>
<Armour>
<Hack>5</Hack>
<Pierce>6</Pierce>
@ -9,7 +17,7 @@
<Civ>brit</Civ>
<SpecificName>Boudicca</SpecificName>
<GenericName>Heroine</GenericName>
<Tooltip>Hero Aura: TBD.</Tooltip>
<Tooltip>Hero Aura: +5 Attack and +25% Speed for Champion units.</Tooltip>
<History>.</History>
<Icon>units/celt_hero_boudicca.png</Icon>
</Identity>

View File

@ -1,5 +1,10 @@
<?xml version="1.0" encoding="utf-8"?>
<Entity parent="template_unit_hero_infantry_swordsman">
<Auras>
<unit_speed_15>
<Type>global</Type>
</unit_speed_15>
</Auras>
<Armour>
<Hack>6</Hack>
<Pierce>6</Pierce>
@ -16,7 +21,7 @@
<Identity>
<Civ>brit</Civ>
<SpecificName>Caratacos</SpecificName>
<Tooltip>Hero Aura: Increased Speed for all units during his lifetime.</Tooltip>
<Tooltip>Hero Aura: +15% Speed for all units during his lifetime.</Tooltip>
<History>Caratacos's name is better known in its Romanized form, Caratacus. Under this name he is remembered as a fierce defender of Britain against the Romans after their invasion in 43 AD. Son of King Cynvelin of the Catuvellauni tribe, Caratacos fought for nine years against the Romans with little success, eventually fleeing to the tribes in Wales, where he was defeated decisively. Finally he entered Northern Britain, where was handed over to the Romans. Taken to Rome, Caratacos was allowed to live by the Emperor Claudius and died in Italy.</History>
<Icon>units/celt_hero_caratacos.png</Icon>
</Identity>

View File

@ -1,12 +1,18 @@
<?xml version="1.0" encoding="utf-8"?>
<Entity parent="template_unit_hero_cavalry_swordsman">
<Auras>
<heal>
<Type>range</Type>
<Radius>60</Radius>
</heal>
</Auras>
<Armour>
<Hack>10</Hack>
</Armour>
<Identity>
<Civ>brit</Civ>
<SpecificName>Cynvelin</SpecificName>
<Tooltip>Hero Aura: Has a large and powerful Healing Aura, only useful when idle.</Tooltip>
<Tooltip>Hero Aura: Has a large and powerful Healing Aura.</Tooltip>
<History>Cynvelin was a powerful ruler centered in the territory around modern day London. Ruling the Catuvellauni from Camulodunum, he was a warrior king who conquered a neighboring tribe and was referred to by the Romans as the King of the Britons. Eventually Cynvelin retired to become the arch-druid of Siluria, but was taken to Rome with his son upon Caratacos's capture. According to legend, the Apostle Paul baptized Cynvelin into Christianity before he died in Italy.</History>
<Icon>units/celt_hero_cynvelin.png</Icon>
</Identity>

View File

@ -1,5 +1,10 @@
<?xml version="1.0" encoding="utf-8"?>
<Entity parent="template_unit_hero_cavalry_swordsman">
<Auras>
<unit_speed_15>
<Type>global</Type>
</unit_speed_15>
</Auras>
<Identity>
<Civ>cart</Civ>
<SpecificName>Ḥimelqart Baraq</SpecificName>

View File

@ -1,5 +1,11 @@
<?xml version="1.0" encoding="utf-8"?>
<Entity parent="template_unit_hero_elephant_melee">
<Auras>
<unit_attack_2>
<Type>range</Type>
<Radius>60</Radius>
</unit_attack_2>
</Auras>
<Identity>
<Civ>cart</Civ>
<GenericName>Hannibal Barca</GenericName>
@ -7,7 +13,7 @@
<History>Carthage's most famous son. Hannibal Barca was the eldest son of Hamilcar Barca and proved an even greater commander than his father. Lived 247-182 BC. While he ultimately lost the Second Punic War, his victories at Trebia, Lake Trasimene, and Cannae, and the feat of crossing the Alps have secured his position as among the best tacticians and strategists in history.</History>
<Icon>units/cart_hero_hannibal.png</Icon>
<Tooltip>Classes: Hero Melee Elephant.
"Tactician" Aura: All allied units +15% attack within vision range of him.
"Tactician" Aura: All allied units +2 attack within vision range of him.
"Strategist" Ability: The player can see changes within the fog of war while Hannibal lives.
Counters: 2x vs. All Cavalry, 1.5x vs. All Structures. Extra 1.5x vs. Gates.
Countered by: Skirmishers and Swordsmen. Can run amok.</Tooltip>