public static (BattleCharacter?, BattleCharacter[]) GetFirstAndOtherTargetByOpponentType( List <BattleCharacter> team, OpponentTargetType opponentTargetType) { var characters = team.Where(x => x.KeyStatus == KeyStatus.Alive).ToList(); if (!characters.Any()) { return(null, new BattleCharacter[] { }); } BattleCharacter battleCharacter = opponentTargetType switch { OpponentTargetType.FirstOpponent => characters.First(), OpponentTargetType.WeakestOpponent => characters.OrderBy(x => x.CharacterBattleAttribute.NowHp).First(), _ => throw new ArgumentOutOfRangeException(nameof(opponentTargetType), opponentTargetType, null) }; var battleCharacters = characters.Where(x => x != battleCharacter).ToArray(); return(battleCharacter, battleCharacters); }
public StandardHarmBullet(BattleCharacter fromWho, OpponentTargetType type, long harm) { FromWho = fromWho; Type = type; Harm = harm; }
public HealSelfBullet(BattleCharacter fromWho, SelfTargetType targetType, int heal) { FromWho = fromWho; TargetType = targetType; Heal = heal; }
public AttackBulletWithToSelfOrMiss(OpponentTargetType type, SelfTargetType selfTargetType, BattleBuffs.IBattleBuff[] battleBuffs, int harm, bool hitOrMiss, BattleCharacter fromWho) { Type = type; SelfTargetType = selfTargetType; BattleBuffs = battleBuffs; Harm = harm; HitOrMiss = hitOrMiss; FromWho = fromWho; }
public AttackBulletWithToOpponentWhenHitOrMiss(OpponentTargetType type, OpponentTargetType buffTargetType, BattleBuffs.IBattleBuff[] battleBuffs, BattleCharacter fromWho, int harm, bool hitOrMiss) { Type = type; BuffTargetType = buffTargetType; BattleBuffs = battleBuffs; FromWho = fromWho; Harm = harm; HitOrMiss = hitOrMiss; }
public JustKillBullet(OpponentTargetType type, BattleCharacter fromWho) { Type = type; FromWho = fromWho; Harm = 1; }
public SummonUnitBullet(BattleCharacter summonCharacter, int maxNum, bool isOnHead, BattleCharacter fromWho, long harm, OpponentTargetType type) { SummonCharacter = summonCharacter; MaxNum = maxNum; IsOnHead = isOnHead; FromWho = fromWho; Harm = harm; Type = type; }
public AddDamageByOpTeamBullet(float multiByNum, OpponentTargetType type, BattleCharacter fromWho, long harm) { MultiByNum = multiByNum; Type = type; FromWho = fromWho; Harm = harm; }
public static BattleCharacter[] GetTargetsBySelfTargetType(List <BattleCharacter> team, SelfTargetType selfTargetType, BattleCharacter fromWho) { var characters = team.Where(x => x.KeyStatus == KeyStatus.Alive).ToList(); if (!characters.Any()) { return new BattleCharacter[] { } } ; return(selfTargetType switch { SelfTargetType.Self => characters.Where(x => x == fromWho).ToArray(), SelfTargetType.SelfTeam => characters.ToArray(), SelfTargetType.SelfWeak => characters .OrderBy(x => x.CharacterBattleAttribute.NowHp / x.CharacterBattleAttribute.MaxHp).Take(1) .ToArray(), SelfTargetType.SelfTeamOthers => characters.Where(x => x != fromWho).ToArray(), _ => throw new ArgumentOutOfRangeException(nameof(selfTargetType), selfTargetType, null) });