rpherbig / dr-scripts

A series of Lich 5 (https://github.com/elanthia-online/lich-5) scripts for use with DragonRealms (http://www.play.net/dr/). Donations are welcome (http://www.paypal.me/rcuhljr)!
GNU General Public License v2.0
53 stars 178 forks source link

barb meditations will repeat if already up #2172

Closed xtremenerdrage closed 6 years ago

xtremenerdrage commented 6 years ago

Barb meditations will repeat over and over if already active example, if Med tenacity is already up you get this message when it does Med tenacity

[combat-trainer]>med tenacity
You begin to meditate upon the chakrel amulet, your inner fire swelling as you center your mind, body, and spirit.
Roundtime: 11 sec.

Peering into the flame you visualize swords, teeth and worse all rending your flesh.

You draw the flames close and bring forth a physical hardening to your body.

Your concentration slowly dissolves, leaving you vulnerable to physical harm.
The flame infuses your flesh, reinforcing it against physical damage!
You feel a jolt as your vision snaps shut.

[combat-trainer]>med tenacity
You begin to meditate upon the chakrel amulet, your inner fire swelling as you center your mind, body, and spirit.
Roundtime: 7 sec.

The jolt shows that it's already up, but the expired message also comes up, causing it to med tenacity again.

jbrock24 commented 6 years ago

Thought a lot about this, not really sure how to make this work within the current system. I think the best practice is to just make sure that you cancel all mediations before entering combat, similar to how we handle cyclics.

jbrock24 commented 6 years ago

@rpherbig What do you think of just canceling all mediations upon entering combat?

In Combat-Trainer:

 def setup(settings)
    Flags.add('ct-spellcast', '^Your formation of a targeting pattern around .+ has completed\.', 'Your target pattern has finished forming around the area', '^You feel fully prepared to cast your spell\.')

    Flags.add('last-stance', 'Setting your Evasion stance to \d+%, your Parry stance to \d+%, and your Shield stance to \d+%.  You have \d+ stance points left')

    bput('stance set 100 0 80', 'Setting your')

    bput('med stop', 'You') if DRStats.barbarian?

    @stop = false
    @running = true
    $debug_mode_ct = UserVars.combat_trainer_debug || settings.debug_mode
    @game_state = GameState.new(settings, @equipment_manager)
    @safety_process = SafetyProcess.new
    @combat_processes = make_processes(settings)
  end
jbrock24 commented 6 years ago

Since there are no mediations which can cause issues walking around, and since they only have an activation cost and not a no maintenance cost, I think ending them upon combat starting is better than at the end. This also avoids any issues with ending combat while one is going and forgetting to stop it later on.

xtremenerdrage commented 6 years ago

Seems reasonable, I was thinking maybe we could add a flag for the delayed message that could let it know to stop casting, but looking at the current system it wouldn't work. Only downside is IF drain at the beginning of combat, but other than that seems the best workaround for now

jbrock24 commented 6 years ago

It really shouldn't affect IF for people actively able to use meditations in combat. If backtraining say stealth, why are you actually even using a meditation?

I am testing this currently:

    @barb_buffs
      .select { |name| Flags["ap-#{name}-expired"] }
      .each do |name|
        Flags.reset("ap-#{name}-expired")
        start_barb_buff(name)
        pause 8 if name.include? "med"
      end

Basically, it's an 8 second pause, this is important if you start meditations back to back.