Skip to content

Commit

Permalink
Changed power up odd distribution by stage.
Browse files Browse the repository at this point in the history
  • Loading branch information
sharivan committed Jan 24, 2023
1 parent 2a70d49 commit 4eaf0b4
Show file tree
Hide file tree
Showing 37 changed files with 136 additions and 45 deletions.
Binary file not shown.
Binary file modified .vs/Bomberman/v17/.suo
Binary file not shown.
118 changes: 102 additions & 16 deletions Config.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
* Contém todas as constantes usadas pelo engine para definir seu comportamento.
* Qualquer alteração em uma dessas constantes irá alterar o comportamento do engine.
*
*/
*/

using System;
using System.Collections.Generic;
Expand Down Expand Up @@ -47,7 +47,7 @@ public partial class FrmBomberman : Form
public static readonly float MAX_TIME = 6 * 60; // 6 minutos. Tempo máximo que o bomberman poderá ter para completar o level.
public static readonly int MAX_LIVES = 9; // Quantidade máxima de vidas que o bomberman poderá ter
public static readonly float BOMB_SPEED = 256; // Velocidade da boma após ser chutada

// Bomb
public static readonly float BOMB_TIME = 2.5F; // Tempo de detonação da bomba após ser plantada pelo bomberman em segundos

Expand Down Expand Up @@ -82,20 +82,106 @@ public partial class FrmBomberman : Form
public static readonly float GENERATE_GRAPH_NODE_VALUES_THINK_TIME = 2; // Intervalo de tempo (em segundos) usado para a geração dos valores dos nós do grafo do jogo para a computação do menor caminho a ser seguido pelos cactus até o bomberman
public static readonly int MAX_SOFT_BLOCK_POWERUPS_PER_LEVEL = 4; // Número máximo de powerups obtidos atráves da quebra de soft blocks
public static readonly int POWER_UP_COUNT = 12; // Quanridade de powerups disponíveis no jogo
public static readonly float[] POWERUP_ODD_DISTRIBUTION = // Distribuição de probabilidade dos powerups do jogo
public static readonly float[,] POWERUP_ODD_DISTRIBUTION = // Distribuição de probabilidade dos powerups do jogo (por level)
{
15, // Bomb pass
10, // Bomb up
15, // Clock
10, // Fire up
2.5F, // Heart
15, // Kick
2.5F, // Life
2.5F, // Red bomb
2.5F, // Remote control
10, // Roller
5, // Soft block pass
10, // Vest
{ // Level 1
15, // Bomb pass
10, // Bomb up
15, // Clock
10, // Fire up
2.5F, // Heart
15, // Kick
2.5F, // Life
2.5F, // Red bomb
2.5F, // Remote control
10, // Roller
5, // Soft block pass
10, // Vest
},
{ // Levle 2
10, // Bomb pass
10, // Bomb up
20, // Clock
10, // Fire up
2.5F, // Heart
15, // Kick
2.5F, // Life
2.5F, // Red bomb
2.5F, // Remote control
15, // Roller
0, // Soft block pass
10, // Vest
},
{ // Level 3
15, // Bomb pass
20, // Bomb up
5, // Clock
20, // Fire up
2.5F, // Heart
15, // Kick
2.5F, // Life
2.5F, // Red bomb
2.5F, // Remote control
10, // Roller
5, // Soft block pass
0, // Vest
},
{ // Level 4
20, // Bomb pass
10, // Bomb up
15, // Clock
10, // Fire up
2.5F, // Heart
15, // Kick
2.5F, // Life
2.5F, // Red bomb
2.5F, // Remote control
10, // Roller
5, // Soft block pass
5, // Vest
},
{ // Level 5
5, // Bomb pass
15, // Bomb up
5, // Clock
15, // Fire up
2.5F, // Heart
15, // Kick
2.5F, // Life
2.5F, // Red bomb
2.5F, // Remote control
15, // Roller
5, // Soft block pass
15, // Vest
},
{ // Level 6
0, // Bomb pass
10, // Bomb up
15, // Clock
10, // Fire up
2.5F, // Heart
15, // Kick
2.5F, // Life
5, // Red bomb
5, // Remote control
15, // Roller
15, // Soft block pass
5, // Vest
},
{ // Level 7
0, // Bomb pass
10, // Bomb up
20, // Clock
10, // Fire up
2.5F, // Heart
10, // Kick
2.5F, // Life
10, // Red bomb
10, // Remote control
10, // Roller
10, // Soft block pass
5, // Vest
}
};
public static readonly int[,] MAX_POWERUP_PER_LEVEL = // Número máximo de powerups de cada tipo por level
{
Expand Down Expand Up @@ -222,7 +308,7 @@ public partial class FrmBomberman : Form
public static readonly Box2D DEFAULT_GAME_AREA_BOX = new Box2D(DEFAULT_GAME_AREA_RECT);
public static readonly Vector2D PRESS_ENTER_COORDS = new Vector2D(124, 323);
public static readonly float PRESS_ENTER_FLASH_TIME = 0.5F;
public static readonly float SIZE_RATIO = (float)COL_COUNT / (float)ROW_COUNT; // Proporção entre o número de colunas e o número de linhas do jogo. Usado para o cálculo da escala do jogo quando a tela for redimensionada.
public static readonly float SIZE_RATIO = (float) COL_COUNT / (float) ROW_COUNT; // Proporção entre o número de colunas e o número de linhas do jogo. Usado para o cálculo da escala do jogo quando a tela for redimensionada.
public static readonly float GAME_OVER_PANEL_SHOW_DELAY = 5;

// Scoring
Expand Down
5 changes: 2 additions & 3 deletions FrmBomberman.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3622,15 +3622,14 @@ public void NextLevel()
public PowerUpType RandomPowerUp()
{
float rnd = RandomFloat() * 100;
float sum = POWERUP_ODD_DISTRIBUTION[0];
float sum = POWERUP_ODD_DISTRIBUTION[currentLevel % STAGE_COUNT, 0];

if (rnd < sum)
return PowerUpType.BOMB_PASS;

for (int i = 1; i < POWERUP_ODD_DISTRIBUTION.Length; i++)
{
sum += POWERUP_ODD_DISTRIBUTION[i];

sum += POWERUP_ODD_DISTRIBUTION[currentLevel % STAGE_COUNT, i];
if (rnd < sum)
return (PowerUpType) i;
}
Expand Down
4 changes: 2 additions & 2 deletions bin/Debug/Bomberman.application
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<description asmv2:publisher="Bomberman" asmv2:product="Bomberman" xmlns="urn:schemas-microsoft-com:asm.v1" />
<deployment install="true" mapFileExtensions="true" />
<compatibleFrameworks xmlns="urn:schemas-microsoft-com:clickonce.v2">
<framework targetVersion="4.6.1" profile="Full" supportedRuntime="4.0.30319" />
<framework targetVersion="4.8.1" profile="Full" supportedRuntime="4.0.30319" />
</compatibleFrameworks>
<dependency>
<dependentAssembly dependencyType="install" codebase="Bomberman.exe.manifest" size="6623">
Expand All @@ -14,7 +14,7 @@
<dsig:Transform Algorithm="urn:schemas-microsoft-com:HashTransforms.Identity" />
</dsig:Transforms>
<dsig:DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha256" />
<dsig:DigestValue>dDBHwjxR0H6lx3VCC8T/UbBSDnagZcdgE+03W7/NQMA=</dsig:DigestValue>
<dsig:DigestValue>ObLyLyPn81BBUqHiiimI2vJrZ0UUPF5BSi3Hc+59X80=</dsig:DigestValue>
</hash>
</dependentAssembly>
</dependency>
Expand Down
Binary file modified bin/Debug/Bomberman.exe
Binary file not shown.
2 changes: 1 addition & 1 deletion bin/Debug/Bomberman.exe.config
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,5 @@
<configuration>
<startup>

<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.6"/></startup>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.8.1"/></startup>
</configuration>
8 changes: 4 additions & 4 deletions bin/Debug/Bomberman.exe.manifest
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@
<dsig:Transform Algorithm="urn:schemas-microsoft-com:HashTransforms.Identity" />
</dsig:Transforms>
<dsig:DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha256" />
<dsig:DigestValue>MnXPThdsSRXecja8it0uZb7CTwT1gFf192pyPh6WQGA=</dsig:DigestValue>
<dsig:DigestValue>LzRcvh4+HQl5JOGD1DXKaXoEQmO+5IeAKnW2WrT0vEw=</dsig:DigestValue>
</hash>
</dependentAssembly>
</dependency>
Expand All @@ -98,17 +98,17 @@
<dsig:Transform Algorithm="urn:schemas-microsoft-com:HashTransforms.Identity" />
</dsig:Transforms>
<dsig:DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha256" />
<dsig:DigestValue>y+ZHPeLOTUqRolRdOp9S7oLGy/csTcmAULKKVZdbtOY=</dsig:DigestValue>
<dsig:DigestValue>flWtlTEFiVx/iNePKdzorBfS+IElaX+9tfaleyjOv84=</dsig:DigestValue>
</hash>
</dependentAssembly>
</dependency>
<file name="Bomberman.exe.config" size="167">
<file name="Bomberman.exe.config" size="169">
<hash>
<dsig:Transforms>
<dsig:Transform Algorithm="urn:schemas-microsoft-com:HashTransforms.Identity" />
</dsig:Transforms>
<dsig:DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha256" />
<dsig:DigestValue>cm6x6fZ+09LS+qX1fNONKtui3fRFsn0UMpem5D/dNvs=</dsig:DigestValue>
<dsig:DigestValue>pXCaTkSdhdZK/ksNiEXvrqy/hr+wlOgzviND6k0ygHs=</dsig:DigestValue>
</hash>
</file>
<file name="favicon.ico" size="370070">
Expand Down
Binary file modified bin/Debug/Bomberman.pdb
Binary file not shown.
Binary file modified bin/Debug/Interop.WMPLib.dll
Binary file not shown.
Binary file modified bin/Debug/app.publish/Bomberman.exe
Binary file not shown.
Binary file modified bin/Debug/rank.bin
Binary file not shown.
4 changes: 2 additions & 2 deletions bin/Release/Bomberman.application
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<description asmv2:publisher="Bomberman" asmv2:product="Bomberman" xmlns="urn:schemas-microsoft-com:asm.v1" />
<deployment install="true" mapFileExtensions="true" />
<compatibleFrameworks xmlns="urn:schemas-microsoft-com:clickonce.v2">
<framework targetVersion="4.6.1" profile="Full" supportedRuntime="4.0.30319" />
<framework targetVersion="4.8.1" profile="Full" supportedRuntime="4.0.30319" />
</compatibleFrameworks>
<dependency>
<dependentAssembly dependencyType="install" codebase="Bomberman.exe.manifest" size="6623">
Expand All @@ -14,7 +14,7 @@
<dsig:Transform Algorithm="urn:schemas-microsoft-com:HashTransforms.Identity" />
</dsig:Transforms>
<dsig:DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha256" />
<dsig:DigestValue>3Qymqz1C8L1jjKclAo3PuKsYJfYFBzDl2MIlJQWXvh0=</dsig:DigestValue>
<dsig:DigestValue>e16Rbl2ZN21o4fBh9BzpQMQu39nVTMXGIWodEC+Q56k=</dsig:DigestValue>
</hash>
</dependentAssembly>
</dependency>
Expand Down
Binary file modified bin/Release/Bomberman.exe
Binary file not shown.
2 changes: 1 addition & 1 deletion bin/Release/Bomberman.exe.config
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,5 @@
<configuration>
<startup>

<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.6"/></startup>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.8.1"/></startup>
</configuration>
6 changes: 3 additions & 3 deletions bin/Release/Bomberman.exe.manifest
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@
<dsig:Transform Algorithm="urn:schemas-microsoft-com:HashTransforms.Identity" />
</dsig:Transforms>
<dsig:DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha256" />
<dsig:DigestValue>toS5Nrvy4jxxHWZSEUCKKGTHrgkeOXD3m0BSAkjfrGc=</dsig:DigestValue>
<dsig:DigestValue>NI82rRK4hN8G+dlsj6E4axYE3+U3W1R9CcBJuRQAL6E=</dsig:DigestValue>
</hash>
</dependentAssembly>
</dependency>
Expand Down Expand Up @@ -102,13 +102,13 @@
</hash>
</dependentAssembly>
</dependency>
<file name="Bomberman.exe.config" size="167">
<file name="Bomberman.exe.config" size="169">
<hash>
<dsig:Transforms>
<dsig:Transform Algorithm="urn:schemas-microsoft-com:HashTransforms.Identity" />
</dsig:Transforms>
<dsig:DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha256" />
<dsig:DigestValue>cm6x6fZ+09LS+qX1fNONKtui3fRFsn0UMpem5D/dNvs=</dsig:DigestValue>
<dsig:DigestValue>pXCaTkSdhdZK/ksNiEXvrqy/hr+wlOgzviND6k0ygHs=</dsig:DigestValue>
</hash>
</file>
<file name="favicon.ico" size="370070">
Expand Down
Binary file modified bin/Release/Bomberman.pdb
Binary file not shown.
Binary file modified bin/Release/app.publish/Bomberman.exe
Binary file not shown.
4 changes: 4 additions & 0 deletions obj/Debug/.NETFramework,Version=v4.8.1.AssemblyAttributes.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
// <autogenerated />
using System;
using System.Reflection;
[assembly: global::System.Runtime.Versioning.TargetFrameworkAttribute(".NETFramework,Version=v4.8.1", FrameworkDisplayName = ".NET Framework 4.8.1")]
4 changes: 2 additions & 2 deletions obj/Debug/Bomberman.application
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<description asmv2:publisher="Bomberman" asmv2:product="Bomberman" xmlns="urn:schemas-microsoft-com:asm.v1" />
<deployment install="true" mapFileExtensions="true" />
<compatibleFrameworks xmlns="urn:schemas-microsoft-com:clickonce.v2">
<framework targetVersion="4.6.1" profile="Full" supportedRuntime="4.0.30319" />
<framework targetVersion="4.8.1" profile="Full" supportedRuntime="4.0.30319" />
</compatibleFrameworks>
<dependency>
<dependentAssembly dependencyType="install" codebase="Bomberman.exe.manifest" size="6623">
Expand All @@ -14,7 +14,7 @@
<dsig:Transform Algorithm="urn:schemas-microsoft-com:HashTransforms.Identity" />
</dsig:Transforms>
<dsig:DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha256" />
<dsig:DigestValue>dDBHwjxR0H6lx3VCC8T/UbBSDnagZcdgE+03W7/NQMA=</dsig:DigestValue>
<dsig:DigestValue>ObLyLyPn81BBUqHiiimI2vJrZ0UUPF5BSi3Hc+59X80=</dsig:DigestValue>
</hash>
</dependentAssembly>
</dependency>
Expand Down
Binary file modified obj/Debug/Bomberman.csproj.AssemblyReference.cache
Binary file not shown.
2 changes: 1 addition & 1 deletion obj/Debug/Bomberman.csproj.CoreCompileInputs.cache
Original file line number Diff line number Diff line change
@@ -1 +1 @@
06d2610688cc4fa7148569a8c77db7106e100bd7
f6ab00cc7d0e86da19f02d3aead7ac94166122a5
1 change: 1 addition & 0 deletions obj/Debug/Bomberman.csproj.FileListAbsolute.txt
Original file line number Diff line number Diff line change
Expand Up @@ -76,3 +76,4 @@ C:\Users\miste\Documents\Projects\c#\vc#\src\Bomberman\obj\Debug\Bomberman.exe.m
C:\Users\miste\Documents\Projects\c#\vc#\src\Bomberman\obj\Debug\Bomberman.application
C:\Users\miste\Documents\Projects\c#\vc#\src\Bomberman\obj\Debug\Bomberman.exe
C:\Users\miste\Documents\Projects\c#\vc#\src\Bomberman\obj\Debug\Bomberman.pdb
C:\Users\miste\Documents\Projects\c#\vc#\src\Bomberman\obj\Debug\Bomberman.csproj.SuggestedBindingRedirects.cache
Binary file modified obj/Debug/Bomberman.csproj.GenerateResource.cache
Binary file not shown.
Empty file.
Binary file modified obj/Debug/Bomberman.exe
Binary file not shown.
8 changes: 4 additions & 4 deletions obj/Debug/Bomberman.exe.manifest
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@
<dsig:Transform Algorithm="urn:schemas-microsoft-com:HashTransforms.Identity" />
</dsig:Transforms>
<dsig:DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha256" />
<dsig:DigestValue>MnXPThdsSRXecja8it0uZb7CTwT1gFf192pyPh6WQGA=</dsig:DigestValue>
<dsig:DigestValue>LzRcvh4+HQl5JOGD1DXKaXoEQmO+5IeAKnW2WrT0vEw=</dsig:DigestValue>
</hash>
</dependentAssembly>
</dependency>
Expand All @@ -98,17 +98,17 @@
<dsig:Transform Algorithm="urn:schemas-microsoft-com:HashTransforms.Identity" />
</dsig:Transforms>
<dsig:DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha256" />
<dsig:DigestValue>y+ZHPeLOTUqRolRdOp9S7oLGy/csTcmAULKKVZdbtOY=</dsig:DigestValue>
<dsig:DigestValue>flWtlTEFiVx/iNePKdzorBfS+IElaX+9tfaleyjOv84=</dsig:DigestValue>
</hash>
</dependentAssembly>
</dependency>
<file name="Bomberman.exe.config" size="167">
<file name="Bomberman.exe.config" size="169">
<hash>
<dsig:Transforms>
<dsig:Transform Algorithm="urn:schemas-microsoft-com:HashTransforms.Identity" />
</dsig:Transforms>
<dsig:DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha256" />
<dsig:DigestValue>cm6x6fZ+09LS+qX1fNONKtui3fRFsn0UMpem5D/dNvs=</dsig:DigestValue>
<dsig:DigestValue>pXCaTkSdhdZK/ksNiEXvrqy/hr+wlOgzviND6k0ygHs=</dsig:DigestValue>
</hash>
</file>
<file name="favicon.ico" size="370070">
Expand Down
Binary file modified obj/Debug/Bomberman.pdb
Binary file not shown.
Binary file modified obj/Debug/Interop.WMPLib.dll
Binary file not shown.
Binary file modified obj/Debug/TempPE/Properties.Resources.Designer.cs.dll
Binary file not shown.
4 changes: 2 additions & 2 deletions obj/Release/Bomberman.application
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<description asmv2:publisher="Bomberman" asmv2:product="Bomberman" xmlns="urn:schemas-microsoft-com:asm.v1" />
<deployment install="true" mapFileExtensions="true" />
<compatibleFrameworks xmlns="urn:schemas-microsoft-com:clickonce.v2">
<framework targetVersion="4.6.1" profile="Full" supportedRuntime="4.0.30319" />
<framework targetVersion="4.8.1" profile="Full" supportedRuntime="4.0.30319" />
</compatibleFrameworks>
<dependency>
<dependentAssembly dependencyType="install" codebase="Bomberman.exe.manifest" size="6623">
Expand All @@ -14,7 +14,7 @@
<dsig:Transform Algorithm="urn:schemas-microsoft-com:HashTransforms.Identity" />
</dsig:Transforms>
<dsig:DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha256" />
<dsig:DigestValue>3Qymqz1C8L1jjKclAo3PuKsYJfYFBzDl2MIlJQWXvh0=</dsig:DigestValue>
<dsig:DigestValue>e16Rbl2ZN21o4fBh9BzpQMQu39nVTMXGIWodEC+Q56k=</dsig:DigestValue>
</hash>
</dependentAssembly>
</dependency>
Expand Down
2 changes: 1 addition & 1 deletion obj/Release/Bomberman.csproj.CoreCompileInputs.cache
Original file line number Diff line number Diff line change
@@ -1 +1 @@
b751e96d51ef424ecc01d4acc5bb90662a916e95
1f4d7371a378d11abb3d921e9b4b762a73eabdc7
1 change: 1 addition & 0 deletions obj/Release/Bomberman.csproj.FileListAbsolute.txt
Original file line number Diff line number Diff line change
Expand Up @@ -49,3 +49,4 @@ C:\Users\miste\Documents\Projects\c#\vc#\src\Bomberman\obj\Release\Bomberman.exe
C:\Users\miste\Documents\Projects\c#\vc#\src\Bomberman\obj\Release\Bomberman.application
C:\Users\miste\Documents\Projects\c#\vc#\src\Bomberman\obj\Release\Bomberman.exe
C:\Users\miste\Documents\Projects\c#\vc#\src\Bomberman\obj\Release\Bomberman.pdb
C:\Users\miste\Documents\Projects\c#\vc#\src\Bomberman\obj\Release\Bomberman.csproj.SuggestedBindingRedirects.cache
Empty file.
Binary file modified obj/Release/Bomberman.exe
Binary file not shown.
6 changes: 3 additions & 3 deletions obj/Release/Bomberman.exe.manifest
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@
<dsig:Transform Algorithm="urn:schemas-microsoft-com:HashTransforms.Identity" />
</dsig:Transforms>
<dsig:DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha256" />
<dsig:DigestValue>toS5Nrvy4jxxHWZSEUCKKGTHrgkeOXD3m0BSAkjfrGc=</dsig:DigestValue>
<dsig:DigestValue>NI82rRK4hN8G+dlsj6E4axYE3+U3W1R9CcBJuRQAL6E=</dsig:DigestValue>
</hash>
</dependentAssembly>
</dependency>
Expand Down Expand Up @@ -102,13 +102,13 @@
</hash>
</dependentAssembly>
</dependency>
<file name="Bomberman.exe.config" size="167">
<file name="Bomberman.exe.config" size="169">
<hash>
<dsig:Transforms>
<dsig:Transform Algorithm="urn:schemas-microsoft-com:HashTransforms.Identity" />
</dsig:Transforms>
<dsig:DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha256" />
<dsig:DigestValue>cm6x6fZ+09LS+qX1fNONKtui3fRFsn0UMpem5D/dNvs=</dsig:DigestValue>
<dsig:DigestValue>pXCaTkSdhdZK/ksNiEXvrqy/hr+wlOgzviND6k0ygHs=</dsig:DigestValue>
</hash>
</file>
<file name="favicon.ico" size="370070">
Expand Down
Binary file modified obj/Release/Bomberman.pdb
Binary file not shown.

0 comments on commit 4eaf0b4

Please sign in to comment.