internal GameData(GameFlags gameFlags, Character clientCharacter)
        {
            if (clientCharacter == null)
            {
                throw new ArgumentNullException(nameof(clientCharacter));
            }

            Flags                   = gameFlags;
            Act                     = new ActData();
            ClientCharacter         = clientCharacter;
            _walkingSpeedMultiplier = new Lazy <double>(() =>
            {
                var walkingSpeedIncreasedMultiplier = 1.0;
                var speedItems = this.Items.Where(i => i.Value.Action == Action.Equip && i.Value.PlayerId == Me?.Id).Select(i => i.Value.GetValueOfStatType(StatType.FasterRunWalk));
                if (speedItems.Any())
                {
                    walkingSpeedIncreasedMultiplier += speedItems.Aggregate((agg, frw) => agg + frw) / (double)100;
                }

                var increasedSpeedSkill = Me.Skills.GetValueOrDefault(Skill.IncreasedSpeed, 0);
                if (increasedSpeedSkill > 0)
                {
                    walkingSpeedIncreasedMultiplier += (13 + 4 * increasedSpeedSkill) / (double)100;
                }

                var vigorSkill = Me.Skills.GetValueOrDefault(Skill.Vigor, 0);
                if (vigorSkill > 0)
                {
                    walkingSpeedIncreasedMultiplier += (13 + 2.5 * vigorSkill) / (double)100;
                }

                return(walkingSpeedIncreasedMultiplier);
            });
        }
    public void Initialize(ActData data, bool available)
    {
        Title.text      = "Act " + data.ActNumber;
        ActImage.sprite = data.LoadSprite();

        locked.SetActive(available);
    }
    public void Initialize(ActData act, Button BackButton = null)
    {
        this.act = act;

        print("Selected Act[" + act.ActNumber + "] " + act.Name);
        ActNumber.text = "Act " + act.ActNumber;
        ActName.text   = act.Name;
        container.DOAnchorPosX(0f, 0f);

        MoveZoneInformation(PrefType.LAST_SELECTED_ZONE.GetInt(0), true);
        PopulateZones();
        ClearPartyList();

        for (int h = 0; h < 5; h++)
        {
            HeroDisplay hd = _partyList.GetOrCreate(HeroPrefab, partyArea.transform);
            hd.isClearable  = true;
            hd.isUsingFades = true;
            hd.Btn_ClearSlot();
            hd.Initialize(null, HeroListFilterType.Level, OnPartySlotSelected);
            hd.btnClear.onClick.AddListener(() => OnPartySlotClear(hd));
        }

        this.BackButton = BackButton;

        if (PlayerPrefs.GetInt("tutorial_step") == 7)
        {
            StoryManager.Instance.DisplayStory("story_tutorial_explore_choose_zone");

            PlayerPrefs.SetInt("tutorial_step", 8);
        }
    }
Exemple #4
0
 /// <summary type="" dos="public">
 /// Копирующий конструктор.
 /// </summary>
 /// <param name="old"> Старый объект данного типа. </param>
 public Act(Act old)
 {
     ActType = old.ActType;
     vertex  = old.vertex;
     edge    = old.edge;
     data    = new ActData(old.data);
     labels  = old.labels;
 }
Exemple #5
0
 public void Init()
 {
     this.Acts = new List <ActBase>();
     for (int i = 0; i < Data.Actions.Count; i++)
     {
         ActData data = Data.Actions[i];
         ActBase act  = ActFactory(data);
         if (act != null)
         {
             Acts.Add(act);
         }
     }
 }
Exemple #6
0
 /// <summary type="" dos="public">
 /// Конструткор для инициализации полей.
 /// </summary>
 /// <param name="actType"> Тип анимационного события. </param>
 /// <param name="objs"> Список анимируемых объектов. </param>
 public Act(ActTypes actType, params object[] objs)
 {
     ActType = actType;
     labels  = new List <ALabel>();
     foreach (var item in objs)
     {
         vertex = vertex ?? item as Vertex;
         edge   = edge ?? item as Edge;
         data   = data ?? item as ActData;
         if (item is Label)
         {
             labels.Add(item as ALabel);
         }
     }
 }
Exemple #7
0
    public static ActBase ActFactory(ActData data)
    {
        ActBase act = null;

        switch (data.Type)
        {
        case EActType.TYPE_ANIM:
            act = new ActAnim();
            break;
        }
        if (act != null)
        {
            act.Data = data;
        }
        return(act);
    }
Exemple #8
0
    public static void initEftActData()
    {
        /* get <eftAct> node ChildNode list  (<Trainer_skillA name="Trainer_skillA">, <Marine_skillB_foot name="Marine_skillB_foot">) //*/
        XmlNodeList eftActXmlList = StaticData.getEftActXML();
        for( int i=0; i<eftActXmlList.Count; i++)
        {
            Hashtable actMgr = new Hashtable();
            ActData[] actDatas;
            Hashtable actList  = new Hashtable();

            // get <Trainer_skillA name="Trainer_skillA"> or <Marine_skillB_foot name="Marine_skillB_foot"> ..
            XmlNode dataNode = eftActXmlList[i];

            string eftName = dataNode.Attributes.GetNamedItem("name").Value;

            // get <act name="Trainer_skillA" totalFrame="26"> or <act name="j" totalFrame="31"> ..
            XmlNodeList actXMLList = dataNode.ChildNodes;
        //			Debug.Log("actXMLList.Count " + actXMLList.Count );
            int length = actXMLList.Count;
            actDatas = new ActData[length];
            for( int y=0; y< actXMLList.Count; y++)
            {
                XmlNode node = actXMLList[y];
                string actName = node.Attributes.GetNamedItem("name").Value;
                string total   = node.Attributes.GetNamedItem("totalFrame").Value;

                // Parser <act name="Trainer_skillA" totalFrame="26"> node's childnodes
                Hashtable dataHash = PieceAnimation.xmllistToHash(node.ChildNodes);
                ActData actD   = new ActData(actName, dataHash, int.Parse(total));

                actD.loopCycles = -1;
                actD.fps = 24;
                actDatas[y]= actD;
                // actName is <act name="Trainer_skillA" totalFrame="26"> node Attributes "name" is Trainer_skillA
                actList[actName] = actD;
            }
            /**
             * actDatas's length is 1 or n, the data format is <act name="Trainer_skillA" totalFrame="26"> node child <xuanzhuan21>, <xuanzhuan22>..
             * actList key is <act name="j" totalFrame="31"> node Attributes "name" is j ,data same as actDatas
             */
            actMgr.Add("actDatas",actDatas);
            actMgr.Add("actList",actList);
            // eftName is <act name="Trainer_skillA" totalFrame="26"> node Attributes "name" is Trainer_skillA
            actHash[eftName] = actMgr;
        }
    }
    public void Init(ActData data, ActSelectInterface actInterface, bool hideLeft = false, bool hideRight = false)
    {
        this.data         = data;
        this.actInterface = actInterface;

        title.text     = "Act " + data.ActNumber + "\n" + data.Name;
        display.sprite = data.LoadSprite();

        if (hideLeft)
        {
            LeftButton.SetActive(false);
        }
        if (hideRight)
        {
            RightButton.SetActive(false);
        }
    }
Exemple #10
0
    public void open(int act, int stage, int round, bool playAni = false, bool refreshOnly = false)
    {
        mustPlayCutScene = false;

        if (
            TutorialManager.isTutorialOpen("T44") ||
            TutorialManager.isTutorialOpen("T45") ||
            TutorialManager.isTutorialOpen("T46") ||
            TutorialManager.isTutorialOpen("T13") ||
            TutorialManager.isTutorialOpen("T15") ||
            TutorialManager.isTutorialOpen("T46") ||
            TutorialManager.isTutorialOpen("T51") ||
            TutorialManager.isTutorialOpen("T24"))
        {
            return;
        }

        if (refreshOnly == false)
        {
            if (playAni)
            {
                SoundData.play(openSound);
                popupPanel.transform.localPosition = new Vector3(0, 1000, 0);
            }
            else
            {
                popupPanel.transform.localPosition = new Vector3(0, 0, 0);
            }
        }

        contentContainer.transform.localPosition = Vector3.zero;
        contentPanel.clipOffset = new Vector2(0, 0);

        iconTooltip.hide();

        clearSlots();

        int i;
        int len;

        _selectedAct   = act;
        _selectedStage = stage;
        _selectedRound = round;

        ActData   ad = GameManager.info.actData[act];
        StageData sd = GameManager.info.stageData[ad.stages[stage - 1]];

        RoundData rd;

#if UNITY_EDITOR
        if (DebugManager.instance.useDebug)
        {
            rd = GameManager.info.roundData[DebugManager.instance.debugRoundId];
        }
        else
#endif
        {
            rd = GameManager.info.roundData[sd.rounds[round - 1]];
        }

        GameManager.me.stageManager.setNowRound(rd, GameType.Mode.Epic, act, stage, round);



        string str = "";

        lbEnergy.text     = GameDataManager.instance.energy.ToString();
        lbEnergyTime.text = string.Empty;


        Util.stringBuilder.Length = 0;

        lbRoundInfo.text = "";        //rd.description;
        lbRoundInfo.gameObject.SetActive(true);

        setRoundInfoText(rd);

        switch (rd.mode)
        {
        case RoundData.MODE.KILLEMALL:

            if (rd.settingTime > -1)
            {
                Util.stringBuilder.Append("등장하는 모든 적 처치");
            }
            else
            {
                Util.stringBuilder.Append("등장하는 모든 적 처치 ");
            }
            if (rd.settingTime > -1)
            {
                Util.stringBuilder.Append("(제한시간 " + rd.settingTime + "초)");
            }

            break;

        case RoundData.MODE.SURVIVAL:
            Util.stringBuilder.Append(rd.settingTime + "초 동안 살아남기");
            break;

        case RoundData.MODE.PROTECT:

            Util.stringBuilder.Append(rd.settingTime + "초 동안 ");

            i = 0;
            foreach (StageMonsterData data in rd.protectObject)
            {
                if (i > 0)
                {
                    Util.stringBuilder.Append(",");
                }
                Util.stringBuilder.Append(GameManager.info.npcData[data.id].name);
                ++i;
            }

            Util.stringBuilder.Append(" 보호");


            //GameManager.info.npcData[rd.protectObject[
            break;

        case RoundData.MODE.SNIPING:
            string hId = rd.heroMonsters[rd.targetIndex].id;
            Util.stringBuilder.Append("결투!  Vs " + GameManager.info.heroMonsterData[hId].name);
            break;

        case RoundData.MODE.KILLCOUNT:

            len = rd.killMonsterIds.Length;
            for (i = 0; i < len; ++i)
            {
                if (i > 0)
                {
                    Util.stringBuilder.Append(",");
                }
                Util.stringBuilder.Append(GameManager.info.unitData[rd.killMonsterIds[i]].name + " " + rd.killMonsterNum[i] + "마리");
            }

            Util.stringBuilder.Append(" 처치");
            break;

        case RoundData.MODE.KILLCOUNT2:
            Util.stringBuilder.Append("몬스터 " + rd.killMonsterNum[0] + "마리 처치");
            break;

        case RoundData.MODE.ARRIVE:

            Util.stringBuilder.Append(Mathf.CeilToInt((float)rd.targetPos * 0.01f) + "m 앞으로 이동하기");

            if (rd.chaser != null)
            {
                Util.stringBuilder.Append(" (추격몬스터 : " + GameManager.info.npcData[rd.chaser.id].name + ")");
            }

            if (rd.settingTime > -1)
            {
                Util.stringBuilder.Append(" (제한시간 " + rd.settingTime + "초)");
            }


            break;

        case RoundData.MODE.DESTROY:

            //roundInfo = "[목표오브젝트] [0]개 파괴 (추격몬스터 : [추격몬스터이름]) (제한시간 000초)";

            Dictionary <string, int> objNum = new Dictionary <string, int>();

            foreach (StageMonsterData data in rd.destroyObject)
            {
                if (objNum.ContainsKey(data.id) == false)
                {
                    objNum[data.id] = 1;
                }
                else
                {
                    ++objNum[data.id];
                }
            }

            len = 0;


            List <StageDetailInfoObjectName> dt = new List <StageDetailInfoObjectName>();

            foreach (KeyValuePair <string, int> kv in objNum)
            {
                if (dt.Count == 0)
                {
                    dt.Add(new StageDetailInfoObjectName());
                    dt[0].name = GameManager.info.npcData[kv.Key].name;
                    dt[0].num  = kv.Value;
                }
                else
                {
                    bool hasKey = false;
                    foreach (StageDetailInfoObjectName tempDt in dt)
                    {
                        if (hasKey == false)
                        {
                            if (tempDt.name == GameManager.info.npcData[kv.Key].name)
                            {
                                tempDt.num += kv.Value;
                                hasKey      = true;
                            }
                        }
                    }

                    if (hasKey == false)
                    {
                        dt.Add(new StageDetailInfoObjectName());
                        dt[dt.Count - 1].name = GameManager.info.npcData[kv.Key].name;
                        dt[dt.Count - 1].num  = kv.Value;
                    }
                }
            }

            foreach (StageDetailInfoObjectName kv in dt)
            {
                if (len > 0)
                {
                    Util.stringBuilder.Append(",");
                }
                Util.stringBuilder.Append(kv.name + " " + kv.num + "개 ");
                ++len;
            }

            dt.Clear();

            Util.stringBuilder.Append("파괴 ");

            if (rd.chaser != null)
            {
                Util.stringBuilder.Append(" (추격몬스터 : " + GameManager.info.npcData[rd.chaser.id].name + ")");
            }

            if (rd.settingTime > -1)
            {
                Util.stringBuilder.Append("(제한시간 " + rd.settingTime + "초)");
            }
            break;

        case RoundData.MODE.GETITEM:

            len = 0;
            foreach (KeyValuePair <string, Xint> kv in rd.getItemData.needCount)
            {
                if (len > 0)
                {
                    Util.stringBuilder.Append(",");
                }
                Util.stringBuilder.Append(GameManager.info.mapObjectData[kv.Key].name + " " + kv.Value + "개");
                ++len;
            }

            Util.stringBuilder.Append(" 획득하기 ");

            if (rd.settingTime > -1)
            {
                Util.stringBuilder.Append("(제한시간 " + rd.settingTime + "초)");
            }

            break;
        }

        lbRoundInfo.text = Util.stringBuilder.ToString();

        lbDescription.text = rd.description;

        lbStageTitle.text = "[ ACT" + act + " ] " + sd.title;

        updatePriceForStartRound();

        sbRoundType.spriteName = getRoundTypeIcon(rd);

        setRoundInfoText(rd);


        GameManager.me.uiManager.uiPlay.lbEpicRoundInfo.text       = lbRoundInfo.text;
        GameManager.me.uiManager.uiPlay.spEpicRoundIcon.spriteName = sbRoundType.spriteName;
        GameManager.me.uiManager.uiPlay.spEpicRoundText.spriteName = "img_text_round" + (round);

        int clearIndex = 0;

        if (act < GameDataManager.instance.maxAct)
        {
            clearIndex = 5;
        }
        else if (stage < GameDataManager.instance.maxStage)
        {
            clearIndex = 5;
        }
        else
        {
            clearIndex = GameDataManager.instance.maxRound - 1;
        }


        for (i = 0; i < 5; ++i)
        {
            if (stage <= 2)
            {
                roundPanel[i].gameObject.SetActive((i < 3));
            }
            else if (stage <= 4)
            {
                roundPanel[i].gameObject.SetActive((i < 4));
            }
            else
            {
                roundPanel[i].gameObject.SetActive(true);
            }

            if (i <= clearIndex)
            {
                if (i + 1 == round)
                {
                    bool isClear = clearIndex == 5;
                    if (GameDataManager.instance.maxAct == act && GameDataManager.instance.maxStage == stage && GameDataManager.instance.maxRound > i + 1)
                    {
                        isClear = true;
                    }

                    roundPanel[i].setData(UIWorldMapRoundPanel.RoundStatus.SELECT, i + 1, isClear);
                }
                else if (i + 1 > clearIndex)
                {
                    roundPanel[i].setData(UIWorldMapRoundPanel.RoundStatus.SELECT2, i + 1, clearIndex == 5);
                }
                else
                {
                    roundPanel[i].setData(UIWorldMapRoundPanel.RoundStatus.CLEAR, i + 1);
                }
            }
            else
            {
                roundPanel[i].setData(UIWorldMapRoundPanel.RoundStatus.LOCK, i + 1);
            }
        }



        ///액트2 이상인 경우 재도전 선택 완료 후 라운드정보창 팝업상태
//		if(canCheckTutorial48_50 && TutorialManager.instance.check("T48") )
//		{
//
//		}
        ///액트2 이상인 경우 재도전 선택 완료 후 라운드정보창 팝업상태
//		else if(canCheckTutorial48_50 && TutorialManager.instance.check("T49") )
//		{
//
//		}
        ///액트2 이상인 경우 재도전 선택 완료 후 라운드정보창 팝업상태
//		else if(canCheckTutorial48_50 && TutorialManager.instance.check("T50") )
//		{
//
//		}
//		else
        if (TutorialManager.instance.check("T44"))
        {
        }



        spMonsterInfoWord.gameObject.SetActive(false);

        gameObject.SetActive(true);


        // 이미 깬 스테이지거나 한번 본 녀석이면...
        if (GameDataManager.instance.roundClearStatusCheck(act, stage, round) || PlayerPrefs.GetInt("CS" + act + stage + round, WSDefine.NO) == WSDefine.YES)
        {
            btnCutSceneOnOff.isEnabled = true;
            spCutSceneOnOff.enabled    = GameDataManager.instance.canCutScenePlay;
            _canUseCutSceneSkip        = true;
        }
        else
        {
            btnCutSceneOnOff.isEnabled = false;
            spCutSceneOnOff.enabled    = true;
            mustPlayCutScene           = true;
            _canUseCutSceneSkip        = false;
        }

        //_rewardSlots

        goRewardContainer.gameObject.SetActive(true);

        _v = goRewardContainer.transform.position;

        _v.y = lbDescription.transform.position.y - (lbDescription.printedSize.y + 50);

        goRewardContainer.transform.position = _v;


        drawRewardList(rd);

        if (_rewardSlots.Count <= 0)
        {
            goRewardContainer.gameObject.SetActive(false);
        }

        _v = goMonsterContainer.transform.position;

        _v.y = goRewardContainer.transform.position.y;

        if (_rewardSlots.Count > 0)
        {
            _v.y = _rewardSlots[_rewardSlots.Count - 1].transform.position.y - 100.0f;
        }
        else
        {
            _v.y = lbDescription.transform.position.y - (lbDescription.printedSize.y + 50);
        }

        if (_rewardSlots.Count > 0)
        {
            spRewardBg.height = Mathf.RoundToInt(Mathf.FloorToInt((_rewardSlots.Count - 1) / 5) * 131 + 194);
        }

        goMonsterContainer.transform.position = _v;

        drawMonsterSlot(rd);

        if (_monsterSlots.Count > 0)
        {
            spMonsterBg.height = Mathf.RoundToInt(Mathf.FloorToInt((_monsterSlots.Count - 1) / 5) * 149 + 219);
        }


        StartCoroutine(repositionContent(playAni));

        ++_playIndex;

        StartCoroutine(playRoundInfoTextAnimation(lbRoundInfo.text, _playIndex));

        canCheckTutorial48_50 = false;
    }
Exemple #11
0
    //cache hero animation data
    public static void initHeroActData( string heroType ,   string xmlStr  )
    {
        Hashtable actMgr = new Hashtable();
        ActData[] actDatas;
        Hashtable actList  = new Hashtable();

        XmlDocument loadXML = new XmlDocument();
        loadXML.LoadXml(xmlStr);

        XmlNodeList actXMLList = loadXML.DocumentElement.GetElementsByTagName("act");
        int length = actXMLList.Count;
        actDatas = new ActData[length];

        for( int y=0; y< actXMLList.Count; y++)
        {
            XmlNode node = actXMLList[y];
            string actName = node.Attributes.GetNamedItem("name").Value;
            string total   = node.Attributes.GetNamedItem("totalFrame").Value;

            Hashtable dataHash = PieceAnimation.xmllistToHash(node.ChildNodes);
            ActData actD   = new ActData(actName, dataHash, int.Parse(total));

            actD.loopCycles = -1;
            actD.fps = 24;
            actDatas[y]= actD;
            actList[actName] = actD;
        }
        actMgr.Add("actDatas",actDatas);
        actMgr.Add("actList",actList);
        heroesActHash[heroType] = actMgr;
    }
Exemple #12
0
 internal GameData(GameFlags gameFlags)
 {
     Flags = gameFlags;
     Act   = new ActData();
 }
Exemple #13
0
    protected virtual void buildActList()
    {
        actList = new Hashtable ();
        XmlDocument loadXML = new XmlDocument ();
        loadXML.LoadXml (actFile.text);

        XmlNodeList actXMLList = loadXML.DocumentElement.GetElementsByTagName ("act");
        for (int i=0; i<actXMLList.Count; i++) {
            XmlNode node = actXMLList [i];
            string actName = node.Attributes.GetNamedItem ("name").Value;
            switch(actName){
            case "idle":
                node.Attributes.GetNamedItem("name").Value = "Stand";
                break;
            case "run":
                node.Attributes.GetNamedItem("name").Value = "Move";
                break;
            case "injured":
                node.Attributes.GetNamedItem("name").Value = "Damage";
                break;
            case "die":
                node.Attributes.GetNamedItem("name").Value = "Death";
                break;
            case "punch":
                node.Attributes.GetNamedItem("name").Value = "Attack";
                break;
            case "shoot":
                node.Attributes.GetNamedItem("name").Value = "Attack";
                break;
            }
        }

        int length = actXMLList.Count;
        actDatas = new ActData[length];
        for (int i=0; i<actXMLList.Count; i++) {
            XmlNode node = actXMLList [i];
            string actName = node.Attributes.GetNamedItem ("name").Value;
            string total = node.Attributes.GetNamedItem ("totalFrame").Value;

            Hashtable allPartFrames = xmllistToHash (node.ChildNodes);
            ActData actD = new ActData (actName, allPartFrames, int.Parse (total));
            actD.loopCycles = -1;
            actD.fps = 24;
            actDatas [i] = actD;
            actList [actName] = actD;
        }
        //Debug.LogError(Utils.dumpHashTable(actList));
        //Debug.Break();
        ActData defaultActD = actDatas [0];
        currentAnima = defaultActD.name;
    }