Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -185,11 +185,29 @@ void UResources::getDropPod(UObject* WorldContext, FRequestData RequestData, TAr
for (AActor* FoundActor : FoundActors) {
AFGDropPod* DropPod = Cast<AFGDropPod>(FoundActor);
FFGDropPodUnlockCost DropPodCost = DropPod->GetUnlockCost();

TSharedPtr<FJsonObject> JDropPod = CreateBaseJsonObject(FoundActor);

JDropPod->Values.Add("location", MakeShared<FJsonValueObject>(getActorJSON(DropPod)));
JDropPod->Values.Add("Opened", MakeShared<FJsonValueBoolean>(DropPod->HasBeenOpened()));
JDropPod->Values.Add("Looted", MakeShared<FJsonValueBoolean>(DropPod->HasBeenLooted()));

FString CostType{};
switch (DropPodCost.CostType)
{
case EFGDropPodUnlockCostType::None:
JDropPod->Values.Add("CostType", MakeShared<FJsonValueString>(TEXT("None")));
break;
case EFGDropPodUnlockCostType::Item:
JDropPod->Values.Add("CostType", MakeShared<FJsonValueString>(TEXT("Item")));
break;
case EFGDropPodUnlockCostType::Power:
JDropPod->Values.Add("CostType", MakeShared<FJsonValueString>(TEXT("Power")));
break;
default:
JDropPod->Values.Add("CostType", MakeShared<FJsonValueString>(TEXT("Unknown")));
break;
}

JDropPod->Values.Add("RequiredItem", MakeShared<FJsonValueObject>(GetItemValueObject(DropPodCost.ItemCost)));
JDropPod->Values.Add("RequiredPower", MakeShared<FJsonValueNumber>(DropPodCost.PowerConsumption));
JDropPod->Values.Add("features", MakeShared<FJsonValueObject>(getActorFeaturesJSON(DropPod, "Drop Pod", "Drop Pod")));
Expand Down
3 changes: 2 additions & 1 deletion docs/modules/ROOT/pages/json/Read/getDropPod.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ include::../Models/_location.adoc[]

| Opened | Boolean | Is Drop Pod opened?
| Looted | Boolean | Is Drop Pod looted?

| CostType | String | Type of cost required to open the Drop Pod.
// inventory items
| RequiredItem | Object | Required Item to open the Drop Pod.
include::../Models/_inventoryItem.adoc[]
Expand All @@ -45,6 +45,7 @@ include::../Models/_features.adoc[]
},
"Opened": false,
"Looted": false,
"CostType": "Item",
"RequiredItem": {
"Name": "Modular Frame",
"ClassName": "Desc_ModularFrame_C",
Expand Down
Loading