Exemplo n.º 1
0
 public override void onBreakDelay(float deltaTime)
 {
     if (passTime + deltaTime < delayTime)
     {
         passTime += deltaTime;
         onDelay(deltaTime);
     }
     else
     {
         FightScene.instance.audioController.SoundPlay(AudioEunm.groupChaosDelay);
         List <GameObject> players = findRemainEnemys();
         for (int i = 0; i < players.Count; ++i)
         {
             PlayerAttribute attr = players[i].GetComponent <PlayerAttribute>();
             if (attr.seat == brokenSeat)
             {
                 PlayerChildren playerChildren = players[i].GetComponent <PlayerChildren>();
                 playerChildren.title.progressActive(false);
                 attr.isChaos = true;
                 PlayerEffect effect = players[i].GetComponent <PlayerEffect>();
                 if (!effect.isPlay(EffectEunm.CHAOS))
                 {
                     effect.Play(EffectEunm.CHAOS);
                 }
             }
         }
         passTime   = 0;
         needUpdate = (int)SkillEunm.SkillState.BreakDuration;
     }
 }
    public override void onSkill()
    {
        List <GameObject> players = findRemainEnemys();

        FightScene.instance.audioController.SoundPlay(AudioEunm.fiveThunder);
        for (int i = 0; i < players.Count; ++i)
        {
            PlayerAttribute attr = players[i].GetComponent <PlayerAttribute>();
            // 减少当前生命值的50%(向上取整)
            attr.ChangeHp(-Mathf.Floor(attr.hp / 2));
            PlayerChildren children = players[i].GetComponent <PlayerChildren>();
            children.thunder.SetActive(true);
            if (attr.isDied)
            {
                AnimationControl anim = players[i].GetComponent <AnimationControl>();
                anim.Death();
                PlayerAction action = players[i].GetComponent <PlayerAction>();
                action.AfterDeath();
                if (RoomData.isMainRole(attr.seat))
                {
                    FightScene.instance.audioController.SoundPlay(AudioEunm.death);
                }
                FightScene.instance.AddDeath(attr.seat, attr.bounces);
            }
        }
    }
 public void AfterNight()
 {
     directionalLight.GetComponent <Light>().color = Color.white;
     if (attr.inNight)
     {
         if (!RoomData.isMainRole(attr.seat))
         {
             return;
         }
         FightScene.instance.nightScope = -1;
         directionalLight.SetActive(true);
         spotLight.SetActive(false);
         // 关闭角色自发光和角色头顶
         List <GameObject> players = FightScene.instance.Players;
         for (int i = 0; i < players.Count; ++i)
         {
             PlayerAction action = players[i].GetComponent <PlayerAction>();
             action.material.DisableKeyword(Emission);
             PlayerChildren children = players[i].GetComponent <PlayerChildren>();
             children.title.gameObject.SetActive(true);
         }
         // 关闭光线自发光
         List <GameObject> lights = FightScene.instance.Lights;
         for (int i = 0; i < lights.Count; ++i)
         {
             LightManager lightManager = lights[i].GetComponent <LightManager>();
             lightManager.trailMaterial.SetColor(lightManager.tintColor, lightManager.colors[lightManager.colorIndex]);
             lightManager.particle.gameObject.SetActive(true);
         }
     }
 }
    public void AfterDeath()
    {
        PlayerChildren children = GetComponent <PlayerChildren>();

        children.title.gameObject.SetActive(false);
        attr.isEnd = true;
    }
Exemplo n.º 5
0
    public override void onDelay(float deltaTime)
    {
        List <GameObject> players = findRemainEnemys();

        for (int i = 0; i < players.Count; ++i)
        {
            PlayerChildren playerChildren = players[i].GetComponent <PlayerChildren>();
            playerChildren.title.progressView(passTime / delayTime);
        }
    }
Exemplo n.º 6
0
    public override void onSkill()
    {
        BreakOtherSkillRelease();
        FightScene.instance.audioController.SoundPlay(AudioEunm.groupChaosDelay);
        passTime   = 0;
        needUpdate = (int)SkillEunm.SkillState.Release;
        List <GameObject> players = findRemainEnemys();

        for (int i = 0; i < players.Count; ++i)
        {
            PlayerChildren playerChildren = players[i].GetComponent <PlayerChildren>();
            playerChildren.title.progressActive(true);
        }
    }
 public void BeforeNight(float skillScope)
 {
     if (attr.inSelfNight)
     {
         directionalLight.GetComponent <Light>().color = Color.grey;
     }
     else if (attr.inNight)
     {
         if (!RoomData.isMainRole(attr.seat))
         {
             return;
         }
         FightScene.instance.nightScope = skillScope;
         directionalLight.SetActive(false);
         spotLight.SetActive(true);
         // 开启自己的自发光,关闭别人的自发光
         List <GameObject> players = FightScene.instance.Players;
         for (int i = 0; i < players.Count; ++i)
         {
             PlayerAction   action   = players[i].GetComponent <PlayerAction>();
             PlayerChildren children = players[i].GetComponent <PlayerChildren>();
             if (RoomData.isMainRole(action.attr.seat))
             {
                 action.material.EnableKeyword(Emission);
                 children.title.gameObject.SetActive(true);
             }
             else
             {
                 action.material.DisableKeyword(Emission);
                 children.title.gameObject.SetActive(false);
             }
         }
         // 关闭光线的自发光和透明化拖尾材质
         List <GameObject> lights = FightScene.instance.Lights;
         for (int i = 0; i < lights.Count; ++i)
         {
             LightManager lightManager = lights[i].GetComponent <LightManager>();
             lightManager.trailMaterial.SetColor(lightManager.tintColor, lightManager.transparent[lightManager.colorIndex]);
             lightManager.particle.gameObject.SetActive(false);
         }
         Night();
     }
 }
Exemplo n.º 8
0
    public override void afterDelay()
    {
        List <GameObject> players = findRemainEnemys();

        for (int i = 0; i < players.Count; ++i)
        {
            PlayerChildren playerChildren = players[i].GetComponent <PlayerChildren>();
            playerChildren.title.progressActive(false);
            PlayerAttribute attr = players[i].GetComponent <PlayerAttribute>();
            if (RoomData.isMainRole(attr.seat))
            {
                FightScene.instance.audioController.SoundPlay(AudioEunm.groupChaosDuration);
            }
            attr.isChaos = true;
            PlayerEffect effect = players[i].GetComponent <PlayerEffect>();
            if (!effect.isPlay(EffectEunm.CHAOS))
            {
                effect.Play(EffectEunm.CHAOS);
            }
        }
    }
 public void Night()
 {
     if (!attr.inSelfNight && !attr.inNight)
     {
         return;
     }
     if (attr.inNight)
     {
         if (!RoomData.isMainRole(attr.seat))
         {
             return;
         }
         // 球形射线检测
         Collider[] hitColliders = Physics.OverlapSphere(transform.position,
                                                         FightScene.instance.nightScope, LayerMask.GetMask(LayerEunm.PLAYER) | LayerMask.GetMask(LayerEunm.LIGHT));
         for (int i = 0; i < hitColliders.Length; ++i)
         {
             if (hitColliders[i].gameObject.layer == LayerMask.NameToLayer(LayerEunm.PLAYER))
             {
                 PlayerAction action = hitColliders[i].gameObject.GetComponent <PlayerAction>();
                 if (RoomData.isMainRole(action.attr.seat))
                 {
                     continue;
                 }
                 if (!action.material.IsKeywordEnabled(Emission))
                 {
                     action.material.EnableKeyword(Emission);
                     PlayerChildren children = hitColliders[i].GetComponent <PlayerChildren>();
                     children.title.gameObject.SetActive(true);
                 }
             }
             else if (hitColliders[i].gameObject.layer == LayerMask.NameToLayer(LayerEunm.LIGHT))
             {
                 LightManager lightManager = hitColliders[i].gameObject.GetComponent <LightManager>();
                 if (!lightManager.particle.gameObject.activeInHierarchy)
                 {
                     lightManager.trailMaterial.SetColor(lightManager.tintColor, lightManager.colors[lightManager.colorIndex]);
                     lightManager.particle.gameObject.SetActive(true);
                 }
             }
         }
         for (int i = 0; i < FightScene.instance.Players.Count; ++i)
         {
             bool isIn = false;
             for (int j = 0; j < hitColliders.Length; ++j)
             {
                 if (hitColliders[j].gameObject == FightScene.instance.Players[i])
                 {
                     isIn = true;
                     break;
                 }
             }
             if (!isIn)
             {
                 PlayerAction action = FightScene.instance.Players[i].GetComponent <PlayerAction>();
                 if (action.material.IsKeywordEnabled(Emission))
                 {
                     action.material.DisableKeyword(Emission);
                     PlayerChildren children = FightScene.instance.Players[i].GetComponent <PlayerChildren>();
                     children.title.gameObject.SetActive(false);
                 }
             }
         }
         for (int i = 0; i < FightScene.instance.Lights.Count; ++i)
         {
             bool isIn = false;
             for (int j = 0; j < hitColliders.Length; ++j)
             {
                 if (hitColliders[j].gameObject == FightScene.instance.Lights[i])
                 {
                     isIn = true;
                     break;
                 }
             }
             if (!isIn)
             {
                 LightManager lightManager = FightScene.instance.Lights[i].GetComponent <LightManager>();
                 if (lightManager.particle.gameObject.activeInHierarchy)
                 {
                     lightManager.trailMaterial.SetColor(lightManager.tintColor, lightManager.transparent[lightManager.colorIndex]);
                     lightManager.particle.gameObject.SetActive(false);
                 }
             }
         }
     }
 }