18 lines
566 B
JavaScript
18 lines
566 B
JavaScript
import ItemBuilder from "../../engine/builders/item";
|
|
import Item from "../../engine/item";
|
|
|
|
export default new ItemBuilder()
|
|
.withID("cup")
|
|
.withName("a cup")
|
|
.withDescription("A standard coffee cup")
|
|
.isTakeable(true)
|
|
.isUsable(true)
|
|
.withUseCallback((context) => {
|
|
const item = context.getItem("cup");
|
|
const cloned = item.clone();
|
|
cloned.name = 'A cloned cup';
|
|
console.log(cloned);
|
|
context.player.addItem(cloned.dynamicID);
|
|
context.print("You touch the cup and a new one somehow appears in your inventory.");
|
|
})
|
|
.create(); |