Push Target - KonradHeinser/EBSGFramework GitHub Wiki

This ability comp combines the targeting system of teleportation with the movement of longjump to allow you to make abilities that throw pawns around. This is what the basic comp with the required fields looks like:

        <comps>
            <li Class="EBSGFramework.CompProperties_AbilityPushTarget">
                <range>10</range>
                <destination>Selected</destination>
            </li>
        </comps>

Required:

  • range : This is the maximum distance the target can be moved from their current location. This is separate from the range listed in the verb properties
  • destination : Determines how the destination is decided. It is recommended to leave this on Selected, but it can also be changed to Caster or RandomInRange

Optional:

  • maxBodySize : Default (999) : The maximum size the target can have before it become impossible to move
  • soundLanding : The SoundDef played upon landin
  • flightEffecterDef : The EffecterDef used for flight
  • flyWithCarriedThing : Default (True) : Determines if the pawn will be forced to drop stuff when pushed
  • successChance : A special item that dictates the chance of success. If you don't add this to the comp, then it will always work
    • baseSuccessChance : Default (1) : Chance of the ability to succeed, with 1 being 100%
    • casterStatChance : StatDef of the caster that is checked to determine success chance. Normally the higher above 0 this is, the higher the chance of success
    • casterStatEffect : Default (Multiply) : Dictates what the stat does to the chance. The options are Multiply, Divide, OneMinusMultiply, and OneMinusDivide. The OneMinus options mean 1 - Stat Value
    • targetStatChance : StatDef of the target that is checked to determine success chance. Normally the higher above 0 this is, the lower the chance of success
    • targetStatEffect : Default (Divide) : Dictates what the stat does to the chance. The options are Multiply, Divide, OneMinusMultiply, and OneMinusDivide. The OneMinus options mean 1 - Stat Value
    • successMessage : Optional. Message given if this comp succeeds and the caster is a player pawn
    • failureMessage : Optional. Message given if this comp fails and the caster is a player pawn

This simplistic example allows for throwing a pawn that is within a range of 30 up to 10 tiles away from its present location with a 90% chance of success

    <AbilityDef>
        <defName>TossAround</defName>
        <label>you tosser</label>
        <description>.</description>
        <iconPath>Things/Mote/SpeechSymbols/Speech</iconPath>
        <cooldownTicksRange>60</cooldownTicksRange>
        <hostile>true</hostile>
        <verbProperties>
            <verbClass>Verb_CastAbility</verbClass>
            <range>30</range>
            <warmupTime>0.5</warmupTime>
            <requireLineOfSight>False</requireLineOfSight>
            <soundCast>Longjump_Jump</soundCast>
            <targetParams>
                <canTargetSelf>False</canTargetSelf>
                <canTargetBuildings>False</canTargetBuildings>
            </targetParams>
        </verbProperties>
        <comps>
            <li Class="EBSGFramework.CompProperties_AbilityPushTarget">
                <range>10</range>
                <soundLanding>Longjump_Land</soundLanding>
                <flyWithCarriedThing>false</flyWithCarriedThing>
                <destination>Selected</destination>
                <successChance>
                    <baseSuccessChance>0.9</baseSuccessChance>
                </successChance>
            </li>
        </comps>
    </AbilityDef>
⚠️ **GitHub.com Fallback** ⚠️