Esempio n. 1
0
        public NPCDefinition()
        {
            name        = new FantasyName();
            gender      = Gender.None;
            species     = Species.None;
            size        = BodySize.None;
            faction     = Faction.None;
            key         = "";
            model       = "";
            minLevel    = 0;
            maxLevel    = 0;
            expPerLevel = 0;

            baseStart    = new List <int>();
            BasePerLevel = new List <GameValue>();

            derivedPerLevel = new List <GameValue>();

            skillStart    = new List <int>();
            skillPerLevel = new List <GameValue>();

            baseResistances    = new List <int>();
            resistancePerLevel = new List <GameValue>();

            abilities = new List <Ability>();
            inventory = new CharacterInventory();
        }
Esempio n. 2
0
        public static string Generate(int prefix_chance, FantasyName name, Gender gender, string race)
        {
            string prefix = "";

            if (Random.Range(0, 100) < prefix_chance)
            {
                prefix = NamePrefix[Random.Range(0, NamePrefix.Length)];
            }

            return(prefix);
        }
Esempio n. 3
0
        public static string Generate(int postfix_chance, FantasyName name, Gender gender, string profession)
        {
            string postfix = "";

            if (Random.Range(0, 100) < postfix_chance)
            {
                postfix = NamePostfix[Random.Range(0, NamePostfix.Length)];
            }

            return(postfix);
        }
Esempio n. 4
0
        public static FantasyName Get(Gender gender, string race, string profession)
        {
            FantasyName name = new FantasyName();

            name.FirstName = FirstName.Generate(name, race);
            name.LastName  = LastName.Generate(name, profession);
            name.Title     = PrefixName.Generate(50, name, gender, race);
            name.Postfix   = PostfixName.Generate(50, name, gender, race);
            name.Land      = LandName.Generate(name, race);

            return(name);
        }
Esempio n. 5
0
        public PcData()
        {
            wealth        = 0;
            upkeep        = new UpkeepData();
            name          = new FantasyName();
            gender        = Gender.None;
            background    = null;
            status        = PcStatus.Idle;
            faction       = Faction.Player;
            raceKey       = "";
            professionKey = "";
            description   = "";

            listIndex      = -1;
            partyIndex     = -1;
            hair           = "Hair 01";
            beard          = "";
            maxAccessories = 1;

            level      = 0;
            experience = 0;
            expToLevel = 0;
            maxExp     = 0;
            expBonus   = 0;

            attributes = new AttributeManager();

            for (int i = 0; i < (int)BaseAttribute.Number; i++)
            {
                attributes.AddAttribute(AttributeListType.Base, new Attribute(AttributeType.Base, i, 1));
            }

            for (int i = 0; i < (int)DerivedAttribute.Number; i++)
            {
                attributes.AddAttribute(AttributeListType.Derived, new Attribute(AttributeType.Derived, i, 0));
            }

            for (int i = 0; i < (int)DamageType.Number; i++)
            {
                attributes.AddAttribute(AttributeListType.Resistance, new Attribute(AttributeType.Resistance, i, 0));
            }

            for (int i = 0; i < (int)Skill.Number; i++)
            {
                attributes.SetSkill(new Attribute(AttributeType.Skill, i, 0));
            }

            abilities = new CharacterAbilities();
            inventory = new CharacterInventory();
        }
Esempio n. 6
0
        public PcData(FantasyName name, Gender gender, int level, string raceKey, string professionKey, string hair, string beard, int listIndex, int partyIndex,
                      int power_slots, int spell_slots)
        {
            wealth = 0;
            upkeep = new UpkeepData();

            this.name          = name;
            this.gender        = gender;
            this.raceKey       = raceKey;
            this.professionKey = professionKey;
            this.listIndex     = listIndex;
            this.partyIndex    = partyIndex;

            this.hair  = hair;
            this.beard = beard;

            maxAccessories = Random.Range(1, 4);

            level      = 0;
            experience = 0;
            expToLevel = 0;
            maxExp     = 0;
            expBonus   = 0.0f;

            attributes = new AttributeManager();

            for (int i = 0; i < (int)BaseAttribute.Number; i++)
            {
                attributes.AddAttribute(AttributeListType.Base, new Attribute(AttributeType.Base, i, 1));
            }

            for (int i = 0; i < (int)DerivedAttribute.Number; i++)
            {
                attributes.AddAttribute(AttributeListType.Derived, new Attribute(AttributeType.Derived, i, 0));
            }

            for (int i = 0; i < (int)DamageType.Number; i++)
            {
                attributes.AddAttribute(AttributeListType.Resistance, new Attribute(AttributeType.Resistance, i, 0));
            }

            for (int i = 0; i < (int)Skill.Number; i++)
            {
                attributes.SetSkill(new Attribute(AttributeType.Skill, i, 0));
            }

            abilities = new CharacterAbilities(this, power_slots, spell_slots);
            inventory = new CharacterInventory();
            faction   = Faction.Player;
        }
Esempio n. 7
0
        public static string Generate(FantasyName name, string profession)
        {
            string lastName = "";

            if (Random.Range(0, 100) < 50)
            {
                lastName = LastNamesPart1[Random.Range(0, LastNamesPart1.Length)] + LastNamesPart2[Random.Range(0, LastNamesPart2.Length)];
            }
            else
            {
                lastName = LastNamesPart1[Random.Range(0, LastNamesPart1.Length)] + LastNamesPart2[Random.Range(0, LastNamesPart2.Length)];
            }

            return(lastName);
        }
Esempio n. 8
0
        public static string Generate(FantasyName name, string race)
        {
            string firstName = "";

            if (Random.Range(0, 100) < 50)
            {
                firstName = FirstNames[Random.Range(0, FirstNames.Length)];
            }
            else
            {
                firstName = FirstNamesPart1[Random.Range(0, FirstNamesPart1.Length)] + FirstNamesPart2[Random.Range(0, FirstNamesPart2.Length)];
            }

            return(firstName);
        }
Esempio n. 9
0
        public NPCDefinition(FantasyName name, Species species, BodySize size, Gender gender, string key, string model, Faction faction,
                             int minLevel, int maxLevel, int expPerLevel)
        {
            this.name        = name;
            this.species     = species;
            this.size        = size;
            this.gender      = gender;
            this.key         = key;
            this.model       = model;
            this.faction     = faction;
            this.minLevel    = minLevel;
            this.maxLevel    = maxLevel;
            this.expPerLevel = expPerLevel;

            baseStart    = new List <int>();
            BasePerLevel = new List <GameValue>();
            for (int i = 0; i < (int)BaseAttribute.Number; i++)
            {
                baseStart.Add(0);
                BasePerLevel.Add(new GameValue());
            }

            derivedPerLevel = new List <GameValue>();
            for (int i = 0; i < (int)DerivedAttribute.Number; i++)
            {
                derivedPerLevel.Add(new GameValue());
            }

            skillStart    = new List <int>();
            skillPerLevel = new List <GameValue>();
            for (int i = 0; i < (int)Skill.Number; i++)
            {
                skillStart.Add(0);
                skillPerLevel.Add(new GameValue());
            }

            baseResistances    = new List <int>();
            resistancePerLevel = new List <GameValue>();
            for (int i = 0; i < (int)DamageType.Number; i++)
            {
                baseResistances.Add(0);
                resistancePerLevel.Add(new GameValue());
            }

            abilities = new List <Ability>();
            inventory = new CharacterInventory();
        }
Esempio n. 10
0
        public static string Generate(FantasyName name, string race)
        {
            string landName = "";

            int weight = GetWeight();

            if (weight < 33)
            {
                landName = "of " + GetRandomElement(LandsPart1) + " " + GetRandomElement(LandsPart2);
            }

            if (weight < 66)
            {
                landName = "of " + GetRandomElement(LandsPartA) + GetRandomElement(LandsPartB);
            }

            landName = "of " + GetRandomElement(LandsPartA) + GetRandomElement(LandsPartB) + " " + GetRandomElement(LandsPart2);

            return(landName);
        }
Esempio n. 11
0
        public Expression <Func <Company, bool> >[] GetSearchExpressions()
        {
            List <Expression <Func <Company, bool> > > expressions = new List <Expression <Func <Company, bool> > >();

            if (!string.IsNullOrEmpty(CNPJ))
            {
                expressions.Add(x => x.CNPJ.ToLower().Contains(CNPJ.ToLower()));
            }

            if (!string.IsNullOrEmpty(FantasyName))
            {
                expressions.Add(x => x.FantasyName.ToLower().Contains(FantasyName.ToLower()));
            }

            if (!string.IsNullOrEmpty(CompanyName))
            {
                expressions.Add(x => x.CompanyName.ToLower().Contains(CompanyName.ToLower()));
            }

            return(expressions.ToArray());
        }
Esempio n. 12
0
        public void Normalize()
        {
            if (!String.IsNullOrEmpty(Cnpj))
            {
                Cnpj = new String(Cnpj.Where(Char.IsDigit).ToArray());
            }

            if (!String.IsNullOrEmpty(Name))
            {
                Name = Name.ToUpper();
            }

            if (!String.IsNullOrEmpty(FantasyName))
            {
                Name = FantasyName.ToUpper();
            }

            if (String.IsNullOrEmpty(FantasyName))
            {
                FantasyName = Name;
            }
        }
Esempio n. 13
0
        public async Task <Model.Services.Common.Result> ListByName([FromBody] FantasyName fantasyName)
        {
            try
            {
                Model.Services.Common.Result result = new Model.Services.Common.Result();

                result.Data = await _companyService.ListByName(fantasyName);

                result.Success       = true;
                result.ResultMessage = "Empresas listadas com sucesso";

                return(result);
            }
            catch (Exception ex)
            {
                return(new Model.Services.Common.Result()
                {
                    Success = false,
                    ResultMessage = $"Ocorreu um erro durante a operação, Descricao: {ex.Message}"
                });
            }
        }
Esempio n. 14
0
        public Task <CompanyRequest> ListByName(FantasyName FantasyName)
        {
            var empresa = _emprRepository.ListByFantasyName(
                new Empresa()
            {
                FantasyName = FantasyName.fantasyName
            }
                );

            var taxas = _taxRepository.ListByCompany(
                new Tax()
            {
                IdCompany = Convert.ToInt32(empresa.id)
            }
                );

            CompanyRequest request = new CompanyRequest()
            {
                Empresa = empresa,
                Taxas   = taxas
            };

            return(Task.FromResult(request));
        }