mirror of
https://github.com/project-redbud/FunGame-Core.git
synced 2025-12-05 16:16:33 +00:00
插件接口参数更改;任务计划新增错误回调;魔法类型名称优化;行动顺序表优化
This commit is contained in:
parent
984a7fd5a1
commit
17914f1128
@ -59,6 +59,10 @@ namespace Milimoe.FunGame.Core.Api.Utility
|
|||||||
if (runtime == FunGameInfo.FunGame.FunGame_Desktop)
|
if (runtime == FunGameInfo.FunGame.FunGame_Desktop)
|
||||||
{
|
{
|
||||||
AddonManager.LoadGameMaps(loader.Maps, otherobjs);
|
AddonManager.LoadGameMaps(loader.Maps, otherobjs);
|
||||||
|
foreach (GameMap map in loader.Maps.Values.ToList())
|
||||||
|
{
|
||||||
|
map.AfterLoad(loader, otherobjs);
|
||||||
|
}
|
||||||
AddonManager.LoadGameModules(loader.Modules, loader.Characters, loader.Skills, loader.Items, delegates, otherobjs);
|
AddonManager.LoadGameModules(loader.Modules, loader.Characters, loader.Skills, loader.Items, delegates, otherobjs);
|
||||||
foreach (GameModule module in loader.Modules.Values.ToList())
|
foreach (GameModule module in loader.Modules.Values.ToList())
|
||||||
{
|
{
|
||||||
@ -71,6 +75,10 @@ namespace Milimoe.FunGame.Core.Api.Utility
|
|||||||
else if (runtime == FunGameInfo.FunGame.FunGame_Server)
|
else if (runtime == FunGameInfo.FunGame.FunGame_Server)
|
||||||
{
|
{
|
||||||
AddonManager.LoadGameMaps(loader.Maps, otherobjs);
|
AddonManager.LoadGameMaps(loader.Maps, otherobjs);
|
||||||
|
foreach (GameMap map in loader.Maps.Values.ToList())
|
||||||
|
{
|
||||||
|
map.AfterLoad(loader, otherobjs);
|
||||||
|
}
|
||||||
AddonManager.LoadGameModulesForServer(loader.ModuleServers, loader.Characters, loader.Skills, loader.Items, delegates, otherobjs);
|
AddonManager.LoadGameModulesForServer(loader.ModuleServers, loader.Characters, loader.Skills, loader.Items, delegates, otherobjs);
|
||||||
foreach (GameModuleServer server in loader.ModuleServers.Values.ToList())
|
foreach (GameModuleServer server in loader.ModuleServers.Values.ToList())
|
||||||
{
|
{
|
||||||
|
|||||||
@ -35,11 +35,12 @@ namespace Milimoe.FunGame.Core.Api.Utility
|
|||||||
/// <param name="name"></param>
|
/// <param name="name"></param>
|
||||||
/// <param name="timeOfDay"></param>
|
/// <param name="timeOfDay"></param>
|
||||||
/// <param name="action"></param>
|
/// <param name="action"></param>
|
||||||
public void AddTask(string name, TimeSpan timeOfDay, Action action)
|
/// <param name="error"></param>
|
||||||
|
public void AddTask(string name, TimeSpan timeOfDay, Action action, Action<Exception>? error = null)
|
||||||
{
|
{
|
||||||
lock (_lock)
|
lock (_lock)
|
||||||
{
|
{
|
||||||
ScheduledTask task = new(name, timeOfDay, action);
|
ScheduledTask task = new(name, timeOfDay, action, error);
|
||||||
if (DateTime.Now > DateTime.Today.Add(timeOfDay))
|
if (DateTime.Now > DateTime.Today.Add(timeOfDay))
|
||||||
{
|
{
|
||||||
task.LastRun = DateTime.Today.Add(timeOfDay);
|
task.LastRun = DateTime.Today.Add(timeOfDay);
|
||||||
@ -55,14 +56,15 @@ namespace Milimoe.FunGame.Core.Api.Utility
|
|||||||
/// <param name="interval"></param>
|
/// <param name="interval"></param>
|
||||||
/// <param name="action"></param>
|
/// <param name="action"></param>
|
||||||
/// <param name="startNow"></param>
|
/// <param name="startNow"></param>
|
||||||
public void AddRecurringTask(string name, TimeSpan interval, Action action, bool startNow = false)
|
/// <param name="error"></param>
|
||||||
|
public void AddRecurringTask(string name, TimeSpan interval, Action action, bool startNow = false, Action<Exception>? error = null)
|
||||||
{
|
{
|
||||||
lock (_lock)
|
lock (_lock)
|
||||||
{
|
{
|
||||||
DateTime now = DateTime.Now;
|
DateTime now = DateTime.Now;
|
||||||
now = new DateTime(now.Year, now.Month, now.Day, now.Hour, now.Minute, now.Second, 0);
|
now = new DateTime(now.Year, now.Month, now.Day, now.Hour, now.Minute, now.Second, 0);
|
||||||
DateTime nextRun = startNow ? now : now.Add(interval);
|
DateTime nextRun = startNow ? now : now.Add(interval);
|
||||||
RecurringTask recurringTask = new(name, interval, action)
|
RecurringTask recurringTask = new(name, interval, action, error)
|
||||||
{
|
{
|
||||||
NextRun = nextRun
|
NextRun = nextRun
|
||||||
};
|
};
|
||||||
@ -185,6 +187,8 @@ namespace Milimoe.FunGame.Core.Api.Utility
|
|||||||
catch (Exception ex)
|
catch (Exception ex)
|
||||||
{
|
{
|
||||||
task.Error = ex;
|
task.Error = ex;
|
||||||
|
TXTHelper.AppendErrorLog(ex.ToString());
|
||||||
|
task.ErrorHandler?.Invoke(ex);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
@ -206,6 +210,8 @@ namespace Milimoe.FunGame.Core.Api.Utility
|
|||||||
catch (Exception ex)
|
catch (Exception ex)
|
||||||
{
|
{
|
||||||
recurringTask.Error = ex;
|
recurringTask.Error = ex;
|
||||||
|
TXTHelper.AppendErrorLog(ex.ToString());
|
||||||
|
recurringTask.ErrorHandler?.Invoke(ex);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|||||||
@ -46,12 +46,12 @@ namespace Milimoe.FunGame.Core.Entity
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
/// 紫宛魔法抗性
|
/// 紫宛魔法抗性
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public double Fleabane { get; set; } = 0;
|
public double Aster { get; set; } = 0;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 时空魔法抗性
|
/// 时空魔法抗性
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public double Particle { get; set; } = 0;
|
public double SpatioTemporal { get; set; } = 0;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 平均魔法抗性
|
/// 平均魔法抗性
|
||||||
@ -60,7 +60,7 @@ namespace Milimoe.FunGame.Core.Entity
|
|||||||
{
|
{
|
||||||
get
|
get
|
||||||
{
|
{
|
||||||
double mdf = Calculation.Round4Digits((None + Starmark + PurityNatural + PurityContemporary + Bright + Shadow + Element + Fleabane + Particle) / 9) * 100;
|
double mdf = Calculation.Round4Digits((None + Starmark + PurityNatural + PurityContemporary + Bright + Shadow + Element + Aster + SpatioTemporal) / 9) * 100;
|
||||||
if (Calculation.IsApproximatelyZero(mdf)) mdf = 0;
|
if (Calculation.IsApproximatelyZero(mdf)) mdf = 0;
|
||||||
return mdf;
|
return mdf;
|
||||||
}
|
}
|
||||||
@ -83,8 +83,8 @@ namespace Milimoe.FunGame.Core.Entity
|
|||||||
MagicType.Bright => Bright,
|
MagicType.Bright => Bright,
|
||||||
MagicType.Shadow => Shadow,
|
MagicType.Shadow => Shadow,
|
||||||
MagicType.Element => Element,
|
MagicType.Element => Element,
|
||||||
MagicType.Fleabane => Fleabane,
|
MagicType.Aster => Aster,
|
||||||
MagicType.Particle => Particle,
|
MagicType.SpatioTemporal => SpatioTemporal,
|
||||||
_ => None
|
_ => None
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
@ -110,11 +110,11 @@ namespace Milimoe.FunGame.Core.Entity
|
|||||||
case MagicType.Element:
|
case MagicType.Element:
|
||||||
Element = value;
|
Element = value;
|
||||||
break;
|
break;
|
||||||
case MagicType.Fleabane:
|
case MagicType.Aster:
|
||||||
Fleabane = value;
|
Aster = value;
|
||||||
break;
|
break;
|
||||||
case MagicType.Particle:
|
case MagicType.SpatioTemporal:
|
||||||
Particle = value;
|
SpatioTemporal = value;
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
None = value;
|
None = value;
|
||||||
@ -133,8 +133,8 @@ namespace Milimoe.FunGame.Core.Entity
|
|||||||
if (assignment)
|
if (assignment)
|
||||||
{
|
{
|
||||||
None = value;
|
None = value;
|
||||||
Particle = value;
|
SpatioTemporal = value;
|
||||||
Fleabane = value;
|
Aster = value;
|
||||||
Element = value;
|
Element = value;
|
||||||
Shadow = value;
|
Shadow = value;
|
||||||
Bright = value;
|
Bright = value;
|
||||||
@ -145,8 +145,8 @@ namespace Milimoe.FunGame.Core.Entity
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
None += value;
|
None += value;
|
||||||
Particle += value;
|
SpatioTemporal += value;
|
||||||
Fleabane += value;
|
Aster += value;
|
||||||
Element += value;
|
Element += value;
|
||||||
Shadow += value;
|
Shadow += value;
|
||||||
Bright += value;
|
Bright += value;
|
||||||
@ -163,8 +163,8 @@ namespace Milimoe.FunGame.Core.Entity
|
|||||||
public void AddAllValue(double value)
|
public void AddAllValue(double value)
|
||||||
{
|
{
|
||||||
None += value;
|
None += value;
|
||||||
Particle += value;
|
SpatioTemporal += value;
|
||||||
Fleabane += value;
|
Aster += value;
|
||||||
Element += value;
|
Element += value;
|
||||||
Shadow += value;
|
Shadow += value;
|
||||||
Bright += value;
|
Bright += value;
|
||||||
@ -188,8 +188,8 @@ namespace Milimoe.FunGame.Core.Entity
|
|||||||
Bright = Bright,
|
Bright = Bright,
|
||||||
Shadow = Shadow,
|
Shadow = Shadow,
|
||||||
Element = Element,
|
Element = Element,
|
||||||
Fleabane = Fleabane,
|
Aster = Aster,
|
||||||
Particle = Particle
|
SpatioTemporal = SpatioTemporal
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -50,12 +50,12 @@ namespace Milimoe.FunGame.Core.Entity
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
/// 紫宛护盾
|
/// 紫宛护盾
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public double Fleabane { get; set; } = 0;
|
public double Aster { get; set; } = 0;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 时空护盾
|
/// 时空护盾
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public double Particle { get; set; } = 0;
|
public double SpatioTemporal { get; set; } = 0;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 总计物理护盾
|
/// 总计物理护盾
|
||||||
@ -65,7 +65,7 @@ namespace Milimoe.FunGame.Core.Entity
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
/// 总计魔法护盾
|
/// 总计魔法护盾
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public double TotalMagicial => None + Starmark + PurityNatural + PurityContemporary + Bright + Shadow + Element + Fleabane + Particle;
|
public double TotalMagicial => None + Starmark + PurityNatural + PurityContemporary + Bright + Shadow + Element + Aster + SpatioTemporal;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 获取或设置护盾值
|
/// 获取或设置护盾值
|
||||||
@ -87,8 +87,8 @@ namespace Milimoe.FunGame.Core.Entity
|
|||||||
MagicType.Bright => Bright,
|
MagicType.Bright => Bright,
|
||||||
MagicType.Shadow => Shadow,
|
MagicType.Shadow => Shadow,
|
||||||
MagicType.Element => Element,
|
MagicType.Element => Element,
|
||||||
MagicType.Fleabane => Fleabane,
|
MagicType.Aster => Aster,
|
||||||
MagicType.Particle => Particle,
|
MagicType.SpatioTemporal => SpatioTemporal,
|
||||||
_ => None
|
_ => None
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
@ -118,11 +118,11 @@ namespace Milimoe.FunGame.Core.Entity
|
|||||||
case MagicType.Element:
|
case MagicType.Element:
|
||||||
Element = value;
|
Element = value;
|
||||||
break;
|
break;
|
||||||
case MagicType.Fleabane:
|
case MagicType.Aster:
|
||||||
Fleabane = value;
|
Aster = value;
|
||||||
break;
|
break;
|
||||||
case MagicType.Particle:
|
case MagicType.SpatioTemporal:
|
||||||
Particle = value;
|
SpatioTemporal = value;
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
None = value;
|
None = value;
|
||||||
@ -152,8 +152,8 @@ namespace Milimoe.FunGame.Core.Entity
|
|||||||
Bright = Bright,
|
Bright = Bright,
|
||||||
Shadow = Shadow,
|
Shadow = Shadow,
|
||||||
Element = Element,
|
Element = Element,
|
||||||
Fleabane = Fleabane,
|
Aster = Aster,
|
||||||
Particle = Particle
|
SpatioTemporal = SpatioTemporal
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -61,10 +61,7 @@ namespace Milimoe.FunGame.Core.Entity
|
|||||||
builder.AppendLine($"攻击力:{ATK:0.##}" + (exATK != 0 ? $" [{BaseATK:0.##} {(exATK >= 0 ? "+" : "-")} {Math.Abs(exATK):0.##}]" : ""));
|
builder.AppendLine($"攻击力:{ATK:0.##}" + (exATK != 0 ? $" [{BaseATK:0.##} {(exATK >= 0 ? "+" : "-")} {Math.Abs(exATK):0.##}]" : ""));
|
||||||
double exDEF = ExDEF + ExDEF2 + ExDEF3;
|
double exDEF = ExDEF + ExDEF2 + ExDEF3;
|
||||||
builder.AppendLine($"物理护甲:{DEF:0.##}" + (exDEF != 0 ? $" [{BaseDEF:0.##} {(exMP >= 0 ? "+" : "-")} {Math.Abs(exDEF):0.##}]" : "") + $" ({PDR * 100:0.##}%)");
|
builder.AppendLine($"物理护甲:{DEF:0.##}" + (exDEF != 0 ? $" [{BaseDEF:0.##} {(exMP >= 0 ? "+" : "-")} {Math.Abs(exDEF):0.##}]" : "") + $" ({PDR * 100:0.##}%)");
|
||||||
double mdf = Calculation.Round4Digits((MDF.None + MDF.Starmark + MDF.PurityNatural + MDF.PurityContemporary +
|
builder.AppendLine($"魔法抗性:{MDF.Avg:0.##}%(平均)");
|
||||||
MDF.Bright + MDF.Shadow + MDF.Element + MDF.Fleabane + MDF.Particle) / 9) * 100;
|
|
||||||
if (Calculation.IsApproximatelyZero(mdf)) mdf = 0;
|
|
||||||
builder.AppendLine($"魔法抗性:{mdf:0.##}%(平均)");
|
|
||||||
double exSPD = AGI * GameplayEquilibriumConstant.AGItoSPDMultiplier + ExSPD;
|
double exSPD = AGI * GameplayEquilibriumConstant.AGItoSPDMultiplier + ExSPD;
|
||||||
builder.AppendLine($"行动速度:{SPD:0.##}" + (exSPD != 0 ? $" [{InitialSPD:0.##} {(exSPD >= 0 ? "+" : "-")} {Math.Abs(exSPD):0.##}]" : "") + $" ({ActionCoefficient * 100:0.##}%)");
|
builder.AppendLine($"行动速度:{SPD:0.##}" + (exSPD != 0 ? $" [{InitialSPD:0.##} {(exSPD >= 0 ? "+" : "-")} {Math.Abs(exSPD):0.##}]" : "") + $" ({ActionCoefficient * 100:0.##}%)");
|
||||||
builder.AppendLine($"生命回复:{HR:0.##}" + (ExHR != 0 ? $" [{InitialHR + STR * GameplayEquilibriumConstant.STRtoHRFactor:0.##} {(ExHR >= 0 ? "+" : "-")} {Math.Abs(ExHR):0.##}]" : ""));
|
builder.AppendLine($"生命回复:{HR:0.##}" + (ExHR != 0 ? $" [{InitialHR + STR * GameplayEquilibriumConstant.STRtoHRFactor:0.##} {(ExHR >= 0 ? "+" : "-")} {Math.Abs(ExHR):0.##}]" : ""));
|
||||||
@ -187,10 +184,7 @@ namespace Milimoe.FunGame.Core.Entity
|
|||||||
builder.AppendLine($"攻击力:{ATK:0.##}" + (exATK != 0 ? $" [{BaseATK:0.##} {(exATK >= 0 ? "+" : "-")} {Math.Abs(exATK):0.##}]" : ""));
|
builder.AppendLine($"攻击力:{ATK:0.##}" + (exATK != 0 ? $" [{BaseATK:0.##} {(exATK >= 0 ? "+" : "-")} {Math.Abs(exATK):0.##}]" : ""));
|
||||||
double exDEF = ExDEF + ExDEF2 + ExDEF3;
|
double exDEF = ExDEF + ExDEF2 + ExDEF3;
|
||||||
builder.AppendLine($"物理护甲:{DEF:0.##}" + (exDEF != 0 ? $" [{BaseDEF:0.##} {(exMP >= 0 ? "+" : "-")} {Math.Abs(exDEF):0.##}]" : "") + $" ({PDR * 100:0.##}%)");
|
builder.AppendLine($"物理护甲:{DEF:0.##}" + (exDEF != 0 ? $" [{BaseDEF:0.##} {(exMP >= 0 ? "+" : "-")} {Math.Abs(exDEF):0.##}]" : "") + $" ({PDR * 100:0.##}%)");
|
||||||
double mdf = Calculation.Round4Digits((MDF.None + MDF.Starmark + MDF.PurityNatural + MDF.PurityContemporary +
|
builder.AppendLine($"魔法抗性:{MDF.Avg:0.##}%(平均)");
|
||||||
MDF.Bright + MDF.Shadow + MDF.Element + MDF.Fleabane + MDF.Particle) / 9) * 100;
|
|
||||||
if (Calculation.IsApproximatelyZero(mdf)) mdf = 0;
|
|
||||||
builder.AppendLine($"魔法抗性:{mdf:0.##}%(平均)");
|
|
||||||
double exSPD = AGI * GameplayEquilibriumConstant.AGItoSPDMultiplier + ExSPD;
|
double exSPD = AGI * GameplayEquilibriumConstant.AGItoSPDMultiplier + ExSPD;
|
||||||
builder.AppendLine($"行动速度:{SPD:0.##}" + (exSPD != 0 ? $" [{InitialSPD:0.##} {(exSPD >= 0 ? "+" : "-")} {Math.Abs(exSPD):0.##}]" : "") + $" ({ActionCoefficient * 100:0.##}%)");
|
builder.AppendLine($"行动速度:{SPD:0.##}" + (exSPD != 0 ? $" [{InitialSPD:0.##} {(exSPD >= 0 ? "+" : "-")} {Math.Abs(exSPD):0.##}]" : "") + $" ({ActionCoefficient * 100:0.##}%)");
|
||||||
builder.AppendLine($"生命回复:{HR:0.##}" + (ExHR != 0 ? $" [{InitialHR + STR * GameplayEquilibriumConstant.STRtoHRFactor:0.##} {(ExHR >= 0 ? "+" : "-")} {Math.Abs(ExHR):0.##}]" : ""));
|
builder.AppendLine($"生命回复:{HR:0.##}" + (ExHR != 0 ? $" [{InitialHR + STR * GameplayEquilibriumConstant.STRtoHRFactor:0.##} {(ExHR >= 0 ? "+" : "-")} {Math.Abs(ExHR):0.##}]" : ""));
|
||||||
@ -412,10 +406,7 @@ namespace Milimoe.FunGame.Core.Entity
|
|||||||
builder.AppendLine($"攻击力:{ATK:0.##}" + (exATK != 0 ? $" [{BaseATK:0.##} {(exATK >= 0 ? "+" : "-")} {Math.Abs(exATK):0.##}]" : ""));
|
builder.AppendLine($"攻击力:{ATK:0.##}" + (exATK != 0 ? $" [{BaseATK:0.##} {(exATK >= 0 ? "+" : "-")} {Math.Abs(exATK):0.##}]" : ""));
|
||||||
double exDEF = ExDEF + ExDEF2 + ExDEF3;
|
double exDEF = ExDEF + ExDEF2 + ExDEF3;
|
||||||
builder.AppendLine($"物理护甲:{DEF:0.##}" + (exDEF != 0 ? $" [{BaseDEF:0.##} {(exMP >= 0 ? "+" : "-")} {Math.Abs(exDEF):0.##}]" : "") + $" ({PDR * 100:0.##}%)");
|
builder.AppendLine($"物理护甲:{DEF:0.##}" + (exDEF != 0 ? $" [{BaseDEF:0.##} {(exMP >= 0 ? "+" : "-")} {Math.Abs(exDEF):0.##}]" : "") + $" ({PDR * 100:0.##}%)");
|
||||||
double mdf = Calculation.Round4Digits((MDF.None + MDF.Starmark + MDF.PurityNatural + MDF.PurityContemporary +
|
builder.AppendLine($"魔法抗性:{MDF.Avg:0.##}%(平均)");
|
||||||
MDF.Bright + MDF.Shadow + MDF.Element + MDF.Fleabane + MDF.Particle) / 9) * 100;
|
|
||||||
if (Calculation.IsApproximatelyZero(mdf)) mdf = 0;
|
|
||||||
builder.AppendLine($"魔法抗性:{mdf:0.##}%(平均)");
|
|
||||||
double exSPD = AGI * GameplayEquilibriumConstant.AGItoSPDMultiplier + ExSPD;
|
double exSPD = AGI * GameplayEquilibriumConstant.AGItoSPDMultiplier + ExSPD;
|
||||||
builder.AppendLine($"行动速度:{SPD:0.##}" + (exSPD != 0 ? $" [{InitialSPD:0.##} {(exSPD >= 0 ? "+" : "-")} {Math.Abs(exSPD):0.##}]" : "") + $" ({ActionCoefficient * 100:0.##}%)");
|
builder.AppendLine($"行动速度:{SPD:0.##}" + (exSPD != 0 ? $" [{InitialSPD:0.##} {(exSPD >= 0 ? "+" : "-")} {Math.Abs(exSPD):0.##}]" : "") + $" ({ActionCoefficient * 100:0.##}%)");
|
||||||
builder.AppendLine($"生命回复:{HR:0.##}" + (ExHR != 0 ? $" [{InitialHR + STR * GameplayEquilibriumConstant.STRtoHRFactor:0.##} {(ExHR >= 0 ? "+" : "-")} {Math.Abs(ExHR):0.##}]" : ""));
|
builder.AppendLine($"生命回复:{HR:0.##}" + (ExHR != 0 ? $" [{InitialHR + STR * GameplayEquilibriumConstant.STRtoHRFactor:0.##} {(ExHR >= 0 ? "+" : "-")} {Math.Abs(ExHR):0.##}]" : ""));
|
||||||
|
|||||||
@ -23,25 +23,7 @@
|
|||||||
<Description>FunGame.Core: A C#.NET library for turn-based games.</Description>
|
<Description>FunGame.Core: A C#.NET library for turn-based games.</Description>
|
||||||
<PackageTags>game;turn-based;server;framework;dotnet;csharp;gamedev</PackageTags>
|
<PackageTags>game;turn-based;server;framework;dotnet;csharp;gamedev</PackageTags>
|
||||||
<PackageReleaseNotes>
|
<PackageReleaseNotes>
|
||||||
We are excited to introduce the official version 1.0.0. Here are the key changes from the last release candidate:
|
See github releases for details on the latest changes.
|
||||||
- Fixed an issue of incorrect recording of non-damage assists. (1.0.0)
|
|
||||||
- Fixed an issue where applying a control effect to an enemy mistakenly resulted in an assist for the character when that enemy killed a teammate. (1.0.0)
|
|
||||||
- Removed the restriction of contributing 10% damage to get an assist. (1.0.0)
|
|
||||||
- Fixed an issue where the skill always defaults to selecting enemies when there is no suitable target, which could cause the character to mistakenly apply a buff state to the enemy. (1.0.0)
|
|
||||||
- Adjusted the basic reward and assist allocation rules for killing enemies. (1.0.0)
|
|
||||||
- Added monetary compensation based on the level and economic difference between the killer/assister and the victim. (1.0.0)
|
|
||||||
Update history of all release candidate versions:
|
|
||||||
- Initial release candidate 1 (1.0.0-rc.1-0428)
|
|
||||||
- Abstract ActionQueue as GamingQueue, and separate the original Mix / Team modes into two queue types: MixGamingQueue and TeamGamingQueue. (1.0.0-rc.1-0502)
|
|
||||||
- In the Effect class, added ParentEffect and ForceHideInStatusBar properties for more precise control of the status bar display. (1.0.0-rc.1-0509)
|
|
||||||
- Added helper methods IsTeammate and GetIsTeammateDictionary to GamingQueue and its interface IGamingQueue for determining if someone is a teammate. This facilitates the skill effects to determine whether the target is a teammate. (1.0.0-rc.1-0509)
|
|
||||||
- Added more properties (such as Name, RealCD) to the ISkill interface. Both NormalAttack and Skill inherit from ISkill, thus implementing these properties, although some properties are not meaningful for NormalAttack. (1.0.0-rc.1-0509)
|
|
||||||
- Added corresponding text for EffectTypes Lifesteal and GrievousWound. (1.0.0-rc.1-0509)
|
|
||||||
- Added EffectTypes: WeakDispelling and StrongDispelling, representing DurativeWeak and DurativeStrong of DispelType. (1.0.0-rc.1-0509)
|
|
||||||
- Added underlying processing support for continuous dispelling in the TimeLapse method. (1.0.0-rc.1-0509)
|
|
||||||
- Fixed an issue where the effect's shield hook provided incorrect parameters. (1.0.0-rc.1-0509)
|
|
||||||
- Fixed an issue where the result of pre-hooks for evade and critical hit checks always deferred to the result of the last effect. It should be that if any effect prevents the check, it is skipped. (1.0.0-rc.1-0509)
|
|
||||||
- Added comments for some code. (1.0.0-rc.1-0509)
|
|
||||||
</PackageReleaseNotes>
|
</PackageReleaseNotes>
|
||||||
<RepositoryUrl>https://github.com/project-redbud/FunGame-Core</RepositoryUrl>
|
<RepositoryUrl>https://github.com/project-redbud/FunGame-Core</RepositoryUrl>
|
||||||
<PackageProjectUrl>https://github.com/project-redbud</PackageProjectUrl>
|
<PackageProjectUrl>https://github.com/project-redbud</PackageProjectUrl>
|
||||||
|
|||||||
@ -1,3 +1,4 @@
|
|||||||
|
using Milimoe.FunGame.Core.Api.Utility;
|
||||||
using Milimoe.FunGame.Core.Interface.Addons;
|
using Milimoe.FunGame.Core.Interface.Addons;
|
||||||
|
|
||||||
namespace Milimoe.FunGame.Core.Library.Common.Addon
|
namespace Milimoe.FunGame.Core.Library.Common.Addon
|
||||||
@ -97,16 +98,14 @@ namespace Milimoe.FunGame.Core.Library.Common.Addon
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// 如果加载后需要执行代码,请重写AfterLoad方法
|
|
||||||
AfterLoad();
|
|
||||||
}
|
}
|
||||||
return IsLoaded;
|
return IsLoaded;
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 加载后需要做的事
|
/// 地图完全加载后需要做的事
|
||||||
/// </summary>
|
/// </summary>
|
||||||
protected virtual void AfterLoad()
|
public virtual void AfterLoad(GameModuleLoader loader, params object[] args)
|
||||||
{
|
{
|
||||||
// override
|
// override
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1,4 +1,5 @@
|
|||||||
using System.Collections.Concurrent;
|
using System.Collections.Concurrent;
|
||||||
|
using Milimoe.FunGame.Core.Api.Utility;
|
||||||
using Milimoe.FunGame.Core.Controller;
|
using Milimoe.FunGame.Core.Controller;
|
||||||
using Milimoe.FunGame.Core.Interface.Addons;
|
using Milimoe.FunGame.Core.Interface.Addons;
|
||||||
using Milimoe.FunGame.Core.Interface.Base;
|
using Milimoe.FunGame.Core.Interface.Base;
|
||||||
@ -149,7 +150,7 @@ namespace Milimoe.FunGame.Core.Library.Common.Addon
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
/// 模组完全加载后需要做的事
|
/// 模组完全加载后需要做的事
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public virtual void AfterLoad(params object[] args)
|
public virtual void AfterLoad(GameModuleLoader loader, params object[] args)
|
||||||
{
|
{
|
||||||
// override
|
// override
|
||||||
}
|
}
|
||||||
|
|||||||
@ -28,12 +28,12 @@ namespace Milimoe.FunGame.Core.Library.Common.Addon
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
/// 是谁站在这格子上?
|
/// 是谁站在这格子上?
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public Dictionary<string, Character> Characters { get; set; } = [];
|
public HashSet<Character> Characters { get; set; } = [];
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 此格子目前受到了什么影响?或者它有什么技能…
|
/// 此格子目前受到了什么影响?
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public Dictionary<string, Skill> Skills { get; set; } = [];
|
public HashSet<Effect> Effects { get; set; } = [];
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 此格子呈现的颜色(默认为 <see cref="Color.Gray"/> )
|
/// 此格子呈现的颜色(默认为 <see cref="Color.Gray"/> )
|
||||||
|
|||||||
@ -36,11 +36,11 @@ namespace Milimoe.FunGame.Core.Library.Common.JsonConverter
|
|||||||
case nameof(MagicResistance.Element):
|
case nameof(MagicResistance.Element):
|
||||||
result.Element = reader.GetDouble();
|
result.Element = reader.GetDouble();
|
||||||
break;
|
break;
|
||||||
case nameof(MagicResistance.Fleabane):
|
case nameof(MagicResistance.Aster):
|
||||||
result.Fleabane = reader.GetDouble();
|
result.Aster = reader.GetDouble();
|
||||||
break;
|
break;
|
||||||
case nameof(MagicResistance.Particle):
|
case nameof(MagicResistance.SpatioTemporal):
|
||||||
result.Particle = reader.GetDouble();
|
result.SpatioTemporal = reader.GetDouble();
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -56,8 +56,8 @@ namespace Milimoe.FunGame.Core.Library.Common.JsonConverter
|
|||||||
writer.WriteNumber(nameof(MagicResistance.Bright), value.Bright);
|
writer.WriteNumber(nameof(MagicResistance.Bright), value.Bright);
|
||||||
writer.WriteNumber(nameof(MagicResistance.Shadow), value.Shadow);
|
writer.WriteNumber(nameof(MagicResistance.Shadow), value.Shadow);
|
||||||
writer.WriteNumber(nameof(MagicResistance.Element), value.Element);
|
writer.WriteNumber(nameof(MagicResistance.Element), value.Element);
|
||||||
writer.WriteNumber(nameof(MagicResistance.Fleabane), value.Fleabane);
|
writer.WriteNumber(nameof(MagicResistance.Aster), value.Aster);
|
||||||
writer.WriteNumber(nameof(MagicResistance.Particle), value.Particle);
|
writer.WriteNumber(nameof(MagicResistance.SpatioTemporal), value.SpatioTemporal);
|
||||||
|
|
||||||
writer.WriteEndObject();
|
writer.WriteEndObject();
|
||||||
}
|
}
|
||||||
|
|||||||
@ -39,11 +39,11 @@ namespace Milimoe.FunGame.Core.Library.Common.JsonConverter
|
|||||||
case nameof(Shield.Element):
|
case nameof(Shield.Element):
|
||||||
result.Element = reader.GetDouble();
|
result.Element = reader.GetDouble();
|
||||||
break;
|
break;
|
||||||
case nameof(Shield.Fleabane):
|
case nameof(Shield.Aster):
|
||||||
result.Fleabane = reader.GetDouble();
|
result.Aster = reader.GetDouble();
|
||||||
break;
|
break;
|
||||||
case nameof(Shield.Particle):
|
case nameof(Shield.SpatioTemporal):
|
||||||
result.Particle = reader.GetDouble();
|
result.SpatioTemporal = reader.GetDouble();
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -60,8 +60,8 @@ namespace Milimoe.FunGame.Core.Library.Common.JsonConverter
|
|||||||
writer.WriteNumber(nameof(Shield.Bright), value.Bright);
|
writer.WriteNumber(nameof(Shield.Bright), value.Bright);
|
||||||
writer.WriteNumber(nameof(Shield.Shadow), value.Shadow);
|
writer.WriteNumber(nameof(Shield.Shadow), value.Shadow);
|
||||||
writer.WriteNumber(nameof(Shield.Element), value.Element);
|
writer.WriteNumber(nameof(Shield.Element), value.Element);
|
||||||
writer.WriteNumber(nameof(Shield.Fleabane), value.Fleabane);
|
writer.WriteNumber(nameof(Shield.Aster), value.Aster);
|
||||||
writer.WriteNumber(nameof(Shield.Particle), value.Particle);
|
writer.WriteNumber(nameof(Shield.SpatioTemporal), value.SpatioTemporal);
|
||||||
|
|
||||||
writer.WriteEndObject();
|
writer.WriteEndObject();
|
||||||
}
|
}
|
||||||
|
|||||||
@ -387,8 +387,8 @@ namespace Milimoe.FunGame.Core.Library.Constant
|
|||||||
MagicType.Bright => "光魔法伤害",
|
MagicType.Bright => "光魔法伤害",
|
||||||
MagicType.Shadow => "影魔法伤害",
|
MagicType.Shadow => "影魔法伤害",
|
||||||
MagicType.Element => "元素魔法伤害",
|
MagicType.Element => "元素魔法伤害",
|
||||||
MagicType.Fleabane => "紫宛魔法伤害",
|
MagicType.Aster => "紫宛魔法伤害",
|
||||||
MagicType.Particle => "时空魔法伤害",
|
MagicType.SpatioTemporal => "时空魔法伤害",
|
||||||
_ => "魔法伤害",
|
_ => "魔法伤害",
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
@ -397,14 +397,14 @@ namespace Milimoe.FunGame.Core.Library.Constant
|
|||||||
{
|
{
|
||||||
return type switch
|
return type switch
|
||||||
{
|
{
|
||||||
MagicType.Starmark => "星痕抗性",
|
MagicType.Starmark => "星痕魔法抗性",
|
||||||
MagicType.PurityNatural => "现代结晶抗性",
|
MagicType.PurityNatural => "现代结晶魔法抗性",
|
||||||
MagicType.PurityContemporary => "纯粹结晶抗性",
|
MagicType.PurityContemporary => "纯粹结晶魔法抗性",
|
||||||
MagicType.Bright => "光抗性",
|
MagicType.Bright => "光魔法抗性",
|
||||||
MagicType.Shadow => "影抗性",
|
MagicType.Shadow => "影魔法抗性",
|
||||||
MagicType.Element => "元素抗性",
|
MagicType.Element => "元素魔法抗性",
|
||||||
MagicType.Fleabane => "紫宛抗性",
|
MagicType.Aster => "紫宛魔法抗性",
|
||||||
MagicType.Particle => "时空抗性",
|
MagicType.SpatioTemporal => "时空魔法抗性",
|
||||||
_ => "魔法抗性",
|
_ => "魔法抗性",
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|||||||
@ -627,8 +627,8 @@ namespace Milimoe.FunGame.Core.Library.Constant
|
|||||||
Bright,
|
Bright,
|
||||||
Shadow,
|
Shadow,
|
||||||
Element,
|
Element,
|
||||||
Fleabane,
|
Aster,
|
||||||
Particle
|
SpatioTemporal
|
||||||
}
|
}
|
||||||
|
|
||||||
public enum PrimaryAttribute
|
public enum PrimaryAttribute
|
||||||
|
|||||||
@ -920,6 +920,15 @@ namespace Milimoe.FunGame.Core.Model
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (type == CharacterActionType.PreCastSkill)
|
else if (type == CharacterActionType.PreCastSkill)
|
||||||
|
{
|
||||||
|
if (character.CharacterState == CharacterState.NotActionable ||
|
||||||
|
character.CharacterState == CharacterState.ActionRestricted ||
|
||||||
|
character.CharacterState == CharacterState.BattleRestricted ||
|
||||||
|
character.CharacterState == CharacterState.SkillRestricted)
|
||||||
|
{
|
||||||
|
WriteLine($"角色 [ {character} ] 状态为:{CharacterSet.GetCharacterState(character.CharacterState)},无法释放技能!");
|
||||||
|
}
|
||||||
|
else
|
||||||
{
|
{
|
||||||
// 预使用技能,即开始吟唱逻辑
|
// 预使用技能,即开始吟唱逻辑
|
||||||
Skill? skill = await OnSelectSkillAsync(character, skills);
|
Skill? skill = await OnSelectSkillAsync(character, skills);
|
||||||
@ -997,6 +1006,7 @@ namespace Milimoe.FunGame.Core.Model
|
|||||||
LastRound.Skill = skill;
|
LastRound.Skill = skill;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
else if (type == CharacterActionType.CastSkill)
|
else if (type == CharacterActionType.CastSkill)
|
||||||
{
|
{
|
||||||
if (_castingSkills.TryGetValue(character, out SkillTarget skillTarget))
|
if (_castingSkills.TryGetValue(character, out SkillTarget skillTarget))
|
||||||
@ -1128,6 +1138,13 @@ namespace Milimoe.FunGame.Core.Model
|
|||||||
else if (type == CharacterActionType.EndTurn)
|
else if (type == CharacterActionType.EndTurn)
|
||||||
{
|
{
|
||||||
baseTime = 3;
|
baseTime = 3;
|
||||||
|
if (character.CharacterState == CharacterState.NotActionable ||
|
||||||
|
character.CharacterState == CharacterState.ActionRestricted ||
|
||||||
|
character.CharacterState == CharacterState.BattleRestricted)
|
||||||
|
{
|
||||||
|
baseTime += 5;
|
||||||
|
WriteLine($"角色 [ {character} ] 状态为:{CharacterSet.GetCharacterState(character.CharacterState)},放弃行动将额外获得 5 {GameplayEquilibriumConstant.InGameTime}硬直时间!");
|
||||||
|
}
|
||||||
decided = true;
|
decided = true;
|
||||||
WriteLine($"[ {character} ] 结束了回合!");
|
WriteLine($"[ {character} ] 结束了回合!");
|
||||||
await OnCharacterDoNothingAsync(character);
|
await OnCharacterDoNothingAsync(character);
|
||||||
|
|||||||
@ -1,6 +1,6 @@
|
|||||||
namespace Milimoe.FunGame.Core.Model
|
namespace Milimoe.FunGame.Core.Model
|
||||||
{
|
{
|
||||||
public class RecurringTask(string name, TimeSpan interval, Action action)
|
public class RecurringTask(string name, TimeSpan interval, Action action, Action<Exception>? error = null)
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 任务名称
|
/// 任务名称
|
||||||
@ -31,5 +31,10 @@
|
|||||||
/// 最后一次运行时发生的错误
|
/// 最后一次运行时发生的错误
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public Exception? Error { get; set; }
|
public Exception? Error { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 捕获异常后,触发的回调函数
|
||||||
|
/// </summary>
|
||||||
|
public Action<Exception>? ErrorHandler { get; set; } = error;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1,6 +1,6 @@
|
|||||||
namespace Milimoe.FunGame.Core.Model
|
namespace Milimoe.FunGame.Core.Model
|
||||||
{
|
{
|
||||||
public class ScheduledTask(string name, TimeSpan timeSpan, Action action)
|
public class ScheduledTask(string name, TimeSpan timeSpan, Action action, Action<Exception>? error = null)
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 任务名称
|
/// 任务名称
|
||||||
@ -31,5 +31,10 @@
|
|||||||
/// 最后一次运行时发生的错误
|
/// 最后一次运行时发生的错误
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public Exception? Error { get; set; }
|
public Exception? Error { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 捕获异常后,触发的回调函数
|
||||||
|
/// </summary>
|
||||||
|
public Action<Exception>? ErrorHandler { get; set; } = error;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user