Ejemplo n.º 1
0
            static void Prefix(ref int ___mNpcID, ref MGState ___mState)
            {
                if (!enabled)
                    return;

                ___mNpcID = 0;
                ___mState = MGState.Single;
            }
 public void SwitchState(MGState state)
 {
     if (MainCam.gameObject.activeInHierarchy == false)
     {
         StartCoroutine(EndMG("reset", .1f));
     }
     else
     {
         ChangeState(state);
     }
 }
            static void Prefix(ref int ___mNpcID, ref MGState ___mState)
            {
                if (!enabled)
                {
                    return;
                }

                if (___mState == MGState.Propose)
                {
                    settings.CurrentSpouse = ___mNpcID;
                }
            }
            static bool Prefix(int npcId, ref bool __result, ref MGState ___mState, ref Actor ___mActor, ref int ___mNpcID)
            {
                if (!enabled)
                {
                    return(true);
                }
                //Debug.Log("XYZ Checking if "+Module<NpcRepository>.Self.GetNpcName(npcId)+" "+npcId+" is Spouse");

                FavorObject f = FavorManager.Self.GetFavorObject(npcId);

                __result = (f.RelationshipType == FavorRelationshipType.Couple);

                //Debug.Log("XYZ " + Module<NpcRepository>.Self.GetNpcName(npcId) + " " + npcId + " is"+(__result?" ":" not ")+"Spouse");

                int spouseid = GetCurrentSpouse();

                if (spouseid == 0)
                {
                    if (___mState != MGState.Propose)
                    {
                        ___mState = MGState.Single;
                        ___mActor = null;
                        ___mNpcID = 0;
                    }
                    return(false);
                }

                List <FavorObject> fList = new List <FavorObject>(FavorManager.Self.GetAllShowFavorObjects());

                foreach (FavorObject fo in fList)
                {
                    if (fo.RelationshipType == FavorRelationshipType.Couple)
                    {
                        if (___mState == MGState.Single)
                        {
                            ___mState = MGState.Marriage;
                        }

                        if (spouseid == fo.ID && ___mState != MGState.Propose)
                        {
                            ___mActor = ActorMgr.Self.Get(fo.ID);
                            ___mNpcID = fo.ID;
                        }
                    }
                }

                return(false);
            }
Ejemplo n.º 5
0
            static bool Prefix(ref bool __result, ref MGState ___mState, ref Actor ___mActor, ref int ___mNpcID)
            {
                if (!enabled)
                {
                    return(true);
                }

                __result = false;

                int spouseid = GetCurrentSpouse();

                Debug.LogError("XYZ current spouse is " + spouseid);

                if (spouseid == 0)
                {
                    if (___mState != MGState.Propose)
                    {
                        ___mState = MGState.Single;
                        ___mActor = null;
                        ___mNpcID = 0;
                    }
                    return(false);
                }

                List <FavorObject> fList = new List <FavorObject>(FavorManager.Self.GetAllShowFavorObjects());

                foreach (FavorObject f in fList)
                {
                    if (f.RelationshipType == FavorRelationshipType.Couple)
                    {
                        __result = true;
                        if (___mState == MGState.Single)
                        {
                            ___mState = MGState.Marriage;
                        }

                        if (spouseid == f.ID)
                        {
                            ___mActor = ActorMgr.Self.Get(f.ID);
                            ___mNpcID = f.ID;
                        }
                    }
                }

                return(false);
            }
    void ChangeState(MGState state)
    {
        //Reset all minigames and get proper text & variables
        CurrentMG = state;
        MainCam.gameObject.SetActive(false);
        ObjectContainer.SetActive(false);
        MainCanvas.SetActive(false);
        MGCanvas.SetActive(false);
        MGCam.SetActive(false);
        MG_1_GO.SetActive(false);
        MG_2_GO.SetActive(false);
        MG_3_GO.SetActive(false);
        MgWinRepr.SetActive(false);
        MG_1_Mng.ResetGame();
        MG_2_Mng.ResetGame();
        MG_3_Mng.ResetGame();
        CameraControl.Instance.CurrentCam = MGCam.GetComponent <Camera>();
        WinStateText.text = "";
        _currentTime      = 0;
        Started           = true;
        switch (state)
        {
        case MGState.Mg1:
            MGCanvas.SetActive(true);
            MGCam.SetActive(true);
            MG_1_GO.SetActive(true);
            MG_1_Mng.InitGame();
            GameDescription.text = TextManager.Instance.Mg1_Description;
            LocalManager.Instance.NetworkCommunicator.SetPlayerState("MiniGame");
            break;

        case MGState.Mg2:
            MGCanvas.SetActive(true);
            MGCam.SetActive(true);
            MG_2_Mng.StartCoroutine("InitGame");
            MG_2_GO.SetActive(true);
            GameDescription.text = TextManager.Instance.Mg2_Description;
            LocalManager.Instance.NetworkCommunicator.SetPlayerState("MiniGame");
            break;

        case MGState.Mg3:
            MGCanvas.SetActive(true);
            MGCam.SetActive(true);
            MG_3_GO.SetActive(true);
            MG_3_Mng.InitGame();
            GameDescription.text = TextManager.Instance.Mg3_Description;
            LocalManager.Instance.NetworkCommunicator.SetPlayerState("MiniGame");
            break;

        case MGState.None:
            Started = false;
            ObjectContainer.SetActive(true);
            MainCam.gameObject.SetActive(true);
            MainCanvas.SetActive(true);
            CameraControl.Instance.CurrentCam = MainCam;
            if (NetMng.Instance.isNetworkActive)
            {
                LocalManager.Instance.NetworkCommunicator.SetPlayerState("Game");
            }
            break;
        }
    }
 static bool Prefix(ref int ___mNpcID, ref Actor ___mActor, ref int __result, ref MGState ___mState)
 {
     if (!enabled)
     {
         return(true);
     }
     __result = 0;
     if (Module <MGMgr> .Self.IsPropose())
     {
         __result = ___mNpcID;
         Dbgl("XYZ Proposing! Current fiance is " + Module <NpcRepository> .Self.GetNpcName(___mNpcID) + " " + ___mNpcID);
     }
     else
     {
         int npcId = GetCurrentSpouse();
         ___mNpcID = npcId;
         ___mActor = ActorMgr.Self.Get(npcId);
         __result  = npcId;
         if (___mState == MGState.Marriage && npcId == 0)
         {
             Dbgl("XYZ Single! No spouse.");
             ___mState = MGState.Single;
         }
         else if (___mState == MGState.Single && npcId != 0)
         {
             ___mState = MGState.Marriage;
             Dbgl("XYZ Married! Current spouse is " + Module <NpcRepository> .Self.GetNpcName(___mNpcID) + " " + ___mNpcID);
         }
     }
     return(false);
 }
Ejemplo n.º 8
0
 public virtual void EndMG(bool won = false)
 {
     m_winConditionMet = won;
     m_mgState         = MGState.COMPLETE;
     StartCoroutine("StartMGClosing");
 }
Ejemplo n.º 9
0
 protected void StartMG()
 {
     m_mgState = MGState.IN_PROGRESS;
     StartCoroutine("StartMGCountdown");
 }
Ejemplo n.º 10
0
 protected void InitializeMG()
 {
     m_mgState = MGState.NOT_STARTED;
 }