mirror of
https://github.com/ddnet/ddnet.git
synced 2024-09-20 01:24:18 +00:00
added the rifle to the maps and removed it from the starting inventory
This commit is contained in:
parent
45a047ce47
commit
48d4aa0e89
Binary file not shown.
Before Width: | Height: | Size: 72 KiB After Width: | Height: | Size: 78 KiB |
Binary file not shown.
Binary file not shown.
|
@ -404,7 +404,7 @@ weapons {
|
|||
nummuzzlesprites 3
|
||||
muzzleoffsetx 0.0
|
||||
muzzleoffsety 0.0
|
||||
maxammo 10
|
||||
maxammo 5
|
||||
recoil 10
|
||||
firedelay 800
|
||||
muzzleduration 0
|
||||
|
|
|
@ -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++)
|
||||
|
|
|
@ -38,6 +38,7 @@ enum
|
|||
ENTITY_WEAPON_SHOTGUN,
|
||||
ENTITY_WEAPON_GRENADE,
|
||||
ENTITY_POWERUP_NINJA,
|
||||
ENTITY_WEAPON_RIFLE,
|
||||
NUM_ENTITIES,
|
||||
|
||||
TILE_AIR=0,
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue