Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function gadget:GetInfo()
- return {
- name = "AoS Mode",
- desc = "AoS Mode",
- author = "sprung",
- date = "25/8/2012",
- license = "PD",
- layer = 1,
- enabled = true,
- }
- end
- if (not gadgetHandler:IsSyncedCode()) then
- return
- end
- --[[if (tobool(Spring.GetModOptions().aos) == false) then
- return
- end]]
- local hq0
- local hq1
- local edge_dist = 1000 -- cc
- local edge_dist2 = 1200 -- spawnpoint
- function gadget:UnitCreated(unitID, unitDefID, unitTeam)
- Spring.SetUnitBuildSpeed(unitID, 0, UnitDefs[unitDefID].repairSpeed, UnitDefs[unitDefID].reclaimSpeed, 0, 0, UnitDefs[unitDefID].terraformSpeed)
- -- blocks building and rez
- end
- function gadget:UnitDestroyed(unitID, unitDefID, unitTeam)
- if(unitID == hq0) then Spring.GameOver({1})
- elseif (unitID == hq1) then Spring.GameOver({0})
- else
- _,_,_,_,_,allyteam = Spring.GetTeamInfo(unitTeam)
- if(allyteam == 0) then Spring.CreateUnit(UnitDefs[unitDefID].name, edge_dist2, Spring.GetGroundHeight(edge_dist2, edge_dist2), edge_dist2, 0, unitTeam)
- else Spring.CreateUnit(UnitDefs[unitDefID].name, Game.mapSizeX - edge_dist2, Spring.GetGroundHeight(Game.mapSizeX - edge_dist2, Game.mapSizeZ - edge_dist2), Game.mapSizeZ - edge_dist2, 2, unitTeam)
- end
- end
- end
- function gadget:GameStart()
- local team1 = Spring.GetTeamList(0)[1]
- local team2 = Spring.GetTeamList(1)[1]
- hq0 = Spring.CreateUnit("pw_hq", edge_dist, Spring.GetGroundHeight(edge_dist, edge_dist), edge_dist, 0, team1)
- hq1 = Spring.CreateUnit("pw_hq", Game.mapSizeX - edge_dist, Spring.GetGroundHeight(Game.mapSizeX - edge_dist, Game.mapSizeZ - edge_dist), Game.mapSizeZ - edge_dist, 2, team2)
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement