123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100 |
- 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)
- {
- }
- /// <summary>
- /// 技能变更.
- /// </summary>
- 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<GameSkill> 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;
- }
- /// <summary>
- /// 属性变更.
- /// </summary>
- 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);
- }
- }
- }
- }
|