铁锈战争模组和地图制作帮助文档

攻击系统

在铁锈战争中,攻击系统是单位战斗能力的核心。本章节将详细介绍如何配置单位的攻击能力,包括攻击范围、目标选择、攻击模式等。

攻击基本配置

攻击系统主要通过[attack]部分来定义:

[attack] 攻击设置

[attack]
canAttack:true
canAttackFlyingUnits:true
canAttackLandUnits:true
canAttackUnderwaterUnits:true
canAttackNotTouchingWaterUnits:true
maxAttackRange:200
            

攻击基本属性说明

属性 说明 示例
canAttack 是否可以攻击 canAttack:true
canAttackFlyingUnits 是否可以攻击空中单位 canAttackFlyingUnits:true
canAttackLandUnits 是否可以攻击地面单位 canAttackLandUnits:true
canAttackUnderwaterUnits 是否可以攻击水下单位 canAttackUnderwaterUnits:true
canAttackNotTouchingWaterUnits 是否可以攻击非接触水单位 canAttackNotTouchingWaterUnits:true
maxAttackRange 最大攻击范围 maxAttackRange:200

目标选择限制

可以设置单位只能攻击特定标签的单位:

标签限制

[attack]
canOnlyAttackUnitsWithTags:infantry,vehicle
canOnlyAttackUnitsWithoutTags:building,structure
            

目标选择属性说明

属性 说明 示例
canOnlyAttackUnitsWithTags 只能攻击具有指定标签的单位 canOnlyAttackUnitsWithTags:infantry,vehicle
canOnlyAttackUnitsWithoutTags 不能攻击具有指定标签的单位 canOnlyAttackUnitsWithoutTags:building,structure

攻击模式设置

可以配置不同的攻击模式:

攻击模式属性

[attack]
isMelee:false
meleeEngangementDistance:250
turretMultiTargeting:true
isFixedFiring:false
            

攻击模式属性说明

属性 说明 示例
isMelee 是否为近战单位 isMelee:false
meleeEngangementDistance 近战索敌距离 meleeEngangementDistance:250
turretMultiTargeting 每个炮塔向不同目标射击 turretMultiTargeting:true
isFixedFiring 必须将身体对准目标射击 isFixedFiring:false

攻击行为控制

可以控制单位的攻击行为:

行为控制属性

[attack]
stopTargetingAfterFiring:true
disablePassiveTargeting:false
showRangeUIGuide:true
            

行为控制属性说明

属性 说明 示例
stopTargetingAfterFiring 射击后停止瞄准 stopTargetingAfterFiring:true
disablePassiveTargeting 不能主动攻击 disablePassiveTargeting:false
showRangeUIGuide 显示攻击范围UI showRangeUIGuide:true

伤害修正系统

可以设置针对特定单位的伤害修正:

伤害修正属性

[attack]
mutator_armor_pierce_ifUnitWithTags:heavy_armor
mutator_armor_pierce_directDamageMultiplier:1.5
mutator_armor_pierce_areaDamageMultiplier:1.5

mutator_building_crush_ifUnitWithTags:building
mutator_building_crush_directDamageMultiplier:2.0
mutator_building_crush_areaDamageMultiplier:2.0
            

伤害修正属性说明

属性 说明 示例
mutator__ifUnitWithTags 伤害修正所需标签 mutator_armor_pierce_ifUnitWithTags:heavy_armor
mutator__directDamageMultiplier 直接伤害乘数 mutator_armor_pierce_directDamageMultiplier:1.5
mutator__areaDamageMultiplier 范围伤害乘数 mutator_armor_pierce_areaDamageMultiplier:1.5

攻击速度控制

可以控制单位的攻击速度:

速度控制属性

[attack]
shootDelayMultiplier:1.0
shootDamageMultiplier:1.0
            

速度控制属性说明

属性 说明 示例
shootDelayMultiplier 开火间隔乘数 shootDelayMultiplier:1.0
shootDamageMultiplier 开火伤害乘数 shootDamageMultiplier:1.0

完整攻击单位示例

反坦克单位

[core]
name:反坦克炮
class:CustomUnitMetadata
price:1800
maxHp:1200
mass:10000
techLevel:2
buildSpeed:0.003
radius:25
displayRadius:30
fogOfWarSightRange:15

[graphics]
image:units/anti_tank.png
image_wreak:units/anti_tank_wreak.png
image_turret:units/anti_tank_turret.png
image_shadow:AUTO
teamColorsUseHue:true
teamColoringMode:hueAdd

[movement]
movementType:LAND
moveSpeed:0.8
maxTurnSpeed:1
reverseSpeedPercentage:0.2
isFixedFiring:true

[attack]
canAttack:true
canAttackFlyingUnits:false
canAttackLandUnits:true
canAttackUnderwaterUnits:false
maxAttackRange:300
isFixedFiring:true
showRangeUIGuide:true

[turret_1]
x:0
y:0
projectile:anti_tank_shell
turnSpeed:1
size:15
barrelX:0
barrelY:20
limitingMinRange:50

[projectile_1]
directDamage:200
life:120
speed:6
image:projectiles/large_shell.png
drawType:1
color:#FF0000
areaDamage:100
areaRadius:40
            

防空单位

[core]
name:防空炮
class:CustomUnitMetadata
price:1500
maxHp:800
mass:5000
techLevel:2
buildSpeed:0.002
radius:20
displayRadius:25
fogOfWarSightRange:18

[graphics]
image:units/anti_air.png
image_wreak:units/anti_air_wreak.png
image_turret:units/anti_air_turret.png
image_shadow:AUTO
teamColorsUseHue:true
teamColoringMode:hueAdd

[movement]
movementType:LAND
moveSpeed:1.0
maxTurnSpeed:3
reverseSpeedPercentage:0.5

[attack]
canAttack:true
canAttackFlyingUnits:true
canAttackLandUnits:false
canAttackUnderwaterUnits:false
maxAttackRange:250
turretMultiTargeting:true

[turret_1]
x:0
y:0
projectile:anti_air_missile
turnSpeed:5
size:10
barrelX:0
barrelY:15

[projectile_1]
directDamage:50
life:120
speed:8
targetGround:false
autoTargetingOnDeadTarget:true
image:projectiles/missile.png
drawType:2
color:#00FF00
            

近战单位

[core]
name:突击单位
class:CustomUnitMetadata
price:800
maxHp:600
mass:3000
techLevel:1
buildSpeed:0.002
radius:20
displayRadius:25
fogOfWarSightRange:12

[graphics]
image:units/assault_unit.png
image_wreak:units/assault_unit_wreak.png
image_shadow:AUTO
teamColorsUseHue:true
teamColoringMode:hueAdd

[movement]
movementType:LAND
moveSpeed:1.5
maxTurnSpeed:3
reverseSpeedPercentage:0.6

[attack]
canAttack:true
canAttackFlyingUnits:false
canAttackLandUnits:true
canAttackUnderwaterUnits:false
isMelee:true
meleeEngangementDistance:250

[turret_1]
x:0
y:0
projectile:assault_bullet
turnSpeed:4
size:10
barrelX:0
barrelY:10

[projectile_1]
directDamage:30
life:30
speed:12
image:projectiles/bullet.png
drawType:1
color:#FF0000
            

注意事项

回到顶部