Ejemplo n.º 1
0
 public override bool FireEvent(Event E)
 {
     if (E.ID == "CommandManifestLimb")
     {
         ArmCost    = (2 + ArmCounter) + (2 * ArmCounter) - 1;
         NewArmCost = ArmCost;
         FocusPsi focusPsi = ParentObject.GetPart <FocusPsi>();
         if (NewArmCost <= ParentObject.Statistics["PsiCharges"].BaseValue)
         {
             ArmCounter += 1;
             focusPsi.focusPsiCurrentCharges = focusPsi.maximumPsiCharge();
             AddPsionicArms();
             AddPlayerMessage(ParentObject.It + " manifest psionic limbs.");
             UseEnergy(500);
             focusPsi.UpdateCharges();
             ParentObject.FireEvent(Event.New("FireEventDebuffSystem", 0, 0, 0));
         }
         else if (NewArmCost <= ParentObject.Statistics["PsiCharges"].BaseValue || ParentObject.Statistics["PsiCharges"].BaseValue <= 0)
         {
             AddPlayerMessage(ParentObject.It + " do not have enough {{red|maximum charges}} to materialize a new limb.");
             return(true);
         }
     }
     if (E.ID == "CommandDismissLimb")
     {
         FocusPsi focusPsi = ParentObject.GetPart <FocusPsi>();
         if (ArmCounter >= 1)
         {
             focusPsi.UpdateCharges();
             RemovePsionicArms();
             AddPlayerMessage(ParentObject.It + " dismiss " + ParentObject.its + " psionic arms.");
             ArmCounter -= 1;
             ParentObject.FireEvent(Event.New("FireEventDebuffSystem", 0, 0, 0));
         }
     }
     if (E.ID == "Dismember")
     {
         if (E.HasStringParameter("Psionic") || E.HasIntParameter("17"))
         {
             AddPlayerMessage("{{Red|A blow disrupts the tangibility of one of " + ParentObject.its + " arms, it dissipates!}}");
             string ArmInQuestion = E.GetStringParameter("LimbSourceGameObjectID");
             ParentObject.RemoveBodyPartsByManager(ArmInQuestion, EvenIfDismembered: true);
         }
     }
     if (E.ID == "EndTurn")
     {
         FocusPsi focusPsi = ParentObject.GetPart <FocusPsi>();
         focusPsi.UpdateCharges();
         // AddPlayerMessage("ArmCounter: " + ArmCounter);
         // AddPlayerMessage("CurrentID: " + ManagerID + ArmCounter);
         // AddPlayerMessage("ArmCost: " + ArmCost);
         // AddPlayerMessage("PsiMaximum: " + focusPsi.maximumPsiCharge());
         // AddPlayerMessage("PsiArmCounter: " + focusPsi.ArmCounter);
         // AddPlayerMessage("PsiArmcost: " + focusPsi.ArmCost);
     }
     return(base.FireEvent(E));
 }
Ejemplo n.º 2
0
        public void ApplyElectricShroud()
        {
            try
            { // AddPlayerMessage("MethodFiring: ChangeTargetResistances");
                FocusPsi PsiMutation = ParentObject.GetPart <FocusPsi>();

                var ParentsEgo     = ParentObject.Statistics["Ego"].Modifier;
                var ParentsLevel   = ParentObject.Statistics["Level"].BaseValue;
                var ParentsCharges = ParentObject.Statistics["PsiCharges"].BaseValue;

                string ChargesSpent = PsiMutation.focusPsiCurrentCharges.ToString();

                // AddPlayerMessage("MethodStep: Getting Target");

                Cell       TargetCell = PickDestinationCell(12 + Level, AllowVis.OnlyVisible, false, true, false, true);
                GameObject Target     = TargetCell.GetFirstObjectWithPart("Combat");

                // AddPlayerMessage("MethodStep: Applying Effect");

                if (!Target.HasEffect("ShimmeringShroud"))
                {
                    Owner = ParentObject;
                    Target.ApplyEffect(new ShimmeringShroud(0, Owner: ParentObject));
                    ElectricChargePulse(TargetCell, ParentsCharges);
                    Target.ParticleText("&W\u000f", 0.02f, 10);
                    PlayWorldSound("Electroblast" + (Stat.Random(1, 4)));
                    Event cE = Event.New("SetShimmeringShroudEffectEvent", "MaximumCharges", ParentsCharges, "Potency", Potency, "Caster", ParentObject, "MutationLevel", Level);

                    // AddPlayerMessage("MethodStep: FireEvent CE");

                    Target.FireEvent(cE);
                }
                else
                {
                    Owner = ParentObject;
                    ElectricChargePulse(TargetCell, ParentsCharges);
                    Target.ParticleText("&W\u000f", 0.02f, 10);
                    PlayWorldSound("Electroblast" + (Stat.Random(1, 4)));
                    Event cE = Event.New("AlteringTemperatureEffectEvent", "ChargesSpent", ParentsCharges, "Potency", Potency, "Caster", ParentObject, "MutationLevel", Level);

                    // AddPlayerMessage("MethodStep: FireEvent CE/ No effect");

                    Target.FireEvent(cE);
                }

                // AddPlayerMessage("MethodStep: Setting Flavour Text");


                XDidYToZ(Target, "dawn", null, Target, "shimmering shroud", "!", null, Target, PossessiveObject: true);
                CooldownMyActivatedAbility(ActivateShimmeringShroudAbilityID, ParentsCharges * 3);
            }
            catch
            {
            }
        }
        public override bool FireEvent(Event E)
        {
            if (E.ID == "CommandCombustionBlast")
            {
                if (base.IsMyActivatedAbilityUsable(this.CombustionBlastActivatedAbilityID))
                {
                    if (!this.ParentObject.pPhysics.CurrentCell.ParentZone.IsWorldMap())
                    {
                        CombustionBeam();
                    }
                    return(false);
                }
            }

            if (E.ID == "CommandQuickFire")
            {
                if (base.IsMyActivatedAbilityUsable(this.CombustionBlastVolleyActivatedAbilityID))
                {
                    if (!ParentObject.pPhysics.CurrentCell.ParentZone.IsWorldMap())
                    {
                        CombustionBeamQuickFire();
                    }
                    return(false);
                }
            }


            if (E.ID == "AIGetOffensiveMutationList")
            {
                FocusPsi PsiMutation = ParentObject.GetPart <FocusPsi>();
                //AddPlayerMessage("I'mma keel yo ass.");
                if (PsiMutation.focusPsiCurrentCharges > 0)
                {
                    E.AddAICommand("CommandCombustionBlast");
                    //AddPlayerMessage("I'mma keel yo ass fo real.");
                }
            }
            return(base.FireEvent(E));
        }
        public void CombustionBeam()
        {
            FocusPsi PsiMutation  = ParentObject.GetPart <FocusPsi>();
            string   ChargesSpent = PsiMutation.focusPsiCurrentCharges.ToString();

            var ParentsEgoMod   = ParentObject.Statistics["Ego"].Modifier;
            var ParentsLevelMod = ParentObject.Statistics["Level"].BaseValue;

            if (!ParentObject.pPhysics.CurrentCell.ParentZone.IsWorldMap())
            {
                if (PsiMutation == null)
                {
                    // AddPlayerMessage("You lack the ability to do this.");
                    string verb1     = "lack";
                    string extra1    = "ability to do this";
                    string termiPun1 = "!";
                    XDidY(ParentObject, verb1, extra1, termiPun1);
                    return;
                }
                if (IsPlayer())
                {
                    ChargesSpent = Popup.AskString("Expend how many charges", "1", 3, 1, "0123456789");
                }
                int Charges = Convert.ToInt32(ChargesSpent);
                if (IsPlayer() && Charges <= 0)
                {
                    AddPlayerMessage("That's not a valid amount of charges.");
                    return;
                }
                if (Charges > 1 + ParentsEgoMod + ParentsLevelMod && !ParentObject.HasEffect("Psiburdening"))
                {
                    int fatigueVar = 25;
                    ParentObject.ApplyEffect(new Psiburdening(fatigueVar * Charges));
                }
                ActuallyFire(Charges);
            }
        }
        //
        //
        //
        //
        //


        public void ChangeAmbientTemperature(string AmbientTempChoices)
        {
            FocusPsi PsiMutation = ParentObject.GetPart <FocusPsi>();

            var ParentsEgo     = ParentObject.Statistics["Ego"].Modifier;
            var ParentsLevel   = ParentObject.Statistics["Level"].BaseValue;
            var ParentsCharges = ParentObject.Statistics["PsiCharges"].BaseValue;

            string ChargesSpent = PsiMutation.focusPsiCurrentCharges.ToString();
            string RadiusChoice = null;

            MaximumRadius = Math.Min(1 + Level, 8);

            if (!this.ParentObject.pPhysics.CurrentCell.ParentZone.IsWorldMap())
            {
                if (PsiMutation == null)
                {
                    // AddPlayerMessage("You lack the ability to do this.");
                    string verb1     = "lack";
                    string extra1    = "ability to do this";
                    string termiPun1 = "!";
                    XDidY(ParentObject, verb1, extra1, termiPun1);
                    return;
                }
                if (IsPlayer())
                {
                    ChargesSpent = Popup.AskString("Expend how many charges", "1", 3, 1, "0123456789");
                }
                if (IsPlayer())
                {
                    RadiusChoice = Popup.AskString("Radius of the effect " + "(Maximum Radius: " + MaximumRadius + ")", "1", 3, 1, "0123456789");
                }

                int Charges = Convert.ToInt32(ChargesSpent);
                int Radius  = Convert.ToInt32(RadiusChoice);

                if (Radius > MaximumRadius)
                {
                    AddPlayerMessage("The Radius you've chosen is greater than you can yield.");
                    ChargesSpent += Charges;
                    return;
                }
                if (Radius <= 0)
                {
                    AddPlayerMessage("Not a valid input for radius.");
                    ChargesSpent += Charges;
                    return;
                }
                if (!PsiMutation.usePsiCharges(Charges))
                {
                    AddPlayerMessage("You do not have enough psi-charges!");
                    return;
                }
                if (IsPlayer() && Charges <= 0)
                {
                    AddPlayerMessage("That's not a valid amount of charges.");
                    return;
                }
                if (Charges > 1 + ParentsEgo + ParentsLevel / 2 && !ParentObject.HasEffect("Psiburdening"))
                {
                    int fatigueVar = 25;
                    ParentObject.ApplyEffect(new Psiburdening(fatigueVar * Charges));
                }


                int Range = 6 + Level / 2 + ParentsEgo;


                List <Cell> Cells = PickBurst(Radius, Range, false, AllowVis.OnlyExplored);

                if (AmbientTempChoices == "Increase Temperature")
                {
                    foreach (var c in Cells)
                    {
                        c.TemperatureChange(Charges * 100, ParentObject);
                        if (Charges >= 15)
                        {
                            c.LargeFireblast();
                        }
                        GameObject cTarget = c.GetFirstObjectWithPart("Brain");
                        if (cTarget != null)
                        {
                            cTarget.GetAngryAt(ParentObject, -100);
                        }
                    }
                }
                else if (AmbientTempChoices == "Decrease Temperature")
                {
                    foreach (var c in Cells)
                    {
                        c.TemperatureChange((Charges * 100) * -1, ParentObject);
                        //
                        if (Charges >= 15)
                        {
                            c.AddObject("CryoGas").GetPart <Gas>().Density = 1 * Charges;
                        }
                        GameObject cTarget = c.GetFirstObjectWithPart("Brain");
                        if (cTarget != null)
                        {
                            cTarget.GetAngryAt(ParentObject, -100);
                        }
                    }
                }


                PlayWorldSound("ambientaltered");
                CooldownMyActivatedAbility(ActivateThermokinesisAbilityID, Charges * 15);
            }
        }
        public void ChangeTargetResistances(string ResistanceChoice, string ElementChoice)
        {
            // AddPlayerMessage("MethodFiring: ChangeTargetResistances");

            FocusPsi PsiMutation = ParentObject.GetPart <FocusPsi>();

            var ParentsEgo     = ParentObject.Statistics["Ego"].Modifier;
            var ParentsLevel   = ParentObject.Statistics["Level"].BaseValue;
            var ParentsCharges = ParentObject.Statistics["PsiCharges"].BaseValue;

            string ChargesSpent = PsiMutation.focusPsiCurrentCharges.ToString();



            if (PsiMutation == null)
            {
                // AddPlayerMessage("You lack the ability to do this.");
                string verb1     = "lack";
                string extra1    = "ability to do this";
                string termiPun1 = "!";
                XDidY(ParentObject, verb1, extra1, termiPun1);
                return;
            }
            if (IsPlayer())
            {
                ChargesSpent = Popup.AskString("Expend how many charges", "1", 3, 1, "0123456789");
            }

            int Charges = Convert.ToInt32(ChargesSpent);

            if (!PsiMutation.usePsiCharges(Charges))
            {
                AddPlayerMessage("You do not have enough psi-charges!");
                return;
            }
            if (IsPlayer() && Charges <= 0)
            {
                AddPlayerMessage("That's not a valid amount of charges.");
                return;
            }
            if (Charges > 1 + ParentsEgo + ParentsLevel && !ParentObject.HasEffect("Psiburdening"))
            {
                int fatigueVar = 25;
                ParentObject.ApplyEffect(new Psiburdening(fatigueVar * Charges));
            }

            // AddPlayerMessage("MethodStep: Getting Target");

            Cell       TargetCell = PickDestinationCell(12 + Level, AllowVis.OnlyVisible, false, true, false, true);
            GameObject Target     = TargetCell.GetFirstObjectWithPart("Combat");

            // AddPlayerMessage("MethodStep: Getting Element Type");


            string Element = null;

            if (ElementChoice == "Heat")
            {
                Element = "HeatResistance";
            }
            else if (ElementChoice == "Cold")
            {
                Element = "ColdResistance";
            }


            // AddPlayerMessage("MethodStep: Applying Effect");

            if (!Target.HasEffect("Temperatura"))
            {
                Target.ApplyEffect(new Temperatura(0, Owner: ParentObject));
                Target.ParticleBlip("{{W|#}}", 3);
                PlayWorldSound("tempaltered");
                Event cE = Event.New("AlteringTemperatureEffectEvent", "ChargesSpent", Charges, "Element", Element, "Caster", ParentObject, "IncreaseOrDecrease", ResistanceChoice, "MutationLevel", Level);

                // AddPlayerMessage("MethodStep: FireEvent CE");

                Target.FireEvent(cE);
            }
            else
            {
                PlayWorldSound("tempaltered");
                Event cE = Event.New("AlteringTemperatureEffectEvent", "ChargesSpent", Charges, "Element", Element, "Caster", ParentObject, "IncreaseOrDecrease", ResistanceChoice, "MutationLevel", Level);

                // AddPlayerMessage("MethodStep: FireEvent CE/ No effect");

                Target.FireEvent(cE);
            }

            // AddPlayerMessage("MethodStep: Setting Flavour Text");

            if (ResistanceChoice == "Increase Resistances")
            {
                XDidYToZ(ParentObject, "alter", null, Target, "resistances to the elements", "!", null, Target, PossessiveObject: true);
            }
            if (ResistanceChoice == "Decrease Resistances")
            {
                Target.GetAngryAt(ParentObject, -100);
                XDidYToZ(ParentObject, "alter", null, Target, "resistances to the elements", "!", null, ParentObject, Target, true, PossessiveObject: true);
            }

            CooldownMyActivatedAbility(ActivateThermokinesisAbilityID, Charges * 3);
        }
        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);
        }