public bool ChangeSeason(RenderMaster.PlayfieldRenderPass enChangeTo, Vector2 v2Source) { if (this.iCoolDown > 0 || this.enCurrentSeason == enChangeTo) { return false; } this.v2Source = v2Source; string sSeason = "summer"; if (enChangeTo == RenderMaster.PlayfieldRenderPass.Season_Fall) { sSeason = "fall"; } else if (enChangeTo == RenderMaster.PlayfieldRenderPass.Season_Winter) { sSeason = "winter"; } Program.game._EffectMaster_AddEffect(new Effect_SeasonChangeParticleCircle(sSeason, v2Source)); this.iCoolDown = 80; this.iCounter = 0; RenderMaster.enPlayfieldPassTwo = this.enCurrentSeason; RenderMaster.enPlayfieldPassOne = enChangeTo; this.enCurrentSeason = enChangeTo; Program.game.xGameSessionData.dSeasons[Program.game.xLevelMaster.xCurrentLevel.enZone] = enChangeTo; if (this.enCurrentSeason == RenderMaster.PlayfieldRenderPass.Season_Winter) { this.DisableWaterSurfaces(); } else { this.EnableWaterSurfaces(); } Program.game.xRenderMaster.xPlayfieldPassTransition = new RenderMaster.SourceCircleTransition(v2Source); if (this.denxCloseGatesDuring.ContainsKey(this.enCurrentSeason)) { foreach (Gate xMos in this.denxCloseGatesDuring[this.enCurrentSeason]) { xMos.Close(); } } if (this.denxOpenGatesDuring.ContainsKey(this.enCurrentSeason)) { foreach (Gate xMos2 in this.denxOpenGatesDuring[this.enCurrentSeason]) { xMos2.Open(); } } Program.game._Trigger_HandleTriggerEvent(FlagCodex.FlagID._MainStory_SeasonChange_SeasonChangedTrigger); if (CAS.NetworkRole == NetworkHelperInterface.NetworkRole.Server) { base.SendNetworkInstruction(0, new float[] { (float)enChangeTo, v2Source.X, v2Source.Y }); } return true; }
public override void Update() { this.iCounter++; if (this.iState == 2) { if (this.iCounter % 5 == 1) { int iIndex = this.iCounter / 5; if (this.lxFencesLeft.Count > iIndex) { this.lxFencesLeft[iIndex].xRenderComponent.AsAnimated().SwitchAnimation(2); } if (this.lxFencesBot.Count > iIndex) { this.lxFencesBot[iIndex].xRenderComponent.AsAnimated().SwitchAnimation(2); } if (this.lxFencesRight.Count > iIndex) { this.lxFencesRight[iIndex].xRenderComponent.AsAnimated().SwitchAnimation(2); } } if (this.iCounter == 180) { this.iState = 3; } return; } if (this.iState == -1) { if (this.iCounter % 5 == 0) { if (this.lxFencesLeft.Count < 6) { SortedAnimated xNewPiece = (SortedAnimated)Program.game._EffectMaster_AddEffect(new SortedAnimated(new Vector2((float)(89 + 8 * this.lxFencesLeft.Count), 126f), SortedAnimated.SortedAnimatedEffects._Blocks_SpearFence)); xNewPiece.xRenderComponent.fVirtualHeight = 0f; this.lxFencesLeft.Add(xNewPiece); } if (CAS.NetworkRole == NetworkHelperInterface.NetworkRole.LocalOnly && this.lxFencesRight.Count < 6) { SortedAnimated xNewPiece2 = (SortedAnimated)Program.game._EffectMaster_AddEffect(new SortedAnimated(new Vector2((float)(510 + 8 * this.lxFencesRight.Count), 210f), SortedAnimated.SortedAnimatedEffects._Blocks_SpearFence)); xNewPiece2.xRenderComponent.fVirtualHeight = 0f; this.lxFencesRight.Add(xNewPiece2); } if (this.lxFencesBot.Count < 16) { SortedAnimated xNewPiece3 = (SortedAnimated)Program.game._EffectMaster_AddEffect(new SortedAnimated(new Vector2((float)(259 + 8 * this.lxFencesBot.Count), 343f), SortedAnimated.SortedAnimatedEffects._Blocks_SpearFence)); xNewPiece3.xRenderComponent.fVirtualHeight = 0f; this.lxFencesBot.Add(xNewPiece3); if (this.lxFencesBot.Count == 16) { this.iState = 0; if (CAS.NetworkRole != NetworkHelperInterface.NetworkRole.LocalOnly) { this.OnInstruction(3, new float[0]); } } } } } else if (this.iState == -2 && this.iCounter % 5 == 0) { if (this.lxFencesRight.Count < 6) { SortedAnimated xNewPiece4 = (SortedAnimated)Program.game._EffectMaster_AddEffect(new SortedAnimated(new Vector2((float)(510 + 8 * this.lxFencesRight.Count), 210f), SortedAnimated.SortedAnimatedEffects._Blocks_SpearFence)); xNewPiece4.xRenderComponent.fVirtualHeight = 0f; this.lxFencesRight.Add(xNewPiece4); } else { this.iState = 0; } } if (this.enSeasonLastFrame == RenderMaster.PlayfieldRenderPass.Standard) { this.enSeasonLastFrame = RenderMaster.enPlayfieldPassOne; } else if (this.enSeasonLastFrame != RenderMaster.enPlayfieldPassOne) { this.TurnOffOrbs(); } this.enSeasonLastFrame = RenderMaster.enPlayfieldPassOne; if (!this.bInBattle && this.xFallHead.bActive && this.iCounter == 170) { Program.game.xSoundSystem.PlaySong("MiniBossBattle03", false); } if (CAS.NetworkRole == NetworkHelperInterface.NetworkRole.Client) { return; } if (this.iState == 0 && this.xSummerHead.xOwner.bToBeDestroyed && this.xWinterHead.xOwner.bToBeDestroyed && this.xFallHead.xOwner.bToBeDestroyed) { this.HydrasDefeated(); } if (!this.bInBattle && this.xSummerHead.enCurrentAction == SeasonHydraAI.Action.Chillin && this.xWinterHead.enCurrentAction == SeasonHydraAI.Action.Chillin) { this.bInBattle = true; Program.game._Trigger_HandleTriggerEvent(FlagCodex.FlagID._MainStory_SeasonChange_HydraAwoken, 1); } }
public void ChangeOrbColor(RenderMaster.PlayfieldRenderPass enSeason) { bool bChanged = this.enChangeTo != enSeason; RenderMaster.PlayfieldRenderPass enOld = this.enChangeTo; this.enChangeTo = enSeason; if (bChanged) { if (enSeason == RenderMaster.PlayfieldRenderPass.Season_Summer) { this.xRenderComponent.SwitchAnimation(13); float[] array = new float[2]; array[0] = 1f; base.SendNetworkInstruction(array); this.xRenderComponent.dixAnimations[0] = this.xRenderComponent.dixAnimations[10]; this.xRenderComponent.dixAnimations[1] = this.xRenderComponent.dixAnimations[11]; this.xRenderComponent.dixAnimations[2] = this.xRenderComponent.dixAnimations[12]; this.enType = DynamicEnvironmentCodex.ObjectTypes.Puzzlish_SeasonChangeOrb_Summer; return; } if (enSeason == RenderMaster.PlayfieldRenderPass.Season_Fall) { this.xRenderComponent.SwitchAnimation(23); base.SendNetworkInstruction(new float[] { 1f, 1f }); this.xRenderComponent.dixAnimations[0] = this.xRenderComponent.dixAnimations[20]; this.xRenderComponent.dixAnimations[1] = this.xRenderComponent.dixAnimations[21]; this.xRenderComponent.dixAnimations[2] = this.xRenderComponent.dixAnimations[22]; this.enType = DynamicEnvironmentCodex.ObjectTypes.Puzzlish_SeasonChangeOrb_Autumn; return; } if (enSeason == RenderMaster.PlayfieldRenderPass.Season_Winter) { this.xRenderComponent.SwitchAnimation(33); base.SendNetworkInstruction(new float[] { 1f, 2f }); this.xRenderComponent.dixAnimations[0] = this.xRenderComponent.dixAnimations[30]; this.xRenderComponent.dixAnimations[1] = this.xRenderComponent.dixAnimations[31]; this.xRenderComponent.dixAnimations[2] = this.xRenderComponent.dixAnimations[32]; this.enType = DynamicEnvironmentCodex.ObjectTypes.Puzzlish_SeasonChangeOrb_Winter; return; } if (enSeason == RenderMaster.PlayfieldRenderPass.Standard) { if (enOld == RenderMaster.PlayfieldRenderPass.Season_Summer) { this.xRenderComponent.SwitchAnimation(43); } else if (enOld == RenderMaster.PlayfieldRenderPass.Season_Fall) { this.xRenderComponent.SwitchAnimation(44); } else if (enOld == RenderMaster.PlayfieldRenderPass.Season_Winter) { this.xRenderComponent.SwitchAnimation(45); } base.SendNetworkInstruction(new float[] { 1f, 3f }); this.xRenderComponent.dixAnimations[0] = this.xRenderComponent.dixAnimations[40]; this.xRenderComponent.dixAnimations[1] = this.xRenderComponent.dixAnimations[41]; this.xRenderComponent.dixAnimations[2] = this.xRenderComponent.dixAnimations[42]; this.enType = DynamicEnvironmentCodex.ObjectTypes.Puzzlish_SeasonChangeOrb_Dead; } } }