Skip to content

Commit afc7b72

Browse files
author
Turning Wheel LLC
authored
Merge pull request #828 from WALLOFJUSTICE/dev-23-q2
V4.2.0 WIP
2 parents 97c265d + 417cacb commit afc7b72

15 files changed

+421
-22
lines changed

src/actboulder.cpp

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -260,6 +260,11 @@ int boulderCheckAgainstEntity(Entity* my, Entity* entity, bool ignoreInsideEntit
260260
bool cursedItemIsBuff = shouldInvertEquipmentBeatitude(stats);
261261
if ( stats->helmet->beatitude >= 0 || cursedItemIsBuff )
262262
{
263+
if ( stats->HP <= damage )
264+
{
265+
// saved us
266+
steamAchievementEntity(entity, "BARONY_ACH_CRUMPLE_ZONES");
267+
}
263268
damage = 0;
264269
}
265270
stats->helmet->status = BROKEN;
@@ -279,6 +284,14 @@ int boulderCheckAgainstEntity(Entity* my, Entity* entity, bool ignoreInsideEntit
279284
mult += 0.25 * abs(stats->helmet->beatitude);
280285
}
281286

287+
if ( stats->HP <= damage )
288+
{
289+
// saved us
290+
if ( stats->HP > (damage * mult) )
291+
{
292+
steamAchievementEntity(entity, "BARONY_ACH_CRUMPLE_ZONES");
293+
}
294+
}
282295
damage *= mult;
283296
if ( stats->helmet->status > BROKEN )
284297
{

src/actflame.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@
2626
-------------------------------------------------------------------------------*/
2727

2828
#define FLAME_LIFE my->skill[0]
29+
#define FLAME_PLAYER my->skill[1]
2930
#define FLAME_VELX my->vel_x
3031
#define FLAME_VELY my->vel_y
3132
#define FLAME_VELZ my->vel_z

src/actmonster.cpp

Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1863,6 +1863,20 @@ bool makeFollower(int monsterclicked, bool ringconflict, char namesays[64],
18631863
steamAchievementClient(monsterclicked, "BARONY_ACH_YOUNG_BLOOD");
18641864
}
18651865
}
1866+
if ( stats[monsterclicked]->sex != myStats->sex )
1867+
{
1868+
if ( stats[monsterclicked]->mask
1869+
&& (stats[monsterclicked]->mask->type == MASK_SPOOKY
1870+
|| stats[monsterclicked]->mask->type == MASK_GOLDEN
1871+
|| stats[monsterclicked]->mask->type == MASK_ARTIFACT_VISOR
1872+
|| stats[monsterclicked]->mask->type == MASK_STEEL_VISOR
1873+
|| stats[monsterclicked]->mask->type == MASK_CRYSTAL_VISOR
1874+
|| stats[monsterclicked]->mask->type == MASK_PLAGUE
1875+
))
1876+
{
1877+
steamAchievementClient(monsterclicked, "BARONY_ACH_SSSMOKIN");
1878+
}
1879+
}
18661880
if ( myStats->type == HUMAN && stats[monsterclicked]->type == HUMAN && stats[monsterclicked]->appearance == 0
18671881
&& stats[monsterclicked]->playerRace == RACE_AUTOMATON )
18681882
{
@@ -1954,6 +1968,11 @@ bool makeFollower(int monsterclicked, bool ringconflict, char namesays[64],
19541968
{
19551969
free(armor);
19561970
}
1971+
1972+
if ( players[monsterclicked] )
1973+
{
1974+
steamAchievementEntity(players[monsterclicked]->entity, "BARONY_ACH_MON_PETIT");
1975+
}
19571976
}
19581977

19591978
return true;
@@ -12448,7 +12467,7 @@ void mimicResetIdle(Entity* my)
1244812467
int tx = pair.first;
1244912468
int ty = pair.second;
1245012469

12451-
if ( checkObstacle((tx << 4) + 8, (ty << 4) + 8, my, nullptr, false) )
12470+
if ( checkObstacle((tx << 4) + 8, (ty << 4) + 8, my, nullptr) )
1245212471
{
1245312472
if ( tx == x + 1 || tx == x - 1 )
1245412473
{

src/charclass.cpp

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2932,6 +2932,12 @@ void initClass(const int player)
29322932
Item* item = static_cast<Item*>(node->element);
29332933
if ( item )
29342934
{
2935+
if ( items[item->type].item_slot == EQUIPPABLE_IN_SLOT_HELM
2936+
|| items[item->type].item_slot == EQUIPPABLE_IN_SLOT_MASK )
2937+
{
2938+
assert(achievementObserver.playerAchievements->startingClassItems.find(item->type)
2939+
!= achievementObserver.playerAchievements->startingClassItems.end());
2940+
}
29352941
if ( players[player]->paperDoll.enabled && itemIsEquipped(item, player) && item->type != SPELL_ITEM )
29362942
{
29372943
continue;

src/entity.cpp

Lines changed: 58 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3591,6 +3591,8 @@ void Entity::handleEffects(Stat* myStats)
35913591
{
35923592
if ( ticks % (HEAL_TIME) == 0 )
35933593
{
3594+
steamAchievementEntity(this, "BARONY_ACH_SMOKIN");
3595+
35943596
int damage = 1 + local_rng.rand() % 3;
35953597
this->modHP(-damage);
35963598
if ( myStats->HP <= 0 )
@@ -6681,6 +6683,7 @@ void Entity::attack(int pose, int charge, Entity* target)
66816683
if ( myStats->HP <= 0 && oldHP > 0 )
66826684
{
66836685
killer->awardXP(this, true, true);
6686+
steamAchievementEntity(killer, "BARONY_ACH_LOCKJAW");
66846687
}
66856688

66866689
updateEnemyBar(killer, this, getMonsterLocalizedName(myStats->type).c_str(), myStats->HP, myStats->MAXHP, true,
@@ -9316,7 +9319,10 @@ void Entity::attack(int pose, int charge, Entity* target)
93169319
{
93179320
Item* armor = nullptr;
93189321
int armornum = 0;
9319-
if ( behavior == &actPlayer )
9322+
if ( behavior == &actPlayer
9323+
|| (hit.entity->behavior == &actMonster
9324+
&& ((hit.entity->monsterAllySummonRank != 0 && hitstats->type == SKELETON)
9325+
|| hit.entity->monsterIsTinkeringCreation())) )
93209326
{
93219327
armor = nullptr;
93229328
}
@@ -9349,6 +9355,10 @@ void Entity::attack(int pose, int charge, Entity* target)
93499355
{
93509356
armor->count--;
93519357
}
9358+
if ( hit.entity->behavior == &actPlayer && playerhit >= 0 )
9359+
{
9360+
steamStatisticUpdateClient(playerhit, STEAM_STAT_I_NEEDED_THAT, STEAM_STAT_INT, 1);
9361+
}
93529362
messagePlayer(playerhit, MESSAGE_COMBAT, Language::get(6085), armor->getName());
93539363
Item* stolenArmor = newItem(armor->type, armor->status, armor->beatitude, qty, armor->appearance, armor->identified, &myStats->inventory);
93549364
stolenArmor->ownerUid = hit.entity->getUID();
@@ -9438,7 +9448,10 @@ void Entity::attack(int pose, int charge, Entity* target)
94389448
{
94399449
Item* armor = nullptr;
94409450
int armornum = 0;
9441-
if ( behavior == &actPlayer )
9451+
if ( behavior == &actPlayer
9452+
|| (hit.entity->behavior == &actMonster
9453+
&& ( (hit.entity->monsterAllySummonRank != 0 && hitstats->type == SKELETON)
9454+
|| hit.entity->monsterIsTinkeringCreation())) )
94429455
{
94439456
armor = nullptr;
94449457
}
@@ -11896,6 +11909,11 @@ void Entity::awardXP(Entity* src, bool share, bool root)
1189611909
if ( inspiration )
1189711910
{
1189811911
gain *= inspirationMult;
11912+
if ( ((followerStats->EXP + gain) >= 100) && ((followerStats->EXP + (xpGain * numshares)) < 100) )
11913+
{
11914+
// inspiration caused us to level
11915+
steamAchievementEntity(this, "BARONY_ACH_BY_EXAMPLE");
11916+
}
1189911917
}
1190011918
followerStats->EXP += gain;
1190111919
}
@@ -11905,6 +11923,11 @@ void Entity::awardXP(Entity* src, bool share, bool root)
1190511923
if ( inspiration )
1190611924
{
1190711925
gain *= inspirationMult;
11926+
if ( ((followerStats->EXP + gain) >= 100) && ((followerStats->EXP + xpGain) < 100) )
11927+
{
11928+
// inspiration caused us to level
11929+
steamAchievementEntity(this, "BARONY_ACH_BY_EXAMPLE");
11930+
}
1190811931
}
1190911932
followerStats->EXP += gain;
1191011933
}
@@ -11927,6 +11950,17 @@ void Entity::awardXP(Entity* src, bool share, bool root)
1192711950
if ( inspiration )
1192811951
{
1192911952
gain *= inspirationMult;
11953+
if ( ((destStats->EXP + gain) >= 100) && ((destStats->EXP + xpGain) < 100) )
11954+
{
11955+
// inspiration caused us to level
11956+
if ( behavior == &actMonster )
11957+
{
11958+
if ( auto leader = monsterAllyGetPlayerLeader() )
11959+
{
11960+
steamAchievementEntity(leader, "BARONY_ACH_BY_EXAMPLE");
11961+
}
11962+
}
11963+
}
1193011964
}
1193111965
destStats->EXP += gain;
1193211966
}
@@ -11953,6 +11987,10 @@ void Entity::awardXP(Entity* src, bool share, bool root)
1195311987
if ( src->behavior == &actPlayer && this->behavior == &actMonster )
1195411988
{
1195511989
achievementObserver.updateGlobalStat(getIndexForDeathType(destStats->type));
11990+
if ( destStats->type == MIMIC )
11991+
{
11992+
steamAchievementClient(src->skill[2], "BARONY_ACH_ETERNAL_REWARD");
11993+
}
1195611994
}
1195711995
else if ( src->behavior == &actMonster && this->behavior == &actPlayer )
1195811996
{
@@ -11980,6 +12018,22 @@ void Entity::awardXP(Entity* src, bool share, bool root)
1198012018
{
1198112019
achievementObserver.updateGlobalStat(STEAM_GSTAT_SHOPKEEPERS_SLAIN);
1198212020
}
12021+
12022+
if ( srcStats->type == LICH || srcStats->type == LICH_FIRE || srcStats->type == LICH_ICE
12023+
|| srcStats->type == DEVIL )
12024+
{
12025+
if ( gameModeManager.currentSession.challengeRun.isActive() )
12026+
{
12027+
if ( gameModeManager.currentSession.challengeRun.classnum >= 0
12028+
|| gameModeManager.currentSession.challengeRun.race >= 0 )
12029+
{
12030+
for ( int c = 0; c < MAXPLAYERS; c++ )
12031+
{
12032+
steamAchievementClient(c, "BARONY_ACH_BLOOM_PLANTED");
12033+
}
12034+
}
12035+
}
12036+
}
1198312037
}
1198412038
}
1198512039

@@ -15881,7 +15935,7 @@ bool Entity::setEffect(int effect, bool value, int duration, bool updateClients,
1588115935
case EFF_CONFUSED:
1588215936
if ( myStats->type == LICH || myStats->type == DEVIL
1588315937
|| myStats->type == LICH_FIRE || myStats->type == LICH_ICE
15884-
|| myStats->type == MINOTAUR )
15938+
|| myStats->type == MINOTAUR || myStats->type == MIMIC )
1588515939
{
1588615940
return false;
1588715941
}
@@ -20557,6 +20611,7 @@ void Entity::handleHumanoidShieldLimb(Entity* shieldLimb, Entity* shieldArmLimb)
2055720611
{
2055820612
flameEntity->flags[GENIUS] = true;
2055920613
flameEntity->setUID(-4);
20614+
flameEntity->skill[1] = player + 1;
2056020615
}
2056120616
else
2056220617
{

src/game.cpp

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1485,6 +1485,12 @@ void gameLogic(void)
14851485
steamAchievementClient(c, "BARONY_ACH_GILDED");
14861486
}
14871487

1488+
if ( stats[c]->helmet && stats[c]->helmet->type == HAT_WOLF_HOOD
1489+
&& stats[c]->helmet->beatitude > 0 )
1490+
{
1491+
steamAchievementClient(c, "BARONY_ACH_PET_DA_DOG");
1492+
}
1493+
14881494
if ( stats[c]->helmet && stats[c]->helmet->type == ARTIFACT_HELM
14891495
&& stats[c]->breastplate && stats[c]->breastplate->type == ARTIFACT_BREASTPIECE
14901496
&& stats[c]->gloves && stats[c]->gloves->type == ARTIFACT_GLOVES
@@ -1628,6 +1634,7 @@ void gameLogic(void)
16281634
gameplayPreferences[i].process();
16291635
}
16301636
updatePlayerConductsInMainLoop();
1637+
achievementObserver.updatePlayerAchievement(clientnum, AchievementObserver::BARONY_ACH_DAPPER, AchievementObserver::DAPPER_EQUIPMENT_CHECK);
16311638

16321639
//if( TICKS_PER_SECOND )
16331640
//generatePathMaps();
@@ -2994,11 +3001,13 @@ void gameLogic(void)
29943001
updateGameplayStatisticsInMainLoop();
29953002
}
29963003

3004+
29973005
for ( int i = 0; i < MAXPLAYERS; ++i )
29983006
{
29993007
gameplayPreferences[i].process();
30003008
}
30013009
updatePlayerConductsInMainLoop();
3010+
achievementObserver.updatePlayerAchievement(clientnum, AchievementObserver::BARONY_ACH_DAPPER, AchievementObserver::DAPPER_EQUIPMENT_CHECK);
30023011

30033012
// ask for entity delete update
30043013
if ( ticks % 4 == 0 && list_Size(map.entities) )

src/main.cpp

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -289,7 +289,13 @@ SteamStat_t g_SteamStats[NUM_STEAM_STATISTICS] =
289289
{ 46, STEAM_STAT_INT, "STAT_EXTRA_CREDIT_LVLS" },
290290
{ 47, STEAM_STAT_INT, "STAT_DIPLOMA" },
291291
{ 48, STEAM_STAT_INT, "STAT_DIPLOMA_LVLS" },
292-
{ 49, STEAM_STAT_INT, "STAT_TUTORIAL_ENTERED" }
292+
{ 49, STEAM_STAT_INT, "STAT_TUTORIAL_ENTERED" },
293+
{ 50, STEAM_STAT_INT, "STAT_I_NEEDED_THAT" },
294+
{ 51, STEAM_STAT_INT, "STAT_DAPPER_1"},
295+
{ 52, STEAM_STAT_INT, "STAT_DAPPER_2"},
296+
{ 53, STEAM_STAT_INT, "STAT_DAPPER_3"},
297+
{ 54, STEAM_STAT_INT, "STAT_DAPPER"},
298+
{ 55, STEAM_STAT_INT, "STAT_DUNGEONSEED" }
293299
};
294300

295301
SteamStat_t g_SteamGlobalStats[NUM_GLOBAL_STEAM_STATISTICS] =

src/main.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -898,7 +898,7 @@ extern bool initialized; //So that messagePlayer doesn't explode before the game
898898

899899
void GO_SwapBuffers(SDL_Window* screen);
900900

901-
static const int NUM_STEAM_STATISTICS = 49;
901+
static const int NUM_STEAM_STATISTICS = 55;
902902
extern SteamStat_t g_SteamStats[NUM_STEAM_STATISTICS];
903903
static const int NUM_GLOBAL_STEAM_STATISTICS = 66;
904904
extern SteamStat_t g_SteamGlobalStats[NUM_GLOBAL_STEAM_STATISTICS];

src/menu.cpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9685,6 +9685,11 @@ void doEndgame(bool saveHighscore) {
96859685
}
96869686
}
96879687

9688+
if ( gameModeManager.currentSession.challengeRun.isActive() )
9689+
{
9690+
steamAchievement("BARONY_ACH_REAP_SOW");
9691+
}
9692+
96889693
if ( victory == 1 )
96899694
{
96909695
if ( currentlevel >= 20 )

0 commit comments

Comments
 (0)