Merchants: Difference between revisions

Jump to navigation Jump to search
104 bytes added ,  02:28, 26 August 2021
m
update color of math formulas from black to white
No edit summary
m (update color of math formulas from black to white)
Tag: Reverted
Line 18: Line 18:
When the merchant is first created, LastRestock tick is set to
When the merchant is first created, LastRestock tick is set to


<math>\text{LastRestockTick} = \text{TickOnCreation} + \text{Random}( \frac{RestockFrequency}{2}, RestockFrequency)</math>
<math>\color{White}\text{LastRestockTick} = \text{TickOnCreation} + \text{Random}( \frac{RestockFrequency}{2}, RestockFrequency)</math>


which substitutes to
which substitutes to


<math>\text{LastRestockTick} = \text{TickOnCreation} + \text{Random}(3000, 6000)</math>
<math>\color{White}\text{LastRestockTick} = \text{TickOnCreation} + \text{Random}(3000, 6000)</math>


Every EndTurn, this is called:
Every EndTurn, this is called:
Line 28: Line 28:
If the current in game turn count-LastRestockTick is greater than RestockFrequency, LastRestockTick is set to equal the current GameTick.  
If the current in game turn count-LastRestockTick is greater than RestockFrequency, LastRestockTick is set to equal the current GameTick.  


<math>\text{num1} = \text{InGameTurn} - \text{LastRestockTick} \ge 6000</math> <math>\rightarrow</math>
<math>\color{White}\text{num1} = \text{InGameTurn} - \text{LastRestockTick} \ge 6000</math> <math>\color{White}\rightarrow</math>


<math>\text{RestockCheck} = \frac { \text{71}}{6000} \times \text{num1} </math>
<math>\color{White}\text{RestockCheck} = \frac { \text{71}}{6000} \times \text{num1} </math>
<math>\rightarrow</math>
<math>\color{White}\rightarrow</math>


If <math>\text{RestockCheck} \ge 100</math> or <math>\text{RestockCheck} \ge \text{Random}(1,100)</math>,
If <math>\color{White}\text{RestockCheck} \ge 100</math> or <math>\color{White}\text{RestockCheck} \ge \text{Random}(1,100)</math>,


the merchant will restock. This means that about 8450-8451 turns (a little more over an ingame week) after the last restock must pass in order to guarantee a restock. The earliest that a merchant can restock is 6,000 turns, with a 71% chance of restocking, or 9,000 turns at a 100% restock if this is the first time the merchant restocks.
the merchant will restock. This means that about 8450-8451 turns (a little more over an ingame week) after the last restock must pass in order to guarantee a restock. The earliest that a merchant can restock is 6,000 turns, with a 71% chance of restocking, or 9,000 turns at a 100% restock if this is the first time the merchant restocks.

Navigation menu