Join GitHub today
GitHub is home to over 36 million developers working together to host and review code, manage projects, and build software together.
Sign upQuiver Autoloading #7237
Conversation
MattAmmann
added some commits
Apr 15, 2014
MattAmmann
changed the title
[WIP] Quiver Autoloading
Quiver Autoloading
Apr 17, 2014
This comment has been minimized.
This comment has been minimized.
|
Everything I planned to implement is now in the PR, so I've removed the WIP tag. |
This comment has been minimized.
This comment has been minimized.
|
Sweet, code looks good except the line of commented out code you left in |
This comment has been minimized.
This comment has been minimized.
|
Sorry about that! Those are now cleaned up. |
KA101
assigned
KA101
and unassigned
KA101
Apr 17, 2014
This comment has been minimized.
This comment has been minimized.
|
Not sure what's up, didn't work when I tested it... |
This comment has been minimized.
This comment has been minimized.
Did you add the ammo to the autopickup rules for your character? It only works with items on the autopickup list, so that the player has control over what gets quivered and what doesn't.
I see the problem. In game.cpp, the volume check happens before my code to check if the ammo is an arrow/bolt. I'll work on a fix to this. |
This comment has been minimized.
This comment has been minimized.
|
I missed the autopickup dependency, and I don't agree with it. It means |
This comment has been minimized.
This comment has been minimized.
|
Ok, that reasoning makes sense. I'm not really sure why the autopickup dependency is there, but I'll work on getting rid of it. Iterating over partially-filled quivers before empty ones is definitely doable. I'll mark this as WIP again, while I make the changes. |
MattAmmann
changed the title
Quiver Autoloading
[WIP ]Quiver Autoloading
Apr 18, 2014
MattAmmann
changed the title
[WIP ]Quiver Autoloading
[WIP ] Quiver Autoloading
Apr 18, 2014
MattAmmann
changed the title
[WIP ] Quiver Autoloading
[WIP] Quiver Autoloading
Apr 18, 2014
MattAmmann
added some commits
Apr 18, 2014
This comment has been minimized.
This comment has been minimized.
|
I changed the EDIT: Nevermind, I figured it out. |
MattAmmann
added some commits
Apr 18, 2014
MattAmmann
changed the title
[WIP] Quiver Autoloading
Quiver Autoloading
Apr 19, 2014
This comment has been minimized.
This comment has been minimized.
|
Made all requested changes. |
This comment has been minimized.
This comment has been minimized.
|
Damn pickup is such a mess. You missed the chunk of code that picks up just one item. That method needs some serious housecleaning (not saying you need to do it, just... damn) |
This comment has been minimized.
This comment has been minimized.
|
Do you mean this conditional? |
This comment has been minimized.
This comment has been minimized.
|
If you pick up an arrow from a pile, it'll quiver it, if you pick up an arrow off the ground, you don't quiver it, that doesn't really make sense. |
This comment has been minimized.
This comment has been minimized.
|
I'll make a helper function and modify the code so that when that conditional does get called, the quiver handling will be there. |
This comment has been minimized.
This comment has been minimized.
|
Things are going smoothly, and I've tamed the game::pickup function quite a bit. How many moves do we want each action to take? From what I understand of the existing code, it detracts a flat 100 moves per map item, regardless of charges. This is pretty unrealistic. In this PR, I'm subtracting 10 moves/arrow for adding to a quiver, and 100 moves flat (as it was before), for adding to the inventory. Should I keep these values? |
This comment has been minimized.
This comment has been minimized.
|
I wouldn't want to mess with the moves/action in general here, it's a |
MattAmmann
added some commits
Apr 20, 2014
This comment has been minimized.
This comment has been minimized.
|
I've made those changes, and game::pickup is much more palatable now. Still needs a bunch of testing, but I'm pretty optimistic about it's stability. |
kevingranade
merged commit dbb29cc
into
CleverRaven:master
Apr 21, 2014
This comment has been minimized.
This comment has been minimized.
|
Thanks for the feature, sorry it was such a protracted process. |
MattAmmann commentedApr 15, 2014
Autopickup and regular pickup will now autoload any equipped quivers. See below notes for more information. Fixes #7164.
Note - please add ammo to be picked up to the autopickup rules for your character. Otherwise, it'll just go into your inventory.
CODE TODO
[✔] change quivers container so that it holds maxCharges int as well
........[✔] remove unnecessary call to max_charges_from_flag() after that's sorted
[✔] change "choice" logic to loop through quivers container instead
[✔] iuse::quiver() small refactor
[✔] change multiple quiver autopickup to fill both quivers
[✔] prune commented out code
[✔] remove AutoPickup dependency
[✔] fix arrow pickup behavior when player volume is full
✔ - working
O - In Progress/Partially working
X - Not working yet
TESTING
[✔] Empty quiver
[✔] Full quiver
[✔] Partially-full quiver
[✔] Non arrow/bolt ammo (do nothing)
[✔] More arrows than quiver holds (fill quiver, rest in inv)
........[✔] Autopickup
........[✔] Regular pickup
[✔] Multiple non-full quivers (rest in inv)
........[✔] Autopickup
........[✔] Regular pickup
[✔] maxCharges still works properly in iuse::quiver
[✔] Arrow volume on ground exceeds player max volume
........[✔] Hands full
........[✔] Hands free