Skip to content

Commit

Permalink
Logging Changes
Browse files Browse the repository at this point in the history
  • Loading branch information
ebuckle authored Jun 6, 2020
1 parent d503865 commit e555cf2
Show file tree
Hide file tree
Showing 10 changed files with 5 additions and 20 deletions.
2 changes: 0 additions & 2 deletions Components/CheatDeath.cs
Original file line number Diff line number Diff line change
Expand Up @@ -19,13 +19,11 @@ public override void OnEventDidTrigger(RuleDealDamage evt)
{
if (evt.Target.Damage < 0)
{
Main.logger.Log(evt.Target.Damage + " is less than zero.");
return;
}

if (evt.Target.Descriptor.Resources.GetResourceAmount(resource) < 1)
{
Main.logger.Log("Not enough Panache.");
return;
}

Expand Down
4 changes: 0 additions & 4 deletions Components/DerringDo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -34,17 +34,14 @@ private int calculateExplodingDice(RuleSkillCheck evt)
RuleRollDice rule = new RuleRollDice(evt.Initiator, dice_formula);
int roll = this.Fact.MaybeContext.TriggerRule<RuleRollDice>(rule).Result;
total += roll;
Main.logger.Log("Roll 1 was a " + roll);
if (roll == 6)
{
Main.logger.Log("Exploding!");
int attempts = Owner.Stats.Dexterity.Bonus > 0 ? Owner.Stats.Dexterity.Bonus : 1;
for (int x = 0; x < attempts; x++)
{
rule = new RuleRollDice(evt.Initiator, dice_formula);
roll = this.Fact.MaybeContext.TriggerRule<RuleRollDice>(rule).Result;
total += roll;
Main.logger.Log("Extra attempt " + x + " was a " + roll);
if (roll != 6)
{
break;
Expand Down Expand Up @@ -73,7 +70,6 @@ public override void OnEventAboutToTrigger(RuleSkillCheck evt)
will_spend = need_resource;

int result = calculateExplodingDice(evt);
Main.logger.Log("Adding bonus of " + result + " to check");
evt.Bonus.AddModifier(result, this, ModifierDescriptor.UntypedStackable);
}

Expand Down
5 changes: 0 additions & 5 deletions Components/DodgingPanache.cs
Original file line number Diff line number Diff line change
Expand Up @@ -35,32 +35,27 @@ private int getResourceCost(RuleAttackWithWeapon evt)

public override void OnEventAboutToTrigger(RuleAttackWithWeapon evt)
{
Main.logger.Log("About to be attacked");
if (!evt.Weapon.Blueprint.IsMelee)
{
Main.logger.Log("Attack was not with a melee weapon");
return;
}
will_spend = 0;
int need_resource = getResourceCost(evt);
if (evt.Target.Descriptor.Resources.GetResourceAmount(resource) < need_resource)
{
Main.logger.Log("Not enough resource - had " + evt.Target.Descriptor.Resources.GetResourceAmount(resource) + " and needed " + need_resource);
return;
}

will_spend = need_resource;

bonus = Owner.Stats.Charisma.Bonus > 0 ? Owner.Stats.Charisma.Bonus : 0;
Main.logger.Log("Adding bonus of " + bonus + " to AC");
evt.AddTemporaryModifier(evt.Target.Stats.AC.AddModifier(bonus, this, ModifierDescriptor.Dodge));
}

public override void OnEventDidTrigger(RuleAttackWithWeapon evt)
{
if (will_spend > 0)
{
Main.logger.Log("Spending " + will_spend + " panache");
evt.Target.Descriptor.Resources.Spend(resource, will_spend);
}
IFactContextOwner factContextOwner = base.Fact as IFactContextOwner;
Expand Down
1 change: 0 additions & 1 deletion Components/PreciseStrike.cs
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@ public override void OnEventAboutToTrigger(RuleAttackRoll evt)
{
if (is_passive && evt.Initiator.Descriptor.Resources.GetResourceAmount(resource) < need_resource)
{
Main.logger.Log("Not enough resource - had " + evt.Target.Descriptor.Resources.GetResourceAmount(resource) + " and needed " + need_resource);
return;
}

Expand Down
4 changes: 0 additions & 4 deletions Components/SwashbucklerInitiative.cs
Original file line number Diff line number Diff line change
Expand Up @@ -23,16 +23,12 @@ private int getResourceAmount(RuleInitiativeRoll evt)

public override void OnEventAboutToTrigger(RuleInitiativeRoll evt)
{
Main.logger.Log("About to roll initiative");

int need_resource = getResourceAmount(evt);

if (evt.Initiator.Descriptor.Resources.GetResourceAmount(resource) < need_resource)
{
Main.logger.Log("Not enough resource - had " + evt.Initiator.Descriptor.Resources.GetResourceAmount(resource) + " and needed " + need_resource);
return;
}
Main.logger.Log("Adding bonus of " + bonus + " to the roll.");
evt.AddTemporaryModifier(Owner.Stats.Initiative.AddModifier(bonus, this, ModifierDescriptor.UntypedStackable));
}

Expand Down
4 changes: 2 additions & 2 deletions Derring-Do.sln
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ Global
Release|Any CPU = Release|Any CPU
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{5AA889BE-4258-449B-8E54-C466AFD373F3}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{5AA889BE-4258-449B-8E54-C466AFD373F3}.Debug|Any CPU.Build.0 = Debug|Any CPU
{5AA889BE-4258-449B-8E54-C466AFD373F3}.Debug|Any CPU.ActiveCfg = Release|Any CPU
{5AA889BE-4258-449B-8E54-C466AFD373F3}.Debug|Any CPU.Build.0 = Release|Any CPU
{5AA889BE-4258-449B-8E54-C466AFD373F3}.Release|Any CPU.ActiveCfg = Release|Any CPU
{5AA889BE-4258-449B-8E54-C466AFD373F3}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
Expand Down
1 change: 0 additions & 1 deletion Main.cs
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,6 @@ static class LibraryScriptableObject_LoadDictionary_Patch
{
static void Postfix(LibraryScriptableObject __instance)
{
logger.Log("Reached POSTFIX");
var self = __instance;
if (Main.library != null) return;
Main.library = self;
Expand Down
1 change: 1 addition & 0 deletions Swashbuckler/InspiredBlade.cs
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ public class InspiredBlade

static public void create()
{
Main.DebugLog("Creating Inspired Blade archetype");
inspired_blade = Helpers.Create<BlueprintArchetype>(a =>
{
a.name = "InspiredBladeArchetype";
Expand Down
2 changes: 1 addition & 1 deletion Swashbuckler/Swashbuckler.cs
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ public class Swashbuckler

internal static void createSwashbucklerClass()
{

Main.DebugLog("Creating Swashbuckler class");
var duelist_class = GetClass("4e0ea99612ae87a499c7fb0588e31828");
var fighter_class = GetClass("48ac8db94d5de7645906c7d0ad3bcfbd");
var magus_class = GetClass("45a4607686d96a1498891b3286121780");
Expand Down
1 change: 1 addition & 0 deletions Swashbuckler/SwashbucklerFeats.cs
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ public class SwashbucklerFeats

static public void createFeats()
{
Main.DebugLog("Creating Feats");
var panache = Swashbuckler.panache;
var panache_resource = Swashbuckler.panache_resource;

Expand Down

0 comments on commit e555cf2

Please sign in to comment.