#TW reload discussion
1 messages · Page 1 of 1 (latest)
Where I am running into issues is trying to impact the PPE pool of the wielder, and that TW items take different ppe costs to reload.
You want to automate PPE deduction?
I have a dragon juicer who has a TW sub machine gun. His item takes 3 ppe to reload the 40 shots of the gun. Its not one to one. I am not sure the system could do this with out a script. Maybe a reload macro?
And just manually deducting the 3 PPE is too difficult?
I dont think it is but it doesn't line up with the rest of the range weapons reload setup. I think it's more of an expectation.
Fair.
So is there two issues? One is reload should be a single item that adds back 40 shots
And two, that action should cost 3 PPE?
That is the basics, some TW items cost less and a couple cost more so any kind of solution would need to be adjustable. I think Ill reach out to see if I can get some help in Macro Polo.
Yeah let me know what you find out
it's a little too hard coded at the moment but it works
Holy... you are awesome! is that a Macro?
yeah
it has a little bit of rough edges you have to configure yourself
the biggest one being the powerpoints type
//
// Updated and expanded from Recharge Item Macro by Stendarpaval Foundry v0.7.9
//
//
// Configure target actor and item.
const actorPC = game.actors.getName("Burster");
const targetItem = actorPC.items.getName("TK Submachine Gun");
const rechargeCost = 3
const arcane = "Psionics"
const ppName = "ISP"
// Get Other Needed Variables
const itemCurrent = targetItem.system.currentShots;
const itemMax = targetItem.system.shots;
const ppType = actorPC.system.powerPoints.Psionics.value
const reducePP = ppType - rechargeCost
//
//
//
if (itemCurrent == itemMax) {
ui.notifications.warn("Your " + targetItem.name + " already has all of its " + itemMax + " charges!");
return;
};
new Dialog({
title: "Recharge Item",
content: '<form id="recharge-item" class="dialog-content"><p>Your ' + targetItem.name + ' currently has ' + itemCurrent + ' out of ' + itemMax + ' charges.</p><p>Do you want to recharge it?</p></form>',
buttons: {
one: {
label: "Recharge",
callback: () => {
let update = {"_id": targetItem._id, "system.currentShots": itemMax};
let updatePP = { "_id": actorPC._id, [`system.powerPoints.${arcane}.value`]: reducePP };
targetItem.update(update);
actorPC.update(updatePP)
sendChatMessage(actorPC.name + " has recharged " + targetItem.name + " and spent " + rechargeCost + " " + ppName);
}
},
two: {
label: "Cancel",
}
}
}).render(true);
function sendChatMessage(text) {
let chatData = {
// user: game.user.id,
// speaker: game.user,
content: text,
//whisper: game.users.entities.filter(u => u.isGM).map(u => u._id)
};
ChatMessage.create(chatData,{});
}
you need to change the variables under // Configure target actor and item.
kick ass John! this will totally work. In my game its a pretty single use case but I can set this up for anyone who is using a TW range weapon.
Thank you very much!
one other thing, where do I change labels for PP to PPE and ISP in the system? everything still comes out as PP.
that, unfortunately, is more difficult
ah, I see it is just a label change in the macro, not within the character sheets. I am gtg.
yeah, not strcitly necessary but thought it would be good to localize it to Rifts
Also need to change "const ppType = actorPC.system.powerPoints.Psionics.value" to .Magic.value if PPE is involved.
You can also put macro links in the note section of an Item. very cool
Oh yeah, missed that one, we can probably change that so "Psionics" is replaced with ${arcane} that way you only have to change the arcane variable.
but have to work out the kinks
this should work
//
// Updated and expanded by Venatus Vinco for Rifts for Savage Worlds on Foundry v10x
// from Recharge Item Macro by Stendarpaval Foundry v0.7.9
//
// Configure target actor and item. Edit these as needed.
const actorPC = game.actors.getName("Burster");
const targetItem = actorPC.items.getName("TK Submachine Gun");
const rechargeCost = 3;
const arcane = "Psionics";
const ppName = "ISP";
// Get Other Needed Variables. Do not edit.
const itemCurrent = targetItem.system.currentShots;
const itemMax = targetItem.system.shots;
const ppType = actorPC.system.powerPoints[arcane].value;
const reducePP = ppType - rechargeCost;
//
//
//
if (itemCurrent == itemMax) {
ui.notifications.warn("Your " + targetItem.name + " already has all of its " + itemMax + " charges!");
return;
};
new Dialog({
title: "Recharge Item",
content: '<form id="recharge-item" class="dialog-content"><p>Your ' + targetItem.name + ' currently has ' + itemCurrent + ' out of ' + itemMax + ' charges.</p><p>Do you want to recharge it?</p></form>',
buttons: {
one: {
label: "Recharge",
callback: () => {
let update = {"_id": targetItem._id, "system.currentShots": itemMax};
let updatePP = { "_id": actorPC._id, [`system.powerPoints.${arcane}.value`]: reducePP };
targetItem.update(update);
actorPC.update(updatePP)
sendChatMessage(actorPC.name + " has recharged " + targetItem.name + " and spent " + rechargeCost + " " + ppName);
}
},
two: {
label: "Cancel",
}
}
}).render(true);
function sendChatMessage(text) {
let chatData = {
// user: game.user.id,
// speaker: game.user,
content: text,
//whisper: game.users.entities.filter(u => u.isGM).map(u => u._id)
};
ChatMessage.create(chatData,{});
}
Nothing major here but tweaked some of the notifications and stuff for cleaner language. Same functionality.