-
Notifications
You must be signed in to change notification settings - Fork 179
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
[script] [combat-trainer] Don't face/engage when using Innocence #5792
base: main
Are you sure you want to change the base?
Changes from 1 commit
1717ab7
6440959
350b553
8620d83
7f5419f
8a2123a
7e88895
45064d7
f7d03ad
8cd9be2
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2230,6 +2230,7 @@ class AbilityProcess | |
timer = game_state.cooldown_timers['Battle Cry'] | ||
return unless !timer || (Time.now - timer).to_i > @battle_cry_cooldown | ||
return unless game_state.npcs.length > 0 | ||
return unless game_state.is_engaging_allowed? | ||
|
||
Flags.reset('ct-battle-cry-not-facing') | ||
|
||
|
@@ -2507,7 +2508,7 @@ class TrainerProcess | |
waitrt? | ||
fix_standing | ||
when /^Tactics$/i | ||
bput($tactics_actions.sample, 'roundtime', 'There is nothing else', 'Face what', 'You must be closer', 'You must be standing', 'Strangely, you don\'t feel like fighting right now', 'flying too high for you to attack') unless game_state.npcs.empty? | ||
bput($tactics_actions.sample, 'roundtime', 'There is nothing else', 'Face what', 'You must be closer', 'You must be standing', 'Strangely, you don\'t feel like fighting right now', 'flying too high for you to attack') unless game_state.npcs.empty? || !game_state.is_engaging_allowed? | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'm not super familiar with Innocence (I just read its entry on elanthipedia), so maybe this is a dumb question. Why would someone using Innocence also be training Tactics? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It's fair, there are a couple "should never happen" examples here -- see also training Astrology, since Innocence is an empath signature spell. However, it also felt like |
||
when /^Analyze$/i | ||
analyze(game_state, 0) | ||
when /^Hunt$/i | ||
|
@@ -2567,7 +2568,7 @@ class TrainerProcess | |
when /^Collect$/i | ||
game_state.sheath_whirlwind_offhand | ||
retreat | ||
put('engage') unless game_state.npcs.empty? || game_state.retreating? | ||
put('engage') unless game_state.npcs.empty? || game_state.retreating? || !game_state.is_engaging_allowed? | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. What do you think about making a function on game_state ( There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yeah, I thought about that. Also considered making There are some cases where we'll completely skip some actions when retreating that we should be able to do while using Innocence, so they're not quite the same thing, but there is a lot of repeat/overlap. Maybe it would make sense to also include There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This could also address a number of the other concerns. "Why would an empath..." "Why would someone using Innocence..." Generalizes more to "prevent us from issuing a |
||
collect(@forage_item) | ||
waitrt? | ||
game_state.wield_whirlwind_offhand | ||
|
@@ -2617,7 +2618,7 @@ class TrainerProcess | |
|
||
game_state.sheath_whirlwind_offhand if game_state.currently_whirlwinding | ||
retreat | ||
fput('engage') unless game_state.npcs.empty? || game_state.retreating? | ||
fput('engage') unless game_state.npcs.empty? || game_state.retreating? || !game_state.is_engaging_allowed? | ||
bput("get my #{@almanac}", 'You get', 'What were') | ||
if training_skill | ||
bput("turn #{@almanac} to #{training_skill}", 'You turn', 'You attempt to turn') | ||
|
@@ -2762,6 +2763,7 @@ class TrainerProcess | |
return if game_state.npcs.empty? | ||
return if fail_count > @analyze_retry_count | ||
return if DRSkill.getxp('Tactics') >= @combat_training_abilities_target | ||
return unless game_state.is_engaging_allowed? | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'm not super familiar with Innocence (I just read its entry on elanthipedia), so maybe this is a dumb question. Why would someone using Innocence also be using Analyze? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Misconfiguration? It should be safe to return here regardless, as the two are mutually exclusive. |
||
case bput('analyze', 'roundtime', 'Analyze what', 'Your analysis reveals a massive opening', /You reveal an? .* (?:weakness|opening)/, /Your analysis reveals an? .* (?:weakness|opening)/, 'You fail to find any holes', 'There is nothing else', 'Face what', 'You must be closer', 'You must be standing', 'Strangely, you don\'t feel like fighting right now', 'flying too high for you to attack', 'Bumbling, you slip') # unless | ||
when 'Analyze what' | ||
case bput('face next', 'There is nothing else', 'You turn', 'What are you trying', 'Face what') | ||
|
@@ -2807,7 +2809,7 @@ class TrainerProcess | |
if DRSkill.getrank('Astrology') <= 120 | ||
DRCMM.predict('weather') | ||
waitrt? | ||
fput('engage') | ||
fput('engage') if game_state.is_engaging_allowed? | ||
else | ||
retreat | ||
check_heavens(game_state) | ||
|
@@ -3039,6 +3041,8 @@ class AttackProcess | |
end | ||
|
||
def attack_melee(charged_maneuver, game_state) | ||
return unless game_state.is_engaging_allowed? | ||
|
||
waitrt? | ||
|
||
maneuver_success = false | ||
|
@@ -3351,7 +3355,7 @@ class AttackProcess | |
def execute_aiming_action?(action, game_state) | ||
case bput(action, 'Roundtime', 'close enough', 'What are you', 'There is nothing', 'must be closer', 'Bumbling, you slip') | ||
when 'close enough', 'must be closer' | ||
return false if game_state.retreating? | ||
return false if game_state.retreating? || !game_state.is_engaging_allowed? | ||
fput('engage') | ||
pause 2.5 | ||
when 'What are you', 'There is nothing' | ||
|
@@ -3407,7 +3411,7 @@ class AttackProcess | |
end | ||
|
||
def dance(game_state) | ||
if game_state.npcs.empty? | ||
if game_state.npcs.empty? || !game_state.is_engaging_allowed? | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Do dance actions break Innocence? If not, should this check be moved to line 3420? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yes, the But dance commands like |
||
pause 1 | ||
else | ||
game_state.set_dance_queue | ||
|
@@ -3981,6 +3985,10 @@ class GameState | |
!@clean_up_step.nil? | ||
end | ||
|
||
def is_engaging_allowed? | ||
!DRSpells.active_spells['Innocence'] | ||
end | ||
|
||
def is_offense_allowed? | ||
return true if is_permashocked? | ||
return true if @construct_mode | ||
|
@@ -4777,6 +4785,7 @@ class GameState | |
def perform_analyze?(combo_type, expertise_requirement) | ||
return false if combo_type != 'flame' && !Flags["ct-#{combo_type}-ready"] && DRStats.barbarian? | ||
return false if DRSkill.getrank('Expertise') < expertise_requirement | ||
return false unless is_engaging_allowed? | ||
|
||
result = bput("analyze #{combo_type}", 'cannot repeat', 'Analyze what\?', 'by landing an? .*', 'You need to hold', 'You must be closer', 'You fail to find any','What are you trying to attack\?') | ||
waitrt? | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Battle cries are Bardic. Would a Bard ever be using Innocence?