Creating effect for all victims of Biotic Grenade damage

Hello!

I’m trying to make a bad aura effect on all victims that got hit by Ana’s Biotic Grenade.
I started with this, but I know it’s not the right way:

rule("Biotic Grenade Debuff Effect")
{
	event
	{
		Player Dealt Damage;
		All;
		Ana;
	}

	conditions
	{
		Event Ability == Is Using Ability 2(Event Player);
	}

	actions
	{
		Create Effect(All Players(All Teams), Bad Aura, Color(Purple), Victim, 1, Visible To Position and Radius);
		Wait(3.500, Ignore Condition);
		Destroy Effect(Last Created Entity);
	}
}

The problem is that only one player will get the bad aura effect (if multiple players are hit at once). Also, I believe the “Destroy Effect” will not work well if there are multiple Ana players in the game. I don’t know how I can improve it.

All victims should get the bad aura effect and it should work fine if there are multiple Ana players in the game. Perhaps there is a way to hide the effect instead of destroying it? How can I make this work?

Thanks.

The problem is as soon the Dealt Damage rule has a waiting behaviour in it, either directly in its action list body or called within a subroutine rule, the event and all the contextual values and actions applied will evaluate and execute only for one Victim. For the Took Damage event it seems to work fine, so there you have an alternative if you wanna condense it into one rule, the other option is to split creation and destruction in two distinct rules like i did as so:

variables
{
	player:
		0: BadEffect
		1: Timer
}

rule("Victim gets effect")
{
	event
	{
		Player Dealt Damage;
		All;
		Ana;
	}

	conditions
	{
		Event Ability == Button(Ability 2);
	}

	actions
	{
		Create Effect(All Players(All Teams), Bad Aura, Color(Purple), Victim, 1, Visible To Position and Radius);
		Victim.BadEffect = Last Created Entity;
		Victim.Timer = 3.500;
		Chase Player Variable At Rate(Victim, Timer, 0, 1, Destination and Rate);
	}
}

rule("Destroy Effect")
{
	event
	{
		Ongoing - Each Player;
		All;
		All;
	}

	conditions
	{
		Event Player.BadEffect != Null;
		Event Player.Timer == 0;
	}

	actions
	{
		Stop Chasing Player Variable(Event Player, Timer);
		Destroy Effect(Event Player.BadEffect);
	}
}

Dealt damage event should apply then on all victims who got hit by nade and took damage in this context.

2 Likes