优化 round 的问题

This commit is contained in:
milimoe 2024-10-19 02:05:32 +08:00
parent 46f5f76f81
commit dd16b49428
Signed by: milimoe
GPG Key ID: 05D280912DA6C69E
33 changed files with 147 additions and 168 deletions

View File

@ -6,7 +6,7 @@ namespace Oshima.Core.Configs
public class OSMCore
{
public const string version = "v1.0";
public const string version2 = "Beta4";
public const string version2 = "Beta5";
public static string Info => $"OSM Core {version} {version2}\r\nAuthor: Milimoe\r\nBuilt on {GetBuiltTime(Assembly.GetExecutingAssembly().Location)}\r\nSee: https://github.com/milimoe";

View File

@ -3,7 +3,6 @@ using Microsoft.AspNetCore.Mvc;
using Microsoft.Extensions.Logging;
using Milimoe.FunGame.Core.Api.Utility;
using Milimoe.FunGame.Core.Entity;
using Oshima.Core.Configs;
using Oshima.Core.Models;
using Oshima.Core.Utils;

View File

@ -13,11 +13,11 @@ namespace Oshima.Core.Controllers
private readonly ILogger<QQController> _logger = logger;
[HttpPost("bind")]
public string Post([FromBody] BindQQ b)
public string Bind([FromBody] BindQQ b)
{
if (QQOpenID.QQAndOpenID.Values.Any(qq => qq == b.QQ))
if (b.Openid.Trim() == "" || b.QQ <= 0)
{
return NetworkUtility.JsonSerialize($"此QQ已被其他人绑定如果你是此QQ的主人请联系客服处理。");
return NetworkUtility.JsonSerialize("请输入正确的OpenID和QQ");
}
if (QQOpenID.QQAndOpenID.TryGetValue(b.Openid, out long bindqq) && bindqq != 0)
@ -25,6 +25,11 @@ namespace Oshima.Core.Controllers
return NetworkUtility.JsonSerialize($"你已经绑定过:{bindqq},如绑定错误请联系客服处理。");
}
if (QQOpenID.QQAndOpenID.Values.Any(qq => qq == b.QQ && b.Openid != b.Openid))
{
return NetworkUtility.JsonSerialize($"此QQ {b.QQ} 已被其他人绑定如果你是此QQ的主人请联系客服处理。");
}
if (QQOpenID.QQAndOpenID.TryAdd(b.Openid, b.QQ))
{
QQOpenID.SaveConfig();
@ -34,7 +39,18 @@ namespace Oshima.Core.Controllers
return NetworkUtility.JsonSerialize($"绑定失败,请稍后再试!如持续绑定失败请联系客服处理。");
}
return NetworkUtility.JsonSerialize("绑定成功!");
return NetworkUtility.JsonSerialize("绑定成功!如果需要解除绑定,请发送【解绑+QQ号】解绑123456789");
}
[HttpPost("unbind")]
public string Unbind([FromBody] BindQQ b)
{
if (QQOpenID.QQAndOpenID.TryGetValue(b.Openid, out long bindqq) && bindqq == b.QQ && QQOpenID.QQAndOpenID.Remove(b.Openid))
{
return NetworkUtility.JsonSerialize($"解绑成功!");
}
return NetworkUtility.JsonSerialize("解绑失败没有查到绑定的信息或者此账号已被其他人绑定如果你是此QQ的主人请联系客服处理。");
}
}
}

View File

@ -320,7 +320,7 @@ namespace Oshima.Core.Utils
Dictionary<Character, double> = [];
foreach (Character c in characters)
{
.TryAdd(c, Calculation.Round4Digits(c.HP / c.MaxHP));
.TryAdd(c, c.HP / c.MaxHP);
}
double max = .Values.Max();
Character winner = .Keys.Where(c => [c] == max).First();
@ -378,7 +378,7 @@ namespace Oshima.Core.Utils
if (PrintOut)
{
Console.WriteLine("--- End ---");
Console.WriteLine("总游戏时长:" + Calculation.Round2Digits(totalTime));
Console.WriteLine($"总游戏时长:{totalTime:0.##}");
Console.WriteLine("");
}

View File

@ -1,7 +0,0 @@
namespace Oshima.FunGame.OshimaModules.Controllers
{
public class Controller
{
}
}

View File

@ -1,5 +1,4 @@
using Milimoe.FunGame.Core.Api.Utility;
using Milimoe.FunGame.Core.Entity;
using Milimoe.FunGame.Core.Entity;
using Milimoe.FunGame.Core.Library.Constant;
namespace Oshima.FunGame.OshimaModules.ItemEffects
@ -8,7 +7,7 @@ namespace Oshima.FunGame.OshimaModules.ItemEffects
{
public override long Id => Skill.Id;
public override string Name => Skill.Name;
public override string Description => $"减少角色的所有主动技能 {实际硬直时间减少} 硬直时间。" + (!TargetSelf ? $"来自:[ {Source} ]" + (Item != null ? $" 的 [ {Item.Name} ]" : "") : "");
public override string Description => $"减少角色的所有主动技能 {实际硬直时间减少:0.##} 硬直时间。" + (!TargetSelf ? $"来自:[ {Source} ]" + (Item != null ? $" 的 [ {Item.Name} ]" : "") : "");
public override EffectType EffectType => EffectType.Item;
public override bool TargetSelf => true;
@ -19,12 +18,12 @@ namespace Oshima.FunGame.OshimaModules.ItemEffects
{
foreach (Skill s in character.Skills)
{
s.HardnessTime = Calculation.Round2Digits(s.HardnessTime - );
s.HardnessTime -= ;
}
foreach (Skill? s in character.Items.Select(i => i.Skills.Active))
{
if (s != null)
s.HardnessTime = Calculation.Round2Digits(s.HardnessTime - );
s.HardnessTime -= ;
}
}
@ -32,12 +31,12 @@ namespace Oshima.FunGame.OshimaModules.ItemEffects
{
foreach (Skill s in character.Skills)
{
s.HardnessTime = Calculation.Round2Digits(s.HardnessTime + );
s.HardnessTime += ;
}
foreach (Skill? s in character.Items.Select(i => i.Skills.Active))
{
if (s != null)
s.HardnessTime = Calculation.Round2Digits(s.HardnessTime + );
s.HardnessTime += ;
}
}

View File

@ -7,7 +7,7 @@ namespace Oshima.FunGame.OshimaModules.ItemEffects
{
public override long Id => Skill.Id;
public override string Name => Skill.Name;
public override string Description => $"增加角色 {实际攻击力加成} 点攻击力。" + (!TargetSelf ? $"来自:[ {Source} ]" + (Item != null ? $" 的 [ {Item.Name} ]" : "") : "");
public override string Description => $"增加角色 {实际攻击力加成:0.##} 点攻击力。" + (!TargetSelf ? $"来自:[ {Source} ]" + (Item != null ? $" 的 [ {Item.Name} ]" : "") : "");
public override EffectType EffectType => EffectType.Item;
public override bool TargetSelf => true;

View File

@ -1,5 +1,4 @@
using Milimoe.FunGame.Core.Api.Utility;
using Milimoe.FunGame.Core.Entity;
using Milimoe.FunGame.Core.Entity;
using Milimoe.FunGame.Core.Library.Constant;
namespace Oshima.FunGame.OshimaModules.ItemEffects
@ -8,7 +7,7 @@ namespace Oshima.FunGame.OshimaModules.ItemEffects
{
public override long Id => Skill.Id;
public override string Name => Skill.Name;
public override string Description => $"减少角色的普通攻击 {实际硬直时间减少} 硬直时间。" + (!TargetSelf ? $"来自:[ {Source} ]" + (Item != null ? $" 的 [ {Item.Name} ]" : "") : "");
public override string Description => $"减少角色的普通攻击 {实际硬直时间减少:0.##} 硬直时间。" + (!TargetSelf ? $"来自:[ {Source} ]" + (Item != null ? $" 的 [ {Item.Name} ]" : "") : "");
public override EffectType EffectType => EffectType.Item;
public override bool TargetSelf => true;
@ -17,12 +16,12 @@ namespace Oshima.FunGame.OshimaModules.ItemEffects
public override void OnEffectGained(Character character)
{
character.NormalAttack.HardnessTime = Calculation.Round2Digits(character.NormalAttack.HardnessTime - ); ;
character.NormalAttack.HardnessTime -= ;
}
public override void OnEffectLost(Character character)
{
character.NormalAttack.HardnessTime = Calculation.Round2Digits(character.NormalAttack.HardnessTime + ); ;
character.NormalAttack.HardnessTime += ;
}
public (Skill skill, Character? source, Item? item, double reduce) : base(skill)

View File

@ -7,7 +7,7 @@ namespace Oshima.FunGame.OshimaModules.ItemEffects
{
public override long Id => Skill.Id;
public override string Name => Skill.Name;
public override string Description => $"增加角色 {实际物理护甲加成} 点物理护甲。" + (!TargetSelf ? $"来自:[ {Source} ]" + (Item != null ? $" 的 [ {Item.Name} ]" : "") : "");
public override string Description => $"增加角色 {实际物理护甲加成:0.##} 点物理护甲。" + (!TargetSelf ? $"来自:[ {Source} ]" + (Item != null ? $" 的 [ {Item.Name} ]" : "") : "");
public override EffectType EffectType => EffectType.Item;
public override bool TargetSelf => true;

View File

@ -22,7 +22,7 @@ namespace Oshima.FunGame.OshimaModules.Items
{
public override long Id => 5999;
public override string Name => "独奏弓";
public override string Description => $"增加角色 {攻击力加成} 点攻击力,减少普通攻击 {硬直时间减少} 硬直时间。";
public override string Description => $"增加角色 {攻击力加成:0.##} 点攻击力,减少普通攻击 {硬直时间减少:0.##} 硬直时间。";
private readonly double = 80;
private readonly double = 2;

View File

@ -1,5 +1,4 @@
using Milimoe.FunGame.Core.Api.Utility;
using Milimoe.FunGame.Core.Entity;
using Milimoe.FunGame.Core.Entity;
using Milimoe.FunGame.Core.Library.Constant;
using Oshima.FunGame.OshimaModules.Effects;
@ -30,7 +29,7 @@ namespace Oshima.FunGame.OshimaModules.Skills
public override double Duration => 30;
public HashSet<Character> { get; } = [];
private double => Calculation.Round4Digits(0.03 * Level);
private double => 0.03 * Level;
public override void AfterDamageCalculation(Character character, Character enemy, double damage, bool isNormalAttack, bool isMagicDamage, MagicType magicType, DamageResult damageResult)
{
@ -45,9 +44,9 @@ namespace Oshima.FunGame.OshimaModules.Skills
{
= 4;
}
double = Calculation.Round2Digits( * * damage);
double = * * damage;
character.HP += ;
WriteLine($"[ {character} ] 回复了 {实际吸血} 点生命值!");
WriteLine($"[ {character} ] 回复了 {实际吸血:0.##} 点生命值!");
}
}

View File

@ -1,5 +1,4 @@
using Milimoe.FunGame.Core.Api.Utility;
using Milimoe.FunGame.Core.Entity;
using Milimoe.FunGame.Core.Entity;
using Milimoe.FunGame.Core.Library.Constant;
using Oshima.FunGame.OshimaModules.Effects;
@ -57,7 +56,7 @@ namespace Oshima.FunGame.OshimaModules.Skills
{
// 移除标记
enemy.Effects.Remove(e);
double = Calculation.Round2Digits(enemy.MaxHP * );
double = enemy.MaxHP * ;
WriteLine($"[ {character} ] 发动了累积之压!将对 [ {enemy} ] 造成眩晕和额外伤害!");
// 眩晕
IEnumerable<Effect> effects3 = enemy.Effects.Where(e => e is && e.Skill == Skill);

View File

@ -1,5 +1,4 @@
using Milimoe.FunGame.Core.Api.Utility;
using Milimoe.FunGame.Core.Entity;
using Milimoe.FunGame.Core.Entity;
using Milimoe.FunGame.Core.Library.Constant;
namespace Oshima.FunGame.OshimaModules.Skills
@ -42,9 +41,9 @@ namespace Oshima.FunGame.OshimaModules.Skills
if (character == Skill.Character)
{
double = Calculation.Round2Digits(damage * );
damage = Calculation.Round2Digits(damage + );
if ( > 0) WriteLine($"[ {character} ] 的伤害提升了 {实际伤害提升} 点!");
double = damage * ;
damage += ;
if ( > 0) WriteLine($"[ {character} ] 的伤害提升了 {实际伤害提升:0.##} 点!");
}
}
return false;
@ -52,7 +51,7 @@ namespace Oshima.FunGame.OshimaModules.Skills
public override void OnTimeElapsed(Character character, double eapsed)
{
= Calculation.Round4Digits( + * eapsed);
+= * eapsed;
WriteLine($"[ {character} ] 的 [ {Name} ] 效果增加了,当前总提升:{累计伤害 * 100:0.##}%。");
}
}

View File

@ -1,5 +1,4 @@
using Milimoe.FunGame.Core.Api.Utility;
using Milimoe.FunGame.Core.Entity;
using Milimoe.FunGame.Core.Entity;
using Milimoe.FunGame.Core.Library.Constant;
namespace Oshima.FunGame.OshimaModules.Skills
@ -23,13 +22,13 @@ namespace Oshima.FunGame.OshimaModules.Skills
{
public override long Id => Skill.Id;
public override string Name => Skill.Name;
public override string Description => $"{Duration} 时间内无法受到任何伤害,且敏捷提升 {系数 * 100:0.##}% [ {敏捷提升} ]。此技能会消耗至少 100 点能量。";
public override string Description => $"{Duration:0.##} 时间内无法受到任何伤害,且敏捷提升 {系数 * 100:0.##}% [ {敏捷提升:0.##} ]。此技能会消耗至少 100 点能量。";
public override bool TargetSelf => true;
public override bool Durative => true;
public override double Duration => Calculation.Round2Digits(16 + * 0.03);
public override double Duration => 16 + * 0.03;
private double => Calculation.Round4Digits(0.3 + 0.03 * (Level - 1));
private double => Calculation.Round2Digits( * Skill.Character?.BaseAGI ?? 0);
private double => 0.3 + 0.03 * (Level - 1);
private double => * Skill.Character?.BaseAGI ?? 0;
private double = 0;
private double = 0;
@ -37,7 +36,7 @@ namespace Oshima.FunGame.OshimaModules.Skills
{
= ;
character.ExAGI += ;
WriteLine($"[ {character} ] 的敏捷提升了 {系数 * 100:0.##}% [ {实际敏捷提升} ] ");
WriteLine($"[ {character} ] 的敏捷提升了 {系数 * 100:0.##}% [ {实际敏捷提升:0.##} ] ");
}
public override void OnEffectLost(Character character)

View File

@ -1,5 +1,4 @@
using Milimoe.FunGame.Core.Api.Utility;
using Milimoe.FunGame.Core.Entity;
using Milimoe.FunGame.Core.Entity;
using Milimoe.FunGame.Core.Library.Constant;
namespace Oshima.FunGame.OshimaModules.Skills
@ -28,8 +27,8 @@ namespace Oshima.FunGame.OshimaModules.Skills
public override bool Durative => true;
public override double Duration => 30;
private double => Calculation.Round4Digits(0.2 + 0.03 * (Level - 1));
private double => Calculation.Round4Digits(0.8 + 0.04 * (Level - 1));
private double => 0.2 + 0.03 * (Level - 1);
private double => 0.8 + 0.04 * (Level - 1);
private double = 0;
private double = 0;

View File

@ -1,5 +1,4 @@
using Milimoe.FunGame.Core.Api.Utility;
using Milimoe.FunGame.Core.Entity;
using Milimoe.FunGame.Core.Entity;
using Milimoe.FunGame.Core.Library.Constant;
namespace Oshima.FunGame.OshimaModules.Skills
@ -25,19 +24,13 @@ namespace Oshima.FunGame.OshimaModules.Skills
{
public override long Id => Skill.Id;
public override string Name => Skill.Name;
public override string Description => $"每释放 {触发硬直次数} 次魔法才会触发硬直时间,且魔法命中时基于 25% 智力 [ {获得额外能量值} ] 获得额外能量值。";
public override string Description => $"每释放 {触发硬直次数:0.##} 次魔法才会触发硬直时间,且魔法命中时基于 25% 智力 [ {获得额外能量值:0.##} ] 获得额外能量值。";
public override bool TargetSelf => true;
public bool { get; set; } = false;
public int { get; set; } = 2;
public int { get; set; } = 0;
public double
{
get
{
return Calculation.Round2Digits(0.25 * Skill.Character?.INT ?? 0);
}
}
public double => 0.25 * Skill.Character?.INT ?? 0;
public override void AfterDamageCalculation(Character character, Character enemy, double damage, bool isNormalAttack, bool isMagicDamage, MagicType magicType, DamageResult damageResult)
{
@ -45,13 +38,13 @@ namespace Oshima.FunGame.OshimaModules.Skills
{
double = ;
character.EP += ;
WriteLine("[ " + character + " ] 发动了灵能反射!额外获得了 " + + " 能量!");
WriteLine($"[ {character} ] 发动了灵能反射!额外获得了 {实际获得能量值:0.##} 能量!");
IEnumerable<Effect> effects = character.Effects.Where(e => e is );
if (effects.Any() && effects.First() is e)
{
double = Calculation.Round2Digits( * 10);
double = * 10;
character.MP += ;
WriteLine("[ " + character + " ] 发动了三重叠加!回复了 " + + " 魔法值!");
WriteLine($"[ {character} ] 发动了三重叠加!回复了 {获得的魔法值:0.##} 魔法值!");
}
}
}

View File

@ -1,5 +1,4 @@
using Milimoe.FunGame.Core.Api.Utility;
using Milimoe.FunGame.Core.Entity;
using Milimoe.FunGame.Core.Entity;
using Milimoe.FunGame.Core.Library.Constant;
namespace Oshima.FunGame.OshimaModules.Skills
@ -26,8 +25,8 @@ namespace Oshima.FunGame.OshimaModules.Skills
public override string Description => $"检查 [ 智慧与力量 ] 的模式。在力量模式下,立即回复 {生命值回复 * 100:0.##}% 生命值;智力模式下,下一次魔法伤害提升 {伤害提升 * 100:0.##}%。";
public override bool TargetSelf => true;
private double => Calculation.Round4Digits(0.25 + 0.03 * (Level - 1));
private double => Calculation.Round4Digits(0.55 + 0.25 * (Level - 1));
private double => 0.25 + 0.03 * (Level - 1);
private double => 0.55 + 0.25 * (Level - 1);
public override void OnEffectGained(Character character)
{
@ -44,9 +43,9 @@ namespace Oshima.FunGame.OshimaModules.Skills
if (character == Skill.Character && isMagicDamage)
{
double = ;
double = Calculation.Round2Digits(damage * );
damage = Calculation.Round2Digits(damage + );
WriteLine("[ " + character + " ] 发动了变幻之心!伤害提升了 " + + " 点!");
double = damage * ;
damage += ;
WriteLine($"[ {character} ] 发动了变幻之心!伤害提升了 {实际伤害提升:0.##} 点!");
character.Effects.Remove(this);
OnEffectLost(character);
}
@ -59,9 +58,9 @@ namespace Oshima.FunGame.OshimaModules.Skills
{
if (caster.PrimaryAttribute == PrimaryAttribute.STR)
{
double = Calculation.Round2Digits( * caster.MaxHP);
double = * caster.MaxHP;
caster.HP += ;
WriteLine("[ " + caster + " ] 回复了 " + + " 点生命值!");
WriteLine($"[ {caster} ] 回复了 {回复的生命:0.##} 点生命值!");
}
else if (caster.PrimaryAttribute == PrimaryAttribute.INT)
{

View File

@ -1,5 +1,4 @@
using Milimoe.FunGame.Core.Api.Utility;
using Milimoe.FunGame.Core.Entity;
using Milimoe.FunGame.Core.Entity;
using Milimoe.FunGame.Core.Library.Constant;
namespace Oshima.FunGame.OshimaModules.Skills
@ -25,14 +24,14 @@ namespace Oshima.FunGame.OshimaModules.Skills
{
public override long Id => Skill.Id;
public override string Name => Skill.Name;
public override string Description => $"META马专属被动力量+5力量成长+0.5在受到伤害时获得的能量提升50%,每回合开始还能获得额外的 [ {EP} ] 能量值。";
public override string Description => $"META马专属被动力量+5力量成长+0.5在受到伤害时获得的能量提升50%,每回合开始还能获得额外的 [ {EP:0.##} ] 能量值。";
public override bool TargetSelf => true;
public static double EP => 10;
public override void AlterEPAfterGetDamage(Character character, ref double baseEP)
{
baseEP = Calculation.Round2Digits(baseEP * 1.5);
if (Skill.Character != null) WriteLine("[ " + Skill.Character + " ] 发动了META马专属被动本次获得了 " + baseEP + " 能量!");
baseEP *= 1.5;
if (Skill.Character != null) WriteLine($"[ {Skill.Character} ] 发动了META马专属被动本次获得了 {baseEP:0.##} 能量!");
}
public override void OnTurnStart(Character character)
@ -40,7 +39,7 @@ namespace Oshima.FunGame.OshimaModules.Skills
if (character.EP < 200)
{
character.EP += EP;
WriteLine("[ " + character + " ] 发动了META马专属被动本次获得了 " + EP + " 能量!");
WriteLine($"[ {character} ] 发动了META马专属被动本次获得了 {EP:0.##} 能量!");
}
}
}

View File

@ -1,5 +1,4 @@
using Milimoe.FunGame.Core.Api.Utility;
using Milimoe.FunGame.Core.Entity;
using Milimoe.FunGame.Core.Entity;
using Milimoe.FunGame.Core.Library.Constant;
namespace Oshima.FunGame.OshimaModules.Skills
@ -23,20 +22,20 @@ namespace Oshima.FunGame.OshimaModules.Skills
{
public override long Id => Skill.Id;
public override string Name => "力量爆发";
public override string Description => $"获得 150% 力量 [ {攻击力加成} ] 的攻击力加成,但每次攻击都会损失 9% 当前生命值 [ {当前生命值} ],持续 {Duration} 时间。";
public override string Description => $"获得 150% 力量 [ {攻击力加成:0.##} ] 的攻击力加成,但每次攻击都会损失 9% 当前生命值 [ {当前生命值:0.##} ],持续 {Duration:0.##} 时间。";
public override bool TargetSelf => true;
public override bool Durative => true;
public override double Duration => 10 + 1 * (Level - 1);
private double => Calculation.Round2Digits(Skill.Character?.STR * 1.5 ?? 0);
private double => Calculation.Round2Digits(Skill.Character?.HP * 0.09 ?? 0);
private double => Skill.Character?.STR * 1.5 ?? 0;
private double => Skill.Character?.HP * 0.09 ?? 0;
private double = 0;
public override void OnEffectGained(Character character)
{
= ;
character.ExATK2 += ;
WriteLine($"[ {character} ] 的攻击力增加了 [ {实际攻击力加成} ] ");
WriteLine($"[ {character} ] 的攻击力增加了 [ {实际攻击力加成:0.##} ] ");
}
public override void OnEffectLost(Character character)
@ -51,7 +50,7 @@ namespace Oshima.FunGame.OshimaModules.Skills
{
double = ;
character.HP -= ;
WriteLine($"[ {character} ] 由于自身力量过于强大而被反噬,损失了 [ {生命值减少} ] 点生命值!");
WriteLine($"[ {character} ] 由于自身力量过于强大而被反噬,损失了 [ {生命值减少:0.##} ] 点生命值!");
}
}

View File

@ -1,5 +1,4 @@
using Milimoe.FunGame.Core.Api.Utility;
using Milimoe.FunGame.Core.Entity;
using Milimoe.FunGame.Core.Entity;
using Milimoe.FunGame.Core.Library.Constant;
namespace Oshima.FunGame.OshimaModules.Skills
@ -26,7 +25,7 @@ namespace Oshima.FunGame.OshimaModules.Skills
public override long Id => Skill.Id;
public override string Name => Skill.Name;
public override string Description => $"生命值高于 30% 时,受到额外的 [ {高于30额外伤害下限}~{高于30额外伤害上限}% ] 伤害,但是获得 [ 累计所受伤害的 {高于30的加成下限}~{高于30的加成上限}% ] 伤害加成;生命值低于等于 30% 时,不会受到额外的伤害,仅能获得 [ 累计受到的伤害 {低于30的加成下限}~{低于30的加成上限}% ] 伤害加成。" +
$"在没有受到任何伤害的时候,将获得 {常规伤害加成 * 100:0.##}% 伤害加成。" + ( > 0 ? $"(当前累计受到伤害:{累计受到的伤害}" : "");
$"在没有受到任何伤害的时候,将获得 {常规伤害加成 * 100:0.##}% 伤害加成。" + ( > 0 ? $"(当前累计受到伤害:{累计受到的伤害:0.##}" : "");
public override bool TargetSelf => true;
private double = 0;
@ -34,8 +33,8 @@ namespace Oshima.FunGame.OshimaModules.Skills
private double HP = 0;
private double = 0;
private readonly double = 0.35;
private readonly int 30 = 40;
private readonly int 30 = 20;
private readonly int 30 = 30;
private readonly int 30 = 15;
private readonly int 30 = 100;
private readonly int 30 = 80;
private readonly int 30 = 60;
@ -49,15 +48,15 @@ namespace Oshima.FunGame.OshimaModules.Skills
{
if (character.HP > character.MaxHP * 0.3)
{
= Calculation.Round4Digits(1.0 + ((new Random().Next(30, 30) + 0.0) / 100));
= 1.0 + ((Random.Shared.Next(30, 30) + 0.0) / 100);
}
else
{
= Calculation.Round4Digits(1.0 + ((new Random().Next(30, 30) + 0.0) / 100));
= 1.0 + ((Random.Shared.Next(30, 30) + 0.0) / 100);
}
return Calculation.Round2Digits( * );
return * ;
}
return Calculation.Round2Digits( * damage);
return * damage;
}
public override void AlterExpectedDamageBeforeCalculation(Character character, Character enemy, ref double damage, bool isNormalAttack, bool isMagicDamage, MagicType magicType)
@ -65,8 +64,8 @@ namespace Oshima.FunGame.OshimaModules.Skills
if (character == Skill.Character)
{
= (damage);
damage = Calculation.Round2Digits(damage + );
WriteLine($"[ {character} ] 发动了玻璃大炮,获得了 {这次的伤害加成} 点伤害加成!");
damage += ;
WriteLine($"[ {character} ] 发动了玻璃大炮,获得了 {这次的伤害加成:0.##} 点伤害加成!");
= 0;
}
@ -76,10 +75,10 @@ namespace Oshima.FunGame.OshimaModules.Skills
if (enemy.HP > enemy.MaxHP * 0.3)
{
// 额外受到伤害
double = Calculation.Round4Digits((new Random().Next(30, 30) + 0.0) / 100);
= Calculation.Round2Digits(damage * );
damage = Calculation.Round2Digits(damage + );
WriteLine($"[ {enemy} ] 的玻璃大炮触发,将额外受到 {这次受到的额外伤害} 点伤害!");
double = (Random.Shared.Next(30, 30) + 0.0) / 100;
= damage * ;
damage += ;
WriteLine($"[ {enemy} ] 的玻璃大炮触发,将额外受到 {这次受到的额外伤害:0.##} 点伤害!");
}
else = 0;
}
@ -89,7 +88,7 @@ namespace Oshima.FunGame.OshimaModules.Skills
{
if (enemy == Skill.Character && damageResult != DamageResult.Evaded)
{
= Calculation.Round2Digits( + damage);
+= damage;
if (enemy.HP < 0 && HP - damage + > 0)
{
enemy.HP = 10;

View File

@ -1,5 +1,4 @@
using Milimoe.FunGame.Core.Api.Utility;
using Milimoe.FunGame.Core.Entity;
using Milimoe.FunGame.Core.Entity;
using Milimoe.FunGame.Core.Library.Constant;
namespace Oshima.FunGame.OshimaModules.Skills
@ -23,13 +22,13 @@ namespace Oshima.FunGame.OshimaModules.Skills
{
public override long Id => Skill.Id;
public override string Name => Skill.Name;
public override string Description => $"{Duration} 时间内普通攻击转为魔法伤害且硬直时间减少50%,并基于 {智力系数 * 100:0.##}% 智力 [{智力加成}] 强化普通攻击伤害。";
public override string Description => $"{Duration:0.##} 时间内普通攻击转为魔法伤害且硬直时间减少50%,并基于 {智力系数 * 100:0.##}% 智力 [ {智力加成:0.##} ] 强化普通攻击伤害。";
public override bool TargetSelf => true;
public override bool Durative => true;
public override double Duration => 40;
private double => Calculation.Round4Digits(1.4 + 0.4 * (Level - 1));
private double => Calculation.Round2Digits( * Skill.Character?.INT ?? 0);
private double => 1.4 + 0.4 * (Level - 1);
private double => * Skill.Character?.INT ?? 0;
public override void OnEffectGained(Character character)
{
@ -45,13 +44,13 @@ namespace Oshima.FunGame.OshimaModules.Skills
{
if (character == Skill.Character && isNormalAttack)
{
damage = Calculation.Round2Digits(damage + );
damage += ;
}
}
public override void AlterHardnessTimeAfterNormalAttack(Character character, ref double baseHardnessTime, ref bool isCheckProtected)
{
baseHardnessTime = Calculation.Round2Digits(baseHardnessTime * 0.5);
baseHardnessTime *= 0.5;
}
public override void OnSkillCasted(Character caster, List<Character> enemys, List<Character> teammates, Dictionary<string, object> others)

View File

@ -1,5 +1,4 @@
using Milimoe.FunGame.Core.Api.Utility;
using Milimoe.FunGame.Core.Entity;
using Milimoe.FunGame.Core.Entity;
using Milimoe.FunGame.Core.Library.Constant;
namespace Oshima.FunGame.OshimaModules.Skills
@ -35,13 +34,13 @@ namespace Oshima.FunGame.OshimaModules.Skills
if (character == Skill.Character && damageResult != DamageResult.Evaded && !)
{
// 减少能量
double EP = new Random().Next(10, 25);
double EP = Random.Shared.Next(10, 25);
enemy.EP -= EP;
WriteLine($"[ {character} ] 发动了枯竭打击![ {enemy} ] 的能量值被减少了 {EP} 点!现有能量:{enemy.EP}。");
WriteLine($"[ {character} ] 发动了枯竭打击![ {enemy} ] 的能量值被减少了 {EP:0.##} 点!现有能量:{enemy.EP:0.##}。");
// 额外伤害
if (enemy.EP >= 0 && enemy.EP < 50 || enemy.EP >= 100 && enemy.EP < 150)
{
double = Calculation.Round2Digits(damage * 0.3);
double = damage * 0.3;
WriteLine($"[ {character} ] 发动了枯竭打击!将造成额外伤害!");
= true;
DamageToEnemy(character, enemy, isMagicDamage, magicType, );

View File

@ -1,5 +1,4 @@
using Milimoe.FunGame.Core.Api.Utility;
using Milimoe.FunGame.Core.Entity;
using Milimoe.FunGame.Core.Entity;
using Milimoe.FunGame.Core.Library.Constant;
namespace Oshima.FunGame.OshimaModules.Skills
@ -24,13 +23,13 @@ namespace Oshima.FunGame.OshimaModules.Skills
public override long Id => Skill.Id;
public override string Name => Skill.Name;
public override string Description => $"对所有角色造成 " +
$"{能量系数 * 100:0.##}% 其现有能量值 + {智力系数 * 100:0.##}% 智力 [ {智力伤害} ] 的魔法伤害。";
$"{能量系数 * 100:0.##}% 其现有能量值 + {智力系数 * 100:0.##}% 智力 [ {智力伤害:0.##} ] 的魔法伤害。";
public override bool TargetSelf => false;
public override double TargetRange => 999;
private double => Calculation.Round4Digits(0.55 * Level);
private double => Calculation.Round2Digits( * Skill.Character?.INT ?? 0);
private double => Calculation.Round4Digits(0.75 * Level);
private double => 0.55 * Level;
private double => * Skill.Character?.INT ?? 0;
private double => 0.75 * Level;
public override void OnSkillCasted(Character caster, List<Character> enemys, List<Character> teammates, Dictionary<string, object> others)
{
@ -38,7 +37,7 @@ namespace Oshima.FunGame.OshimaModules.Skills
{
WriteLine($"[ {caster} ] 正在毁灭 [ {c} ] 的能量!!");
double ep = c.EP;
DamageToEnemy(caster, c, true, MagicType, Calculation.Round2Digits(ep * + ));
DamageToEnemy(caster, c, true, MagicType, ep * + );
}
}
}

View File

@ -1,5 +1,4 @@
using Milimoe.FunGame.Core.Api.Utility;
using Milimoe.FunGame.Core.Entity;
using Milimoe.FunGame.Core.Entity;
using Milimoe.FunGame.Core.Library.Constant;
namespace Oshima.FunGame.OshimaModules.Skills
@ -32,14 +31,14 @@ namespace Oshima.FunGame.OshimaModules.Skills
{
if (character == Skill.Character && (enemy.HP / enemy.MaxHP) <= (character.HP / character.MaxHP))
{
double = Calculation.Round2Digits(damage * 0.5);
damage = Calculation.Round2Digits(damage + );
double = damage * 0.5;
damage += ;
}
}
public override bool AlterEnemyListBeforeAction(Character character, List<Character> enemys, List<Character> teammates, List<Skill> skills, Dictionary<Character, int> continuousKilling, Dictionary<Character, int> earnedMoney)
{
IEnumerable<Character> list = [.. enemys.OrderBy(e => Calculation.Round4Digits(e.HP / e.MaxHP))];
IEnumerable<Character> list = [.. enemys.OrderBy(e => e.HP / e.MaxHP)];
if (list.Any())
{
enemys.Clear();

View File

@ -1,5 +1,4 @@
using Milimoe.FunGame.Core.Api.Utility;
using Milimoe.FunGame.Core.Entity;
using Milimoe.FunGame.Core.Entity;
using Milimoe.FunGame.Core.Library.Constant;
namespace Oshima.FunGame.OshimaModules.Skills
@ -23,7 +22,7 @@ namespace Oshima.FunGame.OshimaModules.Skills
{
public override long Id => Skill.Id;
public override string Name => Skill.Name;
public override string Description => $"获得 40% 吸血,持续 {Duration} 时间。";
public override string Description => $"获得 40% 吸血,持续 {Duration:0.##} 时间。";
public override bool TargetSelf => true;
public override bool Durative => true;
public override double Duration => 30;
@ -32,9 +31,9 @@ namespace Oshima.FunGame.OshimaModules.Skills
{
if (character == Skill.Character && damageResult != DamageResult.Evaded && character.HP < character.MaxHP)
{
double = Calculation.Round2Digits(0.4 * damage);
double = 0.4 * damage;
character.HP += ;
WriteLine($"[ {character} ] 回复了 {实际吸血} 点生命值!");
WriteLine($"[ {character} ] 回复了 {实际吸血:0.##} 点生命值!");
}
}

View File

@ -1,5 +1,4 @@
using Milimoe.FunGame.Core.Api.Utility;
using Milimoe.FunGame.Core.Entity;
using Milimoe.FunGame.Core.Entity;
using Milimoe.FunGame.Core.Library.Constant;
namespace Oshima.FunGame.OshimaModules.Skills
@ -23,15 +22,15 @@ namespace Oshima.FunGame.OshimaModules.Skills
{
public override long Id => Skill.Id;
public override string Name => Skill.Name;
public override string Description => $"{Duration} 时间内,增加 40% 攻击力 [ {攻击力提升} ]、30% 物理穿透和 25% 闪避率(不可叠加),普通攻击硬直时间额外减少 20%,基于 {系数 * 100:0.##}% 敏捷 [ {伤害加成} ] 强化普通攻击的伤害。在持续时间内,【心灵之火】的冷却时间降低至 3 时间。";
public override string Description => $"{Duration:0.##} 时间内,增加 40% 攻击力 [ {攻击力提升:0.##} ]、30% 物理穿透和 25% 闪避率(不可叠加),普通攻击硬直时间额外减少 20%,基于 {系数 * 100:0.##}% 敏捷 [ {伤害加成:0.##} ] 强化普通攻击的伤害。在持续时间内,【心灵之火】的冷却时间降低至 3 时间。";
public override bool TargetSelf => false;
public override int TargetCount => 1;
public override bool Durative => true;
public override double Duration => 40;
private double => Calculation.Round4Digits(1.2 * (1 + 0.6 * (Skill.Level - 1)));
private double => Calculation.Round2Digits( * Skill.Character?.AGI ?? 0);
private double => Calculation.Round2Digits(0.4 * Skill.Character?.BaseATK ?? 0);
private double => 1.2 * (1 + 0.6 * (Skill.Level - 1));
private double => * Skill.Character?.AGI ?? 0;
private double => 0.4 * Skill.Character?.BaseATK ?? 0;
private double = 0;
public override void OnEffectGained(Character character)
@ -68,13 +67,13 @@ namespace Oshima.FunGame.OshimaModules.Skills
{
if (character == Skill.Character && isNormalAttack)
{
damage = Calculation.Round2Digits(damage + );
damage += ;
}
}
public override void AlterHardnessTimeAfterNormalAttack(Character character, ref double baseHardnessTime, ref bool isCheckProtected)
{
baseHardnessTime = Calculation.Round2Digits(baseHardnessTime * 0.8);
baseHardnessTime *= 0.8;
}
public override void OnSkillCasted(Character caster, List<Character> enemys, List<Character> teammates, Dictionary<string, object> others)

View File

@ -1,5 +1,4 @@
using Milimoe.FunGame.Core.Api.Utility;
using Milimoe.FunGame.Core.Entity;
using Milimoe.FunGame.Core.Entity;
using Milimoe.FunGame.Core.Library.Constant;
namespace Oshima.FunGame.OshimaModules.Skills
@ -53,7 +52,7 @@ namespace Oshima.FunGame.OshimaModules.Skills
{
if ( > 0)
{
= Calculation.Round2Digits( - elapsed);
-= elapsed;
if ( <= 0)
{
= 0;
@ -63,7 +62,7 @@ namespace Oshima.FunGame.OshimaModules.Skills
public override void AlterHardnessTimeAfterNormalAttack(Character character, ref double baseHardnessTime, ref bool isCheckProtected)
{
baseHardnessTime = Calculation.Round2Digits(baseHardnessTime * 0.8);
baseHardnessTime *= 0.8;
}
}
}

View File

@ -1,5 +1,4 @@
using Milimoe.FunGame.Core.Api.Utility;
using Milimoe.FunGame.Core.Entity;
using Milimoe.FunGame.Core.Entity;
using Milimoe.FunGame.Core.Library.Constant;
namespace Oshima.FunGame.OshimaModules.Skills
@ -23,12 +22,12 @@ namespace Oshima.FunGame.OshimaModules.Skills
{
public override long Id => Skill.Id;
public override string Name => "魔法涌流";
public override string Description => $"{Duration} 时间内,增加所有伤害的 {减伤比例 * 100:0.##}% 伤害减免,并将普通攻击转为魔法伤害,可叠加魔法震荡的效果。";
public override string Description => $"{Duration:0.##} 时间内,增加所有伤害的 {减伤比例 * 100:0.##}% 伤害减免,并将普通攻击转为魔法伤害,可叠加魔法震荡的效果。";
public override bool TargetSelf => true;
public override bool Durative => true;
public override double Duration => 25;
private double => Calculation.Round2Digits(0.1 + 0.02 * (Level - 1));
private double => 0.1 + 0.02 * (Level - 1);
private double = 0;
public override void OnEffectGained(Character character)
@ -46,7 +45,7 @@ namespace Oshima.FunGame.OshimaModules.Skills
{
if (enemy == Skill.Character)
{
damage = Calculation.Round2Digits(damage * (1 - ));
damage *= 1 - ;
}
return false;
}

View File

@ -22,7 +22,7 @@ namespace Oshima.FunGame.OshimaModules.Skills
{
public override long Id => Skill.Id;
public override string Name => Skill.Name;
public override string Description => $"敏捷提高 20%,然后将目前的力量补充到与敏捷持平,持续 {Duration} 时间。";
public override string Description => $"敏捷提高 20%,然后将目前的力量补充到与敏捷持平,持续 {Duration:0.##} 时间。";
public override bool TargetSelf => true;
public override bool Durative => true;
public override double Duration => 30;

View File

@ -1,5 +1,4 @@
using Milimoe.FunGame.Core.Api.Utility;
using Milimoe.FunGame.Core.Entity;
using Milimoe.FunGame.Core.Entity;
using Milimoe.FunGame.Core.Library.Constant;
namespace Oshima.FunGame.OshimaModules.Skills
@ -28,7 +27,7 @@ namespace Oshima.FunGame.OshimaModules.Skills
public override string Description => $"每次普通攻击都将附带基于 {敏捷系数 * 100:0.##}% 敏捷 [ {敏捷伤害} ] 的魔法伤害。";
public override bool TargetSelf => true;
private double => Calculation.Round2Digits( * Skill.Character?.AGI ?? 0);
private double => * Skill.Character?.AGI ?? 0;
private readonly double = 2.5;
private bool = false;

View File

@ -1,5 +1,4 @@
using Milimoe.FunGame.Core.Api.Utility;
using Milimoe.FunGame.Core.Entity;
using Milimoe.FunGame.Core.Entity;
using Milimoe.FunGame.Core.Library.Constant;
namespace Oshima.FunGame.OshimaModules.Skills
@ -23,13 +22,13 @@ namespace Oshima.FunGame.OshimaModules.Skills
{
public override long Id => Skill.Id;
public override string Name => Skill.Name;
public override string Description => $"进入不可选中状态,获得 100 行动速度,提高 8% 暴击率,持续 {Duration} 时间。破隐一击:在持续时间内,首次造成伤害会附加 {系数 * 100:0.##}% 敏捷 [ {伤害加成} ] 的强化伤害,并解除不可选中状态。";
public override string Description => $"进入不可选中状态,获得 100 行动速度,提高 8% 暴击率,持续 {Duration:0.##} 时间。破隐一击:在持续时间内,首次造成伤害会附加 {系数 * 100:0.##}% 敏捷 [ {伤害加成:0.##} ] 的强化伤害,并解除不可选中状态。";
public override bool TargetSelf => true;
public override bool Durative => true;
public override double Duration => 12 + (1 * (Level - 1));
private double => Calculation.Round4Digits(0.5 + 0.5 * (Skill.Level - 1));
private double => Calculation.Round2Digits( * Skill.Character?.AGI ?? 0);
private double => 0.5 + 0.5 * (Skill.Level - 1);
private double => * Skill.Character?.AGI ?? 0;
private bool { get; set; } = true;
private bool { get; set; } = false;
@ -64,8 +63,8 @@ namespace Oshima.FunGame.OshimaModules.Skills
character.CharacterEffectTypes.Remove(this);
character.UpdateCharacterState();
double d = ;
damage = Calculation.Round2Digits(damage + d);
WriteLine($"[ {character} ] 触发了疾风步破隐一击,获得了 [ {d} ] 点伤害加成!");
damage += d;
WriteLine($"[ {character} ] 触发了疾风步破隐一击,获得了 [ {d:0.##} ] 点伤害加成!");
}
return false;
}

View File

@ -1,5 +1,4 @@
using Milimoe.FunGame.Core.Api.Utility;
using Milimoe.FunGame.Core.Entity;
using Milimoe.FunGame.Core.Entity;
using Milimoe.FunGame.Core.Library.Constant;
namespace Oshima.FunGame.OshimaModules.Skills
@ -24,7 +23,7 @@ namespace Oshima.FunGame.OshimaModules.Skills
{
public override long Id => Skill.Id;
public override string Name => Skill.Name;
public override string Description => $"对目标敌人造成 {Calculation.Round2Digits(90 + 60 * (Skill.Level - 1))} + {Calculation.Round2Digits((1.2 + 1.8 * (Skill.Level - 1)) * 100)}% 智力 [ {Damage} ] 点{CharacterSet.GetMagicDamageName(MagicType)}。";
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 bool TargetSelf => false;
public override int TargetCount => 1;
@ -35,7 +34,7 @@ namespace Oshima.FunGame.OshimaModules.Skills
double d = 0;
if (Skill.Character != null)
{
d = Calculation.Round2Digits(90 + 60 * (Skill.Level - 1) + (1.2 + 1.8 * (Skill.Level - 1)) * Skill.Character.INT);
d = 90 + 60 * (Skill.Level - 1) + (1.2 + 1.8 * (Skill.Level - 1)) * Skill.Character.INT;
}
return d;
}