Пример #1
0
        public override IEnumerable <Gizmo> GetGizmos()
        {
            VitaeAbilityDef bloodAwaken = DefDatabase <VitaeAbilityDef> .GetNamedSilentFail("ROMV_VampiricAwaken");

            foreach (Gizmo g in base.GetGizmos()
                     .Where(x => !(x is Command_Action y && y.defaultLabel == bloodAwaken.label)))
            {
                yield return(g);
            }

            var AbilityUser = sealedVampire;

            if (!AbilityUser?.Dead ?? false)
            {
                yield return(new Command_Action()
                {
                    defaultLabel = bloodAwaken.label,
                    defaultDesc = bloodAwaken.GetDescription(),
                    icon = bloodAwaken.uiIcon,
                    action = delegate
                    {
                        AbilityUser.BloodNeed().AdjustBlood(-1);
                        this.EjectContents();
                        sealedVampire.mindState.mentalStateHandler.TryStartMentalState(MentalStateDefOf.Berserk,
                                                                                       bloodAwaken.label);
                        if (def == VampDefOf.ROMV_HideyHole)
                        {
                            Destroy();
                        }
                    },
                });
            }
        }
Пример #2
0
        public static IEnumerable <Gizmo> GraveGizmoGetter(Pawn AbilityUser, Building_Grave grave)
        {
            bool   dFlag   = false;
            string dReason = "";

            if ((AbilityUser?.BloodNeed()?.CurBloodPoints ?? 0) <= 0)
            {
                dFlag   = true;
                dReason = "ROMV_NoBloodRemaining".Translate();
            }

            VitaeAbilityDef bloodAwaken = DefDatabase <VitaeAbilityDef> .GetNamedSilentFail("ROMV_VampiricAwaken");

            if (!AbilityUser?.Dead ?? false)
            {
                yield return(new Command_Action()
                {
                    defaultLabel = bloodAwaken.label,
                    defaultDesc = bloodAwaken.GetDescription(),
                    icon = bloodAwaken.uiIcon,
                    action = delegate
                    {
                        AbilityUser.BloodNeed().AdjustBlood(-1);
                        grave.EjectContents();
                        if (grave.def == VampDefOf.ROMV_HideyHole)
                        {
                            grave.Destroy();
                        }
                    },
                    disabled = dFlag,
                    disabledReason = dReason
                });
            }

            VitaeAbilityDef bloodResurrection =
                DefDatabase <VitaeAbilityDef> .GetNamedSilentFail("ROMV_VampiricResurrection");

            if (AbilityUser?.Corpse?.GetRotStage() < RotStage.Dessicated)
            {
                yield return(new Command_Action()
                {
                    defaultLabel = bloodResurrection.label,
                    defaultDesc = bloodResurrection.GetDescription(),
                    icon = bloodResurrection.uiIcon,
                    action = delegate
                    {
                        AbilityUser.Drawer.Notify_DebugAffected();
                        ResurrectionUtility.Resurrect(AbilityUser);
                        MoteMaker.ThrowText(AbilityUser.PositionHeld.ToVector3(), AbilityUser.MapHeld,
                                            StringsToTranslate.AU_CastSuccess);
                        AbilityUser.BloodNeed().AdjustBlood(-99999999);
                        HealthUtility.AdjustSeverity(AbilityUser, VampDefOf.ROMV_TheBeast, 1.0f);
                        MentalStateDef MentalState_VampireBeast =
                            DefDatabase <MentalStateDef> .GetNamed("ROMV_VampireBeast");

                        AbilityUser.mindState.mentalStateHandler.TryStartMentalState(MentalState_VampireBeast, null,
                                                                                     true);
                    },
                    disabled = (AbilityUser?.BloodNeed()?.CurBloodPoints ?? 0) < 0
                });
            }
        }