예제 #1
0
        public override bool FireEvent(Event E)
        {
            if (E.ID == "EndTurn")
            {
                if (ParentObject.HasPart("OpeningStory"))
                {
                    return(true);
                }
                if (!ParentObject.HasEffect("Inspired"))
                {
                    if (ParentObject.IsPlayer())
                    {
                        Popup.Show("Your training as a carbide chef has inspired you to invent a meal!");
                    }
                    ParentObject.ApplyEffect(new Inspired(Calendar.turnsPerDay * 2));
                    Recipes--;
                }

                if (Recipes == 0)
                {
                    ParentObject.RemovePart(this);
                }
            }
            return(true);
        }
예제 #2
0
 public override bool WantTurnTick()
 {
     if (!ParentObject.HasEffect(x => DiseaseEffects.Contains(x.ClassName)))
     {
         return(true);
     }
     else if (ParentObject.HasEffect(x => DiseaseEffects.Contains(x.ClassName) && ParentObject.GetStatValue("Hitpoints") <= 1))
     {
         StatsShifted = true;
         --DailyCycleCount;
         if (DailyCycleCount <= 0)
         {
             StatShifter.SetStatShift(ParentObject, "Hitpoints", -1, true);
             DailyCycleCount += 2400;
             return(true);
         }
     }
     else if (!ParentObject.HasEffect(x => DiseaseEffects.Contains(x.ClassName)))
     {
         StatShifter.RemoveStatShifts();
         DailyCycleCount = 2400;
         return(true);
     }
     else if (ParentObject.HasEffect(x => DiseaseEffects.Contains(x.ClassName)) && ParentObject.GetStatValue("Hitpoints") <= 1)
     {
         ParentObject.Die(null, null, "Your form withers away to your pathogenic guest.");
     }
     return(base.WantTurnTick());
 }
예제 #3
0
 public override bool HandleEvent(ObjectEnteredCellEvent E)
 {
     if (E.Object == ParentObject && E.Cell.HasObject(X => WaterThatHurts.Contains(X.Blueprint)) && !ParentObject.HasEffect("Dissolving") && !ParentObject.HasEffect("Flying"))
     {
         ParentObject.ApplyEffect(new Dissolving(1, ParentObject), ParentObject);
         ParentObject.TakeDamage(ref Damage, null, "{{green|Dissolved into visceral soup.}}", null, null, null, Message: "from salt diffusion!");
         IsDissolving = true;
     }
     else if (IsDissolving == true && (E.Object == ParentObject && E.Cell.HasObject(X => WaterThatHurts.Contains(X.Blueprint))))
     {
         this.Duration += 2;
         Damage        += 1;
         ParentObject.TakeDamage(ref Damage, null, "{{green|Dissolved into visceral soup.}}", null, null, null, Message: "from salt diffusion!");
     }
     else if ((IsDissolving == true && E.Object == ParentObject && (!E.Cell.HasObject(X => WaterThatHurts.Contains(X.Blueprint)))))
     {
         this.Duration -= 1;
         ParentObject.TakeDamage(ref Damage, null, "{{green|Dissolved into visceral soup.}}", null, null, null, Message: "from salt diffusion!");
     }
     if (Duration <= 0)
     {
         IsDissolving = false;
         if (ParentObject.HasEffect("Dissolving"))
         {
             ParentObject.RemoveEffect("Dissolving");
             Damage = 2;
         }
     }
     return(base.HandleEvent(E));
 }
        public override bool HandleEvent(AttackerDealingDamageEvent E)
        {
            if (E.Actor == ParentObject && ParentObject.HasEffect("AstralTabbyStance"))
            {
                E.Damage.Amount = (E.Damage.Amount / 2);
            }

            return(base.HandleEvent(E));
        }
예제 #5
0
        public override bool Unmutate(GameObject GO)
        {
            Phased Phased = ParentObject.GetEffect("Phased") as Phased;

            if (ParentObject.HasEffect("Phased"))
            {
                ParentObject.RemoveEffect(Phased);
            }
            return(base.Unmutate(GO));
        }
 public override bool ChangeLevel(int NewLevel)
 {
     StatShifter.DefaultDisplayName = "Chitin Skin";
     avBonus = 1 + (int)Math.Ceiling((Decimal)(NewLevel / 2));
     StatShifter.SetStatShift(target: ParentObject, statName: "AV", amount: avBonus, baseValue: true);
     STRBonus = 1 + (int)Math.Ceiling((Decimal)(NewLevel / 2));
     StatShifter.SetStatShift(target: ParentObject, statName: "Strength", amount: STRBonus, baseValue: true);
     if (ParentObject.HasEffect("SoftChitin"))
     {
         SoftChitin effect = ParentObject.GetEffect("SoftChitin") as SoftChitin;
         effect.setAVDebuff(avBonus, ParentObject);
     }
     return(base.ChangeLevel(NewLevel));
 }
예제 #7
0
        public override bool FireEvent(Event E)
        {
            if (E.ID == "Regenerating")
            {
                if (ParentObject.HasEffect("Meditating"))
                {
                    int HealthRegained = E.GetIntParameter("Amount");
                    HealthRegained += 3 + ParentObject.StatMod("Toughness", 1);
                }
            }
            // else if (E.ID == "AdjustSprintDuration")
            // {
            //     var SprintSpeedDurationBonus = E.GetIntParameter("Duration");
            //     SprintSpeedDurationBonus += 40;
            // }

            return(base.FireEvent(E));
        }
 public override bool FireEvent(Event E)
 {
     //...
     if (E.ID == "BeginMove")
     {
         Cell Cell = E.GetParameter("DestinationCell") as Cell;
         if (Cell.HasObject(X => WaterThatHurts.Contains(X.Blueprint)) && !ParentObject.HasEffect("Dissolving") && ParentObject.IsPlayer())
         {
             if (Popup.ShowYesNo("This liquid is harmful to you, continue") != 0)
             {
                 AutoAct.Interrupt();
                 return(false);
             }
             else
             {
             }
         }
     }
     //...
     return(base.FireEvent(E));
 }
예제 #9
0
        public override bool Mutate(GameObject GO, int Level)
        {
            if (!ParentObject.HasPart("NotOriginalEntity"))
            {
                // Statshifter - Setting all stats for starting husk
                StatShifter.SetStatShift(ParentObject, "Ego", 6, true);
                StatShifter.SetStatShift(ParentObject, "Willpower", 6, true);
                StatShifter.SetStatShift(ParentObject, "Intelligence", 6, true);
                StatShifter.SetStatShift(ParentObject, "Strength", -6, true);
                StatShifter.SetStatShift(ParentObject, "Toughness", -6, true);
                StatShifter.SetStatShift(ParentObject, "Agility", -6, true);
            }
            if (!ParentObject.HasEffect <Disintegrating>())
            {
                ParentObject.ApplyEffect(new Disintegrating(9999));
            }

            ActivatedAbilities activatedAbilities = ParentObject.GetPart("ActivatedAbilities") as ActivatedAbilities;

            this.ActivatedAbilityID = activatedAbilities.AddAbility("Soulshunt", "CommandSoulShunt", "Mental Mutation", "Shunt the imprints of your victims' mind from their body, and assume the throne of their vessel.\n\n" + "Target makes a Willpower saving-throw vs your Ego Modifier {{light blue|(+10)}} or be shunted from its body; you assume control of the target's body permanently. Your new husk will wither over time. On a successful soulshunt you gain a 10% chance to increase your ego score by {{light blue|1}}." + "\n\n{{dark gray|Base cooldown: 2400}}", "(O)", null, false, false, false, false, false, false, false, false, -1);
            return(base.Mutate(GO, Level));
        }
        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);
            }
        }
예제 #11
0
        public override bool HandleEvent(GetShieldBlockPreferenceEvent E)
        {
            var Shield = E.Shield.GetPart <Shield>();

            var ElectroHook = ParentObject.GetPart <Electrokinesis>();

            if (ElectroHook.Potency >= 14 && ParentObject.HasEffect("ShimmeringShroud"))
            {
                if (E.Defender == ParentObject)
                {
                    if (E.Shield.HasPart("Metal"))
                    {
                        var Attacker   = E.Attacker;
                        var Defender   = E.Defender;
                        var PotencyMod = 1 + ElectroHook.Potency;

                        Attacker.TakeDamage((PotencyMod), Attacker.Is + "takes damage from " + Defender.its + " shimmering shroud!", "Electricity", DeathReason: null, ThirdPersonDeathReason: null, Defender);
                        Attacker.ApplyEffect(new Stun(PotencyMod, PotencyMod));
                    }
                }
            }

            return(base.HandleEvent(E));
        }
        public override bool FireEvent(Event E)
        {
            if (E.ID == "CastShadowCommand")
            {
                CastDarkness();
            }
            else if (E.ID == "ShadeSelfCommand")
            {
                CooldownMyActivatedAbility(ShadeSelfActivatedAbilityID, 30);
                if (ParentObject.HasEffect("Darkening"))
                {
                    AddPlayerMessage("{{gray|The shroud of darkness about you disperses.}}");
                    ParentObject.RemoveEffect(new Darkening());
                    return(base.FireEvent(E));
                }
                else
                {
                    AddPlayerMessage("{{dark gray|You shroud yourself in darkness.}}");
                    ParentObject.ApplyEffect(new Darkening());
                }
            }

            return(base.FireEvent(E));
        }
        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 override bool FireEvent(Event E)
        {
            // This event calls the AIGetPassiveMutationList event, in this specific event, it controls how AI's passively use certain abilities, traits excedra which are randomly assigned to various mutants-- the second line after the call assigns activatedabilities to pilesOfAbilities and then sets them to equal parentobject.GetPart<ActivatedAbilities>(), the line after is a bool that is "if pileofabilities does not exist, which calls to look at the acitvated abilities, and then it checks if the specific mutation which is assigned its own specail ID in the GUID section of the add abilities list, exist. Iy will then add the command to the ai with the E.AddAICommand, with the string and an integer denoting its priority.
            //Modifydefending save calls for a longer set of commands. essentially it reads as Call event (E.ID) ModifyDefendingSave and then E(Event). Get string, "VS," which denounces the string, string-null,(only if it has one). Contains "Disease.
            //The next parameterter sets up the roll, the int turns roll into an integer that is equivelent to the event.getintparameter which calls for a string, in this case, roll, (I forget the int Paramter)
            if (E.ID == "ModifyDefendingSave" && E.GetStringParameter("Vs", (string)null).Contains("Disease"))
            {
                int roll = E.GetIntParameter("Roll", 0) - (3 + (int)Math.Ceiling((Decimal)this.Level / new Decimal(3)));
                E.SetParameter("Roll", roll);
            }

            else if (E.ID == "BeforeApplyDamage")
            {
                Damage parameter = E.GetParameter("Damage") as Damage;
                if (parameter.HasAttribute("Poison"))
                {
                    parameter.Amount = (int)((double)parameter.Amount * (1 + (0.10 * (int)Math.Ceiling((Decimal)Level / new Decimal(2)))));
                }
            }

            else if (E.ID == "EndTurn")
            {
                if (turnsTilMolt > 0)
                {
                    --turnsTilMolt;
                    if (turnsTilMolt <= 0)
                    {
                        if (ParentObject.IsPlayer())
                        {
                            Popup.Show("You've outgrown your exoskeleton, its time to molt.");
                        }


                        ParentObject.ApplyEffect(new EncumberingHusk());

                        ActivatedAbilities activatedAbilities = ParentObject.GetPart("ActivatedAbilities") as ActivatedAbilities;
                        this.ActivatedAbilityID = activatedAbilities.AddAbility("Molt", "CommandMolt", "Physical Mutation", "Molts your Husk.", "(Z)", null, false, false, false, false, false, false, false, false);
                    }
                }
                if (ImmobilityDuration > 0 && ParentObject.HasEffect("Immobilized"))
                {
                    --ImmobilityDuration;
                    if (ImmobilityDuration <= 0)
                    {
                        ParentObject.RemoveEffect("EncumberingHusk", false);
                    }
                }
                GetMutationTimerAssistant();
            }


            else if (E.ID == "CommandMolt")
            {
                if (!this.ParentObject.pPhysics.CurrentCell.ParentZone.IsWorldMap())
                {
                    if (this.ActivatedAbilityID != Guid.Empty)
                    {
                        ActivatedAbilities activatedAbilities = ParentObject.GetPart("ActivatedAbilities") as ActivatedAbilities;
                        activatedAbilities.RemoveAbility(this.ActivatedAbilityID);
                    }
                    ParentObject.RemoveEffect("EncumberingHusk", false);
                    Cell currentCell = this.ParentObject.GetCurrentCell();
                    ParentObject.ApplyEffect(new Immobilized(35, "Strength", "Molting Process", "molting"));
                    ParentObject.ApplyEffect(new SoftChitin(avBonus));
                    if (Level <= 3)
                    {
                        currentCell.AddObject("GamerGirlMoltShoddy");
                    }
                    else if (Level <= 6)
                    {
                        currentCell.AddObject("GamerGirlMoltQuality");
                    }
                    else if (Level <= 9)
                    {
                        currentCell.AddObject("GamerGirlMoltHighQuality");
                    }
                    else if (Level < 10)
                    {
                        currentCell.AddObject("GamerGirlMoltDeluxe");
                        GameObject Molt = currentCell.GetObjectWithTagOrProperty("Commerce");
                        Molt.SetIntProperty("Value", +(Level - 9) * 250);
                    }
                }
                else
                {
                    Popup.Show("You must stop travelling before you can molt.");
                }
            }

            else if (E.ID == "CommandChitinHarden")
            {
                turnsTilMolt = (int)Stat.GaussianRandom(360001.0f, 77664.06416574f);
                // turnsTilMolt = 10;
                totalTurnsTilMolt = turnsTilMolt;
            }

            return(base.FireEvent(E));
        }
예제 #15
0
        public override bool FireEvent(Event E)
        {
            if (E.ID == "AtttackerHit" && ParentObject.HasEffect("SaltHopperStance"))
            {
                Damage Damage   = E.GetParameter <Damage>("Damage");
                var    Attacker = ParentObject;

                var ComboSI = ParentObject.GetPart <WM_MMA_CombinationStrikesI>();

                if (NegEffectsCollectiveTI.Any(Attacker.HasEffect))
                {
                    Damage.Amount = (int)Math.Round(Damage.Amount * 1.15f);
                }
                if (NegEffectsCollectiveTII.Any(Attacker.HasEffect))
                {
                    Damage.Amount = (int)Math.Round(Damage.Amount * 1.55f);
                }
                if (NegEffectsCollectiveTIII.Any(Attacker.HasEffect))
                {
                    Damage.Amount = (int)Math.Round(Damage.Amount * 2.5f);
                }
                else
                {
                    Damage.Amount = (int)Math.Round(Damage.Amount * 0.75f);
                }
            }
            if (E.ID == "AttackerAfterAttack" && ParentObject.HasEffect("SaltHopperStance"))
            {
                var ComboSI = ParentObject.GetPart <WM_MMA_CombinationStrikesI>();

                ComboSI.CurrentComboICounter = 0;
                ComboSI.UpdateCounter();
                // AddPlayerMessage("Execute Attacker hit on Salthopperstyle");

                Damage Damage   = E.GetParameter <Damage>("Damage");
                var    Attacker = ParentObject;
                var    Defender = E.GetGameObjectParameter("Defender");
                var    Weapon   = E.GetGameObjectParameter("Weapon");

                var AttackerLevels = Attacker.Statistics["Level"].BaseValue;

                // AddPlayerMessage("var check 1");



                if (!NegEffectsCollectiveTI.Any(Attacker.HasEffect) && Stat.Random(1, 100) <= 3 + AttackerLevels)
                {
                    if (Stat.Random(1, 100) >= 50)
                    {
                        Defender.ApplyEffect(new Dazed(10 + (ParentObject.Statistics["Level"].Value)));
                    }
                    else
                    {
                        Defender.ApplyEffect(new PsiSupression(10 + (ParentObject.Statistics["Level"].Value)));
                    }
                }
                else if (!NegEffectsCollectiveTII.Any(Attacker.HasEffect) && Stat.Random(1, 100) <= 3 + AttackerLevels && ParentObject.Statistics["Level"].Value >= 10)
                {
                    if (Stat.Random(1, 100) >= 50)
                    {
                        Defender.ApplyEffect(new Cripple(10 + (ParentObject.Statistics["Level"].Value)));
                    }
                    else
                    {
                        Defender.ApplyEffect(new Prone());
                    }
                }
                else if (!NegEffectsCollectiveTII.Any(Attacker.HasEffect) && Stat.Random(1, 100) <= 3 + AttackerLevels && ParentObject.Statistics["Level"].Value >= 20)
                {
                    if (Stat.Random(1, 100) >= 50)
                    {
                        Defender.ApplyEffect(new Paralyzed(10 + (ParentObject.Statistics["Level"].Value),
                                                           10 + (ParentObject.Statistics["Level"].Value)));
                    }
                    else
                    {
                        Defender.ApplyEffect(new Stun(10 + (ParentObject.Statistics["Level"].Value),
                                                      10 + (ParentObject.Statistics["Level"].Value)));
                    }
                }
                else if (Stat.Random(1, 100) <= 2 + (AttackerLevels / 5))
                {
                    Defender.UseEnergy(25);
                }
            }

            return(base.FireEvent(E));
        }
예제 #16
0
        public override bool FireEvent(Event E)
        {
            if (E.ID == "AttackerHit" && ParentObject.HasEffect("SaltBackStance"))
            {
                try
                {
                    var    salthopperDamageSystem = ParentObject.GetPart <WM_MMA_PathSaltHopper>();
                    Damage Damage   = E.GetParameter <Damage>("Damage");
                    var    Attacker = ParentObject;


                    if (salthopperDamageSystem.NegEffectsCollectiveTI.Any(Attacker.HasEffect))
                    {
                        Damage.Amount = (int)Math.Round(Damage.Amount * 1.15f);
                    }
                    if (salthopperDamageSystem.NegEffectsCollectiveTII.Any(Attacker.HasEffect))
                    {
                        Damage.Amount = (int)Math.Round(Damage.Amount * 1.55f);
                    }
                    if (salthopperDamageSystem.NegEffectsCollectiveTIII.Any(Attacker.HasEffect))
                    {
                        Damage.Amount = (int)Math.Round(Damage.Amount * 2.5f);
                    }
                    else
                    {
                        Damage.Amount = (int)Math.Round(Damage.Amount * 1.0f);
                    }
                }
                catch
                {
                }
            }
            if (E.ID == "GetDefenderHitDice" && ParentObject.HasEffect("SaltbackStance"))
            {
                // AddPlayerMessage("SaltBack Defender Block Begins");
                // GameObject Attacker = E.GetGameObjectParameter("Attacker");
                var Owner = ParentObject;


                Body            body  = Owner.GetPart("Body") as Body;
                List <BodyPart> hands = body.GetPart("Hand");
                var             hand  = body.GetPrimaryWeaponOfTypeOnBodyPartOfType("DefaultMartialFist", "Hand");

                int FistShieldAV = ParentObject.StatMod("Toughness", 1) + (ParentObject.Statistics["Level"].BaseValue / 2);
                if (SpecialFistCollective.Any(Owner.HasEquippedObject))
                {
                    PSBArmorBonus = 3;
                }

                if (Owner.GetShield() != null)
                {
                    // AddPlayerMessage("SaltBackHalf Shield Returned Null");
                    return(true);
                }
                if (E.HasParameter("ShieldBlocked"))
                {
                    // AddPlayerMessage("SaltBackHalf Blocked ParameterSet");
                    return(true);
                }
                if (!Owner.CanMoveExtremities(null, false, false, false))
                {
                    // AddPlayerMessage("SaltBackHalf CanMove Check");
                    return(true);
                }
                // AddPlayerMessage("SaltBackHalf Block Attempt Random Int");
                if (Stat.Random(1, 100) <= 15 + (5 * (ParentObject.Statistics["Level"].BaseValue / 5)))
                {
                    // AddPlayerMessage("SaltBackHalf SaltBack Status");

                    var MMAComboAccess = ParentObject.GetPart <WM_MMA_CombinationStrikesI>();
                    E.SetParameter("ShieldBlocked", true);
                    ++MMAComboAccess.CurrentComboICounter;
                    MMAComboAccess.UpdateCounter();

                    // AddPlayerMessage("SaltBackHalf Damage");

                    if (Owner.IsPlayer())
                    {
                        IComponent <GameObject> .AddPlayerMessage("You deflect an attack with your " + ParentObject.Equipped + "!" + "(" + FistShieldAV + " AV)", 'g');
                    }
                    else
                    {
                        Owner.ParticleText(string.Concat(new object[]
                        {
                            "{{",
                            IComponent <GameObject> .ConsequentialColor(Owner, null),
                            "|Block! (+",
                            FistShieldAV +
                            " AV)}}"
                        }), ' ', false, 1.5f, -8f);
                    }
                    E.SetParameter("AV", E.GetIntParameter("AV", 0) + FistShieldAV);
                }
            }
            return(base.FireEvent(E));
        }
        public override bool FireEvent(Event E)
        {
            if (E.ID == "DefenderAfterAttackMissed" && ParentObject.HasEffect("AstralTabbyStance"))
            {
                var Defender = E.GetGameObjectParameter("Defender");
                var Weapon   = E.GetGameObjectParameter("Weapon");

                // AddPlayerMessage("Defender: " + Defender);

                if (Defender == ParentObject)
                {
                    var MMAComboAccess = ParentObject.GetPart <WM_MMA_CombinationStrikesI>();

                    MMAComboAccess.CurrentComboICounter++;
                    MMAComboAccess.UpdateCounter();
                }
            }
            else if (E.ID == "AttackerHit" && ParentObject.HasEffect("AstralTabbyStance"))
            {
                Damage Damage = E.GetParameter <Damage>("Damage");
                Damage.Amount = (int)Math.Floor(Damage.Amount * 0.75);
            }
            else if (E.ID == "BeginTakeAction" && ParentObject.HasEffect <AstralTabbyStance>())
            {
                // AddPlayerMessage("Log: Beginning Take Action");
                var ParentCell = ParentObject.CurrentCell.GetLocalAdjacentCells();
                // AddPlayerMessage("Log: Acquired Cells");
                foreach (var C in ParentCell)
                {
                    // AddPlayerMessage("Log: Starting Foreach");
                    if (C.HasObjectWithPart("Combat") && !C.HasObjectWithPart("FlankerReader_PAT"))
                    {
                        // AddPlayerMessage("Found Combat Targets");
                        var ObjectCheck = C.GetFirstObjectWithPart("Combat");
                        // AddPlayerMessage("Log: Getting Combat Targets");

                        if (!ObjectCheck.HasPart("FlankerReader_PAT"))
                        {
                            // AddPlayerMessage("Log: Adding FlankerCheckParts");
                            ObjectCheck.AddPart <FlankerReader_PAT>();


                            // AddPlayerMessage("Log: Added Flanker Part");
                            var ConfirmedObject = ObjectCheck.GetPart <FlankerReader_PAT>();
                            ConfirmedObject.Check = true;


                            // AddPlayerMessage("Log: Confriming Object Flanker Pass");
                            if (ConfirmedObject.Check != false)
                            {
                                FlankersAboundDuration = 3;
                                ParentObject.Statistics["DV"]._Value += 1;
                                Targeted              = true;
                                FlankerAccumBonus    += 1;
                                ConfirmedObject.Check = false;
                            }
                        }
                        // AddPlayerMessage("Log: Completed begin take action.");
                        break;
                    }
                    else
                    if (Targeted == true)
                    {
                        Targeted = false;
                    }
                }
            }
            else if (E.ID == "TargetedForMissileWeapon" && ParentObject.HasEffect <AstralTabbyStance>())
            {
                GameObject Attacker = E.GetGameObjectParameter("Attacker");
                GameObject Defender = E.GetGameObjectParameter("Defender");

                if (Defender == ParentObject)
                {
                    Targeted = true;
                    StatShifter.SetStatShift("DV", +ParentObject.Statistics["Agility"].Modifier + (ParentObject.Statistics["Level"].BaseValue / 8));
                }
            }
            else if (E.ID == "EndTurn" && ParentObject.HasEffect <AstralTabbyStance>())
            {
                // AddPlayerMessage("Log: Firing Endturn.");
                if (FlankersAboundDuration > 0 && Targeted == false)
                {
                    // AddPlayerMessage("Log: Duration Countdown.");
                    --FlankersAboundDuration;
                }
                else if (Targeted == false && FlankersAboundDuration <= 0)
                {
                    // AddPlayerMessage("Log: Resetting Stats");

                    ParentObject.Statistics["DV"]._Value -= FlankerAccumBonus;
                    FlankerAccumBonus = 0;
                    Targeted          = false;
                }
                else if (Targeted == true && StatShifter != null)
                {
                    StatShifter.RemoveStatShifts();
                }

                AddPlayerMessage("Log: Targeted: " + Targeted);
                AddPlayerMessage("FlankersAboundDuration: " + FlankersAboundDuration);
            }
            return(base.FireEvent(E));
        }
예제 #18
0
        public void Activate(GameObject activator = null)
        {
            var inventory = ParentObject.GetPart <Inventory>();
            var liquid    = ParentObject.GetPart <LiquidVolume>();

            if (ParentObject.HasEffect(typeof(helado_BrewedBeverages_Brewing)))
            {
                // Refuse to work because we're already working!

                GetAnnoyed(activator);

                AddPlayerMessage(VariableReplace(
                                     MESSAGE_REFUSAL_WORKING,
                                     Subject: ParentObject
                                     ));
            }
            else if (!ParentObject.UseCharge(CHARGE_COST_TO_ACTIVATE))
            {
                // Refuse to work because no charge is available.

                AddPlayerMessage(VariableReplace(
                                     MESSAGE_REFUSAL_NO_CHARGE,
                                     Subject: ParentObject
                                     ));
            }
            else if (IsAggravated() || ParentObject.IsHostileTowards(activator))
            {
                // Refuse to work because we're too aggravated.

                AddPlayerMessage(VariableReplace(
                                     MESSAGE_REFUSAL_AGGRAVATED,
                                     Subject: ParentObject
                                     ));
            }
            else if (inventory.GetObjectCount() == 0)
            {
                // Refuse to work because our intake is empty.

                AddPlayerMessage(VariableReplace(
                                     MESSAGE_REFUSAL_INTAKE_EMPTY,
                                     Subject: ParentObject
                                     ));
            }
            else if (!liquid.IsEmpty())
            {
                // Refuse to work because our dish has liquid in it already.

                AddPlayerMessage(VariableReplace(
                                     MESSAGE_REFUSAL_DISH_OCCUPIED,
                                     Subject: ParentObject
                                     ));
            }
            else
            {
                // Let's get to work!

                Recipe recipeToBrew     = null;
                var    triedIngredients = new SortedSet <string>(
                    inventory.GetObjects().ConvertAll(delegate(GameObject go)
                {
                    return(go.GetBlueprint().Name);
                })
                    );

                foreach (var blueprint in
                         GameObjectFactory.Factory.GetBlueprintsWithTag(
                             TAG_RECIPE
                             ).Shuffle(RandomSource)
                         )
                {
                    var recipe = ParseRecipe(blueprint);

                    if (
                        recipe != null &&
                        recipe.Ingredients.SetEquals(triedIngredients)
                        )
                    {
                        recipeToBrew = recipe;
                        break;
                    }
                }

                if (recipeToBrew == null)
                {
                    // We're “brewing” putrescence :(
                    recipeToBrew = new Recipe();
                }

                ParentObject.ApplyEffect(new helado_BrewedBeverages_Brewing(recipeToBrew, activator));
            }
        }
        public override bool FireEvent(Event E)
        {
            if (E.ID == "AttackerHit" && ParentObject.HasEffect("SlumberStance"))
            {
                try
                {
                    var    salthopperDamageSystem = ParentObject.GetPart <WM_MMA_PathSaltHopper>();
                    Damage Damage   = E.GetParameter <Damage>("Damage");
                    var    Attacker = ParentObject;


                    if (salthopperDamageSystem.NegEffectsCollectiveTI.Any(Attacker.HasEffect))
                    {
                        Damage.Amount = (int)Math.Round(Damage.Amount * 1.15f);
                    }
                    if (salthopperDamageSystem.NegEffectsCollectiveTII.Any(Attacker.HasEffect))
                    {
                        Damage.Amount = (int)Math.Round(Damage.Amount * 1.55f);
                    }
                    if (salthopperDamageSystem.NegEffectsCollectiveTIII.Any(Attacker.HasEffect))
                    {
                        Damage.Amount = (int)Math.Round(Damage.Amount * 2.5f);
                    }
                    else
                    {
                    }
                }
                catch
                {
                }
            }
            else if (E.ID == "AttackerAfterAttack" && ParentObject.HasEffect("SlumberStance"))
            {
                // AddPlayerMessage("Execute Attacker hit on Slumberstyle");

                Damage Damage   = E.GetParameter <Damage>("Damage");
                var    Attacker = ParentObject;
                var    Defender = E.GetGameObjectParameter("Defender");
                var    Weapon   = E.GetGameObjectParameter("Weapon");

                Event E2 = Event.New("SlumberCleaveEvent");
                E2.SetParameter("Attacker", ParentObject);
                E2.SetParameter("Defender", Defender);
                E2.SetParameter("Damage", Damage.Amount);

                ParentObject.FireEvent(E2);
            }
            else if (E.ID == "SlumberCleaveEvent" && ParentObject.HasEffect("SlumberStance"))
            {
                GameObject Attacker     = E.GetGameObjectParameter("Attacker");
                GameObject Defender     = E.GetGameObjectParameter("Defender");
                int        DamageAmount = E.GetParameter <int>("Damage");

                int ParentsStr = ParentObject.Statistics["Strength"].Modifier;

                // AddPlayerMessage("var check 1");

                var AttackerLevels = Attacker.Statistics["Level"].BaseValue;

                // AddPlayerMessage("var check 2");

                var AttackerCell          = Attacker.GetCurrentCell();
                var AttackersAdacentCells = AttackerCell.GetLocalAdjacentCells();

                // AddPlayerMessage("slumberstyle initiated vars");
                string[] directionList = Directions.DirectionList;
                foreach (string direction3 in directionList)
                {
                    GameObject Flankers = ParentObject.GetCurrentCell().GetCellFromDirection(direction3)?.GetCombatTarget(ParentObject, AllowInanimate: false);
                    if (Stat.Random(1, 100) <= 3 + AttackerLevels / 3)
                    {
                        // AddPlayerMessage("Dismember is Firing?");

                        var FlankersBody = Flankers.Body.GetParts();
                        foreach (var ob in FlankersBody)
                        {
                            if (Stat.Random(1, 100) <= 2 + (AttackerLevels / 10) && ob.IsSeverable() && ob.ParentBody != ParentObject.Body)
                            {
                                if (ob.AnyMortalParts() || ob.Mortal)
                                {
                                    if (ob.Type == "Head")
                                    {
                                        ob.Dismember();
                                        Flankers.Die(ParentObject, ParentObject.it + " lob " + Flankers.its + ob.Name + ", killing it!", null);
                                    }
                                    else if (ob.Type == "Body")
                                    {
                                        ob.Dismember();
                                        Flankers.Die(ParentObject, ParentObject.it + "obliterates" + Flankers.its + ob.Name + ", killing it!", null);
                                    }
                                }
                            }
                            else if (ob.IsSeverable() && ob.Appendage && !ob.Mortal && ob.ParentBody != ParentObject.Body)
                            {
                                ob.Dismember();
                            }
                        }
                    }
                    if (Stat.Random(1, 100) <= 25 + AttackerLevels / 3)
                    {
                        // AddPlayerMessage("Push is firing?");

                        Flankers.TakeDamage(ref (DamageAmount));
                        RageStrikePulse(Flankers.CurrentCell);
                        Flankers.Push(direction3, 1000, 1);
                    }
                }
            }
            else if (E.ID == "SlumberWitnessEvent" && ParentObject.HasEffect("SlumberStance"))
            {
                // AddPlayerMessage("slumberstarting for each 2");

                var Attacker = E.GetGameObjectParameter("Attacker");
                var Defender = E.GetGameObjectParameter("Defender");

                var AttackerLevels = Attacker.Statistics["Level"].BaseValue;

                var CheckCells = Attacker.CurrentCell.GetLocalAdjacentCells();

                var CellQuery = CheckCells.Where(C => C.HasObjectWithTagOrProperty("Brain") || C.HasObjectWithTagOrProperty("Combat") && C.HasCombatObject() && !C.HasObject(Attacker));

                foreach (var c2 in CellQuery)
                {
                    // AddPlayerMessage("slumberstarting for each 3");
                    var FrightenedFlankers = c2.GetObjectsInCell();
                    var FrightQuery        = FrightenedFlankers.Where(Obj => !Obj.MakeSave("Ego", 20 + (AttackerLevels / 3), Attacker, "Ego", "Ego", false) && Obj != Attacker && Obj.HasPart("Brain") || Obj.HasPart("Combat"));

                    foreach (var o2 in FrightenedFlankers)
                    {
                        // AddPlayerMessage("slumberstarting for each 4");
                        string text = (int)Math.Floor((double)(AttackerLevels / 2) + 3.0) + "d6";
                        int    num  = ParentObject.StatMod("Ego");

                        o2.pBrain.Goals.Clear();
                        o2.pBrain.PushGoal(new Flee(Attacker, 5 + (AttackerLevels / 2), false));
                        // AddPlayerMessage(o2.The + " flees in horror of " + Attacker.Its + " torrent of rage.");
                    }
                }
            }
            else if (E.ID == "PerformMeleeAttack" && ParentObject.HasEffect("SlumberStance"))
            {
                int HitBonus = E.GetIntParameter("HitBonus");

                HitBonus = +1;
            }

            // if (E.ID == "EndTurn" && ParentObject.HasEffect("SlumberStance"))
            // {
            //     AddPlayerMessage(" ");
            // }

            return(base.FireEvent(E));
        }
예제 #20
0
        public override bool FireEvent(Event E)
        {
            //...
            if (E.ID == "Regenerating" && ParentObject.HasEffect("Submerged"))
            {
                int RegenerationAmountParameter = E.GetIntParameter("Amount");
                RegenerationAmountParameter += (int)Math.Ceiling((float)RegenerationAmountParameter);
                E.SetParameter("Amount", RegenerationAmountParameter);
            }
            else if (E.ID == "BeginMove" && ParentObject.HasEffect("Submerged"))
            {
                Cell Cell = E.GetParameter("DestinationCell") as Cell;
                if (((!Cell.HasObjectWithPart("LiquidVolume") || (Cell.GetFirstObjectWithPart("LiquidVolume") as GameObject).LiquidVolume.Volume < 200) && ParentObject.IsPlayer() && ParentObject.HasEffect("Submerged")))
                {
                    if (Popup.ShowYesNo("Surface and go ashore?") == (int)DialogResult.Yes)
                    {
                        ParentObject.Splash("{{b|*}}");
                        ParentObject.RemoveEffect("Submerged");
                    }
                    else
                    {
                        return(false);
                    }
                }
            }
            else if (E.ID == "DiveCommand")
            {
                Cell Cell = ParentObject.GetCurrentCell();

                Mutations ParentsMutations = ParentObject.GetPart <Mutations>();
                if (ParentObject.HasEffect("Flying"))
                {
                    if (IsPlayer())
                    {
                        AddPlayerMessage("You cannot do this while flying");
                    }
                    return(false);
                }
                else if (!Cell.HasObjectWithPart("LiquidVolume"))
                {
                    AddPlayerMessage("You try to dive into the earth, you imagine this would be easier if the ground were, say, just a tad less hard.");
                    return(false);
                }
                else if ((Cell.GetFirstObjectWithPart("LiquidVolume") as GameObject).LiquidVolume.Volume < 200)
                {
                    AddPlayerMessage("Its too shallow to dive in!");
                    return(false);
                }
                else if (ParentObject.HasEffect("Submerged"))
                {
                    // AddPlayerMessage("Your return to the surface.");
                    ParentObject.Splatter("{{B|*}}");
                    ParentObject.RemoveEffect("Submerged");
                }
                else if ((Cell.GetFirstObjectWithPart("LiquidVolume") as GameObject).LiquidVolume.Volume >= 200 && ParentsMutations.HasMutation("Amphibious"))
                {
                    AddPlayerMessage("You feel right at home.");
                    ParentObject.Splatter("{{B|*}}");
                    ParentObject.ApplyEffect(new Submerged(Duration: Effect.DURATION_INDEFINITE));
                }
                else if ((Cell.GetFirstObjectWithPart("LiquidVolume") as GameObject).LiquidVolume.Volume >= 200 && !ParentsMutations.HasMutation("Amphibious"))
                {
                    ParentObject.Splatter("{{B|*}}");
                    ParentObject.ApplyEffect(new Submerged(Duration: Effect.DURATION_INDEFINITE));
                }
            }
            else if (E.ID == "EndTurn")
            {
                Cell Cell = ParentObject.GetCurrentCell();

                if (ParentObject.HasEffect("Flying") && (ParentObject.HasEffect("Submerged")))
                {
                    ParentObject.RemoveEffect(new Flying());
                    AddPlayerMessage("Removing Paradox Incident.");
                }
                else if (ParentObject.IsHealingPool() && ParentObject.HasEffect("Submerged"))
                {
                    ParentObject.Heal(+ParentObject.Statistics["Toughness"].Modifier);
                }
                else if (((!Cell.HasObjectWithPart("LiquidVolume") || (Cell.GetFirstObjectWithPart("LiquidVolume") as GameObject).LiquidVolume.Volume < 200) && ParentObject.HasEffect("Submerged")))
                {
                    ParentObject.Splash("{{b|*}}");
                    ParentObject.RemoveEffect("Submerged");
                    return(false);
                }
            }
            //...---------------------------------------------------------------------------------------------
            else if (E.ID == "DeepStrikeCommand")
            {
                if (!ParentObject.HasEffect("Submerged") && ParentObject.IsPlayer())
                {
                    AddPlayerMessage("You must be submerged in deep pools of liquid to use this attack.");
                }
                else if (!ParentObject.HasEffect("Submerged") && !ParentObject.IsPlayer())
                {
                }
                else if (ParentObject.HasEffect("Submerged"))
                {
                    string Direction = E.GetStringParameter("Direction");

                    if (Direction == null)
                    {
                        if (ParentObject != null)
                        {
                            Direction = PickDirectionS();
                            try
                            {
                                Patch_PhaseAndFlightMatches.TemporarilyDisabled = true;
                                Event e     = Event.New("CommandAttackDirection", "Direction", Direction);
                                bool  num11 = FireEvent(e);
                                ParentObject.FireEvent(e);
                                XDidY(ParentObject, "rush", "from the depths to strike!", "!", "C", ParentObject);
                                Patch_PhaseAndFlightMatches.TemporarilyDisabled = false;
                            }
                            catch
                            {
                            }
                        }
                    }
                }
            }
            else if (E.ID == "AIGetOffensiveMutationList")
            {
                //AddPlayerMessage("I'mma keel yo ass.");
                if (IsMyActivatedAbilityAIUsable(DiveActivatedAbility))
                {
                    if (!ParentObject.HasEffect("Submerged") && (ParentObject.CurrentCell.GetFirstObjectWithPart("LiquidVolume") as GameObject).LiquidVolume.Volume >= 200)
                    {
                        E.AddAICommand("DiveCommand");
                    }
                }
                int intParameter = E.GetIntParameter("Distance");
                if (E.GetGameObjectParameter("Target") != null && intParameter <= 1 && !ParentObject.IsFrozen() && IsMyActivatedAbilityAIUsable(DeepStrikeActivatedAbility))
                {
                    E.AddAICommand("DeepStrikeCommand");
                }
            }
            else if (E.ID == "BeginTakeAction")
            {
                if (ParentObject.HasEffect("Flying") && (ParentObject.HasEffect("Submerged")))
                {
                    ParentObject.RemoveEffect(new Flying());
                    AddPlayerMessage("Removing Paradox Incident.");
                }
            }

            return(base.FireEvent(E));
        }
예제 #21
0
        public override bool FireEvent(Event E)
        {
            if (E.ID == "BeginTakeAction")
            {
                //______________________________________________________________________________
                var ElectroHook = ParentObject.GetPart <Electrokinesis>();

                Owner = ElectroHook.Owner;

                if (ElectroHook.Potency == 1 && ParentObject.HasEffect("ShimmeringShroud") && EndedOnMessage == false)
                {
                    if (ElectroHook.ShowMutationUpdates == true)
                    {
                        Popup.Show("You can now recharge batteries by expending Potency.\n\n\n [To deactivate these messages, toggle the Electrokinesis Prompts in the Command menu to OFF.]");
                        EndedOnMessage = true;
                        // AddPlayerMessage("Step 1a");
                    }
                }
                else if (ElectroHook.Potency > 1 && ElectroHook.Potency < 8 && ParentObject.HasEffect("ShimmeringShroud"))
                {
                    EndedOnMessage = false;
                    // AddPlayerMessage("Step 1c");
                }
                else if (ElectroHook.Potency == 8 && ParentObject.HasEffect("ShimmeringShroud") && EndedOnMessage == false)
                {
                    //______________________________________________________________________________

                    if (ElectroHook.ShowMutationUpdates == true)
                    {
                        Popup.Show("You can now sense electromagnetic fields around you such as robots and machinery.\n\n\n [To deactivate these messages, toggle the Electrokenisis Prompts in the Command menu to OFF.]");
                        EndedOnMessage = true;
                    }
                    // AddPlayerMessage("Step 2a");
                }
                else if (ElectroHook.Potency > 8 && ElectroHook.Potency < 12 && ParentObject.HasEffect("ShimmeringShroud"))
                {
                    EndedOnMessage = false;
                    // AddPlayerMessage("Step 2c");
                }
                else if (ElectroHook.Potency == 12 && ParentObject.HasEffect("ShimmeringShroud") && EndedOnMessage == false)
                {
                    //______________________________________________________________________________

                    if (ElectroHook.ShowMutationUpdates == true)
                    {
                        Popup.Show("\n\nCreatures that strike you while wielding any form of conductive weapon, now take damage upon successeful penetrations. If you are wearing armor, this extends to creatures' natural equipment as well.\n\n\n [To deactivate these messages, toggle the Electrokenisis Prompts in the Command menu to OFF.]");
                        EndedOnMessage = true;
                    }
                    // AddPlayerMessage("Step 3a");
                }
                else if (ElectroHook.Potency > 12 && ElectroHook.Potency < 14 && ParentObject.HasEffect("ShimmeringShroud"))
                {
                    EndedOnMessage = false;
                    // AddPlayerMessage("Step 3b");
                }
                else if (ElectroHook.Potency == 14 && ParentObject.HasEffect("ShimmeringShroud") && EndedOnMessage == false)
                {
                    if (ElectroHook.ShowMutationUpdates == true)
                    {
                        Popup.Show("\n\nSuccessfully blocking an attack will deal damage to an enemy as long as you are using a conductive shield. \n\n\n [To deactivate these messages, toggle the Electrokenisis Prompts in the Command menu to OFF.]");
                        EndedOnMessage = true;
                        // AddPlayerMessage("Step 4a");
                    }
                }
                else if (ElectroHook.Potency > 14 && ElectroHook.Potency < 18 && ParentObject.HasEffect("ShimmeringShroud"))
                {
                    EndedOnMessage = false;
                    // AddPlayerMessage("Step 4b");
                }
                else if (ElectroHook.Potency == 18 && ParentObject.HasEffect("ShimmeringShroud") && EndedOnMessage == false)
                {
                    //______________________________________________________________________________

                    if (ElectroHook.ShowMutationUpdates == true)
                    {
                        Popup.Show("Laser Weaponry reduced damage to you. \n\n\n [To deactivate these messages, toggle the Electrokenisis Prompts in the Command menu to OFF.]");
                        EndedOnMessage = true;
                    }
                    // AddPlayerMessage("Step 5a");
                }
                else if (ElectroHook.Potency > 18 && ElectroHook.Potency < 28 && ParentObject.HasEffect("ShimmeringShroud"))
                {
                    EndedOnMessage = false;
                    // AddPlayerMessage("Step 5b");
                }
                else if (ElectroHook.Potency == 28 && ParentObject.HasEffect("ShimmeringShroud") && EndedOnMessage == false)
                {
                    //______________________________________________________________________________

                    if (ElectroHook.ShowMutationUpdates == true)
                    {
                        //blocking things hurt them
                        Popup.Show("Robotic and mechanical enemies must make a save or be stunned upon dealing damage to you. \n\n\n [To deactivate these messages, toggle the Electrokenisis Prompts in the Command menu to OFF.]");
                        EndedOnMessage = true;
                        // AddPlayerMessage("Step 6a");
                    }
                }
                else if (ElectroHook.Potency > 28 && ParentObject.HasEffect("ShimmeringShroud"))
                {
                    // AddPlayerMessage("Step 6b");
                    EndedOnMessage = false;
                }
                else if (ElectroHook.Potency == 28 && ParentObject.HasEffect("ShimmeringShroud") && EndedOnMessage == false)
                {
                    //______________________________________________________________________________

                    if (ElectroHook.ShowMutationUpdates == true)
                    {
                        //blocking things hurt them
                        Popup.Show("Laser Weaponry deals no damage to you. \n\n\n [To deactivate these messages, toggle the Electrokenisis Prompts in the Command menu to OFF.]");
                        EndedOnMessage = true;
                        // AddPlayerMessage("Step 7a");
                    }
                }
                else if (ElectroHook.Potency > 28 && ElectroHook.Potency < 38 && ParentObject.HasEffect("ShimmeringShroud"))
                {
                    EndedOnMessage = false;
                    // AddPlayerMessage("Step 7b");
                }
                else if (ElectroHook.Potency == 38 && ParentObject.HasEffect("ShimmeringShroud") && EndedOnMessage == false)
                {
                    //______________________________________________________________________________

                    if (ElectroHook.ShowMutationUpdates == true)
                    {
                        //blocking things hurt them
                        Popup.Show("Laser weapons now transfers damage into potency. \n\n\n [To deactivate these messages, toggle the Electrokenisis Prompts in the Command menu to OFF.]");
                        EndedOnMessage = true;
                        // AddPlayerMessage("Step 8a");
                    }
                }
                else if (ElectroHook.Potency > 38 && ElectroHook.Potency < 42 && ParentObject.HasEffect("ShimmeringShroud"))
                {
                    EndedOnMessage = false;
                    // AddPlayerMessage("Step 8b");
                }
                else if (ElectroHook.Potency == 42 && ParentObject.HasEffect("ShimmeringShroud") && EndedOnMessage == false)
                {
                    //______________________________________________________________________________

                    if (ElectroHook.ShowMutationUpdates == true)
                    {
                        Popup.Show("Electricity damage is now converted into potency. \n\n\n [To deactivate these messages, toggle the Electrokenisis Prompts in the Command menu to OFF.]");
                        EndedOnMessage = true;
                        // AddPlayerMessage("Step 9a");
                    }
                }
                else if (ElectroHook.Potency > 42 && ParentObject.HasEffect("ShimmeringShroud"))
                {
                    EndedOnMessage = false;
                    // AddPlayerMessage("Step 9b");
                }
                else if (ElectroHook.Potency == 42 && ParentObject.HasEffect("ShimmeringShroud") && EndedOnMessage == false)
                {
                    //______________________________________________________________________________



                    if (ElectroHook.ShowMutationUpdates == true)
                    {
                        Popup.Show("You can now direct a shimmering beam of electric energy at your foes in the form of Shimmering Ray at the cost of potency. You can also release a blast of electric energy that emp's nearby equipment. \n\n\n [To deactivate these messages, toggle the Electrokenisis Prompts in the Command menu to OFF.]");
                        EndedOnMessage = true;
                        // AddPlayerMessage("Step 10b");
                    }
                }
                else if (ElectroHook.Potency > 42 && ElectroHook.Potency < 60 && ParentObject.HasEffect("ShimmeringShroud"))
                {
                    EndedOnMessage = false;
                    // AddPlayerMessage("Step 10e");
                }
                else if (ElectroHook.Potency == 60 && ParentObject.HasEffect("ShimmeringShroud") && EndedOnMessage == false)
                {
                    //______________________________________________________________________________

                    if (ElectroHook.ShowMutationUpdates == true)
                    {
                        //blocking things hurt them
                        Popup.Show("You can now call a great lightning strike on your enemies at the cost of Potency. \n\n\n [To deactivate these messages, toggle the Electrokenisis Prompts in the Command menu to OFF.]");
                        EndedOnMessage = true;
                    }
                }
                else if (ElectroHook.Potency > 60 && ParentObject.HasEffect("ShimmeringShroud"))
                {
                    // AddPlayerMessage("Step 11c");
                    EndedOnMessage = false;
                }
            }

            return(base.FireEvent(E));
        }
        public override bool FireEvent(Event E)
        {
            if (E.ID == "CommandManifestLimb")
            {
                ArmCost    = (2 + ArmCounter) + (2 * ArmCounter) - 1;
                NewArmCost = ArmCost;
                if (NewArmCost <= focusPsiCurrentMaximumCharges)
                {
                    UpdateCharges();
                    ArmCounter += 1;
                }
                else if (NewArmCost > focusPsiCurrentMaximumCharges)
                {
                    UpdateCharges();
                    return(true);
                }
            }

            if (E.ID == "CommandDismissLimb")
            {
                if (ArmCounter >= 1)
                {
                    ArmCounter -= 1;
                }
                UpdateCharges();
            }

            if (E.ID == "AIGetPassiveMutationList")
            {
                // AddPlayerMessage("Hey prepare, to eat my combustion blast.");
                // AddPlayerMessage($"Currentcharges: {focusPsiCurrentCharges}");
                // AddPlayerMessage($"MaximumPsi: {maximumPsiCharge()}");
                if (focusPsiCurrentCharges < focusPsiCurrentMaximumCharges / 2 && !HandlingCharging())
                {
                    E.AddAICommand("CommandFocusPsi");
                    // AddPlayerMessage($"Currentcharges: {focusPsiCurrentCharges}");
                    AddPlayerMessage("Something is gathering psionic energy ...");
                }
                else if (focusPsiCurrentCharges >= focusPsiCurrentMaximumCharges - 1 && HandlingCharging())
                {
                    E.AddAICommand("CommandFocusPsi");
                    // AddPlayerMessage($"Currentcharges: {focusPsiCurrentCharges}");
                    AddPlayerMessage("Something is gathering psionic energy ...");
                }
            }

            if (E.ID == "CommandFocusPsi")
            {
                if (!base.IsMyActivatedAbilityToggledOn(this.PsiFocusActivatedAbilityID))
                {
                    base.ToggleMyActivatedAbility(this.PsiFocusActivatedAbilityID);
                    string verb1   = "begin to gather";
                    string extra1  = "psionic energy";
                    string TermiP1 = ".";
                    XDidY(ParentObject, verb1, extra1, TermiP1);
                    isCharging = true;
                }
                else
                {
                    base.ToggleMyActivatedAbility(this.PsiFocusActivatedAbilityID);
                    string verb2     = "stop";
                    string extra2    = "gathering psi energy";
                    string termiPun2 = ".";
                    XDidY(ParentObject, verb2, extra2, termiPun2);
                    isCharging = false;
                    UseEnergy(1000);
                }
                UpdateCharges();
                return(false);
            }

            else if (E.ID == "EndTurn")
            {
                Psybrachiomancy BrachMutation     = ParentObject.GetPart <Psybrachiomancy>();
                var             PsiburdeningCatch = ParentObject.GetEffect <Psiburdening>();
                if (base.IsMyActivatedAbilityToggledOn(this.PsiFocusActivatedAbilityID) && (focusPsiCurrentCharges < focusPsiCurrentMaximumCharges))
                {
                    int chanceforpsi = (ParentObject.StatMod("Willpower") * 3) + PsiCounter;
                    if (Stat.Random(1, 100) < chanceforpsi)
                    {
                        focusPsiCurrentCharges++;
                        DidX("charge", "psi energy", ".", ColorAsGoodFor: ParentObject);
                    }
                    else
                    {
                        PsiCounter++;
                    }
                    turnsTilPsiDecay++;
                }
                else if (ParentObject.HasPart("Psybrachiomancy") && BrachMutation.ArmCounter <= Math.Min(1, ParentObject.StatMod("Willpower")) && ParentObject.HasEffect("Psiburdening"))
                {
                    ParentObject.RemoveEffect(PsiburdeningCatch);
                }

                UpdateCharges();
            }

            else if (E.ID == "PsionicDecay")
            {
                if (!(ParentObject.MakeSave("Willpower", effectiveSaveTarget, null, null, "Psionic Decay")))
                {
                    focusPsiCurrentCharges -= E.GetIntParameter("Amount", (int)0); // Current default value is zero, change default value to something more appropriate later
                }

                UpdateCharges();
            }

            else if (E.ID == "FireEventDebuffSystem")
            {
                Psybrachiomancy BrachMutation = ParentObject.GetPart <Psybrachiomancy>();
                if (BrachMutation.ArmCounter > ParentObject.StatMod("Willpower") + BrachMutation.Level / 2 && !ParentObject.HasEffect("Psiburdening"))
                {
                    ParentObject.ApplyEffect(new Psiburdening((Stat.Random(10, 20) - ParentObject.StatMod("Willpower")) * Stat.Random(50, 125)));
                }
                else if (BrachMutation.ArmCounter < ParentObject.StatMod("Willpower") && ParentObject.HasEffect("Psiburdening"))
                {
                    ParentObject.RemoveEffect("Psiburdening");
                }
            }

            return(base.FireEvent(E));
        }
        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);
        }
예제 #24
0
        public override bool FireEvent(Event E)
        {
            if (E.ID == "AIGetOffensiveMutationList")
            {
                int intParameter = E.GetIntParameter("Distance");
                if (intParameter <= 1 & IsMyActivatedAbilityCoolingDown(ActivatedAbilityID, ParentObject))
                {
                    GameObject gameObjectParameter2 = E.GetGameObjectParameter("Target");
                    if (gameObjectParameter2.PhaseAndFlightMatches(ParentObject))
                    {
                        List <AICommandList> list = E.GetParameter("List") as List <AICommandList>;
                        list.Add(new AICommandList("CommandSoulShunt", 1));
                    }
                }
            }
            if (E.ID == "DamageFromDecay")
            {
                int DegradateLevel = ParentObject.Stat("Level");

                if (!ParentObject.MakeSave("Toughness", (28 + DegradateLevel), null, null, "Husk Deterioration"))
                {
                    // StatShifter.SetStatShift(ParentObject, "Hitpoints", -Stat.Random(0, 3), true);
                    ParentObject.Statistics["Hitpoints"].BaseValue -= Stat.Random(0, 3);
                }
            }
            else if (E.ID == "ApplyingTonic")
            {
                if (E.GetParameter <GameObject>("Tonic").Blueprint == "UbernostrumTonic" && SetCounterUberAptitude <= 0)
                {
                    UbernostrumScaling = (int)Math.Round(Stat.Random(0.10f, 0.30f) * ParentObject.GetStatValue("Hitpoints", 1));

                    StatShifter.SetStatShift(ParentObject, "Hitpoints", UbernostrumScaling, true);
                    SetCounterUberAptitude += 1;
                }
                else if (E.GetParameter <GameObject>("Tonic").Blueprint == "UbernostrumTonic" && SetCounterUberAptitude > 0)
                {
                    UbernostrumScaling  = (int)Math.Round(Stat.Random(0.10f, 0.30f) * ParentObject.GetStatValue("Hitpoints", 1));
                    UbernostrumScaling -= (int)Math.Round(UbernostrumScaling * (SetCounterUberAptitude + 0.10));

                    StatShifter.SetStatShift(ParentObject, "Hitpoints", UbernostrumScaling, true);
                    SetCounterUberAptitude += 1;
                }
            }
            else if (E.ID == "EndTurn")
            {
                if (HuskWeakeningDuration > 0)
                {
                    --HuskWeakeningDuration;
                    if (HuskWeakeningDuration >= HuskWeakeningDuration * 0.7)
                    {
                        ParentObject.FireEvent(Event.New("DebuffsFromDecay"));
                    }
                    else if (HuskWeakeningDuration >= HuskWeakeningDuration * 0.3)
                    {
                        ParentObject.FireEvent(Event.New("DebuffsFromDecay"));
                    }
                    else if (HuskWeakeningDuration >= HuskWeakeningDuration * 0.1)
                    {
                        ParentObject.FireEvent(Event.New("DebuffsFromDecay"));
                    }
                    else if (HuskWeakeningDuration >= HuskWeakeningDuration * 0.05)
                    {
                        ParentObject.FireEvent(Event.New("DebuffsFromDecay"));
                    }
                }
                else if (ParentObject.Statistics["Hitpoints"].BaseValue <= 1)
                {
                    if (ParentObject.IsPlayer())
                    {
                        ParentObject.Die(null, null, "As your husk crumbles to dust, so do your last tethers to world as your form radiates away.", Force: false);
                    }
                }
                if (!ParentObject.HasEffect <Disintegrating>())
                {
                    ParentObject.ApplyEffect(new Disintegrating(9999));
                }
            }
            else if (E.ID == "CommandSoulShunt")
            {
                ActivatedAbilities activatedAbilities = ParentObject.GetPart("ActivatedAbilities") as ActivatedAbilities;
                activatedAbilities.GetAbility(ActivatedAbilityID).Cooldown = 24000;
                SoulShunt();
                var HuskCurrentToughness = ParentObject.Stat("Toughness");
                HuskWeakeningDuration = 1200 * Math.Min(1, HuskCurrentToughness);
            }
            else if (E.ID == "DebuffsFromDecay")
            {
                var OwnersStrength  = ParentObject.Stat("Strength");
                var OwnersToughness = ParentObject.Stat("Toughness");
                var OwnersAgility   = ParentObject.Stat("Agility");

                if (HuskWeakeningDuration >= HuskWeakeningDuration * 0.6)
                {
                }
                else if (HuskWeakeningDuration >= HuskWeakeningDuration * 0.5)
                {
                    StatShifter.SetStatShift(ParentObject, "Strength", -((int)Math.Round(OwnersStrength * 0.2)), false);
                    StatShifter.SetStatShift(ParentObject, "Toughness", -((int)Math.Round(OwnersToughness * 0.2)), false);
                    StatShifter.SetStatShift(ParentObject, "Agility", -((int)Math.Round(OwnersAgility * 0.2)), false);
                }
                else if (HuskWeakeningDuration >= HuskWeakeningDuration * 0.3)
                {
                    StatShifter.SetStatShift(ParentObject, "Strength", -((int)Math.Round(OwnersStrength * 0.4)), false);
                    StatShifter.SetStatShift(ParentObject, "Toughness", -((int)Math.Round(OwnersToughness * 0.4)), false);
                    StatShifter.SetStatShift(ParentObject, "Agility", -((int)Math.Round(OwnersAgility * 0.4)), false);
                }
                else if (HuskWeakeningDuration >= HuskWeakeningDuration * 0.1)
                {
                    StatShifter.SetStatShift(ParentObject, "Strength", -((int)Math.Round(OwnersStrength * 0.6)), false);
                    StatShifter.SetStatShift(ParentObject, "Toughness", -((int)Math.Round(OwnersToughness * 0.6)), false);
                    StatShifter.SetStatShift(ParentObject, "Agility", -((int)Math.Round(OwnersAgility * 0.6)), false);
                }
                else if (HuskWeakeningDuration >= HuskWeakeningDuration * 0.05)
                {
                    StatShifter.SetStatShift(ParentObject, "Strength", -((int)Math.Round(OwnersStrength * 0.8)), false);
                    StatShifter.SetStatShift(ParentObject, "Toughness", -((int)Math.Round(OwnersToughness * 0.8)), false);
                    StatShifter.SetStatShift(ParentObject, "Agility", -((int)Math.Round(OwnersAgility * 0.8)), false);
                }
                else if (HuskWeakeningDuration <= 0)
                {
                    HuskWeakeningDuration = (int)Math.Round(HuskWeakeningDuration * 0.7);
                }
            }
            else if (E.ID == "SuccessfulDethroning")
            {
                GameObject OriginalBody = E.GetGameObjectParameter("OriginalBody");

                var SkillAccess  = OriginalBody.GetPart <Skills>();
                var SkillListing = SkillAccess.SkillList;

                var CreatureTier          = OriginalBody.GetTier();
                var PrimaryFaction        = OriginalBody.GetPrimaryFaction();
                var FactionVar            = Factions.get(PrimaryFaction);
                var NewBodyPrimaryFaction = OriginalBody.GetPrimaryFaction();

                var ParentIntelligenceSkillAward = (ParentObject.BaseStat("Intelligence") - 10) * 4;

                ParentObject.FireEvent(Event.New("EntityHasSwappedBodies"));

                if (!ParentObject.HasSkill("Survival"))
                {
                    ParentObject.AddSkill("Survival");
                    if (!ParentObject.HasSkill("Survival_Camp"))
                    {
                        ParentObject.AddSkill("Survival_Camp");
                    }
                }

                foreach (var k in SkillListing)
                {
                    ParentObject.GetStat("SP").BaseValue += ParentIntelligenceSkillAward;
                }
                if (FactionVar.Visible)
                {
                    try
                    {
                        XRL.Core.XRLCore.Core.Game.PlayerReputation.modify(PrimaryFaction, -CreatureTier * 50, true);
                    }
                    catch
                    {
                        return(true);
                    }
                }

                if (OriginalBody != null)
                {
                    // AddPlayerMessage("Original Body: " + OriginalBody + ".");
                    // AddPlayerMessage("Parent Body: " + ParentObject + ".");

                    if (!ParentObject.HasProperName)
                    {
                        ParentObject.DisplayName = OriginalBody.DisplayNameOnly;
                        OriginalBody.DisplayName = Names.NameMaker.MakeName(ParentObject);
                    }
                    else
                    {
                        var NewName = ParentObject.DisplayNameOnly;
                        ParentObject.DisplayName = OriginalBody.DisplayNameOnly;
                        OriginalBody.DisplayName = NewName;
                    }
                    OriginalBody.GetAngryAt(ParentObject, -100);

                    PlayWorldSound("soulshunt");

                    var DifferenceVar = ParentObject.StatMod("Ego") - OriginalBody.StatMod("Ego");
                    DifferenceVar *= 5;

                    if (Stat.Random(1, 100) <= DifferenceVar && IsPlayer())
                    {
                        if (Popup.ShowYesNo("You feel the remnants of tender light pulsating within your new husk, would you like to imprint these codings upon your own animus?", false, DialogResult.Yes) == DialogResult.Yes)
                        {
                            StatShifter.SetStatShift(ParentObject, "Ego", 1, true);
                        }
                        else
                        {
                            Popup.Show("You cast the remnants away.");
                        }
                    }
                }
            }

            return(base.FireEvent(E));
        }
        //
        //
        //
        //
        //


        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);
            }
        }
예제 #26
0
        public override bool HandleEvent(AttackerDealingDamageEvent E)
        {
            try
            {
                var Attacker    = E.Object;
                var Defender    = E.Actor;
                var ElectroHook = ParentObject.GetPart <Electrokinesis>();

                var WeaponMeleeHook = E.Weapon.GetPart <MeleeWeapon>();
                var ProjectileHook  = E.Projectile.GetPart <Projectile>();
                var DefenderArmor   = Defender.Equipped.GetEquippedObjects();

                var PotencyMod = 1 + ElectroHook.Potency;

                if (ElectroHook.Potency >= 12 && ParentObject.HasEffect("ShimmeringShroud"))
                {
                    if (Defender == ParentObject && E.Weapon.HasPart("Metal") && !E.Weapon.HasPart("NaturalEquipment"))
                    {
                        Attacker.TakeDamage((PotencyMod), Attacker.Is + "takes damage from " + Defender.its + " shimmering shroud!", "Electricity", DeathReason: null, ThirdPersonDeathReason: null, Defender);
                    }
                    else if (Defender == ParentObject && E.Weapon.HasPart("Metal") || E.Weapon.HasPart("NaturalEquipment"))
                    {
                        foreach (var wornObj in DefenderArmor)
                        {
                            if (wornObj.IsEquippedOnLimbType("Body") && wornObj.HasPart("Metal"))
                            {
                                Attacker.TakeDamage((PotencyMod), Attacker.Is + "takes damage from " + Defender.its + " shimmering shroud!", "Electricity", DeathReason: null, ThirdPersonDeathReason: null, Defender);
                            }
                            else
                            {
                            }
                        }
                    }
                }

                if (ElectroHook.Potency >= 28 && ParentObject.HasEffect("ShimmeringShroud"))
                {
                    if (Defender == ParentObject &&
                        Attacker.HasPart("Combat") ||
                        Attacker.HasPart("Robot") ||
                        Attacker.HasTag("Robot"))
                    {
                        if (!Attacker.MakeSave("Toughness", 8 + ElectroHook.Potency, Defender, null, null))
                        {
                            Attacker.TakeDamage((PotencyMod), Attacker.Is + "takes damage from " + Defender.its + " shimmering shroud!", "Electricity", DeathReason: null, ThirdPersonDeathReason: null, Defender);
                            Attacker.ApplyEffect(new Stun(PotencyMod, PotencyMod));
                        }
                    }
                }
                else if (ElectroHook.Potency >= 38 && ParentObject.HasEffect("ShimmeringShroud"))
                {
                    if (Defender == ParentObject && E.Damage.IsElectricDamage())
                    {
                        var DamageConversion = E.Damage.Amount;
                        ElectroHook.Potency += DamageConversion / 2;
                        E.Damage.Amount     /= 2;
                    }
                }
                else if (ElectroHook.Potency >= 42 && ParentObject.HasEffect("ShimmeringShroud"))
                {
                    if (Defender == ParentObject &&
                        E.Weapon.HasPart("DischargeOnHit") ||
                        WeaponMeleeHook.Element == "Electric" ||
                        ProjectileHook.Attributes == "Electric")
                    {
                        ElectroHook.Potency += E.Damage.Amount / 3;
                    }
                }

                if (Defender == ParentObject &&
                    E.Damage.HasAttribute("Light Laser") ||
                    E.Projectile.HasTagOrStringProperty("EnergyAmmoLoader", "ProjectileLaserRifle") ||
                    E.Projectile.HasTagOrStringProperty("EnergyAmmoLoader", "ProjectileEigenrifle") ||
                    E.Projectile.HasTagOrStringProperty("EnergyAmmoLoader", "ProjectileLaserPistol") ||
                    E.Projectile.HasTagOrStringProperty("EnergyAmmoLoader", "ProjectileOverloadedLaserPistol") ||
                    E.Projectile.HasTagOrStringProperty("EnergyAmmoLoader", "ProjectileElectrobow"))
                {
                    if (ElectroHook.Potency >= 18 && ParentObject.HasEffect("ShimmeringShroud"))
                    {
                        E.Damage.Amount /= 2;
                    }
                    else if (ElectroHook.Potency >= 28 && ParentObject.HasEffect("ShimmeringShroud"))
                    {
                        E.Damage.Amount = 0;
                    }
                    else if (ElectroHook.Potency >= 38 && ParentObject.HasEffect("ShimmeringShroud"))
                    {
                        var DamageConversion = E.Damage.Amount;
                        ElectroHook.Potency += DamageConversion / 2;
                        E.Damage.Amount      = 0;
                    }
                    else if (ElectroHook.Potency >= 42 && ParentObject.HasEffect("ShimmeringShroud"))
                    {
                        if (E.Damage.IsElectricDamage())
                        {
                            var DamageConversion = E.Damage.Amount;
                            ElectroHook.Potency += DamageConversion;
                            E.Damage.Amount      = 0;
                        }
                    }
                }
            }
            catch { }

            return(base.HandleEvent(E));
        }
예제 #27
0
 public override bool HandleEvent(ObjectEnteringCellEvent E)
 {
     if (E.Object == ParentObject && E.Object.IsPlayer() && E.Cell.HasObject(X => WaterThatHurts.Contains(X.Blueprint)) && !ParentObject.HasEffect("Dissolving"))
     {
         if (Popup.ShowYesNo("This liquid is harmful to you, continue") != 0)
         {
             return(base.HandleEvent(E));
         }
         AutoAct.Interrupt();
         AddPlayerMessage("This liquid is harmful to you.");
     }
     return(base.HandleEvent(E));
 }
        public override bool FireEvent(Event E)
        {
            if (E.ID == "DismissStanceCommand")
            {
                StanceReplacement();
                NoviceStancer();
            }
            else if (E.ID == "DawngliderStanceCommand")
            {
                StanceReplacement();
                ParentObject.ApplyEffect(new DawnStance(Effect.DURATION_INDEFINITE));
                NoviceStancer();
            }
            else if (E.ID == "AstralTabbyStanceCommand")
            {
                StanceReplacement();
                ParentObject.ApplyEffect(new AstralTabbyStance(Effect.DURATION_INDEFINITE));
                NoviceStancer();
            }
            else if (E.ID == "SaltBackStanceCommand")
            {
                StanceReplacement();
                ParentObject.ApplyEffect(new SaltbackStance(Effect.DURATION_INDEFINITE));
                NoviceStancer();
            }
            else if (E.ID == "SlumberlingStanceCommand")
            {
                StanceReplacement();
                ParentObject.ApplyEffect(new SlumberStance(Effect.DURATION_INDEFINITE));
                NoviceStancer();
            }
            else if (E.ID == "SaltHopperStanceCommand")
            {
                StanceReplacement();
                ParentObject.ApplyEffect(new SaltHopperStance(Effect.DURATION_INDEFINITE));
                NoviceStancer();
            }
            else if (E.ID == "DeathDaccaStanceCommand")
            {
                StanceReplacement();
                ParentObject.ApplyEffect(new DaccaStance(Effect.DURATION_INDEFINITE));
                NoviceStancer();
            }
            else if (E.ID == "AIGetOffensiveMutationList")
            {
                WM_MMA_MartialStances GetStances = ParentObject.GetPart <WM_MMA_MartialStances>();

                if (IsMyActivatedAbilityToggledOn(AstralTabbyStanceID, ParentObject) == false && !ParentObject.HasEffect("AstralTabbyStance") && InStance == false)
                {
                    E.AddAICommand("AstralTabbyStanceCommand");
                    InStance = true;
                }
                else if (IsMyActivatedAbilityToggledOn(DawnStanceID, ParentObject) == false && !ParentObject.HasEffect("DawnStance") && InStance == false)
                {
                    E.AddAICommand("DawngliderStanceCommand");
                    InStance = true;
                }
                else if (IsMyActivatedAbilityToggledOn(SlumberStanceID, ParentObject) == false && !ParentObject.HasEffect("SlumberStance") && InStance == false)
                {
                    E.AddAICommand("SlumberlingStanceCommand");
                    InStance = true;
                }
                else if (IsMyActivatedAbilityToggledOn(SaltHopperStanceID, ParentObject) == false && !ParentObject.HasEffect("SaltHopperStance") && InStance == false)
                {
                    E.AddAICommand("SaltHopperStanceCommand");
                    InStance = true;
                }
                else if (IsMyActivatedAbilityToggledOn(SaltBackStanceID, ParentObject) == false && !ParentObject.HasEffect("SaltbackStance") && InStance == false)
                {
                    E.AddAICommand("SaltBackStanceCommand");
                    InStance = true;
                }
                else if (IsMyActivatedAbilityToggledOn(DeathDaccaStanceID, ParentObject) == false && !ParentObject.HasEffect("SaltbackStance") && InStance == false)
                {
                    E.AddAICommand("DeathDaccaStanceCommand");
                    InStance = true;
                }
            }

            return(base.FireEvent(E));
        }
예제 #29
0
        public override bool FireEvent(Event E)
        {
            if (E.ID == "CommandShimmeringShroud")
            {
                if (!ParentObject.HasEffect("ShimmeringShroud"))
                {
                    ApplyElectricShroud();
                    if (ToggleMyActivatedAbility(ChargePotentialAbilityID) == true && Potency > 30)
                    {
                        ParentObject.ParticlePulse(ElectroColors() + "\u0000");
                    }
                    ;
                }
                else
                {
                    RemoveElectricShroud();
                }
            }
            else if (E.ID == "CommandChargePotencyShroud")
            {
                ToggleMyActivatedAbility(ChargePotentialAbilityID);
            }
            else if (E.ID == "TogglingChargeVisionEvent")
            {
                ToggleMyActivatedAbility(ToggleChargeSenseAbility);
            }
            else if (E.ID == "ThunderingStrikeEvent")
            {
                CallLightningAnimation();
            }
            else if (E.ID == "ChargeBatteryEvent")
            {
                StartElectroRechargeList();
            }
            else if (E.ID == "BeginTakeAction")
            {
                if (IsMyActivatedAbilityToggledOn(ChargePotentialAbilityID, ParentObject))
                {
                    var ParentsCharges = ParentObject.Statistics["PsiCharges"].BaseValue;

                    if (Potency < ParentsCharges * 2)
                    {
                        ++Potency;
                        PotencyChargeEffectPulse(Potency);
                    }
                }
                if (IsMyActivatedAbilityToggledOn(ToggleChargeSenseAbility, ParentObject))
                {
                    ChargeVisionAbility();
                }
                if (!ParentObject.MakeSave("Ego", 10 + (Potency / 2), null, null))
                {
                    if (Potency > 0)
                    {
                        --Potency;
                    }
                }

                AddPlayerMessage("ShowingAttribute - Potency Current Amount: " + Potency);
            }
            else if (E.ID == "ShimmeringRayEvent")
            {
                if (!Cast(this))
                {
                    return(false);
                }
            }

            return(base.FireEvent(E));
        }
        public override bool FireEvent(Event E)
        {
            // AddPlayerMessage("Wine Inventory Action Event");
            if (E.ID == "DrinkingFrom" && (E.GetParameter("Container") as GameObject).LiquidVolume.ContainsLiquid("wine") && !ParentObject.HasEffect("Drunken"))
            {
                // AddPlayerMessage("Drunken");
                ParentObject.ApplyEffect(new Drunken(25 + (10 * ParentObject.Statistics["Level"].BaseValue / 5)));
            }

            return(base.FireEvent(E));
        }