示例#1
0
 protected override void UpdateBulletStatus(ProjectileBase projectile)
 {
     base.UpdateBulletStatus(projectile);
     projectile.SetDamage(projectile.GetDamage() * currentChargeLevel);
     projectile.SetExplosionRadius(currentChargeLevel);
     projectile.transform.localScale = projectile.GetInitialSize() * (1 + currentChargeLevel * .25f);
 }
示例#2
0
 public virtual void OnHit(Entity projectileEntity, ProjectileBase projectile)
 {
     this.Update(() =>
     {
         Health -= projectile.GetDamage(Entity, this);
         if (Health <= 0)
         {
             SoundEffects.Get("RockBreaking")?.Play();
             OnDie();
             Entity.Delete();
         }
     });
 }
示例#3
0
 protected override void Shoot()
 {
     // base.Shoot();
     charging.Stop();
     //GameObject bulletGO = Instantiate(bulletPrefab, firePoint.position, firePoint.rotation);
     for (int i = 0; i < bullets.Count; i++)
     {
         if (!bullets[i].activeInHierarchy)
         {
             GameObject     _bullet    = bullets[i];
             ProjectileBase projectile = _bullet.GetComponent <ProjectileBase>();
             _bullet.transform.position = firePoint.position;
             _bullet.transform.rotation = firePoint.rotation;
             _bullet.SetActive(true);
             projectile.SetDamage(projectile.GetDamage() * currentChargeLevel);
             Debug.Log(projectile.GetDamage());
             projectile.SetDurability(currentChargeLevel);
             projectile.SetTarget(target);
             shoot.Play();
             break;
         }
     }
 }
示例#4
0
 public void OnHit(Entity projectileEntity, ProjectileBase projectile)
 {
     _ship.Damage(GridLocation, (int)Math.Floor(projectile.GetDamage(Entity, this)));
 }