Skip to content

Commit

Permalink
Added an extra parameter to allow for saving cooldowns in other projects
Browse files Browse the repository at this point in the history
  • Loading branch information
jecrell committed Jun 5, 2017
1 parent 202d7ea commit 2d7f72d
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 2 deletions.
Binary file modified Assemblies/AbilityUser.dll
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -44,10 +44,11 @@ public List<PawnAbility> AllPowers
}
public List<Verb_UseAbility> AbilityVerbs = new List<Verb_UseAbility>();

public void AddPawnAbility(AbilityDef abilityDef, bool activenow = true) => this.AddAbilityInternal(abilityDef, ref this.Powers, activenow); public void AddWeaponAbility(AbilityDef abilityDef, bool activenow = true) => this.AddAbilityInternal(abilityDef, ref this.temporaryWeaponPowers, activenow); public void AddApparelAbility(AbilityDef abilityDef, bool activenow = true) => this.AddAbilityInternal(abilityDef, ref this.temporaryApparelPowers, activenow); private void AddAbilityInternal(AbilityDef abilityDef, ref List<PawnAbility> thelist, bool activenow)
public void AddPawnAbility(AbilityDef abilityDef, bool activenow = true, float savedTicks = -1) => this.AddAbilityInternal(abilityDef, ref this.Powers, activenow, savedTicks); public void AddWeaponAbility(AbilityDef abilityDef, bool activenow = true, float savedTicks = -1) => this.AddAbilityInternal(abilityDef, ref this.temporaryWeaponPowers, activenow, savedTicks); public void AddApparelAbility(AbilityDef abilityDef, bool activenow = true, float savedTicks = -1) => this.AddAbilityInternal(abilityDef, ref this.temporaryApparelPowers, activenow, savedTicks); private void AddAbilityInternal(AbilityDef abilityDef, ref List<PawnAbility> thelist, bool activenow, float savedTicks)
{
PawnAbility pa = new PawnAbility(this.AbilityUser, abilityDef);
if (activenow == false) pa.TicksUntilCasting = (int)(pa.powerdef.MainVerb.SecondsToRecharge * GenTicks.TicksPerRealSecond);
if (savedTicks != -1) pa.TicksUntilCasting = (int)savedTicks;
thelist.Add(pa);
this.UpdateAbilities();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ protected override IEnumerable<Toil> MakeNewToils()
//PsykerUtility.PsykerShockEvents(CompAbilityUser, CompAbilityUser.curPower.PowerLevel);
//}
this.CompAbilityUser.PostAbilityAttempt(this.pawn, verb.ability.powerdef);
this.CompAbilityUser.ShotFired = true;
//this.CompAbilityUser.ShotFired = true;
});
}
}
Expand Down

0 comments on commit 2d7f72d

Please sign in to comment.