- Cycle through all available weapons
- Ensure phone orientation is fixed landscape
This commit is contained in:
Simon 2016-05-27 21:25:02 +01:00
parent 7fa8ea10f4
commit 5387a360b9
8 changed files with 25 additions and 20 deletions

View file

@ -7,8 +7,8 @@ android {
applicationId "com.drbeef.dvr"
minSdkVersion 16
targetSdkVersion 19
versionCode 3
versionName '1.0.2'
versionCode 6
versionName '1.0.5'
}
buildTypes {
release {

View file

@ -155,58 +155,64 @@ int weapon_preferences[2][NUMWEAPONS+1] = {
int P_SwitchWeapon(player_t *player)
{
int *prefer = weapon_preferences[demo_compatibility!=0]; // killough 3/22/98
int prefer = player->readyweapon;//weapon_preferences[demo_compatibility!=0]; // killough 3/22/98
int currentweapon = player->readyweapon;
int newweapon = currentweapon;
int i = NUMWEAPONS+1; // killough 5/2/98
// killough 2/8/98: follow preferences and fix BFG/SSG bugs
do
switch (*prefer++)
{
//SB: Change to cycle through all (available) weapons
do {
if (++prefer == NUMWEAPONS+1)
{
prefer = 0;
}
switch (prefer) {
case 1:
if (!player->powers[pw_strength]) // allow chainsaw override
break;
case 0:
newweapon = wp_fist;
break;
break;
case 2:
if (player->ammo[am_clip])
newweapon = wp_pistol;
break;
break;
case 3:
if (player->weaponowned[wp_shotgun] && player->ammo[am_shell])
newweapon = wp_shotgun;
break;
break;
case 4:
if (player->weaponowned[wp_chaingun] && player->ammo[am_clip])
newweapon = wp_chaingun;
break;
break;
case 5:
if (player->weaponowned[wp_missile] && player->ammo[am_misl])
newweapon = wp_missile;
break;
break;
case 6:
if (player->weaponowned[wp_plasma] && player->ammo[am_cell] &&
gamemode != shareware)
gamemode != shareware)
newweapon = wp_plasma;
break;
break;
case 7:
if (player->weaponowned[wp_bfg] && gamemode != shareware &&
player->ammo[am_cell] >= (demo_compatibility ? 41 : 40))
player->ammo[am_cell] >= (demo_compatibility ? 41 : 40))
newweapon = wp_bfg;
break;
break;
case 8:
if (player->weaponowned[wp_chainsaw])
newweapon = wp_chainsaw;
break;
break;
case 9:
if (player->weaponowned[wp_supershotgun] && gamemode == commercial &&
player->ammo[am_shell] >= (demo_compatibility ? 3 : 2))
player->ammo[am_shell] >= (demo_compatibility ? 3 : 2))
newweapon = wp_supershotgun;
break;
}
break;
}
}
while (newweapon==currentweapon && --i); // killough 5/2/98
return newweapon;
}

View file

@ -161,7 +161,6 @@ public class MainActivity
getWindow().addFlags(WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON);
requestWindowFeature(Window.FEATURE_NO_TITLE);
setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_SENSOR_LANDSCAPE);
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.5 KiB

After

Width:  |  Height:  |  Size: 5.4 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2 KiB

After

Width:  |  Height:  |  Size: 2.9 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 5.4 KiB

After

Width:  |  Height:  |  Size: 8.8 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 10 KiB

After

Width:  |  Height:  |  Size: 18 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 17 KiB

After

Width:  |  Height:  |  Size: 30 KiB