added the rifle to the maps and removed it from the starting inventory

This commit is contained in:
Magnus Auvinen 2008-03-21 19:05:35 +00:00
parent 45a047ce47
commit 48d4aa0e89
8 changed files with 13 additions and 7 deletions

Binary file not shown.

Before

Width:  |  Height:  |  Size: 72 KiB

After

Width:  |  Height:  |  Size: 78 KiB

Binary file not shown.

Binary file not shown.

View file

@ -404,7 +404,7 @@ weapons {
nummuzzlesprites 3
muzzleoffsetx 0.0
muzzleoffsety 0.0
maxammo 10
maxammo 5
recoil 10
firedelay 800
muzzleduration 0

View file

@ -145,8 +145,8 @@ void LAYER_TILES::brush_flip_x()
for(int x = 0; x < width/2; x++)
{
TILE tmp = tiles[y*width+x];
tiles[y*width+x] = tiles[y*width+x+width-1-x];
tiles[y*width+x+width-1-x] = tmp;
tiles[y*width+x] = tiles[y*width+width-1-x];
tiles[y*width+width-1-x] = tmp;
}
for(int y = 0; y < height; y++)

View file

@ -38,6 +38,7 @@ enum
ENTITY_WEAPON_SHOTGUN,
ENTITY_WEAPON_GRENADE,
ENTITY_POWERUP_NINJA,
ENTITY_WEAPON_RIFLE,
NUM_ENTITIES,
TILE_AIR=0,

View file

@ -65,6 +65,11 @@ bool gameobject::on_entity(int index, vec2 pos)
type = POWERUP_WEAPON;
subtype = WEAPON_GRENADE;
}
else if(index == ENTITY_WEAPON_RIFLE)
{
type = POWERUP_WEAPON;
subtype = WEAPON_RIFLE;
}
else if(index == ENTITY_POWERUP_NINJA)
{
type = POWERUP_NINJA;

View file

@ -854,8 +854,8 @@ void player::try_respawn()
weapons[WEAPON_GUN].got = true;
weapons[WEAPON_GUN].ammo = data->weapons[WEAPON_GUN].maxammo;
weapons[WEAPON_RIFLE].got = true;
weapons[WEAPON_RIFLE].ammo = -1;
/*weapons[WEAPON_RIFLE].got = true;
weapons[WEAPON_RIFLE].ammo = -1;*/
active_weapon = WEAPON_GUN;
last_weapon = WEAPON_HAMMER;
@ -1648,10 +1648,10 @@ void powerup::tick()
case POWERUP_WEAPON:
if(subtype >= 0 && subtype < NUM_WEAPONS)
{
if(pplayer->weapons[subtype].ammo < 10 || !pplayer->weapons[subtype].got)
if(pplayer->weapons[subtype].ammo < data->weapons[subtype].maxammo || !pplayer->weapons[subtype].got)
{
pplayer->weapons[subtype].got = true;
pplayer->weapons[subtype].ammo = min(10, pplayer->weapons[subtype].ammo + data->powerupinfo[type].amount);
pplayer->weapons[subtype].ammo = min(data->weapons[subtype].maxammo, pplayer->weapons[subtype].ammo + data->powerupinfo[type].amount);
respawntime = data->powerupinfo[type].respawntime;
// TODO: data compiler should take care of stuff like this