示例#1
0
        protected override EventResult OnStage(EventStage currentStage)
        {
            switch (currentStage)
            {
            case EventStage.START:
                EventState.currentEventText    = "Your landlord enters the shop.";
                EventState.currentEventOptions = EventState.CONTINUE_OPTION;
                mCurrentOptionOutcomes         = new EventStage[] { EventStage.S1 };
                break;

            case EventStage.S1:
                EventState.currentEventText    = "\"Sorry, but I can't let you stay for free again. You have to leave.\"";
                EventState.currentEventOptions = EventState.CONTINUE_OPTION;
                mCurrentOptionOutcomes         = new EventStage[] { EventStage.S2 };
                break;

            case EventStage.S2:
                EventState.currentEventText    = "You don't have enough money to pay the rent this season. The dream is dead.";
                EventState.currentEventOptions = EventState.currentEventOptions = new string[] { "Aww :(" };
                mCurrentOptionOutcomes         = new EventStage[] { EventStage.ACCEPT };
                break;

            case EventStage.ACCEPT:
                MainGameSystem.GameOver();
                return(EventResult.DONE);
            }

            return(EventResult.CONTINUE);
        }
示例#2
0
 private void mod(CommandEvent original, CommandEvent mod)
 {
     _event     = Modable.mod(original._event, mod._event);
     EventID    = Modable.mod(original.EventID, mod.EventID);
     EventGroup = Modable.mod(original.EventGroup, mod.EventGroup);
     EventStage = Modable.mod(original.EventStage, mod.EventStage);
 }
        protected override EventResult OnStage(EventStage currentStage)
        {
            switch (currentStage)
            {
            case EventStage.START:
            case EventStage.S1:
                EventState.currentEventImage   = "faceWifeHappy";
                EventState.currentEventText    = "10 years have passed.\nYou and " + NAME + " ended up getting married!";
                EventState.currentEventOptions = EventState.CONTINUE_OPTION;
                mCurrentOptionOutcomes         = new EventStage[] { EventStage.S2 };
                break;

            case EventStage.S2:
                EventState.currentEventImage   = "faceSonHappy";
                EventState.currentEventText    = "You also had a son together!\nHe's growing up quickly.";
                EventState.currentEventOptions = EventState.CONTINUE_OPTION;
                mCurrentOptionOutcomes         = new EventStage[] { EventStage.S3 };
                break;

            case EventStage.S3:
                EventState.currentEventImage   = "";
                EventState.currentEventText    = "You've been running the potion shop together with " + NAME + ", and it's still doing about as well as it was 10 years ago.";
                EventState.currentEventOptions = EventState.OK_OPTION;
                // Time skip
                GameData.singleton.yearsSkipped = 10;
                GameData.singleton.wifeMarried  = true;
                GameData.singleton.sonWasBorn   = true;
                // Start queueing events for the son
                SonEventChain.Init();
                // The son event will likely happen next, so delay the next wife event a bit longer
                EventState.PushEvent(new WifeEventFive(), GameData.singleton.quarter + 2, 0f);
                return(EventResult.DONE);
            }
            return(EventResult.CONTINUE);
        }
示例#4
0
        protected override EventResult OnStage(EventStage currentStage)
        {
            switch (currentStage)
            {
            case EventStage.START:
                EventState.currentEventText    = "Your landlord enters the shop and comes up to you.";
                EventState.currentEventOptions = EventState.CONTINUE_OPTION;
                mCurrentOptionOutcomes         = new EventStage[] { EventStage.S1 };
                return(EventResult.CONTINUE);

            case EventStage.S1:
                EventState.currentEventText = "\"Looks like you can't pay rent this season.\"";
                mCurrentOptionOutcomes      = new EventStage[] { EventStage.ACCEPT };
                return(EventResult.CONTINUE);

            case EventStage.ACCEPT:
                EventState.currentEventText    = "\"I'll give you one more chance. Don't worry about this season's rent, but if you miss next season, I'll have to evict you.\"";  // TODO: shorten, probably!
                EventState.currentEventOptions = EventState.OK_OPTION;
                EventState.PushEvent(new RestoreRentEvent(GameData.singleton.rent), GameData.singleton.quarter + 1, 0);
                GameData.singleton.rent = 0;     // forgive the rent for one season
                return(EventResult.DONE);
            }

            return(EventResult.DONE);
        }
示例#5
0
        protected override EventResult OnStage(EventStage currentStage)
        {
            switch (currentStage)
            {
            case EventStage.START:
                EventState.currentEventImage   = "facePlayerNeutral";
                EventState.currentEventText    = "You take stock of your potions. What did Dad say about this..?";
                EventState.currentEventOptions = EventState.CONTINUE_OPTION;
                mCurrentOptionOutcomes         = new EventStage[] { EventStage.S1 };
                return(EventResult.CONTINUE);

            case EventStage.S1:
                EventState.currentEventImage   = "faceGrandfather";
                EventState.currentEventText    = "\"Make new potions out of feathers! Personally, I try to replace the potions I sold last season.\"";
                EventState.currentEventOptions = EventState.CONTINUE_OPTION;
                mCurrentOptionOutcomes         = new EventStage[] { EventStage.S2 };
                return(EventResult.CONTINUE);

            case EventStage.S2:
                EventState.currentEventText    = "\"You can change the prices too. If you didn't sell much of a potion, try making it cheaper.\"";
                EventState.currentEventOptions = EventState.OK_OPTION;
                mCurrentOptionOutcomes         = new EventStage[] { EventStage.S3 };
                return(EventResult.CONTINUE);

            case EventStage.S3:
                EventState.currentEventText    = "\"Some potions just aren't as popular as others... and people's tastes can change, too. It's important to adapt!\"";
                EventState.currentEventOptions = EventState.OK_OPTION;
                EventState.PushEvent(new ExplainPeacockEvent(), 0, 0, GameStage.GS_PEACOCK);
                return(EventResult.DONE);
            }
            return(EventResult.DONE);
        }
示例#6
0
        protected override EventResult OnStage(EventStage currentStage)
        {
            switch (currentStage)
            {
            case EventStage.START:
                EventState.currentEventImage   = "facePlayerSad";
                EventState.currentEventText    = "It’s been a month since your father died and passed the family potions shop on to you.";
                EventState.currentEventOptions = EventState.CONTINUE_OPTION;
                mCurrentOptionOutcomes         = new EventStage[] { EventStage.S1 };
                return(EventResult.CONTINUE);

            case EventStage.S1:
                EventState.currentEventImage   = "facePlayerNeutral";
                EventState.currentEventText    = "Passed on for generations, it offers potions made from peacock feathers.";
                EventState.currentEventOptions = EventState.CONTINUE_OPTION;
                mCurrentOptionOutcomes         = new EventStage[] { EventStage.S2 };
                return(EventResult.CONTINUE);

            case EventStage.S2:
                EventState.currentEventImage   = "facePlayerHappy";
                EventState.currentEventText    = "Now it's your turn to keep the business alive.";
                EventState.currentEventOptions = EventState.CONTINUE_OPTION;
                mCurrentOptionOutcomes         = new EventStage[] { EventStage.S3 };
                return(EventResult.CONTINUE);

            case EventStage.S3:
                EventState.currentEventImage   = "";
                EventState.currentEventText    = "Spring starts, and customers come and go, buying the potions your father made before he passed.";
                EventState.currentEventOptions = EventState.CONTINUE_OPTION;
                mCurrentOptionOutcomes         = new EventStage[] { EventStage.S4 };
                EventState.PushEvent(new ExplainSalesEvent(), 0, 0, GameStage.GS_OVERLAY_POTION_SALES);
                return(EventResult.DONE);
            }
            return(EventResult.DONE);
        }
    protected override EventResult OnStage(EventStage currentStage)
    {
        switch (currentStage)
        {
        case EventStage.START:
            EventState.currentEventText    = string.Format("A woman approaches the counter. \"Do you have any {0} potions?\"", mPotionType.GetName().ToLower());
            EventState.currentEventOptions = new string[]
            {
                "We've run out, but you should  try again next season.",
                "We've run out, and I don't know when we'll have more."
            };
            mCurrentOptionOutcomes = new EventStage[] { EventStage.ACCEPT, EventStage.REFUSE };
            return(EventResult.CONTINUE);

        case EventStage.ACCEPT:
            EventState.currentEventText    = "\"Oh okay, I'll try again next season. Thanks!\" the woman says as she leaves.";
            EventState.currentEventOptions = EventState.OK_OPTION;
            EventState.PushEvent(new OutOfStockReturnEvent(mPotionType), GameData.singleton.quarter + 1, 0.6f);
            return(EventResult.DONE);

        case EventStage.REFUSE:
            EventState.currentEventText                = "\"Oh okay. I'll have to look elsewhere,\" she says. She takes her leave.";
            EventState.currentEventOptions             = EventState.OK_OPTION;
            GameData.singleton.storePopularity        *= 0.95f;
            GameData.singleton.outOfStockEventCooldown = GameData.singleton.quarter + 2;
            return(EventResult.DONE);
        }
        return(EventResult.CONTINUE);
    }
        protected override EventResult OnStage(EventStage currentStage)
        {
            switch (currentStage)
            {
            case EventStage.START:
                EventState.currentEventText    = "You overhear a conversation between customers...";
                EventState.currentEventOptions = EventState.CONTINUE_OPTION;
                mCurrentOptionOutcomes         = new EventStage[] { EventStage.S1 };
                break;

            case EventStage.S1:
                EventState.currentEventText    = "\"How's that rat problem you were having?\"";
                EventState.currentEventOptions = EventState.CONTINUE_OPTION;
                mCurrentOptionOutcomes         = new EventStage[] { EventStage.S2 };
                break;

            case EventStage.S2:
                EventState.currentEventText    = "\"They haven't bothered me for a while, actually.\"";
                EventState.currentEventOptions = EventState.OK_OPTION;
                GameData.singleton.productDemand[(int)PotionType.PT_POISON_POTION] -= sDemandChange;
                return(EventResult.DONE);
            }

            return(EventResult.CONTINUE);
        }
示例#9
0
 /// <summary>
 /// イベントが実行可能かどうかを返す関数
 /// </summary>
 /// <returns>イベントが実行可能か</returns>
 public bool eventExists(EventStage now_stage = EventStage.STAGE_MAX)
 {
     if (event_count <= (int)now_stage)
     {
         return(false);
     }
     return(true);
 }
        protected override EventResult OnStage(EventStage currentStage)
        {
            switch (currentStage)
            {
            case EventStage.START:
                EventState.currentEventImage = "faceWifeNeutral";
                EventState.currentEventText  = string.Format("{0} comes up to you. She suggests buying a special toy for your son's birthday.", WifeEventChain.NAME);
                if (GameData.singleton.money >= toyCost)
                {
                    EventState.currentEventOptions = new string[]
                    {
                        "Give her " + Utilities.FormatMoney(toyCost),
                        "Say you can't afford it"
                    };
                    mCurrentOptionOutcomes = new EventStage[] { EventStage.ACCEPT, EventStage.REFUSE };
                }
                else
                {
                    EventState.currentEventOptions = new string[]
                    {
                        "Say you can't afford it"
                    };
                    mCurrentOptionOutcomes = new EventStage[] { EventStage.REFUSE };
                }
                break;

            case EventStage.ACCEPT:
                EventState.currentEventImage = "faceWifeHappy";
                EventState.currentEventText  = "\"I think this will make him very happy.\" She gives you a quick kiss and leaves the shop.";
                EventState.PushEvent(new SonEventBirthday(), GameData.singleton.quarter + 1);
                GameData.singleton.wifeRelationship += 5;
                BusinessState.MoneyChangeFromEvent(-toyCost);
                EventState.currentEventOptions = EventState.CONTINUE_OPTION;
                return(EventResult.DONE);

            case EventStage.REFUSE:
                EventState.currentEventImage = "faceWifeSad";
                if (GameData.singleton.money <= toyCost * 5)
                {
                    EventState.currentEventText = "\"That's too bad. I know things are tough right now. He'll understand.\"";
                }
                else if (GameData.singleton.money >= toyCost * 10)
                {
                    EventState.currentEventText          = "\"I think we could spare it. How can you neglect our son like that?\" She goes outside.";
                    GameData.singleton.wifeRelationship -= 10;
                }
                else
                {
                    EventState.currentEventText = "\"Okay, I'll see if I can find something else myself...\" She leaves.";
                }
                EventState.currentEventOptions = EventState.CONTINUE_OPTION;
                return(EventResult.DONE);
            }

            return(EventResult.CONTINUE);
        }
        protected override EventResult OnStage(EventStage currentStage)
        {
            string potionNameLower = mPotionType.GetName().ToLower();

            switch (currentStage)
            {
            case EventStage.START:
                EventState.currentEventText    = "A familiar woman approaches the counter.";
                EventState.currentEventOptions = EventState.CONTINUE_OPTION;
                mCurrentOptionOutcomes         = new EventStage[] { EventStage.DECIDE };
                return(EventResult.CONTINUE);

            case EventStage.DECIDE:
                EventState.currentEventText = "A familiar woman approaches the counter.";
                if (mHasPotion)
                {
                    EventState.currentEventText    = string.Format("\"Hi! I was in here last season looking for a {0} potion. Do you have any now?\"", potionNameLower);
                    EventState.currentEventOptions = new string[]
                    {
                        string.Format("Sell her a {0} potion", potionNameLower),
                        "Say no"
                    };
                    mCurrentOptionOutcomes = new EventStage[] { EventStage.ACCEPT, EventStage.REFUSE };
                }
                else
                {
                    EventState.currentEventText    = string.Format("\"Hi, I was in here last season looking for a {0} potion, and you told me to return. I still don't see any, though.\"", potionNameLower);
                    EventState.currentEventOptions = new string[]
                    {
                        "Apologize"
                    };
                    mCurrentOptionOutcomes = new EventStage[] { EventStage.UNABLE };
                }
                return(EventResult.CONTINUE);

            case EventStage.ACCEPT:
                EventState.currentEventText         = "She thanks you and pays for her potion.";
                EventState.currentEventOptions      = EventState.OK_OPTION;
                GameData.singleton.storePopularity *= 1.1f;
                BusinessSystem.SellProduct((int)mPotionType);
                break;

            case EventStage.REFUSE:
                EventState.currentEventText         = "The woman is visibly annoyed. She leaves briskly.";
                EventState.currentEventOptions      = EventState.OK_OPTION;
                GameData.singleton.storePopularity *= 0.85f; EventState.currentEventText = "\"Oh okay, I'll try again next season. Thanks!\" the woman says as she leaves.";
                break;

            case EventStage.UNABLE:
                EventState.currentEventText         = "She looks disappointed as she leaves the store empty-handed.";
                EventState.currentEventOptions      = EventState.OK_OPTION;
                GameData.singleton.storePopularity *= 0.9f;
                break;
            }
            return(EventResult.DONE);
        }
    public override void WriteJson(JsonWriter writer, object value, JsonSerializer serializer)
    {
        if (!(value is EventStage))
        {
            throw new Exception("EventStage expected");
        }
        EventStage es = ((EventStage)value);

        writer.WriteValue($"{es.GroupID}.{es.StageID}");
    }
示例#13
0
    public void SetStage(EventType type)
    {
        _stageCategory = StageCategory.EVENT;
        _eventType     = type;
        EventStage eventStage = GameManager.Instance.eventManager.GetEvent(type);

        SetIcon(eventStage.icon);
        // TODO: temporary info display, beautify later
        _infoText.gameObject.SetActive(true);
        _infoText.text     = eventStage.eventName;
        _background.sprite = _eventNode;
    }
 protected override EventResult OnStage(EventStage currentStage)
 {
     switch (currentStage)
     {
     case EventStage.START:
         EventState.currentEventText    = "That festival was fun.";
         EventState.currentEventOptions = EventState.OK_OPTION;
         GameData.singleton.productDemand[(int)PotionType.PT_LUCK_POTION] -= 0.3f;
         break;
     }
     return(EventResult.DONE);
 }
    protected override EventResult OnStage(EventStage currentStage)
    {
        switch (currentStage)
        {
        case EventStage.START:
        {
            EventState.currentEventImage   = "faceOther";
            EventState.currentEventText    = "You caught a thief trying to steal some potions. What do you want to do?";
            EventState.currentEventOptions = new string[]
            {
                "Let the thief go with a warning",
                "Make an example of the thief"
            };
            mCurrentOptionOutcomes = new EventStage[] { EventStage.LET_GO, EventStage.MAKE_EXAMPLE };
            return(EventResult.CONTINUE);
        }

        case EventStage.LET_GO:
        {
            EventState.currentEventImage = "faceOther";
            EventState.currentEventText  = "The thief thanks you and promises never to steal again.";
            break;
        }

        case EventStage.MAKE_EXAMPLE:
        {
            EventState.currentEventImage   = "faceOther";
            EventState.currentEventText    = "Everyone stares as you punch the thief in the nose.";
            EventState.currentEventOptions = new string[] { "Back off", "Stick to your guns" };
            mCurrentOptionOutcomes         = new EventStage[] { EventStage.BACK_OFF, EventStage.STICK_TO };
            return(EventResult.CONTINUE);
        }

        case EventStage.BACK_OFF:
        {
            EventState.currentEventImage = "faceOther";
            EventState.currentEventText  = "The thief scrambles out of the store and people return to shopping.";
            break;
        }

        case EventStage.STICK_TO:
        {
            EventState.currentEventImage = "faceOther";
            EventState.currentEventText  = "People crowd around the thief to protect him. Some people leave the shop.";
            break;
        }
        }
        EventState.currentEventOptions = EventState.OK_OPTION;
        return(EventResult.DONE);
    }
        protected override EventResult OnStage(EventStage currentStage)
        {
            switch (currentStage)
            {
            case EventStage.START:
                EventState.currentEventImage        = "faceSonHappy";
                EventState.currentEventText         = "\"Dad! Thank you for my birthday present!\" He gives you a big hug and then runs outside.";
                EventState.currentEventOptions      = EventState.CONTINUE_OPTION;
                GameData.singleton.sonRelationship += 10;
                return(EventResult.DONE);
            }

            return(EventResult.DONE);
        }
示例#17
0
        internal static void TriggerEvent <t1>(EventStage st, Event ev) where t1 : IEventHandler
        {
            try
            {
                ev.Stage = st;

                Base.Debug($"Triggering {st} {ev.GetType().Name}");
                PluginManager.TriggerEvent <t1>(ev);
            }
            catch (Exception e)
            {
                Base.Error($"Error {st} {typeof(Event).Name}: {e.InnerException}");
            }
        }
        protected override EventResult OnStage(EventStage currentStage)
        {
            switch (currentStage)
            {
            case EventStage.START:
                EventState.currentEventText    = "Your son runs up to you while you're at the counter.";
                EventState.currentEventOptions = EventState.CONTINUE_OPTION;
                mCurrentOptionOutcomes         = new EventStage[] { EventStage.S1 };
                break;

            case EventStage.S1:
                EventState.currentEventImage   = "faceSonHappy";
                EventState.currentEventText    = "\"Daddy! What are you doing?\"";
                EventState.currentEventOptions = new string[]
                {
                    "\"Making magical potions, dear.\"",
                    "\"Adult stuff. Why don't you go play with mom?\""
                };
                mCurrentOptionOutcomes = new EventStage[] { EventStage.S2, EventStage.REFUSE };
                break;

            case EventStage.S2:
                EventState.currentEventImage   = "faceSonSurprise";
                EventState.currentEventText    = "Magical! Can you make one that makes me fly?!";
                EventState.currentEventOptions = new string[]
                {
                    "\"Why not try yourself?\"",
                    "\"Maybe later. I'm busy right now.\""
                };
                mCurrentOptionOutcomes = new EventStage[] { EventStage.ACCEPT, EventStage.REFUSE };
                break;

            case EventStage.ACCEPT:
                EventState.currentEventImage        = "";
                EventState.currentEventText         = "Excited, he grabs some empty bottles and runs over to the cauldron.";
                EventState.currentEventOptions      = EventState.OK_OPTION;
                GameData.singleton.sonRelationship += 10;
                EventState.PushEvent(new SonDropBottlesEvent(), GameData.singleton.quarter);
                return(EventResult.DONE);

            case EventStage.REFUSE:
                EventState.currentEventImage        = "faceSonSad";
                EventState.currentEventText         = "\"Okayy.\" He walks upstairs, looking dejected.";
                EventState.currentEventOptions      = EventState.OK_OPTION;
                GameData.singleton.sonRelationship -= 10;
                EventState.PushEvent(new SonEventTwo(), GameData.singleton.quarter + 2);
                return(EventResult.DONE);
            }
            return(EventResult.CONTINUE);
        }
    protected override EventResult OnStage(EventStage currentStage)
    {
        switch (currentStage)
        {
        case EventStage.START:
            EventState.currentEventText    = "The family peacock has died! The business can't go on without it.";
            EventState.currentEventOptions = new string[] { "Nooo! :(" };
            mCurrentOptionOutcomes         = new EventStage[] { EventStage.ACCEPT };
            return(EventResult.CONTINUE);

        case EventStage.ACCEPT:
            MainGameSystem.GameOver();
            return(EventResult.DONE);
        }

        return(EventResult.DONE);
    }
    protected override EventResult OnStage(EventStage currentStage)
    {
        switch (currentStage)
        {
        case EventStage.START:
            EventState.currentEventText    = "You worked the potion shop for a long time now. It's time to retire.";
            EventState.currentEventOptions = EventState.CONTINUE_OPTION;
            mCurrentOptionOutcomes         = new EventStage[] { EventStage.ACCEPT };
            return(EventResult.CONTINUE);

        case EventStage.ACCEPT:
            MainGameSystem.GameOver();
            return(EventResult.DONE);
        }

        return(EventResult.DONE);
    }
    protected override EventResult OnStage(EventStage currentStage)
    {
        switch (currentStage)
        {
        case EventStage.START:
            EventState.currentEventImage      = mPotionType.GetImage();
            EventState.currentEventImageColor = mPotionType.GetColor();
            EventState.currentEventText       = string.Format("You can now craft {0} potions.", mPotionType.GetName());
            EventState.currentEventOptions    = new string[] { "Nice!" };
            mCurrentOptionOutcomes            = new EventStage[] { EventStage.ACCEPT };
            // Actually unlock the potion
            GameData.singleton.potionsUnlocked[(int)mPotionType] = true;
            return(EventResult.DONE);
        }

        return(EventResult.DONE);
    }
    public void PlayerDecision(int choice)
    {
        // callback from the UI
        Debug.Log("Player made choice " + choice);

        if (mEventStatus == EventResult.DONE)
        {
            // return to the game (this happens *before* setting it so that events that end have a chance to display their final message
            //GameData.singleton.currentStage = mPreviousStage;
            EventEnd(choice);
            SetEventToNull();
            return;
        }

        // If not DONE, the state should change.
        mCurrentStage = mCurrentOptionOutcomes[choice];
        mEventStatus  = OnStage(mCurrentStage);
    }
        protected override EventResult OnStage(EventStage currentStage)
        {
            switch (currentStage)
            {
            case EventStage.START:
                EventState.currentEventText    = "You overhear a conversation between customers...";
                EventState.currentEventOptions = EventState.CONTINUE_OPTION;
                mCurrentOptionOutcomes         = new EventStage[] { EventStage.S1 };
                break;

            case EventStage.S1:
                EventState.currentEventText    = string.Format("\"I can't wait for next year's summer festival!\"");
                EventState.currentEventOptions = EventState.CONTINUE_OPTION;
                mCurrentOptionOutcomes         = new EventStage[] { EventStage.S2 };
                break;

            case EventStage.S2:
                EventState.currentEventText    = string.Format("\"Yes! I love trying my luck at all the little games they set up.\"");
                EventState.currentEventOptions = EventState.CONTINUE_OPTION;
                mCurrentOptionOutcomes         = new EventStage[] { EventStage.S3 };
                break;

            case EventStage.S3:
                EventState.currentEventText    = string.Format("\"Not to mention the big lottery at the end.\"");
                EventState.currentEventOptions = EventState.CONTINUE_OPTION;
                mCurrentOptionOutcomes         = new EventStage[] { EventStage.S4 };
                break;

            case EventStage.S4:
                EventState.currentEventText    = string.Format("\"Fingers crossed for that!\"");
                EventState.currentEventOptions = EventState.CONTINUE_OPTION;
                mCurrentOptionOutcomes         = new EventStage[] { EventStage.S5 };
                break;

            case EventStage.S5:
                EventState.currentEventText    = string.Format("The customers return to their shopping.");
                EventState.currentEventOptions = EventState.OK_OPTION;
                GameData.singleton.productDemand[(int)PotionType.PT_LUCK_POTION] += 0.1f;     // increase demand now, so that it takes effect in the spring
                EventState.PushEvent(new FestivalReminderEvent(), GameData.singleton.quarter + 1);
                return(EventResult.DONE);
            }

            return(EventResult.CONTINUE);
        }
        protected override EventResult OnStage(EventStage currentStage)
        {
            switch (currentStage)
            {
            case EventStage.START:
                EventState.currentEventImage = "faceWifeHappy";
                if (GameData.singleton.wifeUsedLovePotion)
                {
                    EventState.currentEventText = "Despite being under the influence of a love potion for the first date, you and " + NAME + " ended up going on many more dates and growing quite close.";
                }
                else
                {
                    EventState.currentEventText = "You and " + NAME + " ended up going on many dates and growing quite close.";
                }
                EventState.currentEventOptions = EventState.OK_OPTION;
                mCurrentOptionOutcomes         = new EventStage[] { EventStage.S1 };
                break;

            case EventStage.S1:
                EventState.currentEventImage   = "faceWifeHappy";
                EventState.currentEventText    = "\"Hi again! Did you know that Ancadian Peacocks will grow more feathers of a given color depending on the season?\"";
                EventState.currentEventOptions = new string[] { "Neat!", "Oh yea, I noticed that" };
                mCurrentOptionOutcomes         = new EventStage[] { EventStage.S2, EventStage.S2 };
                break;

            case EventStage.S2:
                EventState.currentEventImage   = "faceWifeNeutral";
                EventState.currentEventText    = "\"It's a remarkable bird. There are other factors that affect the color of their feathers too, but I haven't figured it all out yet.\"";
                EventState.currentEventOptions = EventState.CONTINUE_OPTION;
                mCurrentOptionOutcomes         = new EventStage[] { EventStage.S3 };
                break;

            case EventStage.S3:
                EventState.currentEventImage   = "faceWifeHappy";
                EventState.currentEventText    = "\"Anyways, enough about the bird. I'm looking forward to seeing you tonight!\"";
                EventState.currentEventOptions = new string[] { "Me too!" };
                // Queue an event for the start of the next quarter
                EventState.PushEvent(new WifeEventMarriage(), GameData.singleton.quarter + 1, 0f);
                return(EventResult.DONE);
            }
            return(EventResult.CONTINUE);
        }
        protected override EventResult OnStage(EventStage currentStage)
        {
            switch (currentStage)
            {
            case EventStage.START:
                EventState.currentEventImage   = "faceOther";
                EventState.currentEventText    = "A man approaches you at the counter. He looks familiar. \"I'm back from my business venture!\"";
                EventState.currentEventOptions = new string[] { "Continue" };
                mCurrentOptionOutcomes         = new EventStage[] { EventStage.S2 };
                break;

            case EventStage.S2:
                EventState.currentEventImage   = "faceOther";
                EventState.currentEventText    = string.Format("\"Didn't I tell you you wouldn't regret it?\" He hands you {0}, then goes on his way.", Utilities.FormatMoney(COST));
                EventState.currentEventOptions = EventState.OK_OPTION;
                BusinessState.MoneyChangeFromEvent(COST * 2);
                return(EventResult.DONE);
            }
            return(EventResult.CONTINUE);
        }
        protected override EventResult OnStage(EventStage currentStage)
        {
            switch (currentStage)
            {
            case EventStage.START:
                EventState.currentEventText    = "The summer festival is next season!";
                EventState.currentEventOptions = EventState.CONTINUE_OPTION;
                mCurrentOptionOutcomes         = new EventStage[] { EventStage.S5 };
                break;

            case EventStage.S5:
                EventState.currentEventText    = "Maybe I should go.";
                EventState.currentEventOptions = EventState.OK_OPTION;
                GameData.singleton.productDemand[(int)PotionType.PT_LUCK_POTION] += 0.2f;     // increase demand even more for the festival itself
                EventState.PushEvent(new FestivalOverEvent(), GameData.singleton.quarter + 2);
                return(EventResult.DONE);
            }

            return(EventResult.CONTINUE);
        }
示例#27
0
    public EventStage EventStage(string key)
    {
        string[]   keyparts = key.Split('.');
        EventStage result   = null;

        if (keyparts.Length == 2)
        {
            EventGroup eventGroup = this[keyparts[0]];
            EventStage eventStage = eventGroup[keyparts[1]];
            if (eventStage == null)
            {
                throw new GameException($"Failed to load EventStage {keyparts[1]} in {keyparts[0]}");
            }
            result         = eventStage;
            result.GroupID = keyparts[0];
            result.StageID = keyparts[1];
        }
        else if (keyparts.Length == 1)
        {
            Debug.LogWarning($"Malformed EventStage Key '{key}', assuming '{key}.'");
            EventGroup eventGroup = this[key];
            EventStage eventStage = eventGroup[""];

            result         = eventStage;
            result.GroupID = key;
            result.StageID = "";
        }

        result = Modable.copyDeep(result);

        result.inherit();

        /*foreach(string InheritID in result.InheritIDs)
         * {
         *  result = Modable.mod(EventStage(InheritID), result);
         * }*/



        return(result);
    }
        protected override EventResult OnStage(EventStage currentStage)
        {
            switch (currentStage)
            {
            case EventStage.START:
                EventState.currentEventText    = "You hear a crash from across the store. You glance over and see that your son knocked over some potions.";
                EventState.currentEventOptions = EventState.CONTINUE_OPTION;
                mCurrentOptionOutcomes         = new EventStage[] { EventStage.S1 };
                break;

            case EventStage.S1:
                EventState.currentEventImage   = "faceSonSad";
                EventState.currentEventText    = "\"Waaah! I- I didn't mean to!\"";
                EventState.currentEventOptions = EventState.CONTINUE_OPTION;
                mCurrentOptionOutcomes         = new EventStage[] { EventStage.S2 };
                EventState.currentEventOptions = new string[]
                {
                    "Console him and clean up the mess",
                    "Tell him to go upstairs"
                };
                mCurrentOptionOutcomes = new EventStage[] { EventStage.GO_CLEAN, EventStage.GO_OUTSIDE };
                break;

            case EventStage.GO_CLEAN:
                EventState.currentEventImage   = "faceSonNeutral";
                EventState.currentEventText    = "He fetches a broom and helps you clean up. Then he decides to go outside.";
                EventState.currentEventOptions = EventState.OK_OPTION;
                EventState.PushEvent(new SonEventTwo(), GameData.singleton.quarter + 2);     // schedule another event for next quarter
                GameData.singleton.sonRelationship += 5;
                return(EventResult.DONE);

            case EventStage.GO_OUTSIDE:
                EventState.currentEventImage   = "faceSonSad";
                EventState.currentEventText    = "He sniffles and heads upstairs.";
                EventState.currentEventOptions = EventState.OK_OPTION;
                EventState.PushEvent(new SonEventTwo(), GameData.singleton.quarter + 2);     // schedule another event for next quarter
                GameData.singleton.sonRelationship -= 5;
                return(EventResult.DONE);
            }
            return(EventResult.CONTINUE);
        }
        protected override EventResult OnStage(EventStage currentStage)
        {
            switch (currentStage)
            {
            case EventStage.START:
                EventState.currentEventImage = "facePlayerNeutral";
                EventState.currentEventText  = "\"Ah, " + NAME + "'s birthday is coming up!\"";
                if (GameData.singleton.money > COST)
                {
                    EventState.currentEventOptions = new string[]
                    { string.Format("Buy her a gift (-{0})", Utilities.FormatMoney(COST)), "I don't have any money to spare" };
                    mCurrentOptionOutcomes = new EventStage[] { EventStage.ACCEPT, EventStage.REFUSE };
                }
                else
                {
                    EventState.currentEventOptions = new string[] { "I don't have any money to spare" };
                    mCurrentOptionOutcomes         = new EventStage[] { EventStage.REFUSE };
                }

                break;

            case EventStage.ACCEPT:
                BusinessState.MoneyChangeFromEvent(-COST);
                GameData.singleton.wifeRelationship += 11f;
                EventState.currentEventImage         = "facePlayerHappy";
                EventState.currentEventText          = "\"I know just the thing to get! I hope she likes it.\"";
                EventState.currentEventOptions       = new string[]
                { "Ok" };
                return(EventResult.DONE);

            case EventStage.REFUSE:
                GameData.singleton.wifeRelationship -= 1f;
                EventState.currentEventImage         = "facePlayerNeutral";
                EventState.currentEventText          = "\"Hopefully she doesn't mind.\"";
                EventState.currentEventOptions       = new string[]
                { "Ok" };
                return(EventResult.DONE);
            }
            return(EventResult.CONTINUE);
        }
        protected override EventResult OnStage(EventStage currentStage)
        {
            switch (currentStage)
            {
            case EventStage.START:
                EventState.currentEventImage   = "faceOther";
                EventState.currentEventText    = "Someone approaches you at the counter. \"I have a proposition for you.\"";
                EventState.currentEventOptions = new string[] { "Go on..." };
                mCurrentOptionOutcomes         = new EventStage[] { EventStage.DECIDE };
                break;

            case EventStage.DECIDE:
                EventState.currentEventImage   = "faceOther";
                EventState.currentEventText    = string.Format("I've got an investment opportunity. Lend me {0}, and I'll pay you back double.", Utilities.FormatMoney(COST));
                EventState.currentEventOptions = new string[]
                {
                    "Accept the deal",
                    "Refuse"
                };
                mCurrentOptionOutcomes = new EventStage[] { EventStage.ACCEPT, EventStage.REFUSE };
                break;

            case EventStage.ACCEPT:
                EventState.currentEventImage = "faceOther";
                EventState.currentEventText  = string.Format("\"You won't regret this!\", he says. He takes your {0} and leaves.", Utilities.FormatMoney(COST));
                EventState.PushEvent(new InvestmentReturnEvent(), GameData.singleton.quarter + 4);
                BusinessState.MoneyChangeFromEvent(-COST);
                EventState.currentEventOptions = EventState.OK_OPTION;
                return(EventResult.DONE);

            case EventStage.REFUSE:
                EventState.currentEventImage   = "faceOther";
                EventState.currentEventText    = "\"Suit yourself...\", he says. He leaves without another word.";
                EventState.currentEventOptions = EventState.OK_OPTION;
                return(EventResult.DONE);
            }

            return(EventResult.CONTINUE);
        }