Browse Source

Make Poisoned Water Supply quest multiplayer compatible

pull/5478/head
obligaron 3 years ago committed by Anders Jenbo
parent
commit
d0978672e9
  1. 8
      Source/levels/town.cpp
  2. 5
      Source/levels/town.h
  3. 7
      Source/quests.cpp
  4. 2
      Source/towners.cpp

8
Source/levels/town.cpp

@ -346,6 +346,13 @@ void TownOpenGrave()
dPiece[34][21] = 0x53b;
}
void CleanTownFountain()
{
if (!pMegaTiles)
return;
FillTile(60, 70, 71);
}
void CreateTown(lvl_entry entry)
{
dminPosition = { 10, 10 };
@ -374,7 +381,6 @@ void CreateTown(lvl_entry entry)
}
DrlgTPass3();
pMegaTiles = nullptr;
}
} // namespace devilution

5
Source/levels/town.h

@ -44,6 +44,11 @@ void TownOpenHive();
*/
void TownOpenGrave();
/**
* @brief Update town to show clean/not poisoned water fountain
*/
void CleanTownFountain();
/**
* @brief Initialize town level
* @param entry Method of entry

7
Source/quests.cpp

@ -17,6 +17,7 @@
#include "engine/world_tile.hpp"
#include "init.h"
#include "levels/gendung.h"
#include "levels/town.h"
#include "levels/trigs.h"
#include "minitext.h"
#include "missiles.h"
@ -350,6 +351,7 @@ void CheckQuests()
&& ActiveMonsterCount == 4
&& Quests[Q_PWATER]._qactive != QUEST_DONE) {
Quests[Q_PWATER]._qactive = QUEST_DONE;
NetSendCmdQuest(true, Quests[Q_PWATER]);
PlaySfxLoc(IS_QUESTDN, MyPlayer->position.tile);
LoadPalette("levels\\l3data\\l3pwater.pal", false);
UpdatePWaterPalette();
@ -691,6 +693,11 @@ void ResyncQuests()
ObjChangeMapResync(posPentagram.x, posPentagram.y, posPentagram.x + 5, posPentagram.y + 5);
InitL4Triggers();
}
if (currlevel == 0
&& Quests[Q_PWATER]._qactive == QUEST_DONE
&& gbIsMultiplayer) {
CleanTownFountain();
}
}
void DrawQuestLog(const Surface &out)

2
Source/towners.cpp

@ -484,12 +484,14 @@ void TalkToHealer(Player &player, Towner &healer)
Quests[Q_PWATER]._qlog = true;
Quests[Q_PWATER]._qmsg = TEXT_POISON3;
InitQTextMsg(TEXT_POISON3);
NetSendCmdQuest(true, Quests[Q_PWATER]);
return;
}
if (Quests[Q_PWATER]._qactive == QUEST_DONE && Quests[Q_PWATER]._qvar1 != 2) {
Quests[Q_PWATER]._qvar1 = 2;
InitQTextMsg(TEXT_POISON5);
SpawnUnique(UITEM_TRING, healer.position + Direction::SouthWest);
NetSendCmdQuest(true, Quests[Q_PWATER]);
return;
}
}

Loading…
Cancel
Save