Exemplo n.º 1
0
 public void RemoveTarget(AliveEntity target)
 {
     if (isServer)
     {
         Send(new RemoveTarget(target.networkID));
     }
 }
Exemplo n.º 2
0
 public void AddTarget(AliveEntity target)
 {
     if (isServer)
     {
         var rpc = new AddTarget(target.networkID);
         AddTarget(rpc);
         Send(rpc);
     }
 }
Exemplo n.º 3
0
    IEnumerator CastMeteor(AliveEntity target)
    {
        yield return(new WaitForSeconds((float)random.NextDouble()));

        var meteor = Instantiate(pfMeteor);
        var xzSeed = (float)random.NextDouble() * 2 * Mathf.PI;

        if (target == null)
        {
            meteor.transform.position = transform.position + new Vector3(Mathf.Sin(xzSeed), 0, Mathf.Cos(xzSeed)) * (float)random.NextDouble() * 10 + Vector3.up * 50;
        }
        else
        {
            meteor.transform.position = target.transform.position + new Vector3(Mathf.Sin(xzSeed), 0, Mathf.Cos(xzSeed)) * (float)random.NextDouble() + Vector3.up * 50;
        }
        meteor.direction = new Vector3(0, -1, 0);
        meteor.GetComponent <AttackSubject>().owner = this;
    }
Exemplo n.º 4
0
    IEnumerator CastMeteor(AliveEntity target)
    {
        yield return new WaitForSeconds((float)random.NextDouble());

        var meteor = Instantiate(pfMeteor);
        var xzSeed = (float)random.NextDouble() * 2 * Mathf.PI;
        if (target == null)
            meteor.transform.position = transform.position + new Vector3(Mathf.Sin(xzSeed), 0, Mathf.Cos(xzSeed)) * (float)random.NextDouble() * 10 + Vector3.up * 50;
        else
            meteor.transform.position = target.transform.position + new Vector3(Mathf.Sin(xzSeed), 0, Mathf.Cos(xzSeed)) * (float)random.NextDouble() + Vector3.up * 50;
        meteor.direction = new Vector3(0, -1, 0);
        var attackSubject = meteor.GetComponent<AttackSubject>();
        attackSubject.owner = this;
        attackSubject.damageCalculator = t => t + 17;
    }
Exemplo n.º 5
0
 void ApplyDamage(AliveEntity target)
 {
     target.Damage(new Damage(Damage.Type.Physical, owner.weaponType, owner.owner, damageCalculator(owner.attackDamage), 0, knockdown));
 }
Exemplo n.º 6
0
 void ApplyDamage(AliveEntity target)
 {
     target.Damage(new Damage(Damage.Type.Physical, owner.weaponType, owner.owner, damageCalculator(owner.attackDamage), 0, knockdown));
 }
Exemplo n.º 7
0
 public TargetDamagePair(AliveEntity target, float accumulatedDamage)
 {
     this.target            = target;
     this.accumulatedDamage = accumulatedDamage;
 }