• 0

    posted a message on Cooldown gets refunded even though channeling is finished

    I am trying to make a slightly complicated multi-stage launch missile ability that has to be channeled before firing. It is essentially a jumping ability with a slight delay, but the complexity comes from the jump destination part.

    I have managed to successfully create the ability. By modeling the channeling with a persistent effect and calling launch missile afterwards as an expire effect works as intended. However, I'd also like to refund the cooldown if the channeling is cancelled by the player. I have also managed to do this using ability settings - but there is a problem that I am unable to solve.

    If the player cancels the ability right after the channeling is finished and launch missile is executed, the cooldown is still being refunded. This allows the player with good timing to keep jumping around without a cooldown. I don't understand why this is happening, as "Channeled" flag is set for only the channeling effect. Is everything after a channeling step is counted as channeling?

    Here's a snippet:

        <CEffectCreatePersistent id="JumpDelayPassthrough">
            <ValidatorArray value="JumpCastValidators"/>
            <EditorCategories value=""/>
            <Flags index="Channeled" value="1"/>
            <ExpireEffect value="JumpLaunchMissile"/>
            <PeriodCount value="1"/>
            <PeriodicPeriodArray value="2"/>
        </CEffectCreatePersistent>
        <CEffectLaunchMissile id="JumpLaunchMissile">
            <ValidatorArray value="JumpCastValidators"/>
            <EditorCategories value="Race:Terran"/>
            <ImpactLocation Value="TargetPoint"/>
            <Flags index="Placement" value="1"/>
            <Movers Link="Jump"/>
            <DeathType value="Unknown"/>
        </CEffectLaunchMissile>
    

    And for the ability:

        <CAbilEffectTarget id="Jump">
            <OrderArray index="0" DisplayType="Legacy"/>
            <EditorCategories value="Race:Terran,AbilityorEffectType:Units"/>
            <Effect index="0" value="JumpSwitch"/>
            <Flags index="NoDeceleration" value="1"/>
            <Flags index="RequireTargetVision" value="0"/>
            <Cost>
                <Cooldown TimeUse="8"/>
            </Cost>
            <Range value="10"/>
            <CastIntroTime value="0"/>
            <AINotifyEffect value=""/>
            <CmdButtonArray index="Execute" DefaultButtonFace="Jump" Requirements="Jump">
                <Flags index="ToSelection" value="1"/>
            </CmdButtonArray>
            <RefundArray index="Channel" value="1"/>
        </CAbilEffectTarget>
    

    I omitted JumpSwitch and validators as I don't think they are relevant. Assume JumpSwitch calls JumpDelayPassthrough.

    Thanks in advance.

    Posted in: Data
  • To post a comment, please or register a new account.