Esempio n. 1
0
    public float Power = 50;//the power of explosion
    public override void Run(Entity entity)
    {
        //Bullet builder
        BulletSystem.Instance.CreateBullet("Fireball")                                      //Create the bullet
        .OnDeath((b) => PhysicsExtension.Explosion(b.transform.position, 10f, 60f * Power)) //when death, explosion
        .Shoot(entity, ShootForce);                                                         //Shoot the bullet


        Debug.Log($"running skill fireball!");
    }
Esempio n. 2
0
 public float Damage   = 10; //the power of explosion
 public override void Run(Entity entity)
 {
     //Bullet builder
     BulletSystem.Instance.CreateBullet("MeleeAttack")                           //Create the bullet
     .DestroyAfterSeconds(0.1f)
     .OnDeath((b) => PhysicsExtension.Explosion(b.transform.position, 10f, 200)) //when death, explosion
     .SetDamage(10)
     .Shoot(entity, 1200);                                                       //Shoot the bullet
     entity.RunWeaponAttackAnimation();
     AudioManager.Instance.PlaySound("attack");
 }
Esempio n. 3
0
 public override void RunUpdate(Entity master, Entity target)
 {
     if (AttackTimer < AttackIntverval)
     {
         AttackTimer += Time.deltaTime;
         return;//stop
     }
     //Attack
     PhysicsExtension.ExplosionExcept(target.transform.position, 5f, 30, target.gameObject);//blow everyone up except self
     Collider[] objects = UnityEngine.Physics.OverlapSphere(target.transform.position, Radius);
     foreach (Collider h in objects)
     {
         Entity e = h.GetComponent <Entity>();
         if (e == null)
         {
             continue;
         }
         if (e == target)
         {
             continue;
         }
         e.Health -= Damage;
     }
 }