Beispiel #1
0
    // Token: 0x06001447 RID: 5191 RVA: 0x00238E78 File Offset: 0x00237078
    public bool IsCanSetFB_CDTime(CString tmpName = null, long m_UseID = 0L)
    {
        bool result = false;

        if (tmpName == null)
        {
            tmpName = StringManager.Instance.StaticString1024();
        }
        long num = 0L;

        if (m_UseID == 0L)
        {
            tmpName.ClearString();
            tmpName.IntToFormat(NetworkManager.UserID, 1, false);
            tmpName.AppendFormat("{0}_FB_CDTime_UseID");
            long.TryParse(PlayerPrefs.GetString(tmpName.ToString()), out m_UseID);
        }
        tmpName.ClearString();
        tmpName.IntToFormat(m_UseID, 1, false);
        tmpName.AppendFormat("{0}_FB_CDTime_Time_Check");
        long.TryParse(PlayerPrefs.GetString(tmpName.ToString()), out num);
        if (num == 0L || (num <= ActivityManager.Instance.ServerEventTime && GameConstants.GetDateTime(num + 86400L).Day <= GameConstants.GetDateTime(ActivityManager.Instance.ServerEventTime).Day) || GameConstants.GetDateTime(num + 86400L).Month < GameConstants.GetDateTime(ActivityManager.Instance.ServerEventTime).Month || GameConstants.GetDateTime(num + 86400L).Year < GameConstants.GetDateTime(ActivityManager.Instance.ServerEventTime).Year)
        {
            result = true;
            PlayerPrefs.SetString(tmpName.ToString(), ActivityManager.Instance.ServerEventTime.ToString());
        }
        return(result);
    }
Beispiel #2
0
    // Token: 0x06001446 RID: 5190 RVA: 0x00238DB0 File Offset: 0x00236FB0
    public bool CheckReSetFB_CDTime()
    {
        bool    result  = false;
        long    num     = 0L;
        long    num2    = 0L;
        CString cstring = StringManager.Instance.StaticString1024();

        cstring.ClearString();
        cstring.IntToFormat(NetworkManager.UserID, 1, false);
        cstring.AppendFormat("{0}_FB_CDTime_UseID");
        long.TryParse(PlayerPrefs.GetString(cstring.ToString()), out num);
        if (num == 0L)
        {
            PlayerPrefs.SetString(cstring.ToString(), NetworkManager.UserID.ToString());
            num = NetworkManager.UserID;
        }
        cstring.ClearString();
        cstring.IntToFormat(num, 1, false);
        cstring.AppendFormat("{0}_FB_CDTime_Time");
        long.TryParse(PlayerPrefs.GetString(cstring.ToString()), out num2);
        if ((num2 > 0L && num2 - ActivityManager.Instance.ServerEventTime <= 0L) || num2 == 0L)
        {
            result = true;
        }
        return(result);
    }
Beispiel #3
0
    // Token: 0x06001F04 RID: 7940 RVA: 0x003B79B0 File Offset: 0x003B5BB0
    public void OnButtonClick(UIButton sender)
    {
        switch (sender.m_BtnID1)
        {
        case 0:
            this.GUIM.CloseMenu(EGUIWindow.UI_Rating);
            this.GUIM.UIQueueLockRelease(EGUIQueueLock.UIQL_UI_notAllowPopUps);
            break;

        case 1:
        {
            bool    flag    = true;
            CString cstring = StringManager.Instance.StaticString1024();
            cstring.ClearString();
            cstring.IntToFormat(NetworkManager.UserID, 1, false);
            cstring.AppendFormat("{0}_Score_bScoreEnd");
            PlayerPrefs.SetString(cstring.ToString(), flag.ToString());
            this.UpdateUI(1, 0);
            break;
        }

        case 2:
            this.UpdateUI(2, 0);
            break;

        case 3:
        {
            MessagePacket messagePacket = new MessagePacket(1024);
            messagePacket.Protocol = Protocol._MSG_REQUEST_GOOGLESTAR_PRIZE;
            messagePacket.AddSeqId();
            messagePacket.Send(false);
            bool    flag    = true;
            long    num     = 0L;
            CString cstring = StringManager.Instance.StaticString1024();
            cstring.ClearString();
            cstring.IntToFormat(NetworkManager.UserID, 1, false);
            cstring.AppendFormat("{0}");
            long.TryParse(PlayerPrefs.GetString(cstring.ToString()), out num);
            if (num != 0L)
            {
                cstring.ClearString();
                cstring.IntToFormat(num, 1, false);
                cstring.AppendFormat("{0}_Score_bScoreEnd");
                PlayerPrefs.SetString(cstring.ToString(), flag.ToString());
            }
            IGGSDKPlugin.RateGooglePlayApplication(GameConstants.GlobalEditionClassNames);
            this.GUIM.CloseMenu(EGUIWindow.UI_Rating);
            this.GUIM.UIQueueLockRelease(EGUIQueueLock.UIQL_UI_notAllowPopUps);
            break;
        }

        case 4:
            this.GUIM.CloseMenu(EGUIWindow.UI_Rating);
            this.GUIM.UIQueueLockRelease(EGUIQueueLock.UIQL_UI_notAllowPopUps);
            IGGGameSDK.OpenSuggestUrl();
            break;
        }
    }
Beispiel #4
0
    // Token: 0x06000195 RID: 405 RVA: 0x00019120 File Offset: 0x00017320
    public void PlayMP3SFX(ushort NameID, float delay = 0f)
    {
        if (this.MuteSFXVol || NameID == 0)
        {
            return;
        }
        if (this.MP3Key != 0)
        {
            if (NameID == this.MP3ABName)
            {
                return;
            }
            this.MP3Source.Stop();
            AssetManager.UnloadAssetBundle(this.MP3Key, true);
            this.MP3Key = 0;
        }
        this.MP3ABName = NameID;
        int     num     = (int)(NameID / 100);
        CString cstring = StringManager.Instance.StaticString1024();

        cstring.StringToFormat(this.Path);
        cstring.IntToFormat((long)num, 3, true);
        cstring.AppendFormat("{0}{1}");
        AssetBundle assetBundle = AssetManager.GetAssetBundle(cstring, out this.MP3Key);

        if (assetBundle)
        {
            cstring.ClearString();
            cstring.IntToFormat((long)NameID, 1, false);
            cstring.AppendFormat("{0}");
            this.SFXClip.clip = (assetBundle.Load(cstring.ToString(), typeof(AudioClip)) as AudioClip);
            if (this.SFXClip.clip == null)
            {
                AssetManager.UnloadAssetBundle(this.MP3Key, true);
                this.MP3Key    = 0;
                this.MP3ABName = 0;
                return;
            }
            this.SFXClip.DelaySecond = new float?(delay);
            this.SFXClip.Pitch       = 1f;
            this.SFXClip.PanLevel    = 0f;
            this.SFXClip.Volume      = 1f;
            this.SFXClip.Loop        = false;
            this.PlayAudio(this.MP3Source, this.SFXClip);
            this.ChangeDuckingState(AudioManager.DuckingState.Start);
            if (this.poolIndex >= 20)
            {
                this.poolIndex = 0;
            }
        }
        else
        {
            AssetManager.UnloadAssetBundle(this.MP3Key, true);
            this.MP3Key    = 0;
            this.MP3ABName = 0;
        }
    }
Beispiel #5
0
    // Token: 0x0600018D RID: 397 RVA: 0x00018CEC File Offset: 0x00016EEC
    private bool PlaySFXLoopHighPass(ushort NameID, out byte Key, Transform PlayObj = null)
    {
        Key = 0;
        if (this.FireKey != 0)
        {
            return(false);
        }
        int     num     = (int)(NameID / 100);
        CString cstring = StringManager.Instance.StaticString1024();

        cstring.StringToFormat(this.Path);
        cstring.IntToFormat((long)num, 3, true);
        cstring.AppendFormat("{0}{1}");
        AssetBundle assetBundle = AssetManager.GetAssetBundle(cstring, out this.FireKey);

        if (!assetBundle)
        {
            AssetManager.UnloadAssetBundle(this.FireKey, true);
            this.FireKey = 0;
            return(false);
        }
        if (this.FireSFXSource.clip != null)
        {
            this.FireSFXSource.Stop();
        }
        cstring.ClearString();
        cstring.IntToFormat((long)NameID, 1, false);
        cstring.AppendFormat("{0}");
        this.SFXClip.clip = (assetBundle.Load(cstring.ToString(), typeof(AudioClip)) as AudioClip);
        if (this.SFXClip.clip == null)
        {
            AssetManager.UnloadAssetBundle(this.FireKey, true);
            this.FireKey = 0;
            return(false);
        }
        if (PlayObj != null)
        {
            this.FireSFXSource.transform.position = PlayObj.position;
            this.SFXClip.PanLevel = 1f;
        }
        else
        {
            this.SFXClip.PanLevel = 0f;
        }
        this.SFXClip.Loop   = true;
        this.SFXClip.Volume = 1f;
        this.SFXClip.Pitch  = 1f;
        Key = 20;
        this.PlayAudio(this.FireSFXSource, this.SFXClip);
        this.ChangeDuckingState(AudioManager.DuckingState.Start);
        return(true);
    }
Beispiel #6
0
 // Token: 0x06002878 RID: 10360 RVA: 0x00447000 File Offset: 0x00445200
 public bool PostShare(SocialType Kind)
 {
     if (this.CanShowInvite() && this.ShareAddress != null)
     {
         CString cstring = StringManager.Instance.StaticString1024();
         cstring.ClearString();
         cstring.Append(this.ShareAddress);
         cstring.IntToFormat(DataManager.Instance.RoleAttr.UserId, 1, false);
         cstring.IntToFormat((long)Kind, 1, false);
         cstring.AppendFormat("{0}id={1}&kind={2}");
         return(true);
     }
     return(false);
 }
Beispiel #7
0
    // Token: 0x060016A8 RID: 5800 RVA: 0x002718FC File Offset: 0x0026FAFC
    public void UpDateRowItem(GameObject item, int dataIdx, int panelObjectIdx, int panelId)
    {
        if (dataIdx < 0 || dataIdx >= PetBuff.PetSkills.Count || panelObjectIdx >= this.m_panel.Length)
        {
            return;
        }
        if (!this.m_panel[panelObjectIdx].Init)
        {
            this.m_panel[panelObjectIdx].Init = true;
            this.m_panel[panelObjectIdx].Item = item;
            item.transform.GetChild(9).GetChild(2).gameObject.GetComponent <UIButton>().m_Handler = this;
            if (UIPetSkill.nowSkillId == 0)
            {
            }
        }
        this.m_panel[panelObjectIdx].ID = dataIdx;
        item.transform.GetChild(8).gameObject.SetActive(false);
        item.transform.GetChild(9).gameObject.SetActive(true);
        item.transform.GetChild(9).GetChild(2).gameObject.GetComponent <UIButton>().m_BtnID2 = dataIdx + 1;
        item.transform.GetChild(9).GetChild(2).GetChild(2).gameObject.SetActive(this.currentBtnID > 0 && this.currentBtnID <= PetBuff.PetSkills.Count && this.currentBtnID == dataIdx);
        this.SetPanelItem(panelObjectIdx, true);
        this.m_CrownBack = item.transform.GetChild(9).GetChild(2).gameObject.GetComponent <Image>();
        PetSkillTbl recordByKey = PetManager.Instance.PetSkillTable.GetRecordByKey((ushort)PetBuff.PetSkills[dataIdx].ID);
        CString     cstring     = StringManager.Instance.StaticString1024();

        cstring.IntToFormat((long)recordByKey.Icon, 5, false);
        cstring.AppendFormat("s{0}");
        this.m_Defeater           = this.m_CrownBack.transform.GetChild(0).GetComponent <Image>();
        this.m_Defeater.sprite    = this.GM.LoadFrameSprite("sk");
        this.m_Defeater.material  = this.GM.GetFrameMaterial();
        this.m_CrownBack.sprite   = this.GM.LoadSkillSprite(cstring);
        this.m_CrownBack.material = this.GM.GetSkillMaterial();
    }
Beispiel #8
0
    // Token: 0x060024E2 RID: 9442 RVA: 0x00424684 File Offset: 0x00422884
    public void InitialAB()
    {
        CString cstring = StringManager.Instance.StaticString1024();

        if (this.PicPackageID1 != 0)
        {
            cstring.IntToFormat((long)this.PicPackageID1, 1, false);
            cstring.AppendFormat("Store/Mallback_{0}");
        }
        else
        {
            cstring.Append("UI/Mall_0");
        }
        this.m_AssetBundle = AssetManager.GetAssetBundle(cstring, out this.m_AssetBundleKey);
        if (this.m_AssetBundle != null)
        {
            this.m_Material = (this.m_AssetBundle.Load("Mall_m", typeof(Material)) as Material);
            UnityEngine.Object[] array = this.m_AssetBundle.LoadAll(typeof(Sprite));
            for (int i = 0; i < array.Length; i++)
            {
                ushort num = ushort.Parse(array[i].name);
                if (num == 100)
                {
                    this.m_BackImage1 = (Sprite)array[i];
                }
                else if (num == 200)
                {
                    this.m_BackImage2 = (Sprite)array[i];
                }
            }
        }
    }
Beispiel #9
0
    // Token: 0x06001187 RID: 4487 RVA: 0x001EB878 File Offset: 0x001E9A78
    public void InitLock()
    {
        StageManager stageDataController = DataManager.StageDataController;
        CString      cstring             = StringManager.Instance.StaticString1024();
        Vector3      localScale          = Vector3.one * 12.5f;
        Vector3      eulerAngles         = new Vector3(45f, 185f, 3f);

        for (int i = 0; i < this.StageLock.Length; i++)
        {
            if (i > (int)stageDataController.StageRecord[2])
            {
                cstring.ClearString();
                cstring.IntToFormat((long)(i + 1), 1, false);
                cstring.AppendFormat("Lock_{0}");
                CorpsStage recordByKey = DataManager.StageDataController.CorpsStageTable.GetRecordByKey((ushort)(1 + i));
                this.StageLock[i]         = new GameObject(cstring.ToString());
                this.StageLockNameCode[i] = this.StageLock[i].name.GetHashCode();
                SpriteRenderer spriteRenderer = this.StageLock[i].AddComponent <SpriteRenderer>();
                spriteRenderer.sprite       = this.mapspriteManager.GetSpriteByName("lock");
                spriteRenderer.material     = GUIManager.Instance.MapSpriteMaterial;
                spriteRenderer.sortingOrder = -1;
                Transform transform = this.StageLock[i].transform;
                transform.position   = GameConstants.WordToVector3(recordByKey.StagePos.X, recordByKey.StagePos.Y, recordByKey.StagePos.Z, -100, 0.01f);
                transform.localScale = localScale;
                spriteRenderer.color = Color.black;
                Quaternion rotation = transform.rotation;
                rotation.eulerAngles = eulerAngles;
                transform.rotation   = rotation;
                transform.SetParent(this.MapSpriteRoot.transform);
            }
        }
    }
Beispiel #10
0
    // Token: 0x06001BC6 RID: 7110 RVA: 0x00315E68 File Offset: 0x00314068
    public void PraseString(CString NewStr, string str)
    {
        int i = 0;

        while (i < str.Length)
        {
            char c = str[i++];
            if (c == '%')
            {
                char c2 = str[i];
                if (c2 != 'x' && c2 != 'y')
                {
                    if (c2 != 'b')
                    {
                        NewStr.Append(c);
                    }
                    else
                    {
                        NewStr.Append(this.GetCharString(str[i++]));
                    }
                }
                else
                {
                    NewStr.IntToFormat((long)this.GetCharVal(str[i++]), 1, true);
                    NewStr.AppendFormat("{0}");
                }
            }
            else
            {
                NewStr.Append(c);
            }
        }
    }
Beispiel #11
0
    // Token: 0x06001D36 RID: 7478 RVA: 0x003464D8 File Offset: 0x003446D8
    private void Create3DObjects()
    {
        if (this.NowHeroID == this.LastHeroID)
        {
            return;
        }
        if (this.LoadingStep > UIJailRoom.eModelLoadingStep.WaitforHero)
        {
            this.Destory3DObject(false);
        }
        if (this.LoadingStep == UIJailRoom.eModelLoadingStep.Start)
        {
            CString cstring = StringManager.Instance.StaticString1024();
            cstring.Append("Role/cage");
            this.bundle        = AssetManager.GetAssetBundle(cstring, out this.AssetKey1);
            this.bundleRequest = this.bundle.LoadAsync("m", typeof(GameObject));
            this.LoadingStep   = UIJailRoom.eModelLoadingStep.WaitforCage;
            return;
        }
        this.LastHeroID = this.NowHeroID;
        this.heroData   = DataManager.Instance.HeroTable.GetRecordByKey(this.NowHeroID);
        CString cstring2 = StringManager.Instance.StaticString1024();

        cstring2.IntToFormat((long)this.heroData.Modle, 5, false);
        cstring2.AppendFormat("Role/hero_{0}");
        this.bundle = AssetManager.GetAssetBundle(cstring2, out this.AssetKey2);
        if (this.bundle == null)
        {
            this.LoadingStep = UIJailRoom.eModelLoadingStep.Done;
            return;
        }
        this.bundleRequest = this.bundle.LoadAsync("m", typeof(GameObject));
        this.LoadingStep   = UIJailRoom.eModelLoadingStep.WaitforHero;
    }
Beispiel #12
0
 // Token: 0x060017C0 RID: 6080 RVA: 0x00287368 File Offset: 0x00285568
 public void Start(CString str, uint exp, ushort skillID)
 {
     this.m_State         = LvUpAnimation.EAnimState.eStart;
     this.m_AnimationTime = 0f;
     this.m_SetChage[0]   = true;
     this.m_SetChage[1]   = true;
     this.m_SetChage[2]   = true;
     if (this.m_ExpImg != null && !this.m_ExpImg.gameObject.activeInHierarchy)
     {
         this.m_ExpImg.gameObject.SetActive(true);
         this.m_ExpText.enabled = false;
     }
     if (this.m_ExpText != null && !this.m_ExpText.gameObject.activeInHierarchy)
     {
         this.m_ExpText.gameObject.SetActive(true);
     }
     if (this.m_ExpText != null && this.m_ExpText != null)
     {
         str.ClearString();
         str.IntToFormat((long)((ulong)exp), 1, true);
         str.AppendFormat(DataManager.Instance.mStringTable.GetStringByID(55u));
         this.m_ExpText.text = str.ToString();
     }
     this.m_SkillID = skillID;
     AudioManager.Instance.PlayUISFX(UIKind.PetAddExp);
 }
Beispiel #13
0
    // Token: 0x0600010C RID: 268 RVA: 0x00011EF8 File Offset: 0x000100F8
    public void FormatRank(int index, ref CString Str)
    {
        Str.ClearString();
        int num = 0;

        AllianceWarManager._RegisterData[] data = this.GetData(index, ref num);
        if (this.RegisterData == data)
        {
            Str.IntToFormat((long)(num + 1), 1, false);
            Str.AppendFormat("{0}");
        }
        else
        {
            Str.StringToFormat("~");
            Str.IntToFormat((long)(num + 1), 1, false);
            Str.AppendFormat("{0}{1}");
        }
    }
Beispiel #14
0
 // Token: 0x060019EB RID: 6635 RVA: 0x002C0D30 File Offset: 0x002BEF30
 private void FormatResourceValue(CString CStr, long value)
 {
     if (value >= 1000000000L)
     {
         CStr.FloatToFormat((float)((double)value / 1000000000.0), 2, false);
         CStr.AppendFormat("{0}B");
     }
     else if (value >= 100000000L)
     {
         CStr.IntToFormat(value / 1000000L, 1, false);
         CStr.AppendFormat("{0}M");
     }
     else if (value >= 10000000L)
     {
         CStr.FloatToFormat((float)value / 1000000f, 1, false);
         CStr.AppendFormat("{0}M");
     }
     else if (value >= 1000000L)
     {
         CStr.FloatToFormat((float)value / 1000000f, 2, false);
         CStr.AppendFormat("{0}M");
     }
     else if (value >= 100000L)
     {
         CStr.IntToFormat(value / 1000L, 1, false);
         CStr.AppendFormat("{0}K");
     }
     else if (value >= 10000L)
     {
         CStr.FloatToFormat((float)value / 1000f, 1, false);
         CStr.AppendFormat("{0}K");
     }
     else if (value >= 1000L)
     {
         CStr.IntToFormat(value / 1000L, 1, false);
         CStr.IntToFormat(value % 1000L, 3, false);
         CStr.AppendFormat("{0},{1}");
     }
     else
     {
         CStr.IntToFormat(value, 1, false);
         CStr.AppendFormat("{0}");
     }
 }
Beispiel #15
0
    // Token: 0x060008DC RID: 2268 RVA: 0x000B5C4C File Offset: 0x000B3E4C
    public void Recv_MSG_GAMBLE_JACKPOT(MessagePacket MP)
    {
        GamblingManager.GamebleJackpot gamebleJackpot = new GamblingManager.GamebleJackpot();
        gamebleJackpot.KingdomID = MP.ReadUShort(-1);
        MP.ReadStringPlus(3, gamebleJackpot.Tag, -1);
        MP.ReadStringPlus(13, gamebleJackpot.Name, -1);
        uint num = MP.ReadUInt(-1);

        gamebleJackpot.PrizeWins = MP.ReadUInt(-1);
        gamebleJackpot.GameType  = (UIBattle_Gambling.eMode)MP.ReadByte(-1);
        gamebleJackpot.WonTime   = MP.ReadLong(-1);
        bool flag = DataManager.CompareStr(gamebleJackpot.Name, DataManager.Instance.RoleAttr.Name) == 0;

        this.AddJackpotData(gamebleJackpot);
        if (GUIManager.Instance.FindMenu(EGUIWindow.UI_Battle_Gambling) || gamebleJackpot.KingdomID == DataManager.MapDataController.kingdomData.kingdomID)
        {
            DataManager dataManager = DataManager.Instance;
            CString     cstring     = StringManager.Instance.StaticString1024();
            cstring.Append("<color=#FFFF00>");
            cstring.IntToFormat((long)((ulong)gamebleJackpot.PrizeWins), 1, true);
            cstring.AppendFormat(dataManager.mStringTable.GetStringByID(8473u));
            cstring.Append("</color>");
            MapMonster recordByKey  = DataManager.MapDataController.MapMonsterTable.GetRecordByKey(this.m_GambleEventSave.MonsterID);
            HeroTeam   recordByKey2 = dataManager.TeamTable.GetRecordByKey(recordByKey.MapTeamInfo[0].TeamID);
            Hero       recordByKey3 = dataManager.HeroTable.GetRecordByKey(recordByKey2.Arrays[10].Hero);
            CString    cstring2     = StringManager.Instance.StaticString1024();
            GameConstants.FormatRoleName(cstring2, gamebleJackpot.Name, gamebleJackpot.Tag, null, 0, (gamebleJackpot.KingdomID != DataManager.MapDataController.kingdomData.kingdomID) ? gamebleJackpot.KingdomID : 0, null, null, null, null);
            CString cstring3 = StringManager.Instance.StaticString1024();
            cstring3.Append("<color=#FFFF00>");
            cstring3.Append(cstring2);
            cstring3.Append("</color>");
            CString cstring4 = StringManager.Instance.SpawnString(1024);
            cstring4.StringToFormat(cstring3);
            if (gamebleJackpot.GameType == UIBattle_Gambling.eMode.Normal)
            {
                cstring4.StringToFormat(dataManager.mStringTable.GetStringByID(9171u));
            }
            else
            {
                cstring4.StringToFormat(dataManager.mStringTable.GetStringByID(9179u));
            }
            cstring4.StringToFormat(dataManager.mStringTable.GetStringByID((uint)recordByKey3.HeroName));
            cstring4.StringToFormat(cstring);
            cstring4.AppendFormat(dataManager.mStringTable.GetStringByID(9180u));
            this.GambleCountStr.Add(cstring4);
            GUIManager.Instance.SetRunningText(cstring4);
        }
        GUIManager.Instance.UpdateUI(EGUIWindow.UI_Battle_Gambling, 0, 0);
        GUIManager.Instance.UpdateUI(EGUIWindow.UI_Battle_Gambling, 2, 0);
        if (flag)
        {
            GUIManager.Instance.UpdateUI(EGUIWindow.UI_Battle_Gambling, 9, 0);
        }
        GUIManager.Instance.UpdateUI(EGUIWindow.UI_MonsterCrypt, 0, 0);
    }
Beispiel #16
0
    // Token: 0x06000B99 RID: 2969 RVA: 0x0010CF98 File Offset: 0x0010B198
    public NPC(Vector2 inipos, float iniscale, sbyte iniDir, byte npcID, NPCState npcState, Transform parent, ref int ABKey)
    {
        this.NPCControl              = null;
        this.NPCGameObject           = new GameObject("npc");
        this.NPCTransform            = this.NPCGameObject.transform;
        this.NPCTransform.localScale = Vector3.one * iniscale;
        this.NPCSpriteRenderer       = this.NPCGameObject.AddComponent <SpriteRenderer>();
        MapMonster recordByKey = DataManager.MapDataController.MapMonsterTable.GetRecordByKey((ushort)npcID);
        CString    cstring     = StringManager.Instance.SpawnString(30);

        cstring.ClearString();
        cstring.IntToFormat((long)recordByKey.MapNPCNO, 3, false);
        cstring.AppendFormat("UI/NPC_{0}");
        AssetBundle assetBundle = AssetManager.GetAssetBundle(cstring, out ABKey);

        StringManager.Instance.DeSpawnString(cstring);
        GameObject gameObject = UnityEngine.Object.Instantiate(assetBundle.mainAsset) as GameObject;

        gameObject.SetActive(false);
        Transform      transform  = gameObject.transform;
        UISpritesArray component  = transform.GetChild(0).GetComponent <UISpritesArray>();
        UISpritesArray component2 = transform.GetChild(1).GetComponent <UISpritesArray>();
        UISpritesArray component3 = transform.GetChild(2).GetComponent <UISpritesArray>();

        transform.SetParent(parent, false);
        this.NPCTransform.SetParent(parent, false);
        this.NPCSpriteRenderer.material             = component.m_Image.material;
        this.NPCSpriteRenderer.material.renderQueue = 3001;
        this.NPCAnimation    = new Sprite[3][];
        this.NPCAnimation[0] = component.m_Sprites;
        this.NPCAnimation[1] = component2.m_Sprites;
        this.NPCAnimation[2] = component3.m_Sprites;
        this.HitFrame        = recordByKey.HitFrame;
        this.NPCKindID       = npcID;
        this.CurNPCState     = ((npcState < NPCState.NPC_Hit) ? npcState : NPCState.NPC_Attack);
        this.NPCDir          = iniDir;
        if ((int)this.NPCDir == 0)
        {
            this.NPCDir = -1;
            this.NPCTransform.localRotation = Quaternion.Euler(0f, 180f, 0f);
        }
        else
        {
            this.NPCTransform.localRotation = Quaternion.Euler(0f, 0f, 0f);
        }
        this.NPCSheetID     = (byte)UnityEngine.Random.Range(0, this.NPCAnimation[(int)this.CurNPCState].Length);
        this.AnimationSpeed = 15f;
        this.AnimationTimer = 1f;
        this.posxoffset     = (this.posyoffset = (this.HurtTimer = (this.HitTimer = (this.DieTimer = 0f))));
        this.damage         = new List <Damage>(3);
        this.fighters       = new List <LineNode>(16);
        this.hurt           = new List <float>(16);
        this.updateNPC(inipos.x, inipos.y);
        this.SetActive(false);
    }
Beispiel #17
0
    // Token: 0x06001F01 RID: 7937 RVA: 0x003B77C0 File Offset: 0x003B59C0
    public void SetScore()
    {
        bool    flag    = false;
        long    num     = 0L;
        CString cstring = StringManager.Instance.StaticString1024();

        cstring.ClearString();
        cstring.IntToFormat(NetworkManager.UserID, 1, false);
        cstring.AppendFormat("{0}_Score_UseID");
        long.TryParse(PlayerPrefs.GetString(cstring.ToString()), out num);
        if (num != 0L)
        {
            cstring.ClearString();
            cstring.IntToFormat(num, 1, false);
            cstring.AppendFormat("{0}_Score_bScoreFirst");
            bool.TryParse(PlayerPrefs.GetString(cstring.ToString()), out flag);
            if (flag)
            {
                byte b = 0;
                cstring.ClearString();
                cstring.IntToFormat(num, 1, false);
                cstring.AppendFormat("{0}_Score_Count");
                byte.TryParse(PlayerPrefs.GetString(cstring.ToString()), out b);
                b += 1;
                PlayerPrefs.SetString(cstring.ToString(), b.ToString());
            }
            else
            {
                flag = true;
                cstring.ClearString();
                cstring.IntToFormat(num, 1, false);
                cstring.AppendFormat("{0}_Score_bScoreFirst");
                PlayerPrefs.SetString(cstring.ToString(), flag.ToString());
            }
            cstring.ClearString();
            cstring.IntToFormat(num, 1, false);
            cstring.AppendFormat("{0}_Score_CD");
            PlayerPrefs.SetString(cstring.ToString(), this.DM.ServerTime.ToString());
        }
        else
        {
            PlayerPrefs.SetString(cstring.ToString(), NetworkManager.UserID.ToString());
            long.TryParse(PlayerPrefs.GetString(cstring.ToString()), out num);
            flag = true;
            cstring.ClearString();
            cstring.IntToFormat(num, 1, false);
            cstring.AppendFormat("{0}_Score_bScoreFirst");
            PlayerPrefs.SetString(cstring.ToString(), flag.ToString());
            bool.TryParse(PlayerPrefs.GetString(cstring.ToString()), out flag);
            cstring.ClearString();
            cstring.IntToFormat(num, 1, false);
            cstring.AppendFormat("{0}_Score_CD");
            PlayerPrefs.SetString(cstring.ToString(), this.DM.ServerTime.ToString());
        }
    }
Beispiel #18
0
    // Token: 0x06001BC4 RID: 7108 RVA: 0x00315998 File Offset: 0x00313B98
    public void GetLegionHintStr(byte heroEnhance, ref Skill skill, ref CString Content, byte RankStr = 0)
    {
        CString cstring  = StringManager.Instance.StaticString1024();
        CString cstring2 = StringManager.Instance.StaticString1024();

        cstring.Append(Content);
        float num = (float)skill.HurtValue + (float)((ushort)this.LegionRankMagnifation[(int)(heroEnhance - 1)] * skill.HurtIncreaseValue) / 1000f;

        if (skill.HurtKind == 1)
        {
            GameConstants.GetEffectValue(Content, skill.HurtAddition, 0u, 7, 0f);
            Content.IntToFormat((long)((ushort)this.LegionRankMagnifation[(int)(heroEnhance - 1)] * skill.HurtIncreaseValue), 1, true);
            Content.AppendFormat("{0}");
        }
        else if (skill.SkillType == 10)
        {
            GameConstants.GetEffectValue(Content, skill.HurtAddition, (uint)num, 1, 0f);
        }
        else
        {
            GameConstants.GetEffectValue(Content, skill.HurtAddition, 0u, 6, num * 100f);
        }
        if (RankStr > 0)
        {
            cstring2.StringToFormat(DataManager.Instance.mStringTable.GetStringByID(15u));
            cstring2.IntToFormat((long)RankStr, 1, false);
            cstring2.StringToFormat(Content);
            if (skill.SkillType == 10)
            {
                cstring2.AppendFormat("<color=#ffff00ff>{0}{1} : {2}</color>");
            }
            else
            {
                cstring2.AppendFormat("<color=#33eb67ff>{0}{1} : {2}</color>");
            }
        }
        else
        {
            cstring2.StringToFormat(Content);
            if (skill.SkillType == 10)
            {
                cstring2.AppendFormat("<color=#ffff00ff>{0}</color>");
            }
            else
            {
                cstring2.AppendFormat("<color=#33eb67ff>{0}</color>");
            }
        }
        cstring2.Insert(0, cstring, -1);
        Content.ClearString();
        Content.Append(cstring2);
    }
Beispiel #19
0
    // Token: 0x06001831 RID: 6193 RVA: 0x0028C544 File Offset: 0x0028A744
    private void GetTimeString(CString CStr, uint sec)
    {
        if (sec > 86400u)
        {
            CStr.IntToFormat((long)(sec / 86400u), 1, false);
            CStr.AppendFormat("{0}d");
            return;
        }
        uint num = sec % 86400u;

        if (num >= 3600u)
        {
            CStr.IntToFormat((long)(num / 3600u), 1, false);
            CStr.AppendFormat("{0}h");
            return;
        }
        num %= 3600u;
        CStr.IntToFormat((long)(num / 60u), 2, false);
        CStr.AppendFormat("{0}:");
        num %= 60u;
        CStr.IntToFormat((long)((ulong)num), 2, false);
        CStr.AppendFormat("{0}");
    }
Beispiel #20
0
 // Token: 0x06001C78 RID: 7288 RVA: 0x003255AC File Offset: 0x003237AC
 private void LoadModel(Hero herodata, out int AssetKey)
 {
     if (herodata.HeroKey == 101)
     {
         this.bundle        = AssetManager.GetAssetBundle("Role/Priest", out AssetKey, false);
         this.bundleRequest = this.bundle.LoadAsync("Priest", typeof(GameObject));
     }
     else
     {
         CString cstring = StringManager.Instance.StaticString1024();
         cstring.IntToFormat((long)herodata.Modle, 5, false);
         cstring.AppendFormat("Role/hero_{0}");
         this.bundle = AssetManager.GetAssetBundle(cstring, out AssetKey);
         if (this.bundle == null)
         {
             cstring.ClearString();
             cstring.IntToFormat(1L, 5, false);
             cstring.AppendFormat("Role/hero_{0}");
             this.bundle = AssetManager.GetAssetBundle(cstring, out AssetKey);
         }
         this.bundleRequest = this.bundle.LoadAsync("m", typeof(GameObject));
     }
 }
Beispiel #21
0
    // Token: 0x06001448 RID: 5192 RVA: 0x00238FD0 File Offset: 0x002371D0
    public void ReSetFB_CDTime(CString tmpName = null)
    {
        long num = 0L;

        if (tmpName == null)
        {
            tmpName = StringManager.Instance.StaticString1024();
        }
        tmpName.ClearString();
        tmpName.IntToFormat(NetworkManager.UserID, 1, false);
        tmpName.AppendFormat("{0}_FB_CDTime_UseID");
        long.TryParse(PlayerPrefs.GetString(tmpName.ToString()), out num);
        if (!this.IsCanSetFB_CDTime(tmpName, num))
        {
            return;
        }
        tmpName.ClearString();
        tmpName.IntToFormat(num, 1, false);
        tmpName.AppendFormat("{0}_FB_CDTime_Time");
        long num2 = (long)(86400 * UnityEngine.Random.Range(10, 14));

        PlayerPrefs.SetString(tmpName.ToString(), (ActivityManager.Instance.ServerEventTime + num2).ToString());
        DataManager.FBMissionDataManager.bFB_btnShow = false;
    }
Beispiel #22
0
    // Token: 0x060024E4 RID: 9444 RVA: 0x004247D0 File Offset: 0x004229D0
    public void InitialABString()
    {
        if (this.StrPackageID == 0)
        {
            return;
        }
        CString cstring = StringManager.Instance.StaticString1024();

        cstring.IntToFormat((long)this.StrPackageID, 1, false);
        cstring.AppendFormat("Store/Package_{0}");
        this.m_StrAssetBundle = AssetManager.GetAssetBundle(cstring, out this.m_StrAssetBundleKey);
        if (this.m_StrAssetBundle != null)
        {
            this.DownLoadStr = (this.m_StrAssetBundle.Load("Package", typeof(Download)) as Download);
        }
    }
Beispiel #23
0
    // Token: 0x0600003A RID: 58 RVA: 0x00003ACC File Offset: 0x00001CCC
    public void InitialABString()
    {
        if (this.DetailStr == 0)
        {
            return;
        }
        CString cstring = StringManager.Instance.StaticString1024();

        cstring.IntToFormat((long)this.DetailStr, 1, false);
        cstring.AppendFormat("UI/UIActivityPackage_{0}");
        this.m_StrAssetBundle = AssetManager.GetAssetBundle(cstring, out this.m_StrAssetBundleKey);
        if (this.m_StrAssetBundle != null)
        {
            this.DownLoadStr = (this.m_StrAssetBundle.Load("Package", typeof(ActivityData)) as ActivityData);
        }
    }
Beispiel #24
0
    // Token: 0x0600108E RID: 4238 RVA: 0x001D6B1C File Offset: 0x001D4D1C
    public void SetArmyIcon(Image image, int ArmyIdx, UIText IconText, CString str, UIButtonHint hint, Image background, float textWidth)
    {
        if (background == null || image == null || this.m_SpritesArray == null)
        {
            return;
        }
        Vector2 sizeDelta = background.rectTransform.sizeDelta;

        sizeDelta.x = ((textWidth <= 238.4f) ? (textWidth + 40f) : 278.4f);
        background.rectTransform.sizeDelta = sizeDelta;
        SoldierData recordByKey = this.DM.SoldierDataTable.GetRecordByKey((ushort)(ArmyIdx + 1));

        image.sprite = this.m_SpritesArray.GetSprite((int)recordByKey.SoldierKind);
        str.ClearString();
        str.IntToFormat((long)recordByKey.Tier, 1, false);
        str.AppendFormat("{0}");
        IconText.text = str.ToString();
        hint.Parm1    = (ushort)ArmyIdx;
    }
Beispiel #25
0
    // Token: 0x06001707 RID: 5895 RVA: 0x0027B5F4 File Offset: 0x002797F4
    public void LoadPet()
    {
        this.sPet    = PetManager.Instance.PetTable.GetRecordByKey(this.ID);
        this.sHero   = DataManager.Instance.HeroTable.GetRecordByKey(this.sPet.HeroID);
        this.petData = PetManager.Instance.FindPetData(this.ID);
        CString cstring = StringManager.Instance.StaticString1024();

        cstring.IntToFormat((long)this.sHero.Modle, 5, false);
        cstring.AppendFormat("Role/hero_{0}");
        if (AssetManager.GetAssetBundleDownload(cstring, AssetPath.Role, AssetType.Hero, this.sHero.Modle, false))
        {
            this.m_AssetBundle = AssetManager.GetAssetBundle(cstring, out this.AssetKey);
            if (this.m_AssetBundle != null)
            {
                this.m_ABRequest = this.m_AssetBundle.LoadAsync("m", typeof(GameObject));
                this.IsDone      = false;
            }
        }
    }
Beispiel #26
0
    // Token: 0x0600144C RID: 5196 RVA: 0x002394B0 File Offset: 0x002376B0
    public void RecvFBGetReward(MessagePacket MP)
    {
        GUIManager.Instance.HideUILock(EUILock.Mission);
        byte b = MP.ReadByte(-1);

        if (b > 0)
        {
            CString cstring = StringManager.Instance.StaticString1024();
            cstring.IntToFormat((long)b, 1, false);
            cstring.AppendFormat(DataManager.Instance.mStringTable.GetStringByID(12185u));
            GUIManager.Instance.AddHUDMessage(cstring.ToString(), 255, true);
            return;
        }
        if (this.CurFBAwardData.AwardIndex == 11)
        {
            GUIManager.Instance.UpdateUI(EGUIWindow.UI_MissionFB, 1, 0);
        }
        GUIManager.Instance.UpdateUI(EGUIWindow.Door, 27, 1);
        AudioManager.Instance.PlayUISFX(UIKind.RewardReceive);
    }
Beispiel #27
0
 // Token: 0x060016BD RID: 5821 RVA: 0x0027315C File Offset: 0x0027135C
 public void OnButtonClick(UIButton sender)
 {
     if (sender.m_BtnID1 > 0)
     {
         this.UpdateUI(11, 1);
         return;
     }
     if (sender.m_BtnID2 > 0 && sender.m_BtnID2 <= PetBuff.PetSkills.Count)
     {
         this.currentBtnID     = sender.m_BtnID2;
         UIPetSkill.nowPetId   = PetBuff.PetSkills[sender.m_BtnID2 - 1].Pet;
         UIPetSkill.nowSkillId = (ushort)PetBuff.PetSkills[sender.m_BtnID2 - 1].ID;
         PetSkillTbl recordByKey = PetManager.Instance.PetSkillTable.GetRecordByKey((ushort)PetBuff.PetSkills[sender.m_BtnID2 - 1].ID);
         this.onSelect(PetManager.Instance.MapDamageEffTable.GetRecordByKey(recordByKey.DamageRange).RangeTbID);
         this.m_CrownBack = base.transform.GetChild(1).GetChild(26).GetChild(3).gameObject.GetComponent <Image>();
         CString cstring = StringManager.Instance.StaticString1024();
         cstring.IntToFormat((long)recordByKey.Icon, 5, false);
         cstring.AppendFormat("s{0}");
         this.m_Defeater           = this.m_CrownBack.transform.GetChild(0).GetComponent <Image>();
         this.m_Defeater.sprite    = this.GM.LoadFrameSprite("sk");
         this.m_Defeater.material  = this.GM.GetFrameMaterial();
         this.m_CrownBack.sprite   = this.GM.LoadSkillSprite(cstring);
         this.m_CrownBack.material = this.GM.GetSkillMaterial();
         this.UpdateUI(5, 0);
         return;
     }
     if (sender.m_BtnID3 > 0)
     {
         this.SkillInfo.ClearString();
         this.SkillInfo.Append(this.DM.mStringTable.GetStringByID(12585u));
         this.SkillInfo.Append("\n");
         this.SkillInfo.Append(this.DM.mStringTable.GetStringByID(12586u));
         this.SkillInfo.Append("\n");
         this.SkillInfo.Append(this.DM.mStringTable.GetStringByID(12591u));
         this.SkillInfo.Append("\n");
         this.SkillInfo.Append(this.DM.mStringTable.GetStringByID(12583u));
         this.GM.OpenMessageBoxEX(this.DM.mStringTable.GetStringByID(12562u), this.SkillInfo.ToString(), null, null, 0, 0, true, true);
         return;
     }
     this.UpdateUI(0, 0);
 }
Beispiel #28
0
 // Token: 0x060024E0 RID: 9440 RVA: 0x004243CC File Offset: 0x004225CC
 public void SendAskDownLoad()
 {
     if (this.Type == ETreasureType.ETST_Crystal)
     {
         return;
     }
     if (this.m_AssetBundleKey == 0 && this.PicPackageID1 != 0)
     {
         CString cstring = StringManager.Instance.StaticString1024();
         cstring.IntToFormat((long)this.PicPackageID1, 1, false);
         cstring.AppendFormat("Store/Mallback_{0}");
         if (AssetManager.GetAssetBundleDownload(cstring, AssetPath.Store, AssetType.MallBack, this.PicPackageID1, false))
         {
             this.bDownLoadPic = true;
         }
     }
     if (this.PicPackageID2 != 0)
     {
         MallManager instance = MallManager.Instance;
         ushort      num      = this.PicPackageID2 + 1000;
         CString     cstring2 = StringManager.Instance.StaticString1024();
         cstring2.IntToFormat((long)num, 1, false);
         cstring2.AppendFormat("Store/Mallback_{0}");
         if (AssetManager.GetAssetBundleDownload(cstring2, AssetPath.Store, AssetType.MallBack, num, false) && instance.MainData != null && instance.MainData.PicPackageID2 == this.PicPackageID2)
         {
             instance.LoadMainPackege(num);
             instance.SetMainPackage();
         }
     }
     if (this.m_StrAssetBundleKey == 0 && this.StrPackageID != 0)
     {
         CString cstring3 = StringManager.Instance.StaticString1024();
         cstring3.IntToFormat((long)this.StrPackageID, 1, false);
         cstring3.AppendFormat("Store/Package_{0}");
         if (AssetManager.GetAssetBundleDownload(cstring3, AssetPath.Store, AssetType.MallPackage, this.StrPackageID, false))
         {
             this.bDownLoadStr = true;
         }
     }
     MallManager.Instance.CheckOpenMain();
 }
Beispiel #29
0
    // Token: 0x06001BFD RID: 7165 RVA: 0x00319558 File Offset: 0x00317758
    string SimpleHintKind.SetContent(CString Content, int Parm1, int Parm2)
    {
        Content.ClearString();
        DataManager instance = DataManager.Instance;

        Content.Append("<color=#FFF799FF>");
        Content.Append(instance.mStringTable.GetStringByID((uint)instance.SoldierDataTable.GetRecordByKey((ushort)(Parm1 + 1)).Name));
        Content.Append("</color>");
        Content.Append('\n');
        Content.IntToFormat((long)((Parm1 & 3) + 1), 1, false);
        if (Parm1 < 16)
        {
            Content.StringToFormat(DataManager.Instance.mStringTable.GetStringByID((uint)(3841 + (Parm1 >> 2))));
        }
        else
        {
            Content.StringToFormat(DataManager.Instance.mStringTable.GetStringByID((uint)(12079 + (Parm1 - 16 >> 2))));
        }
        Content.AppendFormat(DataManager.Instance.mStringTable.GetStringByID(12078u));
        return(Content.ToString());
    }
Beispiel #30
0
    // Token: 0x06001A4B RID: 6731 RVA: 0x002C9B38 File Offset: 0x002C7D38
    public void LoadHero3D()
    {
        this.ActionTime       = 0f;
        this.ActionTimeRandom = 2f;
        CString cstring = StringManager.Instance.StaticString1024();

        cstring.IntToFormat((long)this.sHero.Modle, 5, false);
        cstring.AppendFormat("Role/hero_{0}");
        if (AssetManager.GetAssetBundleDownload(cstring, AssetPath.Role, AssetType.Hero, this.sHero.Modle, false))
        {
            this.AB = AssetManager.GetAssetBundle(cstring, out this.AssetKey);
            if (this.AB != null)
            {
                this.AR       = this.AB.LoadAsync("m", typeof(GameObject));
                this.ABIsDone = false;
            }
        }
        else
        {
            this.AR = null;
        }
    }