示例#1
0
        public override void Play(SC_Player c)
        {
            if (OnTheRing)
            {
                stayOnRing = false;

                additionalCardsToModify.Remove(this);
            }
            else
            {
                foreach (RingSlot r in (c.IsLocalPlayer ? UI.localRingSlots : UI.otherRingSlots))
                {
                    if (!r.occupied)
                    {
                        goto OpenSlot;
                    }
                }

                stayOnRing = false;
            }
OpenSlot:

            if (stayOnRing)
            {
                additionalCardsToModify.Add(this);
            }

            base.Play(c);
        }
示例#2
0
        public IEnumerator FinishCombo(int nbr)
        {
            yield return(StartCoroutine(SC_Player.WaitForPlayers()));

            modifierCards.Remove(this);

            for (int i = 0; i < nbr; i++)
            {
                StartCoroutine(Caller.Graveyard.Cards[Caller.Graveyard.Cards.Count - 1].UICard.DiscardToDeck(Caller.Deck));
            }

            if (nbr > 0)
            {
                yield return(new WaitForSeconds(GM.refillTime));
            }

            if (Caller.IsLocalPlayer || Caller.AI)
            {
                if (Receiver.Stamina < 3)
                {
                    StartPinfallChoice();
                }
                else
                {
                    NextTurn();
                }
            }
        }
示例#3
0
    // Use this for initialization
    void Start()
    {
        SC_PlayerRef = this.GetComponent <SC_Player>();
        _Color       = SC_PlayerRef.GetSpriteColor();

        b_TrailOn = false;
        _LastPos  = transform.position;
    }
示例#4
0
    public void addPlayerInPU(SC_Player SC_PlayerRef)
    {
        a_SC_Player.Add(SC_PlayerRef);
        a_flashLights[a_SC_Player.Count - 1].intensity = 2;
        a_i_killCountStart.Add((float)SC_PlayerRef.SC_playerComboCounterRef.i_killCount);
        setLightsforFlash();


        //a_colorsToFlash.Add(flashColor);
        //if(b_timerActivated == false) b_timerActivated = true;
    }
    void Start()
    {
        b_IsInPuMode       = false;
        SC_ScoreCounterRef = GameObject.FindGameObjectWithTag("scoreCounter").GetComponent <SC_ScoreCounter>();
        v_startSize        = transform.localScale;
        v_startPos         = transform.position;

        SC_PlayerRef = player.GetComponent <SC_Player>();

        this.guiText.color = SC_PlayerRef.s_Color;
    }
示例#6
0
        public override bool CanUse(SC_Player user, bool ignorePriority = false, bool ignoreLocks = false)
        {
            foreach (SC_BaseCard c in (user.IsLocalPlayer ? UI.otherRingSlots : UI.localRingSlots)[0].slot.parent.GetComponentsInChildren <SC_BaseCard> ())
            {
                if (c.Is(SC_Global.CardType.Mytho))
                {
                    return(base.CanUse(user, ignorePriority, ignoreLocks));
                }
            }

            return(false);
        }
示例#7
0
    // Use this for initialization
    void Start()
    {
        //SYSTEM AVEC PARTICLE SYSTEM
        //p_dashTrailParticle = this.transform.FindChild("p_dashTrailParticle").particleSystem;

        SC_PlayerRef = this.GetComponent <SC_Player>();
        _Color       = SC_PlayerRef.GetSpriteColor();

        //renderer.material.color = _Color;
        b_TrailOn       = false;
        b_TrailLaunched = false;
    }
示例#8
0
        public void ApplyAllModifiersToCard(SC_Player owner, bool add)
        {
            foreach (SC_BaseCard m in modifierCards)
            {
                if (m.effectTarget.IsLocalPlayer == owner.IsLocalPlayer)
                {
                    m.ApplyModifiersToCard(this, add);
                }
            }

            UpdateValuesUI();
        }
示例#9
0
    void Start()
    {
        SC_playerComboRef = this.GetComponent <SC_playerCombo>();

        l_lifeLamp     = this.transform.FindChild("LifeLamp").light;
        SC_lifeLampRef = l_lifeLamp.GetComponent <SC_GetColorSprite>();

        SC_mainLightRef = GameObject.Find("flashLight_root").GetComponent <SC_mainLight>();

        SC_dashTrailRef   = this.GetComponent <SC_dashTrail>();
        SC_playerDeathRef = this.GetComponent <SC_playerDeath>();
        SC_PlayerRef      = this.GetComponent <SC_Player>();

        c_Color = SC_PlayerRef.s_Color;
    }
示例#10
0
    // Use this for initialization
    void Start()
    {
        _Sounds = GameObject.FindGameObjectWithTag("SOUND_MANAGER").GetComponent<SC_SoundManager>();

        SC_PlayerRef = this.GetComponent<SC_Player>();
        SC_playerComboCounterRef = SC_PlayerRef.SC_playerComboCounterRef;

        SC_ScoreCounterRef = GameObject.Find("guiSCOREcounter").GetComponent<SC_ScoreCounter>();
        SC_PlayerRef = GetComponent<SC_Player>();
        SC_PlayerComboRef = GetComponent<SC_playerCombo>();

        //POUR LE DASHFIRE
        SC_dashTrailRef = GetComponent<SC_dashTrail>();
        f_initialDashFade = SC_PlayerRef.f_TrailfadeOutSpeed;
        f_initialTrailSpeed = SC_dashTrailRef.f_TrailSpeed;
    }
示例#11
0
        protected virtual IEnumerator ApplyEffects()
        {
            foreach (CommonEffect e in commonEffects)
            {
                CurrentEffect = e;

                effectTarget = CurrentEffect.effectOnOpponent ? Receiver : Caller;

                MethodInfo mi = typeof(SC_BaseCard).GetMethod(e.effectType.ToString());

                if (mi != null)
                {
                    yield return(StartCoroutine(ApplyEffect(() => { mi.Invoke(this, null); })));
                }
            }
        }
示例#12
0
        public virtual void Play(SC_Player c)
        {
            if (OnTheRing && RingPlay())
            {
                return;
            }

            UI.messagePanel.SetActive(false);

            TryInterceptFinish();

            activeCard = this;

            if (!originalCard)
            {
                originalCard = this;
            }

            Caller = c;

            Receiver = Caller.IsLocalPlayer ? otherPlayer : localPlayer;

            UICard.RecT.SetParent(UICard.RecT.parent.parent);

            if (!OnTheRing)
            {
                Caller.Hand.Remove(this);

                SC_Deck.OrganizeHand(Caller.IsLocalPlayer ? GM.localHand : GM.otherHand);

                UICard.RecT.pivot = Vector2.one * .5f;

                UICard.RecT.anchoredPosition3D = Vector3.up * (Caller.IsLocalPlayer ? UICard.RecT.sizeDelta.y / 2 : (GM.transform as RectTransform).sizeDelta.y - UICard.RecT.sizeDelta.y / 2);
            }
            else
            {
                (Caller.IsLocalPlayer ? UI.localRingSlots : UI.otherRingSlots)[RingSlot].occupied = false;

                RingSlot = -1;
            }

            UICard.RecT.DOLocalMove(Vector3.zero, 1);

            DOTween.Sequence().Append(UICard.RecT.DOSizeDelta(UICard.RecT.sizeDelta * GM.playedSizeMultiplicator, 1)).OnComplete(() => { StartCoroutine(Use()); });

            UICard.Flip(!UICard.FaceUp, 1);
        }
示例#13
0
        public override bool CanUse(SC_Player user, bool ignorePriority = false, bool ignoreLocks = false)
        {
            if (boosting)
            {
                return(base.CanUse(user, ignorePriority, ignoreLocks));
            }
            else
            {
                commonEffects.RemoveAt(0);

                bool b = base.CanUse(user, ignorePriority, true) && SC_Player.otherPlayer.Pinned;

                commonEffects.Insert(0, new CommonEffect(CommonEffectType.Boost));

                return(b);
            }
        }
示例#14
0
        public override bool CanUse(SC_Player user, bool ignorePriority = false, bool ignoreLocks = false)
        {
            if (boosting)
            {
                return(base.CanUse(user, ignorePriority, ignoreLocks));
            }
            else
            {
                commonEffects.Clear();

                bool b = base.CanUse(user, ignorePriority, true) && SC_Player.nonActivePlayer.Submitted;

                commonEffects.Add(new CommonEffect(CommonEffectType.Boost));

                return(b);
            }
        }
示例#15
0
    // Use this for initialization
    void Start()
    {
        i_PlayerId       = (int)GetComponent <SC_Player>().playerIndex;
        b_ChoiceGiven    = false;
        _BatimentManager = GameObject.FindWithTag("BATIMENT_MANAGER").GetComponent <SC_BatimentManager>();

        SC_PlayerRef = this.GetComponent <SC_Player>();

        p_rightParticle.startColor = SC_PlayerRef.s_brightColor;
        p_leftParticle.startColor  = SC_PlayerRef.s_brightColor;

        SC_particleRefR = p_rightParticle.GetComponent <SC_particleSetRotation>();
        SC_particleRefL = p_leftParticle.GetComponent <SC_particleSetRotation>();


        c_brightPlayerColor = SC_PlayerRef.s_brightColor;
    }
示例#16
0
    void Start()
    {
        //_Player = this.gameObject;

        SC_BatimentChoiceRef = this.GetComponent <SC_BatimentChoice>();
        l_LifeLamp           = transform.Find("LifeLamp").light;
        f_LifeAmountMax      = f_LifeAmount;
        f_LifeLampMax        = l_LifeLamp.spotAngle;
        //v_StartPos = transform.position;
        v_respawnPoint = GameObject.FindGameObjectWithTag("respawnPoint").transform.position;
        v_respawnPoint = new Vector3(v_respawnPoint.x, v_respawnPoint.y, transform.position.z);

        //SC_playerComboCounterRef = this.GetComponent<SC_playerComboCounter>();
        SC_ScoreCounterRef = GameObject.FindGameObjectWithTag("scoreCounter").GetComponent <SC_ScoreCounter>();
        SC_PlayerRef       = this.GetComponent <SC_Player>();
        SC_mainLightRef    = GameObject.Find("flashLight_root").GetComponent <SC_mainLight>();

        _deathColor = SC_PlayerRef.s_Color;
    }
示例#17
0
        public bool CanPayCost(SC_Player user, int chain = 1)
        {
            if ((user.Health == 0 || user.Health > GetCost.health * chain) && user.Stamina >= GetCost.stamina * chain)
            {
                foreach (BodyPart b in user.BodyPartsHealth.Keys)
                {
                    if (b == GetCost.bodyPartDamage.bodyPart && (user.BodyPartsHealth[b] == 0 || user.BodyPartsHealth[b] < GetCost.bodyPartDamage.damage * chain))
                    {
                        return(false);
                    }
                }

                return(true);
            }
            else
            {
                return(false);
            }
        }
示例#18
0
    // Use this for initialization
    void Start()
    {
        _AudioSource_bat = gameObject.AddComponent <AudioSource>();
        _Sounds          = GameObject.FindGameObjectWithTag("SOUND_MANAGER").GetComponent <SC_SoundManager>();

        g_backgroundColor       = this.transform.FindChild("bat_Background").gameObject;
        p_damageParticle        = this.transform.FindChild("damageParticle").particleSystem;
        SC_PlayerRef            = _Player.GetComponent <SC_Player>();
        renderer.material.color = SC_PlayerRef.s_brightColor;
        g_CrestRoot             = this.gameObject;
        f_StartSize             = transform.localScale.x;
        f_LifeAmountMax         = f_LifeAmount;
        c_crestColor            = renderer.material.color;

        p_damageParticle.startColor = c_crestColor;
        g_backgroundColor.renderer.material.color = SC_PlayerRef.s_brightColor;
        g_backgroundColor.SetActive(false);

        v_startSize = transform.localScale;
    }
示例#19
0
    public void setColor()
    {
        if (a_DeadPlayers.Count > 0)
        {
            SC_PlayerRef = a_DeadPlayers[0].GetComponent <SC_Player>();

            //a_DeadPlayers[0]

            SC_playerDeathRef = a_DeadPlayers[0].GetComponent <SC_playerDeath>();
            i_regenSpeedBonus = SC_playerDeathRef.i_storedKillCount;

            c_lifeRegenColor        = SC_PlayerRef.s_Color;
            c_lifeRegenColor.a      = 0.5f;
            renderer.material.color = c_lifeRegenColor;
        }
        else
        {
            renderer.material.color = Color.white;
        }
    }
示例#20
0
    public void stopFlash(SC_Player _SC_PlayerRef)
    {
//		foreach(SCa_Player a_SC_PlayerREF in a_SC_Player)
//		{
//			if(a_SC_PlayerREF == _SC_PlayerRef)
//			{
//
//				//a_SC_Player.Remove(a_SC_PlayerREF);
//
//
//			}
//		}
        a_flashLights[a_SC_Player.IndexOf(_SC_PlayerRef)].enabled = false;

        a_i_killCountStart.RemoveAt(a_SC_Player.IndexOf(_SC_PlayerRef));


        a_SC_Player.Remove(_SC_PlayerRef);

        setLightsforFlash();
    }
示例#21
0
        public override bool CanUse(SC_Player user, bool ignorePriority = false, bool ignoreLocks = false)
        {
            if (base.CanUse(user, ignorePriority, ignoreLocks))
            {
                return(true);
            }
            else
            {
                stayOnRing = false;

                if (base.CanUse(user, ignorePriority, ignoreLocks))
                {
                    return(true);
                }
                else
                {
                    stayOnRing = true;

                    return(false);
                }
            }
        }
示例#22
0
        public void Discard(SC_Player owner, Action a = null)
        {
            Caller = owner;

            Caller.Hand.Remove(this);

            SC_Deck.OrganizeHand(Caller.IsLocalPlayer ? GM.localHand : GM.otherHand);

            if (discardNbr != -1)
            {
                a = () => {
                    if (CurrentEffect.effectType == CommonEffectType.DiscardChosen)
                    {
                        activeCard.DiscardChosen();
                    }
                    else
                    {
                        activeCard.DiscardRandom();
                    }
                };
            }

            UICard.ToGraveyard(GM.drawSpeed, a ?? AppliedEffects);
        }
示例#23
0
 public override bool CanUse(SC_Player user, bool ignorePriority = false, bool ignoreLocks = false)
 {
     return(base.CanUse(user, ignorePriority, ignoreLocks) && SC_Player.activePlayer.Graveyard.Cards.FindAll(new System.Predicate <SC_BaseCard> ((t) => { return t.Is(SC_Global.CardType.Hardcore); })).Count >= 4);
 }
示例#24
0
 public bool CanUse(SC_Player user, int chain, bool ignorePriority = false, bool ignoreLocks = false)
 {
     return(base.CanUse(user, ignorePriority, ignoreLocks) && CanPayCost(user, chain));
 }
示例#25
0
 public override bool CanUse(SC_Player user, bool ignorePriority = false, bool ignoreLocks = false)
 {
     return(CanUse(user, 1, ignorePriority, ignoreLocks));
 }
示例#26
0
 public override bool CanUse(SC_Player user, bool ignorePriority = false, bool ignoreLocks = false)
 {
     return(user.Stamina >= (lockingCard as SC_Submission).GetEffect.breakCost && base.CanUse(user, ignorePriority, ignoreLocks));
 }
示例#27
0
    public void death(Vector3 v_HitPushDirRef, float f_pushStrenghtRef, int i_TypeOfDeath, int i_dashMultiplicator, SC_Player SC_PlayerRef)
    {
        //NOTE to get v_HitPushDirRef, use SC_Trigger.getHitDir()
        // to get strenghtRef use SC_Player.f_PushStrenght


        v_HitPushDirRef = v_HitPushDirRef.normalized;
        if (v_HitPushDirRef != Vector3.zero)
        {
            if (v_HitPushDirRef.x >= 0)
            {
                f_angle = (180 - Vector3.Angle(new Vector3(0, 1, 0), new Vector3(v_HitPushDirRef.x, v_HitPushDirRef.y, 0))) + 180;
            }
            else
            {
                f_angle = Vector3.Angle(new Vector3(0, 1, 0), new Vector3(v_HitPushDirRef.x, v_HitPushDirRef.y, 0));
            }
        }
        if (i_TypeOfDeath == 1)
        {
            GameObject _deathBlood = Instantiate(_bloodSplat, new Vector3(transform.position.x, transform.position.y, transform.position.z + 0.05f), Quaternion.Euler(new Vector3(270, 0, 0))) as GameObject;
            _deathBlood.transform.eulerAngles = new Vector3(0, 0, f_angle);
            _deathBlood.transform.parent      = this.transform;

            _deathBlood.transform.GetChild(0).particleSystem.emissionRate += i_dashMultiplicator * 100;
            //_deathBlood.transform.GetChild(0).particleSystem.startLifetime += Mathf.Clamp(i_dashMultiplicator/5,0,1);
            _deathBlood.transform.GetChild(0).particleSystem.startSpeed    += i_dashMultiplicator / 10;
            _deathBlood.transform.GetChild(0).particleSystem.startLifetime += Mathf.Clamp(i_dashMultiplicator / 5, 0, 1);
            _deathBlood.transform.GetChild(0).particleSystem.startColor     = this.GetComponent <SpriteRenderer>().color;



//			if(SC_PlayerRef.b_IsInPuMode != true && SC_PlayerRef.b_IsDashing)
//			{
//				GameObject _PUabsorbTEMP = Instantiate(_PUabsorbParticle, new Vector3(transform.position.x,  transform.position.y, transform.position.z+0.05f), Quaternion.Euler(new Vector3(270,0,0))) as GameObject;
//				_PUabsorbTEMP.transform.eulerAngles = new Vector3(0,0,-f_angle);
//				//_PUabsorbTEMP.transform.parent = this.transform;
//				_PUabsorbTEMP.transform.GetChild(0).particleSystem.startColor = this.GetComponent<SpriteRenderer>().color;
//
//				SC_particleSetRotation SC_ParticleSetRotationRef = _PUabsorbTEMP.GetComponent<SC_particleSetRotation>();
//				SC_ParticleSetRotationRef.t_destination = SC_PlayerRef.t_ParticleAbsorbDestination;
//				SC_ParticleSetRotationRef.c_PlayerColor = SC_PlayerRef.s_brightColor;
//				//SC_ParticleSetRotationRef.f_speed = SC_PlayerRef.f_speedref*3f;
//
//				//Debug.Log("ABSORB");
//			}
        }
        else
        {
            GameObject _deathBloodExplo = Instantiate(_ExplosionSplat, new Vector3(transform.position.x, transform.position.y, transform.position.z + 0.05f), Quaternion.Euler(new Vector3(270, 0, 0))) as GameObject;
            _deathBloodExplo.transform.eulerAngles   = new Vector3(0, 0, f_angle);
            _deathBloodExplo.transform.parent        = this.transform;
            _deathBloodExplo.renderer.material.color = SC_PlayerRef.s_brightColor;
        }

        GameObject g_scoreValueGUITEMP = Instantiate(g_scoreValueGUI, new Vector3(0, 0.03f, 0), Quaternion.Euler(0, 0, 0)) as GameObject;

        Color c_guiColor = SC_PlayerRef.s_Color;

        c_guiColor.a = 0.5f;
        g_scoreValueGUITEMP.guiText.color = c_guiColor;

        SC_EnnemiScoreGUI SC_EnnemiScoreGUIRef = g_scoreValueGUITEMP.GetComponent <SC_EnnemiScoreGUI>();

        SC_EnnemiScoreGUIRef.i_scoreValue = Mathf.Clamp(i_dashMultiplicator, 1, 999) * i_ScoreValue;
        SC_EnnemiScoreGUIRef.g_ennemi     = this.transform;

        _scoreValueGUIdisplay = g_scoreValueGUITEMP;



        v_HitPushDir   = v_HitPushDirRef;
        f_pushStrenght = f_pushStrenghtRef;

        this.collider.enabled       = false;
        SC_EnemyBehaviorRef.enabled = false;
        StartCoroutine(IsPushed(v_HitPushDirRef, f_pushStrenghtRef, 0.5f));

        b_isActive = false;

        if (SC_EnemyBehaviorRef.i_EnemyType == 1)
        {
            b_exploding = true;
            SC_DamageRef.DamageDealth   = 1200;
            SC_EnemyBehaviorRef.enabled = false;
        }
        else
        {
            //StartCoroutine(deathFlash());
        }

        if (i_TypeOfDeath == 0)
        {
            //mort par PU
            AnimationHandeler("DeathPU");
            _AudioSource_Ennemi.PlayOneShot(_Sounds.GetSound("MortParPu"));
        }
        else
        {
            AnimationHandeler("DeathCaC");
        }
    }
示例#28
0
 public override bool CanUse(SC_Player user, bool ignorePriority = false, bool ignoreLocks = false)
 {
     return(base.CanUse(user, ignorePriority, ignoreLocks) && (activeCard as SC_AttackCard).CanPayCost(localPlayer));
 }
示例#29
0
 public override bool CanUse(SC_Player user, bool ignorePriority = false, bool ignoreLocks = false)
 {
     return(base.CanUse(user, ignorePriority, ignoreLocks) && !user.Neutral);
 }
示例#30
0
 public override bool CanUse(SC_Player user, bool ignorePriority = false, bool ignoreLocks = false)
 {
     return(base.CanUse(user, ignorePriority, true) && SC_Player.nonActivePlayer.Submitted);
 }