Skip to content

CompDecoy

flango edited this page Dec 20, 2022 · 3 revisions

×× Distract your enemies and more! ××

Makes pawns hostile towards a thing with this comp, ignoring other targets.

Preview

<Single-use throwables — Verb_LaunchProjectileOneUse>
<Throwable deployables — Projectile_ThingSpawner>
<Rotating projectiles — CompProjectileVFX>


Type: Comp

XML Node: ThingDef/comps/li


Example:

<comps>
    <li Class="flangoCore.CompProperties_Decoy">
        <jobDurationTicks>300~400</jobDurationTicks>   <!-- How long should the distraction last (Default: 300~400) -->
        <forcedAttackCount>2~6</forcedAttackCount>     <!-- How many attacks targets perform before giving up (Default: 2~6) -->
        <disappearAfterTicks>600</disappearAfterTicks> <!-- Duration before despawning (Default: 600) -->
        <updateInterval>60</updateInterval>            <!-- How frequently it will attract new targets (Default: 60) -->
        <range>9.9</range>                             <!-- Range (Default: 9.9) -->
        <requireLOS>true</requireLOS>                  <!-- Will not attract enemies behind walls. (Default: True) -->
        <ignoredByOtherDecoys>true</ignoredByOtherDecoys> <!-- Targets will prioritize new decoys (Default: True) -->
        <destoyedByEMP>true</destoyedByEMP>            <!-- Can be destroyed with EMP damage, or any anti-mechanoid damage (Default: True) -->
        <targetFlags>Hostile, NonFaction</targetFlags> <!-- Who gets distracted by this decoy (Default: Hostile) -->
        <effecterDestroyed>Vomit</effecterDestroyed>   <!-- Create an effecter when destroyed -->
        <fleckDestroyed>                               <!-- Throw a FleckProps fleck when destroyed -->
            <fleckDef>BlastEMP</fleckDef>
            <randomRotation>true</randomRotation>
            <offset>(0.5, 0, 0.5)</offset>
        </fleckDestroyed>
    </li>
</comps>

List of targetFlags:

[Flags]
public enum DecoyTargetFlags
{
    Hostile = 0, // Pirates, mechanoids, manhunters, etc
    Neutral = 1, // Neutral factions, animals
    Colony = 2,  // Player faction
    NonFaction = 4, // Animals
    NeutralNoNonFaction = 8, // Neutral factions
    All = 16 // Everyone can target
}

🦩 Home

🚧 - 404 Page not found.
🖼 - Preview needed.

🟡 - Works but has some TODOs.
🟠 - Basic functionality implemented.
🔴 - Not working properly.
❓ - Not tested.


--== XML ==--

💡 Abilities

General

Ability Givers

Equipment Abilities

🟡 Should recode some stuff 🟡

🌳 Skill Trees

🟠 WIP, work/kill XP gain not implemented 🟠

Defs

Comps

🏘 Buildings

⚙ Comps

🏹 Equipment

General

Weapons

Projectiles

🧪 Hediffs

🧍‍♂‍ Pawn behaviors

📊 Stats

🎲 Misc

🧔 Vanilla Expanded

✨ Debug (Dev Mode)


--== C# ==--

📂 Shared Classes

🧬 Patches


Clone this wiki locally