Beispiel #1
0
 public Item(string name, ItemType itemType, EquipmentType equipmentType, Texture2D texture, EntityStats entityStats)
 {
     this.Name          = name;
     this.ItemType      = itemType;
     this.EquipmentType = equipmentType;
     this.Texture       = texture;
     this.Stats         = entityStats;
 }
Beispiel #2
0
        public static EntityStats SumStats(EntityStats e1, EntityStats e2)
        {
            EntityStats newStats = new EntityStats();

            newStats.AttackLevel  = e1.AttackLevel + e2.AttackLevel;
            newStats.AttackSpeed  = e1.AttackSpeed + e2.AttackSpeed;
            newStats.DefenceLevel = e1.DefenceLevel + e2.DefenceLevel;
            newStats.MaxHP        = e1.MaxHP + e2.MaxHP;
            newStats.MagicSpeed   = e1.MagicSpeed + e2.MagicSpeed;
            return(newStats);
        }
Beispiel #3
0
        public static StatsBoost SumStatsB(EntityStats e1, StatsBoost e2)
        {
            StatsBoost newStats = new StatsBoost();

            newStats.AttackLevel  = e1.AttackLevel + e2.AttackLevel;
            newStats.AttackSpeed  = e1.AttackSpeed + e2.AttackSpeed;
            newStats.DefenceLevel = e1.DefenceLevel + e2.DefenceLevel;
            newStats.MaxHP        = e1.MaxHP + e2.MaxHP;
            newStats.MagicSpeed   = e1.MagicSpeed + e2.MagicSpeed;
            return(newStats);
        }
Beispiel #4
0
        // creates and sends a new projectile at a position
        public void ShootNew(Vector2 from, Vector2 to, int speed, int damage, EntityStats playerStats, ProjectileType projectileType)
        {
            // create a projectile and add it to the projectile array
            var proj = new Projectile();

            proj.Sprite.Texture = GetTexture(projectileType);
            proj.Load();
            proj.Transform.Position = from;
            proj.LookAt(to);
            var buffedDamage = (int)((float)damage * (float)(1 + ((float)playerStats.FullStats.AttackLevel / 10)));

            proj.Damage       = buffedDamage;
            proj.Speed        = speed;
            proj.Sprite.Color = new Color(random.Next(200, 255), random.Next(200, 255), 255);
            this.Projectiles.Add(proj);

            if (projectileType != ProjectileType.SporeBomb)
            {
                SceneManager.SoundManager.PlaySound("magic", 0.2f, (float)random.NextDouble(), 0.0f);
            }
        }