Skip to content

Commit

Permalink
- patch to conditions to add in debug commands
Browse files Browse the repository at this point in the history
  • Loading branch information
KoihimeNakamura committed Oct 8, 2017
1 parent 65a0cea commit 0d0b235
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 2 deletions.
16 changes: 14 additions & 2 deletions ClimatesOfFerngill/ClimatesOfFerngillRebuild.cs
Original file line number Diff line number Diff line change
Expand Up @@ -152,12 +152,14 @@ public override void Entry(IModHelper helper)

ControlEvents.KeyPressed += (sender, e) => this.ReceiveKeyPress(e.KeyPressed, this.WeatherOpt.Keyboard);
MenuEvents.MenuClosed += (sender, e) => this.ReceiveMenuClosed(e.PriorMenu);

//console commands
helper.ConsoleCommands
.Add("weather_settommorowweather", helper.Translation.Get("console-text.desc_tmrweather"), TmrwWeatherChangeFromConsole)
.Add("weather_setweather", helper.Translation.Get("console-text.desc_setweather"), WeatherChangeFromConsole)
.Add("debug_changecondt", "Changes conditions. Debug function.", DebugChgCondition);
.Add("debug_changecondt", "Changes conditions. Debug function.", DebugChgCondition)
.Add("debug_forceheatwave", "Force heatwave. Debug function", ForceHeatwave)
.Add("debug_forcefrost", "Force frost. Debug function", ForceFrost);
}

private void MenuEvents_MenuChanged(object sender, EventArgsClickableMenuChanged e)
Expand Down Expand Up @@ -795,6 +797,16 @@ private bool CheckForForceDay(SDate Target)
* **************************************************************
*/

private void ForceFrost(string arg1, string[] arg2)
{
CurrentWeather.ForceFrost();
}

private void ForceHeatwave(string arg1, string[] arg2)
{
CurrentWeather.ForceHeatwave();
}

/// <summary>
/// This function changes the weather (Console Command)
/// </summary>
Expand Down
10 changes: 10 additions & 0 deletions ClimatesOfFerngill/WeatherConditions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,16 @@ public bool IsDangerousWeather()
return false;
}

public void ForceFrost()
{
UnusualWeather = SpecialWeather.Frost;
}

public void ForceHeatwave()
{
UnusualWeather = SpecialWeather.Heatwave;
}

public void OnNewDay()
{
TodayWeather = 0;
Expand Down

0 comments on commit 0d0b235

Please sign in to comment.