Feature - Implemented Have a holly jolly holiday()!

Fluxxdog

Active member
Code:
> moon

October 31, 2012 - Frankruary 1

Ronald: new moon
Grimace: full moon
Mini-moon: in front of Ronald, R side

Halloween: today
Valentine's Day: 3 days
St. Sneaky Pete's Day: 10 days
Oyster Egg Day: 17 days
Feast of Boris: 22 days
El Dia De Los Muertos Borrachos: 25 days
Generic Summer Holiday: 34 days
Dependence Day: 43 days
Arrrbor Day: 51 days
Labór Day: 61 days
Festival of Jarlsberg: 63 days
Yuletide: 83 days

[COLOR="#FF0000"]Halloween[/COLOR]
Muscle bonus today and tomorrow.
Mafia can determine exactly what holiday it is on its own, but ASH has no access to that data. Would it be possible to return a simple string if Mafia detects a holiday? I'm sure returning "" would be proper for a non-holiday. If this has been requested already, I didn't find it , but it would surprise me if this hasn't been thought of before.
 
I believe it's possible for two holidays to fall on the same day, what would you propose KoLmafia return in such a case?
 
I believe it's possible for two holidays to fall on the same day, what would you propose KoLmafia return in such a case?

I would suggest a comma or semi-colon separated list in that case, but quite often when holidays overlap something special will happen in KoL so that may be completely pointless I guess...
 
I believe it's possible for two holidays to fall on the same day, what would you propose KoLmafia return in such a case?

Drunksgiving. Crimboween. St Sneaky Pete's Oyster Day. Whatever KoL calls it, if mafia knows it. Even if it's not what scripts expect to see... a robust script should be able to combine strlen>2 on holiday() with it not matching anything in the 'normal' holiday set.
 
Good points all around. Perhaps an idea could be a boolean[string] return value. If mafia can pick out the holiday, then count(holiday()) would be greater than zero.

Question: Has there been times when two holidays overlap that KoL didn't have a combo day? I did some searching through Mafia's almanac, and couldn't seem to find any, though it's certainly possible to have overlooked something.

I did notice that the next holiday overlap will occur February 14, 2013 when RL Valentine's Day gets inappropriately propositioned by KoL's St. Sneaky Pete's Day ;) Why do I get the feeling we're going to be REALLY sorry the next morning?
 
Since we just had a non-combo combo Holiday, and apparently the KoL methodology for this is separating with a slash, if we are given the text that mafia has, we could do the same contains_text in our scripts that mafia uses to test for casting reduction and so on.

Also, EatDrink could test for cranberry bonuses on Boris days. Which would be nice. I just realized that I apparently decided that the bonus adventures weren't worth having two uncommitted changes at some point in the last year or two. :)
 
Two choices:

string holiday()

returns a string with multiple holidays separated by a delimiter. KoLmafia uses " / " internally, but it could be anything.

string [] holiday()

returns an array of strings of length 0, 1, or 2, with each string being a holiday.

In order to find out if today is "Feast of Boris", in the first case, you would use holiday().contains_text( "Feast of Boris" ), and in the second case you would foreach over the result and see if any of the strings is == to "Feast of Boris".

On the other hand, if you wanted to print out "Today is xxx" for each holiday, in the first case, you'd have to use split_string() on the return value in order to get an array like the second one returns, in order to iterate.

The first use case seems more common, to me.
 
The first one does seem like the easier choice. Most of the work in ASH would be to test if it is a certain holiday. If separation is needed, a split_string(holiday(),"/") is enough to get the ball rolling.
 
Revision 15120 adds holiday(), which returns a string which has one of the following, as appropriate.

game/real
game
real
""

This is going to be pretty boring for a while. :)
 
Back
Top