New Content - Implemented Can 'putty' 6 times if you have Rain-Doh and Spooky Putty

Darzil

Developer
As the title says, you can now copy 6 monsters if you have both Rain-Doh and Spooky Putty, rather than 5.

Not a big issue, just looked funny to see that I'd used 6/5 Putty today in Daily Deeds.
 

lostcalpolydude

Developer
Staff member
You can only use each individual item 5 times per day though, with the limit of 6 being on the combined use of both items. Which means it would take a second counter to properly track this, and usage limiting would have to check both how many times that item has been used and how many times the two combined have been used.
 

nworbetan

Member
I'd like to make my copying code more flexible when it comes to deciding whether it's about to use a rain-doh black box or spooky putty sheet, and having a separate counter for each would make the logistics of that decision much much easier. As it is, when spookyPuttyCopiesMade == 5 there's no easy way to tell which of the two is actually usable, and doing things like only using a spooky putty sheet iff spookyPuttyCopiesMade == 1 or 5 feels a little wonky. I guess an alternative to deciding which to use might be trying to use both when spookyPuttyCopiesMade == 5, maybe. I'd be a lot happier with a counter for each item though.
 

lostcalpolydude

Developer
Staff member
Here's a patch that adds raindohCopiesMade and increments that one for black box uses, and updates auto-putty stuff to use it. I didn't update Daily Deeds because I don't know how it should be displayed there.
 
I'm pretty sure in a recent run I rain-doh'd 5 times and then couldn't putty. Am I crazy, or do you have to use the second copier before one of them caps out?
 

Darzil

Developer
I'm pretty sure in a recent run I rain-doh'd 5 times and then couldn't putty. Am I crazy, or do you have to use the second copier before one of them caps out?

I'm sure I have done this successfully several times over the last couple of weeks.
 

nworbetan

Member
I just tested bmaher's patch out, and making 5 rain-doh copies followed by a spooky putty copy worked fine. There's a couple nits worth picking still though: spookyPuttyCopiesMade is reset on rollover, but doesn't start with an underscore like one of the two new preference copies.patch, raindohCopiesMade didn't get rest on rollover, and _raindohCopiesMade might have been reset, but I can't tell because it wasn't incremented to begin with. So it's pretty close to perfect, I think? I wish I knew enough to actually like, help implement this, sorry. :/
 

lostcalpolydude

Developer
Staff member
raindohCopiesMade should be _raindohCopiesMade, that was a typo. A fixed version is attached here. spookyPuttyCopiesMade existed before the _ convention was created, so it's reset in a separate mafia function.
 

Attachments

  • copies.patch
    2.2 KB · Views: 47

nworbetan

Member
I was going to post a patch with Preferences.setInteger( "rainDohCopiesMade", 0 ); added to KoLmafia.java, if you hadn't beat me to it. :p

Edit: Actually, now that I've given this a few more minutes of thought, if you see either of the "too scared" messages in FightRequest.java, you definitely want to set the preference corresponding to the item used to 5, as a signal that the item isn't usable any more. I don't think that there's anything that can be done to the "other" counter in any case though, at least not without assuming that the player never used either item outside of mafia. So the bad idea I'm replying to that I already edited out isn't even worth considering. >_<

Anyway, I'm of the opinion that the separate counters are far more informative and accurate than having the 2 items share a single counter, but if any mafia devs want to add more features on top of what bmaher already patched, I'll be happy enough with just copies.patch until further notice.
 
Last edited:

nworbetan

Member
Okay, I guess "until further notice" was a little premature. Here's a patch that in addition to what lost did, splits Putty and Doh into two separate Daily Deeds, and updates each of their displayed maxCopies to account for their shared max of 6.

There's a couple things about it that might need some more experienced eyes than mine though:
a) The Doh deed is always displayed if you have Rain-Doh, but the Putty deed stays hidden until... well I don't actually know what specifically made it decide to show up eventually. It looks like this.setShown( ( kf || !hc ) && ( have || havePutty ) ); is supposed to display the Putty counter even if it's zero, as long as you havePutty, but I could be wrong?
b) The one time I folded my spooky putty into a sheet today, spookyPuttyMonster was set to something totally unrecognizable, which I hadn't seen happen before. I don't see how this patch could have caused that, but I'm open minded.
 

Attachments

  • copies_split_deeds.patch
    5.6 KB · Views: 48
Last edited:

roippi

Developer
I agree, they should be one deed. Have a look at either the runaways deed or the drops deed if you need inspiration for how to display the data depending on if you have A, B, or AB.
 

nworbetan

Member
This patch combines the two deeds into one item on the Daily Deeds preference list, removes the superfluously excessive redundancy from my previous patch, and updates dailyDeedsVersion to 4.

I tried combining the two deeds using DropsDaily as an example, but the \n I wanted to add didn't ever seem to be recognized inside of a string or a buffer. Is there's a simpler/cleaner/better way than this to combine these two counters into one deed and display them on two lines?
 

Attachments

  • PuttyDohCopyDeed.patch
    7.2 KB · Views: 31

lostcalpolydude

Developer
Staff member
I tried combining the two deeds using DropsDaily as an example, but the \n I wanted to add didn't ever seem to be recognized inside of a string or a buffer. Is there's a simpler/cleaner/better way than this to combine these two counters into one deed and display them on two lines?

I disagree with the goal of making it 2 lines. It's not like there's a lack of horizontal space for both to be listed.
 

roippi

Developer
Looked over this. I was mistaken in my previous confusion (expressed in chat) about some of the logic. It's cool. Would work as coded.

Agree with lost (hey, I keep doing that tonight) about it only needing to be one line. We can nitpick over the syntax, but that's not a huge deal.
 

lostcalpolydude

Developer
Staff member
I realized that checking for putty also needs to see if you're wearing the equipment. I've got some stuff together that seems to be working, I should know for sure by the end of the day.
 

nworbetan

Member
I was trying to err on the side of "keeping the user interface superficially consistent" instead of "keeping the code superficially consistent". It would be nice to do both, but whatever. Regardless of what color the bike shed ends up, there's a tandem bike inside whose derailleurs have been squeaky for a little while. :p
 

roippi

Developer
Thanks guys. r10844. Just tweaked a couple of minor things, threw a listener on raindoh and putty so the deed shows up immediately when you pull it as opposed to when you use it. Don't know why it wasn't like that before.

One thing I noticed was the Preferences.setInteger( "_raindohCopiesMade", 5 ); part of this:

Code:
		case ItemPool.RAIN_DOH_BOX:

			// You push the button on the side of the box.
			// It makes a scary noise, and a tiny, ghostly image
			// of your opponent appears inside it. 

			if ( responseText.indexOf( "ghostly image of your opponent" ) != -1 )
			{
				Preferences.increment( "_raindohCopiesMade", 1 );
				Preferences.setString( "rainDohMonster", MonsterStatusTracker.getLastMonsterName() );
				Preferences.setString( "autoPutty", "" );
				return true;
			}
			if ( responseText.indexOf( "too scared to use this box anymore today" ) != -1 )
			{
				Preferences.setInteger( "_raindohCopiesMade", 5 );
			}
			return false;

isn't necessarily true anymore. I'm a bit braindead at the moment and don't want to work out the proper logic.

Edit: I'd also point out, if any users are dissatisfied with how this deed looks/works, they can make their own custom text deed that displays the info in whatever manner they'd like.
 
Last edited:
Top