Feature - Implemented Trendy Support

slyz

Developer
Just don't call TrendyRequest.isTrendy() in FamiliarRequest.canEquip() unless you've already checked KoLCharacter.inTrendycore().
That's what I was doing:
PHP:
if ( KoLCharacter.inTrendycore() && !TrendyRequest.isTrendy( "Familiars", this.race ) )
{
	return false;
}
I really don't understand Hola's recent changes. I know that we have to be careful when using RequestThread.postRequest(), but I don't know what to be careful about.

(Heh. in MY submit, I initially called it KoLCharacter.isTrendy(), but you submitted first, so I adapted to your name. Yes, we have Beecore and Fistcore as examples, but Trendycore sounds a bit off. No big deal. I wonder what the community will call end up calling it?)
That's pretty easy to change - I don't think users will notice :)
 

slyz

Developer
Here is a patch with a bunch of Trendy updates:

- do not show untrendy familiars
- do not try to automatically equip untrendy familiar items
- do not show untrendy restoratives
- do not show untrendy consumables
- do not equip untrendy equipment
- do not show untrendy bookshelf skills
- do not try to pull untrendy items
- do not consider untrendy items when maximizing

The list of trendy items is now parsed when you log on (or when you ascend) if your character is trendy.


I'll post it here so Veracity (or someone else) can have a look.

I'm not sure whether removing untrendy equipment/consumables is worth it, since you can't pull them. I guess it will be the case only if players out of Ronin can empty Hagnks.

I haven't thought about concoctions, are any of those affected by Trendiness (knowing that Mafia knows if you have the "Summon Clip Art" skill available)?
 

Attachments

  • Trendy.patch
    20.5 KB · Views: 21

Veracity

Developer
Staff member
Your code looks good.

ConcoctionDatabase does have a CLIPART mixing method. It's only enabled if KoLCharacter.hasSkill( "Summon Clip Art" ), so, those items should be filtered out if you are Trendy.
 

slyz

Developer
r10006.

I was wondering if it would be better to filter out untrendy items from HagnkStoragePanel completely. I'll look into that.
 

slyz

Developer
CDMoyer posted:
CDMoyer said:
Limitations on items are placed when you obtaining them (pulling, mall, taking out of DC)
So a player should never have any untrendy item in his inventory. I guess some of the checks could be removed.
 

lostcalpolydude

Developer
Staff member
There's no reason to have code that adds some complication to maintaining KoLmafia and potentially slows down execution if it doesn't have even a theoretical benefit to some hypothetical player.
 

Veracity

Developer
Staff member
What if I ascend on November 30, pull some trendy stuff, and it goes out of fashion on December 1? I think there will be many Trendy ascensions that cross month boundaries.
 

xKiv

Active member
I suspect crossing month boundaries will be optimal (allows nominally non-trendy items, because you obtained them yesterday when they were still trendy, plus allows today's new IotM). But we won't know for sure untill that happens and gets addressed by TPTB.
Possobilities include:
- lock trendiness according to run start
- disqualify runs that used nontrendy items/skills/...
- nothing
- put suddenly untrendy items into "gift" boxes
 

fronobulax

Developer
Staff member
r10006
I'm trendy.
The Daily Deeds panel shows non-greyed out buttons for the Pool Table but visiting the V.I.P. Lounge in the relay browser clearly shows it is out of style.
 

slyz

Developer
I guess this is the same problem as when you are in a clan without a Pool Table. Should the Daily Deeds (and the various Clan Item CLI commands) be aware the the item isn't trendy?
 

fronobulax

Developer
Staff member
I guess this is the same problem as when you are in a clan without a Pool Table.

Perhaps. I don't clan hop and the character who does not have a access to a Pool Table at Login also does not even have the buttons in Daily Deeds, so in my case there is something that already realizes it should not be an option.

Should the Daily Deeds (and the various Clan Item CLI commands) be aware the the item isn't trendy?

I'm inclined to say Yes.
 

slyz

Developer
I guess your character didn't have a VIP key.

r10008 make the Daily Deeds aware that clan items (April Shower, Pool Table, Fax Machine, Crimbo Tree) can be untrendy.

I realized a little late that the Crimbo Tree already relied on the _crimboTree preference, and probably didn't need this extra check. I'm not sure _crimboTree would have been updated after ascending during a Mafia session, so I won't remove it.
 

slyz

Developer
It looks like some items are not recognized as being untrendy. Specifically, The Spirit of Crimbo, and all the Crimbo 2009 items.

My guess is that the "elven <i>limbos</i> gingerbread" is making the regex skip the 2009-12 items. Same goes for "Lobster <i>qua</i> Grill" and the 2011-03 items.

The current regex is:
Code:
"<tr class=\"([^\"]*)\">.*?<td[^>]*>([^<]*)</td>.*?<td[^>]*>([^<]*)</td>.*?<td[^>]*>([^<]*)</t[dr]>"
I remember a discussion about regex for this kind of thing, I'll see if I can look it up.

EDIT: found it here, the regex should be:
Code:
"<tr class=\"([^\"]*)\">.*?<td[^>]*>([^<]*)</td>.*?<td[^>]*>([^<]*)</td>.*?<td[^>]*>((?:[^<]*(?:(?!</t[dr]>)<))*[^<]*)</t[dr]>"

EDIT: and added in r10009.
 
Last edited:

Veracity

Developer
Staff member
In this post, CDM says:

Limitations on items are placed when you obtaining them (pulling, mall, taking out of DC), and not when you use them. This means, that any future monthly leaderboard will simply count runs starting on the 1st or later, so that you don't have access to items that expired that month. This was just worlds simpler than checking your equipment at rollover, and every place you can use, equip, etc an item.

That says, to me, that if you manage to have an item in your inventory on a Trendy run, there are no limitations on using, equipping, crafting, drinking, what have you; the item is assumed to have been fashionable when you put it in inventory, and that is good enough. In that sense, your Terrarium is just a source of items that you can pull, and you are prevented from taking un-fashionable familiars out.

I'd suggest that we filter un-trendy familiars in the Gear Changer - as now - and also filter any un-trendy item from the storage list, so you can't even see them.

We need to detect failed attempts to pull un-trendy items from storage, store, display, and terrarium and not change our internal state.

We do NOT need to prevent people from using or eating or drinking un-trendy items since, according to CDM, KoL does not prevent that; if you have the item in inventory, it was fashionable when you got it, and using it will not violate your path - although you had to have crossed a month boundary for that to be possible, and you do not qualify for a leaderboard, if you do that.
 
Last edited:

slyz

Developer
r10012 removes some trendiness checks that where added in r10006.

I changed ItemManager.getAccessibleCount() to not count items you can pull. This is a better fix to the Maximizer suggesting equipement you can pull for free.

I changed ItemManager.retrieveItem() to skip trying to pull or buy untrendy items if the character is trendy. This should avoid some problems too.

The Daily Deeds and the Maximizer now check if you can equip a familiar, not just if you have it.
 

lostcalpolydude

Developer
Staff member
Unknown item found: Thwaitgold butterfly statuette (5392, 820209471)
--------------------
5392 Thwaitgold butterfly statuette none display 0
5392 820209471 thwaitbutt.gif Thwaitgold butterfly statuette
# Thwaitgold butterfly statuette
 

exxyle

New member
I ascended into another trendy run just now using r10012, and this happened out of the clear blue:
Code:
Ascend as a Normal Female Pastamancer under the Vole sign on a Trendy path, banking 24 Karma.
Refreshing session data...
Loading character status...
Synchronizing moon data...
Seeing what's still trendy today...
Seeing what's still trendy today...
Seeing what's still trendy today...
Seeing what's still trendy today...
Seeing what's still trendy today...
Seeing what's still trendy today...
Seeing what's still trendy today...
Seeing what's still trendy today...
Seeing what's still trendy today...
Seeing what's still trendy today...
Seeing what's still trendy today...
Seeing what's still trendy today...
Seeing what's still trendy today...
Seeing what's still trendy today...
Seeing what's still trendy today...
Seeing what's still trendy today...
Seeing what's still trendy today...
Seeing what's still trendy today...
Seeing what's still trendy today...
Seeing what's still trendy today...
Seeing what's still trendy today...
Seeing what's still trendy today...
Seeing what's still trendy today...
Seeing what's still trendy today...
Seeing what's still trendy today...
Seeing what's still trendy today...

***repeat 291 more times***

Done. Are YOU a fashion plate?
Done. Are YOU a fashion plate?
Done. Are YOU a fashion plate?
Done. Are YOU a fashion plate?
Done. Are YOU a fashion plate?
Done. Are YOU a fashion plate?
Done. Are YOU a fashion plate?
Done. Are YOU a fashion plate?
Done. Are YOU a fashion plate?
Done. Are YOU a fashion plate?
Done. Are YOU a fashion plate?
Done. Are YOU a fashion plate?
Done. Are YOU a fashion plate?
Done. Are YOU a fashion plate?
Done. Are YOU a fashion plate?
Done. Are YOU a fashion plate?
Done. Are YOU a fashion plate?
Done. Are YOU a fashion plate?
Done. Are YOU a fashion plate?
Done. Are YOU a fashion plate?
Done. Are YOU a fashion plate?
Done. Are YOU a fashion plate?
Done. Are YOU a fashion plate?
Done. Are YOU a fashion plate?
Done. Are YOU a fashion plate?

***repeat 166 more times***, reloaded relay browser here

Done. Are YOU a fashion plate?
You acquire an item: letter from King Ralph XI
Done. Are YOU a fashion plate?
Done. Are YOU a fashion plate?
You acquire an item: pork elf goodies sack
You acquire an item: disassembled clover
Done. Are YOU a fashion plate?
Done. Are YOU a fashion plate?
Done. Are YOU a fashion plate?
Done. Are YOU a fashion plate?
Done. Are YOU a fashion plate?
Done. Are YOU a fashion plate?
Done. Are YOU a fashion plate?
Done. Are YOU a fashion plate?
Done. Are YOU a fashion plate?
Done. Are YOU a fashion plate?
Done. Are YOU a fashion plate?
Done. Are YOU a fashion plate?
Done. Are YOU a fashion plate?
Done. Are YOU a fashion plate?
Done. Are YOU a fashion plate?
KoLmafia declares world peace. <---abort

Did I mess up a setting or something? :/
 
Top