using System; using System.Collections.Generic; using System.Text; using CommonLang.Property; using CommonAI.Zone.ZoneEditor; using CommonAI.Zone.Instance; using CommonAI.Zone.Attributes; using CommonAI.Zone.EventTrigger; namespace CommonAI.Zone.ZoneEditor.EventTrigger { [DescAttribute("某个道具添加到场景", "道具")] public class AddedItem : AbstractTrigger { public override string ToString() { return string.Format("当某个道具添加到场景"); } public override void Listen(EventTriggerAdapter api, EventArguments args) { api.listen_ItemAdded(args, api.ZoneAPI); } } [DescAttribute("某个单位开始检取特定道具", "道具")] public class TryUnitPickItem : AbstractTrigger { [DescAttribute("道具")] public ItemValue Item = new ItemValue.NA(); [DescAttribute("是否可以检取")] public BooleanValue Condition = new BooleanValue.BooleanComparison(); public override string ToString() { return string.Format("当单位开始检取{0}", Item); } public override void Listen(EventTriggerAdapter api, EventArguments args) { api.listen_TryPickItem(args, api.ZoneAPI, (zone, unit, item) => { InstanceItem ditem = Item.GetValue(api, args); if (ditem != null && ditem == item) { bool ret = Condition.GetValue(api, args); return ret; } return true; }); } } [DescAttribute("某个单位开始检取某个道具", "道具")] public class TryUnitPickAnyItem : AbstractTrigger { [DescAttribute("是否可以检取")] public BooleanValue Condition = new BooleanValue.BooleanComparison(); public override string ToString() { return string.Format("当单位开始检取道具"); } public override void Listen(EventTriggerAdapter api, EventArguments args) { api.listen_TryPickItem(args, api.ZoneAPI, (zone, unit, item) => { bool ret = Condition.GetValue(api, args); return ret; }); } } }