Skip to content

Commit

Permalink
TGS Test Merge (#8007)
Browse files Browse the repository at this point in the history
  • Loading branch information
cm13-github committed Jan 20, 2025
2 parents 2266db9 + e85c527 commit 3a11de5
Show file tree
Hide file tree
Showing 5 changed files with 144 additions and 15 deletions.
3 changes: 3 additions & 0 deletions code/game/verbs/ooc.dm
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,9 @@
prefix += "[icon2html('icons/ooc.dmi', GLOB.clients, "Donator")]"
if(isCouncil(src))
prefix += "[icon2html('icons/ooc.dmi', GLOB.clients, "WhitelistCouncil")]"
var/comm_award = find_community_award_icons()
if(comm_award)
prefix += comm_award
if(admin_holder)
var/list/rank_icons = icon_states('icons/ooc.dmi')
var/rankname = admin_holder.rank
Expand Down
39 changes: 39 additions & 0 deletions code/modules/client/client_procs.dm
Original file line number Diff line number Diff line change
Expand Up @@ -938,3 +938,42 @@ GLOBAL_LIST_INIT(whitelisted_client_procs, list(
winset(src, "mapwindow.map", "right-click=false")
winset(src, "default.Shift", "is-disabled=true")
winset(src, "default.ShiftUp", "is-disabled=true")

GLOBAL_LIST_INIT(community_awards, get_community_awards())

/proc/get_community_awards()
var/list/awards_file = file2list("config/community_awards.txt")
var/list/processed_awards = list()
for(var/awardee in awards_file)
if(!length(awardee))
return FALSE
if(copytext(awardee,1,2) == "#")
continue

//Split the line at every "-"
var/list/split_awardee = splittext(awardee, "-")
if(!length(split_awardee))
return FALSE

//ckey is before the first "-"
var/ckey = ckey(split_awardee[1])
if(!ckey)
continue
processed_awards[ckey] = list()

//given_awards follows the first "-"
var/list/given_awards = list()
if(!(length(split_awardee) >= 2))
continue
given_awards = split_awardee.Copy(2)
for(var/the_award in given_awards)
processed_awards[ckey] += ckeyEx(the_award)

return processed_awards

/client/proc/find_community_award_icons()
if(GLOB.community_awards[ckey])
var/full_prefix = ""
for(var/award in GLOB.community_awards[ckey])
full_prefix += "[icon2html('icons/ooc.dmi', GLOB.clients, award)]"
return full_prefix
18 changes: 16 additions & 2 deletions code/modules/mob/holder.dm
Original file line number Diff line number Diff line change
Expand Up @@ -152,9 +152,9 @@
name = "rat"
desc = "It's a big rat."
icon = 'icons/mob/animal.dmi'
icon_state = "rat_white"
icon_state = "rat_gray"
w_class = SIZE_TINY
flags_equip_slot = null
flags_equip_slot = SLOT_EAR

/obj/item/holder/rat/white
icon_state = "rat_white"
Expand All @@ -176,3 +176,17 @@
/obj/item/holder/rat/brown/Old_Timmy
name = "Old Timmy"
desc = "An ancient looking rat from the old days of the colony."

/obj/item/holder/rat/pet
name = "Pet Rat"
desc = "This is someone's pet rat. I wonder what it's doing here."

/obj/item/holder/rat/pet/marvin
name = "Marvin"
desc = "A sleek well kept rat with a tiny collar around it's neck, it must belong to someone. For a rodent it appears remarkably clean and hygenic."
icon_state = "rat_black"

/obj/item/holder/rat/pet/ikit
name = "Ikit"
desc = "An albino rat with a tiny collar around it's neck, it must belong to someone. Hope it doesn't have some sort of genetically engineered disease or something..."
icon_state = "rat_white"
99 changes: 86 additions & 13 deletions code/modules/mob/living/simple_animal/friendly/rat.dm
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,6 @@
* Rat types
*/

/mob/living/simple_animal/mouse/rat/white
body_color = "white"
icon_state = "rat_white"
desc = "It's a small laboratory rat."
holder_type = /obj/item/holder/rat/white

/mob/living/simple_animal/mouse/rat/gray
body_color = "gray"
icon_state = "rat_gray"
Expand All @@ -29,11 +23,26 @@
body_color = "brown"
icon_state = "rat_brown"
holder_type = /obj/item/holder/rat/brown

/mob/living/simple_animal/mouse/rat/brown/Old_Timmy
name = "Old Timmy"
desc = "An ancient looking rat from the old days of the colony."
response_help = "pets"
response_disarm = "gently pushes aside"
response_harm = "splats"
holder_type = /obj/item/holder/rat/brown/Old_Timmy

/mob/living/simple_animal/mouse/rat/black
body_color = "black"
icon_state = "rat_black"
holder_type = /obj/item/holder/rat/black

/mob/living/simple_animal/mouse/rat/white
body_color = "white"
icon_state = "rat_white"
desc = "It's a small laboratory rat."
holder_type = /obj/item/holder/rat/white

/mob/living/simple_animal/mouse/rat/white/Milky
name = "Milky"
desc = "An escaped test rat from the Weyland-Yutani Research Facility. Hope it doesn't have some sort of genetically engineered disease or something..."
Expand All @@ -43,10 +52,74 @@
response_harm = "stamps on"
holder_type = /obj/item/holder/rat/white/Milky

/mob/living/simple_animal/mouse/rat/brown/Old_Timmy
name = "Old Timmy"
desc = "An ancient looking rat from the old days of the colony."
response_help = "pets"
response_disarm = "gently pushes aside"
response_harm = "splats"
holder_type = /obj/item/holder/rat/brown/Old_Timmy

//Specific Pets for Frozen's Rat Collecting Competition

/mob/living/simple_animal/mouse/rat/pet
name = "Pet Rat"
desc = "This is someone's pet rat. I wonder what it's doing here."
holder_type = /obj/item/holder/rat/pet

/mob/living/simple_animal/mouse/rat/pet/marvin
name = "Marvin"
desc = "A sleek well kept rat with a tiny collar around its neck, it must belong to someone. For a rodent it appears remarkably clean and hygenic."
body_color = "black"
icon_state = "rat_black"
holder_type = /obj/item/holder/rat/pet/marvin

/mob/living/simple_animal/mouse/rat/pet/ikit
name = "Ikit"
desc = "An albino rat with a tiny collar around its neck, it must belong to someone. Hope it doesn't have some sort of genetically engineered disease or something..."
body_color = "white"
icon_state = "rat_white"
holder_type = /obj/item/holder/rat/pet/ikit


//Spawning those rats from cheese.

/obj/item/reagent_container/food/snacks/cheesewedge/attack_self(mob/user)
if(!user.client || user.client.spawned_pet)
return ..()
if(GLOB.community_awards[user.ckey])
for(var/award in GLOB.community_awards[user.ckey])
if(award == "RatKing")
return spawn_pet_rat(user)
..()

/client
/// Whether or not the client has spawned a unique pet.
var/spawned_pet = FALSE

/obj/item/reagent_container/food/snacks/cheesewedge/proc/spawn_pet_rat(mob/user)
if(!user.client || user.client.spawned_pet)
return FALSE
if(tgui_alert(user, "Do you want to spawn your pet rat?", "Spawn Pet", list("Yes", "No")) != "Yes")
return FALSE

var/list/pet_rats = file2list("config/pet_rats.txt")
var/rat_path
for(var/rat_owner in pet_rats)
if(!length(rat_owner))
return FALSE
if(copytext(rat_owner,1,2) == "#")
continue

//Split the line at every "-"
var/list/split_rat_owner = splittext(rat_owner, " - ")
if(!length(split_rat_owner))
return FALSE

//ckey is before the first "-"
var/ckey = ckey(split_rat_owner[1])
if(!ckey || (ckey != user.ckey))
continue

if(length(split_rat_owner) >= 2)
rat_path = split_rat_owner[2]
break

if(!rat_path)
return FALSE

new rat_path(user.loc)
user.client.spawned_pet = TRUE
Binary file modified icons/mob/humans/onmob/clothing/critters_shoulder.dmi
Binary file not shown.

0 comments on commit 3a11de5

Please sign in to comment.