Beispiel #1
0
 public void FinishBattle()
 {
     statModifiers.Clear();
     StatusEffects.Clear();
     BattleEntity = null;
     HurtThisTurn = false;
 }
Beispiel #2
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();
        }