Example #1
0
        protected void DoEffect()
        {
            var wall          = base.TargetA.Thing.def.building.smoothedThing.defName;
            var rnd           = new System.Random();
            var pictureChance = rnd.Next(20);
            var xpGain        = 100f;

            if (pawn.skills != null)
            {
                pictureChance += pawn.skills.GetSkill(SkillDefOf.Artistic).Level;
            }
            if (pictureChance < 20)
            {
            }
            else
            {
                var pictureQuality    = 1;
                var pictureQualityMod = Rand.Value;
                if (pawn.skills != null)
                {
                    if (pawn.skills.GetSkill(SkillDefOf.Artistic).Level < 7)
                    {
                        if (pictureQualityMod > 0.67)
                        {
                            pictureQuality = 2;
                        }
                    }
                    else if (pawn.skills.GetSkill(SkillDefOf.Artistic).Level < 14)
                    {
                        if (pictureQualityMod > 0.67)
                        {
                            pictureQuality = 3;
                        }
                        else if (pictureQualityMod > 0.33)
                        {
                            pictureQuality = 2;
                        }
                    }
                    else
                    {
                        if (pictureQualityMod > 0.33)
                        {
                            pictureQuality = 3;
                        }
                        else
                        {
                            pictureQuality = 2;
                        }
                    }
                }
                var pictureChoice = rnd.Next(5);
                if (pictureQuality == 1)
                {
                    xpGain = 100f;
                    if (pictureChoice == 0)
                    {
                        wall += "XXAtom";
                    }
                    else if (pictureChoice == 1)
                    {
                        wall += "XXBeer";
                    }
                    else if (pictureChoice == 2)
                    {
                        wall += "XXCheese";
                    }
                    else if (pictureChoice == 3)
                    {
                        wall += "XXDoor";
                    }
                    else
                    {
                        wall += "XXShovel";
                    }
                }
                else if (pictureQuality == 2)
                {
                    xpGain = 200f;
                    if (pictureChoice == 0)
                    {
                        wall += "XXBoomalope";
                    }
                    else if (pictureChoice == 1)
                    {
                        wall += "XXForest";
                    }
                    else if (pictureChoice == 2)
                    {
                        wall += "XXHouse";
                    }
                    else if (pictureChoice == 3)
                    {
                        wall += "XXPlanet";
                    }
                    else
                    {
                        wall += "XXRocket";
                    }
                }
                else
                {
                    xpGain = 400f;
                    if (pictureChoice == 0)
                    {
                        wall += "XXGerbils";
                    }
                    else if (pictureChoice == 1)
                    {
                        wall += "XXIsland";
                    }
                    else if (pictureChoice == 2)
                    {
                        wall += "XXMan";
                    }
                    else if (pictureChoice == 3)
                    {
                        wall += "XXRose";
                    }
                    else
                    {
                        wall += "XXWoman";
                    }
                }
                pawn.skills.Learn(SkillDefOf.Artistic, xpGain, false);
            }
            SmoothableWallUtility.Notify_SmoothedByPawn(DecorateWall(base.TargetA.Thing, wall, pawn), pawn);
        }
Example #2
0
 protected void DoEffect()
 {
     SmoothableWallUtility.Notify_SmoothedByPawn(SmoothableWallUtility.SmoothWall(base.TargetA.Thing, pawn), pawn);
 }