Exemple #1
0
        protected void HandleRestoreData(RestoreBehaviorData restoreData)
        {
            int dataValue = restoreData.Value;

            //Handle the different behaviors
            switch (restoreData.Behavior)
            {
            case RestoreBehavior.HealMarioHP:
                HealingResponse.MarioHPRestored += dataValue;
                break;

            case RestoreBehavior.HealPartnerHP:
                HealingResponse.PartnerHPRestored += dataValue;
                break;

            case RestoreBehavior.HealFP:
                HealingResponse.FPRestored += dataValue;
                break;

            case RestoreBehavior.PreventInput:
                PrevThrow = Time.ActiveMilliseconds + dataValue;
                break;

            default:
                break;
            }
        }
Exemple #2
0
        protected void UpdateThrownStars()
        {
            //Check if the stars collided with anything
            for (int i = 0; i < StarsThrown.Count; i++)
            {
                StarsThrown[i].Update();

                //Make sure the star doesn't go past the designated X value
                if (StarsThrown[i].Position.X >= StarMaxX)
                {
                    StarsThrown.RemoveAt(i);
                    i--;

                    continue;
                }

                CollisionResponseHolder?collisionResponse = UtilityGlobals.GetCollisionForSet(StarsThrown[i], IconSpawner.RestorationElements);

                //We have a collision, so handle it
                if (collisionResponse != null)
                {
                    //Remove the star and icon
                    IconSpawner.RemoveElement((SweetTreatRestorationElement)collisionResponse.Value.ResponseObj);

                    StarsThrown.RemoveAt(i);
                    i--;

                    //Handle the restore data based on its behavior
                    RestoreBehaviorData restoreData = (RestoreBehaviorData)collisionResponse.Value.CollisionData;
                    HandleRestoreData(restoreData);
                }
            }
        }