#pragma once #include "CoreMinimal.h" #include "GameFramework/Actor.h" #include "Player/DescentInteraction.h" #include "Vehicles/CarrierLayout.h" #include "DescentFixture.generated.h" class ADescentCarrier; class UProceduralMeshComponent; /** * A fixed station of the carrier (DESIGN_UE.md section 3.4): helm, chart table, beds, nutrient ports, vat, packer, storage wall, * Tethys terminal, carousel console, pool ladder. Not placeable. The actor is attached to the carrier, owns the blockout visual and * collision of the station (built from FCarrierLayout's anchor, so real models replace it later) and is an IDescentInteractable. * A station that is not built yet shows its prompt and answers E with a toast naming the milestone that gives it its function; * the carousel console and the pool ladder work since M3. */ UCLASS(Abstract) class THEDESCENT_API ADescentFixture : public AActor, public IDescentInteractable { GENERATED_BODY() public: ADescentFixture(); /** Spawns the fixture class for the anchor's kind, attached to the carrier. */ static ADescentFixture* SpawnFor(ADescentCarrier* Carrier, const Descent::Carrier::FAnchorDef& Anchor); virtual void BeginPlay() override; virtual void EndPlay(const EEndPlayReason::Type Reason) override; const Descent::Carrier::FAnchorDef& GetAnchor() const { return Anchor; } /** The milestone that gives the station its function. */ virtual const TCHAR* MilestoneNote() const { return TEXT("a later milestone"); } // IDescentInteractable virtual FString GetPrompt() const override { return Anchor.Prompt; } virtual FVector GetFocusPointUU() const override; virtual double GetRangeM() const override { return Anchor.RangeM; } virtual double GetMinDot() const override { return Anchor.MinDot; } virtual void Use(ADescentCharacter* User) override; UPROPERTY(VisibleAnywhere) TObjectPtr Visual; protected: Descent::Carrier::FAnchorDef Anchor; }; UCLASS() class THEDESCENT_API AFixtureHelm : public ADescentFixture { GENERATED_BODY() public: virtual const TCHAR* MilestoneNote() const override { return TEXT("milestone 6 (pilot the carrier)"); } virtual void Use(ADescentCharacter* User) override; }; UCLASS() class THEDESCENT_API AFixtureChartTable : public ADescentFixture { GENERATED_BODY() public: virtual const TCHAR* MilestoneNote() const override { return TEXT("milestone 9 (survey map)"); } }; UCLASS() class THEDESCENT_API AFixtureBed : public ADescentFixture { GENERATED_BODY() public: virtual const TCHAR* MilestoneNote() const override { return TEXT("milestone 8 (sleep)"); } virtual void Use(ADescentCharacter* User) override; }; UCLASS() class THEDESCENT_API AFixtureNutrientPort : public ADescentFixture { GENERATED_BODY() public: virtual const TCHAR* MilestoneNote() const override { return TEXT("milestone 8 (jack-in feed)"); } virtual void Use(ADescentCharacter* User) override; }; UCLASS() class THEDESCENT_API AFixtureVat : public ADescentFixture { GENERATED_BODY() public: virtual const TCHAR* MilestoneNote() const override { return TEXT("milestone 8 (biomass reserve)"); } virtual FString GetPrompt() const override; virtual void Use(ADescentCharacter* User) override; }; UCLASS() class THEDESCENT_API AFixturePacker : public ADescentFixture { GENERATED_BODY() public: virtual const TCHAR* MilestoneNote() const override { return TEXT("milestone 5 (ore boxes)"); } virtual void Use(ADescentCharacter* User) override; }; UCLASS() class THEDESCENT_API AFixtureStorage : public ADescentFixture { GENERATED_BODY() public: virtual const TCHAR* MilestoneNote() const override { return TEXT("milestone 5 (storage)"); } virtual void Use(ADescentCharacter* User) override; }; UCLASS() class THEDESCENT_API AFixtureTerminal : public ADescentFixture { GENERATED_BODY() public: virtual const TCHAR* MilestoneNote() const override { return TEXT("milestone 5 (selling)"); } virtual void Use(ADescentCharacter* User) override; }; UCLASS() class THEDESCENT_API AFixtureCarouselConsole : public ADescentFixture { GENERATED_BODY() public: virtual const TCHAR* MilestoneNote() const override { return TEXT("milestone 3 (carousel)"); } /** E: rotates the next Tender to the launch cradle (refused with a toast while a Tender is out or the hoist moves). */ virtual void Use(ADescentCharacter* User) override; }; UCLASS() class THEDESCENT_API AFixtureLadder : public ADescentFixture { GENERATED_BODY() public: virtual const TCHAR* MilestoneNote() const override { return TEXT("milestone 3 (swimming)"); } /** E: drops the player into the moon pool. */ virtual void Use(ADescentCharacter* User) override; };