Ejemplo n.º 1
0
        static void ImportMissingNamedVectors(AmfObject items, IEnumerable <XmlNamedVector4> xmlItems, string nameProperty, Func <AmfObject, String> descriptionGetter = null, IList <XmlNamedVector4> targetXmlList = null)
        {
            if (targetXmlList == null)
            {
                targetXmlList = (IList <XmlNamedVector4>)xmlItems;
            }
            var xmlNames = new HashSet <String>(xmlItems.Select(x => x.Name));

            foreach (var pair in items)
            {
                var name = pair.ValueAsObject.GetString(nameProperty);
                if (xmlNames.Contains(name))
                {
                    continue;
                }
                xmlNames.Add(name);

                var xml = new XmlNamedVector4 {
                    Name = name
                };
                if (descriptionGetter != null)
                {
                    xml.Description = descriptionGetter(pair.ValueAsObject);
                }
                targetXmlList.Add(xml);
            }
        }
Ejemplo n.º 2
0
        static XmlNamedVector4 HandleSpecialSE(XmlNamedVector4 special)
        {
            if (special.Name == "HeatEffect.TYPE")
            {
                special.Name        = "heat";
                special.Description = "You are in a temporary state of constant feminine need, and are especially fertile. The only way to quench the intense heat in your snatch is to satiate your lust by finding a mate to make you pregnant.";
                special.Label1      = "Fertility bonus";
                special.Value1      = 10;

                special.Label2 = "Libido bonus";
                special.Value2 = 15;
                special.Label3 = "Hours remaining";
            }
            else if (special.Name == "RutEffect.TYPE")
            {
                special.Name        = "rut";
                special.Description = "You are in an insatiable state of pure, carnal, masculine need. You just feel the urge to f**k pretty much anything and everything in sight. Unfortunately for you, you can't just beat the meat to beat the heat, so no matter how many living or debatably living things you f**k and manage to impregnate, you won't be able to escape this frenzied bout of lust until it passes of its own accord in due time. But then again, since you're reading this, why would you let it go when you can prolong and augment it indefinitely?";
                special.Label1      = "Cum production bonus";
                special.Value1      = 150;

                special.Label2 = "Libido bonus";
                special.Value2 = 5;
                special.Label3 = "Hours remaining";
            }
            else if (special.Name == "VampireThirstEffect.TYPE")
            {
                special.Name        = "Vampire Thirst";
                special.Description = "I don't know how this works, don't f**k with this value";
            }
            else
            {
                //uhhhh, throw?
                throw new Exception("unrecognized typed status effect while parsing!");
            }
            return(special);
        }
Ejemplo n.º 3
0
 protected NamedVector4VM(GameVM game, AmfObject items, XmlNamedVector4 xml)
 {
     _xml   = xml;
     _game  = game;
     _items = items;
 }
Ejemplo n.º 4
0
 public StatusVM(GameVM game, AmfObject allStatuses, XmlNamedVector4 xml)
     : base(game, allStatuses, xml)
 {
 }
Ejemplo n.º 5
0
        static List <XmlNamedVector4> ParseStatusContentSection(string content)
        {
            List <XmlNamedVector4> ret = new List <XmlNamedVector4>();
            Regex regex = new Regex(statusEffectRegExString, RegexOptions.Multiline);
            //Regex regex = new Regex(thing);
            var matches = regex.Matches(content);

            foreach (Match match in matches)
            {
                string status_varname = match.Groups[1].Value;
                string status_name    = match.Groups[2].Value;
                string description    = "";
                if (match.Groups.Count > 3)
                {
                    description = NormalizeXmlString(match.Groups[3].Value);
                }
                XmlNamedVector4 status_effect = new XmlNamedVector4
                {
                    Name = status_name
                };
                if (description != "")
                {
                    // check if the description is actually a set of labels divided by '/' or ';'
                    var labels = description.Split('/');
                    if (labels.Length == 1)
                    {
                        labels = description.Split(';');
                    }
                    if (labels.Length == 1)
                    {
                        status_effect.Description = description;
                    }
                    else
                    {
                        for (int i = 0; i < labels.Length; i++)
                        {
                            //normalize the label name by stripping out "v1", "=", ":", etc. and trimming whitespace
                            string label = labels[i].Replace("v" + (i + 1), "").Replace("=", "").Replace(":", "").Trim();
                            switch (i)
                            {
                            case 0:
                                status_effect.Label1 = label;
                                Console.WriteLine("Label 1:" + label);
                                break;

                            case 1:
                                status_effect.Label2 = label;
                                Console.WriteLine("Label 2:" + label);
                                break;

                            case 2:
                                status_effect.Label3 = label;
                                Console.WriteLine("Label 3:" + label);
                                break;

                            case 3:
                                status_effect.Label4 = label;
                                Console.WriteLine("Label 4:" + label);
                                break;
                            }
                        }
                        // hmm?
                        status_effect.Description = description;
                    }
                }
                ret.Add(status_effect);
            }

            //do the special ones now
            regex   = new Regex(statusEffectTypeRegExString, RegexOptions.Multiline);
            matches = regex.Matches(content);
            foreach (Match match in matches)
            {
                XmlNamedVector4 status_effect = new XmlNamedVector4
                {
                    Name = match.Groups[2].Value
                };
                if (match.Groups.Count > 3 && match.Groups[3].Value != "")
                {
                    status_effect.Description = match.Groups[3].Value;
                }
                ret.Add(HandleSpecialSE(status_effect));
            }
            // Sort them alphabetically
            ret.Sort(Comparer <XmlNamedVector4> .Create((s1, s2) => s1.Name.CompareTo(s2.Name)));
            return(ret);
        }
Ejemplo n.º 6
0
 public PerkVectorVM(GameVM game, AmfObject perksArray, XmlNamedVector4 xml)
     : base(game, perksArray, xml)
 {
 }
Ejemplo n.º 7
0
 public KeyItemVM(GameVM game, AmfObject keyItems, XmlNamedVector4 xml)
     : base(game, keyItems, xml)
 {
 }