示例#1
0
 public void Command_TryRemoveModifier(uint casterID, int instancedAbilityID, int modifierLocalID)
 {
     if (base.isAuthority)
     {
         this._mpAbilityPlugin.MPTryRemoveModifierByID(casterID, instancedAbilityID, modifierLocalID);
     }
     else
     {
         RecordInvokeEntryContext context;
         this._mpAbilityPlugin.StartRecordInvokeEntry(instancedAbilityID, 0, casterID, 0xff, out context);
         Offset <MetaArg_Command_ModifierChangeRequest> offset = MetaArg_Command_ModifierChangeRequest.CreateMetaArg_Command_ModifierChangeRequest(context.builder, ModifierAction.Removed, (byte)modifierLocalID);
         context.Finish <MetaArg_Command_ModifierChangeRequest>(offset, AbilityInvokeArgument.MetaArg_Command_ModifierChangeRequest);
     }
 }
示例#2
0
        private void MetaAuthorityCommand_ModifierChangeRequestHandler(AbilityInvokeEntry invokeEntry)
        {
            _metaModifierReq = invokeEntry.GetArgument <MetaArg_Command_ModifierChangeRequest>(_metaModifierReq);
            uint target   = invokeEntry.Target;
            uint casterID = (target != 0) ? target : base._owner.runtimeID;

            if (((int)_metaModifierReq.Action) == 0)
            {
                this.MPTryApplyModifierByID(casterID, invokeEntry.InstancedAbilityID, _metaModifierReq.ModifierLocalID);
            }
            else if (((int)_metaModifierReq.Action) == 1)
            {
                this.MPTryRemoveModifierByID(casterID, invokeEntry.InstancedAbilityID, _metaModifierReq.ModifierLocalID);
            }
        }