protected override void OnUpdate(float dt) { if (userInput.IsJoyStickDirectionJustChanged()) { //DLog.Log("decrease stun duration by " + info.Config.reduction); valueModifiers.Add(extraStunDuration.AddModifier(StatsModifierOperator.Addition, -info.Config.reduction)); VibrateInfo vi = new VibrateInfo( Target.Target, 1, 0, info.Config.vibrate.xAmplitude, info.Config.vibrate.frequency, info.Config.vibrate.shouldDecay, info.Config.vibrate.decayConstant, new List <VfxConfig>(), BaseModifierConfig.NO_ICON, info.Config.vibrate.lifetimes ); vibrateModifier = new VibrateModifier( vi, casterEntity, targetEntity, environment, modifierInteractionCollection ); targetCharacter.AddModifier(vibrateModifier); } }
private void TriggerVibrateActions(List <VibrateAction> vibrateActions) { foreach (VibrateAction vibrateAction in vibrateActions) { VibrateInfo vi = new VibrateInfo( Target.Target, 1, 0, vibrateAction.xAmplitude, vibrateAction.frequency, vibrateAction.shouldDecay, vibrateAction.decayConstant, new List <VfxConfig>(), BaseModifierConfig.NO_ICON, new List <LifetimeConfig>( new[] { new DurationInSecondsLifetimeConfig() { duration = vibrateAction.duration }, } ) ); VibrateModifier vibrateModifier = new VibrateModifier( vi, casterEntity, targetEntity, environment, modifierInteractionCollection ); character.AddModifier(vibrateModifier); vibrateModifiers.Add(vibrateModifier); } }