private static Entity SlotHolsterForWeapon(Entity mech, BodyPartLocation location, Entity weapon) { Entity holster; switch (weapon.GetComponentOfType <Component_Attachable>().SizeRequired) { case AttachmentSize.SMALL: holster = BlueprintListing.BuildForLabel(Blueprints.SMALL_HOLSTER); break; case AttachmentSize.MEDIUM: holster = BlueprintListing.BuildForLabel(Blueprints.MEDIUM_HOLSTER); break; case AttachmentSize.LARGE: holster = BlueprintListing.BuildForLabel(Blueprints.LARGE_HOLSTER); break; default: throw new ArgumentException("BuildHolsterForWeapon can't handle size: not SMALL, MEDIUM, LARGE"); } SlotAt(mech, location, holster); holster.HandleEvent(new GameEvent_Slot(mech, holster, weapon)); return(holster); }
public static Entity BuildNakedMech(string label, bool player, Guidebook book) { var mech = new Entity(label: label, typeLabel: MechTypeLabel) .AddComponent(new Component_Buffable()) .AddComponent(new Component_ActionExecutor(Config.DefaultEntityAP)) .AddComponent(new Component_Skeleton()); if (player) { mech.AddComponent(new Component_Player()); mech.AddComponent(new Component_FocusUser()); } else if (book != null) { mech.AddComponent(new Component_AI(book)); } else { throw new InvalidOperationException("book can't be null!"); } SlotAt(mech, BodyPartLocation.LEFT_ARM, BlueprintListing.BuildForLabel(Blueprints.HAND)); SlotAt(mech, BodyPartLocation.RIGHT_ARM, BlueprintListing.BuildForLabel(Blueprints.HAND)); // Slot in all the required components return(mech); }
private static Entity BuildMountForWeapon(Entity mech, BodyPartLocation location, Entity weapon) { Entity mount; switch (weapon.GetComponentOfType <Component_Attachable>().SizeRequired) { case AttachmentSize.SMALL: mount = BlueprintListing.BuildForLabel(Blueprints.SMALL_MOUNT); break; case AttachmentSize.MEDIUM: mount = BlueprintListing.BuildForLabel(Blueprints.MEDIUM_MOUNT); break; case AttachmentSize.LARGE: mount = BlueprintListing.BuildForLabel(Blueprints.LARGE_MOUNT); break; default: throw new ArgumentException("BuildMountForWeapon can't handle size: not SMALL, MEDIUM, LARGE"); } SlotAt(mech, location, mount); mount.HandleEvent(new GameEvent_Slot(mech, mount, weapon)); return(mount); }
public static Entity BuildArmorPart() { return(BlueprintListing.BuildForLabel(Blueprints.ARMOR)); }