Jump to content

Applying new PersistentStatChange Effects.


Deleted32045420User

Recommended Posts

Hello! as a part of the ongoing effort to make my red fog mod more stable i've been looking for some time into the X2Effect_PersistentStatChange class and it's parents. Now honestly i am LOST. So far i have created an instance of this class:

static function X2Effect_PersistentStatChange CreateRedFogStatusEffect(array<ECharStatType> StatTypes, array<float> StatChanges,bool b_IncludeRobotics)
{
	local X2Effect_PersistentStatChange     PersistentStatChangeEffect;
	local X2Condition_UnitProperty 		UnitPropCondition;
	local ECharStatType			StatType;
	local float				StatChange;
	local int				i;
	PersistentStatChangeEffect = new class'X2Effect_PersistentStatChange';
	PersistentStatChangeEffect.EffectName = 'RedFog';
	PersistentStatChangeEffect.DuplicateResponse = eDupe_Refresh;
	PersistentStatChangeEffect.BuildPersistentEffect(1,true,,,eGameRule_PlayerTurnBegin);
	for(i=0;i<StatTypes.Length;i++)
	{
		StatType=StatTypes[i];
		StatChange=StatChanges[i];
		PersistentStatChangeEffect.AddPersistentStatChange(StatType, StatChange , MODOP_Multiplication);
	}
	PersistentStatChangeEffect.bRemoveWhenTargetDies = true;
	UnitPropCondition = new class'X2Condition_UnitProperty';
	UnitPropCondition.ExcludeRobotic = b_IncludeRobotics;
	PersistentStatChangeEffect.TargetConditions.AddItem(UnitPropCondition);

	return PersistentStatChangeEffect;
}

But i dont know how to apply it to a unit. Once applied it should automatically update the stats and show up in the shot breakdown as far as i understand the X2Abillity_ToHitCalc_StandartAim class.

 

Thanks in advance for the help, EladDv.

Link to comment
Share on other sites

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...