Example #1
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));
 }
Example #2
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);
        }
        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));
        }
Example #4
0
        /*public string storyoptions(string key,string alt){
         *      List<string> output = new List<string>();
         *      foreach(acegiak_RomancePreference preferece in preferences){
         *              string newstring = preferece.getstoryoption(key);
         *              if(newstring != null){
         *                      output.Add(newstring);
         *              }
         *      }
         *      if(output.Count > 0){
         *              return output[Stat.Rnd2.Next(output.Count)];
         *      }
         *      return alt;
         * }*/

        public void AssessDate(GameObject Date, GameObject DateObject)
        {
            havePreference();
            float  value  = (Stat.Rnd2.Next(1, 4) - 2);
            string output = ParentObject.The + ParentObject.ShortDisplayName + " joins you at " + DateObject.the + DateObject.ShortDisplayName;


            foreach (acegiak_RomancePreference preferece in preferences)
            {
                acegiak_RomancePreferenceResult result = preferece.DateAssess(Date, DateObject);

                if (result != null)
                {
                    value  += result.amount;
                    output += "\n" + result.explanation;
                    //IPart.AddPlayerMessage("" + ParentObject.the + ParentObject.DisplayNameOnly + "&Y "+result.explanation);
                }
            }

            if (DateObject.GetPart <Bed>() != null)
            {
                if (ParentObject.GetPart <acegiak_Kissable>() != null)
                {
                    float attractionAmount = ParentObject.GetPart <acegiak_Kissable>().attractionAmount(Date);
                    value += attractionAmount;
                    if (attractionAmount > 0)
                    {
                        output += "\nYou sleep with " + ParentObject.The + ParentObject.ShortDisplayName + ".";
                        ParentObject.ApplyEffect(new Asleep(100));
                        Date.ApplyEffect(new Asleep(100));
                    }
                    if (attractionAmount < 0)
                    {
                        output += "\n" + ParentObject.The + ParentObject.ShortDisplayName + " isn't attracted to you.";
                    }
                }
            }


            Popup.Show(output);
            ParentObject.pBrain.AdjustFeeling(Date, (int)(value * 10));
            Date.GetPart <acegiak_Romancable>().date = null;
            if (value < 1)
            {
                this.patience -= 2;
            }
            else
            {
                this.patience -= 1;
            }
            JournalAPI.AddAccomplishment("&y You took " + ParentObject.a + ParentObject.DisplayNameOnlyDirect + " on a date to " + DateObject.the + DateObject.DisplayNameOnlyDirect + " and " + ParentObject.it + (value > 0?" was&G":" was &rnot") + " impressed&y.", "general", null);
        }
Example #5
0
        public bool HandleEvent(BrewingInterruptedEvent e)
        {
            // Our pipes are delicate :(

            ParentObject.ApplyEffect(new Broken());

            AddPlayerMessage(VariableReplace(
                                 MESSAGE_BREWING_INTERRUPTED,
                                 Subject: ParentObject
                                 ));

            return(true);
        }
Example #6
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);
            }
        }
        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 ChangeAmbientTemperature(string AmbientTempChoices)
        {
            FocusPsi PsiMutation = ParentObject.GetPart <FocusPsi>();

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

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

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

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

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

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


                int Range = 6 + Level / 2 + ParentsEgo;


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

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


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

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

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

            string ChargesSpent = PsiMutation.focusPsiCurrentCharges.ToString();



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

            int Charges = Convert.ToInt32(ChargesSpent);

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

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

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

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


            string Element = null;

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


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

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

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

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

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

                Target.FireEvent(cE);
            }

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

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

            CooldownMyActivatedAbility(ActivateThermokinesisAbilityID, Charges * 3);
        }
Example #11
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));
        }
Example #12
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 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));
        }
Example #14
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 == "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 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));
        }