Skip to content

Commit

Permalink
Fix adept distance strike & penetrating strike interactions (#756)
Browse files Browse the repository at this point in the history
* If both distance & penetrating strike active, only distance strike applies

* Adept distance strike bypasses flame aura

* Prevent activating both adept dist strike & pen strike

* Add note about adept improved reflexes

* Distribute STDs

Looks like `-std=c++11` is missing from the compilation flags, which will throw errors as the compiler/standards advance. Making that explicit here.

---------

Co-authored-by: Lucien Sadi <luciensadi@gmail.com>
  • Loading branch information
jdevnull and luciensadi authored Oct 13, 2024
1 parent 7a736cd commit 7917ed2
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 5 deletions.
6 changes: 3 additions & 3 deletions src/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -31,20 +31,20 @@ BOOST_FLAGS = -lboost_filesystem

# You probably want to comment this out: This is the makefile specification for the GitHub runner.
LIBS = -lcrypt -L/usr/local/lib $(COMMON_FLAGS) $(BOOST_FLAGS) -lnsl -lcurl
MYFLAGS = -DNOCRYPT -Dlinux -I /usr/local/include/ -Wall -Wextra -Wno-unused-parameter
MYFLAGS = -DNOCRYPT -Dlinux -I /usr/local/include/ -Wall -Wextra -Wno-unused-parameter -std=c++11

# OSX? Uncomment these:
#LIBS = -L/usr/local/lib $(COMMON_FLAGS) $(BOOST_FLAGS) -lsodium -lcurl
#MYFLAGS = -DUSE_MEMORY_CANARIES -DDEBUG -DSELFADVANCE -Dosx -I /usr/local/include/ -Wall -Wextra -Wno-unused-parameter -std=c++11 -DSUPPRESS_MOB_SKILL_ERRORS -DACCELERATE_FOR_TESTING -D_GLIBCXX_DEBUG

# Linux / others? Uncomment these:
#LIBS = -lcrypt -L/usr/local/lib $(COMMON_FLAGS) -lnsl -lsodium -lcurl
#MYFLAGS = -DDEBUG_CRYPTO -DDEBUG -DSELFADVANCE -DIDLEDELETE_DRYRUN -Dlinux -I /usr/local/include/ -Wall -Wextra -Wno-unused-parameter -DSUPPRESS_MOB_SKILL_ERRORS
#MYFLAGS = -DDEBUG_CRYPTO -DDEBUG -DSELFADVANCE -DIDLEDELETE_DRYRUN -Dlinux -I /usr/local/include/ -Wall -Wextra -Wno-unused-parameter -DSUPPRESS_MOB_SKILL_ERRORS -std=c++11
# If you want GitHub integration, add -DGITHUB_INTEGRATION to the above and fill out your basic auth credentials in github_config.cpp.

# Cygwin:
#LIBS = -L/usr/local/lib $(COMMON_FLAGS) -lsodium -lcrypt
#MYFLAGS = -DDEBUG -DSELFADVANCE -DIDLEDELETE_DRYRUN -DWIN32 -I /usr/local/include/ -Wall -Wextra -Wno-unused-parameter -DSUPPRESS_MOB_SKILL_ERRORS
#MYFLAGS = -DDEBUG -DSELFADVANCE -DIDLEDELETE_DRYRUN -DWIN32 -I /usr/local/include/ -Wall -Wextra -Wno-unused-parameter -DSUPPRESS_MOB_SKILL_ERRORS -std=c++11

CPPFLAGS = $(MYFLAGS) $(PROFILE)

Expand Down
14 changes: 14 additions & 0 deletions src/act.obj.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4123,6 +4123,20 @@ ACMD(do_activate)
return;
}

// Prevent activation of incompatible powers.
// Penetrating strike can't be conbined with distance strike (SotA 2064, pg 67).
if ((i == ADEPT_DISTANCE_STRIKE) && GET_POWER(ch, ADEPT_PENETRATINGSTRIKE)) {
send_to_char("Distance strike is not compatible with penetrating strike.\r\n", ch);
return;
}
if ((i == ADEPT_PENETRATINGSTRIKE) && GET_POWER(ch, ADEPT_DISTANCE_STRIKE)) {
send_to_char("Penetrating strike is not compatible with distance strike.\r\n", ch);
return;
}
// Improved reflexes isn't checked/blocked here. Its incompatibility (as written in
// SR3, pg 169) can be interpreted as "does not stack" and so highest applies.
// This is also how its handled in handler.cpp: affect_total(struct char_data * ch)

if (i < ADEPT_NUMPOWER) {
if (desired_level == 0)
desired_level = GET_POWER_TOTAL(ch, i);
Expand Down
8 changes: 6 additions & 2 deletions src/newfight.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -780,7 +780,7 @@ bool hit_with_multiweapon_toggle(struct char_data *attacker, struct char_data *v
engage_close_combat_if_appropriate(att, def, net_reach);
engage_close_combat_if_appropriate(def, att, -net_reach);

if (!GET_POWER(att->ch, ADEPT_PENETRATINGSTRIKE) && GET_POWER(att->ch, ADEPT_DISTANCE_STRIKE)) {
if (GET_POWER(att->ch, ADEPT_DISTANCE_STRIKE)) {
// MitS 149: Ignore reach modifiers.
net_reach = 0;
}
Expand Down Expand Up @@ -920,7 +920,7 @@ bool hit_with_multiweapon_toggle(struct char_data *attacker, struct char_data *v

// If your enemy got more successes than you, guess what? You're the one who gets their face caved in.
if (net_successes < 0) {
if (!GET_POWER(att->ch, ADEPT_PENETRATINGSTRIKE) && GET_POWER(att->ch, ADEPT_DISTANCE_STRIKE)) {
if (GET_POWER(att->ch, ADEPT_DISTANCE_STRIKE)) {
// MitS 149: You cannot be counterstriked while using distance strike.
return FALSE;
}
Expand Down Expand Up @@ -1315,6 +1315,10 @@ bool handle_flame_aura(struct combat_data *att, struct combat_data *def) {
if (att->ranged_combat_mode || att->weapon)
return FALSE;

// no-op: adept distance strike
if (GET_POWER(att->ch, ADEPT_DISTANCE_STRIKE))
return FALSE;

int force = -1;

// Flameaura-flagged NPCs just use the larger of half their magic or their own full level as the force.
Expand Down

0 comments on commit 7917ed2

Please sign in to comment.