Table of Contents

Method Equip

Namespace
GrindFest
Assembly
GrindFest.dll

Equip(ItemBehaviour)

Equips an item, automatically picking it up from the ground if needed. Useful for gear management and automatic equipment upgrades.

public bool Equip(ItemBehaviour item)

Parameters

item ItemBehaviour

Item to equip

Returns

bool

True if the hero equipped the item or tried to equip it, false if still moving to pick it up

Remarks

Common uses include:

  • Automatic weapon upgrades based on damage
  • Equipment swapping for different situations
Weapon upgrade based on maximum damage:
foreach (var item in FindItemsOnGround())
{
    if (item.Weapon != null)
    {
        var currentWeapon = Equipment.Weapon;
    if (currentWeapon == null || item.Weapon.MaxDamage > currentWeapon.MaxDamage)
    {
        Equip(item);
        Say($"Found better weapon with {item.Weapon.MaxDamage} maximum damage!");
    }
}

}