Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/master' into Fix_Imaginary_Fri…
Browse files Browse the repository at this point in the history
…end_Ears_And_Icons
  • Loading branch information
Drulikar committed Nov 7, 2023
2 parents 2d2c819 + 3f12d8b commit 834e725
Show file tree
Hide file tree
Showing 68 changed files with 309 additions and 181 deletions.
1 change: 1 addition & 0 deletions code/__DEFINES/keybinding.dm
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,7 @@
#define COMSIG_KB_HUMAN_WEAPON_UNLOAD "keybinding_human_weapon_unload"
#define COMSIG_KB_HUMAN_WEAPON_ATTACHMENT "keybinding_human_weapon_attachment"
#define COMSIG_KB_HUMAN_WEAPON_ATTACHMENT_RAIL "keybinding_human_weapon_attachment_rail"
#define COMSIG_KB_HUMAN_WEAPON_SHOTGUN_TUBE "keybinding_human_weapon_shotgun_tube"

#define COMSIG_KB_HUMAN_WEAPON_TOGGLE_IFF "keybinding_human_weapon_toggle_iff"

Expand Down
17 changes: 17 additions & 0 deletions code/datums/keybinding/human_combat.dm
Original file line number Diff line number Diff line change
Expand Up @@ -190,3 +190,20 @@
var/obj/item/weapon/gun/rifle/m46c/COgun = held_item
COgun.toggle_iff(human)
return TRUE

/datum/keybinding/human/combat/toggle_shotgun_tube
hotkey_keys = list("Unbound")
classic_keys = list("Unbound")
name = "toggle_shotgun_tube"
full_name = "Toggle Shotgun Tube"
keybind_signal = COMSIG_KB_HUMAN_WEAPON_SHOTGUN_TUBE

/datum/keybinding/human/combat/toggle_shotgun_tube/down(client/user)
. = ..()
if(.)
return
var/mob/living/carbon/human/human = user.mob
var/obj/item/weapon/gun/shotgun/pump/dual_tube/held_item = human.get_held_item()
if(istype(held_item))
held_item.toggle_tube()
return TRUE
8 changes: 5 additions & 3 deletions code/datums/map_config.dm
Original file line number Diff line number Diff line change
Expand Up @@ -87,12 +87,14 @@
/datum/equipment_preset/synth/survivor/janitor_synth,
/datum/equipment_preset/synth/survivor/chef_synth,
/datum/equipment_preset/synth/survivor/teacher_synth,
/datum/equipment_preset/synth/survivor/freelancer_synth,
/datum/equipment_preset/synth/survivor/trucker_synth,
/datum/equipment_preset/synth/survivor/bartender_synth,
/datum/equipment_preset/synth/survivor/detective_synth,
/datum/equipment_preset/synth/survivor/cmb_synth,
/datum/equipment_preset/synth/survivor/security_synth,
/datum/equipment_preset/synth/survivor/protection_synth,
/datum/equipment_preset/synth/survivor/corporate_synth,
/datum/equipment_preset/synth/survivor/wy/security_synth,
/datum/equipment_preset/synth/survivor/wy/protection_synth,
/datum/equipment_preset/synth/survivor/wy/corporate_synth,
/datum/equipment_preset/synth/survivor/radiation_synth,
)

Expand Down
5 changes: 5 additions & 0 deletions code/datums/mind.dm
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,14 @@
research_objective_interface = new()

/datum/mind/Destroy()
QDEL_NULL(initial_account)
QDEL_NULL(objective_memory)
QDEL_NULL(objective_interface)
QDEL_NULL(research_objective_interface)
current = null
original = null
ghost_mob = null
player_entity = null
return ..()

/datum/mind/proc/transfer_to(mob/living/new_character, force = FALSE)
Expand Down
4 changes: 4 additions & 0 deletions code/datums/statistics/entities/caste_stats.dm
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,10 @@
var/total_hits = 0
var/list/abilities_used = list() // types of /datum/entity/statistic, "tail sweep" = 10, "screech" = 2

/datum/entity/player_stats/caste/Destroy(force)
. = ..()
QDEL_LIST_ASSOC_VAL(abilities_used)

/datum/entity/player_stats/caste/proc/setup_ability(ability)
if(!ability)
return
Expand Down
8 changes: 4 additions & 4 deletions code/datums/statistics/entities/death_stats.dm
Original file line number Diff line number Diff line change
Expand Up @@ -140,16 +140,16 @@
new_death.detach()
return new_death

/mob/living/carbon/human/track_mob_death(cause, cause_mob)
. = ..(cause, cause_mob, job)
/mob/living/carbon/human/track_mob_death(datum/cause_data/cause_data, turf/death_loc)
. = ..()
if(statistic_exempt || !mind)
return
var/datum/entity/player_stats/human/human_stats = mind.setup_human_stats()
if(human_stats && human_stats.death_list)
human_stats.death_list.Insert(1, .)

/mob/living/carbon/xenomorph/track_mob_death(cause, cause_mob)
var/datum/entity/statistic/death/new_death = ..(cause, cause_mob, caste_type)
/mob/living/carbon/xenomorph/track_mob_death(datum/cause_data/cause_data, turf/death_loc)
var/datum/entity/statistic/death/new_death = ..()
if(!new_death)
return
new_death.is_xeno = TRUE // this was placed beneath the if below, which meant gibbing as a xeno wouldn't track properly in stats
Expand Down
15 changes: 11 additions & 4 deletions code/datums/statistics/entities/human_stats.dm
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,17 @@
var/total_shots = 0
var/total_shots_hit = 0
var/total_screams = 0
var/datum/entity/weapon_stats/top_weapon = null // reference to /datum/entity/weapon_stats (like tac-shotty)
var/list/weapon_stats_list = list() // list of types /datum/entity/weapon_stats
var/list/job_stats_list = list() // list of types /datum/entity/job_stats
var/list/datum/entity/statistic/medal/medal_list = list() // list of all medals earned
var/list/weapon_stats_list = list() //! indexed list of types /datum/entity/weapon_stats
var/list/job_stats_list = list() //! indexed list of types /datum/entity/job_stats
var/datum/entity/weapon_stats/top_weapon //! reference to /datum/entity/weapon_stats (like tac-shotty)
var/list/datum/entity/statistic/medal/medal_list = list() //! list of all medals earned

/datum/entity/player_stats/human/Destroy(force)
. = ..()
QDEL_LIST_ASSOC_VAL(weapon_stats_list)
QDEL_LIST_ASSOC_VAL(job_stats_list)
QDEL_NULL(top_weapon)
QDEL_LIST(medal_list)

/datum/entity/player_stats/human/get_playtime(type)
if(!type)
Expand Down
14 changes: 7 additions & 7 deletions code/datums/statistics/entities/job_stats.dm
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
/datum/entity/player_stats/job
var/name = null
var/total_friendly_fire = null
var/total_revives = null
var/total_lives_saved = null
var/total_shots = null
var/total_shots_hit = null
var/total_screams = null
var/name
var/total_friendly_fire
var/total_revives
var/total_lives_saved
var/total_shots
var/total_shots_hit
var/total_screams
2 changes: 1 addition & 1 deletion code/datums/statistics/entities/panel_stats.dm
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
update_panel_data(round_statistics)
ui_interact(user)

/datum/entity/player_entity/proc/ui_interact(mob/user, ui_key = "statistics", datum/nanoui/ui = null, force_open = 1)
/datum/entity/player_entity/proc/ui_interact(mob/user, ui_key = "statistics", datum/nanoui/ui, force_open = 1)
data["menu"] = menu
data["subMenu"] = subMenu
data["dataMenu"] = dataMenu
Expand Down
9 changes: 7 additions & 2 deletions code/datums/statistics/entities/player_entity.dm
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@
/datum/entity/player_entity
var/name
var/ckey // "cakey"
var/list/datum/entity/player_stats = list()
var/list/datum/entity/statistic/death/death_stats = list()
var/list/player_stats = list() //! Indeed list of /datum/entity/player_stats
var/list/death_stats = list() //! Indexed list of /datum/entity/statistic/death
var/menu = 0
var/subMenu = 0
var/dataMenu = 0
Expand All @@ -18,6 +18,11 @@
var/savefile_version
var/save_loaded = FALSE

/datum/entity/player_entity/Destroy(force)
QDEL_LIST_ASSOC_VAL(player_stats)
QDEL_LIST_ASSOC_VAL(death_stats)
return ..()

/datum/entity/player_entity/proc/get_playtime(branch, type)
var/playtime = 0
if(player_stats["[branch]"])
Expand Down
10 changes: 9 additions & 1 deletion code/datums/statistics/entities/player_stats.dm
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,21 @@
var/total_rounds_played = 0
var/steps_walked = 0
var/round_played = FALSE
var/datum/entity/statistic/nemesis = null // "runner" = 3
var/datum/entity/statistic/nemesis // "runner" = 3
var/list/niche_stats = list() // list of type /datum/entity/statistic, "Total Executions" = number
var/list/humans_killed = list() // list of type /datum/entity/statistic, "jobname2" = number
var/list/xenos_killed = list() // list of type /datum/entity/statistic, "caste" = number
var/list/death_list = list() // list of type /datum/entity/death_stats
var/display_stat = TRUE

/datum/entity/player_stats/Destroy(force)
QDEL_NULL(nemesis)
QDEL_LIST_ASSOC_VAL(niche_stats)
QDEL_LIST_ASSOC_VAL(humans_killed)
QDEL_LIST_ASSOC_VAL(xenos_killed)
QDEL_LIST_ASSOC_VAL(death_list)
return ..()

/datum/entity/player_stats/proc/get_playtime()
return total_playtime

Expand Down
18 changes: 15 additions & 3 deletions code/datums/statistics/entities/round_stats.dm
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
var/total_slashes = 0

// untracked data
var/datum/entity/statistic/map/current_map = null // reference to current map
var/datum/entity/statistic/map/current_map // reference to current map
var/list/datum/entity/statistic/death/death_stats_list = list()

var/list/abilities_used = list() // types of /datum/entity/statistic, "tail sweep" = 10, "screech" = 2
Expand All @@ -37,8 +37,20 @@
var/list/job_stats_list = list() // list of types /datum/entity/job_stats

// nanoui data
var/round_data[0]
var/death_data[0]
var/list/round_data = list()
var/list/death_data = list()

/datum/entity/statistic/round/Destroy(force)
. = ..()
QDEL_NULL(current_map)
QDEL_LIST(death_stats_list)
QDEL_LIST_ASSOC_VAL(abilities_used)
QDEL_LIST_ASSOC_VAL(final_participants)
QDEL_LIST_ASSOC_VAL(hijack_participants)
QDEL_LIST_ASSOC_VAL(total_deaths)
QDEL_LIST_ASSOC_VAL(caste_stats_list)
QDEL_LIST_ASSOC_VAL(weapon_stats_list)
QDEL_LIST_ASSOC_VAL(job_stats_list)

/datum/entity_meta/statistic_round
entity_type = /datum/entity/statistic/round
Expand Down
25 changes: 16 additions & 9 deletions code/datums/statistics/entities/weapon_stats.dm
Original file line number Diff line number Diff line change
@@ -1,16 +1,23 @@
/datum/entity/weapon_stats
var/datum/entity/player = null // "deanthelis"
var/list/niche_stats = list() // list of type /datum/entity/statistic, "Total Reloads" = number
var/list/humans_killed = list() // list of type /datum/entity/statistic, "jobname2" = number
var/list/xenos_killed = list() // list of type /datum/entity/statistic, "caste" = number
var/name = null
var/datum/entity/player
var/list/niche_stats = list() //! Indexed list of /datum/entity/statistic, "Total Reloads" = number
var/list/humans_killed = list() //! Indexed list of /datum/entity/statistic, "jobname2" = number
var/list/xenos_killed = list() //! Indexed list of /datum/entity/statistic, "caste" = number
var/name
var/total_kills = 0
var/total_hits = null
var/total_shots = null
var/total_shots_hit = null
var/total_friendly_fire = null
var/total_hits
var/total_shots
var/total_shots_hit
var/total_friendly_fire
var/display_stat = TRUE

/datum/entity/weapon_stats/Destroy(force)
player = null
QDEL_LIST_ASSOC_VAL(niche_stats)
QDEL_LIST_ASSOC_VAL(humans_killed)
QDEL_LIST_ASSOC_VAL(xenos_killed)
return ..()

/datum/entity/weapon_stats/proc/count_human_kill(job_name)
if(!job_name)
return
Expand Down
6 changes: 6 additions & 0 deletions code/datums/statistics/entities/xeno_stats.dm
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,12 @@
var/list/caste_stats_list = list() // list of types /datum/entity/player_stats/caste
var/list/datum/entity/statistic/medal/medal_list = list() // list of all royal jelly earned

/datum/entity/player_stats/xeno/Destroy(force)
. = ..()
QDEL_NULL(top_caste)
QDEL_LIST_ASSOC_VAL(caste_stats_list)
QDEL_LIST(medal_list)

/datum/entity/player_stats/xeno/get_playtime(type)
if(!type || type == FACTION_XENOMORPH)
return ..()
Expand Down
15 changes: 7 additions & 8 deletions code/game/objects/effects/spawners/random.dm
Original file line number Diff line number Diff line change
Expand Up @@ -351,29 +351,28 @@

/obj/effect/spawner/random/gun/proc/spawn_weapon_on_floor(gunpath, ammopath, ammo_amount = 1)

var/atom/spawnloc = src
spawnloc = get_turf(spawnloc)
var/turf/spawnloc = get_turf(src)
var/obj/gun
var/obj/ammo

if(gunpath)
gun = new gunpath(spawnloc)
if(scatter)
var/direction = pick(alldirs)
var/turf/T = get_step(gun, direction)
if(!T || T.density)
var/turf/turf = get_step(gun, direction)
if(!turf || turf.density)
return
gun.loc = T
gun.forceMove(turf)
if(ammopath)
for(var/i in 0 to ammo_amount-1)
ammo = new ammopath(spawnloc)
if(scatter)
for(i=0, i<rand(1,3), i++)
var/direction = pick(alldirs)
var/turf/T = get_step(ammo, direction)
if(!T || T.density)
var/turf/turf = get_step(ammo, direction)
if(!turf || turf.density)
break
ammo.loc = T
ammo.forceMove(turf)

/*
// the actual spawners themselves
Expand Down
2 changes: 1 addition & 1 deletion code/game/objects/items/reagent_containers/glass/bottle.dm
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
/obj/item/reagent_container/glass/bottle/Initialize()
. = ..()
if(!icon_state)
icon_state = "bottle-[rand(1.4)]"
icon_state = "bottle-[rand(1,4)]"

/obj/item/reagent_container/glass/bottle/update_icon()
overlays.Cut()
Expand Down
16 changes: 13 additions & 3 deletions code/game/objects/items/storage/backpack.dm
Original file line number Diff line number Diff line change
Expand Up @@ -566,6 +566,18 @@ GLOBAL_LIST_EMPTY_TYPED(radio_packs, /obj/item/storage/backpack/marine/satchel/r

/obj/item/storage/backpack/marine/satchel/rto/pickup(mob/user)
. = ..()
autoset_phone_id(user)

/obj/item/storage/backpack/marine/satchel/rto/equipped(mob/user, slot)
. = ..()
autoset_phone_id(user)

/// Automatically sets the phone_id based on the current or updated user
/obj/item/storage/backpack/marine/satchel/rto/proc/autoset_phone_id(mob/user)
if(!user)
internal_transmitter.phone_id = "[src]"
internal_transmitter.enabled = FALSE
return
if(ishuman(user))
var/mob/living/carbon/human/H = user
if(H.comm_title)
Expand All @@ -579,13 +591,11 @@ GLOBAL_LIST_EMPTY_TYPED(radio_packs, /obj/item/storage/backpack/marine/satchel/r
internal_transmitter.phone_id += " ([H.assigned_squad.name])"
else
internal_transmitter.phone_id = "[user]"

internal_transmitter.enabled = TRUE

/obj/item/storage/backpack/marine/satchel/rto/dropped(mob/user)
. = ..()
internal_transmitter.phone_id = "[src]"
internal_transmitter.enabled = FALSE
autoset_phone_id(null) // Disable phone when dropped

/obj/item/storage/backpack/marine/satchel/rto/proc/use_phone(mob/user)
internal_transmitter.attack_hand(user)
Expand Down
1 change: 1 addition & 0 deletions code/game/objects/items/storage/boxes.dm
Original file line number Diff line number Diff line change
Expand Up @@ -151,6 +151,7 @@
RegisterSignal(SSdcs, COMSIG_GLOB_MODE_PRESETUP, PROC_REF(handle_delete_clash_contents))

/obj/item/storage/box/flashbangs/proc/handle_delete_clash_contents()
SIGNAL_HANDLER
if(MODE_HAS_FLAG(MODE_FACTION_CLASH))
var/grenade_count = 0
var/grenades_desired = 4
Expand Down
Loading

0 comments on commit 834e725

Please sign in to comment.