Sump/Core/SumpInterfaces.cs

Interfaces for the stackable effect components in this game. IMisfitAbility, IPhobia and IGraft describe what a misfit's twisted ability, a fear and a grafted body part each expose: the kind enum, strength or dread, cause info, resistance, socket and description.

using System;

// Small pieces that stack. A misfit's twisted ability, a fear and a graft are each a component
// behind one of these, so any number can sit on one object and combine freely, and new ones are
// added by writing one more component.

/// <summary>A misfit's twisted ability, as a component on the misfit.</summary>
public interface IMisfitAbility
{
	TwistedAbility Kind { get; }
	/// <summary>The misfit this ability belongs to.</summary>
	MisfitProfile Profile { get; set; }
	/// <summary>0 dormant .. 1 in full effect; the misfit raises it with its agitation.</summary>
	float Strength { get; set; }
}

/// <summary>One fear, as a component on whoever has it. Several can be on the player at once.</summary>
public interface IPhobia
{
	Phobia Kind { get; }
	/// <summary>How frightening things are for this fear right now, 0 to 1.</summary>
	float Dread { get; }
	/// <summary>Short words for what is causing it, or empty.</summary>
	string Cause { get; }
	/// <summary>Where the cause is, if it has a place.</summary>
	Vector3? CausePosition { get; }
	/// <summary>0 untouched .. 1 immune; grafts and healed friends raise it.</summary>
	float Resistance { get; set; }
}

/// <summary>A part of a healed misfit grown onto the player, with what it lets them do.</summary>
public interface IGraft
{
	/// <summary>The misfit it came from.</summary>
	MisfitProfile Source { get; }
	/// <summary>The bone it sits on, on the rigged model ("spine_2", "hand_l", "tail_3"...).</summary>
	string Socket { get; }
	/// <summary>One line for the HUD: what it is and how to use it.</summary>
	string Description { get; }
	/// <summary>False while something (a flashback, a cutscene) has switched grafts off.</summary>
	bool Active { get; set; }
}