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); }
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); }