Skip to content

Commit

Permalink
stuff
Browse files Browse the repository at this point in the history
  • Loading branch information
Tarmunora committed May 3, 2024
1 parent a1f0f27 commit f6cf2a1
Show file tree
Hide file tree
Showing 6 changed files with 53 additions and 1 deletion.
2 changes: 2 additions & 0 deletions _std/macros/atom_properties.dm
Original file line number Diff line number Diff line change
Expand Up @@ -311,6 +311,8 @@ To remove:
#define PROP_ATOM_FLOATING(x) x("floating", APPLY_ATOM_PROPERTY_SIMPLE, REMOVE_ATOM_PROPERTY_SIMPLE)
/// Thing will redirect clicks to a fluid on its tile when clicked by a relevant item (beaker mop etc)
#define PROP_ATOM_DO_LIQUID_CLICKS(x) x("do_liquid_clicks", APPLY_ATOM_PROPERTY_SIMPLE, REMOVE_ATOM_PROPERTY_SIMPLE)
///for tracking if a borg/cyborg frame was a roundstart one, for stats purposes
#define PROP_ATOM_ROUNDSTART_BORG(x) x("rounstart_borg", APPLY_ATOM_PROPERTY_SIMPLE, REMOVE_ATOM_PROPERTY_SIMPLE)


// In lieu of comments, these are the indexes used for list access in the macros below.
Expand Down
3 changes: 2 additions & 1 deletion code/datums/jobs.dm
Original file line number Diff line number Diff line change
Expand Up @@ -1157,7 +1157,8 @@ ABSTRACT_TYPE(/datum/job/civilian)
..()
if (!M)
return
return M.Robotize_MK2()
. = M.Robotize_MK2()
APPLY_ATOM_PROPERTY(., PROP_ATOM_ROUNDSTART_BORG, "borg")

// Special Cases

Expand Down
8 changes: 8 additions & 0 deletions code/mob/living/silicon/robot.dm
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,8 @@
if (frame)
src.freemodule = frame.freemodule
src.frame_material = frame.material
if(HAS_ATOM_PROPERY(frame, PROP_ATOM_ROUNDSTART_BORG))
APPLY_ATOM_PROPERTY(src, PROP_ATOM_ROUNDSTART_BORG, "borg")
if (starter && !(src.dependent || src.shell))
var/obj/item/parts/robot_parts/chest/light/PC = new /obj/item/parts/robot_parts/chest/light(src)
var/obj/item/cell/supercell/charged/CELL = new /obj/item/cell/supercell/charged(PC)
Expand Down Expand Up @@ -294,6 +296,8 @@
frame.emagged = src.emagged
frame.syndicate = src.syndicate
frame.freemodule = src.freemodule
if(HAS_ATOM_PROPERTY(src, PROP_ATOM_ROUNDSTART_BORG))
APPLY_ATOM_PROPERTY(frame, PROP_ATOM_ROUNDSTART_BORG, "borg")

src.ghostize()
qdel(src)
Expand Down Expand Up @@ -2383,6 +2387,10 @@
if(length(src.upgrades) < src.max_upgrades)
src.upgrades += new /obj/item/roboupgrade/visualizer(src)


var/datum/eventRecord/CyborgModuleSelection/cyborgModuleSelectionEvent = new()
cyborgModuleSelectionEvent.buildAndSend(src, mod)

var/datum/robot_cosmetic/C = null
var/datum/robot_cosmetic/M = null
if (istype(src.cosmetic_mods,/datum/robot_cosmetic/)) C = src.cosmetic_mods
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@

/// Record initial cyborg module selection
/datum/eventRecord/CyborgModuleSelection
eventType = "cyborg_module_selection"
body = /datum/eventRecordBody/TracksPlayer/CyborgModuleSelection

send(
player_id,
module,
borg_type
)
. = ..(args)

buildAndSend(mob/living/silicon/robot/R, mod)
if (!istype(R))
return


var/type
if(R.syndicate)
type = "syndicate"
else if(istype(R.part_head.brain, /obj/item/organ/brain/latejoin))
type = "latejoin"
else if(HAS_ATOM_PROPERTY(R, PROP_ATOM_ROUNDSTART_BORG))
type = "roundstart"
else
type = "constructed/other"

src.send(
R.mind.get_player().id,
mod,
type
)
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@

/datum/eventRecordBody/TracksPlayer/CyborgModuleSelection
fields = list(
"module", // string
"borg_type" // string
)
2 changes: 2 additions & 0 deletions goonstation.dme
Original file line number Diff line number Diff line change
Expand Up @@ -1355,6 +1355,7 @@ var/datum/preMapLoad/preMapLoad = new
#include "code\modules\goonhub\event_recording\events\AntagItemPurchase.dm"
#include "code\modules\goonhub\event_recording\events\AntagObjective.dm"
#include "code\modules\goonhub\event_recording\events\BeeSpawn.dm"
#include "code\modules\goonhub\event_recording\events\CyborgModuleSelection.dm"
#include "code\modules\goonhub\event_recording\events\Death.dm"
#include "code\modules\goonhub\event_recording\events\Error.dm"
#include "code\modules\goonhub\event_recording\events\eventRecord.dm"
Expand All @@ -1369,6 +1370,7 @@ var/datum/preMapLoad/preMapLoad = new
#include "code\modules\goonhub\event_recording\types\AntagItemPurchase.dm"
#include "code\modules\goonhub\event_recording\types\AntagObjective.dm"
#include "code\modules\goonhub\event_recording\types\BeeSpawn.dm"
#include "code\modules\goonhub\event_recording\types\CyborgModuleSelection.dm"
#include "code\modules\goonhub\event_recording\types\Death.dm"
#include "code\modules\goonhub\event_recording\types\Error.dm"
#include "code\modules\goonhub\event_recording\types\eventBody.dm"
Expand Down

0 comments on commit f6cf2a1

Please sign in to comment.