Enable snow for christmas/new years
This commit is contained in:
parent
b70176765e
commit
d1b9cbbfc5
@ -1,5 +1,6 @@
|
|||||||
{
|
{
|
||||||
"acceleration": 7,
|
"acceleration": 7,
|
||||||
|
"enableWinterEvent": false,
|
||||||
"weather": {
|
"weather": {
|
||||||
"clouds": {
|
"clouds": {
|
||||||
"values": [-1.5, -1, 0, 0.5, 1, 1.5],
|
"values": [-1.5, -1, 0, 0.5, 1, 1.5],
|
||||||
|
@ -24,7 +24,7 @@ export class WeatherController
|
|||||||
/** Handle client/weather */
|
/** Handle client/weather */
|
||||||
public generate(): IWeatherData
|
public generate(): IWeatherData
|
||||||
{
|
{
|
||||||
let result: IWeatherData = { acceleration: 0, time: "", date: "", weather: null, winterEventEnabled: false };
|
let result: IWeatherData = { acceleration: 0, time: "", date: "", weather: null, winterEventEnabled: this.weatherConfig.enableWinterEvent };
|
||||||
|
|
||||||
result = this.weatherGenerator.calculateGameTime(result);
|
result = this.weatherGenerator.calculateGameTime(result);
|
||||||
result.weather = this.weatherGenerator.generateWeather();
|
result.weather = this.weatherGenerator.generateWeather();
|
||||||
|
@ -7,6 +7,7 @@ export interface IWeatherConfig extends IBaseConfig
|
|||||||
kind: "aki-weather";
|
kind: "aki-weather";
|
||||||
acceleration: number;
|
acceleration: number;
|
||||||
weather: Weather;
|
weather: Weather;
|
||||||
|
enableWinterEvent: boolean;
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface Weather
|
export interface Weather
|
||||||
|
@ -10,6 +10,7 @@ import { SeasonalEventType } from "@spt-aki/models/enums/SeasonalEventType";
|
|||||||
import { IHttpConfig } from "@spt-aki/models/spt/config/IHttpConfig";
|
import { IHttpConfig } from "@spt-aki/models/spt/config/IHttpConfig";
|
||||||
import { IQuestConfig } from "@spt-aki/models/spt/config/IQuestConfig";
|
import { IQuestConfig } from "@spt-aki/models/spt/config/IQuestConfig";
|
||||||
import { ISeasonalEvent, ISeasonalEventConfig } from "@spt-aki/models/spt/config/ISeasonalEventConfig";
|
import { ISeasonalEvent, ISeasonalEventConfig } from "@spt-aki/models/spt/config/ISeasonalEventConfig";
|
||||||
|
import { IWeatherConfig } from "@spt-aki/models/spt/config/IWeatherConfig";
|
||||||
import { ILocationData } from "@spt-aki/models/spt/server/ILocations";
|
import { ILocationData } from "@spt-aki/models/spt/server/ILocations";
|
||||||
import { ILogger } from "@spt-aki/models/spt/utils/ILogger";
|
import { ILogger } from "@spt-aki/models/spt/utils/ILogger";
|
||||||
import { ConfigServer } from "@spt-aki/servers/ConfigServer";
|
import { ConfigServer } from "@spt-aki/servers/ConfigServer";
|
||||||
@ -24,6 +25,7 @@ export class SeasonalEventService
|
|||||||
protected seasonalEventConfig: ISeasonalEventConfig;
|
protected seasonalEventConfig: ISeasonalEventConfig;
|
||||||
protected questConfig: IQuestConfig;
|
protected questConfig: IQuestConfig;
|
||||||
protected httpConfig: IHttpConfig;
|
protected httpConfig: IHttpConfig;
|
||||||
|
protected weatherConfig: IWeatherConfig;
|
||||||
|
|
||||||
protected halloweenEventActive = undefined;
|
protected halloweenEventActive = undefined;
|
||||||
protected christmasEventActive = undefined;
|
protected christmasEventActive = undefined;
|
||||||
@ -42,6 +44,7 @@ export class SeasonalEventService
|
|||||||
this.seasonalEventConfig = this.configServer.getConfig(ConfigTypes.SEASONAL_EVENT);
|
this.seasonalEventConfig = this.configServer.getConfig(ConfigTypes.SEASONAL_EVENT);
|
||||||
this.questConfig = this.configServer.getConfig(ConfigTypes.QUEST);
|
this.questConfig = this.configServer.getConfig(ConfigTypes.QUEST);
|
||||||
this.httpConfig = this.configServer.getConfig(ConfigTypes.HTTP);
|
this.httpConfig = this.configServer.getConfig(ConfigTypes.HTTP);
|
||||||
|
this.weatherConfig = this.configServer.getConfig(ConfigTypes.WEATHER);
|
||||||
|
|
||||||
this.cacheActiveEvents();
|
this.cacheActiveEvents();
|
||||||
}
|
}
|
||||||
@ -325,9 +328,11 @@ export class SeasonalEventService
|
|||||||
this.addLootItemsToGifterDropItemsList();
|
this.addLootItemsToGifterDropItemsList();
|
||||||
this.enableDancingTree();
|
this.enableDancingTree();
|
||||||
this.giveGift(sessionId, "Christmas2022");
|
this.giveGift(sessionId, "Christmas2022");
|
||||||
|
this.enableSnow();
|
||||||
break;
|
break;
|
||||||
case SeasonalEventType.NEW_YEARS.toLowerCase():
|
case SeasonalEventType.NEW_YEARS.toLowerCase():
|
||||||
this.giveGift(sessionId, "NewYear2023");
|
this.giveGift(sessionId, "NewYear2023");
|
||||||
|
this.enableSnow();
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
// Likely a mod event
|
// Likely a mod event
|
||||||
@ -550,4 +555,9 @@ export class SeasonalEventService
|
|||||||
{
|
{
|
||||||
return this.seasonalEventConfig.eventBotMapping[eventBotRole];
|
return this.seasonalEventConfig.eventBotMapping[eventBotRole];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public enableSnow(): void
|
||||||
|
{
|
||||||
|
this.weatherConfig.enableWinterEvent = true;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user