public void AddComponent(Entity entity, DataEntry data) { var equipment = entity.Add(new Equipment(data.TryGetValue(DatabaseFields.EquipmentSlot, _defaultEquipmentSlot.Value))); StatExtensions.AddStatList(entity, data.Get <DataList>(DatabaseFields.Stats), equipment); if (entity.Stats.HasStat(Stats.Weight)) { equipment.AddStat(Stats.Weight); } }
public static Entity GetBasicCharacterEntity(int faction) { var entity = Entity.New("Character"); var stats = entity.Add(new StatsContainer()); StatExtensions.SetupVitalStats(stats); StatExtensions.SetupBasicCharacterStats(stats); StatExtensions.SetupDefenseStats(stats); entity.Add(new LabelComponent("")); entity.Add(new StatusContainer()); entity.Add(new StatusUpdateComponent()); entity.Add(new DamageComponent()); entity.Add(new GridPosition()); entity.Add(new CommandTarget()); entity.Add(new FactionComponent(faction)); entity.Add(new PronounComponent(PlayerPronouns.They)); return(entity); }
public static Entity GetBasicCharacterEntity(int faction) { var entity = Entity.New("Character"); StatExtensions.SetupVitalStats(entity); StatExtensions.SetupBasicCharacterStats(entity); StatExtensions.SetupDefenseStats(entity); entity.Add(new LabelComponent("")); entity.Add(new DeathStatus()); entity.Add(new ModifiersContainer(null)); entity.Add(new StatusContainer()); entity.Add(new StatusUpdateComponent()); entity.Add(new GridPosition()); entity.Add(new PositionComponent()); entity.Add(new RotationComponent()); entity.Add(new EquipmentSlots(null)); entity.Add(new CommandsContainer(null)); entity.Add(new CommandTarget()); entity.Add(new FactionComponent(faction)); entity.Add(new PronounComponent(PlayerPronouns.They)); return(entity); }