Adding new daily deeds options help?

Zen00

Member
I would like to add a few new daily deeds options, for the eternal car battery for example, and was reading the notes in the code about it. I'm a bit confused as to what I need to do in order to get this code to work properly.

Code:
		{
			"Item", "Eternal Car Battery", "batteryUsed", "Eternal Car Battery", "1", "~50 mp gained, once per day"
		},

The instructions say:

/*
* Built-in deeds. {Type, Name, ...otherArgs}
* Type: one of { Command, Item, Skill, Special }
*
* NOTE: when adding a new built-in deed, also add an appropriate entry for it in getVersion and increment dailyDeedsVersion
* in defaults.txt.
*/

So is that all I have to do to add it? And where is the defaults.txt located? Do I need to declare the batteryUsed variable somewhere, or does the program automatically handle that somewhere else?
 

fronobulax

Developer
Staff member
defaults.txt is in src\data. If you are looking at code then presumably you can map that to your local SVN copy.

As a general rule, if you are talking about changing KoLmafia to add a Daily Deed, you might consider having some discussion about what you are proposing and why, specifically why what you want cannot be done by making a custom daily deed. if you are trying to make a custom daily deed then you might consider making that clear and not making reference to source code files and comments. Not trying to be snarky or unhelpful. If this is a Custom Daily deed the question is not clear. If you are going to submit a patch then discussion before writing it will increase the chances that your patch will actually get used.
 

Zen00

Member
I'm hoping to have some discussion here, which is why I provided an example code of what I was thinking and asked for help in knowing if I was going about doing so properly.
 

lostcalpolydude

Developer
Staff member
I am completely against adding a built-in deed for eternal car battery. It's a minor thing that can only be used in aftercore.
 

Zen00

Member
I am completely against adding a built-in deed for eternal car battery. It's a minor thing that can only be used in aftercore.

You might say the same thing about Oscus's Soda.

However it is an example code that I'm asking if I'm doing the right thing with. I have a list of things I'd like to include in Daily Deeds that I'll share for discussion once I know that I am adding them in right.
 
Last edited:

heeheehee

Developer
Staff member
Why not just use custom daily deeds? I'm honestly somewhat surprised there are still hardcoded deeds buttons.
 

lostcalpolydude

Developer
Staff member
You might say the same thing about Oscus's Soda.

I think that item could be removed, but it was added before people could add their own things to Daily Deeds.

In this case, that would be enough to add that as a builtin deed. However, I expect I will reject anything that can be added that easily, because anything that easy to add is also easy for someone to add as a custom deed.
 

Zen00

Member
Why not just use custom daily deeds? I'm honestly somewhat surprised there are still hardcoded deeds buttons.

I honestly have no idea what the difference is between all those things. I could use some instruction in the hierarchy. I didn't know there was a option for adding your own custom daily deeds.


Hmm, found the panel, well, guess that obviates my desire for adding things. :p

But anyways, say I find a new thing that should be performed by Daily Deeds, or Breakfast function, what would I do to properly add it to the code?
 

fronobulax

Developer
Staff member
Why not just use custom daily deeds? I'm honestly somewhat surprised there are still hardcoded deeds buttons.

Because no one felt like pulling them out in a way that did not break things for everyone else ;-) Kind of like preferences that reset daily but don't begin with an "_".

But to the point at hand I know what is going to happen to me if I submit code of mine or on someone else's behalf that hardcodes a new daily deed without serious buyin before commit.
 

Zen00

Member
Back to the topic of daily deeds, with the new deck store item we'll need a tracker for how many cards have been used each day (if it hasn't been made already) and I suppose it will go into the DD section next to the familiar item drops tracker. Do you mind if I take a shot at programming this? I'm hoping that you'll give me some pointers for questions I may have.
 

fronobulax

Developer
Staff member
Back to the topic of daily deeds, with the new deck store item we'll need a tracker for how many cards have been used each day (if it hasn't been made already) and I suppose it will go into the DD section next to the familiar item drops tracker. Do you mind if I take a shot at programming this? I'm hoping that you'll give me some pointers for questions I may have.

I'm not sure I am the person being asked, but I will review and submit a patch on your behalf provided I have a sense that none of The Powers That Are are opposed and I understand it enough to feel confident that if it breaks anything it is because of my ignorance :)
 

Zen00

Member
So far I have it looking like this (modeled after the PoolDaily function)

http://pastebin.com/sUn0Ff6z

What else do I need to do to get this to work though, or is it done?

Edit: Guess this needs to be inserted into the parseSpecialDeeds function as well.

Code:
		else if ( deedsString[ 1 ].equals( "Deck of Every Card" ) )
		{
			this.add( new CardsDaily() );
		}

and this to the Builtin Deeds function.

Code:
		{
			"Special", "Deck of Every Card",
		},
 
Last edited:
Top