Index: binaries/data/mods/public/simulation/components/Attack.js
===================================================================
--- binaries/data/mods/public/simulation/components/Attack.js
+++ binaries/data/mods/public/simulation/components/Attack.js
@@ -140,6 +140,7 @@
"" + // TODO: it shouldn't be stretched
"" +
"" +
+ Attack.prototype.statusEffectsSchema +
Attack.prototype.bonusesSchema +
Attack.prototype.preferredClassesSchema +
Attack.prototype.restrictedClassesSchema +
@@ -182,6 +183,7 @@
"" +
BuildDamageTypesSchema("damage strength") +
"" +
+ Attack.prototype.statusEffectsSchema +
Attack.prototype.bonusesSchema +
"" +
"" +
@@ -622,6 +624,7 @@
data.isSplash = true;
data.splashStrengths = this.GetAttackStrengths(type + ".Splash");
data.splashBonus = this.GetBonusTemplate(type + ".Splash");
+ data.splashStatusEffects = this.template[type].Splash.StatusEffects;
}
cmpTimer.SetTimeout(SYSTEM_ENTITY, IID_Damage, "MissileHit", timeToTarget * 1000 + +this.template[type].Delay, data);
}
@@ -659,7 +662,8 @@
"attacker": this.entity,
"multiplier": GetDamageBonus(this.entity, target, type, this.GetBonusTemplate(type)),
"type": type,
- "attackerOwner": attackerOwner
+ "attackerOwner": attackerOwner,
+ "statusEffects": this.template.StatusEffects
});
}
};
Index: binaries/data/mods/public/simulation/components/Damage.js
===================================================================
--- binaries/data/mods/public/simulation/components/Damage.js
+++ binaries/data/mods/public/simulation/components/Damage.js
@@ -100,6 +100,7 @@
* @param {string} data.shape - The shape of the splash range.
* @param {Object} data.splashBonus - The attack bonus template from the attacker.
* @param {Object} data.splashStrengths - Data of the form { 'hack': number, 'pierce': number, 'crush': number }.
+ * @param {Object} data.splashStatusEffects - Status effects eg. poisoning, burning etc.
*/
Damage.prototype.MissileHit = function(data, lateness)
{
@@ -123,7 +124,8 @@
"direction": data.direction,
"playersToDamage": this.GetPlayersToDamage(data.attackerOwner, data.friendlyFire),
"type": data.type,
- "attackerOwner": data.attackerOwner
+ "attackerOwner": data.attackerOwner,
+ "statusEffects": data.splashStatusEffects
});
}
@@ -138,10 +140,6 @@
this.CauseDamage(data);
cmpProjectileManager.RemoveProjectile(data.projectileId);
- let cmpStatusReceiver = Engine.QueryInterface(data.target, IID_StatusEffectsReceiver);
- if (cmpStatusReceiver && data.statusEffects)
- cmpStatusReceiver.InflictEffects(data.statusEffects);
-
return;
}
@@ -163,7 +161,8 @@
"attacker": data.attacker,
"multiplier": GetDamageBonus(data.attacker, ent, data.type, data.bonus),
"type": data.type,
- "attackerOwner": data.attackerOwner
+ "attackerOwner": data.attackerOwner,
+ "statusEffects": data.statusEffects
});
cmpProjectileManager.RemoveProjectile(data.projectileId);
break;
@@ -183,6 +182,7 @@
* @param {Vector3D} [data.direction] - The unit vector defining the direction. Needed for linear splash damage.
* @param {Object} data.splashBonus - The attack bonus template from the attacker.
* @param {number[]} data.playersToDamage - The array of player id's to damage.
+ * @param {Object} data.statusEffects - Status effects e.g. poisoning, burning etc.
*/
Damage.prototype.CauseDamageOverArea = function(data)
{
@@ -232,7 +232,8 @@
"attacker": data.attacker,
"multiplier": damageMultiplier,
"type": data.type + ".Splash",
- "attackerOwner": data.attackerOwner
+ "attackerOwner": data.attackerOwner,
+ "statusEffects": data.statusEffects
});
}
};
@@ -246,6 +247,7 @@
* @param {number} data.multiplier - The damage multiplier.
* @param {string} data.type - The type of damage.
* @param {number} data.attackerOwner - The player id of the attacker.
+ * @param {Object} data.statusEffects - Status effects e.g. poisoning, burning etc.
*/
Damage.prototype.CauseDamage = function(data)
{
@@ -253,6 +255,13 @@
if (!cmpDamageReceiver)
return;
+ if (data.statusEffects)
+ {
+ let cmpStatusReceiver = Engine.QueryInterface(data.target, IID_StatusEffectsReceiver);
+ if (cmpStatusReceiver)
+ cmpStatusReceiver.InflictEffects(data.statusEffects);
+ }
+
let targetState = cmpDamageReceiver.TakeDamage(data.strengths, data.multiplier);
let cmpPromotion = Engine.QueryInterface(data.attacker, IID_Promotion);
Index: binaries/data/mods/public/simulation/components/DeathDamage.js
===================================================================
--- binaries/data/mods/public/simulation/components/DeathDamage.js
+++ binaries/data/mods/public/simulation/components/DeathDamage.js
@@ -1,5 +1,21 @@
function DeathDamage() {}
+DeathDamage.prototype.statusEffectsSchema =
+ "" +
+ "" +
+ "" +
+ "" +
+ "" +
+ "" +
+ "" +
+ "" +
+ "" +
+ "" +
+ "" +
+ "" +
+ "" +
+ "";
+
DeathDamage.prototype.bonusesSchema =
"" +
"" +
@@ -36,6 +52,7 @@
"" +
BuildDamageTypesSchema("damage strength") +
"" +
+ DeathDamage.prototype.statusEffectsSchema +
DeathDamage.prototype.bonusesSchema;
DeathDamage.prototype.Init = function()
@@ -88,7 +105,8 @@
"splashBonus": this.GetBonusTemplate(),
"playersToDamage": playersToDamage,
"type": "Death",
- "attackerOwner": owner
+ "attackerOwner": owner,
+ "statusEffects": this.template.StatusEffects || null
});
};
Index: binaries/data/mods/public/simulation/components/tests/test_DeathDamage.js
===================================================================
--- binaries/data/mods/public/simulation/components/tests/test_DeathDamage.js
+++ binaries/data/mods/public/simulation/components/tests/test_DeathDamage.js
@@ -48,7 +48,8 @@
"splashBonus": null,
"playersToDamage": playersToDamage,
"type": "Death",
- "attackerOwner": player
+ "attackerOwner": player,
+ "statusEffects": null
};
AddMock(SYSTEM_ENTITY, IID_Damage, {