public override void InstructionsFromServer(byte byInstructionID, params float[] afParams) { if (byInstructionID == 0) { this.Kill(new Vector2(afParams[0], afParams[1])); return; } if (byInstructionID == 1) { this.iSpinsLeft = (int)afParams[0]; Program.game._Enemy_EnterAttackAnimation(this.xOwner, (ushort)(16 + this.xOwner.byAnimationDirection)); this.enCurrentAction = CrystalBeetleAI.Action.SpecialAttack; this.xOwner.xBaseStats.fCurrentMoveSpeedMod = 0f; return; } if (byInstructionID == 2) { this.enCurrentAction = CrystalBeetleAI.Action.Chillin; this.EndSpin(); } }
public override void OnHitByAttack(AttackCollisionData xAtColData, AttackPhase xAtPhase) { if (!this.bGonnaDie && this.enCurrentAction != CrystalBeetleAI.Action.SpecialAttack) { this.v2RandMoveDir = Vector2.Zero; } if (this.enCurrentAction == CrystalBeetleAI.Action.SpecialAttack && xAtPhase.xStats.iBreakingPower >= this.xOwner.xBaseStats.iKnockbackResistance) { this.xOwner.xBaseStats.iKnockbackResistance = -1; this.enCurrentAction = CrystalBeetleAI.Action.Chillin; this.iNextHardUpdate = 60; } else { this.iCounterAtLastSpin -= 30; } base.OnHitByAttack(xAtColData, xAtPhase); }
private void ChangeAction(CrystalBeetleAI.Action enChangeTo) { this.enCurrentAction = enChangeTo; this.sSubAction = ""; }
public override void OnAnimationCallback(AnimationInstruction xIns) { if (xIns.xEvent.afAlterableValues[0] == 0f) { if (CAS.NetworkRole != NetworkHelperInterface.NetworkRole.Client) { this.iSpinsLeft = 20; base.SendClientInstruction(1, new float[] { (float)this.iSpinsLeft }); Program.game._Enemy_EnterAttackAnimation(this.xOwner, (ushort)(16 + this.xOwner.byAnimationDirection)); this.xOwner.xBaseStats.fCurrentMoveSpeedMod = 0f; this.xOwner.xBaseStats.iKnockbackResistance = 4; if (this.xPlayerLockedOnto != null) { this.v2RandMoveDir = Utility.Normalize(this.xPlayerLockedOnto.xTransform.v2Pos - this.xOwner.xTransform.v2Pos); return; } this.v2RandMoveDir = Utility.RandomizeVector2Direction(CAS.RandomInLogic); return; } } else if (xIns.xEvent.afAlterableValues[0] == 1f) { if (this.iSpinsLeft > 0) { Program.game._Enemy_EnterAttackAnimation(this.xOwner, (ushort)(16 + this.xOwner.byAnimationDirection)); } else { this.xOwner.xRenderComponent.SwitchAnimation((ushort)(20 + this.xOwner.byAnimationDirection)); this.xOwner.xBaseStats.iKnockbackResistance = -1; this.enCurrentAction = CrystalBeetleAI.Action.Chillin; this.v2RandMoveDir = Vector2.Zero; this.EndSpin(); this.iNextHardUpdate = 60; } this.iSpinsLeft--; } }