import pygame
from pygame.locals import *
from random import *
from Video import Video
from Civ import Civ
from math import *

class Wave(object): 
    def __init__(self,lmap,force):
        self.force = int(force)
        self.r = 0
        self.lmap = lmap
        facteur = 1
        self.maxR = round(sqrt(pow(round(self.lmap.width*facteur/2),2)+pow(round(self.lmap.height*facteur/2),2)))
        print("Earthquake ! Force "+str(force))
        self.epicentre()
        #print("Rayon max = "+str(self.maxR))

    def progress(self):
        self.r += 1
        return self.r>self.maxR

    def epicentre(self):
        self.lmap.units[int(self.lmap.width/2) + int(self.lmap.height/2)*self.lmap.width] = 0
    
