-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
20 changed files
with
196 additions
and
380 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
40 changes: 40 additions & 0 deletions
40
default_userdata/scripts/actions/standard/becomeCloseFriends.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
module.exports = { | ||
signature: "becomeCloseFriends", | ||
args: [ | ||
{ | ||
name: "reason", | ||
type: "string", | ||
desc: "the reason (the event) that made them become friends. (write it in past tense)." | ||
} | ||
], | ||
description: "Trigger when a strong and close friendship forms between {{playerName}} and {{aiName}}.", | ||
check: (gameData) => { | ||
let ai = gameData.characters.get(gameData.aiID); | ||
return (getConversationOpinionValue(ai.opinionBreakdownToPlayer) > 35) && | ||
(ai.opinionOfPlayer > 0) && | ||
!ai.relationsToPlayer.includes("Friend") | ||
}, | ||
run: (gameData, runFileManager, args) => { | ||
console.log(args[0]) | ||
runFileManager.append(`global_var:talk_second_scope = { | ||
set_relation_friend = { reason = ${args[0]} target = global_var:talk_first_scope } | ||
}`) | ||
}, | ||
chatMessage: (args) =>{ | ||
return `{{aiName}} has become your friend.` | ||
}, | ||
chatMessageClass: "positive-action-message" | ||
} | ||
//help functions | ||
function getConversationOpinionValue(opinionBreakdown){ | ||
let results = opinionBreakdown.filter( (opinionModifier) =>{ | ||
return opinionModifier.reason == "From conversations"; | ||
}) | ||
|
||
let conversationOpinion = 0; | ||
if(results.length>0){ | ||
conversationOpinion = results[0].value; | ||
} | ||
|
||
return conversationOpinion; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
module.exports = { | ||
signature: "becomeRivals", | ||
args: [ | ||
{ | ||
name: "reason", | ||
type: "string", | ||
desc: "the reason (the event) that made them become rivals with eachother. (write it in past tense)." | ||
} | ||
], | ||
description: "Trigger when something drastic happens and {{playerName}} and {{aiName}} become rivals with eachother. it's enough of {{aiName}} does something that {playerName}} really didn't like.", | ||
check: (gameData) => { | ||
return true; | ||
}, | ||
run: (gameData, runFileManager, args) => { | ||
console.log(args[0]) | ||
runFileManager.append(`global_var:talk_second_scope = { | ||
set_relation_rival = { reason = ${args[0]} target = global_var:talk_first_scope } | ||
}`) | ||
}, | ||
chatMessage: (args) =>{ | ||
return `{{aiName}} has become your rival.` | ||
}, | ||
chatMessageClass: "negative-action-message" | ||
} | ||
//help functions | ||
function getConversationOpinionValue(opinionBreakdown){ | ||
let results = opinionBreakdown.filter( (opinionModifier) =>{ | ||
return opinionModifier.reason == "From conversations"; | ||
}) | ||
|
||
let conversationOpinion = 0; | ||
if(results.length>0){ | ||
conversationOpinion = results[0].value; | ||
} | ||
|
||
return conversationOpinion; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.