新增新的数据查询;更新Rating计算公式;新的Skill继承方法

This commit is contained in:
milimoe 2024-10-31 23:33:14 +08:00
parent 4d18e3d072
commit 672573ecfd
Signed by: milimoe
GPG Key ID: 05D280912DA6C69E
23 changed files with 462 additions and 89 deletions

View File

@ -59,9 +59,14 @@ namespace Oshima.Core.Controllers
builder.AppendLine($"总计冠军数:{stats.Wins}");
builder.AppendLine($"总计前三数:{stats.Top3s}");
builder.AppendLine($"总计败场数:{stats.Loses}");
builder.AppendLine($"胜率:{stats.Winrates * 100:0.##}%");
List<string> names = [.. FunGameSimulation.TeamCharacterStatistics.OrderByDescending(kv => kv.Value.Winrates).Select(kv => kv.Key.GetName())];
builder.AppendLine($"胜率:{stats.Winrates * 100:0.##}%#{names.IndexOf(character.GetName())}");
builder.AppendLine($"前三率:{stats.Top3rates * 100:0.##}%");
builder.AppendLine($"技术得分:{stats.Rating:0.##}");
names = [.. FunGameSimulation.TeamCharacterStatistics.OrderByDescending(kv => kv.Value.Rating).Select(kv => kv.Key.GetName())];
builder.AppendLine($"技术得分:{stats.Rating:0.##}#{names.IndexOf(character.GetName())}");
builder.AppendLine($"上次排名:{stats.LastRank} / 场均名次:{stats.AvgRank}");
return NetworkUtility.JsonSerialize(builder.ToString());
@ -105,10 +110,11 @@ namespace Oshima.Core.Controllers
builder.AppendLine($"总计冠军数:{stats.Wins}");
builder.AppendLine($"总计前三数:{stats.Top3s}");
builder.AppendLine($"总计败场数:{stats.Loses}");
builder.AppendLine($"胜率:{stats.Winrates * 100:0.##}%");
builder.AppendLine($"前三率:{stats.Top3rates * 100:0.##}%");
builder.AppendLine($"技术得分:{stats.Rating:0.##}");
builder.AppendLine($"上次排名:{stats.LastRank} / 场均名次:{stats.AvgRank}");
List<string> names = [.. FunGameSimulation.TeamCharacterStatistics.OrderByDescending(kv => kv.Value.Winrates).Select(kv => kv.Key.GetName())];
builder.AppendLine($"胜率:{stats.Winrates * 100:0.##}%#{names.IndexOf(character.GetName())}");
names = [.. FunGameSimulation.TeamCharacterStatistics.OrderByDescending(kv => kv.Value.Rating).Select(kv => kv.Key.GetName())];
builder.AppendLine($"技术得分:{stats.Rating:0.##}#{names.IndexOf(character.GetName())}");
return NetworkUtility.JsonSerialize(builder.ToString());
}
@ -116,6 +122,90 @@ namespace Oshima.Core.Controllers
return NetworkUtility.JsonSerialize("");
}
[HttpGet("winraterank")]
public string GetWinrateRank([FromQuery] bool? isteam = null)
{
bool team = isteam ?? false;
if (team)
{
List<string> strings = [];
IEnumerable<Character> ratings = FunGameSimulation.TeamCharacterStatistics.OrderByDescending(kv => kv.Value.Winrates).Select(kv => kv.Key);
foreach (Character character in ratings)
{
StringBuilder builder = new();
CharacterStatistics stats = FunGameSimulation.TeamCharacterStatistics[character];
builder.AppendLine(character.ToString());
builder.AppendLine($"总计参赛数:{stats.Plays}");
builder.AppendLine($"总计冠军数:{stats.Wins}");
builder.AppendLine($"胜率:{stats.Winrates * 100:0.##}%");
builder.AppendLine($"技术得分:{stats.Rating:0.##}");
strings.Add(builder.ToString());
}
return NetworkUtility.JsonSerialize(strings);
}
else
{
List<string> strings = [];
IEnumerable<Character> ratings = FunGameSimulation.CharacterStatistics.OrderByDescending(kv => kv.Value.Winrates).Select(kv => kv.Key);
foreach (Character character in ratings)
{
StringBuilder builder = new();
CharacterStatistics stats = FunGameSimulation.CharacterStatistics[character];
builder.AppendLine(character.ToString());
builder.AppendLine($"总计参赛数:{stats.Plays}");
builder.AppendLine($"总计冠军数:{stats.Wins}");
builder.AppendLine($"胜率:{stats.Winrates * 100:0.##}%");
builder.AppendLine($"前三率:{stats.Top3rates * 100:0.##}%");
builder.AppendLine($"技术得分:{stats.Rating:0.##}");
builder.AppendLine($"上次排名:{stats.LastRank} / 场均名次:{stats.AvgRank}");
strings.Add(builder.ToString());
}
return NetworkUtility.JsonSerialize(strings);
}
}
[HttpGet("ratingrank")]
public string GetRatingRank([FromQuery] bool? isteam = null)
{
bool team = isteam ?? false;
if (team)
{
List<string> strings = [];
IEnumerable<Character> ratings = FunGameSimulation.TeamCharacterStatistics.OrderByDescending(kv => kv.Value.Rating).Select(kv => kv.Key);
foreach (Character character in ratings)
{
StringBuilder builder = new();
CharacterStatistics stats = FunGameSimulation.TeamCharacterStatistics[character];
builder.AppendLine(character.ToString());
builder.AppendLine($"总计参赛数:{stats.Plays}");
builder.AppendLine($"总计冠军数:{stats.Wins}");
builder.AppendLine($"胜率:{stats.Winrates * 100:0.##}%");
builder.AppendLine($"技术得分:{stats.Rating:0.##}");
strings.Add(builder.ToString());
}
return NetworkUtility.JsonSerialize(strings);
}
else
{
List<string> strings = [];
IEnumerable<Character> ratings = FunGameSimulation.CharacterStatistics.OrderByDescending(kv => kv.Value.Rating).Select(kv => kv.Key);
foreach (Character character in ratings)
{
StringBuilder builder = new();
CharacterStatistics stats = FunGameSimulation.CharacterStatistics[character];
builder.AppendLine(character.ToString());
builder.AppendLine($"总计参赛数:{stats.Plays}");
builder.AppendLine($"总计冠军数:{stats.Wins}");
builder.AppendLine($"胜率:{stats.Winrates * 100:0.##}%");
builder.AppendLine($"前三率:{stats.Top3rates * 100:0.##}%");
builder.AppendLine($"技术得分:{stats.Rating:0.##}");
builder.AppendLine($"上次排名:{stats.LastRank} / 场均名次:{stats.AvgRank}");
strings.Add(builder.ToString());
}
return NetworkUtility.JsonSerialize(strings);
}
}
[HttpGet("cjs")]
public string GetCharacterIntroduce([FromQuery] int? id = null)
{

View File

@ -482,7 +482,7 @@ namespace Oshima.Core.Utils
}
// 赛后统计
GetCharacterRating(actionQueue.CharacterStatistics, isTeam);
GetCharacterRating(actionQueue.CharacterStatistics, isTeam, actionQueue.EliminatedTeams);
int top = isWeb ? actionQueue.CharacterStatistics.Count : 0; // 回执多少个角色的统计信息
int count = 1;
if (isWeb)
@ -802,68 +802,59 @@ namespace Oshima.Core.Utils
if (totalStats.LiveTime != 0) totalStats.DamagePerSecond = Calculation.Round2Digits(totalStats.TotalDamage / totalStats.LiveTime);
}
public static void GetCharacterRating(Dictionary<Character, CharacterStatistics> statistics, bool isTeam)
public static void GetCharacterRating(Dictionary<Character, CharacterStatistics> statistics, bool isTeam, List<Team> teams)
{
Dictionary<Character, double> ratings = statistics.ToDictionary(k => k.Key, v => CalculateRating(v.Value, isTeam));
foreach (Character character in ratings.Keys)
foreach (Character character in statistics.Keys)
{
statistics[character].Rating = ratings[character];
Team? team = null;
if (isTeam)
{
team = teams.Where(t => t.IsOnThisTeam(character)).FirstOrDefault();
}
statistics[character].Rating = CalculateRating(statistics[character], team);
}
}
public static double CalculateRating(CharacterStatistics stats, bool isTeam)
public static double CalculateRating(CharacterStatistics stats, Team? team = null)
{
// 设定基准值
double avgKills = 4.0;
double avgAssists = 2.5;
double avgDeaths = 1.0;
double avgLiveTime = 90.0;
double avgTotalDamage = 7500.0;
double avgTotalTakenDamage = 5500.0;
double avgDamagePerSecond = 80.0;
// 团队模式使用其他基准
if (isTeam)
// 基础得分
double baseScore = (stats.Kills + stats.Assists) / (stats.Kills + stats.Assists + stats.Deaths + 0.01);
if (team is null)
{
avgKills = 2.0;
avgAssists = 3;
avgDeaths = 1.0;
avgLiveTime = 110.0;
avgTotalDamage = 6000.0;
avgTotalTakenDamage = 2000.0;
avgDamagePerSecond = 80.0;
baseScore += stats.Kills * 0.1;
if (stats.Deaths == 0)
{
baseScore += 0.5;
}
}
// 伤害贡献
double logDamageContribution = Math.Log(1 + (stats.TotalDamage / (stats.TotalTakenDamage + 1e-6)));
// 存活时间贡献
double liveTimeContribution = Math.Log(1 + (stats.LiveTime / (stats.TotalTakenDamage + 0.01) * 100));
// 团队模式参团率加成
double teamContribution = 0;
if (team != null)
{
teamContribution = (stats.Kills + stats.Assists) / (team.Score + 0.01);
if (team.IsWinner)
{
teamContribution += 0.2;
}
}
// 归一化计算
double normalizedKills = stats.Kills / avgKills;
double normalizedAssists = stats.Assists / avgAssists;
double normalizedDeaths = avgDeaths - stats.Deaths / avgDeaths;
double normalizedLiveTime = stats.LiveTime / avgLiveTime;
double normalizedTotalDamage = stats.TotalDamage / avgTotalDamage;
double normalizedTotalTakenDamage = stats.TotalTakenDamage / avgTotalTakenDamage;
double normalizedDamagePerSecond = stats.DamagePerSecond / avgDamagePerSecond;
// 权重设置
double killWeight = 0.4;
double assistWeight = 0.15;
double deathWeight = -0.25;
double liveTimeWeight = 0.2;
double totalDamageWeight = 0.25;
double totalTakenDamageWeight = 0.15;
double damagePerSecondWeight = 0.05;
double k = stats.Deaths > 0 ? 0.2 : 0.075; // 伤害贡献权重
double l = stats.Deaths > 0 ? 0.3 : 0.05; // 存活时间权重
double t = stats.Deaths > 0 ? 0.225 : 0.1; // 参团率权重
// 计算归一化后的Rating
double rating =
killWeight * normalizedKills +
assistWeight * normalizedAssists +
deathWeight * normalizedDeaths +
liveTimeWeight * normalizedLiveTime +
totalDamageWeight * normalizedTotalDamage +
totalTakenDamageWeight * normalizedTotalTakenDamage +
damagePerSecondWeight * normalizedDamagePerSecond;
// 计算最终评分
double rating = baseScore + k * logDamageContribution + l * liveTimeContribution + t * teamContribution;
// 限制Rating在 0 和 5 之间
return Math.Clamp(rating, 0, 5);
// 确保评分在合理范围内
return Math.Max(0.01, rating);
}
}
}

View File

@ -50,7 +50,7 @@ namespace Oshima.FunGame.OshimaModules.Skills
}
}
public override void OnSkillCasted(Character caster, List<Character> enemys, List<Character> teammates, Dictionary<string, object> others)
public override void OnSkillCasted(Character caster, List<Character> targets, Dictionary<string, object> others)
{
RemainDuration = Duration;
if (!caster.Effects.Contains(this))

View File

@ -59,7 +59,7 @@ namespace Oshima.FunGame.OshimaModules.Skills
= caster.EP;
}
public override void OnSkillCasted(Character caster, List<Character> enemys, List<Character> teammates, Dictionary<string, object> others)
public override void OnSkillCasted(Character caster, List<Character> targets, Dictionary<string, object> others)
{
RemainDuration = Duration;
if (!caster.Effects.Contains(this))

View File

@ -52,7 +52,7 @@ namespace Oshima.FunGame.OshimaModules.Skills
character.PhysicalPenetration -= 穿;
}
public override void OnSkillCasted(Character caster, List<Character> enemys, List<Character> teammates, Dictionary<string, object> others)
public override void OnSkillCasted(Character caster, List<Character> targets, Dictionary<string, object> others)
{
RemainDuration = Duration;
if (!caster.Effects.Contains(this))

View File

@ -51,7 +51,7 @@ namespace Oshima.FunGame.OshimaModules.Skills
}
}
public override void OnSkillCasted(Character caster, List<Character> enemys, List<Character> teammates, Dictionary<string, object> others)
public override void OnSkillCasted(Character caster, List<Character> targets, Dictionary<string, object> others)
{
= ;
if (!caster.Effects.Contains(this))

View File

@ -51,7 +51,7 @@ namespace Oshima.FunGame.OshimaModules.Skills
}
}
public override void OnSkillCasted(Character caster, List<Character> enemys, List<Character> teammates, Dictionary<string, object> others)
public override void OnSkillCasted(Character caster, List<Character> targets, Dictionary<string, object> others)
{
IEnumerable<Effect> effects = caster.Effects.Where(e => e is );
if (effects.Any())

View File

@ -54,7 +54,7 @@ namespace Oshima.FunGame.OshimaModules.Skills
}
}
public override void OnSkillCasted(Character caster, List<Character> enemys, List<Character> teammates, Dictionary<string, object> others)
public override void OnSkillCasted(Character caster, List<Character> targets, Dictionary<string, object> others)
{
RemainDuration = Duration;
if (!caster.Effects.Contains(this))

View File

@ -66,7 +66,7 @@ namespace Oshima.FunGame.OshimaModules.Skills
baseHardnessTime *= 0.3;
}
public override void OnSkillCasted(Character caster, List<Character> enemys, List<Character> teammates, Dictionary<string, object> others)
public override void OnSkillCasted(Character caster, List<Character> targets, Dictionary<string, object> others)
{
RemainDuration = Duration;
if (!caster.Effects.Contains(this))

View File

@ -32,9 +32,9 @@ namespace Oshima.FunGame.OshimaModules.Skills
private double => * Skill.Character?.INT ?? 0;
private double => 1.05 * Level;
public override void OnSkillCasted(Character caster, List<Character> enemys, List<Character> teammates, Dictionary<string, object> others)
public override void OnSkillCasted(Character caster, List<Character> targets, Dictionary<string, object> others)
{
foreach (Character c in enemys)
foreach (Character c in targets)
{
WriteLine($"[ {caster} ] 正在毁灭 [ {c} ] 的能量!!");
double ep = c.EP;

View File

@ -37,7 +37,7 @@ namespace Oshima.FunGame.OshimaModules.Skills
}
}
public override void OnSkillCasted(Character caster, List<Character> enemys, List<Character> teammates, Dictionary<string, object> others)
public override void OnSkillCasted(Character caster, List<Character> targets, Dictionary<string, object> others)
{
RemainDuration = Duration;
if (!caster.Effects.Contains(this))

View File

@ -76,7 +76,7 @@ namespace Oshima.FunGame.OshimaModules.Skills
baseHardnessTime *= 0.8;
}
public override void OnSkillCasted(Character caster, List<Character> enemys, List<Character> teammates, Dictionary<string, object> others)
public override void OnSkillCasted(Character caster, List<Character> targets, Dictionary<string, object> others)
{
RemainDuration = Duration;
if (!caster.Effects.Contains(this))

View File

@ -50,7 +50,7 @@ namespace Oshima.FunGame.OshimaModules.Skills
return false;
}
public override void OnSkillCasted(Character caster, List<Character> enemys, List<Character> teammates, Dictionary<string, object> others)
public override void OnSkillCasted(Character caster, List<Character> targets, Dictionary<string, object> others)
{
RemainDuration = Duration;
if (!caster.Effects.Contains(this))

View File

@ -55,7 +55,7 @@ namespace Oshima.FunGame.OshimaModules.Skills
character.Recovery(pastHP, pastMP, pastMaxHP, pastMaxMP);
}
public override void OnSkillCasted(Character caster, List<Character> enemys, List<Character> teammates, Dictionary<string, object> others)
public override void OnSkillCasted(Character caster, List<Character> targets, Dictionary<string, object> others)
{
RemainDuration = Duration;
if (!caster.Effects.Contains(this))

View File

@ -69,7 +69,7 @@ namespace Oshima.FunGame.OshimaModules.Skills
return false;
}
public override void OnSkillCasted(Character caster, List<Character> enemys, List<Character> teammates, Dictionary<string, object> others)
public override void OnSkillCasted(Character caster, List<Character> targets, Dictionary<string, object> others)
{
if (!caster.Effects.Contains(this))
{

View File

@ -9,8 +9,8 @@ namespace Oshima.FunGame.OshimaModules.Skills
public override string Name => "冰霜攻击";
public override string Description => Effects.Count > 0 ? Effects.First().Description : "";
public override double MPCost => 30 + (50 * (Level - 1));
public override double CD => 20;
public override double CastTime => 6;
public override double CD => 25;
public override double CastTime => 8;
public override double HardnessTime { get; set; } = 3;
public (Character? character = null) : base(SkillType.Magic, character)
@ -23,28 +23,19 @@ namespace Oshima.FunGame.OshimaModules.Skills
{
public override long Id => Skill.Id;
public override string Name => Skill.Name;
public override string Description => $"对目标敌人造成 {90 + 60 * (Skill.Level - 1):0.##} + {(1.2 + 1.8 * (Skill.Level - 1)) * 100:0.##}% 智力 [ {Damage:0.##} ] 点{CharacterSet.GetMagicDamageName(MagicType)}。";
public override string Description => $"对目标敌人造成 {基础伤害:0.##} + {系数 * 100:0.##}% 智力 [ {Damage:0.##} ] 点{CharacterSet.GetMagicDamageName(MagicType)}。";
public override bool TargetSelf => false;
public override int TargetCount => 1;
private double Damage
{
get
{
double d = 0;
if (Skill.Character != null)
{
d = 90 + 60 * (Skill.Level - 1) + (1.2 + 1.8 * (Skill.Level - 1)) * Skill.Character.INT;
}
return d;
}
}
private double => 90 + 60 * (Skill.Level - 1);
private double => 0.35 + 0.4 * (Skill.Level - 1);
private double Damage => + * Skill.Character?.INT ?? 0;
public override void OnSkillCasted(Character caster, List<Character> enemys, List<Character> teammates, Dictionary<string, object> others)
public override void OnSkillCasted(Character caster, List<Character> targets, Dictionary<string, object> others)
{
if (enemys.Count > 0)
if (targets.Count > 0)
{
Character enemy = enemys[new Random().Next(enemys.Count)];
Character enemy = targets[0];
DamageToEnemy(caster, enemy, true, MagicType, Damage);
}
}

View File

@ -0,0 +1,43 @@
using Milimoe.FunGame.Core.Entity;
using Milimoe.FunGame.Core.Library.Constant;
namespace Oshima.FunGame.OshimaModules.Skills
{
public class : Skill
{
public override long Id => (long)MagicID.;
public override string Name => "心灵之霞";
public override string Description => Effects.Count > 0 ? Effects.First().Description : "";
public override double MPCost => 30 + (50 * (Level - 1));
public override double CD => 25;
public override double CastTime => 6;
public override double HardnessTime { get; set; } = 3;
public (Character? character = null) : base(SkillType.Magic, character)
{
Effects.Add(new (this));
}
}
public class (Skill skill) : Effect(skill)
{
public override long Id => Skill.Id;
public override string Name => Skill.Name;
public override string Description => $"对目标敌人造成 {基础伤害:0.##} + {智力系数 * 100:0.##}% 智力 [ {Damage:0.##} ] 点{CharacterSet.GetMagicDamageName(MagicType)}。";
public override bool TargetSelf => false;
public override int TargetCount => 1;
private double => 90 + 60 * (Skill.Level - 1);
private double => (0.5 + 0.6 * (Skill.Level - 1));
private double Damage => + * Skill.Character?.INT ?? 0;
public override void OnSkillCasted(Character caster, List<Character> targets, Dictionary<string, object> others)
{
if (targets.Count > 0)
{
Character enemy = targets[0];
DamageToEnemy(caster, enemy, true, MagicType, Damage);
}
}
}
}

View File

@ -0,0 +1,43 @@
using Milimoe.FunGame.Core.Entity;
using Milimoe.FunGame.Core.Library.Constant;
namespace Oshima.FunGame.OshimaModules.Skills
{
public class : Skill
{
public override long Id => (long)MagicID.;
public override string Name => "暗物质";
public override string Description => Effects.Count > 0 ? Effects.First().Description : "";
public override double MPCost => 30 + (50 * (Level - 1));
public override double CD => 25;
public override double CastTime => 6;
public override double HardnessTime { get; set; } = 3;
public (Character? character = null) : base(SkillType.Magic, character)
{
Effects.Add(new (this));
}
}
public class (Skill skill) : Effect(skill)
{
public override long Id => Skill.Id;
public override string Name => Skill.Name;
public override string Description => $"对目标敌人造成 {基础伤害:0.##} + {智力系数 * 100:0.##}% 智力 [ {Damage:0.##} ] 点{CharacterSet.GetMagicDamageName(MagicType)}。";
public override bool TargetSelf => false;
public override int TargetCount => 1;
private double => 90 + 60 * (Skill.Level - 1);
private double => (0.5 + 0.6 * (Skill.Level - 1));
private double Damage => + * Skill.Character?.INT ?? 0;
public override void OnSkillCasted(Character caster, List<Character> targets, Dictionary<string, object> others)
{
if (targets.Count > 0)
{
Character enemy = targets[0];
DamageToEnemy(caster, enemy, true, MagicType, Damage);
}
}
}
}

View File

@ -0,0 +1,43 @@
using Milimoe.FunGame.Core.Entity;
using Milimoe.FunGame.Core.Library.Constant;
namespace Oshima.FunGame.OshimaModules.Skills
{
public class : Skill
{
public override long Id => (long)MagicID.;
public override string Name => "次元上升";
public override string Description => Effects.Count > 0 ? Effects.First().Description : "";
public override double MPCost => 30 + (50 * (Level - 1));
public override double CD => 25;
public override double CastTime => 6;
public override double HardnessTime { get; set; } = 3;
public (Character? character = null) : base(SkillType.Magic, character)
{
Effects.Add(new (this));
}
}
public class (Skill skill) : Effect(skill)
{
public override long Id => Skill.Id;
public override string Name => Skill.Name;
public override string Description => $"对目标敌人造成 {基础伤害:0.##} + {智力系数 * 100:0.##}% 智力 [ {Damage:0.##} ] 点{CharacterSet.GetMagicDamageName(MagicType)}。";
public override bool TargetSelf => false;
public override int TargetCount => 1;
private double => 90 + 60 * (Skill.Level - 1);
private double => (0.5 + 0.6 * (Skill.Level - 1));
private double Damage => + * Skill.Character?.INT ?? 0;
public override void OnSkillCasted(Character caster, List<Character> targets, Dictionary<string, object> others)
{
if (targets.Count > 0)
{
Character enemy = targets[0];
DamageToEnemy(caster, enemy, true, MagicType, Damage);
}
}
}
}

View File

@ -0,0 +1,43 @@
using Milimoe.FunGame.Core.Entity;
using Milimoe.FunGame.Core.Library.Constant;
namespace Oshima.FunGame.OshimaModules.Skills
{
public class : Skill
{
public override long Id => (long)MagicID.;
public override string Name => "水之矢";
public override string Description => Effects.Count > 0 ? Effects.First().Description : "";
public override double MPCost => 30 + (40 * (Level - 1));
public override double CD => 20;
public override double CastTime => 6;
public override double HardnessTime { get; set; } = 3;
public (Character? character = null) : base(SkillType.Magic, character)
{
Effects.Add(new (this));
}
}
public class (Skill skill) : Effect(skill)
{
public override long Id => Skill.Id;
public override string Name => Skill.Name;
public override string Description => $"对目标敌人造成 {基础伤害:0.##} + {系数 * 100:0.##}% {CharacterSet.GetPrimaryAttributeName(Skill.Character?.PrimaryAttribute ?? PrimaryAttribute.INT)} [ {Damage:0.##} ] 点{CharacterSet.GetMagicDamageName(MagicType)}。";
public override bool TargetSelf => false;
public override int TargetCount => 1;
private double => 85 + 65 * (Skill.Level - 1);
private double => 0.35 + 0.45 * (Skill.Level - 1);
private double Damage => + * Skill.Character?.PrimaryAttributeValue ?? 0;
public override void OnSkillCasted(Character caster, List<Character> targets, Dictionary<string, object> others)
{
if (targets.Count > 0)
{
Character enemy = targets[0];
DamageToEnemy(caster, enemy, true, MagicType, Damage);
}
}
}
}

View File

@ -0,0 +1,43 @@
using Milimoe.FunGame.Core.Entity;
using Milimoe.FunGame.Core.Library.Constant;
namespace Oshima.FunGame.OshimaModules.Skills
{
public class : Skill
{
public override long Id => (long)MagicID.;
public override string Name => "火之矢";
public override string Description => Effects.Count > 0 ? Effects.First().Description : "";
public override double MPCost => 30 + (40 * (Level - 1));
public override double CD => 20;
public override double CastTime => 6;
public override double HardnessTime { get; set; } = 3;
public (Character? character = null) : base(SkillType.Magic, character)
{
Effects.Add(new (this));
}
}
public class (Skill skill) : Effect(skill)
{
public override long Id => Skill.Id;
public override string Name => Skill.Name;
public override string Description => $"对目标敌人造成 {基础伤害:0.##} + {系数 * 100:0.##}% {CharacterSet.GetPrimaryAttributeName(Skill.Character?.PrimaryAttribute ?? PrimaryAttribute.INT)} [ {Damage:0.##} ] 点{CharacterSet.GetMagicDamageName(MagicType)}。";
public override bool TargetSelf => false;
public override int TargetCount => 1;
private double => 80 + 65 * (Skill.Level - 1);
private double => 0.45 + 0.35 * (Skill.Level - 1);
private double Damage => + * Skill.Character?.PrimaryAttributeValue ?? 0;
public override void OnSkillCasted(Character caster, List<Character> targets, Dictionary<string, object> others)
{
if (targets.Count > 0)
{
Character enemy = targets[0];
DamageToEnemy(caster, enemy, true, MagicType, Damage);
}
}
}
}

View File

@ -0,0 +1,43 @@
using Milimoe.FunGame.Core.Entity;
using Milimoe.FunGame.Core.Library.Constant;
namespace Oshima.FunGame.OshimaModules.Skills
{
public class : Skill
{
public override long Id => (long)MagicID.;
public override string Name => "石之锤";
public override string Description => Effects.Count > 0 ? Effects.First().Description : "";
public override double MPCost => 30 + (30 * (Level - 1));
public override double CD => 22;
public override double CastTime => 6;
public override double HardnessTime { get; set; } = 4;
public (Character? character = null) : base(SkillType.Magic, character)
{
Effects.Add(new (this));
}
}
public class (Skill skill) : Effect(skill)
{
public override long Id => Skill.Id;
public override string Name => Skill.Name;
public override string Description => $"对目标敌人造成 {基础伤害:0.##} + {系数 * 100:0.##}% 力量 [ {Damage:0.##} ] 点{CharacterSet.GetMagicDamageName(MagicType)}。";
public override bool TargetSelf => false;
public override int TargetCount => 1;
private double => 100 + 50 * (Skill.Level - 1);
private double => 0.7 + 0.4 * (Skill.Level - 1);
private double Damage => + * Skill.Character?.STR ?? 0;
public override void OnSkillCasted(Character caster, List<Character> targets, Dictionary<string, object> others)
{
if (targets.Count > 0)
{
Character enemy = targets[0];
DamageToEnemy(caster, enemy, true, MagicType, Damage);
}
}
}
}

View File

@ -0,0 +1,43 @@
using Milimoe.FunGame.Core.Entity;
using Milimoe.FunGame.Core.Library.Constant;
namespace Oshima.FunGame.OshimaModules.Skills
{
public class : Skill
{
public override long Id => (long)MagicID.;
public override string Name => "风之轮";
public override string Description => Effects.Count > 0 ? Effects.First().Description : "";
public override double MPCost => 50 + (60 * (Level - 1));
public override double CD => 30;
public override double CastTime => 10;
public override double HardnessTime { get; set; } = 4;
public (Character? character = null) : base(SkillType.Magic, character)
{
Effects.Add(new (this));
}
}
public class (Skill skill) : Effect(skill)
{
public override long Id => Skill.Id;
public override string Name => Skill.Name;
public override string Description => $"对目标敌人造成 {基础伤害:0.##} + {系数 * 100:0.##}% 敏捷 [ {Damage:0.##} ] 点{CharacterSet.GetMagicDamageName(MagicType)}。";
public override bool TargetSelf => false;
public override int TargetCount => 1;
private double => 120 + 80 * (Skill.Level - 1);
private double => 0.4 + 0.4 * (Skill.Level - 1);
private double Damage => + * Skill.Character?.AGI ?? 0;
public override void OnSkillCasted(Character caster, List<Character> targets, Dictionary<string, object> others)
{
if (targets.Count > 0)
{
Character enemy = targets[0];
DamageToEnemy(caster, enemy, true, MagicType, Damage);
}
}
}
}