public override void Load() { fntFinlanderFont = Content.Load <SpriteFont>("Fonts/Finlander Font"); foreach (KeyValuePair <string, Timeline> Timeline in LoadTimelines(typeof(CoreTimeline))) { if (Timeline.Value is AnimationOriginTimeline) { continue; } DicTimeline.Add(Timeline.Key, Timeline.Value); } base.Load(); InitRessources(); for (int L = ListAnimationLayer.Count - 1; L >= 0; --L) { #region Markers foreach (List <Timeline> ListActiveEvent in ListAnimationLayer[L].DicTimelineEvent.Values) { foreach (Timeline ActiveTimeline in ListActiveEvent) { MarkerTimeline ActiveMarkerEvent = ActiveTimeline as MarkerTimeline; if (ActiveMarkerEvent == null) { continue; } switch (ActiveMarkerEvent.MarkerType) { case "Card": ActiveMarkerEvent.Sprite = sprEnemyCard; break; } ActiveMarkerEvent.Sprite = sprEnemyCard; } } #endregion #region Init renderTarget ListAnimationLayer[L].renderTarget = new RenderTarget2D( GraphicsDevice, GraphicsDevice.PresentationParameters.BackBufferWidth, GraphicsDevice.PresentationParameters.BackBufferHeight); #endregion } }
public override void Load() { DicTimeline.Clear(); foreach (KeyValuePair <string, Timeline> Timeline in LoadTimelines(typeof(CoreTimeline))) { if (Timeline.Value is AnimationOriginTimeline) { continue; } DicTimeline.Add(Timeline.Key, Timeline.Value); } foreach (KeyValuePair <string, Timeline> Timeline in LoadTimelines(typeof(TripleThunderTimeline), this)) { DicTimeline.Add(Timeline.Key, Timeline.Value); } base.Load(); if (Content != null) { PrimaryWeapons.Load(Content); SecondaryWeapons.Load(Content); for (int W = 0; W < ListStanceAnimation.Count; ++W) { if (ListStanceAnimation[W].ActiveProjectileInfo != null && ListStanceAnimation[W].ActiveProjectileInfo.ProjectileAnimation.Path != string.Empty) { ListStanceAnimation[W].ActiveProjectileInfo.ProjectileAnimation.Load(Content, "Animations/Sprites/"); ListStanceAnimation[W].NozzleFlashAnimation.Load(Content, "Animations/Sprites/"); } if (ListStanceAnimation[W].ActiveProjectileInfo != null && ListStanceAnimation[W].ActiveProjectileInfo.TrailAnimation != null && ListStanceAnimation[W].ActiveProjectileInfo.TrailAnimation.Path != string.Empty) { ListStanceAnimation[W].ActiveProjectileInfo.TrailAnimation.Load(Content, "Animations/Sprites/"); } if (ListStanceAnimation[W].ExplosionAttributes.ExplosionAnimation.Path != string.Empty) { ListStanceAnimation[W].ExplosionAttributes.ExplosionAnimation.Load(Content, "Animations/Sprites/"); } } } SetAnimation(StandingAnimations.GetDefaultAnimationName()); CurrentMovementInput = MovementInputs.None; ActiveMovementStance = "None"; Update(new GameTime()); SetIdle(); }
public override void Load() { foreach (KeyValuePair <string, Timeline> Timeline in LoadAllTimelines()) { DicTimeline.Add(Timeline.Key, Timeline.Value); } base.Load(); PolygonEffect = new BasicEffect(GraphicsDevice); PolygonEffect.VertexColorEnabled = true; PolygonEffect.TextureEnabled = true; PolygonEffect.View = Matrix.Identity; PolygonEffect.World = Matrix.Identity; InitRessources(); }
public override void Load() { if (IsLoaded) { return; } IsLoaded = true; fntFinlanderFont = Content.Load <SpriteFont>("Fonts/Finlander Font"); sprBarExtraLargeBackground = Content.Load <Texture2D>("Battle/Bars/Extra Long Bar"); sprBarExtraLargeEN = Content.Load <Texture2D>("Battle/Bars/Extra Long Energy"); sprBarExtraLargeHP = Content.Load <Texture2D>("Battle/Bars/Extra Long Health"); sprInfinity = Content.Load <Texture2D>("Battle/Infinity"); foreach (KeyValuePair <string, Timeline> Timeline in LoadTimelines(typeof(CoreTimeline))) { if (Timeline.Value is AnimationOriginTimeline) { continue; } DicTimeline.Add(Timeline.Key, Timeline.Value); } foreach (KeyValuePair <string, Timeline> Timeline in LoadTimelines(typeof(DeathmatchMapTimeline), this, Content)) { DicTimeline.Add(Timeline.Key, Timeline.Value); } base.Load(); InitRessources(); Unit ActiveUnit = AttackingSquad.CurrentLeader; Unit EnemyUnit = EnemySquad.CurrentLeader; for (int L = ListAnimationLayer.Count - 1; L >= 0; --L) { #region Markers foreach (List <Timeline> ListActiveEvent in ListAnimationLayer[L].DicTimelineEvent.Values) { foreach (Timeline ActiveTimeline in ListActiveEvent) { MarkerTimeline ActiveMarkerEvent = ActiveTimeline as MarkerTimeline; if (ActiveMarkerEvent == null) { continue; } string AnimationPath = ""; switch (ActiveMarkerEvent.MarkerType) { case "Support Stand": case "Support Standing": case "Enemy Standing": case "Enemy Stand": case "Enemy Default": ActiveMarkerEvent.AnimationMarker = new AnimationClass(EnemyUnit.Animations.Default.AnimationName); break; case "Enemy Wingman A Standing": case "Enemy Wingman 1 Standing": if (EnemySquad.CurrentWingmanA != null) { ActiveMarkerEvent.AnimationMarker = new AnimationClass(EnemySquad.CurrentWingmanA.Animations.Default.AnimationName); } break; case "Enemy Wingman B Standing": case "Enemy Wingman 2 Standing": if (EnemySquad.CurrentWingmanB != null) { ActiveMarkerEvent.AnimationMarker = new AnimationClass(EnemySquad.CurrentWingmanB.Animations.Default.AnimationName); } break; case "Enemy Hit": if (BattleResult.ArrayResult[0].AttackMissed) { AnimationPath = EnemyUnit.Animations.Default.AnimationName; } else { AnimationPath = EnemyUnit.Animations.Hit.AnimationName; } if (File.Exists("Content/Animations/" + AnimationPath + ".pea")) { ActiveMarkerEvent.AnimationMarker = new AnimationClass(AnimationPath); } else { ActiveMarkerEvent.AnimationMarker = new AnimationClass(EnemyUnit.Animations.Default.AnimationName); } break; case "Player Stand": case "Player Standing": case "Player Default": ActiveMarkerEvent.AnimationMarker = new AnimationClass(ActiveUnit.Animations.Default.AnimationName); break; default: AnimationPath = EnemyUnit.Animations.Default.AnimationName; if (ActiveMarkerEvent.MarkerType.StartsWith("Player ")) { AnimationPath = ActiveMarkerEvent.MarkerType.Split(new string[] { "Player " }, StringSplitOptions.RemoveEmptyEntries)[0]; } ActiveMarkerEvent.AnimationMarker = new AnimationClass(AnimationPath); break; } ActiveMarkerEvent.AnimationMarker.DicTimeline = DicTimeline; ActiveMarkerEvent.AnimationMarker.Load(); } } #endregion #region Quotes foreach (QuoteSetTimeline.QuoteSetKeyFrame ActiveKeyFrame in ((QuoteSetTimeline)ListAnimationLayer.EngineLayer.DicTimelineEvent[0][1]).DicAnimationKeyFrame.Values) { Quote ActiveQuote = ActiveKeyFrame.QuoteSet; int QuoteSetIndex = 0; int QuoteSetCount = 0; //Once a Quote is selected, keep it, if random quotes are needed, use multiple QuoteSet. //If the number of QuoteSet changed, assume the user did something wrong and get a new index. if (ActiveQuote.ListQuoteSet.Count > 1 && QuoteSetCount != ActiveQuote.ListQuoteSet.Count) { QuoteSetCount = ActiveQuote.ListQuoteSet.Count; QuoteSetIndex = Random.Next(ActiveQuote.ListQuoteSet.Count); ActiveQuote.SelectedQuoteSet = QuoteSetIndex; } Quote.Targets ActiveTarget = ActiveQuote.Target; QuoteSet ActiveQuoteSet = ActiveQuote.ActiveQuoteSet; Character ActivePilot = ActiveUnit.Pilot; Character EnemyPilot = EnemyUnit.Pilot; if (ActiveTarget == Quote.Targets.Defender) { ActivePilot = EnemyUnit.Pilot; EnemyPilot = ActiveUnit.Pilot; } bool UseRandomIndex = !ActiveQuoteSet.QuoteSetUseLast && ActiveQuoteSet.QuoteSetChoice == QuoteSet.QuoteSetChoices.Random; QuoteSet.QuoteStyles QuoteStyle = ActiveQuoteSet.QuoteStyle; int QuoteIndex = 0; if (ActiveQuoteSet.QuoteSetChoice == QuoteSet.QuoteSetChoices.Fixed) { QuoteIndex = ActiveQuoteSet.QuoteSetChoiceValue; } Tuple <string, string> ActiveQuoteTuple; switch (QuoteStyle) { case QuoteSet.QuoteStyles.Reaction: QuoteTypes ActiveQuoteType = QuoteTypes.Damaged; ActiveQuoteTuple = GetQuote(ActiveQuoteType, ActivePilot, EnemyPilot, UseRandomIndex, ref QuoteIndex); ActiveQuote.ActiveText = ActiveQuoteTuple.Item2; ActiveQuote.PortraitPath = ActiveQuoteTuple.Item1; break; case QuoteSet.QuoteStyles.QuoteSet: ActiveQuoteTuple = GetAttackQuote(ActiveQuoteSet.QuoteSetName, ActivePilot, EnemyPilot, UseRandomIndex, ref QuoteIndex); ActiveQuote.ActiveText = ActiveQuoteTuple.Item2; ActiveQuote.PortraitPath = ActiveQuoteTuple.Item1; break; case QuoteSet.QuoteStyles.Custom: ActiveQuote.ActiveText = ActiveQuoteSet.CustomText; break; case QuoteSet.QuoteStyles.MoveIn: ActiveQuoteTuple = GetQuote(QuoteTypes.BattleStart, ActivePilot, EnemyPilot, UseRandomIndex, ref QuoteIndex); ActiveQuote.ActiveText = ActiveQuoteTuple.Item2; ActiveQuote.PortraitPath = ActiveQuoteTuple.Item1; break; } if (!string.IsNullOrEmpty(ActiveQuote.PortraitPath)) { if (ActiveQuote.PortraitPath.StartsWith("Animations")) { ActiveQuote.ActiveCharacter = new SimpleAnimation("", ActiveQuote.PortraitPath, new AnimationLooped(ActiveQuote.PortraitPath)); ActiveQuote.ActiveCharacter.ActiveAnimation.Content = Content; ActiveQuote.ActiveCharacter.ActiveAnimation.Load(); } else { ActiveQuote.ActiveCharacter = new SimpleAnimation("", ActiveQuote.PortraitPath, Content.Load <Texture2D>(ActiveQuote.PortraitPath)); } } } #endregion #region Init renderTarget ListAnimationLayer[L].renderTarget = new RenderTarget2D( GraphicsDevice, GraphicsDevice.PresentationParameters.BackBufferWidth, GraphicsDevice.PresentationParameters.BackBufferHeight); #endregion } }
public override void Load() { foreach (KeyValuePair <string, Timeline> Timeline in LoadTimelines(typeof(CoreTimeline))) { if (Timeline.Value is AnimationOriginTimeline) { continue; } DicTimeline.Add(Timeline.Key, Timeline.Value); } base.Load(); InitRessources(); for (int L = ListAnimationLayer.Count - 1; L >= 0; --L) { #region Markers foreach (List <Timeline> ListActiveEvent in ListAnimationLayer[L].DicTimelineEvent.Values) { foreach (Timeline ActiveTimeline in ListActiveEvent) { MarkerTimeline ActiveMarkerEvent = ActiveTimeline as MarkerTimeline; if (ActiveMarkerEvent == null) { continue; } switch (ActiveMarkerEvent.MarkerType) { case "Player Idle": case "Player Stand": case "Player Standing": case "Player Default": ActiveMarkerEvent.AnimationMarker = new AnimationClass("Conquest/" + ActiveUnit.ArmourType + "/Idle"); break; case "Player Attack": case "Player Attacking": ActiveMarkerEvent.AnimationMarker = new AnimationClass("Conquest/" + ActiveUnit.ArmourType + "/Attack"); break; } ActiveMarkerEvent.AnimationMarker.DicTimeline = DicTimeline; ActiveMarkerEvent.AnimationMarker.Load(); } } #endregion #region Init renderTarget ListAnimationLayer[L].renderTarget = new RenderTarget2D( GraphicsDevice, ScreenWidth, ScreenHeight); #endregion } }
public override void Load() { if (IsLoaded) { return; } IsLoaded = true; fntFinlanderFont = Content.Load <SpriteFont>("Fonts/Finlander Font"); sprBarExtraLargeBackground = Content.Load <Texture2D>("Battle/Bars/Extra Long Bar"); sprBarExtraLargeEN = Content.Load <Texture2D>("Battle/Bars/Extra Long Energy"); sprBarExtraLargeHP = Content.Load <Texture2D>("Battle/Bars/Extra Long Health"); sprInfinity = Content.Load <Texture2D>("Battle/Infinity"); foreach (KeyValuePair <string, Timeline> Timeline in LoadTimelines(typeof(CoreTimeline))) { if (Timeline.Value is AnimationOriginTimeline) { continue; } DicTimeline.Add(Timeline.Key, Timeline.Value); } foreach (KeyValuePair <string, Timeline> Timeline in LoadTimelines(typeof(DeathmatchMapTimeline), this, Content)) { DicTimeline.Add(Timeline.Key, Timeline.Value); } base.Load(); InitRessources(); Unit ActiveUnit = AttackingSquad.CurrentLeader; Unit EnemyUnit = EnemySquad.CurrentLeader; for (int L = ListAnimationLayer.Count - 1; L >= 0; --L) { InitMarkers(ListAnimationLayer[L], AttackingSquad, EnemySquad); #region Quotes foreach (QuoteSetTimeline.QuoteSetKeyFrame ActiveKeyFrame in ((QuoteSetTimeline)ListAnimationLayer.EngineLayer.DicTimelineEvent[0][1]).DicAnimationKeyFrame.Values) { Quote ActiveQuote = ActiveKeyFrame.QuoteSet; int QuoteSetIndex = 0; int QuoteSetCount = 0; //Once a Quote is selected, keep it, if random quotes are needed, use multiple QuoteSet. //If the number of QuoteSet changed, assume the user did something wrong and get a new index. if (ActiveQuote.ListQuoteSet.Count > 1 && QuoteSetCount != ActiveQuote.ListQuoteSet.Count) { QuoteSetCount = ActiveQuote.ListQuoteSet.Count; QuoteSetIndex = Random.Next(ActiveQuote.ListQuoteSet.Count); ActiveQuote.SelectedQuoteSet = QuoteSetIndex; } Quote.Targets ActiveTarget = ActiveQuote.Target; QuoteSet ActiveQuoteSet = ActiveQuote.ActiveQuoteSet; Character ActivePilot = ActiveUnit.Pilot; Character EnemyPilot = EnemyUnit.Pilot; if (ActiveTarget == Quote.Targets.Defender) { ActivePilot = EnemyUnit.Pilot; EnemyPilot = ActiveUnit.Pilot; } bool UseRandomIndex = !ActiveQuoteSet.QuoteSetUseLast && ActiveQuoteSet.QuoteSetChoice == QuoteSet.QuoteSetChoices.Random; QuoteSet.QuoteStyles QuoteStyle = ActiveQuoteSet.QuoteStyle; int QuoteIndex = 0; if (ActiveQuoteSet.QuoteSetChoice == QuoteSet.QuoteSetChoices.Fixed) { QuoteIndex = ActiveQuoteSet.QuoteSetChoiceValue; } Tuple <string, string> ActiveQuoteTuple; switch (QuoteStyle) { case QuoteSet.QuoteStyles.Reaction: QuoteTypes ActiveQuoteType = QuoteTypes.Damaged; if (BattleResult.ArrayResult[0].AttackMissed) { ActiveQuoteType = QuoteTypes.Dodge; } ActiveQuoteTuple = GetQuote(ActiveQuoteType, ActivePilot, EnemyPilot, UseRandomIndex, ref QuoteIndex); ActiveQuote.ActiveText = TextHelper.FitToWidth(fntFinlanderFont, ActiveQuoteTuple.Item2, 500); ActiveQuote.PortraitPath = ActiveQuoteTuple.Item1; ActiveQuote.ActiveCharacterName = ActivePilot.Name; break; case QuoteSet.QuoteStyles.QuoteSet: ActiveQuoteTuple = GetAttackQuote(ActiveQuoteSet.QuoteSetName, ActivePilot, EnemyPilot, UseRandomIndex, ref QuoteIndex); ActiveQuote.ActiveText = TextHelper.FitToWidth(fntFinlanderFont, ActiveQuoteTuple.Item2, 500); ActiveQuote.PortraitPath = ActiveQuoteTuple.Item1; ActiveQuote.ActiveCharacterName = ActivePilot.Name; break; case QuoteSet.QuoteStyles.Custom: ActiveQuote.ActiveText = TextHelper.FitToWidth(fntFinlanderFont, ActiveQuoteSet.CustomText, 500); break; case QuoteSet.QuoteStyles.BattleStart: ActiveQuoteTuple = GetQuote(QuoteTypes.BattleStart, ActivePilot, EnemyPilot, UseRandomIndex, ref QuoteIndex); ActiveQuote.ActiveText = TextHelper.FitToWidth(fntFinlanderFont, ActiveQuoteTuple.Item2, 500); ActiveQuote.PortraitPath = ActiveQuoteTuple.Item1; ActiveQuote.ActiveCharacterName = ActivePilot.Name; break; } if (!string.IsNullOrEmpty(ActiveQuote.PortraitPath)) { if (ActiveQuote.PortraitPath.StartsWith("Animations")) { ActiveQuote.ActiveCharacterSprite = new SimpleAnimation("", ActiveQuote.PortraitPath, new AnimationLooped(ActiveQuote.PortraitPath)); ActiveQuote.ActiveCharacterSprite.ActiveAnimation.Content = Content; ActiveQuote.ActiveCharacterSprite.ActiveAnimation.Load(); } else { ActiveQuote.ActiveCharacterSprite = new SimpleAnimation("", ActiveQuote.PortraitPath, Content.Load <Texture2D>(ActiveQuote.PortraitPath)); } } } #endregion #region Init renderTarget ListAnimationLayer[L].renderTarget = new RenderTarget2D( GraphicsDevice, ScreenWidth, ScreenHeight); #endregion } }