Beispiel #1
0
        private static void CheckHPSTRested(GeoCharacter restedCharacter, List <IGeoCharacterContainer> ____justRestedContainer, GeoFaction ____faction)
        {
            try {
                if (!HP_Changed && !ST_Changed)
                {
                    return;
                }
                if (HP_Changed && !Mod.Config.Notice_On_HP_Only_Heal)
                {
                    return;
                }
                if (ST_Changed && !Mod.Config.Notice_On_Stamina_Only_Heal)
                {
                    return;
                }
                Func <IGeoCharacterContainer, bool> foundRested = (e) => e.GetAllCharacters().Contains(restedCharacter);

                if (____justRestedContainer.Any(foundRested))
                {
                    return;
                }
                var container = ____faction.Vehicles.FirstOrDefault(foundRested) ?? ____faction.Sites.FirstOrDefault(foundRested);
                if (container == null)
                {
                    return;
                }
                if (container.GetAllCharacters().All(c => (HP_Changed && !c.IsInjured) || (ST_Changed && c.Fatigue?.IsFullyRested != false)))
                {
                    Info("Detected {0} recovery on {1}", HP_Changed ? "HP" : "stamina", container.Name);
                    ____justRestedContainer.Add(container);
                }
            } catch (Exception ex) { Error(ex); }
        }
 public CharacterModel(GeoCharacter geoCharacter)
 {
     this._Data = geoCharacter;
 }
Beispiel #3
0
        private static void AfterDisplaySoldier_AddStats(UIStateEquipSoldier __instance, GeoCharacter character)
        {
            try {
                var cls = character?.ClassDef;
                if (cls == null || cls.IsVehicle || cls.IsMutog || character.Progression == null)
                {
                    return;
                }
                var TextComp = (typeof(UIStateEquipSoldier).GetProperty("_soldierEquipModule", BindingFlags.NonPublic | BindingFlags.Instance)?.GetValue(__instance) as UIModuleSoldierEquip)?.WeightLimitTextComp;

                var stats = character.CharacterStats;
                var txt   = Mod.Config.Equip_Weight_Replacement;
                // "{encumbrance}, {speed_txt} {speed}, {accuracy_txt} {accuracy}, {perception_txt} {perception}, {stealth_txt} {stealth}";
                txt           = txt.Replace("{encumbrance}", TextComp.text);
                txt           = txt.Replace("{speed_txt}", new LocalizedTextBind("KEY_ITEM_STAT_SPEED", false).Localize());
                txt           = txt.Replace("{accuracy_txt}", new LocalizedTextBind("KEY_ITEM_STAT_ACCURACY", false).Localize());
                txt           = txt.Replace("{perception_txt}", new LocalizedTextBind("KEY_ITEM_STAT_PERCEPTION", false).Localize());
                txt           = txt.Replace("{stealth_txt}", new LocalizedTextBind("KEY_ITEM_STAT_STEALTH", false).Localize());
                txt           = txt.Replace("{speed}", ModTxt(stats.Speed.Value.EndValue - character.GetProgressionBaseStats().Speed));
                txt           = txt.Replace("{accuracy}", PercTxt(stats.Accuracy));
                txt           = txt.Replace("{perception}", ModTxt(stats.Perception.Value.EndValue - stats.Perception.Value.BaseValue));
                txt           = txt.Replace("{stealth}", PercTxt(stats.Stealth));
                TextComp.text = txt;
            } catch (Exception ex) { Error(ex); }
        }
 public GeoTankWrapper(GeoCharacter vehicle) : base(tankDefs[vehicle.ClassDef])
 {
     this.GroundVehicle = vehicle;
 }