public void ActuallyFire(int Charges) { FocusPsi PsiMutation = ParentObject.GetPart <FocusPsi>(); // Shows the line picker interface for the player. TextConsole _TextConsole = UI.Look._TextConsole; ScreenBuffer Buffer = TextConsole.ScrapBuffer; Core.XRLCore.Core.RenderMapToBuffer(Buffer); List <GameObject> hit = new List <GameObject>(1); List <Cell> usedCells = new List <Cell>(1); var line = PickLine(20, AllowVis.Any, null, false, ForMissileFrom: ParentObject); Body body = ParentObject.GetPart <Body>(); List <BodyPart> ParentsHead = body.GetPart("Head"); Cell targetCell = line[line.Count - 1]; if (!PsiMutation.usePsiCharges(Charges)) { AddPlayerMessage("You do not have enough psi-charges!"); return; } foreach (var Head in ParentsHead) { if (Head.Equipped != null) { Physics.ApplyExplosion(currentCell, GetForce(Level, Charges), usedCells, hit, true, true, ParentObject, GetDamage(Level, Charges), 1, false, false, 2); AddPlayerMessage("Your helmet obstructs the energy of the beam--it explodes in your face!"); return; } } if (ParentObject.HasEffect("Dazed") || ParentObject.HasEffect("Confused")) { Physics.ApplyExplosion(currentCell, GetForce(Level, Charges), usedCells, hit, true, true, ParentObject, GetDamage(Level, Charges), 1, false, false, 2); AddPlayerMessage("You lack the concentration to hold your focus! The collected energy explodes in your face!"); return; } ActivatedAbilities activatedAbilities = ParentObject.GetPart("ActivatedAbilities") as ActivatedAbilities; activatedAbilities.GetAbility(CombustionBlastActivatedAbilityID).Cooldown = (Charges - 1) * 100; // Loop through each cell of the line in order. List <string> SparkySparkyChars = new List <string>() { "\xf8", "*", "." }; List <Point> Beamline = Zone.Line(line[0].X, line[0].Y, targetCell.X, targetCell.Y); base.PlayWorldSound("sparkblast", 0.3f, 0.1f, true, null); for (int index = 1; index < line.Count; index++) { Cell cell = line[index]; char DisplayBeam = Beamline[index].DisplayChar; Buffer.Goto(cell.X, cell.Y); Buffer.Write("&Y^r" + DisplayBeam); Cell SparkyBeam = cell.GetRandomLocalAdjacentCell(); Buffer.Goto(SparkyBeam.X, SparkyBeam.Y); Buffer.Write("&W" + SparkySparkyChars.GetRandomElement()); _TextConsole.DrawBuffer(Buffer); System.Threading.Thread.Sleep(18); // Find a solid object and combat id on obj in line, to hit in this cell. GameObject obj = cell.FindObject(o => o.ConsiderSolidFor(ParentObject, ParentObject) || (o.HasPart("Combat") && !o.pPhysics.Solid)); if (obj != null) { targetCell = cell; break; } } if (Stat.Random(1, 100) <= 50) { base.PlayWorldSound("bang1", 0.3f, 0, true, null); } else { base.PlayWorldSound("bang2", 0.3f, 0, true, null); } ComExplode(GetForce(Level, Charges), targetCell, ParentObject, GetDamage(Level, Charges)); ParentObject.UseEnergy(10000); }