protected override void ApplyEffect()
    {
        //Add speed increase to MovementComponent
        ScriptableSpeedBuff speedBuff = (ScriptableSpeedBuff)Buff;

        _movementComponent.MovementSpeed += speedBuff.SpeedIncrease;
    }
    public override void Activate()
    {
        //Add speed increase to MovementComponent
        ScriptableSpeedBuff speedBuff = (SpeedBuff)buff;

        movementComponent.moveSpeed += speedBuff.SpeedIncrease;
    }
    public override void End()
    {
        //Revert speed increase
        ScriptableSpeedBuff speedBuff = (ScriptableSpeedBuff)Buff;

        _movementComponent.MovementSpeed -= speedBuff.SpeedIncrease * EffectStacks;
        EffectStacks = 0;
    }
Example #4
0
    public override void End()
    {
        //Revert speed increase
        ScriptableSpeedBuff speedBuff = (ScriptableSpeedBuff)Buff;

        player.moveSpeed -= speedBuff.SpeedIncrease * EffectStacks;
        EffectStacks      = 0;
    }
Example #5
0
    protected override void ApplyEffect()
    {
        //Add speed increase to MovementComponent
        ScriptableSpeedBuff speedBuff = (ScriptableSpeedBuff)Buff;

        //_movementComponent.MovementSpeed += speedBuff.SpeedIncrease;


        _entity.SetArmorAmount(speedBuff.SpeedIncrease + _entity.GetArmorAmount());
    }
Example #6
0
    public override void End()
    {
        //Revert speed increase
        ScriptableSpeedBuff speedBuff = (ScriptableSpeedBuff)Buff;

        //_movementComponent.MovementSpeed -= speedBuff.SpeedIncrease * EffectStacks;

        _entity.SetArmorAmount(_entity.GetArmorAmount() - speedBuff.SpeedIncrease);

        EffectStacks = 0;
    }
 public void applyPassiveBuff()
 {
     if (buffSelector == buffs.speedBuff)
     {
         ScriptableSpeedBuff buff = (ScriptableSpeedBuff)ScriptableObject.CreateInstance(typeof(ScriptableSpeedBuff));
         buff.Duration      = Mathf.Infinity;
         buff.SpeedIncrease = 3;
         playerBuffs.AddBuff(buff.InitializeBuff(playerBuffs.gameObject));
     }
     else if (buffSelector == buffs.healthBuff)
     {
         ScriptableHealthBuff buff = (ScriptableHealthBuff)ScriptableObject.CreateInstance(typeof(ScriptableHealthBuff));
         buff.Duration       = Mathf.Infinity;
         buff.HealthIncrease = 10;
         playerBuffs.AddBuff(buff.InitializeBuff(playerBuffs.gameObject));
     }
     else if (buffSelector == buffs.shootBuff)
     {
         ScriptableShootSpeedBuff buff = (ScriptableShootSpeedBuff)ScriptableObject.CreateInstance(typeof(ScriptableShootSpeedBuff));
         buff.Duration           = Mathf.Infinity;
         buff.ShootSpeedIncrease = -0.9f;
         playerBuffs.AddBuff(buff.InitializeBuff(playerBuffs.gameObject));
     }
 }
Example #8
0
 public SpeedBuff(BuffContainer container) : base(container)
 {
     engine   = container.Obj.GetComponent <BoatEngine>();
     settings = (ScriptableSpeedBuff)container.Buff;
 }
 public TimedSpeedBuff(float duration, ScriptableBuff buff, GameObject obj) : base(duration, buff, obj)
 {
     //Getting MovementComponent, replace with your own implementation
     movementComponent = obj.GetComponent <MovementComponent>();
     speedBuff         = (ScriptableSpeedBuff)buff;
 }