private static ThingDef NewFrameDef_Terrain(TerrainDef terrDef)
        {
            ThingDef thingDef = ThingDefGenerator_Buildings.BaseFrameDef();

            thingDef.defName                       = ThingDefGenerator_Buildings.BuildingFrameDefNamePrefix + terrDef.defName;
            thingDef.label                         = terrDef.label + "FrameLabelExtra".Translate();
            thingDef.entityDefToBuild              = terrDef;
            thingDef.useHitPoints                  = false;
            thingDef.fillPercent                   = 0f;
            thingDef.description                   = "Terrain building in progress.";
            thingDef.passability                   = Traversability.Standable;
            thingDef.selectable                    = true;
            thingDef.constructEffect               = terrDef.constructEffect;
            thingDef.building.isEdifice            = false;
            thingDef.constructionSkillPrerequisite = terrDef.constructionSkillPrerequisite;
            thingDef.clearBuildingArea             = false;
            thingDef.modContentPack                = terrDef.modContentPack;
            thingDef.category                      = ThingCategory.Ethereal;
            thingDef.entityDefToBuild              = terrDef;
            terrDef.frameDef                       = thingDef;
            if (!thingDef.IsFrame)
            {
                Log.Error("Framedef is not frame: " + thingDef, false);
            }
            return(thingDef);
        }
Example #2
0
        private static ThingDef NewFrameDef_Thing(ThingDef def)
        {
            ThingDef thingDef = ThingDefGenerator_Buildings.BaseFrameDef();

            thingDef.defName = def.defName + ThingDefGenerator_Buildings.BuildingFrameDefNameSuffix;
            thingDef.label   = def.label + "FrameLabelExtra".Translate();
            thingDef.size    = def.size;
            thingDef.SetStatBaseValue(StatDefOf.MaxHitPoints, (float)((float)def.BaseMaxHitPoints * 0.25));
            thingDef.SetStatBaseValue(StatDefOf.Beauty, -8f);
            thingDef.fillPercent = 0.2f;
            thingDef.pathCost    = 10;
            thingDef.description = def.description;
            thingDef.passability = def.passability;
            if ((int)thingDef.passability > 1)
            {
                thingDef.passability = Traversability.PassThroughOnly;
            }
            thingDef.selectable                    = def.selectable;
            thingDef.constructEffect               = def.constructEffect;
            thingDef.building.isEdifice            = def.building.isEdifice;
            thingDef.constructionSkillPrerequisite = def.constructionSkillPrerequisite;
            thingDef.clearBuildingArea             = def.clearBuildingArea;
            thingDef.drawPlaceWorkersWhileSelected = def.drawPlaceWorkersWhileSelected;
            if (def.placeWorkers != null)
            {
                thingDef.placeWorkers = new List <Type>(def.placeWorkers);
            }
            if (def.designationCategory != null)
            {
                thingDef.stuffCategories = def.stuffCategories;
            }
            thingDef.entityDefToBuild = def;
            def.frameDef = thingDef;
            return(thingDef);
        }