using System.Collections.Generic; using XmdsCommon.Message; using XmdsCommon.Plugin; using XmdsCommonServer.Message; namespace XmdsCommonServer.Plugin { partial class XmdsVirtual { public virtual void ReceiveMsgR2B(object status) { } /// /// 技能变更. /// protected virtual void OnPlayerSkillsChanged(PlayerSkillChangeEventR2B evt) { FormatLog("OnPlayerPropertiesChanged", null); if (evt != null) { switch (evt.OperateID) { case PlayerSkillChangeEventR2B.SkillOperate.Replace: this.mSkillHelper.ReplaceSkill(evt.SkillList); break; case PlayerSkillChangeEventR2B.SkillOperate.Add: this.mSkillHelper.AddSkill(evt.SkillList); break; case PlayerSkillChangeEventR2B.SkillOperate.Remove: this.mSkillHelper.RemoveSkill(evt.SkillList); break; case PlayerSkillChangeEventR2B.SkillOperate.Reset: this.ResetSkill(evt.SkillList); break; default: break; } } else { FormatLog("OnPlayerSkillsChanged Error :XmdsUnitSkillInfoEventB2C.Props is null", null); } } public void ResetSkill(List SkillList) { this.DestorySkill(); this.mSkillHelper = new XmdsSkillHelper(); this.mSkillHelper.ResetSkill(SkillList, this); } public bool AddHP(PropertyChangeEventR2B.ValueType type, float v,bool show) { switch (type) { case PropertyChangeEventR2B.ValueType.Percent: int r = (int)(this.MirrorProp.MaxHP * (v / XmdsSkillTemplate.DamageCalculator.XmdsDamageCalculator.PERER)); //SendMsgToClient(string.Format("{0}{1}", Tips_AddHP, r)); this.AddHP(r, this.mUnit, show); break; case PropertyChangeEventR2B.ValueType.Value: //SendMsgToClient(string.Format("{0}{1}", Tips_AddHP, v)); this.AddHP((int)v, this.mUnit, show); break; } return true; } /// /// 属性变更. /// protected void OnPlayerPropertiesChanged(XmdsUnitPropEventB2C evt) { if (evt != null && evt.Props != null) { FormatLog("OnPlayerPropertiesChanged", null); //重置属性. mProp.ServerData.Prop = evt.Props; InitBaseData(mProp.ServerData.Prop); //刷新属性. UnitPropRefresh(MirrorProp); this.mCardModule.ReloadCardSkillWeight(); SyncBattlePropsFields(PlayerBattlePropChangeEventB2C.MASK_ALL); } else { FormatLog("OnPlayerPropertiesChanged Error :OnPlayerPropertiesChanged.Props is null", null); } } } }