Minimum value per level and enhanced damage item stats fix (#26)
* Added a temporary fix to have a minimum value of 1 for per level mods * Expose Stat Aliases and Type Aliases (#25) * Fixed setting a minimum value of 1 for per level item stats * Added minimum value of attack rating per level to be 15 * Added min value for replenish durability/quantity * Added fix for reading item modifiers - enhanced damage now works * Delete .idea/.gitignore * Delete .idea/d2go.iml * Delete .idea/modules.xml * Delete .idea/vcs.xml * Added gitignore file * Refactored code --------- Co-authored-by: dmeli <d.melia@outlook.fr> Co-authored-by: Arto Simonyan <artosimonyan@protonmail.com>
This commit is contained in:
@@ -123,14 +123,14 @@ func TestRule_Evaluate(t *testing.T) {
|
||||
{
|
||||
name: "Basic rule without stats or maxquantity",
|
||||
fields: fields{
|
||||
RawLine: "[type] == armor && [quality] == magic # #",
|
||||
RawLine: "[type] == assassinclaw && [class] == elite && [quality] == magic # #",
|
||||
Enabled: true,
|
||||
},
|
||||
args: args{
|
||||
item: data.Item{
|
||||
ID: 373,
|
||||
ID: 187,
|
||||
Identified: false,
|
||||
Name: "mageplate",
|
||||
Name: "GreaterTalons",
|
||||
Quality: item.QualityMagic,
|
||||
},
|
||||
},
|
||||
@@ -156,6 +156,29 @@ func TestRule_Evaluate(t *testing.T) {
|
||||
},
|
||||
want: RuleResultFullMatch,
|
||||
},
|
||||
{
|
||||
name: "Basic rule for a white superior item with enhanceddamage",
|
||||
fields: fields{
|
||||
RawLine: "[type] == sword # [enhanceddamage] >= 15 #",
|
||||
Enabled: true,
|
||||
},
|
||||
args: args{
|
||||
item: data.Item{
|
||||
Identified: true,
|
||||
ID: 234,
|
||||
Name: "colossusblade",
|
||||
Quality: item.QualitySuperior,
|
||||
Stats: []stat.Data{
|
||||
{ID: stat.EnhancedDamage, Value: 15},
|
||||
{ID: stat.MinDamage, Value: 28},
|
||||
{ID: stat.MaxDamage, Value: 74},
|
||||
{ID: stat.TwoHandedMinDamage, Value: 66},
|
||||
{ID: stat.TwoHandedMaxDamage, Value: 132},
|
||||
},
|
||||
},
|
||||
},
|
||||
want: RuleResultFullMatch,
|
||||
},
|
||||
}
|
||||
for _, tt := range tests {
|
||||
t.Run(tt.name, func(t *testing.T) {
|
||||
|
||||
Reference in New Issue
Block a user