private Rectangle AttackHitbox;                                     // 右向き時の槍部分の攻撃判定ボックス (相対)
        #endregion

        /// <summary>
        /// コンストラクタ
        /// </summary>
        public HyruleSoldier(Point Position, bool IsFromMap = false, Point FromMapPosition = new Point(), bool AttackStart = false)
        {
            this.Position        = Position.ToVector2();
            this.IsFromMap       = IsFromMap;
            this.FromMapPosition = FromMapPosition;
            Type         = Types.Enemy;
            Health       = 3;
            DamageDetail = new DamageDetail(4, DamageDetail.Types.Normal, this);

            if (AttackStart)
            {
                Status = Statuses.Attack;
            }
            else
            {
                Status = Statuses.Searching;
            }

            IsAlive      = true;
            MoveDistance = Vector2.Zero;

            Hitbox       = new Rectangle(-7, -23, 14, 24);
            SearchRange  = new Rectangle(-80, -63, 160, 64);
            AttackHitbox = new Rectangle(7, -9, 21, 5);
        }
 /// <summary>
 /// エンティティにダメージを与える
 /// </summary>
 /// <param name="DamageDetail">与えるダメージの内容</param>
 /// <returns>ダメージが有効であったかどうかを返す。</returns>
 public virtual bool GiveDamage(DamageDetail DamageDetail)
 {
     IsDamageBlink           = true;
     DamageBlinkFrameCounter = 0;
     Health -= DamageDetail.Damage;
     if (Health <= 0)
     {
         Destroy();
     }
     return(true);
 }
Beispiel #3
0
        public const int MaxNumber = 3;                                                                 // 画面内に存在できるロックバスターの最大数
        #endregion

        /// <summary>
        /// コンストラクタ
        /// </summary>
        public RockBuster(Point Position, bool FaceToLeft)
        {
            IsAlive       = true;
            IsNoclip      = true;
            this.Position = Position.ToVector2();
            IsFaceToLeft  = FaceToLeft;
            DamageDetail  = new DamageDetail(1, DamageDetail.Types.RockBuster1, this);

            RelativeHitbox = new Rectangle(-4, -4, 8, 8);

            Count++;
        }
 /// <summary>
 /// エンティティにダメージを与える
 /// </summary>
 /// <param name="Damage">与えるダメージ</param>
 public override bool GiveDamage(DamageDetail DamageDetail)
 {
     Status = Statuses.Attack;
     base.GiveDamage(DamageDetail);
     // 体力が 0 以下になった場合
     if (Health <= 0)
     {
         Point EffectPosition = new Point((int)Position.X, (int)Position.Y - 12);
         AddReserv(Entity.Names.Explosion1, EffectPosition);
     }
     return(true);
 }
Beispiel #5
0
        /// <summary>
        /// ダメージを受ける
        /// </summary>
        /// <param name="Damage">ダメージ量</param>
        public override bool GiveDamage(DamageDetail DamageDetail)
        {
            if (IsAlive && !IsInvincible)
            {
                base.GiveDamage(DamageDetail);

                if (Health <= 0)
                {
                    Destroy();
                }
                else
                {
                    IsShooting     = false;
                    IsInvincible   = true;
                    MoveDistance.Y = 0;
                    SetStatus(Statuses.Damage);
                }
            }
            return(true);
        }