40 List<Loot> list =
new();
41 foreach (
string value
in lootVd.Values) {
44 list.Sort((l1, l2) => l1.Value - l2.Value);
48 public virtual void Update(
float dt) {
55 List<BlockDropValue> blockDropValues = [];
59 for (
int i = 0; i < num2; i++) {
67 loader.DecideLoot(
this, blockDropValues);
71 Vector3 position = (m_componentCreature.ComponentBody.BoundingBox.Min +
m_componentCreature.ComponentBody.BoundingBox.Max) / 2f;
82 m_lootDropped = valuesDictionary.GetValue<
bool>(
"LootDropped");
92 string[] array = lootString.Split([
";"], StringSplitOptions.None);
93 if (array.Length >= 3) {
96 Loot result =
default;
98 result.MinCount =
int.Parse(array[1]);
99 result.MaxCount =
int.Parse(array[2]);
100 result.Probability = array.Length >= 4 ?
float.Parse(array[3]) : 1f;
107 throw new InvalidOperationException(
"Invalid loot string.");
ComponentCreature m_componentCreature
override void Save(ValuesDictionary valuesDictionary, EntityToIdMap entityToIdMap)
SubsystemGameInfo m_subsystemGameInfo
static Loot ParseLoot(string lootString)
override void Load(ValuesDictionary valuesDictionary, IdToEntityMap idToEntityMap)
virtual void Update(float dt)
static List< Loot > ParseLootList(ValuesDictionary lootVd)
SubsystemPickables m_subsystemPickables
List< Loot > m_lootOnFireList
static int DecodeResult(string result)
ValuesDictionary ValuesDictionary
static void HookAction(string HookName, Func< ModLoader, bool > action)
执行Hook
ValuesDictionary ValuesDictionaryForMods
模组如果需要添加或使用额外信息,可以在这个ValuesDictionary读写元素