Exemplo n.º 1
0
 public BattleAnimationScreen(ConquestMap Map, UnitConquest ActiveUnit, UnitConquest EnemyUnit,
                              string ActiveTerrain, bool HorizontalMirror, AnimationScreen ActiveUnitAnimation, AnimationScreen EnemyUnitAnimation)
     : this(Map, ActiveUnit, EnemyUnit, 2, 2, ActiveTerrain, HorizontalMirror)
 {
     this.ActiveUnitAnimation = ActiveUnitAnimation;
     this.EnemyUnitAnimation  = EnemyUnitAnimation;
 }
Exemplo n.º 2
0
        public override void Load()
        {
            BackgroundRight = Content.Load <Texture2D>("Animations/Background Sprites/AW/Countryside road");
            BackgroundLeft  = Content.Load <Texture2D>("Animations/Background Sprites/AW/Countryside road");

            int ActiveUnitHP            = (int)Math.Ceiling(ActiveUnit.HP / 10d);
            int ActiveUnitHPAfterDamage = (int)Math.Ceiling((ActiveUnit.HP - DamageTakenSelf) / 10d);
            int EnemyUnitHP             = (int)Math.Ceiling(EnemyUnit.HP / 10d);
            int EnemyUnitHPAfterDamage  = (int)Math.Ceiling((EnemyUnit.HP - DamageTakenEnemy) / 10d);

            ActiveUnitAnimation = new AnimationScreen("Conquest/" + ActiveUnit.ArmourType + "/Attack by HP/" + ActiveUnitHP + " HP", ActiveUnit, ActiveTerrain, HorizontalMirror);
            ActiveUnitAnimation.Load();
            ActiveUnitAnimation.UpdateKeyFrame(0);

            AnimationScreen ActiveUnitAnimationAfterDamage = new AnimationScreen("Conquest/" + ActiveUnit.ArmourType + "/Idle by HP/" + Math.Max(0, ActiveUnitHPAfterDamage) + " HP", ActiveUnit, ActiveTerrain, HorizontalMirror);

            ActiveUnitAnimationAfterDamage.Load();
            ActiveUnitAnimationAfterDamage.UpdateKeyFrame(0);

            AnimationClass ActiveUnitAnimationDeath = new AnimationScreen("Conquest/" + ActiveUnit.ArmourType.ToString() + "/Death", ActiveUnit, ActiveTerrain, HorizontalMirror);

            ActiveUnitAnimationDeath.Load();
            ActiveUnitAnimationDeath.UpdateKeyFrame(0);

            EnemyUnitAnimation = new AnimationScreen("Conquest/" + ActiveUnit.ArmourType + "/Idle by HP/" + EnemyUnitHP + " HP", EnemyUnit, ActiveTerrain, !HorizontalMirror);
            EnemyUnitAnimation.Load();
            EnemyUnitAnimation.UpdateKeyFrame(0);

            //Todo, load Idle or Attacking animation depending of the situaton
            AnimationScreen EnemyUnitAnimationAfterDamage = new AnimationScreen("Conquest/" + ActiveUnit.ArmourType + "/Idle by HP/" + Math.Max(0, EnemyUnitHPAfterDamage) + " HP", EnemyUnit, ActiveTerrain, !HorizontalMirror);

            EnemyUnitAnimationAfterDamage.Load();
            EnemyUnitAnimationAfterDamage.UpdateKeyFrame(0);

            AnimationClass EnemyUnitAnimationDeath = new AnimationClass("Conquest/" + EnemyUnit.ArmourType.ToString() + "/Death");

            EnemyUnitAnimationDeath.DicTimeline = EnemyUnitAnimation.DicTimeline;
            EnemyUnitAnimationDeath.Load();

            InitBattleAnimation(EnemyUnitAnimation, EnemyUnitAnimationAfterDamage, "Conquest/" + EnemyUnit.ArmourType.ToString() + "/Death");

            InitBattleAnimation(ActiveUnitAnimation, ActiveUnitAnimationAfterDamage, "Conquest/" + ActiveUnit.ArmourType.ToString() + "/Death");
        }