mirror of
https://gitgud.io/BondageProjects/Bondage-College.git
synced 2025-04-14 04:19:22 +00:00
Merge branch 'inventory' into 'master'
BUG: More `C.Inventory` fixups See merge request BondageProjects/Bondage-College!5492
This commit is contained in:
commit
488e9ba1a2
2 changed files with 24 additions and 22 deletions
BondageClub
|
@ -56,16 +56,19 @@ function InventoryItemMiscHighSecurityPadlockPlayerHasKeys(C, Item) {
|
|||
if (LogQuery("KeyDeposit", "Cell")) return false;
|
||||
let UnlockName = "Unlock" + Item.Asset.Name;
|
||||
if ((Item != null) && (Item.Property != null) && (Item.Property.LockedBy != null)) UnlockName = "Unlock" + Item.Property.LockedBy;
|
||||
for (let I = 0; I < Player.Inventory.length; I++)
|
||||
if (InventoryItemHasEffect(Player.Inventory[I], /** @type {EffectName} */ (UnlockName))) {
|
||||
var Lock = InventoryGetLock(Item);
|
||||
if (Lock != null) {
|
||||
if (Lock.Asset.LoverOnly && !C.IsLoverOfPlayer()) return false;
|
||||
if (Lock.Asset.OwnerOnly && !C.IsOwnedByPlayer()) return false;
|
||||
if (Lock.Asset.FamilyOnly && !C.IsFamilyOfPlayer()) return false;
|
||||
return true;
|
||||
} else return true;
|
||||
|
||||
const key = Asset.find(a => InventoryItemHasEffect({ Asset: a }, /** @type {EffectName} */ (UnlockName)));
|
||||
if (key && InventoryAvailable(Player, key.Name, key.Group.Name)) {
|
||||
var Lock = InventoryGetLock(Item);
|
||||
if (Lock != null) {
|
||||
if (Lock.Asset.LoverOnly && !C.IsLoverOfPlayer()) return false;
|
||||
if (Lock.Asset.OwnerOnly && !C.IsOwnedByPlayer()) return false;
|
||||
if (Lock.Asset.FamilyOnly && !C.IsFamilyOfPlayer()) return false;
|
||||
return true;
|
||||
} else {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
|
|
|
@ -682,15 +682,18 @@ function DialogHasKey(C, Item) {
|
|||
let UnlockName = /** @type {EffectName} */("Unlock" + Item.Asset.Name);
|
||||
if ((Item.Property != null) && (Item.Property.LockedBy != null))
|
||||
UnlockName = /** @type {EffectName} */("Unlock" + Item.Property.LockedBy);
|
||||
for (let I = 0; I < Player.Inventory.length; I++)
|
||||
if (InventoryItemHasEffect(Player.Inventory[I], UnlockName)) {
|
||||
if (lock != null) {
|
||||
if (lock.Asset.LoverOnly && !C.IsLoverOfPlayer()) return false;
|
||||
if (lock.Asset.OwnerOnly && !C.IsOwnedByPlayer()) return false;
|
||||
if (lock.Asset.FamilyOnly && !C.IsFamilyOfPlayer()) return false;
|
||||
return true;
|
||||
} else return true;
|
||||
|
||||
const key = Asset.find(a => InventoryItemHasEffect({ Asset: a }, UnlockName));
|
||||
if (key && InventoryAvailable(Player, key.Name, key.Group.Name)) {
|
||||
if (lock != null) {
|
||||
if (lock.Asset.LoverOnly && !C.IsLoverOfPlayer()) return false;
|
||||
if (lock.Asset.OwnerOnly && !C.IsOwnedByPlayer()) return false;
|
||||
if (lock.Asset.FamilyOnly && !C.IsFamilyOfPlayer()) return false;
|
||||
return true;
|
||||
} else {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
|
@ -1612,11 +1615,7 @@ function DialogInventoryBuild(C, resetOffset=false, locks=false, reload=true) {
|
|||
if (C.FocusGroup == null) return;
|
||||
|
||||
if (locks) {
|
||||
for (const item of Player.Inventory) {
|
||||
if (item.Asset != null && item.Asset.IsLock) {
|
||||
DialogInventoryAdd(C, item, false);
|
||||
}
|
||||
}
|
||||
Asset.filter(a => a.IsLock && InventoryAvailable(Player, a.Name, a.Group.Name)).forEach(a => DialogInventoryAdd(C, { Asset: a }, false));
|
||||
DialogInventoryOffset = Math.max(0, Math.min(DialogInventory.length, DialogInventoryOffset));
|
||||
DialogInventorySort();
|
||||
return;
|
||||
|
|
Loading…
Add table
Reference in a new issue