from __future__ import generators
import plus
import Arenas
import random
import Hazards
import math


class BoxArena(Arenas.SuperArena):
    "Battle inside a giant hamster ball!  Be careful not to get flipped when it rolls, or you could land helpless in the middle of a pack of hungry robots."
    name = "DSL Hamster Ball of Doom"
    preview = "Hamster/test2_preview.bmp"
    game_types = ['OBSTACLE COURSE']
    extent = (-45, 25, 45, -25)

    def __init__(self):
        Arenas.SuperArena.__init__(self, "Arenas/Hamster/test2.gmf")
        #plus.Arena.__init__(self, "")
        plus.setBackColor(0,0,0)
        degrad = 0.01745
        #self.AddStaticCamera("Static 1", (10.8, 6.6, -17.04), (.367, -40*degrad), degrad*55)
        self.AddStaticCamera("Static 2", (0, 99, 0), (90*degrad, 90*degrad), degrad*120)
        #self.AddStaticCamera("Static 3", (0, 7.8, -18), (40*degrad, 0), degrad*62)

	self.AddWatchCamera("Watch Cam 1", (-24, 15, 18), (12, 20, 30*degrad, 20*degrad))
	self.AddWatchCamera("Watch Cam 2", (24, 15, -18), (12, 20, 30*degrad, 20*degrad))
	self.AddWatchCamera("Watch Cam 3", (10, 20, 10), (14, 22, 30*degrad, 30*degrad))
	self.AddWatchCamera("Watch Cam 4", (-10, 20, -10), (16, 24, 30*degrad, 40*degrad))
	
        self.players = ()

        
    def AddShadowReceivers(self):
        self.SetShadowSource(5.897, 19.159, 5.899)
        
        #Main Arena Floor Shadow Triangles
        self.AddShadowTriangle((-10.2877,0.051,1.83754), (-12.4182,0.051,12.4283), (-12.4182,0.051,1.83754))

        
    def HazardsOn(self, on):
	

	return Arenas.SuperArena.HazardsOn(self, on)

    def Activate(self, on):
        if on: self.players = plus.getPlayers()
        
        Arenas.SuperArena.Activate(self, on)


    def ZoneEvent(self, direction, id, robot, chassis):
   
        return True

    def Tick(self):
	

        return Arenas.SuperArena.Tick(self)
        
Arenas.register(BoxArena)
