Show / Hide Table of Contents

Class Agent

Base class for Agents, including Clutter and Living agents

Inheritance
System.Object
Agent
Bullet
Clutter
Living
Wall
Implements
Killable
Namespace: Mannequin.Bindings
Assembly: Collapse.dll
Syntax
public class Agent : object, Killable

Properties

CurrentTile

Get the Tile this Agent is standing on.

Declaration
public Tile CurrentTile { get; }
Property Value
Type Description
Tile

Faction

Get or set this Agent's Faction.

Declaration
public Faction Faction { get; set; }
Property Value
Type Description
Faction

GridPosition

The Agent's position on the Grid.

Declaration
public Point GridPosition { get; }
Property Value
Type Description
Point

Health

The health (hit points) this Agent has

Declaration
public int Health { get; set; }
Property Value
Type Description
System.Int32

IsBullet

Is this a Bullet?

Declaration
public bool IsBullet { get; }
Property Value
Type Description
System.Boolean

IsClutter

Is this Clutter?

Declaration
public bool IsClutter { get; }
Property Value
Type Description
System.Boolean

IsLiving

Is this a living object (Living)?

Declaration
public bool IsLiving { get; }
Property Value
Type Description
System.Boolean

IsWall

Is this a Wall?

Declaration
public bool IsWall { get; }
Property Value
Type Description
System.Boolean

MaxHealth

The maximum health (hit points) this Agent can have

Declaration
public int MaxHealth { get; set; }
Property Value
Type Description
System.Int32

Name

The name of this Agent

Declaration
public string Name { get; set; }
Property Value
Type Description
System.String

Position

The Point where this Agent lies

Declaration
public Point Position { get; set; }
Property Value
Type Description
Point

Scene

The Scene this Agent is currently in

Declaration
public Scene Scene { get; }
Property Value
Type Description
Scene

Visible

Whether this Agent is visible or not.

Declaration
public bool Visible { get; set; }
Property Value
Type Description
System.Boolean

Methods

Damage(Agent, Int32, Boolean, EWeaponDamageType, EIntegrityStrength)

Have attacker "damage" this Agent. Note that this will fire AgentDamage.

Declaration
public int Damage(Agent attacker, int damage, bool critical, EWeaponDamageType damageType, EIntegrityStrength weaponpower)
Parameters
Type Name Description
Agent attacker

The attacker

System.Int32 damage
System.Boolean critical

If it's a critical hit, it's only to determine if the UI will show some feedback, it has no impact beside that as it's already handled byt the damage parameter

EWeaponDamageType damageType

The damage type

EIntegrityStrength weaponpower
Returns
Type Description
System.Int32

The amount of damage that actually was inflicted to the victim

Examples

Make an Agent damage itself every 10 seconds.

Mannequin:Import("Game")
Mannequin:Import("Event")
Mannequin:Import("EWeaponDamageType")
Mannequin:Import("Timer")

Event.On("Game", function()
    local currScene = Game.GetActiveScene()
    Timer.Every(5, function()
        local agents = currScene.GetAgents()
        for i=1,#agents,1 do
            agents[i]:Damage(agents[i], 10, EWeaponDamageType.Impact)
        end
    end)
end)

Kill()

Kill this Agent, removing it from its respective Scene. Note that this will fire the AgentDeath.

Declaration
public void Kill()

Implements

Killable
Back to top © 2020 Anarkis Gaming. All rights reserved. Generated by DocFX