void shoot(Player player, Vector3 dir) { GameObject proj = (GameObject)Instantiate(projectile, player.transform.position, Quaternion.identity); SkillshotBullet projScript = proj.GetComponent <SkillshotBullet>(); projScript.setSource(player.gameObject); projScript.seek(dir); projScript.setDamage(damage); projScript.setRange(range); projScript.setTargetTag(player.targetTag); projScript.setIgnoreArmor(false); projScript.setExplosionRadius(explosionRadius); projScript.setPlayerShot(true); if (level == 3) { projScript.setPctDistanceDamage(pctDamage); projScript.setPctDistanceDamage(pctDistanceDamage); } proj.transform.localScale *= level; }
void shoot(Player player, Vector3 dir) { GameObject proj = (GameObject)Instantiate(level == 3 ? projectileMissile : projectileBullet, player.transform.position, Quaternion.identity); SkillshotBullet projScript = proj.GetComponent <SkillshotBullet>(); projScript.setSource(player.gameObject); proj.transform.localScale /= 1.6f; projScript.seek(dir); projScript.setDamage(damagePerProjectile); projScript.setRange(range); projScript.setTargetTag(player.targetTag); projScript.setIgnoreArmor(false); projScript.setPlayerShot(true); if (level >= 2) { ArmorShredBuff buff = new ArmorShredBuff(2, armorShred); projScript.setBuffToApply(buff); } projScript.setExplosionRadius(level == 3 ? explosionRadius : 0f); projScript.setChanceToImpactEffect(level == 3 ? .2f : 1f); }