Widget:PriceCalculator: Difference between revisions

From bg3.wiki
Jump to navigation Jump to search
(Adjust defaults)
(logging for deubg)
Line 2: Line 2:
<table id="bg3wiki-price-calculator-form">
<table id="bg3wiki-price-calculator-form">
     <tr>
     <tr>
         <th><label for="item-value">Item value</label></th><td><input type="number" id="item-value" size="6" value="1000"/></td>
         <th><label for="item-value">Item value</label></th><td><input type="number" id="item-value" size="7" value="1000"/></td>
     </tr>
     </tr>
     <tr>
     <tr>
Line 57: Line 57:
         let attitude = sanitize(get_value('#attitude')) * 0.025;
         let attitude = sanitize(get_value('#attitude')) * 0.025;
         let difficulty = document.querySelectorAll('input[name="difficulty"]:checked').value;
         let difficulty = document.querySelectorAll('input[name="difficulty"]:checked').value;
        difficulty = get_difficulty_mod(difficulty)
          
          
         let price_mod = Math.max(1.0, 2.5 - persuasion_mod - attitude - get_difficulty_mod(difficulty));
         let price_mod = Math.max(1.0, 2.5 - persuasion_mod - attitude - difficulty);
         let price_buy = item_value * price_mod;
         let price_buy = item_value * price_mod;
         let price_sell = item_value / price_mod;
         let price_sell = item_value / price_mod;
        console.log(`persuasion mod ${persuasion_mod} attitude mod ${attitude} difficulty mod ${difficulty}`)


         output.textContent = '';
         output.textContent = '';

Revision as of 17:53, 4 October 2023