diff --git a/Anomaly/Patches/AbilityDefs/Abilities_Anomaly.xml b/Anomaly/Patches/AbilityDefs/Abilities_Anomaly.xml index e617232d14..dc83c644d7 100644 --- a/Anomaly/Patches/AbilityDefs/Abilities_Anomaly.xml +++ b/Anomaly/Patches/AbilityDefs/Abilities_Anomaly.xml @@ -1,6 +1,14 @@ + + Defs/AbilityDef[@Name="SpikeLaunchBase"]/verbProperties/verbClass + + CombatExtended.Verb_AbilityShootCE + + + + diff --git a/Source/CombatExtended/CombatExtended/Verbs/Verb_AbilityShootCE.cs b/Source/CombatExtended/CombatExtended/Verbs/Verb_AbilityShootCE.cs new file mode 100644 index 0000000000..59aae395ff --- /dev/null +++ b/Source/CombatExtended/CombatExtended/Verbs/Verb_AbilityShootCE.cs @@ -0,0 +1,39 @@ + +using RimWorld; +using Verse; + +namespace CombatExtended +{ + public class Verb_AbilityShootCE : Verb_ShootCE, IAbilityVerb + { + private Ability ability; + + public Ability Ability + { + get + { + return ability; + } + set + { + ability = value; + } + } + + public override bool TryCastShot() + { + bool flag = base.TryCastShot(); + if (flag) + { + ability.StartCooldown(ability.def.cooldownTicksRange.RandomInRange); + } + return flag; + } + + public override void ExposeData() + { + Scribe_References.Look(ref ability, "ability"); + base.ExposeData(); + } + } +}