public override void OnHitByAttack(AttackCollisionData xAtColData, AttackPhase xAtPhase) { if (!this.bGonnaDie) { this.v2RandMoveDir = Vector2.Zero; } if (xAtPhase.xStats.iBreakingPower >= this.xOwner.xBaseStats.iKnockbackResistance) { if (!xAtColData.bShielded) { this.xOwner.xRenderComponent.SwitchAnimation((ushort)(12 + this.xOwner.byAnimationDirection)); this.ExitShieldMode(); this.bHasBeenHitOutsideOfShield = true; if (this.enCurrentAction == AutumnKnightAI.Action.SpecialAttack) { this.enCurrentAction = AutumnKnightAI.Action.Chillin; this.ExitShieldMode(); this.xOwner.xBaseStats.iKnockbackResistance = -1; if (this.xOccupiedTornado != null) { this.ExitTornadoMode(); } } this.sSubAction = "Wait"; this.iCounter = -35; } else if (this.xOwner.xBaseStats.iShieldHP > 0) { this.xOwner.xRenderComponent.SwitchAnimation((ushort)(32 + this.xOwner.byAnimationDirection)); this.sSubAction = "Wait"; this.iCounter = -20; } else { this.xOwner.xRenderComponent.SwitchAnimation((ushort)(40 + this.xOwner.byAnimationDirection)); this.ExitShieldMode(); this.sSubAction = "Wait"; this.iCounter = -100; this.iShieldBreakCounter = 1; Program.game._EffectMaster_AddEffect(new SortedAnimated(this.xOwner.xTransform.v2Pos + Utility.AnimationDirectionToVector2((int)this.xOwner.byAnimationDirection) * 10f, SortedAnimated.SortedAnimatedEffects._EnemyEffects_SeasonKnight_ShieldBreak)); } } base.OnHitByAttack(xAtColData, xAtPhase); }
private void ChangeAction(AutumnKnightAI.Action enChangeTo) { this.enCurrentAction = enChangeTo; this.sSubAction = ""; }
public override void OnAnimationCallback(AnimationInstruction xIns) { if (xIns.xEvent.afAlterableValues[0] == 0f) { this.xOwner.xBaseStats.iKnockbackResistance = -1; return; } if (xIns.xEvent.afAlterableValues[0] == 1f) { this.xOwner.xBaseStats.iInShield = (short)this.xOwner.byAnimationDirection; return; } if (xIns.xEvent.afAlterableValues[0] == 2f) { byte byDir = this.xOwner.byAnimationDirection; Program.game._Enemy_EnterAttackAnimation(this.xOwner, 44); int iAdd = (int)((8 - byDir) % 4); if (byDir == 0) { iAdd = 3; } else if (byDir == 1) { iAdd = 2; } else if (byDir == 2) { iAdd = 1; } else { iAdd = 0; } this.xOwner.xRenderComponent.fPassedTicks = (float)(iAdd * this.xOwner.xRenderComponent.GetCurrentAnimation().iTicksPerFrame); this.xOwner.xRenderComponent.GetCurrentAnimation().Update(this.xOwner.xRenderComponent.fPassedTicks); this.iSpinsLeft = 10 + CAS.DifficultyModifier * 3; this.enCurrentAction = AutumnKnightAI.Action.SpecialAttack; this.iCounterAtLastSpin = this.iExistCounter; this.ExitShieldMode(); this.bNoInterestInTornado = false; this.xOwner.xBaseStats.iKnockbackResistance = 4; return; } if (xIns.xEvent.afAlterableValues[0] == 3f) { if (this.iSpinsLeft <= 0) { this.xOwner.xRenderComponent.SwitchAnimation(45); this.enCurrentAction = AutumnKnightAI.Action.Chillin; this.sSubAction = "Wait"; this.iCounter = -45; this.ExitShieldMode(); this.xOwner.xBaseStats.iKnockbackResistance = -1; if (this.xOccupiedTornado != null) { this.ExitTornadoMode(); } } else { Program.game._Enemy_EnterAttackAnimation(this.xOwner, 44); } this.iSpinsLeft--; } }