Skip to content

Commit

Permalink
TGS Test Merge (#7242)
Browse files Browse the repository at this point in the history
  • Loading branch information
cm13-github committed Nov 16, 2024
2 parents 9d7906f + 0f24fab commit 79bf325
Show file tree
Hide file tree
Showing 9 changed files with 880 additions and 9 deletions.
14 changes: 13 additions & 1 deletion code/__DEFINES/clans.dm
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@
#define CLAN_RANK_ELDER_INT 5
#define CLAN_RANK_LEADER_INT 6
#define CLAN_RANK_ADMIN_INT 7
#define CLAN_RANK_SUPERADMIN_INT 10

/// Hard limit
#define CLAN_LIMIT_NUMBER 1
Expand Down Expand Up @@ -76,7 +77,7 @@

#define NO_CLAN_LIST list(\
clan_id = null,\
clan_name = "Clanless",\
clan_name = CLAN_NAME_CLANLESS,\
clan_description = "This is a list of players without a clan",\
clan_honor = null,\
clan_keys = list(),\
Expand All @@ -91,3 +92,14 @@
)

#define CLAN_SHIP_PUBLIC -1

#define CLAN_ANCILLARY_NONE "None"
#define CLAN_ANCILLARY_ENFORCER "Enforcer"
#define CLAN_ANCILLARY_HOUND_MASTER "Hound Master"
#define CLAN_ANCILLARY_TASK_MASTER "Task Master"
#define CLAN_ANCILLARY_ADJUTANT "Adjutant"
#define CLAN_ANCILLARY_SHAMAN "Shaman"
#define CLAN_ANCILLARY_HIGH_ENFORCER "High Enforcer"
#define CLAN_ANCILLARY_HIGH_SHAMAN "High Shaman"

#define CLAN_NAME_CLANLESS "Clanless"
11 changes: 11 additions & 0 deletions code/_globalvars/lists/clans.dm
Original file line number Diff line number Diff line change
Expand Up @@ -17,3 +17,14 @@ GLOBAL_LIST_INIT(clan_ranks_ordered, list(
CLAN_RANK_LEADER = CLAN_RANK_LEADER_INT,
CLAN_RANK_ADMIN = CLAN_RANK_ADMIN_INT
))

GLOBAL_LIST_INIT_TYPED(clan_ancillaries, /datum/yautja_ancillary, list(
CLAN_ANCILLARY_ENFORCER = new /datum/yautja_ancillary/enforcer(),
CLAN_ANCILLARY_ADJUTANT = new /datum/yautja_ancillary/adjutant(),
CLAN_ANCILLARY_HOUND_MASTER = new /datum/yautja_ancillary/hound_master(),
CLAN_ANCILLARY_TASK_MASTER = new /datum/yautja_ancillary/task_master(),
CLAN_ANCILLARY_SHAMAN = new /datum/yautja_ancillary/shaman(),
CLAN_ANCILLARY_HIGH_ENFORCER = new /datum/yautja_ancillary/high_enforcer(),
CLAN_ANCILLARY_HIGH_SHAMAN = new /datum/yautja_ancillary/high_shaman(),
CLAN_ANCILLARY_NONE = new /datum/yautja_ancillary/clear()
))
11 changes: 10 additions & 1 deletion code/datums/entities/clans.dm
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@
var/clan_id

var/honor
var/player_name
var/clan_ancillary

/datum/entity/clan
var/name
Expand Down Expand Up @@ -40,12 +42,15 @@ BSQL_PROTECT_DATUM(/datum/entity/clan)
"permissions" = DB_FIELDTYPE_BIGINT,
"clan_id" = DB_FIELDTYPE_BIGINT,
"honor" = DB_FIELDTYPE_BIGINT,
"player_name" = DB_FIELDTYPE_STRING_MEDIUM,
"clan_ancillary" = DB_FIELDTYPE_STRING_MEDIUM,
)
key_field = "player_id"

/datum/entity_meta/clan_player/on_insert(datum/entity/clan_player/player)
player.honor = 0
player.clan_rank = GLOB.clan_ranks_ordered[CLAN_RANK_UNBLOODED]
player.clan_ancillary = CLAN_ANCILLARY_NONE
player.permissions = GLOB.clan_ranks[CLAN_RANK_UNBLOODED].permissions

player.save()
Expand Down Expand Up @@ -76,6 +81,8 @@ BSQL_PROTECT_DATUM(/datum/entity/clan)
var/permissions
var/clan_name
var/honor
var/player_name
var/clan_ancillary

/datum/entity_view_meta/clan_players_view
root_record_type = /datum/entity/clan_player
Expand All @@ -88,7 +95,9 @@ BSQL_PROTECT_DATUM(/datum/entity/clan)
"honor",
"clan_player_id" = "id",
"clan_name" = "clan.name",
"ckey" = "player.ckey"
"ckey" = "player.ckey",
"player_name",
"clan_ancillary",
)
order_by = list("clan_rank" = DB_ORDER_BY_DESC)

Expand Down
Loading

0 comments on commit 79bf325

Please sign in to comment.