module Base
{
    /* BADLANDS Greenhouse. Art: forge examples/knx_greenhouse.py; tiledef
       badlands_greenhouse_01 (6475) holds tilesets badlands_greenhouse_01
       (walls, door) and badlands_ghroof_01 (roof panel), assembled by forge
       build/_greenhouse_mod.py. Wall and door props mirror vanilla's see-through
       jail set; the roof is solidfloor + BlockRain + transparentFloor.
       The roof panel is what shelters crops: the engine treats every square
       under it as indoors (lua/shared/KNXGreenhouse.lua). Its entity has an
       empty ground layer and the panel on the layer above, so it is built from
       the ground straight onto the tops of the walls. */
    entity KNX_GreenhouseWall
    {
        component UiConfig
        {
            xuiSkin = default,
            entityStyle = ES_KNX_GreenhouseWall,
            uiEnabled = false,
        }
        component SpriteConfig
        {
            LogicClass = WoodenWall,
            health = 200,
            skillBaseHealth = 20,
            BreakSound = SmashWindow,
            face W
            {
                layer
                {
                    row = badlands_greenhouse_01_0,
                }
            }
            face N
            {
                layer
                {
                    row = badlands_greenhouse_01_1,
                }
            }
            corner = badlands_greenhouse_01_3,
        }
        component CraftRecipe
        {
            timedAction = BuildWallHammer,
            time = 200,
            category = Carpentry,
            Tags = Carpentry,
            SkillRequired = Woodwork:3,
            xpAward = Woodwork:20,
            Tooltip = Tooltip_craft_KNX_GreenhouseWallDesc,
            inputs
            {
                item 1 tags[base:hammer] mode:keep flags[Prop1;MayDegradeVeryLight],
                item 2 [Base.GlassPanel],
                item 2 [Base.Plank],
                item 4 [Base.Nails],
            }
        }
    }

    entity KNX_GreenhouseDoor
    {
        component UiConfig
        {
            xuiSkin = default,
            entityStyle = ES_KNX_GreenhouseDoor,
            uiEnabled = false,
        }
        component SpriteConfig
        {
            skillBaseHealth = 150,
            dontNeedFrame = true,
            BreakSound = SmashWindow,
            face W
            {
                layer
                {
                    row = badlands_greenhouse_01_4,
                }
            }
            face N
            {
                layer
                {
                    row = badlands_greenhouse_01_5,
                }
            }
            face W_OPEN
            {
                layer
                {
                    row = badlands_greenhouse_01_6,
                }
            }
            face N_OPEN
            {
                layer
                {
                    row = badlands_greenhouse_01_7,
                }
            }
        }
        component CraftRecipe
        {
            timedAction = BuildWoodenStructureSmall,
            time = 200,
            category = Carpentry,
            Tags = Carpentry,
            SkillRequired = Woodwork:3,
            xpAward = Woodwork:30,
            Tooltip = Tooltip_craft_KNX_GreenhouseDoorDesc,
            inputs
            {
                item 1 tags[base:hammer] mode:keep flags[Prop1;MayDegradeVeryLight],
                item 2 [Base.GlassPanel],
                item 2 [Base.Plank],
                item 6 [Base.Nails],
                item 2 [Base.Hinge],
                item 1 [Base.Doorknob],
            }
        }
    }

    entity KNX_GreenhouseRoof
    {
        component UiConfig
        {
            xuiSkin = default,
            entityStyle = ES_KNX_GreenhouseRoof,
            uiEnabled = false,
        }
        component SpriteConfig
        {
            isThumpable = false,
            OnIsValid = KNXGreenhouse.RoofOnIsValid,
            OnCreate = BuildRecipeCode.floor.OnCreate,
            face W
            {
                layer
                {
                    row = false,
                }
                layer
                {
                    row = badlands_ghroof_01_0,
                }
            }
        }
        component CraftRecipe
        {
            timedAction = BuildWallHammer,
            time = 200,
            category = Carpentry,
            Tags = Carpentry,
            SkillRequired = Woodwork:4,
            xpAward = Woodwork:25,
            Tooltip = Tooltip_craft_KNX_GreenhouseRoofDesc,
            inputs
            {
                item 1 tags[base:hammer] mode:keep flags[Prop1;MayDegradeVeryLight],
                item 2 [Base.GlassPanel],
                item 2 [Base.Plank],
                item 4 [Base.Nails],
            }
        }
    }
}
