forked from OpenWF/SpaceNinjaServer
		
	feat: add config options for event boosters (#1184)
Reviewed-on: OpenWF/SpaceNinjaServer#1184
This commit is contained in:
		
							parent
							
								
									25dfbf4724
								
							
						
					
					
						commit
						db20369eb9
					
				@ -38,6 +38,9 @@
 | 
				
			|||||||
  "fastClanAscension": false,
 | 
					  "fastClanAscension": false,
 | 
				
			||||||
  "spoofMasteryRank": -1,
 | 
					  "spoofMasteryRank": -1,
 | 
				
			||||||
  "events": {
 | 
					  "events": {
 | 
				
			||||||
 | 
					    "creditBoost": false,
 | 
				
			||||||
 | 
					    "affinityBoost": false,
 | 
				
			||||||
 | 
					    "resourceBoost": false,
 | 
				
			||||||
    "starDays": true
 | 
					    "starDays": true
 | 
				
			||||||
  }
 | 
					  }
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
				
			|||||||
@ -17,6 +17,7 @@ export const worldStateController: RequestHandler = (req, res) => {
 | 
				
			|||||||
                : buildConfig.buildLabel,
 | 
					                : buildConfig.buildLabel,
 | 
				
			||||||
        Time: Math.round(Date.now() / 1000),
 | 
					        Time: Math.round(Date.now() / 1000),
 | 
				
			||||||
        Goals: [],
 | 
					        Goals: [],
 | 
				
			||||||
 | 
					        GlobalUpgrades: [],
 | 
				
			||||||
        EndlessXpChoices: [],
 | 
					        EndlessXpChoices: [],
 | 
				
			||||||
        ...staticWorldState
 | 
					        ...staticWorldState
 | 
				
			||||||
    };
 | 
					    };
 | 
				
			||||||
@ -76,6 +77,43 @@ export const worldStateController: RequestHandler = (req, res) => {
 | 
				
			|||||||
        Nodes: []
 | 
					        Nodes: []
 | 
				
			||||||
    };
 | 
					    };
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    if (config.events?.creditBoost) {
 | 
				
			||||||
 | 
					        worldState.GlobalUpgrades.push({
 | 
				
			||||||
 | 
					            _id: { $oid: "5b23106f283a555109666672" },
 | 
				
			||||||
 | 
					            Activation: { $date: { $numberLong: "1740164400000" } },
 | 
				
			||||||
 | 
					            ExpiryDate: { $date: { $numberLong: "2000000000000" } },
 | 
				
			||||||
 | 
					            UpgradeType: "GAMEPLAY_MONEY_REWARD_AMOUNT",
 | 
				
			||||||
 | 
					            OperationType: "MULTIPLY",
 | 
				
			||||||
 | 
					            Value: 2,
 | 
				
			||||||
 | 
					            LocalizeTag: "",
 | 
				
			||||||
 | 
					            LocalizeDescTag: ""
 | 
				
			||||||
 | 
					        });
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
 | 
					    if (config.events?.affinityBoost) {
 | 
				
			||||||
 | 
					        worldState.GlobalUpgrades.push({
 | 
				
			||||||
 | 
					            _id: { $oid: "5b23106f283a555109666673" },
 | 
				
			||||||
 | 
					            Activation: { $date: { $numberLong: "1740164400000" } },
 | 
				
			||||||
 | 
					            ExpiryDate: { $date: { $numberLong: "2000000000000" } },
 | 
				
			||||||
 | 
					            UpgradeType: "GAMEPLAY_KILL_XP_AMOUNT",
 | 
				
			||||||
 | 
					            OperationType: "MULTIPLY",
 | 
				
			||||||
 | 
					            Value: 2,
 | 
				
			||||||
 | 
					            LocalizeTag: "",
 | 
				
			||||||
 | 
					            LocalizeDescTag: ""
 | 
				
			||||||
 | 
					        });
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
 | 
					    if (config.events?.resourceBoost) {
 | 
				
			||||||
 | 
					        worldState.GlobalUpgrades.push({
 | 
				
			||||||
 | 
					            _id: { $oid: "5b23106f283a555109666674" },
 | 
				
			||||||
 | 
					            Activation: { $date: { $numberLong: "1740164400000" } },
 | 
				
			||||||
 | 
					            ExpiryDate: { $date: { $numberLong: "2000000000000" } },
 | 
				
			||||||
 | 
					            UpgradeType: "GAMEPLAY_PICKUP_AMOUNT",
 | 
				
			||||||
 | 
					            OperationType: "MULTIPLY",
 | 
				
			||||||
 | 
					            Value: 2,
 | 
				
			||||||
 | 
					            LocalizeTag: "",
 | 
				
			||||||
 | 
					            LocalizeDescTag: ""
 | 
				
			||||||
 | 
					        });
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    // Circuit choices cycling every week
 | 
					    // Circuit choices cycling every week
 | 
				
			||||||
    worldState.EndlessXpChoices.push({
 | 
					    worldState.EndlessXpChoices.push({
 | 
				
			||||||
        Category: "EXC_NORMAL",
 | 
					        Category: "EXC_NORMAL",
 | 
				
			||||||
@ -158,6 +196,7 @@ interface IWorldState {
 | 
				
			|||||||
    Time: number;
 | 
					    Time: number;
 | 
				
			||||||
    Goals: IGoal[];
 | 
					    Goals: IGoal[];
 | 
				
			||||||
    SyndicateMissions: ISyndicateMission[];
 | 
					    SyndicateMissions: ISyndicateMission[];
 | 
				
			||||||
 | 
					    GlobalUpgrades: IGlobalUpgrade[];
 | 
				
			||||||
    NodeOverrides: INodeOverride[];
 | 
					    NodeOverrides: INodeOverride[];
 | 
				
			||||||
    EndlessXpChoices: IEndlessXpChoice[];
 | 
					    EndlessXpChoices: IEndlessXpChoice[];
 | 
				
			||||||
    KnownCalendarSeasons: ICalendarSeason[];
 | 
					    KnownCalendarSeasons: ICalendarSeason[];
 | 
				
			||||||
@ -188,6 +227,17 @@ interface ISyndicateMission {
 | 
				
			|||||||
    Nodes: string[];
 | 
					    Nodes: string[];
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					interface IGlobalUpgrade {
 | 
				
			||||||
 | 
					    _id: IOid;
 | 
				
			||||||
 | 
					    Activation: IMongoDate;
 | 
				
			||||||
 | 
					    ExpiryDate: IMongoDate;
 | 
				
			||||||
 | 
					    UpgradeType: string;
 | 
				
			||||||
 | 
					    OperationType: string;
 | 
				
			||||||
 | 
					    Value: number;
 | 
				
			||||||
 | 
					    LocalizeTag: string;
 | 
				
			||||||
 | 
					    LocalizeDescTag: string;
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
interface INodeOverride {
 | 
					interface INodeOverride {
 | 
				
			||||||
    _id: IOid;
 | 
					    _id: IOid;
 | 
				
			||||||
    Activation?: IMongoDate;
 | 
					    Activation?: IMongoDate;
 | 
				
			||||||
 | 
				
			|||||||
@ -64,6 +64,9 @@ interface IConfig {
 | 
				
			|||||||
    fastClanAscension?: boolean;
 | 
					    fastClanAscension?: boolean;
 | 
				
			||||||
    spoofMasteryRank?: number;
 | 
					    spoofMasteryRank?: number;
 | 
				
			||||||
    events?: {
 | 
					    events?: {
 | 
				
			||||||
 | 
					        creditBoost?: boolean;
 | 
				
			||||||
 | 
					        affinityBoost?: boolean;
 | 
				
			||||||
 | 
					        resourceBoost?: boolean;
 | 
				
			||||||
        starDays?: boolean;
 | 
					        starDays?: boolean;
 | 
				
			||||||
    };
 | 
					    };
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user