public void SetCamType(int entityID, int camp) { if (entityID == pkTargetID) { return; } if (m_BloodMap.ContainsKey(entityID)) { UBlood ub = m_BloodMap[entityID]; ub.SetCampType(camp); } }
public void UpdateBlood(EntityView view) { int entityID = -1; if (EntityView.isNullOrEmpty(view)) { return; } entityID = view.ID; if (m_BloodMap.ContainsKey(entityID)) { UBlood ub = m_BloodMap[entityID]; ub.Entity = view; ub.ChangeParent(view.transform); if (view.Property != null) { ub.SetCampType(view.Property.GetNumProp(ENTITY_PROPERTY.PROPERTY_CAMP)); } } }
/// <summary> /// 设置角色属性 /// </summary> /// <param name="objev"></param> private void SetProperty(EntityView objev, UBlood blood) { if (null == objev || null == objev.Property || null == blood) { return; } int nHeroID = objev.ID; int nMaxHp = objev.Property.GetNumProp(ENTITY_PROPERTY.PROPERTY_MAX_HP); int nCurHp = objev.Property.GetNumProp(ENTITY_PROPERTY.PROPERTY_HP); int nTempHp = objev.Property.GetNumProp(ENTITY_PROPERTY.PROPERTY_SHIELD); int nCurMp = objev.Property.GetNumProp(ENTITY_PROPERTY.PROPERTY_MP); int nMaxMp = objev.Property.GetNumProp(ENTITY_PROPERTY.PROPERTY_MAX_MP); int nCamp = objev.Property.GetNumProp(ENTITY_PROPERTY.PROPERTY_CAMP); int nLevel = 1; if (pkTargetID < 0) //PKTarget<0,代表当前不在PK状态 { nLevel = objev.Property.GetNumProp(ENTITY_PROPERTY.PROPERTY_LEVEL); } else { nLevel = GameLogicAPI.getPlayerLevel(nHeroID); } int masterID = objev.Property.GetNumProp(ENTITY_PROPERTY.PROPERTY_MASTER_UID); string sName = objev.Property.CreatureName; bool bIsMainHero = objev.IsHero; if (masterID > 0) { EntityView masterView = EntityFactory.getEntityViewByID(masterID); if (null != masterView && null != masterView.Property) { //英雄分身 if (blood.BloodType == BloodStyleType.Player) { nMaxHp = masterView.Property.GetNumProp(ENTITY_PROPERTY.PROPERTY_MAX_HP); nCurHp = masterView.Property.GetNumProp(ENTITY_PROPERTY.PROPERTY_HP); nTempHp = masterView.Property.GetNumProp(ENTITY_PROPERTY.PROPERTY_SHIELD); nCurMp = masterView.Property.GetNumProp(ENTITY_PROPERTY.PROPERTY_MP); nMaxMp = masterView.Property.GetNumProp(ENTITY_PROPERTY.PROPERTY_MAX_MP); nLevel = 1; if (pkTargetID < 0) //PKTarget<0,代表当前不在PK状态 { nLevel = masterView.Property.GetNumProp(ENTITY_PROPERTY.PROPERTY_LEVEL); } else { nLevel = GameLogicAPI.getPlayerLevel(masterID); } sName = masterView.Property.CreatureName; } } } if (nHeroID != pkTargetID) { blood.SetCampType(nCamp); } blood.SetLevel(nLevel); blood.SetMaxValue(nMaxHp); blood.SetCurValue(nCurHp); blood.SetTempValue(nTempHp); blood.SetMpValue(nCurMp); blood.SetMpMaxValue(nMaxMp); if (!bIsMainHero) { blood.SetRoleName(sName); } else { blood.SetClosed(!actorBloodVisible); } }