diff --git a/lang/en.json b/lang/en.json index 0dcec2b..2ba8afc 100644 --- a/lang/en.json +++ b/lang/en.json @@ -36,6 +36,7 @@ }, "Messages": { "HandItemAdded": "Golpe desarmado adicionado as suas coisas.", + "Rolling": "Rolando {ability}", "SelectWeaponLimitExceeded": "Você só pode usar 2 armas simultaneamente." }, "Mutation": { @@ -129,7 +130,8 @@ "SpecialActivities": "Atividades Especiais", "Traits": "Traços", "Type": "Tipo", - "Upgrades": "Aprimoramentos" + "Upgrades": "Aprimoramentos", + "Weight": "Carga" }, "Statuses": { "Blinded": { "long": "Cego", "abbr": "" }, diff --git a/lang/pt-BR.json b/lang/pt-BR.json index 0dcec2b..2ba8afc 100644 --- a/lang/pt-BR.json +++ b/lang/pt-BR.json @@ -36,6 +36,7 @@ }, "Messages": { "HandItemAdded": "Golpe desarmado adicionado as suas coisas.", + "Rolling": "Rolando {ability}", "SelectWeaponLimitExceeded": "Você só pode usar 2 armas simultaneamente." }, "Mutation": { @@ -129,7 +130,8 @@ "SpecialActivities": "Atividades Especiais", "Traits": "Traços", "Type": "Tipo", - "Upgrades": "Aprimoramentos" + "Upgrades": "Aprimoramentos", + "Weight": "Carga" }, "Statuses": { "Blinded": { "long": "Cego", "abbr": "" }, diff --git a/module/data/actor-vehicle.mjs b/module/data/actor-vehicle.mjs index 2bd63c6..73e36c0 100644 --- a/module/data/actor-vehicle.mjs +++ b/module/data/actor-vehicle.mjs @@ -26,7 +26,6 @@ export default class Punkapocalypticvehicle extends PunkapocalypticActorBase { //alert("fuel") obj[ability].fields.fuelEfficiency = new fields.NumberField({ ...requiredInteger, initial: 0, min: 0 }); } - console.warn(obj); return obj; }, {})); diff --git a/module/documents/actor.mjs b/module/documents/actor.mjs index f29bee3..aa306b4 100644 --- a/module/documents/actor.mjs +++ b/module/documents/actor.mjs @@ -12,6 +12,55 @@ export class PunkapocalypticActor extends Actor { super.prepareData(); } + /** + * Prepare derived data for vehicles. + */ + async vehiclePrepareDerivedData() { + const actorData = this; + actorData.system.defense.current = actorData.system.defense.base + actorData.system.speed.current; + actorData.system.abilities.hands.value = 0; + if (actorData.system.speed.current > 0) { + actorData.system.abilities.muscles.value = 10 + actorData.system.speed.current; + actorData.system.abilities.feet.value = 10 + actorData.system.speed.current; + } else { + actorData.system.abilities.muscles.value = 0; + actorData.system.abilities.feet.value = 0; + } + const driver = actorData.system.occupants.find(i => i.driver); + if (driver) { + const actordriver = await fromUuid(driver.uuid); + if (actordriver) { + actorData.system.abilities.hands.value = actordriver.system.abilities.hands.value - 5; + } + } + } + + /** + * Prepare derived data for characters. + */ + async characterPrepareDerivedData() { + const actorData = this; + // Calculate defense value + const defenseBase = actorData.system.defense.base; + const armorItems = actorData.items.filter(i => i.type === "armor" && i.system.equipped); + + if (armorItems.length > 0) { + const armor = armorItems[0]; // Using first equipped armor + actorData.system.defense.current = armor.system.isBonus + ? defenseBase + armor.system.defense + : armor.system.defense; + } else { + actorData.system.defense.current = defenseBase; + } + } + + /** + * Prepare derived data for NPCs. + */ + async npcPrepareDerivedData() { + const actorData = this; + } + /** * @override * Augment the actor source data with additional dynamic data that isn't @@ -21,42 +70,18 @@ export class PunkapocalypticActor extends Actor { */ async prepareDerivedData() { const actorData = this; - //if (actorData.type === 'npc') - - if (actorData.type === 'vehicle') { - actorData.system.defense.current = actorData.system.defense.base + actorData.system.speed.current; - actorData.system.abilities.hands.value = 0; - if (actorData.system.speed.current > 0) { - actorData.system.abilities.muscles.value = 10 + actorData.system.speed.current; - actorData.system.abilities.feet.value = 10 + actorData.system.speed.current; - } else { - actorData.system.abilities.muscles.value = 0; - actorData.system.abilities.feet.value = 0; - } - const driver = actorData.system.occupants.find(i => i.driver); - if (driver) { - const actordriver = await fromUuid(driver.uuid); - if (actordriver) { - console.warn("DRIVER",actordriver) - actorData.system.abilities.hands.value = actordriver.system.abilities.hands.value - 5; - } - } - console.warn("BVehicle driver hands: ", actorData.system.abilities.hands); - } else if (actorData.type === 'character') { - - // Calculate defense value - const defenseBase = actorData.system.defense.base; - const armorItems = actorData.items.filter(i => i.type === "armor" && i.system.equipped); - - if (armorItems.length > 0) { - const armor = armorItems[0]; // Using first equipped armor - actorData.system.defense.current = armor.system.isBonus - ? defenseBase + armor.system.defense - : armor.system.defense; - } else { - actorData.system.defense.current = defenseBase; - } + switch (actorData.type) { + case 'vehicle': + this.vehiclePrepareDerivedData(); + break; + case 'character': + this.characterPrepareDerivedData(); + break; + case 'npc': + this.npcPrepareDerivedData(); + break; } + for (const key in actorData.system.abilities) { // Calculate the modifier using d20 rules. actorData.system.abilities[key].mod = Math.floor((actorData.system.abilities[key].value - 10)); @@ -108,9 +133,10 @@ export class PunkapocalypticActor extends Actor { // Get localized ability name and prepare flavor text const label = game.i18n.localize(CONFIG.PUNKAPOCALYPTIC.abilities[id]); + const roll_message = game.i18n.localize("PUNKAPOCALYPTIC.Messages.Rolling", { ability: label }); const flavor = content || ` -
Rolando ${label}
`; +${roll_message}
`; // Roll the base ability check const baseRoll = await new Roll(`1d20+@abilities.${id}.mod`, actor.getRollData()).evaluate({ async: false }); diff --git a/module/helpers/config.mjs b/module/helpers/config.mjs index 1cd0231..f2bc275 100644 --- a/module/helpers/config.mjs +++ b/module/helpers/config.mjs @@ -288,7 +288,6 @@ PUNKAPOCALYPTIC.progress_function = (actor) => { const next_level = actor.system.missions + 1; const options = []; actor.update({ "system.missions": (next_level) }) - console.warn("progress for actor",actor); } PUNKAPOCALYPTIC.speedNeedle = { diff --git a/module/helpers/luck-tracker.mjs b/module/helpers/luck-tracker.mjs index 2d9962e..ab85389 100644 --- a/module/helpers/luck-tracker.mjs +++ b/module/helpers/luck-tracker.mjs @@ -35,8 +35,6 @@ export class TokenEffectsTracker extends Application { async getData() { let currentLuck = game.settings.get("punkapocalyptic", "groupLuck"); - - console.warn("Get DATA") let data = {}; if (game.user.isGM) { data.luck = { @@ -52,26 +50,26 @@ export class TokenEffectsTracker extends Application { } _prepareHelpDice(actor) { - console.warn("Get DATA") + } _prepareHeldAction(actor) { - console.warn("Get DATA") + } async _prepareTemporaryEffects(actor) { - console.warn("Get DATA") + } _mergeStackableConditions(effects) { - console.warn("Get DATA") + } async _statusObjects(statuses, effectName) { - console.warn("Get DATA") + } activateListeners(html) { diff --git a/module/sheets/actor-sheet.mjs b/module/sheets/actor-sheet.mjs index 4017776..270ee79 100644 --- a/module/sheets/actor-sheet.mjs +++ b/module/sheets/actor-sheet.mjs @@ -252,7 +252,6 @@ export class PunkapocalypticActorSheet extends ActorSheet { }); // Handle clicking the profile div to open FilePicker html.on('click', '.profile-img', (ev) => { - console.log() const fp = new FilePicker({ type: 'image', current: ev.currentTarget.dataset.img.replace(/^url\(["']?/, '').replace(/["']?\)$/, ''), @@ -487,7 +486,6 @@ export class PunkapocalypticActorSheet extends ActorSheet { } async _onDropItemCreate(itemData, event) { - console.warn("Item data", itemData); if (super._onDropItemCreate) { await super._onDropItemCreate(itemData, event); } @@ -557,7 +555,6 @@ export class PunkapocalypticActorSheet extends ActorSheet { // Check if there's something to update if (Object.keys(updatedResources).length > 0) { await this.actor.update(updatedResources); - console.log("Updated actor resources:", updatedResources); } else { console.log("No resources to update."); } diff --git a/module/sheets/item-sheet.mjs b/module/sheets/item-sheet.mjs index e0fa7d6..8a60ebc 100644 --- a/module/sheets/item-sheet.mjs +++ b/module/sheets/item-sheet.mjs @@ -203,8 +203,6 @@ export class PunkapocalypticItemSheet extends ItemSheet { const row = event.currentTarget.closest('li'); const uuid = row.dataset.itemUuid; const itemIds = this.item.system.itemIds || []; - console.warn("UID", uuid); - console.warn(itemIds); const index = itemIds.indexOf(uuid); if (index > -1) { itemIds.splice(index, 1); @@ -245,8 +243,6 @@ export class PunkapocalypticItemSheet extends ItemSheet { const pathDiceNum = rootPath + ".diceNum"; const pathDiceBonus = rootPath + ".diceBonus"; const pathDiceSize = rootPath + ".diceSize"; - console.warn("editItem", dataset, rootPath, pathDiceNum, pathDiceBonus, pathDiceSize); - console.warn("item", utils.getValueByPath(item, rootPath)); if (item.type == "weapon") { try { data = await foundry.applications.api.DialogV2.prompt({ @@ -293,8 +289,6 @@ export class PunkapocalypticItemSheet extends ItemSheet { console.error("Error parsing drop data:", err); return; } - - console.log("Dropped data:", data); if (!['background','path'].includes(this.item.type)) { return; } @@ -316,8 +310,6 @@ export class PunkapocalypticItemSheet extends ItemSheet { return; } - console.log(`Dropped item "${droppedItem.name}" with ID: ${droppedItem.id}`); - // Get the current list of item IDs and update let itemIds = foundry.utils.duplicate(this.item.system.itemIds || []); diff --git a/module/sheets/npc-sheet.mjs b/module/sheets/npc-sheet.mjs index d97347a..c4d5bc6 100644 --- a/module/sheets/npc-sheet.mjs +++ b/module/sheets/npc-sheet.mjs @@ -419,7 +419,6 @@ export class PunkapocalypticNPCSheet extends ActorSheet { const dataset = element.dataset; // Handle item rolls. - console.warn(dataset) if (dataset.rollType) { if (dataset.rollType == 'select-ammo') { const itemId = element.closest('.item').dataset.itemId; diff --git a/module/sheets/vehicle-sheet.mjs b/module/sheets/vehicle-sheet.mjs index 3604a54..ef458a1 100644 --- a/module/sheets/vehicle-sheet.mjs +++ b/module/sheets/vehicle-sheet.mjs @@ -217,7 +217,7 @@ export class PunkapocalypticVehicleSheet extends ActorSheet { context.actor.system.abilities[ability].tooltip = game.i18n.localize(`PUNKAPOCALYPTIC.Ability.${ability.capitalize()}.Tooltip`); context.actor.system.abilities[ability].img = CONFIG.PUNKAPOCALYPTIC.abilityImages[ability]; } - console.warn(context.actor.system.otherStatistics); + for (const statistic in context.actor.system.otherStatistics) { context.actor.system.otherStatistics[statistic] = context.actor.system.otherStatistics[statistic]; context.actor.system.otherStatistics[statistic].tooltip = game.i18n.localize(`PUNKAPOCALYPTIC.Vehicle.${statistic.capitalize()}.Tooltip`); @@ -288,7 +288,6 @@ export class PunkapocalypticVehicleSheet extends ActorSheet { } // Iterate through items, allocating to containers - console.warn(context.items) for (let i of context.items) { i.img = i.img || Item.DEFAULT_ICON; // Append to gear. @@ -493,14 +492,12 @@ export class PunkapocalypticVehicleSheet extends ActorSheet { */ async _onItemCreate(event) { event.preventDefault(); - console.warn("ADASDSD") const header = event.currentTarget; // Get the type of item to create. let type = header.dataset.type; if (type == 'item') { type = await this.chooseOption(); } - console.warn(type) // Grab any data associated with this control. const data = foundry.utils.duplicate(header.dataset); @@ -514,7 +511,6 @@ export class PunkapocalypticVehicleSheet extends ActorSheet { }; // Remove the type from the dataset since it's in the itemData.type prop. delete itemData.system['type']; - console.warn(itemData) // Finally, create the item! return await Item.create(itemData, { parent: this.actor }); } @@ -599,9 +595,6 @@ export class PunkapocalypticVehicleSheet extends ActorSheet { } const occupant = this.actor.system.occupants.find(o => o.uuid == dataset.itemId); if (occupant) { - console.warn(occupant); - - console.warn("NEW DRIVER"); occupant.driver = !occupant.driver; await this.actor.update({ "system.occupants": this.actor.system.occupants }); await this.actor.update({ "system.driver": occupant.driver }); @@ -625,7 +618,6 @@ export class PunkapocalypticVehicleSheet extends ActorSheet { if (user) { if (game.user.isGM) { - console.warn("GRANTING PERMISSION") await this.actor.update({ [`ownership.${user.id}`]: permissionLevel }); @@ -653,7 +645,6 @@ export class PunkapocalypticVehicleSheet extends ActorSheet { } if (user) { if (game.user.isGM) { - console.warn("GRANTING PERMISSION") await this.actor.update({ [`ownership.${user.id}`]: permissionLevel }); @@ -681,12 +672,10 @@ export class PunkapocalypticVehicleSheet extends ActorSheet { console.error("Error parsing drop data:", err); return; } - console.warn(data) if (data.type === "Item") { const item = await fromUuid(data.uuid); this._onDropItemCreate(item, event); } else { - console.warn(this.actor.system.otherStatistics.occupants) if (this.actor.system.otherStatistics.occupants.current == this.actor.system.otherStatistics.occupants.value) { ui.notifications.warn("Veículo cheio"); return; @@ -730,12 +719,9 @@ export class PunkapocalypticVehicleSheet extends ActorSheet { } } } - - console.log("Dropped data:", data); } async _onDropItemCreate(itemData, event) { - console.warn(itemData); if (!CONFIG.PUNKAPOCALYPTIC.VehicleSupportedItems.includes(itemData.type)) { ui.notifications.warn("Tipo de item não suportado por veículos"); return; diff --git a/templates/actor/parts/actor-background.hbs b/templates/actor/parts/actor-background.hbs index c7791c0..2758617 100644 --- a/templates/actor/parts/actor-background.hbs +++ b/templates/actor/parts/actor-background.hbs @@ -9,7 +9,7 @@ data-type='background' > - {{localize 'PUNKAPOCALYPTIC.NewItemMasc' type=(localize 'TYPES.Item.background') }} + {{!-- {{localize 'PUNKAPOCALYPTIC.NewItemMasc' type=(localize 'TYPES.Item.background') }} --}} diff --git a/templates/actor/parts/actor-benefits.hbs b/templates/actor/parts/actor-benefits.hbs index f7e689c..1482637 100644 --- a/templates/actor/parts/actor-benefits.hbs +++ b/templates/actor/parts/actor-benefits.hbs @@ -8,7 +8,7 @@ data-type='benefit' > - {{localize 'PUNKAPOCALYPTIC.NewItemMasc' type=(localize 'TYPES.Item.benefit') }} + {{!-- {{localize 'PUNKAPOCALYPTIC.NewItemMasc' type=(localize 'TYPES.Item.benefit') }} --}} diff --git a/templates/actor/parts/actor-category-item.hbs b/templates/actor/parts/actor-category-item.hbs index 9b4f38e..9fddd9b 100644 --- a/templates/actor/parts/actor-category-item.hbs +++ b/templates/actor/parts/actor-category-item.hbs @@ -21,7 +21,8 @@ title='{{localize "PUNKAPOCALYPTIC.CreateNewItemFem" type=(localize 'TYPES.Item.{{category}}')}}' data-type='{{category}}' > - {{localize 'PUNKAPOCALYPTIC.NewItemFem' type=(localize 'TYPES.Item.{{category}}') }} + + {{!-- {{localize 'PUNKAPOCALYPTIC.NewItemFem' type=(localize 'TYPES.Item.{{category}}') }} --}} diff --git a/templates/actor/parts/actor-effects.hbs b/templates/actor/parts/actor-effects.hbs index 9b5cd06..dd6dafa 100644 --- a/templates/actor/parts/actor-effects.hbs +++ b/templates/actor/parts/actor-effects.hbs @@ -6,7 +6,8 @@