Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 19 additions & 3 deletions Inventory/Inventory.gd
Original file line number Diff line number Diff line change
Expand Up @@ -267,7 +267,7 @@ func getCharacter():
return get_parent()
return null

func equipItem(item):
func equipItem(item) -> bool:
if(hasItem(item)):
removeItem(item)

Expand Down Expand Up @@ -332,14 +332,20 @@ func unequipSlotRemoveIfRestraint(slot):
addItem(theitem)
return true

func forceEquipRemoveOther(item):
func forceEquipRemoveOther(item) -> bool:
var slot:String = item.getClothingSlot()

if(hasSlotEquipped(slot)):
removeItemFromSlot(slot)

return equipItem(item)

func forceEquipReturnOther(item: ItemBase):
var slot: String = item.getClothingSlot()
var displacedItem = removeItemFromSlot(slot)
equipItem(item)
return displacedItem

func forceEquipStoreOther(item):
var slot:String = item.getClothingSlot()

Expand All @@ -358,7 +364,17 @@ func forceEquipStoreOtherUnlessRestraint(item):
addItem(storedItem)

return equipItem(item)


func forceEquipStoreOtherUnlessRestraintReturnOther(item: ItemBase):

@Zsar Zsar May 14, 2026

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It would be better to change the return value of forceEquipRemoveOther and assorted functions to be a struct

successfully : bool
itemDisplaced: Optional<ItemBased>

but I did not want to make such a big change without asking you first.

(Don't mind the leg work, though, so if you give the go-ahead, I shall.)

... It also seems that GDScript flat out cannot handle null-ables as return types? So it would also need such an Optional class, which it also does not implement itself?
- Damn, one should think that if someone were to create their own programming language, they'd take care to make it better than its predecessors!

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do this really need extra new functions? Can you maybe use the other ones that exist already.
instead of doing displacedItems.addItem(GM.pc.getInventory().forceEquipReturnOther(thePump))
you can get the current item in that slot and unequip it manually

var theItem = GM.pc.getInventory().removeItemFromSlot(thePump.getClothingSlot())
if(theItem):
   displacedItems.addItem(theItem)
GM.pc.getInventory().forceEquipStoreOtherUnlessRestraint(thePump)

Or something x3

@Zsar Zsar May 16, 2026

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I just wrote the extra function to have a working prototype, but I also dislike adding more. That's why I figured it would be more sensible to change the return value of the existing functions. Just did not want to dump 100+ code changes on you without asking first.

Of course, once there is a dedicated object to deal with these code changes, it does not harm to just do it in several lines - those would no longer pollute the Scene code, they would all be hidden behind a tidy one-liner calling on said object.

Candidates are

  • LightInventory (which should then probably be renamed, but de-facto is already used exclusively for item transfers and temporary storage)
  • PlayerSlaveryStash (which is a "character", I see, but thus could provide full slot information by equipping what was equipped and storing what was not)
  • a new class (my thought yesterday, before discovering PlayerSlaveryStash; now I'd rather use one of the existing two)

var slot:String = item.getClothingSlot()
var storedItem = null
if(hasSlotEquipped(slot)):
storedItem = removeItemFromSlot(slot)
if(!storedItem.isRestraint() || storedItem.isImportant() || storedItem.isRestraintShouldKeep()):
addItem(storedItem)
equipItem(item)
return storedItem

func equipItemBy(item, equipper):
var success = equipItem(item)
if(success):
Expand Down
20 changes: 13 additions & 7 deletions Modules/MedicalModule/Milking/ElizaQuickMilkingScene.gd
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ var vaginaMilked = false
var hasPenisPump = false
var amountCollected = 0.0

var displacedItems := LightInventory.new()

func _init():
sceneID = "ElizaQuickMilkingScene"

Expand All @@ -19,14 +21,14 @@ func _reactInit():
var theFluids = thePump.getFluids()
if(theFluids):
theFluids.addFluid("Milk", 400.0)
GM.pc.getInventory().forceEquipStoreOtherUnlessRestraint(thePump)
displacedItems.addItem(GM.pc.getInventory().forceEquipReturnOther(thePump))
if(GM.pc.hasReachablePenis() || GM.pc.isWearingChastityCage()):
amountCollected += GM.main.SCI.processMilkPlayerPenis()
penisMilked = true
if(GM.pc.hasReachablePenis()):
var thePump = GlobalRegistry.createItem("PenisPump")
GM.pc.getInventory().forceEquipStoreOtherUnlessRestraint(thePump)
hasPenisPump = true
if(GM.pc.hasReachablePenis() || GM.pc.getWornChastityCage().getRestraintData().canBeEasilyRemovedByDom()):

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can be dropped, if you like.

Seemed sensible, but is not in scope of the issue.

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This could error out if we're waring portal panties or something. The pp is not reachable but there is no chastity cage. I'd promoute it to a variable and check if its not null

var thePump = GlobalRegistry.createItem("PenisPump")
displacedItems.addItem(GM.pc.getInventory().forceEquipReturnOther(thePump))
hasPenisPump = true
if(GM.pc.hasReachableVagina()):
amountCollected += GM.main.SCI.processMilkPlayerVagina()
vaginaMilked = true
Expand All @@ -47,7 +49,7 @@ func _run():

addButton("Continue", "See what happens next", "endthescene_removestuff")

func _react(_action: String, _args):
func _react(_action: String, _args) -> void:
if(_action == "endthescene"):
endScene()
return
Expand All @@ -57,7 +59,9 @@ func _react(_action: String, _args):
GM.pc.getInventory().clearSlot(InventorySlot.Penis)
if(breastsMilked):
GM.pc.getInventory().clearSlot(InventorySlot.UnderwearTop)

for displacedItem in displacedItems.getAllItems():
GM.pc.getInventory().forceEquipRemoveOther(displacedItem)

playAnimation(StageScene.Duo, "stand", {npc="eliza"})
aimCameraAndSetLocName(GM.pc.getLocation())
endScene()
Expand All @@ -73,6 +77,7 @@ func saveData():
data["vaginaMilked"] = vaginaMilked
data["hasPenisPump"] = hasPenisPump
data["amountCollected"] = amountCollected
data["displacedItems"] = displacedItems.saveData()

return data

Expand All @@ -84,3 +89,4 @@ func loadData(data):
vaginaMilked = SAVE.loadVar(data, "vaginaMilked", false)
hasPenisPump = SAVE.loadVar(data, "hasPenisPump", false)
amountCollected = SAVE.loadVar(data, "amountCollected", 0.0)
displacedItems.loadData(SAVE.loadVar(data, "displacedItems", {}))