branchrust_reboot/main/softcore_update/respawn_changescancel
32 Commits over 0 Days - ∞cph!
When respawning and trying to reclaim items, drop extra items in a dropped bag
Switch dropped bag from white -> corpse bag when dropping extra reclaim loot
Don't respawn with items in softcore if you die inside building privilege
- convar `reclaim_building_auth` controls it
merge from softcore_update -> respawn_changes
Only merge backpack partial stacks if something is taken from the backpack for the reclaim system
Make backpack dropped on death if not reclaimed instead of staying on the corpse
- backpack still stays on player if you are wounded in softcore (to enforce reclaim of backpack contents)
Move drop backpack to `WoundedStartSharedCode()`
Fix drop backpack for wounding not being called when the player is set to crawling
Make sure "drop backpack on death" is only called when they die and not when they are wounded
- no change to behavior, fixes convars for "drop backpack on death vs wound"
Handle all default items, not just rocks and torches
Ensure rocks, torches and other starting items are never reclaimed
Don't reclaim loot when respawning if the player is F1 killing
- ignore situations where you are F1 killing after being wounded
Fix 100% of clothing being reclaimed on death instead of 0% of clothing
merge from softcore_update -> respawn_changes
merge from softcore_update -> respawn_changes
merge from softcore_update -> respawn_changes (before the merge from main)
Change DroppedItemContainer to use the same `RemoveFractionOfContainer()` method that softcore uses
- expose static function for moving multiple containers into a single inventory inside DroppedItemContainer
- also change ContainerCorpse to point to the same static function that the DroppedItemContainer uses
- remove default destroyPercent of 0, force it to be supplied to the method
Refactor ContainerCorpse to use `RemoveFractionOfContainer()` so all "remove fraction of items from inventory" methods share the same logic
Add ability for `RemoveFractionOfContainer()` to take out different percentage than 50%
Fix it not looping backwards since it's iterating while removing items
Fix single stack items not being removed from source container
Refactor so `RemoveFractionOfContainer()` method is moved from softcore gamemode -> ItemContainer
Fixed CLIENT compile error
Try to merge all partial stacks of items inside the main inventory of the corpse before trying to move backpack items into it
- reduces times we spawning backpack contents sack on the ground
Fix reclaim backpack contents going into main inventory when respawning instead of backpack
Fixed missing pooling for List<Item> (missed from stash)
Fix pooling missed for Dictionary<ItemDefinition,float>
Refactor to `ItemContainer.MoveAllItems()` so any time we are trying to move all items from container -> container we don't skip items or throw errors for looping while items are removed
Try to move items onto the corpse's inventory first before spawning the dropped bag with the backpack's contents
Add convars to keep backpack when wounded / dying
- keep backpack equipped when dying in softcore so it works as expected with reclaim
Fix "ReclaimPercent" doing the opposite of what you think where 0% = keep and 100% = none
- change the convar for reclaimWear percent to reflect this
If the backpack is going to be kept on the player to be reclaimed, drop the contents of the backpack on the ground that aren't going to be kept
Fix backpack not fitting into the reclaim inventory due to volume restriction
Reclaim items automatically when you respawn instead of needing to run back to corpse
"Rewrite" reclaim manager so it only has a single reclaim per player
- timer refreshed every time you die but it should give out every item when you respawn anyways
- also remove storage of killer name since that was used for reclaim backpack naming
Remove reclaim backpack code & prefab since it's not used anymore
Reclaims still expire after 2 hours (convar)
Put items back into respective inventories (main, wear, hotbar, backpack)
- put backpack contents into main inventory if you don't respawn with a backpack due to reclaim
Add new inventories to protobuf & run codegen
Change `AddFractionOfContainer()` method to keep 50% of the amount of items instead of 50% of stacks
- 1000 stone + 1000 wood -> 500 stone + 500 wood instead of only choosing one of the stacks
- use RNG to determine initial rounding of stackable items then use remainder to consistantly determine the rest of the rounding behavior
Remove reclaim toast prompted when you respawn
Remove reclaim terminal from outpost and bandit camp
- S2P both monuments