添加动态空投

This commit is contained in:
milimoe 2024-10-25 19:40:19 +08:00
parent bf66e404cd
commit 27df05d6c2
Signed by: milimoe
GPG Key ID: 05D280912DA6C69E
2 changed files with 30 additions and 14 deletions

View File

@ -1,8 +1,8 @@
using System.Text;
using Milimoe.FunGame.Core.Api.Utility;
using Milimoe.FunGame.Core.Entity;
using Milimoe.FunGame.Core.Library.Constant;
using Milimoe.FunGame.Core.Model;
using Oshima.FunGame.OshimaModules;
using Oshima.FunGame.OshimaModules.Characters;
using Oshima.FunGame.OshimaModules.Items;
using Oshima.FunGame.OshimaModules.Skills;
@ -29,6 +29,7 @@ namespace Oshima.Core.Utils
}
public static List<Character> Characters { get; } = [];
public static List<Item> Items { get; } = [];
public static Dictionary<Character, CharacterStatistics> CharacterStatistics { get; } = [];
public static PluginConfig StatsConfig { get; } = new(nameof(FunGameSimulation), nameof(CharacterStatistics));
public static bool IsRuning { get; set; } = false;
@ -306,8 +307,9 @@ namespace Oshima.Core.Utils
// 开始空投
Msg = "";
(actionQueue, totalTime);
(actionQueue);
if (isWeb) result.Add("=== 空投 ===\r\n" + Msg);
double = 80;
// 总回合数
int i = 1;
@ -356,7 +358,18 @@ namespace Oshima.Core.Utils
}
// 模拟时间流逝
totalTime += actionQueue.TimeLapse();
double timeLapse = actionQueue.TimeLapse();
totalTime += timeLapse;
-= timeLapse;
if ( <= 0)
{
// 空投
Msg = "";
(actionQueue);
if (isWeb) result.Add("=== 空投 ===\r\n" + Msg);
= 100;
}
if (actionQueue.Eliminated.Count > deaths)
{
@ -493,21 +506,20 @@ namespace Oshima.Core.Utils
if (PrintOut) Console.WriteLine(str);
}
public static void (ActionQueue queue, double totalTime)
public static void (ActionQueue queue)
{
Item[] ;
if (totalTime == 0)
Item a = Items[Random.Shared.Next(Items.Count)];
a.SetGamingQueue(queue);
Item[] = [a];
WriteLine($"社区送温暖了,现在向所有人发放 [ {a.Name} ]");
foreach (Character character in queue.Queue)
{
WriteLine("社区送温暖了,现在向所有人发放 [ 攻击之爪 +50 ]");
foreach (Character character in queue.Queue)
foreach (Item item in )
{
= [new 50()];
foreach (Item item in )
{
queue.Equip(character, EquipItemToSlot.Accessory1, item);
}
queue.Equip(character, item.Copy(1));
}
}
WriteLine("");
}
public static void InitCharacter()
@ -538,6 +550,10 @@ namespace Oshima.Core.Utils
CharacterStatistics[character] = StatsConfig.Get<CharacterStatistics>(character.ToStringWithOutUser()) ?? CharacterStatistics[character];
}
}
Dictionary<string, Item> exItems = Factory.GetGameModuleInstances<Item>(OshimaGameModuleConstant.General, OshimaGameModuleConstant.Item);
Items.AddRange(exItems.Values);
Items.AddRange([new 10(), new 30(), new 50()]);
}
}
}

View File

@ -27,7 +27,7 @@ namespace Oshima.FunGame.OshimaModules.Skills
public override bool Durative => true;
public override double Duration => 16 + * 0.03;
private double => 0.3 + 0.03 * (Level - 1);
private double => 0.2 + 0.015 * (Level - 1);
private double => * Skill.Character?.BaseAGI ?? 0;
private double = 0;
private double = 0;