PiggyBank ClassDelta Engine Documentation
Piggy Bank is all about the gold. Special abilities are: Greed: Amount of gold earned for killing a creep is increased Payday: Creeps drop extra gold Coins Rain: Collectable coins fall on the grid over a short period, doing damage View code on GitHub
Inheritance Hierarchy

System Object
  DeltaEngine.Entities Entity
    CreepyTowers.Avatars Avatar
      CreepyTowers.Avatars PiggyBank

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

public class PiggyBank : Avatar

The PiggyBank type exposes the following members.

Constructors

  NameDescription
Public methodPiggyBank
Initializes a new instance of the PiggyBank class
Top
Methods

  NameDescription
Public methodAdd T  (Inherited from Entity.)
Public methodAddTag (Inherited from Entity.)
Public methodClearTags (Inherited from Entity.)
Public methodContains T  (Inherited from Entity.)
Public methodContainsBehavior T  (Inherited from Entity.)
Public methodContainsTag (Inherited from Entity.)
Protected methodDeactivate (Inherited from Entity.)
Public methodDispose (Inherited from Entity.)
Public methodGet T 
Gets a specific component, derived classes can return faster cached values (e.g. Entity2D) View code on GitHub
(Inherited from Entity.)
Protected methodGetActiveBehaviors (Inherited from Entity.)
Protected methodGetComponentsForSaving (Inherited from Entity.)
Public methodGetOrDefault T  (Inherited from Entity.)
Public methodGetTags (Inherited from Entity.)
Public methodPerformAttack (Overrides Avatar PerformAttack(AvatarAttack, Vector2D).)
Public methodRemove T  (Inherited from Entity.)
Public methodRemoveTag (Inherited from Entity.)
Public methodReset (Inherited from Avatar.)
Public methodSet (Inherited from Entity.)
Public methodSetComponents (Inherited from Entity.)
Public methodStart T  (Inherited from Entity.)
Public methodStop T  (Inherited from Entity.)
Public methodToString (Inherited from Entity.)
Top
Fields

  NameDescription
Protected fieldcomponents (Inherited from Entity.)
Top
Properties

  NameDescription
Public propertyActivatedSpecialAttack (Inherited from Avatar.)
Public propertyAttackFrequencyMultiplier (Inherited from Avatar.)
Public propertyIsActive (Inherited from Entity.)
Public propertyIsLocked (Inherited from Avatar.)
Public propertyIsPauseable (Inherited from Entity.)
Public propertyIsSelected (Inherited from Avatar.)
Public propertyNumberOfComponents (Inherited from Entity.)
Public propertyPowerMultiplier (Inherited from Avatar.)
Public propertyProgressLevel (Inherited from Avatar.)
Public propertyRangeMultiplier (Inherited from Avatar.)
Public propertySpecialAttackAIsActivated (Inherited from Avatar.)
Public propertySpecialAttackBIsActivated (Inherited from Avatar.)
Public propertyUpdatePriority (Inherited from Entity.)
Public propertyXp (Inherited from Avatar.)
Top
Remarks

Tests: CreepyTowers.Tests.Avatars.PiggyBankTests
Examples

3 unit tests call CreepyTowers.Avatars.PiggyBank
[Test]
public void SpawnCoinMinefield()
{
    Assert.AreEqual(5, coins.Count);
    Assert.AreEqual(new Vector3D(0.5f, 1.5f, 0.0f), coins[0].Position);
    Assert.IsTrue(coins[0].IsActive);
}
[Test]
public void TriggeringPiggyBankPayDayMakesCreepsDropMoreGold()
{
    var creep = new Creep(CreepType.Cloth, new Vector2D(0.5f, 1.5f));
    var gold = creep.GetStatValue("Gold");
    pig.PerformAttack(AvatarAttack.PiggyBankPayDay, Vector2D.Unused);
    AdvanceTimeAndUpdateEntities(4.9f);
    Assert.AreEqual(1.5f, creep.GetStatValue("Gold") / gold);
}
[Test]
public void PiggyBankPayDayBuffLasts5Seconds()
{
    var creep = new Creep(CreepType.Cloth, new Vector2D(0.5f, 1.5f));
    var gold = creep.GetStatValue("Gold");
    pig.PerformAttack(AvatarAttack.PiggyBankPayDay, Vector2D.Unused);
    AdvanceTimeAndUpdateEntities(5.1f);
    Assert.GreaterOrEqual(creep.GetStatValue("Gold"), gold);
}
See Also