keyword + animation
This commit is contained in:
@@ -13,15 +13,10 @@ namespace Continentis.MainGame.Card
|
||||
#region Fundamental
|
||||
public partial class CardLogicBase
|
||||
{
|
||||
public bool HasTag(string tag)
|
||||
public List<string> GetElementalKeywords(List<string> overrideKeywords = null)
|
||||
{
|
||||
return tags.Contains(tag);
|
||||
}
|
||||
|
||||
public List<string> GetElementTags(List<string> tags = null)
|
||||
{
|
||||
tags ??= this.tags;
|
||||
return tags.Filtered((tag) => MainGameManager.Instance.elementTags.Contains(tag));
|
||||
overrideKeywords ??= contentSubmodule.keywords;
|
||||
return overrideKeywords.Filtered(kw => MainGameManager.Instance.elementTags.Contains(kw));
|
||||
}
|
||||
|
||||
public bool HasKeyword(string keyword)
|
||||
@@ -95,15 +90,22 @@ namespace Continentis.MainGame.Card
|
||||
{
|
||||
CommandBase clone = template.Clone();
|
||||
|
||||
List<CommandBase> allCommands = new List<CommandBase>();
|
||||
|
||||
if (clone is CommandGroup group)
|
||||
{
|
||||
foreach (CommandBase cmd in group.commands)
|
||||
{
|
||||
cmd.selfContext.context["Target"] = target;
|
||||
}
|
||||
}//TODO: 变成递归
|
||||
allCommands.AddRange(group.GetAllCommands(true));
|
||||
}
|
||||
else
|
||||
{
|
||||
allCommands.Add(clone);
|
||||
}
|
||||
|
||||
foreach (CommandBase cmd in allCommands)
|
||||
{
|
||||
cmd.selfContext.context["Target"] = target;
|
||||
}
|
||||
|
||||
clone.selfContext.context["Target"] = target;
|
||||
singleGroup.AddCommand(clone);
|
||||
}
|
||||
|
||||
@@ -132,17 +134,17 @@ namespace Continentis.MainGame.Card
|
||||
protected virtual int GetFinalDamage(CharacterBase target, List<string> elementalTags,
|
||||
out float baseDamageAfterOffset, out float elementalMultiplier, out float magicMultiplier, out float finalMultiplier)
|
||||
{
|
||||
elementalTags ??= GetElementTags();
|
||||
elementalTags ??= GetElementalKeywords();
|
||||
|
||||
//----计算基础伤害增量----
|
||||
int physicsOffset = 0;
|
||||
if (HasTag("Physics") || HasKeyword("Slash") || HasKeyword("Prick") || HasKeyword("Strike"))
|
||||
if (HasKeyword("Physics") || HasKeyword("Slash") || HasKeyword("Prick") || HasKeyword("Strike"))
|
||||
{
|
||||
physicsOffset = user.GetAttribute("PhysicsDamageDealtOffset"); //物理伤害基础增量
|
||||
}
|
||||
|
||||
int magicOffset = 0;
|
||||
if (HasTag("Magic") || HasKeyword("Arcane") || HasKeyword("Sorcery"))
|
||||
if (HasKeyword("Magic") || HasKeyword("Arcane") || HasKeyword("Sorcery"))
|
||||
{
|
||||
magicOffset = user.GetAttribute("MagicDamageDealtOffset"); //魔法伤害基础增量
|
||||
}
|
||||
@@ -159,7 +161,7 @@ namespace Continentis.MainGame.Card
|
||||
|
||||
//计算通用的魔法伤害加成
|
||||
magicMultiplier = 1;
|
||||
if (HasTag("Magic") || HasKeyword("Arcane") || HasKeyword("Sorcery"))
|
||||
if (HasKeyword("Magic") || HasKeyword("Arcane") || HasKeyword("Sorcery"))
|
||||
{
|
||||
magicMultiplier = user.GetRawAttribute("MagicDamageDealtMultiplier", 1) *
|
||||
target.GetRawAttribute("MagicDamageGainMultiplier", 1);
|
||||
|
||||
Reference in New Issue
Block a user