Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // I can't remember who originally wrote this for me way back when it was first made.
- // I have edited it as well and added some things. Its a good template/example of a potential for editing time in Rimworld.
- using System;
- using System.Collections.Generic;
- using System.Text;
- using UnityEngine;
- using RimWorld;
- using Verse;
- using Verse.AI;
- namespace RimWorld
- {
- public static class GenDate // This file uses A12 default values.
- {
- public const int TicksPerRealSecond = 60;
- public const float SecondsPerTickAsFractionOfDay = 2f;
- public static int TicksPerHour = 1250;
- public static int HoursPerDay = 24;
- // This section will allow you to change the names of a month and the count of the days.
- public static List<MonthInfo> Months = new List<MonthInfo>() {
- new MonthInfo { name="InitializedMonth", dayCount= 1 }, new MonthInfo { name = "InitializedMonth", dayCount = 1 },
- };
- public static int MonthsPerYear
- {
- get
- {
- return Months.Count;
- }
- }
- public static int DefaultStartingYear = 5500; // Ever wanted to start at a different date with a different story?
- public static bool LeapYear = false; // Added because real life has leap years, every 4 years on February.
- public static int YearsToLeap = 4; // Every 4 years, add a day to the month(s) listed below.
- // "Every year that is exactly divisible by four is a leap year, except for years that are exactly divisible by 100,
- // but these centurial years are leap years if they are exactly divisible by 400. For example, the years 1700, 1800,
- // and 1900 were not leap years, but the years 1600 and 2000 were."
- public static int AlternateLeapYear = false; // See above; added for the potential to make time work the way it does for Earth should a mod author want it.
- public static int YearDivisibleLeap = 100; // If year is divisible by this number, it is not a leap year. This removes a day from AltLeapMonths after YearsToLeap is calculated.
- public static int YearDivisibleSubtract = 400; // If year is divisible by this number, it is a leap year. This adds a day to the months listed in AltLeapMonths, after YearsToLeap is calculated.
- public static List<string> LeapMonths = new List<string>() { "InitializedMonth" };
- public static List<string> AltLeapMonths = new List<string>() { "InitializedMonth" };
- }
- public class MonthInfo
- {
- public string name;
- public int dayCount;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement