2020-12-22 03:13:43 +00:00
|
|
|
|
/* This Source Code Form is subject to the terms of the Mozilla Public
|
|
|
|
|
|
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
|
|
|
|
|
* file, You can obtain one at https://mozilla.org/MPL/2.0/. */
|
|
|
|
|
|
|
|
|
|
|
|
using System;
|
2020-04-09 07:48:45 +01:00
|
|
|
|
using System.Collections;
|
|
|
|
|
|
using System.Collections.Generic;
|
|
|
|
|
|
using MessagePack;
|
|
|
|
|
|
using Newtonsoft.Json;
|
|
|
|
|
|
using Unity.Mathematics;
|
|
|
|
|
|
using static Unity.Mathematics.math;
|
|
|
|
|
|
|
2020-05-22 22:34:08 +01:00
|
|
|
|
[RethinkTable("Items"), MessagePackObject, JsonObject(MemberSerialization.OptIn)]
|
2020-04-09 07:48:45 +01:00
|
|
|
|
public class BlueprintData : DatabaseEntry, INamedEntry
|
|
|
|
|
|
{
|
|
|
|
|
|
[InspectableField, JsonProperty("name"), Key(1)]
|
|
|
|
|
|
public string Name;
|
|
|
|
|
|
|
2020-04-14 00:42:04 +01:00
|
|
|
|
[InspectableDatabaseLink(typeof(ItemData)), JsonProperty("ingredients"), Key(2)]
|
2020-04-09 07:48:45 +01:00
|
|
|
|
public Dictionary<Guid, int> Ingredients = new Dictionary<Guid, int>();
|
|
|
|
|
|
|
2020-05-22 22:34:08 +01:00
|
|
|
|
[JsonProperty("item"), Key(3)]
|
2020-04-09 07:48:45 +01:00
|
|
|
|
public Guid Item;
|
|
|
|
|
|
|
2020-06-05 04:16:33 +01:00
|
|
|
|
[InspectableField, JsonProperty("productionTime"), Key(4)]
|
2020-04-14 01:20:20 +01:00
|
|
|
|
public float ProductionTime;
|
2020-04-09 07:48:45 +01:00
|
|
|
|
|
2020-06-05 04:16:33 +01:00
|
|
|
|
[InspectableField, JsonProperty("quality"), Key(5)]
|
2020-04-14 00:42:04 +01:00
|
|
|
|
public float Quality;
|
|
|
|
|
|
|
2020-06-05 04:16:33 +01:00
|
|
|
|
[InspectableField, JsonProperty("qualityExponent"), Key(6)]
|
2020-04-30 02:54:31 +01:00
|
|
|
|
public float QualityExponent = 1;
|
|
|
|
|
|
|
2020-06-05 04:16:33 +01:00
|
|
|
|
[InspectableField, JsonProperty("productionExponent"), Key(7)]
|
2020-04-30 02:54:31 +01:00
|
|
|
|
public float ProductionExponent = 1;
|
|
|
|
|
|
|
2020-06-05 04:16:33 +01:00
|
|
|
|
[InspectableField, JsonProperty("randomExponent"), Key(8)]
|
2020-06-08 01:01:33 +01:00
|
|
|
|
public float RandomQualityExponent = 1;
|
2020-04-30 02:54:31 +01:00
|
|
|
|
|
2020-06-08 01:01:33 +01:00
|
|
|
|
[InspectableField, JsonProperty("personalityExponent"), Key(9)]
|
|
|
|
|
|
public float PersonalityExponent = 1;
|
|
|
|
|
|
|
|
|
|
|
|
[InspectableField, JsonProperty("qualityFloor"), Key(10)]
|
2020-04-30 02:54:31 +01:00
|
|
|
|
public float QualityFloor = .25f;
|
|
|
|
|
|
|
2020-06-08 01:01:33 +01:00
|
|
|
|
[InspectableField, JsonProperty("statEffects"), Key(11)]
|
2020-04-09 07:48:45 +01:00
|
|
|
|
public List<BlueprintStatEffect> StatEffects = new List<BlueprintStatEffect>();
|
2020-04-14 00:42:04 +01:00
|
|
|
|
|
2020-06-08 01:01:33 +01:00
|
|
|
|
[InspectableField, JsonProperty("researchTime"), Key(12)]
|
2020-04-14 00:42:04 +01:00
|
|
|
|
public float ResearchTime;
|
|
|
|
|
|
|
2020-06-08 01:01:33 +01:00
|
|
|
|
[InspectableDatabaseLink(typeof(BlueprintData)), JsonProperty("researchDependencies"), Key(13)]
|
2020-04-14 05:32:00 +01:00
|
|
|
|
public List<Guid> Dependencies = new List<Guid>();
|
2020-04-28 01:50:50 +01:00
|
|
|
|
|
2020-06-08 01:01:33 +01:00
|
|
|
|
[InspectableDatabaseLink(typeof(CraftedItemData)), JsonProperty("factoryItem"), Key(14)]
|
2020-04-28 01:50:50 +01:00
|
|
|
|
public Guid FactoryItem;
|
2020-05-03 00:36:47 +01:00
|
|
|
|
|
2020-06-08 01:01:33 +01:00
|
|
|
|
[InspectableDatabaseLink(typeof(SimpleCommodityData)), JsonProperty("resourceRequirements"), Key(15)]
|
2020-05-03 00:36:47 +01:00
|
|
|
|
public Dictionary<Guid, int> ResourceRequirements = new Dictionary<Guid, int>();
|
|
|
|
|
|
|
2020-04-09 07:48:45 +01:00
|
|
|
|
[IgnoreMember] public string EntryName
|
|
|
|
|
|
{
|
|
|
|
|
|
get => Name;
|
|
|
|
|
|
set => Name = value;
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
[InspectableField, MessagePackObject, JsonObject(MemberSerialization.OptIn)]
|
|
|
|
|
|
public class BlueprintStatEffect
|
|
|
|
|
|
{
|
|
|
|
|
|
[InspectableField, JsonProperty("ingredient"), Key(1)]
|
|
|
|
|
|
public Guid Ingredient;
|
|
|
|
|
|
|
2020-05-03 00:36:47 +01:00
|
|
|
|
[InspectableField, JsonProperty("stat"), Key(2)]
|
2020-04-09 07:48:45 +01:00
|
|
|
|
public StatReference StatReference = new StatReference();
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
[InspectableField, MessagePackObject, JsonObject(MemberSerialization.OptIn)]
|
|
|
|
|
|
public class StatReference
|
|
|
|
|
|
{
|
2020-05-06 04:56:36 +01:00
|
|
|
|
[InspectableType(typeof(BehaviorData)), JsonProperty("behavior"), Key(1)]
|
2020-05-12 01:42:13 +01:00
|
|
|
|
public string Target;
|
2020-04-09 07:48:45 +01:00
|
|
|
|
|
2020-05-03 00:36:47 +01:00
|
|
|
|
[InspectableField, JsonProperty("stat"), Key(2)]
|
2020-04-09 07:48:45 +01:00
|
|
|
|
public string Stat;
|
|
|
|
|
|
}
|