forked from OpenWF/SpaceNinjaServer
chore: no-op nemesis mode=w (#2196)
Reviewed-on: OpenWF/SpaceNinjaServer#2196 Co-authored-by: Sainan <63328889+Sainan@users.noreply.github.com> Co-committed-by: Sainan <63328889+Sainan@users.noreply.github.com>
This commit is contained in:
parent
2e9d3c33b6
commit
bf40155dd4
@ -151,7 +151,8 @@ export const nemesisController: RequestHandler = async (req, res) => {
|
|||||||
inventory.Nemesis!.HenchmenKilled += antivirusGain;
|
inventory.Nemesis!.HenchmenKilled += antivirusGain;
|
||||||
if (inventory.Nemesis!.HenchmenKilled >= 100) {
|
if (inventory.Nemesis!.HenchmenKilled >= 100) {
|
||||||
inventory.Nemesis!.HenchmenKilled = 100;
|
inventory.Nemesis!.HenchmenKilled = 100;
|
||||||
// Client doesn't seem to request mode=w for infested liches, so weakening it here.
|
|
||||||
|
// Weaken nemesis now.
|
||||||
inventory.Nemesis!.InfNodes = [
|
inventory.Nemesis!.InfNodes = [
|
||||||
{
|
{
|
||||||
Node: getNemesisManifest(inventory.Nemesis!.manifest).showdownNode,
|
Node: getNemesisManifest(inventory.Nemesis!.manifest).showdownNode,
|
||||||
@ -294,31 +295,15 @@ export const nemesisController: RequestHandler = async (req, res) => {
|
|||||||
target: inventory.toJSON().Nemesis
|
target: inventory.toJSON().Nemesis
|
||||||
});
|
});
|
||||||
} else if ((req.query.mode as string) == "w") {
|
} else if ((req.query.mode as string) == "w") {
|
||||||
const inventory = await getInventory(
|
const inventory = await getInventory(account._id.toString(), "Nemesis");
|
||||||
account._id.toString(),
|
|
||||||
"Nemesis LoadOutPresets CurrentLoadOutIds DataKnives Upgrades RawUpgrades"
|
|
||||||
);
|
|
||||||
//const body = getJSONfromString<INemesisWeakenRequest>(String(req.body));
|
//const body = getJSONfromString<INemesisWeakenRequest>(String(req.body));
|
||||||
|
|
||||||
if (inventory.Nemesis!.Weakened) {
|
// As of 38.6.0, this request is no longer sent, instead mode=r already weakens the nemesis if appropriate.
|
||||||
logger.warn(`client is weakening an already-weakened nemesis?!`);
|
// We always weaken the nemesis in mode=r so simply giving the client back the nemesis.
|
||||||
}
|
|
||||||
|
|
||||||
inventory.Nemesis!.InfNodes = [
|
|
||||||
{
|
|
||||||
Node: getNemesisManifest(inventory.Nemesis!.manifest).showdownNode,
|
|
||||||
Influence: 1
|
|
||||||
}
|
|
||||||
];
|
|
||||||
inventory.Nemesis!.Weakened = true;
|
|
||||||
|
|
||||||
const response: INemesisWeakenResponse = {
|
const response: INemesisWeakenResponse = {
|
||||||
target: inventory.toJSON<IInventoryClient>().Nemesis!
|
target: inventory.toJSON<IInventoryClient>().Nemesis!
|
||||||
};
|
};
|
||||||
|
|
||||||
await consumePasscodeModCharges(inventory, response);
|
|
||||||
|
|
||||||
await inventory.save();
|
|
||||||
res.json(response);
|
res.json(response);
|
||||||
} else {
|
} else {
|
||||||
logger.debug(`data provided to ${req.path}: ${String(req.body)}`);
|
logger.debug(`data provided to ${req.path}: ${String(req.body)}`);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user