Beispiel #1
0
    /* Equips an item to an actor's arms, giving it max ammo if relevant. */
    public static void PrimaryEquip(string item, ref Actor actor)
    {
        Data dat = Item.GetItem(item);

        if (dat != null)
        {
            if (dat.itemType == Item.RANGED)
            {
                Ranged.MaxAmmo(ref dat);
            }
            actor.Equip(dat);
        }
        else
        {
            MonoBehaviour.print(item + " was null!");
        }
    }
Beispiel #2
0
    /* Spawns this weapon, giving it full ammo if applicable. */
    private void Spawn()
    {
        Data dat = Item.GetItem(weaponName);

        if (dat != null)
        {
            if (dat.itemType == Item.RANGED)
            {
                Ranged.MaxAmmo(ref dat);
            }
            Item item = Item.GetItem(dat);
            if (item != null)
            {
                weapon = item.gameObject;
                weapon.transform.position = transform.position;
            }
        }
    }
Beispiel #3
0
    public static void DualEquip(string item, ref Actor actor)
    {
        Data dat = Item.GetItem(item);

        if (dat != null)
        {
            if (dat.itemType == Item.RANGED)
            {
                Ranged.MaxAmmo(ref dat);
            }
            if (!actor.arms.DualEquipAvailable(dat))
            {
                MonoBehaviour.print("Could not dual equip " + item);
                return;
            }
            actor.DualEquip(dat);
        }
        else
        {
            MonoBehaviour.print(item + " was null!");
        }
    }