添加物品测试

This commit is contained in:
milimoe 2024-09-15 23:38:51 +08:00
parent c38e755f4f
commit 8d9c9d0095
Signed by: milimoe
GPG Key ID: 05D280912DA6C69E
9 changed files with 123 additions and 14 deletions

View File

@ -4,8 +4,14 @@ Microsoft Visual Studio Solution File, Format Version 12.00
VisualStudioVersion = 17.5.33516.290
MinimumVisualStudioVersion = 10.0.40219.1
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "FunGame.Testing", "Library\FunGame.Testing.csproj", "{6F6B4A21-8F39-4B0D-84E8-98AE3E93F06F}"
ProjectSection(ProjectDependencies) = postProject
{94B564CD-7A1E-4B3C-AF78-23EBCD5D627E} = {94B564CD-7A1E-4B3C-AF78-23EBCD5D627E}
EndProjectSection
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "FunGame.Testing.Desktop", "Desktop\FunGame.Testing.Desktop.csproj", "{05FA61CB-22AA-4834-8C45-1161C42DF2C7}"
ProjectSection(ProjectDependencies) = postProject
{94B564CD-7A1E-4B3C-AF78-23EBCD5D627E} = {94B564CD-7A1E-4B3C-AF78-23EBCD5D627E}
EndProjectSection
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "FunGame.Core", "..\FunGame.Core\FunGame.Core.csproj", "{94B564CD-7A1E-4B3C-AF78-23EBCD5D627E}"
EndProject

View File

@ -8,7 +8,7 @@ namespace Milimoe.FunGame.Testing.Effects
public override long Id => 4101;
public override string Name => "眩晕";
public override string Description => $"此角色被眩晕了,不能行动。来自:[ {Source} ] 的 [ {Skill.Name} ]";
public override EffectControlType ControlType => EffectControlType.Stun;
public override EffectType EffectType => EffectType.Stun;
public override bool TargetSelf => true;
public override Character Source => _sourceCharacter;
public override bool Durative => _durative;

View File

@ -8,7 +8,7 @@ namespace Milimoe.FunGame.Testing.Effects
public override long Id => 4102;
public override string Name => "累积之压标记";
public override string Description => $"此角色持有累积之压标记,已累计 {MarkLevel} 层。来自:[ {Source} ]";
public override EffectControlType ControlType => EffectControlType.Mark;
public override EffectType EffectType => EffectType.Mark;
public override bool TargetSelf => true;
public override Character Source => _sourceCharacter;
public int MarkLevel { get; set; } = 1;

View File

@ -0,0 +1,89 @@
using Milimoe.FunGame.Core.Entity;
using Milimoe.FunGame.Core.Library.Constant;
namespace FunGame.Testing.Items
{
public class 10 : Item
{
public override long Id => 14001;
public override string Name => "攻击之爪 +10";
public override string Description => Skills.Passives.Count > 0 ? Skills.Passives.First().Description : "";
public 10(Character? character = null) : base(ItemType.Accessory, slot: EquipSlotType.Accessory)
{
Skills.Passives.Add(new (character, this, 10));
}
}
public class 30 : Item
{
public override string Name => "攻击之爪 +30";
public override string Description => Skills.Passives.Count > 0 ? Skills.Passives.First().Description : "";
public 30(Character? character = null) : base(ItemType.Accessory, slot: EquipSlotType.Accessory)
{
Skills.Passives.Add(new (character, this, 30));
}
}
public class 50 : Item
{
public override string Name => "攻击之爪 +50";
public override string Description => Skills.Passives.Count > 0 ? Skills.Passives.First().Description : "";
public 50(Character? character = null) : base(ItemType.Accessory, slot: EquipSlotType.Accessory)
{
Skills.Passives.Add(new (character, this, 50));
}
}
public class : Skill
{
public override long Id => 5001;
public override string Name => "攻击之爪";
public override string Description => Effects.Count > 0 ? Effects.First().Description : "";
public Item Item { get; }
public (Character? character, Item item, double exATK) : base(SkillType.Passive, character)
{
Level = 1;
Item = item;
Effects.Add(new (this, character, item, exATK));
}
public override IEnumerable<Effect> AddInactiveEffectToCharacter()
{
return Effects;
}
}
public class : Effect
{
public override long Id => Skill.Id;
public override string Name => Skill.Name;
public override string Description => $"增加角色 {攻击力加成} 点攻击力。" + (!TargetSelf ? $"来自:[ {Source} ] 的 [ {Item.Name} ]" : "");
public override EffectType EffectType => EffectType.Item;
public override bool TargetSelf => true;
public Item Item { get; }
private readonly double = 0;
public override void OnEffectGained(Character character)
{
character.ExATK2 += ;
}
public override void OnEffectLost(Character character)
{
character.ExATK2 -= ;
}
public (Skill skill, Character? source, Item item, double exATK) : base(skill)
{
ActionQueue = skill.ActionQueue;
Source = source;
Item = item;
= exATK;
}
}
}

View File

@ -1,6 +1,6 @@
using Milimoe.FunGame.Testing.Tests;
bool printout = false;
bool printout = true;
List<string> strs = FunGameSimulation.StartGame(printout);
if (printout == false)
{
@ -10,5 +10,4 @@ if (printout == false)
}
}
Console.ReadKey();

View File

@ -24,17 +24,17 @@ namespace Milimoe.FunGame.Testing.Skills
{
public override long Id => Skill.Id;
public override string Name => Skill.Name;
public override string Description => $"暴击伤害提升 30%。";
public override string Description => $"暴击伤害提升 70%。";
public override bool TargetSelf => true;
public override void OnEffectGained(Character character)
{
character.ExCritDMG += 0.3;
character.ExCritDMG += 0.7;
}
public override void OnEffectLost(Character character)
{
character.ExCritDMG -= 0.3;
character.ExCritDMG -= 0.7;
}
}
}

View File

@ -36,7 +36,7 @@ namespace Milimoe.FunGame.Testing.Skills
public override void OnEffectGained(Character character)
{
Skill.IsInEffect = true;
character.CharacterEffectControlTypes.Add(this, [EffectControlType.Unselectable]);
character.CharacterEffectTypes.Add(this, [EffectType.Unselectable]);
character.UpdateCharacterState();
character.ExSPD += 100;
character.ExCritRate += 0.08;
@ -48,7 +48,7 @@ namespace Milimoe.FunGame.Testing.Skills
if (!)
{
// 在没有打出破隐一击的情况下,恢复角色状态
character.CharacterEffectControlTypes.Remove(this);
character.CharacterEffectTypes.Remove(this);
character.UpdateCharacterState();
}
character.ExSPD -= 100;
@ -61,7 +61,7 @@ namespace Milimoe.FunGame.Testing.Skills
{
= false;
= true;
character.CharacterEffectControlTypes.Remove(this);
character.CharacterEffectTypes.Remove(this);
character.UpdateCharacterState();
double d = ;
damage = Calculation.Round2Digits(damage + d);

View File

@ -25,7 +25,7 @@ namespace Milimoe.FunGame.Testing.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.GetMagicName(MagicType)}。";
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 bool TargetSelf => false;
public override int TargetCount => 1;

View File

@ -1,4 +1,5 @@
using System.Text;
using FunGame.Testing.Items;
using Milimoe.FunGame.Core.Api.Utility;
using Milimoe.FunGame.Core.Entity;
using Milimoe.FunGame.Core.Library.Common.Addon;
@ -78,7 +79,7 @@ namespace Milimoe.FunGame.Testing.Tests
// M = 5, W = 0, P1 = 0, P3 = 2
// M = 5, W = 1, P1 = 0, P3 = 0
if (list.Count > 3)
if (list.Count > 11)
{
if (PrintOut) Console.WriteLine();
if (PrintOut) Console.WriteLine("Start!!!");
@ -99,8 +100,8 @@ namespace Milimoe.FunGame.Testing.Tests
List<Character> characters = [
character1, character2, character3, character4,
character5, character6, character7, character8,
character9, character10, character11, character12
character5, character6, character7, character8,
character9, character10, character11, character12
];
int clevel = 60;
@ -320,6 +321,7 @@ namespace Milimoe.FunGame.Testing.Tests
// 总游戏时长
double totalTime = 0;
(actionQueue, totalTime);
// 总回合数
int i = 1;
@ -432,5 +434,18 @@ namespace Milimoe.FunGame.Testing.Tests
Msg += str + "\r\n";
if (PrintOut) Console.WriteLine(str);
}
public static void (ActionQueue queue, double totalTime)
{
if (totalTime == 0)
{
WriteLine("社区送温暖了,现在向所有人发放 [ 攻击之爪 +50 ]");
foreach (Character character in queue.Queue)
{
Item = new 50();
queue.Equip(character, EquipItemToSlot.Accessory1, );
}
}
}
}
}