mirror of
https://gitgud.io/BondageProjects/Bondage-College.git
synced 2026-07-09 16:09:03 +00:00
Fix(College): Cleanup of code, fixes minor bug
This commit is contained in:
parent
a464f88195
commit
05c80fdb18
1 changed files with 7 additions and 4 deletions
11
Actor.js
11
Actor.js
|
|
@ -107,10 +107,13 @@ function ActorInteractionAvailable(LoveReq, SubReq, VarReq, InText, ForIntro) {
|
||||||
if ((parseInt(SubReq) < 0) && (parseInt(ActorGetValue(ActorSubmission)) > parseInt(SubReq))) return false;
|
if ((parseInt(SubReq) < 0) && (parseInt(ActorGetValue(ActorSubmission)) > parseInt(SubReq))) return false;
|
||||||
|
|
||||||
// Checks if there's a custom script variable or a common variable to process
|
// Checks if there's a custom script variable or a common variable to process
|
||||||
if ((VarReq != "") && (VarReq.substr(0, 7) == "Common_") && (window[VarReq] == false)) return false;
|
if(VarReq != ""){
|
||||||
if ((VarReq != "") && (VarReq.substr(0, 8) == "!Common_") && (window[VarReq.substr(1)] == true)) return false;
|
let negate = VarReq.substring(0,1) == "!";
|
||||||
if ((VarReq != "") && (VarReq.substr(0, 7) != "Common_") && (VarReq.substr(0, 1) != "!") && (window[CurrentChapter + "_" + CurrentScreen + "_" + VarReq] == false)) return false;
|
if(negate) VarReq = VarReq.substring(1);
|
||||||
if ((VarReq != "") && (VarReq.substr(0, 7) != "Common_") && (VarReq.substr(0, 1) == "!") && (window[CurrentChapter + "_" + CurrentScreen + "_" + VarReq.substr(1)] == true)) return false;
|
// whether to check global variable starting with Common_ or script variable starting with chapter and screen name
|
||||||
|
let variableToCheck = (VarReq.substring(0,7) == "Common_" ? VarReq : CurrentChapter + "_" + CurrentScreen + "_" + VarReq);
|
||||||
|
if(!!window[variableToCheck] === negate) return false;
|
||||||
|
}
|
||||||
|
|
||||||
// Check if the player is gagged, only interactions that starts with '(', '(' or '@' are allowed
|
// Check if the player is gagged, only interactions that starts with '(', '(' or '@' are allowed
|
||||||
var nonSpeechActionsStart = [
|
var nonSpeechActionsStart = [
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue