New Content - Implemented 2016 Content item of the Year - Batfellow comic

Veracity

Developer
Staff member
Batfellow:

- How much time remains (0-600 minutes)
- Bat-Sedan location: Bat-Cave, Low/Medium/High Crime, Downtown
--> Bat-Fabricator available only in Bat-Cave
--> Orphanage, P. D., ChemiCorp available only Downtown
--> Various adventuring areas available only in appropriate zone
- Percentage explored for 9 boss zones
--> Boss killed = -1?
--> Boss area only open if exploration 0-100

- Combat skills remove a combat item from inventory
--> parsing topmenu is unnecessary if accurately track when items enter/leave inventory

- track upgrades purchased to Bat-Suit, Bat-Sedan, Bat-Cave
--> cost reduction of Bat-Fabricator

- track movement of Bat-Sedan via choice.php
--> sets Bad-Sedan location

= From charpane:
--> time remaining
--> Maximum HP (although derivable)
--> Current HP
--> Bat-Punch damage (although derivable)
--> Bat-Kick damage (although derivable)

- automation:
--> Do not use api.php when KoL asks for charpane.php

Code:
8954	special edition Batfellow comic	608798216	batfellowbook.gif	usable		0
# Item special edition Batfellow comic: Lets you have a fun adventure as a dark, brooding, bat-themed superhero.
Not tradeable, eh?
 

Veracity

Developer
Staff member
These are the stats or modifiers I am aware of:

Maximum Bat-Health (experimental gene therapy or combat increase)
(current) Bat-Health
Bat-Punch modifier (confidence-building hug)
Bat-Punch doubled (Hardened Knuckles)
Bat-Kick modifier (confidence-building hug)
Bat-Kick doubled (Steel-Toed Bat-Boots)
Bat-Armor (Pec-Guards or self-defense training)
Bat-Bulletproofing (Kevlar Undergarments or combat increased)
Bat-Health regeneration (combat increased)
Bat-Spooky resistance (Snugglybear Nightlight or combat increased)
Bat-Heat resistance (Asbestos Lining or combat increase)
Bat-Stench resistance (Bat-Freshener or combat increase?)

Here are some things that can appear after combat. I have not seen all of them. Neither I nor Wiki mentioned Bat-Stench Resistance, but Spooky and heat exist, so it seems possible.

- (+1 Bat-Health regeneration per fight)
- (+3 Maximum Bat-Health)
- (+1 Bat-Bulletproofing)
- (+10% Bat-Spooky Resistance)
- (+10% Bat-Heat Resistance)
- (+10% Bat-Stench Resistance)
- (+3% Bat-Progress)
- (+10 Bat-Minutes)
 

Veracity

Developer
Staff member
Since KoL itself has limitmode = "batman", I decided to split the non-request parts of BatFellowRequest (which aren't actually developed/used, yet) into a new module in session: BatManager.java. Also known as Bat-Manager.

I am sure zarqon will be pleased. :)
 

Bale

Minion
Here are some things that can appear after combat. I have not seen all of them. Neither I nor Wiki mentioned Bat-Stench Resistance, but Spooky and heat exist, so it seems possible.

You can get Stench resistance from fighting one of the plumbers in the Sewers.

I'm sure zarqon will be overjoyed by our new Bat manager.
 

Bale

Minion
Oh yeah. I remember that! It was very helpful on my first few runs before I started skipping 100% of the combats in that area.
 

Veracity

Developer
Staff member
More specific monsters with special effects:

inquisitee: (+1% Investigation Progress per fight)
time bandit: (+10 Bat-Minutes)

I guess the former is a Bat-Stat. Not that we track Bat-Progress, yet.
 

Xande1

Member
Including stuff here that the current version of mafia doesn't know about consumables:
Mansquito Serum gives 400 turns of More Mansquito than Man, no adventure gain. Statgain still unspaded, but somewhere around 25-40 each.
The Author's ink gives 200 turns of It's a Good Life!, no adventure gain or substats.
Code:
--------------------
2046 It's a Good Life! inkwell.gif c8e5625a3588796179a6f3a5dab1fc7f
Effect It's a Good Life! Experience: +10, Muscle Percent: +200, Mysticality Percent: +200, Moxie Percent: +200
--------------------
The Inquisitor's unidentifiable object is a spleenable, 1 toxicity, Level required 6. Gives 100 turns of The Inquisitor's Unknown Effect. no adventure gain. Substats still not spaded, but somewhere around 55-75 each.

Doc Clock's thyme cocktail is an epic booze, potency 4, level required 8, reduces fullness by 2. Wiki lists adventure gain at 26-29, and substats as 30-45 of each. I can't swear that's exactly right, but it certainly jibes with my experience.

All of the above consumables are only 1 per day. (I don't know if/how mafia tracks that.)
 
Last edited:

Veracity

Developer
Staff member
I've now played four Batfellow comics all the way through (and also use 2 without killing a boss, so they didn't get used up, just to test various things.) I have not studied any walkthroughs or mechanics articles, so there is clearly a lot I haven't seen yet. Even so, I think that what KoLmafia needs to support is getting clearer.

As always with KoL & KoLmafia, this is the paradigm:

- KoL has a data model which reflects the state of the game. Batfellow, in this case.
- KoL presents the game in the browser.
- The model determines what & how things are displayed
- User inputs modify the model.

- KoLmafia has a data model which reflects all aspects of KoL's data model that we care about.
- KoLmafia acts as an HTTP proxy and relays HTML requests/responses.
- KoLmafia learns the values of KoL's data by looking at browser responses.
- KoLmafia may or may not display those data outside of the browser
- KoLmafia should make those data available to scripts.

How do we "learn" KoL's data values in order to set KoLmafia's data values?

- We watch what happens when the user does things that change the model
- We scrape values from pages that the user visits
- KoL (might) provide api.php

Batfellow has stats, an inventory, "upgrades", time, and a location. I believe that only HP and items are accessible via api.php. So, if you exit KoL and log in again, assuming you end up where you left off in the Batfellow game (I have not dared try, since it costs $1 a pop to play, and I'm not willing to throw away money to experiment), restoring KoLmafia's data model is problematic. We can scrape things from the charpane and the topmenu, but there are all sorts of things that we can only deduce by looking at the Bat-Sedan or noticing post-combat messages.

1) Stats

Many (but not all) Bat-Stats are in the charpane.

In some cases, the charpane shows a composed value. For example, Bat-Punch damage is actually ( 5 + modifier ) * multiplier, but the single (current) value is shown. KoL obviously keeps the individual factors, since upgrades from Bat R&D, orphan hugs, and monsters affect them, and if you buy another hug, it updates correctly.

Other factors, such as Bat-Investigation, are not shown, but can be modified by upgrades - or a monster.

*** If we log in with limitmode=batman, we could recreate many (but not all) stats from the charpane. It sure would be nice if api.php?what=status (or what=batman) would give us the whole set.

2) Inventory

The topmenu is replaced with your inventory. We currently track the inventory accurately - acquiring items, spending them at shops, using them in battle. Therefore, we currently ignore the topmenu.

*** I have not looked at api.php?what=inventory. If that has (as expected) Batfellow's inventory, then that will suffice for refreshing state when you log in with limitmode=batman. Otherwise, we should scrape the topmenu.

3) Location

There are five: Bat-Cavern, Center Park, Slums, Industrial District, and Downtown. Unless you are in combat, you can see where you are: if you are in one of those, there will be various locations you can click on. If you are in the Bad-Sedan, you see a map - and your current location is not present, so you can deduce it.

*** The 4 Coinmasters should only be available if you are in the correct zone - Bat-Cavern or Downtown
*** If we log in with limitmode=batman, we can therefore either deduce the Location from the map we are shown or from the monster we are fighting.

4) Time

You start with 600 minutes. Your remaining time is displayed on the charpane.

- Traveling from zone to zone takes time, as modified by Bad-Sedan and Bat-Cavern upgrades
- Fights take time, as modified by a Bat-Cavern upgrade
- Using an exploding kickball sends the monster away without advancing time - although it does advance the combat count for the area.
- A Bat-Sedan upgrade allows healing for time with no travel.

*** We update Bat-Time only when we look at the charpane. For the purpose of automation, it would be nice to update it when any of the above actions change it.

5) Combat

Logging is not quite right; we are not advancing rounds correctly.

{45 m.} Porkham Asylum
Encounter: former inmate
Round 0: Batfellow wins initiative!
Round 0: Batfellow uses BAT-PUNCH!
Encounter: former inmate
Round 0: Batfellow loses initiative!
Round 1: former inmate takes 16 damage.
Round 1: You lose 7 hit points
Round 0: Batfellow uses BAT-KICK!
Encounter: former inmate
Round 0: Batfellow loses initiative!
Round 1: former inmate takes 18 damage.
Round 1: Batfellow wins the fight!
You acquire an item: high-tensile-strength fibers (3)
After Battle: You gain 2 hit points

That should be:

{45 m.} Porkham Asylum
Encounter: former inmate
Round 0: Batfellow wins initiative!
Round 0: Batfellow uses BAT-PUNCH!
Round 1: former inmate takes 16 damage.
Round 1: You lose 7 hit points
Round 1: Batfellow uses BAT-KICK!
Round 2: former inmate takes 18 damage.
Round 2: Batfellow wins the fight!
You acquire an item: high-tensile-strength fibers (3)
After Battle: You gain 2 hit points

6) Non-Combats

After 5 combats in any adventuring area, you are given a choice adventure which allows (up to) five things

- Full Heal
- +10% Investigation
- gain items
- (+25% investigation by spending an item)
- (+50% investigation by spending multiple items)

Gain items:

Casing the Conservatory (choice 1140) - 5 dangerous chemicals
Researching the Reservoir (choice 1141) - 5 kidnapped orphans
Combing the Cemetery (choice 1142) - 5 incriminating evidence
Searching the Sewers (choice 1143) - 6 explosives
Assessing the Asylum (choice 1144) - 6 high-grade metal
Looking Over the Library (choice 1145) - 6 fibers
Considering the Clock Factory (choice 1146) - 6 orphans + 6 explosives
Frisking the Foundry (choice 1147) - 6 chemicals + 6 metal
Taking Stock of the Trivia Company (choice 1148) - 6 evidence + 6 fibers

Items for 25% progress:

Casing the Conservatory (choice 1140) - glob of Bat-Glue
Researching the Reservoir (choice 1141) - Bat-Aid bandage
Combing the Cemetery (choice 1142) - bat-bearing
Searching the Sewers (choice 1143) - bat-oomerang
Assessing the Asylum (choice 1144) - bat-o-mite
Looking over the Library (choice 1145) - bat-jute
Considering the Clock Factory (choice 1146) - exploding kickball
Frisking the Foundry (choice 1147) - ultracoagulator
Taking Stock of the Trivia Company (choice 1148) - fingerprint dusting kit

Items for 50% progress:

Casing the Conservatory (choice 1140) - 3 fingerprint dusting kits
Researching the Reservoir (choice 1141) - 3 ultracoagulators
Combing the Cemetery (choice 1142) - 3 exploding kickballs

*** Are there 50% progress options for the Medium/High areas?
*** We should track combats in each area.
*** We should be aware when the next adventure in an area will be a noncombat.
*** Perhaps we should make that information visible. Annotate the charpane so show combats remaining until next non-combat?

7) Monsters

Monsters do not have an Attack or Defense. The do have HP.

- Monster Manuel in the quest log does not show HP, but he does show it in battle. Seems like this:

- Low/Medium/High-level non-bosses: 10/20/40
- Low/Medium/High-level bosses: 50/75/100

(I have not seen The Jokester yet, but the Wiki says he has 200 HP)

*** For those without Manuel, we should use those in monsters.txt, even though Manuel disagrees.

- Mooks are actually displayed using two images: a head and a body. The body might have no weapon, a melee weapon, or a gun. The type of weapon presumably affects the type of damage and, perhaps, the amount of damage.

*** Perhaps we should notice this and make the "weapon type" available in a proxy field for the specific mook you are fighting.
*** bat-arang disarms foe. I haven't tried it on a mook. Changes the image, I assume?

*** Manuel owners get Avatar potions for all bosses after 3 factoids. Should be in monsters.txt

8) Progress

All 9 adventuring zones have a "progress". You gain 3% normally, +1% for each of two upgrades, +1% if you beat an inquisitee, and +3% (?) from a fingerprint dusting kit. Your progress is also displayed after you win each fight.

The charpane displays something like:

Track down Kudzu (0% progress)
Defeat Kudzu

... or nothing about Kudzu, if you have beaten him

Similarly:

Learn the Jokester's access code: 123*5****

... will tell you which bosses have been defeated

*** We should make progress towards the 9 bosses available to scripts. Perhaps 0-100 and (something) if defeated
*** We should track progress after fights
*** When you log in with limitmode=batman, we can learn progress from charpane

9) Automation & UI

*** Since api.php is all but useless if limitmode=batman, the "refresh" button should probably call charpane.php
*** If you automate an adventure, when KoL asks for a charpane refresh, we call api.php instead. Not for batman...
*** The green sidepane is pretty useless during batman. We could customize it if limitmode=batman. Meh.
 

xKiv

Active member
So, if you exit KoL and log in again, assuming you end up where you left off in the Batfellow game (I have not dared try, since it costs $1 a pop to play, and I'm not willing to throw away money to experiment), restoring KoLmafia's data model is problematic.

People have reported that "being a batfellow" persists over rollover. I don't know if they logged out before rollover, or just let it hit, though.
Also, there may be some redirecting before the game recognizes being batfellow again (one report mentions the main map flashing first).
 

Xande1

Member
Comments on Veracity's post, since I've played way more than my share of Batfellow:

*** Are there 50% progress options for the Medium/High areas?
I've done those areas with a sufficiently decked-out inventory to say with 99.99% certainty that there are NOT.

Gain items
Just for the record, the numbers of items listed are base. With the "Improved Cowl Optics" upgrade, you get ~2-3 more of each item.

Monsters do not have an Attack or Defense.
Monsters (and Batfellow) always hit. Batfellow always does full damage to monsters. Monsters have (fixed) damage and a "type". Types seem to be melee, gun, stench, spooky, and hot. Gun damage can get multiple hits per round (1, 3, or 5, again, fixed per monster) Each hit by melee and gun are reduced by the amount of the appropriate type of armor, to a minimum of 1 per hit. Stench, spooky, and hot are reduced by their relevant percent resistances. Disarming both changes damage type to melee, and cuts damage amount substantially. (I can't say for sure that it's 1, since by the time I'm facing armed enemies who aren't instakilled by a bat-erang, I usually have several levels of armor.)

EDIT: More info on Batfellow's damage: The first punch or kick in a combat will do listed damage. If you repeat the action, the repeat will also do listed damage. If you alternate punches and kicks (starting with either) each attack that combat after the first gets a cumulative +1 damage, which is applied before the double-damage upgrades. Example, just to make it clear, if you have double-damage punches, and no other upgrades, the listed damage will be punch: 10, kick: 5. Actual sequence of damage will be as follows:
punch (10), kick (6), punch (14), kick (8), punch (18)...
OR kick (5), punch (12), kick (7), punch (16)...

Also, most combat items do damage:
bat-erang: 20 damage + disarms an armed foe
bat-jute: 10 damage. If that damage kills the enemy +3% exploration
bat-omite: 50 damage.
bat-bearing: 15 damage + stagger
bat-bandaid: Heal 20hp + stagger
bat-glue: stun (2 rounds vs. bosses; longer vs. regular enemies)
kickball: regular enemies: skip combat; bosses: 35 (or 30? need to double-check) damage + stagger
ultracoagulator: heal all hp + stagger

Nothing is stun or stagger immune.

- Monster Manuel in the quest log does not show HP, but he does show it in battle. Seems like this:
- Low/Medium/High-level non-bosses: 10/20/40
- Low/Medium/High-level bosses: 50/75/100
Boss HP for Low bosses is 20, not 50.
Non-boss hp is approximately correct, but varies slightly from monster-type to monster-type (although I'm 90% certain all monsters of a given type have the same HP total). E.g., Low-level mooks have 10 hp, but the mosquitos and plant creatures have 11 hp. I'll try to fill this out in my next playthroughs.

- Mooks are actually displayed using two images: a head and a body. The body might have no weapon, a melee weapon, or a gun. The type of weapon presumably affects the type of damage and, perhaps, the amount of damage.
This doesn't just apply to mooks. The Burner enemy in the Foundry, and the Time Bandit in the Clock Tower also have multiple body images for armed/disarmed; there may be another example I'm not thinking of. Beyond that, correct: weapon affects damage type and amount (see above).

*** bat-arang disarms foe. I haven't tried it on a mook. Changes the image, I assume?
Yes, changes the image. Also changes damage type (assuming the weapon wasn't a melee weapon) to melee, and reduces damage amount. (see above)

Yes, fingerprint kit is +3% progress. It gets used up even if it's unnecessary (i.e., in a fight where the area was at 99% completed, a kit will still be used, even though the area would have been completed without the kit bonus). Also, what fractalnavel said about bat-jutes.
 
Last edited:

cubeof11

New member
xKiv, when logging in to the Kingdom in the middle of a limit mode, you'll see the main map display for a second before you're sent back to the relevant map for that mode.

This is an HTML snippet of the normal main.php when logging in:

HTML:
<script language="javascript">function chatFocus(){if(top.chatpane.document.chatform.graf) top.chatpane.document.chatform.graf.focus();}
if (typeof defaultBind != 'undefined') { defaultBind(47, 2, chatFocus); defaultBind(190, 2, chatFocus);defaultBind(191, 2, chatFocus); defaultBind(47, 8, chatFocus);defaultBind(190, 8, chatFocus); defaultBind(191, 8, chatFocus); }</script><script> var todo = [];
function nextAction() {
	var next_todo = todo.shift();
	if (next_todo) {
		eval(next_todo);
	}
}
function dojax(dourl, afterFunc, hoverCaller, failureFunc, method, params) {
	$.ajax({
		type: method || 'GET', url: dourl, cache: false,
		data: params || null,
		global: false,
		success: function (out) {
			nextAction();
			if (out.match(/no\|/)) {
				var parts = out.split(/\|/);
				if (failureFunc) failureFunc(parts[1]);
				else if (window.dojaxFailure) window.dojaxFailure(parts[1]);
				else if (top.chatpane.handleMessage) top.chatpane.handleMessage({type: 'event', msg: 'Oops!  Sorry, Dave, you appear to be ' + parts[1]});
				else  $('#ChatWindow').append('<font color="green">Oops!  Sorry, Dave, you appear to be ' + parts[1] + '.</font><br />' + "\n");
				return;
			}

			if (hoverCaller)  {
				float_results(hoverCaller, out);
				if (afterFunc) { afterFunc(out); }
				return;
			}
$(top.mainpane.document).find("#effdiv").remove(); if(!window.dontscroll || (window.dontscroll && dontscroll==0)) { window.scroll(0,0);}
			var $eff = $(top.mainpane.document).find('#effdiv');
			if ($eff.length == 0) {
				var d = top.mainpane.document.createElement('DIV');
				d.id = 'effdiv';
				var b = top.mainpane.document.body;
				if ($('#content_').length > 0) {
					b = $('#content_ div:first')[0];
				}
				b.insertBefore(d, b.firstChild);
				$eff = $(d);
			}
			$eff.find('a[name="effdivtop"]').remove().end()
				.prepend('<a name="effdivtop"></a><center>' + out + '</center>').css('display','block');
			if (!window.dontscroll || (window.dontscroll && dontscroll==0)) {
				top.mainpane.document.location = top.mainpane.document.location + "#effdivtop";
			}
			if (afterFunc) { afterFunc(out); }
		}
	});
}
</script><script language=Javascript src="//images.kingdomofloathing.com/scripts/jquery-1.3.1.min.js"></script>

This is the corresponding HTML snippet of the mid-Spelunking main.php when logging in (note the META redirect):

HTML:
<script language="javascript">function chatFocus(){if(top.chatpane.document.chatform.graf) top.chatpane.document.chatform.graf.focus();}
if (typeof defaultBind != 'undefined') { defaultBind(47, 2, chatFocus); defaultBind(190, 2, chatFocus);defaultBind(191, 2, chatFocus); defaultBind(47, 8, chatFocus);defaultBind(190, 8, chatFocus); defaultBind(191, 8, chatFocus); }</script><meta http-equiv="Refresh" content="1;url=place.php?whichplace=spelunky"><script language=Javascript src="//images.kingdomofloathing.com/scripts/jquery-1.3.1.min.js"></script>
 

Veracity

Developer
Staff member
So, yesterday I used three Batfellow comics and got the Jokester for the first (three) times and finished off my factoids. I also happened to get a replica bat-oomerang.

There is plenty more work to do here, but, at this point, I'll be taking my time on it. I am happy with how things log and with how we handle things so far.

I have another 12 runs to make to unlock the content for good (i.e., get my weekly special edition comic), and I will do them, by and by - and, I am sure, pick up the tattoo somewhere along the way - but don't expect my support to continue at the level I've been giving it in recent days.
 

Xande1

Member
Quick note, that's probably much quicker to type than to fix: enemies in Batfellow are not affected by your ML modifiers (particularly MCD), mafia thinks they are.
 
Top