protected override async Task Talk() { // Unofficial Msg("My hero! How can I ever repay you for this... How about a reward?", Button("Some gold maybe?", "@gold"), Button("An item!", "@item")); var reward = await Select(); if (!HasKeyword("TirChonaill_Tutorial_Judging") && !HasKeyword("TirChonaill_Tutorial_Perceiving")) { if (reward == "@gold") { Msg("Some money? Of course, here you go."); GiveGold(1000); GiveKeyword("TirChonaill_Tutorial_Judging"); } else if (reward == "@item") { Msg("Please take this, may it bring you luck."); GiveItem(16009); GiveKeyword("TirChonaill_Tutorial_Perceiving"); } } GiveKeyword("Clear_Tutorial_Alby_Dungeon"); Msg("Thank you so much, now let's leave this horrible place...", Button("End Conversation")); await Select(); Close2(); var cutscene = new Cutscene("tuto_result", Player); cutscene.AddActor("me", Player); cutscene.AddActor("#lostresident", 1002); cutscene.Play(_ => WarpToRewardRoom()); }
/// <summary> /// Create a new Track Group. /// </summary> /// <param name="cutscene">The cutscene that this Track Group will be attached to.</param> /// <param name="type">The type of the new track group.</param> /// <param name="label">The name of the new track group.</param> /// <returns>The new track group. Reminder: Register an Undo.</returns> public static TrackGroup CreateTrackGroup(Cutscene cutscene, Type type, string label) { // Create the director group. GameObject trackGroupGO = new GameObject(label, type); trackGroupGO.transform.parent = cutscene.transform; return trackGroupGO.GetComponent<TrackGroup>(); }
public void PlayCutscene(Cutscene cutscene) { Debug.Assert(!this.cutscene); this.cutscene = Instantiate(cutscene); Refresh(); }
public override void LoadEvents() { // "Altar" near Tin OnClientEvent(0x00B0007D0001009C, SignalType.Enter, (creature, eventData) => { // Only do this once. if (creature.Vars.Perm["TinCutscene"] != null) return; if (!creature.Quests.Has(1000001)) creature.Quests.Start(1000001); // Nao's Letter of Introduction var cutscene = new Cutscene("tuto_meet_tin", creature); cutscene.AddActor("me", creature); cutscene.AddActor("#tin", creature.Region.GetCreature("_tin")); cutscene.Play((scene) => { // Give first weapon if(creature.RightHand == null) creature.Inventory.Add(40005, Pocket.RightHand1); // Short Sword // Set as soon as the player got everything creature.Vars.Perm["TinCutscene"] = true; // Required to remove the fade effect. scene.Leader.Warp(125, 22930, 75423); }); }); }
static CutsceneRepository() { Cutscenes = new List<Cutscene>(); var cut1 = new Cutscene(""); //cut1.AddCamera("Main", Vector3.Zero, Vector3.Zero) // .AddObject() }
public static void setCutscene(Cutscene cutscene) { ModeSwitch.switchCutsceneOn(); instance.currentCutscene = cutscene; instance.cutsceneStep = 0; CutsceneStep step = instance.currentCutscene.cutsceneSteps[0]; instance.textBox.setText(step.text, step.speaker); }
void Awake() { current = this; audiosource = GetComponent<AudioSource> (); rt = GetComponent<RectTransform>(); rim = GetComponent<RawImage>(); origPos = rt.anchoredPosition; rim.enabled = false; mt = (MovieTexture)rim.mainTexture; }
public override void OnBoss(Dungeon dungeon) { dungeon.AddBoss(20201, 3); // Hellhound foreach (var member in dungeon.Party) { var cutscene = new Cutscene("bossroom_HellHound", member); cutscene.AddActor("me", member); cutscene.AddActor("#hellhound", 20201); cutscene.Play(); } }
public override void OnBoss(Dungeon dungeon) { dungeon.AddBoss(30802, 1); // Giant Golden Spiderling foreach (var member in dungeon.Party) { var cutscene = new Cutscene("bossroom_tutorial_giantgoldenspiderkid", member); cutscene.AddActor("player0", member); cutscene.AddActor("#giantgoldenspiderkid", 30802); cutscene.Play(); } }
public override void OnBoss(Dungeon dungeon) { dungeon.AddBoss(10602, 3); // Giant Imp foreach (var member in dungeon.Party) { var cutscene = new Cutscene("bossroom_imp", member); cutscene.AddActor("player0", member); cutscene.AddActor("#imp", 10601); cutscene.Play(); } }
public static string DefaultName(Cutscene.MediaType type) { switch (type) { case Cutscene.MediaType.Shots: return "Shots"; case Cutscene.MediaType.Actors: return "Actors"; case Cutscene.MediaType.Audio: return "Audio"; default: // Cutscene.MediaType.Subtitles return "Subtitles"; } }
public override void OnBoss(Dungeon dungeon) { dungeon.AddBoss(380001, 3); // Rabbit foreach (var member in dungeon.Party) { var cutscene = new Cutscene("bossroom_GiantSpider_kid", member); cutscene.AddActor("player0", member); cutscene.AddActor("#giant_spider_kid", 380001); cutscene.AddActor("#red_spider_kid", 380001); cutscene.Play(); } }
public override void OnBoss(Dungeon dungeon) { dungeon.AddBoss(30022, 1); // Giant Spiderling dungeon.AddBoss(1002, 1); // Lost Resident foreach (var member in dungeon.Party) { var cutscene = new Cutscene("bossroom_tutorial_giantspider_kid", member); cutscene.AddActor("player0", member); cutscene.AddActor("#giant_spider_kid", 30022); cutscene.AddActor("#lostresident", 1002); cutscene.Play(); } }
public override void OnBoss(Dungeon dungeon) { dungeon.AddBoss(130001, 1); // Golem dungeon.AddBoss(11003, 6); // Metal Skeleton foreach (var member in dungeon.Party) { var cutscene = new Cutscene("bossroom_Metalskeleton_Golem", member); cutscene.AddActor("player0", member); cutscene.AddActor("#golem", 130001); cutscene.AddActor("#metal_skeleton", 11003); cutscene.Play(); } }
public override void OnBoss(Dungeon dungeon) { dungeon.AddBoss(30004, 1); // Giant Spider dungeon.AddBoss(30003, 6); // Red Spider foreach (var member in dungeon.Party) { var cutscene = new Cutscene("bossroom_GiantSpider", member); cutscene.AddActor("player0", member); cutscene.AddActor("#giant_spider", 30004); cutscene.AddActor("#darkred_spider", 30003); cutscene.Play(); } }
public override void OnBoss(Dungeon dungeon) { dungeon.AddBoss(130002, 1); // Small Golem dungeon.AddBoss(11010, 6); // Metal Skeleton foreach (var member in dungeon.Party) { var cutscene = new Cutscene("bossroom_MetalskeletonArmorA_Golem", member); cutscene.AddActor("player0", member); cutscene.AddActor("#golem", 130002); cutscene.AddActor("#metalskeleton_armora", 11010); cutscene.Play(); } }
public async Task<HookResult> TalkTrefor(NpcScript npc, params object[] args) { if(npc.QuestActive(this.Id, "talk_trefor")) { npc.FinishQuest(this.Id, "talk_trefor"); if(!npc.Player.Skills.Has(SkillId.Smash, SkillRank.Novice)) npc.Player.Skills.Give(SkillId.Smash, SkillRank.Novice); npc.Msg("Welcome, I am Trefor, the guard.<br/>Someone from the town went into Alby Dungeon a while ago, but hasn't returned yet.<br/>I wish I could go there myself, but I can't leave my post. I'd really appreciate it if you can go and look for in Alby Dungeon."); npc.Msg("Since the dungeon is a dangerous place to be in, I'll teach you a skill that will help you in an emergency situation.<br/>It's called the Smash skill. If you use it, you can knock down a monster with a single blow!<br/>It is also highly effective when you sneak up on a target and deliver the blow without warning."); npc.Msg("Against monsters that are using the Defense skill,<br/>Smash will be the only way to penetrate that skill and deliver a killer blow."); npc.Msg("However... looking at the way you're holding your sword, I'm not sure if you are up to the task.<br/>Let me test your skills first. Do you see those brown foxes wandering in front of me?<br/>They're quite a nuisance, praying on those roosters in town.<br/>I want you to go and hunt 5 Young Brown Foxes right now."); npc.Msg("Foxes use the Defense Skill a lot, and as I told you before, regular attacks do not work against defending targets.<br/>That's then the Smash skill comes in handy.<br/><br/>Watch how I do it, and try picking up the important parts so you can use it too.<br/>You don't need to overstrain yourself by going for the Brown Foxes. Young Brown Foxes will do just fine.", npc.Movie("skillbar_guide_us.wmv", 500, 300), npc.Button("Continue")); await npc.Select(); npc.Close2(); var scene = new Cutscene("tuto_smash", npc.Player); scene.AddActor("me", npc.Player); scene.AddActor("#trefor", npc.NPC); scene.AddActor("#brownfox", 50001); scene.Play(); return HookResult.End; } else if(npc.QuestActive(this.Id, "talk_trefor2")) { npc.FinishQuest(this.Id, "talk_trefor2"); npc.Msg("Good, I see that you're getting the hang of it.<br/>Well, I was able to do that when I was 8, but whatever...<br/>It is now time for you to go and search for the missing Villager."); npc.Msg("Follow the road up and turn right and you'll find the Alby Dungeon.<br/>You can enter the dungeon by dropping this item on the altar.<br/>If you either lose it or fail to rescue her, come back to me so I can give you another one. Please be careful.", npc.Image("dungeonpass", 128, 128)); npc.GiveItem(63180, 1); return HookResult.Break; } else if(npc.QuestActive(this.Id, "talk_trefor3")) { npc.FinishQuest(this.Id, "talk_trefor3"); npc.Msg("You did it! Good job.<br/>Good thing I asked for your help.<br/>For your great work, I will now teach you how to properly use the Smash skill.<br/>If you open your Skill window and press the 'LEARN' button, you will be able to use a more powerful Smash skill.<br/>I can always use some help here, so drop by often, okay?"); if(npc.Player.Skills.Is(SkillId.Smash, SkillRank.Novice)) npc.Player.Skills.Train(SkillId.Smash, 1); return HookResult.Break; } return HookResult.Continue; }
public override void OnBoss(Dungeon dungeon) { dungeon.AddBoss(130003, 1); // Small Golem dungeon.AddBoss(190001, 3); // Flying Sword foreach (var member in dungeon.Party) { var cutscene = new Cutscene("bossroom_SmallGolem_FlyingSword", member); cutscene.AddActor("me", member); cutscene.AddActor("#small_golem", 130003); cutscene.AddActor("#flying_sword", 190001); cutscene.Play(); } }
public override void OnBoss(Dungeon dungeon) { dungeon.AddBoss(30006, 1); // Giant Black Spider dungeon.AddBoss(30012, 6); // Burgundy Spider foreach (var member in dungeon.Party) { var cutscene = new Cutscene("bossroom_giant_spiderB", member); cutscene.AddActor("player0", member); cutscene.AddActor("#giant_black_spider", 30006); cutscene.AddActor("#darkred_spider", 30012); cutscene.Play(); } }
public override void OnBoss(Dungeon dungeon) { dungeon.AddBoss(130004, 1); // Small Golem dungeon.AddBoss(160102, 6); // Green Gremlin foreach (var member in dungeon.Party) { var cutscene = new Cutscene("bossroom_small_golem", member); cutscene.AddActor("player0", member); cutscene.AddActor("#small_golem", 130004); cutscene.AddActor("#imp", 10601); cutscene.Play(); } }
public override void OnBoss(Dungeon dungeon) { dungeon.AddBoss(30018, 1); // Giant Spiderling dungeon.AddBoss(30019, 3); // Red Spiderling foreach (var member in dungeon.Party) { var cutscene = new Cutscene("bossroom_GiantSpider_kid", member); cutscene.AddActor("player0", member); cutscene.AddActor("#giant_spider_kid", 30018); cutscene.AddActor("#red_spider_kid", 30019); cutscene.Play(); } }
public override void OnBoss(Dungeon dungeon) { dungeon.AddBoss(100302, 1); // Argus dungeon.AddBoss(100303, 1); // Argus dungeon.AddBoss(100304, 1); // Argus dungeon.AddBoss(170201, 6); // Werewolf foreach (var member in dungeon.Party) { var cutscene = new Cutscene("bossroom_argos", member); cutscene.AddActor("player0", member); cutscene.AddActor("#argus", 100302); cutscene.Play(); } }
public override void OnBoss(Dungeon dungeon) { dungeon.AddBoss(170107, 2); // Lycanthrope dungeon.AddBoss(110102, 5); // Gorgon foreach (var member in dungeon.Party) { var cutscene = new Cutscene("bossroom_lycan", member); cutscene.AddActor("leader", member); cutscene.AddActor("player1", member); // TODO: Party cutscene.AddActor("#lycan", 170107); cutscene.AddActor("#gorgon", 110102); cutscene.Play(); } }
void directorControl_PlayCutscene(object sender, CinemaDirectorArgs e) { Cutscene c = e.cutscene as Cutscene; if (c != null) { if (Application.isPlaying) { c.Play(); } else { c.PreviewPlay(); previousTime = System.DateTime.Now; } } }
public void CutsceneEnd(bool releaseCamera = true) { if (m_currentCutscene != null) { if (MyVisualScriptLogicProvider.CutsceneEnded != null) { MyVisualScriptLogicProvider.CutsceneEnded(m_currentCutscene.Name); } m_currentCutscene = null; if (releaseCamera) { m_cameraEntity.FOV = MathHelper.ToDegrees(MySandboxGame.Config.FieldOfView); m_releaseCamera = true; } MyHudCameraOverlay.Enabled = m_overlayEnabled; } }
private void OnCollisionEnter2D(Collision2D collision) { Entity e = collision.collider.GetComponent <Entity>(); if (e != null) { GameObject cutscene = GameManager.instance.genericCutsceneObject; go = Instantiate(cutscene).GetComponent <Cutscene>(); go.cam.actor = Camera.main.gameObject; go.cam.positions.Add(transform); go.cam.transitionTimes.Add(5); go.cam.holdTimes.Add(1.3f); go.cam.screenColors.Add(new Color(0, 0, 0, 1)); go.fadeIn = true; cutsceneStart = true; } }
/// <summary> /// Initalize the states and add them /// </summary> protected override void Start() { base.Start(); StateMachine = new CharacterStateMachine(this); falling = new Falling(); grounded = new Grounded(); motion = new Motion(); cutscene = new Cutscene(); // Add states StateMachine.AddState(StateName.Falling, falling); StateMachine.AddState(StateName.Grounded, grounded); StateMachine.AddState(StateName.Motion, motion); StateMachine.AddState(StateName.Cutscene, cutscene); }
/// <summary> /// Plays cutscene for all party members. /// </summary> /// <param name="cutsceneName"></param> /// <param name="onFinish"></param> public void PlayCutscene(string cutsceneName, Action <Cutscene> onFinish) { var viewers = this.GetRpCharactersOrCreators().ToArray(); if (viewers.Length == 0) { return; } var leader = this.PartyLeader; if (!this.IsInside(leader.EntityId)) { leader = viewers.First(); } Cutscene.Play(cutsceneName, leader, onFinish, viewers); }
public override void OnBoss(Dungeon dungeon) { dungeon.AddBoss(30009, 1); // Giant Black Spider dungeon.AddBoss(30010, 1); // Giant Red Spider dungeon.AddBoss(30011, 1); // Giant White Spider dungeon.AddBoss(30012, 16); // Burgundy Spider foreach (var member in dungeon.Party) { var cutscene = new Cutscene("bossroom_giant_spiderRBW", member); cutscene.AddActor("player0", member); cutscene.AddActor("#giant_black_spider", 30009); cutscene.AddActor("#giant_spider", 30010); cutscene.AddActor("#giant_white_spider", 30011); cutscene.AddActor("#darkred_spider", 30012); cutscene.Play(); } }
private void clearTrackGroups(Cutscene cutscene) { ActorTrackGroup[] actorGroupArr = cutscene.GetComponentsInChildren <ActorTrackGroup>(); foreach (ActorTrackGroup actorGroup in actorGroupArr) { if (actorGroup.Actor == null) { continue; } Transform actorTrans = actorGroup.Actor; for (int i = actorTrans.childCount - 1; i >= 0; i--) { GameObject.DestroyImmediate(actorTrans.GetChild(i).gameObject); } } }
private void OnTokenDrawn(Rect rect, Cutscene cutscene, CutscenePlayer player, Token token, int tokenIndex, ref GUIContent tokenlabel) { if (!Configs.CheckErrors) { return; } var foundErrors = GetErrors(tokenIndex, -1).ToArray(); if (!foundErrors.Any()) { return; } var highestLevel = (from error in foundErrors select error.Level).Max(); var icon = ShiroiStyles.GetIcon(highestLevel); tokenlabel.image = icon; }
/*public override void EditSpawnPool( IDictionary<int, float> pool, NPCSpawnInfo spawnInfo ) { * Cutscene nowCutscene = CutsceneManager.Instance?.GetCurrentPlayerCutscene( Main.LocalPlayer ); * if( nowCutscene == null ) { * return; * } * * pool.Clear(); * } * * public override void EditSpawnRate( Player player, ref int spawnRate, ref int maxSpawns ) { * Cutscene nowCutscene = CutsceneManager.Instance?.GetCurrentPlayerCutscene( Main.LocalPlayer ); * if( nowCutscene == null ) { * return; * } * * maxSpawns = 0; * }*/ //////////////// public override bool PreAI(NPC npc) { var cutMngr = CutsceneManager.Instance; Cutscene nowCutscene = cutMngr?.GetCurrentCutscene_Player(Main.LocalPlayer); if (nowCutscene == null) { return(base.PreAI(npc)); } if (!nowCutscene.AllowNPC_Internal(npc)) { npc.active = false; npc.life = 0; } return(cutMngr.Update_NPC_Internal(npc)); }
private static TrackGroupContextData getContextDataFromType(Cutscene cutscene, Type type) { string label = string.Empty; foreach (TrackGroupAttribute attribute in type.GetCustomAttributes(typeof(TrackGroupAttribute), true)) { if (attribute != null) { label = attribute.Label; break; } } TrackGroupContextData userData = new TrackGroupContextData { Cutscene = cutscene, Type = type, Label = label }; return(userData); }
/// <summary> /// 重置Cutscene的子结点数据 /// </summary> /// <param name="cutscene"></param> private void resetCutscene(Cutscene cutscene) { ActorTrackGroup[] actorGroupArr = cutscene.GetComponentsInChildren <ActorTrackGroup>(); foreach (ActorTrackGroup actorGroup in actorGroupArr) { if (actorGroup is EntityTrackGroup) { this.resetEnityTrackGroup((EntityTrackGroup)actorGroup); } else { ActorTrackGroupInspector.Initialize(actorGroup); } } this.resetAudioTrackGroup(cutscene); }
/// CG开始播放 public void OnCutsceneStarted(object sender, CutsceneEventArgs e) { Cutscene cs = sender as Cutscene; if (cs != _CurCutscene || _CurCutscene == null) { Common.HobaDebuger.LogWarningFormat("Logic Error: when call OnCutsceneStarted, another cg is playing"); return; } var useCGCamera = _CurCGGlobal.cameraType == CGGlobal.CameraType.CGCamera; if (useCGCamera) { ChangeOtherSetting(false, _CurCGGlobal.UseUICamera); if (_CurCGGlobal.WeatherId > 0) { DynamicEffectManager.Instance.EnterCGEffect(_CurCGGlobal.WeatherId, _CurCGGlobal.GetComponentsInChildren <PostProcessChain>(true)); } } { IntPtr L = LuaScriptMgr.Instance.GetL(); try { var ls = LuaScriptMgr.Instance.GetLuaState(); var oldTop = LuaDLL.lua_gettop(L); LuaDLL.lua_getglobal(L, "OnCGStart"); LuaDLL.lua_pushboolean(L, useCGCamera); if (!ls.PCall(1, 0)) { Common.HobaDebuger.LogLuaError(LuaDLL.lua_tostring(L, -1)); } LuaDLL.lua_settop(L, oldTop); } catch (Exception ex) { Debug.LogException(ex); Debug.LogError(LuaStatic.GetTraceBackInfo(L)); } } _CurCutscene.CutsceneStarted -= OnCutsceneStarted; }
/// <summary> /// Removes a section of a cutscene. Camera focus data is not altered /// </summary> /// <param name="cutscene"></param> /// <param name="cutStart">First frame to remove</param> /// <param name="cutEnd">First frame to keep</param> private static void CutsceneDeleteSection(Cutscene cutscene, short cutStart, short cutEnd) { var deleteIFrameCollection = CutsceneDeleteSection (cutscene.Commands.OfType <IFrameCollection>(), cutStart, cutEnd); var deleteIFrameData = CutsceneDeleteSection (cutscene.Commands.OfType <IFrameData>(), cutStart, cutEnd); foreach (var item in deleteIFrameCollection) { cutscene.Commands.Remove((CutsceneCommand)item); } foreach (var item in deleteIFrameData) { cutscene.Commands.Remove((CutsceneCommand)item); } }
/// <summary> /// Starts a cutscene with the given lines of text and the given NPC's. /// </summary> /// <param name="theNPCs">The NPC's used</param> /// <param name="theLines">The lines of dialogue to play</param> /// <param name="theCutscene">The Current Cutscene playing</param> public void StartCutscene(NPC_Dialogue[] theNPCs, string[] theLines, Cutscene theCutscene) { StopAllCoroutines(); theCurrentCutscene = theCutscene; currentIndex = 0; dialogueLines = theLines; currentNPCs = theNPCs; npcNameUI.text = theNPCs[0].name; dialogueObj.SetActive(true); response1.gameObject.SetActive(true); response2.SetActive(false); response3.SetActive(false); response1.rectTransform.parent.gameObject.GetComponent <Response>().isCutscene = true; response1.text = "Continue"; Camera.main.GetComponent <CameraController>().enabled = false; Player.instance.GetComponent <PlayerController>().enabled = false; StartCoroutine(printText(dialogueLines[currentIndex])); StartCoroutine(CameraMove(currentNPCs[0].transform.position)); }
void LoadData(string path) { loaded = false; if (cutscene != null) { cutscene.Dispose(); cutscene = null; } Thread GameDataLoaderThread = new Thread(() => { GameData = new GameDataManager(path, Resources); GameData.LoadData(); FLLog.Info("Game", "Finished loading game data"); EnsureUIThread(OnLoadComplete); }); GameDataLoaderThread.Name = "GamedataLoader"; GameDataLoaderThread.Start(); }
/// <summary> /// Spools the events and loads the timeline control /// </summary> protected void OnEnable() { EditorApplication.update = (EditorApplication.CallbackFunction)System.Delegate.Combine(EditorApplication.update, new EditorApplication.CallbackFunction(this.DirectorUpdate)); EditorApplication.playmodeStateChanged = (EditorApplication.CallbackFunction)System.Delegate.Combine(EditorApplication.playmodeStateChanged, new EditorApplication.CallbackFunction(this.PlaymodeStateChanged)); GUISkin skin = ScriptableObject.CreateInstance <GUISkin>(); skin = (EditorGUIUtility.isProSkin) ? Resources.Load <GUISkin>(PRO_SKIN) : Resources.Load <GUISkin>(FREE_SKIN); directorControl = new DirectorControl(); directorControl.OnLoad(skin); directorControl.PlayCutscene += directorControl_PlayCutscene; directorControl.PauseCutscene += directorControl_PauseCutscene; directorControl.StopCutscene += directorControl_StopCutscene; directorControl.ScrubCutscene += directorControl_ScrubCutscene; directorControl.SetCutsceneTime += directorControl_SetCutsceneTime; directorControl.EnterPreviewMode += directorControl_EnterPreviewMode; directorControl.ExitPreviewMode += directorControl_ExitPreviewMode; isSnappingEnabled = directorControl.IsSnappingEnabled; previousTime = DateTime.Now; accumulatedTime = 0; int instanceId = -1; if (EditorPrefs.HasKey("DirectorControl.CutsceneID")) { instanceId = EditorPrefs.GetInt("DirectorControl.CutsceneID"); } if (instanceId >= 0) { foreach (Cutscene c in GameObject.FindObjectsOfType <Cutscene>()) { if (c.GetInstanceID() == instanceId) { cutscene = c; } } } }
public override bool moveElementDown(DataControl dataControl) { bool elementMoved = false; int elementIndex = cutscenesList.IndexOf((Cutscene)dataControl.getContent()); if (elementIndex < cutscenesList.Count - 1) { Cutscene e = cutscenesList[elementIndex]; CutsceneDataControl c = cutscenesDataControlList[elementIndex]; cutscenesList.RemoveAt(elementIndex); cutscenesDataControlList.RemoveAt(elementIndex); cutscenesList.Insert(elementIndex + 1, e); cutscenesDataControlList.Insert(elementIndex + 1, c); //controller.dataModified( ); elementMoved = true; } return(elementMoved); }
public void PlayCutscene(Cutscene cutscene) { // Stops the audio from playing during a dualogue current_volume = AudioListener.volume; AudioListener.volume = 0; App.Get().settings.is_paused = true; // Retrieving the cutscene with that dialogue for (int i = 0; i < cutscenes.Length; i++) { if (cutscenes[i].dialogue == cutscene.dialogue) { current_cutscene = cutscenes[i]; break; } } LoadPassage(); }
public override void Trigger(GameObject actor) { if (!Application.isPlaying) { return; } shotTrack = Cutscene.GetComponentInChildren <ShotTrack>(); //PanelManager panelMgr = AppFacade.Instance.GetManager<PanelManager>(); //LuaManager luaMgr = AppFacade.Instance.GetManager<LuaManager>(); //handler = TimeManager.TotalMilliSeconds(DateTime.Now); //if (!panelMgr.IsPanelVisible(UIName)) //{ // LuaFunction func = luaMgr.mainLua.GetFunction(UIName + ".show"); // if (func == null) return; // func.BeginPCall(); // func.Push(handler); // func.Push(actor); // func.Push((int)Direction); // if(!string.IsNullOrEmpty(Args)) // func.Push(Args); // func.PCall(); // func.EndPCall(); //} //else //{ // LuaFunction func = luaMgr.mainLua.GetFunction(UIName + ".addItem"); // if (func == null) return; // func.BeginPCall(); // func.Push(handler); // func.Push(actor); // func.Push((int)Direction); // if (!string.IsNullOrEmpty(Args)) // func.Push(Args); // func.PCall(); // func.EndPCall(); //} //updateTimeFunc = luaMgr.mainLua.GetFunction(UIName + ".updateTime"); }
void directorControl_PlayCutscene(object sender, CinemaDirectorArgs e) { Cutscene c = e.cutscene as Cutscene; if (c != null) { if (Application.isPlaying) { c.Play(); } else { c.PreviewPlay(); previousTime = Time.realtimeSinceStartup; m_Time.m_Time = 0; m_Time.m_Frame = 0; } } }
/// <summary> /// Create a track container for an actor in this cutscene. /// </summary> /// <param name="transform">The transform of the game object</param> /// <returns>the newly created container</returns> public static TrackGroup CreateActorTrackGroup(Cutscene cutscene, Transform transform) { string trackGroupName = ACTOR_GROUP_NAME; if (transform != null) { trackGroupName = string.Format("{0} Group", transform.name); } GameObject actorGroupGO = new GameObject(trackGroupName, typeof(ActorTrackGroup)); actorGroupGO.transform.parent = cutscene.transform; ActorTrackGroup actorTrackGroup = actorGroupGO.GetComponent <ActorTrackGroup>(); actorTrackGroup.Actor = transform; return(actorTrackGroup); }
void onClick_DeleteCutsceneButton(MyGuiControlButton sender) { var cutscenes = MySession.Static.GetComponent <MySessionComponentCutscenes>(); if (m_selectedCutscene != null) { cutscenes.GetCutscenes().Remove(m_selectedCutscene.Name); m_comboCutscenes.RemoveItem(m_selectedCutscene.Name.GetHashCode()); if (cutscenes.GetCutscenes().Count == 0) { m_selectedCutscene = null; } else { m_comboCutscenes.SelectItemByIndex(cutscenes.GetCutscenes().Count - 1); } } }
/// <summary> /// Export prefab to local desk /// </summary> /// <param name="cutscene"></param> /// <param name="path"></param> private void exportPrefab(Cutscene cutscene, string path) { GameObject instanceObj = GameObject.Instantiate(cutscene.gameObject); instanceObj.layer = LayerMask.NameToLayer("Plot"); CinemaShot[] shotArr = instanceObj.GetComponentsInChildren <CinemaShot>(); foreach (CinemaShot shot in shotArr) { PlotCamera plotCam = shot.shotCamera.GetComponent <PlotCamera>(); plotCam.IsMainCamera = shot.Firetime == 0; } ActorTrackGroup[] actorGroupArr = instanceObj.GetComponentsInChildren <ActorTrackGroup>(); foreach (ActorTrackGroup actorGroup in actorGroupArr) { Transform trackTrans = actorGroup.transform; clearTransform(trackTrans, "_temp"); clearTransform(trackTrans, "_Entity", true); } //clear audio source AudioTrack[] audioTracks = instanceObj.GetComponentsInChildren <AudioTrack>(); foreach (AudioTrack audioGroup in audioTracks) { foreach (TimelineItem timelineItem in audioGroup.GetTimelineItems()) { CinemaAudio audio = timelineItem as CinemaAudio; if (audio) { AudioSource audioSrc = audio.GetComponent <AudioSource>(); GameObject.DestroyImmediate(audioSrc); } } } PrefabUtility.CreatePrefab(path, instanceObj); GameObject.DestroyImmediate(instanceObj); AssetDatabase.ImportAsset(path); }
public override void OnBoss(Dungeon dungeon) { if (dungeon.CountPlayers() == 1) { dungeon.AddBoss(10301, 1); // Black Succubus } else { dungeon.AddBoss(10101, 1); // Goblin foreach (var member in dungeon.Party) { var cutscene = new Cutscene("bossroom_GoldGoblin", member); cutscene.AddActor("me", member); cutscene.AddActor("#gold_goblin", 10104); cutscene.AddActor("#goblin_archer", 10103); cutscene.Play(); } } }
public override void OnBoss(Dungeon dungeon) { if (dungeon.CountPlayers() == 1) { dungeon.AddBoss(10302, 1); // Red Succubus } else { dungeon.AddBoss(170101, 1); // Lycanthrope dungeon.AddBoss(170102, 1); // Lycanthrope foreach (var member in dungeon.Party) { var cutscene = new Cutscene("bossroom_Lycanthrope2", member); cutscene.AddActor("me", member); cutscene.AddActor("#lycan", 170101); cutscene.Play(); } } }
public override void OnBoss(Dungeon dungeon) { if (dungeon.CountPlayers() == 1) { dungeon.AddBoss(10302, 1); // Red Succubus } else { dungeon.AddBoss(170101, 1); // Lycanthrope dungeon.AddBoss(170102, 1); // Lycanthrope foreach (var member in dungeon.Party) { var cutscene = new Cutscene("bossroom_Lycanthrope2", member); cutscene.AddActor("me", member); cutscene.AddActor("#lycan", 170101); cutscene.Play(); } } }
public static void playCutscene(string cutscene, string sound) { Mode = CutsceneMode.Middle; CutsceneName = cutscene; CutsceneAfter = null; CutsceneReturn = Tree.CurrentScene; CutsceneSound = sound; if (!KWorld.worldFileExists(Cutscene.makeScenePath(1))) { if (Tree.Paused) { Tree.Paused = false; Cutscene.releaseAll(); } return; } Tree.Paused = true; Tree.Root.RemoveChild(Tree.CurrentScene); // TODO: how not to blink? Tree.ChangeScene("res://knytt/ui/Cutscene.tscn"); }
public void OnTriggerEnter2D(Collider2D collision) { Player p = collision.GetComponent <Player>(); if (p != null) { p.GiveItem(item); Instantiate(GameManager.instance.genericSoundObject, transform.position, Quaternion.identity).GetComponent <AudioSource>().clip = pickupSound.GetClip(); Cutscene c = Instantiate(GameManager.instance.genericCutsceneObject).GetComponent <Cutscene>(); GetComponent <DialogueTrigger>().TriggerDialogue(); c.cam.actor = Camera.main.gameObject; c.actors.Add(new SceneShot()); c.actors[0].actor = gameObject; c.cam.positions.Add(c.cam.actor.transform); c.cam.transitionTimes.Add(4); c.cam.holdTimes.Add(3); transform.position = p.itemShowTransform.position; //Destroy(gameObject); } }
public override void OnBoss(Dungeon dungeon) { if (dungeon.CountPlayers() == 1) { dungeon.AddBoss(10301, 1); // Black Succubus } else { dungeon.AddBoss(10101, 1); // Goblin foreach (var member in dungeon.Party) { var cutscene = new Cutscene("bossroom_GoldGoblin", member); cutscene.AddActor("me", member); cutscene.AddActor("#gold_goblin", 10104); cutscene.AddActor("#goblin_archer", 10103); cutscene.Play(); } } }
private static TrackGroupContextData getContextDataFromType(Cutscene cutscene, Type type) { string label = string.Empty; object[] attrs = type.GetCustomAttributes(typeof(TrackGroupAttribute), true); for (int i = 0; i < attrs.Length; i++) { TrackGroupAttribute attribute = attrs[i] as TrackGroupAttribute; if (attribute != null) { label = attribute.Label; break; } } TrackGroupContextData userData = new TrackGroupContextData { Cutscene = cutscene, Type = type, Label = label }; return(userData); }
//开场动画结束执行的触发高亮碰撞事件 private void FlashAndCollisionShowEvent(Cutscene sc) { int ptcontain = DanKai_CutSceneController.DanKai_CutSceneControllerInstance.CC_StartContainsOrNotInter(sc); if (ptcontain >= 0) { int wgc = 0; int bn = DanKai_CutSceneController.DanKai_CutSceneControllerInstance.SmallStepNumber.Length; for (int i = 0; i < ptcontain; i++) { wgc += DanKai_CutSceneController.DanKai_CutSceneControllerInstance.SmallStepNumber[i]; } CollisionEnable(wgc); if (DanKai_PracticeUserInterface.PracticeInstance == null) { return; } FlashActive(wgc); } }
public static void ReflectChanges(Cutscene cutscene, CutsceneWrapper wrapper) { if (cutscene == null || wrapper == null) { return; } cutscene.Duration = wrapper.Duration; foreach (TrackGroupWrapper tgw in wrapper.TrackGroups) { TrackGroup tg = tgw.Behaviour as TrackGroup; tg.Ordinal = tgw.Ordinal; foreach (TimelineTrackWrapper trackWrapper in tgw.Tracks) { TimelineTrack track = trackWrapper.Behaviour as TimelineTrack; track.Ordinal = trackWrapper.Ordinal; } } }
protected void EndCutscene() { this.enabled = false; Cutscene.current = null; // Release the camera lock if we have one. if (this.locksCam) { MainCam.S.ReleaseCameraLock(); } // Clear Navi's dialog. Navi.S.dialog.textObject.text = ""; Events.Broadcast(new OnCutsceneEndEvent { cutscene = this }); Events.Broadcast(new OnPauseEvent { paused = false }); if (this.showOnce) { Destroy(this.gameObject); } }
public override void OnBoss(Dungeon dungeon) { dungeon.AddBoss(100003, 1); // Ogre Warrior dungeon.AddBoss(100004, 1); // Ogre Warrior dungeon.AddBoss(100005, 1); // Ogre Warrior dungeon.AddBoss(100006, 1); // Ogre Warrior dungeon.AddBoss(100007, 1); // Ogre Warrior foreach (var member in dungeon.Party) { var cutscene = new Cutscene("bossroom_OgreBros", member); cutscene.AddActor("me", member); cutscene.AddActor("#ogrebros1", 100003); cutscene.AddActor("#ogrebros2", 100004); cutscene.AddActor("#ogrebros3", 100005); cutscene.AddActor("#ogrebros4", 100006); cutscene.AddActor("#ogrebros5", 100007); cutscene.AddActor("#goblin", 10101); cutscene.Play(); } }
public override void LoadEvents() { // "Altar" near Tin OnClientEvent(0x00B0007D0001009C, SignalType.Enter, (creature, eventData) => { // Only do this once. if (creature.Keywords.Has("tin_tutorial_guide")) return; if (!creature.Quests.Has(202001)) creature.Quests.Start(202001, false); // Nao's Letter of Introduction // TODO: Cutscene db var cutscene = new Cutscene("tuto_meet_tin", creature); cutscene.AddActor("me", creature); cutscene.AddActor("#tin", creature.Region.GetCreature("_tin")); cutscene.Play((scene) => { // Give first weapon if(creature.RightHand == null) { //if(!eiry) // creature.Inventory.Add(40005, Pocket.RightHand1); // Short Sword //else { // Eiry Practice Short Sword creature.Inventory.AddWithUpdate(Item.CreateEgo(40524, EgoRace.EirySword, "Eiry"), Pocket.RightHand1); } } // Give as soon as the player got everything creature.Keywords.Give("tin_tutorial_guide"); // Required to remove the fade effect. scene.Leader.Warp(125, 22930, 75423); }); }); }
public async Task<HookResult> TalkDuncan(NpcScript npc, params object[] args) { if(npc.QuestActive(this.Id, "talk_duncan")) { npc.FinishQuest(this.Id, "talk_duncan"); Send.Effect(npc.NPC, Effect.ScreenFlash, 3000, 0); // Remove Eiry var eiry = npc.Player.Inventory.Items.FirstOrDefault(item => item.EgoInfo.Race == EgoRace.EirySword); if(eiry != null) npc.Player.Inventory.Remove(eiry); // Give sword npc.GiveItem(40015); npc.Notice("Received Fluted Short Sword from Duncan."); npc.Msg("Welcome to Tir Chonaill."); npc.Msg("Oh, you are finally here, <username/>.<br/>I've heard a lot about you from the villagers.<br/>You've leveled up quite a lot."); npc.Msg("This may be a small town,<br/>but Tir Chonaill has long boasted a tradition<br/>of growing resolute and sturdy warriors<br/>that don't have to worry about the kingdom's control."); npc.Msg("You have now completed all our missions<br/>and have earned the right to join the rank of Tir Chonaill's warriors.<br/>Well done, and congratulations."); npc.Msg("Wherever you go, don't forget who you are and what you have become.<br/>Since you have become strong enough to survive alone,<br/>your ego guide must have already parted ways with you.<br/>There is no one to look after you now, so befriend as many people as you can."); npc.Msg("If you have anything else to ask, let me know."); await npc.Conversation(); npc.Close2(); var cutscene = new Cutscene("etc_event_ego_goodbye", npc.Player); cutscene.AddActor("me", npc.Player); cutscene.Play(); return HookResult.Break; } return HookResult.Continue; }
public static CutsceneWrapper CreateWrapper(Cutscene cutscene) { CutsceneWrapper wrapper = new CutsceneWrapper(cutscene); if (cutscene != null) { wrapper.RunningTime = cutscene.RunningTime; wrapper.Duration = cutscene.Duration; wrapper.IsPlaying = cutscene.State == Cutscene.CutsceneState.PreviewPlaying || cutscene.State == Cutscene.CutsceneState.Playing; foreach (TrackGroup tg in cutscene.TrackGroups) { TrackGroupWrapper tgWrapper = new TrackGroupWrapper(tg); tgWrapper.Ordinal = tg.Ordinal; wrapper.AddTrackGroup(tg, tgWrapper); foreach (TimelineTrack track in tg.GetTracks()) { TimelineTrackWrapper trackWrapper = new TimelineTrackWrapper(track); trackWrapper.Ordinal = track.Ordinal; tgWrapper.AddTrack(track, trackWrapper); foreach (TimelineItem item in track.GetTimelineItems()) { if (item.GetType().IsSubclassOf(typeof(CinemaClipCurve))) { CinemaClipCurve clip = item as CinemaClipCurve; CinemaClipCurveWrapper clipWrapper = new CinemaClipCurveWrapper(clip, clip.Firetime, clip.Duration); trackWrapper.AddItem(clip, clipWrapper); } else if (item.GetType().IsSubclassOf(typeof(CinemaTween))) { } else if (item.GetType().IsSubclassOf(typeof(TimelineActionFixed))) { TimelineActionFixed actionFixed = item as TimelineActionFixed; CinemaActionFixedWrapper actionFixedWrapper = new CinemaActionFixedWrapper(actionFixed, actionFixed.Firetime, actionFixed.Duration, actionFixed.InTime, actionFixed.OutTime, actionFixed.ItemLength); trackWrapper.AddItem(actionFixed, actionFixedWrapper); } else if (item.GetType().IsSubclassOf(typeof(TimelineAction))) { TimelineAction action = item as TimelineAction; CinemaActionWrapper itemWrapper = new CinemaActionWrapper(action, action.Firetime, action.Duration); trackWrapper.AddItem(action, itemWrapper); } else { TimelineItemWrapper itemWrapper = new TimelineItemWrapper(item, item.Firetime); trackWrapper.AddItem(item, itemWrapper); } } } } } return wrapper; }