protected internal static BattleFighter createHeroFighterFromBattleProp(HeroTeam heroTeam, FighterInfo fighterProps)
		{
			BattleFighter _fighter = createBattleFighterFromBattleProp(heroTeam, fighterProps);
			setHeroSkillManager(_fighter, heroTeam);
			FighterBuffManager = _fighter;
			return _fighter;
		}
		public BattleHeroSkillManager(BattleFighter fighter, HeroTeam ownerTeam) : base(fighter)
		{
			// TODO: 这里之后是单例的Action
			this.ownerTeam = ownerTeam;
			init();
			// TODO: 以后重构
		}
		public static HeroTeam createHeroTeam(Battle battle, List<FighterInfo> fighterProps, BattleSideEnum side)
		{
			HeroTeam _team = new HeroTeam(battle, side);
			foreach (FighterInfo _fighterProp in fighterProps)
			{
				BattleFighter _fighter = createHeroFighterFromBattleProp(_team, _fighterProp);
				_team.addActor(_fighter);
			}
			return _team;
		}
Example #4
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);
    }
Example #5
0
        public void SetUp()
        {
            m_heroTeam = new HeroTeamLogic();
            HeroTeam ht = new HeroTeam();

            ht.PlayerId = 1;
            ht.Team     = new CacheList <int> {
                0, 0, 0
            };
            m_heroTeam.MyHeroTeam = ht;
        }
Example #6
0
		public virtual void handleSceneFinish(int sceneIndex, HeroTeam heroTeam)
		{
			this.sceneIndex = sceneIndex;
			this.curHp = heroTeam.CurHp;
			this.curMp = heroTeam.CurMp;
			foreach (BattleFighter _fighter in heroTeam.ActorList)
			{
				if (_fighter.hasState(BattleConstants.SP_MAX_FALG))
				{
					spIndexList.Add(_fighter.Index);
				}
			}
			saveToData();
		}
Example #7
0
    private void Awake()
    {
        if (i == null)
        {
            i = this;
            DontDestroyOnLoad(gameObject);

            heroTeam = new List <CharacterStats>();

            redHeroStats   = Resources.Load("CharacterStats/Heroes/RedHero") as CharacterStats;
            greenHeroStats = Resources.Load("CharacterStats/Heroes/GreenHero") as CharacterStats;
            blueHeroStats  = Resources.Load("CharacterStats/Heroes/BlueHero") as CharacterStats;
            blackHeroStats = Resources.Load("CharacterStats/Heroes/BlackHero") as CharacterStats;
        }
    }
Example #8
0
    // Token: 0x06001BBC RID: 7100 RVA: 0x003145BC File Offset: 0x003127BC
    public void ShowHero(UIButtonHint hint, ushort HeroID, ushort TeamIndex, ushort ArrayIndex)
    {
        if (hint == null)
        {
            return;
        }
        RectTransform rectTransform = hint.transform as RectTransform;
        DataManager   instance      = DataManager.Instance;
        GUIManager    instance2     = GUIManager.Instance;

        this.m_RectTransform.gameObject.SetActive(true);
        this.m_RectTransform.SetAsLastSibling();
        if (this.m_ItemBtn.gameObject.activeSelf)
        {
            this.ItemGo.SetActive(false);
            this.ItemPanel.gameObject.SetActive(false);
            this.HeroPanel.gameObject.SetActive(true);
        }
        HeroTeam recordByKey  = instance.TeamTable.GetRecordByKey(TeamIndex);
        Hero     recordByKey2 = instance.HeroTable.GetRecordByKey(recordByKey.Arrays[(int)ArrayIndex].Hero);

        if (recordByKey2.HeroTitle > 0)
        {
            this.m_Name.text = instance.mStringTable.GetStringByID((uint)recordByKey2.HeroTitle);
        }
        if (recordByKey.Arrays[(int)ArrayIndex].Type == 3)
        {
            this.BossIcon.gameObject.SetActive(true);
            instance2.ChangeHeroItemImg(this.m_HeroBtn.transform, eHeroOrItem.Hero, recordByKey2.HeroKey, recordByKey.HeroStar, 0, 0);
        }
        else
        {
            this.BossIcon.gameObject.SetActive(false);
            GUIManager.Instance.ChangeHeroItemImg(this.m_HeroBtn.transform, eHeroOrItem.Hero, recordByKey2.HeroKey, 1, 0, 0);
        }
        if (instance.UserLanguage == GameLanguage.GL_Chs)
        {
            this.CNBossIconObj.SetActive(this.BossIcon.gameObject.activeSelf);
            this.BossIcon.gameObject.SetActive(false);
        }
        instance2.tmpString.Remove(0, instance2.tmpString.Length);
        this.m_HeroLV.text     = instance2.tmpString.AppendFormat(instance.mStringTable.GetStringByID(52u), recordByKey.HeroLevel).ToString();
        this.m_HeroName.text   = instance.mStringTable.GetStringByID((uint)recordByKey2.HeroName);
        this.m_Properties.text = instance.mStringTable.GetStringByID((uint)recordByKey2.Summary);
        Vector2 sizeDelta = this.m_Properties.rectTransform.sizeDelta;

        sizeDelta.y = Mathf.Max(66f, this.m_Properties.preferredHeight);
        this.m_Properties.rectTransform.sizeDelta = sizeDelta;
        sizeDelta   = this.m_BackRect.sizeDelta;
        sizeDelta.y = Mathf.Max(180f, 117.6f + this.m_Properties.preferredHeight + 14.4f);
        this.m_BackRect.sizeDelta = sizeDelta;
        hint.GetTipPosition(this.m_BackRect, UIButtonHint.ePosition.Original, null);
        float num = -this.m_BackRect.anchoredPosition3D.y + this.m_BackRect.sizeDelta.y;

        if (num > GUIManager.Instance.m_MessageBoxLayer.rect.size.y)
        {
            this.m_Properties.fontSize = 18 - Convert.ToInt32((num - GUIManager.Instance.m_MessageBoxLayer.rect.size.y) * 0.038f);
            sizeDelta   = this.m_Properties.rectTransform.sizeDelta;
            sizeDelta.y = Mathf.Max(66f, this.m_Properties.preferredHeight);
            this.m_Properties.rectTransform.sizeDelta = sizeDelta;
            sizeDelta   = this.m_BackRect.sizeDelta;
            sizeDelta.y = Mathf.Max(180f, 117.6f + this.m_Properties.preferredHeight + 14.4f);
            this.m_BackRect.sizeDelta = sizeDelta;
        }
        this.m_ButtonHint      = hint;
        this.Canvasgroup.alpha = 1f;
    }
Example #9
0
    void Awake()
    {
        if (instance == null)
        {
            instance = this;
            DontDestroyOnLoad(gameObject);

            // Read config file to set audio volumes settings
            configFile.Read("config.txt");
            if (configFile.GetData().Length == 0) // setting default values when file is created
            {
                configFile["master-volume"].SetFloat(1.0f);
                configFile["music-volume"].SetFloat(1.0f);
                configFile["sfx-volume"].SetFloat(1.0f);
                configFile["ui-volume"].SetFloat(1.0f);
            }
            else
            {
                ApplySettings();
            }

            AssetBundleManager.LoadAllBundlesFrom("terrains/palettes");
            AssetBundleManager.LoadAllBundlesFrom("terrains/zones");
            AssetBundleManager.LoadAllBundlesFrom("stats");
            AssetBundleManager.LoadAllBundlesFrom("weapons");
            AssetBundleManager.LoadAllBundlesFrom("mounts");

            heroes.LoadHeroes();

            foreach (HeroInfo data in heroes.heroes)
            {
                Debug.Log("Hero bundle name: " + data.bundleName);
            }

            heroToSpawn.Clear();

            HeroTeam hero1 = new HeroTeam()
            {
                team = 1, info = new HeroInfo()
            };
            hero1.info = heroes.heroes[0];
            heroToSpawn.Add(hero1);

            HeroTeam hero2 = new HeroTeam()
            {
                team = 0, info = new HeroInfo()
            };
            hero2.info = heroes.heroes[1];
            heroToSpawn.Add(hero2);

            HeroTeam hero3 = new HeroTeam()
            {
                team = 1, info = new HeroInfo()
            };
            hero3.info = heroes.heroes[0];
            heroToSpawn.Add(hero3);

            HeroTeam hero4 = new HeroTeam()
            {
                team = 0, info = new HeroInfo()
            };
            hero4.info = heroes.heroes[1];
            heroToSpawn.Add(hero4);
        }
        else
        {
            Destroy(gameObject);
        }
    }
Example #10
0
		public static void recordAllIndex(HeroTeam heroTeam, BattleIndexRecord record)
		{
			record.TargetSide = heroTeam.battlingActorSize();
			foreach (HeroPoint _point in heroTeam.BattlingHeroArr)
			{
				addSinglePointToCheckList(record, _point);
			}
			foreach (HeroPoint _point in heroTeam.WaitingHeroList)
			{
				addSinglePointToCheckList(record, _point);
			}
		}
Example #11
0
		public static void recordFillIndex(HeroTeam heroTeam, BattleIndexRecord record)
		{
			foreach (HeroPoint _point in heroTeam.WaitingHeroList)
			{
				addSinglePointToFillList(record, _point);
			}
		}
Example #12
0
		protected internal static void setHeroSkillManager(BattleFighter fighter, HeroTeam heroTeam)
		{
			BattleHeroSkillManager _skillaManager = new BattleHeroSkillManager(fighter, heroTeam);
			fighter.SkillManager = _skillaManager;
		}