Skip to content

Commit

Permalink
Minor changes to TrueBurst
Browse files Browse the repository at this point in the history
  • Loading branch information
jecrell committed Jun 20, 2017
1 parent dd414aa commit 67b32c7
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 44 deletions.
Binary file modified Assemblies/AbilityUser.dll
Binary file not shown.
Binary file modified Assemblies/CompVehicle.dll
Binary file not shown.
Binary file modified Source/.vs/JecsTools/v15/.suo
Binary file not shown.
54 changes: 12 additions & 42 deletions Source/AllModdingComponents/CompAbilityUser/CompAbilityUser.cs
Original file line number Diff line number Diff line change
Expand Up @@ -34,11 +34,13 @@ public List<PawnAbility> AllPowers
{
get
{
if (this.allPowers != null) return allPowers;
allPowers = new List<PawnAbility>();
if (this.Powers != null && this.Powers.Count > 0) allPowers.AddRange(this.Powers);
if (this.temporaryApparelPowers != null && this.temporaryApparelPowers.Count > 0) allPowers.AddRange(this.temporaryApparelPowers);
if (this.temporaryWeaponPowers != null && this.temporaryWeaponPowers.Count > 0) allPowers.AddRange(this.temporaryWeaponPowers);
if (this.allPowers == null)
{
allPowers = new List<PawnAbility>();
if (!this.Powers.NullOrEmpty()) allPowers.AddRange(this.Powers);
if (!this.temporaryApparelPowers.NullOrEmpty()) allPowers.AddRange(this.temporaryApparelPowers);
if (!this.temporaryWeaponPowers.NullOrEmpty()) allPowers.AddRange(this.temporaryWeaponPowers);
}
return allPowers;
}
set
Expand Down Expand Up @@ -135,14 +137,6 @@ public override IEnumerable<Gizmo> CompGetGizmosExtra()

public override void PostExposeData()
{
//Scribe_Collections.Look<PawnAbility>(ref this.temporaryApparelPowers, "temporaryApparelPowers", LookMode.Deep, new object[]
// {
// this,
// });
//Scribe_Collections.Look<PawnAbility>(ref this.temporaryWeaponPowers, "temporaryWeaponPowers", LookMode.Deep, new object[]
// {
// this,
// });
Scribe_Collections.Look<PawnAbility>(ref this.Powers, "Powers", LookMode.Deep, new object[]
{
this,
Expand Down Expand Up @@ -191,50 +185,26 @@ public void UpdateAbilities()
{
if (this.IsInitialized)
{

this.AbilityVerbs.Clear();
List<PawnAbility> abList = new List<PawnAbility>();

abList.AddRange(this.Powers);
abList.AddRange(this.temporaryWeaponPowers);
abList.AddRange(this.temporaryApparelPowers);

this.AllPowers.Clear();
List<PawnAbility> abList = new List<PawnAbility>();
if (!this.Powers.NullOrEmpty()) abList.AddRange(this.Powers);
if (!this.temporaryWeaponPowers.NullOrEmpty()) abList.AddRange(this.temporaryWeaponPowers);
if (!this.temporaryApparelPowers.NullOrEmpty()) abList.AddRange(this.temporaryApparelPowers);

this.AllPowers = abList;

// Log.Message("UpdateAbilities : with "+this.allPowers.Count+" powers");


for (int i = 0; i < this.AllPowers.Count; i++)
{
Verb_UseAbility newVerb = (Verb_UseAbility)Activator.CreateInstance(abList[i].powerdef.MainVerb.verbClass);
if (!this.AbilityVerbs.Any(item => item.verbProps == newVerb.verbProps))
{
////Log.Message("UpdateAbilities: Added to AbilityVerbs");
newVerb.caster = this.AbilityUser;
newVerb.ability = abList[i];
newVerb.verbProps = abList[i].powerdef.MainVerb;
this.AbilityVerbs.Add(newVerb);
}
}

/*
this.pawnAbilities.Clear();
foreach (PawnAbility pow in abList)
{
Verb_UseAbility newVerb = (Verb_UseAbility)Activator.CreateInstance(pow.powerdef.MainVerb.verbClass);
if (!AbilityVerbs.Any(item => item.verbProps == newVerb.verbProps))
{
////Log.Message("UpdateAbilities: Added to pawnAbilities");
newVerb.caster = this.abilityUser;
newVerb.ability = pow;
newVerb.verbProps = pow.powerdef.MainVerb;
pawnAbilities.Add(pow, newVerb);
}
}
// //Log.Message(this.PawnAbilitys.Count.ToString());
*/
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ protected override bool TryCastShot()
bool result = false;
this.TargetsAoE.Clear();
UpdateTargets();
//int burstShots = this.ShotsPerBurst;
int burstShots = this.ShotsPerBurst;
if (this.UseAbilityProps.AbilityTargetCategory != AbilityTargetCategory.TargetAoE && this.TargetsAoE.Count > 1)
{
this.TargetsAoE.RemoveRange(0, this.TargetsAoE.Count - 1);
Expand All @@ -41,7 +41,7 @@ protected override bool TryCastShot()
}

// here, might want to have this set each time so people don't force stop on last burst and not hit the cooldown?
this.burstShotsLeft = 0;
//this.burstShotsLeft = 0;
if (this.burstShotsLeft == 0)
{
this.ability.TicksUntilCasting = (int)this.UseAbilityProps.SecondsToRecharge * GenTicks.TicksPerRealSecond;
Expand Down

0 comments on commit 67b32c7

Please sign in to comment.