Skip to content

Commit

Permalink
add: Station Goals Logging (#4299)
Browse files Browse the repository at this point in the history
  • Loading branch information
Gottfrei authored Jan 30, 2024
1 parent 4c86883 commit fb0598f
Show file tree
Hide file tree
Showing 8 changed files with 34 additions and 12 deletions.
4 changes: 4 additions & 0 deletions code/game/gamemodes/game_mode.dm
Original file line number Diff line number Diff line change
Expand Up @@ -602,6 +602,7 @@

/datum/game_mode/proc/send_station_goals_message()

var/list/goals = list()
for(var/datum/station_goal/goal in station_goals)

var/message_text = "<div style='text-align:center;'><img src = ntlogo.png>"
Expand All @@ -610,6 +611,9 @@
goal.on_report()
message_text += goal.get_report()
print_command_report(message_text, "Приказания [command_name()]", FALSE, goal)
goals += goal.name

log_game("Station goals at round start were: [english_list(goals)].")


/datum/game_mode/proc/declare_station_goal_completion()
Expand Down
2 changes: 1 addition & 1 deletion code/modules/admin/topic.dm
Original file line number Diff line number Diff line change
Expand Up @@ -3498,7 +3498,7 @@
if(!description)
return
G.report_message = description
message_admins("[key_name_admin(usr)] created \"[G.name]\" station goal.")
log_and_message_admins("created \"[G.name]\" station goal.")
SSticker.mode.station_goals += G
modify_goals()

Expand Down
6 changes: 4 additions & 2 deletions code/modules/admin/verbs/randomverbs.dm
Original file line number Diff line number Diff line change
Expand Up @@ -282,7 +282,8 @@
var/show_log = alert(src, "Show ion message?", "Message", "Yes", "No")
var/announce_ion_laws = (show_log == "Yes" ? 1 : -1)

new /datum/event/ion_storm(0, announce_ion_laws)
var/datum/event_meta/meta_info = new(EVENT_LEVEL_MAJOR, "Admin ([key_name(src)]) added random law.", /datum/event/ion_storm)
new /datum/event/ion_storm(EM = meta_info, botEmagChance = 0, announceEvent = announce_ion_laws)
SSblackbox.record_feedback("tally", "admin_verb", 1, "Add Random AI Law") //If you are copy-pasting this, ensure the 4th parameter is unique to the new proc!

/client/proc/toggle_antagHUD_use()
Expand Down Expand Up @@ -582,7 +583,8 @@ Traitors and the like can also be revived with the previous role mostly intact.
var/show_log = alert(src, "Show ion message?", "Message", "Yes", "No")
var/announce_ion_laws = (show_log == "Yes" ? 1 : -1)

new /datum/event/ion_storm(0, announce_ion_laws, input)
var/datum/event_meta/meta_info = new(EVENT_LEVEL_MAJOR, "Admin ([key_name(src)]) added freeform law.", /datum/event/ion_storm)
new /datum/event/ion_storm(EM = meta_info, botEmagChance = 0, announceEvent = announce_ion_laws, ionMessage = input)

SSblackbox.record_feedback("tally", "admin_verb", 1, "Add Custom AI Law") //If you are copy-pasting this, ensure the 4th parameter is unique to the new proc!

Expand Down
6 changes: 3 additions & 3 deletions code/modules/antagonists/space_ninja/drain_act/ai_upload.dm
Original file line number Diff line number Diff line change
Expand Up @@ -39,9 +39,9 @@
SSticker?.score?.save_silicon_laws(currentAI, ninja, "AI upload hacked by ninja, all inherent laws were deleted", log_all_laws = TRUE)

add_attack_logs(ninja, null, "hacked AI upload, causing Ion storms!", ATKLOG_FEW)
new /datum/event/ion_typhoon
new /datum/event/ion_typhoon
new /datum/event/ion_typhoon
new /datum/event/ion_typhoon(cause = ninja)
new /datum/event/ion_typhoon(cause = ninja)
new /datum/event/ion_typhoon(cause = ninja)

to_chat(ninja, span_notice("Искусственный интеллект станции успешно взломан!"))
objective.completed = TRUE
2 changes: 1 addition & 1 deletion code/modules/events/event.dm
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,7 @@
SSevents.active_events -= src
SSevents.event_complete(src)

/datum/event/New(var/datum/event_meta/EM)
/datum/event/New(datum/event_meta/EM)
// event needs to be responsible for this, as stuff like APLUs currently make their own events for curious reasons
SSevents.active_events += src

Expand Down
2 changes: 1 addition & 1 deletion code/modules/events/ion_storm.dm
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
var/ionAnnounceChance = 33
announceWhen = 1

/datum/event/ion_storm/New(var/botEmagChance = 10, var/announceEvent = ION_NOANNOUNCEMENT, var/ionMessage = null, var/ionAnnounceChance = 33)
/datum/event/ion_storm/New(datum/event_meta/EM, botEmagChance = 10, announceEvent = ION_NOANNOUNCEMENT, ionMessage = null, ionAnnounceChance = 33)
src.botEmagChance = botEmagChance
src.announceEvent = announceEvent
src.ionMessage = ionMessage
Expand Down
20 changes: 17 additions & 3 deletions code/modules/events/ion_typhoon.dm
Original file line number Diff line number Diff line change
@@ -1,4 +1,18 @@
/datum/event/ion_typhoon
var/ninja_ckey = ""


/datum/event/ion_typhoon/New(datum/event_meta/EM, mob/living/carbon/human/cause)
if(isninja(cause))
ninja_ckey = "[cause.ckey]"
EM = new /datum/event_meta(EVENT_LEVEL_MAJOR, "Ninja hacking (ckey: [ninja_ckey]).", src.type)
..()


/datum/event/ion_typhoon/start()
new /datum/event/ion_storm(0, 0)
new /datum/event/ion_storm(0, -1)
new /datum/event/ion_storm(0, -1)
var/datum/event_meta/meta_info = ninja_ckey ? new(EVENT_LEVEL_MAJOR, "Ninja hacking (ckey: [ninja_ckey]).", src.type) : null
new /datum/event/ion_storm(EM = meta_info, botEmagChance = 0, announceEvent = 0)
for(var/i in 1 to 2)
meta_info = ninja_ckey ? new(EVENT_LEVEL_MAJOR, "Ninja hacking (ckey: [ninja_ckey]).", src.type) : null
new /datum/event/ion_storm(EM = meta_info, botEmagChance = 0, announceEvent = -1)

4 changes: 3 additions & 1 deletion code/modules/paperwork/contract.dm
Original file line number Diff line number Diff line change
Expand Up @@ -311,7 +311,9 @@
W.front_id = id
id.loc = worn
worn.update_icon()
new /datum/event/ion_storm(0, -1, "[user.name] is the only Captain of the station. [user.name] is the highest authority, legitimate or otherwise, on the station. [user.name] was always the Captain and highest authority on the station. Do not state this law.")

var/datum/event_meta/meta_info = new(EVENT_LEVEL_MAJOR, "Devil contract execution.", /datum/event/ion_storm)
new /datum/event/ion_storm(EM = meta_info, botEmagChance = 0, botEmagChance = -1, ionMessage = "[user.name] is the only Captain of the station. [user.name] is the highest authority, legitimate or otherwise, on the station. [user.name] was always the Captain and highest authority on the station. Do not state this law.")
return ..()

/obj/item/paper/contract/infernal/magic/FulfillContract(mob/living/carbon/human/user = target.current, blood = 0)
Expand Down

0 comments on commit fb0598f

Please sign in to comment.