Exemplo n.º 1
0
            public void CalculateImmuneSystem(MinionIdentity dupe)
            {
                var totalGerms = 0;

                foreach (var germ in germList)
                {
                    if (germ.Id == Db.Get().Diseases.SlimeGerms.Id)
                    {
                        totalGerms += (int)(germ.Amount * 1.0f);
                    }
                    else if (germ.Id == Db.Get().Diseases.PollenGerms.Id)
                    {
                        totalGerms += (int)(germ.Amount * 0.5f);
                    }
                    else
                    {
                        totalGerms += (int)germ.Amount;
                    }
                }

                var amount = ImmuneSystemAmount.Lookup(dupe);

                for (int index = 0; index != amount.deltaAttribute.Modifiers.Count; ++index)
                {
                    AttributeModifier mod = amount.deltaAttribute.Modifiers[index];
                    if (mod.AttributeId == ImmuneSystemGermModifier.AttributeId &&
                        mod.Description == ImmuneSystemGermModifier.Description)
                    {
                        mod.SetValue((float)-(totalGerms / 900D / 500D));
                    }
                }
            }
Exemplo n.º 2
0
            public static void Postfix(MinionIdentity __instance)
            {
                var dupe = __instance;

                if (HasDupeValue(dupe.gameObject, ImmuneSystemAmount))
                {
                    var immuneSystem = ImmuneSystemAmount.Lookup(dupe.gameObject);
                    var max          = immuneSystem.GetMax();
                    var value        = immuneSystem.value;


                    var amount = ImmuneSystemAmount.Lookup(dupe.gameObject);
                    for (var index = 0; index != amount.deltaAttribute.Modifiers.Count; ++index)
                    {
                        var mod = amount.deltaAttribute.Modifiers[index];
                        if (mod.AttributeId != ImmuneSystemBaseModifier.AttributeId ||
                            mod.Description != ImmuneSystemBaseModifier.Description)
                        {
                            continue;
                        }
                        if (value >= max)
                        {
                            mod.SetValue(0f);
                        }
                        else
                        {
                            if (mod.Value <= 0f)
                            {
                                mod.SetValue(ImmuneSystemDefaultDelta);
                            }
                        }
                    }
                }
            }
Exemplo n.º 3
0
            public static void Postfix(MinionConfig __instance, GameObject go)
            {
                AmountInstance immuneSys = ImmuneSystemAmount.Lookup(go);

                immuneSys.value = immuneSys.GetMax();
            }