12.10 进度 基本完成
This commit is contained in:
@@ -19,22 +19,12 @@ namespace Continentis.Mods.Basic.Buffs
|
||||
|
||||
this.statusSubmodule = new StatusSubmodule(this, StatusType.Protected);
|
||||
|
||||
this.contentSubmodule = new ContentSubmodule(this);//TODO: 以后增加角色的ContentSubmodule
|
||||
this.contentSubmodule = new ContentSubmodule(this)
|
||||
.AddParameterGetter("Protector", GetProtectorNames);
|
||||
|
||||
this.iconSubmodule = new IconSubmodule(this).SetTextFunctions();
|
||||
|
||||
this.eventSubmodule = new EventSubmodule(this);
|
||||
/*
|
||||
this.eventSubmodule.onOpponentDecideAction.Add("Protected",
|
||||
new EventUnit<CharacterBase, IntendedCard, CharacterBase>((opponent, intendedCard, originalTarget) =>
|
||||
{
|
||||
if (opponent is CombatNPC npc)
|
||||
{
|
||||
intendedCard.targets.Remove(originalTarget);
|
||||
//intendedCard.targets.Add(protector); //TODO: 后续用设计专门的函数决定目标改变
|
||||
}
|
||||
}));
|
||||
*/
|
||||
}
|
||||
|
||||
public override bool OnBuffApply(out CharacterCombatBuffBase existingBuff)
|
||||
@@ -55,5 +45,24 @@ namespace Continentis.Mods.Basic.Buffs
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
private string GetProtectorNames()
|
||||
{
|
||||
List<string> names = new List<string>();
|
||||
foreach (Protecting protector in protectingSources)
|
||||
{
|
||||
names.Add(protector.attachedCharacter.data.displayName);
|
||||
Debug.Log($"Protector found: {protector.attachedCharacter.data.displayName}");
|
||||
}
|
||||
|
||||
if (names.Count == 1)
|
||||
{
|
||||
return names[0];
|
||||
}
|
||||
else
|
||||
{
|
||||
return string.Join(", ", names);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user