测试三阵营
This commit is contained in:
@@ -14,19 +14,34 @@ namespace TcgEngine
|
||||
{
|
||||
public bool increase_value;
|
||||
public bool increase_max;
|
||||
|
||||
[Header("Team Mana")]
|
||||
public string team_id = ""; // 指定影响的阵营,空值表示影响通用mana
|
||||
|
||||
public override void DoEffect(GameLogic logic, AbilityData ability, Card caster, Player target)
|
||||
{
|
||||
if (increase_max)
|
||||
// 如果指定了阵营,影响阵营mana;否则影响通用mana
|
||||
if (!string.IsNullOrEmpty(team_id))
|
||||
{
|
||||
target.mana_max += ability.value;
|
||||
target.mana_max = Mathf.Clamp(target.mana_max, 0, GameplayData.Get().mana_max);
|
||||
// 影响阵营mana
|
||||
int current_add = increase_value ? ability.value : 0;
|
||||
int max_add = increase_max ? ability.value : 0;
|
||||
target.AddTeamMana(team_id, current_add, max_add);
|
||||
}
|
||||
|
||||
if(increase_value)
|
||||
else
|
||||
{
|
||||
target.mana += ability.value;
|
||||
target.mana = Mathf.Max(target.mana, 0);
|
||||
// 影响通用mana(保持原有逻辑)
|
||||
if (increase_max)
|
||||
{
|
||||
target.mana_max += ability.value;
|
||||
target.mana_max = Mathf.Clamp(target.mana_max, 0, GameplayData.Get().mana_max);
|
||||
}
|
||||
|
||||
if(increase_value)
|
||||
{
|
||||
target.mana += ability.value;
|
||||
target.mana = Mathf.Max(target.mana, 0);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user