private void ZapZapZaamPrepareUpdate() { Vector2 v2MidMos = Utility.AnimationDirectionToVector2((int)this.xOwner.byAnimationDirection); Utility.Vector2ToRadians(v2MidMos); int iMos = 15; if (GameSessionData.iBaseDifficulty > 0) { iMos = 10; } int iKnas = (int)Math.Floor((double)((float)(this.iCounter - iMos * 4) / (float)iMos)); if (iKnas >= -1 && iKnas < this.llv2ZapTargets[this.iZapTargetTemplate].Count) { Vector2 v2Origin; if (iKnas >= 0) { v2Origin = this.llv2ZapTargets[this.iZapTargetTemplate][iKnas]; } else { v2Origin = this.xOwner.xTransform.v2Pos; } Vector2 v2Target; if (iKnas < this.llv2ZapTargets[this.iZapTargetTemplate].Count - 1) { v2Target = this.llv2ZapTargets[this.iZapTargetTemplate][iKnas + 1]; } else { v2Target = this.xOwner.xTransform.v2Pos; } int iProgress = this.iCounter % iMos; float fProgress = (float)iProgress / (float)iMos; Vector2 v2NewPos = Vector2.Lerp(v2Origin, v2Target, fProgress); iProgress = (this.iCounter - 1) % iMos; fProgress = (float)iProgress / (float)iMos; Vector2 v2LastPos = Vector2.Lerp(v2Origin, v2Target, fProgress); if (this.iCounter % iMos == 0) { v2LastPos = v2NewPos; } float fDistance = Vector2.Distance(v2LastPos, v2NewPos); int iSteps = (int)(fDistance / 1.5f); for (int i = 0; i <= iSteps; i++) { RenderComponent xStatic = new StaticRenderComponent(RenderMaster.txCircleRad25, new TransformComponent(Vector2.Lerp(v2NewPos, v2LastPos, (float)i / (float)iSteps))); xStatic.fScale = 0.05f; xStatic.fAlpha = 0.75f; xStatic.cColor = Color.LightYellow; Program.game._EffectMaster_AddEffect(new _Effect_GenericFadeOut(xStatic, 0, 0.03f, 1f, RenderMaster.SubRenderLayer.BelowSorted)); } } if (iKnas >= 0 && this.iCounter % iMos == 0) { if (iKnas < this.llv2ZapTargets[this.iZapTargetTemplate].Count) { Program.game._EffectMaster_AddEffect(new SortedAnimated(this.llv2ZapTargets[this.iZapTargetTemplate][iKnas], SortedAnimated.SortedAnimatedEffects._EnemyEffects_Boss_PhasemanPhaseTarget)); return; } if (iKnas == this.llv2ZapTargets[this.iZapTargetTemplate].Count + 4) { this.enCurrentAction = RoguePhasemanAI.PhasemanAction.ExecutingZapZapZaaam; if (CAS.NetworkRole != NetworkHelperInterface.NetworkRole.Client) { this.xOwner.xRenderComponent.SwitchAnimation(54, Animation.CancelOptions.IgnoreIfPlaying); this.v2PhaseTarget = this.llv2ZapTargets[this.iZapTargetTemplate][0]; this.v2RandMoveDir = Vector2.Normalize(this.v2PhaseTarget - this.xOwner.xTransform.v2Pos); } } } }
public override void OnUpdate() { if (!this.bActive) { return; } if (this.xOwner.bToBeDestroyed || this.bDying) { return; } Random knark = Program.GetTheGame().randomInLogic; if (!this.bInited) { this.xOwner.xBaseStats.bUntargetable = false; this.iNextHardUpdate = 0; this.bInited = true; (this.xOwner as Boss).EnterBattle(); } if (this.v2RandMoveDir != Vector2.Zero && this.xOwner.xRenderComponent.GetCurrentAnimation().bIsMoveCancellable) { this.xOwner.xTransform.v2Pos += this.xOwner.xBaseStats.fMovementSpeed * this.v2RandMoveDir; } this.iCounter++; this.iNextHardUpdate--; if (this.enCurrentAction == RoguePhasemanAI.PhasemanAction.Chillin) { if (this.iNextHardUpdate <= 0) { if (this.bHasFiredThisRound) { if (this.v2TacticalPosition == Vector2.Zero) { this.enCurrentAction = RoguePhasemanAI.PhasemanAction.Phasing; this.xOwner.xRenderComponent.SwitchAnimation(4, Animation.CancelOptions.UseAnimationDefault); this.v2PhaseTarget = new Vector2(1014f, 248f) - this.v2Dif; this.v2TacticalPosition = (this.v2RandMoveDir = new Vector2(0f, -1f)); } else if (this.v2TacticalPosition == new Vector2(0f, -1f)) { this.enCurrentAction = RoguePhasemanAI.PhasemanAction.Phasing; this.xOwner.xRenderComponent.SwitchAnimation(7, Animation.CancelOptions.UseAnimationDefault); this.v2PhaseTarget = new Vector2(833f, 354f) - this.v2Dif; this.v2TacticalPosition = new Vector2(-1f, 0f); } else if (this.v2TacticalPosition == new Vector2(-1f, 0f)) { this.enCurrentAction = RoguePhasemanAI.PhasemanAction.Phasing; this.xOwner.xRenderComponent.SwitchAnimation(5, Animation.CancelOptions.UseAnimationDefault); this.v2PhaseTarget = new Vector2(1206f, 354f) - this.v2Dif; this.v2TacticalPosition = new Vector2(1f, 0f); } else if (this.v2TacticalPosition == new Vector2(1f, 0f)) { this.enCurrentAction = RoguePhasemanAI.PhasemanAction.Phasing; this.xOwner.xRenderComponent.SwitchAnimation(7, Animation.CancelOptions.UseAnimationDefault); this.v2PhaseTarget = new Vector2(1014f, 351f) - this.v2Dif; this.v2TacticalPosition = Vector2.Zero; } this.v2RandMoveDir = Vector2.Normalize(this.v2PhaseTarget - this.xOwner.xTransform.v2Pos); } else { this.bHasFiredThisRound = true; if (this.v2TacticalPosition == new Vector2(0f, -1f)) { this.enCurrentAction = RoguePhasemanAI.PhasemanAction.FiringStunBullet; this.xOwner.xRenderComponent.SwitchAnimation(18, Animation.CancelOptions.IgnoreIfPlaying); this.bReadyToFire = false; this.bSpecialShotBlocked = false; } else if (this.v2TacticalPosition == Vector2.Zero) { this.enCurrentAction = RoguePhasemanAI.PhasemanAction.PreparingZapZapZaaam; this.bReadyToFire = false; this.xOwner.xRenderComponent.SwitchAnimation(50, Animation.CancelOptions.IgnoreIfPlaying); this.iCounter = 0; this.iZapTargetProgress = 0; this.iZapTargetTemplate = Program.game.randomInLogic.Next(this.llv2ZapTargets.Count); base.SendClientInstruction(0, new float[] { (float)this.iZapTargetTemplate }); } else { byte byDir = this.xOwner.byAnimationDirection; this.bReadyToFire = false; this.enCurrentAction = RoguePhasemanAI.PhasemanAction.FiringNormalBullets; this.xOwner.xRenderComponent.SwitchAnimation((ushort)(32 + byDir), Animation.CancelOptions.IgnoreIfPlaying); this.iCounter = 0; if (this.enPattern == RoguePhasemanAI.BulletMosOfDos.Badoom) { this.enPattern = RoguePhasemanAI.BulletMosOfDos.Wave; } else { this.enPattern = RoguePhasemanAI.BulletMosOfDos.Badoom; } } } } } else if (this.enCurrentAction == RoguePhasemanAI.PhasemanAction.Phasing) { bool bAtTarget = Vector2.Distance(this.xOwner.xTransform.v2Pos, this.v2PhaseTarget) < 10f; if (Utility.IsWithinRange((int)this.xOwner.xRenderComponent.iActiveAnimation, 8, 11)) { if (this.iCounter % 3 == 0) { Program.GetTheGame()._EffectMaster_AddEffect(new VFX_GenericGhostImage(this.xOwner.xTransform.v2Pos, this.xOwner.xRenderComponent)); } int iMossa = 1; if (GameSessionData.iBaseDifficulty > 0) { iMossa = 4; } if (this.iCounter % 2 == 0) { for (int i = 0; i < iMossa; i++) { this.FireGenericBullet(Utility.RandomizeVector2Direction(knark), 2f, 1f, 120); } } } if (bAtTarget) { this.xOwner.xTransform.v2Pos = this.v2PhaseTarget; byte byDir2 = (byte)((this.xOwner.byAnimationDirection + 2) % 4); this.xOwner.xRenderComponent.SwitchAnimation((ushort)(12 + byDir2), Animation.CancelOptions.UseAnimationDefault); this.iNextHardUpdate = 160 - GameSessionData.iBaseDifficulty * 20; this.enCurrentAction = RoguePhasemanAI.PhasemanAction.Chillin; this.bHasFiredThisRound = false; } } else if (this.enCurrentAction == RoguePhasemanAI.PhasemanAction.FiringStunBullet) { if (this.xChargeEffect != null && this.xChargeEffect.xRenderComponent.fAlpha > 0f) { this.xChargeEffect.xRenderComponent.fAlpha -= 0.01f; } if (Utility.IsWithinRange((int)this.xOwner.xRenderComponent.iActiveAnimation, 0, 3)) { this.enCurrentAction = RoguePhasemanAI.PhasemanAction.Chillin; this.iNextHardUpdate = 220; if (this.bSpecialShotBlocked) { this.iNextHardUpdate = 100; } } } else if (this.enCurrentAction == RoguePhasemanAI.PhasemanAction.PreparingZapZapZaaam) { this.ZapZapZaamPrepareUpdate(); } else if (this.enCurrentAction == RoguePhasemanAI.PhasemanAction.ExecutingZapZapZaaam) { bool bAtTarget2 = Vector2.Distance(this.xOwner.xTransform.v2Pos, this.v2PhaseTarget) < 10f; if (Utility.IsWithinRange((int)this.xOwner.xRenderComponent.iActiveAnimation, 8, 11)) { if (this.iCounter % 3 == 0) { Program.GetTheGame()._EffectMaster_AddEffect(new VFX_GenericGhostImage(this.xOwner.xTransform.v2Pos, this.xOwner.xRenderComponent)); } int iMossa2 = 1; if (GameSessionData.iBaseDifficulty > 0) { iMossa2 = 4; } if (this.iCounter % 2 == 0) { for (int j = 0; j < iMossa2; j++) { this.FireGenericBullet(Utility.RandomizeVector2Direction(knark), 2f, 1f, 120); } } } if (bAtTarget2) { this.iZapTargetProgress++; this.xOwner.xTransform.v2Pos = this.v2PhaseTarget; if (this.iZapTargetProgress < this.llv2ZapTargets[this.iZapTargetTemplate].Count) { this.v2PhaseTarget = this.llv2ZapTargets[this.iZapTargetTemplate][this.iZapTargetProgress]; } else { this.v2PhaseTarget = new Vector2(1014f, 351f) - this.v2Dif; } if (this.iZapTargetProgress > this.llv2ZapTargets[this.iZapTargetTemplate].Count) { byte arg_741_0 = (byte)((this.xOwner.byAnimationDirection + 2) % 4); this.xOwner.xRenderComponent.SwitchAnimation(14, Animation.CancelOptions.UseAnimationDefault); this.iNextHardUpdate = 160 - GameSessionData.iBaseDifficulty * 20; this.enCurrentAction = RoguePhasemanAI.PhasemanAction.Chillin; this.bHasFiredThisRound = true; } else { this.v2RandMoveDir = Vector2.Normalize(this.v2PhaseTarget - this.xOwner.xTransform.v2Pos); } } } else if (this.enCurrentAction == RoguePhasemanAI.PhasemanAction.FiringNormalBullets) { if (!this.bReadyToFire) { this.iCounter = 0; return; } if (this.iCounter >= 180) { this.enCurrentAction = RoguePhasemanAI.PhasemanAction.Chillin; this.iNextHardUpdate = 80; if (this.xOwner.xRenderComponent.iActiveAnimation >= 30) { this.xOwner.xRenderComponent.SwitchAnimation((ushort)(40 + this.xOwner.byAnimationDirection), Animation.CancelOptions.IgnoreIfPlaying); } return; } if (this.enPattern == RoguePhasemanAI.BulletMosOfDos.Wave && this.iCounter % 3 == 0) { Vector2 v2MidMos = Utility.AnimationDirectionToVector2((int)this.xOwner.byAnimationDirection); float fRadianMid = Utility.Vector2ToRadians(v2MidMos); this.xOwner.xRenderComponent.SwitchAnimation((ushort)(36 + this.xOwner.byAnimationDirection), Animation.CancelOptions.IgnoreIfPlaying); int iPart = this.iCounter % 120; int iRealPart = this.iCounter % 60; if (iPart < 60) { this.FireGenericBullet(Utility.RadiansToVector2(fRadianMid - 3.14159274f + 3.14159274f * ((float)iRealPart / 60f)), 4f, 1f, 200); } else { this.FireGenericBullet(Utility.RadiansToVector2(fRadianMid - 3.14159274f * ((float)iRealPart / 60f)), 4f, 1f, 200); } if (GameSessionData.iBaseDifficulty > 0) { if (iPart < 60) { this.FireGenericBullet(Utility.RadiansToVector2(fRadianMid - 3.14159274f * ((float)iRealPart / 60f) - 0.02617994f), 4f, 1f, 200); } else { this.FireGenericBullet(Utility.RadiansToVector2(fRadianMid - 3.14159274f + 3.14159274f * ((float)iRealPart / 60f) + 0.02617994f), 4f, 1f, 200); } } } else if (this.enPattern == RoguePhasemanAI.BulletMosOfDos.Badoom) { Vector2 v2MidMos2 = Utility.AnimationDirectionToVector2((int)this.xOwner.byAnimationDirection); float fRadianMid2 = Utility.Vector2ToRadians(v2MidMos2); if (this.iCounter == 20) { this.FireMegaBullet(Utility.RadiansToVector2(fRadianMid2 - 3.14159274f + 0.628318548f), 2f, 0.98f, 120); this.xOwner.xRenderComponent.SwitchAnimation((ushort)(44 + this.xOwner.byAnimationDirection), Animation.CancelOptions.RestartIfPlaying); } if (this.iCounter == 50) { this.FireMegaBullet(Utility.RadiansToVector2(fRadianMid2 - 3.14159274f + 1.2566371f), 2f, 0.98f, 120); this.xOwner.xRenderComponent.SwitchAnimation((ushort)(44 + this.xOwner.byAnimationDirection), Animation.CancelOptions.RestartIfPlaying); } if (this.iCounter == 80) { this.FireMegaBullet(Utility.RadiansToVector2(fRadianMid2 - 3.14159274f + 1.88495576f), 2f, 0.98f, 120); this.xOwner.xRenderComponent.SwitchAnimation((ushort)(44 + this.xOwner.byAnimationDirection), Animation.CancelOptions.RestartIfPlaying); } if (this.iCounter == 110) { this.FireMegaBullet(Utility.RadiansToVector2(fRadianMid2 - 3.14159274f + 2.51327419f), 2f, 0.98f, 120); this.xOwner.xRenderComponent.SwitchAnimation((ushort)(44 + this.xOwner.byAnimationDirection), Animation.CancelOptions.RestartIfPlaying); } if (GameSessionData.iBaseDifficulty > 0) { if (this.iCounter == 35) { this.FireMegaBullet(Utility.RadiansToVector2(fRadianMid2 - 3.14159274f + 2.51327419f), 2f, 0.98f, 120); this.xOwner.xRenderComponent.SwitchAnimation((ushort)(44 + this.xOwner.byAnimationDirection), Animation.CancelOptions.RestartIfPlaying); } if (this.iCounter == 65) { this.FireMegaBullet(Utility.RadiansToVector2(fRadianMid2 - 3.14159274f + 1.88495576f), 2f, 0.98f, 120); this.xOwner.xRenderComponent.SwitchAnimation((ushort)(44 + this.xOwner.byAnimationDirection), Animation.CancelOptions.RestartIfPlaying); } if (this.iCounter == 95) { this.FireMegaBullet(Utility.RadiansToVector2(fRadianMid2 - 3.14159274f + 1.2566371f), 2f, 0.98f, 120); this.xOwner.xRenderComponent.SwitchAnimation((ushort)(44 + this.xOwner.byAnimationDirection), Animation.CancelOptions.RestartIfPlaying); } if (this.iCounter == 125) { this.FireMegaBullet(Utility.RadiansToVector2(fRadianMid2 - 3.14159274f + 0.628318548f), 2f, 0.98f, 120); this.xOwner.xRenderComponent.SwitchAnimation((ushort)(44 + this.xOwner.byAnimationDirection), Animation.CancelOptions.RestartIfPlaying); } } if (this.iCounter == 150) { this.xOwner.xRenderComponent.SwitchAnimation((ushort)(40 + this.xOwner.byAnimationDirection), Animation.CancelOptions.IgnoreIfPlaying); } } } else if (this.enCurrentAction == RoguePhasemanAI.PhasemanAction.Stunned && this.iNextHardUpdate <= 0) { this.iNextHardUpdate = 60; this.xOwner.xRenderComponent.SwitchAnimation((ushort)(28 + this.xOwner.byAnimationDirection), Animation.CancelOptions.UseAnimationDefault); this.enCurrentAction = RoguePhasemanAI.PhasemanAction.Chillin; } this.xOwner.xTransform.v2ServerPos = this.xOwner.xTransform.v2Pos; }
public override void OnDeathOverride(AttackPhase xKillingAP) { this.bDying = true; this.enCurrentAction = RoguePhasemanAI.PhasemanAction.Chillin; if (this.xChargeEffect != null) { this.xOwner.bDefeated = true; this.xChargeEffect.bToBeDestroyed = true; this.xChargeEffect = null; } if (this.xOwner.byAnimationDirection != 3) { this.xOwner.xRenderComponent.SwitchAnimation(100, Animation.CancelOptions.IgnoreIfPlaying); return; } this.xOwner.xRenderComponent.SwitchAnimation(101, Animation.CancelOptions.IgnoreIfPlaying); }
public override void OnHitByAttack(AttackCollisionData xAtColData, AttackPhase xAtPhase) { base.OnHitByAttack(xAtColData, xAtPhase); if (xAtPhase.xStats.sAttackHandle == "SupahPhase") { this.enCurrentAction = RoguePhasemanAI.PhasemanAction.Stunned; this.iNextHardUpdate = 440 - Program.GetTheGame()._Enemy_GetDifficultyModifier() * 20; this.xOwner.xRenderComponent.SwitchAnimation((ushort)(20 + this.xOwner.byAnimationDirection), Animation.CancelOptions.IgnoreIfPlaying); } NetworkHelperInterface.NetworkRole arg_70_0 = Program.GetTheGame().xNetworkInfo.enCurrentRole; }
public override void InstructionsFromServer(byte byInstructionID, params float[] afParams) { if (byInstructionID == 0) { int iTemplate = (int)afParams[0]; this.iZapTargetTemplate = iTemplate; this.enCurrentAction = RoguePhasemanAI.PhasemanAction.PreparingZapZapZaaam; this.iCounter = 0; this.iZapTargetProgress = 0; return; } if (byInstructionID == 1) { if (afParams[0] == 1f) { this.bActive = true; } this.xOwner.xBaseStats.iHP = (int)afParams[1]; this.xOwner.xTransform.SetBoth(new Vector2(afParams[2], afParams[3])); } }