Skip to content

Instantly share code, notes, and snippets.

@dancodan
Last active March 12, 2018 14:55
Show Gist options
  • Select an option

  • Save dancodan/372d2be689208b79fbb873b78b2df452 to your computer and use it in GitHub Desktop.

Select an option

Save dancodan/372d2be689208b79fbb873b78b2df452 to your computer and use it in GitHub Desktop.
This is where I store all stolen goods
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
weather = function()
var temp_tracker_winter; //Added a variable to keep track of temperature
var temp_tracker_summer
var temp_tracker_autumn
var temp_tracker_spring
var basetemp_winter === -30; //These are the base temperatures, we will add a random d20 to these numbers for each season
var basetemp_summer === +15;
var basetemp_autumn === 0;
var basetemp_spring === 0;
var maxtemp_winter === 5; //This is the highest the temperature is allowed to get during this season
var maxtemp_summer === 50;
var maxtemp_autumn === 25;
var maxtemp_spring === 30;
var lowtemp_winter === -50; //This is the lowest the temperature is allowed to get during this season
var lowtemp_summer === 5;
var lowtemp_autumn === -10;
var lowtemp_spring === -10;
//So this is my current idea
Check if its winter, summer, autumn, spring
roll d20, add base temp for that season
Set the temp as our Temp_tracker variable
Next day, check season again.
if same season, Take value from temp_tracker variable and add/subtract 1d6.
Store the new temperature in the temp_tacker variable
Next day, check season again.
if season change, set temp_tracker to NULL and roll a d20, add season base temp.
Next day, check season
if same season. Take value from temp_tracker variable and add/subtract 1d6.
Repeat/loop
Problems
How do we know if its the same season when we restart the script?
Maybe, every time script is reloaded, check as if it is a new season, take season base temp, roll d20 and add the temp_tracker to the next days results
If we skip more days, for example three
Use base season temp+D20, set temp_tracker to NULL. Temp_tracker is only usable if its the following day
How do we make a max and min temperature so that it doesnt get 200 degrees warm?
I have no clue here. Is it possible to control the Temp_tracker so it needs to be within certain limits?
Maybe we need 4 different temp_trackers with seasonal limits.
For example, the limits on temp_tracker_summer shouldnt be the same as temp_tracker_winter
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment