public static int AddTpAfterSkill(SDConstants.AddMpTpType addType , BattleRoleData source) { if (source._Tag != SDConstants.CharacterType.Hero) { return(0); } GDEHeroData hero = SDDataManager.Instance.getHeroByHashcode(source.unitHashcode); HeroInfo info = SDDataManager.Instance.getHeroInfoById(source.UnitId); int baseTp = info.RAL.Tp + hero.RoleAttritubeList.AD_List[(int)AttributeData.Tp]; int currentTp = source.ThisBasicRoleProperty().RoleBasicRA.Tp; // float upRate0 = currentTp * 1f / baseTp; float upRate1 = 1; if (addType == SDConstants.AddMpTpType.PreferMp || addType == SDConstants.AddMpTpType.PreferBoth) { upRate1 = 1.5f; } else if (addType == SDConstants.AddMpTpType.LowMp || addType == SDConstants.AddMpTpType.LowBoth) { upRate1 = 0.5f; } else if (addType == SDConstants.AddMpTpType.YearnMp || addType == SDConstants.AddMpTpType.YearnBoth) { upRate1 = 2f; } return((int)(SDConstants.SkillAddMinMp * upRate0 * upRate1)); }
//保存战斗前阵型英雄信息(主要是英雄经验 结算用) public void SaveLastTeamData() { List <FightHeroInfo> pveHeroProtoDataList = FightProxy.instance.fightHeroInfoList; _fightBeforeTeamHeroDictionary.Clear(); HeroInfo heroInfo; for (int i = 0, count = pveHeroProtoDataList.Count; i < count; i++) { heroInfo = pveHeroProtoDataList[i].heroInfo; HeroInfo info = new HeroInfo(heroInfo.instanceID, heroInfo.heroData.id, heroInfo.breakthroughLevel, heroInfo.strengthenLevel, heroInfo.advanceLevel, heroInfo.level); info.exp = heroInfo.exp; info.strengthenExp = heroInfo.strengthenExp; _fightBeforeTeamHeroDictionary.Add((int)info.instanceID, info); } _fightBeforeTeamPlayer = null; if (FightProxy.instance.fightPlayerInfo != null) { PlayerInfo player = FightProxy.instance.fightPlayerInfo.playerInfo; _fightBeforeTeamPlayer = new PlayerInfo(player.instanceID, player.playerData.Id, player.hairCutIndex, player.hairColorIndex, player.faceIndex, player.skinIndex, GameProxy.instance.AccountName); _fightBeforeTeamPlayer.exp = player.exp; _fightBeforeTeamPlayer.level = player.level; _fightBeforeTeamPlayer.weaponID = player.weaponID; _fightBeforeTeamPlayer.accessoryID = player.accessoryID; _fightBeforeTeamPlayer.armorID = player.armorID; } // _fightBeforeTeamPlayer = new PlayerInfo(player.instanceID, player.playerData.Id, player.hairCutIndex, player.hairColorIndex, player.faceIndex, player.name); }
public Dictionary <string, HeroInfo> GetHeroes() { Dictionary <string, HeroInfo> @return = new Dictionary <string, HeroInfo>(); foreach (ulong key in TrackedFiles[0x75]) { STUHero hero = GetInstance <STUHero>(key); if (hero == null) { continue; } string name = GetString(hero.Name) ?? $"Unknown{GUID.Index(key):X}"; string description = GetDescriptionString(hero.Description); string color = null; if (hero.GalleryColor != null) { color = hero.GalleryColor.Hex(); } @return[name] = new HeroInfo(key, name, description, color, GetAbilities(hero)); } return(@return); }
/// <summary> /// Deep copy from another hero info. /// </summary> /// <param name="other">Other.</param> public void DeepCopy(HeroInfo other, Dictionary <Hero, Hero> heroMap) { m_health = other.m_health; m_moveRange = other.m_moveRange; m_attackRange = other.m_attackRange; m_attack = other.m_attack; m_agile = other.m_agile; m_direction = other.m_direction; m_attackType = other.m_attackType; m_teamColor = other.m_teamColor; if (other.history != null) { foreach (HistoryStep step in other.history) { history.Add(new HistoryStep(step, heroMap)); } } if (other.buffList != null) { foreach (Buff buff in other.buffList) { buffList.Add(BuffFactory.CreateBuffFrom(buff, heroMap)); } } }
private void Ready2theGame() { Debug.Log("Ready2theGame"); #region 씬 전환 //버튼 3개 this.btn_Continew.onClick.AddListener(() => { Debug.Log("이어 하기"); var stageLevel = this.heroInfo.stageLevel; //인게임 불러오기 this.InGameInit(this.heroInfo); }); this.btn_NewGame.onClick.AddListener(() => { Debug.Log("새 게임"); //인게임 불러오기 InfoManager.Instance.CreateInfo(); this.heroInfo = InfoManager.Instance.heroInfo; var stageLevel = this.heroInfo.stageLevel; this.InGameInit(this.heroInfo); }); #endregion this.btn_Option.onClick.AddListener(() => { Debug.Log("옵션"); //옵션 팝업 }); }
//http://www.redblobgames.com/grids/hexagons/#range public static bool canHeroMoveToTile(HeroInfo heroInfo, TileInfo tileInfo) { if (heroInfo == null || tileInfo == null) { //Debug.Log ("something was null"); return false; } if (tileInfo.UnitOnTile != null) { //Debug.Log ("something was on the tile"); return false; } TileInfo heroTile = heroInfo.tile; int dX = tileInfo.x - heroTile.x; int dY = tileInfo.y - heroTile.y; int dZ = tileInfo.z - heroTile.z; float d = Mathf.Abs (dX) + Mathf.Abs (dY) + Mathf.Abs (dZ); d = d / 2; if (d <= heroInfo.move) { return true; } return false; }
private PartyInfo MakePartyInfo(WBattlePartyData partyData) { HeroInfo heroInf01 = null; List <CharInfo> charInfoes01 = new List <CharInfo>(); for (int i = 0; i < partyData.troop.Length; i++) { if (i == 0) //Index of 0 is hero { heroInf01 = MakeCharatcerInfo(partyData.troop[i], true) as HeroInfo; } else { charInfoes01.Add(MakeCharatcerInfo(partyData.troop[i], false)); } } //Secrets //Now it's only for working List <Divine.Secret> secrets = new List <Divine.Secret>(2) { Divine.Secret.Mirror, Divine.Secret.Ransom }; return(new PartyInfo(heroInf01, charInfoes01.ToArray(), secrets, 0, partyData.name)); }
public bool OnSortCondion(CSItem item) { HeroInfo heroInfo = GameTable.HeroInfoTableAsset.Lookup(item.IDInTable); if (null == heroInfo) { Debug.LogWarning("null == heroInfo item.IDInTable:" + item.IDInTable); return(true); } // 收藏或者在编队中或者是代表卡 则不显示出来 if (item.Love || Team.Singleton.IsCardInTeam(item.Guid) || User.Singleton.RepresentativeCard == item.Guid) { return(true); } int occ = OperateCardList.Singleton.m_cardDivisionOcc; int level = OperateCardList.Singleton.m_cardDivisionLevel; int star = OperateCardList.Singleton.m_cardDivisionStar; if (heroInfo.Occupation == occ && item.Level == level && star == heroInfo.Rarity) { return(false); } return(true); }
//设置3D头像 void SetCard3DHead(CSItem card) { int childCount = m_beforModel.transform.childCount; for (int i = 0; i < childCount; i++) { Transform child = m_beforModel.transform.GetChild(i); GameObject.Destroy(child.gameObject); } AddModel(card, m_beforModel); int childCount1 = m_afterModel.transform.childCount; for (int i = 0; i < childCount1; i++) { Transform child = m_afterModel.transform.GetChild(i); GameObject.Destroy(child.gameObject); } HeroInfo info = GameTable.HeroInfoTableAsset.Lookup(card.IDInTable); if (null == info) { Debug.Log("UICardEvolution HeroInfo == null card.m_id:" + card.IDInTable); return; } CSItem tempCard = new CSItem(); tempCard.m_id = (short)info.EvolveChangeID; AddModel(tempCard, m_afterModel); }
public List <RoleInfo> GetIllustrationRoleList() { List <RoleInfo> roleList = new List <RoleInfo>(); foreach (var data in IllustrationDictionary) { int[] info = data.Key.ToArray <int>(','); if (info.Length == 2) { HeroData heroData = HeroData.GetHeroDataByID(info[1]); if (heroData == null) { continue; } RoleInfo roleInfo = null; if (heroData.hero_type == 2)//主角 { roleInfo = new PlayerInfo((uint)0, (uint)heroData.id, (uint)0, (uint)0, (uint)0, 0, ""); } else { roleInfo = new HeroInfo(0, heroData.id, 1, 0, 1, 1); } roleList.Add(roleInfo); } } return(roleList); }
protected Hero(HeroInfo heroInfo) { maxHp = heroInfo.Hp; currentHp = maxHp; if (HpChangedEvent != null) { HpChangedEvent(this, currentHp, maxHp); } maxAmmo = heroInfo.Ammo; currentAmmo = maxAmmo; if (AmmoChangedEvent != null) { AmmoChangedEvent(this, currentAmmo, maxAmmo); } bullets = new BulletInfo[maxAmmo]; bulletSprite = heroInfo.BulletSprite; bulletSpeed = heroInfo.BulletSpeed; animator = heroInfo.Animator; hand = new HandController(heroInfo); bodyParts = HitBox.GetHitBox(heroInfo.HitBox); }
public void SetHeroInfo(HeroInfo info, bool fullRefresh = true) { if (info == null) { return; } _currentInfo = info; // 英雄魂石碎片 int currentCount = UserManager.Instance.GetHeroPieceCount(_currentInfo.Cfg.Cost); int needCount = UserManager.Instance.GetHeroStarUpgradeCost(_currentInfo.ConfigID, _currentInfo.StarLevel); _imageStonePrg.fillAmount = 1.0f * currentCount / needCount; _txtStoneNumber.text = string.Format("{0}/{1}", currentCount, needCount); _txtHeroStoneNumber.text = string.Format("{0}/{1}", currentCount, needCount); _imageHeroIcon.sprite = ResourceManager.Instance.GetHeroIcon(_currentInfo.ConfigID); _starPanel.SetStar(_currentInfo.StarLevel); _btnUpgradeStar.interactable = UserManager.Instance.CheckHeroUpgradeStarItem(_currentInfo); if (currentCount >= needCount) { _imgStarAdd.gameObject.SetActive(false); } else { _imgStarAdd.gameObject.SetActive(true); } }
public void RefreshWakeUpPanel() { HeroInfo info = SDDataManager.Instance.getHeroInfoById(HeroDetail.ID); HeroRace hrace = info.Race; RaceIcon.sprite = hrace.Icon; RaceIcon.SetNativeSize(); RaceText.text = SDGameManager.T(hrace.NAME); // RoleCareer rcareer = info.Career; CareerIcon.sprite = rcareer.Icon; CareerIcon.SetNativeSize(); CareerText.text = SDGameManager.T(rcareer.NAME); // RarityImg.sprite = SDDataManager.Instance.raritySprite(info.Rarity); RarityImg.SetNativeSize(); if (info.PersonalDrawImg == null) { PoseImg.gameObject.SetActive(false); PoseBgImg.sprite = SDDataManager.Instance.heroRaceBgIcon(hrace.Race); } else { PoseImg.gameObject.SetActive(true); } }
// 更新战友模型相关信息 void UpdateHelperModel() { Helper helper = User.Singleton.HelperList.LookupHelper(StageMenu.Singleton.m_curHelperGuid); if (null != helper) { AddHelperModel(helper.m_cardId); HeroInfo heroInfo = GameTable.HeroInfoTableAsset.Lookup(helper.m_cardId); if (null != heroInfo) { m_helperCardName.text = heroInfo.StrName; m_helperCardLevel.text = Localization.Get("CardLevel") + helper.m_cardLevel; RaceInfo raceInfo = GameTable.RaceInfoTableAsset.LookUp(heroInfo.Type); m_helperCardRace.text = raceInfo.m_name; OccupationInfo occInfo = GameTable.OccupationInfoAsset.LookUp(heroInfo.Occupation); m_helperCardOcc.text = occInfo.m_name; AttrRatioInfo rarityInfo = GameTable.attrRatioTableAsset.LookUp(heroInfo.Occupation, heroInfo.Rarity); // 计算生命值 int hp = (int)((heroInfo.FHPMax + rarityInfo.m_hPMaxAdd * (helper.m_cardLevel - 1)) * rarityInfo.m_hpMutiply); m_helperHP.text = hp.ToString(); // 计算物理攻击力 int attack = BattleFormula.GetPhyAttack(helper.m_cardId, 1); m_helperPhyAttack.text = attack.ToString(); // 魔法攻击力 attack = BattleFormula.GetMagAttack(helper.m_cardId, 1); m_helperMagAttack.text = attack.ToString(); } } }
private void OnClickItem(int heroConfigID) { HeroInfo info = UserManager.Instance.GetHeroInfoByUnitID(heroConfigID); if (info == null) { return; } if (info.IsOnPVE()) { UserManager.Instance.PVEHeroList.Remove(info); } else { UserManager.Instance.PVEHeroList.Add(info); } // 只刷新点击的英雄 foreach (Transform item in _listView._listContainer) { PVESelectHeroWidget widget = item.GetComponent <PVESelectHeroWidget>(); if (widget != null && widget.IsWidget(heroConfigID)) { widget.SetInfo(info); } } // TODO 刷新英雄 }
private static RunStatus CharacterSwitch() { BotMain.StatusText = "[Funky] Hero Switch *Switching Heros*"; if (FunkyBaseExtension.Settings.General.AltHeroIndex < 0) { Logger.DBLog.InfoFormat("Hero Index Info not setup!"); BotMain.Stop(); return(RunStatus.Success); } if (HeroIndexInfo.Characters.Count == 0) { Logger.DBLog.InfoFormat("Hero Index Info not setup!"); BotMain.Stop(); return(RunStatus.Success); } if (MainHeroInfo == null) { ZetaDia.Memory.ClearCache(); MainHeroInfo = new HeroInfo(ZetaDia.Service.Hero); } _lastProfilePath = ProfileManager.CurrentProfile.Path; Logger.DBLog.InfoFormat("Switching to Hero Index {0}", FunkyBaseExtension.Settings.General.AltHeroIndex); ZetaDia.Service.GameAccount.SwitchHero(FunkyBaseExtension.Settings.General.AltHeroIndex); return(RunStatus.Running); }
public override void InitItem(HeroInfo heroInfo) { base.InitItem(heroInfo); lvLabel.text = heroInfo.Lvl.ToString(CultureInfo.InvariantCulture); attackLabel.text = heroInfo.Prop[RoleProperties.ROLE_ATK].ToString(CultureInfo.InvariantCulture); hpLabel.text = heroInfo.Prop[RoleProperties.ROLE_ATK].ToString(CultureInfo.InvariantCulture); }
// 刷选职业和种族 TRUE 排除 FALSE 不排除 public bool SortByOccRace(int cardId) { HeroInfo heroInfo = GameTable.HeroInfoTableAsset.Lookup(cardId); if (null == heroInfo) { Debug.LogWarning("null == heroInfo item.IDInTable:" + cardId); return(true); } // 职业刷选 if (m_cardSortUI.GetSelectedOcc().Count != 0) { // 如果不是是选中的职业 则不显示 if (!m_cardSortUI.GetSelectedOcc().Contains(heroInfo.Occupation)) { return(true); } } // 种族筛选 if (m_cardSortUI.GetSelectedRace().Count != 0) { // 如果不是是选中的职业 则不显示 if (!m_cardSortUI.GetSelectedRace().Contains(heroInfo.Type)) { return(true); } } return(false); }
// 更新单个格子 为队伍编辑 void UpdateTeamItem(CSItem card, Team.EDITTYPE type) { if (null != card && !SortByOccRace(card.IDInTable)) { // 格子不够增加格子 if (false == m_gridList.ContainsKey(m_tempIndex)) { ExpandOneGrid(); } UICardItem item = m_gridList[m_tempIndex]; HeroInfo heroInfo = GameTable.HeroInfoTableAsset.Lookup(card.IDInTable); if (null == heroInfo) { Debug.LogWarning("UpdateTeamItem null == heroInfo item.IDInTable:" + card.IDInTable); } else { OperateCardList.Singleton.m_leadShipCost = OperateCardList.Singleton.m_leadShipCost + heroInfo.Cost; item.UpdateOperateTeam(card, m_cardSortUI.GetLastSortType(), type, m_tempIndex); OperateCardList.Singleton.m_hadItemList.Add(card.Guid); } m_tempIndex++; } }
private void RegenerateInTeamHeroModels() { DespawnCharacter(); for (int i = 0; i < 9; i++) { FormationPosition formationPosition = (FormationPosition)(i + 1); uint roleID = ManageHeroesProxy.instance.GetCharacterInstanceIDAt(formationPosition); //uint cachedRoleID = 0; //_cachedFormationDic.TryGetValue(formationPosition, out cachedRoleID); //if (roleID != cachedRoleID) //{ TransformUtil.ClearChildren(roleModelRoots[i], true); if (!ManageHeroesProxy.instance.IsPositionEmpty(formationPosition)) { if (GameProxy.instance.IsPlayer(roleID)) { PlayerInfo playerInfo = GameProxy.instance.PlayerInfo; CharacterEntity characterEntity = CharacterEntity.CreatePlayerEntityAsUIElement(playerInfo, roleModelRoots[i], false, false); _characters.Add(characterEntity); } else { HeroInfo heroInfo = HeroProxy.instance.GetHeroInfo(roleID); HeroEntity heroEntity = CharacterEntity.CreateHeroEntityAsUIElement(heroInfo, roleModelRoots[i], false, false); _characters.Add(heroEntity); } } _cachedFormationDic.AddOrReplace(formationPosition, roleID); //} formationBaseImages[i].SetSprite(roleID > 0 || ManageHeroesProxy.instance.CurrentFormationTeamInfo.formationInfo.formationData.GetPosEnalbe(formationPosition) ? _formationOccupiedSprite : _formationNormalSprite); roleShadows[i].gameObject.SetActive(roleID > 0); } }
public void Init() { // 测试用, 先把技能全部 放进去 HeroInfo heroInfo = GameTable.HeroInfoTableAsset.Lookup(IDInTable); if (null != heroInfo) { if (GameSettings.Singleton.m_isSingle) { foreach (int skillId in heroInfo.AllSkillIDList) { HeroCardSkill info = new HeroCardSkill(); info.m_skillID = skillId; AddSkill(info); } foreach (var item in heroInfo.PassiveSkillIDList) {//被动技能 HeroCardSkill info = new HeroCardSkill(); info.m_skillID = item; AddSkill(info); } } SwitchSkillID = heroInfo.SwitchSkillID; } }
public void Call(HeroInfo param0) { func.BeginPCall(); func.PushObject(param0); func.PCall(); func.EndPCall(); }
// 是否有指定技能 public bool HaveSkill(int skillId) { if (!isCheckSkill) { return(true); } HeroInfo heroInfo = GameTable.HeroInfoTableAsset.Lookup(IDInTable); if (null == heroInfo) { return(false); } int needLevel = heroInfo.GetSkillNeedLevel(skillId); // 等级不够 if (Level < needLevel) { return(false); } // 身上无此技能 for (int i = 0; i < SkillItemInfoList.Length; i++) { if (SkillItemInfoList[i].m_skillID == skillId) { return(true); } } return(false); }
public void refreshCurrentNewAddingStar() { currentAddingFigure = 0; GDEHeroData data = SDDataManager.Instance.getHeroByHashcode(heroDetail.Hashcode); HeroInfo indo = SDDataManager.Instance.getHeroInfoById(data.id); starVision.StarNum = data.starNumUpgradeTimes + indo.LEVEL; int starNum = starVision.StarNum; if (starNum >= SDConstants.UnitMAxStarNum) { BtnToConfirmCurrentImprove.interactable = false; return; } currentAddingFigure = 1; for (int i = 0; i < AllSlots.Length; i++) { bool unlocked = i < starNum; AllSlots[i].isLocked = !unlocked; if (unlocked && AllSlots[i].isEmpty) { currentAddingFigure = 0; } } //预计升星动画 //升级确认按钮状态 BtnToConfirmCurrentImprove.interactable = currentAddingFigure > 0 && SDDataManager.Instance.checkHeroExpIfOverflow(data.exp, starNum); }
void Start() { Debug.Log("Title Start"); //인포 로드 var loadInfo = InfoManager.Instance.LoadInfo(); //인포가 있으면, 이어하기 버튼 활성화 if (loadInfo) { this.heroInfo = InfoManager.Instance.heroInfo; this.btn_continue.gameObject.SetActive(true); } else { this.btn_continue.gameObject.SetActive(false); } this.OnFadeInEnd = () => { //준비 완료 this.Ready2Game(); }; StartCoroutine(this.FadeIn()); }
public void Init() { Debug.Log("Title Init"); //GPGS연동 //Data 불러오기 var data = DataManager.Instance; data.LoadAllDatas(); //Info 불러오기 //true 면 기존유저, false면 신규유저 var userCheck = InfoManager.Instance.LoadHeroInfo(); if (userCheck) { //기존유저 //이어하기 활성화 this.btn_Continew.gameObject.SetActive(true); //히어로 인포 저장 this.heroInfo = InfoManager.Instance.heroInfo; } else { //신규유저 //이어하기 비 활성화 this.btn_Continew.gameObject.SetActive(false); } //페이드 인 아웃 //게임 시작 준비 호출 this.Ready2theGame(); }
public void Init(HeroInfo heroInfo) { this.heroInfo = heroInfo; //인포 세이브 InfoManager.Instance.SaveInfo(this.heroInfo); //데이터 불러오기 DataManager.Instance.LoadAllData(); this.campData = DataManager.Instance.dicCampData[this.heroInfo.stageLevel]; //캠프 프리팹 불러오기 this.LoadPrefab(); this.trader.OnComeEnd = () => { this.Ready2Shopping(); }; this.OnFadeOutEnd = () => { //스테이지로 이동 this.OnCampEnd(); }; //페이드 인 //this.hero.anim(앉기); StartCoroutine(this.FadeIn()); StartCoroutine(this.trader.Come()); }
public void SetInfo(HeroInfo heroInfo, ItemInfo itemInfo) { _heroInfo = heroInfo; _itemInfo = itemInfo; _starPanel.SetStar(heroInfo.StarLevel); _imgIconBg.sprite = ResourceManager.Instance.GetHeroBgByStar(heroInfo.StarLevel); _imgIcon.sprite = ResourceManager.Instance.GetHeroImage(heroInfo.ConfigID); _txtHeroName.text = heroInfo.GetName(); _txtHeroName.color = ResourceManager.Instance.GetColorByQuality(heroInfo.StarLevel); _txtFightScore.text = heroInfo.FightingScore.ToString(); _imgItemType.sprite = ResourceManager.Instance.GetItemTypeIcon((ItemType)itemInfo.Cfg.Type); ItemInfo curItemInfo = heroInfo.GetItemByType((ItemType)itemInfo.Cfg.Type); if (curItemInfo != null) { _itemWidget.SetInfo(curItemInfo); _itemWidget.gameObject.SetActive(true); } else { _itemWidget.gameObject.SetActive(false); } }
private IEnumerator RefreshRoleModelCoroutine() { DespawnCharacter(); TransformUtil.ClearChildren(roleModelRoot, true); yield return(new WaitForSeconds(0.4f)); PlayerInfo playerInfo = _roleInfo as PlayerInfo; HeroInfo heroInfo = _roleInfo as HeroInfo; if (playerInfo != null) { CharacterEntity characterEntity = CharacterEntity.CreatePlayerEntityAsUIElement(playerInfo, roleModelRoot, true, true); Action.Controller.ActionController.instance.PlayerAnimAction(characterEntity, AnimatorUtil.VICOTRY_ID); } else if (heroInfo != null) { bool canClick = true; if (_roleInfo.heroData.hero_type == 4)//boss { canClick = false; } _characterEntity = CharacterEntity.CreateHeroEntityAsUIElement(heroInfo, roleModelRoot, canClick, true); if (canClick) { Action.Controller.ActionController.instance.PlayerAnimAction(_characterEntity, AnimatorUtil.VICOTRY_ID); } } }
private static PartyInfo MakePartyInfo(BtlCtrlParty btlCtrlParty) { HeroInfo heroInf01 = null; List <CharInfo> charInfoes01 = new List <CharInfo>(); List <BtlCtrlCharacter> characterList = btlCtrlParty.GetCharacters(); foreach (BtlCtrlCharacter ch in characterList) { if (ch.type == BtlCtrlCharacter.Type.Hero) { heroInf01 = MakeCharatcerInfo(ch, true) as HeroInfo; } else { charInfoes01.Add(MakeCharatcerInfo(ch, false)); } } //Secrets List <Divine.Secret> secrets = new List <Divine.Secret>(2) { Divine.Secret.Mirror, Divine.Secret.Ransom }; return(new PartyInfo(heroInf01, charInfoes01.ToArray(), secrets, 0, btlCtrlParty.partyName)); }
private void GetHeroInfo() { if (GameManager.Instance.Player) { info = GameManager.Instance.Player.GetComponent <HeroInfo>(); if (info) { heroCenter = info.heroCenter; heroTransformMax = new GameObject("MaxTransf").transform; heroTransformMax.SetParent(heroCenter); heroTransform = new GameObject("HeroCamTransform").transform; heroTransform.SetParent(heroCenter); heroTransformMax.localScale = heroTransform.localScale = Vector3.zero; if (info.thirdPerson) { heroTransformMax.rotation = heroTransform.rotation = info.thirdPerson.rotation; heroTransformMax.position = heroTransform.position = info.thirdPerson.position; } else { heroTransformMax.localRotation = heroTransform.localRotation = Quaternion.Euler( 12.6756f, 0.0f, 0.0f); heroTransformMax.localPosition = heroTransform.localPosition = new Vector3(0.0f , 3.143125f, -7.536876f); } } } }
static int FindLast(IntPtr L) { try { ToLua.CheckArgsCount(L, 2); System.Collections.Generic.List <HeroInfo> obj = (System.Collections.Generic.List <HeroInfo>)ToLua.CheckObject(L, 1, typeof(System.Collections.Generic.List <HeroInfo>)); System.Predicate <HeroInfo> arg0 = null; LuaTypes funcType2 = LuaDLL.lua_type(L, 2); if (funcType2 != LuaTypes.LUA_TFUNCTION) { arg0 = (System.Predicate <HeroInfo>)ToLua.CheckObject(L, 2, typeof(System.Predicate <HeroInfo>)); } else { LuaFunction func = ToLua.ToLuaFunction(L, 2); arg0 = DelegateFactory.CreateDelegate(typeof(System.Predicate <HeroInfo>), func) as System.Predicate <HeroInfo>; } HeroInfo o = obj.FindLast(arg0); ToLua.PushObject(L, o); return(1); } catch (Exception e) { return(LuaDLL.toluaL_exception(L, e)); } }
public void SetData(HeroInfo h0, int type) { IsFriend = false; TheType = type; HeroData = h0; Attrack = 0; Hp = 0; Recover = 0; Mp = 0; if (HeroData != null) { HeroTemp = HeroModelLocator.Instance.GetHeroByTemplateId(HeroData.TemplateId); if (HeroData.Prop.ContainsKey(RoleProperties.ROLE_ATK)) { Attrack += HeroData.Prop[RoleProperties.ROLE_ATK]; } if (HeroData.Prop.ContainsKey(RoleProperties.ROLE_HP)) { Hp += HeroData.Prop[RoleProperties.ROLE_HP]; } if (HeroData.Prop.ContainsKey(RoleProperties.ROLE_RECOVER)) { Recover += HeroData.Prop[RoleProperties.ROLE_RECOVER]; } if (HeroData.Prop.ContainsKey(RoleProperties.ROLE_MP)) { Mp += HeroData.Prop[RoleProperties.ROLE_MP]; } } SetContent(); }
/// <summary> /// The comparation of hero info by job. /// </summary> /// <param name="p1">The left hero info.</param> /// <param name="p2">The right hero info.</param> /// <returns>The result of the comparation</returns> private int CompareHeroByJob(HeroInfo p1, HeroInfo p2) { var heroTemp = HeroTemplates.HeroTmpls; int compareResult = heroTemp[p1.TemplateId].Job.CompareTo(heroTemp[p2.TemplateId].Job); if (compareResult == 0) { return CompareHeroByTemplateId(p1, p2); } return compareResult; }
/// <summary> /// Show the info of the item. /// </summary> /// <param name="orderType">The order type of </param> /// <param name="heroTran">The transform of item.</param> /// <param name="heroInfo">The info of item.</param> public static void ShowHero(OrderType orderType, HeroItem heroTran, HeroInfo heroInfo) { var heroTemplate = HeroModelLocator.Instance.HeroTemplates.HeroTmpls[heroInfo.TemplateId]; var quality = heroTemplate.Star; var level = heroInfo.Lvl; var job = heroTemplate.Job; var atk = heroInfo.Prop[RoleProperties.ROLE_ATK]; var hp = heroInfo.Prop[RoleProperties.ROLE_HP]; ; var recover = heroInfo.Prop[RoleProperties.ROLE_RECOVER]; ; ShowHero(orderType, heroTran, quality, level, job, atk, hp, recover); }
public virtual void InitItem(HeroInfo heroInfo) { var heroTemplate = HeroModelLocator.Instance.HeroTemplates.HeroTmpls[heroInfo.TemplateId]; Quality = heroTemplate.Star; HeroInfo = heroInfo; HeroConstant.SetHeadByIndex(icon, heroTemplate.Icon - 1); if (jobIcon) { jobIcon.spriteName = HeroConstant.HeroJobPrefix + heroTemplate.Job; jobIcon.MakePixelPerfect(); } if (heroName) { heroName.text = heroTemplate.Name; } }
public void Refresh(HeroInfo heroInfo) { if (heroInfo == null) { Logger.LogWarning("You are refreshing hero info with null, Please check it."); return; } Uuid = heroInfo.Uuid; IsLock = heroInfo.Bind; var heroTemps = HeroModelLocator.Instance.HeroTemplates; HeroTemplate heroTemp; heroTemps.HeroTmpls.TryGetValue(heroInfo.TemplateId, out heroTemp); if (heroTemp != null) { Refresh(heroTemp); IsLock = heroInfo.Bind; } }
public void Refresh(HeroInfo heroInfo) { var template = HeroModelLocator.Instance.HeroTemplates.HeroTmpls[heroInfo.TemplateId]; if (BaseInfoRefresher) { BaseInfoRefresher.Refresh(heroInfo); } if (HeroItemBase) { HeroItemBase.InitItem(heroInfo); } if(PropertyUpdater) { PropertyUpdater.UpdateProperty(heroInfo.Lvl, template.LvlLimit, heroInfo.Prop[RoleProperties.ROLE_ATK], heroInfo.Prop[RoleProperties.ROLE_HP], heroInfo.Prop[RoleProperties.ROLE_RECOVER], heroInfo.Prop[RoleProperties.ROLE_MP]); } HeroSkillUpdater.RefreshSkills(template); }
//http://www.redblobgames.com/grids/hexagons/#range public static bool canHeroAttackUnit(HeroInfo attacker, HeroInfo deffender) { if (deffender == null || attacker == null) { Debug.Log ("something was null"); return false; } TileInfo attackerTile = attacker.tile; TileInfo deffenderTile = deffender.tile; int dX = attackerTile.x - deffenderTile.x; int dY = attackerTile.y - deffenderTile.y; int dZ = attackerTile.z - deffenderTile.z; float d = Mathf.Abs (dX) + Mathf.Abs (dY) + Mathf.Abs (dZ); d = d / 2; if (d <= attacker.range) { return true; } return false; }
/// <summary> /// The comparation of hero info by recover. /// </summary> /// <param name="p1">The left hero info.</param> /// <param name="p2">The right hero info.</param> /// <returns>The result of the comparation</returns> private int CompareHeroByRecover(HeroInfo p1, HeroInfo p2) { int compareResult = p2.Prop[RoleProperties.ROLE_RECOVER].CompareTo(p1.Prop[RoleProperties.ROLE_RECOVER]); if (compareResult == 0) { return CompareHeroByTemplateId(p1, p2); } return compareResult; }
/// <summary> /// The comparation of hero info by attack. /// </summary> /// <param name="p1">The left hero info.</param> /// <param name="p2">The right hero info.</param> /// <returns>The result of the comparation</returns> private int CompareHeroByAttack(HeroInfo p1, HeroInfo p2) { int compareResult = p2.Prop[RoleProperties.ROLE_ATK].CompareTo(p1.Prop[RoleProperties.ROLE_ATK]); if (compareResult == 0) { return CompareHeroByTemplateId(p1, p2); } return compareResult; }
/// <summary> /// The comparation of hero info by template id. /// </summary> /// <param name="p1"></param> /// <param name="p2"></param> /// <returns></returns> private int CompareHeroByTemplateId(HeroInfo p1, HeroInfo p2) { return p2.TemplateId.CompareTo(p1.TemplateId); }
public void EquipOver(HeroInfo info) { RefreshData(info); if (heroSelItem != null) { NGUITools.Destroy(heroSelItem); heroSelItem = null; } }
public void RefreshData(HeroInfo info) { commonWindow.HeroInfo = info; RefreshData(); }
internal static void ResetVars() { MainHeroInfo = null; AltHeroInfo = null; AltHeroGamblingEnabled = false; GamblingCharacterSwitch = false; GamblingCharacterSwitchToMain = false; _mainHeroIndexes.Clear(); }
private void SetLeaderState(HeroInfo heroInfo) { var heroList = HeroModelLocator.Instance.SCHeroList; var curTeamIndex = heroList.CurrentTeamIndex; var curTeamUuids = new List<long>(); var allTeamUuids = new List<long>(); for (var i = 0; i < heroList.TeamList.Count; i++) { var uUids = heroList.TeamList[i].ListHeroUuid.Where(id => id != HeroConstant.NoneInitHeroUuid).ToList(); if (curTeamIndex == i) { curTeamUuids = uUids.ToList(); } allTeamUuids.AddRange(uUids); } allTeamUuids = allTeamUuids.Distinct().ToList(); LeaderState = HeroUtils.GetLeaderState(heroInfo.Uuid, curTeamUuids, allTeamUuids); }
public override void InitItem(HeroInfo heroInfo, List<long> curTeam, List<long> allTeams) { base.InitItem(heroInfo); HeroInfo = heroInfo; LeaderState = HeroUtils.GetLeaderState(heroInfo.Uuid, curTeam, allTeams); BindState = heroInfo.Bind; }
private void ShowHeroDetail(HeroInfo heroInfo) { detailClone = NGUITools.AddChild(gameObject, HeroDetailInfo); var heroDetailControl = detailClone.GetComponent<HeroDetailInfoControl>(); heroDetailControl.Refresh(heroInfo); }
private void UpdateSkills(HeroInfo leaderInfo) { var leaderTemplate = HeroModelLocator.Instance.HeroTemplates.HeroTmpls[leaderInfo.TemplateId]; var skillTempls = HeroModelLocator.Instance.SkillTemplates.HeroBattleSkillTmpls; HeroBattleSkillTemplate leaderSkill; skillTempls.TryGetValue(leaderTemplate.LeaderSkill, out leaderSkill); leaderSkillName.text = leaderSkill != null ? leaderSkill.Name : "-"; leaderSkillDesc.text = leaderSkill != null ? leaderSkill.Desc : "-"; }
private void CloneBaseHeros(out List<HeroInfo> heroInfos, out HeroInfo leaderInfo) { leaderInfo = null; heroInfos = new List<HeroInfo>(); var curIndex = 0; for(var i = 0; i < curTeam.Count; i++) { var uuid = curTeam[i]; if(uuid != HeroConstant.NoneInitHeroUuid) { var child = NGUITools.AddChild(teamGrid.gameObject, BaseHeroPrefab); SetPositionViaIndex(child, curIndex); var baseHero = child.GetComponent<HeroItemBase>(); var heroInfo = HeroModelLocator.Instance.FindHero(uuid); baseHero.InitItem(heroInfo); heroInfos.Add(heroInfo); var index = infos.IndexOf(heroInfo); teamObjects.Add(Utils.OneDimToTwo(index, CountOfOneGroup), child); HeroUtils.InstallLongPress(child, CancelHeroToTeam, GreenHandGuideHandler.Instance.TeamFinishFlag); if(i == 0) { leaderInfo = heroInfo; } } curIndex++; } }
/// <summary> /// The comparation of hero info by level. /// </summary> /// <param name="p1">The left hero info.</param> /// <param name="p2">The right hero info.</param> /// <returns>The result of the comparation</returns> private int CompareHeroByLv(HeroInfo p1, HeroInfo p2) { int compareResult = p2.Lvl.CompareTo(p1.Lvl); if (compareResult == 0) { return CompareHeroByTemplateId(p1, p2); } return compareResult; }
/// <summary> /// The comparation of hero info by time. /// </summary> /// <param name="p1">The left hero info.</param> /// <param name="p2">The right hero info.</param> /// <returns>The result of the comparation</returns> private int CompareHeroByTime(HeroInfo p1, HeroInfo p2) { return p2.Uuid.CompareTo(p1.Uuid); }
private static RunStatus CharacterSwitch() { BotMain.StatusText = "[Funky] Hero Switch *Switching Heros*"; if (FunkyBaseExtension.Settings.General.AltHeroIndex < 0) { Logger.DBLog.InfoFormat("Hero Index Info not setup!"); BotMain.Stop(); return RunStatus.Success; } if (HeroIndexInfo.Characters.Count == 0) { Logger.DBLog.InfoFormat("Hero Index Info not setup!"); BotMain.Stop(); return RunStatus.Success; } if (MainHeroInfo == null) { ZetaDia.Memory.ClearCache(); MainHeroInfo = new HeroInfo(ZetaDia.Service.Hero); } _lastProfilePath = ProfileManager.CurrentProfile.Path; Logger.DBLog.InfoFormat("Switching to Hero Index {0}", FunkyBaseExtension.Settings.General.AltHeroIndex); ZetaDia.Service.GameAccount.SwitchHero(FunkyBaseExtension.Settings.General.AltHeroIndex); return RunStatus.Running; }
public virtual void InitItem(HeroInfo heroInfo, List<long> curTeam, List<long> allTeams) { InitItem(heroInfo); }
private static RunStatus UpdateAltHero() { BotMain.StatusText = "[Funky] Hero Switch *Refreshing Alt Info*"; if (AltHeroInfo == null) { ZetaDia.Memory.ClearCache(); AltHeroInfo = new HeroInfo(ZetaDia.Service.Hero); return RunStatus.Running; } if (AltHeroInfo.Equals(MainHeroInfo)) { //Switch Failed or Values were incorrect! Logger.DBLog.InfoFormat("[Funky] Hero Switch (Incorrect Hero Info!)"); AltHeroInfo = null; return RunStatus.Success; } return RunStatus.Running; }
public static void CleanEquipStatus(HeroInfo heroInfo, List<ItemInfo> items) { if (heroInfo == null || items == null) { return; } var equipedUuids = heroInfo.EquipUuid; foreach (var equipedUuid in equipedUuids) { var item = ItemModeLocator.Instance.FindItem(equipedUuid); if (item != null) { item.EquipStatus = 0; } } }
public static RunStatus GamblingCharacterSwitchBehavior() { if (!_delayer.Test(5d)) return RunStatus.Running; if (GamblingCharacterSwitchToMain) { if (!_initalDelayStarted) { _initalstartTime = DateTime.Now; _initalDelayStarted = true; } var initaldelayStartSecs = DateTime.Now.Subtract(_initalstartTime).TotalSeconds; if (initaldelayStartSecs < 7) { BotMain.StatusText = "[Funky] Switching to Main Hero (Waiting for inital delay! [" + initaldelayStartSecs + " secs])"; return RunStatus.Running; } BotMain.StatusText = "[Funky] Switching to Main Hero"; ZetaDia.Memory.ClearCache(); HeroInfo curheroinfo = new HeroInfo(ZetaDia.Service.Hero); if (!curheroinfo.Equals(MainHeroInfo)) {//Need To Switch back to main hero! Logger.DBLog.DebugFormat("Current Hero Info Mismatched -- Current Hero {0}\r\nMain Hero{1}", curheroinfo.ToString(), MainHeroInfo.ToString()); if (_mainHeroIndexes.Count == 0) {//Get a list of possible heroes using our index list (matching hero class and name) foreach (var c in HeroIndexInfo.Characters.Where(c => c.Class == MainHeroInfo.Class && c.Name == MainHeroInfo.Name)) { _mainHeroIndexes.Add(c.Index); } } else {//Switch and remove index from list int mainheroIndex = _mainHeroIndexes.First(); Logger.DBLog.InfoFormat("[Funky] Switching to Main Hero -- Index {0}", mainheroIndex); ZetaDia.Service.GameAccount.SwitchHero(mainheroIndex); _mainHeroIndexes.RemoveAt(0); } } else {//Finished! Reset the variables. FunkyGame.ShouldRefreshAccountDetails = true; PluginSettings.LoadSettings(); _initalDelayStarted = false; MainHeroInfo = null; AltHeroInfo = null; GamblingCharacterSwitch = false; GamblingCharacterSwitchToMain = false; _mainHeroIndexes.Clear(); return RunStatus.Success; } return RunStatus.Running; } //Update Main Hero Info and Switch to Alt Hero! if (MainHeroInfo == null) { if (!_initalDelayStarted) { _initalstartTime = DateTime.Now; _initalDelayStarted = true; } var initaldelayStartSecs = DateTime.Now.Subtract(_initalstartTime).TotalSeconds; if (initaldelayStartSecs < 7) { BotMain.StatusText = "[Funky] Switching to Alt Hero (Waiting for inital delay! [" + initaldelayStartSecs + " secs])"; return RunStatus.Running; } BotMain.StatusText = "[Funky] Switching to Alt Hero"; return CharacterSwitch(); } //Update Alt Hero Info and Start Adventure Mode Game! if (AltHeroInfo == null) return UpdateAltHero(); //Finished for now.. lets load the new game and let combat control take over! FunkyGame.ShouldRefreshAccountDetails = true; GamblingCharacterSwitch = false; AltHeroGamblingEnabled = true; _initalDelayStarted = false; return RunStatus.Success; }
public void SetData(HeroInfo herodata0, HeroInfo herodata1, HeroInfo herodata2, int leadertype) { IsFriendItem = false; LeaderType = leadertype; HeroList = new List<HeroInfo>(); HeroList.Add(herodata0); HeroList.Add(herodata1); HeroList.Add(herodata2); Attrack = 0; Hp = 0; Recover = 0; Mp = 0; TheLevel = (herodata0 != null) ? (int)herodata0.Lvl : 0; for (int i = 0; i < HeroList.Count; i++) { if (HeroList[i] == null) continue; if (HeroList[i].Prop.ContainsKey(RoleProperties.ROLE_ATK)) { Attrack += HeroList[i].Prop[RoleProperties.ROLE_ATK]; if (i == 0) { LeaderAtk = HeroList[i].Prop[RoleProperties.ROLE_ATK]; } } if (HeroList[i].Prop.ContainsKey(RoleProperties.ROLE_HP)) { Hp += HeroList[i].Prop[RoleProperties.ROLE_HP]; if (i == 0) { LeaderHp = HeroList[i].Prop[RoleProperties.ROLE_HP]; } } if (HeroList[i].Prop.ContainsKey(RoleProperties.ROLE_RECOVER)) { Recover += HeroList[i].Prop[RoleProperties.ROLE_RECOVER]; } if (HeroList[i].Prop.ContainsKey(RoleProperties.ROLE_MP)) { Mp += HeroList[i].Prop[RoleProperties.ROLE_MP]; } } ShowData(); }
public static void GetMaxProperties(HeroInfo info, out int maxAtk, out int maxHp, out int maxRecover, out int maxMp) { var heroTemplate = HeroModelLocator.Instance.HeroTemplates.HeroTmpls[info.TemplateId]; var addtionTimes = heroTemplate.LvlLimit - info.Lvl; maxAtk = info.Prop[RoleProperties.ROLE_ATK] + GetConverted(heroTemplate.AttackAddtion) * addtionTimes; maxHp = info.Prop[RoleProperties.ROLE_HP] + GetConverted(heroTemplate.HPAddtion) * addtionTimes; maxRecover = info.Prop[RoleProperties.ROLE_RECOVER] + GetConverted(heroTemplate.RecoverAddtion) * addtionTimes; maxMp = info.Prop[RoleProperties.ROLE_MP] + GetConverted(heroTemplate.MPAddtion) * addtionTimes; }