//-----------------------------------------------------------------------------
        // 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;
        }
예제 #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;
 }
예제 #3
0
 //-----------------------------------------------------------------------------
 // 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();
 }
예제 #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);
        }
예제 #5
0
 public Collectible SpawnCollectible(Reward reward)
 {
     Collectible collectible = new Collectible(reward);
     gameControl.RoomControl.SpawnEntity(collectible);
     return collectible;
 }
예제 #6
0
 public Reward AddReward(Reward reward)
 {
     if (!rewards.ContainsKey(reward.ID))
         rewards.Add(reward.ID, reward);
     return rewards[reward.ID];
 }
예제 #7
0
 public Drop(Type entityType)
 {
     this.reward		= null;
     this.entityType	= entityType;
 }
예제 #8
0
 public Drop(Reward reward)
 {
     this.reward		= reward;
     this.entityType	= null;
 }
예제 #9
0
 //-----------------------------------------------------------------------------
 // Constructor
 //-----------------------------------------------------------------------------
 public Drop()
 {
     reward		= null;
     entityType	= null;
 }
예제 #10
0
 public RoomStateReward(Reward reward, Point2I chestPosition)
     : this(reward)
 {
     this.chestPosition		= chestPosition;
     this.useChest			= true;
 }
예제 #11
0
 public void AddDrop(int odds, Reward reward)
 {
     AddDrop(odds, new Drop(reward));
 }