Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add ExludeDamageTypes to HarvesterAttackNotifier #21242

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
6 changes: 6 additions & 0 deletions OpenRA.Mods.Common/Traits/Player/HarvesterAttackNotifier.cs
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,9 @@ public class HarvesterAttackNotifierInfo : TraitInfo
[Desc("Length of time (in ticks) to display a location ping in the minimap.")]
public readonly int RadarPingDuration = 250;

[Desc("Exclude damage types (defined on the warheads) that trigger Notification.")]
public readonly BitSet<DamageType> ExludeDamageTypes = default;

[NotificationReference("Speech")]
[Desc("Speech notification type to play.")]
public readonly string Notification = "HarvesterAttack";
Expand Down Expand Up @@ -54,6 +57,9 @@ public HarvesterAttackNotifier(Actor self, HarvesterAttackNotifierInfo info)

void INotifyDamage.Damaged(Actor self, AttackInfo e)
{
if (!info.ExludeDamageTypes.IsEmpty && e.Damage.DamageTypes.Overlaps(info.ExludeDamageTypes))
return;

// Don't track self-damage
if (e.Attacker != null && e.Attacker.Owner == self.Owner)
return;
Expand Down
1 change: 1 addition & 0 deletions mods/d2k/rules/player.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,7 @@ Player:
Prerequisites: global-auto-concrete
FrozenActorLayer:
HarvesterAttackNotifier:
ExludeDamageTypes: SpiceExplosion
TextNotification: notification-harvester-under-attack
PlayerStatistics:
PlaceBeacon:
Expand Down
4 changes: 2 additions & 2 deletions mods/d2k/weapons/other.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -305,7 +305,7 @@ SpiceExplosion:
invulnerable: 0
cy: 20
harvester: 25
DamageTypes: Prone50Percent, TriggerProne, ExplosionDeath
DamageTypes: Prone50Percent, TriggerProne, SpiceExplosion
DamageCalculationType: ClosestTargetablePosition
AffectsParent: true
Warhead@2Res: CreateResource
Expand Down Expand Up @@ -333,7 +333,7 @@ BloomExplosion:
invulnerable: 0
cy: 20
harvester: 25
DamageTypes: Prone50Percent, TriggerProne, ExplosionDeath
DamageTypes: Prone50Percent, TriggerProne, ExplosionDeath, SpiceExplosion
DamageCalculationType: ClosestTargetablePosition
AffectsParent: true

Expand Down