Exemplo n.º 1
0
    private void Freeze(FreezeData enemy)
    {
        if (enemy)
        {
            _freezeTimers[enemy] = 0;
            enemy.nav.speed      = enemy.originalSpeed / 2;

            enemy.mat.SetColor("_EmissionColor", _freezeColor);
        }
    }
Exemplo n.º 2
0
 protected override void AddEffectAfterCheck(PassengerSM passenger)
 {
     MonobehaviorHandler.GetMonobeharior().GetObject <DoorsTimer>("DoorsTimer").SetPaused(false);
     passenger.ActiveBonuses.Add(GetBonusType());
     if (_data == null)
     {
         _data            = new FreezeData();
         _data.Distance   = Dist;
         _data.StartPoint = Position;
         _floor           = MonobehaviorHandler.GetMonobeharior().GetObject <Floor>("Floor");
         _floor.SnowDrop(_data, true);
     }
     passenger.ActivateFreezeBonus(_data);
 }
Exemplo n.º 3
0
 protected override void AddEffectAfterCheck(PassengerSM passenger)
 {
     MonobehaviorHandler.GetMonobeharior().GetObject<DoorsTimer>("DoorsTimer").SetPaused(false);
     passenger.ActiveBonuses.Add(GetBonusType());
     if (_data == null)
     {
         _data = new FreezeData();
         _data.Distance = Dist;
         _data.StartPoint = Position;
         _floor = MonobehaviorHandler.GetMonobeharior().GetObject<Floor>("Floor");
         _floor.SnowDrop(_data, true);
     }
     passenger.ActivateFreezeBonus(_data);
 }
Exemplo n.º 4
0
        public void LoadFromXML(XDocument doc)
        {
            foreach (var a in doc.Root.Attributes())
            {
                switch (a.Name.LocalName)
                {
                case "rating":
                    Rating = Convert.ToInt32(a.Value);
                    break;

                case "description":
                    Description = a.Value;
                    break;

                case "style":
                    Style = a.Value;
                    break;

                case "difficulty":
                    Difficulty = a.Value;
                    break;
                }
            }

            foreach (var e in doc.Root.Elements())
            {
                if (e.Name.LocalName == "stepdata")
                {
                    foreach (var x in e.Elements())
                    {
                        ArrowData.Add(e.ToArrow());
                    }
                }
                else if (e.Name.LocalName == "freezedata")
                {
                    foreach (var x in e.Elements())
                    {
                        FreezeData.Add(e.ToArrow());
                    }
                }
            }
        }
Exemplo n.º 5
0
        public int LoadFromData(string[] data, int pointer)
        {
            string s = "";

            Style       = data[pointer++].Replace("dance-", "").TrimEnd(':');
            Style       = Style[0].ToString().ToUpper() + Style.Substring(1);
            Description = data[pointer++].TrimEnd(':');
            Difficulty  = data[pointer++].TrimEnd(':');
            Difficulty  = Difficulty[0].ToString().ToUpper() + Difficulty.Substring(1);
            Rating      = Convert.ToInt32(data[pointer++].TrimEnd(':'));

            pointer++;

            List <string> measure = new List <string>();
            List <string> allData = new List <string>();

            while (s != ";")
            {
                measure.Clear();
                s = data[pointer++];
                while (s != "," && s != ";")
                {
                    measure.Add(s);
                    allData.Add(s);
                    s = data[pointer++];
                }

                switch (measure.Count)
                {
                case 4:
                    for (int i = 0; i < 4; i++)
                    {
                        ArrowData.Add(measure[i].ToArrow());
                        for (int j = 0; j < 3; j++)
                        {
                            ArrowData.Add(Arrow.None);
                        }
                    }
                    break;

                case 8:
                    for (int i = 0; i < 8; i++)
                    {
                        ArrowData.Add(measure[i].ToArrow());
                        ArrowData.Add(Arrow.None);
                    }
                    break;

                case 12:
                    for (int i = 0; i < 4; i++)
                    {
                        ArrowData.Add(Arrow.All);
                        ArrowData.Add(measure[i * 3].ToArrow());
                        ArrowData.Add(measure[i * 3 + 1].ToArrow());
                        ArrowData.Add(measure[i * 3 + 2].ToArrow());
                    }
                    break;

                case 16:
                    for (int i = 0; i < 16; i++)
                    {
                        ArrowData.Add(measure[i].ToArrow());
                    }
                    break;
                }
            }

            Arrow freezesOn = Arrow.None;

            foreach (var a in allData)
            {
                FreezeData.Add(a.ToFreeze(freezesOn, out freezesOn));
            }

            return(pointer);
        }