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); }
public virtual void OnApply(IBuffable owner, GameObject ownerGameObject, SpriteRenderer ownerRenderer, Navigation navigation = null) { _owner = owner; _ownerGameObject = ownerGameObject; _ownerRenderer = ownerRenderer; _navigation = navigation; }
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); } }
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; }
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..."); } }
protected override void ApplyBonus(IBonus bonus, IBuffable buffable) { buffable.ApplyBonus <HealthSystem>(bonus); }
/// <summary> /// TODO The apply buff. /// </summary> /// <param name="buffable"> /// TODO The buffable. /// </param> public void ApplyBuff(IBuffable buffable) { }
public BuffCommand(IBuffable buffableToken) { _buffableToken = buffableToken; }
public void AddBuffable(IBuffable buff, float timer) { // Setup when the buff should finish.(current time + timer) buff.FinishTime = Time.time + timer; buffables.Add(buff); }
public override void OnApply(IBuffable owner, GameObject ownerGameObject, SpriteRenderer ownerRenderer, Navigation navigation = null) { base.OnApply(owner, ownerGameObject, ownerRenderer, navigation); }