예제 #1
0
        // States.
        /*private MonsterBurnState		stateBurn;
        private MonsterStunState		stateStun;
        private MonsterFallInHoleState	stateFallInHole;
        private MonsterGaleState		stateGale;*/
        //-----------------------------------------------------------------------------
        // Constructors
        //-----------------------------------------------------------------------------
        public Monster()
        {
            // With player:
            // - Top: 4 overlap
            // - Bottom: 3 overlap?
            // - Sides: 3 overlap

            color = MonsterColor.Red;
            properties = new Properties();

            // Physics.
            Physics.CollisionBox		= new Rectangle2I(-5, -9, 10, 10);
            Physics.SoftCollisionBox	= new Rectangle2I(-6, -11, 12, 11);
            Physics.CollideWithWorld	= true;
            Physics.CollideWithRoomEdge	= true;
            Physics.AutoDodges			= true;
            Physics.HasGravity			= true;
            Physics.IsDestroyedInHoles	= true;

            // Graphics.
            Graphics.DepthLayer			= DepthLayer.Monsters;
            Graphics.DepthLayerInAir	= DepthLayer.InAirMonsters;
            Graphics.DrawOffset			= new Point2I(-8, -14);
            centerOffset				= new Point2I(0, -6);

            // Monster & unit settings.
            knockbackSpeed			= GameSettings.MONSTER_KNOCKBACK_SPEED;
            hurtKnockbackDuration	= GameSettings.MONSTER_HURT_KNOCKBACK_DURATION;
            bumpKnockbackDuration	= GameSettings.MONSTER_BUMP_KNOCKBACK_DURATION;
            hurtInvincibleDuration	= GameSettings.MONSTER_HURT_INVINCIBLE_DURATION;
            hurtFlickerDuration		= GameSettings.MONSTER_HURT_FLICKER_DURATION;
            contactDamage			= 1;
            isGaleable				= true;
            isBurnable				= true;
            isStunnable				= true;
            isKnockbackable			= true;

            softKill = false;

            // Setup default interactions.
            interactionHandlers = new InteractionHandler[(int) InteractionType.Count];
            for (int i = 0; i < (int) InteractionType.Count; i++)
                interactionHandlers[i] = new InteractionHandler();
            SetDefaultReactions();
        }
예제 #2
0
 public Builder Color(MonsterColor color)
 {
     this.color = color;
     return(this);
 }
예제 #3
0
        //-----------------------------------------------------------------------------
        // Overridden Methods
        //-----------------------------------------------------------------------------
        public override void Initialize()
        {
            base.Initialize();

            color = (MonsterColor) Properties.GetInteger("color", (int) color);

            health = healthMax;
            Graphics.PlayAnimation(GameData.ANIM_MONSTER_OCTOROK);
            ChooseImageVariant();

            // Begin the default monster state.
            BeginNormalState();
            previousState = state;
        }