Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

* hotfixes #858

Merged
merged 5 commits into from
Oct 29, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions lang/compendium_lang/lang_world.json
Original file line number Diff line number Diff line change
Expand Up @@ -705,10 +705,10 @@
"out.",
"",
"Strong enchantments prevent",
"prevent teleporting, dig, open, and",
"levitation. Those seeking treasure",
"must navigate these tunnels the hard",
"way, and hope they can escape."
"teleporting, dig, open, and levitation.",
"Those seeking treasure must navigate",
"these tunnels the hard way, and hope",
"they can escape."
],
"details_line_highlights": [
{
Expand Down
24 changes: 24 additions & 0 deletions src/actarrow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1268,6 +1268,30 @@ void actArrow(Entity* my)
armorDegradeChance += 10;
}

if ( hit.entity->behavior == &actPlayer && armornum == 4 && hitstats->shield )
{
if ( skillCapstoneUnlocked(hit.entity->skill[2], PRO_SHIELD) )
{
armorDegradeChance = 100; // don't break.
}
else
{
if ( itemCategory(hitstats->shield) == ARMOR )
{
armorDegradeChance += 2 * (hitstats->getModifiedProficiency(PRO_SHIELD) / 10);
armorDegradeChance += 10;
if ( !players[hit.entity->skill[2]]->mechanics.itemDegradeRoll(hitstats->shield) )
{
armorDegradeChance = 100; // don't break.
}
}
else
{
armorDegradeChance += (hitstats->getModifiedProficiency(PRO_SHIELD) / 10);
}
}
}

if ( armorDegradeChance == 100 || (local_rng.rand() % armorDegradeChance > 0) )
{
armor = NULL;
Expand Down
2 changes: 1 addition & 1 deletion src/entity.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -9435,7 +9435,7 @@ void Entity::attack(int pose, int charge, Entity* target)
armorDegradeChance += 10;
}

if ( hit.entity->behavior == &actPlayer && armornum == 4 )
if ( hit.entity->behavior == &actPlayer && armornum == 4 && hitstats->shield )
{
if ( skillCapstoneUnlocked(hit.entity->skill[2], PRO_SHIELD) )
{
Expand Down
9 changes: 6 additions & 3 deletions src/magic/actmagic.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5157,7 +5157,7 @@ Entity* createParticleAestheticOrbit(Entity* parent, int sprite, int duration, i
return entity;
}

void createParticleRock(Entity* parent, int sprite)
void createParticleRock(Entity* parent, int sprite, bool light)
{
if ( !parent )
{
Expand Down Expand Up @@ -5189,8 +5189,11 @@ void createParticleRock(Entity* parent, int sprite)
entity->flags[PASSABLE] = true;
entity->flags[NOUPDATE] = true;
entity->flags[UNCLICKABLE] = true;
entity->lightBonus = vec4(*cvar_magic_fx_light_bonus, *cvar_magic_fx_light_bonus,
*cvar_magic_fx_light_bonus, 0.f);
if ( !light )
{
entity->lightBonus = vec4(*cvar_magic_fx_light_bonus, *cvar_magic_fx_light_bonus,
*cvar_magic_fx_light_bonus, 0.f);
}
if ( multiplayer != CLIENT )
{
entity_uids--;
Expand Down
2 changes: 1 addition & 1 deletion src/magic/magic.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -567,7 +567,7 @@ void actParticleShadowTag(Entity* my);
void createParticleDropRising(Entity* parent, int sprite, double scale);
void createParticleDot(Entity* parent);
Entity* createParticleAestheticOrbit(Entity* parent, int sprite, int duration, int particleType);
void createParticleRock(Entity* parent, int sprite = -1);
void createParticleRock(Entity* parent, int sprite = -1, bool light = false);
void createParticleShatteredGem(real_t x, real_t y, real_t z, int sprite, Entity* parent);
void createParticleErupt(Entity* parent, int sprite);
Entity* createParticleSapCenter(Entity* parent, Entity* target, int spell, int sprite, int endSprite);
Expand Down
2 changes: 1 addition & 1 deletion src/mod_tools.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -13621,7 +13621,7 @@ std::vector<std::pair<std::string, Sint32>> Compendium_t::Events_t::getCustomEve
{
if ( specificClass >= 0 )
{
if ( classId.first != specificClass )
if ( (classId.first % kEventClassesMax) != specificClass )
{
continue;
}
Expand Down
4 changes: 2 additions & 2 deletions src/ui/MainMenu.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -34352,7 +34352,7 @@ namespace MainMenu {
int index = -1;
if ( f->getUserData() )
{
index = (reinterpret_cast<intptr_t>(f->getUserData()) & 0x7F);
index = (reinterpret_cast<intptr_t>(f->getUserData()) & 0x7F) - 1;
}
Compendium_t::compendiumEntityCurrent.modelIndex = index + 1;
populateRecordsSectionItems(page_right_inner.getParent(), Compendium_t::Events_t::kEventCodexOffset + findCat->second, findCat->first.c_str(), index);
Expand Down Expand Up @@ -35901,7 +35901,7 @@ namespace MainMenu {
actualPos.h = std::max(compendiumPageRightInnerHeight, entry->getSize().y + entry->getSize().h);
page_right->setActualSize(actualPos);

Uint8 userData = classnum;
Uint8 userData = (classnum + 1);
if ( i == 0 )
{
userData |= 1 << 7;
Expand Down
Loading