public override void PlayEvent() { Text = "The shoes go *shoop*"; EventActor = Actors.AI_BaseStation(); { var choice = NewChoice("[relieved] affirmative."); choice.OnChoiceSelected += (Choice c) => { State.State_Shoes = E_ThrowawayState.ThrownInHomeStation; var item_state_a = State.State_Headset; var item_state_b = State.State_Phone_A_Scott; if (item_state_a == E_ThrowawayState.OnFloor || item_state_b == E_ThrowawayState.OnFloor && item_state_a != E_ThrowawayState.PickedUp && item_state_b != E_ThrowawayState.PickedUp) { StoryManager.AddNextEvent <BaseStation_Dispose_Bedroom_Half_1>(); } else if (item_state_a == E_ThrowawayState.PickedUp || item_state_b == E_ThrowawayState.PickedUp || item_state_a == E_ThrowawayState.ThrownInHomeStation || item_state_b == E_ThrowawayState.ThrownInHomeStation) { StoryManager.AddNextEvent <BaseStation_Interaction_Return>(); } }; } }
public static void ScriptedKeyItem(Client client, KeyItem keyItem, int slot) { switch (keyItem.ItemID) { case 1839: // Costume box { Messenger.SendAvailableCostumes(client); } break; case 1842: // Drif-Flute { if (client.Player.Map.Indoors || client.Player.Map.MapType != Enums.MapType.Standard) { var story = new Story(); var segment = StoryBuilder.BuildStory(); StoryBuilder.AppendSaySegment(segment, "It's probably a bad idea to use that here.", client.Player.GetActiveRecruit().Species, 0, 0); segment.AppendToStory(story); StoryManager.PlayStory(client, story); return; } if (client.Player.OutlawRole == Enums.OutlawRole.Outlaw && IsOutlawPlayerInRange(client, 30, Enums.OutlawRole.Hunter)) { Messenger.StoryMessage(client, "It's not safe to use that now! A hunter is nearby!"); return; } Messenger.SendAvailableFlyPoints(client); } break; } }
public StoryManager() { instance = this; EventSystem.Instance.addEventListener(StoryEvent.STORY_STEP_FINISH, onStoryStepFinish); EventSystem.Instance.addEventListener(StoryEvent.STORY_SKIP, onStorySkip); }
public void OnTriggerEnter2D(Collider2D collider) { StoryManager manager = StoryManager.GetSingleton(); manager.SetInt("player_money", manager.GetInt("player_money") + moneyAmount); Destroy(gameObject); }
//导出工程 private void ExportScriptsTo(string dir) { //资源 ResourceManager.Export(dir); //地图 MapEventsManager.Export(dir); //剧本 StoryManager.Export(dir); //人物 RoleManager.Export(dir); //技能 SkillManager.Export(dir); //物品 ItemManager.Export(dir); //战斗 BattleManager.Export(dir); MessageBox.Show("保存成功!"); }
void Start() { localisedName = GetComponent <LocalisedName> (); originalName = localisedName.key; soundManager = GameObject.Find("GameManager").GetComponent <SoundManager> (); storyManager = GameObject.Find("GameManager").GetComponent <StoryManager> (); }
public void LoadScreen(string screenName) { Initialize(); screenName = screenName.ToLower(); ClearScreen(); if (!screens.ContainsKey(screenName)) { Debug.LogError("Story Screen named [" + screenName + "] was not found!"); return; } currentScreen = screens[screenName]; StoryManager.MarkStoryAsRead(screenName); isScreenFinished = false; isFinished = false; Background.sprite = currentScreen.BackgroundImage != null ? currentScreen.BackgroundImage : StoryManager.Instance.DefaultBackground; if (currentScreen.Music != null) { FMODManager.Play(currentScreen.Music.Value); } else if (currentScreen.StopMusic) { FMODManager.StopMusic(); } gameObject.SetActive(true); }
private void ApplyDoctorSelectingState(Client client) { client.Player.Muted = true; var story = new Story(Guid.NewGuid().ToString()); var segment = StoryBuilder.BuildStory(); StoryBuilder.AppendSaySegment(segment, "Night has fallen!", -1, 0, 0); StoryBuilder.AppendSaySegment(segment, "The doctor must now decide who to save.", -1, 0, 0); if (Data.ExtendPlayer(client).Role == UserRole.Doctor) { StoryBuilder.AppendSaySegment(segment, "You are the doctor. Make your decision with /wchoose.", -1, 0, 0); } StoryBuilder.AppendSaySegment(segment, "Everyone is muted while the doctor decides.", -1, 0, 0); if (IsRoleDead(UserRole.Doctor)) { StoryBuilder.AppendPauseAction(segment, 5000); } segment.AppendToStory(story); StoryManager.PlayStory(client, story); }
private void PullLever() { if (this.orbs.Count == 2) { StoryManager storyManager = FindObjectOfType <StoryManager>(); if (storyManager.storyBeat == StoryManager.Beat.TUTORIAL_SUMMON_MONSTER_INSTRUCTIONS) { Orb.OrbColor a = this.orbs[0].orbColor; Orb.OrbColor b = this.orbs[1].orbColor; if (!(a == Orb.OrbColor.BROWN && b == Orb.OrbColor.RED || a == Orb.OrbColor.RED && b == Orb.OrbColor.BROWN)) { this.orbs[0].item.ReturnToLab(); this.orbs[1].item.ReturnToLab(); this.orbs.Clear(); this.state = State.OPEN; storyManager.state = StoryManager.State.PROMPT; return; } } this.voidSoundTime = 1f; this.leverCount = !this.leverCount; this.audioSource.PlayOneShot(leverCount ? this.lever1Sound : this.lever2Sound, 0.5f); this.state = State.CLOSING; this.orbs[0].item.MachineLeverPull(orbPath); this.orbs[1].item.MachineLeverPull(orbPath); } }
// Use this for initialization void Start() { switch (StoryManager.GetInstance().kokoko) { case 0: //stołówka, intensywna terapia lol.text = "Szokująca wiadomość! W wyniku awarii w szpitalu zginęło 32 dzieci." + "Inkubatory nie były zasilane, co doprowadziło do śmierci noworodków."; break; case 1: //duży pokój (Dimitrij) lol.text = "Szokująca wiadomość! W wyniku awarii w szpitalu zginęło 54 ludzi." + "Maszyny podtrzymujące życie nie były zasilane, co doprowadziło do zgonu pacjentów."; break; case 2: //koniec korytarza lol.text = "Szokująca wiadomość! W wyniku awarii w szpitalu zginęło 86 ludzi w tym 32 dzieci." + "Inkubatory i maszyny podtrzymujące życia nie były zasilane, co doprowadziło do śmierci pacjentów." + "Z magazynu w szpitalu zginęły przy okazji leki oraz spirytus. Służby podejrzewają o współudział w kradzieży elektryka Elektrija, który był obecny w dniu awarii w budynku."; break; case 3: //na lewo (agregat) lol.text = "Szokująca wiadomość! W wyniku awarii zasilania w więzieniu doszło do ucieczki stulecia." + "Prawie połowa więźniów uciekła i znajduje się teraz na wolności. Uprasza się o zachowanie ostrożności poruszając się dzisiaj po terenie miasta."; break; case 4: //na prawo (bramy) lol.text = "Szokująca wiadomość! W wyniku awarii zasilania w więzieniu doszło do śmierci 15 więźniów, którzy znajdowali się na skrzydle szpitalnym."; break; } }
private void ApplyVillagerSelectingState(Client client) { var chosenUser = ClientManager.FindClientFromCharID(Data.WerewolfKilledUser); var story = new Story(Guid.NewGuid().ToString()); var segment = StoryBuilder.BuildStory(); StoryBuilder.AppendSaySegment(segment, "Daytime has arrived!", -1, 0, 0); StoryBuilder.AppendSaySegment(segment, "While you slept, werewolves attacked.", -1, 0, 0); if (!Data.ExtendPlayer(Data.WerewolfKilledUser).IsDead) { StoryBuilder.AppendSaySegment(segment, "...however, the doctor protected the village, and no one was hurt!", -1, 0, 0); } else { if (chosenUser == null) { StoryBuilder.AppendSaySegment(segment, $"Character {Data.WerewolfKilledUser} was killed. They logged off in fear.", -1, 0, 0); } else { StoryBuilder.AppendSaySegment(segment, $"{chosenUser.Player.DisplayName} was killed in the attack. They were a {Data.ExtendPlayer(chosenUser).Role}!", -1, 0, 0); } } StoryBuilder.AppendSaySegment(segment, "Now, you must stop the werewolves!", -1, 0, 0); StoryBuilder.AppendSaySegment(segment, "Who will be killed? Make your decision with /wchoose.", -1, 0, 0); StoryBuilder.AppendSaySegment(segment, "None shall rest until a majority decision is made.", -1, 0, 0); segment.AppendToStory(story); StoryManager.PlayStory(client, story); }
public bool isEnabled() { Ink.Runtime.Story story = StoryManager.GetSingleton().GetStory(); var storyValue = story.variablesState[savedName]; if (!multiple && storyValue != null && (int)storyValue > 0) { return(false); } if (parsedCondition == null && condition != null && condition != "") { parsedCondition = ConditionParser.parseCondition(condition); } if (cost > (int)story.variablesState["player_money"]) { return(false); } if (parsedCondition == null) { return(true); } else { return(parsedCondition.evaluate(new GameState(story))); } }
public void Buy() { Ink.Runtime.Story story = StoryManager.GetSingleton().GetStory(); story.variablesState["player_money"] = (int)story.variablesState["player_money"] - cost; story.variablesState[savedName] = (int)story.variablesState[savedName] + (multiple ? quantity : 1); }
public override void PlayEvent() { Text = "The vaper goes *shoop*"; EventActor = Actors.AI_BaseStation(); { var choice = NewChoice("[relieved] affirmative."); choice.OnChoiceSelected += (Choice c) => { State.State_Vape = E_ThrowawayState.ThrownInHomeStation; var item_state_a = State.State_Phone_B_Jen; var item_state_b = State.State_Capsules_B; if (item_state_a == E_ThrowawayState.OnFloor || item_state_b == E_ThrowawayState.OnFloor && item_state_a != E_ThrowawayState.PickedUp && item_state_b != E_ThrowawayState.PickedUp) { StoryManager.AddNextEvent <BaseStation_Go_Find_Trash_Bathroom_Hurry>(); } else if (item_state_a == E_ThrowawayState.PickedUp || item_state_b == E_ThrowawayState.PickedUp || item_state_a == E_ThrowawayState.ThrownInHomeStation || item_state_b == E_ThrowawayState.ThrownInHomeStation) { StoryManager.AddNextEvent <BaseStation_Interaction_Return>(); } }; } }
private void Start() { city = GameObject.FindObjectOfType <City>(); manager = FindObjectOfType <StoryManager>(); editStr = ""; isOn = false; }
void Start() { CardGameVariables oponent = GetOponent(CardGameInitializer.playerName); deck = new Deck(oponent.deckSkin ?? deckSkin); players = new PlayerLogic[] { //BuildPlayerLogic(playerHand, playerMoney, oponent, "SmartAI", defaultAIData), new HumanPlayerLogic(0, playerHand, foldButton, guiTransform, bidPreview, multiplier, multiplierShow, multiplierImages, cardSelection, playerMoney), BuildPlayerLogic(oponentHand, oponentMoney, oponent, "SmartAI", defaultAIData), }; var story = StoryManager.GetSingleton().GetStory(); if (story != null) { players[0].AdjustMoney((int)(story.variablesState["player_money"] ?? 1000) - players[0].money); if (oponent.oponentMoneyStore != null) { players[1].AdjustMoney((int)story.variablesState[oponent.oponentMoneyStore] - players[1].money); } } foreach (PlayerLogic logic in players) { logic.hand.UseBack(oponent.deckSkin == null ? deckSkin.back : oponent.deckSkin.back); } StartHand(); }
void Awake() { //self init Dispatcher = new UIDispather(this); //game init ResourceManager.Init(); //AudioManager.Init (this); //AnimationManager.Init(); SkillManager.Init(); //ItemManager.Init(); RoleManager.Init(); //ShopManager.Init(); //SellShopManager.Init(); MapEventsManager.Init(); //BattleManager.Init(); //TowerManager.Init(); StoryManager.Init(this); TaskManager.Init(this); //TimeTriggerManager.Init(); //boost game this.reset(); RuntimeData.Instance.Init(); RuntimeData.Instance.storyGameEngine = new StoryGameEngine(this); //mainMenu.Load(); //各模块赋初值 taskUI.taskGrid.Show(TaskManager.drawTasks()); trainUI.Show(); //开始测试 storyMode(); RuntimeData.Instance.storyGameEngine.NewGame(); }
private static void RunProblems(Problem problem, StoryManager storyManager, IList <int> options, string storyName) { Console.WriteLine(problem.Text); Console.WriteLine(); if (problem.Options == null || problem.Options.Count == 0) { return; } foreach (ReadModel.Option option in problem.Options) { Console.WriteLine("{0}) {1}", option.Number, option.Text); } int chosenOption = 0; while (!int.TryParse(Console.ReadLine(), out chosenOption) || problem.Options.All(op => op.Number != chosenOption)) { Console.WriteLine("Invalid option."); } options.Add(chosenOption); var nextProblem = storyManager.GetNextProblem(storyName, options); RunProblems(nextProblem, storyManager, options, storyName); }
private UIController UIController; //!< UIController object. //! sets UIController object and interaction once all objects initialised. public void Awake() { layerMask = gameObject.layer; InventoryList = new List <Clue>(); UIController = GameObject.FindGameObjectWithTag("DoozyUI").GetComponent <UIController>().Instance; StoryManager = GameObject.FindGameObjectWithTag("StoryManager").GetComponent <StoryManager>(); }
// Get's run on game start by Unity public void Start() { Story = StoryManager.Instance; // Start the game loop Invoke("OnStoryStateChanged", 1.8f); }
public JsonResult AddLike(int StoryID) { StoryManager sm = new StoryManager(); int LikeCount = sm.AddLike(StoryID); return(Json(LikeCount)); }
void Awake() { if (!Instance) { Instance = this; } }
void Awake() { _uIManager = _managers.uiManager; _storyManager = _managers.storyManager; _spawnManager = _managers.spawnManager; GameManager oldManager = registerManager <GameManager>("old"); if (oldManager) { setHighScore(oldManager.getHighScore()); setMode(oldManager.getMode()); if (oldManager.isEndlessModeUnlocked()) { unlockEndlessMode(); } Destroy(oldManager.gameObject); } MainMenu mainMenu = registerManager <MainMenu>("Canvas"); if (mainMenu) { setMode(mainMenu.getMode()); setDebug(mainMenu.debugMode()); Destroy(mainMenu.gameObject); } }
public override void PlayEvent() { EventActor = Actors.AI_Alinna(); if (State.IntroState == E_AlinnaState.PsychoAIRevealed && State.Door_A_State != E_DoorState.ShutHard) { Text = "I need you to listen to me.\n\nFor the both of us."; State.Door_A_State = E_DoorState.ShutHard; { var choice = NewChoice("[...] acknowledged."); choice.OnChoiceSelected += (Choice c) => { }; } } else if (State.Door_A_State == E_DoorState.Unlocked) { // Instantly close the current event and set the door to be opened Text = "..."; StoryManager.CloseCurrentEvent(); State.Door_A_State = E_DoorState.Open; } else { // Instantly close the current event Text = "..."; StoryManager.CloseCurrentEvent(); } }
public static void OnStep(Client client, PacketHitList hitlist) { // NOTE: Remove the mapper+ check for release if (exPlayer.Get(client).AnniversaryEnabled&& client.Player.CurrentChapter == null && Ranks.IsAllowed(client, Enums.Rank.Mapper)) { int currentAnniversarySection = client.Player.StoryHelper.ReadSetting("[Anniversary12]-CurrentSection").ToInt(); //Messenger.PlayerMsg(client, "Section: " + currentAnniversarySection, Text.BrightRed); // NOTE: Do /not/ remove the mapper+ check here, this resets the story when you reach the end if (currentAnniversarySection == annivRiddles.Length && Ranks.IsAllowed(client, Enums.Rank.Mapper)) { currentAnniversarySection = 0; client.Player.StoryHelper.SaveSetting("[Anniversary12]-CurrentSection", currentAnniversarySection.ToString()); Messenger.PlayerMsg(client, "Section reset!", Text.BrightRed); } if (currentAnniversarySection >= 0 && currentAnniversarySection < annivRiddles.Length) { AnniversaryRiddle currentRiddle = annivRiddles[currentAnniversarySection]; if (client.Player.MapID == currentRiddle.MapId && client.Player.X == currentRiddle.X && client.Player.Y == currentRiddle.Y) { client.Player.SetStoryState(currentRiddle.Story - 1, false); StoryManager.PlayStory(client, currentRiddle.Story - 1); currentAnniversarySection++; client.Player.StoryHelper.SaveSetting("[Anniversary12]-CurrentSection", currentAnniversarySection.ToString()); } } } if (exPlayer.Get(client).StoryEnabled&& client.Player.CurrentChapter == null) { int currentStorySection = client.Player.StoryHelper.ReadSetting("[MainStory]-CurrentSection").ToInt(); switch (client.Player.MapID) { case "s737": { if (currentStorySection == 3) // Tiny Grotto complete, first time [Bulbasaur mission] { if (client.Player.X > 20 && client.Player.X < 35 && client.Player.Y > 43) { if (client.Player.GetDungeonCompletionCount(1 - 1) >= 1) { StoryManager.PlayStory(client, 614 - 1); } } } } break; case "s1934": { if (currentStorySection == 6) { if (client.Player.X == 10 && client.Player.Y == 9) { StoryManager.PlayStory(client, 616 - 1); } } } break; } } }
public void DisplayChoices(List <Choice> choices, StoryManager storyManager) { buttonsFaded = 0; for (var i = 0; i < buttons.Length && i < choices.Count; i++) { var choiceButton = buttons[i]; var choice = choices[i]; choiceButton.gameObject.SetActive(true); choiceButton.interactable = true; choiceButton.GetComponent <CanvasGroup>().alpha = 1.0f; var choiceText = choiceButton.GetComponentInChildren <Text>(); choiceText.text = choice.text; UnityAction selectChoice = delegate { storyManager.SelectChoice(choice.index); }; var selctedIndex = i; choiceButton.onClick.AddListener(delegate { StartCoroutine(SelectChoiceAnimation(selectChoice, selctedIndex)); }); } }
// What happens when this event is played public override void PlayEvent() { // The UI skin (and ~portrait~) of this event is set to that of Alinna. // Check out Assets/StoryTools/Core/Actors.cs for a list of all available actors EventActor = Actors.AI_Alinna(); // Normally you could just add some choices and be done with it, this door is special though // It first checks what the state of the story is, then changes what the event reads and what choices to display // Ask the "State" (where all StoryState is being stored) if Door_A is currently locked (by default it is) if (State.Door_A_State == E_DoorState.Locked) { // If it's locked, the event text becomes: Text = "I don’t think you’re done yet."; // And add a single choice button to this event, it does nothing it just reads this text NewChoice("[sad] affirmative."); } // Is the door ShutHard (happens at the end of the game where doors close after you go through them) else if (State.Door_A_State == E_DoorState.ShutHard) { // Change the text Text = "Just hurry."; // Adds a preset Choice text NewContinueChoice(); } else { // Should no longer be interactable Text = "..."; StoryManager.CloseCurrentEvent(); } }
public override void PlayEvent() { EventActor = Actors.AI_Alinna(); if (State.IntroState == E_AlinnaState.PsychoAIRevealed && State.Door_B_State != E_DoorState.ShutHard) { Text = "I can tell your battery is getting low. \n\nPlease proceed to your charging station."; State.Door_B_State = E_DoorState.ShutHard; { var choice = NewChoice("affirmative."); choice.OnChoiceSelected += (Choice c) => { }; } } else if (State.Door_B_State == E_DoorState.Unlocked) { Text = "Dummy Text."; StoryManager.CloseCurrentEvent(); State.Door_B_State = E_DoorState.Open; } else { Text = "Dummy Text."; StoryManager.CloseCurrentEvent(); } }
// OnStateEnter is called when a transition starts and the state machine starts to evaluate this state override public void OnStateEnter(Animator animator, AnimatorStateInfo stateInfo, int layerIndex) { if (storyManager == null) { storyManager = FindObjectOfType <StoryManager>(); } }
public Orb MakeGhostOrb(Orb primaryOrb, Orb[] otherOrbs) { StoryManager storyManager = FindObjectOfType <StoryManager>(); if (storyManager.storyBeat == StoryManager.Beat.FREE_PLAY_2) { storyManager.GotoBeat(StoryManager.Beat.INTERLUDE_2_PABS_EMERGE, 2f); } Orb ghostOrb = this.inactiveGhostOrbs.Pop(); ghostOrb.AddChildOrb(primaryOrb); for (int i = 0; i < otherOrbs.Length; i++) { ghostOrb.AddChildOrb(otherOrbs[i]); } primaryOrb.item.state = Item.State.TRANSFORMED; for (int i = 0; i < otherOrbs.Length; i++) { otherOrbs[i].item.state = Item.State.TRANSFORMED; } ghostOrb.item.transform.position = primaryOrb.transform.position; ghostOrb.item.initialPosition = ghostOrb.item.transform.position; return(ghostOrb); }