コード例 #1
0
 /// <summary> Initialize the helper </summary>
 public void Initialize()
 {
     if (allomancyTree == null)
     {
         // The entity doesn't have any allomantic properties registered, so we add them.
         Entity.WatchedAttributes.SetAttribute("allomancy", allomancyTree = new TreeAttribute());
         allomancyTree.SetAttribute("powers", new TreeAttribute());
         allomancyTree.SetAttribute("metals", new TreeAttribute());
         allomancyTree.SetAttribute("status", new TreeAttribute());
         allomancyTree.SetAttribute("toggle", new TreeAttribute());
         allomancyTree.SetString("selectedMetal", "none");
         allomancyTree.SetFloat("pewterFatigue", 0);
         // Make the entity a random misting.
         string chosenPower = MistModSystem.METALS[RNG.Next(0, MistModSystem.METALS.Length)];
         AllomanticPowers.SetBool(chosenPower, true);
         Entity.WatchedAttributes.MarkPathDirty("allomancy");
         return;
     }
 }