コード例 #1
0
        public override void ObjectEnteredCell(LiquidVolume Liquid, XRL.World.GameObject GO)
        {
            if (Liquid.MaxVolume != -1 || !GO.HasPart("Body") || !GO.PhaseAndFlightMatches(Liquid.ParentObject) || Liquid.Volume > 1000)
            {
                return;
            }
            int num = 10 + (int)((double)(Liquid.ComponentLiquids[this.ID] * 5) / 1000.0);

            if (!GO.MakeSave("Agility", num, null, null, "Dye"))
            {
                if (GO.IsPlayer())
                {
                    MessageQueue.AddPlayerMessage("&CYou get covered in " + ColorNames[this.Color] + " dye!");
                }
                GO.pRender.TileColor   = "&" + this.Color;
                GO.pRender.ColorString = "&" + this.Color;
                GO.pRender.DetailColor = ToggleCase(this.Color);
            }
        }
コード例 #2
0
 public static bool Prefix(TradeUI __instance, XRL.World.GameObject Trader)
 {
     Debug.Log("Running Trade Patch to check willingness!");
     if (Trader.HasPart("DynamicPersonality"))
     {
         DynamicPersonality personality = Trader.GetPart <DynamicPersonality>();
         if (personality.WillingToTrade)
         {
             Debug.Log("Is willing to trade!");
             return(true);
         }
         else
         {
             Debug.Log("Is NOT willing to trade!");
             Popup.ShowFail(Trader.The + Trader.ShortDisplayName + " does not like you well enough to trade.");
             return(false);
         }
     }
     else
     {
         Debug.LogError($"CheckTradeWillingnessPatch run on gameobject {Trader.DebugName} which has no DynamicPersonality part");
         return(true);
     }
 }
コード例 #3
0
 public override void ObjectEnteredCell(LiquidVolume Liquid, XRL.World.GameObject GO)
 {
     if (Liquid.MaxVolume == -1 && GO.PhaseAndFlightMatches(Liquid.ParentObject) && GO.GetIntProperty("Slimewalking") <= 0 && GO.HasPart("Body"))
     {
         int difficulty = 10 + (int)((double)(Liquid.ComponentLiquids[2] * 5) / 1000.0);
         if (!GO.MakeSave("Strength,Agility", difficulty, null, null, "Furling Agent Restraint"))
         {
             GO.ApplyEffect(new cloneStuck(12, Liquid.ComponentLiquids[2] / 100, null));
         }
     }
 }