Exemple #1
0
        public bool HasPermutation(GameObject ParentObject)
        {
            Mutations HasSynergyMutation = ParentObject.GetPart <Mutations>();

            if (HasSynergyMutation.HasMutation("Quills") == true || HasSynergyMutation.HasMutation("GelatinousFormPoison") == true)
            {
                return(true);
            }
            else
            {
                return(false);
            }
        }
Exemple #2
0
 public override bool FireEvent(Event E)
 {
     if (E.ID == "EndTurnEngulfing")
     {
         if (descriptionSet == false)
         {
             IPart.ThePlayer.GetPart <Description>().Short = "I'm not a bad slime";
             descriptionSet = true;
         }
         GameObject parameter = E.GetParameter <GameObject>("Object");
         if (parameter != null)
         {
             Damage damage = new Damage(Stat.Random(IPart.ThePlayer.Statistics["Toughness"].BaseValue / 2, IPart.ThePlayer.Statistics["Toughness"].BaseValue));
             Event  E1     = Event.New("TakeDamage", 0, 0, 0);
             E1.AddParameter("Damage", (object)damage);
             E1.AddParameter("Owner", (object)this.ParentObject);
             E1.AddParameter("Attacker", (object)this.ParentObject);
             E1.AddParameter("Message", this.DamageMessage);
             parameter.FireEvent(E1);
             if (parameter.hitpoints <= 0)
             {
                 if (DifficultyEvaluation.GetDifficultyDescription(parameter) == "&wAverage")
                 {
                     this.statGains(1);
                 }
                 else if (DifficultyEvaluation.GetDifficultyDescription(parameter) == "&WTough")
                 {
                     this.statGains(2);
                 }
                 else if (DifficultyEvaluation.GetDifficultyDescription(parameter) == "&rVery Tough")
                 {
                     this.statGains(4);
                 }
                 else if (DifficultyEvaluation.GetDifficultyDescription(parameter) == "&RImpossible")
                 {
                     this.statGains(8);
                 }
                 Mutations targetMutations = parameter.GetPart <Mutations>();
                 Mutations playerMutations = IPart.ThePlayer.GetPart <Mutations>();
                 if (targetMutations != null)
                 {
                     foreach (BaseMutation mutation in targetMutations.MutationList)
                     {
                         if (!playerMutations.HasMutation(mutation) && !excludedMutations.Contains(mutation.Name) && mutation.CompatibleWith(IPart.ThePlayer))
                         {
                             playerMutations.AddMutation(mutation, 1);
                         }
                     }
                 }
                 Stomach part = IPart.ThePlayer.GetPart <Stomach>();
                 IPart.ThePlayer.RemoveEffect("Famished", false);
                 part.HungerLevel    = 0;
                 part.CookCount      = 0;
                 part.CookingCounter = 0;
                 part.Water          = 30000;
             }
         }
     }
     return(true);
 }
        public void UpdateTailParts()
        {
            GameObject Tail         = ParentObject;
            GameObject Owner        = Tail.Equipped;
            Mutations  PMu          = Owner.GetPart <Mutations>();
            ThickTail  TailMutation = base.ParentObject.Equipped.GetPart <Mutations>().GetMutation("ThickTail") as ThickTail;
            int        ChimeraBoost = ((Owner.StatMod("Strength") + Owner.StatMod("Toughness") + Owner.StatMod("Agility")) / 3);

            if (Owner == null)
            {
                return;
            }
            if (PMu.HasMutation("Chimera"))
            {
                SynergyConstruct Construct;
                bool             SynergizedChi = SynergyEffects.TryGetValue("Chimera", out Construct);
                if (SynergizedChi && Construct.IsActive == false)
                {
                    Construct.Effect.Invoke(ParentObject);
                    Construct.IsActive = true;
                }
            }
            foreach (BaseMutation Mut in PMu.MutationList)
            {
                SynergyConstruct Construct;
                bool             Synergized = SynergyEffects.TryGetValue(Mut.Name, out Construct);
                if (Synergized && Construct.IsActive == false)
                {
                    Construct.Effect.Invoke(ParentObject);
                    Construct.IsActive = true;
                }
            }
        }
        public override bool HandleEvent(GetDisplayNameEvent E)
        {
            try
            {
                if (!NeedsSynergyPrefix)
                {
                    return(true);
                }

                GameObject Tail  = ParentObject;
                GameObject Owner = Tail.Equipped;
                Mutations  HasSynergyMutation = Owner.GetPart <Mutations>();
                int        Synergies          = SynergyMutations.Count(HasSynergyMutation.HasMutation);
                if (Synergies >= 3)
                {
                    return(true);
                }
                foreach (var kv in SynergyEffects)
                {
                    if (HasSynergyMutation.HasMutation(kv.Key))
                    {
                        E.AddBase(kv.Value.Prefix, DescriptionBuilder.ORDER_ADJUST_EARLY);
                    }
                }
            }
            catch
            {
            }
            return(base.HandleEvent(E));
        }
Exemple #5
0
        public void ProcessTurnConstricted(GameObject Target, int TurnsConstricted)
        {
            Mutations HasSynergyMutation = ParentObject.GetPart <Mutations>();
            int       Synergies          = SynergyMutations.Count(HasSynergyMutation.HasMutation);

            if (ResistanceSave(Target))
            {
                EndConstriction(Target);
                XDidY(Target, "escape", "constriction", ".");
            }
            else if (HasPermutation(ParentObject) && HasSynergyMutation.HasMutation("Quills") == true)
            {
                AddPlayerMessage("Your barbs gouge into your foe, dealing extra damage!");
                Target.TakeDamage(PermutationDamageQuills(), Message: "from %t coils", Attributes: null, DeathReason: "Crushed to death by muscled coiling.", Owner: ParentObject, Attacker: ParentObject);
                PerformDamage(Target);
            }

            else if (HasPermutation(ParentObject) == true && HasSynergyMutation.HasMutation("GelatinousFormPoison") == true)
            {
                AddPlayerMessage("You strangle your enemy with miasmic poisons, dealing extra damage!");
                Target.TakeDamage(PermutationDamagGFP(), Message: "from %t coils", Attributes: null, DeathReason: "Crushed to death by muscled coiling.", Owner: ParentObject, Attacker: ParentObject);
                PerformDamage(Target);
            }
            else if (HasPermutation(ParentObject) == true && HasSynergyMutation.HasMutation("GelatinousFormAcid") == true)
            {
                AddPlayerMessage("You strangle your enemy with your acidic form dealing extra damage!");
                Target.TakeDamage(PermutationDamagGFA(), Message: "from %t coils", Attributes: null, DeathReason: "Crushed to death by muscled coiling.", Owner: ParentObject, Attacker: ParentObject);
                PerformDamage(Target);
            }
            else if (Synergies >= 1)
            {
                var MessageRandomizer = Rules.Stat.Random(1, 100);
                if (MessageRandomizer <= 33)
                {
                    AddPlayerMessage("Your barbs gouge into your foe, dealing extra damage!");
                }
                Target.TakeDamage(PermutationDamagGFA(), Message: "from %t coils", Attributes: null, DeathReason: "Crushed to death by muscled coiling.", Owner: ParentObject, Attacker: ParentObject);
                PerformDamage(Target);
            }
        }
        public override bool HandleEvent(GetSwimmingPerformanceEvent E)
        {
            GameObject Tail         = ParentObject;
            GameObject Owner        = Tail.Equipped;
            Mutations  PMu          = Owner.GetPart <Mutations>();
            ThickTail  TailMutation = base.ParentObject.Equipped.GetPart <Mutations>().GetMutation("ThickTail") as ThickTail;
            var        data         = TailMutation.GetData(TailMutation.Level);

            if (PMu.HasMutation("Amphibious"))
            {
                E.MoveSpeedPenalty -= data.SwimSpeed;
            }
            return(base.HandleEvent(E));
        }
        public override bool Mutate(GameObject GO, int Level)
        {
            this.Unmutate(GO);
            Mutations GainPSiFocus = GO.GetPart <Mutations>();

            if (!GainPSiFocus.HasMutation("FocusPsi"))
            {
                GainPSiFocus.AddMutation("FocusPsi", 1);
                //AddPlayerMessage("Has Focus Psi.");
            }
            this.ActivateThermokinesisAbilityID = base.AddMyActivatedAbility("Alter Temperatures", "CommandAlterTemperatures", "Mental Mutation", null, "*", null, false, false, false, false, false);
            this.ChangeLevel(Level);
            return(base.Mutate(GO, Level));
        }
        // public void FocusPsiDeficiency()
        // {
        //     if ((maximumPsiCharge() < 0) && !ParentObject.HasEffect("Psiburdening"))
        //     {
        //         ParentObject.ApplyEffect(new Psiburdening(9999));
        //     }
        //     else if ((maximumPsiCharge() > 0) && ParentObject.HasEffect("Psiburdening"))
        //     {
        //         ParentObject.RemoveEffect("Psiburdening");
        //     }
        // }

        // maximum psi an entity can hold
        public int maximumPsiCharge(int Modifier1 = 0)
        {
            try
            {
                Mutations       GetMutations  = ParentObject.GetPart <Mutations>();
                Psybrachiomancy BrachMutation = ParentObject.GetPart <Psybrachiomancy>();
                ArmCost    = (2 + BrachMutation.ArmCounter) + (2 * BrachMutation.ArmCounter) - 1;
                NewArmCost = ArmCost;
                int differenceSum = NewArmCost;
                if (GetMutations.HasMutation("Psybrachiomancy") && ArmCounter >= 1)
                {
                    Dictionary <string, Statistic> Stats = ParentObject.Statistics;
                    float Result = 1 + Stats["Ego"].Modifier;
                    Result += Stats["Toughness"].Modifier / 2f;
                    Result += (Stats["Level"].Value * 0.1f) * Stats["Ego"].Modifier;
                    if (Result < 0f)
                    {
                        return(0);
                    }
                    return((int)Math.Round(Result) - (differenceSum));
                }
                else
                {
                    Dictionary <string, Statistic> Stats = ParentObject.Statistics;
                    float Result = 1 + Stats["Ego"].Modifier;
                    Result += Stats["Toughness"].Modifier / 2f;
                    Result += (Stats["Level"].Value * 0.1f) * Stats["Ego"].Modifier;
                    if (Result < 0f)
                    {
                        return(0);
                    }
                    return((int)Math.Round(Result));
                }
            }
            catch
            {
                Dictionary <string, Statistic> Stats = ParentObject.Statistics;
                float Result = 1 + Stats["Ego"].Modifier;
                Result += Stats["Toughness"].Modifier / 2f;
                Result += (Stats["Level"].Value * 0.1f) * Stats["Ego"].Modifier;
                if (Result < 0f)
                {
                    return(0);
                }
                return((int)Math.Round(Result));
            }
        }
        public override bool Mutate(GameObject GO, int Level)
        {
            // string PsychomateriartisinfoSource = "{ \"Psychomateriartis\": [\"*cult*, mind-smiths\", \"Forgemasters *cult*\"] }";
            // SimpleJSON.JSONNode PsychomateriartisInfo = SimpleJSON.JSON.Parse(PsychomateriartisinfoSource);

            // WMExtendedMutations.History.AddToHistorySpice("spice.extradimensional", PsychomateriartisInfo["Psychomateriartis"]);

            Mutations GainPSiFocus = GO.GetPart <Mutations>();

            if (!GainPSiFocus.HasMutation("FocusPsi"))
            {
                GainPSiFocus.AddMutation("FocusPsi", 1);
            }

            this.ManifestPsiWeaponActivatedAbilityID = base.AddMyActivatedAbility("Psi-Forge", "ManifestWeaponCommand", "Mental Mutation", "Manifest or dismiss a psionic weapon.\n\n");
            this.ReturnPsiWeaponActivatedAbilityID   = base.AddMyActivatedAbility("Return Psi-Weapon", "ReturnWeaponCommand", "Mental Mutation", "Rematerialize your last previously crafted psi-arm to your hand so long as you are in the same parasang, this is a turnless action.", "\u03A9");

            return(base.Mutate(GO, Level));
        }
Exemple #10
0
        public override bool Mutate(GameObject GO, int Level)
        {
            // string PsybrachiomancyinfoSource = "{ \"Psybrachiomancy\": [\"*cult*, the Asuran\", \"Many-Armed *cult*\"] }";
            // SimpleJSON.JSONNode PsybrachiomancyInfo = SimpleJSON.JSON.Parse(PsybrachiomancyinfoSource);

            // WMExtendedMutations.History.AddToHistorySpice("spice.extradimensional", PsybrachiomancyInfo["Psybrachiomancy"]);

            Mutations GainPSiFocus = GO.GetPart <Mutations>();

            if (!GainPSiFocus.HasMutation("FocusPsi"))
            {
                GainPSiFocus.AddMutation("FocusPsi", 1);
            }
            this.ActivatedAbilityID = base.AddMyActivatedAbility("Manifest Limb", "CommandManifestLimb", "Mental Mutation", "Manifest a psychic arm.\n\n Instead of using strength for penetration, a weapon’s penetration when wielded with a psionic arm is limited to your Ego modifier and the weapons’ penetration value.\n\n"
                                                                 + "(Dismembered psionic arms may not dissapate and may require re-weaving to repair, no damage is taken from blows that sever psionic limbs.)\n"
                                                                 + "If the set of arms you summon are more than your Willpower Modifier, you will be given the 'psi-exhaustion' effect temporarily.", ">", null, false, false, false, false, false, false, false, 10, null);
            this.ActivatedAbilityID = base.AddMyActivatedAbility("Dismiss Limb", "CommandDismissLimb", "Mental Mutation", "Dismiss a psychic arm.\n\n", "<", null, false, false, false, false, false, false, false, 10, null);
            this.ChangeLevel(Level);
            return(base.Mutate(GO, Level));
        }
Exemple #11
0
        public override bool Mutate(GameObject GO, int Level)
        {
            Mutations GainPSiFocus = GO.GetPart <Mutations>();

            if (!GainPSiFocus.HasMutation("FocusPsi"))
            {
                GainPSiFocus.AddMutation("FocusPsi", 1);
            }
            if (!ParentObject.HasPart("ShimmeringShroudHandler"))
            {
                ParentObject.AddPart <ShimmeringShroudHandler>();
            }
            ActivateShimmeringShroudAbilityID = base.AddMyActivatedAbility("Activate Shroud", "CommandShimmeringShroud", "Mental Mutation", null, "*", null, false, false, false, false, false);
            ChargePotentialAbilityID          = base.AddMyActivatedAbility("Charge Potential", "CommandChargePotencyShroud", "Mental Mutation", null, "*", null, true, false, true, false, false);
            PotencyForChargesAbility          = base.AddMyActivatedAbility("Recharge Battery", "ChargeBatteryEvent", "Electrokinesis", null, "~", null, false, false, true, false, false);
            ElectrokinesisGauge = base.AddMyActivatedAbility("Electrokinesis", "ElectroToggleEvent", "Mutation");

            this.ChangeLevel(Level);
            return(base.Mutate(GO, Level));
        }
        public override bool Mutate(GameObject GO, int Level)
        {
            // string CombustionBlastinfoSource = "{ \"CombustionBlast\": [\"*cult*, the Fire-Eyed\", \"mind-blast *cult*\"] }";
            // SimpleJSON.JSONNode CombustionInfo = SimpleJSON.JSON.Parse(CombustionBlastinfoSource);

            // WMExtendedMutations.History.AddToHistorySpice("spice.extradimensional", CombustionInfo["CombustionBlast"]);

            this.Unmutate(GO);
            Mutations GainPSiFocus = GO.GetPart <Mutations>();

            if (!GainPSiFocus.HasMutation("FocusPsi"))
            {
                GainPSiFocus.AddMutation("FocusPsi", 1);
                //AddPlayerMessage("Has Focus Psi.");
            }
            this.CombustionBlastActivatedAbilityID       = base.AddMyActivatedAbility("fire volley", "CommandCombustionBlast", "Mental Mutation", null, "*", null, false, false, false, false, false);
            this.CombustionBlastVolleyActivatedAbilityID = base.AddMyActivatedAbility("quick fire", "CommandQuickFire", "Mental Mutation", null, "*", null, false, false, false, false, false);
            this.ChangeLevel(Level);
            return(base.Mutate(GO, Level));
        }
Exemple #13
0
 public void EvolveSludge()
 {
     if (this.newLiquid != (byte)99)
     {
         Mutations part1 = this.ParentObject.GetPart("Mutations") as Mutations;
         if (!part1.HasMutation("LiquidSpitter"))
         {
             part1.AddMutation((BaseMutation) new LiquidSpitter(LiquidVolume.ComponentLiquidTypes[this.newLiquid].GetName((LiquidVolume)null).Substring(2)), 1);
         }
         LiquidSpitter mutation = part1.GetMutation("LiquidSpitter") as LiquidSpitter;
         mutation.extraLiquids.Add(this.newLiquid);
         if (mutation.extraLiquids.Count == 1 && this.newLiquid == (byte)18)
         {
             mutation.extraLiquids.Add((byte)0);
         }
         this.ComponentLiquids.Add(this.newLiquid);
         string displayName = this.ParentObject.DisplayName;
         this.ParentObject.DisplayName = string.Empty;
         foreach (byte componentLiquid in this.ComponentLiquids)
         {
             GameObject parentObject = this.ParentObject;
             parentObject.DisplayName = parentObject.DisplayName + LiquidVolume.ComponentLiquidTypes[componentLiquid].GetAdjective((LiquidVolume)null) + "&y ";
         }
         GameObject parentObject1 = this.ParentObject;
         parentObject1.DisplayName = parentObject1.DisplayName + Evolution.GetPrefix(this.ComponentLiquids.Count) + "sludge";
         if (this.ComponentLiquids.Count >= 5)
         {
             JournalAPI.AddAccomplishment("You witnessed the rare formation of " + Grammar.A(Evolution.GetPrefix(this.ComponentLiquids.Count) + "sludge", false) + ".", "general", (string)null, -1L);
         }
         MessageQueue.AddPlayerMessage("The " + LiquidVolume.ComponentLiquidTypes[this.newLiquid].GetName((LiquidVolume)null) + " &ycatalyzes " + this.ParentObject.the + displayName + " into " + this.ParentObject.a + this.ParentObject.DisplayName + ".");
         bool flag  = false;
         Body part2 = this.ParentObject.GetPart <Body>();
         foreach (BodyPart bodyPart in part2.GetPart("Hand"))
         {
             if (bodyPart.Equipped == null)
             {
                 flag = true;
                 break;
             }
         }
         if (!flag)
         {
             this.totalHands += 2;
             BodyPart body        = part2.GetBody();
             BodyPart InsertAfter = body.AddPartAt("Pseudopod", 0, (string)null, (string)null, (string)null, (string)null, new int?(), new int?(), new int?(), new bool?(), new bool?(), new bool?(), new bool?(), new bool?(), "Hand", "Missile Weapon");
             body.AddPartAt(InsertAfter, "Pseudopod", 0, (string)null, (string)null, (string)null, (string)null, new int?(), new int?(), new int?(), new bool?(), new bool?(), new bool?(), new bool?(), new bool?());
         }
         if (this.newLiquid == (byte)0)
         {
             this.ParentObject.TakeObject("Watery Pseudopod", false, new int?(0));
         }
         else if (this.newLiquid == (byte)1)
         {
             this.ParentObject.TakeObject("Salty Pseudopod", false, new int?(0));
         }
         else if (this.newLiquid == (byte)2)
         {
             this.ParentObject.TakeObject("Tarry Pseudopod", false, new int?(0));
         }
         else if (this.newLiquid == (byte)3)
         {
             this.ParentObject.TakeObject("Magmatic Pseudopod", false, new int?(0));
             this.ParentObject.Statistics["HeatResistance"].BaseValue += 100;
             this.ParentObject.pPhysics.Temperature = 1000;
         }
         else if (this.newLiquid == (byte)4)
         {
             this.ParentObject.TakeObject("Slimy Pseudopod", false, new int?(0));
             this.ParentObject.AddPart <DisarmOnHit>(new DisarmOnHit(100), true);
         }
         else if (this.newLiquid == (byte)5)
         {
             this.ParentObject.TakeObject("Oily Pseudopod", false, new int?(0));
             this.ParentObject.AddPart <DisarmOnHit>(new DisarmOnHit(100), true);
         }
         else if (this.newLiquid == (byte)6)
         {
             this.ParentObject.TakeObject("Bloody Pseudopod", false, new int?(0));
             this.ParentObject.AddPart <LifeDrainOnHit>(new LifeDrainOnHit("15-20", 100), true);
         }
         else if (this.newLiquid == (byte)7)
         {
             this.ParentObject.TakeObject("Acidic Pseudopod", false, new int?(0));
             this.ParentObject.Statistics["AcidResistance"].BaseValue += 100;
         }
         else if (this.newLiquid == (byte)8)
         {
             this.ParentObject.TakeObject("Honeyed Pseudopod", false, new int?(0));
         }
         else if (this.newLiquid == (byte)9)
         {
             this.ParentObject.TakeObject("Lush Pseudopod", false, new int?(0));
         }
         else if (this.newLiquid == (byte)10)
         {
             this.ParentObject.TakeObject("Sludgy Pseudopod2", false, new int?(0));
         }
         else if (this.newLiquid == (byte)11)
         {
             this.ParentObject.TakeObject("Gooey Pseudopod2", false, new int?(0));
         }
         else if (this.newLiquid == (byte)12)
         {
             this.ParentObject.TakeObject("Putrid Pseudopod", false, new int?(0));
         }
         else if (this.newLiquid == (byte)13)
         {
             this.ParentObject.TakeObject("Unctuous Pseudopod", false, new int?(0));
             this.ParentObject.AddPart <DisarmOnHit>(new DisarmOnHit(100), true);
         }
         else if (this.newLiquid == (byte)14)
         {
             this.ParentObject.TakeObject("Oozing Pseudopod2", false, new int?(0));
         }
         else if (this.newLiquid == (byte)15)
         {
             this.ParentObject.TakeObject("Spiced Pseudopod", false, new int?(0));
         }
         else if (this.newLiquid == (byte)16)
         {
             this.ParentObject.TakeObject("Luminous Pseudopod2", false, new int?(0));
             this.ParentObject.AddPart <LightSource>(new LightSource(), true);
             (this.ParentObject.GetPart("LightSource") as LightSource).Radius = 6;
             this.ParentObject.Statistics["ColdResistance"].BaseValue        += 100;
         }
         else if (this.newLiquid == (byte)17)
         {
             this.ParentObject.TakeObject("Neutronic Pseudopod", false, new int?(0));
         }
         else if (this.newLiquid == (byte)18)
         {
             this.ParentObject.TakeObject("Homogenized Pseudopod", false, new int?(0));
             this.ParentObject.AddPart <CloneOnHit>(new CloneOnHit(), true);
         }
         else if (this.newLiquid == (byte)20)
         {
             this.ParentObject.TakeObject("Waxen Pseudopod", false, new int?(0));
         }
         else if (this.newLiquid == (byte)21)
         {
             this.ParentObject.TakeObject("Inky Pseudopod", false, new int?(0));
             this.ParentObject.AddPart <DisarmOnHit>(new DisarmOnHit(100), true);
         }
         else if (this.newLiquid == (byte)22)
         {
             this.ParentObject.TakeObject("Sugary Pseudopod", false, new int?(0));
         }
         this.ParentObject.pBrain.PerformReequip(false);
         this.newLiquid = (byte)99;
     }
     this.isCatalyzing = false;
     if (this.ComponentLiquids.Count != 1)
     {
         return;
     }
     MessageQueue.AddPlayerMessage("The reacting liquids congeal into a " + this.ParentObject.ShortDisplayName + ".");
     this.C.AddObject(this.ParentObject);
     XRLCore.Core.Game.ActionManager.AddActiveObject(this.ParentObject);
 }
Exemple #14
0
        public bool AttemptDisarm(GameObject who)
        {
            if (!Armed)
            {
                return(false);
            }
            if (who.IsPlayer() && !ParentObject.Understood())
            {
                return(false);
            }
            if (!who.CheckFrozen(Telepathic: false, Telekinetic: true))
            {
                return(false);
            }
            int num = 9 + Explosive.GetMark() * 3;

            if (who.HasSkill("Tinkering_GadgetInspector"))
            {
                num -= 4;
            }
            if (who.HasSkill("Tinkering_LayMine"))
            {
                num -= 4;
            }
            string    text       = (iTimer > 0) ? "Tinkering Bomb Disarm" : "Tinkering Mine Disarm";
            string    stat       = "Intelligence";
            int       difficulty = num;
            string    vs         = text;
            int       num2       = who.SaveChance(stat, difficulty, null, null, vs);
            int       num3       = num2;
            int       num4       = who.Stat("Intelligence");
            Mutations part       = who.GetPart <Mutations>();

            if (part != null)
            {
                if (part.HasMutation("Intuition"))
                {
                    num4 += 10;
                }
                if (part.HasMutation("Precognition"))
                {
                    num4 += 5;
                }
                if (part.HasMutation("Skittish"))
                {
                    num3 -= 10;
                }
            }
            if (who.HasSkill("Discipline_IronMind"))
            {
                num4 += 2;
            }
            if (who.HasSkill("Discipline_Lionheart"))
            {
                num3 += 3;
            }
            if (num4 <= 10)
            {
                num3 += 20;
            }
            else if (num4 <= 15)
            {
                num3 += 10;
            }
            else if (num4 <= 20)
            {
                num3 -= 10;
            }
            else if (num4 <= 25)
            {
                num3 -= 5;
            }
            int num5 = (num4 <= 10) ? 20 : ((num4 <= 20) ? 10 : ((num4 > 30) ? 1 : 5));

            if (num5 > 1)
            {
                num3 -= num3 % num5;
            }
            if (num3 > 100 - num5)
            {
                num3 = 100 - num5;
            }
            if (num3 < 0)
            {
                num3 = 0;
            }
            if (who.IsPlayer())
            {
                StringBuilder stringBuilder = Event.NewStringBuilder();
                string        chanceColor   = Stat.GetChanceColor(num3);
                stringBuilder.Append("&yFailing to disarm ").Append(ParentObject.the).Append(ParentObject.ShortDisplayName)
                .Append("&y will detonate ")
                .Append(ParentObject.it)
                .Append(". You estimate you have");
                if (num3 < num5)
                {
                    stringBuilder.Append(" less than a ").Append(chanceColor).Append(num5.ToString())
                    .Append("%");
                }
                else
                {
                    stringBuilder.Append(" about a ").Append(chanceColor).Append(num3.ToString())
                    .Append("%");
                }
                stringBuilder.Append(chanceColor).Append("&y chance of success. Do you want to make the attempt?");
                if (Popup.ShowYesNo(stringBuilder.ToString()) != 0)
                {
                    return(false);
                }
            }
            else if (Stat.Random(1, 100) > num3 && Stat.Random(1, 100) > num3)
            {
                return(false);
            }
            vs         = "Intelligence";
            difficulty = num;
            stat       = text;
            if (who.MakeSave(vs, difficulty, null, null, stat))
            {
                stat = "disarm";
                GameObject parentObject = ParentObject;
                IPart.XDidYToZ(who, stat, parentObject);
                Disarm();
            }
            else
            {
                Boom();
            }
            who.UseEnergy(1000, "Tinkering Mine Disarm");
            return(true);
        }
Exemple #15
0
 public override bool FireEvent(Event E)
 {
     if (E.ID == "EndTurnEngulfing")
     {
         if (descriptionSet == false)
         {
             IPart.ThePlayer.GetPart <Description>().Short = "I'm not a bad slime";
             descriptionSet = true;
         }
         GameObject parameter = E.GetParameter <GameObject>("Object");
         if (parameter != null)
         {
             Damage damage = new Damage(Stat.Random(IPart.ThePlayer.Statistics["Toughness"].BaseValue / 2, IPart.ThePlayer.Statistics["Toughness"].BaseValue));
             Event  E1     = Event.New("TakeDamage", 0, 0, 0);
             E1.AddParameter("Damage", (object)damage);
             E1.AddParameter("Owner", (object)this.ParentObject);
             E1.AddParameter("Attacker", (object)this.ParentObject);
             E1.AddParameter("Message", this.DamageMessage);
             parameter.FireEvent(E1);
             if (parameter.hitpoints <= 0)
             {
                 if (DifficultyEvaluation.GetDifficultyDescription(parameter) == "&wAverage")
                 {
                     this.statGains(1);
                 }
                 else if (DifficultyEvaluation.GetDifficultyDescription(parameter) == "&WTough")
                 {
                     this.statGains(2);
                 }
                 else if (DifficultyEvaluation.GetDifficultyDescription(parameter) == "&rVery Tough")
                 {
                     this.statGains(4);
                 }
                 else if (DifficultyEvaluation.GetDifficultyDescription(parameter) == "&RImpossible")
                 {
                     this.statGains(8);
                 }
                 Mutations targetMutations = parameter.GetPart <Mutations>();
                 Mutations playerMutations = IPart.ThePlayer.GetPart <Mutations>();
                 if (targetMutations != null)
                 {
                     bool   CasterIsPlayer = XRLCore.Core.Game.Player.Body == this.ParentObject ? true : false;
                     string PopupText;
                     foreach (BaseMutation mutation in targetMutations.MutationList)
                     {
                         //mutation.GetStat() == "Ego"
                         if (!playerMutations.HasMutation(mutation) && mutation.CompatibleWith(this.ParentObject))
                         {
                             if (mutation.GetMutationEntry().Category.Name == "Mental")
                             {
                                 PopupText = "Integrate Mental mutation with name of " + mutation.Name;
                                 if (CasterIsPlayer || UI.Popup.ShowYesNoCancel(PopupText) == DialogResult.Yes)
                                 {
                                     playerMutations.AddMutation(mutation, 1);
                                 }
                             }
                             else if (CasterIsPlayer && ForbiddenMutations.Contains(mutation.Name))//Forbidden Mutations
                             {
                                 if (mutation.AffectsBodyParts())
                                 {
                                     PopupText = "Integrate Forbidden-" + mutation.GetMutationEntry().Category.Name + " BodyBased mutation with name of " + mutation.Name;
                                 }
                                 else
                                 {
                                     PopupText = "Integrate Forbidden-" + mutation.GetMutationEntry().Category.Name + " mutation with name of " + mutation.Name;
                                 }
                                 if (UI.Popup.ShowYesNoCancel(PopupText) == DialogResult.Yes)
                                 {
                                     playerMutations.AddMutation(mutation, 1);
                                 }
                             }
                         }
                     }
                 }
                 Stomach part = IPart.ThePlayer.GetPart <Stomach>();
                 IPart.ThePlayer.RemoveEffect("Famished", false);
                 part.HungerLevel    = 0;
                 part.CookCount      = 0;
                 part.CookingCounter = 0;
                 part.Water          = 30000;
             }
         }
     }
     return(true);
 }
        public void TailStrike(XRL.World.GameObject Defender, int Hitbonus)
        {
            ThickTail Tail = base.ParentObject.Equipped.GetPart <Mutations>().GetMutation("ThickTail") as ThickTail;

            var       TailSource         = ParentObject;
            var       Owner              = TailSource.Equipped;
            Mutations HasSynergyMutation = Owner.GetPart <Mutations>();

            if (Defender != null && Defender.PhaseAndFlightMatches(Owner) && Defender.CurrentCell != null && Owner.CurrentCell != null && Owner.DistanceTo(Defender) <= 1)
            {
                if (Defender.pBrain != null)
                {
                    Defender.pBrain.GetAngryAt(Owner, -20);
                }
                if (Stat.Random(1, 20) + Hitbonus + Owner.StatMod("Agility", 0) > Stats.GetCombatDV(Defender))
                {
                    var    data            = Tail.GetData(Tail.Level);
                    int    PenetrationCont = Stat.RollDamagePenetrations(Stats.GetCombatAV(Defender), (Stat.Roll(data.Penetration, null) + Stat.Roll(data.BonusPen)), Stat.Roll(data.Penetration, null) + Stat.Roll(data.BonusPen));
                    string resultColor     = Stat.GetResultColor(PenetrationCont);
                    int    DamageBaseInit  = 0;

                    if (PenetrationCont > 0)
                    {
                        for (int i = 0; i < PenetrationCont; i++)
                        {
                            DamageBaseInit += Stat.Roll(data.BaseDamage, null);
                            CombatJuice.punch(Owner, Defender);
                        }
                        Damage damage = new Damage(DamageBaseInit);
                        damage.AddAttribute("Physical");
                        damage.AddAttribute("Bludgeoning");
                        Event @event = Event.New("TakeDamage", 0, 0, 0);
                        @event.AddParameter("Damage", damage);
                        @event.AddParameter("Owner", Owner);
                        @event.AddParameter("Attacker", Owner);
                        if (HasSynergyMutation.HasMutation("Quills"))
                        {
                            @event.AddParameter("Damage", data.BonusDamage);
                        }
                        if (DamageBaseInit > 0 && Defender.FireEvent(@event))
                        {
                            if (Owner.IsPlayer())
                            {
                                IComponent <GameObject> .AddPlayerMessage(string.Concat(new string[]
                                {
                                    "&gYou strike ",
                                    resultColor,
                                    "(x",
                                    PenetrationCont.ToString(),
                                    ")&y for ",
                                    damage.Amount.ToString(),
                                    " &ydamage with your " + base.ParentObject.DisplayName + "!"
                                }));
                            }
                            else if (Defender.IsPlayer())
                            {
                                IComponent <GameObject> .AddPlayerMessage(string.Concat(new string[]
                                {
                                    ParentObject.The,
                                    ParentObject.ShortDisplayName,
                                    " &r",
                                    ParentObject.GetVerb("strike", false, false),
                                    " ",
                                    resultColor,
                                    "(x",
                                    PenetrationCont.ToString(),
                                    ")&r for ",
                                    damage.Amount.ToString(),
                                    " &ydamage with ",
                                    ParentObject.its,
                                    " tail!"
                                }));
                            }
                        }
                        else if (Owner.IsPlayer())
                        {
                            IComponent <GameObject> .AddPlayerMessage("&rYou fail to deal damage to " + Defender.the + Defender.DisplayNameOnly + " &rwith your " + base.ParentObject.DisplayName + "!");
                        }
                        else if (Defender.IsPlayer())
                        {
                            IComponent <GameObject> .AddPlayerMessage(string.Concat(new string[]
                            {
                                ParentObject.The,
                                ParentObject.DisplayName,
                                " &g",
                                ParentObject.GetVerb("fail", false, false),
                                " to damage you with ",
                                ParentObject.its,
                                " tail!"
                            }));
                        }
                    }
                }
            }
        }
        public override bool FireEvent(Event E)
        {
            var Owner = ParentObject?.Equipped;

            if (Owner == null)
            {
                return(base.FireEvent(E));
            }
            Mutations HasSynergyMutation = Owner.GetPart <Mutations>();
            ThickTail TailMutation       = base.ParentObject.Equipped.GetPart <Mutations>().GetMutation("ThickTail") as ThickTail; if (E.ID == "MutationAdded")

            {
                UpdateTailParts();
                GameObject Tail      = ParentObject;
                int        Synergies = SynergyMutations.Count(HasSynergyMutation.HasMutation);
                if (Synergies == 3)
                {
                    NeedsSynergyPrefix = false;
                    Tail.DisplayName   = "{{blue|bizarre}} tail";
                }
                else if (Synergies == 4)
                {
                    NeedsSynergyPrefix = false;
                    Tail.DisplayName   = "{{zetachrome|zenith}} tail";
                }
                else if (Synergies >= 5)
                {
                    NeedsSynergyPrefix = false;
                    Tail.DisplayName   = "{{shyrhak|chimeraen}} tail";
                }
            }
            if (E.ID == "Equipped")
            {
                GameObject EventOwner = E.GetGameObjectParameter("EquippingObject");
                EventOwner.RegisterPartEvent(this, "PerformingMeleeAttack");
                EventOwner.RegisterPartEvent(this, "GetDefenderHitDice");
                UpdateTailParts();
            }
            else if (E.ID == "Unequipped")
            {
                GameObject EventOwner = E.GetGameObjectParameter("UnequippingObject");
                EventOwner.UnregisterPartEvent(this, "PerformingMeleeAttack");
                EventOwner.UnregisterPartEvent(this, "GetDefenderHitDice");
                UpdateTailParts();
            }

            if (E.ID == "PerformingMeleeAttack")
            {
                GameObject Defender = E.GetGameObjectParameter("Defender");
                if (Stat.Random(1, 100) <= 20 + (TailMutation.Level * 5))
                {
                    TailStrike(Defender, 2 + TailMutation.Level);
                    if (HasSynergyMutation.HasMutation("Quills"))
                    {
                        AddPlayerMessage("Your quilled tail delivers extra damage!");
                    }
                }
            }
            if (E.ID == "GetDefenderHitDice" && HasSynergyMutation.HasMutation("RoughScales"))
            {
                GameObject Attacker   = E.GetGameObjectParameter("Attacker");
                GameObject Tail       = ParentObject;
                var        TailShield = Tail.RequirePart <Shield>();
                if (TailShield == null)
                {
                    return(true);
                }
                if (E.HasParameter("ShieldBlocked"))
                {
                    return(true);
                }
                if (!Owner.CanMoveExtremities(null, false, false, false))
                {
                    return(true);
                }
                if (Stat.Random(1, 100) <= 15 + (5 * TailMutation.Level))
                {
                    E.SetParameter("ShieldBlocked", true);
                    if (Owner.IsPlayer())
                    {
                        IComponent <GameObject> .AddPlayerMessage("You deflect an attack with your " + base.ParentObject.DisplayName + "!" + "(" + TailShield.AV + " AV)", 'g');
                    }
                    else
                    {
                        Owner.ParticleText(string.Concat(new object[]
                        {
                            "{{",
                            IComponent <GameObject> .ConsequentialColor(Owner, null),
                            "|Block! (+",
                            TailShield.AV,
                            " AV)}}"
                        }), ' ', false, 1.5f, -8f);
                    }
                    E.SetParameter("AV", E.GetIntParameter("AV", 0) + TailShield.AV);
                }
            }
            return(base.FireEvent(E));
        }
        public TailData GetData(int Level)
        {
            Mutations CheckSynergy = ParentObject.GetPart <Mutations>();
            TailData  Result       = new TailData();

            Result.BaseDamage  = string.Empty;
            Result.BonusDamage = string.Empty;
            Result.BonusPen    = string.Empty;
            Result.Penetration = string.Empty;
            Result.BlockChance = int.MaxValue;
            Result.SwingChance = int.MaxValue;
            Result.SwimSpeed   = int.MaxValue;

            if (Level == 1)
            {
                Result.Penetration = "4";
                Result.BaseDamage  = "1d3";
                Result.SwingChance = 20;
            }
            if (Level == 2)
            {
                Result.Penetration = "4";
                Result.BaseDamage  = "1d4";
                Result.SwingChance = 25;
            }
            if (Level == 3)
            {
                Result.Penetration = "5";
                Result.BaseDamage  = "1d4";
                Result.SwingChance = 30;
            }
            if (Level == 4)
            {
                Result.Penetration = "5";
                Result.BaseDamage  = "1d5";
                Result.SwingChance = 35;
            }
            if (Level == 5)
            {
                Result.Penetration = "6";
                Result.BaseDamage  = "1d5";
                Result.SwingChance = 40;
            }
            if (Level == 6)
            {
                Result.Penetration = "6";
                Result.BaseDamage  = "1d6";
                Result.SwingChance = 45;
            }
            if (Level == 7)
            {
                Result.Penetration = "7";
                Result.BaseDamage  = "1d6";
                Result.SwingChance = 50;
            }
            if (Level == 8)
            {
                Result.Penetration = "7";
                Result.BaseDamage  = "1d7";
                Result.SwingChance = 55;
            }
            if (Level == 9)
            {
                Result.Penetration = "8";
                Result.BaseDamage  = "1d7";
                Result.SwingChance = 60;
            }
            if (Level >= 10)
            {
                Result.Penetration = "8";
                Result.BaseDamage  = "1d8";
                Result.SwingChance = 60 + ((ParentObject.StatMod("Agility") * 2));
            }
            if (CheckSynergy.HasMutation("Quills"))
            {
                if (Level == 1 || Level == 2)
                {
                    Result.BonusDamage = "1d4";
                    Result.BonusPen    = "1";
                }
                if (Level == 3 || Level == 4)
                {
                    Result.BonusDamage = "2d4";
                    Result.BonusPen    = "2";
                }
                if (Level == 5 || Level == 6)
                {
                    Result.BonusDamage = "3d4";
                    Result.BonusPen    = "3";
                }
                if (Level > 6)
                {
                    Result.BonusDamage = "4d4+" + Level / 2;
                    Result.BonusPen    = "4";
                }
            }
            if (CheckSynergy.HasMutation("Quills"))
            {
                if (Level == 1 || Level == 2)
                {
                    Result.BlockChance = 30;
                }
                if (Level == 3 || Level == 4)
                {
                    Result.BlockChance = 40;
                }
                if (Level == 5 || Level == 6)
                {
                    Result.BlockChance = 50;
                }
                if (Level > 6)
                {
                    Result.BlockChance = 60 + (5 * Level / 3);
                }
            }
            if (CheckSynergy.HasMutation("Amphibious"))
            {
                if (Level == 1)
                {
                    Result.SwimSpeed = 50;
                }
                if (Level == 2)
                {
                    Result.SwimSpeed = 100;
                }
                if (Level == 3)
                {
                    Result.SwimSpeed = 125;
                }
                if (Level == 4)
                {
                    Result.SwimSpeed = 150;
                }
                if (Level == 5)
                {
                    Result.SwimSpeed = 175;
                }
                if (Level == 6)
                {
                    Result.SwimSpeed = 200;
                }
                if (Level == 7)
                {
                    Result.SwimSpeed = 200 + (ParentObject.StatMod("Strength") * 2);
                }
                if (Level == 8)
                {
                    Result.SwimSpeed = 210 + (ParentObject.StatMod("Strength") * 2);
                }
                if (Level == 9)
                {
                    Result.SwimSpeed = 215 + (ParentObject.StatMod("Strength") * 2);
                }
                if (Level >= 10)
                {
                    Result.SwimSpeed = 215 + (ParentObject.StatMod("Strength") * 3);
                }
            }
            return(Result);
        }
        public override bool HandleEvent(GetShortDescriptionEvent E)
        {
            GameObject Tail  = ParentObject;
            GameObject Owner = Tail.Equipped;
            Mutations  HasSynergyMutation = Owner.GetPart <Mutations>();
            string     DescriptTest       = "TESTING THIS ABOMINATION!";
            string     DescriptQuills     = "{{light blue|This thick muscular tail is lined with large barbs, angled for striking potential predators. [Bonus Damage on Tail Whip]}}\n"
                                            + "{{green|" + Tail.Armor.AV + "+ Bonus AV\n"
                                            + Tail.Armor.DV + "+ Bonus DV}}\n";
            string DescriptFurred = "{{light blue|A large, thick fuzzy tail. You feel the urge to curl up in it.}}\n"
                                    + "{{green|" + Tail.Armor.AV + "+ Bonus AV\n"
                                    + Tail.Armor.DV + "+ Bonus DV}}\n";
            string DescriptChimera = "{{red|The beginnings of a primordial shah.}}\n"
                                     + "{{green|" + Tail.Armor.AV + "+ Bonus AV\n"
                                     + Tail.Armor.DV + "+ Bonus DV}}\n";
            string DescriptPlated = "{{light blue|Its armed with plated scales, their strength allows this appendage to deflect blows.\n"
                                    + "{{green|" + Tail.Armor.AV + "+ Bonus AV\n"
                                    + Tail.Armor.DV + "+ Bonus DV}}\n"
                                    + "Your tail can deflect blows on successful blocks: Strength Modifier -> AC.";
            string PlatedAccesser = "[Your tail can deflect blows on successful blocks: Strength Modifier -> AC.]";
            string DescriptLum    = "{{grey|The fleshy end of this tail glows luminously as chemical reactions perform a mesmerizing dance in a membrane at its tip.}}\n"
                                    + "{{green|" + Tail.Armor.AV + "+ Bonus AV\n"
                                    + Tail.Armor.DV + "+ Bonus DV}}\n";
            string DescriptFin = "{{grey|This tail has a large dorsal fin, its strength aids in swimming strides, a rare skill.}}\n"
                                 + "{{green|" + Tail.Armor.AV + "+ Bonus AV\n"
                                 + Tail.Armor.DV + "+ Bonus DV}}\n";
            string DescriptTwo = "This one is a somewhat mutated tail with several grotesque appendages granting it odd qualities.\n"
                                 + "{{green|" + Tail.Armor.AV + "+ Bonus AV\n"
                                 + Tail.Armor.DV + "+ Bonus DV}}\n";
            string DescriptThree = "This strange tail echoes nature's mockeries of order and anarchy; it offers its bearer a variety of perks at their disposal.\n"
                                   + "{{green|" + Tail.Armor.AV + "+ Bonus AV\n"
                                   + Tail.Armor.DV + "+ Bonus DV}}\n";
            string DescriptFour = "This tail is worthy of the name zenith, a deadly composition sculpted through nature's will to evolve.\n"
                                  + "{{green|" + Tail.Armor.AV + "+ Bonus AV\n"
                                  + Tail.Armor.DV + "+ Bonus DV}}\n";
            string DescriptFive = "To look upon this twisted limb is to be reminded of the meaning chimera. It awakens primitive fears, maybe even a sudden thrill.\n"
                                  + "{{green|" + Tail.Armor.AV + "+ Bonus AV\n"
                                  + Tail.Armor.DV + "+ Bonus DV}}\n";

            string[] outputs   = SynergyMutations.GetRange(0, 4).ToArray();
            int      Synergies = SynergyMutations.Count(HasSynergyMutation.HasMutation);

            try
            {
                if (Synergies == 1 && HasSynergyMutation.HasMutation("Quills"))
                {
                    Debug.Log("MY Log: Initiate quills");
                    E.Infix.Append('\n').Append(DescriptQuills);
                }
                else if (Synergies == 1 && HasSynergyMutation.HasMutation("ThickFur"))
                {
                    Debug.Log("MY Log: Initiate fur");
                    E.Infix.Append('\n').Append(DescriptFurred);
                }
                else if (Synergies == 1 && HasSynergyMutation.HasMutation("RoughScales"))
                {
                    Debug.Log("MY Log: Initiate scale");
                    E.Infix.Append('\n').Append(DescriptPlated);
                }
                else if (Synergies == 1 && HasSynergyMutation.HasMutation("LightManipulation"))
                {
                    Debug.Log("MY Log: Initiate lum");
                    E.Infix.Append('\n').Append(DescriptLum);
                }
                else if (Synergies == 1 && HasSynergyMutation.HasMutation("Amphibious"))
                {
                    E.Infix.Append('\n').Append(DescriptFin);
                }
                else if (Synergies == 1 && HasSynergyMutation.HasMutation("Chimera"))
                {
                    E.Infix.Append('\n').Append(DescriptChimera);
                }
                else if (Synergies == 2)
                {
                    E.Infix.Append('\n').Append(DescriptTwo);
                }
                else if (Synergies == 3)
                {
                    E.Infix.Append('\n').Append(DescriptThree);
                }
                else if (Synergies == 4)
                {
                    E.Infix.Append('\n').Append(DescriptFour);
                }
                else if (Synergies >= 5)
                {
                    E.Infix.Append('\n').Append(DescriptFive);
                }
                if (HasSynergyMutation.HasMutation("RoughScales") && Synergies > 1)
                {
                    E.Postfix.Append('\n').Append(PlatedAccesser);
                }
            }
            catch
            { E.Infix.Append('\n').Append(DescriptTest); }
            return(base.HandleEvent(E));
        }
Exemple #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));
        }