private void Splash() { PoisonSplash tmp = GameObject.Instantiate(splashPrefab, target.transform.position, Quaternion.identity); tmp.Damage = splashDamage; Physics2D.IgnoreCollision(target.GetComponent <Collider2D>(), tmp.GetComponent <Collider2D>()); }
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); } }
/// <summary> /// Spawns a splash on the ground /// </summary> private void Splash() { //Spawns the splash at the monster's position PoisonSplash tmp = GameObject.Instantiate(splashPrefab, target.transform.position, Quaternion.identity) as PoisonSplash; //Sets the damage equal to the splash damage tmp.Damage = splashDamage; //Makes sure that the monster that spawned the splash can't collide with it Physics2D.IgnoreCollision(target.GetComponent <Collider2D>(), tmp.GetComponent <Collider2D>()); }
/// <summary> /// The poison debuff's constructor /// </summary> /// <param name="splashDamage">The damage that the splash will dow</param> /// <param name="tickTime">how often the debuff will tick</param> /// <param name="splashPrefab">Prefab for the splash</param> /// <param name="target">The target that we will apply de thebuff til</param> /// <param name="duration">The duration of the debuff</param> public PoisonDebuff(int splashDamage, float tickTime, PoisonSplash splashPrefab, Monster target, float duration) : base(duration, target) { this.splashDamage = splashDamage; this.tickTime = tickTime; this.splashPrefab = splashPrefab; }
private int splashDamage; //표식 데미지 public PoisonDebuff(int splashDamage, float tickTime, PoisonSplash splashPrefab, float duration, Monster target) : base(target, duration) { //독타워 디버프 this.splashDamage = splashDamage; this.tickTime = tickTime; this.splashPrefab = splashPrefab; }
public PoisonDebuff(int splashDamage, float tickTime, PoisonSplash splashPrefab, float duration, Virus target) : base(target, duration) { this.splashDamage = splashDamage; this.tickTime = tickTime; this.splashPrefab = splashPrefab; }
public PoisonDebuff(float tickTime, float tickDamage, float duration, PoisonSplash splashPrefab, Mob target) : base(target, duration) { this.tickTime = tickTime; this.tickDamage = tickDamage; this.splashPrefab = splashPrefab; }
public PoisonDebuff(float splashDamage, float tickTime, PoisonSplash splashPrefab, float duration, Ship target) : base(target, 1) { this.splashDamage = splashDamage; this.splash = splashPrefab; this.tickTime = tickTime; }