Skip to content

Commit

Permalink
Merge pull request #343 from FFXIV-CombatReborn/WHM
Browse files Browse the repository at this point in the history
WHM Base2.0
  • Loading branch information
LTS-FFXIV authored Sep 11, 2024
2 parents e00a162 + ec3716d commit a67a0a1
Show file tree
Hide file tree
Showing 3 changed files with 161 additions and 71 deletions.
24 changes: 9 additions & 15 deletions RotationSolver.Basic/Configuration/Configs.cs
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,8 @@ public const string
List2 = "List2",
Debug = "Debug";

public int Version { get; set; } = 10;
public const int CurrentVersion = 11;
public int Version { get; set; } = CurrentVersion;

public string LastSeenChangelog { get; set; } = "0.0.0.0";
public bool FirstTimeSetupDone { get; set; } = false;
Expand Down Expand Up @@ -689,19 +690,12 @@ public void Save()

public static Configs Migrate(Configs oldConfigs)
{
return oldConfigs; // Disable migration until a better solution can be found.
//var newConfigs = new Configs();

//JObject oldJson = JObject.FromObject(oldConfigs);
//JObject newJson = JObject.FromObject(newConfigs);

//newJson.Merge(oldJson, new JsonMergeSettings
//{
// MergeArrayHandling = MergeArrayHandling.Union,
// MergeNullValueHandling = MergeNullValueHandling.Merge
//});

//var migratedConfigs = newJson.ToObject<Configs>();
//return migratedConfigs ?? new Configs();
// Implement migration logic if needed
if (oldConfigs.Version != CurrentVersion)
{
// Reset to default if versions do not match
return new Configs();
}
return oldConfigs;
}
}
203 changes: 147 additions & 56 deletions RotationSolver.Basic/Rotations/Basic/WhiteMageRotation.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ partial class WhiteMageRotation
/// <inheritdoc/>
public override MedicineType MedicineType => MedicineType.Mind;

private protected sealed override IBaseAction Raise => RaisePvE;

#region Job Gauge
/// <summary>
///
Expand Down Expand Up @@ -38,36 +40,78 @@ partial class WhiteMageRotation
/// <returns></returns>
protected static bool LilyAfterGCD(uint gcdCount = 0, float offset = 0)
=> LilyAfter(GCDTime(gcdCount, offset));

/// <summary>
/// Holds the remaining amount of SacredSight stacks
/// </summary>
public static byte SacredSightStacks
{
get
{
byte stacks = Player.StatusStack(true, StatusID.SacredSight);
return stacks == byte.MaxValue ? (byte)3 : stacks;
}
}

/// <inheritdoc/>
public override void DisplayStatus()
{
ImGui.Text("SacredSightStacks: " + SacredSightStacks.ToString());
}
#endregion

private protected sealed override IBaseAction Raise => RaisePvE;
#region PvE Actions
static partial void ModifyStonePvE(ref ActionSetting setting)
{

static partial void ModifyMedicaIiPvE(ref ActionSetting setting)
}

static partial void ModifyCurePvE(ref ActionSetting setting)
{
setting.StatusProvide = [StatusID.MedicaIi, StatusID.TrueMedicaIi];
setting.CreateConfig = () => new ActionConfig()
{
AoeCount = 1,
};

}

static partial void ModifyAeroPvE(ref ActionSetting setting)
{
setting.TargetStatusProvide = [
StatusID.Aero,
StatusID.AeroIi,
StatusID.Dia,
];
}

static partial void ModifyMedicaPvE(ref ActionSetting setting)
{
setting.CreateConfig = () => new ActionConfig()
{
AoeCount = 1,
};
}

static partial void ModifyRaisePvE(ref ActionSetting setting)
{

}

static partial void ModifyCureIiiPvE(ref ActionSetting setting)
static partial void ModifyStoneIiPvE(ref ActionSetting setting)
{

}

static partial void ModifyCureIiPvE(ref ActionSetting setting)
{
setting.UnlockedByQuestID = 65977;
}

static partial void ModifyPresenceOfMindPvE(ref ActionSetting setting)
{
setting.ActionCheck = () => InCombat;
setting.CreateConfig = () => new ActionConfig()
{
AoeCount = 1,
TimeToKill = 10,
};

setting.UnlockedByQuestID = 66615;
setting.StatusProvide = [StatusID.SacredSight];
}

static partial void ModifyRegenPvE(ref ActionSetting setting)
Expand All @@ -80,70 +124,56 @@ static partial void ModifyRegenPvE(ref ActionSetting setting)
setting.UnlockedByQuestID = 66616;
}

static partial void ModifyHolyPvE(ref ActionSetting setting)
{
setting.IsFriendly = false;
setting.UnlockedByQuestID = 66619;
}

static partial void ModifyHolyIiiPvE(ref ActionSetting setting)
{
setting.IsFriendly = false;
}

static partial void ModifyAfflatusSolacePvE(ref ActionSetting setting)
static partial void ModifyCureIiiPvE(ref ActionSetting setting)
{
setting.ActionCheck = () => Lily > 0;
setting.CreateConfig = () => new ActionConfig()
{
AoeCount = 1,
};
setting.UnlockedByQuestID = 66617;
}

static partial void ModifyDivineBenisonPvE(ref ActionSetting setting)
static partial void ModifyAetherialShiftPvE(ref ActionSetting setting)
{
setting.StatusProvide = [StatusID.DivineBenison];
setting.SpecialType = SpecialActionType.MovingForward;
}

static partial void ModifyAfflatusRapturePvE(ref ActionSetting setting)
static partial void ModifyHolyPvE(ref ActionSetting setting)
{
setting.ActionCheck = () => Lily > 0;
setting.IsFriendly = false;
setting.UnlockedByQuestID = 66619;
setting.CreateConfig = () => new ActionConfig()
{
AoeCount = 1,
AoeCount = 3,
};

}

static partial void ModifyAeroPvE(ref ActionSetting setting)
static partial void ModifyAeroIiPvE(ref ActionSetting setting)
{
setting.TargetStatusProvide =
[
setting.TargetStatusProvide = [
StatusID.Aero,
StatusID.AeroIi,
StatusID.Dia,
];
}

static partial void ModifyAfflatusMiseryPvE(ref ActionSetting setting)
static partial void ModifyMedicaIiPvE(ref ActionSetting setting)
{
setting.ActionCheck = () => BloodLily == 3;
setting.StatusProvide = [StatusID.MedicaIi, StatusID.TrueMedicaIi, StatusID.MedicaIii];
setting.CreateConfig = () => new ActionConfig()
{
AoeCount = 1,
};
}

static partial void ModifyCureIiiPvP(ref ActionSetting setting)
{
setting.StatusNeed = [StatusID.CureIiiReady];
setting.UnlockedByQuestID = 66617;
}

static partial void ModifyCureIiPvE(ref ActionSetting setting)
static partial void ModifyBenedictionPvE(ref ActionSetting setting)
{
setting.UnlockedByQuestID = 65977;
setting.UnlockedByQuestID = 66620;
}

static partial void ModifyBenedictionPvE(ref ActionSetting setting)
static partial void ModifyAfflatusSolacePvE(ref ActionSetting setting)
{
setting.UnlockedByQuestID = 66620;
setting.ActionCheck = () => Lily > 0 && BloodLily < 3;
}

static partial void ModifyAsylumPvE(ref ActionSetting setting)
Expand Down Expand Up @@ -172,51 +202,90 @@ static partial void ModifyAssizePvE(ref ActionSetting setting)
static partial void ModifyThinAirPvE(ref ActionSetting setting)
{
setting.UnlockedByQuestID = 67259;
setting.StatusProvide = [StatusID.ThinAir];
}

static partial void ModifyTetragrammatonPvE(ref ActionSetting setting)
{
setting.UnlockedByQuestID = 67261;
}

static partial void ModifyStoneIvPvE(ref ActionSetting setting)
{

}

static partial void ModifyDivineBenisonPvE(ref ActionSetting setting)
{
setting.StatusProvide = [StatusID.DivineBenison];
}

static partial void ModifyPlenaryIndulgencePvE(ref ActionSetting setting)
{
setting.UnlockedByQuestID = 67954;
setting.StatusProvide = [StatusID.Confession];
setting.CreateConfig = () => new ActionConfig()
{
AoeCount = 1,
};
}

static partial void ModifySeraphStrikePvP(ref ActionSetting setting)
static partial void ModifyDiaPvE(ref ActionSetting setting)
{
setting.SpecialType = SpecialActionType.MovingForward;
setting.TargetStatusProvide = [
StatusID.Aero,
StatusID.AeroIi,
StatusID.Dia,
];
}

// Dawntrail changes below
static partial void ModifyGlarePvE(ref ActionSetting setting)
{

}

static partial void ModifyPresenceOfMindPvE(ref ActionSetting setting)
static partial void ModifyAfflatusMiseryPvE(ref ActionSetting setting)
{
setting.ActionCheck = () => !IsMoving;
setting.ActionCheck = () => BloodLily == 3;
setting.CreateConfig = () => new ActionConfig()
{
TimeToKill = 10,
AoeCount = 1,
};
setting.UnlockedByQuestID = 66615;
setting.StatusProvide = [StatusID.SacredSight];
}

static partial void ModifyAetherialShiftPvE(ref ActionSetting setting)
static partial void ModifyAfflatusRapturePvE(ref ActionSetting setting)
{
setting.SpecialType = SpecialActionType.MovingForward;
setting.ActionCheck = () => Lily > 0 && BloodLily < 3;
setting.CreateConfig = () => new ActionConfig()
{
AoeCount = 1,
};
}

static partial void ModifyTemperancePvE(ref ActionSetting setting)
{
setting.StatusProvide = [StatusID.Temperance, StatusID.DivineGrace];
}

static partial void ModifyGlareIiiPvE(ref ActionSetting setting)
{

}

static partial void ModifyHolyIiiPvE(ref ActionSetting setting)
{
setting.IsFriendly = false;
setting.CreateConfig = () => new ActionConfig()
{
AoeCount = 3,
};
}

static partial void ModifyAquaveilPvE(ref ActionSetting setting)
{
setting.TargetStatusProvide = [StatusID.Aquaveil];
}

static partial void ModifyLiturgyOfTheBellPvE(ref ActionSetting setting)
{
setting.CreateConfig = () => new ActionConfig()
Expand All @@ -227,7 +296,16 @@ static partial void ModifyLiturgyOfTheBellPvE(ref ActionSetting setting)

static partial void ModifyGlareIvPvE(ref ActionSetting setting)
{
setting.StatusNeed = [StatusID.SacredSight];
setting.ActionCheck = () => SacredSightStacks > 0;
setting.CreateConfig = () => new ActionConfig()
{
AoeCount = 1,
};
}

static partial void ModifyMedicaIiiPvE(ref ActionSetting setting)
{
setting.StatusProvide = [StatusID.MedicaIi, StatusID.TrueMedicaIi, StatusID.MedicaIii];
setting.CreateConfig = () => new ActionConfig()
{
AoeCount = 1,
Expand All @@ -242,4 +320,17 @@ static partial void ModifyDivineCaressPvE(ref ActionSetting setting)
AoeCount = 1,
};
}
}
#endregion

#region PvP Actions
static partial void ModifyCureIiiPvP(ref ActionSetting setting)
{
setting.StatusNeed = [StatusID.CureIiiReady];
}

static partial void ModifySeraphStrikePvP(ref ActionSetting setting)
{
setting.SpecialType = SpecialActionType.MovingForward;
}
#endregion
}
5 changes: 5 additions & 0 deletions RotationSolver/RotationSolverPlugin.cs
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,12 @@ public RotationSolverPlugin(IDalamudPluginInterface pluginInterface)
File.ReadAllText(Svc.PluginInterface.ConfigFile.FullName))
?? new Configs();

// Check version and migrate or reset if necessary
var newConfigs = Configs.Migrate(oldConfigs);
if (newConfigs.Version != Configs.CurrentVersion)
{
newConfigs = new Configs(); // Reset to default if versions do not match
}
Service.Config = newConfigs;
}
else
Expand Down

0 comments on commit a67a0a1

Please sign in to comment.