Exemplo n.º 1
0
        public void StartBattle()
        {
            statModifiers.Clear();
            StatusEffects.Clear();
            calculateStatsFromModifiers();

            BattleEntity = new Entity(ResourceManager.GetNewSkeleton(Data.BattleSkeletonName), new Vector2());
            BattleEntity.Skeleton.SetSkin(Data.BattleSkeletonSkinName);
            BattleEntity.Scale    = new Vector2(0.6f);
            BattleEntity.Altitude = Data.BattleAltitude;
            if (Data.BattleShadowFollowBoneName != null && Data.BattleShadowFollowBoneName.Length > 0)
            {
                BattleEntity.ShadowFollowBone = BattleEntity.Skeleton.FindBone(Data.BattleShadowFollowBoneName);
            }

            updateBattleEntitySkeleton();

            HurtThisTurn = false;

            hasIdleWeaponAnimation = BattleEntity.Skeleton.Data.FindAnimation("idle_weapon") != null;
            hasIdleShieldAnimation = BattleEntity.Skeleton.Data.FindAnimation("idle_shield") != null;
            hasHurtWeaponAnimation = BattleEntity.Skeleton.Data.FindAnimation("hurt_weapon") != null;
            hasHurtShieldAnimation = BattleEntity.Skeleton.Data.FindAnimation("hurt_shield") != null;
            BattleEntity.AnimationState.SetAnimation(GetBattleEntityIdleAnimationName(), true);
            BattleEntity.AnimationState.Time = (float)Game1.Random.NextDouble();
        }
Exemplo n.º 2
0
 public void StartOverworld(Vector2 entityPosition)
 {
     if (Data.OverworldSpriteName != null && Data.OverworldSpriteName.Length > 0)
     {
         OverworldEntity = new Entity(ResourceManager.GetNewSprite(Data.OverworldSpriteName), entityPosition);
     }
     else
     {
         OverworldEntity = new Entity(ResourceManager.GetNewSkeleton(Data.OverworldSkeletonName), entityPosition);
         Rectangle customBoundingBox = OverworldEntity.GetBoundingBoxAt(Vector2.Zero);
         customBoundingBox.Height         /= 4;
         customBoundingBox.Y              += customBoundingBox.Height * 3;
         OverworldEntity.CustomBoundingBox = customBoundingBox;
         OverworldEntity.Scale             = new Vector2(0.3f);
     }
 }