コード例 #1
0
    public void AddDebuff(string debuff, float slowFactor, PoisonSplash splashPrefab, float tickDamage, float tickTime, float duration)
    {
        Debuff temp;

        switch (debuff)
        {
        case "fire":
            temp = new FireDebuff(tickDamage, tickTime, duration, this);
            break;

        case "ice":
            temp = new IceDebuff(slowFactor, duration, this);
            break;

        case "storm":
            temp = new StormDebuff(this, duration);
            break;

        case "poison":
            temp = new PoisonDebuff(tickDamage, tickTime, splashPrefab, duration, this);
            break;

        default:
            Debug.Log("Debuff error");
            temp = new FireDebuff(tickDamage, tickTime, duration, this);
            break;
        }
        if (!debuffs.Exists(x => x.GetType() == debuff.GetType()))
        {
            newDebuffs.Add(temp);
        }
    }
コード例 #2
0
 public override void ApplyDebuff(Enemy enemy)
 {
     iceDebuff = new IceDebuff(enemy, 0.5f);
     enemy.AddDebuff(iceDebuff);
 }