-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feature: Made FactionData datum into a SmartObject. Its paths can be …
…initialized by the Faction AI for convenience. First Faction JSON spec. Diplomancy.
- Loading branch information
jmalek
committed
Apr 22, 2024
1 parent
40c196d
commit f7fe8c5
Showing
12 changed files
with
131 additions
and
10 deletions.
There are no files selected for viewing
Binary file not shown.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,5 @@ | ||
{ | ||
"type": "sofetcher", | ||
"sense_index_key": "sofetcher", | ||
"enabled": 1, | ||
"in_memory_key": "SightCurr", | ||
|
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,10 @@ | ||
{ | ||
"name": "Debug Faction", | ||
"tags": [ | ||
"debug" | ||
], | ||
"relationships": {}, | ||
"actionset_files": [ | ||
"faction_base.json" | ||
] | ||
} |
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
38 changes: 38 additions & 0 deletions
38
GOAI/integrations/utility_agent/actions/faction/improve_relations.dm
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,38 @@ | ||
/* | ||
// Diplomancy - make a target faction friendlier to us. Somehow. | ||
*/ | ||
|
||
/datum/utility_ai/proc/ImproveRelations(var/datum/ActionTracker/tracker, var/datum/utility_ai/buddyfriendo) | ||
if(isnull(tracker)) | ||
RUN_ACTION_DEBUG_LOG("Tracker position is null | <@[src]> | [__FILE__] -> L[__LINE__]") | ||
return | ||
|
||
if(isnull(buddyfriendo)) | ||
RUN_ACTION_DEBUG_LOG("buddyfriendo is null | <@[src]> | [__FILE__] -> L[__LINE__]") | ||
return | ||
|
||
if(tracker.IsStopped()) | ||
return | ||
|
||
if(isnull(buddyfriendo.brain)) | ||
RUN_ACTION_DEBUG_LOG("Target brain is null | <@[src]> | [__FILE__] -> L[__LINE__]") | ||
tracker.SetFailed() | ||
return | ||
|
||
if(isnull(src.brain.relations)) | ||
src.brain.relations = new() | ||
|
||
if(isnull(buddyfriendo.brain.relations)) | ||
buddyfriendo.brain.relations = new() | ||
|
||
if(prob(75)) | ||
var/their_tag = src.name | ||
var/their_amount = (rand(2, 10) / 2) | ||
|
||
var/our_tag = buddyfriendo.name | ||
var/our_amount = their_amount + (rand(-2, 2) / 4) | ||
|
||
buddyfriendo.brain.relations.Increase(their_tag, their_amount) | ||
src.brain.relations.Increase(our_tag, our_amount) | ||
tracker.SetDone() | ||
return |
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