Agent ApplyBuff Method Delta Engine Documentation

Namespace: CreepyTowers
Assembly: CreepyTowers (in CreepyTowers.exe) Version: 1.1.1.0 (1.1.1)
Syntax

public void ApplyBuff(
	BuffEffect effect
)
Remarks

Tests: CreepyTowers.Tests.AgentTests
Examples

4 unit tests call CreepyTowers.Agent.ApplyBuff(CreepyTowers.Stats.BuffEffect)
[Test]
public void ApplyBuff()
{
    creep.ApplyBuff(new BuffEffect("TestHpBuff"));
    Assert.AreEqual(304.0, creep.GetStatValue("Hp"));
    Assert.AreEqual(100.0, creep.GetStatBaseValue("Hp"));
    Assert.AreEqual(1.0, creep.GetStatPercentage("Hp"));
}
[Test]
public void ReceiveBuffOnAttributeItDoesNotHave()
{
    Assert.DoesNotThrow(() => creep.ApplyBuff(new BuffEffect("DragonRangeMultiplier")));
}
[Test, CloseAfterFirstFrame, Ignore]
public void NotElapsedBuffDoesNotExpire()
{
    creep.ApplyBuff(new BuffEffect("TestGoldBuff"));
    AdvanceTimeAndUpdateEntities(1.0f);
    Assert.AreEqual(23.0f, creep.GetStatValue("Gold"));
}
See Also