API 中断性变更

This commit is contained in:
milimoe 2025-12-30 00:46:12 +08:00
parent 85b89ac6d6
commit 72b8b52171
Signed by: milimoe
GPG Key ID: 9554D37E4B8991D0
42 changed files with 50 additions and 60 deletions

View File

@ -27,7 +27,7 @@ namespace Oshima.FunGame.OshimaModules.Effects.SkillEffects
{
target.Shield.Mix += ;
WriteLine($"[ {target} ] 获得了 {护盾值:0.##} 点混合护盾值!");
GamingQueue?.LastRound.ApplyEffects.TryAdd(target, [EffectType.Shield]);
GamingQueue?.LastRound.AddApplyEffects(target, EffectType.Shield);
}
}
}

View File

@ -27,7 +27,7 @@ namespace Oshima.FunGame.OshimaModules.Effects.SkillEffects
{
target.Shield[false] += ;
WriteLine($"[ {target} ] 获得了 {护盾值:0.##} 点物理护盾值!");
GamingQueue?.LastRound.ApplyEffects.TryAdd(target, [EffectType.Shield]);
GamingQueue?.LastRound.AddApplyEffects(target, EffectType.Shield);
}
}
}

View File

@ -41,7 +41,7 @@ namespace Oshima.FunGame.OshimaModules.Effects.SkillEffects
target.Effects.Add(e);
e.OnEffectGained(target);
e.DispelledType = DispelledType;
GamingQueue?.LastRound.ApplyEffects.TryAdd(target, [EffectType.Shield]);
GamingQueue?.LastRound.AddApplyEffects(target, EffectType.Shield);
}
}
}

View File

@ -27,7 +27,7 @@ namespace Oshima.FunGame.OshimaModules.Effects.SkillEffects
{
target.Shield[true, MagicType.None] += ;
WriteLine($"[ {target} ] 获得了 {护盾值:0.##} 点魔法护盾值!");
GamingQueue?.LastRound.ApplyEffects.TryAdd(target, [EffectType.Shield]);
GamingQueue?.LastRound.AddApplyEffects(target, EffectType.Shield);
}
}
}

View File

@ -41,7 +41,7 @@ namespace Oshima.FunGame.OshimaModules.Effects.SkillEffects
target.Effects.Add(e);
e.OnEffectGained(target);
e.DispelledType = DispelledType;
GamingQueue?.LastRound.ApplyEffects.TryAdd(target, [EffectType.Shield]);
GamingQueue?.LastRound.AddApplyEffects(target, EffectType.Shield);
}
}
}

View File

@ -46,7 +46,7 @@ namespace Oshima.FunGame.OshimaModules.Effects.SkillEffects
target.Effects.Add(e);
e.OnEffectGained(target);
e.EffectType = EffectType.Haste;
GamingQueue?.LastRound.ApplyEffects.TryAdd(target, [e.EffectType]);
GamingQueue?.LastRound.AddApplyEffects(target, e.EffectType);
GamingQueue?.ChangeCharacterHardnessTime(target, -0.3, true, false);
}
}

View File

@ -82,7 +82,7 @@ namespace Oshima.FunGame.OshimaModules.Effects.SkillEffects
break;
}
}
GamingQueue?.LastRound.ApplyEffects.TryAdd(target, [EffectType]);
GamingQueue?.LastRound.AddApplyEffects(target, EffectType);
}
}
}

View File

@ -66,7 +66,7 @@ namespace Oshima.FunGame.OshimaModules.Effects.SkillEffects
e.DispelledType = DispelledType;
e.ParentEffect = ParentEffect;
}
GamingQueue?.LastRound.ApplyEffects.TryAdd(target, [e.EffectType]);
GamingQueue?.LastRound.AddApplyEffects(target, e.EffectType);
}
}
}

View File

@ -66,7 +66,7 @@ namespace Oshima.FunGame.OshimaModules.Effects.SkillEffects
e.DispelledType = DispelledType;
e.ParentEffect = ParentEffect;
}
GamingQueue?.LastRound.ApplyEffects.TryAdd(target, [e.EffectType]);
GamingQueue?.LastRound.AddApplyEffects(target, e.EffectType);
}
}
}

View File

@ -144,7 +144,7 @@ namespace Oshima.FunGame.OshimaModules.Effects.SkillEffects
{
target.Effects.Add(e);
e.OnEffectGained(target);
GamingQueue?.LastRound.ApplyEffects.TryAdd(target, [e.EffectType]);
GamingQueue?.LastRound.AddApplyEffects(target, e.EffectType);
}
}
}

View File

@ -34,7 +34,7 @@ namespace Oshima.FunGame.OshimaModules.Effects.SkillEffects
e = new(Skill, caster, _durative, _duration + _levelGrowth * (Level - 1), Convert.ToInt32(_durationTurn + _levelGrowth * (Level - 1)));
enemy.Effects.Add(e);
e.OnEffectGained(enemy);
GamingQueue?.LastRound.ApplyEffects.TryAdd(enemy, [e.EffectType]);
GamingQueue?.LastRound.AddApplyEffects(enemy, e.EffectType);
}
}
}

View File

@ -44,7 +44,7 @@ namespace Oshima.FunGame.OshimaModules.Effects.SkillEffects
e = new(Skill, enemy, caster, _durative, _duration + _levelGrowth * (Level - 1), Convert.ToInt32(_durationTurn + _levelGrowth * (Level - 1)), _isPercentage, _durationDamage, _durationDamagePercent);
enemy.Effects.Add(e);
e.OnEffectGained(enemy);
GamingQueue?.LastRound.ApplyEffects.TryAdd(enemy, [e.EffectType]);
GamingQueue?.LastRound.AddApplyEffects(enemy, e.EffectType);
}
}
}

View File

@ -37,7 +37,7 @@ namespace Oshima.FunGame.OshimaModules.Effects.SkillEffects
e = new(Skill, caster, _durative, _duration + _levelGrowth * (Level - 1), Convert.ToInt32(_durationTurn + _levelGrowth * (Level - 1)));
enemy.Effects.Add(e);
e.OnEffectGained(enemy);
GamingQueue?.LastRound.ApplyEffects.TryAdd(enemy, [e.EffectType]);
GamingQueue?.LastRound.AddApplyEffects(enemy, e.EffectType);
}
}
}

View File

@ -61,7 +61,7 @@ namespace Oshima.FunGame.OshimaModules.Effects.SkillEffects
e = new(Skill, enemy, caster, _durative, _duration + _levelGrowth * (Level - 1), Convert.ToInt32(_durationTurn + _levelGrowth * (Level - 1)), ActualDamageReductionPercent, ActualDEFReductionPercent, ActualMDFReductionPercent, ActualHealingReductionPercent);
enemy.Effects.Add(e);
e.OnEffectGained(enemy);
GamingQueue?.LastRound.ApplyEffects.TryAdd(enemy, [e.EffectType]);
GamingQueue?.LastRound.AddApplyEffects(enemy, e.EffectType);
}
}
}

View File

@ -47,7 +47,7 @@ namespace Oshima.FunGame.OshimaModules.Effects.SkillEffects
e.OnEffectGained(target);
e.EffectType = EffectType.Slow;
e.IsDebuff = true;
GamingQueue?.LastRound.ApplyEffects.TryAdd(target, [e.EffectType]);
GamingQueue?.LastRound.AddApplyEffects(target, e.EffectType);
GamingQueue?.ChangeCharacterHardnessTime(target, 0.3, true, false);
}
}

View File

@ -59,7 +59,7 @@ namespace Oshima.FunGame.OshimaModules.Skills
caster.Effects.Add(this);
OnEffectGained(caster);
}
GamingQueue?.LastRound.ApplyEffects.TryAdd(caster, [EffectType.DamageBoost, EffectType.Lifesteal]);
GamingQueue?.LastRound.AddApplyEffects(caster, EffectType.DamageBoost, EffectType.Lifesteal);
}
}
}

View File

@ -82,7 +82,7 @@ namespace Oshima.FunGame.OshimaModules.Skills
caster.Effects.Add(this);
OnEffectGained(caster);
}
GamingQueue?.LastRound.ApplyEffects.TryAdd(caster, [EffectType.Invulnerable]);
GamingQueue?.LastRound.AddApplyEffects(caster, EffectType.Invulnerable);
}
}
}

View File

@ -66,7 +66,7 @@ namespace Oshima.FunGame.OshimaModules.Skills
caster.Effects.Add(this);
OnEffectGained(caster);
}
GamingQueue?.LastRound.ApplyEffects.TryAdd(caster, [EffectType.CritBoost, EffectType.PenetrationBoost]);
GamingQueue?.LastRound.AddApplyEffects(caster, EffectType.CritBoost, EffectType.PenetrationBoost);
}
}
}

View File

@ -75,7 +75,7 @@ namespace Oshima.FunGame.OshimaModules.Skills
caster.Effects.Add(this);
OnEffectGained(caster);
}
GamingQueue?.LastRound.ApplyEffects.TryAdd(caster, [EffectType.MPRegen, EffectType.Haste]);
GamingQueue?.LastRound.AddApplyEffects(caster, EffectType.MPRegen, EffectType.Haste);
}
}
}

View File

@ -158,11 +158,11 @@ namespace Oshima.FunGame.OshimaModules.Skills
{
double = * caster.MaxHP;
HealToTarget(caster, caster, );
GamingQueue?.LastRound.ApplyEffects.TryAdd(caster, [EffectType.Lifesteal]);
GamingQueue?.LastRound.AddApplyEffects(caster, EffectType.Lifesteal);
}
else if (caster.PrimaryAttribute == PrimaryAttribute.INT)
{
GamingQueue?.LastRound.ApplyEffects.TryAdd(caster, [EffectType.DamageBoost]);
GamingQueue?.LastRound.AddApplyEffects(caster, EffectType.DamageBoost);
}
}
}

View File

@ -66,7 +66,7 @@ namespace Oshima.FunGame.OshimaModules.Skills
caster.Effects.Add(this);
OnEffectGained(caster);
}
GamingQueue?.LastRound.ApplyEffects.TryAdd(caster, [EffectType.DamageBoost]);
GamingQueue?.LastRound.AddApplyEffects(caster, EffectType.DamageBoost);
}
}
}

View File

@ -79,7 +79,7 @@ namespace Oshima.FunGame.OshimaModules.Skills
caster.Effects.Add(this);
OnEffectGained(caster);
}
GamingQueue?.LastRound.ApplyEffects.TryAdd(caster, [EffectType.DamageBoost, EffectType.Haste, EffectType.DefenseBoost]);
GamingQueue?.LastRound.AddApplyEffects(caster, EffectType.DamageBoost, EffectType.Haste, EffectType.DefenseBoost);
}
}
}

View File

@ -49,7 +49,7 @@ namespace Oshima.FunGame.OshimaModules.Skills
caster.Effects.Add(this);
OnEffectGained(caster);
}
GamingQueue?.LastRound.ApplyEffects.TryAdd(caster, [EffectType.Lifesteal]);
GamingQueue?.LastRound.AddApplyEffects(caster, EffectType.Lifesteal);
}
}
}

View File

@ -90,7 +90,7 @@ namespace Oshima.FunGame.OshimaModules.Skills
caster.Effects.Add(this);
OnEffectGained(caster);
}
GamingQueue?.LastRound.ApplyEffects.TryAdd(caster, [EffectType.DamageBoost, EffectType.PenetrationBoost]);
GamingQueue?.LastRound.AddApplyEffects(caster, EffectType.DamageBoost, EffectType.PenetrationBoost);
}
}
}

View File

@ -73,7 +73,7 @@ namespace Oshima.FunGame.OshimaModules.Skills
caster.Effects.Add(this);
OnEffectGained(caster);
}
GamingQueue?.LastRound.ApplyEffects.TryAdd(caster, [EffectType.DefenseBoost]);
GamingQueue?.LastRound.AddApplyEffects(caster, EffectType.DefenseBoost);
}
}
}

View File

@ -75,7 +75,7 @@ namespace Oshima.FunGame.OshimaModules.Skills
caster.Effects.Add(this);
OnEffectGained(caster);
}
GamingQueue?.LastRound.ApplyEffects.TryAdd(caster, [EffectType.DamageBoost, EffectType.Lifesteal]);
GamingQueue?.LastRound.AddApplyEffects(caster, EffectType.DamageBoost, EffectType.Lifesteal);
}
}
}

View File

@ -78,7 +78,7 @@ namespace Oshima.FunGame.OshimaModules.Skills
{
if (!caster.Effects.Contains(this))
{
GamingQueue?.LastRound.ApplyEffects.Add(caster, [EffectType]);
GamingQueue?.LastRound.AddApplyEffects(caster, EffectType);
= true;
= false;
RemainDuration = Duration;

View File

@ -76,7 +76,7 @@ namespace Oshima.FunGame.OshimaModules.Skills
e.EffectType = EffectType.DamageBoost;
e.Source = caster;
e.OnEffectGained(target);
GamingQueue?.LastRound.ApplyEffects.TryAdd(target, [EffectType.DamageBoost]);
GamingQueue?.LastRound.AddApplyEffects(target, EffectType.DamageBoost);
}
}
}

View File

@ -91,7 +91,7 @@ namespace Oshima.FunGame.OshimaModules.Skills
e.EffectType = EffectType.DamageBoost;
e.Source = caster;
e.OnEffectGained(target);
GamingQueue?.LastRound.ApplyEffects.TryAdd(target, [EffectType.DamageBoost]);
GamingQueue?.LastRound.AddApplyEffects(target, EffectType.DamageBoost);
}
}
}

View File

@ -105,7 +105,7 @@ namespace Oshima.FunGame.OshimaModules.Skills
target.Effects.Add(e2);
e2.OnEffectGained(target);
e2.IsDebuff = true;
GamingQueue?.LastRound.ApplyEffects.TryAdd(target, [EffectType.Slow]);
GamingQueue?.LastRound.AddApplyEffects(target, EffectType.Slow);
}
}
}

View File

@ -89,7 +89,7 @@ namespace Oshima.FunGame.OshimaModules.Skills
target.Effects.Add(e2);
e2.OnEffectGained(target);
e2.IsDebuff = true;
GamingQueue?.LastRound.ApplyEffects.TryAdd(target, [EffectType.Slow]);
GamingQueue?.LastRound.AddApplyEffects(target, EffectType.Slow);
}
}
}

View File

@ -92,7 +92,7 @@ namespace Oshima.FunGame.OshimaModules.Skills
e.EffectType = EffectType.MagicResistBreak;
e.Source = caster;
e.OnEffectGained(target);
GamingQueue?.LastRound.ApplyEffects.TryAdd(target, [e.EffectType]);
GamingQueue?.LastRound.AddApplyEffects(target, e.EffectType);
}
}
}

View File

@ -119,7 +119,7 @@ namespace Oshima.FunGame.OshimaModules.Skills
e3.EffectType = EffectType.DefenseBoost;
e3.Source = caster;
e3.OnEffectGained(target);
GamingQueue?.LastRound.ApplyEffects.TryAdd(target, [EffectType.DamageBoost, EffectType.DefenseBoost]);
GamingQueue?.LastRound.AddApplyEffects(target, EffectType.DamageBoost, EffectType.DefenseBoost);
}
}
}

View File

@ -134,7 +134,7 @@ namespace Oshima.FunGame.OshimaModules.Skills
e3.EffectType = EffectType.DefenseBoost;
e3.Source = caster;
e3.OnEffectGained(target);
GamingQueue?.LastRound.ApplyEffects.TryAdd(target, [EffectType.DamageBoost, EffectType.DefenseBoost]);
GamingQueue?.LastRound.AddApplyEffects(target, EffectType.DamageBoost, EffectType.DefenseBoost);
}
}
}

View File

@ -98,7 +98,7 @@ namespace Oshima.FunGame.OshimaModules.Skills
e2.EffectType = EffectType.DefenseBoost;
e2.Source = caster;
e2.OnEffectGained(target);
GamingQueue?.LastRound.ApplyEffects.TryAdd(target, [EffectType.DefenseBoost]);
GamingQueue?.LastRound.AddApplyEffects(target, EffectType.DefenseBoost);
}
}
}

View File

@ -113,7 +113,7 @@ namespace Oshima.FunGame.OshimaModules.Skills
e2.EffectType = EffectType.DefenseBoost;
e2.Source = caster;
e2.OnEffectGained(target);
GamingQueue?.LastRound.ApplyEffects.TryAdd(target, [EffectType.DefenseBoost]);
GamingQueue?.LastRound.AddApplyEffects(target, EffectType.DefenseBoost);
}
}
}

View File

@ -92,7 +92,7 @@ namespace Oshima.FunGame.OshimaModules.Skills
}
target.Effects.Add(e);
e.OnEffectGained(target);
GamingQueue?.LastRound.ApplyEffects.TryAdd(target, [e.EffectType]);
GamingQueue?.LastRound.AddApplyEffects(target, e.EffectType);
}
}
}

View File

@ -97,7 +97,7 @@ namespace Oshima.FunGame.OshimaModules.Skills
e2.EffectType = EffectType.EvadeBoost;
e2.Source = caster;
e2.OnEffectGained(target);
GamingQueue?.LastRound.ApplyEffects.TryAdd(target, [EffectType.CritBoost, EffectType.EvadeBoost]);
GamingQueue?.LastRound.AddApplyEffects(target, EffectType.CritBoost, EffectType.EvadeBoost);
}
}
}

View File

@ -112,7 +112,7 @@ namespace Oshima.FunGame.OshimaModules.Skills
e2.EffectType = EffectType.EvadeBoost;
e2.Source = caster;
e2.OnEffectGained(target);
GamingQueue?.LastRound.ApplyEffects.TryAdd(target, [EffectType.CritBoost, EffectType.EvadeBoost]);
GamingQueue?.LastRound.AddApplyEffects(target, EffectType.CritBoost, EffectType.EvadeBoost);
}
}
}

View File

@ -342,7 +342,7 @@ namespace Oshima.FunGame.OshimaServers.Service
$",击杀来自{actionQueue.GetTeam(actionQueue.LastRound.Actor)}\r\n" : "");
if (showAllRound)
{
Character[] showHPMP = [actionQueue.LastRound.Actor, .. actionQueue.LastRound.Targets];
Character[] showHPMP = [actionQueue.LastRound.Actor, .. actionQueue.LastRound.Targets.Values.SelectMany(c => c)];
foreach (Character character in showHPMP)
{
roundMsg += $"[ {character} ] 生命值:{character.HP:0.##}/{character.MaxHP:0.##} / 魔法值:{character.MP:0.##}/{character.MaxMP:0.##}\r\n";

View File

@ -11,7 +11,7 @@ namespace Oshima.FunGame.WebAPI.Controllers
{
[ApiController]
[Route("[controller]")]
public class OshimaController : ControllerBase
public class OshimaController(SQLHelper sql) : ControllerBase
{
[HttpGet("saints")]
public Dictionary<string, object> GetSaints(long group, bool reverse)
@ -21,9 +21,6 @@ namespace Oshima.FunGame.WebAPI.Controllers
if (Statics.RunningPlugin != null)
{
try
{
SQLHelper? sql = Statics.RunningPlugin.Controller.SQLHelper;
if (sql != null)
{
sql.Script = "select qq UID, '-' as Times, SC, Remark, Record from saints where `group` = @group order by sc" + (!reverse ? " desc" : "");
sql.Parameters.Add("group", group);
@ -35,7 +32,6 @@ namespace Oshima.FunGame.WebAPI.Controllers
return dict;
}
}
}
catch (Exception e)
{
Statics.RunningPlugin.Controller.Error(e);

View File

@ -220,12 +220,6 @@ namespace Oshima.FunGame.WebAPI
builder.Services.AddScoped<FunGameController>();
builder.Services.AddScoped<QQController>();
builder.Services.AddScoped<TestController>();
builder.Services.AddTransient(provider =>
{
SQLHelper? sql = Factory.OpenFactory.GetSQLHelper();
if (sql != null) return sql;
throw new Milimoe.FunGame.SQLServiceException();
});
// 使用 Configure<BotConfig> 从配置源绑定
builder.Services.Configure<BotConfig>(builder.Configuration.GetSection("Bot"));
}