public void ConstantDarknessEffect() { try { if (Duration > 0) { --Duration; } int ParentsEgoModifer = Object.Statistics["Ego"].Modifier; List <Cell> AdjacentCells; Umbrameum UmbralHook = Object.GetPart <Umbrameum>(); Blackout BlackOutHook = Object.GetPart <Blackout>(); int MaximumRadius = Math.Min(UmbralHook.Level / 2, 8); if (UmbralHook.Level > 3) { AdjacentCells = Object.CurrentCell.GetAdjacentCells(MaximumRadius); } else { AdjacentCells = Object.CurrentCell.GetAdjacentCells(); } foreach (var Cell in AdjacentCells) { if (!Cell.HasObject("MagicalDarkness")) { // AddPlayerMessage("Status Check: For Each Loop"); GameObject gameObject = Cell.AddObject("MagicalDarkness"); MagicalDarkness Darkness = gameObject.GetPart <MagicalDarkness>(); // AddPlayerMessage("Status Check: Setting up Objects"); int Ran = Stat.Random(0, 3); Darkness.Duration = ((UmbralHook.Level * (10 + ParentsEgoModifer) / 2) + Ran); // AddPlayerMessage("Status Check: Setting Darkness Duration: " + Darkness.Duration); } } } catch { } }
public void CastDarkness() { try { int ParentsEgoModifer = ParentObject.Statistics["Ego"].Modifier; int MaximumRadius = Math.Min(1 + (Level / 2), 4); List <Cell> Cells = PickBurst(MaximumRadius, 8 + Level, false, AllowVis.OnlyExplored); int Ran1 = Stat.Random(1, 100); if (!this.ParentObject.pPhysics.CurrentCell.ParentZone.IsWorldMap()) { if (Stat.Random(1, 100) < Ran1) { base.PlayWorldSound("darknesscast", 15f, 0, true, null); } else { base.PlayWorldSound("darknesscastdeep", 15f, 0, true, null); } for (int index = 0; index < Cells.Count; index++) { Cell C = Cells[index]; if (C.ParentZone.IsActive() && C.IsVisible()) { TextConsole.LoadScrapBuffers(); ScreenBuffer scrapBuffer = TextConsole.ScrapBuffer; XRLCore.Core.RenderMapToBuffer(TextConsole.ScrapBuffer); scrapBuffer.Goto(C.X, C.Y); scrapBuffer.Write(GetDarknesBlips() + "\a"); Popup._TextConsole.DrawBuffer(scrapBuffer); Thread.Sleep(10); XRLCore.Core.RenderMapToBuffer(scrapBuffer); scrapBuffer.Goto(C.X, C.Y); scrapBuffer.Write(GetDarknesBlips() + "\u0489"); Popup._TextConsole.DrawBuffer(scrapBuffer); Thread.Sleep(5); var Roll = Stat.Random(1, 100); if (Roll <= 10) { base.PlayWorldSound("darkness", 15f, 0, true, null); } if (C.HasObjectWithPart("Combat") || C.HasObjectWithPart("Brain")) { var cObj = C.GetFirstObjectWithPart("Combat"); if (cObj != ParentObject) { if (cObj.MakeSave(Stat: "Ego", Difficulty: 5 + Level, Attacker: ParentObject, AttackerStat: "Ego")) { cObj.ApplyEffect(new Confused(ParentsEgoModifer * 10, Level, (ParentsEgoModifer + Level) / 2)); } } } GameObject gameObject = C.AddObject("MagicalDarkness"); MagicalDarkness Darkness = gameObject.GetPart <MagicalDarkness>(); // AddPlayerMessage("Status Check: Setting up Objects"); int Ran2 = Stat.Random(0, 3); Darkness.Duration = ((Level * (10 + ParentsEgoModifer) / 2) + Ran2); } } } CooldownMyActivatedAbility(ShadowAreaEffectActivatedAbilityID, 60); } catch { } }
public void CreateMagicalDarknessEffect() { try { if (!Object.HasPart("Blackout")) { // AddPlayerMessage("Status Check: Apply Effect"); int ParentsEgoModifer = Object.Statistics["Ego"].Modifier; Object.AddPart <Blackout>(); // AddPlayerMessage("Status Check: Applied Blackout"); Umbrameum UmbralHook = Object.GetPart <Umbrameum>(); Blackout BlackOutHook = Object.GetPart <Blackout>(); // AddPlayerMessage("Status Check: Getting Hooks"); List <Cell> AdjacentCells; int MaximumRadius = Math.Min(UmbralHook.Level / 2, 4); if (UmbralHook.Level > 3) { AdjacentCells = Object.CurrentCell.GetAdjacentCells(MaximumRadius); } else { AdjacentCells = Object.CurrentCell.GetAdjacentCells(); } // AddPlayerMessage("Status Check: Getting Adjacent Cells"); foreach (var Cell in AdjacentCells) { // AddPlayerMessage("Status Check: For Each Loop"); GameObject gameObject = Cell.AddObject("MagicalDarkness"); MagicalDarkness Darkness = gameObject.GetPart <MagicalDarkness>(); // AddPlayerMessage("Status Check: Setting up Objects"); int Ran = Stat.Random(0, 3); Darkness.Duration = ((UmbralHook.Level * (10 + ParentsEgoModifer) / 2) + Ran); Darkness.Owner = Object; // AddPlayerMessage("Status Check: Setting Darkness Duration: " + Darkness.Duration); } // AddPlayerMessage("Status Check: Ending Foreach Loop"); BlackOutHook.Radius = UmbralHook.Level / 2; Duration = UmbralHook.Level * (10 + ParentsEgoModifer); // AddPlayerMessage("Status Check: Setting Efect Duration: " + Duration); } } catch { } }