Esempio n. 1
0
 public void addEffect(EffectActuator newEffect, Player effectOwner)
 {
     if (effectOwner != NetInterface.Get().localPlayer)
     {
         return;
     }
     effectsQueue.Add(newEffect);
 }
Esempio n. 2
0
 public void addEffectToStartOfQueue(EffectActuator newEffect, string informationText, Player effectOwner)
 {
     if (effectOwner != NetInterface.Get().localPlayer)
     {
         return;
     }
     newEffect.informationText = informationText;
     effectsQueue.Insert(0, newEffect);
 }
Esempio n. 3
0
    void Update()
    {
        // do not allow effects until game setup is complete
        if (!NetInterface.Get().gameSetupComplete)
        {
            return;
        }
        if (effectJustFinished) // need to do this here to prevent race condition
        {
            // unlock each player
            if (GameManager.gameMode == GameManager.GameMode.hotseat)
            {
                throw new Exception("Unimplemented");
                //GameManager.Get().activePlayer.locked = false;
                //GameManager.Get().nonActivePlayer.locked = false;
            }
            else
            {
                // TODO fix this for netplay
                GameManager.Instance.ActivePlayer.RemoveLock(effectsManagerLock);
            }
            // reset bool
            effectJustFinished = false;
            return;
        }

        // do not trigger the next effect if one is already taking place or there is no next effect
        if (effectInProcess || effectsQueue.Count == 0)
        {
            return;
        }

        EffectActuator effectToActivate = effectsQueue[0];

        effectsQueue.Remove(effectToActivate);
        effectInProcess = true;
        effectToActivate.activate();
        GameManager.Instance.ActivePlayer.AddLock(effectsManagerLock);
        //GameManager.Get().activePlayer.locked = true;
        if (effectToActivate.informationText != null)
        {
            flipEffectTextOn(effectToActivate.informationText);
        }
    }
Esempio n. 4
0
 public void addEffect(EffectActuator newEffect, string informationText, Player effectOwner)
 {
     newEffect.informationText = informationText;
     addEffect(newEffect, effectOwner);
 }