Bug - Fixed Incomplete parsing of cathedral battle

jasonharper

Developer
(Posted here so I don't lose any of the relevant details...)

Defeated a BRICKO Cathedral by funkslinging reactors; final combat page below.
Picture 4.png
HTML:
<html><head>
<script language=Javascript>
<!--
if (parent.frames.length == -1) location.href="game.php";
//-->
</script>
<script language=Javascript src="/images/scripts/keybinds.min.2.js"></script>
<script language=Javascript src="/images/scripts/window.js?date=20090915"></script>
<script language="javascript">function chatFocus(){if(top.chatpane.document.chatform.graf) top.chatpane.document.chatform.graf.focus();}
defaultBind(47, CTRL, chatFocus); defaultBind(190, CTRL, chatFocus);defaultBind(191, CTRL, chatFocus); defaultBind(47, META, chatFocus);defaultBind(190, META, chatFocus); defaultBind(191, META, chatFocus);</script><script language="javascript" src="/images/scripts/core.js"></script><script>
var onturn = 3;
function newpic(pic, name)
{
   var monpic = getObj('monpic');
   var monname = getObj('monname');
   monpic.src = pic;
   monname.innerHTML = name;
}

var waking = false;

function killforms(sub) {
	sub.disabled = true;
	var is = document.getElementsByTagName("input");
	for (i=0; i < is.length; i++) {
		if (is[i].getAttribute('type') == 'submit') { is[i].disabled = true; }
	}

	if (waking) { clearTimeout(waking); }
	waking = setTimeout(function () {
		for (i=0; i < is.length; i++) {
			if (is[i].getAttribute('type') == 'submit') { is[i].disabled = false; }
		}
	}, 3000);

	sub.form.submit();

	return true;
}


</script>
<link rel="stylesheet" type="text/css" href="http://images.kingdomofloathing.com/styles.css">
<script language="Javascript" src="/basics.js"></script><link rel="stylesheet" href="/basics.css" /></head>

<body onkeyup="handleCombatHotkey(event,false);" onkeydown="handleCombatHotkey(event,true);" ><div id="mafiabuttons"><center><table width="95%"><tr><td align=left><input type="button" onClick="document.location.href='inventory.php';void(0);" value="again" id="defaultButton"> <input type="button" onClick="document.location.href='inventory.php';void(0);" value="noodles" disabled> <input type="button" onClick="document.location.href='inventory.php';void(0);" value="olfaction" disabled> <input type="button" onClick="document.location.href='inventory.php';void(0);" value="script" disabled> <input type="button" onClick="document.location.href='inventory.php';void(0);" value="stream" disabled> <input type="button" onClick="document.location.href='inventory.php';void(0);" value="saucestorm" disabled> <input type="button" onClick="document.location.href='inventory.php';void(0);" value="saucy salve" disabled> <input type="button" onClick="document.location.href='inventory.php';void(0);" value="saucegeyser" disabled> <input type="button" onClick="document.location.href='inventory.php';void(0);" value="tango" disabled> </td><td align=right><select id="hotkeyViewer" onchange="updateCombatHotkey();"><option>- update hotkeys -</option><option>0: skill stream of sauce</option><option>1: item molybmagnet, sealtooth</option><option>2: </option><option>3: </option><option>4: </option><option>5: </option><option>6: </option><option>7: </option><option>8: </option><option>9: section default</option></select></td></tr></table></center></div>
<center><table  width=95%  cellspacing=0 cellpadding=0><tr><td style="color: white;" align=center bgcolor=blue><b>Combat: Round 0!</b></td></tr><tr><td style="padding: 5px; border: 1px solid blue;"><center><table><tr><td><center><table><tr><td><img id='monpic' src="http://images.kingdomofloathing.com/adventureimages/brickocathedral.gif" width=500 height=450 ></td><td valign=center></td></tr></table><br>You're fighting <span id='monname'>a BRICKO cathedral</span><table><tr><td valign=center><img src="http://images.kingdomofloathing.com/itemimages/brickoreactor.gif" width=30 height=30 alt="BRICKO reactor" title="BRICKO reactor"></td><td valign=center><p>You snap the reactor onto the top of your opponent and give it a good kick.  You dive for cover as it overloads and explodes, dealing 77633 damage and sending heaps of charred bricks flying in every direction.</td></tr></table><table><tr><td valign=center><img src="http://images.kingdomofloathing.com/itemimages/brickoreactor.gif" width=30 height=30 alt="BRICKO reactor" title="BRICKO reactor"></td><td valign=center><p>You snap the reactor onto the top of your opponent and give it a good kick.  You dive for cover as it overloads and explodes, dealing 11367 damage and sending heaps of charred bricks flying in every direction.</td></tr></table><p><center>You win the fight!<!--WINWINWIN--><p><!--familiarmessage--><center><table><tr><td align=center valign=center><img src="http://images.kingdomofloathing.com/itemimages/hounddog.gif" width=30 height=30></td><td valign=center><p>It's Good To Be King does a couple of karate moves, then swivels his hips and gyrates his pelvis.</td></tr></table></center><center><table class="item" style="float: none" rel="id=4489&s=5000&q=0&d=1&g=0&t=1&n=1&m=1&u=u"><tr><td><img src="http://images.kingdomofloathing.com/itemimages/brickogilded.gif" alt="gilded BRICKO brick" title="gilded BRICKO brick" class=hand onClick='descitem(817114403)'></td><td valign=center class=effect>You acquire an item: <b>gilded BRICKO brick</b></td></tr></table></center><p>You gain 50 Strongness.<bR>You gain 130 Enchantedness.<bR>You gain 53 Cheek.<bR><p></center><Center><a href="inventory.php">Back to your Inventory</a></center><script>parent.charpane.location.href="charpane.php";</script><script language="javascript">
	function updateParseItem(iid, field, info) {
		var tbl = $('#ic'+iid);
		var data = parseItem(tbl);
		if (!data) return;
		data[field] = info;
		var out = [];
		for (i in data) {
			if (!data.hasOwnProperty(i)) continue;
			out.push(i+'='+data[i]);
		}
		tbl.attr('rel', out.join('&'));
	}
	function parseItem(tbl) {
		tbl = $(tbl);
		var rel = tbl.attr('rel');
		var data = {};
		if (!rel) return data;
		var parts = rel.split('&');
		for (i in parts) {
			if (!parts.hasOwnProperty(i)) continue;
			var kv = parts[i].split('=');
			tbl.data(kv[0], kv[1]);
			data[kv[0]] = kv[1];
		}
		return data;
	}
</script><script language=Javascript src="/images/scripts/jquery-1.3.1.min.js"></script>
<script type="text/javascript" src="/images/scripts/pop_query.20090915.js"></script>
<script type="text/javascript" src="/images/scripts/ircm.20090928.js"></script>
<script type="text/javascript">
function pop_ircm_contents(i, some) {
	var contents = '';
	var shown = 0;
	one = 'one';
if (i.d==1 && i.s>0) { shown++; 
contents += '<div style="width:100%; padding-bottom: 3px;" rel="sellstuff.php?action=sell&ajax=1&type=quant&whichitem%5B%5D=IID&howmany=NUM&pwd=d866e9dcb203407af8c30f0c517cfefb" id="pircm_'+i.id+'"><b>Auto-Sell ('+i.s+' meat):</b> <a href="#" rel="1" class="small dojaxy">['+one+']</a>';
if (some) { contents += ' <a href="#" rel="?" class="small dojaxy">[some]</a> <a href="#" rel="'+i.n+'" class="small dojaxy">[all]</a>';}
contents += '</div>';
}
one = 'one';
if (i.u && i.u != ".") { shown++; 
contents += '<div style="width:100%; padding-bottom: 3px;" rel="inv_'+(lab=(i.u=="u"?"use":(i.u=="e"?"eat":(i.u=="b"?"booze":"equip"))))+'.php?ajax=1&whichitem=IID&itemquantity=NUM&quantity=NUM'+(i.u=="q"?"&action=equip":"")+'&pwd=d866e9dcb203407af8c30f0c517cfefb" id="pircm_'+i.id+'"><b>'+ucfirst(unescape(i.ou ? i.ou : (lab=="booze"?"drink":lab)))+':</b> <a href="#" rel="1" class="small dojaxy">['+one+']</a>';
if (some && i.u != 'q' && !(i.u=='u' && i.m==0)) { contents += ' <a href="#" rel="?" class="small dojaxy">[some]</a> <a href="#" rel="'+i.n+'" class="small dojaxy">[all]</a>';}
contents += '</div>';
}

	return [contents, shown];
}
var todo = [];
function nextAction() {
	var next_todo = todo.shift();
	if (next_todo) {
		eval(next_todo);
	}
}
function dojax(dourl, afterFunc, hoverCaller, failureFunc) {
	$.ajax({
		type: 'GET', url: dourl, cache: false,
		global: false,
		success: function (out) {
			nextAction();
			if (out.match(/no\|/)) {
				var parts = out.split(/\|/);
				if (failureFunc) failureFunc(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(); }
				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(); }
		}
	});
}</script></td></tr></table></center></td></tr><tr><td height=4></td></tr></table></center></body><script src="/hotkeys.js"></script><script src="/onfocus.js"></script></html>
However, CLI output (and the session log) is truncated:
Code:
[9174] BRICKO cathedral
Encounter: BRICKO cathedral
Round 0: seventh loses initiative!
Round 1: It's Good To Be King takes a pull on the hookah, and immediately goes into a coughing fit, blowing a cloud of smoke in your face. Since this is magic smoke, instead of giving you cancer (or, perhaps in addition to giving you cancer), it gives you an effect:
You acquire an effect: Newt Gets In Your Eyes (duration: 6 Adventures)
You lose 108 hit points
Round 1: seventh uses the green BRICKO brick!
Round 2: bricko cathedral takes 11000 damage.
Round 2: seventh uses the BRICKO reactor and uses the BRICKO reactor!
Round 3: bricko cathedral takes 77633 damage.
Damage from the 2nd reactor is missing, as is the final familiar action, stat gains, and the gilded brick drop (also missing from inventory). There didn't seem to be any hung threads, so it appears that the combat parser took an early exit, rather than getting stuck in a loop.
 

Veracity

Developer
Staff member
Revision 8482. (I assume: I reproduced and tested with a BRICKO python).
 
Last edited:
Top