New Content - Implemented PvP Changes

lostcalpolydude

Developer
Staff member
Attacking for mainstat is not a thing this season. Instead, you can pick any of the minis to use, with the other 6 selected randomly. There's likely something we should change for that, but I haven't started looking at any code yet. I'm pretty sure we can't assume that future seasons will work exactly like this either.
 

Veracity

Developer
Staff member
Interesting. The obvious thing to change is the "pvp" command, which lets you specify "muscle", "myst", "moxie", or "ballyhoo" as your "stance". It passes the "stance" to PvpManager.executePvPRequest, which uses it to construct a PeeVPeeRequest as the value of the "stance" form field. PvpManager also has a "pickStance" method which picks based on your best adjusted stats.

Looks like a fair amount of work, but the first question I'd have is: what does peevpee.php require right now? Does it still have a "stance" form field? If so, what values does it take?

I.e., what is the mechanic used to specify that you want to pick a particular mini?
 

Bale

Minion
Yep, It uses a stance field. Here:

HTML:
<body>
<center><table  width=95%  cellspacing=0 cellpadding=0><tr><td style="color: white;" align=center bgcolor=blue><b>Results:</b></td></tr><tr><td style="padding: 5px; border: 1px solid blue;"><center><table><tr><td>Allegiance pledged, commence fighting.</td></tr></table></center></td></tr><tr><td height=4></td></tr></table><table  width=95%  cellspacing=0 cellpadding=0><tr><td style="color: white;" align=center bgcolor=blue><b>Pick a Fight</b></td></tr><tr><td style="padding: 5px; border: 1px solid blue;"><center><table><tr><td>			<form action="peevpee.php" method="post">
				<input type=hidden name="action" value="fight" />
				<input type=hidden name="place" value="fight" />
				<input type=hidden name=pwd value="6264c6cc4a676ea958b789b81ce650d0" />
			
				Attack 
				<select name="ranked" id="ranked">
					<option value="1" >a random opponent (+1 swagger)</option>
					<option value="2" >a random tougher opponent (+1 swagger, increased Fame gain)</option>
					<option value="0" >a specific player</option>
				</select>
				<span class="ranked0 ranked hide">
				<input class=text type=text size=10 id="who" name=who  />!  
								<a id="searchp" href="searchplayer.php?for=pvp&hc=1" target="_new" class="if"><font size=1>[search players]</font></a>
								<div class="ift"></div>
				</span>
				<span class="ranked1 ranked"></span>
				<br />
				Use your
				<select name="stance"><option value="0" >Bear Hugs All Around</option><option value="1" selected>Beary Famous</option><option value="2" >Barely Dressed</option><option value="3" >Basket Reaver</option><option value="4" >Polar Envy</option><option value="5" >Maul Power</option><option value="6" >Grave Robbery</option><option value="7" >Most Things Eaten</option><option value="8" >Hibernation Ready</option><option value="9" >Visiting the Cousins</option><option value="10" >Northern Digestion</option><option value="11" >Most Murderous</option></select>				and try to take some
								<select name="attacktype">
					<option selected="selected"  class="ranked ranked1 ranked2"  value=fame>Fame<br>
					<option  class="ranked ranked1 ranked0 ranked2"  value=flowers>Flowers<br>
									</select>.
			
				<table>
				<tr>
					<td>If I win, shout:</td><td><input class=text type=text size=30 maxlength=50 name=winmessage value="I want a stuffed Hodgman, not a flower... Darnit."><input type=checkbox name=setdefaultwin><small>(set as default)</small></td>
				</tr>
				<tr>
					<td>If I lose, whimper:</td><td><input class=text type=text size=30 maxlength=50 name=losemessage value="You can take my life, but not my dignity. Umm..."><input type=checkbox name=setdefaultlose><small>(set as default)</small></td>
				</tr>
				<tr><td colspan="2" align="center"><a href="peevpee.php?place=defmes"><small>[Set Defensive Messages]</small></a></td></tr>
				</table>
				<center>
					<p><input class=button type=submit value="A Fighter is You!" id="doattack">
					<p>You have 10 fights remaining today.</p>
				</center>
			</form>
			<p><center><a href="peevpee.php">Back to The Colosseum</a></center></td></tr></table></center></td></tr><tr><td height=4></td></tr></table></center></body>
 

Veracity

Developer
Staff member
Code:
<select name="stance"><option value="0" >Bear Hugs All Around</option><option value="1" selected>Beary Famous</option><option value="2" >Barely Dressed</option><option value="3" >Basket Reaver</option><option value="4" >Polar Envy</option><option value="5" >Maul Power</option><option value="6" >Grave Robbery</option><option value="7" >Most Things Eaten</option><option value="8" >Hibernation Ready</option><option value="9" >Visiting the Cousins</option><option value="10" >Northern Digestion</option><option value="11" >Most Murderous</option></select>
This is the mapping between mini name and stance #. Prior to this season, that dropdown would have been something like this:

Code:
<select name="stance"><option value="1" selected>Bully</option><option value="2" >Burninate</option><option value="3" >Backstab</option><option value="4" >Ballyhoo</option></select>
Seems like we could visit the pvp page, once per day, to fetch what today's mini name to stance # mapping is.

We could make the "pvp" command accept a (fuzzy matched) mini name to look up in that mapping.
We should, presumably, provide a command which will visit the page and look up the minis and list them for you.
The existing code to choose a default via highest buffed stat makes sense only if we know that the first three options are stat-based. Perhaps we should not allow for a default?

In any case, I don't want to hardcode the minis - even though that would allow us to annotate them. I broke my stone today and used a CSA firestarter and did my 13 fites using Maul Power - even though that was not the one I thought I was using. It worked out OK - I won 12 of 13 - but there was a clear better choice for me...

Perhaps a command to visit the fite page and list the available minis and the stance # they correspond to, and then make the stance parameter of the PVP commands accept a number?

Any other thoughts?
 

Bale

Minion
How about checking the fite page the first time the pvp command. It can then store the result for the rest of the session in case the pvp command is used again. Having to use a separate command to check the pvp page would be cumbersome and unnecessary since mafia should know when it needs to do that.
 

Darzil

Developer
If we kept the information in a preference, along with the date it was read, we'd know when to update, as the reset happens at a fixed time every 2 months.
 

Veracity

Developer
Staff member
> pvp

0: Bear Hugs All Around
1: Beary Famous
2: Barely Dressed
3: Basket Reaver
4: Polar Envy
6: Grave Robbery
7: Most Things Eaten
8: Hibernation Ready
9: Visiting the Cousins
10: Northern Digestion
11: Most Murderous

> pvp 1 fame Grave Robbery

Use 1 PVP attacks to steal fame via Grave Robbery
Attack 1 of 1
You challenged kenny KAmaKAzi and won the PvP fight, 6 to 1!
You have 90 attacks remaining.

> pvp 1 fame 6

Use 1 PVP attacks to steal fame via Grave Robbery
Attack 1 of 1
You challenged Thisguy and won the PvP fight, 6 to 1!
You have 89 attacks remaining.
Revision 15791 let me do the above.

For now, it determines the available stances the first time you do a "pvp" command. That command with no arguments lists the stances by number and name, as you can see, and you must specify a stance to use, either by number or name, since we can no longer choose a reasonable stance for you based on your stats.

Things to do before this is done:

- Remembering the stances in a setting, as Darzil suggests, since there is really no reason to read them every session.
- Since we read the stances from the dropdown, we can't do that if you have no fights remaining. Which is probably OK, since you can't fight, anyway.
- The "flowers" command (which I have never used) has not been changed; it uses stance 0 - which used to mean "pick one for me".
- Ditto for the "attack" command, which attacks specific players. Again, I have never used this and don't expect to ever use it, so perhaps somebody who cares - and is willing/able to test it - might want to change that to require a stance to take, much as I did for the "pvp" command.
 

lostcalpolydude

Developer
Staff member
I think it's fine to leave "flowers" as is.

I will update the "attack" command. The hard part will be deciding on a syntax, I think.
 
Last edited:

Veracity

Developer
Staff member
Revision 15795 does fuzzy matching of stance name for "pvp" and "attack" commands.

Probably the only thing left is to save the stances in a preference and load from there rather than hitting the server, if appropriate. Although, I don't mind hitting the server once a session, since it means we don't have to hardcode knowledge of when PVP seasons start and depend on your computer's clock being set correctly for us to recognize that.

Saving the stances in a setting when we read them could be useful for scripts, though.
 

Veracity

Developer
Staff member
Actually, I'm thinking of doing this, rather than a setting:

Code:
 int [string] current_pvp_stances()
That returns a copy of a map that we already have from stance name -> stance #. You can foreach over it to get the list of stances, you can use "contains" on it to see if a stance name is in it, and you can index it if you need the stance number to construct a pvp URL.

The advantage of having a function rather than a setting is that we'll go fetch it right now if necessary, rather than depending on having fetched it before and set the setting.
 

Veracity

Developer
Staff member
Yeah.

> ash current_pvp_stances()

Returned: aggregate int [string]
I'm out of fites, so there is no dropdown for us to get stances from.

> use 3 mojo filter

Pulling items from storage...
Using 3 mojo filter...
Finished using 3 mojo filter.

> chew 1 Five Second Energy

Pulling items from storage...
Chewing 1 Five Second Energy™...
You gain 3 PvP Fights
Finished chewing 1 Five Second Energy™.
Now I have fites available.

> ash current_pvp_stances()

Returned: aggregate int [string]
Barely Dressed => 2
Basket Reaver => 3
Bear Hugs All Around => 0
Beary Famous => 1
Grave Robbery => 6
Hibernation Ready => 8
Maul Power => 5
Most Murderous => 11
Most Things Eaten => 7
Northern Digestion => 10
Polar Envy => 4
Visiting the Cousins => 9

> ashq int [string] map = current_pvp_stances(); print( map contains "Grave Robbery")

true

> ashq int [string] map = current_pvp_stances(); print( map[ "Grave Robbery" ] )

6
Which means we can fetch the stances and the ASH function works as expected.
 

Veracity

Developer
Staff member
Revision 15796 has that ASH function.

If we decide to keep a preference with the current stances in it, we'll initiaize the internal map from that and this function will continue to work as before, except that it will know the stances even if you can't currently see them because you are out of fites.

Note that this is not a "list of contests" - although it is, this season. It is the "list of stances" that you can take. Perhaps they will go back to bully/burninate/backstab/ballyhoo in a future season, and those will be what you see as stances.
 

Veracity

Developer
Staff member
I'm OK with declaring this done; it does everything that _I_ need, and I haven't seen any swell of demand for adding the setting to save this season's stances in. I'm closing this, and if somebody really wants a setting, they can open a Feature Request explaining what that want and why. :)
 

Bale

Minion
Agreed. It worked brilliantly for my needs also. Now that it helped me get my new skill I won't need it again for the next few months, so thank you.
 
Top