Widget:PriceCalculator: Difference between revisions

From bg3.wiki
Jump to navigation Jump to search
(perfection)
(truncate numbers, add tablestyle)
Line 60: Line 60:
          
          
         let price_mod = Math.max(1.0, 2.5 - persuasion_mod - attitude - difficulty);
         let price_mod = Math.max(1.0, 2.5 - persuasion_mod - attitude - difficulty);
         let price_buy = item_value * price_mod;
         let price_buy = Math.floor(item_value * price_mod);
         let price_sell = item_value / price_mod;
         let price_sell = Math.floor(item_value / price_mod);
 
        console.log(`persuasion mod ${persuasion_mod} attitude mod ${attitude} difficulty mod ${difficulty}`)
 
         output.textContent = '';
         output.textContent = '';
         let table = document.createElement('table');
         let table = document.createElement('table');
        table.classList.add('wikitable');
         table.appendChild(create_output_row('Base item price', item_value));
         table.appendChild(create_output_row('Base item price', item_value));
         table.appendChild(create_output_row('Item price when selling to a trader', price_sell));
         table.appendChild(create_output_row('Item price when selling to a trader', price_sell));

Revision as of 18:05, 4 October 2023