From ced3d03bdb3ce866d832e03fb212865140905a9a Mon Sep 17 00:00:00 2001 From: Thomas Leyh Date: Sun, 24 Jul 2016 08:14:18 +0200 Subject: Add project files. --- V3/Objects/KingsGuard.cs | 62 ++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 62 insertions(+) create mode 100644 V3/Objects/KingsGuard.cs (limited to 'V3/Objects/KingsGuard.cs') diff --git a/V3/Objects/KingsGuard.cs b/V3/Objects/KingsGuard.cs new file mode 100644 index 0000000..a0f3bc5 --- /dev/null +++ b/V3/Objects/KingsGuard.cs @@ -0,0 +1,62 @@ +using System; +using Microsoft.Xna.Framework.Content; +using V3.Data; +using V3.Map; +using V3.Objects.Movement; +using V3.Objects.Sprite; + +namespace V3.Objects +{ + public sealed class KingsGuard : AbstractCreature + { + public override string Name { get; protected set; } = "Königliche Garde"; + public override int Life { get; protected set; } = 200; + public override int MaxLife { get; protected set; } = 200; + public override int Speed { get; } = 7; + public override int Attack { get; protected set; } = 25; + public override int AttackRadius { get; protected set; } = 48; + public override int SightRadius { get; protected set; } = 200; + public override TimeSpan TotalRecovery { get; } = TimeSpan.FromSeconds(0.5); + public override TimeSpan Recovery { get; set; } + protected override ISpriteCreature[] Sprite { get; } = { new PlateSprite(), new HeadPlateSprite(), new LongswordSprite(), new ShieldSprite() }; + protected override IMovable MovementScheme { get; } = new PlayerMovement(); + protected override CreatureType Type { get; } = CreatureType.KingsGuard; + public override Faction Faction { get; } = Faction.Kingdom; + public override ICreature IsAttacking { get; set; } + public override IBuilding IsAttackingBuilding { get; set; } + + public KingsGuard(ContentManager contentManager, + Pathfinder pathfinder, IOptionsManager optionsManager, AchievementsAndStatistics achievementsAndStatistics) + : base(contentManager, pathfinder, optionsManager,achievementsAndStatistics) + { + } + + public void MakeFemale() + { + ChangeEquipment(EquipmentType.Body, new PlateFemaleSprite()); + ChangeEquipment(EquipmentType.Head, new HeadPlateFemaleSprite()); + ChangeEquipment(EquipmentType.Weapon, new LongswordFemaleSprite()); + ChangeEquipment(EquipmentType.Offhand, new ShieldFemaleSprite()); + } + + public void RemoveArmor() + { + if (Sprite[(int)EquipmentType.Body] is PlateSprite) + { + ChangeEquipment(EquipmentType.Body, new NudeSprite()); + } + else if (Sprite[(int)EquipmentType.Body] is PlateFemaleSprite) + { + ChangeEquipment(EquipmentType.Body, new NudeFemaleSprite()); + } + else if (Sprite[(int)EquipmentType.Body] is NudeSprite) + { + ChangeEquipment(EquipmentType.Body, new PlateSprite()); + } + else if (Sprite[(int)EquipmentType.Body] is NudeFemaleSprite) + { + ChangeEquipment(EquipmentType.Body, new PlateFemaleSprite()); + } + } + } +} -- cgit v1.2.1