public ProjectileBase()
 {
     target   = null;
     speed    = 4;
     damage   = 0;
     isHoming = true;
 }
Beispiel #2
0
 void Tick()
 {
     if (building == Building.done)
     {
         attackTime += Time.deltaTime;
         if (attackTime > (1 / attackSpeed))
         {
             attackTime = 0;
             attack     = true;
         }
         if (attack == true)
         {
             hasTarget = PickTarget();
             if (hasTarget)
             {
                 for (int i = 0; i < attackProjectiles; i++)
                 {
                     if (targets.Count - 1 < i)
                     {
                         break;
                     }
                     target = targets[i];
                     ShootProjectile();
                     attack = false;
                 }
             }
         }
     }
     else
     {
         Build();
     }
 }
 public ProjectileBase(mobBase target, float speed, float damage, bool isHoming)
 {
     this.target   = target;
     this.speed    = speed;
     this.damage   = damage;
     this.isHoming = isHoming;
 }
Beispiel #4
0
 public void RemoveMob(mobBase mob)
 {
     if (mobs.Contains(mob))
     {
         mobs.Remove(mob);
     }
 }
Beispiel #5
0
    public static void RemoveMob(mobBase oldMob)
    {
        Vector2Int gridPos = TerrainGen.GetGridPosition2D(oldMob.thisHex);

        RemoveMobFromGrid(oldMob, gridPos);
        mobList.Remove(oldMob);
        oldMob.transform.SetParent(deadMobs.transform);
        oldMob.gameObject.SetActive(false);
        deadMobList.Add(oldMob);
        allMobs.name = "Mobs: (" + mobList.Count + " / " + deadMobList.Count + ") = " + (deadMobList.Count + mobList.Count);
        //Debug.Log("Dead mobs " + deadMobList.Count);
    }
 public void SetProjectile(mobBase target, float speed, float damage, float areaEffect, int chainCount, float chainDistanceMin, float chainDistanceMax, int forkCount, int forkProjectiles, float forkLoss, bool isHoming, bool isInstant)
 {
     this.target           = target;
     this.speed            = speed;
     this.damage           = damage;
     this.areaEffect       = areaEffect;
     this.chainCount       = chainCount;
     this.chainDistanceMin = chainDistanceMin;
     this.chainDistanceMax = chainDistanceMax;
     this.forkCount        = forkCount;
     this.forkProjectiles  = forkProjectiles;
     this.forkDamageLoss   = forkLoss;
     this.isHoming         = isHoming;
     this.isInstant        = isInstant;
     if (chainCount > 0)
     {
         chainList = new List <mobBase>();
     }
 }
Beispiel #7
0
 public static void AddMob(mobBase newMob)
 {
     mobList.Add(newMob);
 }
Beispiel #8
0
 public static void RemoveMobFromGrid(mobBase mob, Vector2Int from)
 {
     mobGrid[from.x, from.y].Remove(mob);
 }
Beispiel #9
0
 public static void MoveMobOnGrid(mobBase mob, Vector2Int from, Vector2Int to)
 {
     mobGrid[from.x, from.y].Remove(mob);
     mobGrid[to.x, to.y].Add(mob);
 }