Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add new target category, add it to auto trajectory units #4162

Draft
wants to merge 5 commits into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions gamedata/alldefs_post.lua
Original file line number Diff line number Diff line change
Expand Up @@ -812,6 +812,7 @@ function UnitDef_Post(name, uDef)
categories["MINE"] = function(uDef) return uDef.weapondefs and uDef.weapondefs.minerange end
categories["COMMANDER"] = function(uDef) return commanderList[uDef.movementclass] end
categories["EMPABLE"] = function(uDef) return categories.SURFACE(uDef) and uDef.customparams and uDef.customparams.paralyzemultiplier ~= 0 end
categories["FASTSURFACE"] = function(uDef) return uDef.speed and uDef.speed > 78 and not (categories.UNDERWATER(uDef) and categories.MOBILE(uDef)) and not categories.VTOL(uDef) end --78 is the speed of rezbots, the fastest intentional exclusion.

uDef.category = uDef.category or ""
if not string.find(uDef.category, "OBJECT") then -- objects should not be targetable and therefore are not assigned any other category
Expand Down
6 changes: 3 additions & 3 deletions units/ArmBuildings/LandDefenceOffence/armamb.lua
Original file line number Diff line number Diff line change
Expand Up @@ -208,19 +208,19 @@ return {
},
weapons = {
[1] = {
badtargetcategory = "VTOL GROUNDSCOUT",
badtargetcategory = "FASTSURFACE",
def = "ARMAMB_GUN",
maindir = "0 1 0",
maxangledif = 230,
onlytargetcategory = "SURFACE",
},
[2] = {
badtargetcategory = "VTOL GROUNDSCOUT",
badtargetcategory = "FASTSURFACE",
def = "ARMAMB_GUN_HIGH",
onlytargetcategory = "SURFACE",
},
[3] = {
badtargetcategory = "VTOL GROUNDSCOUT",
badtargetcategory = "FASTSURFACE",
def = "smart_trajectory_dummy",
maindir = "0 1 0",
maxangledif = 230,
Expand Down
3 changes: 2 additions & 1 deletion units/ArmBuildings/LandDefenceOffence/armguard.lua
Original file line number Diff line number Diff line change
Expand Up @@ -200,13 +200,14 @@ return {
},
weapons = {
[1] = {
badtargetcategory = "VTOL",
badtargetcategory = "FASTSURFACE",
def = "PLASMA",
maindir = "0 1 0",
maxangledif = 230,
onlytargetcategory = "SURFACE",
},
[2] = {
badtargetcategory = "FASTSURFACE",
def = "PLASMA_HIGH",
onlytargetcategory = "SURFACE",
},
Expand Down
6 changes: 3 additions & 3 deletions units/ArmGantry/armvang.lua
Original file line number Diff line number Diff line change
Expand Up @@ -220,17 +220,17 @@ return {
},
weapons = {
[1] = {
badtargetcategory = "VTOL GROUNDSCOUT",
badtargetcategory = "FASTSURFACE",
def = "SHOCKER_LOW",
onlytargetcategory = "SURFACE",
},
[2] = {
badtargetcategory = "VTOL GROUNDSCOUT",
badtargetcategory = "FASTSURFACE",
def = "SHOCKER_HIGH",
onlytargetcategory = "SURFACE",
},
[3] = {
badtargetcategory = "VTOL GROUNDSCOUT",
badtargetcategory = "FASTSURFACE",
def = "smart_trajectory_dummy",
onlytargetcategory = "SURFACE",
},
Expand Down
5 changes: 3 additions & 2 deletions units/CorBuildings/LandDefenceOffence/corpun.lua
Original file line number Diff line number Diff line change
Expand Up @@ -202,18 +202,19 @@ return {
},
weapons = {
[1] = {
badtargetcategory = "VTOL",
badtargetcategory = "FASTSURFACE",
def = "PLASMA",
maindir = "0 1 0",
maxangledif = 230,
onlytargetcategory = "SURFACE",
},
[2] = {
badtargetcategory = "FASTSURFACE",
def = "PLASMA_HIGH",
onlytargetcategory = "SURFACE",
},
[3] = {
badtargetcategory = "VTOL",
badtargetcategory = "FASTSURFACE",
def = "smart_trajectory_dummy",
maindir = "0 1 0",
maxangledif = 230,
Expand Down
6 changes: 3 additions & 3 deletions units/CorBuildings/LandDefenceOffence/cortoast.lua
Original file line number Diff line number Diff line change
Expand Up @@ -209,19 +209,19 @@ return {
},
weapons = {
[1] = {
badtargetcategory = "VTOL GROUNDSCOUT",
badtargetcategory = "FASTSURFACE",
def = "CORTOAST_GUN",
maindir = "0 1 0",
maxangledif = 230,
onlytargetcategory = "SURFACE",
},
[2] = {
badtargetcategory = "VTOL GROUNDSCOUT",
badtargetcategory = "FASTSURFACE",
def = "CORTOAST_GUN_HIGH",
onlytargetcategory = "SURFACE",
},
[3] = {
badtargetcategory = "VTOL GROUNDSCOUT",
badtargetcategory = "FASTSURFACE",
def = "smart_trajectory_dummy",
maindir = "0 1 0",
maxangledif = 230,
Expand Down
5 changes: 3 additions & 2 deletions units/Legion/Defenses/legacluster.lua
Original file line number Diff line number Diff line change
Expand Up @@ -247,18 +247,19 @@ return {
},
weapons = {
[1] = {
badtargetcategory = "VTOL",
badtargetcategory = "FASTSURFACE",
def = "PLASMA",
maindir = "0 1 0",
maxangledif = 230,
onlytargetcategory = "SURFACE",
},
[2] = {
badtargetcategory = "FASTSURFACE",
def = "PLASMA_HIGH",
onlytargetcategory = "SURFACE",
},
[3] = {
badtargetcategory = "VTOL",
badtargetcategory = "FASTSURFACE",
def = "smart_trajectory_dummy",
maindir = "0 1 0",
maxangledif = 230,
Expand Down
5 changes: 3 additions & 2 deletions units/Legion/Defenses/legcluster.lua
Original file line number Diff line number Diff line change
Expand Up @@ -234,18 +234,19 @@ return {
},
weapons = {
[1] = {
badtargetcategory = "VTOL",
badtargetcategory = "FASTSURFACE",
def = "PLASMA",
maindir = "0 1 0",
maxangledif = 230,
onlytargetcategory = "SURFACE",
},
[2] = {
badtargetcategory = "FASTSURFACE",
def = "PLASMA_HIGH",
onlytargetcategory = "SURFACE",
},
[3] = {
badtargetcategory = "VTOL",
badtargetcategory = "FASTSURFACE",
def = "smart_trajectory_dummy",
maindir = "0 1 0",
maxangledif = 230,
Expand Down