Advertisement
VasVadum

Rimworld GenDate5.cs

Feb 28th, 2016
335
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 2.56 KB | None | 0 0
  1. // I can't remember who originally wrote this for me way back when it was first made.
  2. // I have edited it as well and added some things.  Its a good template/example of a potential for editing time in Rimworld.
  3.  
  4. using System;
  5. using System.Collections.Generic;
  6. using System.Text;
  7. using UnityEngine;
  8. using RimWorld;
  9. using Verse;
  10. using Verse.AI;
  11.  
  12.  
  13. namespace RimWorld
  14. {
  15.     public static class GenDate // This file uses A12 default values.
  16.     {
  17.         public const int TicksPerRealSecond = 60;
  18.         public const float SecondsPerTickAsFractionOfDay = 2f;
  19.         public static int TicksPerHour = 1250;
  20.         public static int HoursPerDay = 24;
  21.  
  22.         // This section will allow you to change the names of a month and the count of the days.
  23.         public static List<MonthInfo> Months = new List<MonthInfo>() {
  24.             new MonthInfo { name="InitializedMonth", dayCount= 1 }, new MonthInfo { name = "InitializedMonth", dayCount = 1 },
  25.         };
  26.  
  27.         public static int MonthsPerYear
  28.         {
  29.             get
  30.             {
  31.                 return Months.Count;
  32.             }
  33.         }
  34.  
  35.         public static int DefaultStartingYear = 5500; // Ever wanted to start at a different date with a different story?
  36.         public static bool LeapYear = false; // Added because real life has leap years, every 4 years on February.
  37.         public static int YearsToLeap = 4; // Every 4 years, add a day to the month(s) listed below.
  38.        
  39.         // "Every year that is exactly divisible by four is a leap year, except for years that are exactly divisible by 100,
  40.         // but these centurial years are leap years if they are exactly divisible by 400. For example, the years 1700, 1800,
  41.         // and 1900 were not leap years, but the years 1600 and 2000 were."
  42.         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.
  43.         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.
  44.         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.
  45.         public static List<string> LeapMonths = new List<string>() { "InitializedMonth" };
  46.         public static List<string> AltLeapMonths = new List<string>() { "InitializedMonth" };
  47.     }
  48.  
  49.     public class MonthInfo
  50.     {
  51.         public string name;
  52.         public int dayCount;
  53.  
  54.     }
  55. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement