-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtest.js
More file actions
14 lines (11 loc) · 682 Bytes
/
test.js
File metadata and controls
14 lines (11 loc) · 682 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
const ManyItems = require('./dist/index');
const player = new ManyItems.BasicItem('Player', 'player')
.addFeature(new ManyItems.features.XP()
.setHook((f, i) => console.log(`${f.name} is being applied to ${i.name}!`))
.setGainHook((amt, xp) => console.log(`${player.name}'s new XP amount is ${amt}, from ${xp.xp} - ^${amt - xp.xp} - [${xp.xp}/${xp.currentLevelMax}]`))
.setLevelCheck(xp => xp.xp >= xp.currentLevelMax)
.setLevelHook((tl, xp) => console.log(`${player.name}'s new level is ${xp.level}!`))
);
console.log(player.xp);
//for (i=1;i<21;i++) {console.log(i, player.xp.levelAlgorithm(i));}
for (i=1;i<21;i++) {player.xp.xp += 10;}