1
0
mirror of https://github.com/vcmi/vcmi.git synced 2024-11-24 08:32:34 +02:00

add nwctheone

This commit is contained in:
Laserlicht 2023-12-09 00:44:53 +01:00 committed by GitHub
parent d58c99b47d
commit 584bb32f53
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 26 additions and 2 deletions

View File

@ -391,7 +391,7 @@ void PlayerMessageProcessor::cheatMaxLuck(PlayerColor player, const CGHeroInstan
{
if (!hero)
return;
GiveBonus gb;
gb.bonus = Bonus(BonusDuration::PERMANENT, BonusType::MAX_LUCK, BonusSource::OTHER, 0, BonusSourceID(Obj(Obj::NO_OBJ)));
gb.id = hero->id;
@ -399,6 +399,18 @@ void PlayerMessageProcessor::cheatMaxLuck(PlayerColor player, const CGHeroInstan
gameHandler->giveHeroBonus(&gb);
}
void PlayerMessageProcessor::cheatFly(PlayerColor player, const CGHeroInstance * hero)
{
if (!hero)
return;
GiveBonus gb;
gb.bonus = Bonus(BonusDuration::PERMANENT, BonusType::FLYING_MOVEMENT, BonusSource::OTHER, 0, BonusSourceID(Obj(Obj::NO_OBJ)));
gb.id = hero->id;
gameHandler->giveHeroBonus(&gb);
}
void PlayerMessageProcessor::cheatMaxMorale(PlayerColor player, const CGHeroInstance * hero)
{
if (!hero)
@ -444,7 +456,8 @@ bool PlayerMessageProcessor::handleCheatCode(const std::string & cheat, PlayerCo
"vcmiforgeofnoldorking", "vcmiartifacts",
"vcmiolorin", "vcmiexp",
"nwcfollowthewhiterabbit",
"nwcmorpheus"
"nwcmorpheus",
"nwctheone"
};
if (!vstd::contains(townTargetedCheats, cheatName) && !vstd::contains(playerTargetedCheats, cheatName) && !vstd::contains(heroTargetedCheats, cheatName))
@ -521,6 +534,15 @@ void PlayerMessageProcessor::executeCheatCode(const std::string & cheatName, Pla
const auto & doCheatRevealPuzzle = [&]() { cheatPuzzleReveal(player); };
const auto & doCheatMaxLuck = [&]() { cheatMaxLuck(player, hero); };
const auto & doCheatMaxMorale = [&]() { cheatMaxMorale(player, hero); };
const auto & doCheatTheOne = [&]()
{
if(!hero)
return;
cheatMapReveal(player, true);
cheatGiveArmy(player, hero, { "archangel", "5" });
cheatMovement(player, hero, { });
cheatFly(player, hero);
};
// Unimplemented H3 cheats:
// nwcphisherprice - Changes and brightens the game colors.
@ -575,6 +597,7 @@ void PlayerMessageProcessor::executeCheatCode(const std::string & cheatName, Pla
{"nwcoracle", doCheatRevealPuzzle },
{"nwcfollowthewhiterabbit", doCheatMaxLuck },
{"nwcmorpheus", doCheatMaxMorale },
{"nwctheone", doCheatTheOne },
};
assert(callbacks.count(cheatName));

View File

@ -40,6 +40,7 @@ class PlayerMessageProcessor
void cheatPuzzleReveal(PlayerColor player);
void cheatMaxLuck(PlayerColor player, const CGHeroInstance * hero);
void cheatMaxMorale(PlayerColor player, const CGHeroInstance * hero);
void cheatFly(PlayerColor player, const CGHeroInstance * hero);
public:
CGameHandler * gameHandler;