Skip to content

CompRemoteExplosive

flango edited this page Nov 29, 2022 · 1 revision

×× Things that go kaboom! ××

Makes a thing (building, item, etc) explode with a press of a button or when destroyed.

Very customizable. See the list of available options below.

Preview


Type: Comp

XML Node: ThingDef/comps/li


List of options:

'string' commandLabel = "Detonate";
'string' commandDescription = "Make this thing go kaboom.";
'string' commandIcon;
'int' timerTicks; // Default: 0 (Explode instantly). 1 second = 60 ticks.
'float' range = 0.9f;
'DamageDef' damageDef; // Default: Bomb
'int' damage = -1; // Usually defaults to DamageDef base damage
'float' armorPenetration = -1; // Usually scales with damage
'ExplosionShape' explosionShape; // Normal, Star, CrossPlus, CrossX, Ring, RandomAdjacent
'SoundDef' soundDef; // Optional
'ThingDef' preExplosionSpawnThing;
'ThingDef' postExplosionSpawnThing;
'float' preExplosionSpawnChance;
'float' postExplosionSpawnChance;
'int' preExplosionSpawnCount;
'int' postExplosionSpawnCount;
'float' chanceToStartFire;
'bool' applyDamageToCellNeighbors;
'bool' damageFalloff;
'bool' destroyOnDetonation = true;
'bool' explodeOnDestroyed = true;
'bool' canBeCancelled;
'bool' showAlert = false; // "This thing will explode in X seconds."
'bool' drawWick = false; // A mote indicating that this thing is about to explode
'string' cancelLabel = "Cancel";
'string' cancelDescription = "Cancel kaboom.";
'string' cancelIcon;
'SoundDef' soundActivated;
'SoundDef' soundCancelled;
'SoundDef' sustainerSound; // Hissing sound
'EffecterDef' explosionEffecter; // Trigger an effecter after exploding
'FleckProps' fleck; // Spawn a fleck every X ticks after starting the timer
'FleckProps' explosionFleck; // Spawn X flecks after exploding
'int' explosionFleckCount;

Example:

<comps>
    <li Class="flangoCore.CompProperties_RemoteExplosive">
        <commandLabel>Detonate</commandLabel>
        <commandIcon>UI/Kaboom</commandIcon>
        <timerTicks>300</timerTicks>
        <range>3.9</range>
        <damageDef>Bomb</damageDef>
        <canBeCancelled>true</canBeCancelled>
        <cancelLabel>Cancel</cancelLabel>
        <cancelIcon>UI/Designators/Cancel</cancelIcon>
        <soundActivated>TurretAcquireTarget</soundActivated>
        <chanceToStartFire>0.25</chanceToStartFire>
        <explosionShape>Star</explosionShape>
        <sustainerSound>HissSmall</sustainerSound>
        <fleck>
            <fleckDef>Smoke</fleckDef>
            <intervalTicks>24</intervalTicks>
            <scaleRange>0.8~1</scaleRange>
            <offset>(0.5, 0, 0.9)</offset>
            <randomRotation>true</randomRotation>
            <rotationRate>10</rotationRate>
            <velocityAngle>0~10</velocityAngle>
            <velocitySpeed>2~4</velocitySpeed>
            <solidTimeOverride>1</solidTimeOverride>
        </fleck>
        <explosionFleck>
            <fleckDef>Smoke</fleckDef>
            <scaleRange>0.8~1</scaleRange>
            <offset>(0.5, 0, 0.5)</offset>
            <randomRotation>true</randomRotation>
            <rotationRate>10</rotationRate>
            <velocityAngle>0~360</velocityAngle>
            <velocitySpeed>8~12</velocitySpeed>
            <colorMin>(0,0,0)</colorMin>
            <colorMax>(255,255,255)</colorMax>
            <solidTimeOverride>2</solidTimeOverride>
        </explosionFleck>
        <explosionFleckCount>1000</explosionFleckCount>
    </li>
</comps>

🦩 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