function Initialise()
	
	SetData("Land.Indestructable", 1)
	SetData("TurnTime", 0)
    SetData("RoundTime",0)
    SetData("HUD.Clock.DisplayTenths", 1)
	SetData("HotSeatTime", 0) 
    SetData("RetreatTime", 0) 
SetData("HUD.Counter.Active", 1) 

	
	lib_SetupTeam(0, "PlayerTeam")
	lib_SetupWorm(0, "PlayerWorm")
	lib_SetupTeamInventory(0, "PlayerInventory")
	
	
	SendMessage("WormManager.Reinitialise")
    SendMessage("Commentary.NoDefault")



waterskill = 1
StartTimer("water",10000)
    StartFirstTurn()
end







function water()


SetData("Water.Level", GetData("Water.Level") + waterskill*3)
waterskill = waterskill+0.02
SetData("HUD.Counter.Value", waterskill) 

local worm = QueryContainer("Worm.Data00")   
if worm.Energy == 0 then
  SetData("Text.TestComment",'Unspawn')
  lib_Comment("Text.TestComment")
SendIntMessage("WXWormManager.UnspawnWorm",0)
else
StartTimer("water",100)
end


end








function TurnEnded()
        StartTurn()
    
end

function Worm_Died()
    
    deadworm = GetData("DeadWorm.Id")
    
    if deadworm == 0 then
    
SetData("Water.Level", 0)
SetData("HUD.Counter.Value", 0) 
waterskill = 0
StartTimer("water",10000)

        local lock, EditWorm = EditContainer(lib_GetWormContainerName(0))
        EditWorm.Energy = 100
        EditWorm.Active = true
        CloseContainer(lock)
        SendIntMessage("Worm.Respawn", 0)

       -- SendMessage("GameLogic.Challenge.Failure")
    end
end



