Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix rangemod move preview #109

Merged
merged 1 commit into from
May 16, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ public void btnEditStartParams_Click()

public void btnEditUniversal_Click()
{
OpenItem<UniversalActiveEffect>("Universal Event", (UniversalActiveEffect)DataManager.Instance.UniversalEvent, (obj) => {
OpenItem<UniversalBaseEffect>("Universal Event", (UniversalBaseEffect)DataManager.Instance.UniversalEvent, (obj) => {
DataManager.Instance.UniversalEvent = obj;
DataManager.SaveData(PathMod.HardMod(DataManager.DATA_PATH + "Universal" + DataManager.DATA_EXT), obj);
});
Expand Down
6 changes: 4 additions & 2 deletions RogueEssence/Data/ActiveEffect.cs
Original file line number Diff line number Diff line change
Expand Up @@ -218,12 +218,14 @@ public int GetTotalCount()
}

[Serializable]
public class UniversalActiveEffect : ActiveEffect
public abstract class UniversalBaseEffect : ActiveEffect
{
public List<ZoneStep> ZoneSteps;
public UniversalActiveEffect() : base()
public UniversalBaseEffect() : base()
{
this.ZoneSteps = new List<ZoneStep>();
}

public abstract int GetRange(Character character, ref SkillData entry);
}
}
4 changes: 2 additions & 2 deletions RogueEssence/Data/DataManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -235,7 +235,7 @@ public static void InitInstance()
/// </summary>
public string GenUnbreakable;

public UniversalActiveEffect UniversalEvent;
public UniversalBaseEffect UniversalEvent;

public TypeDict<BaseData> UniversalData;

Expand Down Expand Up @@ -333,7 +333,7 @@ public void InitBase()


Version oldVersion = DevHelper.GetVersion(PathMod.ModPath(DATA_PATH + "Universal" + DATA_EXT));
UniversalEvent = LoadData<UniversalActiveEffect>(PathMod.ModPath(DATA_PATH + "Universal" + DATA_EXT));
UniversalEvent = LoadData<UniversalBaseEffect>(PathMod.ModPath(DATA_PATH + "Universal" + DATA_EXT));

UniversalData = LoadData<TypeDict<BaseData>>(PathMod.ModPath(MISC_PATH + "Index" + DATA_EXT));
LoadStartParams();
Expand Down
2 changes: 1 addition & 1 deletion RogueEssence/Dungeon/DungeonScene.cs
Original file line number Diff line number Diff line change
Expand Up @@ -876,7 +876,7 @@ public void CalculateMovePreviews(int previewMove)


// TODO: figure out a way to calculate the rangeMod
int rangeMod = 0;
int rangeMod = DataManager.Instance.UniversalEvent.GetRange(FocusedCharacter, ref data);
bool canViewPastWalls = false;

if (hitbox is AreaAction)
Expand Down