TEXT* inventory[20];
TEXT* tempTxt = {
string ("");
}
var inventorySell[20];
TEXT* namess[20];
var tempNum = 1;
function addInv(STRING* itemName,itemAtk, itemDef, itemSell){
if(inventorySell[20] == 0){
var i = 0;
while(i<20){
if(inventorySell[i] == 0){
str_cpy( ((tempTxt.pstring)[0]) , itemName);
str_cat( ((tempTxt.pstring)[0]), " [");
if(itemAtk) str_cat_num( ((tempTxt.pstring)[0]),"%.0f", itemAtk);
if(itemDef) str_cat_num( ((tempTxt.pstring)[0]),"%.0f", itemDef);
str_cat( ((tempTxt.pstring)[0]), "]");
((inventory[i].pstring)[0]) = ((tempTxt.pstring)[0]);
inventorySell[i] = itemSell;
return;
}
i++;
}
}
return;
}
function main(){
video_mode = 7;
var i;
for(i = 0;i<20;i++){
inventory[i] = txt_create(1,20);
(inventory[i])->pos_x = 630;
(inventory[i])->pos_y = 100+(i*10);
(inventory[i])->flags = VISIBLE;
((inventory[i])->pstring)[0] = "";
}
namess[1] = txt_create(1,20);
((namess[1])->pstring)[0] = "name1";
namess[2] = txt_create(1,20);
((namess[2])->pstring)[0] = "name2";
namess[3] = txt_create(1,20);
((namess[3])->pstring)[0] = "name3";
namess[4] = txt_create(1,20);
((namess[4])->pstring)[0] = "name4";
namess[5] = txt_create(1,20);
((namess[5])->pstring)[0] = "name5";
while(1){
if(key_space){addInv(((namess[tempNum])->pstring)[0],2+integer(random(3)),0,1);wait(-0.5);tempNum++;}
wait(1);
}
}