Example #1
0
    public void Attack(int actionSlimeId, int targetSlimeId)
    {
        RawSlime actionSlime = FindSlimeById(actionSlimeId);
        RawSlime targetSlime = FindSlimeById(targetSlimeId);

        int damage = actionSlime.getDamage;

        if (actionSlime.changeMass((int)-actionSlime.GetMass() * actionSlime.attackDrain) <= 0)
        {
            actionSlime.GetPlayer().RemoveSlime(actionSlime);
        }
        if (targetSlime.changeMass((int)-damage * targetSlime.GetDamageReduction()) <= 0)
        {
            targetSlime.GetPlayer().RemoveSlime(targetSlime);

            /*Debug.Log("DEAD");
             * Debug.Log(targetSlime.GetPlayer());*/
        }

        SpendActions(1);
    }