import plus
import math
import Levels
	
class Level8(Levels.SuperLevel):
    "Level 8 Machines are bigger in Texas."
    name = "Level 8"
    preview = "Levels/Level8/cowboy_preview.bmp"
    mission_index = 8
    
    def __init__(self):
        Levels.SuperLevel.__init__(self)

        self.startpoint = (65, 85)
        self.startrotation = (0, 0, 0)
            
        self.AddTerrain("resources\\Levels\\Heightmap\\cowboy_hightmap.bmp", 128, 7, 128, "resources\\Levels\\Ground_Textures\\cowboy.tga", "resources\\Levels\\Ground_Textures\\dirt1.tga", 1, 1, "resources\\Levels\\Ground_Textures\\dirt4.tga")
        self.AddTerrainPanels("resources\\Levels\\Ground_Textures\\tile.bmp");
    
        self.AddSkybox("resources\\Levels\\SkyBox\\sky_left2.bmp", "resources\\Levels\\SkyBox\\sky_right2.bmp", "resources\\Levels\\SkyBox\\sky_front2.bmp", "resources\\Levels\\SkyBox\\sky_back2.bmp", "resources\\Levels\\SkyBox\\sky_top2.bmp")
        self.AddCloudPlane("resources\\Levels\\SkyBox\\cloud_map1.tga", 165.0, 0.002)
        self.AddSun(0.31, "Resources\\Levels\\Billboards\\Sun.tga", 0.5, 0.7, 0.7, 0.7)
        self.AddLensFlareLayer("Resources\\Levels\\Billboards\\lens1.bmp", 1.0, 3.0)
        self.AddLensFlareLayer("Resources\\Levels\\Billboards\\lens2.bmp", 2.0, 0.5)
        self.AddLensFlareLayer("Resources\\Levels\\Billboards\\lens1.bmp", 3.0, 0.25)
        self.AddLensFlareLayer("Resources\\Levels\\Billboards\\lens3.bmp", 8.0, 1.0)
        self.AddLensFlareLayer("Resources\\Levels\\Billboards\\lens1.bmp", -2.0, 0.5)
        self.AddLensFlareLayer("Resources\\Levels\\Billboards\\lens4.bmp", -4.0, 0.25)
        self.AddLensFlareLayer("Resources\\Levels\\Billboards\\lens1.bmp", -5.5, 0.25)
      
        self.AddOctagon(8, 250.0, 35.0)
        self.SetOctagonTexture(0, "Resources\\Levels\\Billboards\\Oct1PNL1V2.tga")
        self.SetOctagonTexture(1, "Resources\\Levels\\Billboards\\Oct1PNL1V2_P1.tga")
        self.SetOctagonTexture(2, "Resources\\Levels\\Billboards\\Oct1PNL1V2.tga")
        self.SetOctagonTexture(3, "Resources\\Levels\\Billboards\\Oct1PNL1V2_P1.tga")
        self.SetOctagonTexture(4, "Resources\\Levels\\Billboards\\Oct1PNL1V2.tga")
        self.SetOctagonTexture(5, "Resources\\Levels\\Billboards\\Oct1PNL1V2_P1.tga")
        self.SetOctagonTexture(6, "Resources\\Levels\\Billboards\\Oct1PNL1V2.tga")
	self.SetOctagonTexture(7, "Resources\\Levels\\Billboards\\Oct1PNL1V2_P1.tga")
    
    
        self.SetTreePlacementBitmap("resources\\Levels\\TreeMaps\\tree_map_level8.bmp")
        self.AssignTreeToColor("resources\\Levels\\Billboards\\tree_3.tga", (172, 172, 172), 1.0, 3.3, 1, 25.0)
        self.AssignTreeToColor("resources\\Levels\\Billboards\\tree_4.tga", (0, 255, 0), 2.0, 4.3, 1, 25.0)
        self.AssignTreeToColor("resources\\Levels\\Billboards\\tree_2.tga", (255, 0, 0), 2.0, 3.3, 1, 25.0)
        self.AssignTreeToColor("resources\\Levels\\Billboards\\shrub2.tga", (255, 255, 0), 1.0,1.8, 0, 25.0)
        self.AssignTreeToColor("resources\\Levels\\Billboards\\pinetree.tga", (0, 0, 255), 1.0,1.8, 1, 25.0)
        self.AssignTreeToColor("resources\\Levels\\Billboards\\shrub.tga", (255, 255, 255), 1.0,1.8, 0, 25.0)        
        self.PlaceTrees()
        
        self.AddPlacementZone(0, (5.5 ,8.0 , 5.5 ), (44.6, 19.5, 41.0 ))
        self.AddPlacementZone(0, (5.5 ,8.0 , 5.5 ), (51.0, 19.5, 41.0 ))
        self.AddPlacementZone(0, (5.5 ,8.0 , 5.5 ), (60.5, 19.5, 41.0 ))
        self.AddPlacementZone(0, (5.5 ,8.0 , 5.5 ), (66.8, 19.5, 41.0 ))
        self.AddPlacementZone(0, (5.5 ,8.0 , 5.5 ), (74.8, 19.5, 41.0 ))
        self.AddPlacementZone(0, (5.5 ,8.0 , 5.5 ), (81.3, 19.5, 41.0 ))
        self.AddPlacementZone(0, (5.5 ,8.0 , 5.5 ), (90.6, 19.5, 41.0 ))
        self.AddPlacementZone(0, (5.5 ,8.0 , 5.5 ), (97.3, 19.5, 41.0 ))
        
        self.SetHelpArrowPosition(0, 44.6, 19.5, 41.0, 0.0)
        self.SetHelpArrowPosition(1, 51.0, 19.5, 41.0, 0.0)
        self.SetHelpArrowPosition(2, 60.5, 19.5, 41.0, 0.0)
        self.SetHelpArrowPosition(3, 66.8, 19.5, 41.0, 0.0)
        self.SetHelpArrowPosition(4, 74.8, 19.5, 41.0, 0.0)
        self.SetHelpArrowPosition(5, 81.3, 19.5, 41.0, 0.0)
        self.SetHelpArrowPosition(6, 90.6, 19.5, 41.0, 0.0)
        self.SetHelpArrowPosition(7, 97.3, 19.5, 41.0, 0.0)
        
        import Level8_features
        Level8_features.setup(self)
        
        self.DisableBuildingEdgeDetection()
        import Level8_fence
        Level8_fence.setup(self)
        self.EnableBuildingEdgeDetection()
	
        fmod = .015
        # static cameras
        #self.AddStaticCamera("Static 1", (17.7, 11, 40), (.367, -.576), fmod*50)
        self.AddStaticCamera("Static 1", (-1, 29, 44), (.37, 1.39), math.pi / 4)
        self.AddStaticCamera("Static 2", (43.6, 24.5, 100), (.36, 2.07), math.pi / 4)
        self.AddStaticCamera("Static 3", (6.5, 37, 66), (.62, 1.98), math.pi / 4)
        
        # watch camera
        self.AddWatchCamera("Watch 1", (20, 28, 85), (2.0, 15.0, fmod*40, fmod*25))
        self.AddWatchCamera("Watch 2", (58.6, 40, 100), (30.0, 30.0, fmod*40, fmod*40))

            
Levels.register(Level8)