返回提交历史
Modified
src/services/worldStateService.ts
+11
-3
XFEstudio/SpaceNinjaServer
fix: don't roll texture index for tilesets with only 1 option (#3876)
Closes #3874 Reviewed-on: https://onlyg.it/OpenWF/SpaceNinjaServer/pulls/3876 Co-authored-by: Sainan <63328889+Sainan@users.noreply.github.com> Co-committed-by: Sainan <63328889+Sainan@users.noreply.github.com>
53f872bc
代码差异
1 个文件
+11
-3
@@ -601,7 +601,9 @@ const pushTilesetModifiers = (modifiers: string[], tileset: TSortieTileset): voi
601
601
};
602
602
603
603
export const getSortie = (day: number): ISortie => {
604
const rng = new SRng(new SRng(day).randomInt(0, 100_000));
604
const seed = new SRng(day).randomInt(0, 100_000);
605
//logger.debug(`sortie seed: ${seed}`);
606
const rng = new SRng(seed);
605
607
606
608
const boss = rng.randomElement(sortieBosses)!;
607
609
const enemyFaction = sortieBossToFaction[boss];
@@ -765,8 +767,14 @@ const validateSortieSeed = (seed: number, variants: ISortieMission[]): boolean =
765
767
}
766
768
rng.randomFloat(); // difficulty
767
769
}
768
if (variant.missionType != "MT_ARENA" && variant.missionType != "MT_JUNCTION") {
769
const locationTextureIndex = rng.randomInt(0, 1); // In general, each tileset has 2 texture options (there are exceptions of course, like MT_ARENA and MT_JUNCTION).
770
if (
771
variant.missionType != "MT_ARENA" &&
772
variant.missionType != "MT_JUNCTION" &&
773
variant.tileset.indexOf("GasCity") == -1 &&
774
variant.tileset.indexOf("Forest") == -1 &&
775
variant.tileset.indexOf("Settlement") == -1
776
) {
777
const locationTextureIndex = rng.randomInt(0, 1);
770
778
if (variant.tileset == "CorpusIcePlanetTileset" || variant.tileset == "CorpusIcePlanetTilesetCaves") {
771
779
if (locationTextureIndex != 0) {
772
780
return false; // For the corpus ice planet tileset, index 1 is an infested corpus ship image, which we don't want.