示例#1
0
    public virtual void Initialize(Effect parentEffect, LayerMask mask, float life = 0f, float damage = 0f)
    {
        this.parentEffect = parentEffect;
        LayerMask         = mask;
        stats             = new StatCollection();
        stats.Initialize(statTemplate);
        ParentFacing = parentEffect.Source.Facing;


        if (this.parentEffect is EffectAttack)
        {
            EffectAttack attackEffect = this.parentEffect as EffectAttack;
            penetrating  = attackEffect.penetrate;
            numPen       = attackEffect.numPenetrations;
            impactEffect = attackEffect.impactEffectName;
        }


        this.life   = life + stats.GetStatModifiedValue(Constants.BaseStatType.Lifetime);
        this.damage = damage + stats.GetStatModifiedValue(Constants.BaseStatType.BaseDamage);

        if (this.life > 0f)
        {
            Invoke("CleanUp", this.life);
        }
    }
示例#2
0
    protected void SetUpStats()
    {
        ProjectileStats = new StatCollection(gameObject, OnStatChanged, statTemplate);
        maxSpeed        = ProjectileStats.GetStatModifiedValue(BaseStat.StatType.MoveSpeed);

        float life = ProjectileStats.GetStatModifiedValue(BaseStat.StatType.Lifetime);

        if (life > 0)
        {
            Invoke("CleanUp", life);
        }
    }
示例#3
0
 private void OnStatChanged(BaseStat.StatType type, GameObject source)
 {
     if (type == BaseStat.StatType.CoolDown)
     {
         coolDownTimer.SetNewDuration(Stats.GetStatModifiedValue(BaseStat.StatType.CoolDown));
     }
 }