private void DotTarget(_Unit unitToAttack, string dotSpell)
 {
     if (this.Player.CanUse(dotSpell) && !unitToAttack.GotDebuff(dotSpell))
     {
         this.Player.Cast(dotSpell);
     }
 }
示例#2
0
    public void InitiateArcher()
    {
        GM    = GameObject.Find("Game Manager").GetComponent <_GameManager>();
        Class = GM.GetUnitClass(this.gameObject);

        MaxHealth    = 25;
        Health       = MaxHealth;
        AttackDamage = 20;
        Range        = 40;
        AttackSpeed  = 5f;

        ProjectileSpeed = 100;

        Nav = GetComponent <NavMeshAgent>();
    }
示例#3
0
    public void InitiateKnight()
    {
        GM    = GameObject.Find("Game Manager").GetComponent <_GameManager>();
        Class = GM.GetUnitClass(this.gameObject);

        MaxHealth    = 50;
        Health       = MaxHealth;
        AttackDamage = 10;
        Range        = 3;
        AttackSpeed  = 1.5f;

        ProjectileSpeed = 0;

        Nav = GetComponent <NavMeshAgent>();
    }
示例#4
0
        public bool Add(_Unit unit)
        {
            bool          isAdd         = false;
            SqlConnection sqlConnection = new SqlConnection(connectionString);
            string        query         = "INSERT INTO tblUnit(Units)" +
                                          "VALUES('" + unit.Units + "')";
            SqlCommand sqlCommand = new SqlCommand(query, sqlConnection);

            sqlConnection.Open();
            int isExecute = sqlCommand.ExecuteNonQuery();

            if (isExecute > 0)
            {
                isAdd = true;
            }
            sqlConnection.Close();
            return(isAdd);
        }
        public List <_Unit> LoadUnit()
        {
            List <_Unit> units = new List <_Unit>();

            SqlConnection sqlConnection = new SqlConnection(connectionString);

            sqlConnection.Open();
            string     commandString = @"SELECT * FROM tblUnit";
            SqlCommand sqlCommand    = new SqlCommand(commandString, sqlConnection);

            SqlDataReader sqlDataReader = sqlCommand.ExecuteReader();

            while (sqlDataReader.Read())
            {
                _Unit unit = new _Unit();
                unit.Units = sqlDataReader["Units"].ToString();
                units.Add(unit);
            }

            sqlConnection.Close();
            return(units);
        }
示例#6
0
        public List <_Unit> Display()
        {
            List <_Unit> units = new List <_Unit>();

            SqlConnection sqlConnection = new SqlConnection(connectionString);

            sqlConnection.Open();
            string     query      = "SELECT * FROM tblUnit";
            SqlCommand sqlCommand = new SqlCommand(query, sqlConnection);

            SqlDataReader sqlDataReader = sqlCommand.ExecuteReader();

            while (sqlDataReader.Read())
            {
                _Unit unit = new _Unit();
                unit.Id    = Convert.ToInt32(sqlDataReader["Id"]);
                unit.Units = sqlDataReader["Units"].ToString();

                units.Add(unit);
            }
            sqlConnection.Close();

            return(units);
        }
示例#7
0
 public _Move(GameObject _owner, _Unit _ownerScript)
 {
     Owner       = _owner;
     OwnerScript = _ownerScript;
 }
示例#8
0
 public _HoldPosition(GameObject _owner, _Unit _ownerScript)
 {
     Owner       = _owner;
     OwnerScript = _ownerScript;
 }
 public bool Add(_Unit unit)
 {
     return(_unitRepository.Add(unit));
 }