Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //ideal code to run
- Crafting.createCombinedPart(user, user.data.characters[0].constructions.shield.parts[k].part , user.data.inventory.parts[i]);
- userActions.saveConstruction();
- // ideal code to run
- //long-winded method
- var combineItem = false;
- var x = user.data.characters[0].constructions.shield.parts[k].x;
- var y = user.data.characters[0].constructions.shield.parts[k].y;
- var inventoryID, shieldID;
- var shieldLength = user.data.characters[0].constructions.shield.parts.length - 1;
- var shieldList = user.data.characters[0].constructions.shield.parts;
- loop1:
- for(var a = 0; a < listLength; a++) {
- for(var b = 0; b < shieldLength; b++) {
- if(shieldList[b].part.type == inventoryList[a].type) {
- combineItem = true;
- inventoryID = inventoryList[a].id;
- shieldID = shieldList[b].part.id;
- break loop1;
- }
- }
- }
- if(combineItem) {
- var foo = inventoryLib.getPartById(shieldID);
- systemLog.push('<b class="rarity-' + part.quality + '-text"> ' + part.name + ' +' + ( part.plus) + '</b> <- <b class="rarity-' + foo.quality + '-text">' + foo.name + ' +' + ( foo.plus) + '</b>');
- craftingActions.setPrimary(foo, true);
- craftingActions.setConsumed(inventoryLib.getPartById(inventoryID), true);
- craftingActions.combine();
- craftingActions.update();
- Construction.addToSetup(shieldConstruction, foo, x, y);
- userActions.saveConstruction();
- }
- //long-winded method INCOMPLETE
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement