- UID
- 44787
- UCC
-
- 声望
-
- 好评
-
- 贡献
-
- 最后登录
- 1970-1-1
|
本帖最后由 EliteCadre 于 2014-2-15 10:37 编辑
目前我已经初步了解如何修改Game Data\scripts\server下as中的代码,即使我没有什么编程基础。
已经初步实现如下效果,程序可被识别,即将测试BUG:
(1)护盾代码修改,支持武器的半穿透效果
void ShieldSoak(Event@ evt, float StoreMax, float absorbFactor) {
if(evt.flags & DF_ShieldPiercing != 0)
return;
if(evt.flags & DF_HalfShieldPierce != 0) {
if(evt.flags & DF_Kinetic != 0) {
Object@ obj = evt.target;
State@ shld = obj.getState(strShields);
//Check to see if we should absorb the shot
if(randomf(1.f) < clamp((shld.val * absorbFactor) / shld.max, 0.f, 1.f)) {
float soak = min(evt.damage, shld.val);
if(soak > 0) {
evt.damage -= soak;
shld.val -= soak;
}
else {
//The shields have collapsed, no further checks are necessary
evt.flags |= DF_ShieldPiercing;
}
}
}
else {
Object@ obj = evt.target;
State@ shld = obj.getState(strShields);
float shieldStability = clamp((shld.val * absorbFactor) / shld.max, 0.f, 1.f);
float soak = min(evt.damage, shld.val) * shieldStability;
if(soak > 0) {
shld.val -= soak;
evt.damage -= soak;
}
else {
//The shields have collapsed, no further checks are necessary
evt.flags |= DF_ShieldPiercing;
}
}
}
else {
if(evt.flags & DF_Kinetic != 0) {
Object@ obj = evt.target;
State@ shld = obj.getState(strShields);
//Check to see if we should absorb the shot
if(randomf(1.f) < clamp((shld.val * absorbFactor) / shld.max, 0.f, 1.f)) {
float soak = min(evt.damage, shld.val);
if(soak > 0) {
evt.damage -= soak;
shld.val -= soak;
}
else {
//The shields have collapsed, no further checks are necessary
evt.flags |= DF_ShieldPiercing;
}
}
}
else {
Object@ obj = evt.target;
State@ shld = obj.getState(strShields);
float shieldStability = clamp((shld.val * absorbFactor) / shld.max, 0.f, 1.f);
float soak = min(evt.damage, shld.val) * shieldStability;
if(soak > 0) {
shld.val -= soak;
evt.damage -= soak;
}
else {
//The shields have collapsed, no further checks are necessary
evt.flags |= DF_ShieldPiercing;
}
}
}
}
(2)护甲完全免疫武器的穿甲效果
//Reduces damage taken by FieldSoak, down to a minimum of 20% damage
void FieldSoakDamage(Event@ evt, float Soak) {
SysRef@ dest = evt.dest;
if(dest is null)
return;
evt.damage = max(evt.damage - Soak, evt.damage * 0.2f);
float deal = min(evt.damage, dest.HP);
dest.HP -= deal;
evt.damage -= deal;
}
(3)护甲降低穿透比率的一半(全穿便50%穿,50%穿变25%穿)
//Reduces damage taken by Hard Soak, down to a minimum of 20% damage
void HardSoakDamage(Event@ evt, float Soak) {
if(evt.flags & DF_ArmorPierced != 0)
return;
SysRef@ dest = evt.dest;
if(dest is null)
return;
if(evt.flags & DF_ArmorPiercing != 0) {
evt.damage = max(evt.damage - (Soak * 0.5f), evt.damage * 0.4f);
float deal = min(evt.damage * 0.5f, dest.HP);
dest.HP -= deal;
evt.damage -= deal;
evt.flags |= DF_ArmorPierced;//(加入DF_ArmorPierced是为了防止利用多块装甲堆叠反复吸收穿甲伤害)
}
if(evt.flags & DF_HalfArmorPierce == 0) {
evt.damage = max(evt.damage - Soak, evt.damage * 0.2f);
float deal = min(evt.damage, dest.HP);
dest.HP -= deal;
evt.damage -= deal;
}
else {
evt.damage = max(evt.damage - (Soak * 0.75f), evt.damage * 0.2667f);
float deal = min(evt.damage * 0.75f, dest.HP);
dest.HP -= deal;
evt.damage -= deal;
evt.flags |= DF_ArmorPiercing;
evt.flags |= DF_ArmorPierced;
}
}
至此已经为新的两种装甲和半穿透护盾武器的加入做好了铺垫,接下来就是把新子系统加入,将已经制作好的图标和他们对应,然后再中文和英文两种语言文件中写好他们的名称和注释。预计5天内制作好版本0.0.1 |
评分
-
查看全部评分
|