The Glest Wiki
(Rewording, since it's broken in an unreleased version)
 
(5 intermediate revisions by one other user not shown)
Line 10: Line 10:
 
<effects>
 
<effects>
 
<effect name="effect_name" bias="detrimental" stacking="overwrite" target="any" chance="100.0" duration="8" image="images/icon.bmp" damage-type="piercing">
 
<effect name="effect_name" bias="detrimental" stacking="overwrite" target="any" chance="100.0" duration="8" image="images/icon.bmp" damage-type="piercing">
  +
<affect value="tag" />
 
<static-modifiers>
 
<static-modifiers>
 
<hp-regeneration value="-50"/>
 
<hp-regeneration value="-50"/>
Line 24: Line 25:
 
==Elements==
 
==Elements==
 
===effect===
 
===effect===
There is one effect tag per individual effect on the attack (if multiple are added), all which are children of the main effects tag. There are a number of attributes, with the name, bias, stacking, and duration being required, and the rest being optional.
+
There is one effect tag per individual effect on the attack (if multiple are added), all which are children of the main effects tag. There are a number of attributes, with the name, bias, stacking, and duration being required, and the rest being optional. Having multiple effect tags to allow an attack to have more than one effect, though they must have unique names.
   
 
{| class="wikitable"
 
{| class="wikitable"
Line 33: Line 34:
 
| name
 
| name
 
| '''required'''
 
| '''required'''
| Name of the effect.
+
| ''Unique'' name of the effect.
 
|-
 
|-
 
| image
 
| image
Line 63: Line 64:
 
| When hp-regeneration is negative, this value (if present) is used to determine the appropriate multiplier to use for the target's armor. This is the data specified in <damage-multipliers> section of the techtree.xml file.
 
| When hp-regeneration is negative, this value (if present) is used to determine the appropriate multiplier to use for the target's armor. This is the data specified in <damage-multipliers> section of the techtree.xml file.
 
|}
 
|}
  +
  +
===affect===
  +
If limiting the effect to units with certain tags, simply specify the tag here. If not limiting, exclude this entire element. The value is the name of the tag to limit to.
   
 
===static-modifiers===
 
===static-modifiers===
Line 74: Line 78:
 
|Modifies the maximum HP.
 
|Modifies the maximum HP.
 
|-
 
|-
|&lt;hp-regen&gt;
+
|&lt;hp-regeneration&gt;
 
|Modifies the HP regeneration rate.
 
|Modifies the HP regeneration rate.
 
|-
 
|-
Line 80: Line 84:
 
|Modifies the maximum EP.
 
|Modifies the maximum EP.
 
|-
 
|-
|&lt;ep-regen&gt;
+
|&lt;ep-regeneration&gt;
 
|Modifies the EP regeneration rate.
 
|Modifies the EP regeneration rate.
 
|-
 
|-
Line 124: Line 128:
 
! Description
 
! Description
 
|-
 
|-
| &lt;effects-ally&gt;
+
| &lt;effects-ally /&gt;
 
| Will effect allies. This is also turned on when target="allies" or "both".
 
| Will effect allies. This is also turned on when target="allies" or "both".
 
|-
 
|-
| &lt;effects-foes&gt;
+
| &lt;effects-foes /&gt;
 
| Will effect allies. This is also turned on when target="foes" or "both".
 
| Will effect allies. This is also turned on when target="foes" or "both".
 
|-
 
|-
| &lt;not-effects-normal-units&gt;
+
| &lt;pets-only /&gt;
| Will not effect normal units (i.e., not buildings). By default, normal units are effected and buildings aren't.
 
|-
 
| &lt;buildings&gt;
 
| Will effect buildings. By default, buildings are not effected. (currently broken in the git-master)
 
|-
 
| &lt;pets-only&gt;
 
 
| Will only effect the pets of the caster. This causes effects-ally, effects-foes, not-effects-normal-units and effects-buildings to be ignored.
 
| Will only effect the pets of the caster. This causes effects-ally, effects-foes, not-effects-normal-units and effects-buildings to be ignored.
 
|-
 
|-
| &lt;master-only&gt;
+
| &lt;master-only /&gt;
 
| Will only effect the master of the caster (eg, the pet is the caster). This causes effects-ally, effects-foes, not-effects-normal-units and effects-buildings to be ignored.
 
| Will only effect the master of the caster (eg, the pet is the caster). This causes effects-ally, effects-foes, not-effects-normal-units and effects-buildings to be ignored.
 
|-
 
|-
| &lt;scale-splash-strength&gt;
+
| &lt;scale-splash-strength /&gt;
| Scale the strength of the effect with the same formula used to determine splash damage, which is <tt>1.0 / (distance_from_target + 1)</tt>. The further from the apex of the target, the weaker the effect will be. By default, all units within the splash radius of a skill with an effect are effected equally.
+
| Scale the strength of the effect with the same formula used to determine splash damage. The further from the apex of the target, the weaker the effect will be. By default, all units within the splash radius of a skill with an effect are effected equally. The formula used is: <math>\frac{1}{\left(\text{Distance from target} + 1\right)}</math>
 
|-
 
|-
| &lt;ends-with-source&gt;
+
| &lt;ends-with-source /&gt;
 
| The effect will end if the unit who caused the effect dies.
 
| The effect will end if the unit who caused the effect dies.
 
|-
 
|-
| &lt;recourse-ends-with-root&gt;
+
| &lt;recourse-ends-with-root /&gt;
 
| Causes the recourse effect to end when the root (primary) effect ends, regardless the duration. Applies only to recourse effects.
 
| Causes the recourse effect to end when the root (primary) effect ends, regardless the duration. Applies only to recourse effects.
 
|-
 
|-
| &lt;allow-negative-speed&gt;
+
| &lt;allow-negative-speed /&gt;
 
| Adding negative values to the static-modifiers for move-speed can cause a unit to travel away from their destination, although they are facing their destination. While this is probably undesirable, this flag will allow it to happen anyway. The default behavior brings the unit's effective speed to zero if it would otherwise become negative.
 
| Adding negative values to the static-modifiers for move-speed can cause a unit to travel away from their destination, although they are facing their destination. While this is probably undesirable, this flag will allow it to happen anyway. The default behavior brings the unit's effective speed to zero if it would otherwise become negative.
 
|-
 
|-
| &lt;tick-immediately&gt;
+
| &lt;tick-immediately /&gt;
 
| Causes HP and EP regeneration to take immediate effect as if tick() had been called. This can be used for effects that should immediately heal or damage units and is mostly useful for zero duration effects, causing it to take immediate effect and then terminate. Using this flag with a zero duration will render all other modifiers in the effect, other than HP & EP regeneration to become useless although sound and particle effects will still be played/rendered.
 
| Causes HP and EP regeneration to take immediate effect as if tick() had been called. This can be used for effects that should immediately heal or damage units and is mostly useful for zero duration effects, causing it to take immediate effect and then terminate. Using this flag with a zero duration will render all other modifiers in the effect, other than HP & EP regeneration to become useless although sound and particle effects will still be played/rendered.
 
|-
 
|-
| &lt;permanent&gt;
+
| &lt;permanent /&gt;
 
| The effect has an infinite duration.
 
| The effect has an infinite duration.
 
|}
 
|}
Line 268: Line 266:
 
*[[GAE/Features|GAE Feature list]]
 
*[[GAE/Features|GAE Feature list]]
 
[[Category:GAE]]
 
[[Category:GAE]]
  +
[[Category:Detailed feature pages]]

Latest revision as of 18:34, 2 March 2012

Effects are added bonuses that can be added to attacks, allowing the unit to cause an extra effect with an attack. For example, it may "poison" the opponent and slowly drain their HP, or you could slow a unit by reducing its move speed, etc.

Usage[]

Effects are embedded in the <skill> tag of the unit's XML. At this time, only attack skills and emanations (described in the next section) are supported, but a new "cast spell" skill type will be later added to allow effects to be put on friendly units.

XML definition[]

More XML elements are planned, but are not yet implemented and thus, excluded from this page.

<effects>
	<effect name="effect_name" bias="detrimental" stacking="overwrite" target="any" chance="100.0" duration="8" image="images/icon.bmp" damage-type="piercing">
		<affect value="tag" />
		<static-modifiers>
			<hp-regeneration value="-50"/>
		</static-modifiers>
		<multipliers>
			<sight value="0.2"/>
		</multipliers>
		<flags/>
		<recourse-effects/>
	</effect>
</effects>

Elements[]

effect[]

There is one effect tag per individual effect on the attack (if multiple are added), all which are children of the main effects tag. There are a number of attributes, with the name, bias, stacking, and duration being required, and the rest being optional. Having multiple effect tags to allow an attack to have more than one effect, though they must have unique names.

Attribute Required? Description
name required Unique name of the effect.
image optional Path to an image used to display the effect (image not yet implimented, but effect name is).
bias required Primarily used by AI and must be either detrimental, neutral or beneficial.
stacking required Defines behavior when an additional effect of the same type hits the unit. Must be one of stack (the new effect is added in addition to the old one), extend (the duration of the original effect is extended), overwrite (the old effect is replaced with the new effect) or reject (the new effect is ignored).
target optional What units are affected by the effect. Must be one of ally, foe, pet, master or all. Default value is all.
chance optional The percent chance that the effect will be applied to the target. The default is 100%.
duration required The number of seconds the effect will last. Ignored if the flag "permanent" is specified.
damage-type optional When hp-regeneration is negative, this value (if present) is used to determine the appropriate multiplier to use for the target's armor. This is the data specified in <damage-multipliers> section of the techtree.xml file.

affect[]

If limiting the effect to units with certain tags, simply specify the tag here. If not limiting, exclude this entire element. The value is the name of the tag to limit to.

static-modifiers[]

Static multipliers increase or decrease stats by a set amount. All child tags will have a value attribute which denotes how much it should be increased or decreased by.

Value Description
<max-hp> Modifies the maximum HP.
<hp-regeneration> Modifies the HP regeneration rate.
<max-ep> Modifies the maximum EP.
<ep-regeneration> Modifies the EP regeneration rate.
<sight> Modifies the unit's sight.
<armor> Modifies the unit's armor strength.
<attack-strength> Modifies the unit's attack strength.
<attack-range> Modifies the unit's attack ragen.
<attack-speed> Modifies the unit's attack speed.
<move-speed> Modifies the speed the unit moves at.
<production-speed> Modifies the production speed (speed of creating units or morphing).
<repair-speed> Modifies the speed of the repair skill.
<harvest-speed> Modifies the speed of the harvest skill.
<effect-strength> Modifies the strength of effects.

multipliers[]

Similar to static modifiers above, and using the same children nodes, multipliers instead multiply the stat by their amount, with the default being 1. So if a multiplier is 2, they'll have that stat double, if it's 0.5, it'll be halved, and so forth.

flags[]

Flags effect various aspects of the "effect". Each nested element has no attributes or children.

Element Description
<effects-ally /> Will effect allies. This is also turned on when target="allies" or "both".
<effects-foes /> Will effect allies. This is also turned on when target="foes" or "both".
<pets-only /> Will only effect the pets of the caster. This causes effects-ally, effects-foes, not-effects-normal-units and effects-buildings to be ignored.
<master-only /> Will only effect the master of the caster (eg, the pet is the caster). This causes effects-ally, effects-foes, not-effects-normal-units and effects-buildings to be ignored.
<scale-splash-strength /> Scale the strength of the effect with the same formula used to determine splash damage. The further from the apex of the target, the weaker the effect will be. By default, all units within the splash radius of a skill with an effect are effected equally. The formula used is:
<ends-with-source /> The effect will end if the unit who caused the effect dies.
<recourse-ends-with-root /> Causes the recourse effect to end when the root (primary) effect ends, regardless the duration. Applies only to recourse effects.
<allow-negative-speed /> Adding negative values to the static-modifiers for move-speed can cause a unit to travel away from their destination, although they are facing their destination. While this is probably undesirable, this flag will allow it to happen anyway. The default behavior brings the unit's effective speed to zero if it would otherwise become negative.
<tick-immediately /> Causes HP and EP regeneration to take immediate effect as if tick() had been called. This can be used for effects that should immediately heal or damage units and is mostly useful for zero duration effects, causing it to take immediate effect and then terminate. Using this flag with a zero duration will render all other modifiers in the effect, other than HP & EP regeneration to become useless although sound and particle effects will still be played/rendered.
<permanent /> The effect has an infinite duration.

recourse-effects[]

Recourse effects are an entirely new effect that is added inside of the effect to modify the user. For example, you could have an EP draining attack that would give the foe negative EP regeneration while giving the attacking unit a positive EP regeneration.

Examples[]

Archer example[]

The below is an example of an extended attack of the archer adding a poison to the arrows which causes blindness and 50 damage per second for 8 seconds. Note that the only part of this snippet that is modified from the original is the addition of the <effects> tag.

<skill>
	<type value="attack"/>
	<name value="attack_skill"/>
	<ep-cost value="0"/>
	<speed value="50"/>
	<anim-speed value="50"/>
	<animation path="models/archer_attacking.g3d"/>
	<sound enabled="true" start-time="0.5">
		<sound-file path="sounds/archer_attack1.wav"/>
		<sound-file path="sounds/archer_attack2.wav"/>
		<sound-file path="sounds/archer_attack3.wav"/>
		<sound-file path="sounds/archer_attack4.wav"/>
	</sound>
	<attack-strenght value="100"/>
	<attack-var value="50"/>
	<attack-range value="10"/>
	<attack-type value="piercing"/>
	<attack-start-time value="0.5"/>
	<attack-fields>
		<field value="land"/>
		<field value="air"/>
	</attack-fields>
	<projectile value="true">
		<particle value="true" path="particle_proj.xml"/>
		<sound enabled="true">
			<sound-file path="sounds/arrow_hit1.wav"/>
			<sound-file path="sounds/arrow_hit2.wav"/>
			<sound-file path="sounds/arrow_hit3.wav"/>
			<sound-file path="sounds/arrow_hit4.wav"/>
			<sound-file path="sounds/arrow_hit5.wav"/>
		</sound>
	</projectile>
	<splash value="false"/>
	<effects>
		<effect name="blinding_poison" bias="detrimental" stacking="overwrite" target="any" chance="100.0" duration="8" image="../../../../placeholders/icon.bmp">
			<static-modifiers>
				<hp-regeneration value="-50"/>
			</static-modifiers>
			<multipliers>
				<sight value="0.2"/>
			</multipliers>
			<flags/>
			<recourse-effects/>
		</effect>
	</effects>
</skill>

By using the multiplier of 0.2 for sight, their sight is reduced to 20% of normal. Reducing it further may result in a sight of zero, which would make them incapable of attacking even targets directly adjacent to them.

Archmage example[]

Effects can be used on attacks with a splash effect as well, this will cause all units in the splash radius to be effected. By default, all units are effected equally, even if they are on the very edge of the splash radius. However, by adding the flag <scale-splash-strength> to the <flags> section of the effect, this behavior can be overridden causing the strength of the effect to be weaker on units further from the point of impact. The strength of the effect isn't exposed through the XML interface, but it effects all attribute modifications (both positive and negative). Below is an example a theoretical effect added to the ice attack of an archmage. Presuming that the ice is cold, let's say that this will temporarily reduce the movement and attack speed of the target. However, the effect will be relative to where they in the splash radius.

<effects>
	<effect name="icy_chill" bias="detrimental" stacking="stack" target="all" chance="100.0" duration="8">
		<static-modifiers>
			<attack-speed value="-25"/>
			<move-speed value="-30"/>
		</static-modifiers>
		<multipliers>
			<sight value="0.0"/>
		</multipliers>
		<flags>
			<scale-splash-strength/>
		</flags>
	</effect>
</effects>

You may have noticed that the "stacking" attribute of the effect tag was set to "stack" this time instead of "overwrite". This means that successive attacks which cause this effect will accumulate, increasing the total effect. Each instance of the effect has it's own timer, so they will wear off one at a time. When set to "overwrite", the previous effect is simply overwritten and the duration reset. This isn't recommended for use with apply-splash-strength however because a second effect may be weaker and overwrite a stronger one.

Initiate example[]

This example illustrates the use of a recourse effect, which will effect the user, in this case, regenerating HP and making them faster.

<effect name="burning_bastard" bias="detrimental" stacking="stack" target="any" chance="100.0" duration="8">
	<static-modifiers>
		<hp-regeneration value="-25"/>
	</static-modifiers>
	<multipliers>
		<movement-speed value="2.0"/>
	</multipliers>
	<recourse-effects>
		<effect name="pyromania" bias="beneficial" stacking="stack" target="any" chance="100.0" duration="8">
			<static-modifiers>
				<ep-regeneration value="25"/>
			</static-modifiers>
			<multipliers>
				<movement-speed value="2.0"/>
			</multipliers>
		</effect>
	</recourse-effects>
</effect>

See also[]