//public static EncounterElement JustText(string name, string afterText, string label = null) //{ // var ee = new EncounterElement(name, label); // ee.EncounterTask = () => { name = afterText; return Task.CompletedTask; }; // return ee; //} public static EncounterElement JustSFX(string name, int resId, string label = null, double?volume = null, bool?useSpeakers = null) { var ee = new EncounterElement(name, label); var fx = new Effect("Encounter|" + name, resId); return(ee.DuringWhich(fx.PlayToCompletion(playVolume: volume, useSpeakers: useSpeakers))); }
public static EncounterElement SetUpPostcard() { EncounterElement HackingStage, BypassStage, ShootItOpen, PassTheDoor; BypassStage = new EncounterElement("Bypass Panel"); HackingStage = new EncounterElement("Jack Into Dataport") .Then(new EncounterElement("Hacking...").DuringWhich(Task.Delay(1200))); ShootItOpen = JustSFX("Shoot It Open", Resource.Raw._169206_security_voice_activating_alarm); PassTheDoor = new EncounterElement("Enter") .DuringWhich(async() => { if (!HackingStage.hasBeenCompleted) { var gunFX = new Effect("Gunshot", Resource.Raw.gunshot_3, null); foreach (int i in Enumerable.Range(0, 20)) { await Task.Delay(50); gunFX.Play(useSpeakers: true, stopIfNecessary: true); } } }); BypassStage.Then(HackingStage, PassTheDoor); HackingStage.Then(BypassStage, ShootItOpen); ShootItOpen.Then(PassTheDoor); return(new EncounterElement("Begin 'Postcard'") .Then("Enter facility...") .Then("Open security panel") .Then(BypassStage, HackingStage, ShootItOpen)); }
public static EncounterElement JustSpeech(string name, string speechtext, string label = null) { var ee = new EncounterElement(name, label); return(ee.DuringWhich(Speech.SayAllOf(speechtext))); }