Example #1
0
 public void EvolveSludge()
 {
     if (this.newLiquid != (byte)99)
     {
         Mutations part1 = this.ParentObject.GetPart("Mutations") as Mutations;
         if (!part1.HasMutation("LiquidSpitter"))
         {
             part1.AddMutation((BaseMutation) new LiquidSpitter(LiquidVolume.ComponentLiquidTypes[this.newLiquid].GetName((LiquidVolume)null).Substring(2)), 1);
         }
         LiquidSpitter mutation = part1.GetMutation("LiquidSpitter") as LiquidSpitter;
         mutation.extraLiquids.Add(this.newLiquid);
         if (mutation.extraLiquids.Count == 1 && this.newLiquid == (byte)18)
         {
             mutation.extraLiquids.Add((byte)0);
         }
         this.ComponentLiquids.Add(this.newLiquid);
         string displayName = this.ParentObject.DisplayName;
         this.ParentObject.DisplayName = string.Empty;
         foreach (byte componentLiquid in this.ComponentLiquids)
         {
             GameObject parentObject = this.ParentObject;
             parentObject.DisplayName = parentObject.DisplayName + LiquidVolume.ComponentLiquidTypes[componentLiquid].GetAdjective((LiquidVolume)null) + "&y ";
         }
         GameObject parentObject1 = this.ParentObject;
         parentObject1.DisplayName = parentObject1.DisplayName + Evolution.GetPrefix(this.ComponentLiquids.Count) + "sludge";
         if (this.ComponentLiquids.Count >= 5)
         {
             JournalAPI.AddAccomplishment("You witnessed the rare formation of " + Grammar.A(Evolution.GetPrefix(this.ComponentLiquids.Count) + "sludge", false) + ".", "general", (string)null, -1L);
         }
         MessageQueue.AddPlayerMessage("The " + LiquidVolume.ComponentLiquidTypes[this.newLiquid].GetName((LiquidVolume)null) + " &ycatalyzes " + this.ParentObject.the + displayName + " into " + this.ParentObject.a + this.ParentObject.DisplayName + ".");
         bool flag  = false;
         Body part2 = this.ParentObject.GetPart <Body>();
         foreach (BodyPart bodyPart in part2.GetPart("Hand"))
         {
             if (bodyPart.Equipped == null)
             {
                 flag = true;
                 break;
             }
         }
         if (!flag)
         {
             this.totalHands += 2;
             BodyPart body        = part2.GetBody();
             BodyPart InsertAfter = body.AddPartAt("Pseudopod", 0, (string)null, (string)null, (string)null, (string)null, new int?(), new int?(), new int?(), new bool?(), new bool?(), new bool?(), new bool?(), new bool?(), "Hand", "Missile Weapon");
             body.AddPartAt(InsertAfter, "Pseudopod", 0, (string)null, (string)null, (string)null, (string)null, new int?(), new int?(), new int?(), new bool?(), new bool?(), new bool?(), new bool?(), new bool?());
         }
         if (this.newLiquid == (byte)0)
         {
             this.ParentObject.TakeObject("Watery Pseudopod", false, new int?(0));
         }
         else if (this.newLiquid == (byte)1)
         {
             this.ParentObject.TakeObject("Salty Pseudopod", false, new int?(0));
         }
         else if (this.newLiquid == (byte)2)
         {
             this.ParentObject.TakeObject("Tarry Pseudopod", false, new int?(0));
         }
         else if (this.newLiquid == (byte)3)
         {
             this.ParentObject.TakeObject("Magmatic Pseudopod", false, new int?(0));
             this.ParentObject.Statistics["HeatResistance"].BaseValue += 100;
             this.ParentObject.pPhysics.Temperature = 1000;
         }
         else if (this.newLiquid == (byte)4)
         {
             this.ParentObject.TakeObject("Slimy Pseudopod", false, new int?(0));
             this.ParentObject.AddPart <DisarmOnHit>(new DisarmOnHit(100), true);
         }
         else if (this.newLiquid == (byte)5)
         {
             this.ParentObject.TakeObject("Oily Pseudopod", false, new int?(0));
             this.ParentObject.AddPart <DisarmOnHit>(new DisarmOnHit(100), true);
         }
         else if (this.newLiquid == (byte)6)
         {
             this.ParentObject.TakeObject("Bloody Pseudopod", false, new int?(0));
             this.ParentObject.AddPart <LifeDrainOnHit>(new LifeDrainOnHit("15-20", 100), true);
         }
         else if (this.newLiquid == (byte)7)
         {
             this.ParentObject.TakeObject("Acidic Pseudopod", false, new int?(0));
             this.ParentObject.Statistics["AcidResistance"].BaseValue += 100;
         }
         else if (this.newLiquid == (byte)8)
         {
             this.ParentObject.TakeObject("Honeyed Pseudopod", false, new int?(0));
         }
         else if (this.newLiquid == (byte)9)
         {
             this.ParentObject.TakeObject("Lush Pseudopod", false, new int?(0));
         }
         else if (this.newLiquid == (byte)10)
         {
             this.ParentObject.TakeObject("Sludgy Pseudopod2", false, new int?(0));
         }
         else if (this.newLiquid == (byte)11)
         {
             this.ParentObject.TakeObject("Gooey Pseudopod2", false, new int?(0));
         }
         else if (this.newLiquid == (byte)12)
         {
             this.ParentObject.TakeObject("Putrid Pseudopod", false, new int?(0));
         }
         else if (this.newLiquid == (byte)13)
         {
             this.ParentObject.TakeObject("Unctuous Pseudopod", false, new int?(0));
             this.ParentObject.AddPart <DisarmOnHit>(new DisarmOnHit(100), true);
         }
         else if (this.newLiquid == (byte)14)
         {
             this.ParentObject.TakeObject("Oozing Pseudopod2", false, new int?(0));
         }
         else if (this.newLiquid == (byte)15)
         {
             this.ParentObject.TakeObject("Spiced Pseudopod", false, new int?(0));
         }
         else if (this.newLiquid == (byte)16)
         {
             this.ParentObject.TakeObject("Luminous Pseudopod2", false, new int?(0));
             this.ParentObject.AddPart <LightSource>(new LightSource(), true);
             (this.ParentObject.GetPart("LightSource") as LightSource).Radius = 6;
             this.ParentObject.Statistics["ColdResistance"].BaseValue        += 100;
         }
         else if (this.newLiquid == (byte)17)
         {
             this.ParentObject.TakeObject("Neutronic Pseudopod", false, new int?(0));
         }
         else if (this.newLiquid == (byte)18)
         {
             this.ParentObject.TakeObject("Homogenized Pseudopod", false, new int?(0));
             this.ParentObject.AddPart <CloneOnHit>(new CloneOnHit(), true);
         }
         else if (this.newLiquid == (byte)20)
         {
             this.ParentObject.TakeObject("Waxen Pseudopod", false, new int?(0));
         }
         else if (this.newLiquid == (byte)21)
         {
             this.ParentObject.TakeObject("Inky Pseudopod", false, new int?(0));
             this.ParentObject.AddPart <DisarmOnHit>(new DisarmOnHit(100), true);
         }
         else if (this.newLiquid == (byte)22)
         {
             this.ParentObject.TakeObject("Sugary Pseudopod", false, new int?(0));
         }
         this.ParentObject.pBrain.PerformReequip(false);
         this.newLiquid = (byte)99;
     }
     this.isCatalyzing = false;
     if (this.ComponentLiquids.Count != 1)
     {
         return;
     }
     MessageQueue.AddPlayerMessage("The reacting liquids congeal into a " + this.ParentObject.ShortDisplayName + ".");
     this.C.AddObject(this.ParentObject);
     XRLCore.Core.Game.ActionManager.AddActiveObject(this.ParentObject);
 }