2019-02-15 20:17:30 -08:00
|
|
|
if interopG then
|
|
|
|
return interopG
|
|
|
|
end
|
2017-05-06 02:03:28 -07:00
|
|
|
local interop = {}
|
|
|
|
|
2018-02-09 23:57:04 -08:00
|
|
|
local unitGroupUtils = require("UnitGroupUtils")
|
|
|
|
|
2017-05-06 02:03:28 -07:00
|
|
|
function interop.addAIPoints(value)
|
|
|
|
global.natives.points = global.natives.points + value
|
|
|
|
end
|
|
|
|
|
|
|
|
function interop.getAIPoints()
|
|
|
|
return global.natives.points
|
|
|
|
end
|
|
|
|
|
2017-05-13 20:23:25 -07:00
|
|
|
function interop.setNocturnalMode(flag)
|
|
|
|
global.natives.aiNocturnalMode = flag
|
|
|
|
end
|
|
|
|
|
|
|
|
function interop.getNocturnalMode()
|
|
|
|
return global.natives.aiNocturnalMode
|
|
|
|
end
|
|
|
|
|
|
|
|
function interop.setPointsPerCycleScaling(scale)
|
|
|
|
global.natives.aiPointsScaler = scale
|
|
|
|
end
|
|
|
|
|
|
|
|
function interop.getPointsPerCycleScaling()
|
|
|
|
return global.natives.aiPointsScaler
|
|
|
|
end
|
|
|
|
|
2017-05-06 02:03:28 -07:00
|
|
|
function interop.changeState(aiState)
|
|
|
|
global.natives.state = aiState
|
|
|
|
end
|
|
|
|
|
|
|
|
function interop.getState()
|
|
|
|
return global.natives.state
|
|
|
|
end
|
|
|
|
|
|
|
|
function interop.getNextStateTick()
|
|
|
|
return global.natives.stateTick
|
|
|
|
end
|
|
|
|
|
|
|
|
function interop.getMaxWaveSize()
|
2018-10-15 19:52:55 -07:00
|
|
|
return global.natives.attackWaveMaxSize
|
2017-05-06 02:03:28 -07:00
|
|
|
end
|
|
|
|
|
|
|
|
function interop.getThresholds()
|
|
|
|
return global.natives.attackThresholdMin, global.natives.attackThresholdMax
|
|
|
|
end
|
|
|
|
|
|
|
|
function interop.changeMaxWaveSize(waveSize)
|
2018-10-15 19:52:55 -07:00
|
|
|
global.natives.attackWaveMaxSize = waveSize
|
2017-05-06 02:03:28 -07:00
|
|
|
end
|
|
|
|
|
|
|
|
function interop.changeThreshold(min, max)
|
|
|
|
global.natives.attackThresholdMin = min
|
|
|
|
global.natives.attackThresholdMax = max
|
|
|
|
global.natives.attackThresholdRange = max - min
|
|
|
|
end
|
|
|
|
|
|
|
|
function interop.changePlayerThreshold(value)
|
|
|
|
global.natives.attackPlayerThreshold = value
|
|
|
|
end
|
|
|
|
|
|
|
|
function interop.getPlayerThreshold()
|
|
|
|
return global.natives.attackPlayerThreshold
|
|
|
|
end
|
|
|
|
|
|
|
|
function interop.changeAttackUsePollution(bool)
|
|
|
|
global.natives.attackUsePollution = bool
|
|
|
|
end
|
|
|
|
|
|
|
|
function interop.changeAttackUsePlayer(bool)
|
|
|
|
global.natives.attackUsePlayer = bool
|
|
|
|
end
|
|
|
|
|
|
|
|
function interop.getAttackUsePollution()
|
|
|
|
return global.natives.attackUsePollution
|
|
|
|
end
|
|
|
|
|
|
|
|
function interop.getAttackUsePlayer()
|
|
|
|
return global.natives.attackUsePlayer
|
|
|
|
end
|
|
|
|
|
2018-02-09 23:57:04 -08:00
|
|
|
function interop.registerUnitGroup(unitGroup)
|
2019-03-06 22:12:39 -08:00
|
|
|
unitGroupUtils.createSquad(unitGroup.position, unitGroup.surface, unitGroup)
|
2018-02-09 23:57:04 -08:00
|
|
|
end
|
|
|
|
|
2019-02-15 20:17:30 -08:00
|
|
|
interopG = interop
|
2017-05-06 02:03:28 -07:00
|
|
|
return interop
|