-
Notifications
You must be signed in to change notification settings - Fork 366
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* feat: random drops * silent rename quantity * remove extra spaces * added notifiable drop logic to the npc editor * change selected index on add * added notifiable drop logic to the resource editor --------- Co-authored-by: Robbie Lodico <pandacoder@pm.me>
- Loading branch information
1 parent
f391d19
commit 241e419
Showing
11 changed files
with
2,980 additions
and
2,883 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,30 @@ | ||
using Newtonsoft.Json; | ||
|
||
namespace Intersect.GameObjects; | ||
|
||
public partial class Drop | ||
{ | ||
private int _maxQuantity; | ||
|
||
public double Chance { get; set; } | ||
|
||
public Guid ItemId { get; set; } | ||
|
||
public int Quantity { get; set; } | ||
} | ||
[JsonProperty] | ||
[Obsolete(message: $"Use {nameof(MinQuantity)} instead, the Quantity property will be removed in 0.9-beta", error: true)] | ||
private int Quantity | ||
{ | ||
/* Setter only [JsonProperty] annotated private property to "silently" rename Quantity to MinQuantity */ | ||
set => MinQuantity = value; | ||
} | ||
|
||
/* By renaming Quantity to MinQuantity the "automatic" range given an original "Quantity" value of 3 will be 3 to 3, instead of 1 to 3 or 0 to 3 */ | ||
public int MinQuantity { get; set; } = 1; | ||
|
||
public int MaxQuantity | ||
{ | ||
/* Special getter ensures that MaxQuantity can never be less than MinQuantity, and it doesn't need a non-zero default value as a result */ | ||
get => Math.Max(_maxQuantity, MinQuantity); | ||
set => _maxQuantity = value; | ||
} | ||
} |
3,601 changes: 1,766 additions & 1,835 deletions
3,601
Intersect.Editor/Forms/Editors/frmNpc.Designer.cs
Large diffs are not rendered by default.
Oops, something went wrong.
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
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
Oops, something went wrong.