Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Don't double-use waffles #1365

Merged
merged 14 commits into from
Oct 1, 2023
12 changes: 10 additions & 2 deletions RELEASE/scripts/autoscend/combat/auto_combat_default_stage2.ash
Original file line number Diff line number Diff line change
Expand Up @@ -198,7 +198,7 @@ string auto_combatDefaultStage2(int round, monster enemy, string text)
combat_status_add("freeruncheck");
}

if (!combat_status_check("replacercheck") && canReplace(enemy) && auto_wantToReplace(enemy, my_location()))
if (!combat_status_check("replacercheck") && auto_wantToReplace(enemy, my_location()))
{
string combatAction = replaceMonsterCombatString(enemy, true);
if(combatAction != "")
Expand All @@ -214,7 +214,15 @@ string auto_combatDefaultStage2(int round, monster enemy, string text)
}
else if(index_of(combatAction, "item") == 0)
{
handleTracker(enemy, to_item(substring(combatAction, 5)), "auto_replaces");
if(contains_text(combatAction, ", none"))
{
int commapos = index_of(combatAction, ", none");
handleTracker(enemy, to_item(substring(combatAction, 5, commapos)), "auto_replaces");
}
else
{
handleTracker(enemy, to_item(substring(combatAction, 5)), "auto_replaces");
}
}
else
{
Expand Down
2 changes: 1 addition & 1 deletion RELEASE/scripts/autoscend/combat/auto_combat_ed.ash
Original file line number Diff line number Diff line change
Expand Up @@ -375,7 +375,7 @@ string auto_edCombatHandler(int round, monster enemy, string text)
combat_status_add("banishercheck");
}

if (!combat_status_check("replacercheck") && canReplace(enemy) && auto_wantToReplace(enemy, my_location()))
if (!combat_status_check("replacercheck") && auto_wantToReplace(enemy, my_location()))
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thinking out loud. Don't need to add support for parsing funkslinging like you did in the general combat code because Ed can't throw 2 items in a single round of combat. True fact?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Never ran Ed but looking through the wiki that makes sense to me since you lose your skills and there is no funkslinging equivalent in the skill tree

{
string combatAction = replaceMonsterCombatString(enemy, true);
if(combatAction != "")
Expand Down
4 changes: 2 additions & 2 deletions RELEASE/scripts/autoscend/combat/auto_combat_util.ash
Original file line number Diff line number Diff line change
Expand Up @@ -860,9 +860,9 @@ string replaceMonsterCombatString(monster target, boolean inCombat)
{
return "skill " + $skill[CHEAT CODE: Replace Enemy];
}
if(item_amount($item[waffle]) > 0 && !haveUsed($item[waffle]) && auto_is_valid($item[waffle]))
if(canUse($item[waffle]))
{
return "item " + $item[waffle];
return useItems($item[waffle], $item[none]);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
return useItems($item[waffle], $item[none]);
return useItem($item[waffle]);

useItem() has handling for funkslinging, no need to complicate it unnecessarily.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It didn't work with useItem. It tried to double use them, BUT that was before I updated the replacer logger in stage2. Will try useItem again and see if it works now

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, useItem double uses waffle for some reason. I changed it back to useItem and this happened.
useItem waffle.txt

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could the issue be none vs nothing?
image

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does it still double use when using useItem + change useItem to have none as the second item?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

hmm did a quick test by using 2 different custom combat scripts. One for each of the returned value above. Both resulted in only 1 waffle being used. So none vs nothing doesn't seem to be the issue

}
return "";
}
Expand Down
Loading