Because run_combat() didn't always exist. I'm still in the habit of telling mafia to adventure somewhere when I should say run_combat(). I use a place which I can't get to (and mafia doesn't know that), because I don't want to accidentally waste a turn in the noob cave.
I don't know what "finalized" means, but the oldest SVN commit not that mentions run_combat is this:Looking at SVN annotation, I'd argue that run_combat() was finalized in 2015 so there is a potential of 5 years when run_combat() didn't exist.
r8994 | veracity0 | 2011-02-01 18:02:16 -0500 (Tue, 01 Feb 2011) | 4 lines
Adjust with of Monster category in Fax Request Frame.
Allow run_combat to finish combat even when the CCS has a consult script which
didn't finish the combat.
r15235 | lostcalpolydude | 2015-01-19 13:23:44 -0500 (Mon, 19 Jan 2015) | 3 lines
Add buffer run_choice( int ) command. When in a choice adventure, use this to submit the selected option.
With -1 as imput, it will automate the rest of the choice using existing settings.
Also add run_turn(), which will work as run_combat() or run_choice( -1 ) depending on whether you are in combat or in a choice.
[9850] Barf Mountain
Encounter: angry tourist
Round 0: Veracity wins initiative!
Round 1: Veracity uses the seal tooth!
Round 2: angry tourist takes 1 damage.
Round 2: angry tourist drops 3 attack power.
Round 2: angry tourist drops 4 defense.
[9850] The Goatlet
KoLmafia thinks it is round 3 but KoL thinks it is round 2
Round 2: Veracity uses the seal tooth!
Round 3: angry tourist takes 1 damage.
Round 3: angry tourist drops 4 attack power.
Round 3: angry tourist drops 3 defense.
Round 3: You lose 1 hit point
Round 3: Veracity attacks!
Round 4: angry tourist takes 1261 damage.
Round 4: angry tourist drops 2 attack power.
Round 4: angry tourist drops 3 defense.
Round 4: Veracity wins the fight
[9850] The Goatlet
KoLmafia thinks it is round 3 but KoL thinks it is round 2
Yeah, this is nice. My God Lobster script I posted was written several years ago and looks for fight.php or choice.php in the result from visit_url. I could modernize it to use current_round() and handling_choice() to do the same thing without doing string searches.I think people just don't realise. I added current_round() a while ago just to give you what mafia believes the current round is, I see if I'm in a flight by checking if it is 0
[9851] Barf Mountain
Encounter: garbage tourist
Round 0: Veracity wins initiative!
Round 1: Veracity uses the seal tooth!
Round 2: garbage tourist takes 1 damage.
Round 2: garbage tourist drops 3 attack power.
Round 2: garbage tourist drops 3 defense.
KoLmafia thinks it is round 3 but KoL thinks it is round 2
KoLmafia thinks it is round 3 but KoL thinks it is round 2
Round 2: Veracity uses the seal tooth!
Round 3: garbage tourist takes 1 damage.
Round 3: garbage tourist drops 3 attack power.
Round 3: garbage tourist drops 3 defense.
KoLmafia thinks it is round 4 but KoL thinks it is round 3
Round 3: Veracity uses the seal tooth!
Round 4: garbage tourist takes 1 damage.
Round 4: Veracity attacks!
Round 5: garbage tourist takes 1260 damage.
Round 5: Veracity wins the fight!
You're fighting <span id='monname'>a tiny, shaky, restless, askew, stingy, ticking wailing mushroom guy</span>
<script>var ocrs = ["tiny","shakes","zoom","askew","stingy","ticking"];</script>
<script>newpic("https://s3.amazonaws.com/images.kingdomofloathing.com/adventureimages/salamander.gif", "a salamander",100,100);</script>
You cast CLEESH at your opponent. It turns into a salamander.
You're fighting <span id='monname'>a tiny, short, turgid, artisanal, American, cloud-based salamander</span>
<script>var ocrs = ["tiny","short","turgid","artisanal","patriotic","cloud"];</script>
You scratch your opponent with your seal tooth, doing 1 damage.
There is an issue when you transform a monster with random modifiers.
The random modifiers are rerolled for the new monster.
In the response to the transformation:
It displays the original monster with original modifiers
Manuel lists the new Atk/Def/HP but the original phylum/element/init
It changes the monster name and image in-place with Javascript.
--> The new name does not include the new modifiers
--> The new image is rendered using the old modifiers.
--> Manuel already had the new Atk/Def/HP, but still displays the old phylum/element/init
If you reload the page (twiddle), you get to see the new monster with the new modifiers.
Alternatively, you can just do a combat action and will see them next round.
That's not really advised; you'd prefer to choose your combat action based on the new modifiers.
-------
I equipped six pieces of dice gear and an Intergnat.
I adventured in The Hippy Camp (Bombed back to the Stone Age)
You're fighting an Australian, floating, broke, drunk, turgid, narcissistic caveman hippy NAMED NEIL
(Atk = 241 Def = 321 HP = 1,403 Hippy Stinky 20% Init)
cast Macrometeorite
(Atk = 250 Def = 207 HP = 260 Hippy Stinky 20% Init)
You're fighting a cavewomyn hippy
(Reload page - twiddle my thumbs)
You're fighting a left-handed, bouncing, askew, wet, American, frozen cavewomyn hippy WITH BACON!!!
(Atk = 250 Def = 207 HP = 260 Hippy Cold 25% Init)
cast CLEESH
(Atk = 3 Def = 2 HP = 3 Hippy Cold 25% Init)
You're fighting a newt
(Reload page - twiddle my thumbs)
(Atk = 3 Def = 2 HP = 3 Beast No element Never wins initiative)
You're fighting a tiny, cartwheeling, twirling, short, narcissistic, obscene newt WITH BACON!!!
-------
Looking at the HTML of those requests, here is what happens when I transform a monster:
fight.php?action=skill&whichskill=7290
You're fighting <span id='monname'>an Australian, floating, broke, drunk, turgid, narcissistic caveman hippy NAMED NEIL</span><!-- MONSTERID: 471 -->
<script type="text/javascript">var monsterstats = {"hp":"260","def":"207","off":"250"};</script>
<script>var ocrs = ["flip","floating","broke","drunk","appendimg:adventureimages\/ol_drunk.gif:0:0","turgid","narcissistic"];</script>
<script>newpic("https://s3.amazonaws.com/images.kingdomofloathing.com/adventureimages/cavewomyn.gif", "a cavewomyn hippy",100,100);</script>
You quickly step to the side, and the massive meteorite that was about to hit you instead hits your opponent, knocking them out of the way. You wander off to fight something else.
postwarisland.php
redirect to: fight.php
You're fighting <span id='monname'>a left-handed, bouncing, askew, wet, American, frozen cavewomyn hippy WITH BACON!!!</span><!-- MONSTERID: 472 --
<script type="text/javascript">var monsterstats = {"hp":"260","def":"250","off":"341"};</script>
<script>var ocrs = ["mirror","bouncing","askew","wet","appendimg:adventureimages\/water5.png:0:0","patriotic","frozen","appendimg:adventureimages\/ice_overlay.png:0:0"];</script>
You twiddle your thumbs.
fight.php?action=skill&whichskill=15
You're fighting <span id='monname'>a left-handed, bouncing, askew, wet, American, frozen cavewomyn hippy WITH BACON!!!</span><!-- MONSTERID: 472 -->
<script type="text/javascript">var monsterstats = {"hp":"3","def":"2","off":"3"};</script>
<script>var ocrs = ["mirror","bouncing","askew","wet","appendimg:adventureimages\/water5.png:0:0","patriotic","frozen","appendimg:adventureimages\/ice_overlay.png:0:0"];</script>
<script>newpic("https://s3.amazonaws.com/images.kingdomofloathing.com/adventureimages/newt.gif", "a newt",100,100);</script>
You cast CLEESH at your opponent. She turns into a newt.
postwarisland.php
redirect to: fight.php
You're fighting <span id='monname'>a tiny, cartwheeling, twirling, short, narcissistic, obscene newt WITH BACON!!!</span><!-- MONSTERID: 333 -->
<script type="text/javascript">var monsterstats = {"hp":"0","def":"2","off":"1"};</script>
<script>var ocrs = ["tiny","spinning","rotate","short","narcissistic","obscene","appendimg:adventureimages\/ol_censored.png:0:0"];</script>
You twiddle your thumbs.
----
Notice the issues, as the user sees them (until twiddle or next round)
Started out with an Australian, floating, broke, drunk, turgid, narcissistic caveman hippy NAMED NEIL
(Hippy, Stinky, Init 20)
Replaced with a left-handed, bouncing, askew, wet, American, frozen cavewomyn hippy WITH BACON!!!
--> The new random modifiers are not displayed
--> Says it is a Hippy - which is still true
--> Says it is Stinky, but it's really Cold
--> Says Init is 20% but is really 25%
Replaced with a tiny, cartwheeling, twirling, short, narcissistic, obscene newt WITH BACON!!!
--> The new random modifiers are not displayed
--> Says it is a Hippy, but it's really a Beast
--> Says it is Cold, but it's really (no element)
--> Says Init is 25% but is really (never wins initiative)
I've been diving into transforming monsters and how to recognize which monster you end up with.
tl;dr: I'd like you to include MONSTERID as an argument to the newpic() Javascript function.
It works like this.
I am in fight.php. I see monster X.
I submit an action which transforms the monster - CLEESH, CHEAT CODE: REPALCE MONSTER, Macrometeorite, etc.
The response shows me the picture of monster X - and MONSTERID is for X.
The text says that the monster is replaced. Depending on the skill, it may tell you what the new monster is. CLEESH does, CHEAT CODE: REPLACE ENEMY does not.
The following script runs:
newpic("/iii/adventureimages/newt.gif", "a newt",100,100);
newpic("/iii/adventureimages/fratboy.gif", "an Orcish Frat Boy",100,100);
newpic("/iii/adventureimages/darkness.gif", "the darkness",100,100);
Those are 3 examples. It is not really "/iii", although it could be.
So How do I tell, for sure, what the new monster is? MONSTERID on the page is the old monster.
The response to the next action - which could twiddling your thumbs - has the new MONSTERID.
So that is the guaranteed way to tell what the replacement monster is. Unfortunately, it requires an action.
How about looking up the monster by name? That works for "a newt", but there multiple Orcish Frat Boys:
62 = fratboy.gif
63 = fratboy.gif
64 = fratskirt.gif
527 = fratboy.gif (War Pledge)
(War Pledge shares the same image, which makes looking up by image even more complicated.)
Similarly for Ninja Snowman:
338 = ninjarice.gif
137 = snowman.gif
100 = snowman.gif
factory workers and factory overseers and mine workers and mine overseers all have male and female versions - but the images are distinct, at least.
I would like to be able to get the MONSTERID of the transformed monster from the same response text where the transformation happens.
I suggest the following:
Change the signature of the Javascript newpic() function.
newpic("/iii/adventureimages/newt.gif", "a newt",100,100,MONSTERID);
newpic("/iii/adventureimages/fratboy.gif", "an Orcish Frat Boy",100,100,MONSTERID);
newpic("/iii/adventureimages/darkness.gif", "the darkness",100,100,-1);
KoL doesn't need that in order to render the monster transformation, but it would make KoLmafia's life a lot easier.
Thanks for reading this bug report.
I have reproduced this for normal Haiku Denizens.I'm getting errors in The Haiku Dungeon.A sausage goblin that showed up was recognized fine.Code:[13920] The Haiku Dungeon Encounter: Knob Goblin poseur MONSTERID not found