picklish
Member
Edit 2006-08-13: Now includes familar equipment and weights. Also, updated my wiki cache so some values have changed. Goat cheese tacos are not a 1 fullness/4 adventure food.
)
Edit 2006-08-14: Trademarks now stripped, so should work in Windows.
Now that we all have the altogether nifty file_to_map and map_to_file commands, the only thing missing is a decent set of maps to load. The advantage to using maps is not just because it's faster than adding them in manually, but that you can switch out the maps when items get updated and your scripts keep working, becuase they don't reference items directly.
Combining the forces of the wiki and some rogue perl scripts, I concocted a set of map files which I've attached to this message. You can blow out the zip file over your current mafia installation to populate the data directory with the maps. It comes with a test script that loads all the maps. If you unzip the file in the right place, load up mafia, call testMaps.ash, and you see "everything ok" and no pages and pages of Java stacktraces, then you're good to go.
The files are all named something like "$effect_by_$itemtype.map". You can load them as either float[item] or int[item] maps except in two cases. Anything involving adventures and consumables should only be used via float[item] maps and anything involving familiars should be used via a familiar[item] map. Here's a quick example of how you might use this:
Other ideas are left as an exercise to the reader...
Item Effects:
Here is a list of the shorthand item effects that you will find in the map filenames and what the mapping corresponds to. These effects already include intrinsic effects (like complete delusion) that you get when wearing the equipment.
Food Effects
Item Types:
Item types should be self explanatory. The "equip" category is all equipment. The "weapon" category is all weapons (melee or ranged). The "armor" category is anything you can wear that's not a weapon. The "item" category is everything. The "famequip" category is equipment for your familiars.
Finally, if somebody has a place this archive could live permanently and that I could automate an update to via ftp or somesuch, I can keep these up to date for everyone as new items are added.

Edit 2006-08-14: Trademarks now stripped, so should work in Windows.
Now that we all have the altogether nifty file_to_map and map_to_file commands, the only thing missing is a decent set of maps to load. The advantage to using maps is not just because it's faster than adding them in manually, but that you can switch out the maps when items get updated and your scripts keep working, becuase they don't reference items directly.
Combining the forces of the wiki and some rogue perl scripts, I concocted a set of map files which I've attached to this message. You can blow out the zip file over your current mafia installation to populate the data directory with the maps. It comes with a test script that loads all the maps. If you unzip the file in the right place, load up mafia, call testMaps.ash, and you see "everything ok" and no pages and pages of Java stacktraces, then you're good to go.
The files are all named something like "$effect_by_$itemtype.map". You can load them as either float[item] or int[item] maps except in two cases. Anything involving adventures and consumables should only be used via float[item] maps and anything involving familiars should be used via a familiar[item] map. Here's a quick example of how you might use this:
Code:
void main()
{
# Put on the hat that gives the most rollover adventures (naive)...
int[item] rollover_by_hat;
file_to_map("rollover_by_hat.map", rollover_by_hat);
# find best
int max = 0;
item best;
foreach hat in rollover_by_hat
{
if (item_amount(hat) > 0 && rollover_by_hat[hat] > max)
{
max = rollover_by_hat[hat];
best = hat;
}
}
if (max != 0)
{
print("Best hat found: " + best);
equip(best);
}
else
{
print("No hats found that give extra adventures.");
}
}
Other ideas are left as an exercise to the reader...

Item Effects:
Here is a list of the shorthand item effects that you will find in the map filenames and what the mapping corresponds to. These effects already include intrinsic effects (like complete delusion) that you get when wearing the equipment.
mox => amount of moxie added when equipped
moxpercent => percent of moxie added when equipped
moxreq => amount of moxie required to equip
mys => amount of mysticality added when equipped
myspercent => percent of mysticality added when equipped
mysreq => amount of mysticality required to equip
mus => amount of muscle added when equipped
muspercent => percent of muscle added when equipped
musreq => amount of muscle required to equip
meatpercent => percentage increase to meat drops
itempercent => percentage increase to item drops
initiative => percentage increase to initiative
spelldamage => extra spell damage when equipped
rollover => extra adventures at rollover when equipped
hands => hands required to wield (1, 2, or 3)
power => weapon/armor power
extrastats => extra stat points when equipped
meleedamage => extra melee damage when equipped
hp => extra HP when equipped
mp => extra MP when equipped
ml => extra monster level when equipped
skillcost => change to cost of skills when equipped (numbers are negative)
sellprice => autosell price
weight => change in familiar weight when equipping
familiar => the only familiar that can equip this. If any familiar can equip an item, it will not be in this map. (reminder: use a familiar[item] map for anything involving this)
Food Effects
fullness => fullness gained when consuming this item
drunkness => drunkenness gained when consuming this item
spleen => spleenliness gained when consuming this item
adventures => average adventures gained when consuming this item (reminder: use a float[item] map for anything involving this effect)
Item Types:
Item types should be self explanatory. The "equip" category is all equipment. The "weapon" category is all weapons (melee or ranged). The "armor" category is anything you can wear that's not a weapon. The "item" category is everything. The "famequip" category is equipment for your familiars.
Finally, if somebody has a place this archive could live permanently and that I could automate an update to via ftp or somesuch, I can keep these up to date for everyone as new items are added.