public void AddBuffable(IBuffable buff, float timer, int value)
 {
     // Setup when the buff should finish
     buff.FinishTime = Time.time + timer;
     buff.value = value;
     buffables.Add(buff);
 }
示例#2
0
 public virtual void OnApply(IBuffable owner, GameObject ownerGameObject, SpriteRenderer ownerRenderer,
                             Navigation navigation = null)
 {
     _owner           = owner;
     _ownerGameObject = ownerGameObject;
     _ownerRenderer   = ownerRenderer;
     _navigation      = navigation;
 }
示例#3
0
    public void BuffToken()
    {
        IBuffable buffableUnit = _hitInfo.transform.GetComponent <IBuffable>();

        if (buffableUnit != null)
        {
            ICommand buffCommand = new BuffCommand(buffableUnit);
            _commandInvoker.ExecuteCommand(buffCommand);
        }
    }
    public void BuffToken()
    {
        // note, this search only works if the collider and IBuffable component are attached to the same gameObject
        IBuffable buffableUnit = _hitInfo.transform.GetComponent <IBuffable>();

        //if we have the token, command it to buff
        if (buffableUnit != null)
        {
            ICommand buffCommand = new BuffCommand(buffableUnit);
            _commandInvoker.ExecuteCommand(buffCommand);
        }
    }
示例#5
0
    public override void OnApply(IBuffable owner, GameObject ownerGameObject, SpriteRenderer ownerRenderer,
                                 Navigation navigation = null)
    {
        base.OnApply(owner, ownerGameObject, ownerRenderer, navigation);

        _fireParticleInstance = Instantiate(_fireParticleSystemPrefab, ownerGameObject.transform).GetComponent <ParticleSystem>();

        ParticleSystem.ShapeModule shape = _fireParticleInstance.shape;
        shape.spriteRenderer = ownerRenderer;

        _timePassed    = _tickInterval;
        _movingToPoint = false;
    }
示例#6
0
 private void OnCollisionEnter2D(Collision2D collision)
 {
     if (collision.gameObject.tag == "Enemy")
     {
         enemyScript = collision.gameObject.GetComponent <Enemy>();
         DMG(25);
     }
     if (collision.gameObject.GetComponent <IBuffable>() != null)
     {
         IBuffable buff = collision.gameObject.GetComponent <IBuffable>();
         buff.Buff(this.gameObject);
         Destroy(collision.gameObject);
     }
 }
    public override void Activate(ITargetable target)
    {
        //test if target
        IBuffable objectToBuff = target as IBuffable;

        // apply buff
        if (objectToBuff != null)
        {
            objectToBuff.Buff(_buffAmount);
            Debug.Log("Healed Target");
        }
        else
        {
            Debug.Log("Target is not healable...");
        }
    }
示例#8
0
 protected override void ApplyBonus(IBonus bonus, IBuffable buffable)
 {
     buffable.ApplyBonus <HealthSystem>(bonus);
 }
示例#9
0
 /// <summary>
 /// TODO The apply buff.
 /// </summary>
 /// <param name="buffable">
 /// TODO The buffable.
 /// </param>
 public void ApplyBuff(IBuffable buffable)
 {
 }
示例#10
0
 public BuffCommand(IBuffable buffableToken)
 {
     _buffableToken = buffableToken;
 }
示例#11
0
 public void AddBuffable(IBuffable buff, float timer)
 {
     // Setup when the buff should finish.(current time + timer)
     buff.FinishTime = Time.time + timer;
     buffables.Add(buff);
 }
示例#12
0
 public override void OnApply(IBuffable owner, GameObject ownerGameObject, SpriteRenderer ownerRenderer,
                              Navigation navigation = null)
 {
     base.OnApply(owner, ownerGameObject, ownerRenderer, navigation);
 }