示例#1
0
文件: Effect.cs 项目: mxgmn/GENW
    public void Add(string name, float time, object parameter)
    {
        var query = data.Where(e => e.data.name == name);
        if (query.Count() > 0)
        {
            Effect e = query.Single();
            if (e.timeLeft < time) e.timeLeft = time;
        }
        else
        {
            Effect e = new Effect(name, time, parameter);
            data.Add(e);

            if (e.NameIs("True Strike", "Blind", "Fake Death", "Sleeping", "Blindsight", "Mind Tricked", "Mind Controlled"))
                B.log.AddLine(t.CommonName + " ", t.LogColor);

            if (e.NameIs("Roots"))
            {
                B.log.AddLine("Multiple roots crawl from the ground and entangle " + t.CommonName + "! ", Color.Pink);
                B.log.Add(t.CommonName, t.LogColor);
                B.log.Add(" can't move!", Color.Pink);
            }
            else if (e.NameIs("True Strike")) B.log.Add("feels confident.", Color.Pink);
            else if (e.NameIs("Blind")) B.log.Add("can't see anything!", Color.Pink);
            else if (e.NameIs("Fake Death")) B.log.Add("looks completely dead.", Color.Pink);
            else if (e.NameIs("Sleeping")) B.log.Add("falls asleep.", Color.Pink);
            else if (e.NameIs("Blindsight")) B.log.Add("can't see " + (e.parameter as LocalObject).CommonName + " now.", Color.Pink);
            else if (e.NameIs("Mind Tricked")) B.log.Add("is now fighting for the wrong party!", Color.Pink);
            else if (e.NameIs("Mind Controlled"))
                B.log.Add("is now controlled by " + (e.parameter as LocalObject).CommonName + "!", Color.Pink);
        }
    }