public PanelFind() { InitializeComponent(); this.AccessibleName = this.Name = "Find"; //note: VS designer bug: changes Name to be = the class name. _tFind._f = this; _tReplace._f = this; _comboFind = new ComboWrapper(_tFind); _comboReplace = new ComboWrapper(_tReplace); _comboFind.ArrowButtonPressed += _comboFindReplace_ArrowButtonPressed; _comboReplace.ArrowButtonPressed += _comboFindReplace_ArrowButtonPressed; }
public override void RegisterStates() { ComboWrapper upCombo = new ComboWrapper(CharStates.ATTACK_STRONG.ToS(Suffixes.Up), 1) .WithCondition(new InputCondition(CharVars.FromInputMode(this.input).ToS(), Operators.EQUAL, InputModes.PRESS, InputModes.DOUBLE_TAP)) .WithCondition(new FloatCondition(CharVars.VERTICAL_VALUE.ToS(), Operators.GREATER_THAN, 0f)) .WithCondition(new IntCondition(CharVars.ATTACK_EFFECT.ToS(), Operators.EQUAL, (int)AttackEffects.KNOCKBACK)); ComboWrapper downCombo = new ComboWrapper(CharStates.ATTACK_STRONG.ToS(Suffixes.Down), 2) .WithCondition(new InputCondition(CharVars.FromInputMode(this.input).ToS(), Operators.EQUAL, InputModes.PRESS, InputModes.DOUBLE_TAP)) .WithCondition(new FloatCondition(CharVars.VERTICAL_VALUE.ToS(), Operators.LESS_THAN, 0f)) .WithCondition(new IntCondition(CharVars.ATTACK_EFFECT.ToS(), Operators.EQUAL, (int)AttackEffects.KNOCKBACK)); ComboWrapper forwardCombo = new ComboWrapper(CharStates.ATTACK_STRONG.ToS(Suffixes.Forwards), 3) .WithCondition(new InputCondition(CharVars.FromInputMode(this.input).ToS(), Operators.EQUAL, InputModes.PRESS, InputModes.DOUBLE_TAP)) .WithCondition(new FloatCondition(CharVars.VERTICAL_VALUE.ToS(), Operators.EQUAL, 0f)) .WithCondition(new IntCondition(CharVars.ATTACK_EFFECT.ToS(), Operators.EQUAL, (int)AttackEffects.KNOCKBACK)); if (this.enablePursuit) { PursuitBuilder pursuitBuilder = new PursuitBuilder(this.targetObject, this.input, CharVars.TARGET.ToS(), this.timeout) .WithState(CharStates.ATTACK_STRONG.ToS(Suffixes.Pursuit)) .WithMaxPursuits(CharVars.GENERIC_COUNTER, this.maxPursuits) .WithAnimation(new PlayAnimationBehaviour(this.targetObject, CharStates.DASH.ToS(Suffixes.H))) .WithSpeedMultiplierIncrease(this.speedIncrease) .WithCombo(upCombo) .WithCombo(downCombo) .WithCombo(forwardCombo) ; this.stateWrappers.AddRange(pursuitBuilder.Build()); } if (this.enableTeleport) { TeleportBuilder teleportBuilder = new TeleportBuilder(this.targetObject, this.input, CharVars.TARGET.ToS(), this.timeout, this.teleportObstacles, this.distanceFromTarget) .WithState(CharStates.ATTACK_STRONG.ToS(Suffixes.Teleport)) .WithMaxTeleports(CharVars.GENERIC_COUNTER, this.maxTeleports) .WithAnimation(new PlayAnimationBehaviour(this.targetObject, CharStates.WAIT_LOCKED.ToS(Suffixes.Disappear))) .WithWait(CharStates.ATTACK_STRONG.ToS(Suffixes.Wait), new PlayAnimationBehaviour(this.targetObject, CharStates.WAIT_LOCKED.ToS(Suffixes.Appear))) .WithFlip() .WithSounds(this.teleportStartSound, this.teleportUpdateSound, this.teleportExitSound) .WithEffects(this.teleportStartEffect, this.teleportUpdateEffect, this.teleportExitEffect) .WithCombo(upCombo) .WithCombo(downCombo) .WithCombo(forwardCombo) ; this.stateWrappers.AddRange(teleportBuilder.Build()); } this.stateWrappers.AddRange(this.BuildAttackUp()); this.stateWrappers.AddRange(this.BuildAttackDown()); this.stateWrappers.AddRange(this.BuildAttackForward()); }