添加免疫状态、混乱状态;添加新技能;机器人部分优化

This commit is contained in:
milimoe 2025-06-27 00:03:04 +08:00
parent f9821a71cf
commit cb9c2b1a78
Signed by: milimoe
GPG Key ID: 9554D37E4B8991D0
22 changed files with 791 additions and 57 deletions

View File

@ -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;

View File

@ -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 += ;
}
}

View File

@ -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 += ;
}
}

View 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;
}
}
}

View 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;
}
}
}

View 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);
}
}
}

View 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);
}
}
}

View 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;
}
}
}

View 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]);
}
}
}
}

View File

@ -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 (),

View File

@ -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;

View 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);
}
}
}
}

View 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]);
}
}
}
}

View 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]);
}
}
}
}
}

View File

@ -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
}
]

View File

@ -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("刷新每天登录");
}
});
});

View File

@ -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; } = [

View File

@ -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;
}
}
}

View File

@ -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;
}
}
}

View File

@ -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
{

View File

@ -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;

View File

@ -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 页)
11
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;
}