Changeset 3643 for 2012/27


Ignore:
Timestamp:
2012-07-06 11:44:00 (11 years ago)
Author:
dezhidki
Message:

Talletus.

Location:
2012/27/DenisZ/TheDungeonGame/TheDungeonGame
Files:
3 added
9 edited

Legend:

Unmodified
Added
Removed
  • 2012/27/DenisZ/TheDungeonGame/TheDungeonGame/TheDungeonGame/EntityTemplates.cs

    r3633 r3643  
    166166        { 
    167167            damage = 1; 
    168             health = 75; 
     168            health = 120; 
    169169            followingSpeed = 150; 
    170170            randomSpeed = 10000; 
     
    218218        { 
    219219            hitSound.Play(); 
    220             if (health <= 35 && !isPowerUpped) 
     220            if (health <= 50 && !isPowerUpped) 
    221221                upgradeMario(); 
    222222            game.gui.bossHealth.Value -= damage; 
  • 2012/27/DenisZ/TheDungeonGame/TheDungeonGame/TheDungeonGame/InGameGui.cs

    r3633 r3643  
    3939            Add(weaponSpeedText); 
    4040 
    41             Label weaponSpeedInfo = new Label("Weapon's speed"); 
     41            Label weaponSpeedInfo = new Label("Shooting delay"); 
    4242            weaponSpeedInfo.Top += 30; 
    4343            weaponSpeedInfo.Right += 90; 
     
    9797            healthAmount.TextColor = Color.Red; 
    9898            healthAmount.TextScale = new Vector(1.5, 1.5); 
    99             healthAmount.Right = Right - 40; 
     99            healthAmount.Right = Right - 100; 
    100100 
    101101            Add(healthAmount); 
  • 2012/27/DenisZ/TheDungeonGame/TheDungeonGame/TheDungeonGame/Item.cs

    r3640 r3643  
    2828       public virtual void onPickup(Player picker) 
    2929       { 
     30           TheDungeonGame.soundEffects[4].Play(); 
    3031           //picker.ItemInInventory = this; 
    3132           //picker.updateGuiImage(); 
  • 2012/27/DenisZ/TheDungeonGame/TheDungeonGame/TheDungeonGame/ItemEntity.cs

    r3640 r3643  
    1919           Image = bindedItem.itemTexture; 
    2020           CanRotate = false; 
    21            CollisionIgnoreGroup = CollisionGroups.Rocks; 
    2221       } 
    2322    } 
  • 2012/27/DenisZ/TheDungeonGame/TheDungeonGame/TheDungeonGame/ItemTemplates.cs

    r3640 r3643  
    88namespace Items 
    99{ 
    10    public class TestItem : Item 
     10    public class TestItem : Item 
    1111    { 
    12        public TestItem(Image itemTexture, String name, bool usuable) 
    13            : base(itemTexture, name, usuable) 
    14        { 
     12        public TestItem(Image itemTexture, String name, bool usuable) 
     13            : base(itemTexture, name, usuable) 
     14        { 
    1515 
    16        } 
     16        } 
    1717 
    18        public override bool useItem(TheDungeonGame game) 
    19        { 
    20            if (game.Player == null) return false; 
     18        public override bool useItem(TheDungeonGame game) 
     19        { 
     20            if (game.Player == null) return false; 
    2121 
    22            game.Player.ItemInInventory = null; 
    23            return true; 
    24        } 
     22            game.Player.ItemInInventory = null; 
     23            return true; 
     24        } 
    2525    } 
    2626 
     
    3030            : base(((TheDungeonGame)TheDungeonGame.Instance).objectTextures[3], "HealthPack", false) 
    3131        { 
    32  
    3332        } 
    3433 
     
    3938        } 
    4039    } 
     40 
     41    public class ItemAmmoDamage : Item 
     42    { 
     43        public ItemAmmoDamage() 
     44            : base(((TheDungeonGame)TheDungeonGame.Instance).objectTextures[5], "Damage upgrade", false) 
     45        { 
     46        } 
     47 
     48        public override void onPickup(Player picker) 
     49        { 
     50            picker.WeaponDamage++; 
     51            base.onPickup(picker); 
     52        } 
     53    } 
     54 
     55    public class ItemWeaponSpeed : Item 
     56    { 
     57        public ItemWeaponSpeed() 
     58            : base(((TheDungeonGame)TheDungeonGame.Instance).objectTextures[4], "Speed upgrade", false) 
     59        { 
     60        } 
     61 
     62        public override void onPickup(Player picker) 
     63        { 
     64            picker.WeaponSpeed -= TimeSpan.FromSeconds(0.05); 
     65            base.onPickup(picker); 
     66        } 
     67    } 
     68 
     69    public class ItemBulletLifeTime : Item 
     70    { 
     71        public ItemBulletLifeTime() 
     72            : base(((TheDungeonGame)TheDungeonGame.Instance).objectTextures[6], "Lifetime upgrade", false) 
     73        { 
     74             
     75        } 
     76 
     77        public override void onPickup(Player picker) 
     78        { 
     79            picker.BulletLife += TimeSpan.FromSeconds(0.05); 
     80            base.onPickup(picker); 
     81        } 
     82    } 
    4183} 
  • 2012/27/DenisZ/TheDungeonGame/TheDungeonGame/TheDungeonGame/Room.cs

    r3640 r3643  
    5353        public void spawnRandomEntities(int entityAmount) 
    5454        { 
     55            if (entityAmount == 0) return; 
     56 
    5557            int entitiesSpawned = 0; 
    5658            while (entitiesSpawned < entityAmount) 
     
    6567        public void spawnRandomItems(int itemAmount) 
    6668        { 
     69            if (itemAmount == 0) return; 
     70 
    6771            int itemsSpawned = 0; 
    6872            while (itemsSpawned < itemAmount) 
    6973            { 
    70                 ItemEntity item = RoomCreator.getItem(RandomGen.NextInt(1)).createWorldObject(); 
     74                ItemEntity item = RoomCreator.getItem(RandomGen.NextInt(4)).createWorldObject(); 
    7175                if (!addBlock(item, RandomGen.NextInt(bWidth - 2) + 1, RandomGen.NextInt(bHeight - 2) + 1)) 
    7276                    continue; 
  • 2012/27/DenisZ/TheDungeonGame/TheDungeonGame/TheDungeonGame/RoomTemplates.cs

    r3640 r3643  
    2121        { 
    2222            createLevelDecorations(); 
    23             spawnRandomItems(1); 
     23             
    2424        } 
    2525    } 
     
    4141            addBlock(new ObjectRock(blockWidth, blockHeight), bWidth - 1, bHeight - 1, new Vector(0, -50)); 
    4242 
    43             spawnRandomEntities(RandomGen.NextInt(6)+1); 
     43            spawnRandomEntities(RandomGen.NextInt(6) + 1); 
     44            spawnRandomItems(RandomGen.NextInt(2)); 
    4445        } 
    4546    } 
     
    5657            createLevelDecorations(); 
    5758 
    58             for (int i = 0; i < 4; i++) 
     59            for (int i = 0; i < 3; i++) 
    5960            { 
    6061                addBlock(new ObjectRock(blockWidth, blockHeight), 1, 1 + i, new Vector(0, -50)); 
    6162            } 
    6263 
    63             for (int i = 0; i < 4; i++) 
     64            for (int i = 0; i < 3; i++) 
    6465            { 
    6566                addBlock(new ObjectRock(blockWidth, blockHeight), 8, 1 + i, new Vector(0, -50)); 
     
    6768 
    6869            spawnRandomEntities(RandomGen.NextInt(6) + 1); 
     70            spawnRandomItems(RandomGen.NextInt(2)); 
    6971        } 
    7072    } 
     
    102104 
    103105            spawnRandomEntities(RandomGen.NextInt(6) + 1); 
     106            spawnRandomItems(RandomGen.NextInt(2)); 
    104107        } 
    105108    } 
     
    126129 
    127130            spawnRandomEntities(RandomGen.NextInt(6) + 1); 
     131            spawnRandomItems(RandomGen.NextInt(2)); 
    128132        } 
    129133    } 
     
    149153 
    150154            deleteBlock(bWidth / 2 - 1, bHeight / 2); 
    151             spawnRandomEntities(RandomGen.NextInt(6) + 1); 
     155            deleteBlock(bWidth / 2, bHeight / 2); 
     156            spawnRandomEntities(RandomGen.NextInt(6) + 1); 
     157            spawnRandomItems(RandomGen.NextInt(2)); 
    152158        } 
    153159    } 
     
    172178 
    173179            spawnRandomEntities(RandomGen.NextInt(6) + 1); 
     180            spawnRandomItems(RandomGen.NextInt(2)); 
    174181        } 
    175182    } 
     
    237244            if (id == 0) 
    238245                item = new ItemHealth(); 
     246            else if (id == 1) 
     247                item = new ItemAmmoDamage(); 
     248            else if (id == 2) 
     249                item = new ItemWeaponSpeed(); 
     250            else if (id == 3) 
     251                item = new ItemBulletLifeTime(); 
    239252 
    240253            return item; 
  • 2012/27/DenisZ/TheDungeonGame/TheDungeonGame/TheDungeonGame/TheDungeonGame.cs

    r3640 r3643  
    108108        objectTextures.Add(LoadImage("objects/ammo_speed")); 
    109109        objectTextures.Add(LoadImage("objects/ammo_damage")); 
     110        objectTextures.Add(LoadImage("objects/ammo_lifetime")); 
    110111    } 
    111112 
     
    163164            { 
    164165                EntityBossMario mario = (EntityBossMario)player.currentRoom.getEntityAt(3, 3); 
     166                if (mario.IsDestroyed) return; 
    165167                gui.setupBossGauge(mario); 
    166168                mario.enableMovement(); 
     
    202204        gui = new InGameGui(this); 
    203205        Add(gui); 
     206        gui.setupInfoMeters(); 
    204207        regenerateLevel(); 
    205208    } 
  • 2012/27/DenisZ/TheDungeonGame/TheDungeonGame/TheDungeonGameContent/TheDungeonGameContent.contentproj

    r3640 r3643  
    315315    </Compile> 
    316316  </ItemGroup> 
     317  <ItemGroup> 
     318    <Compile Include="objects\ammo_lifetime.png"> 
     319      <Name>ammo_lifetime</Name> 
     320      <Importer>TextureImporter</Importer> 
     321      <Processor>TextureProcessor</Processor> 
     322    </Compile> 
     323  </ItemGroup> 
    317324  <Import Project="$(MSBuildExtensionsPath)\Microsoft\XNA Game Studio\$(XnaFrameworkVersion)\Microsoft.Xna.GameStudio.ContentPipeline.targets" /> 
    318325  <!--  To modify your build process, add your task inside one of the targets below and uncomment it.  
Note: See TracChangeset for help on using the changeset viewer.