Skip to content

Commit

Permalink
added announceMobDrops config option
Browse files Browse the repository at this point in the history
  • Loading branch information
RenderBr committed Nov 21, 2022
1 parent 1385d76 commit 7430565
Show file tree
Hide file tree
Showing 8 changed files with 9 additions and 2 deletions.
Binary file modified .vs/ProjectEvaluation/simpleecon.metadata.v5.2
Binary file not shown.
Binary file modified .vs/ProjectEvaluation/simpleecon.projects.v5.2
Binary file not shown.
Binary file modified .vs/SimpleEcon/DesignTimeBuild/.dtbcache.v2
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file modified .vs/SimpleEcon/v17/.futdcache.v2
Binary file not shown.
1 change: 1 addition & 0 deletions SimpleEcon/Config.cs
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ public class Config
public List<int> excludedMobs { get; set; } = new List<int>() { 211, 210 };

public bool enableMobDrops { get; set; } = false;
public bool announceMobDrops { get; set; } = true;
public bool giveRewardsForPlaytime { get; set; } = false;
public int rewardtimer { get; set; } = 5;

Expand Down
10 changes: 8 additions & 2 deletions SimpleEcon/SimpleEcon.cs
Original file line number Diff line number Diff line change
Expand Up @@ -198,6 +198,14 @@ public void OnNpcStrike(SendDataEventArgs args)
color = Color.Red;
}

PlayerManager.GetPlayer(player.Name).balance += totalGiven;

if(config.announceMobDrops == false)
{
return;
}


if (totalGiven == 1)
{
player.SendMessage("+ " + totalGiven + " " + config.currencyNameSingular + " from killing " + npc.FullName, color);
Expand All @@ -206,8 +214,6 @@ public void OnNpcStrike(SendDataEventArgs args)
{
player.SendMessage("+ " + totalGiven + " " + config.currencyNamePlural + " from killing " + npc.FullName, color);
}

PlayerManager.GetPlayer(player.Name).balance += totalGiven;
}
}

Expand Down

0 comments on commit 7430565

Please sign in to comment.