New Content - Implemented The Source

Darzil

Developer
Hmm, I bet we set enlightenment before adding source points.

Will have to look at that sometime (not sure when).
 

Bale

Minion
At this time, the skill Overclocked does nothing to KoLmafia's knowlege.

I would appreciate if Overclocked was accounted as a monster adjustment for jump_chance() against Source Agents. Right now, my preAdventureScript needs to make manual adjustments to jump_chance() to figure out how much danger I face so that it will know if it should start buffing initiative...

Code:
	case "The Source":
		if(get_property("sourceInterval").to_int() <= 400) {
			// Boost initiative (and HP?) to deal with Source Agents
			if(jump_chance($monster[Source Agent]) + 200 < 100) {
				foreach sk in $skills[Springy Fusilli, Cletus's Canticle of Celerity, Walberg's Dim Bulb, Suspicious Gaze] {
					if(jump_chance($monster[Source Agent]) + 200 >= 100) break;
					if(have_effect(to_effect(sk)) == 0 && have_skill(sk))
						use_skill(1, sk);
				}
			}
			// If Agent is tough enough to survive Big Guns, use Ruthless Efficiency to enhance Humiliating Hack
			if(have_skill($skill[Ruthless Efficiency]) && have_effect($effect[Ruthlessly Efficient]) < 1 && monster_hp($monster[source agent]) > (1 - min(.50, monster_level_adjustment() * .004)) * 300)
				use_skill(1, $skill[Ruthless Efficiency]); 
		}
		break;

Yeah, that still sucks slightly since it assumes that I have Overclocked (that's on purpose since I believe the oversight will get fixed within days) and it doesn't check for any items to use for initiative when things get dire. Nor does it try to boost HP for defense against really strong agents. I should probably make sure that MP is restored also. Obviously I'm just starting to automate the problem. A very important key is jump_chance().
 
Last edited:

Bale

Minion
Oh wait! Since jump_chance() never goes below 0, the calculation I was using is totally wrong. I'm going to have to go to the wiki to look up the formula to make a function that calculates it properly without using jump_chance() unless a dev adds it to jump_chance() before I start encountering Agents that can get the jump on me. Ick.
 

heeheehee

Developer
Staff member
Hm. Would editing monsters.txt to have
Code:
Init: [25+25*pref(sourceAgentsDefeated)-200*skill(Overclocked)]
work?
 

Bale

Minion
That's wrong, but it would work.

It's wrong because a monster's base initiative isn't actually modified by Overclocked. It would work because I can't think of any other use for the base initiative and the formula contains no multiplicative factors.
 

heeheehee

Developer
Staff member
I know, but it would have the desired effect in terms of affecting your jump chance against that one monster.

Overclocked can't be treated as a +200 init modifier, since we have no way of conditionally applying a modifier against specific monsters. Even if we could, I bet it's not doubled by... bow-legged swagger, was it?

The only correct way of implementing it (for every definition of the word) seems to be to modify MonsterData.jumpChance to take into account whether or not you have that skill, but that seems almost like an overreaction.

edit: maybe overreaction isn't the right word. I'm not quite sure what I'm thinking of.
 

Bale

Minion
Well then. I am absolutely in favor of that fix. Otherwise the jump_chance() function is completely useless against Source Agents. I have to write an entire function duplicating the functionality of jump_chance() just to make it work for this monster.
 

Bale

Minion
For whatever it is worth, I fixed my logic with this...

Code:
int jump_chance(monster mon, boolean clock_check) {
	int init = 100 - mon.base_initiative + initiative_modifier() 
		+ max(0, my_primestat().my_basestat() - mon.base_attack);
	
	if(mon == $monster[Source Agent] && have_skill($skill[Overclocked]))
		init += 200;
	
	return max(0, init);
}

I no longer need KoLmafia to be fixed for my sake, but I do think it would be a good idea to keep it from giving other people a wrong result to jump_chance($monster[Source Agent]) since that value is important to anyone who wants to make their lives easier with a little automation.
 
Last edited:

Bale

Minion
Great! Now its time for me to discard the function that I wrote to see me through my turns today.
 

Lxndr

Member
May 24 - Source Agents now get less difficult if you run away from or are defeated by them. Runs-away also always work against them.

Once we figure out how this is tracked (if it just decrements the 'defeated' number in the equation by 1 by each runaway/defeat...), perhaps it should be taken into account?
 

Bale

Minion
May 24 - Source Agents now get less difficult if you run away from or are defeated by them. Runs-away also always work against them.

Do we currently have any form of error checking on this? Is a Source Agent's Attack stat compared to his expected Attack stat to determine his true number and the preference updated accordingly?
 

Darzil

Developer
r16958 handles reducing SourceAgentsDefeated on a loss.
r16960 handles reduction of (non-tuned) experience gain.

What else of significance are we missing? Anything?
 

Darzil

Developer
r16961 shows "Source Agent" and the number of fights til the Agent CAN appear in relay browser character pane. It does not appear in counters, as it is not a normal counter (goes down with fights rather than adventures). When it is zero, an Agent can appear.
 

Bale

Minion
Wow. I wasn't expecting that last one, even though I suggested it.

I think this path is now properly implemented? Anything missing?
 

Ezandora

Member
Minor tracking/creation issue, when source agents replace a monster:
Code:
[441] The Hidden Office Building
Encounter: pygmy witch accountant
Round 0: Ezandora wins initiative!
Round 1: Ezandora wins the fight!
You acquire an item: McClusky file (page 5)

Use 1 boring binder clip + 1 McClusky file (page 1) + 1 McClusky file (page 2) + 1 McClusky file (page 3) + 1 McClusky file (page 4) + 1 McClusky file (page 5)

[441] The Hidden Office Building
Encounter: Agent Simmons
Round 0: Ezandora loses initiative!
The McClusky file code runs while we're still in a fight with a source agent. This won't assemble the files, but seems to remove them from mafia's inventory tracking.
May not be important enough to worry about?
 

Darzil

Developer
Yeah, it was something I wanted to do, even suggested it in the first post, it was just working out the best way. In the end just creating and destroying the counter before and after displaying it, based on the in game foreshadowing seemed the best way of dealing with all the uncertain spading and uncertainty of how to display it. The Guide use of sourceInterval was working well for me in a run or two predicting agents, just seemed simple enough to do it.

I will of course be looking forward to CHIT colouring it!
 

Darzil

Developer
Minor tracking/creation issue, when source agents replace a monster:
Code:
[441] The Hidden Office Building
Encounter: pygmy witch accountant
Round 0: Ezandora wins initiative!
Round 1: Ezandora wins the fight!
You acquire an item: McClusky file (page 5)

Use 1 boring binder clip + 1 McClusky file (page 1) + 1 McClusky file (page 2) + 1 McClusky file (page 3) + 1 McClusky file (page 4) + 1 McClusky file (page 5)

[441] The Hidden Office Building
Encounter: Agent Simmons
Round 0: Ezandora loses initiative!
The McClusky file code runs while we're still in a fight with a source agent. This won't assemble the files, but seems to remove them from mafia's inventory tracking.
May not be important enough to worry about?
It's part of a general bug, rather than source specific, also happens in random summer path. Basically any autocreation that happens after a combat that doesn't actually end that turn needs to be deferred somehow until after the combat finally ends. There is at least one separate bug report for it.
 
Top