Beispiel #1
0
    void Chop(Knife.ChopMode chop)
    {
        if (ChopsToKill[chopCount] == chop)
        {
            chopCount++;

            if (ChopsToKill.Count == chopCount)
            {
                // done chopping, kill

                // run mesh-divider
                // update game class kill count
                OnDeath(true);
                // after interval, remove pieces, put stuff on plate
                Debug.Log("Success! Awarded pts : " + scoreValue.ToString());
            }
        }
        else
        {
            // chopped wrongly, kill but no rewards

            // run mesh divider
            // update game class fail count
            OnDeath(false);
            // leave chopped bits where they are
            Debug.Log("Fail!");
        }
    }
Beispiel #2
0
    public void Chop(Knife.ChopMode chop)
    {
        if (state < MonState.Derpy)
        {
            return;
        }

        if (chopCount >= ChopsToKill.Count)
        {
            return;
        }

        // we chopped at the right angle
        if (ChopsToKill[chopCount] == chop)
        {
            chopCount++;

            if (ChopsToKill.Count == chopCount)
            {
                // done chopping, kill

                // run mesh-divider
                // update game class kill count
                Debug.Log("KILLED", this);
                state = MonState.Dead;
                if (OnDeath != null)
                {
                    OnDeath(true, this);
                }

                // after interval, remove pieces, put stuff on plate
                Debug.Log("Success! Awarded pts : " + scoreValue.ToString());
            }

            if (OnChop != null)
            {
                OnChop(true, this);
            }
        }
        // we chopped at the wrong angle
        else
        {
            state = MonState.Dead;

            if (OnDeath != null)
            {
                OnDeath(false, this);
            }

            // chopped wrongly, kill but no rewards
            if (OnChop != null)
            {
                OnChop(false, this);
            }

            // run mesh divider
            // update game class fail count



            // leave chopped bits where they are
            Debug.Log("Fail!");
        }
    }