public Gnome(Character gnome, SkillDef[] skillDefinitions) { ID = gnome.ID; Name = gnome.Name(); Location = new Location(gnome.Position); Stats = new GnomeStats(gnome); Profession = new GnomeProfession(gnome.Mind.Profession); BodyParts = GnomeBodyPartStatus.GetBodyStatus(gnome); LaborSkills = GnomeSkill.GetGnomeSkills(GnomeSkill.GnomeSkillType.Labor, skillDefinitions, gnome); CombatSkills = GnomeSkill.GetGnomeSkills(GnomeSkill.GnomeSkillType.Combat, skillDefinitions, gnome); }
public GnomeRow(Character character) : base(character) { Name = character.Name(); Profession = character.Mind.Profession; Mining = character.SkillLevel(CharacterSkillType.Mining.ToString()); Masonry = character.SkillLevel(CharacterSkillType.Masonry.ToString()); Stonecarving = character.SkillLevel(CharacterSkillType.Stonecarving.ToString()); WoodCutting = character.SkillLevel(CharacterSkillType.Woodcutting.ToString()); Carpentry = character.SkillLevel(CharacterSkillType.Carpentry.ToString()); Woodcarving = character.SkillLevel(CharacterSkillType.Woodcarving.ToString()); Smelting = character.SkillLevel(CharacterSkillType.Smelting.ToString()); Blacksmithing = character.SkillLevel(CharacterSkillType.Blacksmithing.ToString()); Metalworking = character.SkillLevel(CharacterSkillType.Metalworking.ToString()); WeaponCrafting = character.SkillLevel(CharacterSkillType.WeaponCrafting.ToString()); ArmorCrafting = character.SkillLevel(CharacterSkillType.ArmorCrafting.ToString()); Gemcutting = character.SkillLevel(CharacterSkillType.Gemcutting.ToString()); JewelryMaking = character.SkillLevel(CharacterSkillType.JewelryMaking.ToString()); Weaving = character.SkillLevel(CharacterSkillType.Weaving.ToString()); Tailoring = character.SkillLevel(CharacterSkillType.Tailoring.ToString()); Pottery = character.SkillLevel(CharacterSkillType.Pottery.ToString()); Leatherworking = character.SkillLevel(CharacterSkillType.Leatherworking.ToString()); Bonecarving = character.SkillLevel(CharacterSkillType.Bonecarving.ToString()); Prospecting = character.SkillLevel(CharacterSkillType.Prospecting.ToString()); Tinkering = character.SkillLevel(CharacterSkillType.Tinkering.ToString()); Machining = character.SkillLevel(CharacterSkillType.Machining.ToString()); Engineering = character.SkillLevel(CharacterSkillType.Engineering.ToString()); Mechanic = character.SkillLevel(CharacterSkillType.Mechanic.ToString()); AnimalHusbandry = character.SkillLevel(CharacterSkillType.AnimalHusbandry.ToString()); Butchery = character.SkillLevel(CharacterSkillType.Butchery.ToString()); Horticulture = character.SkillLevel(CharacterSkillType.Horticulture.ToString()); Farming = character.SkillLevel(CharacterSkillType.Farming.ToString()); Cooking = character.SkillLevel(CharacterSkillType.Cooking.ToString()); Brewing = character.SkillLevel(CharacterSkillType.Brewing.ToString()); Medic = character.SkillLevel(CharacterSkillType.Medic.ToString()); Caretaking = character.SkillLevel(CharacterSkillType.Caretaking.ToString()); Construction = character.SkillLevel(CharacterSkillType.Construction.ToString()); Hauling = character.SkillLevel(CharacterSkillType.Hauling.ToString()); }
public IResponseFormatter Add() { var skillDefinitions = GnomanEmpire.Instance.GetSkillDefs(); var faction = GnomanEmpire.Instance.World.AIDirector.PlayerFaction; var entryPosition = faction.FindRegionEntryPosition(); var gnomadRaceClassDefs = faction.FactionDef.Squads.SelectMany(squad => squad.Classes.Where(squadClass => squadClass.Name == "Gnomad")).ToList(); Int32 defCount = gnomadRaceClassDefs.Count; Int32 raceClassDefIndex = GnomanEmpire.Instance.Rand.Next(defCount); var raceClassDef = gnomadRaceClassDefs[raceClassDefIndex]; var gnomad = new Character(entryPosition, raceClassDef, faction.ID); gnomad.SetBehavior(BehaviorType.PlayerCharacter); Dictionary<String, Int32> orderedProfessions = GetBestProfessions(gnomad); var bestProfession = orderedProfessions.OrderByDescending(obj => obj.Value).First().Key; SetProfession(gnomad, bestProfession); GnomanEmpire.Instance.EntityManager.SpawnEntityImmediate(gnomad); GnomanEmpire.Instance.World.NotificationManager.AddNotification(String.Format("The Gnomad {0} has arrived and been assigned as a {1}", gnomad.Name(), bestProfession)); Gnome gnome = new Gnome(gnomad, skillDefinitions); return JsonResponse(gnome); }
public Gnome(Character gnome, int level, int row, int column, int mapCellPosition, int realIndex) { this.name = gnome.Name(); this.id = realIndex; this.level = level; this.row = row; this.column = column; this.position = mapCellPosition; this.profession = gnome.Mind.Profession; this.mining = gnome.SkillLevel(CharacterSkillType.Mining); foreach (var skill in SkillDef.AllLaborSkills()) this.laborSkills.Add(new SkillEntry(skill, gnome.SkillLevel(skill), gnome.Mind.IsSkillAllowed(skill))); foreach (var skill in SkillDef.AllCombatSkills()) this.combatSkills.Add(new SkillEntry(skill, gnome.SkillLevel(skill), gnome.Mind.IsSkillAllowed(skill))); foreach (var attribute in Enum.GetValues(typeof(CharacterAttributeType))) this.attributes.Add(new AttributeEntry((CharacterAttributeType)attribute, gnome.AttributeLevel((CharacterAttributeType)attribute))); }