Which code determines that the implant is an addition, not a replacement?

Started by Lanking0758, February 08, 2024, 10:21:23 PM

Previous topic - Next topic

Lanking0758

I added a mod, and then one implant in this Mod would squeezed out all the other implants in that body parts(e.g. in the brain, like mechlink would be squeezed out).

I went through all of the associated codes for this implant, Thingdef, HediffDef, and RecipeDef, and I didn't find anything different from other implants like Psychic Sensitizer in Royalty.


<!-- IOP通用火控核心  -->

    <ThingDef ParentName="GF_BaseIOPMake_Base">
        <defName>GF_IOP_BaseFire</defName>
        <label>IOP通用火控核心</label>
        <description>IOP公司生产的第二代战术人形使用独立的火控核心,采用了IOP标准的火控核心技术。由于多数人形的射击能力足够应对战场局势,这款独立的火控核心只安装在部分远距离或狙击人形上。</description>
        <descriptionHyperlinks><RecipeDef>GF_InstallPrecision_IOP_BaseFire</RecipeDef></descriptionHyperlinks>
        <costList>
          <Steel>40</Steel>
          <ComponentIndustrial>2</ComponentIndustrial>
        </costList>       
        <statBases>
            <WorkToMake>18000</WorkToMake>
            <MarketValue>0</MarketValue>
            <Mass>2</Mass>
        </statBases>
    </ThingDef>

    <HediffDef ParentName="GF_ImplantAdvanced">
        <defName>GF_IOP_BaseFire</defName>
        <label>通用火控核心</label>
        <labelNoun>一副调试完毕的IOP通用火控核心</labelNoun>
        <description>IOP公司生产的独立火控核心。</description>
        <descriptionHyperlinks><ThingDef>GF_IOP_BaseFire</ThingDef></descriptionHyperlinks>
        <spawnThingOnRemoved>GF_IOP_BaseFire</spawnThingOnRemoved>
        <addedPartProps>
            <solid>true</solid>
            <partEfficiency>1</partEfficiency>
        </addedPartProps>
        <stages>
            <li>
                <capMods>
                    <li>
                        <capacity>Hearing</capacity>
                        <offset>0.1</offset>
                    </li>   
                    <li>
                        <capacity>Sight</capacity>
                        <offset>0.2</offset>
       
                    </li>
                </capMods>
                <statOffsets>
                    <ShootingAccuracyPawn>2</ShootingAccuracyPawn>       
                </statOffsets>
            </li>
        </stages>           
    </HediffDef>   

    <RecipeDef ParentName="GFS_SurgeryInstallImplantBase">
        <defName>GF_InstallPrecision_IOP_BaseFire</defName>
        <label>安装IOP通用火控核心</label>
        <description>安装IOP通用火控核心</description>
        <descriptionHyperlinks>
        <HediffDef>GF_IOP_BaseFire</HediffDef>
        <ThingDef>GF_IOP_BaseFire</ThingDef>
        </descriptionHyperlinks>
        <workerClass>Recipe_InstallArtificialBodyPart</workerClass>
        <jobString>正在安装IOP通用火控核心</jobString>
        <ingredients>
            <li>
                <filter>
                    <thingDefs>
                        <li>GF_IOP_BaseFire</li>
                    </thingDefs>
                </filter>
                <count>1</count>
            </li>
        </ingredients>
        <fixedIngredientFilter>
            <thingDefs>
                <li>GF_IOP_BaseFire</li>
            </thingDefs>
        </fixedIngredientFilter>
        <appliedOnFixedBodyParts>
            <li>Brain</li>
        </appliedOnFixedBodyParts>
        <addsHediff>GF_IOP_BaseFire</addsHediff>
    </RecipeDef>
Here are their ParentName

    <HediffDef Name="GF_ImplantAdvanced" Abstract="True">
        <hediffClass>Hediff_Implant</hediffClass>
        <isBad>false</isBad>
        <defaultLabelColor>(0.6, 0.6, 1.0)</defaultLabelColor>
        <addedPartProps>
            <betterThanNatural>true</betterThanNatural>
        </addedPartProps>
    </HediffDef>   

    <HediffDef Name="GF_AddPartAdvanced" ParentName="GF_ImplantAdvanced" Abstract="True">
        <hediffClass>Hediff_AddedPart</hediffClass>
        <priceImpact>true</priceImpact>
    </HediffDef>



  <SurgeryOutcomeEffectDef Name="GFS_SurgeryOutcomeBase">
    <defName>GFS_SurgeryOutcomeBase</defName>
    <outcomes>
      <li Class="SurgeryOutcomeSuccess" />
    </outcomes>
  </SurgeryOutcomeEffectDef>

  <RecipeDef Abstract="True" Name="GFS_SurgeryFlesh">
    <effectWorking>Surgery</effectWorking>
    <soundWorking>Recipe_Surgery</soundWorking>
    <workSpeedStat>MedicalOperationSpeed</workSpeedStat>
    <workSkill>Medicine</workSkill>
    <workSkillLearnFactor>16</workSkillLearnFactor>
    <surgeryOutcomeEffect>GFS_SurgeryOutcomeBase</surgeryOutcomeEffect>
  </RecipeDef>

  <RecipeDef Name="GFS_SurgeryInstallImplantBase" ParentName="GFS_SurgeryFlesh" Abstract="True">
    <workerClass>Recipe_InstallImplant</workerClass>
    <workAmount>60</workAmount>
    <developmentalStageFilter>Child, Adult</developmentalStageFilter>
    <recipeUsers>
      <li>Human</li>
    </recipeUsers>
    <fixedIngredientFilter>
      <categories>
        <li>Medicine</li>
      </categories>
    </fixedIngredientFilter>
  </RecipeDef>