12
edits
No edit summary |
(more comments and edits thanks to gnarf) |
||
Line 99: | Line 99: | ||
} | } | ||
// This sets the description for what exactly your mutation does | // This sets the description for what exactly your mutation does. | ||
// It is good idea to make helper functions like the "ChanceToMoo" to make dynamic descriptions for changing rules for a mutation. | |||
public override string GetLevelText(int Level) | public override string GetLevelText(int Level) | ||
{ | { | ||
return " | return "{{rules|You have a " + ChanceToMoo(Level) + "% chance to moo per turn}}"; | ||
} | |||
public int ChanceToMoo(int Level) | |||
{ | |||
return Level; | |||
} | } | ||
// This is called every time the mutation changes level, and can be used to change things like damage. | // This is called every time the mutation changes level, and can be used to change things like damage. | ||
// We don't use "ChanceToMoo" in this example so we can allow GetLevelText to use it. | |||
public override bool ChangeLevel(int NewLevel) | public override bool ChangeLevel(int NewLevel) | ||
{ | { | ||
Line 161: | Line 168: | ||
if (E.ID == "EndTurn") | if (E.ID == "EndTurn") | ||
{ | { | ||
// | // Reusing the same method we used in GetLevelText means that both of them will remain accurate. | ||
if ( | if (ChanceToMoo(Level).in100()) DidX("moo"); | ||
} | } | ||
return base.FireEvent(E); | return base.FireEvent(E); |
edits