示例#1
0
 internal override void PassiveEffect()
 {
     if (GetComponent <KartShoot>() != null && GetComponent <KartShoot>().shotBullet != null)
     {
         if (GetComponent <KartShoot>().shotBullet.GetComponent <StatEffectBurn>() == null)
         {
             StatEffectBurn burnEffect = GetComponent <KartShoot>().shotBullet.AddComponent <StatEffectBurn>();
             burnEffect.damagePerSecond = damagePerSecond;
             burnEffect.duration        = duration;
             burnEffect.statVisual      = burnVisual;
         }
     }
 }
示例#2
0
文件: Bullet.cs 项目: datnewb/Kartus
 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;
                 }
             }
         }
     }
 }