Pawtang / roguelike

8 stars 2 forks source link

Item stat boost implementation #13

Closed Pawtang closed 5 years ago

Pawtang commented 5 years ago

player.items = [sword,shield,potion,potion]

UI: Potions: 2

add permanent stat boost when item is in inventory:

something like this:

swordCount = () => {
  for (i=0; i<player.items.length; i++)
  if (player.items.name[i] == 'sword' {
    swordCount++;
    }
}

player.attack += (10*swordCount);

similar for all other stats

can we handle potions in the same way? sure we can, and we should.