22 lines
730 B
C#
22 lines
730 B
C#
using System;
|
|
using System.Collections.Generic;
|
|
using cfg;
|
|
using Framework;
|
|
using Framework.Condition;
|
|
using Gameplay.Character;
|
|
using Gameplay.Level;
|
|
|
|
public class ConditionCombatKillAllEnemy : ICondition
|
|
{
|
|
public EventManager.EventName SignalName => EventManager.EventName.INFIGHT_UNIT_DEAD;
|
|
public bool Check(List<float> args)
|
|
{
|
|
if (!LevelManager.Instance.IsInLevel)
|
|
throw new Exception("current level is null!");
|
|
var level = LevelManager.Instance.CurrentLevel;
|
|
var character = level.CharacterManager.FindOne(character =>
|
|
character.troopId is ETroopsId.Enemy1 or ETroopsId.Enemy2
|
|
&& !character.statusData.isDead);
|
|
return character == null;
|
|
}
|
|
} |