updated unit stats

configurable cruise missile stats
bugfix for incorrect projectile collision with the surface
This commit is contained in:
devZoGok
2026-05-13 19:06:02 +03:00
parent 63204751a1
commit c53eb2a022
10 changed files with 126 additions and 99 deletions
@@ -1,4 +1,5 @@
<model>
<node name="turret" px="0.0" py="4.0" pz="-0.0" rw="1.0" rx="0.0" ry="0.0" rz="0.0" sx="1.0" sy="1.0" sz="1.0"/>
<node name="WarRobotTemplate" px="0.0" py="0.0" pz="-0.0" rw="1.0" rx="0.0" ry="0.0" rz="0.0" sx="1.0" sy="1.0" sz="1.0">
<mesh name="WarRobotTemplateWarRobotTemplate" num_vertex_pos="248" num_faces="446" num_vertex_groups="0" num_shape_keys="0">
<vertdata px="0.7378405928611755" py="5.257974624633789" pz="-1.1475341320037842" nx="0.9317941665649414" ny="-0.11999237537384033" nz="0.34258049726486206" />
@@ -1,4 +1,5 @@
<model>
<node name="turret" px="0.0" py="4.0" pz="-0.0" rw="1.0" rx="0.0" ry="0.0" rz="0.0" sx="1.0" sy="1.0" sz="1.0"/>
<node name="MechAM" px="0.0" py="0.0" pz="-0.0" rw="1.0" rx="0.0" ry="0.0" rz="0.0" sx="1.0" sy="1.0" sz="1.0">
<mesh name="MechAMMesh" num_vertex_pos="2967" num_faces="5842" num_vertex_groups="0" num_shape_keys="0">
<vertdata px="-1.1444093388490728e-06" py="6.228968620300293" pz="-0.520443320274353" nx="-2.2832049580756575e-05" ny="-0.9999580979347229" nz="-0.00915344525128603" />
@@ -29429,4 +29430,4 @@
<vert id="854" uvx="0.5321128368377686" uvy="0.9579939246177673" tx="0.9414616227149963" ty="-0.081190325319767" tz="0.32719743251800537" bx="-0.15855565667152405" by="-0.963158369064331" bz="0.2172233909368515" />
</mesh>
</node>
</model>
</model>
@@ -1,4 +1,5 @@
<model>
<node name="turret" px="0.0" py="4.0" pz="-0.0" rw="1.0" rx="0.0" ry="0.0" rz="0.0" sx="1.0" sy="1.0" sz="1.0"/>
<node name="Ball-Deploy" px="1.529024729052253e-07" py="0.0" pz="-0.17927397787570953" rw="1.0" rx="0.0" ry="0.0" rz="0.0" sx="1.0" sy="1.0" sz="1.0">
<mesh name="Ball-DeployMesh" num_vertex_pos="2766" num_faces="5428" num_vertex_groups="0" num_shape_keys="0">
<vertdata px="-0.8366935849189758" py="4.260567665100098" pz="1.7702429294586182" nx="0.9396857619285583" ny="-0.0038162698037922382" nz="-0.34201779961586" />
@@ -21081,4 +21082,4 @@
<vert id="331" uvx="0.34078919887542725" uvy="0.3217828869819641" tx="-0.01096597220748663" ty="0.9829784631729126" tz="0.1833934485912323" bx="-0.988864004611969" by="-0.03788268193602562" bz="0.14392012357711792" />
</mesh>
</node>
</model>
</model>
+2 -2
View File
@@ -237,7 +237,7 @@ function Player:findSuitableSpot(buildingId, idealPos, radius)
structFrame:destroy()
return point
elseif structFrame.status == GameObjectFrameStatus.BLOCKED_BY_FOG_OF_WAR then
engis = self:getUnitsByClass(UnitClass.CYBORG_ENGINEER, -1)
engis = self:getUnitsByClass(UnitClass.ROBO_ENGINEER, -1)
for i = 1, #engis do
if engis[i]:getNumOrders() > 0 and engis[i]:getOrder(0).targets[1].pos:getDistanceFrom(point) < engis[i]:getLineOfSight() then
@@ -279,7 +279,7 @@ function Player:buildStructure(engineer, buildingId, buildPos, buildAngle)
end
function Player:findIdleEngineer()
engineers = self:getUnitsByClass(UnitClass.CYBORG_ENGINEER, -1)
engineers = self:getUnitsByClass(UnitClass.ROBO_ENGINEER, -1)
for i = 1, #engineers do
if engineers[i]:getNumOrders() == 0 then return engineers[i] end
+1 -1
View File
@@ -11,7 +11,7 @@ for i = 1, #game.cpuPlayers do
func = player.buildTaskForces,
args = {
factoryClass = UnitClass.LAND_FACTORY,
taskForceData = {{class = UnitClass.CYBORG_ENGINEER, numUnits = 5}}
taskForceData = {{class = UnitClass.ROBO_ENGINEER, numUnits = 5}}
}
},
{
@@ -1,4 +1,4 @@
ProjectileId = {HE_SHELL = 0, EMP_SHELL = 1, CRUISE_MISSILE = 2, MISSILE = 3, TORPEDO = 4, DEPTH_CHARGE = 5}
ProjectileId = {TANK_SHELL = 0, ANTI_SUB_CRUISER_SHELL = 1, EMP_SHELL = 2, CRUISE_MISSILE = 3, MISSILE = 4, TORPEDO = 5, DEPTH_CHARGE = 6}
ProjectileClass = {SHELL = 0, CRUISE_MISSILE = 1, MISSILE = 2, TORPEDO = 3, DEPTH_CHARGE = 4}
G = 9.8
@@ -36,6 +36,19 @@ projectiles = {
meshPath = "shell.xml",
albedoPath = 'shell.jpg'
},
{
projectileClass = ProjectileClass.SHELL,
size = {x = 1, y = 1, z = 1},
speed = 5,
rotAngle = .1,
explosion = {detonation = Detonation.EXPLOSION, damage = 100, radius = 20, fx = {explosionVfx, explosionSfx}},
directHitDamage = 80,
rayLength = 1,
name = "Shell",
basePath = PATH .. "Models/GameObjects/Projectiles/Shells/",
meshPath = "shell.xml",
albedoPath = 'shell.jpg'
},
{
projectileClass = ProjectileClass.SHELL,
size = {x = 1, y = 1, z = 1},
@@ -51,9 +64,11 @@ projectiles = {
},
{
projectileClass = ProjectileClass.CRUISE_MISSILE,
minDist = 6,
minHeight = 50,
health = 75,
size = {x = 6, y = 13.5, z = 2.54},
speed = .5,
speed = 1.5,
rotAngle = .1,
explosion = {detonation = Detonation.EXPLOSION, damage = 100, radius = 20, fx = {explosionVfx, explosionSfx}},
directHitDamage = 450,
@@ -71,7 +86,7 @@ projectiles = {
rotAngle = .1,
explosion = {detonation = Detonation.EXPLOSION, damage = 70, radius = 12, fx = {explosionVfx, explosionSfx}},
directHitDamage = 250,
rayLength = 3,
rayLength = 1.8,
name = "Missile",
basePath = PATH .. "Models/GameObjects/Projectiles/Missiles/",
meshPath = "missile.xml",
+88 -88
View File
@@ -129,8 +129,10 @@ units = {
{
orderType = OrderType.ATTACK,
rateOfFire = 100,
maxRange = 14,
maxRange = 40,
damage = 50,
maxFireAngle = .1,
nodes = {{name = 'turret', rotationSpeed = 0, angleConstraints = {min = -1.5, max = 1.5}, vertical = true}},
fireFx = {
{
vfx = true,
@@ -191,7 +193,7 @@ units = {
selectionSfx = PATH .. 'Sounds/Units/WarMechs/selection.ogg',
speed = .4,
destinationOffset = .1,
anglePrecision = .1,
anglePrecision = .01,
maxTurnAngle = .1,
garrisonCategory = 1,
deathFx = {explosionVfx, explosionSfx},
@@ -201,9 +203,10 @@ units = {
{
orderType = OrderType.ATTACK,
rateOfFire = 100,
maxRange = 14,
maxRange = 40,
damage = 50,
maxFireAngle = .15,
maxFireAngle = .1,
nodes = {{name = 'turret', rotationSpeed = 1, angleConstraints = {min = -1.5, max = 1.5}, vertical = true}},
fireFx = {
{
vfx = true,
@@ -248,6 +251,7 @@ units = {
unitClass = UnitClass.MECH,
unitType = UnitType.LAND,
armor = {ArmorType.MECHANIC},
alignToSurface = true,
maxUnevenness = .5,
isVehicle = true,
health = 500,
@@ -264,7 +268,7 @@ units = {
selectionSfx = PATH .. 'Sounds/Units/WarMechs/selection.ogg',
speed = .3,
destinationOffset = .1,
anglePrecision = .01,
anglePrecision = .1,
maxTurnAngle = .1,
garrisonCategory = 1,
deathFx = {explosionVfx, explosionSfx},
@@ -273,9 +277,11 @@ units = {
weapons = {
{
orderType = OrderType.ATTACK,
rateOfFire = 100,
maxRange = 14,
rateOfFire = 250,
maxRange = 40,
damage = 50,
maxFireAngle = .1,
nodes = {{name = 'turret', rotationSpeed = 1, angleConstraints = {min = -1.5, max = 1.5}, vertical = true}},
fireFx = {
{
vfx = true,
@@ -320,6 +326,7 @@ units = {
unitClass = UnitClass.MECH,
unitType = UnitType.LAND,
armor = {ArmorType.MECHANIC},
alignToSurface = true,
maxUnevenness = .5,
isVehicle = true,
health = 500,
@@ -334,7 +341,7 @@ units = {
albedoPath = 'mech.jpg',
colorNodes = {'stripes'},
selectionSfx = PATH .. 'Sounds/Units/WarMechs/selection.ogg',
speed = .3,
speed = .4,
destinationOffset = .1,
anglePrecision = .1,
maxTurnAngle = .1,
@@ -350,7 +357,7 @@ units = {
maxRange = 50,
maxFireAngle = .1,
nodes = {{name = 'TankASHead', rotationSpeed = .05, vertical = false}, {name = 'barell', rotationSpeed = .05, angleConstraints = {min = 0, max = .349}, vertical = true}},
projectile = {id = ProjectileId.HE_SHELL, parent = 'barell', pos = {x = 0, y = .49, z = 8.35}, rot = {w = 1, x = 0, y = 0, z = 0}},
projectile = {id = ProjectileId.TANK_SHELL, parent = 'barell', pos = {x = 0, y = .49, z = 8.35}, rot = {w = 1, x = 0, y = 0, z = 0}},
fireFx = {
{
vfx = false,
@@ -392,7 +399,7 @@ units = {
albedoPath = 'tank.jpg',
colorNodes = {'TankASHead'},
selectionSfx = PATH .. 'Sounds/Units/Tanks/selection.ogg',
speed = 5,
speed = .5,
destinationOffset = .1,
anglePrecision = .1,
maxTurnAngle = .1,
@@ -405,10 +412,10 @@ units = {
orderType = OrderType.ATTACK,
rateOfFire = 1000,
damage = 200,
maxRange = 250,
maxRange = 50,
maxFireAngle = .1,
nodes = {{name = 'TankGun_AM', rotationSpeed = .05, vertical = false}, {name = 'barell', rotationSpeed = .05, angleConstraints = {min = -.2, max = .74}, vertical = true}},
projectile = {id = ProjectileId.HE_SHELL, parent = 'barell', pos = {x = 0.06, y = .19, z = 9.18}, rot = {w = 1, x = 0, y = 0, z = 0}},
projectile = {id = ProjectileId.TANK_SHELL, parent = 'barell', pos = {x = 0.06, y = .19, z = 9.18}, rot = {w = 1, x = 0, y = 0, z = 0}},
fireFx = {
{
vfx = false,
@@ -465,8 +472,11 @@ units = {
damage = 200,
maxRange = 50,
maxFireAngle = .1,
nodes = {{name = 'turret', rotationSpeed = .05, vertical = false}},
projectile = {id = ProjectileId.HE_SHELL, parent = 'turret', pos = {x = 0, y = .67, z = 5}, rot = {w = 1, x = 0, y = 0, z = 0}},
nodes = {
{name = 'turret', rotationSpeed = .05, vertical = false},
{name = 'GunHead', rotationSpeed = .05, angleConstraints = {min = -.174, max = 0}, vertical = true}
},
projectile = {id = ProjectileId.TANK_SHELL, parent = 'turret', pos = {x = 0, y = .67, z = 5}, rot = {w = 1, x = 0, y = 0, z = 0}},
fireFx = {
{
vfx = false,
@@ -491,7 +501,7 @@ units = {
}
},
unitClass = UnitClass.TANK,
unitType = UnitType.LAND,
unitType = UnitType.HOVER,
armor = {ArmorType.STEEL},
maxUnevenness = .5,
isVehicle = true,
@@ -527,7 +537,7 @@ units = {
{name = 'Asia_Mech.001', rotationSpeed = .05, vertical = false},
{name = 'Asia_Mech.002', rotationSpeed = .05, angleConstraints = {min = -.348, max = .785}, vertical = true}
},
projectile = {id = ProjectileId.HE_SHELL, parent = 'Asia_Mech.002', pos = {x = 0., y = 0., z = 5.91}, rot = {w = 1, x = 0, y = 0, z = 0}},
projectile = {id = ProjectileId.TANK_SHELL, parent = 'Asia_Mech.002', pos = {x = 0., y = 0., z = 5.91}, rot = {w = 1, x = 0, y = 0, z = 0}},
fireFx = {
{
vfx = true,
@@ -586,7 +596,7 @@ units = {
{name = 'turret', rotationSpeed = .05, vertical = false},
{name = 'barrel', rotationSpeed = .05, angleConstraints = {min = -.139, max = .279}, vertical = true}
},
projectile = {id = ProjectileId.HE_SHELL, parent = 'barrel', pos = {x = 0., y = 0, z = 9.14}, rot = {w = 1, x = 0, y = 0, z = 0}},
projectile = {id = ProjectileId.TANK_SHELL, parent = 'barrel', pos = {x = 0., y = 0, z = 9.14}, rot = {w = 1, x = 0, y = 0, z = 0}},
fireFx = {
{
vfx = true,
@@ -612,7 +622,6 @@ units = {
unitType = UnitType.LAND,
armor = {ArmorType.MECHANIC},
maxUnevenness = .5,
alignToSurface = true,
isVehicle = true,
health = 500,
buildTime = 1000,
@@ -748,7 +757,7 @@ units = {
},
abilityButtons = {{buttonType = ButtonType.ORDER, name = 'Hack', orderType = OrderType.HACK}},
unitClass = UnitClass.CYBORG_ENGINEER,
unitType = UnitType.HOVER,
unitType = UnitType.LAND,
armor = {ArmorType.MECHANIC},
maxUnevenness = .5,
isVehicle = true,
@@ -769,7 +778,7 @@ units = {
speed = 1,
destinationOffset = .1,
anglePrecision = .1,
maxTurnAngle = .1,
maxTurnAngle = .3,
garrisonCategory = 3,
deathFx = {explosionVfx, explosionSfx},
},
@@ -829,7 +838,7 @@ units = {
},
abilityButtons = {{buttonType = ButtonType.ORDER, name = 'Hack', orderType = OrderType.HACK}},
unitClass = UnitClass.CYBORG_ENGINEER,
unitType = UnitType.HOVER,
unitType = UnitType.LAND,
armor = {ArmorType.MECHANIC},
maxUnevenness = .5,
isVehicle = true,
@@ -910,7 +919,7 @@ units = {
},
abilityButtons = {{buttonType = ButtonType.ORDER, name = 'Hack', orderType = OrderType.HACK}},
unitClass = UnitClass.CYBORG_ENGINEER,
unitType = UnitType.HOVER,
unitType = UnitType.LAND,
armor = {ArmorType.MECHANIC},
maxUnevenness = .5,
isVehicle = true,
@@ -1092,7 +1101,7 @@ units = {
meshPath = 'aincTransport.xml',
albedoPath = 'transport.jpg',
selectionSfx = PATH .. 'Sounds/Units/Transports/selection.ogg',
speed = .1,
speed = .6,
destinationOffset = .1,
anglePrecision = .1,
maxTurnAngle = .1,
@@ -1168,7 +1177,7 @@ units = {
meshPath = 'erTransport.xml',
albedoPath = 'transport.jpg',
selectionSfx = PATH .. 'Sounds/Units/Transports/selection.ogg',
speed = .1,
speed = .6,
destinationOffset = .1,
anglePrecision = .1,
maxTurnAngle = .1,
@@ -1284,8 +1293,8 @@ units = {
weapons = {
{
orderType = OrderType.ATTACK,
rateOfFire = 200,
damage = 10,
rateOfFire = 1500,
damage = 80,
maxRange = 50,
nodes = {
{name = 'FrontTurret', rotationSpeed = .05, angleConstraints = {min = -2.53, max = 2.53}, vertical = false},
@@ -1307,8 +1316,8 @@ units = {
},
{
orderType = OrderType.ATTACK,
rateOfFire = 200,
damage = 10,
rateOfFire = 1500,
damage = 80,
maxRange = 50,
nodes = {
{name = 'RearTurret', rotationSpeed = .05, angleConstraints = {min = -2.53, max = 2.53}, vertical = false},
@@ -1391,8 +1400,8 @@ units = {
weapons = {
{
orderType = OrderType.ATTACK,
rateOfFire = 200,
damage = 10,
rateOfFire = 1500,
damage = 70,
maxRange = 50,
nodes = {{name = 'frontTurret', rotationSpeed = .05, angleConstraints = {min = -2.44, max = 2.44}, vertical = false}},
fireFx = {
@@ -1411,8 +1420,8 @@ units = {
},
{
orderType = OrderType.ATTACK,
rateOfFire = 200,
damage = 10,
rateOfFire = 1500,
damage = 70,
maxRange = 50,
nodes = {{name = 'rearTurret', rotationSpeed = .05, angleConstraints = {min = -2.44, max = 2.44}, vertical = false}},
fireFx = {
@@ -1492,7 +1501,7 @@ units = {
meshPath = 'mediumAssaultCruiser.xml',
albedoPath = 'cruiser.jpg',
selectionSfx = PATH .. 'Sounds/Units/Cruisers/selection.ogg',
speed = .1,
speed = .45,
destinationOffset = .1,
anglePrecision = .1,
maxTurnAngle = .1,
@@ -1503,8 +1512,8 @@ units = {
weapons = {
{
orderType = OrderType.ATTACK,
rateOfFire = 200,
damage = 10,
rateOfFire = 1400,
damage = 60,
maxRange = 50,
nodes = {
{name = 'frontTurret', rotationSpeed = .05, angleConstraints = {min = -2.44, max = 2.44}, vertical = false},
@@ -1526,8 +1535,8 @@ units = {
},
{
orderType = OrderType.ATTACK,
rateOfFire = 200,
damage = 10,
rateOfFire = 1400,
damage = 60,
maxRange = 50,
nodes = {
{name = 'rearTurret', rotationSpeed = .05, angleConstraints = {min = -2.44, max = 2.44}, vertical = false},
@@ -1602,10 +1611,10 @@ units = {
meshPath = 'lightAssaultCruiser.xml',
albedoPath = 'cruiser.jpg',
selectionSfx = PATH .. 'Sounds/Units/Cruisers/selection.ogg',
speed = .1,
speed = .5,
destinationOffset = .1,
anglePrecision = .1,
maxTurnAngle = .1,
maxTurnAngle = .05,
garrisonCategory = 3,
deathFx = {explosionVfx, explosionSfx},
},
@@ -1704,7 +1713,6 @@ units = {
{
orderType = OrderType.ATTACK,
rateOfFire = 2000,
damage = 10,
maxRange = 100,
targetUnits = {UnitType.UNDERWATER},
targetProjectiles = {},
@@ -1717,14 +1725,13 @@ units = {
},
{
orderType = OrderType.ATTACK,
rateOfFire = 200,
damage = 10,
rateOfFire = 1500,
maxRange = 50,
nodes = {
{name = 'frontTurret', rotationSpeed = .05, angleConstraints = {min = -2.26, max = 2.26}, vertical = false},
{name = 'frontTurretBarrels', rotationSpeed = .05, angleConstraints = {min = -.1395, max = .348}, vertical = true}
},
projectile = {id = ProjectileId.HE_SHELL, parent = 'frontTurret', pos = {x = 0.52, y = .83, z = 4.16}, rot = {w = 1, x = 0, y = 0, z = 0}},
projectile = {id = ProjectileId.ANTI_SUB_CRUISER_SHELL, parent = 'frontTurret', pos = {x = 0.52, y = .83, z = 4.16}, rot = {w = 1, x = 0, y = 0, z = 0}},
fireFx = {
{
vfx = false,
@@ -1747,14 +1754,13 @@ units = {
},
{
orderType = OrderType.ATTACK,
rateOfFire = 200,
damage = 10,
rateOfFire = 1500,
maxRange = 50,
nodes = {
{name = 'middleTurret', rotationSpeed = .05, vertical = false},
{name = 'middleTurretBarrel', rotationSpeed = .05, angleConstraints = {min = -.0872, max = .209}, vertical = true}
},
projectile = {id = ProjectileId.HE_SHELL, parent = 'middleTurret', pos = {x = 0, y = 1.8, z = 7.45}, rot = {w = 1, x = 0, y = 0, z = 0}},
projectile = {id = ProjectileId.ANTI_SUB_CRUISER_SHELL, parent = 'middleTurret', pos = {x = 0, y = 1.8, z = 7.45}, rot = {w = 1, x = 0, y = 0, z = 0}},
fireFx = {
{
vfx = false,
@@ -1777,14 +1783,13 @@ units = {
},
{
orderType = OrderType.ATTACK,
rateOfFire = 200,
damage = 10,
rateOfFire = 1500,
maxRange = 50,
nodes = {
{name = 'rearTurret', rotationSpeed = .05, angleConstraints = {min = -2.79, max = 2.79}, vertical = false},
{name = 'rearTurretBarrel', rotationSpeed = .05, angleConstraints = {min = -.0872, max = .209}, vertical = true}
},
projectile = {id = ProjectileId.HE_SHELL, parent = 'rearTurret', pos = {x = 0, y = 1.8, z = 7.45}, rot = {w = 1, x = 0, y = 0, z = 0}},
projectile = {id = ProjectileId.ANTI_SUB_CRUISER_SHELL, parent = 'rearTurret', pos = {x = 0, y = 1.8, z = 7.45}, rot = {w = 1, x = 0, y = 0, z = 0}},
fireFx = {
{
vfx = false,
@@ -1822,7 +1827,7 @@ units = {
meshPath = 'aincAntiSubCruiser.xml',
albedoPath = 'cruiser.jpg',
selectionSfx = PATH .. 'Sounds/Units/Cruisers/selection.ogg',
speed = .3,
speed = .6,
destinationOffset = .1,
anglePrecision = .1,
maxTurnAngle = .1,
@@ -1834,7 +1839,6 @@ units = {
{
orderType = OrderType.ATTACK,
rateOfFire = 2000,
damage = 10,
maxRange = 100,
targetUnits = {UnitType.UNDERWATER},
targetProjectiles = {},
@@ -1847,14 +1851,13 @@ units = {
},
{
orderType = OrderType.ATTACK,
rateOfFire = 200,
damage = 10,
rateOfFire = 2000,
maxRange = 50,
nodes = {
{name = 'frontLowerTurret', rotationSpeed = .05, angleConstraints = {min = -2.44, max = 2.44} , vertical = false},
{name = 'frontLowerTurretBarrels', rotationSpeed = .05, angleConstraints = {min = 0, max = .785}, vertical = true},
},
projectile = {id = ProjectileId.HE_SHELL, parent = 'frontLowerTurret', pos = {x = .42, y = 1.68, z = 4.14}, rot = {w = 1, x = 0, y = 0, z = 0}},
projectile = {id = ProjectileId.ANTI_SUB_CRUISER_SHELL, parent = 'frontLowerTurret', pos = {x = .42, y = 1.68, z = 4.14}, rot = {w = 1, x = 0, y = 0, z = 0}},
fireFx = {
{
vfx = false,
@@ -1877,14 +1880,13 @@ units = {
},
{
orderType = OrderType.ATTACK,
rateOfFire = 200,
damage = 10,
rateOfFire = 2000,
maxRange = 50,
nodes = {
{name = 'frontUpperTurret', rotationSpeed = .05, angleConstraints = {min = -2.44, max = 2.44} , vertical = false},
{name = 'frontUpperTurretBarrels', rotationSpeed = .05, angleConstraints = {min = 0, max = .785}, vertical = true},
},
projectile = {id = ProjectileId.HE_SHELL, parent = 'frontUpperTurret', pos = {x = .42, y = 1.68, z = 4.14}, rot = {w = 1, x = 0, y = 0, z = 0}},
projectile = {id = ProjectileId.ANTI_SUB_CRUISER_SHELL, parent = 'frontUpperTurret', pos = {x = .42, y = 1.68, z = 4.14}, rot = {w = 1, x = 0, y = 0, z = 0}},
fireFx = {
{
vfx = false,
@@ -1907,14 +1909,13 @@ units = {
},
{
orderType = OrderType.ATTACK,
rateOfFire = 200,
damage = 10,
rateOfFire = 2000,
maxRange = 50,
nodes = {
{name = 'rearLowerTurret', rotationSpeed = .05, angleConstraints = {min = -2.44, max = 2.44} , vertical = false},
{name = 'rearLowerTurretBarrels', rotationSpeed = .05, angleConstraints = {min = 0, max = .785}, vertical = true},
},
projectile = {id = ProjectileId.HE_SHELL, parent = 'rearLowerTurret', pos = {x = .42, y = 1.68, z = 4.14}, rot = {w = 1, x = 0, y = 0, z = 0}},
projectile = {id = ProjectileId.ANTI_SUB_CRUISER_SHELL, parent = 'rearLowerTurret', pos = {x = .42, y = 1.68, z = 4.14}, rot = {w = 1, x = 0, y = 0, z = 0}},
fireFx = {
{
vfx = false,
@@ -1937,14 +1938,13 @@ units = {
},
{
orderType = OrderType.ATTACK,
rateOfFire = 200,
damage = 10,
rateOfFire = 2000,
maxRange = 50,
nodes = {
{name = 'rearUpperTurret', rotationSpeed = .05, angleConstraints = {min = -2.44, max = 2.44} , vertical = false},
{name = 'rearUpperTurretBarrels', rotationSpeed = .05, angleConstraints = {min = 0, max = .785}, vertical = true},
},
projectile = {id = ProjectileId.HE_SHELL, parent = 'rearUpperTurret', pos = {x = .42, y = 5.82, z = 11.4}, rot = {w = 1, x = 0, y = 0, z = 0}},
projectile = {id = ProjectileId.ANTI_SUB_CRUISER_SHELL, parent = 'rearUpperTurret', pos = {x = .42, y = 5.82, z = 11.4}, rot = {w = 1, x = 0, y = 0, z = 0}},
fireFx = {
{
vfx = false,
@@ -1982,7 +1982,7 @@ units = {
meshPath = 'erAntiSubCruiser.xml',
albedoPath = 'cruiser.jpg',
selectionSfx = PATH .. 'Sounds/Units/Cruisers/selection.ogg',
speed = .3,
speed = .6,
destinationOffset = .1,
anglePrecision = .1,
maxTurnAngle = .1,
@@ -2034,10 +2034,10 @@ units = {
albedoPath = 'submarine.jpg',
colorNodes = {'Cube.001'},
selectionSfx = PATH .. 'Sounds/Units/Submarines/selection.ogg',
speed = .3,
speed = .4,
destinationOffset = .1,
anglePrecision = .1,
maxTurnAngle = .1,
maxTurnAngle = .125,
garrisonCategory = 3,
deathFx = {explosionVfx, explosionSfx},
},
@@ -2054,7 +2054,7 @@ units = {
}
},
damage = 200,
maxRange = 20,
maxRange = 200,
projectile = {id = ProjectileId.TORPEDO, pos = {x = 0, y = -.27, z = 4.6}, rot = {w = 1, x = 0, y = 0, z = 0}}
},
{
@@ -2086,10 +2086,10 @@ units = {
albedoPath = 'submarine.jpg',
colorNodes = {'Cube.001'},
selectionSfx = PATH .. 'Sounds/Units/Submarines/selection.ogg',
speed = .1,
speed = .4,
destinationOffset = .1,
anglePrecision = .1,
maxTurnAngle = .1,
maxTurnAngle = .125,
garrisonCategory = 3,
deathFx = {explosionVfx, explosionSfx},
},
@@ -2106,7 +2106,7 @@ units = {
}
},
damage = 200,
maxRange = 20,
maxRange = 200,
projectile = {id = ProjectileId.TORPEDO, pos = {x = 0, y = -.27, z = 4.6}, rot = {w = 1, x = 0, y = 0, z = 0}}
},
{
@@ -2138,10 +2138,10 @@ units = {
albedoPath = 'submarine.jpg',
colorNodes = {'Sphere.001'},
selectionSfx = PATH .. 'Sounds/Units/Submarines/selection.ogg',
speed = .1,
speed = .4,
destinationOffset = .1,
anglePrecision = .1,
maxTurnAngle = .1,
maxTurnAngle = .125,
garrisonCategory = 3,
deathFx = {explosionVfx, explosionSfx},
},
@@ -2177,10 +2177,10 @@ units = {
meshPath = 'acsSubmarine.xml',
albedoPath = 'submarine.jpg',
selectionSfx = PATH .. 'Sounds/Units/Submarines/selection.ogg',
speed = .2,
speed = .5,
destinationOffset = .1,
anglePrecision = .1,
maxTurnAngle = .1,
maxTurnAngle = .15,
garrisonCategory = 3,
deathFx = {explosionVfx, explosionSfx},
},
@@ -2190,7 +2190,7 @@ units = {
orderType = OrderType.ATTACK,
projectile = {id = ProjectileId.TORPEDO, pos = {x = 0, y = -.27, z = 4.6}, rot = {w = 1, x = 0, y = 0, z = 0}},
damage = 200,
maxRange = 20,
maxRange = 200,
rateOfFire = 500,
fireFx = {
{
@@ -2216,10 +2216,10 @@ units = {
meshPath = 'aincSubmarine.xml',
albedoPath = 'submarine.jpg',
selectionSfx = PATH .. 'Sounds/Units/Submarines/selection.ogg',
speed = .1,
speed = .6,
destinationOffset = .1,
anglePrecision = .1,
maxTurnAngle = .1,
maxTurnAngle = .15,
garrisonCategory = 3,
deathFx = {explosionVfx, explosionSfx},
},
@@ -2229,7 +2229,7 @@ units = {
orderType = OrderType.ATTACK,
projectile = {id = ProjectileId.TORPEDO, pos = {x = 0, y = -.27, z = 4.6}, rot = {w = 1, x = 0, y = 0, z = 0}},
damage = 200,
maxRange = 20,
maxRange = 200,
rateOfFire = 500,
fireFx = {
{
@@ -2255,10 +2255,10 @@ units = {
meshPath = 'erSubmarine.xml',
albedoPath = 'submarine.jpg',
selectionSfx = PATH .. 'Sounds/Units/Submarines/selection.ogg',
speed = .1,
speed = .5,
destinationOffset = .1,
anglePrecision = .1,
maxTurnAngle = .1,
maxTurnAngle = .15,
garrisonCategory = 3,
deathFx = {explosionVfx, explosionSfx},
},
@@ -2278,7 +2278,7 @@ units = {
meshPath = 'acsIcebreaker.xml',
albedoPath = 'icebreaker.jpg',
selectionSfx = PATH .. 'Sounds/Units/Submarines/selection.ogg',
speed = .1,
speed = .4,
destinationOffset = .1,
anglePrecision = .1,
maxTurnAngle = .1,
@@ -2301,7 +2301,7 @@ units = {
meshPath = 'aincIcebreaker.xml',
albedoPath = 'icebreaker.jpg',
selectionSfx = PATH .. 'Sounds/Units/Submarines/selection.ogg',
speed = .1,
speed = .4,
destinationOffset = .1,
anglePrecision = .1,
maxTurnAngle = .1,
@@ -2324,7 +2324,7 @@ units = {
meshPath = 'erIcebreaker.xml',
albedoPath = 'icebreaker.jpg',
selectionSfx = PATH .. 'Sounds/Units/Submarines/selection.ogg',
speed = .1,
speed = .4,
destinationOffset = .1,
anglePrecision = .1,
maxTurnAngle = .1,
@@ -2337,7 +2337,7 @@ units = {
type = WeaponClass.FREEZE,
orderType = OrderType.ATTACK,
rateOfFire = 100,
maxRange = 30,
maxRange = 500,
damage = 0,
nodes = {
{name = 'turret', rotationSpeed = .05, vertical = false},
@@ -2371,10 +2371,10 @@ units = {
meshPath = 'freezer.xml',
albedoPath = 'freezer.jpg',
selectionSfx = PATH .. 'Sounds/Units/Submarines/selection.ogg',
speed = .3,
speed = .7,
destinationOffset = .1,
anglePrecision = .1,
maxTurnAngle = .1,
maxTurnAngle = .15,
garrisonCategory = 3,
deathFx = {explosionVfx, explosionSfx},
},
@@ -2412,10 +2412,10 @@ units = {
meshPath = 'empShip.xml',
albedoPath = 'empShip.jpg',
selectionSfx = PATH .. 'Sounds/Units/Submarines/selection.ogg',
speed = .1,
speed = 1.5,
destinationOffset = .1,
anglePrecision = .1,
maxTurnAngle = .1,
maxTurnAngle = .2,
garrisonCategory = 3,
deathFx = {explosionVfx, explosionSfx},
},
+9 -2
View File
@@ -12,6 +12,7 @@
namespace battleship{
using namespace std;
using namespace vb01;
using namespace gameBase;
CruiseMissile::CruiseMissile(Unit *unit, int id, Vector3 tp, Vector3 pos, Quaternion rot) :
Projectile(unit, id, pos, rot),
@@ -20,6 +21,8 @@ namespace battleship{
{
destructable = new Destructable(this);
initProperties();
Vector3 unitDir = unit->getDirVec();
Vector3 leftDir = unit->getLeftVec();
Vector3 targDir = (Vector3(targetPoint.x, pos.y, targetPoint.z) - pos).norm();
@@ -31,8 +34,13 @@ namespace battleship{
CruiseMissile::~CruiseMissile(){delete destructable;}
void CruiseMissile::initProperties(){
sol::table projTable = generateView()[GameObject::getGameObjTableName()][id + 1];
minHeight = (float)projTable["minHeight"];
minDist = (float)projTable["minDist"];
}
void CruiseMissile::pitch(float rotAngle, Vector3 compVec){
float minHeight = 20;
float angleToCompVec = Projectile::dirVec.getAngleBetween(compVec);
float angle = (angleToCompVec > rotAngle ? rotAngle : angleToCompVec);
@@ -49,7 +57,6 @@ namespace battleship{
}
void CruiseMissile::cruise(){
float minDist = 6;
float initDist = Vector3(targetPoint.x, initPos.y, targetPoint.z).getDistanceFrom(initPos);
if(Projectile::pos.getDistanceFrom(Vector3(targetPoint.x, Projectile::pos.y, targetPoint.z)) < minDist)
+2
View File
@@ -13,7 +13,9 @@ namespace battleship{
enum class FlightStage{ASCENT, CRUISE, DESCENT};
FlightStage flightStage;
vb01::Vector3 targetPoint;
float minHeight, minDist;
void initProperties();
void pitch(float, vb01::Vector3);
void cruise();
};
+1 -1
View File
@@ -122,7 +122,7 @@ namespace battleship{
cellId = cells[cellId].underWaterCellIds[numUnderwaterCells - 1];
}
if((pos + dirVec * rayLength).y <= cells[cellId].pos.y + .5 * map->getCellSize().y)
if((pos + dirVec * rayLength).y <= cells[cellId].pos.y)
detonate();
}