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

Fix reaction/initiative aug/magic compatibility #714

Merged
merged 8 commits into from
Oct 23, 2023
Merged
Show file tree
Hide file tree
Changes from 3 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
29 changes: 7 additions & 22 deletions .github/workflows/c-cpp.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,13 @@ jobs:
steps:
- uses: actions/checkout@v3

# Update apt cache.
- name: Update apt cache.
run: sudo apt update

# Install dependencies.
- name: Install Boost filesystem and libcurl4
run: sudo apt install libboost-filesystem-dev libcurl4-openssl-dev
run: sudo apt install -y libboost-filesystem-dev libcurl4-openssl-dev

# Populate our config file with dummy values.
- name: Write mysql_config.cpp
Expand All @@ -27,27 +31,8 @@ jobs:
const char *mysql_user = "user"; \
const char *mysql_db = "db"; ' \
> mysql_config.cpp

# Restore our built artifact cache, if any available.
- name: Restore cached artifacts
id: cache-artifact-restore
uses: actions/cache/restore@v3
with:
path: |
src/*.d
src/*.o
key: cache-key-${{ github.event.number }}


# Compile the game.
- name: make
working-directory: ./src
run: make

# Save any compiled dependencies for next time.
- name: Save cached artifacts
id: cache-artifact-save
uses: actions/cache/save@v3
with:
path: |
src/*.d
src/*.o
key: ${{ steps.cache-artifact-restore.outputs.cache-primary-key }}
25 changes: 17 additions & 8 deletions src/handler.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -777,10 +777,6 @@ void affect_total(struct char_data * ch)
cyber->obj_flags.bitvector, TRUE);
}

for (sust = GET_SUSTAINED(ch); sust; sust = sust->next)
if (!sust->caster)
spell_modify(ch, sust, TRUE);

for (struct obj_data *bio = ch->bioware; bio; bio = bio->next_content) {
switch (GET_BIOWARE_TYPE(bio)) {
case BIO_PAINEDITOR:
Expand All @@ -796,12 +792,21 @@ void affect_total(struct char_data * ch)
}
}

// We want the higher of either cyber+bio or magic/adept
int aug_rea = GET_REA(ch);
int aug_init_dice = GET_INIT_DICE(ch);
GET_REA(ch) = 0;
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should this be GET_REA(ch) = GET_REAL_REA(ch)?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The quickness and intelligence contributions to reaction get added in at the very end of all the attribute stuff, so that drugs, capping, and nerve strike modifiers all apply.

There's a question as to how GET_REAL_REA should be calculated though... SR3 rules consider cerebral boosters, muscle toner, and adept improved ability to be natural in most cases.... but not always, since toners (and probably also adept improved qui) don't apply to reaction when rigging.

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't have a strong opinion on that question myself, so if you're confident in this code as it stands I'm happy to merge it for testing.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe leave GET_REAL_REA alone for informational purposes, and then if we're decking or rigging, let's update GET_REA (and GET_INIT_DICE) to the appropriate values.

GET_INIT_DICE(ch) = 0;

/* effects of magic */
for (sust = GET_SUSTAINED(ch); sust; sust = sust->next)
if (!sust->caster)
spell_modify(ch, sust, TRUE);

if (GET_TRADITION(ch) == TRAD_ADEPT)
{
if (GET_INIT_DICE(ch) == 0)
GET_INIT_DICE(ch) += MIN(3, GET_POWER(ch, ADEPT_REFLEXES));
if (GET_REAL_REA(ch) == GET_REA(ch))
GET_REA(ch) += 2*MIN(3, GET_POWER(ch, ADEPT_REFLEXES));
GET_INIT_DICE(ch) += MIN(3, GET_POWER(ch, ADEPT_REFLEXES));
GET_REA(ch) += 2*MIN(3, GET_POWER(ch, ADEPT_REFLEXES));
GET_BOD(ch) += GET_POWER(ch, ADEPT_IMPROVED_BOD);
GET_QUI(ch) += GET_POWER(ch, ADEPT_IMPROVED_QUI);
GET_STR(ch) += GET_POWER(ch, ADEPT_IMPROVED_STR);
Expand All @@ -823,6 +828,10 @@ void affect_total(struct char_data * ch)
}
}

// We want the higher of either cyber+bio or magic/adept
GET_REA(ch) = (GET_REA(ch) > aug_rea) ? GET_REA(ch) : aug_rea;
GET_INIT_DICE(ch) = (GET_INIT_DICE(ch) > aug_init_dice) ? GET_INIT_DICE(ch) : aug_init_dice;

apply_drug_modifiers_to_ch(ch);

// Min attribute is one, max is soft capped
Expand Down