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