Okay, browsing through the game files, I have come to this conclusion:
Gold is free to pickup energywise based on game files
Moving on top of =g items manually seems to autopickup those (energy free?) even if monsters are visible, based on just playing the game. Does it cost extra energy? Not quire sure what the code means with that ...
Player disturb flushes cmd queue
If running (moving with shift down for me) on top of a gold pile, and the character moving causes a disturbance (new monster, monster moves, yadda yadda), it will trigger a disturb to flush cmd queue
However, this ALSO flushes the autopickup command from the cmd queue
Hence, gold will stay on ground, causing me to backtrack and be annoyed with QoL gameplay issues
I guess my question at this point is:
Does autopickup for ammo for example cost extra energy when moving on them?
If so, that is causing me extra risk sometimes, ouch
If not, then I could just adjust the code to re-insert the autopickup cmd to the cmdqueue after the disturb in the disturb code?
Also, the 'obvious things' isn't that obvious to me, lol. If I understand it correctly, if the autopickup picks up more than move energy cost / 10 items the move action costs 0.1x items picked up, otherwise normal move cost? So without +Steps items, and move energy cost of 100, any movement that picks up more than 10 autopickup items will cost more energy?
Here is the code ... Does ammo calculate as 1/40 items per item? So a full stack is just 1 item? Gah ...
Sorry rambling questions. Initially, from what I understand, I can just re-insert autopickup into after the cmd queue flush in the player/moved/disturb code, and would fix this issue for me?
Gold is free to pickup energywise based on game files
Moving on top of =g items manually seems to autopickup those (energy free?) even if monsters are visible, based on just playing the game. Does it cost extra energy? Not quire sure what the code means with that ...
Player disturb flushes cmd queue
If running (moving with shift down for me) on top of a gold pile, and the character moving causes a disturbance (new monster, monster moves, yadda yadda), it will trigger a disturb to flush cmd queue
However, this ALSO flushes the autopickup command from the cmd queue
Hence, gold will stay on ground, causing me to backtrack and be annoyed with QoL gameplay issues
I guess my question at this point is:
Does autopickup for ammo for example cost extra energy when moving on them?
If so, that is causing me extra risk sometimes, ouch
If not, then I could just adjust the code to re-insert the autopickup cmd to the cmdqueue after the disturb in the disturb code?
Also, the 'obvious things' isn't that obvious to me, lol. If I understand it correctly, if the autopickup picks up more than move energy cost / 10 items the move action costs 0.1x items picked up, otherwise normal move cost? So without +Steps items, and move energy cost of 100, any movement that picks up more than 10 autopickup items will cost more energy?
Here is the code ... Does ammo calculate as 1/40 items per item? So a full stack is just 1 item? Gah ...
Code:
/** * Pick up or look at objects on a square when the player steps onto it */ void do_cmd_autopickup(struct command *cmd) { /* Get the obvious things */ player->upkeep->energy_use = do_autopickup(player) * z_info->move_energy / 10; if (player->upkeep->energy_use > z_info->move_energy) player->upkeep->energy_use = z_info->move_energy; /* Look at or feel what's left */ event_signal(EVENT_SEEFLOOR); /* Redraw the object list using the upkeep flag so that the update can be * somewhat coalesced. Use event_signal(EVENT_ITEMLIST to force update. */ player->upkeep->redraw |= (PR_ITEMLIST); }
Comment