internal override void ActiveEffect() { GameObject corrosiveBombInstance = Network.Instantiate(corrosiveBomb, GetComponent <KartGun>().bulletSpawnPoint.position, GetComponent <KartGun>().bulletSpawnPoint.rotation, 0) as GameObject; corrosiveBombInstance.GetComponent <CharacterTeam>().team = GetComponent <CharacterTeam>().team; corrosiveBombInstance.GetComponent <Bullet>().SetDamage(damage); corrosiveBombInstance.GetComponent <Bullet>().ownerKartType = KartType.Player; corrosiveBombInstance.GetComponent <Rigidbody>().AddForce(corrosiveBombInstance.transform.forward * corrosiveBombSpeed, ForceMode.VelocityChange); StatEffectSlow slow = corrosiveBombInstance.AddComponent <StatEffectSlow>(); slow.torqueDecrease = torqueDecrease; slow.topSpeedDecrease = topSpeedDecrease; slow.duration = effectDuration; }
internal override void ActiveEffect() { GameObject empMissileInstance = Network.Instantiate(empMissile, GetComponent <KartGun>().bulletSpawnPoint.position, GetComponent <KartGun>().bulletSpawnPoint.rotation, 0) as GameObject; empMissileInstance.GetComponent <CharacterTeam>().team = GetComponent <CharacterTeam>().team; empMissileInstance.GetComponent <Bullet>().SetDamage(damage); empMissileInstance.GetComponent <Bullet>().ownerKartType = KartType.Player; empMissileInstance.GetComponent <Rigidbody>().AddForce(empMissileInstance.transform.forward * empMissileSpeed, ForceMode.VelocityChange); StatEffectSkillDisable skillDisable = empMissileInstance.AddComponent <StatEffectSkillDisable>(); skillDisable.duration = effectDuration; StatEffectSlow slow = empMissileInstance.AddComponent <StatEffectSlow>(); slow.duration = effectDuration; }
internal void ApplyStatEffect(GameObject target) { if (GetComponent <StatEffect>() != null) { foreach (StatEffect statEffect in GetComponents <StatEffect>()) { if (statEffect.GetType() == typeof(StatEffectBurn)) { StatEffectBurn burnEffect = null; if (!statEffect.isStacking && target.GetComponent <StatEffectBurn>() != null) { burnEffect = target.GetComponent <StatEffectBurn>(); } else { burnEffect = target.AddComponent <StatEffectBurn>(); } if (burnEffect != null) { burnEffect.duration = statEffect.duration; burnEffect.damagePerSecond = ((StatEffectBurn)statEffect).damagePerSecond; burnEffect.statVisual = statEffect.statVisual; } } else if (statEffect.GetType() == typeof(StatEffectSlow)) { StatEffectSlow slow = null; if (!statEffect.isStacking && target.GetComponent <StatEffectSlow>() != null) { slow = target.GetComponent <StatEffectSlow>(); } else { slow = target.AddComponent <StatEffectSlow>(); } if (slow != null) { slow.duration = statEffect.duration; slow.torqueDecrease = ((StatEffectSlow)statEffect).torqueDecrease; slow.topSpeedDecrease = ((StatEffectSlow)statEffect).topSpeedDecrease; slow.statVisual = statEffect.statVisual; } } else if (statEffect.GetType() == typeof(StatEffectSkillDisable)) { StatEffectSkillDisable skillDisable = null; if (!statEffect.isStacking && target.GetComponent <StatEffectSkillDisable>() != null) { skillDisable = target.GetComponent <StatEffectSkillDisable>(); } else { skillDisable = target.AddComponent <StatEffectSkillDisable>(); } if (skillDisable != null) { skillDisable.duration = statEffect.duration; skillDisable.statVisual = statEffect.statVisual; } } } } }