-
Notifications
You must be signed in to change notification settings - Fork 281
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1212 from dwasint/antag-rep'
Antag Rep
- Loading branch information
Showing
11 changed files
with
166 additions
and
21 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
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,38 +1,45 @@ | ||
/datum/log_category/cloning | ||
category = LOG_CATEGORY_CLONING | ||
master_category = /datum/log_category/game | ||
config_flag = /datum/config_entry/flag/cloning | ||
config_flag = /datum/config_entry/flag/log_cloning | ||
|
||
/datum/config_entry/flag/cloning | ||
/datum/config_entry/flag/log_cloning | ||
|
||
/datum/log_category/mechcomp | ||
category = LOG_CATEGORY_MECHCOMP | ||
master_category = /datum/log_category/game | ||
config_flag = /datum/config_entry/flag/mechcomp | ||
config_flag = /datum/config_entry/flag/log_mechcomp | ||
|
||
/datum/config_entry/flag/mechcomp | ||
/datum/config_entry/flag/log_mechcomp | ||
|
||
/datum/log_category/music | ||
category = LOG_CATEGORY_MUSIC | ||
config_flag = /datum/config_entry/flag/music | ||
config_flag = /datum/config_entry/flag/log_music | ||
|
||
/datum/config_entry/flag/music | ||
/datum/config_entry/flag/log_music | ||
|
||
/datum/log_category/meta | ||
category = LOG_CATEGORY_META | ||
config_flag = /datum/config_entry/flag/meta | ||
config_flag = /datum/config_entry/flag/log_meta | ||
|
||
/datum/config_entry/flag/meta | ||
/datum/config_entry/flag/log_meta | ||
|
||
/datum/log_category/artifact | ||
category = LOG_CATEGORY_ARTIFACT | ||
config_flag = /datum/config_entry/flag/artifact | ||
config_flag = /datum/config_entry/flag/log_artifact | ||
|
||
/datum/config_entry/flag/artifact | ||
/datum/config_entry/flag/log_artifact | ||
|
||
/datum/log_category/blackmarket | ||
category = LOG_CATEGORY_BLACKMARKET | ||
master_category = /datum/log_category/economy | ||
config_flag = /datum/config_entry/flag/blackmarket | ||
config_flag = /datum/config_entry/flag/log_blackmarket | ||
|
||
/datum/config_entry/flag/blackmarket | ||
/datum/config_entry/flag/log_blackmarket | ||
|
||
|
||
/datum/log_category/antag_rep | ||
category = LOG_CATEGORY_ANTAG_REP | ||
config_flag = /datum/config_entry/flag/log_antag_rep | ||
|
||
/datum/config_entry/flag/log_antag_rep |
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 |
---|---|---|
|
@@ -45,3 +45,6 @@ | |
) | ||
///amount of lootboxes owned | ||
var/lootboxes_owned = 0 | ||
|
||
///our current antag rep (base is 10) | ||
var/antag_rep = 10 |
63 changes: 63 additions & 0 deletions
63
monkestation/code/modules/storytellers/antag_rep/helper_procs.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,63 @@ | ||
GLOBAL_LIST_INIT(blessed_ckeys, list( | ||
"taocat" = list(3, 25), | ||
)) //this is a lmao moment should be a json but its being left here because lol it goes ckey = list(multiplier, base) | ||
|
||
///adjusts antag rep by {VALUE} keeping the value above 0 | ||
/datum/preferences/proc/adjust_antag_rep(value, multiplier = TRUE) | ||
if(multiplier) | ||
value *= return_rep_multiplier() | ||
log_antag_rep("[parent]'s antag rep was adjusted by [value]") | ||
antag_rep += value | ||
if(antag_rep < 1) | ||
log_antag_rep("[parent]'s antag rep was adjusted below 1 resetting to 1") | ||
antag_rep = 1 | ||
save_preferences() | ||
|
||
/datum/preferences/proc/reset_antag_rep() | ||
var/default = return_default_antag_rep() | ||
log_antag_rep("[parent]'s antag rep was reset to default ([default])") | ||
antag_rep = default | ||
save_preferences() | ||
|
||
/datum/preferences/proc/return_default_antag_rep() | ||
if(!parent) | ||
return 10 | ||
if(!(parent.ckey in GLOB.blessed_ckeys)) | ||
return 10 | ||
return GLOB.blessed_ckeys[parent.ckey][2] | ||
|
||
/datum/preferences/proc/return_rep_multiplier() | ||
if(!parent) | ||
return 1 | ||
if(!(parent.ckey in GLOB.blessed_ckeys)) | ||
return 1 | ||
return GLOB.blessed_ckeys[parent.ckey][1] | ||
|
||
|
||
///give it a list of clients and the value aswell if it should be affected by multipliers and let er rip | ||
/proc/mass_adjust_antag_rep(list/clients, value, mulitplier = TRUE) | ||
for(var/client/listed_client as anything in clients) | ||
if(!listed_client.prefs || !IS_CLIENT_OR_MOCK(listed_client)) | ||
continue | ||
listed_client.prefs.adjust_antag_rep(value, mulitplier) | ||
|
||
/proc/return_antag_rep_weight(list/candidates) | ||
var/list/returning_list = list() | ||
for(var/anything in candidates) | ||
var/client/client_source | ||
if(ismob(anything)) | ||
var/mob/mob = anything | ||
client_source = mob.client | ||
if(IS_CLIENT_OR_MOCK(anything)) | ||
client_source = anything | ||
if(!client_source) | ||
continue | ||
|
||
returning_list += client_source | ||
var/return_value = 10 | ||
if(client_source.prefs?.antag_rep) | ||
return_value = client_source.prefs.antag_rep | ||
returning_list[client_source] = return_value | ||
|
||
log_antag_rep("Returned Weighted List of [length(returning_list)]", list("before_weight" = candidates, "after_weight" = returning_list)) | ||
return returning_list |
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