public void BuildPart(IPart iPart, string Context = null)
        {
            Body body = iPart as Body;

            if (body == null)
            {
                return;
            }
            BodyPart bodyPart = body.GetBody();

            bodyPart.AddPart("Nuclear Protrusion", 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?()).AddPart("Sensory Bulb", 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?());
            BodyPartType LHand = BodyPartType.VariantOf("Hand", "Left Tentacle", "Left side Manipulator for objects", null, null, null, "OmniSlimeTenticle", null, BodyPartCategory.PROTOPLASMIC, null, null, 2);

            bodyPart.AddPart(LHand, Lat.LEFT, "OmniSlimeTenticle", "Tentacles");
            BodyPartType RHand = BodyPartType.VariantOf("Hand", "Right Tentacle", "Right side Manipulator for objects", null, null, null, "OmniSlimeTenticle", null, BodyPartCategory.PROTOPLASMIC, null, null, 2);

            bodyPart.AddPart(RHand, Lat.RIGHT, "OmniSlimeTenticle", "Tentacles");
            BodyPartType Tentacles = BodyPartType.VariantOf("Hands", "Tentacles", null, null, null, null, "OmniSlimeTenticle");

            bodyPart.AddPart(Tentacles, 0);
            bodyPart.AddPart("Missile Weapon", 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?());
            bodyPart.AddPart("Missile Weapon", 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?());
            bodyPart.AddPart("Thrown Weapon", 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?());
            bodyPart.AddPart("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?());
            bodyPart.AddPart("Floating Nearby", 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?());

            body.CategorizeAll(5);
            body.FinishBuild();
        }
Ejemplo n.º 2
0
        public void AddPsionicArms()
        {
            Body SourceBody = ParentObject.GetPart("Body") as Body;

            if (SourceBody != null)
            {
                BodyPart ReadyBody          = SourceBody.GetBody();
                BodyPart AttatchArmTemplate = ReadyBody.AddPartAt("Psionic-Arm", 2, null, null, null, null, ManagerID + ArmCounterStrings(), 17, null, null, null, null, null, null, null, null, null, null, null, "Arm", new string[4]
                {
                    "Hands",
                    "Feet",
                    "Roots",
                    "Thrown Weapon"
                });
                AttatchArmTemplate.AddPart("Psionic-Hand", 2, null, "Psionic-Hands", null, null, ManagerID + ArmCounterStrings(), 17);
                ReadyBody.AddPartAt(AttatchArmTemplate, "Psionic-Arm", 1, null, null, null, null, ManagerID + ArmCounterStrings(), 17).AddPart("Psionic-Hand", 1, null, "Psionic-Hands", null, null, ManagerID + ArmCounterStrings(), 17);
                ReadyBody.AddPartAt("Psionic-Hands", 0, null, null, "Psionic-Hands", null, ManagerID + ArmCounterStrings(), 17, null, null, null, null, null, null, null, null, null, null, null, "Hands", new string[3]
                {
                    "Feet",
                    "Roots",
                    "Thrown Weapon"
                });
                ReadyBody.AddPartAt("Missile Weapon", Laterality.RIGHT, null, null, "Psionic-Hands", null, ManagerID + ArmCounterStrings(), Category: 17, null, null, null, null, null, null, null, null, null, null, null, "Hands", new string[1]
                {
                    "Missile Weapon"
                });
                ReadyBody.AddPartAt("Missile Weapon", Laterality.LEFT, null, null, "Psionic-Hands", null, ManagerID + ArmCounterStrings(), Category: 17, null, null, null, null, null, null, null, null, null, null, null, "Hands", new string[1]
                {
                    "Missile Weapon"
                });
            }
        }
Ejemplo n.º 3
0
        public override void ApplyModification(GameObject Object)
        {
            if (Object == null)
            {
                return;
            }
            Body partBody = Object.GetPart <Body>();

            if (partBody != null)
            {
                BodyPart body2 = partBody.GetBody();
                if (body2 == null)
                {
                    return;
                }
                body2.AddPart("Tread", 2);
                body2.AddPart("Tread", 1);
            }
        }
Ejemplo n.º 4
0
        public BodyPart DeepCopy(BodyPart original)
        {
            if (original == null)
            {
                return(null);
            }
            BodyPart bodyPart = new BodyPart(null);

            bodyPart.Type                       = original.Type;
            bodyPart.VariantType                = original.VariantType;
            bodyPart.Description                = original.Description;
            bodyPart.Name                       = original.Name;
            bodyPart.SupportsDependent          = original.SupportsDependent;
            bodyPart.DependsOn                  = original.DependsOn;
            bodyPart.RequiresType               = original.RequiresType;
            bodyPart.PreventRegenerationBecause = original.PreventRegenerationBecause;
            bodyPart.Category                   = original.Category;
            bodyPart.Laterality                 = original.Laterality;
            bodyPart.RequiresLaterality         = original.RequiresLaterality;
            bodyPart.Mobility                   = original.Mobility;
            bodyPart.Primary                    = original.Primary;
            bodyPart.Native                     = original.Native;
            bodyPart.Integral                   = original.Integral;
            bodyPart.Mortal                     = original.Mortal;
            bodyPart.Abstract                   = original.Abstract;
            bodyPart.Extrinsic                  = original.Extrinsic;
            bodyPart.Plural                     = original.Plural;
            bodyPart.Position                   = original.Position;
            bodyPart._ID        = original._ID;
            bodyPart.ParentBody = null;
            if (original.DefaultBehavior != null)
            {
                GameObject gameObject = original.DefaultBehavior.DeepCopy();
                if (ParentObject.DeepCopyInventoryObjectMap == null)
                {
                    ParentObject.DeepCopyInventoryObjectMap = new Dictionary <GameObject, GameObject>();
                }
                ParentObject.DeepCopyInventoryObjectMap.Add(original.DefaultBehavior, gameObject);
                gameObject.pPhysics._Equipped = ParentObject;
                bodyPart.DefaultBehavior      = gameObject;
            }

            if (original.Parts != null)
            {
                foreach (BodyPart part in original.Parts)
                {
                    if (!part.Extrinsic)
                    {
                        bodyPart.AddPart(DeepCopy(part));
                    }
                }
                return(bodyPart);
            }
            return(bodyPart);
        }
Ejemplo n.º 5
0
        public override void ApplyModification(GameObject Object)
        {
            Body partBody = Object.GetPart <Body>();

            if (partBody != null)
            {
                BodyPart body2             = partBody.GetBody();
                BodyPart firstAttachedPart = body2.GetFirstAttachedPart("Back", 0, partBody, true);
                if (firstAttachedPart != null)
                {
                    body2.AddPartAt(firstAttachedPart, "Arm", 2).AddPart("Hand", 2, "MetalFist", "Hands");
                    body2.AddPartAt(firstAttachedPart, "Arm", 1).AddPart("Hand", 1, "MetalFist", "Hands");
                    body2.AddPartAt(firstAttachedPart, "Missile Weapon", 2);
                    body2.AddPartAt(firstAttachedPart, "Missile Weapon", 1);
                    body2.AddPartAt(firstAttachedPart, "Thrown Weapon");
                    body2.AddPartAt(firstAttachedPart, "Hands", 0, null, null, "Hands");
                }
                else
                {
                    body2.AddPart("Arm", 2).AddPart("Hand", 2, "MetalFist", "Hands");
                    body2.AddPart("Arm", 1).AddPart("Hand", 1, "MetalFist", "Hands");
                    body2.AddPart("Missile Weapon", 2);
                    body2.AddPart("Missile Weapon", 1);
                    body2.AddPart("Thrown Weapon");
                    body2.AddPart("Hands", 0, null, null, "Hands");
                }
            }
        }
Ejemplo n.º 6
0
        public void AddBodyPart()
        {
            //BodyPartType.Make("Riding", null, "riding", null, null, null, null, null, null, null, null, null, false, true);

            Body part = ParentObject.GetPart <Body>();

            if (part != null)
            {
                BodyPart body = part.GetBody();

                BodyPart bodyPart = body.AddPart("Riding");
            }
        }
Ejemplo n.º 7
0
 public override bool PouredOn(LiquidVolume Liquid, GameObject GO)
 {
     if (Liquid.ComponentLiquids.Count != 1)
     {
         return(true);
     }
     if (Liquid.Volume > 0 && GO.HasPart("Stomach") && GO.HasPart("Body") && GO.GetIntProperty("Inorganic") == 0 && GO.HasStat("Toughness"))
     {
         BodyPart p  = GO.GetPart <Body>()._Body.GetParts().GetRandomElement();
         BodyPart p2 = GO.GetPart <Body>()._Body.GetParts().GetRandomElement();
         p2.AddPart(p.DeepCopy(GO, GO.GetPart <Body>()));
         GO.Statistics["Toughness"].Penalty += 3;
         IPart.AddPlayerMessage(GO.The + GO.DisplayNameOnly + "'s " + p2.Name + " sprout" + (p2.Plural?"":"s") + " " + (p.Plural?"":"a ") + p.Name + "!");
     }
     return(true);
 }
Ejemplo n.º 8
0
        public void AddBodyPart()
        {
            string gtype = ParentObject.GetTag("GlandLiquid");

            if (gtype != null)
            {
                //IPart.AddPlayerMessage("glandtype:"+gtype);
                this.GlandType = gtype;
            }

            Body part = ParentObject.GetPart <Body>();

            if (part != null)
            {
                BodyPart body = part.GetBody();

                if (body.GetFirstPart("Glands") != null)
                {
                    return;
                }

                BodyPart   firstPart    = body.AddPart(new BodyPart("Glands", part), "Back");
                GameObject GlandsObject = GameObjectFactory.Factory.CreateObject("DefaultGlands");
                GlandsObject.DisplayName = GlandType + " glands";
                GlandsObject.GetPart <LiquidProducer>().Liquid = GlandType;
                GlandsObject.GetPart <LiquidVolume>().Empty();
                GlandsObject.GetPart <LiquidVolume>().InitialLiquid = GlandType + "-1000";
                GlandsObject.GetPart <LiquidVolume>().Volume        = GlandsObject.GetPart <LiquidVolume>().StartVolume.RollCached();
                //GlandsObject.GetPart<acegiak_NoPour>().ProcessInitialLiquid(GlandType-"1000");


                Event @event = Event.New("CommandForceEquipObject");
                @event.AddParameter("Object", GlandsObject);
                @event.AddParameter("BodyPart", firstPart);
                @event.SetSilent(true);
                ParentObject.FireEvent(@event);
            }
        }
Ejemplo n.º 9
0
        public static BodyPart BodyPartCopy(BodyPart origin, GameObject Parent, Body NewBody)
        {
            if (origin == null || NewBody == null || Parent == null)
            {
                return(null);
            }
            BodyPart bodyPart = new BodyPart(NewBody);

            bodyPart.Type                       = origin.Type;
            bodyPart.VariantType                = origin.VariantType;
            bodyPart.Description                = origin.Description;
            bodyPart.Name                       = origin.Name;
            bodyPart.SupportsDependent          = origin.SupportsDependent;
            bodyPart.DependsOn                  = origin.DependsOn;
            bodyPart.RequiresType               = origin.RequiresType;
            bodyPart.PreventRegenerationBecause = origin.PreventRegenerationBecause;
            bodyPart.Category                   = origin.Category;
            bodyPart.Laterality                 = origin.Laterality;
            bodyPart.RequiresLaterality         = origin.RequiresLaterality;
            bodyPart.Mobility                   = origin.Mobility;
            bodyPart.Primary                    = origin.Primary;
            bodyPart.Native                     = origin.Native;
            bodyPart.Integral                   = origin.Integral;
            bodyPart.Mortal                     = origin.Mortal;
            bodyPart.Abstract                   = origin.Abstract;
            bodyPart.Extrinsic                  = origin.Extrinsic;
            bodyPart.Plural                     = origin.Plural;
            bodyPart.Position                   = origin.Position;
            bodyPart._ID        = origin._ID;
            bodyPart.ParentBody = NewBody;
            // if (DefaultBehavior != null)
            // {
            //  GameObject gameObject = DefaultBehavior.DeepCopy();
            //  Parent.DeepCopyInventoryObjectMap.Add(DefaultBehavior, gameObject);
            //  gameObject.pPhysics._Equipped = Parent;
            //  bodyPart.DefaultBehavior = gameObject;
            // }
            // if (Equipped != null && !Parent.DeepCopyInventoryObjectMap.ContainsKey(Equipped))
            // {
            //  GameObject gameObject2 = Equipped.DeepCopy();
            //  Parent.DeepCopyInventoryObjectMap.Add(Equipped, gameObject2);
            //  Body.DeepCopyEquipMap.Add(gameObject2, bodyPart);
            // }
            if (origin.Parts == null)
            {
                return(bodyPart);
            }
            if (bodyPart.Parts == null)
            {
                bodyPart.Parts = new List <BodyPart>(13);
            }
            foreach (BodyPart part in origin.Parts)
            {
                if (!part.Extrinsic)
                {
                    BodyPart copy = BodyPartCopy(part, Parent, NewBody);
                    if (copy != null)
                    {
                        bodyPart.AddPart(copy);
                    }
                }
            }
            return(bodyPart);
        }
Ejemplo n.º 10
0
        public bool recurAdd(BodyPart destination, BodyPart add, GameObject who, bool after = false)
        {
            if (add == null)
            {
                return(true);
            }


            add.Description = "Augmented " + Grammar.MakeTitleCase(add.Name);
            add.Description = Regex.Replace(add.Description, "Fore", "");
            add.Description = Regex.Replace(add.Description, "Hind", "");
            add.Description = Regex.Replace(add.Description, "Mid", "");
            add.Description = Regex.Replace(add.Description, "Right *", "");
            add.Description = Regex.Replace(add.Description, "Left *", "");
            add.Description = Grammar.MakeTitleCase(add.Description);


            add.ParentBody = destination.ParentBody;


            try{
                BodyPart part = null;
                if (after)
                {
                    part = destination.ParentBody.GetBody().AddPart(add, destination.Position + 1);
                }
                else
                {
                    part = destination.AddPart(add);
                }



                int      saveroll = XRL.Rules.Stat.RollSave(who, "Intelligence", 22);
                string[] stats    = new string[] { "Intelligence", "Willpower", "Ego", "Agility", "Toughness", "Strength" };
                if (part.Type == "Face" || part.Type == "Head")
                {
                    stats = new string[] { "Intelligence", "Willpower", "Ego" };
                }
                else
                {
                    stats = new string[] { "Strength", "Toughness", "Agility" };
                }
                string thestat = stats[XRL.Rules.Stat.Rnd2.Next(stats.Length)];
                if (saveroll < 5)
                {
                    who.Statistics[thestat].BaseValue--;
                    Popup.Show("Your " + thestat + " is damaged by the augmentation process.");
                }
                else if (saveroll < 15)
                {
                    part.Equip(GameObject.create("Scarring"));
                    Popup.Show("Your new " + part.Name + " becomes horribly scarred by the augmentation process.");
                }
                else if (saveroll > 20)
                {
                    who.Statistics[thestat].BaseValue++;
                    Popup.Show("Your " + thestat + " is enhanced by your new " + part.Name + ".");
                }
            }catch (Exception e) {
                IPart.AddPlayerMessage(e.Message);
                return(false);
            }


            if (add.Parts != null)
            {
                foreach (BodyPart p in add.Parts)
                {
                    if (!recurAdd(add, p, who, false))
                    {
                        return(false);
                    }
                    ;
                }
            }
            return(true);
        }
Ejemplo n.º 11
0
        public void BuildPart(IPart iPart, string Context = null)
        {
            Body body1 = iPart as Body;

            if (body1 == null)
            {
                return;
            }
            BodyPart body2 = body1.GetBody();

            body2.AddPart("Head", 0, "Kitty_Astral_Bite", (string)null, (string)null, (string)null, new int?(), new int?(), new int?(), new bool?(), new bool?(), new bool?(), new bool?(), new bool?()).AddPart("Face", 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?());
            body2.AddPart("Back", 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?());
            body2.AddPart("Foot", 18, "Kitty_Astral_Claw", "Forefeet", (string)null, (string)null, new int?(), new int?(), new int?(), new bool?(), new bool?(), new bool?(), new bool?(), new bool?());
            body2.AddPart("Foot", 17, "Kitty_Astral_Claw", "Forefeet", (string)null, (string)null, new int?(), new int?(), new int?(), new bool?(), new bool?(), new bool?(), new bool?(), new bool?());
            body2.AddPart("Foot", 66, (string)null, "Hindfeet", (string)null, (string)null, new int?(), new int?(), new int?(), new bool?(), new bool?(), new bool?(), new bool?(), new bool?());
            body2.AddPart("Foot", 65, (string)null, "Hindfeet", (string)null, (string)null, new int?(), new int?(), new int?(), new bool?(), new bool?(), new bool?(), new bool?(), new bool?());
            body2.AddPart("Missile Weapon", 2, (string)null, (string)null, (string)null, (string)null, new int?(), new int?(), new int?(), new bool?(), new bool?(), new bool?(), new bool?(), new bool?());
            body2.AddPart("Missile Weapon", 1, (string)null, (string)null, (string)null, (string)null, new int?(), new int?(), new int?(), new bool?(), new bool?(), new bool?(), new bool?(), new bool?());
            body2.AddPart("Feet", 16, (string)null, (string)null, "Forefeet", (string)null, new int?(), new int?(), new int?(0), new bool?(), new bool?(), new bool?(), new bool?(), new bool?());
            body2.AddPart("Feet", 64, (string)null, (string)null, "Hindfeet", (string)null, new int?(), new int?(), new int?(0), new bool?(), new bool?(), new bool?(), new bool?(), new bool?());
            body2.AddPart("Tail", 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?());
            body2.AddPart("Thrown Weapon", 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?());
            body2.AddPart("Floating Nearby", 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?());
            body1.FinishBuild();
        }