示例#1
0
 public void SetDisplayer(IAmountDisplayer displayer)
 {
     this.displayer = displayer;
     minAttribute.SetFormatter(displayer.Formatter);
     maxAttribute.SetFormatter(displayer.Formatter);
     deltaAttribute.SetFormatter(displayer.Formatter);
 }
示例#2
0
        public Disease(string id, byte strength, RangeInfo temperature_range, RangeInfo temperature_half_lives, RangeInfo pressure_range, RangeInfo pressure_half_lives)
            : base(id, null, null)
        {
            name    = new StringKey("STRINGS.DUPLICANTS.DISEASES." + id.ToUpper() + ".NAME");
            this.id = id;
            DiseaseVisualization.Info info = Assets.instance.DiseaseVisualization.GetInfo(id);
            overlayColour        = info.overlayColour;
            temperatureRange     = temperature_range;
            temperatureHalfLives = temperature_half_lives;
            pressureRange        = pressure_range;
            pressureHalfLives    = pressure_half_lives;
            PopulateElemGrowthInfo();
            ApplyRules();
            string str = Strings.Get("STRINGS.DUPLICANTS.DISEASES." + id.ToUpper() + ".LEGEND_HOVERTEXT").ToString();

            overlayLegendHovertext = str + DUPLICANTS.DISEASES.LEGEND_POSTAMBLE;
            Attribute attribute  = new Attribute(id + "Min", "Minimum" + id.ToString(), string.Empty, string.Empty, 0f, Attribute.Display.Normal, false, null, null);
            Attribute attribute2 = new Attribute(id + "Max", "Maximum" + id.ToString(), string.Empty, string.Empty, 1E+07f, Attribute.Display.Normal, false, null, null);

            amountDeltaAttribute = new Attribute(id + "Delta", id.ToString(), string.Empty, string.Empty, 0f, Attribute.Display.Normal, false, null, null);
            amount = new Amount(id, id + " " + DUPLICANTS.DISEASES.GERMS, id + " " + DUPLICANTS.DISEASES.GERMS, attribute, attribute2, amountDeltaAttribute, false, Units.Flat, 0.01f, true, null, null);
            Db.Get().Attributes.Add(attribute);
            Db.Get().Attributes.Add(attribute2);
            Db.Get().Attributes.Add(amountDeltaAttribute);
            cureSpeedBase           = new Attribute(id + "CureSpeed", false, Attribute.Display.Normal, false, 0f, null, null);
            cureSpeedBase.BaseValue = 1f;
            cureSpeedBase.SetFormatter(new ToPercentAttributeFormatter(1f, GameUtil.TimeSlice.None));
            Db.Get().Attributes.Add(cureSpeedBase);
        }
示例#3
0
 public Sickness(string id, SicknessType type, Severity severity, float immune_attack_strength, List <InfectionVector> infection_vectors, float sickness_duration, string recovery_effect = null)
     : base(id, null, null)
 {
     name                    = new StringKey("STRINGS.DUPLICANTS.DISEASES." + id.ToUpper() + ".NAME");
     this.id                 = id;
     sicknessType            = type;
     this.severity           = severity;
     infectionVectors        = infection_vectors;
     sicknessDuration        = sickness_duration;
     recoveryEffect          = recovery_effect;
     descriptiveSymptoms     = new StringKey("STRINGS.DUPLICANTS.DISEASES." + id.ToUpper() + ".DESCRIPTIVE_SYMPTOMS");
     cureSpeedBase           = new Attribute(id + "CureSpeed", false, Attribute.Display.Normal, false, 0f, null, null);
     cureSpeedBase.BaseValue = 1f;
     cureSpeedBase.SetFormatter(new ToPercentAttributeFormatter(1f, GameUtil.TimeSlice.None));
     Db.Get().Attributes.Add(cureSpeedBase);
 }
示例#4
0
 public static void Postfix(Database.Attributes __instance)
 {
     Klei.AI.Attribute attribute = new Klei.AI.Attribute(HeartAttackMonitor.ATTRIBUTE_ID, false, Klei.AI.Attribute.Display.Details, false, 0f, null, null);
     attribute.SetFormatter(new ToPercentAttributeFormatter(1, GameUtil.TimeSlice.None));
     __instance.Add(attribute);
 }