feature-attributes #7

Merged
zephyr merged 10 commits from feature-attributes into main 2023-07-30 10:58:19 -05:00
2 changed files with 7 additions and 4 deletions
Showing only changes of commit 3b1b4a90b7 - Show all commits

View File

@ -1,10 +1,14 @@
using System;
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
zephyr marked this conversation as resolved Outdated

Missing SO suffix

Missing SO suffix

I think this should go back to a struct rather than an SO. But it also seems like that makes it so the editor can't see them. Might need to implement a custom editor?

I think this should go back to a struct rather than an SO. But it also seems like that makes it so the editor can't see them. Might need to implement a custom editor?
public class Attribute : ScriptableObject
[Serializable]
public struct Attribute
{
public long Base { get; set; }
public long Base;
public Attribute(long stat) { Base = stat; }
/// <summary>
/// Calculates the stat value with accumulated buff and debuff modifiers.

View File

@ -17,8 +17,7 @@ public class AttributeTest
[TestCase(1000000, 0, -20000, 0, ExpectedResult = 0)]
public long Value(long startStat, long baseBonus, long permyriadBonus, long flatBonus)
{
var attr = ScriptableObject.CreateInstance<Attribute>();
attr.Base = startStat;
var attr = new Attribute(startStat);
var effect = EffectSO.New(baseBonus, permyriadBonus, flatBonus);
return attr.Calc(effect);
}