Minor wishing alias improvement

Previously when wishing for "ring of protection from shape shifters",
you got a random ring instead of the protection from shape changers,
because the string matching alias was "protection from shape shifters"
without the object class.  Now, we'll check if the wish matched any
object class, but not existing object or alias, and try matching
the aliases again, but only those of the already matching obj class.

Add an alias for the ring of increase accuracy: "ring of accuracy",
and tests for it.
This commit is contained in:
Pasi Kallinen
2024-03-16 16:59:55 +02:00
parent 54c3dd35ac
commit 9d97835686
2 changed files with 20 additions and 0 deletions

View File

@@ -60,6 +60,9 @@ local wishtest_objects = {
["blessed fireproof +2 pair of speed boots"] = { otyp_name = "speed boots", oclass = "[", oerodeproof = 1, blessed = 1, spe = 2 },
["tooled horn"] = { otyp_name = "tooled horn", oclass = "(" },
["meat ring"] = { otyp_name = "meat ring", oclass = "%" },
["cursed +3 ring of increase accuracy"] = { otyp_name = "increase accuracy", oclass = "=", spe = 3, cursed = 1 },
["ring of accuracy"] = { otyp_name = "increase accuracy", oclass = "=", spe = 5 },
["accuracy"] = { otyp_name = "increase accuracy", oclass = "=" },
["beartrap"] = { otyp_name = "beartrap", oclass = "(" },
["bear trap"] = { otyp_name = "beartrap", oclass = "(" },
["landmine"] = { otyp_name = "land mine", oclass = "(" },
@@ -94,3 +97,4 @@ for str, tbl in pairs(wishtest_objects) do
end
end
end
pline("testwish: OK");