Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Then add a new .cs file in your mod that implements the class. Here's a skeletal implementation of the entry above. It must be in the XRL.World.Parts.Mutation namespace and must ultimately descend from BaseMutation. (Though not necessarily directly, if you have a very complex mod) 

Info

You can remove mutations by including a tag with just the Name of the mutation you want with a - in front. For example:

Code Block
<mutation Name="-Flaming Hands"></mutation>
Code Block
languagec#
titleSkeletal mutation example.
linenumberstrue
collapsetrue
using System;
using System.Collections.Generic;
using System.Text;

using XRL.Rules;
using XRL.Messages;
using ConsoleLib.Console;

namespace XRL.World.Parts.Mutation
{
    [Serializable]
    class FreeholdTutorial_Udder : BaseMutation
    {
        public FreeholdTutorial_Udder()
        {
            Name = "FreeholdTutorial_Udder";
            DisplayName = "Udder";
        }

        public override void Register(GameObject Object)
        {
        }
        
        public override string GetDescription()
        {
            return "";
        }

        public override string GetLevelText(int Level)
        {
            string Ret = "You have udders.\n";
            return Ret;
        }

        public override bool BeforeRender(Event E)
        {
            if (ParentObject.IsPlayer())
            {
                if (ParentObject.pPhysics != null && ParentObject.pPhysics.CurrentCell != null)
                {
                    ParentObject.pPhysics.CurrentCell.ParentZone.AddLight(ParentObject.pPhysics.CurrentCell.X, ParentObject.pPhysics.CurrentCell.Y, Level, LightLevel.Darkvision);
                }
            }
            return true;
        }

        public override bool FireEvent(Event E)
        {
            return base.FireEvent(E);
        }

        public override bool ChangeLevel(int NewLevel)
        {
            return true;
        }

        public override bool Mutate(GameObject GO, int Level)
        {
            return true;
        }

        public override bool Unmutate(GameObject GO)
        {
            return true;
        }
    }
}

...