示例#1
0
 public void displayOutro(Outro outro)
 {
     setTextFieldsForOutro(outro.getFirstLine(), outro.getSecondLine(), outro.getThirdLine());
     temperatureCanvas.SetActive(false);
     canvas.SetActive(true);
     StartCoroutine(startOutroTextFadeInAnimation());
 }
示例#2
0
        public static void WillCrewMemberShoot(List <BaseCriminal> crew, List <BaseLocation> locations, bool isPlayerAttemptingMoneySplit)
        // Check every crew member's morale to see if they will turn
        {
            // SIMILAR to WillCrewMemberTurnAfterHeist
            BaseCriminal player = crew.Find(c => c.IsPlayer);

            crew.ForEach(c =>
            {
                int morale = c.Morale;
                if (c.IsPlayer == false && morale <= 40)
                {
                    // Save as traitor for easy understanding
                    BaseCriminal traitor = c;

                    // Generate a new random number between 1-10 to handle the % a person will turn
                    Random r         = new Random();
                    int randomNumber = r.Next(101);
                    int chance30     = 0;
                    int chance50     = 0;
                    int chance70     = 0;
                    int chance100    = 0;

                    // Based on this member's morale, generate a number by chance
                    if (morale >= 30 && morale <= 40)
                    {
                        chance30 = r.Next(31);
                    }
                    else if (morale >= 20 && morale <= 29)
                    {
                        chance50 = r.Next(51);
                    }
                    else if (morale >= 10 && morale <= 19)
                    {
                        chance70 = r.Next(71);
                    }
                    // Chance100 equals the randomNumber so if they're at that level, they'll always turn
                    else if (morale <= 9)
                    {
                        chance100 = randomNumber;
                    }

                    ChanceToShoot(chance30, randomNumber, crew, locations, traitor, isPlayerAttemptingMoneySplit);
                    ChanceToShoot(chance50, randomNumber, crew, locations, traitor, isPlayerAttemptingMoneySplit);
                    ChanceToShoot(chance70, randomNumber, crew, locations, traitor, isPlayerAttemptingMoneySplit);
                    ChanceToShoot(chance100, randomNumber, crew, locations, traitor, isPlayerAttemptingMoneySplit);
                }
            });
            // Find criminals WHERE they have not been marked as ICED and set them as the new crew
            crew = crew.Where(c => !c.isAssociateIced).ToList();
            // After we have looped through every associate, go to the correct view
            if (isPlayerAttemptingMoneySplit)
            {
                Outro.GameOver(crew, locations, true, player);
            }
            if (!isPlayerAttemptingMoneySplit)
            {
                Outro.SplitCash(crew, locations);
            }
        }
        public string ToBriefing(int levelCount)
        {
            string res = "";
            int    i   = 0;

            res += Intro.ToBriefing(i++);
            foreach (BriefingLevel level in Levels.Take(levelCount))
            {
                res += level.ToBriefing(i++);
            }
            res += Outro.ToBriefing(i++);
            res += "$S999\n";
            return(res.Replace("\n", "\r\n"));
        }
示例#4
0
        public static void DisplayWhoIcedWho(List <BaseCriminal> crew,
                                             List <BaseLocation> locations,
                                             BaseCriminal traitor,
                                             BaseCriminal gotShot,
                                             bool isPlayerAttemptingMoneySplit)
        {
            Color.IcedRed();

            Console.WriteLine(Heading.DisplayHeadingIced());
            Console.WriteLine(gotShot.FaceIced);
            Console.WriteLine("");
            if (gotShot.IsPlayer)
            {
                Console.WriteLine($"{traitor.Name} iced YOU in the face!");
                Console.WriteLine("");
                Menu.Continue();
                Outro.GameOver(crew, locations, false, gotShot);
            }

            else if (!gotShot.IsPlayer)
            {
                Console.WriteLine($"{traitor.Name} iced {gotShot.Name} in the face!");
                Console.WriteLine("");
                Console.WriteLine("Survivors' morale decreased.");
                Console.WriteLine("");
                Menu.Continue();

                // If player is NOT attempting to split the cash, return to SplitCash view
                if (!isPlayerAttemptingMoneySplit)
                {
                    // Loop through the crew and find the members WHERE they have not been iced
                    crew = crew.Where(c => !c.isAssociateIced).ToList();
                    Outro.SplitCash(crew, locations);
                }
                // Otherwise, continue the forEach check for each crew member
            }
        }
示例#5
0
文件: Event.cs 项目: wach78/Turbofest
        public Event(DateTime ClockStart, DateTime ClockEnd, int ClockRunTime, System.Xml.Linq.XDocument XMLEvents, ref CrashHandler Crash)
        {
            ch = Crash;
            events = new Dictionary<string, List<EventItem>>();
            clock = new PartyClock(ClockStart, ClockEnd, ClockRunTime);
            Util.ShowClock = true;
            sound = new Sound(true);
            text = new Text2D();
            chess = new Chess();
            sf = new Starfield(150);

            intro = new Intro(ref sound, ref text);
            outro = new Outro(ref sound);

            advent = new Advent(ref sound);
            birthday = new Birthday(ref sound, ref text, ref chess);
            xmas = new Christmas(ref sound);
            smurf = new Datasmurf(ref sound, ref text); // random
            dif = new Dif(ref chess, ref sound); // random
            fbk = new Fbk(ref sound); // random
            hw = new Halloween(ref chess, ref sound, 25);
            lucia = new Lucia(ref chess, ref sound);
            newyear = new NewYear();
            richard = new RMS(ref sound, ref text); // random
            scroller = new Scroller(ref chess, ref sf, ref text); // random
            semla = new Semla();
            sune = new SuneAnimation(ref sound, ref text);
            tl = new TurboLogo(ref sound, ref chess, (OpenGL.Util.SpringOrFall.Equals("Spring")? true:false)/*((ClockStart.Month >= 1 && ClockStart.Month <= 8)? false:true)*/ ); // vilken termin är det? jan till början av augusti VT, resten HT... random
            valentine = new Valentine(ref sound);
            wl = new WinLinux(ref chess); //random
            creators = new Self(ref sound); // random
            bb = new BB(ref sound); // random
            GM = new GummiBears(ref sound);
            NDay = new National(ref chess, ref sound);
            easter = new Easter(ref sound);
            hajk = new Hajk(ref sound);
            mid = new Midsummer(ref sound);
            vaf = new Vaffla();
            wp = new Walpurgis();
            crayfish = new CrayFish();

            ts = new TeknatStyle(ref chess, ref sound, ref text);
            m = new Matrix(ref text);
            q = new Quiz(ref text, false, ref sound);
            talepsin = new Talespin(ref sound);
            cd = new ChipAndDale(ref sound, ref chess);
            nerd = new Nerdy(ref chess, ref sound);
            trex = new Trex(ref sound);
            sailormoon = new Sailormoon(ref sound,ref chess);
            gb = new GhostBusters(ref sound);
            zelda = new Zelda(ref sound, ref chess);
            tardis = new Tardis(ref sound);
            f**k = new F**k(ref sound, ref chess);

            silverFang = new SilverFang(ref sound);
            mt = new MoraT(ref sound);

            swine = new Swine(ref chess, ref text);
            tjall = new Tjall(ref chess, ref text);

            ronja = new Ronja(ref sound);
            emil = new Emil(ref sound);
            djungelboken = new Djungelboken(ref sound);
            fabbe = new Fabbe(ref sound);
            drink = new Drink(ref sound);
            frozen = new Frozen(ref sound);

            eventCurrent = null; // event item for events to be triggerd in clock_NewDate
            //randomEvent = new List<string>(new string[] { "starfield", "SuneAnimation", "TurboLogo", "Datasmurf", "WinLinux", "Scroller", "BB", "GummiBears", "TeknatStyle", "Matrix"});
            randomEvent = new List<string>(new string[] { "starfield", "Nerdy", "Talespin", "Sailormoon", "GhostBusters", "Zelda", "Tardis", "F**k", "SilverFang", "MoraT" });
            //new stuff
             List<UtilXML.EventData> ed = UtilXML.Loadeffectdata();

            // TODO: Make a clean list with all events allowed to be used implement so that it is actaully usable instead of a switch at the bottom of this file.
            Dictionary<string, Effect> effects = new Dictionary<string, Effect>()
            {
                {"SuneAnimation", new Effect(sune, ed.Find(e => e.Name == "SuneAnimation"))},
                {"Dif",new Effect(dif, ed.Find(e => e.Name == "Dif"))},
                {"Fbk",new Effect(fbk, ed.Find(e => e.Name == "Fbk"))},
                {"TurboLogo",new Effect(tl, ed.Find(e => e.Name == "TurboLogo"))},
                {"Datasmurf", new Effect(smurf, ed.Find(e => e.Name == "Datasmurf"))},
                {"RMS",new Effect(richard, ed.Find(e => e.Name == "RMS"))},
                {"WinLinux",new Effect(wl, ed.Find(e => e.Name == "WinLinux"))},
                {"Scroller",new Effect(scroller, ed.Find(e => e.Name == "Scroller"))},
                {"Self",new Effect(creators, ed.Find(e => e.Name == "Self"))},
                {"BB",new Effect(bb, ed.Find(e => e.Name == "BB"))},
                {"GummiBears",new Effect(GM, ed.Find(e => e.Name == "GummiBears"))},
                {"Hajk",new Effect(hajk, ed.Find(e => e.Name == "Hajk"))},
                {"TeknatStyle",new Effect(ts, ed.Find(e => e.Name == "TeknatStyle"))},
                {"Matrix",new Effect(m, ed.Find(e => e.Name == "Matrix"))},
                {"Quiz",new Effect(q, ed.Find(e => e.Name == "Quiz"))},
                {"Talespin",new Effect(talepsin, ed.Find(e => e.Name == "Talespin"))},
                {"ChipDale",new Effect(cd, ed.Find(e => e.Name == "ChipDale"))},
                {"Nerdy",new Effect(nerd, ed.Find(e => e.Name == "Nerdy"))},
              /*  {"Trex",new Effect(trex, ed.Find(e => e.Name == "Trex"))},*/
                {"Sailormoon",new Effect(sailormoon, ed.Find(e => e.Name == "Sailormoon"))},
                {"GhostBusters",new Effect(gb, ed.Find(e => e.Name == "GhostBusters"))},
                {"Zelda",new Effect(zelda, ed.Find(e => e.Name == "Zelda"))},
                {"Tardis",new Effect(tardis, ed.Find(e => e.Name == "Tardis"))},
                {"F**k",new Effect(f**k, ed.Find(e => e.Name == "F**k"))},
                {"SilverFang",new Effect(silverFang, ed.Find(e => e.Name == "SilverFang"))},
                {"MoraT",new Effect(mt, ed.Find(e => e.Name == "MoraT"))},
                {"Ronja",new Effect(ronja, ed.Find(e => e.Name == "Ronja"))},
                {"Emil",new Effect(emil, ed.Find(e => e.Name == "Emil"))},
                {"Djungelboken",new Effect(djungelboken, ed.Find(e => e.Name == "Djungelboken"))},
                {"Fabbe",new Effect(fabbe, ed.Find(e => e.Name == "Fabbe"))},
                {"Drink",new Effect(drink, ed.Find(e => e.Name == "Drink"))},
                {"Frozen",new Effect(drink, ed.Find(e => e.Name == "Frozen"))}
            };

            runEffectInMonth = new Dictionary<string, List<objdata>>();

            string[] months = Util.monthlist();
            int counter;
            foreach (KeyValuePair<string, Effect> pair in effects)
            {
                counter = 0;
                foreach (bool b in pair.Value.RunAllowedlist)
                {
                    if (b == true)
                    {
                        if (!runEffectInMonth.ContainsKey(months[counter]))
                        {
                            runEffectInMonth.Add(months[counter], new List<objdata>());
                        }

                        runEffectInMonth[months[counter]].Add(new objdata(pair.Key, pair.Value.Vetolist[counter], pair.Value.Priolist[counter], pair.Value.Runslist[counter]));
                    }
                    counter++;
                }
            }

            clock.NewDate += clock_NewDate; // Event listener

            if (ch.CrashDialogResult == System.Windows.Forms.DialogResult.Yes)
            {
                clock.clock = ch.CrashClock;
            }

            string name, date, type;
            // Event dates setup
            foreach (var item in XMLEvents.Descendants("event"))
            {
                name = item.Element("name").Value;
                date = item.Element("date").Value;
                type = item.Element("type").Value.ToLower();
                EventItem ei = new EventItem(name, type, date);
                if (!events.ContainsKey(date))
                {
                    List<EventItem> list = new List<EventItem>(); // seems most bad in my eyes...
                    events.Add(date, list);
                }

                for (int i = 0; i < events[date].Count; i++)
                {
                    EventItem e = events[date][i];
                    if ("birthday".Equals(e.Type) && "birthday".Equals(ei.Type))
                    {
                        e.Name += "\n\n" + ei.Name;
                        events[date][i] = e;
                    }
                }
                events[date].Add(ei);
                name = date = type = string.Empty;
            }

            // this needs to be fixed nicer...
            if (events.ContainsKey(ClockEnd.ToShortDateString()))
            {
                events[ClockEnd.ToShortDateString()].Clear(); // force this to be top..
                events[ClockEnd.ToShortDateString()].Add( new EventItem("outro", "outro", ClockEnd.ToShortDateString()) );
            }
            else
            {
                events.Add(ClockEnd.ToShortDateString(), new List<EventItem>() { new EventItem("outro", "outro", ClockEnd.ToShortDateString()) });
            }

            // Random effects on dates with no effects and check against new list of allowed things for them...
            DateTime dt = ClockStart;
            bool star = (Util.Rnd.Next(0, 1000) < 500 ? true:false); // make this random at the start too?
            int num = 0;

            while (dt <= ClockEnd)
            {
                date = dt.ToShortDateString();
                if (!events.ContainsKey(date))
                {
                    EventItem ei;

                    if (num == 0 || num == 1)
                    {
                        ei = new EventItem("starfield", "random", date);
                    }
                    else
                    {
                        //ei = new EventItem(randomEvent[Util.Rnd.Next(1, randomEvent.Count)], "random", date);

                        string month = "";
                        if (dt != null)
                            month = dt.Month.ToString();

                        switch (month)
                        {
                            case "1": month = "jan"; break;
                            case "2": month = "feb"; break;
                            case "3": month = "mar"; break;
                            case "4": month = "apr"; break;
                            case "5": month = "maj"; break;
                            case "6": month = "jun"; break;
                            case "7": month = "jul"; break;
                            case "8": month = "aug"; break;
                            case "9": month = "sep"; break;
                            case "10": month = "okt"; break;
                            case "11": month = "nov"; break;
                            case "12": month = "dec"; break;
                        }//switch

                        if (runEffectInMonth.ContainsKey(month))
                        {
                            List<objdata> mobj = runEffectInMonth[month];

                            List<objdata> vetolist = new List<objdata>();
                            List<objdata> novetolist = new List<objdata>();

                            foreach (objdata n in mobj)
                            {

                                if ("Quiz".Equals(n.Name) && eventnum == 4)
                                {
                                    n.vetoAgain();
                                    eventnum = 0;
                                }

                                if (n.Veto == true)
                                {
                                    if (n.Runs > 0)
                                        vetolist.Add(n);
                                }
                                else
                                {
                                    if (n.Runs > 0)
                                        novetolist.Add(n);
                                }
                            }

                            vetolist.Sort();
                            novetolist.Sort();

                            if (vetolist.Count > 0)
                            {
                                ei = new EventItem(vetolist[0].Name, "random", date);
                                vetolist[0].noMoreVeto();
                            }
                            else if (novetolist.Count > 0)
                            {
                                ei = new EventItem(novetolist[0].Name, "random", date);
                                novetolist[0].decRuns();
                                if (eventnum < 4)
                                    eventnum++;
                            }
                            else
                            {
                                ei = new EventItem(randomEvent[Util.Rnd.Next(1, randomEvent.Count)], "random", date);
                            }
                        }
                        else
                        {
                            ei = new EventItem(randomEvent[Util.Rnd.Next(1, randomEvent.Count)], "random", date);
                        }
                    }

                    num++;
                    if (num == 3)
                    {
                        num = 0;
                    }
                    ei = new EventItem("Self", "random", date); // this is for debuging new events
                    events.Add(date, new List<EventItem>());
                    events[date].Add(ei);
                }

                dt = dt.AddDays(1);
                date = string.Empty;
            }
        }
示例#6
0
        public static void HeistFailure(List <BaseCriminal> crew, List <BaseLocation> locations)
        {
            Color.PoliceBlue();
            BaseCriminal player    = crew.Find(c => c.IsPlayer);
            string       moraleMsg = "Crew morale decreased.";
            // 50-50 chance for arrested or escaped
            Random random = new Random();
            int    r      = random.Next(1, 3);

            // Arrested
            if (r == 1)
            {
                // Generate arrested summary
                Console.WriteLine(Heading.DisplayHeadingArrested());
                Console.WriteLine(Heading.DisplaySubheadingArrested());

                // If only player is in crew
                if (crew.Count == 1)
                {
                    crew.ForEach(c => c.IsPlayerArrested = true);
                    Console.WriteLine(Face.DisplayArrested());
                    Menu.Continue();
                    Outro.GameOver(crew, locations, true, player);
                }
                // If multiple crew members
                else if (crew.Count > 1)
                {
                    // arrest a random crew member
                    int crewSize         = crew.Count();
                    int randomCrewMember = new Random().Next(1, crewSize);

                    BaseCriminal arrestedMember = crew.ElementAt(randomCrewMember);
                    Console.WriteLine("");
                    Console.WriteLine($"{arrestedMember.Face}");
                    Console.WriteLine("");
                    Console.WriteLine($"The cops got {arrestedMember.Name}!\n");
                    Console.WriteLine(moraleMsg);
                    Console.WriteLine("");
                    Menu.Continue();

                    crew.RemoveAt(randomCrewMember);
                    // Randomly lower every non-player's morale
                    crew.ForEach(c =>
                    {
                        if (c.IsPlayer == false)
                        {
                            int loweredMorale = c.Morale - new Random().Next(25, 54);
                            if (loweredMorale < c.MoraleMin)
                            {
                                c.Morale = c.MoraleMin;
                            }
                            else
                            {
                                c.Morale = loweredMorale;
                            }
                        }
                    });
                    // Return to level select menu
                    Level.LevelSelect(crew, locations);
                }
            }
            // Escaped
            else if (r == 2)
            {
                // Randomly lower every non-player's morale
                crew.ForEach(c =>
                {
                    if (c.IsPlayer == false)
                    {
                        int loweredMorale = c.Morale - new Random().Next(15, 35);
                        if (loweredMorale < c.MoraleMin)
                        {
                            c.Morale = c.MoraleMin;
                        }
                        else
                        {
                            c.Morale = loweredMorale;
                        }
                    }
                });
                // Display escaped summary
                Console.WriteLine(Heading.DisplayHeadingEscaped());
                Console.WriteLine(Heading.DisplaySubheadingEscaped());
                Console.WriteLine(Vehicle.DisplayPoliceCar());
                if (crew.Count() > 1)
                {
                    Console.WriteLine(moraleMsg);
                }
                Console.WriteLine("");
                Menu.Continue();
                // Return to level select menu
                Level.LevelSelect(crew, locations);
            }
        }
示例#7
0
        public static void LevelSelect(List <BaseCriminal> crew, List <BaseLocation> locations)
        {
            Color.DefaultGray();
            // While there are levels not yet completed, allow user to continue selecting levels
            List <BaseLocation> locationsLeftToRob = locations.Where(l => l.Completed == false).ToList();

            BaseCriminal player = crew.Find(c => c.IsPlayer);

            while (locationsLeftToRob.Count() > 0)
            {
                Console.Clear();
                Console.Write(Heading.DisplayPlanning());
                CrewManagement.DisplayCrewInfo(crew);
                Console.WriteLine(LevelArt.DisplayNashville());

                if (player.PlayerContactCount == 0 && crew.Count() == 1)
                {
                    Console.WriteLine("No crew left to manage");
                    Console.WriteLine("______________________");
                    Console.WriteLine("");
                }
                else
                {
                    Console.WriteLine("1) manage crew");
                    Console.WriteLine("______________");
                    Console.WriteLine("");
                }

                // Iterate through locations, for those that are not completed, then show those options
                locations.ForEach(l =>
                {
                    if (!l.Completed)
                    {
                        if (l.Name == "Annoying Neighbor's House")
                        {
                            Console.WriteLine("2) stakeout Annoying Neighbor's House");
                        }
                        if (l.Name == "Corner Evan-Eleven")
                        {
                            Console.WriteLine("3) stock-up at Corner Evan-Eleven");
                        }
                        if (l.Name == "Welts Fargo")
                        {
                            Console.WriteLine("4) stakeout Welts Fargo");
                        }
                        if (l.Name == "Pinnackle National Bank")
                        {
                            Console.WriteLine("5) stakeout Pinnackle National Bank");
                        }
                        if (l.Name == "Bank of Amereeka")
                        {
                            Console.WriteLine("6) stakeout Bank of Amereeka");
                        }
                    }
                });

                // IF you have ANY money, option 7 is available

                if (player.CrewTotalCash > 0)
                {
                    Console.WriteLine("____________");
                    Console.WriteLine("");
                    if (crew.Count() == 1)
                    {
                        Console.WriteLine("7) end heist spree");
                    }
                    else
                    {
                        Console.WriteLine("7) end heist spree and split cash");
                    }
                }

                // Check to ensure user typed only a number
                int selection = Menu.MenuInput(7);

                switch (selection)
                {
                case 1:
                    if (player.PlayerContactCount == 0 && crew.Count() == 1)
                    {
                        LevelSelect(crew, locations);
                    }
                    else
                    {
                        CrewManagement.ManageCrew(crew, locations);
                    }
                    break;

                case 2:
                    // Annoying Neighbor
                    StakeOutLocation(crew, locations, 2);
                    break;

                case 3:
                    // Evan-Eleven
                    StakeOutLocation(crew, locations, 3);
                    break;

                case 4:
                    // Welts Fargo
                    StakeOutLocation(crew, locations, 4);
                    break;

                case 5:
                    // Pinnackle
                    StakeOutLocation(crew, locations, 5);
                    break;

                case 6:
                    // Amereeka
                    StakeOutLocation(crew, locations, 6);
                    break;

                case 7:
                    // End game - split cash
                    if (player.CrewTotalCash > 0)
                    {
                        Outro.SplitCash(Outro.PrepCrewForEndGame(crew), locations);
                    }
                    break;
                }

                locationsLeftToRob = locations.Where(l => l.Completed == false).ToList();
            }

            Outro.SplitCash(Outro.PrepCrewForEndGame(crew), locations);
        }
    void HandleBoss()
    {
        //Debug.Log("State: " + state + ", Intro: " + intro + ", Outro: " + outro + ", choice: " + choice + ", ChoicePhase: " + choiceStage);
        switch (state)
        {
        case State.Intro:

            switch (intro)
            {
            case Intro.StartLanding:
                landing_legs.transform.SetY(-8.62f);
                landing_head.transform.SetY(-2f);
                landing_arms.transform.SetY(-4.44f);
                landing_body.transform.SetY(-4.47f);
                landing_legs.transform.AddY(23);
                landing_head.transform.AddY(23);
                landing_arms.transform.AddY(23);
                landing_body.transform.AddY(23);

                iTween.MoveTo(landing_legs, iTween.Hash("delay", 0.3f, "y", -8.62f, "time", 0.3f, "easetype", iTween.EaseType.easeOutSine, "looptype", iTween.LoopType.none));
                iTween.MoveTo(landing_head, iTween.Hash("delay", 0.3f, "y", -2f, "time", 0.27f, "easetype", iTween.EaseType.easeOutSine, "looptype", iTween.LoopType.none));
                iTween.MoveTo(landing_arms, iTween.Hash("delay", 0.3f, "y", -4.44f, "time", 0.33f, "easetype", iTween.EaseType.easeOutSine, "looptype", iTween.LoopType.none));
                iTween.MoveTo(landing_body, iTween.Hash("delay", 0.3f, "y", -4.47f, "time", 0.3f, "easetype", iTween.EaseType.easeOutSine, "looptype", iTween.LoopType.none));
                intro   = Intro.Impact;
                state   = State.Waiting;
                timeSet = fa.time;
                delay   = 0.37f;
                break;

            case Intro.Impact:
                ScreenShakeCamera.Screenshake(2, 0.35f, ScreenShakeCamera.ScreenshakeMethod.Basic);
                GameObject go = Instantiate(blastEffect, blastPoint.transform.position, blastPoint.transform.rotation);
                intro   = Intro.Yell;
                state   = State.Waiting;
                timeSet = fa.time;
                delay   = 0.5f;
                break;

            case Intro.Yell:
                //Yell();
                intro   = Intro.AfterYell;
                state   = State.Waiting;
                timeSet = fa.time;
                delay   = 0.1f;
                break;

            case Intro.AfterYell:
                intro   = Intro.End;
                state   = State.Waiting;
                timeSet = fa.time;
                delay   = 0.1f;
                break;
            }

            break;

        case State.Decide:


            if (healthScript.health > 100 && healthScript.health <= 125 && choiceStage != ChoiceStage.Phase2_Fireballs)
            {
                choice = 0; choiceStage = ChoiceStage.Phase2_Fireballs;
            }
            if (healthScript.health > 0 && healthScript.health <= 100 && choiceStage != ChoiceStage.Phase5_CuteGhost)
            {
                choice = 0; choiceStage = ChoiceStage.Phase4_Vanish;
            }
            if (healthScript.health <= 0 && choiceStage != ChoiceStage.Phase99_DerpyGhostDeath)
            {
                choice = 0; choiceStage = ChoiceStage.Phase99_DerpyGhostDeath;
            }


            if (choiceStage == ChoiceStage.Phase1_ChargeAndScythe)
            {
                if (choice == 0)
                {
                    choice = 1;
                    state  = State.Idle;
                }
                else if (choice == 1)
                {
                    state = State.Charging;
                    if (healthScript.health < 180)
                    {
                        choice = 2;
                    }
                    else
                    {
                        choice = 3;
                    }
                }
                else if (choice == 2)
                {
                    state  = State.Attacking;
                    choice = 3;
                }
                else if (choice == 3)
                {
                    choice = 4;
                    state  = State.Stunned;
                }
                else if (choice == 4)
                {
                    choice = 0;
                    state  = State.LongIdle;
                }
            }
            else if (choiceStage == ChoiceStage.Phase2_Fireballs)
            {
                if (choice == 0)
                {
                    choice = 1;
                    state  = State.Idle;
                }
                else if (choice == 1)
                {
                    choice = 2;
                    state  = State.Attacking2;
                }
                else if (choice >= 2)
                {
                    choice = 0;
                    state  = State.Stunned;
                }
            }
            else if (choiceStage == ChoiceStage.Phase4_Vanish)
            {
                choice      = 0;
                state       = State.DieToGhost;
                choiceStage = ChoiceStage.Phase5_CuteGhost;
            }
            else if (choiceStage == ChoiceStage.Phase5_CuteGhost)
            {
                state = State.CuteGhost;
            }
            else if (choiceStage == ChoiceStage.Phase99_DerpyGhostDeath)
            {
                state = State.Outro;
                outro = Outro.StartTweening;
                EnterOutro();
            }



            break;

        case State.Waiting:
            if (fa.time > (timeSet + delay))
            {
                timeSet = 0;
                delay   = 0;
                if (intro != Intro.End)
                {                        //If the intro isn't finished, go back to the intro
                    state = State.Intro;
                }
                else if (outro != Outro.End && outro != Outro.NotStartedYet)
                {
                    state = State.Outro;
                }
                else if (lastState == State.DieToGhost)
                {
                    state = State.DieToGhost2;
                }
                else
                {
                    state = State.Decide;
                }
            }
            break;

        case State.Idle:
            timeSet = fa.time;
            delay   = 0.8f;
            EnterIdle();
            state = State.Waiting;
            break;

        case State.LongIdle:
            timeSet = fa.time;
            delay   = 1f;
            EnterIdle();
            state = State.Waiting;
            break;

        case State.Stunned:
            timeSet = fa.time;
            delay   = 5;
            EnterStunned();
            GameObject g4 = Instantiate(aboutToFlipPrefab, stunnedMuzzlePoint.transform.position, stunnedMuzzlePoint.transform.rotation);

            state = State.Waiting;
            break;

        case State.Attacking:
            timeSet = fa.time;
            delay   = 3;
            EnterAttacking();
            state = State.Waiting;

            GameObject g1 = Instantiate(scythPrefab, muzzlePoint1.transform.position, muzzlePoint1.transform.rotation);
            //GameObject g2 = Instantiate(scythPrefab,muzzlePoint2.transform.position,muzzlePoint2.transform.rotation);
            GameObject   g3 = Instantiate(scythPrefab, muzzlePoint3.transform.position, muzzlePoint3.transform.rotation);
            ScytheScript ss = null;
            ss     = g1.GetComponent <ScytheScript>();
            ss.vel = new Vector3(-6, -6, 0);
            //ss = g2.GetComponent<ScytheScript>();
            //ss.vel = new Vector3(-14,11,0);
            ss     = g3.GetComponent <ScytheScript>();
            ss.vel = new Vector3(-6, 4, 0);

            break;

        case State.Attacking2:
            timeSet = fa.time;
            delay   = 5;
            EnterAttacking2();
            state = State.Waiting;

            break;

        case State.Big:
            timeSet = fa.time;
            delay   = 3;
            EnterBig();
            state = State.Waiting;

            break;

        case State.Charging:

            EnterCharging();
            iTween.MoveTo(Controller_Charging, iTween.Hash("x", -21.5f, "time", 1f, "easetype", iTween.EaseType.linear));
            iTween.MoveTo(Controller_Charging, iTween.Hash("delay", 1f, "x", 10.27f, "time", 1f, "easetype", iTween.EaseType.linear));
            iTween.ScaleTo(Controller_ChargingSubController, iTween.Hash("delay", 1f, "x", -1, "time", 0));
            iTween.ScaleTo(Controller_ChargingSubController, iTween.Hash("delay", 2f, "x", 1, "time", 0));

            timeSet = fa.time;
            delay   = 2f;
            state   = State.Waiting;
            break;

        case State.DieToGhost:
            EnterDieToGhost();
            dieToGhost_AniScript.Play();

            dieToGhost_Ghost.transform.SetX(3.5f);
            dieToGhost_Ghost.transform.SetY(-14.86f);
            iTween.MoveTo(dieToGhost_Ghost, iTween.Hash("delay", 1f, "y", 0.14, "time", 1f, "easetype", iTween.EaseType.easeInOutSine));

            lastState = State.DieToGhost;
            timeSet   = fa.time;
            delay     = 2f;
            state     = State.Waiting;
            break;

        case State.DieToGhost2:
            if (xa.pgMode)
            {
                DieToGhostText.text = "Cray cray, bro bro!";
            }
            else
            {
                DieToGhostText.text = "F**k it!";
            }
            iTween.MoveTo(dieToGhost_Ghost, iTween.Hash("delay", 1f, "y", 18.11, "time", 1f, "easetype", iTween.EaseType.easeInOutSine));

            Instantiate(dieToGhost_Corpse, dieToGhost_CorpseMuzzlePoint.transform.position, dieToGhost_CorpseMuzzlePoint.transform.rotation);

            lastState = State.None;
            timeSet   = fa.time;
            delay     = 3f;
            state     = State.Waiting;
            break;

        case State.CuteGhost:

            EnterCuteGhost();

            if (nonRandomCuteGhostCycle == 0)
            {
                nonRandomCuteGhostCycle       = 1;
                ghostSkull.transform.position = new Vector3(19f, 9.5f, 55);
                iTween.MoveTo(ghostSkull, iTween.Hash("x", -28.9f, "y", -9.1f, "time", 5f, "easetype", iTween.EaseType.linear));
            }
            else if (nonRandomCuteGhostCycle == 1)
            {
                nonRandomCuteGhostCycle       = 2;
                ghostSkull.transform.position = new Vector3(4.1f, 16.2f, 55);
                iTween.MoveTo(ghostSkull, iTween.Hash("x", -3.7f, "y", -13f, "time", 5f, "easetype", iTween.EaseType.linear));
            }
            else if (nonRandomCuteGhostCycle == 2)
            {
                nonRandomCuteGhostCycle       = 3;
                ghostSkull.transform.position = new Vector3(21f, 5f, 55);
                iTween.MoveTo(ghostSkull, iTween.Hash("x", -30f, "y", 5f, "time", 5f, "easetype", iTween.EaseType.linear));
            }
            else if (nonRandomCuteGhostCycle == 3)
            {
                nonRandomCuteGhostCycle       = 0;
                ghostSkull.transform.position = new Vector3(21f, -4.4f, 55);
                iTween.MoveTo(ghostSkull, iTween.Hash("x", -30f, "y", -4.4f, "time", 5f, "easetype", iTween.EaseType.linear));
            }


            timeSet = fa.time;
            delay   = 6f;
            state   = State.Waiting;
            break;

        case State.Outro:

            switch (outro)
            {
            case Outro.StartTweening:
                toSay          = "Nooooooooooooo!\nMy beautiful butt!";
                OutroText.text = "";
                firstYell      = false;
                finalSkull.transform.SetX(31);
                finalSkull.transform.SetY(-9);

                iTween.MoveTo(finalSkull, iTween.Hash("x", -4f, "y", -2f, "time", 2f, "easetype", iTween.EaseType.easeOutSine, "looptype", iTween.LoopType.none));
                outro   = Outro.Yell;
                state   = State.Waiting;
                timeSet = fa.time;
                delay   = 2.2f;
                break;

            case Outro.Yell:
                if (!firstYell)
                {
                    firstYell = true;
                    Fresh_SoundEffects.PlaySound(Fresh_SoundEffects.Type.MegaSatan_Scream);
                }
                if (toSay.Length > 0)
                {
                    string chop = "" + toSay[0];
                    toSay           = toSay.Remove(0, 1);
                    OutroText.text += chop;

                    outro = Outro.Yell;
                    delay = 0.05f;
                }
                else
                {
                    outro = Outro.AfterYell;
                    delay = 0.5f;
                }

                state   = State.Waiting;
                timeSet = fa.time;
                break;

            case Outro.AfterYell:
                outro   = Outro.DropButt;
                state   = State.Waiting;
                timeSet = fa.time;
                delay   = 0.1f;
                break;

            case Outro.DropButt:

                goldenButt.transform.SetParent(null, true);
                //goldenButt.transform.SetScaleX(12);
                //goldenButt.transform.SetScaleY(12);
                iTween.MoveTo(goldenButt, iTween.Hash("x", -2f, "y", -8.9f, "time", 1f, "easetype", iTween.EaseType.easeOutBounce));
                iTween.RotateBy(goldenButt, iTween.Hash("z", 1, "time", 1f, "easetype", iTween.EaseType.easeInOutSine));

                Fresh_SoundEffects.PlaySound(Fresh_SoundEffects.Type.MegaSatan_Bounce);

                outro   = Outro.Explode;
                state   = State.Waiting;
                timeSet = fa.time;
                delay   = 2f;
                break;

            case Outro.Explode:

                Fresh_SoundEffects.PlaySound(Fresh_SoundEffects.Type.MegaSatan_Explo);
                //ScreenShakeCamera.Screenshake(2, 0.45f, ScreenShakeCamera.ScreenshakeMethod.Basic);
                Instantiate(flameDeathExplo, outroMuzzlePoint.transform.position, outroMuzzlePoint.transform.rotation);
                Instantiate(sparksDeathExplo, outroMuzzlePoint.transform.position, outroMuzzlePoint.transform.rotation);
                Instantiate(epicDeathPinwheel, outroMuzzlePoint.transform.position, outroMuzzlePoint.transform.rotation);



                outro   = Outro.Portal;
                state   = State.Waiting;
                timeSet = fa.time;
                delay   = 3f;
                break;

            case Outro.Portal:
                portal.SetActive(true);
                outro   = Outro.End;
                state   = State.Dead;
                timeSet = fa.time;
                delay   = 1f;
                break;
            }

            break;
        }
    }