예제 #1
0
        public static DamageKeywordDef GetDamageType(string type)
        {
            if (DmgType == null)
            {
                DmgType = SharedData.GetSharedDataFromGame().SharedDamageKeywords;
            }
            switch (type)
            {
            case "acid": return(DmgType.AcidKeyword);

            case "blast": return(DmgType.BlastKeyword);

            case "bleed": return(DmgType.BleedingKeyword);

            case "fire": return(DmgType.BurningKeyword);

            case "goo": return(DmgType.GooKeyword);

            case "mist": return(DmgType.MistKeyword);

            case "paralyse":
            case "paralyze": return(DmgType.ParalysingKeyword);

            case "pierce": return(DmgType.PiercingKeyword);

            case "poison": return(DmgType.PoisonousKeyword);

            case "psychic": return(DmgType.PsychicKeyword);

            case "shock": return(DmgType.ShockKeyword);

            case "shred": return(DmgType.ShreddingKeyword);

            case "sonic": return(DmgType.SonicKeyword);

            case "syphon":
            case "vampiric": return(DmgType.SyphonKeyword);

            case "viral": return(DmgType.ViralKeyword);

            case "virophage": return((DamageKeywordDef)Repo.GetDef("c968f22f-392d-1964-68cd-edd14655082d"));

            case "normal":
            case "":
                return(DmgType.DamageKeyword);
            }
            throw new ArgumentException("Unknown damage type: " + type);
        }
예제 #2
0
        private static void AfterDropItems_DropArmour(DieAbility __instance)
        {
            try {
                var actor = __instance.TacticalActor;
                var items = actor?.BodyState?.GetArmourItems();
                if (items?.Any() != true)
                {
                    return;
                }

                var        shared = SharedData.GetSharedDataFromGame();
                var        gameTags = shared.SharedGameTags;
                GameTagDef armour = gameTags.ArmorTag, manu = gameTags.ManufacturableTag, mount = gameTags.MountedTag;

                int count = 0;
                foreach (var item in items)
                {
                    var def  = item.ItemDef as TacticalItemDef;
                    var tags = def?.Tags;
                    if (tags == null || tags.Count == 0 || !tags.Contains(manu) || def.IsPermanentAugment)
                    {
                        continue;
                    }
                    if (tags.Contains(armour) || tags.Contains(mount))
                    {
                        Verbo("Force dropping {0}", def.ViewElementDef.Name);
                        item.Drop(shared.FallDownItemContainerDef, actor);
                        count++;
                    }
                }
                if (count > 0)
                {
                    Info("Force dropped {0} pieces from {1} of {2}", count, actor.ViewElementDef?.Name, actor.TacticalFaction?.Faction?.FactionDef?.GetName());
                }
            } catch (Exception ex) { Error(ex); }
        }