Exemple #1
0
    public void ApplyContinueNeedDigiStone(BattleStateData battleStateData, int needDigiStone, int currentDigistone, bool isCheckDigiStoneZero)
    {
        string @string = StringMaster.GetString("BattleUI-11");

        if (isCheckDigiStoneZero && currentDigistone < needDigiStone)
        {
            @string = StringMaster.GetString("BattleUI-11");
        }
        else if (needDigiStone < battleStateData.playerCharacters.Length + 2)
        {
            @string = StringMaster.GetString("BattleUI-09");
        }
        else
        {
            @string = StringMaster.GetString("BattleUI-08");
        }
        this.digistoneDescription.text = string.Format(@string, needDigiStone);
        if (currentDigistone >= needDigiStone)
        {
            this.revivalOrShopLocalize.text = StringMaster.GetString("BattleUI-14");
        }
        else
        {
            this.revivalOrShopLocalize.text = StringMaster.GetString("SystemButtonGoShop");
        }
        if (this.offRevivalOrShopLocalize != null)
        {
            this.offRevivalOrShopLocalize.text = this.revivalOrShopLocalize.text;
        }
    }
    public Queue <CharacterStateControl> GetSortedSpeedCharacerList(CharacterStateControl[] controlers = null)
    {
        BattleStateData          battleStateData = BattleStateManager.current.battleStateData;
        BattleStateManager       current         = BattleStateManager.current;
        BattleStateHierarchyData hierarchyData   = BattleStateManager.current.hierarchyData;

        CharacterStateControl[]       collection = (controlers != null) ? controlers : this.GetTotalCharacters();
        Queue <CharacterStateControl> queue      = new Queue <CharacterStateControl>(collection);

        if (controlers == null)
        {
            foreach (CharacterStateControl characterStateControl in queue)
            {
                characterStateControl.SpeedRandomize(hierarchyData.onEnableRandomValue);
                current.fraudCheck.FraudCheckOverflowMaxSpeed(characterStateControl);
            }
        }
        CharacterStateControl[] collection2 = CharacterStateControlSorter.SortedSpeedEnemyPriority(queue.ToArray());
        queue = new Queue <CharacterStateControl>(collection2);
        battleStateData.currentTurnNumber = 0;
        battleStateData.SetOrderInSortedCharacter(queue, -1);
        if (!current.onEnableTutorial)
        {
            hierarchyData.onEnableRandomValue = true;
        }
        return(queue);
    }
Exemple #3
0
    private void ManageItemDropResultForJsonToValue(string json, BattleStateData battleStateData)
    {
        string[] array             = JsonReader.Deserialize(json, typeof(string[])) as string[];
        List <ItemDropResult> list = new List <ItemDropResult>();

        foreach (string value in array)
        {
            ItemDropResultStore itemDropResultStore = JsonReader.Deserialize(value, typeof(ItemDropResultStore)) as ItemDropResultStore;
            ItemDropResult      item = new ItemDropResult(itemDropResultStore.dropBoxType);
            list.Add(item);
        }
        battleStateData.itemDropResults = list;
    }
Exemple #4
0
    public IEnumerator LoadCharacterParam(string characterId, int index, Action <CharacterParams, int, string> result)
    {
        BattleDebug.Log(string.Concat(new object[]
        {
            "--- モンスター単体ロード characterId[",
            characterId,
            "] index[",
            index,
            "] : 開始"
        }));
        GameObject prefab    = base.stateManager.serverControl.GetCharacterPrefab(characterId);
        GameObject character = base.Instantiate <GameObject>(prefab);

        yield return(null);

        character.name = characterId;
        character.transform.SetParent(base.battleStateData.characterRoot);
        character.transform.position = Vector3.zero;
        character.transform.rotation = Quaternion.identity;
        CharacterParams characterParams = character.GetComponent <CharacterParams>();
        CapsuleCollider col             = characterParams.GetComponent <CapsuleCollider>();

        col.radius = 1.03f;
        if (base.battleStateData.useCharacterShadow)
        {
            characterParams.SetShadowObject();
            yield return(null);
        }
        characterParams.PlayAnimation(CharacterAnimationType.idle, SkillType.Attack, 0, null, null);
        yield return(null);

        characterParams.Initialize(base.hierarchyData.cameraObject.camera3D);
        GameObject      hasColliderObject = characterParams.collider.gameObject;
        BattleStateData battleStateData   = base.battleStateData;

        battleStateData.characterColliderLayerMask |= 1 << hasColliderObject.layer;
        character.gameObject.SetActive(false);
        result(characterParams, index, characterId);
        BattleDebug.Log(string.Concat(new object[]
        {
            "--- モンスター単体ロード characterId[",
            characterId,
            "] index[",
            index,
            "] : 完了"
        }));
        yield break;
    }
Exemple #5
0
 public void SetCharacterState(CharacterStateControlStore savedCSC, BattleStateData battleStateData)
 {
     this._currentHp    = savedCSC.hp;
     this.ap            = savedCSC.ap;
     this.isSelectSkill = savedCSC.isSelectSkill;
     this.hate          = savedCSC.hate;
     this.previousHate  = savedCSC.previousHate;
     this.isLeader      = savedCSC.isLeader;
     this.skillOrder    = savedCSC.skillOrder;
     this.myIndex       = savedCSC.myIndex;
     this.isEnemy       = savedCSC.isEnemy;
     this.currentSufferState.Set(savedCSC.currentSufferState);
     this.randomedSpeed  = savedCSC.randomedSpeed;
     this.isEscape       = savedCSC.isEscape;
     this.skillUseCounts = savedCSC.skillUseCounts;
     this.chip.SetCharacterState(savedCSC);
 }
Exemple #6
0
    public static List <CharacterStateControl> GetSufferCharacters(SufferStateProperty.SufferType sufferType, BattleStateData battleStateData)
    {
        List <CharacterStateControl> list = new List <CharacterStateControl>();

        foreach (CharacterStateControl characterStateControl in battleStateData.GetTotalCharacters())
        {
            if (!characterStateControl.isDied)
            {
                if (characterStateControl.currentSufferState.FindSufferState(sufferType))
                {
                    list.Add(characterStateControl);
                }
            }
        }
        return(list);
    }
Exemple #7
0
    private void ManageCharacterStateControlForJsonToValue(string json, CharacterStateControl characterStateControl, BattleStateData battleStateData)
    {
        CharacterStateControlStore savedCSC = JsonReader.Deserialize(json, typeof(CharacterStateControlStore)) as CharacterStateControlStore;

        characterStateControl.SetCharacterState(savedCSC, battleStateData);
    }
Exemple #8
0
    public void Save(BattleStateData battleStateData)
    {
        battleStateData.ticketId = DataMng.Instance().GetResultUtilData().last_dng_req.userDungeonTicketId;
        PropertyInfo[] propertyInfos = this.GetPropertyInfos(typeof(BattleStateData), false);
        List <string>  list          = new List <string>();
        string         propInfoName  = string.Empty;
        Type           propInfoType  = null;

        foreach (PropertyInfo propertyInfo in propertyInfos)
        {
            propInfoName = propertyInfo.Name;
            propInfoType = propertyInfo.PropertyType;
            if (!this.typeNameBlackList.Any((Type c) => c == propInfoType))
            {
                if (!this.variableNameBlackList.Any((string c) => c == propInfoName))
                {
                    if (propertyInfo.PropertyType == typeof(CharacterStateControl))
                    {
                        if (propInfoName == "leaderCharacter")
                        {
                        }
                    }
                    else if (propInfoType == typeof(CharacterStateControl[]))
                    {
                        if (propInfoName == "playerCharacters")
                        {
                            List <string>           list2  = new List <string>();
                            CharacterStateControl[] array2 = propertyInfo.GetValue(battleStateData, null) as CharacterStateControl[];
                            foreach (CharacterStateControl csc in array2)
                            {
                                string item = this.ManageCharacterStateControlForValueToJson(csc);
                                list2.Add(item);
                            }
                            string item2 = JsonWriter.Serialize(list2.ToArray());
                            list.Add(item2);
                        }
                        else if (!(propInfoName == "enemies"))
                        {
                            global::Debug.LogFormat("ありえない変数名:{0}です。", new object[]
                            {
                                propInfoName
                            });
                        }
                    }
                    else if (propInfoType == typeof(CharacterStateControl[][]))
                    {
                        List <string[]>           list3  = new List <string[]>();
                        CharacterStateControl[][] array4 = propertyInfo.GetValue(battleStateData, null) as CharacterStateControl[][];
                        foreach (CharacterStateControl array6 in array4)
                        {
                            List <string> list4 = new List <string>();
                            foreach (CharacterStateControl csc2 in array6)
                            {
                                string item3 = this.ManageCharacterStateControlForValueToJson(csc2);
                                list4.Add(item3);
                            }
                            list3.Add(list4.ToArray());
                        }
                        string item4 = JsonWriter.Serialize(list3.ToArray());
                        list.Add(item4);
                    }
                    else if (propInfoType == typeof(List <ItemDropResult>))
                    {
                        List <ItemDropResult> idrs = propertyInfo.GetValue(battleStateData, null) as List <ItemDropResult>;
                        string item5 = this.ManageItemDropResultForValueToJson(idrs);
                        list.Add(item5);
                    }
                    else
                    {
                        object value = propertyInfo.GetValue(battleStateData, null);
                        string item6 = JsonWriter.Serialize(value);
                        list.Add(item6);
                    }
                }
            }
        }
        this.AppendStandardInfo(list);
        this.cachedJsonForSave = list;
        this.SaveForSystem();
    }
Exemple #9
0
    public void Load(BattleStateData battleStateData)
    {
        string propInfoName = string.Empty;
        Type   propInfoType = null;

        try
        {
            PropertyInfo[] propertyInfos = this.GetPropertyInfos(typeof(BattleStateData), false);
            int            num           = 0;
            foreach (PropertyInfo propertyInfo in propertyInfos)
            {
                propInfoName = propertyInfo.Name;
                propInfoType = propertyInfo.PropertyType;
                if (!this.typeNameBlackList.Any((Type c) => c == propInfoType))
                {
                    if (!this.variableNameBlackList.Any((string c) => c == propInfoName))
                    {
                        string text = this.cachedJsonArr[num];
                        if (propInfoType != typeof(CharacterStateControl))
                        {
                            if (propInfoType == typeof(CharacterStateControl[]))
                            {
                                if (propInfoName == "playerCharacters")
                                {
                                    string[] array2 = JsonReader.Deserialize(text, typeof(string[])) as string[];
                                    int      num2   = 0;
                                    foreach (string json in array2)
                                    {
                                        this.ManageCharacterStateControlForJsonToValue(json, battleStateData.playerCharacters[num2], battleStateData);
                                        num2++;
                                    }
                                }
                                else
                                {
                                    if (propInfoName == "enemies")
                                    {
                                        goto IL_279;
                                    }
                                    global::Debug.LogErrorFormat("ありえない変数名:{0}です。", new object[]
                                    {
                                        propInfoName
                                    });
                                    goto IL_279;
                                }
                            }
                            else if (propInfoType == typeof(CharacterStateControl[][]))
                            {
                                string[][] array4 = JsonReader.Deserialize(text, typeof(string[][])) as string[][];
                                int        num3   = 0;
                                foreach (string array6 in array4)
                                {
                                    int num4 = 0;
                                    foreach (string json2 in array6)
                                    {
                                        this.ManageCharacterStateControlForJsonToValue(json2, battleStateData.preloadEnemies[num3][num4], battleStateData);
                                        num4++;
                                    }
                                    num3++;
                                }
                            }
                            else if (propInfoType == typeof(List <ItemDropResult>))
                            {
                                this.ManageItemDropResultForJsonToValue(text, battleStateData);
                            }
                            else if (!(propertyInfo.Name == "currentDigiStoneNumber"))
                            {
                                object value = JsonReader.Deserialize(text, propInfoType);
                                propertyInfo.SetValue(battleStateData, value, null);
                            }
                        }
                        num++;
                    }
                }
                IL_279 :;
            }
        }
        catch (Exception ex)
        {
            global::Debug.LogErrorFormat("Error:{0}, 変数名:{1}, Type:{2}", new object[]
            {
                ex.Message,
                propInfoName,
                propInfoType
            });
        }
        DkLog.W(string.Format("チケットID {0} : {1}", battleStateData.ticketId, DataMng.Instance().GetResultUtilData().last_dng_req.userDungeonTicketId), false);
        if (!string.IsNullOrEmpty(battleStateData.ticketId))
        {
            DataMng.Instance().GetResultUtilData().last_dng_req.userDungeonTicketId = battleStateData.ticketId;
        }
    }
    public void SendPvPBattleActionLog(AttackData attackData, int attackerIndex, bool isMyAction, BattleStateData battleStateData, List <BattleLogData.AttackLog> attackLog, List <BattleLogData.BuffLog> buffLog)
    {
        BattleLogData value = new BattleLogData
        {
            playerUserId           = attackData.playerUserId,
            attackerIndex          = attackerIndex,
            selectSkillIdx         = attackData.selectSkillIdx,
            targetIdx              = attackData.targetIdx,
            isTargetCharacterEnemy = attackData.isTargetCharacterEnemy,
            isMyAction             = isMyAction,
            round     = battleStateData.currentRoundNumber,
            turn      = battleStateData.currentTurnNumber + 1,
            attackLog = attackLog,
            buffLog   = buffLog
        };
        string action = JsonWriter.Serialize(value);
        Dictionary <string, object> dictionary = new Dictionary <string, object>();
        PvPBattleActionLog          value2     = new PvPBattleActionLog
        {
            action       = action,
            isMockBattle = ((!(ClassSingleton <MultiBattleData> .Instance.MockBattleUserCode == "0")) ? 1 : 0)
        };

        dictionary.Add("080114", value2);
        Singleton <TCPUtil> .Instance.SendTCPRequest(dictionary, "activityList");
    }