BatBrain -- a central nervous system for consult scripts

Winterbay

Active member
The entangling noodles first bit is probably due to WHAM deciding that you need to stun and then adding that to the top of the queue. I should probably check for the shield before doing that. It just hadn't occurred to me as I don't have a shield and is permanently in hardcore :)
 

zarqon

Well-known member
"Makes you a Crack Shot"... increases the hit chance of ranged combat by +100.

To clarify, you mean +100 to your attack stat for purposes of calculating hit chance, right? Not +100 to your actual hit chance, as worded?

@Winterbay: That's not too hard to fix. Will add it to the to-do list. Also, I like your joke for small programmers.

@zanmatoer: That friggin' shield is a huge problem to script for, for a variety of not-small reasons. Not the least of which being that BatBrain doesn't know anything about critical spell success.
 

Bale

Minion
To clarify, you mean +100 to your attack stat for purposes of calculating hit chance, right? Not +100 to your actual hit chance, as worded?

Loi. Yes. The other would raise hitchance over 100%. It would be like the Sunday Night Football equivalent of doing your best. I would hit the monster 160% of the time! What the hell would that even mean? Am I the only one who is deeply troubled whenever some sports icon says that he gives it 120%? Then some other idiot says that instead of 120% he gives it 150%. Like that actually means something!

I added the following line to my BatBrain so that it can properly kill monsters:

PHP:
if (have_equipped($item[operation patriot shield]) && my_class() == $class[Disco Bandit] && current_hit_stat() == $stat[moxie]) attack+= 100;
 
Last edited:

Winterbay

Active member
The OPS doesn't seem very well implemented as it stands. I only acquired one very recently, but WHAM used 'throw shield' before suckerpunch a whole lot... Often it would use "entangling noodles, throw shield, suckerpunch" to stasis with a megadrone in my CoT. Obviously "throw shield, entangling noodles, suckerpunch" would be infinitely preferable.

If this behaviour has been altered recently I apologise, I saw this happening a while ago and Bales post reminded me to mention it :)

Do you have any CLI output of it doing this? I'm just wondering what caused it to throw the shield in the first place since it is basically a 1-round stun and thus currently not taken into account by the stunning function (which only looks at Broadside and Noodles) and so I'm a bit confused as to why it would've been thrown at all. I can't find anything in batbrain, SS nor WHAM that would cause it to use that skill (even though it probably should if it could).
 

zarqon

Well-known member
That was probably the most profitable stasis action -- which is quite possible whenever the monster is able to damage you since it is both free and a stunner. Then, when it was no longer available, SS used the next most profitable stasis action.

@Bale: hahaha, that's exactly why I wanted to verify that. :) Also, why only Disco Bandits? Doesn't it increase hitchance for all ranged attacks, regardless of class?
 

xKiv

Active member
Doesn't it increase hitchance for all ranged attacks, regardless of class?

Doesn't it have different enchantments for different classes?

ETA: I mean, the ability would work for all classes, but only DBs ever get it
 

Bale

Minion
Also, why only Disco Bandits? Doesn't it increase hitchance for all ranged attacks, regardless of class?

Nope! Only Disco Bandits! I'd suggest that you check the wiki page for the awesome Operation Patriot Shield. In addition to a few powerful abilities, it also gives two additional and different special powers to each character class. Only DBs get the Crack Shot ability and +20 Ranged Damage. ATs get enhanced sing and 4 songs, TTs get HP regen and +5 Familiar Weight, PMs get MP regen and -3 Mp cost... and so on. It's awesome and different for every character class.

I adore the OPS. It's one of my fun reasons to play with Softcore since it is a slightly different Mr Item depending on what class I play. To enjoy it fully I need to use it for different classes.
 

zarqon

Well-known member
Ah right. Mind like a (rusty) steel trap.

This weekend I'm hoping to push out a bunch of updates, including that fix. Fingers crossed.
 

Bale

Minion
More for this weekend! Here's some updated data for Boris. A little late, but better than never.

Cleave: multiplies base weapon damage by 5.
Mighty Axing: multiplies base weapon damage by 2.
 

zarqon

Well-known member
So Mighty Axing does the same damage as Thrust-Smack? And Cleave does the same as Bashing Sham Slash? Handy.

I also noticed that like LTS, Bashing Spam Smack is an auto-hit when holding a club (+100% to hitchance! haha). Added that too. This update shall be glorious in its multifarious minutiæ.
 

zarqon

Well-known member
Since the actual name lends itself to being forgotten (also the other one: Volcanoradiodeoxyriboflavin Meteopaleoconiosis), I typically change it every time. But that was particularly piquant combination. Perhaps I should change the display name accordingly in BatMan RE, haha.

Sadly, when I searched Youtube for people being slapped in the face with spam, I was unable to find anything. Best I could find was a video of some people throwing spam at a glass door.
 

Winterbay

Active member
Is there a strange Mafia/batbrain conflict that makes Olfaction not available as an option against unknown monsters? For some reason
Code:
get_action("transcendent olfaction").id != "")
returns false every time against the new bugbears even though the skill is obviously available. And so macro($skill[olfaction]) fails, because it's not a real option.

I've worked around it now by adding my own macro-function that is used only for this purpose, but I feel it's a bit odd to have to do that.
 

zarqon

Well-known member
Olfaction (and any action flagged in batfactors with "custom", for that matter) is not included in opts[], since we don't want combat scripts to consider Olfaction as a regular combat option. If you'd like to perform Olfaction, you'll have to either 1) create the advevent yourself before enqueueing it, as SS does on line 149-ish, 2) call macro(string) to perform Olfaction non-predictively, or 3) edit the ftf_olfact setting.
 

Winterbay

Active member
Ahh right. It thought it may have been something like that. My failure was trying to use macro(advevent) rather than macro(string) :)
 

Winterbay

Active member
As reported over in the WHAM-thread: PADL-phones and COmunication windchimes does not work against the trandy bugbear chefs despite them being on the battlefield. This should probably be taken into accoutn by BatBrain in build_items().
 

Theraze

Active member
As per post 776, PADL and windchimes have issues with off-zone monsters. Mostly noted with the bugbears, but romantic arrows or festival wanderers could cause this as well. As such, I suggest changing
Code:
         case 2065: if (my_location() != $location[battlefield (frat uniform)] ||             // PADL phone
            string_modifier("Outfit") != "Frat Warrior Fatigues" || get_counters("PADL Phone",0,10) != "") continue;
         case 2354: if (to_float(my_stat("hp"))/my_maxhp() < 0.25) fields.pdmg = "-275";      // windchimes
             else if (to_float(my_stat("mp"))/my_maxmp() < 0.25) fields.special = "mp 175";
              else fields.dmg = "175";
            if (to_item(it) == $item[PADL phone]) break;
            if (my_location() != $location[battlefield (hippy uniform)] || get_counters("Communications Windchimes",0,10) != "" ||
                string_modifier("Outfit") != "War Hippy Fatigues") continue; break;
to
Code:
         case 2065: if (my_location() != $location[battlefield (frat uniform)] ||              // PADL phone
            string_modifier("Outfit") != "Frat Warrior Fatigues" || get_counters("PADL Phone",0,10) != "" || !(appearance_rates(my_location()) contains last_monster())) continue;
         case 2354: if (to_float(my_stat("hp"))/my_maxhp() < 0.25) fields.pdmg = "-275";      // windchimes
             else if (to_float(my_stat("mp"))/my_maxmp() < 0.25) fields.special = "mp 175";
              else fields.dmg = "175";
            if (to_item(it) == $item[PADL phone]) break;
            if (my_location() != $location[battlefield (hippy uniform)] || get_counters("Communications Windchimes",0,10) != "" ||
                string_modifier("Outfit") != "War Hippy Fatigues" || !(appearance_rates(my_location()) contains last_monster())) continue; break;

Basically, a check on appearance rates for your location (which has already been validated as the battlefield with the right uniform) and, if it does NOT contain the monster you're currently fighting, move on.

Edit: Hopefully I've fixed the code above. :)

Edit2: Alternative using hola's new 11124 code:
Code:
         case 2065: if (my_location() != $location[battlefield (frat uniform)] ||              // PADL phone
            string_modifier("Outfit") != "Frat Warrior Fatigues" || get_counters("PADL Phone",0,10) != "" || appearance_rates(my_location())[last_monster()] > 0)) continue;
         case 2354: if (to_float(my_stat("hp"))/my_maxhp() < 0.25) fields.pdmg = "-275";      // windchimes
             else if (to_float(my_stat("mp"))/my_maxmp() < 0.25) fields.special = "mp 175";
              else fields.dmg = "175";
            if (to_item(it) == $item[PADL phone]) break;
            if (my_location() != $location[battlefield (hippy uniform)] || get_counters("Communications Windchimes",0,10) != "" ||
                string_modifier("Outfit") != "War Hippy Fatigues" || appearance_rates(my_location())[last_monster()] > 0) continue; break;
Not sure which is better... the first has the advantage of working even on 'boss' monsters whose rate is officially 0, but are listed as being in the zone. The second might be faster. Time for the tracktime alias!
tracktime ash for i from 1 to 10000 print_html(appearance_rates(my_location())[last_monster()])

Returned: void
Time: 347
tracktime ash float [monster] rates; for i from 1 to 10000 { rates = appearance_rates(my_location()); if (rates contains last_monster()) print_html(rates[last_monster()]);}

Returned: void
Time: 378
Timing is basically a wash between them. Varied between 300-700 milliseconds for 10 thousand lookups.
 
Last edited:

zarqon

Well-known member
1.24 Update

Lots of little optimizations in this update:

  • Record happenings separately for id's containing multiple actions. Happenings will no longer contain "compound" actions. Previously, if you funkslung some items and then checked happened(just one item), it would return false, despite having actually happened.
  • The final tweak to combat completion detection. Even better checking than mafia's own (not fooled by the Bugged Bugbear's "fight.php" message)! Note that this fix finally makes BatMan RE compatible with the CAB.
  • The enchanted fire extinguisher makes spells cold.
  • Biffing Smarm Smack has 100% hitchance as a SC with a club.
  • The OPS gives +100 to attack for ranged DB's (thanks Bale!).
  • Account for HP/MP regen when considering loss as well as gain.
  • Reserve items possibly needed for the tower. This is presently about 90% finished -- it doesn't withhold tower items if your location is $location[none], since when you manually adventure at the tower your location is $location[none] and those items should be available there. However, that means that in certain other places which mafia considers $location[none], your tower items will still be unprotected.
  • Skip double-ice shards if you're in cold form (found this while basementing; you might never be able to kill it since it will resist all your damage).
  • Better figures for Mighty Axing and Cleave damage (thanks again Bale!).
  • PADL Phones and Communications Windchimes only affect native Battlefield monsters (thanks Theraze!).
  • Stasis sort improvement: ignore profit from deleveling if your attack action will one-shot the monster.
  • Don't get confused by DB combos when deciding whether or not to precede them with Mistletoe.
  • Better batround() response to dangerous poison -- try to remove it and keep going; only abort if that was unsuccessful.
  • When building the macro, skip inserting batround() if it doesn't contain anything.

@slyz: :)
 
Last edited:
Top