@@ -275,6 +275,7 @@ extended:
275
275
var int infectionFaction;
276
276
var int remainingHealth;
277
277
var int temp;
278
+ var int temp2;
278
279
var int INFECTION_LOW_THRESHOLD;
279
280
var int INFECTION_MID_THRESHOLD;
280
281
var int INFECTION_HIGH_THRESHOLD;
@@ -286,12 +287,6 @@ extended:
286
287
return;
287
288
end;
288
289
289
- #set infection thresholds
290
- unit.getTag infectionType Tag.CURRENT_INFECTION_TYPE;
291
- set INFECTION_LOW_THRESHOLD 20;
292
- set INFECTION_MID_THRESHOLD 40;
293
- set INFECTION_HIGH_THRESHOLD 80;
294
-
295
290
unit.getHealth remainingHealth;
296
291
sub remainingHealth to_health;
297
292
@@ -300,6 +295,16 @@ extended:
300
295
return;
301
296
end;
302
297
298
+ attacker.getFaction temp;
299
+ unit.getFaction temp2;
300
+ if and eq temp FACTION_PLAYER eq temp2 FACTION_PLAYER; #both attacker and target belong to the player faction; administer the Emperor's Peace
301
+ #debug_log "Infection Scripts; damageUnit, offset 23: Aborting. Friendly fire." remainingHealth;
302
+ unit.setTag Tag.CURRENT_INFECTION_FACTION 0; #untag
303
+ unit.setTag Tag.CURRENT_INFECTION_DAMAGE 0; #untag
304
+ unit.setTag Tag.CURRENT_INFECTION_TYPE 0; #untag
305
+ return;
306
+ end;
307
+
303
308
unit.getTag infectionFaction Tag.CURRENT_INFECTION_FACTION; #set the faction
304
309
#debug_log "Infection Scripts; damageUnit, offset 23: Infection faction:" infectionFaction;
305
310
if eq infectionFaction FACTION_PLAYER; #player infections don't spawn units for balance reasons
@@ -314,6 +319,12 @@ extended:
314
319
unit.getHealthMax temp;
315
320
limit_upper infectionDamage temp; #infection damage cannot exceed the victim's maximum health
316
321
322
+ #set infection thresholds
323
+ unit.getTag infectionType Tag.CURRENT_INFECTION_TYPE;
324
+ set INFECTION_LOW_THRESHOLD 20;
325
+ set INFECTION_MID_THRESHOLD 40;
326
+ set INFECTION_HIGH_THRESHOLD 80;
327
+
317
328
#debug_log "Infection Scripts; damageUnit, offset 23: Fatal Damage Incurred; Remaining Health:" remainingHealth;
318
329
if eq infectionType 1; #if Nurgle
319
330
if le infectionDamage INFECTION_LOW_THRESHOLD; #low level infection
0 commit comments