Skip to content

Commit

Permalink
Merge branch 'develop' of [email protected]:TurningWheel/Barony.git into…
Browse files Browse the repository at this point in the history
… develop
  • Loading branch information
SheridanR committed Mar 1, 2024
2 parents 9bc501f + afc7b72 commit cfed44e
Show file tree
Hide file tree
Showing 15 changed files with 421 additions and 22 deletions.
13 changes: 13 additions & 0 deletions src/actboulder.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -260,6 +260,11 @@ int boulderCheckAgainstEntity(Entity* my, Entity* entity, bool ignoreInsideEntit
bool cursedItemIsBuff = shouldInvertEquipmentBeatitude(stats);
if ( stats->helmet->beatitude >= 0 || cursedItemIsBuff )
{
if ( stats->HP <= damage )
{
// saved us
steamAchievementEntity(entity, "BARONY_ACH_CRUMPLE_ZONES");
}
damage = 0;
}
stats->helmet->status = BROKEN;
Expand All @@ -279,6 +284,14 @@ int boulderCheckAgainstEntity(Entity* my, Entity* entity, bool ignoreInsideEntit
mult += 0.25 * abs(stats->helmet->beatitude);
}

if ( stats->HP <= damage )
{
// saved us
if ( stats->HP > (damage * mult) )
{
steamAchievementEntity(entity, "BARONY_ACH_CRUMPLE_ZONES");
}
}
damage *= mult;
if ( stats->helmet->status > BROKEN )
{
Expand Down
1 change: 1 addition & 0 deletions src/actflame.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
-------------------------------------------------------------------------------*/

#define FLAME_LIFE my->skill[0]
#define FLAME_PLAYER my->skill[1]
#define FLAME_VELX my->vel_x
#define FLAME_VELY my->vel_y
#define FLAME_VELZ my->vel_z
Expand Down
21 changes: 20 additions & 1 deletion src/actmonster.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1863,6 +1863,20 @@ bool makeFollower(int monsterclicked, bool ringconflict, char namesays[64],
steamAchievementClient(monsterclicked, "BARONY_ACH_YOUNG_BLOOD");
}
}
if ( stats[monsterclicked]->sex != myStats->sex )
{
if ( stats[monsterclicked]->mask
&& (stats[monsterclicked]->mask->type == MASK_SPOOKY
|| stats[monsterclicked]->mask->type == MASK_GOLDEN
|| stats[monsterclicked]->mask->type == MASK_ARTIFACT_VISOR
|| stats[monsterclicked]->mask->type == MASK_STEEL_VISOR
|| stats[monsterclicked]->mask->type == MASK_CRYSTAL_VISOR
|| stats[monsterclicked]->mask->type == MASK_PLAGUE
))
{
steamAchievementClient(monsterclicked, "BARONY_ACH_SSSMOKIN");
}
}
if ( myStats->type == HUMAN && stats[monsterclicked]->type == HUMAN && stats[monsterclicked]->appearance == 0
&& stats[monsterclicked]->playerRace == RACE_AUTOMATON )
{
Expand Down Expand Up @@ -1954,6 +1968,11 @@ bool makeFollower(int monsterclicked, bool ringconflict, char namesays[64],
{
free(armor);
}

if ( players[monsterclicked] )
{
steamAchievementEntity(players[monsterclicked]->entity, "BARONY_ACH_MON_PETIT");
}
}

return true;
Expand Down Expand Up @@ -12448,7 +12467,7 @@ void mimicResetIdle(Entity* my)
int tx = pair.first;
int ty = pair.second;

if ( checkObstacle((tx << 4) + 8, (ty << 4) + 8, my, nullptr, false) )
if ( checkObstacle((tx << 4) + 8, (ty << 4) + 8, my, nullptr) )
{
if ( tx == x + 1 || tx == x - 1 )
{
Expand Down
6 changes: 6 additions & 0 deletions src/charclass.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2932,6 +2932,12 @@ void initClass(const int player)
Item* item = static_cast<Item*>(node->element);
if ( item )
{
if ( items[item->type].item_slot == EQUIPPABLE_IN_SLOT_HELM
|| items[item->type].item_slot == EQUIPPABLE_IN_SLOT_MASK )
{
assert(achievementObserver.playerAchievements->startingClassItems.find(item->type)
!= achievementObserver.playerAchievements->startingClassItems.end());
}
if ( players[player]->paperDoll.enabled && itemIsEquipped(item, player) && item->type != SPELL_ITEM )
{
continue;
Expand Down
61 changes: 58 additions & 3 deletions src/entity.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3591,6 +3591,8 @@ void Entity::handleEffects(Stat* myStats)
{
if ( ticks % (HEAL_TIME) == 0 )
{
steamAchievementEntity(this, "BARONY_ACH_SMOKIN");

int damage = 1 + local_rng.rand() % 3;
this->modHP(-damage);
if ( myStats->HP <= 0 )
Expand Down Expand Up @@ -6681,6 +6683,7 @@ void Entity::attack(int pose, int charge, Entity* target)
if ( myStats->HP <= 0 && oldHP > 0 )
{
killer->awardXP(this, true, true);
steamAchievementEntity(killer, "BARONY_ACH_LOCKJAW");
}

updateEnemyBar(killer, this, getMonsterLocalizedName(myStats->type).c_str(), myStats->HP, myStats->MAXHP, true,
Expand Down Expand Up @@ -9316,7 +9319,10 @@ void Entity::attack(int pose, int charge, Entity* target)
{
Item* armor = nullptr;
int armornum = 0;
if ( behavior == &actPlayer )
if ( behavior == &actPlayer
|| (hit.entity->behavior == &actMonster
&& ((hit.entity->monsterAllySummonRank != 0 && hitstats->type == SKELETON)
|| hit.entity->monsterIsTinkeringCreation())) )
{
armor = nullptr;
}
Expand Down Expand Up @@ -9349,6 +9355,10 @@ void Entity::attack(int pose, int charge, Entity* target)
{
armor->count--;
}
if ( hit.entity->behavior == &actPlayer && playerhit >= 0 )
{
steamStatisticUpdateClient(playerhit, STEAM_STAT_I_NEEDED_THAT, STEAM_STAT_INT, 1);
}
messagePlayer(playerhit, MESSAGE_COMBAT, Language::get(6085), armor->getName());
Item* stolenArmor = newItem(armor->type, armor->status, armor->beatitude, qty, armor->appearance, armor->identified, &myStats->inventory);
stolenArmor->ownerUid = hit.entity->getUID();
Expand Down Expand Up @@ -9438,7 +9448,10 @@ void Entity::attack(int pose, int charge, Entity* target)
{
Item* armor = nullptr;
int armornum = 0;
if ( behavior == &actPlayer )
if ( behavior == &actPlayer
|| (hit.entity->behavior == &actMonster
&& ( (hit.entity->monsterAllySummonRank != 0 && hitstats->type == SKELETON)
|| hit.entity->monsterIsTinkeringCreation())) )
{
armor = nullptr;
}
Expand Down Expand Up @@ -11896,6 +11909,11 @@ void Entity::awardXP(Entity* src, bool share, bool root)
if ( inspiration )
{
gain *= inspirationMult;
if ( ((followerStats->EXP + gain) >= 100) && ((followerStats->EXP + (xpGain * numshares)) < 100) )
{
// inspiration caused us to level
steamAchievementEntity(this, "BARONY_ACH_BY_EXAMPLE");
}
}
followerStats->EXP += gain;
}
Expand All @@ -11905,6 +11923,11 @@ void Entity::awardXP(Entity* src, bool share, bool root)
if ( inspiration )
{
gain *= inspirationMult;
if ( ((followerStats->EXP + gain) >= 100) && ((followerStats->EXP + xpGain) < 100) )
{
// inspiration caused us to level
steamAchievementEntity(this, "BARONY_ACH_BY_EXAMPLE");
}
}
followerStats->EXP += gain;
}
Expand All @@ -11927,6 +11950,17 @@ void Entity::awardXP(Entity* src, bool share, bool root)
if ( inspiration )
{
gain *= inspirationMult;
if ( ((destStats->EXP + gain) >= 100) && ((destStats->EXP + xpGain) < 100) )
{
// inspiration caused us to level
if ( behavior == &actMonster )
{
if ( auto leader = monsterAllyGetPlayerLeader() )
{
steamAchievementEntity(leader, "BARONY_ACH_BY_EXAMPLE");
}
}
}
}
destStats->EXP += gain;
}
Expand All @@ -11953,6 +11987,10 @@ void Entity::awardXP(Entity* src, bool share, bool root)
if ( src->behavior == &actPlayer && this->behavior == &actMonster )
{
achievementObserver.updateGlobalStat(getIndexForDeathType(destStats->type));
if ( destStats->type == MIMIC )
{
steamAchievementClient(src->skill[2], "BARONY_ACH_ETERNAL_REWARD");
}
}
else if ( src->behavior == &actMonster && this->behavior == &actPlayer )
{
Expand Down Expand Up @@ -11980,6 +12018,22 @@ void Entity::awardXP(Entity* src, bool share, bool root)
{
achievementObserver.updateGlobalStat(STEAM_GSTAT_SHOPKEEPERS_SLAIN);
}

if ( srcStats->type == LICH || srcStats->type == LICH_FIRE || srcStats->type == LICH_ICE
|| srcStats->type == DEVIL )
{
if ( gameModeManager.currentSession.challengeRun.isActive() )
{
if ( gameModeManager.currentSession.challengeRun.classnum >= 0
|| gameModeManager.currentSession.challengeRun.race >= 0 )
{
for ( int c = 0; c < MAXPLAYERS; c++ )
{
steamAchievementClient(c, "BARONY_ACH_BLOOM_PLANTED");
}
}
}
}
}
}

Expand Down Expand Up @@ -15881,7 +15935,7 @@ bool Entity::setEffect(int effect, bool value, int duration, bool updateClients,
case EFF_CONFUSED:
if ( myStats->type == LICH || myStats->type == DEVIL
|| myStats->type == LICH_FIRE || myStats->type == LICH_ICE
|| myStats->type == MINOTAUR )
|| myStats->type == MINOTAUR || myStats->type == MIMIC )
{
return false;
}
Expand Down Expand Up @@ -20557,6 +20611,7 @@ void Entity::handleHumanoidShieldLimb(Entity* shieldLimb, Entity* shieldArmLimb)
{
flameEntity->flags[GENIUS] = true;
flameEntity->setUID(-4);
flameEntity->skill[1] = player + 1;
}
else
{
Expand Down
9 changes: 9 additions & 0 deletions src/game.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1485,6 +1485,12 @@ void gameLogic(void)
steamAchievementClient(c, "BARONY_ACH_GILDED");
}

if ( stats[c]->helmet && stats[c]->helmet->type == HAT_WOLF_HOOD
&& stats[c]->helmet->beatitude > 0 )
{
steamAchievementClient(c, "BARONY_ACH_PET_DA_DOG");
}

if ( stats[c]->helmet && stats[c]->helmet->type == ARTIFACT_HELM
&& stats[c]->breastplate && stats[c]->breastplate->type == ARTIFACT_BREASTPIECE
&& stats[c]->gloves && stats[c]->gloves->type == ARTIFACT_GLOVES
Expand Down Expand Up @@ -1628,6 +1634,7 @@ void gameLogic(void)
gameplayPreferences[i].process();
}
updatePlayerConductsInMainLoop();
achievementObserver.updatePlayerAchievement(clientnum, AchievementObserver::BARONY_ACH_DAPPER, AchievementObserver::DAPPER_EQUIPMENT_CHECK);

//if( TICKS_PER_SECOND )
//generatePathMaps();
Expand Down Expand Up @@ -2994,11 +3001,13 @@ void gameLogic(void)
updateGameplayStatisticsInMainLoop();
}


for ( int i = 0; i < MAXPLAYERS; ++i )
{
gameplayPreferences[i].process();
}
updatePlayerConductsInMainLoop();
achievementObserver.updatePlayerAchievement(clientnum, AchievementObserver::BARONY_ACH_DAPPER, AchievementObserver::DAPPER_EQUIPMENT_CHECK);

// ask for entity delete update
if ( ticks % 4 == 0 && list_Size(map.entities) )
Expand Down
8 changes: 7 additions & 1 deletion src/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -289,7 +289,13 @@ SteamStat_t g_SteamStats[NUM_STEAM_STATISTICS] =
{ 46, STEAM_STAT_INT, "STAT_EXTRA_CREDIT_LVLS" },
{ 47, STEAM_STAT_INT, "STAT_DIPLOMA" },
{ 48, STEAM_STAT_INT, "STAT_DIPLOMA_LVLS" },
{ 49, STEAM_STAT_INT, "STAT_TUTORIAL_ENTERED" }
{ 49, STEAM_STAT_INT, "STAT_TUTORIAL_ENTERED" },
{ 50, STEAM_STAT_INT, "STAT_I_NEEDED_THAT" },
{ 51, STEAM_STAT_INT, "STAT_DAPPER_1"},
{ 52, STEAM_STAT_INT, "STAT_DAPPER_2"},
{ 53, STEAM_STAT_INT, "STAT_DAPPER_3"},
{ 54, STEAM_STAT_INT, "STAT_DAPPER"},
{ 55, STEAM_STAT_INT, "STAT_DUNGEONSEED" }
};

SteamStat_t g_SteamGlobalStats[NUM_GLOBAL_STEAM_STATISTICS] =
Expand Down
2 changes: 1 addition & 1 deletion src/main.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -898,7 +898,7 @@ extern bool initialized; //So that messagePlayer doesn't explode before the game

void GO_SwapBuffers(SDL_Window* screen);

static const int NUM_STEAM_STATISTICS = 49;
static const int NUM_STEAM_STATISTICS = 55;
extern SteamStat_t g_SteamStats[NUM_STEAM_STATISTICS];
static const int NUM_GLOBAL_STEAM_STATISTICS = 66;
extern SteamStat_t g_SteamGlobalStats[NUM_GLOBAL_STEAM_STATISTICS];
Expand Down
5 changes: 5 additions & 0 deletions src/menu.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -9685,6 +9685,11 @@ void doEndgame(bool saveHighscore) {
}
}

if ( gameModeManager.currentSession.challengeRun.isActive() )
{
steamAchievement("BARONY_ACH_REAP_SOW");
}

if ( victory == 1 )
{
if ( currentlevel >= 20 )
Expand Down
Loading

0 comments on commit cfed44e

Please sign in to comment.