mirror of
https://github.com/oshima-studios/OshimaGameModule.git
synced 2025-06-27 20:29:35 +08:00
添加免疫状态、混乱状态;添加新技能;机器人部分优化
This commit is contained in:
parent
f9821a71cf
commit
cb9c2b1a78
@ -126,24 +126,24 @@ namespace Oshima.FunGame.OshimaModules.Effects.OpenEffects
|
||||
{
|
||||
foreach (Skill s in character.Skills)
|
||||
{
|
||||
s.HardnessTime -= shtr;
|
||||
s.ExHardnessTime -= shtr;
|
||||
}
|
||||
foreach (Skill? s in character.Items.Select(i => i.Skills.Active))
|
||||
{
|
||||
if (s != null)
|
||||
s.HardnessTime -= shtr;
|
||||
s.ExHardnessTime -= shtr;
|
||||
}
|
||||
}
|
||||
else if (RealDynamicsValues.TryGetValue("shtr", out double current))
|
||||
{
|
||||
foreach (Skill s in character.Skills)
|
||||
{
|
||||
s.HardnessTime += current;
|
||||
s.ExHardnessTime += current;
|
||||
}
|
||||
foreach (Skill? s in character.Items.Select(i => i.Skills.Active))
|
||||
{
|
||||
if (s != null)
|
||||
s.HardnessTime += current;
|
||||
s.ExHardnessTime += current;
|
||||
}
|
||||
}
|
||||
RealDynamicsValues["shtr"] = shtr;
|
||||
@ -172,24 +172,24 @@ namespace Oshima.FunGame.OshimaModules.Effects.OpenEffects
|
||||
{
|
||||
foreach (Skill s in character.Skills)
|
||||
{
|
||||
s.HardnessTime -= s.HardnessTime * shtr2;
|
||||
s.ExHardnessTime2 -= shtr2;
|
||||
}
|
||||
foreach (Skill? s in character.Items.Select(i => i.Skills.Active))
|
||||
{
|
||||
if (s != null)
|
||||
s.HardnessTime -= s.HardnessTime * shtr2;
|
||||
s.ExHardnessTime2 -= shtr2;
|
||||
}
|
||||
}
|
||||
else if (RealDynamicsValues.TryGetValue("shtr2", out double current))
|
||||
{
|
||||
foreach (Skill s in character.Skills)
|
||||
{
|
||||
s.HardnessTime += s.HardnessTime * current;
|
||||
s.ExHardnessTime2 += current;
|
||||
}
|
||||
foreach (Skill? s in character.Items.Select(i => i.Skills.Active))
|
||||
{
|
||||
if (s != null)
|
||||
s.HardnessTime += s.HardnessTime * current;
|
||||
s.ExHardnessTime2 += current;
|
||||
}
|
||||
}
|
||||
RealDynamicsValues["shtr2"] = shtr2;
|
||||
|
@ -23,12 +23,12 @@ namespace Oshima.FunGame.OshimaModules.Effects.OpenEffects
|
||||
}
|
||||
foreach (Skill s in character.Skills)
|
||||
{
|
||||
s.HardnessTime -= 实际硬直时间减少;
|
||||
s.ExHardnessTime -= 实际硬直时间减少;
|
||||
}
|
||||
foreach (Skill? s in character.Items.Select(i => i.Skills.Active))
|
||||
{
|
||||
if (s != null)
|
||||
s.HardnessTime -= 实际硬直时间减少;
|
||||
s.ExHardnessTime -= 实际硬直时间减少;
|
||||
}
|
||||
}
|
||||
|
||||
@ -36,12 +36,12 @@ namespace Oshima.FunGame.OshimaModules.Effects.OpenEffects
|
||||
{
|
||||
foreach (Skill s in character.Skills)
|
||||
{
|
||||
s.HardnessTime += 实际硬直时间减少;
|
||||
s.ExHardnessTime += 实际硬直时间减少;
|
||||
}
|
||||
foreach (Skill? s in character.Items.Select(i => i.Skills.Active))
|
||||
{
|
||||
if (s != null)
|
||||
s.HardnessTime += 实际硬直时间减少;
|
||||
s.ExHardnessTime += 实际硬直时间减少;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -23,12 +23,12 @@ namespace Oshima.FunGame.OshimaModules.Effects.OpenEffects
|
||||
}
|
||||
foreach (Skill s in character.Skills)
|
||||
{
|
||||
s.HardnessTime -= s.HardnessTime * 减少比例;
|
||||
s.ExHardnessTime2 -= 减少比例;
|
||||
}
|
||||
foreach (Skill? s in character.Items.Select(i => i.Skills.Active))
|
||||
{
|
||||
if (s != null)
|
||||
s.HardnessTime -= s.HardnessTime * 减少比例;
|
||||
s.ExHardnessTime2 -= 减少比例;
|
||||
}
|
||||
}
|
||||
|
||||
@ -36,12 +36,12 @@ namespace Oshima.FunGame.OshimaModules.Effects.OpenEffects
|
||||
{
|
||||
foreach (Skill s in character.Skills)
|
||||
{
|
||||
s.HardnessTime += s.HardnessTime * 减少比例;
|
||||
s.ExHardnessTime2 += 减少比例;
|
||||
}
|
||||
foreach (Skill? s in character.Items.Select(i => i.Skills.Active))
|
||||
{
|
||||
if (s != null)
|
||||
s.HardnessTime += s.HardnessTime * 减少比例;
|
||||
s.ExHardnessTime2 += 减少比例;
|
||||
}
|
||||
}
|
||||
|
||||
|
61
OshimaModules/Effects/PassiveEffects/完全免疫.cs
Normal file
61
OshimaModules/Effects/PassiveEffects/完全免疫.cs
Normal file
@ -0,0 +1,61 @@
|
||||
using Milimoe.FunGame.Core.Entity;
|
||||
using Milimoe.FunGame.Core.Interface.Entity;
|
||||
using Milimoe.FunGame.Core.Library.Constant;
|
||||
|
||||
namespace Oshima.FunGame.OshimaModules.Effects.PassiveEffects
|
||||
{
|
||||
public class 完全免疫 : Effect
|
||||
{
|
||||
public override long Id => 4113;
|
||||
public override string Name => "完全免疫";
|
||||
public override string Description => $"此角色处于完全免疫状态,无法选中其作为普通攻击和技能的目标(自释放技能除外),免疫物理伤害和魔法伤害。来自:[ {Source} ] 的 [ {Skill.Name} ]";
|
||||
public override EffectType EffectType => EffectType.PhysicalImmune;
|
||||
public override DispelledType DispelledType => DispelledType.Strong;
|
||||
public override bool IsDebuff => false;
|
||||
public override Character Source => _sourceCharacter;
|
||||
public override bool Durative => _durative;
|
||||
public override double Duration => _duration;
|
||||
public override int DurationTurn => _durationTurn;
|
||||
|
||||
private readonly Character _sourceCharacter;
|
||||
private readonly bool _durative;
|
||||
private readonly double _duration;
|
||||
private readonly int _durationTurn;
|
||||
|
||||
public 完全免疫(Skill skill, Character sourceCharacter, bool durative = false, double duration = 0, int durationTurn = 1) : base(skill)
|
||||
{
|
||||
GamingQueue = skill.GamingQueue;
|
||||
_sourceCharacter = sourceCharacter;
|
||||
_durative = durative;
|
||||
_duration = duration;
|
||||
_durationTurn = durationTurn;
|
||||
}
|
||||
|
||||
public override void OnEffectGained(Character character)
|
||||
{
|
||||
if (_durative && RemainDuration == 0)
|
||||
{
|
||||
RemainDuration = Duration;
|
||||
}
|
||||
else if (RemainDurationTurn == 0)
|
||||
{
|
||||
RemainDurationTurn = DurationTurn;
|
||||
}
|
||||
AddImmuneTypesToCharacter(character, [ImmuneType.All]);
|
||||
}
|
||||
|
||||
public override void OnEffectLost(Character character)
|
||||
{
|
||||
RemoveImmuneTypesFromCharacter(character);
|
||||
}
|
||||
|
||||
public override bool OnImmuneCheck(Character character, Character target, ISkill skill, Item? item = null)
|
||||
{
|
||||
if (character == target)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
61
OshimaModules/Effects/PassiveEffects/技能免疫.cs
Normal file
61
OshimaModules/Effects/PassiveEffects/技能免疫.cs
Normal file
@ -0,0 +1,61 @@
|
||||
using Milimoe.FunGame.Core.Entity;
|
||||
using Milimoe.FunGame.Core.Interface.Entity;
|
||||
using Milimoe.FunGame.Core.Library.Constant;
|
||||
|
||||
namespace Oshima.FunGame.OshimaModules.Effects.PassiveEffects
|
||||
{
|
||||
public class 技能免疫 : Effect
|
||||
{
|
||||
public override long Id => 4110;
|
||||
public override string Name => "技能免疫";
|
||||
public override string Description => $"此角色处于技能免疫状态,无法选中其作为技能目标(自释放技能除外),并免疫来自技能的伤害。来自:[ {Source} ] 的 [ {Skill.Name} ]";
|
||||
public override EffectType EffectType => EffectType.SkilledImmune;
|
||||
public override DispelledType DispelledType => DispelledType.Strong;
|
||||
public override bool IsDebuff => false;
|
||||
public override Character Source => _sourceCharacter;
|
||||
public override bool Durative => _durative;
|
||||
public override double Duration => _duration;
|
||||
public override int DurationTurn => _durationTurn;
|
||||
|
||||
private readonly Character _sourceCharacter;
|
||||
private readonly bool _durative;
|
||||
private readonly double _duration;
|
||||
private readonly int _durationTurn;
|
||||
|
||||
public 技能免疫(Skill skill, Character sourceCharacter, bool durative = false, double duration = 0, int durationTurn = 1) : base(skill)
|
||||
{
|
||||
GamingQueue = skill.GamingQueue;
|
||||
_sourceCharacter = sourceCharacter;
|
||||
_durative = durative;
|
||||
_duration = duration;
|
||||
_durationTurn = durationTurn;
|
||||
}
|
||||
|
||||
public override void OnEffectGained(Character character)
|
||||
{
|
||||
if (_durative && RemainDuration == 0)
|
||||
{
|
||||
RemainDuration = Duration;
|
||||
}
|
||||
else if (RemainDurationTurn == 0)
|
||||
{
|
||||
RemainDurationTurn = DurationTurn;
|
||||
}
|
||||
AddImmuneTypesToCharacter(character, [ImmuneType.Skilled]);
|
||||
}
|
||||
|
||||
public override void OnEffectLost(Character character)
|
||||
{
|
||||
RemoveImmuneTypesFromCharacter(character);
|
||||
}
|
||||
|
||||
public override bool OnImmuneCheck(Character character, Character target, ISkill skill, Item? item = null)
|
||||
{
|
||||
if (character == target)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
79
OshimaModules/Effects/PassiveEffects/混乱.cs
Normal file
79
OshimaModules/Effects/PassiveEffects/混乱.cs
Normal file
@ -0,0 +1,79 @@
|
||||
using Milimoe.FunGame.Core.Entity;
|
||||
using Milimoe.FunGame.Core.Library.Constant;
|
||||
|
||||
namespace Oshima.FunGame.OshimaModules.Effects.PassiveEffects
|
||||
{
|
||||
public class 混乱 : Effect
|
||||
{
|
||||
public override long Id => 4114;
|
||||
public override string Name => "混乱";
|
||||
public override string Description => $"此角色处于混乱状态,行动受限且失控,行动回合中无法自主行动而是随机行动,在进行攻击指令时,可能会选取友方角色为目标。来自:[ {Source} ] 的 [ {Skill.Name} ]";
|
||||
public override EffectType EffectType => EffectType.Confusion;
|
||||
public override DispelledType DispelledType => DispelledType.Strong;
|
||||
public override bool IsDebuff => true;
|
||||
public override Character Source => _sourceCharacter;
|
||||
public override bool Durative => _durative;
|
||||
public override double Duration => _duration;
|
||||
public override int DurationTurn => _durationTurn;
|
||||
|
||||
private readonly Character _sourceCharacter;
|
||||
private readonly bool _durative;
|
||||
private readonly double _duration;
|
||||
private readonly int _durationTurn;
|
||||
|
||||
public 混乱(Skill skill, Character sourceCharacter, bool durative = false, double duration = 0, int durationTurn = 1) : base(skill)
|
||||
{
|
||||
GamingQueue = skill.GamingQueue;
|
||||
_sourceCharacter = sourceCharacter;
|
||||
_durative = durative;
|
||||
_duration = duration;
|
||||
_durationTurn = durationTurn;
|
||||
}
|
||||
|
||||
public override void AlterSelectListBeforeAction(Character character, List<Character> enemys, List<Character> teammates, List<Skill> skills, Dictionary<Character, int> continuousKilling, Dictionary<Character, int> earnedMoney)
|
||||
{
|
||||
// 为了确保角色能够混乱行动,这里需要将角色设置为可行动
|
||||
if (character.CharacterState == CharacterState.ActionRestricted)
|
||||
{
|
||||
GamingQueue?.SetCharactersToAIControl(true, false, character);
|
||||
character.CharacterState = CharacterState.Actionable;
|
||||
}
|
||||
enemys.AddRange(teammates);
|
||||
teammates.AddRange(enemys);
|
||||
}
|
||||
|
||||
public override CharacterActionType AlterActionTypeBeforeAction(Character character, CharacterState state, ref bool canUseItem, ref bool canCastSkill, ref double pUseItem, ref double pCastSkill, ref double pNormalAttack, ref bool forceAction)
|
||||
{
|
||||
forceAction = true;
|
||||
return Milimoe.FunGame.Core.Model.GamingQueue.GetActionType(pUseItem, pCastSkill, pNormalAttack);
|
||||
}
|
||||
|
||||
public override void OnTurnEnd(Character character)
|
||||
{
|
||||
character.UpdateCharacterState();
|
||||
}
|
||||
|
||||
public override void OnEffectGained(Character character)
|
||||
{
|
||||
if (_durative && RemainDuration == 0)
|
||||
{
|
||||
RemainDuration = Duration;
|
||||
}
|
||||
else if (RemainDurationTurn == 0)
|
||||
{
|
||||
RemainDurationTurn = DurationTurn;
|
||||
}
|
||||
GamingQueue?.SetCharactersToAIControl(true, false, character);
|
||||
AddEffectStatesToCharacter(character, [CharacterState.ActionRestricted]);
|
||||
AddEffectTypeToCharacter(character, [EffectType.Confusion]);
|
||||
InterruptCasting(character, Source);
|
||||
}
|
||||
|
||||
public override void OnEffectLost(Character character)
|
||||
{
|
||||
GamingQueue?.SetCharactersToAIControl(true, true, character);
|
||||
RemoveEffectStatesFromCharacter(character);
|
||||
RemoveEffectTypesFromCharacter(character);
|
||||
}
|
||||
}
|
||||
}
|
51
OshimaModules/Effects/PassiveEffects/物理免疫.cs
Normal file
51
OshimaModules/Effects/PassiveEffects/物理免疫.cs
Normal file
@ -0,0 +1,51 @@
|
||||
using Milimoe.FunGame.Core.Entity;
|
||||
using Milimoe.FunGame.Core.Library.Constant;
|
||||
|
||||
namespace Oshima.FunGame.OshimaModules.Effects.PassiveEffects
|
||||
{
|
||||
public class 物理免疫 : Effect
|
||||
{
|
||||
public override long Id => 4112;
|
||||
public override string Name => "物理免疫";
|
||||
public override string Description => $"此角色处于物理免疫状态,免疫物理伤害。来自:[ {Source} ] 的 [ {Skill.Name} ]";
|
||||
public override EffectType EffectType => EffectType.PhysicalImmune;
|
||||
public override DispelledType DispelledType => DispelledType.Weak;
|
||||
public override bool IsDebuff => false;
|
||||
public override Character Source => _sourceCharacter;
|
||||
public override bool Durative => _durative;
|
||||
public override double Duration => _duration;
|
||||
public override int DurationTurn => _durationTurn;
|
||||
|
||||
private readonly Character _sourceCharacter;
|
||||
private readonly bool _durative;
|
||||
private readonly double _duration;
|
||||
private readonly int _durationTurn;
|
||||
|
||||
public 物理免疫(Skill skill, Character sourceCharacter, bool durative = false, double duration = 0, int durationTurn = 1) : base(skill)
|
||||
{
|
||||
GamingQueue = skill.GamingQueue;
|
||||
_sourceCharacter = sourceCharacter;
|
||||
_durative = durative;
|
||||
_duration = duration;
|
||||
_durationTurn = durationTurn;
|
||||
}
|
||||
|
||||
public override void OnEffectGained(Character character)
|
||||
{
|
||||
if (_durative && RemainDuration == 0)
|
||||
{
|
||||
RemainDuration = Duration;
|
||||
}
|
||||
else if (RemainDurationTurn == 0)
|
||||
{
|
||||
RemainDurationTurn = DurationTurn;
|
||||
}
|
||||
AddImmuneTypesToCharacter(character, [ImmuneType.Physical]);
|
||||
}
|
||||
|
||||
public override void OnEffectLost(Character character)
|
||||
{
|
||||
RemoveImmuneTypesFromCharacter(character);
|
||||
}
|
||||
}
|
||||
}
|
61
OshimaModules/Effects/PassiveEffects/魔法免疫.cs
Normal file
61
OshimaModules/Effects/PassiveEffects/魔法免疫.cs
Normal file
@ -0,0 +1,61 @@
|
||||
using Milimoe.FunGame.Core.Entity;
|
||||
using Milimoe.FunGame.Core.Interface.Entity;
|
||||
using Milimoe.FunGame.Core.Library.Constant;
|
||||
|
||||
namespace Oshima.FunGame.OshimaModules.Effects.PassiveEffects
|
||||
{
|
||||
public class 魔法免疫 : Effect
|
||||
{
|
||||
public override long Id => 4111;
|
||||
public override string Name => "魔法免疫";
|
||||
public override string Description => $"此角色处于魔法免疫状态,无法选中其作为魔法技能的目标(自释放魔法技能除外),并且免疫魔法伤害。来自:[ {Source} ] 的 [ {Skill.Name} ]";
|
||||
public override EffectType EffectType => EffectType.MagicalImmune;
|
||||
public override DispelledType DispelledType => DispelledType.Weak;
|
||||
public override bool IsDebuff => false;
|
||||
public override Character Source => _sourceCharacter;
|
||||
public override bool Durative => _durative;
|
||||
public override double Duration => _duration;
|
||||
public override int DurationTurn => _durationTurn;
|
||||
|
||||
private readonly Character _sourceCharacter;
|
||||
private readonly bool _durative;
|
||||
private readonly double _duration;
|
||||
private readonly int _durationTurn;
|
||||
|
||||
public 魔法免疫(Skill skill, Character sourceCharacter, bool durative = false, double duration = 0, int durationTurn = 1) : base(skill)
|
||||
{
|
||||
GamingQueue = skill.GamingQueue;
|
||||
_sourceCharacter = sourceCharacter;
|
||||
_durative = durative;
|
||||
_duration = duration;
|
||||
_durationTurn = durationTurn;
|
||||
}
|
||||
|
||||
public override void OnEffectGained(Character character)
|
||||
{
|
||||
if (_durative && RemainDuration == 0)
|
||||
{
|
||||
RemainDuration = Duration;
|
||||
}
|
||||
else if (RemainDurationTurn == 0)
|
||||
{
|
||||
RemainDurationTurn = DurationTurn;
|
||||
}
|
||||
AddImmuneTypesToCharacter(character, [ImmuneType.Magical]);
|
||||
}
|
||||
|
||||
public override void OnEffectLost(Character character)
|
||||
{
|
||||
RemoveImmuneTypesFromCharacter(character);
|
||||
}
|
||||
|
||||
public override bool OnImmuneCheck(Character character, Character target, ISkill skill, Item? item = null)
|
||||
{
|
||||
if (character == target)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
78
OshimaModules/Effects/SkillEffects/施加免疫.cs
Normal file
78
OshimaModules/Effects/SkillEffects/施加免疫.cs
Normal file
@ -0,0 +1,78 @@
|
||||
using Milimoe.FunGame.Core.Entity;
|
||||
using Milimoe.FunGame.Core.Library.Constant;
|
||||
using Oshima.FunGame.OshimaModules.Effects.PassiveEffects;
|
||||
using Oshima.FunGame.OshimaModules.Skills;
|
||||
|
||||
namespace Oshima.FunGame.OshimaModules.Effects.SkillEffects
|
||||
{
|
||||
public class 施加免疫 : Effect
|
||||
{
|
||||
public override long Id => Skill.Id;
|
||||
public override string Name => Skill.Name;
|
||||
public override string Description => $"对{Skill.TargetDescription()}施加{CharacterSet.GetImmuneTypeName(ImmuneType)},持续 {持续时间}。";
|
||||
public override DispelledType DispelledType => DispelledType.Strong;
|
||||
|
||||
private ImmuneType ImmuneType { get; set; } = ImmuneType.None;
|
||||
private string 持续时间 => _durative && _duration > 0 ? 实际持续时间 + $" {GameplayEquilibriumConstant.InGameTime}" : (!_durative && _durationTurn > 0 ? 实际持续时间 + " 回合" : $"0 {GameplayEquilibriumConstant.InGameTime}");
|
||||
private double 实际持续时间 => _durative && _duration > 0 ? _duration + _levelGrowth * (Level - 1) : (!_durative && _durationTurn > 0 ? _durationTurn + _levelGrowth * (Level - 1) : 0);
|
||||
private readonly bool _durative;
|
||||
private readonly double _duration;
|
||||
private readonly int _durationTurn;
|
||||
private readonly double _levelGrowth;
|
||||
|
||||
public 施加免疫(Skill skill, ImmuneType type, bool durative = false, double duration = 0, int durationTurn = 1, double levelGrowth = 0) : base(skill)
|
||||
{
|
||||
GamingQueue = skill.GamingQueue;
|
||||
ImmuneType = type;
|
||||
_durative = durative;
|
||||
_duration = duration;
|
||||
_durationTurn = durationTurn;
|
||||
_levelGrowth = levelGrowth;
|
||||
}
|
||||
|
||||
public override void OnSkillCasted(Character caster, List<Character> targets, Dictionary<string, object> others)
|
||||
{
|
||||
foreach (Character target in targets)
|
||||
{
|
||||
if (target.HP <= 0) continue;
|
||||
WriteLine($"[ {caster} ] 获得了{CharacterSet.GetImmuneTypeName(ImmuneType)}!持续 {持续时间}!");
|
||||
switch (ImmuneType)
|
||||
{
|
||||
case ImmuneType.Physical:
|
||||
{
|
||||
EffectType = EffectType.PhysicalImmune;
|
||||
物理免疫 e = new(Skill, caster, _durative, _duration + _levelGrowth * (Level - 1), Convert.ToInt32(_durationTurn + _levelGrowth * (Level - 1)));
|
||||
target.Effects.Add(e);
|
||||
e.OnEffectGained(target);
|
||||
break;
|
||||
}
|
||||
case ImmuneType.Magical:
|
||||
{
|
||||
EffectType = EffectType.MagicalImmune;
|
||||
魔法免疫 e = new(Skill, caster, _durative, _duration + _levelGrowth * (Level - 1), Convert.ToInt32(_durationTurn + _levelGrowth * (Level - 1)));
|
||||
target.Effects.Add(e);
|
||||
e.OnEffectGained(target);
|
||||
break;
|
||||
}
|
||||
case ImmuneType.Skilled:
|
||||
{
|
||||
EffectType = EffectType.SkilledImmune;
|
||||
技能免疫 e = new(Skill, caster, _durative, _duration + _levelGrowth * (Level - 1), Convert.ToInt32(_durationTurn + _levelGrowth * (Level - 1)));
|
||||
target.Effects.Add(e);
|
||||
e.OnEffectGained(target);
|
||||
break;
|
||||
}
|
||||
case ImmuneType.All:
|
||||
{
|
||||
EffectType = EffectType.AllImmune;
|
||||
完全免疫 e = new(Skill, caster, _durative, _duration + _levelGrowth * (Level - 1), Convert.ToInt32(_durationTurn + _levelGrowth * (Level - 1)));
|
||||
target.Effects.Add(e);
|
||||
e.OnEffectGained(target);
|
||||
break;
|
||||
}
|
||||
}
|
||||
GamingQueue?.LastRound.ApplyEffects.TryAdd(target, [EffectType]);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
@ -70,6 +70,9 @@ namespace Oshima.FunGame.OshimaModules
|
||||
(long)MagicID.结晶防护 => new 结晶防护(),
|
||||
(long)MagicID.强音之力 => new 强音之力(),
|
||||
(long)MagicID.神圣祝福 => new 神圣祝福(),
|
||||
(long)MagicID.根源屏障 => new 根源屏障(),
|
||||
(long)MagicID.灾难冲击波 => new 灾难冲击波(),
|
||||
(long)MagicID.银色荆棘 => new 银色荆棘(),
|
||||
(long)SkillID.疾风步 => new 疾风步(),
|
||||
(long)SuperSkillID.力量爆发 => new 力量爆发(),
|
||||
(long)SuperSkillID.天赐之力 => new 天赐之力(),
|
||||
|
@ -59,7 +59,7 @@ namespace Oshima.FunGame.OshimaModules.Skills
|
||||
}
|
||||
}
|
||||
|
||||
public override CharacterActionType AlterActionTypeBeforeAction(Character character, CharacterState state, ref bool canUseItem, ref bool canCastSkill, ref double pUseItem, ref double pCastSkill, ref double pNormalAttack)
|
||||
public override CharacterActionType AlterActionTypeBeforeAction(Character character, CharacterState state, ref bool canUseItem, ref bool canCastSkill, ref double pUseItem, ref double pCastSkill, ref double pNormalAttack, ref bool forceAction)
|
||||
{
|
||||
pNormalAttack += 0.1;
|
||||
return CharacterActionType.None;
|
||||
|
66
OshimaModules/Skills/魔法/根源屏障.cs
Normal file
66
OshimaModules/Skills/魔法/根源屏障.cs
Normal file
@ -0,0 +1,66 @@
|
||||
using Milimoe.FunGame.Core.Entity;
|
||||
using Milimoe.FunGame.Core.Library.Constant;
|
||||
using Oshima.FunGame.OshimaModules.Effects.SkillEffects;
|
||||
|
||||
namespace Oshima.FunGame.OshimaModules.Skills
|
||||
{
|
||||
public class 根源屏障 : Skill
|
||||
{
|
||||
public override long Id => (long)MagicID.根源屏障;
|
||||
public override string Name => "根源屏障";
|
||||
public override string Description => string.Join("", Effects.Select(e => e.Description));
|
||||
public override string DispelDescription => "被驱散性:魔法免疫可弱驱散" + (Level > 4 ? $",技能免疫需强驱散" : "");
|
||||
public override double MPCost => Level > 0 ? 200 + (75 * (Level - 1)) : 200;
|
||||
public override double CD => Level > 0 ? 120 - (3 * (Level - 1)) : 120;
|
||||
public override double CastTime => Level > 0 ? 12 - (0.5 * (Level - 1)) : 12;
|
||||
public override double HardnessTime { get; set; } = 8;
|
||||
public override bool CanSelectSelf => true;
|
||||
public override bool CanSelectEnemy => false;
|
||||
public override bool CanSelectTeammate => true;
|
||||
public override int CanSelectTargetCount => 1;
|
||||
|
||||
public 根源屏障(Character? character = null) : base(SkillType.Magic, character)
|
||||
{
|
||||
Effects.Add(new 根源屏障特效(this));
|
||||
}
|
||||
}
|
||||
|
||||
public class 根源屏障特效 : Effect
|
||||
{
|
||||
public override long Id => Skill.Id;
|
||||
public override string Name => Skill.Name;
|
||||
public override string Description => $"为{Skill.TargetDescription()}提供{CharacterSet.GetImmuneTypeName(ImmuneType.Magical)},持续 {持续时间}。" + (Skill.Level > 4 ? $"为{Skill.TargetDescription()}提供{CharacterSet.GetImmuneTypeName(ImmuneType.Skilled)},持续 1 回合。" : "");
|
||||
public override EffectType EffectType => EffectType.MagicalImmune;
|
||||
public override DispelledType DispelledType => DispelledType.Weak;
|
||||
|
||||
private string 持续时间 => $"{实际持续时间} 回合";
|
||||
private int 实际持续时间
|
||||
{
|
||||
get
|
||||
{
|
||||
return Level switch
|
||||
{
|
||||
5 => 2,
|
||||
6 => 2,
|
||||
7 => 2,
|
||||
8 => 2,
|
||||
_ => 1
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
public 根源屏障特效(Skill skill) : base(skill)
|
||||
{
|
||||
GamingQueue = skill.GamingQueue;
|
||||
}
|
||||
|
||||
public override void OnSkillCasted(Character caster, List<Character> targets, Dictionary<string, object> others)
|
||||
{
|
||||
new 施加免疫(Skill, ImmuneType.Magical, false, 0, 实际持续时间).OnSkillCasted(caster, targets, others);
|
||||
if (Level > 4)
|
||||
{
|
||||
new 施加免疫(Skill, ImmuneType.Skilled, false, 0, 1).OnSkillCasted(caster, targets, others);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
99
OshimaModules/Skills/魔法/灾难冲击波.cs
Normal file
99
OshimaModules/Skills/魔法/灾难冲击波.cs
Normal file
@ -0,0 +1,99 @@
|
||||
using Milimoe.FunGame.Core.Entity;
|
||||
using Milimoe.FunGame.Core.Library.Constant;
|
||||
using Oshima.FunGame.OshimaModules.Effects.OpenEffects;
|
||||
using Oshima.FunGame.OshimaModules.Effects.SkillEffects;
|
||||
|
||||
namespace Oshima.FunGame.OshimaModules.Skills
|
||||
{
|
||||
public class 灾难冲击波 : Skill
|
||||
{
|
||||
public override long Id => (long)MagicID.灾难冲击波;
|
||||
public override string Name => "灾难冲击波";
|
||||
public override string Description => string.Join("\r\n", Effects.Select(e => e.Description));
|
||||
public override string DispelDescription => Effects.Count > 0 ? Effects.First(e => e is 灾难冲击波特效).DispelDescription : "";
|
||||
public override double MPCost => Level > 0 ? 95 + (75 * (Level - 1)) : 95;
|
||||
public override double CD => Level > 0 ? 85 - (1.5 * (Level - 1)) : 85;
|
||||
public override double CastTime => Level > 0 ? 6 + (0.5 * (Level - 1)) : 6;
|
||||
public override double HardnessTime { get; set; } = 5;
|
||||
public override int CanSelectTargetCount
|
||||
{
|
||||
get
|
||||
{
|
||||
return Level switch
|
||||
{
|
||||
3 => 2,
|
||||
4 => 2,
|
||||
5 => 3,
|
||||
6 => 3,
|
||||
7 => 4,
|
||||
8 => 4,
|
||||
_ => 1
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
public 灾难冲击波(Character? character = null) : base(SkillType.Magic, character)
|
||||
{
|
||||
Effects.Add(new 基于攻击力的伤害_带基础伤害(this, 120, 35, 0.25, 0.04));
|
||||
Effects.Add(new 灾难冲击波特效(this, false, 0, 2, 0, 0.03, 0.02));
|
||||
}
|
||||
}
|
||||
|
||||
public class 灾难冲击波特效 : Effect
|
||||
{
|
||||
public override long Id => Skill.Id;
|
||||
public override string Name => Skill.Name;
|
||||
public override string Description => $"对{Skill.TargetDescription()}造成魔法抗性降低 {ActualMDFReductionPercent * 100:0.##}%,持续 {持续时间}。";
|
||||
public override DispelledType DispelledType => DispelledType.Weak;
|
||||
|
||||
private string 持续时间 => _durative && _duration > 0 ? 实际持续时间 + $" {GameplayEquilibriumConstant.InGameTime}" : (!_durative && _durationTurn > 0 ? 实际持续时间 + " 回合" : $"0 {GameplayEquilibriumConstant.InGameTime}");
|
||||
private double 实际持续时间 => _durative && _duration > 0 ? _duration + _levelGrowth * (Level - 1) : (!_durative && _durationTurn > 0 ? _durationTurn + _levelGrowth * (Level - 1) : 0);
|
||||
private readonly bool _durative;
|
||||
private readonly double _duration;
|
||||
private readonly int _durationTurn;
|
||||
private readonly double _levelGrowth;
|
||||
private readonly double _MDFReductionPercent;
|
||||
private readonly double _MDFReductionPercentLevelGrowth;
|
||||
private double ActualMDFReductionPercent => Level > 0 ? _MDFReductionPercent + _MDFReductionPercentLevelGrowth * (Level - 1) : _MDFReductionPercent;
|
||||
|
||||
public 灾难冲击波特效(Skill skill, bool durative = false, double duration = 0, int durationTurn = 1, double levelGrowth = 0, double MDFReductionPercent = 0, double MDFReductionPercentLevelGrowth = 0) : base(skill)
|
||||
{
|
||||
GamingQueue = skill.GamingQueue;
|
||||
_durative = durative;
|
||||
_duration = duration;
|
||||
_durationTurn = durationTurn;
|
||||
_levelGrowth = levelGrowth;
|
||||
_MDFReductionPercent = MDFReductionPercent;
|
||||
_MDFReductionPercentLevelGrowth = MDFReductionPercentLevelGrowth;
|
||||
}
|
||||
|
||||
public override void OnSkillCasted(Character caster, List<Character> targets, Dictionary<string, object> others)
|
||||
{
|
||||
foreach (Character target in targets)
|
||||
{
|
||||
WriteLine($"[ {target} ] 的魔法抗性降低了 {ActualMDFReductionPercent * 100:0.##}%!持续时间:{持续时间}!");
|
||||
ExMDF e = new(Skill, new(){
|
||||
{ "mdftype", 0 },
|
||||
{ "mdfvalue", -ActualMDFReductionPercent }
|
||||
}, caster);
|
||||
target.Effects.Add(e);
|
||||
if (_durative && _duration > 0)
|
||||
{
|
||||
e.Durative = true;
|
||||
e.Duration = 实际持续时间;
|
||||
e.RemainDuration = 实际持续时间;
|
||||
}
|
||||
else if (!_durative && _durationTurn > 0)
|
||||
{
|
||||
e.Durative = false;
|
||||
e.DurationTurn = (int)实际持续时间;
|
||||
e.RemainDurationTurn = (int)实际持续时间;
|
||||
}
|
||||
e.EffectType = EffectType.MagicResistBreak;
|
||||
e.Source = caster;
|
||||
e.OnEffectGained(target);
|
||||
GamingQueue?.LastRound.ApplyEffects.TryAdd(target, [e.EffectType]);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
100
OshimaModules/Skills/魔法/银色荆棘.cs
Normal file
100
OshimaModules/Skills/魔法/银色荆棘.cs
Normal file
@ -0,0 +1,100 @@
|
||||
using Milimoe.FunGame.Core.Entity;
|
||||
using Milimoe.FunGame.Core.Library.Constant;
|
||||
using Oshima.FunGame.OshimaModules.Effects.PassiveEffects;
|
||||
|
||||
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 string DispelDescription => Effects.Count > 0 ? Effects.First().DispelDescription : "";
|
||||
public override double MPCost => Level > 0 ? 100 + (80 * (Level - 1)) : 100;
|
||||
public override double CD => Level > 0 ? 100 - (1.5 * (Level - 1)) : 100;
|
||||
public override double CastTime => 12;
|
||||
public override double HardnessTime { get; set; } = 5;
|
||||
public override int CanSelectTargetCount
|
||||
{
|
||||
get
|
||||
{
|
||||
return Level switch
|
||||
{
|
||||
4 => 2,
|
||||
5 => 2,
|
||||
6 => 2,
|
||||
7 => 3,
|
||||
8 => 3,
|
||||
_ => 1
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
public 银色荆棘(Character? character = null) : base(SkillType.Magic, character)
|
||||
{
|
||||
Effects.Add(new 银色荆棘特效(this, false, 0, 2, 0, 0.6, 0.04));
|
||||
}
|
||||
}
|
||||
|
||||
public class 银色荆棘特效 : Effect
|
||||
{
|
||||
public override long Id => Skill.Id;
|
||||
public override string Name => Skill.Name;
|
||||
public override string Description => $"对{Skill.TargetDescription()}造成 {Damage:0.##} 点{CharacterSet.GetDamageTypeName(DamageType.Magical, MagicType)}。" +
|
||||
$"随后 {ActualConfusionProbability * 100:0.##}% 概率使目标进入混乱状态,持续 {持续时间}。混乱:进入行动受限状态,失控并随机行动,且在进行攻击指令时,可能会选取友方角色为目标。";
|
||||
public override DispelledType DispelledType => DispelledType.Strong;
|
||||
public override EffectType EffectType => EffectType.Confusion;
|
||||
|
||||
private string 持续时间 => _durative && _duration > 0 ? 实际持续时间 + $" {GameplayEquilibriumConstant.InGameTime}" : (!_durative && _durationTurn > 0 ? 实际持续时间 + " 回合" : $"0 {GameplayEquilibriumConstant.InGameTime}");
|
||||
private double 实际持续时间 => _durative && _duration > 0 ? _duration + _levelGrowth * (Level - 1) : (!_durative && _durationTurn > 0 ? _durationTurn + _levelGrowth * (Level - 1) : 0);
|
||||
private double Damage => Skill.Level > 0 ? 基础数值伤害 + 基础伤害等级成长 * (Skill.Level - 1) : 基础数值伤害;
|
||||
private double 基础数值伤害 { get; set; } = 50;
|
||||
private double 基础伤害等级成长 { get; set; } = 50;
|
||||
private double ActualConfusionProbability => Level > 0 ? _confusionProbability + _confusionProbabilityLevelGrowth * (Level - 1) : _confusionProbability;
|
||||
private readonly bool _durative;
|
||||
private readonly double _duration;
|
||||
private readonly int _durationTurn;
|
||||
private readonly double _levelGrowth;
|
||||
private readonly double _confusionProbability;
|
||||
private readonly double _confusionProbabilityLevelGrowth;
|
||||
|
||||
public 银色荆棘特效(Skill skill, bool durative = false, double duration = 0, int durationTurn = 1, double levelGrowth = 0, double confusionProbability = 0, double confusionProbabilityLevelGrowth = 0) : base(skill)
|
||||
{
|
||||
GamingQueue = skill.GamingQueue;
|
||||
_durative = durative;
|
||||
_duration = duration;
|
||||
_durationTurn = durationTurn;
|
||||
_levelGrowth = levelGrowth;
|
||||
_confusionProbability = confusionProbability;
|
||||
_confusionProbabilityLevelGrowth = confusionProbabilityLevelGrowth;
|
||||
}
|
||||
|
||||
public override void OnSkillCasted(Character caster, List<Character> targets, Dictionary<string, object> others)
|
||||
{
|
||||
foreach (Character target in targets)
|
||||
{
|
||||
DamageToEnemy(caster, target, DamageType.Magical, MagicType, Damage);
|
||||
if (target.HP > 0 && Random.Shared.NextDouble() < ActualConfusionProbability)
|
||||
{
|
||||
WriteLine($"[ {target} ] 陷入了混乱!!持续时间:{持续时间}!");
|
||||
混乱 e = new(Skill, caster);
|
||||
if (_durative && _duration > 0)
|
||||
{
|
||||
e.Durative = true;
|
||||
e.Duration = 实际持续时间;
|
||||
e.RemainDuration = 实际持续时间;
|
||||
}
|
||||
else if (!_durative && _durationTurn > 0)
|
||||
{
|
||||
e.Durative = false;
|
||||
e.DurationTurn = (int)实际持续时间;
|
||||
e.RemainDurationTurn = (int)实际持续时间;
|
||||
}
|
||||
target.Effects.Add(e);
|
||||
e.OnEffectGained(target);
|
||||
GamingQueue?.LastRound.ApplyEffects.TryAdd(target, [e.EffectType]);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
@ -4142,7 +4142,7 @@
|
||||
"时骸怀表": {
|
||||
"Id": 14549,
|
||||
"Name": "时骸怀表",
|
||||
"Description": "增加角色 20% 冷却缩减和 20% 加速系数。",
|
||||
"Description": "增加角色 20% 魔法穿透和 20% 加速系数。",
|
||||
"BackgroundStory": "扭曲者冻结自己心脏铸成表壳,冰霜傀儡拆下肋骨打磨为表针。怀表齿轮由压缩的战争残影浇注,发条乃时霜药剂结晶。",
|
||||
"ItemType": 4,
|
||||
"WeaponType": 0,
|
||||
@ -4157,7 +4157,7 @@
|
||||
"Effects": [
|
||||
{
|
||||
"Id": 8032,
|
||||
"excdr": 0.2,
|
||||
"exmpt": 0.2,
|
||||
"exacc": 0.2
|
||||
}
|
||||
]
|
||||
|
@ -111,15 +111,17 @@ namespace Oshima.FunGame.OshimaServers
|
||||
Controller.WriteLine("已重置所有人的今日运势");
|
||||
Daily.ClearDaily();
|
||||
});
|
||||
TaskScheduler.Shared.AddTask("重置交易冷却1", new TimeSpan(9, 0, 0), () =>
|
||||
TaskScheduler.Shared.AddTask("上九", new TimeSpan(9, 0, 0), () =>
|
||||
{
|
||||
Controller.WriteLine("重置物品交易冷却时间");
|
||||
Controller.WriteLine("重置物品交易冷却时间/刷新地区天气");
|
||||
_ = FunGameService.AllowSellAndTrade();
|
||||
_ = FunGameService.UpdateRegionWeather();
|
||||
});
|
||||
TaskScheduler.Shared.AddTask("重置交易冷却2", new TimeSpan(15, 0, 0), () =>
|
||||
TaskScheduler.Shared.AddTask("下三", new TimeSpan(15, 0, 0), () =>
|
||||
{
|
||||
Controller.WriteLine("重置物品交易冷却时间");
|
||||
Controller.WriteLine("重置物品交易冷却时间/刷新地区天气");
|
||||
_ = FunGameService.AllowSellAndTrade();
|
||||
_ = FunGameService.UpdateRegionWeather();
|
||||
});
|
||||
TaskScheduler.Shared.AddRecurringTask("刷新存档缓存", TimeSpan.FromMinutes(1), () =>
|
||||
{
|
||||
@ -205,7 +207,26 @@ namespace Oshima.FunGame.OshimaServers
|
||||
FunGameService.CheckDailyStore(store);
|
||||
store.SaveConfig();
|
||||
}
|
||||
Controller.WriteLine("刷新签到");
|
||||
Controller.WriteLine("刷新商店");
|
||||
}
|
||||
});
|
||||
Task.Run(() =>
|
||||
{
|
||||
// 刷新每天登录
|
||||
FunGameService.FirstLoginDailyNotice.Clear();
|
||||
string directoryPath = $@"{AppDomain.CurrentDomain.BaseDirectory}configs/saved";
|
||||
if (Directory.Exists(directoryPath))
|
||||
{
|
||||
string[] filePaths = Directory.GetFiles(directoryPath);
|
||||
foreach (string filePath in filePaths)
|
||||
{
|
||||
string fileName = Path.GetFileNameWithoutExtension(filePath);
|
||||
PluginConfig pc = new("saved", fileName);
|
||||
pc.LoadConfig();
|
||||
pc.Add("logon", false);
|
||||
pc.SaveConfig();
|
||||
}
|
||||
Controller.WriteLine("刷新每天登录");
|
||||
}
|
||||
});
|
||||
});
|
||||
|
@ -592,13 +592,13 @@ namespace Oshima.FunGame.OshimaServers.Service
|
||||
|
||||
public static Dictionary<QualityType, (int Min, int Max)> PriceRanges { get; } = new()
|
||||
{
|
||||
{ QualityType.White, (200, 2000) },
|
||||
{ QualityType.Green, (1500, 15000) },
|
||||
{ QualityType.Blue, (5000, 50000) },
|
||||
{ QualityType.Purple, (10000, 100000) },
|
||||
{ QualityType.Orange, (40000, 400000) },
|
||||
{ QualityType.Red, (100000, 1000000) },
|
||||
{ QualityType.Gold, (500000, 5000000) }
|
||||
{ QualityType.White, (200, 800) },
|
||||
{ QualityType.Green, (800, 3500) },
|
||||
{ QualityType.Blue, (3500, 8800) },
|
||||
{ QualityType.Purple, (8800, 15600) },
|
||||
{ QualityType.Orange, (15600, 32200) },
|
||||
{ QualityType.Red, (32200, 67000) },
|
||||
{ QualityType.Gold, (67000, 130000) }
|
||||
};
|
||||
|
||||
public static string[] CommonSurnames { get; } = [
|
||||
|
@ -14,6 +14,7 @@ namespace Oshima.FunGame.OshimaServers.Service
|
||||
{
|
||||
public class FunGameService
|
||||
{
|
||||
public static Dictionary<long, List<string>> FirstLoginDailyNotice { get; } = [];
|
||||
public static Dictionary<int, Character> Bosses { get; } = [];
|
||||
public static ServerPluginLoader? ServerPluginLoader { get; set; } = null;
|
||||
public static WebAPIPluginLoader? WebAPIPluginLoader { get; set; } = null;
|
||||
@ -39,8 +40,9 @@ namespace Oshima.FunGame.OshimaServers.Service
|
||||
|
||||
FunGameConstant.PassiveSkills.AddRange([new META马(), new 心灵之火(), new 魔法震荡(), new 灵能反射(), new 智慧与力量(), new 致命打击(), new 毁灭之势(), new 枯竭打击(), new 破釜沉舟(), new 累积之压(), new 敏捷之刃(), new 弱者猎手()]);
|
||||
|
||||
FunGameConstant.Magics.AddRange([new 冰霜攻击(), new 火之矢(), new 水之矢(), new 风之轮(), new 石之锤(), new 心灵之霞(), new 次元上升(), new 暗物质(), new 回复术(), new 治愈术(), new 复苏术(), new 圣灵术(),
|
||||
new 时间加速(), new 时间减速(), new 反魔法领域(), new 沉默十字(), new 虚弱领域(), new 混沌烙印(), new 凝胶稠絮(), new 大地之墙(), new 盖亚之盾(), new 风之守护(), new 结晶防护(), new 强音之力(), new 神圣祝福()]);
|
||||
FunGameConstant.Magics.AddRange([new 冰霜攻击(), new 火之矢(), new 水之矢(), new 风之轮(), new 石之锤(), new 心灵之霞(), new 次元上升(), new 暗物质(),
|
||||
new 回复术(), new 治愈术(), new 复苏术(), new 圣灵术(), new 时间加速(), new 时间减速(), new 反魔法领域(), new 沉默十字(), new 虚弱领域(), new 混沌烙印(), new 凝胶稠絮(),
|
||||
new 大地之墙(), new 盖亚之盾(), new 风之守护(), new 结晶防护(), new 强音之力(), new 神圣祝福(), new 根源屏障(), new 灾难冲击波(), new 银色荆棘()]);
|
||||
|
||||
Dictionary<string, Item> exItems = Factory.GetGameModuleInstances<Item>(OshimaGameModuleConstant.General, OshimaGameModuleConstant.Item);
|
||||
FunGameConstant.Equipment.AddRange(exItems.Values.Where(i => (int)i.ItemType >= 0 && (int)i.ItemType < 5));
|
||||
@ -587,6 +589,12 @@ namespace Oshima.FunGame.OshimaServers.Service
|
||||
}
|
||||
}
|
||||
|
||||
if (!pc.TryGetValue("logon", out object? value) || (value is bool logon && !logon))
|
||||
{
|
||||
pc.Add("logon", true);
|
||||
FirstLoginDailyNotice[user.Id] = ["欢迎回到筽祀牻大陆!请发送【帮助】获取更多玩法指令哦~"];
|
||||
}
|
||||
|
||||
return user;
|
||||
}
|
||||
|
||||
@ -1703,8 +1711,16 @@ namespace Oshima.FunGame.OshimaServers.Service
|
||||
Store daily = new($"{(user != null ? user.Username + "的" : "")}每日商店");
|
||||
for (int i = 0; i < 4; i++)
|
||||
{
|
||||
int index = Random.Shared.Next(FunGameConstant.AllItems.Count);
|
||||
Item item = FunGameConstant.AllItems[index].Copy();
|
||||
Item item;
|
||||
if (Random.Shared.Next(3) < 1)
|
||||
{
|
||||
item = GenerateMagicCard((QualityType)Random.Shared.Next((int)QualityType.Gold + 1));
|
||||
}
|
||||
else
|
||||
{
|
||||
int index = Random.Shared.Next(FunGameConstant.AllItems.Count);
|
||||
item = FunGameConstant.AllItems[index].Copy();
|
||||
}
|
||||
item.Character = null;
|
||||
(int min, int max) = (0, 0);
|
||||
if (FunGameConstant.PriceRanges.TryGetValue(item.QualityType, out (int Min, int Max) range))
|
||||
@ -1712,11 +1728,23 @@ namespace Oshima.FunGame.OshimaServers.Service
|
||||
(min, max) = (range.Min, range.Max);
|
||||
}
|
||||
double price = Random.Shared.Next(min, max);
|
||||
if (item.ItemType == ItemType.MagicCard)
|
||||
{
|
||||
price *= 0.7;
|
||||
}
|
||||
else if (item.ItemType == ItemType.Consumable)
|
||||
{
|
||||
int prev = (int)item.QualityType - 1;
|
||||
int current = (int)item.QualityType;
|
||||
min = 300 * (1 + (prev * prev - prev));
|
||||
max = 300 * (1 + (current * current - current));
|
||||
price = Random.Shared.Next(min, max);
|
||||
}
|
||||
if (price == 0)
|
||||
{
|
||||
price = (Random.Shared.NextDouble() + 0.1) * Random.Shared.Next(1000, 5000) * Random.Shared.Next((int)item.QualityType + 2, 6 + ((int)item.QualityType));
|
||||
}
|
||||
item.Price = Calculation.Round2Digits(price);
|
||||
item.Price = (int)price;
|
||||
daily.AddItem(item, Random.Shared.Next(1, 3));
|
||||
}
|
||||
store.Add("daily", daily);
|
||||
@ -1824,5 +1852,14 @@ namespace Oshima.FunGame.OshimaServers.Service
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public static async Task UpdateRegionWeather()
|
||||
{
|
||||
foreach (Region region in FunGameConstant.Regions.Union(FunGameConstant.PlayerRegions))
|
||||
{
|
||||
region.ChangeRandomWeather();
|
||||
}
|
||||
await Task.CompletedTask;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -1011,22 +1011,22 @@ namespace Oshima.FunGame.OshimaServers.Service
|
||||
{
|
||||
if (addLevel)
|
||||
{
|
||||
character.SetLevel(character.Level + 10, false);
|
||||
character.NormalAttack.Level += 2;
|
||||
character.SetLevel(character.Level + 8, false);
|
||||
character.NormalAttack.Level += 1;
|
||||
foreach (Skill skill in character.Skills)
|
||||
{
|
||||
if (skill.SkillType == SkillType.Passive) continue;
|
||||
skill.Level += 2;
|
||||
skill.Level += 1;
|
||||
}
|
||||
Character? original = queue.Original[character.Guid];
|
||||
if (original != null)
|
||||
{
|
||||
original.Level += 10;
|
||||
original.NormalAttack.Level += 2;
|
||||
original.Level += 8;
|
||||
original.NormalAttack.Level += 1;
|
||||
foreach (Skill skill in original.Skills)
|
||||
{
|
||||
if (skill.SkillType == SkillType.Passive) continue;
|
||||
skill.Level += 2;
|
||||
skill.Level += 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -4024,7 +4024,7 @@ namespace Oshima.FunGame.WebAPI.Controllers
|
||||
pc.Add("days", days + 1);
|
||||
pc.Add("lastTime", newLastTime);
|
||||
pc.SaveConfig();
|
||||
return NetworkUtility.JsonSerialize(msg);
|
||||
return NetworkUtility.JsonSerialize(msg + "\r\n>>> 请发送【帮助】来获取更多玩法指令!<<<");
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -82,6 +82,7 @@ namespace Oshima.FunGame.WebAPI.Models
|
||||
public string Timestamp { get; }
|
||||
public string OpenId { get; }
|
||||
public string AuthorOpenId { get; }
|
||||
public long FunGameUID { get; set; }
|
||||
}
|
||||
|
||||
public class ThirdPartyMessage : IBotMessage
|
||||
@ -109,6 +110,9 @@ namespace Oshima.FunGame.WebAPI.Models
|
||||
|
||||
[JsonIgnore]
|
||||
public string Result { get; set; } = "";
|
||||
|
||||
[JsonIgnore]
|
||||
public long FunGameUID { get; set; } = 0;
|
||||
}
|
||||
|
||||
public class C2CMessage : IBotMessage
|
||||
@ -128,6 +132,9 @@ namespace Oshima.FunGame.WebAPI.Models
|
||||
[JsonPropertyName("attachments")]
|
||||
public Attachment[] Attachments { get; set; } = [];
|
||||
|
||||
[JsonIgnore]
|
||||
public long FunGameUID { get; set; } = 0;
|
||||
|
||||
public string Detail
|
||||
{
|
||||
get => Content;
|
||||
@ -158,6 +165,9 @@ namespace Oshima.FunGame.WebAPI.Models
|
||||
[JsonPropertyName("attachments")]
|
||||
public Attachment[] Attachments { get; set; } = [];
|
||||
|
||||
[JsonIgnore]
|
||||
public long FunGameUID { get; set; } = 0;
|
||||
|
||||
public string Detail
|
||||
{
|
||||
get => Content;
|
||||
|
@ -42,6 +42,11 @@ namespace Oshima.FunGame.WebAPI.Services
|
||||
content = content.Trim();
|
||||
await Service.SendC2CMessageAsync(msg.OpenId, content, msgType, media, msg.Id, msgSeq);
|
||||
}
|
||||
if (msg.FunGameUID > 0 && FunGameService.FirstLoginDailyNotice.TryGetValue(msg.FunGameUID, out List<string>? msgs) && msgs != null)
|
||||
{
|
||||
FunGameService.FirstLoginDailyNotice.Remove(msg.FunGameUID);
|
||||
await SendAsync(msg, "每日登录提醒", string.Join("\r\n", msgs), msgType, media, 5);
|
||||
}
|
||||
}
|
||||
|
||||
public async Task<bool> Handler(IBotMessage e)
|
||||
@ -63,6 +68,7 @@ namespace Oshima.FunGame.WebAPI.Services
|
||||
if (MemoryCache.TryGetValue(openid, out object? value) && value is long uidTemp)
|
||||
{
|
||||
uid = uidTemp;
|
||||
e.FunGameUID = uid;
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -74,6 +80,7 @@ namespace Oshima.FunGame.WebAPI.Services
|
||||
{
|
||||
User user = Factory.GetUser(sql.DataSet);
|
||||
uid = user.Id;
|
||||
e.FunGameUID = uid;
|
||||
MemoryCache.Set(openid, uid, TimeSpan.FromMinutes(10));
|
||||
}
|
||||
}
|
||||
@ -122,7 +129,7 @@ namespace Oshima.FunGame.WebAPI.Services
|
||||
|
||||
if (e.Detail == "帮助" || e.Detail == "帮助1")
|
||||
{
|
||||
await SendAsync(e, "饭给木", @"《饭给木》游戏指令列表(第 1 / 7 页)
|
||||
await SendAsync(e, "筽祀牻", @"《筽祀牻》游戏指令列表(第 1 / 7 页)
|
||||
1、创建存档:创建存档,生成随机一个自建角色(序号固定为1)
|
||||
2、我的库存/我的背包/查看库存 [页码]:显示所有角色、物品库存,每个角色和物品都有一个专属序号
|
||||
3、我的库存 <物品类型> [页码]:卡包/武器/防具/鞋子/饰品/消耗品/魔法卡等...
|
||||
@ -140,7 +147,7 @@ namespace Oshima.FunGame.WebAPI.Services
|
||||
|
||||
if (e.Detail == "帮助2")
|
||||
{
|
||||
await SendAsync(e, "饭给木", @"《饭给木》游戏指令列表(第 2 / 7 页)
|
||||
await SendAsync(e, "筽祀牻", @"《筽祀牻》游戏指令列表(第 2 / 7 页)
|
||||
12、装备 <角色序号> <物品序号>:装备指定物品给指定角色
|
||||
13、取消装备 <角色序号> <装备槽序号>:卸下角色指定装备槽上的物品
|
||||
* 装备槽序号从1开始,卡包/武器/防具/鞋子/饰品1/饰品2
|
||||
@ -157,7 +164,7 @@ namespace Oshima.FunGame.WebAPI.Services
|
||||
|
||||
if (e.Detail == "帮助3")
|
||||
{
|
||||
await SendAsync(e, "饭给木", @"《饭给木》游戏指令列表(第 3 / 7 页)
|
||||
await SendAsync(e, "筽祀牻", @"《筽祀牻》游戏指令列表(第 3 / 7 页)
|
||||
22、普攻升级 [角色序号]:升级普攻等级
|
||||
23、查看普攻升级 [角色序号]:查看下一次普攻升级信息
|
||||
23、技能升级 <角色序号> <技能名称>:升级技能等级
|
||||
@ -175,7 +182,7 @@ namespace Oshima.FunGame.WebAPI.Services
|
||||
|
||||
if (e.Detail == "帮助4")
|
||||
{
|
||||
await SendAsync(e, "饭给木", @"《饭给木》游戏指令列表(第 4 / 7 页)
|
||||
await SendAsync(e, "筽祀牻", @"《筽祀牻》游戏指令列表(第 4 / 7 页)
|
||||
33、兑换金币 <材料数>:1材料=200金币
|
||||
34、还原存档:没有后悔药
|
||||
35、我的主战:查看当前主战角色
|
||||
@ -191,7 +198,7 @@ namespace Oshima.FunGame.WebAPI.Services
|
||||
|
||||
if (e.Detail == "帮助5")
|
||||
{
|
||||
await SendAsync(e, "饭给木", @"《饭给木》游戏指令列表(第 5 / 7 页)
|
||||
await SendAsync(e, "筽祀牻", @"《筽祀牻》游戏指令列表(第 5 / 7 页)
|
||||
43:任务列表:查看今日任务列表
|
||||
44:开始任务/做任务 <任务序号>
|
||||
45、任务信息:查看进行中任务的详细信息
|
||||
@ -206,7 +213,7 @@ namespace Oshima.FunGame.WebAPI.Services
|
||||
|
||||
if (e.Detail == "帮助6")
|
||||
{
|
||||
await SendAsync(e, "饭给木", @"《饭给木》游戏指令列表(第 6 / 7 页)
|
||||
await SendAsync(e, "筽祀牻", @"《筽祀牻》游戏指令列表(第 6 / 7 页)
|
||||
52、我的社团:查看社团信息
|
||||
53、加入社团 <社团编号>:申请加入社团
|
||||
54、退出社团
|
||||
@ -224,7 +231,7 @@ namespace Oshima.FunGame.WebAPI.Services
|
||||
|
||||
if (e.Detail == "帮助7")
|
||||
{
|
||||
await SendAsync(e, "饭给木", @"《饭给木》游戏指令列表(第 7 / 7 页)
|
||||
await SendAsync(e, "筽祀牻", @"《筽祀牻》游戏指令列表(第 7 / 7 页)
|
||||
63、每日商店
|
||||
64、商店查看 <商品序号>
|
||||
65、商店购买 <商品序号>
|
||||
@ -267,14 +274,14 @@ namespace Oshima.FunGame.WebAPI.Services
|
||||
int count = 1;
|
||||
foreach (string msg in real)
|
||||
{
|
||||
await SendAsync(e, "饭给木", msg.Trim(), msgSeq: count++);
|
||||
await SendAsync(e, "筽祀牻", msg.Trim(), msgSeq: count++);
|
||||
await Task.Delay(5500);
|
||||
}
|
||||
FunGameSimulation = false;
|
||||
}
|
||||
else
|
||||
{
|
||||
await SendAsync(e, "饭给木", "游戏正在模拟中,请勿重复请求!");
|
||||
await SendAsync(e, "筽祀牻", "游戏正在模拟中,请勿重复请求!");
|
||||
}
|
||||
return result;
|
||||
}
|
||||
@ -321,21 +328,21 @@ namespace Oshima.FunGame.WebAPI.Services
|
||||
int count = 1;
|
||||
foreach (string msg in real)
|
||||
{
|
||||
await SendAsync(e, "饭给木", msg.Trim(), msgSeq: count++);
|
||||
await SendAsync(e, "筽祀牻", msg.Trim(), msgSeq: count++);
|
||||
await Task.Delay(5500);
|
||||
}
|
||||
FunGameSimulation = false;
|
||||
}
|
||||
else
|
||||
{
|
||||
await SendAsync(e, "饭给木", "游戏正在模拟中,请勿重复请求!");
|
||||
await SendAsync(e, "筽祀牻", "游戏正在模拟中,请勿重复请求!");
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
if (e.Detail == "上次的完整日志")
|
||||
{
|
||||
await SendAsync(e, "饭给木", string.Join("\r\n", Controller.GetLast()));
|
||||
await SendAsync(e, "筽祀牻", string.Join("\r\n", Controller.GetLast()));
|
||||
return result;
|
||||
}
|
||||
|
||||
@ -379,14 +386,14 @@ namespace Oshima.FunGame.WebAPI.Services
|
||||
int count = 1;
|
||||
foreach (string msg in real)
|
||||
{
|
||||
await SendAsync(e, "饭给木", msg.Trim(), msgSeq: count++);
|
||||
await SendAsync(e, "筽祀牻", msg.Trim(), msgSeq: count++);
|
||||
await Task.Delay(5500);
|
||||
}
|
||||
FunGameSimulation = false;
|
||||
}
|
||||
else
|
||||
{
|
||||
await SendAsync(e, "饭给木", "游戏正在模拟中,请勿重复请求!");
|
||||
await SendAsync(e, "筽祀牻", "游戏正在模拟中,请勿重复请求!");
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user