Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

another attempt at fixing cult #19541

Merged
merged 4 commits into from
Jul 9, 2023
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
More cult fixes
  • Loading branch information
JohnFulpWillard committed Jul 9, 2023
commit 0a06de76d472885a004fe7ed0376ffb651b0e881
19 changes: 17 additions & 2 deletions code/modules/admin/antag_panel.dm
Original file line number Diff line number Diff line change
Expand Up @@ -34,14 +34,15 @@ GLOBAL_VAR(antag_prototypes)
var/command_part = commands.Join(" | ")
var/data_part = antag_panel_data()
var/objective_part = antag_panel_objectives()
var/team_objective_part = antag_panel_team_objectives()
var/memory_part = antag_panel_memory()

var/list/parts = listtrim(list(command_part,data_part,objective_part,memory_part))
var/list/parts = listtrim(list(command_part, data_part, objective_part, team_objective_part, memory_part))

return parts.Join("<br>")

/datum/antagonist/proc/antag_panel_objectives()
var/result = "<i><b>Objectives</b></i>:<br>"
var/result = "<i><b>Personal Objectives</b></i>:<br>"
if (objectives.len == 0)
result += "EMPTY<br>"
else
Expand All @@ -53,6 +54,20 @@ GLOBAL_VAR(antag_prototypes)
result += "<a href='?src=[REF(owner)];obj_announce=1'>Announce objectives</a><br>"
return result

/datum/antagonist/proc/antag_panel_team_objectives()
var/datum/team/antag_team = get_team()
if(!antag_team)
return
var/result = "<i><b>Team Objectives</b></i>:<br>"
if (antag_team.objectives.len == 0)
result += "EMPTY<br>"
else
var/obj_count = 1
for(var/datum/objective/objective in antag_team.objectives)
result += "<B>[obj_count]</B>: <font color=[objective.check_completion() ? "green" : "red"]>[objective.explanation_text][objective.check_completion() ? " (COMPLETED)" : ""]</font> <a href='?src=[REF(owner)];obj_edit=[REF(objective)]'>Edit</a> <a href='?src=[REF(owner)];obj_delete=[REF(objective)]'>Delete</a> <a href='?src=[REF(owner)];obj_completed=[REF(objective)]'><font color=[objective.completed ? "green" : "red"]>[objective.completed ? "Mark as incomplete" : "Mark as complete"]</font></a><br>"
obj_count++
return result

/datum/antagonist/proc/antag_panel_memory()
var/out = "<b>Memory:</b><br>"
out += task_memory
Expand Down
5 changes: 3 additions & 2 deletions code/modules/antagonists/_common/antag_datum.dm
Original file line number Diff line number Diff line change
Expand Up @@ -203,7 +203,7 @@ GLOBAL_LIST_EMPTY(antagonists)

//Returns the team antagonist belongs to if any.
/datum/antagonist/proc/get_team()
return
return null

//Individual roundend report
/datum/antagonist/proc/roundend_report()
Expand Down Expand Up @@ -401,8 +401,9 @@ GLOBAL_LIST_EMPTY(antagonists)
/datum/antagonist/proc/get_objectives()
var/objective_count = 1
var/list/objective_data = list()
var/datum/team/antag_team = get_team()
//all obj
for(var/datum/objective/objective in objectives)
for(var/datum/objective/objective in objectives + antag_team?.objectives)
objective_data += list(list(
"count" = objective_count,
"name" = objective.objective_name,
Expand Down
36 changes: 21 additions & 15 deletions code/modules/antagonists/cult/cult.dm
Original file line number Diff line number Diff line change
Expand Up @@ -40,9 +40,6 @@
stack_trace("Wrong team type passed to [type] initialization.")
cult_team = new_team

/datum/antagonist/cult/proc/add_objectives()
objectives |= cult_team.objectives

/datum/antagonist/cult/Destroy()
QDEL_NULL(communion)
QDEL_NULL(vote)
Expand Down Expand Up @@ -71,7 +68,6 @@

/datum/antagonist/cult/on_gain()
. = ..()
add_objectives()
var/mob/living/current = owner.current
if(ishuman(current))
var/mob/living/carbon/human/H = current
Expand Down Expand Up @@ -480,12 +476,6 @@
var/sacced = FALSE
var/sac_image

/datum/objective/sacrifice/is_valid_target(possible_target)
. = ..()
var/datum/mind/M = possible_target
if(istype(M) && isipc(M.current))
return FALSE

/// Unregister signals from the old target so it doesn't cause issues when sacrificed of when a new target is found.
/datum/objective/sacrifice/proc/clear_sacrifice()
if(!target)
Expand All @@ -502,13 +492,29 @@
var/datum/team/cult/cult = team
var/list/target_candidates = list()
for(var/mob/living/carbon/human/player in GLOB.player_list)
if(player.mind && !player.mind.has_antag_datum(/datum/antagonist/cult) && !is_convertable_to_cult(player) && player.stat != DEAD)
target_candidates += player.mind
if(!player.mind)
continue
if(player.mind.has_antag_datum(/datum/antagonist/cult))
continue
if(is_convertable_to_cult(player))
continue
if(isipc(player))
continue
if(player.stat == DEAD)
continue
target_candidates += player.mind
if(target_candidates.len == 0)
message_admins("Cult Sacrifice: Could not find unconvertible target, checking for convertible target.")
for(var/mob/living/carbon/human/player in GLOB.player_list)
if(player.mind && !player.mind.has_antag_datum(/datum/antagonist/cult) && player.stat != DEAD)
target_candidates += player.mind
if(!player.mind)
continue
if(player.mind.has_antag_datum(/datum/antagonist/cult))
continue
if(isipc(player))
continue
if(player.stat == DEAD)
continue
target_candidates += player.mind
listclearnulls(target_candidates)
if(LAZYLEN(target_candidates))
target = pick(target_candidates)
Expand Down Expand Up @@ -580,7 +586,7 @@
update_explanation_text()

/datum/objective/eldergod/update_explanation_text()
explanation_text = "Summon Nar'sie by invoking the rune 'Summon Nar'sie'. <b>The summoning can only be accomplished in [english_list(summon_spots)] - where the veil is weak enough for the ritual to begin.</b>"
explanation_text = "Summon Nar'sie by invoking the rune 'Summon Nar'sie'. The summoning can only be accomplished in [english_list(summon_spots)] - where the veil is weak enough for the ritual to begin."

/datum/objective/eldergod/check_completion()
if(killed)
Expand Down