public SeasonHydraBagman(SeasonChangeBagman xSeasonChangeBagman, EnemyBehaviour xSummerHead, EnemyBehaviour xFallHead, EnemyBehaviour xWinterHead) { this.xSummerHead = (SeasonHydraAI)xSummerHead; this.xFallHead = (SeasonHydraAI)xFallHead; this.xWinterHead = (SeasonHydraAI)xWinterHead; this.xSeasonChangeBagman = xSeasonChangeBagman; this.xSummerHead.xHydraBagman = this; this.xFallHead.xHydraBagman = this; this.xWinterHead.xHydraBagman = this; }
public WorldActor FindTarget(EnemyBehaviour.TargetSearchParameters enSearchType, float fMaxDistance, bool bRayCast, out float fDistance) { Game1 Lord = Program.GetTheGame(); WorldActor xClosestPlayer = null; List<WorldActor> lx = Lord._Enemy_GetTargetList(this, true); float fBestDistance = 99999f; if (enSearchType == EnemyBehaviour.TargetSearchParameters.Farthest) { fBestDistance = 0f; } List<WorldActor> lxCollection = new List<WorldActor>(); List<float> lfCollection = new List<float>(); foreach (WorldActor xActor in lx) { float fDist = Vector2.Distance(xActor.xTransform.v2Pos, this.xOwner.xTransform.v2Pos) + (float)(Math.Min(Program.GetTheGame()._Enemies_GetEnemiesByTarget(xActor).Count, 3) * 40); if (enSearchType == EnemyBehaviour.TargetSearchParameters.Closest) { if (fDist < fMaxDistance && fDist < fBestDistance && (!bRayCast || !this.Raycast(xActor.xTransform.v2Pos))) { xClosestPlayer = xActor; fBestDistance = fDist; } } else if (enSearchType == EnemyBehaviour.TargetSearchParameters.Farthest) { if (fDist < fMaxDistance && fDist > fBestDistance && (!bRayCast || !this.Raycast(xActor.xTransform.v2Pos))) { xClosestPlayer = xActor; fBestDistance = fDist; } } else if (enSearchType == EnemyBehaviour.TargetSearchParameters.Random && fDist < fMaxDistance && (!bRayCast || !this.Raycast(xActor.xTransform.v2Pos))) { lxCollection.Add(xActor); lfCollection.Add(fDist); } } if (lxCollection.Count == 0) { fDistance = fBestDistance; return xClosestPlayer; } if (enSearchType == EnemyBehaviour.TargetSearchParameters.Random) { int iIndex = Program.GetTheGame().randomInLogic.Next(lxCollection.Count); fDistance = lfCollection[iIndex]; return lxCollection[iIndex]; } fDistance = fBestDistance; return xClosestPlayer; }
public void TryCatch(EnemyBehaviour xBehaviour) { this.xBehaviour = xBehaviour; xBehaviour.xCatchMode = this; this.enPhase = CatchMode.Phase.WaitingForBaitedEnemy; xBehaviour.xCatchMode = this; this.iTimeSinceWinOrLose = 0; xBehaviour.ToBeCaught(); this.xRC.cColor = Color.White; this.xRC.fAlpha = 1f; this.xRC.fScale = 1f; this.iCatchChoise = 0; if (Program.GetTheGame().xNetworkInfo.enCurrentRole == NetworkHelperInterface.NetworkRole.Server) { NetOutgoingMessage om = this.CreateMessage(); om.Write(1); om.Write(xBehaviour.xOwner.iID); this.SendMessage(om); } }
public void EndCatch() { if (this.enPhase == CatchMode.Phase.None) { return; } this.enPhase = CatchMode.Phase.None; this.xBehaviour.EndCatch(); this.xBehaviour.xOwner.ExitLockedState(); this.xBehaviour.xCatchMode = null; this.xBehaviour = null; Program.GetTheGame().xRenderMaster.UnregisterRenderComponenent(this.xRC); if (Program.GetTheGame().xStolenInput == this) { Program.GetTheGame().xStolenInput = null; } if (Program.GetTheGame().xNetworkInfo.enCurrentRole != NetworkHelperInterface.NetworkRole.Client) { this.xView.xEntity.ExitLockedState(); } if (Utility.IsWithinRange((int)this.xView.xEntity.xRenderComponent.iActiveAnimation, 2100, 2299)) { if (this.xView.xEntity.byAnimationDirection == 1) { this.xView.xEntity.xRenderComponent.SwitchAnimation(2104, Animation.CancelOptions.IgnoreIfPlaying); } else if (this.xView.xEntity.byAnimationDirection == 3) { this.xView.xEntity.xRenderComponent.SwitchAnimation(2105, Animation.CancelOptions.IgnoreIfPlaying); } else { this.xView.xEntity.xRenderComponent.SwitchAnimation((ushort)this.xView.xEntity.byAnimationDirection, Animation.CancelOptions.IgnoreIfPlaying); } } if (Program.GetTheGame().xNetworkInfo.enCurrentRole == NetworkHelperInterface.NetworkRole.Server || (Program.GetTheGame().xNetworkInfo.enCurrentRole == NetworkHelperInterface.NetworkRole.Client && this.xView == Program.GetTheGame().xLocalPlayer)) { NetOutgoingMessage om = this.CreateMessage(); om.Write(4); this.SendMessage(om); } }
public void ReportHeadDeath(EnemyBehaviour xBehaviour) { if (this.GetDeadHeads() == 3) { return; } Vector2 v2SeasonChangeMid = new Vector2(325f, 260f); if (this.GetDeadHeads() == 1) { if (this.xRightOrb.enChangeTo != RenderMaster.PlayfieldRenderPass.Standard || (this.xLeftOrb.enChangeTo == RenderMaster.PlayfieldRenderPass.Standard && CAS.RandomInLogic.Next(2) == 0)) { this.xLeftOrb.xRenderComponent.SwitchAnimation(50); this.xLeftOrb.xCollisionComponent.DeactivateGroup(CollisionComponent.ColliderGroup.Combat); v2SeasonChangeMid = new Vector2(144f, 205f); } else { this.xRightOrb.xRenderComponent.SwitchAnimation(50); this.xRightOrb.xCollisionComponent.DeactivateGroup(CollisionComponent.ColliderGroup.Combat); v2SeasonChangeMid = new Vector2(492f, 205f); } } else if (this.GetDeadHeads() == 2) { if (this.xLeftOrb.xRenderComponent.iActiveAnimation < 50) { this.xLeftOrb.xRenderComponent.SwitchAnimation(50); this.xLeftOrb.xCollisionComponent.DeactivateGroup(CollisionComponent.ColliderGroup.Combat); v2SeasonChangeMid = new Vector2(144f, 205f); } else { this.xRightOrb.xRenderComponent.SwitchAnimation(50); this.xRightOrb.xCollisionComponent.DeactivateGroup(CollisionComponent.ColliderGroup.Combat); v2SeasonChangeMid = new Vector2(492f, 205f); } } if (xBehaviour == this.xSummerHead && this.enSeasonLastFrame == RenderMaster.PlayfieldRenderPass.Season_Summer) { if (this.xFallHead.xOwner.xBaseStats.iHP > 0) { this.xSeasonChangeBagman.ChangeSeason(RenderMaster.PlayfieldRenderPass.Season_Fall, v2SeasonChangeMid); } else { this.xSeasonChangeBagman.ChangeSeason(RenderMaster.PlayfieldRenderPass.Season_Winter, v2SeasonChangeMid); } } if (xBehaviour == this.xFallHead && this.enSeasonLastFrame == RenderMaster.PlayfieldRenderPass.Season_Fall) { if (this.xWinterHead.xOwner.xBaseStats.iHP > 0) { this.xSeasonChangeBagman.ChangeSeason(RenderMaster.PlayfieldRenderPass.Season_Winter, v2SeasonChangeMid); } else { this.xSeasonChangeBagman.ChangeSeason(RenderMaster.PlayfieldRenderPass.Season_Summer, v2SeasonChangeMid); } } if (xBehaviour == this.xWinterHead && this.enSeasonLastFrame == RenderMaster.PlayfieldRenderPass.Season_Winter) { if (this.xSummerHead.xOwner.xBaseStats.iHP > 0) { this.xSeasonChangeBagman.ChangeSeason(RenderMaster.PlayfieldRenderPass.Season_Summer, v2SeasonChangeMid); return; } this.xSeasonChangeBagman.ChangeSeason(RenderMaster.PlayfieldRenderPass.Season_Fall, v2SeasonChangeMid); } }
public void ReportFinalBlow(EnemyBehaviour xBehaviour) { if (this.GetDeadHeads() == 3) { return; } if (xBehaviour == this.xSummerHead) { if (this.xLeftOrb.enChangeTo == RenderMaster.PlayfieldRenderPass.Season_Summer) { this.xLeftOrb.ChangeOrbColor(RenderMaster.PlayfieldRenderPass.Standard); } if (this.xRightOrb.enChangeTo == RenderMaster.PlayfieldRenderPass.Season_Summer) { this.xRightOrb.ChangeOrbColor(RenderMaster.PlayfieldRenderPass.Standard); } } if (xBehaviour == this.xFallHead) { if (this.xLeftOrb.enChangeTo == RenderMaster.PlayfieldRenderPass.Season_Fall) { this.xLeftOrb.ChangeOrbColor(RenderMaster.PlayfieldRenderPass.Standard); } if (this.xRightOrb.enChangeTo == RenderMaster.PlayfieldRenderPass.Season_Fall) { this.xRightOrb.ChangeOrbColor(RenderMaster.PlayfieldRenderPass.Standard); } } if (xBehaviour == this.xWinterHead) { if (this.xLeftOrb.enChangeTo == RenderMaster.PlayfieldRenderPass.Season_Winter) { this.xLeftOrb.ChangeOrbColor(RenderMaster.PlayfieldRenderPass.Standard); } if (this.xRightOrb.enChangeTo == RenderMaster.PlayfieldRenderPass.Season_Winter) { this.xRightOrb.ChangeOrbColor(RenderMaster.PlayfieldRenderPass.Standard); } } }
public WorldActor FindTarget(EnemyBehaviour.TargetSearchParameters enSearchType, float fMaxDistance, out float fDistance) { return this.FindTarget(enSearchType, fMaxDistance, false, out fDistance); }