It's done, atleast the code is

This commit is contained in:
Fabian
2021-03-05 21:50:29 +01:00
parent 2f1aba4f80
commit 8178b7073a
17 changed files with 1128 additions and 58 deletions
+4
View File
@@ -57,6 +57,10 @@
#define ADMIN_SET_SD_CODE "(<a href='?_src_=holder;[HrefToken(TRUE)];set_selfdestruct_code=1'>SETCODE</a>)"
#define ADMIN_FULLMONTY_NONAME(user) "[ADMIN_QUE(user)] [ADMIN_PP(user)] [ADMIN_VV(user)] [ADMIN_SM(user)] [ADMIN_FLW(user)] [ADMIN_TP(user)] [ADMIN_INDIVIDUALLOG(user)] [ADMIN_SMITE(user)]"
#define ADMIN_FULLMONTY(user) "[key_name_admin(user)] [ADMIN_FULLMONTY_NONAME(user)]"
//ambition start
#define ADMIN_TPMONTY_NONAME(user) "[ADMIN_QUE(user)] [ADMIN_JMP(user)] [ADMIN_FLW(user)]"
#define ADMIN_TPMONTY(user) "[key_name_admin(user)] [ADMIN_TPMONTY_NONAME(user)]"
//ambition end
#define ADMIN_JMP(src) "(<a href='?_src_=holder;[HrefToken(TRUE)];adminplayerobservecoodjump=1;X=[src.x];Y=[src.y];Z=[src.z]'>JMP</a>)"
#define COORD(src) "[src ? "([src.x],[src.y],[src.z])" : "nonexistent location"]"
#define AREACOORD(src) "[src ? "[get_area_name(src, TRUE)] ([src.x], [src.y], [src.z])" : "nonexistent location"]"
+6
View File
@@ -110,3 +110,9 @@ GLOBAL_LIST_EMPTY(living_heart_cache) //A list of all living hearts in existance
#define BLOB_SPREAD_COST 4
#define BLOB_ATTACK_REFUND 2 //blob refunds this much if it attacks and doesn't spread
#define BLOB_REFLECTOR_COST 15
//Objectives-Ambitions Panel
#define REQUEST_NEW_OBJECTIVE "new_objective"
#define REQUEST_DEL_OBJECTIVE "del_objective"
#define REQUEST_WIN_OBJECTIVE "win_objective"
#define REQUEST_LOSE_OBJECTIVE "lose_objective"
+5 -1
View File
@@ -27,7 +27,9 @@
//INDEXES
#define COOLDOWN_EMPLOYMENT_CABINET "employment cabinet"
#define COOLDOWN_AMBITION "ambition"
#define COOLDOWN_OBJECTIVES "objectives"
#define COOLDOWN_OBJ_ADMIN_PING "obj_admin_ping"
//TIMER COOLDOWN MACROS
@@ -63,6 +65,8 @@
#define COOLDOWN_START(cd_source, cd_index, cd_time) (cd_source.cd_index = world.time + cd_time)
#define COOLDOWN_CHECK(cd_source, cd_index) (cd_source.cd_index < world.time)
//Returns true if the cooldown has run its course, false otherwise
#define COOLDOWN_FINISHED(cd_source, cd_index) (cd_source.cd_index < world.time)
+3
View File
@@ -86,6 +86,9 @@
#define EMOTE_OMNI 4
//Don't set this very much higher then 1024 unless you like inviting people in to dos your server with message spam
//ambition start
#define MAX_AMBITION_LEN 1024
//ambition end
#define MAX_MESSAGE_LEN 4096 //Citadel edit: What's the WORST that could happen?
#define MAX_FLAVOR_LEN 4096
#define MAX_TASTE_LEN 40 //lick... vore... ew...
+3
View File
@@ -13,6 +13,9 @@
#define UNSETEMPTY(L) if (L && !length(L)) L = null
#define LAZYCOPY(L) (L ? L.Copy() : list() )
#define LAZYREMOVE(L, I) if(L) { L -= I; if(!length(L)) { L = null; } }
//ambition start
#define LAZYCUT(L, S, E) if((length(L) >= S) && (E == 0 || length(L) >= (E - 1))) { L.Cut(S, E); if(!length(L)) { L = null; } }
//ambition end
#define LAZYADD(L, I) if(!L) { L = list(); } L += I;
#define LAZYOR(L, I) if(!L) { L = list(); } L |= I;
#define LAZYFIND(L, V) L ? L.Find(V) : 0
+4
View File
@@ -491,6 +491,10 @@
currrent_category = A.roundend_category
previous_category = A
result += A.roundend_report()
//ambition start
for(var/count in 1 to LAZYLEN(A.owner.ambitions))
result += "<br><B>Ambition #[count]</B>: [A.owner.ambitions[count]]"
//ambition end
result += "<br><br>"
CHECK_TICK
@@ -441,3 +441,8 @@
config_entry_value = TRUE
/datum/config_entry/string/centcom_ban_db // URL for the CentCom Galactic Ban DB API
//ambition start
/datum/config_entry/number/max_ambitions // Maximum number of ambitions a mind can store.
config_entry_value = 5
//ambition end
+38
View File
@@ -49,6 +49,11 @@
/// A weak reference to another datum
var/datum/weakref/weak_reference
//ambition start
///Lazy associative list of currently active cooldowns.
var/list/cooldowns
//ambition end
/*
* Lazy associative list of currently active cooldowns.
*
@@ -231,6 +236,39 @@
else
return returned
//ambition start
/**
* Callback called by a timer to end an associative-list-indexed cooldown.
*
* Arguments:
* * source - datum storing the cooldown
* * index - string index storing the cooldown on the cooldowns associative list
*
* This sends a signal reporting the cooldown end.
*/
/proc/end_cooldown(datum/source, index)
if(QDELETED(source))
return
SEND_SIGNAL(source, COMSIG_CD_STOP(index))
TIMER_COOLDOWN_END(source, index)
/**
* Proc used by stoppable timers to end a cooldown before the time has ran out.
*
* Arguments:
* * source - datum storing the cooldown
* * index - string index storing the cooldown on the cooldowns associative list
*
* This sends a signal reporting the cooldown end, passing the time left as an argument.
*/
/proc/reset_cooldown(datum/source, index)
if(QDELETED(source))
return
SEND_SIGNAL(source, COMSIG_CD_RESET(index), S_TIMER_COOLDOWN_TIMELEFT(source, index))
TIMER_COOLDOWN_END(source, index)
//ambition end
/**
* Callback called by a timer to end an associative-list-indexed cooldown.
*
+957 -39
View File
File diff suppressed because it is too large Load Diff
+12 -2
View File
@@ -25,7 +25,9 @@
to_chat(usr, "<span class='warning'>You seem to be selecting a mob that doesn't exist anymore.</span>", confidential = TRUE)
return
var/body = "<html><head><meta http-equiv='Content-Type' content='text/html; charset=UTF-8'><title>Options for [M.key]</title></head>"
//ambition start
var/list/body = list("<html><head><meta http-equiv='Content-Type' content='text/html; charset=UTF-8'><title>Options for [M.key]</title></head>")
//ambition end
body += "<body>Options panel for <b>[M]</b>"
if(M.client)
body += " played by <b>[M.client]</b> "
@@ -125,6 +127,10 @@
body += "<A href='?_src_=holder;[HrefToken()];subtlemessage=[REF(M)]'>Subtle message</A> | "
// body += "<A href='?_src_=holder;[HrefToken()];playsoundto=[REF(M)]'>Play sound to</A> | "
body += "<A href='?_src_=holder;[HrefToken()];languagemenu=[REF(M)]'>Language Menu</A>"
//ambition start
if(M.mind)
body += " | <A href='?_src_=holder;[HrefToken()];ObjectiveRequest=[REF(M.mind)]'>Objective-Ambition Menu</A>"
//ambition end
if (M.client)
if(!isnewplayer(M))
@@ -206,7 +212,11 @@
body += "<br>"
body += "</body></html>"
usr << browse(body, "window=adminplayeropts-[REF(M)];size=550x515")
//ambition start
var/datum/browser/popup = new(usr, "adminplayeropts-[REF(M)]", "Player Panel", nwidth = 550, nheight = 515)
popup.set_content(body.Join())
popup.open()
//ambition end
SSblackbox.record_feedback("tally", "admin_verb", 1, "Player Panel") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc!
+23 -9
View File
@@ -97,10 +97,14 @@ GLOBAL_VAR(antag_prototypes)
alert("This mind doesn't have a mob, or is deleted! For some reason!", "Edit Memory")
return
var/out = "<B>[name]</B>[(current && (current.real_name!=name))?" (as [current.real_name])":""]<br>"
out += "Mind currently owned by key: [key] [active?"(synced)":"(not synced)"]<br>"
out += "Assigned role: [assigned_role]. <a href='?src=[REF(src)];role_edit=1'>Edit</a><br>"
out += "Faction and special role: <b><font color='red'>[special_role]</font></b><br>"
//ambition start
var/list/out = list(
"<B>[name]</B>[(current && (current.real_name!=name))?" (as [current.real_name])":""]<br>\
Mind currently owned by key: [key] [active?"(synced)":"(not synced)"]<br>\
Assigned role: [assigned_role]. <a href='?src=[REF(src)];role_edit=1'>Edit</a><br>\
Faction and special role: <b><font color='red'>[special_role]</font></b><br>"
)
//ambition end
var/special_statuses = get_special_statuses()
if(length(special_statuses))
@@ -203,15 +207,25 @@ GLOBAL_VAR(antag_prototypes)
uplink_info += "." //hiel grammar
out += uplink_info + "<br>"
//ambition start
//Ambitions
out += "<b>[current.real_name]'s Ambitions:</b> <a href='?src=[REF(src)];edit_ambitions_panel=1'>Edit Ambitions</a><br><ul>"
if(!LAZYLEN(ambitions))
out += "<li><i><b>NONE</b></i><li>"
else
for(var/count in 1 to LAZYLEN(ambitions))
out += "<li><B>Ambition #[count]</B>:<br>[ambitions[count]]"
out += "</ul>"
//Common Memory
var/common_memory = "<span>Common Memory:</span>"
common_memory += memory
common_memory += "<a href='?src=[REF(src)];memory_edit=1'>Edit Memory</a>"
out += common_memory + "<br>"
out += "<br><span>Common Memory:</span>"
out += memory
out += "<a href='?src=[REF(src)];memory_edit=1'>Edit Memory</a><br>"
//Other stuff
out += get_common_admin_commands()
out += "<br><a href='?src=[REF(src)];refresh_antag_panel=1'>Refresh</a>"
var/datum/browser/panel = new(usr, "traitorpanel", "", 600, 600)
panel.set_content(out)
panel.set_content(out.Join())
//ambition end
panel.open()
return
+12
View File
@@ -2251,6 +2251,18 @@
var/mob/M = locate(href_list["HeadsetMessage"])
usr.client.admin_headset_message(M)
//ambition start
else if(href_list["ObjectiveRequest"])
if(!check_rights(R_ADMIN))
return
var/datum/mind/requesting_mind = locate(href_list["ObjectiveRequest"])
if(!istype(requesting_mind) || QDELETED(requesting_mind))
to_chat(usr, "<span class='warning'>This mind reference is no longer valid. It has probably since been destroyed.</span>")
return
requesting_mind.do_edit_objectives_ambitions()
return
//ambition end
else if(href_list["reject_custom_name"])
if(!check_rights(R_ADMIN))
@@ -25,6 +25,10 @@ GLOBAL_LIST_EMPTY(antagonists)
var/show_name_in_check_antagonists = FALSE //Will append antagonist name in admin listings - use for categories that share more than one antag type
var/list/blacklisted_quirks = list(/datum/quirk/nonviolent,/datum/quirk/mute) // Quirks that will be removed upon gaining this antag. Pacifist and mute are default.
var/threat = 0 // Amount of threat this antag poses, for dynamic mode
//ambition start
/// Lazy list for antagonists to request the admins objectives.
var/list/requested_objective_changes
//ambition end
var/show_to_ghosts = FALSE // Should this antagonist be shown as antag to ghosts? Shouldn't be used for stealthy antagonists like traitors
var/list/skill_modifiers
@@ -35,8 +39,9 @@ GLOBAL_LIST_EMPTY(antagonists)
/datum/antagonist/Destroy()
GLOB.antagonists -= src
if(owner)
LAZYREMOVE(owner.antag_datums, src)
//ambition start
owner?.do_remove_antag_datum(src)
//ambition end
owner = null
return ..()
@@ -133,7 +138,9 @@ GLOBAL_LIST_EMPTY(antagonists)
remove_innate_effects()
clear_antag_moodies()
if(owner)
LAZYREMOVE(owner.antag_datums, src)
//ambition start
owner.do_remove_antag_datum(src)
//ambition end
for(var/A in skill_modifiers)
owner.remove_skill_modifier(GET_SKILL_MOD_ID(A, type))
if(!silent && owner.current)
@@ -294,3 +301,33 @@ GLOBAL_LIST_EMPTY(antagonists)
else
return
..()
///Clears change requests from deleted objectives to avoid broken references.
/datum/antagonist/proc/clean_request_from_del_objective(datum/objective/source, force)
var/objective_reference = REF(source)
for(var/uid in requested_objective_changes)
var/list/change_request = requested_objective_changes[uid]
if(change_request["target"] != objective_reference)
continue
LAZYREMOVE(requested_objective_changes, uid)
/datum/antagonist/proc/add_objective_change(uid, list/additions)
LAZYADD(requested_objective_changes, uid)
var/datum/objective/request_target = additions["target"]
if(!ispath(request_target))
request_target = locate(request_target) in objectives
if(istype(request_target))
RegisterSignal(request_target, COMSIG_PARENT_QDELETING, .proc/clean_request_from_del_objective)
requested_objective_changes[uid] = additions
/datum/antagonist/proc/remove_objective_change(uid)
if(!LAZYACCESS(requested_objective_changes, uid))
return
var/datum/objective/request_target = requested_objective_changes[uid]["target"]
if(!ispath(request_target))
request_target = locate(request_target) in objectives
if(istype(request_target))
UnregisterSignal(request_target, COMSIG_PARENT_QDELETING)
LAZYREMOVE(requested_objective_changes, uid)
@@ -65,7 +65,9 @@
user.copy_languages(target, LANGUAGE_ABSORB)
if(target.mind && user.mind)//if the victim and user have minds
target.mind.show_memory(user, 0) //I can read your mind, kekeke. Output all their notes.
//ambition start
to_chat(user, "<i>[target.mind.show_memory()]</i>") //I can read your mind, kekeke. Output all their notes.
//ambition end
//Some of target's recent speech, so the changeling can attempt to imitate them better.
//Recent as opposed to all because rounds tend to have a LOT of text.
+4 -1
View File
@@ -49,7 +49,10 @@
cult_team = new_team
/datum/antagonist/cult/proc/add_objectives()
objectives |= cult_team?.objectives
//ambition start
if(cult_team)
objectives |= cult_team.objectives
//ambition end
/datum/antagonist/cult/Destroy()
QDEL_NULL(communion)
+4 -1
View File
@@ -2,7 +2,10 @@
..()
//Mind updates
sync_mind()
mind.show_memory(src, 0)
//ambition start
if(mind.memory || mind.antag_datums)
to_chat(src, "<i>[mind.show_memory()]</i>")
//ambition end
//Round specific stuff
if(SSticker.mode)
+5 -1
View File
@@ -441,7 +441,11 @@
set category = "IC"
set desc = "View your character's notes memory."
if(mind)
mind.show_memory(src)
//ambition start
var/datum/browser/popup = new(src, "memory", "Memory and Notes")
popup.set_content(mind.show_memory())
popup.open()
//ambition end
else
to_chat(src, "You don't have a mind datum for some reason, so you can't look at your notes, if you had any.")