public void Init() { this.xNiceOverlay = new StaticRenderComponent(RenderMaster.txNullTex, new TransformComponent(Vector2.Zero)); this.xNiceOverlay.v2Offset = Vector2.Zero; Program.game.xRenderMaster.RegisterBackground(this.xNiceOverlay); this.xNiceOverlay.fAlpha = 0.9f; this.xRenderFunction = new DelegateRenderComponent(new DelegateRenderComponent.RenderDelegate(this.Render)); Program.game.xRenderMaster.RegisterAboveAllRenderComponent(this.xRenderFunction); if (this.xColorOverlayWhite == null) { this.xColorOverlayWhite = new OverlayRenderComponent(new Rectangle(0, 0, 640, 360), Color.White * 0f); this.xColorOverlayWhite.fAlpha = 0f; Program.game.xRenderMaster.RegisterAboveSorted(this.xColorOverlayWhite); } if (this.xColorOverlayBlack == null) { this.xColorOverlayBlack = new OverlayRenderComponent(new Rectangle(0, 0, 640, 360), Color.Black * 0f); this.xColorOverlayBlack.fAlpha = 0f; Program.game.xRenderMaster.RegisterAboveSorted(this.xColorOverlayBlack); } string sText = "During my thousand years of captivity \nnot once did I doubt \nmy saviour would be the greed of humans.\n \n \nAt last, the time is nigh \nfor artifacts to rule mankind."; this.xFunMessageTextBatch = new TextBatch(FontManager.GetFont(FontManager.FontType.Reg7), sText, Color.White, -1, new float[0]); this.xFunMessageTextBatch.MakeTextCentered(240); this.xFunMessageTextBatch.OverridePosition(0); Program.game.xSoundSystem.PlayInterfaceCue("Gund4m_Startup_Short"); this.xHead.xOwner.bUpdateInCutscene = true; if (this.xHead.iCounter > 21) { this.xHead.iCounter = 20; } this.xLeftHand.xOwner.xTransform.v2Pos = this.xLeftHand.v2StartPos; this.xRightHand.xOwner.xTransform.v2Pos = this.xRightHand.v2StartPos; this.xHead.xBody.xRenderComponent.AsAnimated().SwitchAnimation(13, Animation.CancelOptions.IgnoreIfPlaying); this.iLerpColorCounter = 30; this.xHead.xOwner.xRenderComponent.cColor = Color.White; this.xLeftHand.xOwner.xRenderComponent.fVirtualHeight = 0f; this.xRightHand.xOwner.xRenderComponent.fVirtualHeight = 0f; this.xHead.xRightScreen.xRenderComponent.AsAnimated().SwitchAnimation(1, Animation.CancelOptions.IgnoreIfPlaying); this.xHead.xLeftScreen.xRenderComponent.AsAnimated().SwitchAnimation(1, Animation.CancelOptions.IgnoreIfPlaying); this.xHead.xMidScreen.xRenderComponent.AsAnimated().SwitchAnimation(1, Animation.CancelOptions.IgnoreIfPlaying); this.iBlackState = 0; if (this.xColorOverlayBlack != null) { this.xColorOverlayBlack.fAlpha = 0f; } if (this.xColorOverlayWhite != null) { this.xColorOverlayWhite.fAlpha = 0f; } if (this.xNiceOverlay != null) { this.xNiceOverlay.fAlpha = 0f; Program.game.xRenderMaster.UnregisterRenderComponenent(this.xNiceOverlay); } Program.game.xRenderMaster.UnregisterRenderComponenent(this.xRenderFunction); this.iState = 1000; this.OnInstruction(100, new float[0]); this.OnInstruction(104, new float[0]); }
public DelayedFadeInRenderComponent(RenderComponent rcComponent, int iDelay, int iFadeTime, float fStartAlpha = 0f, float fEndAlpha = 1f) { this.iFadeTime = iFadeTime; this.fStartAlpha = fStartAlpha; this.fEndAlpha = fEndAlpha; this.iFadeInDelay = iDelay; this.rc = rcComponent; }
public ShadowSlaveRenderComponent(RenderComponent p_xParentComponent) { if (p_xParentComponent.enType != RenderComponent.ComponentType.AnimatedRenderComponent && p_xParentComponent.enType != RenderComponent.ComponentType.PlayerRenderComponent) { throw new Exception("ShadowSlave assigned to a non-animated component!"); } this.xParentComponent = p_xParentComponent; }
public ProximityBasedAlpha(RenderComponent rcComponent, TransformComponent xTransformA, TransformComponent xTransformB, float fFullAlphaDistance, float fNoAlphaDistance, float fAlphaMultiplier = 1f) { this.rc = rcComponent; this.xTransformA = xTransformA; this.xTransformB = xTransformB; this.fFullAlphaDistance = fFullAlphaDistance; this.fNoAlphaDistance = fNoAlphaDistance; this.fAlphaMultiplier = fAlphaMultiplier; }
public FlagSet() { this.xRC = new DelegateRenderComponent(new DelegateRenderComponent.RenderDelegate(this.Render)); Program.game.xRenderMaster.RegisterGUIRenderComponent(this.xRC); IEnumerable<FlagCodex.FlagID> values = Enum.GetValues(typeof(FlagCodex.FlagID)).Cast<FlagCodex.FlagID>(); foreach (FlagCodex.FlagID en in values) { this.lenFlags.Add(en); } }
public VFX_GenericGhostImage(Vector2 v2Pos, RenderComponent xParent, float fFadeSpeed, float fStartAlpha, Color cCol) : base() { this.fFadeSpeed = 0.03f; this.xTransform = new TransformComponent(v2Pos); SnatchRenderComponent xStat = new SnatchRenderComponent(xParent, this.xTransform); this.xRenderComponent = xStat; this.xRenderComponent.fVirtualHeight = xParent.fVirtualHeight; this.xRenderComponent.cColor = cCol; this.xRenderComponent.fAlpha = fStartAlpha; this.xRenderComponent.v2OffsetRenderPos = xParent.v2OffsetRenderPos; this.fFadeSpeed = fFadeSpeed; Program.GetTheGame().xRenderMaster.RegisterSortedRenderComponent(this.xRenderComponent); }
public void Init() { this.InitFenceParts(); this.xNiceOverlay = new StaticRenderComponent(CAS.RegionContent.Load<Texture2D>("Bkg/Zone009_FlyingTemple/Inside/BossRoom/overlay"), new TransformComponent(Vector2.Zero)); this.xNiceOverlay.v2Offset = Vector2.Zero; Program.game.xRenderMaster.RegisterBackground(this.xNiceOverlay); this.xNiceOverlay.fAlpha = 0.9f; this.xRenderFunction = new DelegateRenderComponent(new DelegateRenderComponent.RenderDelegate(this.Render)); Program.game.xRenderMaster.RegisterAboveAllRenderComponent(this.xRenderFunction); this.colPillar = new BoxCollider(new Rectangle(309, 327, 23, 15)); Program.game.xCollisionMaster.RegisterStaticCollider(this.colPillar); this.colPathBarrierMos = new BoxCollider(new Rectangle(279, 400, 84, 18)); if (this.xColorOverlayWhite == null) { this.xColorOverlayWhite = new OverlayRenderComponent(new Rectangle(0, 0, 640, 360), Color.White); this.xColorOverlayWhite.fAlpha = 0f; Program.game.xRenderMaster.RegisterAboveSorted(this.xColorOverlayWhite); } if (this.xColorOverlayBlack == null) { this.xColorOverlayBlack = new OverlayRenderComponent(new Rectangle(0, 0, 640, 360), Color.Black); this.xColorOverlayBlack.fAlpha = 0f; Program.game.xRenderMaster.RegisterAboveSorted(this.xColorOverlayBlack); } string sText = "During my thousand years of captivity \nnot once did I doubt \nmy saviour would be the greed of humans.\n \n \nAt last, the time is nigh \nfor artifacts to rule mankind."; this.xFunMessageTextBatch = new TextBatch(FontManager.GetFont(FontManager.FontType.Reg7), sText, Color.White, -1, new float[0]); this.xFunMessageTextBatch.MakeTextCentered(240); this.xFunMessageTextBatch.OverridePosition(0); }
public SnatchRenderComponent(RenderComponent p_xParentComponent, TransformComponent p_xTransform) { this.xParentComponent = p_xParentComponent; this.xTransform = p_xTransform; Program.GetTheGame().xRenderMaster.lxTextureSnatchers.Add(this); }
public WhiteFadeInWatcher(RenderComponent rcComponent, int iFadeInEnd) { this.iFadeInEnd = iFadeInEnd; this.rc = rcComponent; }
public void RegisterGUIRenderComponent(RenderComponent p_toAdd, bool bToBack) { if (bToBack) { this.lxGUIRenderComponents.Insert(0, p_toAdd); } else { this.lxGUIRenderComponents.Add(p_toAdd); } p_toAdd.bRegistered = true; }
public override void OnAdd() { if (!Program.game.xGameSessionData.henActiveFlags.Contains(FlagCodex.FlagID._MainStory_Winterland_ToyFactoryBeatToyMachine)) { for (int i = 0; i < 4; i++) { this.lxCandyBarsBot.Add((SortedAnimated)Program.game._EffectMaster_AddEffect(new SortedAnimated(new Vector2((float)(302 + 11 * i), 345f), SortedAnimated.SortedAnimatedEffects._Blocks_Polka))); this.lxCandyBarsBot[i].xRenderComponent.AsAnimated().SwitchAnimation(3); } Program.game.xCollisionMaster.RegisterStaticCollider(this.colBottomCollider); } for (int j = 0; j < this.lxCandyBarsBot.Count; j++) { this.lxCandyBarsBot[j].xRenderComponent.AsAnimated().SwitchAnimation(0); } this.xColorOverlayWhite = new OverlayRenderComponent(new Rectangle(0, 0, 640, 360), Color.White); this.xColorOverlayWhite.fAlpha = 0f; Program.game.xRenderMaster.RegisterAboveSorted(this.xColorOverlayWhite); this.xLeftLamp = (Program.game._EffectMaster_AddEffect(new SortedAnimated(new Vector2(129f, 90f), SortedAnimated.SortedAnimatedEffects._Unique_ToyFactory_WarningLamp)) as SortedAnimated); this.xRightLamp = (Program.game._EffectMaster_AddEffect(new SortedAnimated(new Vector2(496f, 89f), SortedAnimated.SortedAnimatedEffects._Unique_ToyFactory_WarningLamp)) as SortedAnimated); this.xLeftLamp.xRenderComponent.fVirtualHeight = (this.xRightLamp.xRenderComponent.fVirtualHeight = 30f); new ToyFactoryTrainStuffBagman.Train(Vector2.Zero, Vector2.Zero, 0f, ToyFactoryTrainStuffBagman.Train.GraphicType.Cart01).xRenderComponent.Unregister(); new ToyFactoryTrainStuffBagman.Train(Vector2.Zero, Vector2.Zero, 0f, ToyFactoryTrainStuffBagman.Train.GraphicType.Engine01).xRenderComponent.Unregister(); this.lxSwitches.Add(new ToyFactoryTrainStuffBagman.SwitchRail(new Vector2(122f, 230f), 2)); TrainSwitchLever xSwitchLever = Program.game._EntityMaster_AddDynamicEnvironment(DynamicEnvironmentCodex.ObjectTypes.RailRoadSwitchLever, new Vector2(108f, 220f)) as TrainSwitchLever; xSwitchLever.SetInfo(this.lxSwitches[this.lxSwitches.Count - 1], this.lxTrains); xSwitchLever.bUnlocked = true; xSwitchLever.xRenderComponent.SwitchAnimation(8); xSwitchLever.xRenderComponent.fVirtualHeight = -20f; xSwitchLever.xCollisionComponent.DeactivateGroup(CollisionComponent.ColliderGroup.All); this.lxTrainSwitchLevers.Add(xSwitchLever); this.lxSwitches.Add(new ToyFactoryTrainStuffBagman.SwitchRail(new Vector2(190f, 232f), 0)); xSwitchLever = (Program.game._EntityMaster_AddDynamicEnvironment(DynamicEnvironmentCodex.ObjectTypes.RailRoadSwitchLever, new Vector2(197f, 220f)) as TrainSwitchLever); xSwitchLever.SetInfo(this.lxSwitches[this.lxSwitches.Count - 1], this.lxTrains); xSwitchLever.bUnlocked = true; xSwitchLever.xRenderComponent.SwitchAnimation(9); xSwitchLever.xRenderComponent.fVirtualHeight = -20f; xSwitchLever.xCollisionComponent.DeactivateGroup(CollisionComponent.ColliderGroup.All); this.lxTrainSwitchLevers.Add(xSwitchLever); this.lxSwitches.Add(new ToyFactoryTrainStuffBagman.SwitchRail(new Vector2(305f, 181f), 2)); xSwitchLever = (Program.game._EntityMaster_AddDynamicEnvironment(DynamicEnvironmentCodex.ObjectTypes.RailRoadSwitchLever, new Vector2(312f, 207f)) as TrainSwitchLever); xSwitchLever.SetInfo(this.lxSwitches[this.lxSwitches.Count - 1], this.lxTrains); xSwitchLever.xRenderComponent.SwitchAnimation(8); xSwitchLever.xRenderComponent.fVirtualHeight = -20f; xSwitchLever.bUnlocked = true; xSwitchLever.xCollisionComponent.DeactivateGroup(CollisionComponent.ColliderGroup.All); this.lxTrainSwitchLevers.Add(xSwitchLever); this.lxSwitches.Add(new ToyFactoryTrainStuffBagman.SwitchRail(new Vector2(420f, 232f), 0)); xSwitchLever = (Program.game._EntityMaster_AddDynamicEnvironment(DynamicEnvironmentCodex.ObjectTypes.RailRoadSwitchLever, new Vector2(427f, 220f)) as TrainSwitchLever); xSwitchLever.SetInfo(this.lxSwitches[this.lxSwitches.Count - 1], this.lxTrains); xSwitchLever.bUnlocked = true; xSwitchLever.xRenderComponent.SwitchAnimation(9); xSwitchLever.xRenderComponent.fVirtualHeight = -20f; xSwitchLever.xCollisionComponent.DeactivateGroup(CollisionComponent.ColliderGroup.All); this.lxTrainSwitchLevers.Add(xSwitchLever); this.lxSwitches.Add(new ToyFactoryTrainStuffBagman.SwitchRail(new Vector2(489f, 230f), 2)); xSwitchLever = (Program.game._EntityMaster_AddDynamicEnvironment(DynamicEnvironmentCodex.ObjectTypes.RailRoadSwitchLever, new Vector2(517f, 220f)) as TrainSwitchLever); xSwitchLever.SetInfo(this.lxSwitches[this.lxSwitches.Count - 1], this.lxTrains); xSwitchLever.bUnlocked = true; xSwitchLever.xRenderComponent.SwitchAnimation(8); xSwitchLever.xRenderComponent.fVirtualHeight = -20f; xSwitchLever.xCollisionComponent.DeactivateGroup(CollisionComponent.ColliderGroup.All); this.lxTrainSwitchLevers.Add(xSwitchLever); this.xRightSwitch = new ToyFactoryTrainStuffBagman.SwitchRail(new Vector2(420f, 293f), 2); this.lxSwitches.Add(this.xRightSwitch); this.xLeftSwitch = new ToyFactoryTrainStuffBagman.SwitchRail(new Vector2(190f, 294f), 2); this.lxSwitches.Add(this.xLeftSwitch); this.lxSwitches.Add(new ToyFactoryTrainStuffBagman.SwitchRail(new Vector2(86f, 232f), 0)); this.lxSwitches[this.lxSwitches.Count - 1].bIsStatic = true; this.lxSwitches.Add(new ToyFactoryTrainStuffBagman.SwitchRail(new Vector2(87f, 295f), 3)); this.lxSwitches[this.lxSwitches.Count - 1].bIsStatic = true; this.lxSwitches.Add(new ToyFactoryTrainStuffBagman.SwitchRail(new Vector2(252f, 294f), 2)); this.lxSwitches[this.lxSwitches.Count - 1].bIsStatic = true; this.lxSwitches.Add(new ToyFactoryTrainStuffBagman.SwitchRail(new Vector2(252f, 183f), 0)); this.lxSwitches[this.lxSwitches.Count - 1].bIsStatic = true; this.lxSwitches.Add(new ToyFactoryTrainStuffBagman.SwitchRail(new Vector2(527f, 231f), 1)); this.lxSwitches[this.lxSwitches.Count - 1].bIsStatic = true; this.lxSwitches.Add(new ToyFactoryTrainStuffBagman.SwitchRail(new Vector2(527f, 293f), 2)); this.lxSwitches[this.lxSwitches.Count - 1].bIsStatic = true; this.lxSwitches.Add(new ToyFactoryTrainStuffBagman.SwitchRail(new Vector2(360f, 294f), 3)); this.lxSwitches[this.lxSwitches.Count - 1].bIsStatic = true; this.lxSwitches.Add(new ToyFactoryTrainStuffBagman.SwitchRail(new Vector2(359f, 182f), 1)); this.lxSwitches[this.lxSwitches.Count - 1].bIsStatic = true; }
public void RegisterGUIRenderComponent(RenderComponent p_toAdd) { this.RegisterGUIRenderComponent(p_toAdd, false); }
public override void OnInstruction(byte byInstructionID, params float[] afParams) { if (byInstructionID == 0) { this.iTurnCounter = 1; return; } if (byInstructionID == 1) { return; } if (byInstructionID == 2) { return; } if (byInstructionID == 3) { if (this.xColorOverlayRed == null) { this.xColorOverlayRed = new OverlayRenderComponent(new Rectangle(0, 0, 640, 360), Color.Red); this.xColorOverlayRed.fAlpha = 0f; Program.game.xRenderMaster.RegisterBelowSorted(this.xColorOverlayRed); RenderComponent r = (Program.game.xLevelMaster.denxNamedEntities[NPCCodex.NPCTypes.GuestOrSign05] as StaticEnvironment).xRenderComponent; Program.game.xRenderMaster.UnregisterRenderComponenent(r); Program.game.xRenderMaster.RegisterBelowSorted(r); r = (Program.game.xLevelMaster.denxNamedEntities[NPCCodex.NPCTypes.GuestOrSign06] as StaticEnvironment).xRenderComponent; Program.game.xRenderMaster.UnregisterRenderComponenent(r); Program.game.xRenderMaster.RegisterBelowSorted(r); } Program.game.xEntityMaster.dbyxBagmen[1].OnInstruction(1, new float[0]); return; } if (byInstructionID == 4) { if (this.xColorOverlayWhite == null) { ((this.xPhaseman as Boss).xHPRenderComponent as MiniBossHPRenderComponent).bForceClose = true; this.xColorOverlayWhite = new OverlayRenderComponent(new Rectangle(0, 0, 640, 360), Color.White); this.xColorOverlayWhite.fAlpha = 0f; Program.game.xRenderMaster.RegisterBelowSorted(this.xColorOverlayWhite); this.xPhaseman.xRenderComponent.SetEffect(Program.game.dsxEffects["FlashWhite"], 6); this.xPhaseman.xRenderComponent.dsfFloatShaderParameters["WhiteGrade"] = 0f; this.xPhaseman.iHitEffect = 0; return; } } else if (byInstructionID == 5) { this.bFadeOutYo = true; Program.game.xRenderMaster.UnregisterRenderComponenent(this.xColorOverlayRed); this.xColorOverlayRed = null; if (!this.bHasDroppedStuff) { this.bHasDroppedStuff = true; Program.game._Enemy_DropLoot(this.xPhaseman); this.xPhaseman.bDropsAnyLoot = false; return; } } else if (byInstructionID == 6) { Program.game.xRenderMaster.UnregisterRenderComponenent(this.xColorOverlayWhite); Program.game.xRenderMaster.UnregisterRenderComponenent(this.xColorOverlayRed); RenderComponent r2 = (Program.game.xLevelMaster.denxNamedEntities[NPCCodex.NPCTypes.GuestOrSign05] as StaticEnvironment).xRenderComponent; Program.game.xRenderMaster.UnregisterRenderComponenent(r2); Program.game.xRenderMaster.RegisterSortedRenderComponent(r2); r2 = (Program.game.xLevelMaster.denxNamedEntities[NPCCodex.NPCTypes.GuestOrSign06] as StaticEnvironment).xRenderComponent; Program.game.xRenderMaster.UnregisterRenderComponenent(r2); Program.game.xRenderMaster.RegisterSortedRenderComponent(r2); foreach (PlayerView x in Program.game.dixPlayers.Values) { if (x.xViewStats.bIsDead) { Program.game._Player_CombatRevivePlayer(x); } } if (!this.bHasDroppedStuff) { this.bHasDroppedStuff = true; Program.game._Enemy_DropLoot(this.xPhaseman); this.xPhaseman.bDropsAnyLoot = false; return; } } else { if (byInstructionID == 7) { Program.game._Dialogue_EnterWorldDialogue("", true); Program.game.xDialogueSystem.SetPopUpDialogue(new GotSkillRenderComponent("PhaseShift")); return; } if (byInstructionID == 8) { float fDistance = 120f; float fVelocity = 3f; float fTime = fDistance / fVelocity; Vector2 v2Origin = Program.game.xLocalPlayer.xEntity.xTransform.v2Pos + new Vector2(0f, -22f); Program.game._EffectMaster_AddEffect(new _Effect_MovingAnimated(v2Origin - new Vector2(0f, 1f) * fDistance, SortedAnimated.SortedAnimatedEffects._EnemyEffects_Boss_PhasemanOrbGetEffect, new Vector2(0f, 1f) * fVelocity, (int)fTime, 10, 1f)); Program.game._EffectMaster_AddEffect(new _Effect_MovingAnimated(v2Origin - new Vector2(0f, -1f) * fDistance, SortedAnimated.SortedAnimatedEffects._EnemyEffects_Boss_PhasemanOrbGetEffect, new Vector2(0f, -1f) * fVelocity, (int)fTime, 10, 1f)); Program.game._EffectMaster_AddEffect(new _Effect_MovingAnimated(v2Origin - new Vector2(1f, 0f) * fDistance, SortedAnimated.SortedAnimatedEffects._EnemyEffects_Boss_PhasemanOrbGetEffect, new Vector2(1f, 0f) * fVelocity, (int)fTime, 10, 1f)); Program.game._EffectMaster_AddEffect(new _Effect_MovingAnimated(v2Origin - new Vector2(-1f, 0f) * fDistance, SortedAnimated.SortedAnimatedEffects._EnemyEffects_Boss_PhasemanOrbGetEffect, new Vector2(-1f, 0f) * fVelocity, (int)fTime, 10, 1f)); Program.game._EffectMaster_AddEffect(new _Effect_MovingAnimated(v2Origin - Vector2.Normalize(new Vector2(-0.5f, -0.5f)) * fDistance, SortedAnimated.SortedAnimatedEffects._EnemyEffects_Boss_PhasemanOrbGetEffect, Vector2.Normalize(new Vector2(-0.5f, -0.5f)) * fVelocity, (int)fTime, 10, 1f)); Program.game._EffectMaster_AddEffect(new _Effect_MovingAnimated(v2Origin - Vector2.Normalize(new Vector2(0.5f, -0.5f)) * fDistance, SortedAnimated.SortedAnimatedEffects._EnemyEffects_Boss_PhasemanOrbGetEffect, Vector2.Normalize(new Vector2(0.5f, -0.5f)) * fVelocity, (int)fTime, 10, 1f)); Program.game._EffectMaster_AddEffect(new _Effect_MovingAnimated(v2Origin - Vector2.Normalize(new Vector2(-0.5f, 0.5f)) * fDistance, SortedAnimated.SortedAnimatedEffects._EnemyEffects_Boss_PhasemanOrbGetEffect, Vector2.Normalize(new Vector2(-0.5f, 0.5f)) * fVelocity, (int)fTime, 10, 1f)); Program.game._EffectMaster_AddEffect(new _Effect_MovingAnimated(v2Origin - Vector2.Normalize(new Vector2(0.5f, 0.5f)) * fDistance, SortedAnimated.SortedAnimatedEffects._EnemyEffects_Boss_PhasemanOrbGetEffect, Vector2.Normalize(new Vector2(0.5f, 0.5f)) * fVelocity, (int)fTime, 10, 1f)); return; } if (byInstructionID == 9) { this.xOrbMos.bToBeDestroyed = true; } } }
public void Follow(RenderComponent xRCToFollow, float fAtHeight) { this.xFollowThis = xRCToFollow; this.xRenderComponent.fVirtualHeight = xRCToFollow.fVirtualHeight; this.xRenderComponent.v2OffsetRenderPos.Y = -fAtHeight; }
public VFX_GenericGhostImage(Vector2 v2Pos, RenderComponent xParent) : this(v2Pos, xParent, 0.03f, 0.7f) { }
public void RegisterShadowLayer(RenderComponent p_toAdd, int iLayer = 60) { if (!this.dilxShadowLayers.ContainsKey(iLayer)) { this.dilxShadowLayers.Add(iLayer, new List<RenderComponent>()); } this.dilxShadowLayers[iLayer].Add(p_toAdd); p_toAdd.bRegistered = true; }
public void RegisterParallax(RenderComponent p_toAdd) { this.lxParallax.Add(p_toAdd); p_toAdd.bRegistered = true; }
public void ReArrange(RenderComponent xNewRC, RenderMaster.SubRenderLayer enLayer) { this.xRenderComponent.Unregister(); Program.game.xRenderMaster.RegisterComponent(enLayer, xNewRC); this.xRenderComponent = xNewRC; }
public HorizontalAppearWatcher(RenderComponent rcComponent, int iFadeInEnd) { this.iFadeInEnd = iFadeInEnd; this.rc = rcComponent; }
public RecolorWrapperRC(RenderComponent p_xParentComponent, PlayerView xView) { this.xParentComponent = p_xParentComponent; this.xView = xView; }
public void RegisterSortedRenderComponent(RenderComponent p_toAdd) { if (p_toAdd.bRegistered) { return; } this.lxSortedRenderComponents.Add(p_toAdd); p_toAdd.bRegistered = true; }
public void UnregisterRenderComponenent(RenderComponent p_toUnregister) { if (p_toUnregister == null) { return; } this.lxParallax.Remove(p_toUnregister); this.lxBackground.Remove(p_toUnregister); foreach (List<RenderComponent> lxShadowLayer in this.dilxShadowLayers.Values) { lxShadowLayer.Remove(p_toUnregister); } this.lxBelowSorted.Remove(p_toUnregister); this.lxSortedRenderComponents.Remove(p_toUnregister); this.lxAboveSorted.Remove(p_toUnregister); this.lxGUIRenderComponents.Remove(p_toUnregister); this.lxAboveAll.Remove(p_toUnregister); this.lxDynamicLights.Remove(p_toUnregister); p_toUnregister.bRegistered = false; }
public UpdateRenderComponent(RenderComponent xRCToUpdate) { this.xRCToUpdate = xRCToUpdate; }
public AnimatedAttackPhase(RenderComponent p_xRC, IEntity p_xOwner) : base(p_xOwner) { this.xRC = p_xRC; }
public ScaleInRenderComponent(RenderComponent rcComponent, int iFadeInEnd) { this.iFadeInEnd = iFadeInEnd; this.rc = rcComponent; }
public override void Update() { if (this.iTurnCounter > 0) { this.iTurnCounter++; if (Vector2.Distance(this.xPhaseman.xTransform.v2Pos, new Vector2(1018f, 263f)) < this.v2CurMoveMos.Length()) { this.iTurnCounter = 0; this.xPhaseman.xTransform.v2Pos = new Vector2(1018f, 263f); return; } if (this.v2CurMoveMos.X < 6f) { this.v2CurMoveMos.X = this.v2CurMoveMos.X + 0.6f; } this.xPhaseman.xTransform.v2Pos += this.v2CurMoveMos; this.xPhaseman.xTransform.v2ServerPos = this.xPhaseman.xTransform.v2Pos; } if (!this.bPhasemanDead && this.xPhaseman.xBaseStats.iHP <= 0) { Program.game.xCutsceneMaster.LoadCutscene(CutsceneLibrary.GetCutscene(CutsceneLibrary.CutsceneID._MainStory_SkyTemple_PhaseManOutro)); this.bPhasemanDead = true; if (CAS.NetworkRole != NetworkHelperInterface.NetworkRole.Client) { this.lxLoot = PreSeededLoot.GenerateListFromDropTable(this.xPhaseman.xEnemyDescription.lxLootTable, CAS.RandomInLogic, 100); if (CAS.NetworkRole == NetworkHelperInterface.NetworkRole.Server) { NetOutgoingMessage om = base.CreateMessage(true); om.Write(0); om.Write((byte)this.lxLoot.Count); for (int i = 0; i < this.lxLoot.Count; i++) { om.Write(this.lxLoot[i].iID); om.Write((int)this.lxLoot[i].enItem); om.Write(this.lxLoot[i].v2Direction.X); om.Write(this.lxLoot[i].v2Direction.Y); } base.SendMessage(om); } } } if (this.bFadeOutYo) { if (this.xColorOverlayWhite != null && this.xColorOverlayWhite.fAlpha > 0f) { this.xColorOverlayWhite.fAlpha -= 0.02f; if (this.xColorOverlayWhite.fAlpha < 0f) { this.xColorOverlayWhite.fAlpha = 0f; Program.game.xRenderMaster.UnregisterRenderComponenent(this.xColorOverlayWhite); this.xColorOverlayWhite = null; } } } else if (this.xColorOverlayWhite != null) { this.xPhaseman.iHitEffect = 0; if (this.xColorOverlayWhite.fAlpha < 1f) { this.xColorOverlayWhite.fAlpha += 0.01f; if (this.xColorOverlayWhite.fAlpha > 1f) { this.xColorOverlayWhite.fAlpha = 1f; } this.xPhaseman.iHitEffect = 0; this.xPhaseman.xRenderComponent.cColor = Color.Black; if (this.xPhaseman.xRenderComponent.dsfFloatShaderParameters["WhiteGrade"] < 1f) { this.xPhaseman.xRenderComponent.dsfFloatShaderParameters["WhiteGrade"] = this.xPhaseman.xRenderComponent.dsfFloatShaderParameters["WhiteGrade"] + 0.01f; } } else { this.iBeenWhiteCounter++; this.xPhaseman.xRenderComponent.ClearEffect(); this.xPhaseman.xRenderComponent.cColor = Color.Black; if (this.iBeenWhiteCounter > 30 && this.xPhaseman.xRenderComponent.fAlpha > 0f) { this.xPhaseman.xRenderComponent.fAlpha -= 0.02f; if (this.xPhaseman.xRenderComponent.fAlpha < 0f) { this.xPhaseman.xRenderComponent.fAlpha = 0f; } } } } if (this.xColorOverlayRed != null && this.xColorOverlayRed.fAlpha < 0.35f) { this.xColorOverlayRed.fAlpha += 0.01f; if (this.xColorOverlayRed.fAlpha >= 0.35f) { this.xColorOverlayRed.fAlpha = 0.35f; } } }
public DuplicateRC(RenderComponent p_xParentComponent, TransformComponent xOverrideTransform) { this.xParentComponent = p_xParentComponent; this.xTransform = xOverrideTransform; }
public override void OnInstruction(byte byInstructionID, params float[] afParams) { if (byInstructionID == 0) { this.iTurnCounter = 1; return; } if (byInstructionID == 1) { this.xBridge.Close(); return; } if (byInstructionID == 2) { this.xBridge.Open(); return; } if (byInstructionID == 3) { if (this.xColorOverlayRed == null) { this.xColorOverlayRed = new OverlayRenderComponent(new Rectangle(0, 0, 640, 360), Color.Red); this.xColorOverlayRed.fAlpha = 0f; Program.game.xRenderMaster.RegisterBelowSorted(this.xColorOverlayRed); RenderComponent r = (Program.game.xLevelMaster.denxNamedEntities[NPCCodex.NPCTypes.GuestOrSign05] as StaticEnvironment).xRenderComponent; Program.game.xRenderMaster.UnregisterRenderComponenent(r); Program.game.xRenderMaster.RegisterBelowSorted(r); r = (Program.game.xLevelMaster.denxNamedEntities[NPCCodex.NPCTypes.GuestOrSign06] as StaticEnvironment).xRenderComponent; Program.game.xRenderMaster.UnregisterRenderComponenent(r); Program.game.xRenderMaster.RegisterBelowSorted(r); return; } } else if (byInstructionID == 4) { if (this.xColorOverlayWhite == null) { ((this.xPhaseman as Boss).xHPRenderComponent as MiniBossHPRenderComponent).bForceClose = true; this.xColorOverlayWhite = new OverlayRenderComponent(new Rectangle(0, 0, 640, 360), Color.White); this.xColorOverlayWhite.fAlpha = 0f; Program.game.xRenderMaster.RegisterBelowSorted(this.xColorOverlayWhite); this.xPhaseman.xRenderComponent.SetEffect(Program.game.dsxEffects["FlashWhite"], 6); this.xPhaseman.xRenderComponent.dsfFloatShaderParameters["WhiteGrade"] = 0f; this.xPhaseman.iHitEffect = 0; return; } } else if (byInstructionID == 5) { this.bFadeOutYo = true; Program.game.xRenderMaster.UnregisterRenderComponenent(this.xColorOverlayRed); this.xColorOverlayRed = null; if (!this.bHasDroppedStuff) { this.bHasDroppedStuff = true; this.xPhaseman.bDropsAnyLoot = false; for (int i = 0; i < this.lxLoot.Count; i++) { Program.game._EntityMaster_AddItem(this.lxLoot[i].iID, this.lxLoot[i].enItem, this.xPhaseman.xTransform.v2Pos, this.xPhaseman.xRenderComponent.fVirtualHeight, this.xPhaseman.xCollisionComponent.ibitCurrentColliderLayer, this.lxLoot[i].v2Direction); } this.xOrbMos = (Program.game._EntityMaster_AddDynamicEnvironment(DynamicEnvironmentCodex.ObjectTypes.FlagTriggerItem_PhaseShiftOrb, this.xPhaseman.xTransform.v2Pos) as FlagTriggerItem); this.xOrbMos.SetInfo(FlagCodex.FlagID._MainStory_FlyingTemple_PhaseShiftObtained, 0); return; } } else if (byInstructionID == 6) { (Program.game.xLevelMaster.denxNamedEntities[NPCCodex.NPCTypes.GuestOrSign02] as PhaseShiftPlate).xRenderComponent.SwitchAnimation(8, Animation.CancelOptions.IgnoreIfPlaying); Program.game.xRenderMaster.UnregisterRenderComponenent(this.xColorOverlayWhite); Program.game.xRenderMaster.UnregisterRenderComponenent(this.xColorOverlayRed); RenderComponent r2 = (Program.game.xLevelMaster.denxNamedEntities[NPCCodex.NPCTypes.GuestOrSign05] as StaticEnvironment).xRenderComponent; Program.game.xRenderMaster.UnregisterRenderComponenent(r2); Program.game.xRenderMaster.RegisterSortedRenderComponent(r2); r2 = (Program.game.xLevelMaster.denxNamedEntities[NPCCodex.NPCTypes.GuestOrSign06] as StaticEnvironment).xRenderComponent; Program.game.xRenderMaster.UnregisterRenderComponenent(r2); Program.game.xRenderMaster.RegisterSortedRenderComponent(r2); foreach (PlayerView x in Program.game.dixPlayers.Values) { if (x.xViewStats.bIsDead) { Program.game._Player_CombatRevivePlayer(x); } } if (!this.bHasDroppedStuff) { this.bHasDroppedStuff = true; this.xPhaseman.bDropsAnyLoot = false; for (int j = 0; j < this.lxLoot.Count; j++) { Program.game._EntityMaster_AddItem(this.lxLoot[j].iID, this.lxLoot[j].enItem, this.xPhaseman.xTransform.v2Pos, this.xPhaseman.xRenderComponent.fVirtualHeight, this.xPhaseman.xCollisionComponent.ibitCurrentColliderLayer, this.lxLoot[j].v2Direction); } this.xOrbMos = (Program.game._EntityMaster_AddDynamicEnvironment(DynamicEnvironmentCodex.ObjectTypes.FlagTriggerItem_PhaseShiftOrb, this.xPhaseman.xTransform.v2Pos) as FlagTriggerItem); this.xOrbMos.SetInfo(FlagCodex.FlagID._MainStory_FlyingTemple_PhaseShiftObtained, 0); return; } } else { if (byInstructionID == 7) { Program.game._Dialogue_EnterWorldDialogue("", true); Program.game.xDialogueSystem.SetPopUpDialogue(new GotSkillRenderComponent("PhaseShift")); return; } if (byInstructionID == 8) { float fDistance = 120f; float fVelocity = 3f; float fTime = fDistance / fVelocity; Vector2 v2Origin = Program.game.xLocalPlayer.xEntity.xTransform.v2Pos + new Vector2(0f, -22f); Program.game._EffectMaster_AddEffect(new _Effect_MovingAnimated(v2Origin - new Vector2(0f, 1f) * fDistance, SortedAnimated.SortedAnimatedEffects._EnemyEffects_Boss_PhasemanOrbGetEffect, new Vector2(0f, 1f) * fVelocity, (int)fTime, 10, 1f)); Program.game._EffectMaster_AddEffect(new _Effect_MovingAnimated(v2Origin - new Vector2(0f, -1f) * fDistance, SortedAnimated.SortedAnimatedEffects._EnemyEffects_Boss_PhasemanOrbGetEffect, new Vector2(0f, -1f) * fVelocity, (int)fTime, 10, 1f)); Program.game._EffectMaster_AddEffect(new _Effect_MovingAnimated(v2Origin - new Vector2(1f, 0f) * fDistance, SortedAnimated.SortedAnimatedEffects._EnemyEffects_Boss_PhasemanOrbGetEffect, new Vector2(1f, 0f) * fVelocity, (int)fTime, 10, 1f)); Program.game._EffectMaster_AddEffect(new _Effect_MovingAnimated(v2Origin - new Vector2(-1f, 0f) * fDistance, SortedAnimated.SortedAnimatedEffects._EnemyEffects_Boss_PhasemanOrbGetEffect, new Vector2(-1f, 0f) * fVelocity, (int)fTime, 10, 1f)); Program.game._EffectMaster_AddEffect(new _Effect_MovingAnimated(v2Origin - Vector2.Normalize(new Vector2(-0.5f, -0.5f)) * fDistance, SortedAnimated.SortedAnimatedEffects._EnemyEffects_Boss_PhasemanOrbGetEffect, Vector2.Normalize(new Vector2(-0.5f, -0.5f)) * fVelocity, (int)fTime, 10, 1f)); Program.game._EffectMaster_AddEffect(new _Effect_MovingAnimated(v2Origin - Vector2.Normalize(new Vector2(0.5f, -0.5f)) * fDistance, SortedAnimated.SortedAnimatedEffects._EnemyEffects_Boss_PhasemanOrbGetEffect, Vector2.Normalize(new Vector2(0.5f, -0.5f)) * fVelocity, (int)fTime, 10, 1f)); Program.game._EffectMaster_AddEffect(new _Effect_MovingAnimated(v2Origin - Vector2.Normalize(new Vector2(-0.5f, 0.5f)) * fDistance, SortedAnimated.SortedAnimatedEffects._EnemyEffects_Boss_PhasemanOrbGetEffect, Vector2.Normalize(new Vector2(-0.5f, 0.5f)) * fVelocity, (int)fTime, 10, 1f)); Program.game._EffectMaster_AddEffect(new _Effect_MovingAnimated(v2Origin - Vector2.Normalize(new Vector2(0.5f, 0.5f)) * fDistance, SortedAnimated.SortedAnimatedEffects._EnemyEffects_Boss_PhasemanOrbGetEffect, Vector2.Normalize(new Vector2(0.5f, 0.5f)) * fVelocity, (int)fTime, 10, 1f)); return; } if (byInstructionID == 9) { this.xOrbMos.bToBeDestroyed = true; } } }
public override void Update() { if (this.iTurnCounter > 0) { this.iTurnCounter++; if (Vector2.Distance(this.xPhaseman.xTransform.v2Pos, new Vector2(1018f, 263f)) < this.v2CurMoveMos.Length()) { this.iTurnCounter = 0; this.xPhaseman.xTransform.v2Pos = new Vector2(1018f, 263f); return; } if (this.v2CurMoveMos.X < 6f) { this.v2CurMoveMos.X = this.v2CurMoveMos.X + 0.6f; } this.xPhaseman.xTransform.v2Pos += this.v2CurMoveMos; this.xPhaseman.xTransform.v2ServerPos = this.xPhaseman.xTransform.v2Pos; } if (!this.bPhasemanDead && this.xPhaseman.xBaseStats.iHP <= 0) { Program.game.xCutsceneMaster.LoadCutscene(CutsceneLibrary.GetCutscene(CutsceneLibrary.CutsceneID._MainStory_SkyTemple_PhaseManOutro)); this.bPhasemanDead = true; } if (this.bFadeOutYo) { if (this.xColorOverlayWhite != null && this.xColorOverlayWhite.fAlpha > 0f) { this.xColorOverlayWhite.fAlpha -= 0.02f; if (this.xColorOverlayWhite.fAlpha < 0f) { this.xColorOverlayWhite.fAlpha = 0f; Program.game.xRenderMaster.UnregisterRenderComponenent(this.xColorOverlayWhite); this.xColorOverlayWhite = null; } } } else if (this.xColorOverlayWhite != null) { this.xPhaseman.iHitEffect = 0; if (this.xColorOverlayWhite.fAlpha < 1f) { this.xColorOverlayWhite.fAlpha += 0.01f; if (this.xColorOverlayWhite.fAlpha > 1f) { this.xColorOverlayWhite.fAlpha = 1f; } this.xPhaseman.iHitEffect = 0; this.xPhaseman.xRenderComponent.cColor = Color.Black; if (this.xPhaseman.xRenderComponent.dsfFloatShaderParameters["WhiteGrade"] < 1f) { this.xPhaseman.xRenderComponent.dsfFloatShaderParameters["WhiteGrade"] = this.xPhaseman.xRenderComponent.dsfFloatShaderParameters["WhiteGrade"] + 0.01f; } } else { this.iBeenWhiteCounter++; this.xPhaseman.xRenderComponent.ClearEffect(); this.xPhaseman.xRenderComponent.cColor = Color.Black; if (this.iBeenWhiteCounter > 30 && this.xPhaseman.xRenderComponent.fAlpha > 0f) { this.xPhaseman.xRenderComponent.fAlpha -= 0.02f; if (this.xPhaseman.xRenderComponent.fAlpha < 0f) { this.xPhaseman.xRenderComponent.fAlpha = 0f; } } } } if (this.xColorOverlayRed != null && this.xColorOverlayRed.fAlpha < 0.35f) { this.xColorOverlayRed.fAlpha += 0.01f; if (this.xColorOverlayRed.fAlpha >= 0.35f) { this.xColorOverlayRed.fAlpha = 0.35f; } } }
public void RegisterDynamicLight(RenderComponent p_toAdd) { this.lxDynamicLights.Add(p_toAdd); p_toAdd.bRegistered = true; }