//-----------------------------------------------------------------------------
        // Constructors
        //-----------------------------------------------------------------------------
        public CollectibleReward(Reward reward, bool isDrop = false)
        {
            this.reward			= reward;
            this.showMessage	= !reward.OnlyShowMessageInChest;
            this.hasDuration	= reward.HasDuration;
            this.isCollectibleWithItems = reward.IsCollectibleWithItems;
            this.isDrop			= isDrop;

            // Physics.
            Physics.CollisionBox		= new Rectangle2I(-4, -9, 8, 8);
            Physics.SoftCollisionBox	= new Rectangle2I(-5, -9, 9, 8);
            EnablePhysics(
                PhysicsFlags.Bounces |
                PhysicsFlags.HasGravity |
                PhysicsFlags.CollideRoomEdge |
                PhysicsFlags.CollideWorld |
                PhysicsFlags.HalfSolidPassable |
                PhysicsFlags.DestroyedInHoles);
            soundBounce = reward.BounceSound;

            // Graphics.
            centerOffset					= new Point2I(0, -5);
            Graphics.DrawOffset				= new Point2I(-8, -13);
            Graphics.RipplesDrawOffset		= new Point2I(0, 1);
            Graphics.IsGrassEffectVisible	= true;
            Graphics.IsRipplesEffectVisible	= true;
        }
Example #2
0
 //-----------------------------------------------------------------------------
 // Rewards
 //-----------------------------------------------------------------------------
 public Collectible SpawnCollectibleFromBreakableTile(Reward reward, Point2I position)
 {
     Collectible collectible = new Collectible(reward);
     gameControl.RoomControl.SpawnEntity(collectible);
     collectible.Position = position;
     collectible.Physics.ZVelocity = 1.5f;
     return collectible;
 }
 //-----------------------------------------------------------------------------
 // Constructor
 //-----------------------------------------------------------------------------
 public RoomStateReward(Reward reward)
 {
     this.updateRoom			= false;
     this.animateRoom		= true;
     this.reward				= reward;
     this.chestPosition		= Point2I.Zero;
     this.useChest			= false;
     this.timer				= 0;
     this.animationPlayer	= new AnimationPlayer();
 }
Example #4
0
        //-----------------------------------------------------------------------------
        // Constructors
        //-----------------------------------------------------------------------------
        public Collectible(Reward reward)
        {
            EnablePhysics(PhysicsFlags.Bounces |
                PhysicsFlags.HasGravity |
                PhysicsFlags.DestroyedOutsideRoom |
                PhysicsFlags.CollideWorld |
                PhysicsFlags.HalfSolidPassable |
                PhysicsFlags.LedgePassable |
                PhysicsFlags.DestroyedInHoles);

            this.reward			= reward;
            this.showMessage	= false;
            this.timer			= 0;
            this.Graphics.DrawOffset	= new Point2I(-8, -8);
        }
Example #5
0
 public Collectible SpawnCollectible(Reward reward)
 {
     Collectible collectible = new Collectible(reward);
     gameControl.RoomControl.SpawnEntity(collectible);
     return collectible;
 }
Example #6
0
 public Reward AddReward(Reward reward)
 {
     if (!rewards.ContainsKey(reward.ID))
         rewards.Add(reward.ID, reward);
     return rewards[reward.ID];
 }
Example #7
0
 public Drop(Type entityType)
 {
     this.reward		= null;
     this.entityType	= entityType;
 }
Example #8
0
 public Drop(Reward reward)
 {
     this.reward		= reward;
     this.entityType	= null;
 }
Example #9
0
 //-----------------------------------------------------------------------------
 // Constructor
 //-----------------------------------------------------------------------------
 public Drop()
 {
     reward		= null;
     entityType	= null;
 }
 public RoomStateReward(Reward reward, Point2I chestPosition)
     : this(reward)
 {
     this.chestPosition		= chestPosition;
     this.useChest			= true;
 }
Example #11
0
 public void AddDrop(int odds, Reward reward)
 {
     AddDrop(odds, new Drop(reward));
 }