Skip to content

Commit

Permalink
Merge pull request #177 from jamilnielsen/reward_sec_players_monkecoin
Browse files Browse the repository at this point in the history
[Priority?]give those sec players monkecoins
  • Loading branch information
dwasint authored Jul 24, 2023
2 parents 7c5bf72 + cf62d68 commit 8e4502e
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 1 deletion.
1 change: 1 addition & 0 deletions code/__HELPERS/roundend.dm
Original file line number Diff line number Diff line change
Expand Up @@ -283,6 +283,7 @@ GLOBAL_LIST_INIT(round_end_images, world.file2list("data/image_urls.txt"))
for(var/client/C in GLOB.clients)
if(C && C.prefs)
C.prefs.adjust_metacoins(C.ckey, 75, "Played a Round")
C.prefs.adjust_metacoins(C.ckey, C.reward_this_person, "Special Bonus")
if(length(C.applied_challenges))
if(isliving(C.mob))
var/mob/living/client_mob = C.mob
Expand Down
11 changes: 11 additions & 0 deletions code/controllers/subsystem/ticker.dm
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,11 @@ SUBSYSTEM_DEF(ticker)
/// Why an emergency shuttle was called
var/emergency_reason

///add bitflags to this that should be rewarded monkecoins, example: DEPARTMENT_BITFLAG_SECURITY
var/list/bitflags_to_reward = list(DEPARTMENT_BITFLAG_SECURITY,)
///add jobs to this that should get rewarded monkecoins, example: JOB_SECURITY_OFFICER
var/list/jobs_to_reward = list(JOB_JANITOR,)

/datum/controller/subsystem/ticker/Initialize()
var/list/byond_sound_formats = list(
"mid" = TRUE,
Expand Down Expand Up @@ -479,6 +484,12 @@ SUBSYSTEM_DEF(ticker)
livings += living
if(living.client && length(living.client?.active_challenges))
SSchallenges.apply_challenges(living.client)
for(var/processing_reward_bitflags in bitflags_to_reward)//you really should use department bitflags if possible
if(living.mind.assigned_role.departments_bitflags & processing_reward_bitflags)
living.client.reward_this_person += 150
for(var/processing_reward_jobs in jobs_to_reward)//just in case you really only want to reward a specific job
if(living.job == processing_reward_jobs)
living.client.reward_this_person += 150
if(livings.len)
addtimer(CALLBACK(src, PROC_REF(release_characters), livings), 30, TIMER_CLIENT_TIME)

Expand Down
2 changes: 2 additions & 0 deletions code/modules/client/client_defines.dm
Original file line number Diff line number Diff line change
Expand Up @@ -272,3 +272,5 @@
/// Does this client have typing indicators enabled?
var/typing_indicators = FALSE

/// used for rewarding players monkecoins at round end
var/reward_this_person = 0
7 changes: 6 additions & 1 deletion code/modules/mob/dead/new_player/new_player.dm
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,12 @@

if(character.client && length(character.client?.active_challenges))
SSchallenges.apply_challenges(character.client)

for(var/processing_reward_bitflags in SSticker.bitflags_to_reward)//you really should use department bitflags if possible
if(character.mind.assigned_role.departments_bitflags & processing_reward_bitflags)
character.client.reward_this_person += 150
for(var/processing_reward_jobs in SSticker.jobs_to_reward)//just in case you really only want to reward a specific job
if(character.job == processing_reward_jobs)
character.client.reward_this_person += 150
#define IS_NOT_CAPTAIN 0
#define IS_ACTING_CAPTAIN 1
#define IS_FULL_CAPTAIN 2
Expand Down

0 comments on commit 8e4502e

Please sign in to comment.