Exemplo n.º 1
0
        public override IEnumerable <FloatMenuOption> GetFloatMenuOptions(Pawn pawn)
        {
            yield return(new FloatMenuOption(
                             "Give abilities", delegate
            {
                List <AbilityDef> abilities = DefDatabase <AbilityDef> .AllDefs.Where(def => def.abilityClass == typeof(OccultAbility)).ToList();
                foreach (AbilityDef def in abilities)
                {
                    pawn.abilities.GainAbility(def);
                }
            }
                             ));

            yield return(new FloatMenuOption(
                             "Give Occultism XP", delegate
            {
                pawn.skills.Learn(CultsDefOf.Cults_Skill_Occultism, 3500f);
            }
                             ));

            yield return(new FloatMenuOption(
                             "+0.1 residual energy", delegate
            {
                ResidualEnergy energy = this.Map.GetComponent <ResidualEnergy>();
                energy.Severity += 0.1f;
            }
                             ));
        }
        public void releaseResidualEnergy()
        {
            FloatRange     amount         = Props.residualEnergyGain;
            ResidualEnergy residualEnergy = parent.pawn.Map.GetComponent <ResidualEnergy>();
            float          add            = Rand.Range(amount.min, amount.max);

            Log.Message("Energy: " + amount.min + " - " + amount.max + " - " + add);
            residualEnergy.Severity += add;
        }