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 4 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 @@ -796,6 +796,7 @@ function UnitDef_Post(name, uDef)

categories["ALL"] = function() return true end
categories["MOBILE"] = function(uDef) return uDef.speed and uDef.speed > 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.
SethDGamre marked this conversation as resolved.
Show resolved Hide resolved
categories["NOTMOBILE"] = function(uDef) return not categories.MOBILE(uDef) end
categories["WEAPON"] = function(uDef) return uDef.weapondefs ~= nil end
categories["NOWEAPON"] = function(uDef) return not categories.WEAPON(uDef) end
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