Beispiel #1
0
void URPGEffectBase::Tick( float DeltaTime)
{
	//Super::Tick(DeltaTime);
	if(!AffectedTarget)
		return;
	if(!GetWorld())
		return;
	if(!IsEffectActive)
		return;

	currentTickTime += DeltaTime;
	if(currentTickTime >= TickDuration)
	{
		if(GetWorld())
		{
			OnEffectTick();
		}
		currentTickTime = 0;
	}
	currentDuration += DeltaTime;
	if(currentDuration >= Duration)
	{
		currentDuration = 0;
		OnEffectEnd();
		AffectedTarget->EffectManager->RemoveEffect(this);
	}
	OnEffectTickFrame(); //this will tick every frame.
	SetAttributeUpdates();
}
void URPGEffectPeriodic::SelfRemoveEffect()
{
	OnEffectEnd(); //we give chance to excute any logic before effect is completly removed
	//if (ApplicationType != EApplicationType::InstantApplication)
	//{
	TargetAttributes->RemoveEffect(this);
	//}
}
void URPGEffectPeriodic::Deinitialize()
{
	OnEffectDeinitialized();
	OnEffectEnd();
	IsEffectActive = false;
	PeriodLenght = 0;
	TotalDuration = 0;
}
Beispiel #4
0
void URPGEffectBase::Deinitialize()
{
	OnEffectEnd();
	EffectsRemoved = 0;
	TickDuration = 0;
	Duration = 0;
	IsEffectActive = false;
}
void AAREffectPeriodic::Deactivate()
{
	if (!EffectTarget)
		return;
	OnEffectEnd();
	UARAttributeBaseComponent* AttrComp = EffectTarget->FindComponentByClass<UARAttributeBaseComponent>();

	if (!AttrComp)
		return;
	if (IsEffectActive)
		return;
	AttrComp->RemovePeriodicEffect(this);

	CurrentDuration = 0;

	
}