From 803bed1c18572573e6eaa0863edc3d87098a620c Mon Sep 17 00:00:00 2001 From: Miniature Date: Sat, 24 Dec 2011 03:34:25 +1030 Subject: [PATCH 1/2] Custom items for special people They have to be manually coded in atm, but someone will no doubt eventually make it use a database when we get that going again (if we don't already) --- baystation12.dme | 2 ++ code/game/gamemodes/gameticker.dm | 1 + code/modules/mob/new_player/new_player.dm | 1 + 3 files changed, 4 insertions(+) diff --git a/baystation12.dme b/baystation12.dme index 13f0147d9f7..18ec77a7490 100644 --- a/baystation12.dme +++ b/baystation12.dme @@ -139,6 +139,7 @@ #define FILE_DIR "code/unused/spacecraft" #define FILE_DIR "code/WorkInProgress" #define FILE_DIR "code/WorkInProgress/mapload" +#define FILE_DIR "code/WorkInProgress/Mini" #define FILE_DIR "code/WorkInProgress/organs" #define FILE_DIR "code/WorkInProgress/virus2" #define FILE_DIR "code/WorkInProgress/virus2/Disease2" @@ -975,6 +976,7 @@ #include "code\WorkInProgress\explosion_particles.dm" #include "code\WorkInProgress\mapload\dmm_suite.dm" #include "code\WorkInProgress\mapload\reader.dm" +#include "code\WorkInProgress\Mini\customitems.dm" #include "code\WorkInProgress\virus2\Prob.dm" #include "code\WorkInProgress\virus2\Disease2\analyser.dm" #include "code\WorkInProgress\virus2\Disease2\base.dm" diff --git a/code/game/gamemodes/gameticker.dm b/code/game/gamemodes/gameticker.dm index 7c7c30c880a..996e82385f7 100644 --- a/code/game/gamemodes/gameticker.dm +++ b/code/game/gamemodes/gameticker.dm @@ -150,6 +150,7 @@ var/global/datum/controller/gameticker/ticker captainless=0 if(player.mind.assigned_role != "MODE") job_master.EquipRank(player, player.mind.assigned_role, 0) + EquipCustomItems(player) if(captainless) world << "Captainship not forced on anyone." diff --git a/code/modules/mob/new_player/new_player.dm b/code/modules/mob/new_player/new_player.dm index 3add40623f9..057c76bb0f5 100644 --- a/code/modules/mob/new_player/new_player.dm +++ b/code/modules/mob/new_player/new_player.dm @@ -231,6 +231,7 @@ var/icon/char_icon = getFlatIcon(character,0)//We're creating out own cache so it's not needed. job_master.AssignRole(character, rank, 1) job_master.EquipRank(character, rank, 1) + EquipCustomItems(character) character.loc = pick(latejoin) AnnounceArrival(character, rank) From 319981a37d7e554d4d1fe35645d4e7d945f317e9 Mon Sep 17 00:00:00 2001 From: Miniature Date: Sat, 24 Dec 2011 03:35:58 +1030 Subject: [PATCH 2/2] Trust me to forget a file. --- code/WorkInProgress/Mini/customitems.dm | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 code/WorkInProgress/Mini/customitems.dm diff --git a/code/WorkInProgress/Mini/customitems.dm b/code/WorkInProgress/Mini/customitems.dm new file mode 100644 index 00000000000..2f55aa7acd3 --- /dev/null +++ b/code/WorkInProgress/Mini/customitems.dm @@ -0,0 +1,23 @@ +//switch this out to use a database at some point +//list of ckey/ real_name and item paths +//gives item to specific people when they join if it can +//for multiple items just add mutliple entries, unless i change it to be a listlistlist +//yes, it has to be an item, you can't pick up nonitems +var/list/CustomItemList = list( + // ckey real_name item path + // list("miniature","Dave Booze",/obj/item/toy/crayonbox) //screw this i dont want crayons, it's an example okay + ) + +/proc/EquipCustomItems(mob/living/carbon/human/M) + for(var/list/test in CustomItemList) + if(test[1] == M.ckey && test[2] == M.real_name) + var/path = test[3] + var/obj/item/item = new path() + if(istype(M.back,/obj/item/weapon/storage)) + item.loc = M.back + else + for(var/obj/item/weapon/storage/S in M.contents) + item.loc = S + return + message_admins("Attempted to give [M.real_name]([M.key]) a [item] but there was nowhere to put it!") + M << "You were meant to recieve a [item] but there was nowhere to put it. Sorry. :(" \ No newline at end of file