ArchetypeTemplate - jimdroberts/FishMMO GitHub Wiki

Description

ScriptableObject template representing a character archetype, including rewards, requirements, and metadata. Used to define archetypes, their unlock conditions, and the rewards granted in the FishMMO character system.


API Access

Fields

  • public NPCGuildTemplate NPCGuild

    The NPC guild associated with this archetype, if any.

  • public Sprite Icon

    The icon representing this archetype in the UI.

  • public string Description

    The description of the archetype, shown to the player.

  • public List AttributeRewards

    List of attribute templates rewarded for unlocking this archetype.

  • public List AbilityRewards

    List of ability templates rewarded for unlocking this archetype.

  • public List ItemRewards

    List of item templates rewarded for unlocking this archetype.

  • public List BuffRewards

    List of buff templates rewarded for unlocking this archetype.

  • public List TitleRewards

    List of title strings rewarded for unlocking this archetype.

  • public BaseCondition ArchetypeRequirements

    The condition that must be met to unlock this archetype.

Properties

  • public string Name { get; }

    The name of this archetype template (from the ScriptableObject's name).

Methods

  • public bool MeetsRequirements(IPlayerCharacter playerCharacter)

    Checks if the given player character meets the requirements for this archetype. playerCharacter (IPlayerCharacter): The player character to evaluate. Returns true if requirements are met, or if no requirements are set; otherwise, false (bool).


Basic Usage

Setup

  1. Create a new ArchetypeTemplate ScriptableObject via the Unity editor (Assets > Create > FishMMO > Character > Archetype > Archetype).
  2. Assign NPCGuild, Icon, Description, and reward lists as needed in the Inspector.
  3. Set ArchetypeRequirements to define unlock conditions, or leave null for no requirements.

Example

// Example 1: Checking if a player meets archetype requirements
if (archetypeTemplate.MeetsRequirements(playerCharacter)) {
    // Grant archetype rewards
}

// Example 2: Accessing rewards
foreach (var ability in archetypeTemplate.AbilityRewards) {
    // Grant ability to player
}

Best Practices

  • Always define clear requirements for each archetype to control player progression.
  • Use descriptive icons and descriptions to enhance the player experience.
  • Keep reward lists organized and relevant to the archetype's theme.
  • Use ScriptableObjects for easy data management and editor integration.
⚠️ **GitHub.com Fallback** ⚠️