Пример #1
0
        public static void ApparelByStuff()
        {
            List <FloatMenuOption> list = new List <FloatMenuOption>();

            list.Add(new FloatMenuOption("Stuffless", delegate
            {
                DebugOutputsGeneral.DoTableInternalApparel(null);
            }, MenuOptionPriority.Default, null, null, 0f, null, null));
            foreach (ThingDef current in from td in DefDatabase <ThingDef> .AllDefs
                     where td.IsStuff
                     select td)
            {
                ThingDef localStuff = current;
                list.Add(new FloatMenuOption(localStuff.defName, delegate
                {
                    DebugOutputsGeneral.DoTableInternalApparel(localStuff);
                }, MenuOptionPriority.Default, null, null, 0f, null, null));
            }
            Find.WindowStack.Add(new FloatMenu(list));
        }
Пример #2
0
        public static void WeaponsMelee()
        {
            List <FloatMenuOption> list = new List <FloatMenuOption>();

            list.Add(new FloatMenuOption("Stuffless", delegate
            {
                DebugOutputsGeneral.DoTablesInternalMelee(null, false);
            }, MenuOptionPriority.Default, null, null, 0f, null, null));
            IEnumerable <ThingDef> source = from st in DefDatabase <ThingDef> .AllDefs
                                            where st.IsStuff
                                            where DefDatabase <ThingDef> .AllDefs.Any((ThingDef wd) => wd.IsMeleeWeapon && st.stuffProps.CanMake(wd))
                                            select st;

            foreach (ThingDef current in from td in source
                     orderby td.GetStatValueAbstract(StatDefOf.SharpDamageMultiplier, null) descending
                     select td)
            {
                ThingDef localStuff         = current;
                float    statValueAbstract  = localStuff.GetStatValueAbstract(StatDefOf.SharpDamageMultiplier, null);
                float    statValueAbstract2 = localStuff.GetStatValueAbstract(StatDefOf.BluntDamageMultiplier, null);
                float    statFactorFromList = localStuff.stuffProps.statFactors.GetStatFactorFromList(StatDefOf.MeleeWeapon_CooldownMultiplier);
                list.Add(new FloatMenuOption(string.Concat(new object[]
                {
                    localStuff.defName,
                    " (sharp ",
                    statValueAbstract,
                    ", blunt ",
                    statValueAbstract2,
                    ", cooldown ",
                    statFactorFromList,
                    ")"
                }), delegate
                {
                    DebugOutputsGeneral.DoTablesInternalMelee(localStuff, false);
                }, MenuOptionPriority.Default, null, null, 0f, null, null));
            }
            Find.WindowStack.Add(new FloatMenu(list));
        }