Skip to content

Commit 7371f80

Browse files
committed
add zombie on landing setting editable via config
1 parent 65ea664 commit 7371f80

3 files changed

Lines changed: 15 additions & 1 deletion

File tree

‎data/2016/sampleData/defaultconfig.yaml‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,10 @@ airdrop:
8585
minimumPlayers: 10
8686
# Drop at a random valid spot in the caller's grid cell. This is experimental, use at your own risk.
8787
useNavmesh: true
88+
# Spawn a horde of zombies around the crate once it has landed
89+
spawnZombiesOnLanding: true
90+
zombiesPerAirdrop: 15
91+
zombieSpawnRadius: 0.5
8892
types:
8993
normal:
9094
planeSpeed: 140000

‎src/servers/ZoneServer2016/managers/airdropmanager.ts‎

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@ export class AirdropManager {
112112
}
113113
};
114114

115-
// Zombie spawn-on-landing settings
115+
// Zombie spawn-on-landing settings, will be override by config
116116
public spawnZombiesOnLanding: boolean = true;
117117
public zombiesPerAirdrop: number = 15;
118118
public zombieSpawnRadius: number = 0.5;
@@ -123,6 +123,10 @@ export class AirdropManager {
123123
applyConfig(cfg: AirdropConfig) {
124124
this.minimumPlayers = cfg.minimumPlayers;
125125
this.useNavmesh = cfg.useNavmesh ?? false;
126+
this.spawnZombiesOnLanding =
127+
cfg.spawnZombiesOnLanding ?? this.spawnZombiesOnLanding;
128+
this.zombiesPerAirdrop = cfg.zombiesPerAirdrop ?? this.zombiesPerAirdrop;
129+
this.zombieSpawnRadius = cfg.zombieSpawnRadius ?? this.zombieSpawnRadius;
126130
for (const [name, overrides] of Object.entries(cfg.types ?? {})) {
127131
const type = this.airdropTypes[name];
128132
if (!type) continue; // unknown type in config; nothing to tune

‎src/servers/ZoneServer2016/models/config.ts‎

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -191,6 +191,12 @@ export interface AirdropConfig {
191191
minimumPlayers: number;
192192
/** Use the navmesh to drop at a random valid spot in the caller's grid cell. */
193193
useNavmesh: boolean;
194+
/** Spawn a horde of zombies around the crate once it has landed. */
195+
spawnZombiesOnLanding: boolean;
196+
/** Zombies spawned around each landed crate. */
197+
zombiesPerAirdrop: number;
198+
/** Distance from the crate, in world units, the zombies spawn at. */
199+
zombieSpawnRadius: number;
194200
/** Overrides per airdrop type, keyed by name (normal, bombing, ...). */
195201
types: Record<string, Partial<AirdropTypeConfig>>;
196202
}

0 commit comments

Comments
 (0)