Skip to content

Commit

Permalink
Make a few shield tweaks
Browse files Browse the repository at this point in the history
  • Loading branch information
Monsterovich committed Oct 28, 2024
1 parent e1d4439 commit 3b54ccc
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
2 changes: 1 addition & 1 deletion data/base/audio/audio.json
Original file line number Diff line number Diff line change
Expand Up @@ -451,7 +451,7 @@
{ "fileName": "scream2.ogg", "loop": false, "range": 1800, "volume": 100 },
{ "fileName": "scream3.ogg", "loop": false, "range": 1800, "volume": 100 },
{ "fileName": "silence.ogg", "loop": false, "range": 1800, "volume": 100 },
{ "fileName": "shield-hit.ogg", "loop": false, "range": 1800, "volume": 100 }
{ "fileName": "shield-hit.ogg", "loop": false, "range": 1800, "volume": 70 }
]
},
"Extra": {
Expand Down
8 changes: 7 additions & 1 deletion src/combat.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -518,11 +518,17 @@ int32_t objDamage(BASE_OBJECT *psObj, unsigned damage, unsigned originalhp, WEAP
{
actualDamage -= psDroid->shieldPoints;
psDroid->shieldPoints = 0;
}

if (psDroid->shieldPoints == 0) {
// shields are interrupted, wait for a while until regeneration starts again
psDroid->shieldInterruptRegenTime = psDroid->time;
}

if (PERCENT(psDroid->shieldPoints, droidGetMaxShieldPoints(psDroid)) > 25) {
if (weaponSubClass != WSC_FLAME &&
weaponSubClass != WSC_COMMAND &&
PERCENT(psDroid->shieldPoints, droidGetMaxShieldPoints(psDroid)) > 25)
{
Vector3i dv;
dv.y = psDroid->pos.z;
dv.y += (psDroid->sDisplay.imd->max.y * 2);
Expand Down

0 comments on commit 3b54ccc

Please sign in to comment.