Skip to content

Commit

Permalink
Remove control point modoptions (#2744)
Browse files Browse the repository at this point in the history
  • Loading branch information
thehobojoe authored Mar 19, 2024
1 parent 67997fb commit 552639a
Show file tree
Hide file tree
Showing 26 changed files with 39 additions and 3,139 deletions.
51 changes: 0 additions & 51 deletions gamedata/alldefs_post.lua
Original file line number Diff line number Diff line change
Expand Up @@ -138,57 +138,6 @@ function UnitDef_Post(name, uDef)
end
end

-- Control Mode Tweaks
if modOptions.scoremode ~= "disabled" then
if modOptions.scoremode_chess == true then
-- Disable Wrecks
uDef.corpse = nil
-- Disable Bad Units
local factories = {
armaap = true,
armalab = true,
armap = true,
armavp = true,
armhp = true,
armlab = true,
armshltx = true,
armvp = true,
armamsub = true,
armasy = true,
armfhp = true,
armplat = true,
armshltxuw = true,
armsy = true,
coraap = true,
coralab = true,
corap = true,
coravp = true,
corgant = true,
corhp = true,
corlab = true,
corvp = true,
coramsub = true,
corasy = true,
corfhp = true,
corplat = true,
corgantuw = true,
corsy = true,
armapt3 = true, -- scav T3 air factory
corapt3 = true, -- scav T3 air factory
armnanotc = true,
armnanotcplat = true,
cornanotc = true,
cornanotcplat = true,
armbotrail = true, -- it spawns units so it will add dead launched peewees to respawn queue.
}
if factories[name] then
uDef.maxthisunit = 0
end
else

end
end

-- test New sound system!
--VFS.Include('luarules/configs/gui_soundeffects.lua')
--if not (GUIUnitSoundEffects[name] or (GUIUnitSoundEffects[string.sub(name, 1, string.len(name)-5)] and string.find(name, "_scav"))) then
Expand Down
8 changes: 0 additions & 8 deletions luaai.lua
Original file line number Diff line number Diff line change
Expand Up @@ -24,18 +24,10 @@ return {
name = 'ScavengersAI',
desc = 'Infinite Games'
},
-- {
-- name = 'ScavReduxAI',
-- desc = 'Infinite Games'
-- },
{
name = 'STAI',
desc = 'Medium AI by @pandaro',
},
-- {
-- name = 'ControlModeAI',
-- desc = 'AI designed for Control Points gamemode, stays idle if control mode is disabled',
-- },
{
name = 'Shard',
desc = 'Shard - Basic Shard AI'
Expand Down
6 changes: 1 addition & 5 deletions luarules/gadgets/ai/Shard/behaviours.lua
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
shard_include( "taskqueues" )
shard_include( "taskqueuebehaviour" )
shard_include( "attackerbehaviour" )
shard_include( "pointcapturerbehaviour" )
shard_include( "bootbehaviour" )

function defaultBehaviours(unit, ai)
Expand All @@ -15,14 +14,11 @@ function defaultBehaviours(unit, ai)
if u:CanBuild() then
table.insert(b,TaskQueueBehaviour)
else
if IsPointCapturer(unit, ai) then
table.insert(b,PointCapturerBehaviour)
end
if IsAttacker(unit) then
table.insert(b,AttackerBehaviour)
end
end
return b
end

return { }
return { }
68 changes: 0 additions & 68 deletions luarules/gadgets/ai/Shard/capturerbehaviour.lua

This file was deleted.

39 changes: 0 additions & 39 deletions luarules/gadgets/ai/Shard/controlpointhandler.lua

This file was deleted.

3 changes: 1 addition & 2 deletions luarules/gadgets/ai/Shard/modules.lua
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
shard_include( "spothandler" )
shard_include( "controlpointhandler" )
shard_include( "unithandler" )
shard_include( "attackhandler" )
shard_include( "placementhandler" )
shard_include( "sleep" )

return { UnitHandler, AttackHandler, ControlPointHandler, MetalSpotHandler, PlacementHandler, Sleep }
return { UnitHandler, AttackHandler, MetalSpotHandler, PlacementHandler, Sleep }
68 changes: 0 additions & 68 deletions luarules/gadgets/ai/Shard/pointcapturerbehaviour.lua

This file was deleted.

12 changes: 0 additions & 12 deletions luarules/gadgets/ai/shard_runtime/shard_null/game.lua
Original file line number Diff line number Diff line change
Expand Up @@ -85,16 +85,4 @@ function game:GetResources() -- returns a table of Resource objects, takes the n
return {}
end

function game:UsesControlPoints()
return false
end

function game:ControlPointCaptureRadius()
return 0
end

function game:ControlPointNonCapturingUnits()
return {}
end

return game
14 changes: 2 additions & 12 deletions luarules/gadgets/ai/shard_runtime/shard_null/map.lua
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ function map:CanBuildHere(unittype,position) -- returns boolean
end

function map:GetMapFeatures()

return {}
end

Expand Down Expand Up @@ -61,16 +61,6 @@ function map:GetGeoSpots() -- returns a table of spot positions
return {}
end

function map:GetControlPoints()
-- not sure this can be implemented in the Spring C++ AI interface
return {}
end

function map:AreControlPoints()
-- not sure this can be implemented in the Spring C++ AI interface
return false
end

function map:MapDimensions() -- returns a Position holding the dimensions of the map
local m = game_engine:Map()
return m:MapDimensions()
Expand Down Expand Up @@ -165,4 +155,4 @@ end

-- game.map = map

return map
return map
14 changes: 1 addition & 13 deletions luarules/gadgets/ai/shard_runtime/spring_cpp/game.lua
Original file line number Diff line number Diff line change
Expand Up @@ -147,16 +147,4 @@ local game = {}
end
end

function game:UsesControlPoints()
return map:AreControlPoints()
end

function game:ControlPointCaptureRadius()
return 500
end

function game:ControlPointNonCapturingUnits()
return {}
end

return game
return game
12 changes: 1 addition & 11 deletions luarules/gadgets/ai/shard_runtime/spring_cpp/map.lua
Original file line number Diff line number Diff line change
Expand Up @@ -103,16 +103,6 @@ function map:GetMetalSpots() -- returns a table of spot positions
return f
end

function map:GetControlPoints()
-- not sure this can be implemented in the Spring C++ AI interface
return {}
end

function map:AreControlPoints()
-- not sure this can be implemented in the Spring C++ AI interface
return false
end

function map:MapDimensions() -- returns a Position holding the dimensions of the map
local m = game_engine:Map()
return m:MapDimensions()
Expand Down Expand Up @@ -237,4 +227,4 @@ end

-- game.map = map

return map
return map
1 change: 0 additions & 1 deletion luarules/gadgets/ai/shard_runtime/spring_lua/boot.lua
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,6 @@ local runtime_includes = {
"spring_lua/unittype",
"spring_lua/damage",
"spring_lua/feature",
"spring_lua/controlpoint"
}


Expand Down
Loading

0 comments on commit 552639a

Please sign in to comment.