import plus
import math
import Levels
	
class Level1Roadway(Levels.SuperLevel):
    "Level 1 - Roadway is a level with a roadway in it."
    name = "Level 1 - Roadway"
    preview = "Levels/Level1Roadway/roadway_preview.tga"
    mission_index = 0
    
    def __init__(self):
        Levels.SuperLevel.__init__(self)
        
        self.startpoint = (32, 38.5)
        self.startrotation = (-math.pi / 2.0, 0, 0)
        
        self.AddTerrain("resources\\Levels\\Heightmap\\roadway.bmp", 128, 5, 128, "resources\\Levels\\Ground_Textures\\terrain_level1.tga", "resources\\Levels\\Ground_Textures\\dirt1.tga", 1, 1, "resources\\Levels\\Ground_Textures\\dirt4.tga")
        self.AddTerrainPanels("resources\\Levels\\Ground_Textures\\tile.bmp");
        
        self.AddTerrainEdgeOverlay("Resources\\Levels\\Ground_Textures\\RoadExt.bmp", (-400.0,0.0,37.4),(0.1, 0.0, 37.4), 11.0)
        self.AddTerrainEdgeOverlay("Resources\\Levels\\Ground_Textures\\RoadExt.bmp", (127.9, 0.0, 37.4),(528.0,0.0,37.4), 11.0)
        self.AddTerrainEdgeOverlay("Resources\\Levels\\Ground_Textures\\RoadExt.bmp", (62.1,0.0, 528.0), (62.1, 0.0, 127.9), 11.0)
        
        self.AddSkybox("resources\\Levels\\SkyBox\\sky_left.bmp", "resources\\Levels\\SkyBox\\sky_right.bmp", "resources\\Levels\\SkyBox\\sky_front.bmp", "resources\\Levels\\SkyBox\\sky_back.bmp", "resources\\Levels\\SkyBox\\sky_top.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(11, 200.0, 25.0)
        self.SetOctagonTexture(0, "Resources\\Levels\\Billboards\\TreePannel1.tga")
        self.SetOctagonTexture(1, "Resources\\Levels\\Billboards\\TreePannel1.tga")
        self.SetOctagonTexture(2, "Resources\\Levels\\Billboards\\TreePannel1.tga")
        self.SetOctagonTexture(3, "Resources\\Levels\\Billboards\\TreePannel1.tga")
        self.SetOctagonTexture(4, "Resources\\Levels\\Billboards\\TreePannel1.tga")
        self.SetOctagonTexture(5, "Resources\\Levels\\Billboards\\TreePannel1.tga")
        self.SetOctagonTexture(6, "Resources\\Levels\\Billboards\\TreePannel1.tga")
        self.SetOctagonTexture(7, "Resources\\Levels\\Billboards\\TreePannel1.tga")
        self.SetOctagonTexture(8, "Resources\\Levels\\Billboards\\TreePannel1.tga")
        self.SetOctagonTexture(9, "Resources\\Levels\\Billboards\\TreePannel1.tga")
        self.SetOctagonTexture(10, "Resources\\Levels\\Billboards\\TreePannel1.tga")
        
        self.SetTreePlacementBitmap("resources\\Levels\\TreeMaps\\tree_map_level1.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.AddDumpZone(58.5 , 65.3, 63.0, 76.4)
        
        import Level1Roadway_features
        Level1Roadway_features.setup(self)

        self.DisableBuildingEdgeDetection()
        import Level1roadway_fence
        Level1roadway_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", (-5, 26, 21.8), (.375, 1.045), math.pi / 4)
        self.AddStaticCamera("Static 2", (107, 27, 5.4), (.4, -.775), math.pi / 4)
        self.AddStaticCamera("Static 3", (40.75, 27.9, 56.9), (.475, 1.155), math.pi / 4)
        self.AddStaticCamera("Static 4", (49, 22.5, 98.7), (.275, 2.78), math.pi / 4)
        
        # watch camera
        self.AddWatchCamera("Watch 1", (62, 22, 21), (2.0, 30.0, fmod*60, fmod*25))
        self.AddWatchCamera("Watch 2", (20, 28, 85), (2.0, 15.0, fmod*40, fmod*25))
        self.AddWatchCamera("Watch 3", (87, 20, 70), (2.0, 30.0, fmod*60, fmod*25))
        
        
Levels.register(Level1Roadway)