ASH consulting questions

illarion

Member
Hi all, I have a few questions that have arisen while attempting a new and improved stasis script.

Is there any way to find out:

- Whether a monster does elemental attacks, and if so, with what frequency?
- Whether I have a shield equipped, other than testing my offhand slot against a known list?
- What location I am in? (For purposes of using a dictionary or not, for example)
- What my +melee modifier is, and/or another way to calculate the minimum damage I would do with a TS or LTS?
- Similarly for +spell damage, for calculating minimum stream damage?

Finally, does damage_reduction() take Skin of the Leatherback into account?

All advice very much appreciated. I will of course post the script here when finished.
 

Metraxis

Member
[quote author=illarion link=topic=795.msg3834#msg3834 date=1172531531]
Hi all, I have a few questions that have arisen while attempting a new and improved stasis script.

Is there any way to find out:

- Whether a monster does elemental attacks, and if so, with what frequency?[/quote]
I don't think so, but you could map them. I''l say that the 'accepted' damage formula fails pretty badly in the higher levels, though, and I'm not sure how to fix it.

- Whether I have a shield equipped, other than testing my offhand slot against a known list?
Not really. I check my off-hand item for Damage Reduction in my temporarily retired script.

- What location I am in? (For purposes of using a dictionary or not, for example)
Again, nope, but you could populate a monster [int] map using get_monsters(location) and check against that.

- What my +melee modifier is, and/or another way to calculate the minimum damage I would do with a TS or LTS?
Again, parse your equipment for +melee, check for Claws, Claws, Rage, Tenacity, Symphony, Aspect, add 1/10th your weapon power, and then double or triple before adding in your off-hand.
- Similarly for +spell damage, for calculating minimum stream damage?
As above, except Spiciness, Aspect and Symphony are all you need to check for.

Finally, does damage_reduction() take Skin of the Leatherback into account?

No. This is probably because noone's figured out a reliable formula and posted it to the wiki yet. Since it's level-dependant, the raw damage formula will need to be ironed out first.

All advice very much appreciated. I will of course post the script here when finished.
'Das all I got.
 

holatuwol

Developer
[quote author=illarion]Whether I have a shield equipped, other than testing my offhand slot against a known list?[/quote]

int get_power(item) will return non-zero values for shields in the next release.



[quote author=illarion]What location I am in?  (For purposes of using a dictionary or not, for example)[/quote]

location my_location() returns your current location when in a consulted script, or your last location visited when called elsewhere.
 

Metraxis

Member
That's handy to know. In any case, here's the damage formula I was referring to earlier. If anyone can spot my error, I'd appreciate it.
Code:
	int ablate;
	if(have_skill($skill[Hero of the Half-Shell]) && EqValue(current_equipment($slot[off-hand]),"Damage Reduction") > 0) {
		ablate = max(my_buffedstat($stat[Muscle]),my_buffedstat($stat[Moxie]));
	} else {
		ablate = my_buffedstat($stat[Moxie]);
	}
	int ML = monster_base_attack(string_to_monster(encounter));
	float DamagePotential = (max(0, ML - ablate) + .25*ML - damage_reduction())*(1-damage_absorption_percent()/100);
	if(Elementals[string_to_monster(encounter)] != $element[none]) {
		print(element_to_string(Elementals[string_to_monster(encounter)]) + " Elemental");
	}
	DamagePotential = DamagePotential * (1 - elemental_resistance(Elementals[string_to_monster(encounter)])/100);
 

illarion

Member
[quote author=holatuwol link=topic=795.msg3844#msg3844 date=1172613745]
int get_power(item) will return non-zero values for shields in the next release.
[/quote]

I'm probably being dense, but how does this help?

[quote author=holatuwol link=topic=795.msg3844#msg3844 date=1172613745]
location my_location() returns your current location when in a consulted script, or your last location visited when called elsewhere.
[/quote]
Brilliant, exactly what I needed. Many thanks!

[quote author=Metraxis link=topic=795.msg3838#msg3838 date=1172559724]
Again, parse your equipment for +melee, check for Claws, Claws, Rage, Tenacity, Symphony, Aspect, add 1/10th your weapon power, and then double or triple before adding in your off-hand.
As above, except Spiciness, Aspect and Symphony are all you need to check for.
[/quote]

So you're checking the item description using index_of or whatever? Which function gives you the item description in the first place though?

[quote author=Metraxis link=topic=795.msg3838#msg3838 date=1172559724]
No. This is probably because noone's figured out a reliable formula and posted it to the wiki yet. Since it's level-dependant, the raw damage formula will need to be ironed out first.
[/quote]

http://forums.hardcoreoxygenation.com/viewtopic.php?t=967&start=60

Seems a pretty good fit.

Anyway, I have a first attempt functioning, and posted in the Writings In Progress forum:
http://kolmafia.us/index.php/topic,799.0.html
 

holatuwol

Developer
[quote author=illarion link=topic=795.msg3850#msg3850 date=1172675454]I'm probably being dense, but how does this help?[/quote]

Oh, right, you can also have weapons in your off-hand. Guess it doesn't help after all.
 

illarion

Member
[quote author=holatuwol link=topic=795.msg3853#msg3853 date=1172684532]
Oh, right, you can also have weapons in your off-hand. Guess it doesn't help after all.
[/quote]
Shame, I thought you were being cleverer than me :)

I've written a function for it anyway now, though obviously it won't handle new shields that are introduced.
Hmm, I should check for the "use your shield to absorb some of the blow" message too.

Oh, Hola, I've been meaning to ask you - what's your position on pickpocketing these days? Is it ok for me to add it to a publicly available script? Obviously I will not if you would prefer I didn't.
 

holatuwol

Developer
I'm neutral. KoLmafia does it when it thinks its necessary, but I have no issues with a consulted script doing it when KoLmafia believes otherwise.
 
Top