| | |
| | | private set; |
| | | } |
| | | |
| | | protected BattleDrops battleDrops; |
| | | protected BattleDrops m_battleDrops; |
| | | |
| | | private RectTransform m_heroRectTrans; |
| | | |
| | |
| | | var heroInfoBarScale = heroInfoBar.transform.localScale; |
| | | heroInfoBarScale.x *= Camp == BattleCamp.Red ? 1 : -1; |
| | | heroInfoBar.transform.localScale = heroInfoBarScale; |
| | | |
| | | heroInfoBar.SetActive(true); |
| | | if (battleField is StoryBattleField && (battleField as StoryBattleField).battleState == StoryBattleState.Break) |
| | | { |
| | | //主线关卡休息中的不显示血条 |
| | | heroInfoBar.SetActive(false); |
| | | } |
| | | else |
| | | { |
| | | heroInfoBar.SetActive(true); |
| | | } |
| | | SetFront(); |
| | | } |
| | | |
| | |
| | | |
| | | public void OnObjInfoRefresh(H0418_tagObjInfoRefresh _refreshInfo) |
| | | { |
| | | // 天子的挑战拦截血条,不拦截怒气 |
| | | BattleObject boss = battleField.FindBoss(); |
| | | if (boss != null && battleField.MapID == 30020 && boss.ObjID == _refreshInfo.ObjID && _refreshInfo.RefreshType != (ushort)PlayerDataType.XP) |
| | | return; |
| | | switch ((PlayerDataType)_refreshInfo.RefreshType) |
| | | { |
| | | case PlayerDataType.HP: |
| | | long toHp = GeneralDefine.GetFactValue(_refreshInfo.Value, _refreshInfo.ValueEx); |
| | | heroInfoBar.UpdateHP(teamHero.curHp, toHp, teamHero.maxHp); |
| | | heroInfoBar.UpdateHP(teamHero.curHp, toHp, teamHero.maxHp, false); |
| | | teamHero.curHp = GeneralDefine.GetFactValue(_refreshInfo.Value, _refreshInfo.ValueEx); |
| | | break; |
| | | case PlayerDataType.MaxHP: |
| | | teamHero.maxHp = GeneralDefine.GetFactValue(_refreshInfo.Value, _refreshInfo.ValueEx); |
| | | heroInfoBar.UpdateHP(teamHero.curHp, teamHero.curHp, teamHero.maxHp); |
| | | heroInfoBar.UpdateHP(teamHero.curHp, teamHero.curHp, teamHero.maxHp, false); |
| | | break; |
| | | case PlayerDataType.XP: |
| | | long toXp = GeneralDefine.GetFactValue(_refreshInfo.Value, _refreshInfo.ValueEx); |
| | |
| | | |
| | | public void ObjPropertyRefreshView(HB418_tagSCObjPropertyRefreshView vNetData) |
| | | { |
| | | // 天子的挑战拦截血条,不拦截怒气 |
| | | BattleObject boss = battleField.FindBoss(); |
| | | if (boss != null && battleField.MapID == 30020 && boss.ObjID == vNetData.ObjID && vNetData.RefreshType != (ushort)PlayerDataType.XP) |
| | | return; |
| | | switch ((PlayerDataType)vNetData.RefreshType) |
| | | { |
| | | case PlayerDataType.HP: |
| | | long toHp = GeneralDefine.GetFactValue(vNetData.Value, vNetData.ValueEx); |
| | | heroInfoBar.UpdateHP(teamHero.curHp, toHp, teamHero.maxHp); |
| | | heroInfoBar.UpdateHP(teamHero.curHp, toHp, teamHero.maxHp, false); |
| | | teamHero.curHp = GeneralDefine.GetFactValue(vNetData.Value, vNetData.ValueEx); |
| | | break; |
| | | case PlayerDataType.MaxHP: |
| | | teamHero.maxHp = GeneralDefine.GetFactValue(vNetData.Value, vNetData.ValueEx); |
| | | heroInfoBar.UpdateHP(teamHero.curHp, teamHero.curHp, teamHero.maxHp); |
| | | heroInfoBar.UpdateHP(teamHero.curHp, teamHero.curHp, teamHero.maxHp, false); |
| | | break; |
| | | case PlayerDataType.XP: |
| | | long toXp = GeneralDefine.GetFactValue(vNetData.Value, vNetData.ValueEx); |
| | |
| | | |
| | | if (isFatalAttack) |
| | | { |
| | | if (null != battleDrops) |
| | | if (null != battleHurtParam.battleDrops) |
| | | { |
| | | PushDropItems(battleDrops); |
| | | PushDropItems(battleHurtParam.battleDrops); |
| | | } |
| | | battleField.OnObjsDead(new List<HB422_tagMCTurnFightObjDead>() { battleHurtParam.deadPack }); |
| | | |
| | | |
| | | } |
| | | else |
| | | { |
| | |
| | | } |
| | | } |
| | | |
| | | public void SuckHp(uint suckHP, SkillConfig skillConfig) |
| | | { |
| | | // teamHero.curHp = Math.Min(teamHero.maxHp, teamHero.curHp + (int)suckHP); |
| | | } |
| | | |
| | | public void HurtByReflect(uint bounceHP, SkillConfig skillConfig) |
| | | { |
| | | // teamHero.curHp = Math.Max(0, teamHero.curHp - (int)bounceHP); |
| | | } |
| | | |
| | | |
| | | const float pingpongTime = 0.4f; |
| | | // 闪避开始 |
| | |
| | | .SetEase(Ease.OutCubic); |
| | | |
| | | motionBase.ShowIllusionShadow(true); |
| | | |
| | | DamageNumConfig damageNumConfig = DamageNumConfig.Get((int)DamageType.Dodge); |
| | | |
| | | string dodgeStr = ((char)damageNumConfig.prefix).ToString(); |
| | | |
| | | heroInfoBar.ShowTips(dodgeStr, true, false); |
| | | |
| | | tween.onComplete += () => |
| | | { |
| | |
| | | protected virtual BattleDmgInfo PopDamage(BattleHurtParam battleHurtParam) |
| | | { |
| | | BattleDmgInfo battleDmgInfo = new BattleDmgInfo(battleField.guid, battleHurtParam); |
| | | // 天子的挑战拦截血条逻辑 |
| | | BattleObject boss = battleField.FindBoss(); |
| | | if (boss != null && battleField.MapID == 30020 && boss.ObjID == battleHurtParam.hurtObj.ObjID) |
| | | { |
| | | EventBroadcast.Instance.Broadcast(EventName.BATTLE_DAMAGE_TAKEN, battleDmgInfo); |
| | | return battleDmgInfo; |
| | | } |
| | | else |
| | | { |
| | | heroInfoBar.UpdateDamage(battleDmgInfo); |
| | | |
| | | // 使用传入的 fromHp 和 toHp 更新血条显示 |
| | | heroInfoBar.UpdateHP(battleHurtParam.fromHp, battleHurtParam.toHp, teamHero.maxHp); |
| | | // YYL TODO 是否需要挂在在自身的follow点上 |
| | | EventBroadcast.Instance.Broadcast(EventName.BATTLE_DAMAGE_TAKEN, battleDmgInfo); |
| | | return battleDmgInfo; |
| | | } |
| | | |
| | | // YYL TODO 是否需要挂在在自身的follow点上 |
| | | EventBroadcast.Instance.Broadcast(EventName.BATTLE_DAMAGE_TAKEN, battleDmgInfo); |
| | | return battleDmgInfo; |
| | | } |
| | | |
| | | public RectTransform GetAliasTeamNode() |
| | |
| | | |
| | | public void PushDropItems(BattleDrops _battleDrops) |
| | | { |
| | | battleDrops = _battleDrops; |
| | | m_battleDrops = _battleDrops; |
| | | } |
| | | |
| | | public void PerformDrop() |
| | | { |
| | | if (null == battleDrops || battleDrops.dropItemPackIndex.Count == 0) |
| | | if (null == m_battleDrops) |
| | | return; |
| | | |
| | | EventBroadcast.Instance.Broadcast<string, BattleDrops, Action>( |
| | | EventName.BATTLE_DROP_ITEMS, battleField.guid, battleDrops, OnPerformDropFinish); |
| | | EventName.BATTLE_DROP_ITEMS, battleField.guid, m_battleDrops, OnPerformDropFinish); |
| | | } |
| | | |
| | | protected void OnPerformDropFinish() |
| | | { |
| | | battleDrops = null; |
| | | m_battleDrops = null; |
| | | } |
| | | |
| | | public void SetBack() |