Exemplo n.º 1
0
        public virtual void Frame(ISkillArgs args)
        {
            for (int i = 0; i < skills.Count; i++)
            {
                ISkill skill = skills[i];
                skill.SetDisable(disable);
                //FreeLog.ActionMark = unit.GetID() + "'s skill " + skill.ToString();
                FreeLog.SetTrigger(skill);
                skill.Frame(args);
            }

            if (removes.Count > 0)
            {
                for (int i = 0; i < removes.Count; i++)
                {
                    ISkill skill_1 = removes[i];
                    skills.Remove(skill_1);
                }
                removes.Clear();
            }
            if (adds.Count > 0)
            {
                for (int i = 0; i < adds.Count; i++)
                {
                    ISkill skill_1 = adds[i];
                    skills.Add(skill_1);
                }
                adds.Clear();
            }
            effects.Frame(args);
        }
Exemplo n.º 2
0
        public override void DoAction(IEventArgs args)
        {
            if (!initialed)
            {
                if (prepare != null)
                {
                    prepare.Act(args);
                }
                initialed = true;
            }
            FreeLog.SetTrigger(trigger);
            order.Act(args);
            if (frame != null)
            {
                frame.Act(args);
            }
            if (args.FreeContext.AiSuccess)
            {
                if (frame is TestCaseMultiAction)
                {
                    ((TestCaseMultiAction)frame).Record(args);
                }

                if (clean != null)
                {
                    clean.Act(args);
                }
            }
        }
Exemplo n.º 3
0
 public virtual void Eat(PlayerEntity player, ISkillArgs skill)
 {
     foreach (FreeBuf buf in map.Values)
     {
         FreeLog.SetTrigger(buf);
         buf.Eat(player, skill);
     }
 }
Exemplo n.º 4
0
 public virtual void Eat(PlayerEntity player, ISkillArgs skill)
 {
     MyDictionary <string, FreeBuf> .Enumerator it = map.GetEnumerator();
     while (it.MoveNext())
     {
         FreeBuf buf = it.Current.Value;
         FreeLog.SetTrigger(buf);
         buf.Eat(player, skill);
     }
 }
Exemplo n.º 5
0
 private void UpdateFreeMoveEntity(Contexts room, int interval)
 {
     FreeMoveEntity[] freeMoves = room.freeMove.GetEntities();
     foreach (var freeMoveEntity in freeMoves)
     {
         if (freeMoveEntity.freeData.FreeData != null)
         {
             FreeLog.SetTrigger(freeMoveEntity.freeData.FreeData);
             ((FreeEntityData)freeMoveEntity.freeData.FreeData).Frame(args, interval);
         }
     }
 }
Exemplo n.º 6
0
        public static void Handle(ServerRoom room, DebugCommand message, PlayerEntity player)
        {
            if (commandDic.ContainsKey(message.Command.ToLower()))
            {
                FreeLog.Reset();

                IGameAction action = commandDic[message.Command.ToLower()];

                if (FreeLog.IsEnable())
                {
                    FreeLog.SetTrigger(string.Format("命令行 {0}: {1}", message.Command, string.Join(" ", message.Args)));
                }

                if (commandPara == null)
                {
                    commandPara = new StringPara("command", "");
                }

                if (message.Args != null)
                {
                    for (int i = 1; i <= message.Args.Length; i++)
                    {
                        room.FreeArgs.TempUsePara(new StringPara("arg" + i, message.Args[i - 1]));
                    }
                }


                room.FreeArgs.TempUsePara(commandPara);
                room.FreeArgs.TempUse("current", (FreeData)player.freeData.FreeData);

                action.Act(room.FreeArgs);

                if (message.Command == "relive")
                {
                    player.isFlagCompensation = true;
                }

                room.FreeArgs.Resume("current");
                room.FreeArgs.ResumePara("command");

                if (message.Args != null)
                {
                    for (int i = 1; i <= message.Args.Length; i++)
                    {
                        room.FreeArgs.ResumePara("arg" + i);
                    }
                }

                FreeLog.Print();
            }
        }
Exemplo n.º 7
0
 public virtual void Trigger(IEventArgs args)
 {
     if (!disable)
     {
         FreeLog.SetTrigger(this);
         FreeLog.ActionMark = this.@group + " " + this.name + " " + this.key;
         long s = FreeTimeDebug.RecordStart("trigger " + name);
         foreach (IGameAction de in actions)
         {
             de.Act(args);
         }
         FreeTimeDebug.RecordEnd("trigger " + name, s);
     }
 }
Exemplo n.º 8
0
 public override void DoAction(IEventArgs args)
 {
     FreeLog.SetTrigger(trigger);
     order.Act(args);
     if (frame != null)
     {
         frame.Act(args);
     }
     if (args.FreeContext.AiSuccess)
     {
         if (frame is TestCaseMultiAction)
         {
             ((TestCaseMultiAction)frame).Record(args);
         }
     }
 }