コード例 #1
0
    private void SetEffect(string effect, DirectionTarget facing, Level inLevel, TrashCan who)
    {
        // Display Small Spark Effect on Hit
        SpecialEffects spark = new SpecialEffects(effect, facing, inLevel, who);

        InLevel.GameItems.Add(spark);
    }
コード例 #2
0
        public override void GetHit(DirectionTarget cameFrom, int damage)
        {
            this.IsAttacking = false;

            this.Health -= damage;
            if (CheckForDeath())
            {
                SoundManager.PlaySound("RolentoDye");
                GetKnockedDown(cameFrom, 0);
                return;
            }

            // Set state and tetxture
            state      = RolentoEnemyRangedState.TakeHit;
            texture    = Game1.SprRolentoWalkIdle;
            frameX     = 0;
            frameY     = 3;
            drawWidth  = DRAW_WIDTH_TAKEHIT;
            drawHeight = DRAW_HEIGHT_TAKEHIT;
            SetDrawArea();

            // Play Sound
            SoundManager.PlaySound("RolentoGetHit");

            // Face the man who beat you
            if (cameFrom == DirectionTarget.Left)
            {
                FacingDir = DirectionTarget.Right;
            }
            else
            {
                FacingDir = DirectionTarget.Left;
            }
        }
コード例 #3
0
        public SpecialEffects(string id, DirectionTarget facingDir, Level inLevel, TrashCan gameItem)
            : base(Vector2.Zero, inLevel, null)
        {
            switch (id)
            {
            case "trashcanhit":     // TrashCan Blue Spark
                this.Sprite = TextureManager.GetTexure("small-spark");
                break;
            }

            // Place this vector based of the actor position

            this.InitSpriteFrames(DRAW_SMALLSPARK_WIDTH, DRAW_SMALLSPARK_HEIGHT);

            this.SetOffsetPosition(new Vector2(50, 20));

            if (facingDir == DirectionTarget.Left)
            {
                this.Position = new Vector2(gameItem.Position.X - Offset.X, gameItem.Position.Y - Offset.Y);
            }
            else
            {
                this.Position = new Vector2(gameItem.Position.X + Offset.X, gameItem.Position.Y - Offset.Y);
            }

            this.SetOriginPosition();
        }
コード例 #4
0
        public override void GetKnockedDown(DirectionTarget cameFrom, int damage)
        {
            // Set state and texture
            this.IsAttackable = false;
            this.IsAttacking  = false;
            this.Health      -= damage;

            this.state  = EnemyRangedState.KnockedDown;
            this.Sprite = Texture_React;
            this.InitSpriteFrames(DRAW_WIDTH_KNOCKDOWN, DRAW_HEIGHT_TAKEHIT, 0, 1);
            this.SetDrawArea();
            this.SetOriginPosition("bottom");

            // Face the man who beat you
            if (cameFrom == DirectionTarget.Left)
            {
                FacingDir = DirectionTarget.Right;
            }
            else
            {
                FacingDir = DirectionTarget.Left;
            }

            SoundManager.PlaySound("GetHit03");
        }
コード例 #5
0
        public override void GetHit(DirectionTarget cameFrom, int damage)
        {
            this.IsAttacking = false;
            this.Health     -= damage;

            if (CheckForDeath())
            {
                SoundManager.PlaySound("GetHit-Died");
                GetKnockedDown(cameFrom, 0);
                return;
            }

            // Set state and tetxture
            state = AdonCloseState.TakeHit;

            this.Sprite = Texture_Walk_Idle;
            this.InitSpriteFrames(DRAW_WIDTH_TAKEHIT, DRAW_HEIGHT_TAKEHIT, 0, 2);
            this.SetOriginPosition("bottom");
            this.SetDrawArea();

            // Play Sound
            SoundManager.PlaySound("GetHit01");

            // Face the man who beat you
            if (cameFrom == DirectionTarget.Left)
            {
                FacingDir = DirectionTarget.Right;
            }
            else
            {
                FacingDir = DirectionTarget.Left;
            }
        }
コード例 #6
0
        public SpecialEffects(string fxID, DirectionTarget facing, Level inLevel, TrashCan gameItem)
        {
            this.InLevel    = inLevel;
            this.EffectsID  = fxID;
            this.facing_dir = facing;
            this.gameItem   = gameItem;

            switch (EffectsID)
            {
            case "trashcanhit":     // TrashCan Blue Spark
                this.EffectsID  = null;
                this.texture    = Game1.SprSmallSpark;
                this.drawWidth  = DRAW_SMALLSPARK_WIDTH;
                this.drawHeight = DRAW_SMALLSPARK_HEIGHT;
                this.frameX     = 0;
                this.frameY     = 1;
                Offset          = new Vector2(50, 20); // Place this vector based of the actor position
                if (facing_dir == DirectionTarget.Left)
                {
                    this.Position = new Vector2(gameItem.Position.X - Offset.X, gameItem.Position.Y - Offset.Y);
                }
                else
                {
                    this.Position = new Vector2(gameItem.Position.X + Offset.X, gameItem.Position.Y - Offset.Y);
                }

                this.origin = new Vector2(this.drawWidth / 2, this.drawHeight / 2);
                break;
            }
        }
コード例 #7
0
        public override void GetHitKick(DirectionTarget cameFrom, int damage)
        {
            this.IsAttacking = false;

            this.Health -= damage;
            if (CheckForDeath())
            {
                SoundManager.PlaySound("GetHit-Died");
                GetKnockedDown(cameFrom, 0);
                return;
            }

            // Set state and tetxture
            this.state  = EnemyRangedState.TakeHitLowKick;
            this.Sprite = Texture_React;
            this.InitSpriteFrames(DRAW_WIDTH_TAKEHIT, DRAW_HEIGHT_TAKEHIT, 3, 6);
            this.SetDrawArea();
            this.SetOriginPosition("bottom");

            // Face the man who beat you
            if (cameFrom == DirectionTarget.Left)
            {
                FacingDir = DirectionTarget.Right;
            }
            else
            {
                FacingDir = DirectionTarget.Left;
            }

            SoundManager.PlaySound("GetHit02");
            SoundManager.PlaySound("GetHit-Shit");
        }
コード例 #8
0
        public override void GetHitKick(DirectionTarget cameFrom, int damage)
        {
            this.IsAttacking = false;
            this.Health     -= damage;

            if (this.CheckForDeath())
            {
                SoundManager.PlaySound("RolentoDye");
                GetKnockedDown(cameFrom, 0);
                return;
            }

            // Set state and tetxture
            this.state  = RolentoEnemyRangedState.TakeHitLowKick;
            this.Sprite = Texture_Walk_Idle;
            this.InitSpriteFrames(DRAW_WIDTH_TAKEHITLOW, DRAW_HEIGHT_TAKEHITLOW, 0, 4);
            this.SetDrawArea();

            // Face the man who beat you
            if (cameFrom == DirectionTarget.Left)
            {
                FacingDir = DirectionTarget.Right;
            }
            else
            {
                FacingDir = DirectionTarget.Left;
            }

            SoundManager.PlaySound("RolentoGetHit");
        }
コード例 #9
0
        public override void GetKnockedDown(DirectionTarget cameFrom, int damage)
        {
            // Set state and texture
            IsAttackable     = false;
            this.IsAttacking = false;
            state            = AdonCloseState.KnockedDown;
            texture          = Game1.SprAdonWalkIdle;
            frameX           = 0;
            frameY           = 4;
            drawWidth        = DRAW_WIDTH_KNOCKDOWN;
            drawHeight       = DRAW_HEIGHT_TAKEHIT;
            originCharacters = new Vector2((drawWidth / 2), drawHeight);
            SetDrawArea();

            // Play Sound
            SoundManager.PlaySound("GetHit03");

            // Face the man who beat you
            if (cameFrom == DirectionTarget.Right)
            {
                FacingDir = DirectionTarget.Left;
            }
            else
            {
                FacingDir = DirectionTarget.Right;
            }

            this.Health -= damage;
        }
コード例 #10
0
        public override void GetHitKick(DirectionTarget cameFrom, int damage)
        {
            this.IsAttacking = false;

            this.Health -= damage;
            if (CheckForDeath())
            {
                SoundManager.PlaySound("GetHit-Died");
                GetKnockedDown(cameFrom, 0);
                return;
            }

            // Set state and tetxture
            state      = AdonCloseState.TakeHitLowKick;
            texture    = Game1.SprAdonWalkIdle;
            frameX     = 0;
            frameY     = 4;
            drawWidth  = DRAW_WIDTH_TAKEHITLOW;
            drawHeight = DRAW_HEIGHT_TAKEHITLOW;
            SetDrawArea();

            // Play Sound
            SoundManager.PlaySound("GetHit02");

            // Face the man who beat you
            if (cameFrom == DirectionTarget.Left)
            {
                FacingDir = DirectionTarget.Right;
            }
            else
            {
                FacingDir = DirectionTarget.Left;
            }
        }
コード例 #11
0
        public RolentoEnemy(DirectionTarget startingSide, Vector2 position, Level inLevel)
            : base(Vector2.Zero, inLevel)
        {
            this.Health    = STARTING_HEALTH;
            this.FacingDir = startingSide;

            ResetIdleGraphic();
        }
コード例 #12
0
        /// <summary>
        /// Create an enemy to spawn on a particular side of the screen
        /// </summary>
        /// <param name="startingSide"></param>
        /// <param name="inLevel"></param>
        public EnemyClose(DirectionTarget startingSide, Level inLevel)
            : base(Vector2.Zero, inLevel)
        {
            this.FacingDir = startingSide;

            ResetIdleGraphic();
            drawColor   = new Color(1f, 0.2f, 0.2f); // Set the draw color
            this.Health = STARTING_HEALTH;
        }
コード例 #13
0
        /// <summary>
        /// Create an enemy to spawn on a particular side of the screen
        /// </summary>
        /// <param name="startingSide"></param>
        /// <param name="inLevel"></param>
        public AdonEnemy(DirectionTarget startingSide, Level inLevel)
            : base(Vector2.Zero, inLevel)
        {
            this.FacingDir = startingSide;

            ResetIdleGraphic();
            drawColor   = Color.White;
            this.Health = STARTING_HEALTH;
        }
コード例 #14
0
        public EnemyRanged(DirectionTarget startingSide, Vector2 position, Level inLevel)
            : base(position, inLevel)
        {
            this.FacingDir = startingSide;
            this.Health    = STARTING_HEALTH;
            this.DrawColor = new Color(1f, 0.2f, 0.2f);

            ResetIdleGraphic();
        }
コード例 #15
0
 public void SetToWait(DirectionTarget facingDir)
 {
     this.state  = EnemyCloseState.Wait;
     this.Sprite = Texture_Walk_Idle;
     this.InitSpriteFrames(DRAW_WIDTH_WAIT, DRAW_HEIGHT_WAIT, 0, 3);
     this.SetDrawArea();
     this.SetOriginPosition("bottom");
     this.FacingDir = facingDir;
 }
コード例 #16
0
        public void SetToWait(DirectionTarget facingDir)
        {
            this.FacingDir = facingDir;

            this.state  = DeejayCloseState.Wait;
            this.Sprite = Texture_Walk_Idle;
            this.InitSpriteFrames(DRAW_WIDTH_IDLE, DRAW_HEIGHT_NORMAL, 0, 0);
            this.SetOriginPosition("bottom");
            this.SetDrawArea();
        }
コード例 #17
0
        public void SetToLayingDown(DirectionTarget facingDir)
        {
            this.FacingDir = facingDir;

            this.state  = DeejayCloseState.LayingDown;
            this.Sprite = Texture_Walk_Idle;
            this.InitSpriteFrames(DRAW_WIDTH_WAIT, DRAW_HEIGHT_WAIT, 0, 7);
            this.SetOriginPosition("bottom");
            this.SetDrawArea();
        }
コード例 #18
0
 public void SetToWait(DirectionTarget facingDir)
 {
     texture    = Game1.SprDeejayWalkIdle;
     drawWidth  = DRAW_WIDTH_IDLE;
     drawHeight = DRAW_HEIGHT_NORMAL;
     frameX     = 0;
     frameY     = 0;
     SetDrawArea();
     state = DeejayCloseState.Wait;
     this.originCharacters = new Vector2((drawWidth / 2), drawHeight);
     this.FacingDir        = facingDir;
 }
コード例 #19
0
 public void SetToWait(DirectionTarget facingDir)
 {
     texture    = Game1.SprAdonWalkIdle;
     drawWidth  = DRAW_WIDTH_WAIT;
     drawHeight = DRAW_HEIGHT_WAIT;
     frameX     = 0;
     frameY     = 7;
     SetDrawArea();
     state = AdonCloseState.Wait;
     this.originCharacters = new Vector2((drawWidth / 2), drawHeight);
     this.FacingDir        = facingDir;
 }
コード例 #20
0
    public override void TakeHit(DirectionTarget cameFrom)
    {
        // Set speed and texture
        this.state   = TrashCanState.Hit;
        this.texture = Game1.SprTrashCanHit;

        // Set speed based off hitDirection
        if (cameFrom == DirectionTarget.Left)
        {
            this.speed = new Vector2(-baseHitSpeed.X, baseHitSpeed.Y);
        }
        else
        {
            this.speed = baseHitSpeed;
        }

        SoundManager.PlaySound("CrashGlass");
        SoundManager.PlaySound("MetalSound2");
    }
コード例 #21
0
 public Rock(Vector2 startPos, DirectionTarget thrownDir, Level inLevel, Actor whoThrewMe)
 {
     this.whoThrewMe = whoThrewMe;
     this.zHeight    = startPos.Y;
     this.InLevel    = inLevel;
     this.origin     = new Vector2(Game1.SprRocks.Width / 2, Game1.SprRocks.Height / 2);
     GetLayerDepth(zHeight);
     if (thrownDir == DirectionTarget.Left)
     {
         this.speed    = BASE_SPEED * -1;
         this.Position = new Vector2(
             startPos.X - Offset.X, startPos.Y - Offset.Y);
     }
     else
     {
         this.speed    = BASE_SPEED;
         this.Position = new Vector2(
             startPos.X + Offset.X, startPos.Y - Offset.Y);
     }
 }
コード例 #22
0
        public Rock(Vector2 startPos, DirectionTarget thrownDir, Level inLevel, Actor throwingActor)
            : base(startPos, inLevel, throwingActor)
        {
            this.Sprite = TextureManager.GetTexure("Rocks");
            this.SetOffsetPosition(new Vector2(70, 90));
            this.InitSpriteFrames(this.Sprite.Width, this.Sprite.Height);
            this.SetOriginPosition();
            this.GetLayerDepth(startPos.Y);

            if (thrownDir == DirectionTarget.Left)
            {
                this.Speed.X  = BASE_SPEED * -1;
                this.Position = new Vector2(startPos.X - Offset.X, startPos.Y - Offset.Y);
            }
            else
            {
                this.Speed.X  = BASE_SPEED;
                this.Position = new Vector2(startPos.X + Offset.X, startPos.Y - Offset.Y);
            }
        }
コード例 #23
0
 public virtual void GetHitKick(DirectionTarget cameFrom, int damage)
 {
 }
コード例 #24
0
 public virtual void TakeHit(DirectionTarget cameFrom)
 {
 }
コード例 #25
0
 public virtual void GetKnockedDown(DirectionTarget cameFrom, int damage)
 {
 }