-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathplanetScript.lua
More file actions
24 lines (23 loc) · 871 Bytes
/
planetScript.lua
File metadata and controls
24 lines (23 loc) · 871 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
ma_planete = nil
flottes = nil
function AI(ma_planete2, flottes2)
if(ma_planete2.buildingList[Building.CommandCenter] < 5) then
if(ma_planete2.buildingList[Building.CommandCenter] <= ma_planete2.buildingList[Building.Factory]) then
return makeBuilding(Building.CommandCenter)
end
if(ma_planete2.buildingList[Building.MetalMine] < ma_planete2.buildingList[Building.CommandCenter]) then
return makeBuilding(Building.MetalMine)
end
if(ma_planete2.buildingList[Building.Factory] < ma_planete2.buildingList[Building.CommandCenter]) then
return makeBuilding(Building.Factory)
end
end
if(ma_planete2.ressourceSet:at(Ressource.Metal) >= 2000) then
if(math.random(10) == 1) then
return makeShip(Ship.Queen)
else
return makeShip(Ship.Mosquito)
end
end
return noPlanetAction()
end