UpgradeDef - Grim-/Talented GitHub Wiki

<Talented.UpgradeDef>

UpgradeDefs define what bonuses a character receives when spending talent points. These are referenced by UpgradeTreeNodes to determine what upgrades are available at each point in the talent tree.

Available Effect Types

You can define three types of effects in your upgrades:

Hediff Effects

Add health conditions or modifications to the character. Useful for adding straight stat buffs, health conditions, or other effects that are normally applied through hediffs.

Ability Effects

Grant new abilities to the character. If you want your upgrade to give the character new abilities (like psycasts), use this.

Organ Effects

Add or modify organs. Use this when you want to give characters new organs or modify existing ones. Can be used for both simple organ additions and complex modifications.

Required Fields

  • defName: Unique identifier for your upgrade
  • label: What shows up in the UI
  • parasiteLevelRequired: Minimum parasite level needed for this upgrade
  • At least one effect type (hediff, ability, or organ)

Optional Fields

  • prerequisites: Other upgrades that must be taken first
  • uiIconPath: Custom icon for the upgrade
  • pointCost: How many talent points it costs (defaults to 1)
  • description: Custom description (if not provided, one will be generated based on the effects)

The description will automatically list what hediffs, abilities, or organs are being added unless you provide a custom one.

Future Features

  • Pure stat upgrades are planned for a future update UpgradeDef defined an upgrade, this would be referenced in a list on the UpgradeTreeNodeDef to grant that upgrade from that node.

You can have an upgrade grant the character either a hediff, a specific organ or an ability, pure stat upgrades will be coming soon.

<?xml version="1.0" encoding="utf-8" ?>
<Defs>
    <!-- Auxiliary Heart -->
    <Talented.UpgradeDef>
        <defName>AuxiliaryHeartUpgrade</defName>
        <label>Auxiliary Heart</label>
              <uiIconPath>DragonBall1</uiIconPath>
        <description>Grows an additional heart to improve blood circulation and stamina.</description>
        <parasiteLevelRequired>4</parasiteLevelRequired>
        <organEffects>
            <li>
                <addedOrganHediff>AuxiliaryHeart</addedOrganHediff>
                <isAddition>true</isAddition>
            </li>
        </organEffects>
    </Talented.UpgradeDef>

    <HediffDef ParentName="ImplantHediffBase">
        <defName>AuxiliaryHeart</defName>
        <label>auxiliary heart</label>
        <description>An additional parasitic heart has grown to support the circulatory system.</description>
        <defaultLabelColor>(0.5, 0.8, 0.5)</defaultLabelColor>
        <addedPartProps>
            <solid>true</solid>
            <partEfficiency>1.0</partEfficiency>
            <betterThanNatural>true</betterThanNatural>
        </addedPartProps>
        <stages>
            <li>
                <statOffsets>
                    <MoveSpeed>0.15</MoveSpeed>
                    <WorkSpeedGlobal>0.1</WorkSpeedGlobal>
                </statOffsets>
                <capMods>
                    <li>
                        <capacity>BloodPumping</capacity>
                        <offset>0.5</offset>
                    </li>
                </capMods>
            </li>
        </stages>
    </HediffDef>

</Defs>
⚠️ **GitHub.com Fallback** ⚠️