Skip to content

Alter Item

Alite edited this page Sep 11, 2026 · 2 revisions

This ability comp changes various properties of most things, like their hp, biocoding, quality, or stuffing. This cannot change items while are presently equipped or otherwise not targetable by the ability:

        <comps>
            <li Class="EBSGFramework.CompProperties_AbilityAlterItem">
            </li>
        </comps>

These are the options available:

  • hpRestore : Default (0) : A static amount of hit points to give the item. If set to a negative number, this will reduce the hit points

  • maxHPPercentRestore : Default (0) : The amount of max hit points to restore (i.e. 0.1 on an item with 100 max hp will restore 10). If set to a negative number, this will reduce the hit points

  • requireHitPoints : Default (False) : Requires the targeted item uses hit points (i.e. this will render a stack of silver untargetable). You can add onlyTargetDamagedThings to the targetParams to restrict to only damaged items

  • uncode : Default (False) : If the item is biocoded, remove the biocoding

  • requireBiocode : Default (False) : Requires the targeted item be biocoded

  • untaint : Default (False) : If the item is tainted, remove the tainting

  • requireTaint : Default (False) : Requires the targeted item be tainted apparel

  • increaseQuality : Default (False) : Increments the quality of the item

  • maxQuality : Default (Legendary) : The highest quality an item can be increased to. The options are: Awful, Poor, Normal, Good, Excellent, Masterwork, and Legendary

  • decreaseQuality : Default (False) : Decrements the quality of the item

  • minQuality : Default (Awful) : The lowest quality an item can be decreased to. The options are: Awful, Poor, Normal, Good, Excellent, Masterwork, and Legendary

  • requireQuality : Default (False) : Requires the item have the quality comp

  • stuffingChange : A list of lists which designate progression for stuffing changes. The outer li's are used for individual progression paths, with the inner ones listing the ThingDefs to upgrade to. I recommend looking at the Reforge example because how this functions is probably a lot clearer with that

  • requireStuffing : Default (False) : Requires the item uses stuff instead of only using static items

  • requireAny : Default (False) : Makes it so the ability can only be used on items which this comp will change in some way, like the item being tainted while untaint is True, or one of the quality altering options are active and the max/min hasn't been reached yet. If any of the individual require options are used, this will not be useful

  • requireFinished : Default (True) : While true, unfinished items can't be targeted by the ability. This should usually remain True to avoid some weird results that could happen when trying to change an unfinished/unbuilt item, and if you do set it to False make sure to test thoroughly

Note : The individual require options (i.e. requireBiocode) can be used even if their related settings (i.e. uncode) are not used to make the comp a little more flexible (i.e. can create an ability that only repairs biocoded items)


These are examples from Superhero Genes which use most of the options available, with the first one being the base they all use to decrease the amount of code and the last one being a mash-up of all of them:

    <AbilityDef Name="SHG_RePowerBase" Abstract="True">
        <cooldownTicksRange>60000</cooldownTicksRange>
        <casterMustBeCapableOfViolence>False</casterMustBeCapableOfViolence>
        <aiCanUse>False</aiCanUse>
        <verbProperties>
            <requireLineOfSight>false</requireLineOfSight>
            <range>4.9</range>
            <drawAimPie>false</drawAimPie>
            <targetParams>
                <verbClass>Verb_CastAbility</verbClass>
                <warmupTime>1</warmupTime>
                <canTargetPawns>False</canTargetPawns>
                <canTargetItems>True</canTargetItems>
                <thingCategory>Item</thingCategory>
                <mapObjectTargetsMustBeAutoAttackable>False</mapObjectTargetsMustBeAutoAttackable>
            </targetParams>
        </verbProperties>
    </AbilityDef>
    <AbilityDef ParentName="SHG_RePowerBase">
        <defName>SHG_Refine</defName>
        <label>refine</label>
        <description>Improve the quality of a nearby item.</description>
        <comps>
            <li Class="EBSGFramework.CompProperties_AbilityAlterItem">
                <increaseQuality>True</increaseQuality>
                <requireQuality>True</requireQuality>
            </li>
        </comps>
    </AbilityDef>

Note for refurbish, because it only messes with taint and biocoding, it sets canTargetBuildings to minimize the amount of work the ability needs to do to realize that the target is not valid. Also, it uses requireAny so that it can target non-tainted biocoded items or non-biocoded tainted items

    <AbilityDef ParentName="SHG_RePowerBase">
        <defName>SHG_Refurbish</defName>
        <label>refurbish</label>
        <description>Remove tainting and/or biocoding from a nearby item.</description>
        <verbProperties>
            <targetParams>
                <canTargetBuildings>False</canTargetBuildings>
            </targetParams>
        </verbProperties>
        <comps>
            <li Class="EBSGFramework.CompProperties_AbilityAlterItem">
                <requireAny>True</requireAny>
                <uncode>True</uncode>
                <untaint>True</untaint>
            </li>
        </comps>
    </AbilityDef>
    <AbilityDef ParentName="SHG_RePowerBase">
        <defName>SHG_Repair</defName>
        <label>repair</label>
        <description>Remove all damage on an item.</description>
        <verbProperties>
            <targetParams>
                <onlyTargetDamagedThings>True</onlyTargetDamagedThings>
            </targetParams>
        </verbProperties>
        <comps>
            <li Class="EBSGFramework.CompProperties_AbilityAlterItem">
                <maxHPPercentRestore>1</maxHPPercentRestore>
                <requireHitPoints>True</requireHitPoints>
            </li>
        </comps>
    </AbilityDef>

Note for reforge, the may require could be moved to obsidian specifically if the player should still be able to go from slate blocks to plasteel. Another thing note, if a mod adds a steel alternative that needs to be added to this list, a new section would be added that would include that alternative and plasteel. If added to the existing list (i.e. Steel > Alternative Steel > Plasteel), then steel items would turn into the alternative, then the alternative to plasteel

    <AbilityDef ParentName="SHG_RePowerBase">
        <defName>SHG_Reforge</defName>
        <label>reforge</label>
        <description>Replace the metals used for the item with stuff of a better quality.</description>
        <comps>
            <li Class="EBSGFramework.CompProperties_AbilityAlterItem">
                <requireStuffing>True</requireStuffing>
                <stuffingChange>
                    <li>
                        <li>Steel</li>
                        <li>Plasteel</li>
                    </li>
                    <li>
                        <li>Silver</li>
                        <li>Gold</li>
                    </li>
                    <li MayRequire="Ludeon.Rimworld.Odyssey">
                        <li>BlocksSlate</li>
                        <li>Obsidian</li>
                        <li>Plasteel</li>
                    </li>
                </stuffingChange>
            </li>
        </comps>
    </AbilityDef>
    <AbilityDef ParentName="SHG_RePowerBase">
        <defName>SHG_Revitalizer</defName>
        <label>revitalize</label>
        <description>Restore all lost hit points, purify tainting, remove biocoding, upgrade quality, and improve materials all at the same time.</description>
        <comps>
            <li Class="EBSGFramework.CompProperties_AbilityAlterItem">
                <requireAny>True</requireAny>
                <maxHPPercentRestore>1</maxHPPercentRestore>
                <uncode>True</uncode>
                <untaint>True</untaint>
                <increaseQuality>True</increaseQuality>
                <stuffingChange>
                    <li>
                        <li>Steel</li>
                        <li>Plasteel</li>
                    </li>
                    <li>
                        <li>Silver</li>
                        <li>Gold</li>
                    </li>
                    <li MayRequire="Ludeon.Rimworld.Odyssey">
                        <li>BlocksSlate</li>
                        <li>Obsidian</li>
                        <li>Plasteel</li>
                    </li>
                </stuffingChange>
            </li>
        </comps>
    </AbilityDef>

Other


Special Nodes

Clone this wiki locally