123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151 |
- using CommonAI.Zone.EventTrigger;
- using CommonAI.Zone.Instance;
- using CommonAI.Zone.ZoneEditor;
- using CommonAI.Zone.ZoneEditor.EventTrigger;
- using CommonLang.Property;
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using XmdsCommonServer.Plugin.Scene;
- namespace XmdsCommonServer.Plugin.Editor
- {
- /*
- [DescAttribute("某个玩家任务状态Flag发生变化", "Xmds扩展 - 任务")]
- public class QuestFlagChanged : AbstractTrigger
- {
- public override void Listen(EventTriggerAdapter api, EventArguments args)
- {
- XmdsServerScene scene = (api.ZoneAPI as XmdsServerScene);
- XmdsServerScene.OnPlayerQuestFlagChangedHandlerR2B handler = new XmdsServerScene.OnPlayerQuestFlagChangedHandlerR2B((zone, player, flagName, flagValue)=>
- {
- //api.TriggingUnit = player;
- api.SetAttribute("TriggingFlagName", flagName);
- api.TestAndDoAction();
- });
- scene.OnPlayerQuestFlagChanged_R2B += handler;
- api.OnDisposed += (a) =>
- {
- scene.OnPlayerQuestFlagChanged_R2B -= handler;
- };
- }
- public override string ToString()
- {
- return string.Format("某个玩家任务状态Flag发生变化");
- }
- }
- [DescAttribute("设置玩家任务Flag", "Xmds扩展 - 任务")]
- public class SetPlayerQuestFlagAction : AbstractAction
- {
- [DescAttribute("玩家单位")]
- public UnitValue PlayerUnit = new UnitValue.Trigging();
- [DescAttribute("Flag唯一ID")]
- public StringValue FlagName = new StringValue.VALUE("FlagName");
- [DescAttribute("Flag值")]
- public StringValue FlagValue = new StringValue.VALUE("FlagValue");
- public override void DoAction(EventTriggerAdapter api, EventArguments args)
- {
- XmdsServerScene scene = (api.ZoneAPI as XmdsServerScene);
- InstancePlayer player = PlayerUnit.GetValue(api, args) as InstancePlayer;
- if (player != null)
- {
- scene.BS_SetPlayerQuestFlag(player, FlagName.GetValue(api, args), FlagValue.GetValue(api, args));
- }
- }
- public override string ToString()
- {
- return string.Format("设置玩家({0})任务Flag:{1}={2}", PlayerUnit, FlagName, FlagValue);
- }
- }
- [DescAttribute("清理玩家任务Flag", "Xmds扩展 - 任务")]
- public class ClearPlayerQuestFlagAction : AbstractAction
- {
- [DescAttribute("玩家单位")]
- public UnitValue PlayerUnit = new UnitValue.Trigging();
- [DescAttribute("Flag唯一ID")]
- public StringValue FlagName = new StringValue.VALUE("FlagName");
-
- public override void DoAction(EventTriggerAdapter api, EventArguments args)
- {
- XmdsServerScene scene = (api.ZoneAPI as XmdsServerScene);
- InstancePlayer player = PlayerUnit.GetValue(api, args) as InstancePlayer;
- if (player != null)
- {
- scene.BS_ClearPlayerQuestFlag(player, FlagName.GetValue(api, args));
- }
- }
- public override string ToString()
- {
- return string.Format("清理玩家({0})任务Flag:{1}", PlayerUnit, FlagName);
- }
- }
- [DescAttribute("获得玩家任务Flag值", "Xmds扩展 - 任务")]
- public class PlayerQuestFlagValue : StringValue
- {
- [DescAttribute("玩家单位")]
- public UnitValue PlayerUnit = new UnitValue.Trigging();
- [DescAttribute("Flag唯一ID")]
- public StringValue FlagName = new StringValue.VALUE("FlagName");
- public override string GetValue((IEditorValueAdapter api, EventArguments args)
- {
- string flagName = FlagName.GetValue(api, args);
- InstancePlayer player = PlayerUnit.GetValue(api, args) as InstancePlayer;
- if (player != null && flagName != null)
- {
- return (player.Virtual as XmdsVirtual_Player).GetQuestFlag(flagName);
- }
- return null;
- }
- public override string ToString()
- {
- return string.Format("获得玩家({0})任务Flag:{1}", PlayerUnit, FlagName);
- }
- }
- [DescAttribute("玩家是否拥有任务Flag", "Xmds扩展 - 任务")]
- public class PlayerContainsQuestFlag : BooleanValue
- {
- [DescAttribute("玩家单位")]
- public UnitValue PlayerUnit = new UnitValue.Trigging();
- [DescAttribute("Flag唯一ID")]
- public StringValue FlagName = new StringValue.VALUE("FlagName");
- public override bool GetValue((IEditorValueAdapter api, EventArguments args)
- {
- string flagName = FlagName.GetValue(api, args);
- InstancePlayer player = PlayerUnit.GetValue(api, args) as InstancePlayer;
- if (player != null && flagName != null)
- {
- return !string.IsNullOrEmpty((player.Virtual as XmdsVirtual_Player).GetQuestFlag(flagName));
- }
- return false;
- }
- public override string ToString()
- {
- return string.Format("玩家({0})是否拥有任务Flag:{1}", PlayerUnit, FlagName);
- }
- }
- [DescAttribute("触发中的FlagName", "Xmds扩展 - 任务")]
- public class TriggingFlagName : StringValue
- {
- public override string ToString()
- {
- return string.Format("触发中的FlagName");
- }
- public override string GetValue((IEditorValueAdapter api, EventArguments args)
- {
- return api.GetAttribute("TriggingFlagName") as string;
- }
- }
- */
- }
|