示例#1
0
    new private void Start()
    {
        base.Start();

        attack  = new Attack(0.5f, 1, 0, 1.0f, 10, (Attackable attackable) => TargetingFunction.IsEnemy(this, attackable));
        _skills = new[] { attack };
    }
示例#2
0
    new private void Start()
    {
        base.Start();

        //Offensive bonuses

        _faithBonus = new FaithBonus(BuilderHelper.GetBuilderById(CreatorId), 100f, 0.5f);

        List <IOffensiveModifier> modifiers = new List <IOffensiveModifier>
        {
            _faithBonus,
        };

        //Defensive bonuses
        _block = new Block(10f, 1f);

        defensiveModifiers.Add(_block);

        _attack = new Attack(0, 1.0f, this, 10, (Targetable attackable) => TargetingFunction.IsEnemy(this, attackable))
        {
            Modifiers = modifiers
        };

        Skills = new[] { _attack };
    }
示例#3
0
    new private void Start()
    {
        base.Start();

        attack = new Attack(0, 1.0f, this, 10, (Targetable attackable) => TargetingFunction.IsEnemy(this, attackable))
        {
            Effects = new List <Effect> {
                new FaithKill(new ResourceFaith(1), BuilderHelper.GetBuilderById(this.CreatorId), TargetingFunction.IsUnit)
            }
        };
        Skills = new[] { attack };
    }
示例#4
0
    new private void Start()
    {
        base.Start();

        _attack = new Attack(150, 1.0f, this, 14, (Targetable attackable) => TargetingFunction.IsEnemy(this, attackable));
        _heal   = new Heal(240, 1.0f, 0.2f, this, 60f, (Targetable attackable) => TargetingFunction.IsAllyUnit(this, attackable));

        Skills = new Skill[]
        {
            _attack,
            _heal
        };
    }
示例#5
0
    new private void Start()
    {
        base.Start();

        attack = new Attack(0.5f, 1, 150, 1.0f, 14, (Attackable attackable) => TargetingFunction.IsEnemy(this, attackable));
        heal   = new Heal(0f, 0.125f, 240, 1.0f, 60f, (Attackable attackable) => TargetingFunction.IsAlly(this, attackable));

        _skills = new Skill[]
        {
            attack,
            heal
        };
    }
示例#6
0
    new private void Start()
    {
        base.Start();
        List <IOffensiveModifier> modifiers = new List <IOffensiveModifier>();

        CriticalHit criticalHit = new CriticalHit(0.2f, 2.0f);

        modifiers.Add(criticalHit);
        _attack = new Attack(0, 1.0f, this, 45, (Targetable attackable) => TargetingFunction.IsEnemy(this, attackable))
        {
            Modifiers = modifiers
        };

        Skills = new[] { _attack };
    }
示例#7
0
    new private void Start()
    {
        base.Start();
        _infest = new Infest(0, 0, 2.5f, this, 0.3f, TargetingFunction.IsCorpse);
        _attack = new Attack(0, 1.0f / 0.8f, this, 12, (Targetable attackable) => TargetingFunction.IsEnemy(this, attackable))
        {
            Effects = new List <Effect> {
                new Neurotoxin(0.2f, 0.2f, 1, (Targetable attackable) => TargetingFunction.IsEnemyUnit(this, attackable))
                {
                    Duration = 3
                }
            }
        };

        Skills = new[] { _attack };
    }
示例#8
0
    new private void Start()
    {
        base.Start();

        List <IOffensiveModifier> modifiers = new List <IOffensiveModifier>();

        ArmorPierce armorPiercing = new ArmorPierce(0.5f);

        modifiers.Add(armorPiercing);
        attack = new Attack(0.0f, 1.0f / 0.8f, this, 40, (Targetable attackable) => TargetingFunction.IsEnemy(this, attackable))
        {
            Modifiers = modifiers
        };

        Skills = new[] { attack };
    }
示例#9
0
    new private void Start()
    {
        base.Start();

        _attack       = new Attack(150, 1.0f, this, 25, (Targetable attackable) => TargetingFunction.IsEnemy(this, attackable));
        _massHeal     = new MassHeal(240, 1.0f, 0.2f, this, 60f, 75f, (Targetable attackable) => TargetingFunction.IsAllyUnit(this, attackable));
        _overtimeHeal = new OvertimeHeal(2f, (Attackable attackable) => TargetingFunction.IsAllyUnit(this, attackable));
        _healingAura  = new Aura(75f, _overtimeHeal);

        _healingAura.ApplyOnTarget(this);

        Skills = new Skill[]
        {
            _attack,
            _massHeal
        };
    }
示例#10
0
    new private void Start()
    {
        base.Start();
        List <IOffensiveModifier> modifiers = new List <IOffensiveModifier>();

        Defense def       = new Defense(0.2f, (Attackable target) => TargetingFunction.IsAllyUnit(this, target));
        Aura    armorAura = new Aura(80, def);

        armorAura.ApplyOnTarget(this);

        ArmorPierce armorPiercing = new ArmorPierce(0.5f);

        modifiers.Add(armorPiercing);
        _attack = new Attack(0f, 1.0f, this, 45, (Targetable attackable) => TargetingFunction.IsEnemy(this, attackable))
        {
            Modifiers = modifiers
        };

        Skills = new[] { _attack };
    }
示例#11
0
    new private void Start()
    {
        base.Start();
        List <IOffensiveModifier> modifiers = new List <IOffensiveModifier>
        {
            new ArmorPierce(0.5f)
        };

        Zeal       zeal       = new Zeal(0, _attack, 20, 0.03f);
        Surrounded surrounded = new Surrounded(150, this, zeal, (Targetable t) => t is Inquisitor);

        surrounded.ApplyOnTarget(this);

        _attack = new Attack(0f, 1.0f, this, 20, (Targetable attackable) => TargetingFunction.IsEnemy(this, attackable))
        {
            Modifiers = modifiers
        };

        Skills = new[] { _attack };
    }
示例#12
0
    new private void Start()
    {
        base.Start();
        _modifiers = new List <IOffensiveModifier>();

        ArmorPierce armorPiercing = new ArmorPierce(0.6f);

        _modifiers.Add(armorPiercing);

        _attack = new RangeAttack(100, 1f / 0.3f, this, 60, PooledEnum.THROWABLE_WEIGHT, (Targetable attackable) => TargetingFunction.IsEnemy(this, attackable))
        {
            Modifiers = _modifiers
        };

        Skills = new Skill[]
        {
            _attack,
        };
    }
示例#13
0
    new private void Start()
    {
        base.Start();
        List <IOffensiveModifier> modifiers = new List <IOffensiveModifier>();

        CriticalHit criticalHit = new CriticalHit(0.2f, 2.0f);

        modifiers.Add(criticalHit);
        attack  = new Attack(0.5f, 1.0f, 0, 1.0f, 45, modifiers, (Attackable attackable) => TargetingFunction.IsEnemy(this, attackable));
        _skills = new[] { attack };
    }
示例#14
0
文件: Unit.cs 项目: Cauch/CastleFight
 public virtual Targetable MoveTarget()
 {
     return(TargetingFunction.GetClosestTarget(this, CastleHelper.GetCastle(!Allegiance), (Targetable Targetable) => TargetingFunction.IsEnemy(this, Targetable), DetectionRange * DetectionRange));
 }
示例#15
0
    new private void Start()
    {
        base.Start();

        //Offensive bonuses

        _faithBonus = new FaithBonus(Creator, 100f, 0.5f);

        List <IOffensiveModifier> modifiers = new List <IOffensiveModifier>
        {
            _faithBonus,
        };

        //Defensive bonuses
        _block = new Block(10f, 1f);

        defensiveModifiers.Add(_block);

        _attack = new Attack(1f, 1.0f, 0, 1.0f, 10, modifiers, (Attackable attackable) => TargetingFunction.IsEnemy(this, attackable));

        _skills = new[] { _attack };
    }
示例#16
0
    new private void Start()
    {
        base.Start();
        _modifiers = new List <IOffensiveModifier>();

        ArmorPierce armorPiercing = new ArmorPierce(0.6f);

        _modifiers.Add(armorPiercing);

        _attack = new Attack(0.5f, 0.3f, 100, 1.0f, 60, _modifiers, (Attackable attackable) => TargetingFunction.IsEnemy(this, attackable));

        _skills = new Skill[]
        {
            _attack,
        };
    }
示例#17
0
    public static Attackable GetClosestEnemy(Unit attacker)
    {
        Attackable target = attacker.EnemyCastle;

        float closestDistanceSqr = attacker.DetectionRange;

        foreach (Attackable potentialTarget in DetectSurroundings(attacker, (Attackable attackable) => TargetingFunction.IsEnemy(attacker, attackable)))
        {
            Vector3 directionToTarget = potentialTarget.transform.position - attacker.transform.position;
            float   dSqrToTarget      = directionToTarget.sqrMagnitude;
            if (dSqrToTarget < closestDistanceSqr && potentialTarget.gameObject != attacker)
            {
                closestDistanceSqr = dSqrToTarget;
                target             = potentialTarget;
            }
        }

        return(target);
    }