|
|
|
@ -7,12 +7,12 @@ |
|
|
|
|
#include <zombies.h> |
|
|
|
|
|
|
|
|
|
void addItem(char *type, int yPos, int xPos){ |
|
|
|
|
if(!strcmp(type,"Pistol Magazine")){ |
|
|
|
|
struct Item pistolMag = {.type="Pistol Magazine", .symbol='=', .isAlive=1, .curXpos=xPos, .curYpos=yPos}; |
|
|
|
|
if(!strcmp(type,"Pistol")){ |
|
|
|
|
struct Item pistolItem = {.type="Pistol", .symbol='p', .isAlive=1, .curXpos=xPos, .curYpos=yPos}; |
|
|
|
|
int i; |
|
|
|
|
for (i=0;i<MAX_ITEMS;i++){ |
|
|
|
|
if(!allItems[i].isAlive){ |
|
|
|
|
allItems[i]=pistolMag; |
|
|
|
|
allItems[i]=pistolItem; |
|
|
|
|
break; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
@ -23,7 +23,7 @@ void tryRandomEvent(){ |
|
|
|
|
int eventTrigger = (rand()%100)+1; |
|
|
|
|
if (eventTrigger < 15+itemModifier){ |
|
|
|
|
struct OpenPos openPos = getOpenPos(); |
|
|
|
|
addItem("Pistol Magazine", openPos.y, openPos.x);
|
|
|
|
|
addItem("Pistol", openPos.y, openPos.x);
|
|
|
|
|
} |
|
|
|
|
if (eventTrigger < 1+zombieModifier){
|
|
|
|
|
struct OpenPos openPos = getOpenPos(); |
|
|
|
|