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 static bool Equip(ItemBehaviour item)
Parameters
item
ItemBehaviourItem 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
foreach (var item in Hero.FindItemsOnGround())
{
if (item.Weapon != null)
{
var currentWeapon = Equipment.Weapon;
if (currentWeapon == null || item.Weapon.MaxDamage > currentWeapon.MaxDamage)
{
Hero.Equip(item);
Hero.Say($"Found better weapon with {item.Weapon.MaxDamage} maximum damage!");
}
}
}