From 0e638cbbd79c2480837ef1997a5ef07d5420dff8 Mon Sep 17 00:00:00 2001 From: SpaceAdmiral Date: Sun, 25 Feb 2024 07:13:35 -0800 Subject: [PATCH 1/3] update: add ship condition events --- models/ShipConditionEvent.json | 60 ++++++++++++++++++++++++++++++++++ reference/SpaceTraders.json | 39 ++++++++++++++++++++-- 2 files changed, 96 insertions(+), 3 deletions(-) create mode 100644 models/ShipConditionEvent.json diff --git a/models/ShipConditionEvent.json b/models/ShipConditionEvent.json new file mode 100644 index 0000000..33f6a53 --- /dev/null +++ b/models/ShipConditionEvent.json @@ -0,0 +1,60 @@ +{ + "type": "object", + "description": "An event that represents damage or wear to a ship's reactor, frame, or engine, reducing the condition of the ship.", + "properties": { + "symbol": { + "type": "string", + "enum": [ + "REACTOR_OVERLOAD", + "ENERGY_SPIKE_FROM_MINERAL", + "SOLAR_FLARE_INTERFERENCE", + "COOLANT_LEAK", + "POWER_DISTRIBUTION_FLUCTUATION", + "MAGNETIC_FIELD_DISRUPTION", + "HULL_MICROMETEORITE_STRIKES", + "STRUCTURAL_STRESS_FRACTURES", + "CORROSIVE_MINERAL_CONTAMINATION", + "THERMAL_EXPANSION_MISMATCH", + "VIBRATION_DAMAGE_FROM_DRILLING", + "ELECTROMAGNETIC_FIELD_INTERFERENCE", + "IMPACT_WITH_EXTRACTED_DEBRIS", + "FUEL_EFFICIENCY_DEGRADATION", + "COOLANT_SYSTEM_AGEING", + "DUST_MICROABRASIONS", + "THRUSTER_NOZZLE_WEAR", + "EXHAUST_PORT_CLOGGING", + "BEARING_LUBRICATION_FADE", + "SENSOR_CALIBRATION_DRIFT", + "HULL_MICROMETEORITE_DAMAGE", + "SPACE_DEBRIS_COLLISION", + "THERMAL_STRESS", + "VIBRATION_OVERLOAD", + "PRESSURE_DIFFERENTIAL_STRESS", + "ELECTROMAGNETIC_SURGE_EFFECTS", + "ATMOSPHERIC_ENTRY_HEAT" + ] + }, + "component": { + "type": "string", + "enum": [ + "FRAME", + "REACTOR", + "ENGINE" + ] + }, + "name": { + "type": "string", + "description": "The name of the event." + }, + "description": { + "type": "string", + "description": "A description of the event." + } + }, + "required": [ + "symbol", + "component", + "name", + "description" + ] +} \ No newline at end of file diff --git a/reference/SpaceTraders.json b/reference/SpaceTraders.json index 0981c70..8cc303e 100644 --- a/reference/SpaceTraders.json +++ b/reference/SpaceTraders.json @@ -2196,12 +2196,23 @@ }, "cargo": { "$ref": "../models/ShipCargo.json" + }, + "events": { + "type": "array", + "items": { + "oneOf": [ + { + "$ref": "../models/ShipConditionEvent.json" + } + ] + } } }, "required": [ "extraction", "cooldown", - "cargo" + "cargo", + "events" ], "type": "object" } @@ -2259,12 +2270,23 @@ }, "cargo": { "$ref": "../models/ShipCargo.json" + }, + "events": { + "type": "array", + "items": { + "oneOf": [ + { + "$ref": "../models/ShipConditionEvent.json" + } + ] + } } }, "required": [ "siphon", "cooldown", - "cargo" + "cargo", + "events" ], "type": "object" } @@ -2573,11 +2595,22 @@ }, "nav": { "$ref": "../models/ShipNav.json" + }, + "events": { + "type": "array", + "items": { + "oneOf": [ + { + "$ref": "../models/ShipConditionEvent.json" + } + ] + } } }, "required": [ "nav", - "fuel" + "fuel", + "events" ], "type": "object" } From 43b9bcff42286b6d91ec225bf05ccec8bd249010 Mon Sep 17 00:00:00 2001 From: SpaceAdmiral Date: Tue, 5 Mar 2024 16:38:14 -0800 Subject: [PATCH 2/3] update: add ship scrap and repair endpoints --- models/RepairTransaction.json | 29 +++++ models/ScrapTransaction.json | 29 +++++ reference/SpaceTraders.json | 210 ++++++++++++++++++++++++++++++++++ 3 files changed, 268 insertions(+) create mode 100644 models/RepairTransaction.json create mode 100644 models/ScrapTransaction.json diff --git a/models/RepairTransaction.json b/models/RepairTransaction.json new file mode 100644 index 0000000..bae8d3a --- /dev/null +++ b/models/RepairTransaction.json @@ -0,0 +1,29 @@ +{ + "type": "object", + "properties": { + "waypointSymbol": { + "$ref": "./WaypointSymbol.json" + }, + "shipSymbol": { + "type": "string", + "description": "The symbol of the ship." + }, + "totalPrice": { + "type": "integer", + "description": "The total price of the transaction.", + "minimum": 0 + }, + "timestamp": { + "type": "string", + "format": "date-time", + "description": "The timestamp of the transaction." + } + }, + "required": [ + "waypointSymbol", + "shipSymbol", + "totalPrice", + "timestamp" + ], + "description": "Result of a repair transaction." +} \ No newline at end of file diff --git a/models/ScrapTransaction.json b/models/ScrapTransaction.json new file mode 100644 index 0000000..e33dd17 --- /dev/null +++ b/models/ScrapTransaction.json @@ -0,0 +1,29 @@ +{ + "type": "object", + "properties": { + "waypointSymbol": { + "$ref": "./WaypointSymbol.json" + }, + "shipSymbol": { + "type": "string", + "description": "The symbol of the ship." + }, + "totalPrice": { + "type": "integer", + "description": "The total price of the transaction.", + "minimum": 0 + }, + "timestamp": { + "type": "string", + "format": "date-time", + "description": "The timestamp of the transaction." + } + }, + "required": [ + "waypointSymbol", + "shipSymbol", + "totalPrice", + "timestamp" + ], + "description": "Result of a scrap transaction." +} \ No newline at end of file diff --git a/reference/SpaceTraders.json b/reference/SpaceTraders.json index 8cc303e..a34c111 100644 --- a/reference/SpaceTraders.json +++ b/reference/SpaceTraders.json @@ -3622,6 +3622,216 @@ "Fleet" ] } + }, + "/my/ships/{shipSymbol}/scrap": { + "parameters": [ + { + "description": "The ship symbol.", + "in": "path", + "name": "shipSymbol", + "required": true, + "schema": { + "type": "string" + } + } + ], + "get": { + "x-preview-feature": true, + "description": "Get the amount of value that will be returned when scrapping a ship.", + "operationId": "get-scrap-ship", + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "description": "", + "properties": { + "data": { + "properties": { + "transaction": { + "$ref": "../models/ScrapTransaction.json" + } + }, + "required": [ + "transaction" + ], + "type": "object" + } + }, + "required": [ + "data" + ], + "type": "object" + } + } + }, + "description": "Successfully retrieved the amount of value that will be returned when scrapping a ship." + } + }, + "security": [ + { + "AgentToken": [] + } + ], + "summary": "Get Scrap Ship", + "tags": [ + "Fleet" + ] + }, + "post": { + "x-preview-feature": true, + "description": "Scrap a ship, removing it from the game and returning a portion of the ship's value to the agent. The ship must be docked in a waypoint that has the `Shipyard` trait in order to use this function. To preview the amount of value that will be returned, use the Get Ship action.", + "operationId": "scrap-ship", + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "description": "", + "properties": { + "data": { + "properties": { + "agent": { + "$ref": "../models/Agent.json" + }, + "transaction": { + "$ref": "../models/ScrapTransaction.json" + } + }, + "required": [ + "agent", + "transaction" + ], + "type": "object" + } + }, + "required": [ + "data" + ], + "type": "object" + } + } + }, + "description": "Ship scrapped successfully." + } + }, + "security": [ + { + "AgentToken": [] + } + ], + "summary": "Scrap Ship", + "tags": [ + "Fleet" + ] + } + }, + "/my/ships/{shipSymbol}/repair": { + "parameters": [ + { + "description": "The ship symbol.", + "in": "path", + "name": "shipSymbol", + "required": true, + "schema": { + "type": "string" + } + } + ], + "get": { + "x-preview-feature": true, + "description": "Get the cost of repairing a ship.", + "operationId": "get-repair-ship", + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "description": "", + "properties": { + "data": { + "properties": { + "transaction": { + "$ref": "../models/RepairTransaction.json" + } + }, + "required": [ + "transaction" + ], + "type": "object" + } + }, + "required": [ + "data" + ], + "type": "object" + } + } + }, + "description": "Successfully retrieved the cost of repairing a ship." + } + }, + "security": [ + { + "AgentToken": [] + } + ], + "summary": "Get Repair Ship", + "tags": [ + "Fleet" + ] + }, + "post": { + "x-preview-feature": true, + "description": "Repair a ship, restoring the ship to maximum condition. The ship must be docked at a waypoint that has the `Shipyard` trait in order to use this function. To preview the cost of repairing the ship, use the Get action.", + "operationId": "repair-ship", + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "description": "", + "properties": { + "data": { + "properties": { + "agent": { + "$ref": "../models/Agent.json" + }, + "ship": { + "$ref": "../models/Ship.json" + }, + "transaction": { + "$ref": "../models/RepairTransaction.json" + } + }, + "required": [ + "agent", + "ship", + "transaction" + ], + "type": "object" + } + }, + "required": [ + "data" + ], + "type": "object" + } + } + }, + "description": "Ship repaired successfully." + } + }, + "security": [ + { + "AgentToken": [] + } + ], + "summary": "Repair Ship", + "tags": [ + "Fleet" + ] + } } } } \ No newline at end of file From fc1a0563e2089a49be400d14ad853d90f8d04191 Mon Sep 17 00:00:00 2001 From: SpaceAdmiral Date: Wed, 6 Mar 2024 16:14:17 -0800 Subject: [PATCH 3/3] update: add integrity to ship components --- models/ShipComponentCondition.json | 7 +++++++ models/ShipComponentIntegrity.json | 7 +++++++ models/ShipCondition.json | 6 ------ models/ShipEngine.json | 7 ++++++- models/ShipFrame.json | 7 ++++++- models/ShipReactor.json | 7 ++++++- 6 files changed, 32 insertions(+), 9 deletions(-) create mode 100644 models/ShipComponentCondition.json create mode 100644 models/ShipComponentIntegrity.json delete mode 100644 models/ShipCondition.json diff --git a/models/ShipComponentCondition.json b/models/ShipComponentCondition.json new file mode 100644 index 0000000..e7bee25 --- /dev/null +++ b/models/ShipComponentCondition.json @@ -0,0 +1,7 @@ +{ + "type": "number", + "format": "double", + "description": "The repairable condition of a component. A value of 0 indicates the component needs significant repairs, while a value of 1 indicates the component is in near perfect condition. As the condition of a component is repaired, the overall integrity of the component decreases.", + "minimum": 0, + "maximum": 1 +} \ No newline at end of file diff --git a/models/ShipComponentIntegrity.json b/models/ShipComponentIntegrity.json new file mode 100644 index 0000000..18f74e3 --- /dev/null +++ b/models/ShipComponentIntegrity.json @@ -0,0 +1,7 @@ +{ + "type": "number", + "format": "double", + "description": "The overall integrity of the component, which determines the performance of the component. A value of 0 indicates that the component is almost completely degraded, while a value of 1 indicates that the component is in near perfect condition. The integrity of the component is non-repairable, and represents permanent wear over time.", + "minimum": 0, + "maximum": 1 +} \ No newline at end of file diff --git a/models/ShipCondition.json b/models/ShipCondition.json deleted file mode 100644 index b1b2c01..0000000 --- a/models/ShipCondition.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "type": "integer", - "description": "Condition is a range of 0 to 100 where 0 is completely worn out and 100 is brand new.", - "minimum": 0, - "maximum": 100 -} \ No newline at end of file diff --git a/models/ShipEngine.json b/models/ShipEngine.json index d48567d..7e80120 100644 --- a/models/ShipEngine.json +++ b/models/ShipEngine.json @@ -21,7 +21,10 @@ "description": "The description of the engine." }, "condition": { - "$ref": "./ShipCondition.json" + "$ref": "./ShipComponentCondition.json" + }, + "integrity": { + "$ref": "./ShipComponentIntegrity.json" }, "speed": { "type": "integer", @@ -35,6 +38,8 @@ "required": [ "symbol", "name", + "condition", + "performance", "description", "speed", "requirements" diff --git a/models/ShipFrame.json b/models/ShipFrame.json index 90bfa3f..226ae45 100644 --- a/models/ShipFrame.json +++ b/models/ShipFrame.json @@ -32,7 +32,10 @@ "description": "Description of the frame." }, "condition": { - "$ref": "./ShipCondition.json" + "$ref": "./ShipComponentCondition.json" + }, + "integrity": { + "$ref": "./ShipComponentIntegrity.json" }, "moduleSlots": { "type": "integer", @@ -56,6 +59,8 @@ "required": [ "symbol", "name", + "condition", + "performance", "description", "moduleSlots", "mountingPoints", diff --git a/models/ShipReactor.json b/models/ShipReactor.json index 4c61e41..1a44847 100644 --- a/models/ShipReactor.json +++ b/models/ShipReactor.json @@ -22,7 +22,10 @@ "description": "Description of the reactor." }, "condition": { - "$ref": "./ShipCondition.json" + "$ref": "./ShipComponentCondition.json" + }, + "integrity": { + "$ref": "./ShipComponentIntegrity.json" }, "powerOutput": { "type": "integer", @@ -36,6 +39,8 @@ "required": [ "symbol", "name", + "condition", + "performance", "description", "powerOutput", "requirements"