-
Notifications
You must be signed in to change notification settings - Fork 259
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add CE Verb for Anomaly launching abilities
- Loading branch information
Showing
2 changed files
with
47 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
39 changes: 39 additions & 0 deletions
39
Source/CombatExtended/CombatExtended/Verbs/Verb_AbilityShootCE.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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(); | ||
} | ||
} | ||
} |