MDT单位能力教程
单位的能力有很多种,比如能量场、力墙场和状态场,等等(本教程为了省事,使用 .hjson 语法进行教程)

教程部分
玄武 -> 能量场/EnergyFieldAbility

abilities.add(new EnergyFieldAbility(35f, 65f, 180f){{
statusDuration = 60f * 6f;
maxTargets = 25;
}});
json
abilities: [
{
type: EnergyFieldAbility
damage: 35.0
reload: 65.0
range: 180.0
status: electrified
statusDuration: 360.0
targetGround: true
targetAir: true
hitBuildings: true
hitUnits: true
healPercent: 2.50
maxTargets: 25
useAmmo: true
color: 98ffa9
}
]
属性解释
type: 能力类型
damage: 伤害
reload: 能量场激活间隔
range: 能量场范围
status: 被击中的敌军获得效果
statusDuration: 效果持续帧数
targetGround: 瞄准陆军
targetAir: 瞄准空军
hitBuildings: 瞄准建筑物
hitUnits: 瞄准单位
healPercent: 恢复友方生命百分比
maxTarget: 最多瞄准数
useAmmo: 是否使用子弹
color: 能量场的主色

耀星 -> 力墙场/ForceFieldAbility

abilities.add(new ForceFieldAbility(60f, 0.3f, 400f, 60f * 6));
json
abilities: [
{
type: ForceFieldAbility
radius: 60.0
regen: 0.30
max: 400.0
cooldown: 360.0
}
]
属性解释
radius: 力墙范围
regen: 力墙恢复值
max: 力墙最大值
cooldown: 墙破后冷却时间

新星 -> 修复场/RepairFieldAbility
abilities.add(new RepairFieldAbility(10f, 60f * 4, 60f));
json
abilities: [
{
type: RepairFieldAbility
amount: 10
reload: 100
range: 60
}
]
属性解释
amount: 恢复生命值
reload: 恢复场间隔帧数
range: 恢复场范围

恒星 -> 护盾再生场/ShieldRegenFieldAbility
abilities.add(new ShieldRegenFieldAbility(20f, 40f, 60f * 5, 60f));
json
abilities: [
{
type: ShieldRegenFieldAbility
amount: 20.0
max: 40.0
reload: 300.0
range: 60.0
}
]
属性解释
amount: 护盾再生值
max: 护盾最大值
reload: 护盾再生场间隔帧数
range: 护盾再生场范围

电鳗 -> 状态场/StatusFieldAbility

abilities.add(new StatusFieldAbility(StatusEffects.overclock, 60f * 6, 60f * 6f, 60f));
json
abilities: [
{
type: StatusFieldAbility
effect: overclock
duration: 360.0
reload: 360.0
range: 60.0
}
]
属性解释
effect: 友方获得状态
duration: 状态持续时间
reload: 状态场间隔帧数
range: 状态场范围

? -> 单位单位工厂/UnitSpawnAbility
(`?`指游戏内没有单位引用该能力)
abilities: [
{
type: UnitSpawnAbility
unit: crawler
spawnTime: 300.0
spawnX: -5
spawnY: 5
}
]
属性解释
unit: 生成的单位
spawnTime: 生成帧数
spawnX: x轴偏移
spawnY: y轴偏移

属性分类
EnergyFieldAbility
damage: float
reload: float
range: float
status: StatusEffect
statusDuration: float
targetGround: boolean
targetAir: boolean
hitBuildings: boolean
hitUnits: boolean
healPercent: float
maxTarget: int
useAmmo: boolean
color: Color

ForceFieldAbility
radius: float
regen: float
max: float
cooldown: float

RepairFieldAbility
amount: float
reload: amount
range: amount

ShieldRegenFieldAbility
amount: float
max: float
reload: float
range: float

StatusFieldAbilitiy
effect: StatusEffect
duration: float
reload: float
range: float

UnitSpawnAbility
unit: UnitType
spawnTime: float
spawnX: float
spawnY: float

其他
StatusEffect
json模组只能用这些, 也可以改变它们, 但不能自创(你可以用none等不常见效果写状态, 间接自创)
none: 无(无效果, 为了特殊场景使用)
burning: 燃烧(持续受到伤害)
互斥: 潮湿, 冻结; 加成: 油浸
freezing: 冻结(暂时减少血量和移速上限, 加强爆炸伤害)
互斥: 融化, 燃烧; 加成: 爆炸
wet: 潮湿(暂时减少移速上限, 加强电击伤害)
互斥: 燃烧, 融化; 加成: 电击
muddy: 泥泞(暂时减少移速上限)
melting: 融化(暂时减少生命上限和移速)
互斥: 潮湿, 冻结; 加成: 油浸
sapped: 弱化(暂时减少生命上限和移速上限)
electrified: 电磁紊乱(暂时减少移速上限, 增加换弹时间)
spore-slowed: 孢子减速(暂时减少移速上限)
tarred: 油浸(暂时减少单位移速)
加成: 融化, 燃烧
overdrive: 过载(增加移速和伤害倍率, 减少生命上限, 永不消失)
overclock: 超频(暂时增加移速, 伤害和生命上限)
shocked: 电击(只在潮湿加成下作用)
blasted: 爆炸(只在冻结加成下作用)
unmoving: 静止(暂时大幅度减少单位移速)
slow: 减速(暂时中程度减少单位移速)
shielded: 武甲(暂时增加生命上限)
boss: Boss(增加伤害倍率和生命上限, 永不消失)
corroded: 腐蚀(持续受到伤害)
disarmed: 缴械(暂时无法使用武器)
invincible: 无敌(字面意思)

UnitType
即单位, 教程见上期
