Skip to content

Commit

Permalink
Add CE Verb for Anomaly launching abilities
Browse files Browse the repository at this point in the history
  • Loading branch information
Thorbane committed Jun 7, 2024
1 parent 174711c commit 9a613a4
Show file tree
Hide file tree
Showing 2 changed files with 47 additions and 0 deletions.
8 changes: 8 additions & 0 deletions Anomaly/Patches/AbilityDefs/Abilities_Anomaly.xml
Original file line number Diff line number Diff line change
@@ -1,6 +1,14 @@
<?xml version="1.0" encoding="utf-8"?>
<Patch>

<Operation Class="PatchOperationReplace">
<xpath>Defs/AbilityDef[@Name="SpikeLaunchBase"]/verbProperties/verbClass</xpath>
<value>
<verbClass>CombatExtended.Verb_AbilityShootCE</verbClass>
</value>
</Operation>


<!-- ========== Spike Base ========== -->

<Operation Class="PatchOperationReplace">
Expand Down
39 changes: 39 additions & 0 deletions Source/CombatExtended/CombatExtended/Verbs/Verb_AbilityShootCE.cs
Original file line number Diff line number Diff line change
@@ -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();
}
}
}

0 comments on commit 9a613a4

Please sign in to comment.