Exemplo n.º 1
0
        public override bool Unmutate(GameObject GO)
        {
            Phased Phased = ParentObject.GetEffect("Phased") as Phased;

            if (ParentObject.HasEffect("Phased"))
            {
                ParentObject.RemoveEffect(Phased);
            }
            return(base.Unmutate(GO));
        }
 public override bool ChangeLevel(int NewLevel)
 {
     StatShifter.DefaultDisplayName = "Chitin Skin";
     avBonus = 1 + (int)Math.Ceiling((Decimal)(NewLevel / 2));
     StatShifter.SetStatShift(target: ParentObject, statName: "AV", amount: avBonus, baseValue: true);
     STRBonus = 1 + (int)Math.Ceiling((Decimal)(NewLevel / 2));
     StatShifter.SetStatShift(target: ParentObject, statName: "Strength", amount: STRBonus, baseValue: true);
     if (ParentObject.HasEffect("SoftChitin"))
     {
         SoftChitin effect = ParentObject.GetEffect("SoftChitin") as SoftChitin;
         effect.setAVDebuff(avBonus, ParentObject);
     }
     return(base.ChangeLevel(NewLevel));
 }
        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));
        }