Exemplo n.º 1
0
 private void Check_lives(Mobs.Mob_Base monster)
 {
     Player.Lives       -= monster.Lives_value;
     MonsterCounter.Text = Player.Lives.ToString();
     if (Player.Lives <= 0)
     {
         Console.WriteLine("No lives. Ending game");
         WaveServices.Platform.Exit();
     }
 }
Exemplo n.º 2
0
 private void Check_death(Mobs.Mob_Base monster)
 {
     if (monster.HP > 0)
     {
         Check_lives(monster);
     }
     else
     {
         Player.Add_gold(monster.Monster_gold);
         MoneyCounter.Text = Player.Gold.ToString();
     }
 }
Exemplo n.º 3
0
        public int Get_Damage(Mobs.Mob_Base Monster, Entity Monsters_set)
        {
            if (Tower_bullet.Bullet_access)
            {
                Tower_bullet.Bullet_speed_x = Tower_bullet.Bullet_speed_y = Tower_bullet.Bullet_speed;
                if (Tower_target == "" || Monster.Mob.Name == Tower_target)
                {
                    int Pos_x = (int)Monster.Mob.FindComponent <Transform2D>().X;
                    int Pos_y = (int)Monster.Mob.FindComponent <Transform2D>().Y;

                    if ((Check_Range(Pos_x, Pos_y)) &&
                        (!Tower_bullet.Bullet.Enabled) &&
                        (Tower_target == ""))
                    {
                        Get_values(Monster.Mob.Name);
                    }

                    Get_directions(Pos_x, Pos_y, Monsters_set);

                    if (Tower_target != "")
                    {
                        if (((Get_hit(Pos_x, Pos_y,
                                      (int)Tower_bullet.Bullet_bitmap.X,
                                      (int)Tower_bullet.Bullet_bitmap.Y)) &&
                             Tower_bullet.Bullet.Enabled) ||
                            (Monsters_set.FindChild(Tower_target).Enabled == false))
                        {
                            if (Monster.Mob.Name == Tower_target)
                            {
                                Monster.HP -= Tower_bullet.Bullet_damage;
                            }
                            Reset_values();
                            return(Tower_bullet.Bullet_damage);
                        }
                        else
                        {
                            return(0);
                        }
                    }
                }
            }
            return(0);
        }
Exemplo n.º 4
0
 private bool Check_monster(Mobs.Mob_Base monster, int i)
 {
     if ((monster.Grid_x == Level.ending_x && monster.Grid_y == Level.ending_y) || (monster.HP <= 0))
     {
         for (int j = 0; j < TowersList.Count; j++)
         {
             if (TowersList[j].Tower_target == monster.Mob.Name)
             {
                 TowersList[j].Reset_values();
             }
         }
         Check_death(monster);
         monster.Mob.Enabled = false;
         Static.Functions.Swap(MonsterList, i, MonsterList.Count - 1);
         return(true);
     }
     else
     {
         return(false);
     }
 }