BatBrain -- a central nervous system for consult scripts

Magus_Prime

Well-known member
When fighting a storm cow I received the following in the gCLI:

Code:
This monster is stun immune! That information should be added to batfactors.

I don't know how to add something to batfactors. If someone who has access, and is familiar with the process, would make the update it would be appreciated.
 

zarqon

Well-known member
Yay! My new code for detecting stun immunity helped!

Anyone have any ideas for how to calculate the cost of Thunder, Rain, and/or Lightning? We get 3-5 Thunder per adventure and 1 Rain per adventure, but using valueOfAdventure here seems rather steep.

Though it doesn't quite feel right, I'm thinking of treating it as ranging linearly from actual adventure cost to free depending on your current total, with endpoints being the cost of the most expensive skill in that branch (around 40) and the maximum (100). In other words, if you're at max Rain, it'll be treated as free; if you have 50 or less Rain, it'll be treated as costing valueOfAdventure. Values in the middle would be scaled accordingly.

I'd prefer to have an actual number that works out to be basically correct all the time, but I have no idea how to arrive at such a number.
 

lostcalpolydude

Developer
Staff member
Lightning is worth at least 1 turn per 20 lightning if you have Lightning Strike, since that skill is basically just -1 turncount whenever you use it.

Rain and thunder are both weird though. I usually let thunder overflow because there isn't anything to spend it on, though I have found myself wanting to banish with it and not having thunder available. Rain is valuable as long as you have good Rain Man targets, and then its value drops off, except for the nuns where it's probably about 1 adventure per 20-25 rain depending on your other +meat sources.

I hope that helps (though I expect it doesn't).
 
"Attacks always hit" needs to be added for Thor's pliers too please. Or maybe not. They may hit, but not do any significant damage if you are under muscled. Elemental damage can jack that up though.
 
Last edited:

Bale

Minion
Anyone have any ideas for how to calculate the cost of Thunder, Rain, and/or Lightning? We get 3-5 Thunder per adventure and 1 Rain per adventure, but using valueOfAdventure here seems rather steep.

These are weird. They actually regenerate based on monsters killed, not adventures. (And Lightning regenerates at 1 per combat if you have Thor's Pliers equipped.)

The main use of Rain is to use Rain Man. Anytime you use Rain, it has to be balanced off against not using Rain Man. Consequently Rain should never be used by a script if the character has Rain Man. Never. Even if the character is at max Rain.

For Lightning, the main use is Lightning Strike. That is the only thing worth using Lightning for since it saves a turn. (If you have no other source of Yellow Ray I suppose Ball Lightning is acceptable.) Even more importantly it burns delay. It should be saved for use in a delay zone. It is like a free runaway that ALSO kills the monster, causing it to drop items and give experience. Lightning Strike is that awesome. BatBrain should probably not make use of these skills either.

Thunder is used for combat. Thunder also raises the Water Level and can buff HP, but those are small costs compared to the torrent of Thunder regeneration. Okay, the 40 Thunder for a banish is pretty serious, but I don't do that often enough to keep thunder from refreshing so thunder is definitely a combat suite. This is the only cost that I can accept being used by BatBrain.
 

lostcalpolydude

Developer
Staff member
For Lightning, the main use is Lightning Strike. That is the only thing worth using Lightning for since it saves a turn. Even more importantly it burns delay. It should be saved for use in a delay zone.

That strategy is wrong. Just like free runaways, it mostly doesn't matter what monster you use it against, it is -1 turncount regardless. The exception is if it preserves an effect, like +item or Ultrahydrated, in which case it can save slightly more than 1 turn per use.
 

Bale

Minion
Code:
float hitchance(string id) {        // HITCH-nce
   if (id == "jiggle") return 1.0;
   if (have_equipped($item[operation patriot shield]) && happened($skill[throw shield]) && !happened("shieldcrit")) return 1.0;
   [COLOR="#0000CD"][B]if (have_equipped($item[thor's pliers])) return 1.0;[/B][/COLOR]
 

Bale

Minion
OMG! I just noticed a serious lack in BatBrain. It does not know how to handle a Rain-Doh green lantern or snow mobile! (I'm doing softcore.)

Both of these items seriously increase the damage of spells! At the moment Ive tried adding the following near the bottom of add_skill()

Code:
      if(have_equipped($item[Rain-Doh green lantern]) || have_equipped($item[snow mobile])) {
         switch (sk) {
         case 3003: case 3005: case 3007: case 3008: case 3019: case 3020: case 3023: case 3022: 
         case 4003: case 4005: case 4009: case 4012: case 4020: case 4022: case 4023: case 4032: case 7099: 
         case 29: case 31: case 33: case 43: case 37: case 56:
         case 28: case 30: case 32: case 42: case 36: case 57:
		 case 55: case 110:
            float max_dmg;
            foreach el in d
               if(d[el] > max_dmg) max_dmg = d[el];
            d[ have_equipped($item[Rain-Doh green lantern])? $element[stench]: $element[cold] ] += max_dmg;
         }
      }

Unfortunately that doesn't seem to work for reasons which escape me.
 

Winterbay

Active member
For a small simplification: Isn't there a batbrain-function called is_spell() which should help out? (not that that helps with the not working part...)
 

zarqon

Well-known member
Thanks for giving me good things to copypasta, Bale. r42 brings us support for the two things you posted.

I am slightly suspicious that your lantern code didn't work because the variable d was still empty. That said, the code I added was basically functionally identical, and I haven't tested it, so I would appreciate feedback that it works. I also suspect that it will be overestimating its bonus damage, since there is wording on the Wiki about bonus elemental damage not being included.

Winterbay remembers correctly, there's an is_spell() you could have used to save a fair bit of typing. However, I took a look at the skill numbers you listed and ended up adding Shrap to is_spell(), so your typing was not in vain!

As for the pliers, there are a few edge cases I'd like to check to determine whether I've placed the code in the correct spot:

1) Does the always-hit mechanic supersede Cunctatitis?
2) Do the pliers successfully hit The Bat in Spats?

I coded it to assume "no" for both the above, as I tend toward pessimism -- i.e. safety -- in BatBrain.

Enjoy!

Also:

I'm still hemming and hawing about how to value Rains skills. A fair number of them will be custom skills and thus outside the value framework, but for the rest, the opportunity cost of using combat skills (preventing noncombat skills that share the same resource pool) is not something easily calculable. I appreciate lost and Bale weighing in on the matter and would appreciate even more feedback -- even if it's just a "+1".
 

xKiv

Active member
That strategy is wrong. Just like free runaways, it mostly doesn't matter what monster you use it against, it is -1 turncount regardless. The exception is if it preserves an effect, like +item or Ultrahydrated, in which case it can save slightly more than 1 turn per use.

Free runaways are only worth -1 turncount if you don't need the XP (or the drops/meat). That *probably* doesn't matter if you are running around with 100+ ml. Or maybe it does matter even at 150 ml if you are bloody edge speedy (I am not).
 

lostcalpolydude

Developer
Staff member
Free runaways are only worth -1 turncount if you don't need the XP (or the drops/meat). That *probably* doesn't matter if you are running around with 100+ ml. Or maybe it does matter even at 150 ml if you are bloody edge speedy (I am not).

Sure, but that's not especially relevant to the strategy of using them with respect to delay (which is that delay is completely irrelevant to the decision). It just means you want to target lower ML monsters when possible. Edit: For free runaways, not for Lightning Strike.
 
Last edited:

xKiv

Active member
Sure, but that's not especially relevant to the strategy of using them with respect to delay (which is that delay is completely irrelevant to the decision). It just means you want to target lower ML monsters when possible.

Right. That matters for things that can randomly overwrite whatever you are after.
 

lostcalpolydude

Developer
Staff member
Code:
float hitchance(string id) {        // HITCH-nce
   if (id == "jiggle") return 1.0;
   if (have_equipped($item[operation patriot shield]) && happened($skill[throw shield]) && !happened("shieldcrit")) return 1.0;
   [COLOR="#0000CD"][B]if (have_equipped($item[thor's pliers])) return 1.0;[/B][/COLOR]

Don't forget Red Fox glove or Comic Violence (gremlin juice). You can still fumble with those (and Thor's pliers) so I have a feeling this isn't the right place to add it anyway.
 

Crowther

Active member
I appreciate lost and Bale weighing in on the matter and would appreciate even more feedback -- even if it's just a "+1".
What Bale said seemed accurate to me. I don't want WHAM to use rain or lightning. I need to keep some thunder for banishing and maintaining the water level, but I get lazy and it overfills, so WHAM could use that.
 

zarqon

Well-known member
Don't forget Red Fox glove or Comic Violence (gremlin juice). You can still fumble with those (and Thor's pliers) so I have a feeling this isn't the right place to add it anyway.

Yep, that's not where I added it. Looks like I need to move it even further down, below fumbles (and add those other two you mentioned), as I'd assumed it also precluded fumbling.
 
Top