コード例 #1
0
ファイル: IBullet.cs プロジェクト: tyrdom/hang_up
 public AddBuffSelfBullet(BattleBuffs.IBattleBuff[] battleBuffs,
                          BattleCharacter fromWho, SelfTargetType selfTargetType)
 {
     BattleBuffs    = battleBuffs;
     FromWho        = fromWho;
     SelfTargetType = selfTargetType;
     TargetType     = selfTargetType;
 }
コード例 #2
0
ファイル: IBullet.cs プロジェクト: tyrdom/hang_up
 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;
 }
コード例 #3
0
ファイル: AutoBattleTools.cs プロジェクト: tyrdom/hang_up
        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)
            });
コード例 #4
0
ファイル: IBullet.cs プロジェクト: tyrdom/hang_up
 public HealSelfBullet(BattleCharacter fromWho, SelfTargetType targetType, int heal)
 {
     FromWho    = fromWho;
     TargetType = targetType;
     Heal       = heal;
 }