adds more loadout equipment, adds working ckey whitelist system, and more

This commit is contained in:
deathride58
2018-01-16 16:23:22 -05:00
parent b55a497ffc
commit b74518a24a
10 changed files with 159 additions and 20 deletions
+1
View File
@@ -416,6 +416,7 @@ SUBSYSTEM_DEF(job)
if(job.dresscodecompliant)// CIT CHANGE - dress code compliance
equip_loadout(N, H) // CIT CHANGE - allows players to spawn with loadout items
job.after_spawn(H, M)
equip_loadout(N, H, TRUE)//CIT CHANGE - makes players spawn with in-backpack loadout items properly. A little hacky but it works
handle_roundstart_items(H, M.ckey, H.mind.assigned_role, H.mind.special_role) //CIT CHANGE - makes donators spawn with their items. This can safely be commented out when all of the donator items are migrated to the loadout system
+14 -4
View File
@@ -571,14 +571,21 @@ GLOBAL_LIST_EMPTY(preferences_datums)
dat += "<td><font size=2><b>Description</b></font></td></tr>"
for(var/j in GLOB.loadout_items[gear_tab])
var/datum/gear/gear = GLOB.loadout_items[gear_tab][j]
var/donoritem
if(gear.ckeywhitelist && gear.ckeywhitelist.len)
donoritem = TRUE
if(!(user.ckey in gear.ckeywhitelist))
continue
var/class_link = ""
if(gear.type in chosen_gear)
class_link = "class='linkOn' href='?_src_=prefs;preference=gear;toggle_gear_path=[j];toggle_gear=0'"
class_link = "style='white-space:normal;' class='linkOn' href='?_src_=prefs;preference=gear;toggle_gear_path=[j];toggle_gear=0'"
else if(gear_points <= 0)
class_link = "class='linkOff'"
class_link = "style='white-space:normal;' class='linkOff'"
else if(donoritem)
class_link = "style='white-space:normal;background:#ebc42e;' href='?_src_=prefs;preference=gear;toggle_gear_path=[j];toggle_gear=1'"
else
class_link = "href='?_src_=prefs;preference=gear;toggle_gear_path=[j];toggle_gear=1'"
dat += "<tr style='vertical-align:top;'><td width=15%><a style='white-space:normal;' [class_link]>[j]</a></td>"
class_link = "style='white-space:normal;' href='?_src_=prefs;preference=gear;toggle_gear_path=[j];toggle_gear=1'"
dat += "<tr style='vertical-align:top;'><td width=15%><a [class_link]>[j]</a></td>"
dat += "<td width = 5% style='vertical-align:top'>[gear.cost]</td><td>"
if(islist(gear.restricted_roles))
if(gear.restricted_roles.len)
@@ -1690,6 +1697,9 @@ GLOBAL_LIST_EMPTY(preferences_datums)
if(!is_loadout_slot_available(G.category))
to_chat(user, "<span class='danger'>You cannot take this loadout, as you've already chosen too many of the same category!</span>")
return
if(G.ckeywhitelist && G.ckeywhitelist.len && !(user.ckey in G.ckeywhitelist))
to_chat(user, "<span class='danger'>This is an item intended for donator use only. You are not authorized to use this item.</span>")
return
if(gear_points >= initial(G.cost))
LAZYADD(chosen_gear, G.type)
gear_points -= initial(G.cost)
@@ -1,4 +1,4 @@
/datum/controller/subsystem/job/proc/equip_loadout(mob/dead/new_player/N, mob/living/M)
/datum/controller/subsystem/job/proc/equip_loadout(mob/dead/new_player/N, mob/living/M, equipbackpackstuff)
var/mob/the_mob = N
if(!the_mob)
the_mob = M // cause this doesn't get assigned if player is a latejoiner
@@ -13,7 +13,11 @@
var/permitted = TRUE
if(G.restricted_roles && G.restricted_roles.len && !(M.job in G.restricted_roles))
permitted = FALSE
if(G.ckeywhitelist && !(M.ckey in G.ckeywhitelist))
if(G.ckeywhitelist && G.ckeywhitelist.len && !(the_mob.client.ckey in G.ckeywhitelist))
permitted = FALSE
if(!equipbackpackstuff && G.category == slot_in_backpack)//snowflake check since plopping stuff in the backpack doesnt work for pre-job equip loadout stuffs
permitted = FALSE
if(equipbackpackstuff && G.category != slot_in_backpack)//snowflake check since plopping stuff in the backpack doesnt work for pre-job equip loadout stuffs
permitted = FALSE
if(!permitted)
continue
@@ -0,0 +1,24 @@
/datum/gear/plushcarp
name = "Space carp plushie"
category = slot_in_backpack
path = /obj/item/toy/plush/carpplushie
/datum/gear/plushliz
name = "Lizard plushie"
category = slot_in_backpack
path = /obj/item/toy/plush/lizardplushie
/datum/gear/plushsnek
name = "Snake plushie"
category = slot_in_backpack
path = /obj/item/toy/plush/snakeplushie
/datum/gear/plushslime
name = "Slime plushie"
category = slot_in_backpack
path = /obj/item/toy/plush/slimeplushie
/datum/gear/dildo
name = "Customizable dildo"
category = slot_in_backpack
path = /obj/item/dildo/custom
@@ -0,0 +1,13 @@
//This is the file that handles donator loadout items.
/datum/gear/aaapingcoderfailsafe
name = "IF YOU SEE THIS, PING A CODER RIGHT NOW!"
category = slot_in_backpack
path = /obj/item/bikehorn/golden
ckeywhitelist = list("This entry should never appear with this variable set. If it does, then that means somebody fucked up the whitelist system hardcore")
/datum/gear/donortestingbikehorn
name = "Only coders should see this"
category = slot_in_backpack
path = /obj/item/bikehorn
ckeywhitelist = list("deathride58")
@@ -13,11 +13,6 @@
category = slot_hands
path = /obj/item/storage/pill_bottle/dice
/datum/gear/flyswatter
name = "Flyswatter"
category = slot_hands
path = /obj/item/melee/flyswatter
/datum/gear/eightball
name = "Magic eightball"
category = slot_hands
@@ -0,0 +1,59 @@
/datum/gear/poncho
name = "Poncho"
category = slot_wear_suit
path = /obj/item/clothing/suit/poncho
/datum/gear/ponchogreen
name = "Green poncho"
category = slot_wear_suit
path = /obj/item/clothing/suit/poncho/green
/datum/gear/ponchored
name = "Red poncho"
category = slot_wear_suit
path = /obj/item/clothing/suit/poncho/red
/datum/gear/jacketbomber
name = "Bomber jacket"
category = slot_wear_suit
path = /obj/item/clothing/suit/jacket
/datum/gear/jacketleather
name = "Leather jacket"
category = slot_wear_suit
path = /obj/item/clothing/suit/jacket/leather
/datum/gear/overcoatleather
name = "Leather overcoat"
category = slot_wear_suit
path = /obj/item/clothing/suit/jacket/leather/overcoat
/datum/gear/jacketpuffer
name = "Puffer jacket"
category = slot_wear_suit
path = /obj/item/clothing/suit/jacket/puffer
/datum/gear/vestpuffer
name = "Puffer vest"
category = slot_wear_suit
path = /obj/item/clothing/suit/jacket/puffer/vest
/datum/gear/jacketlettermanbrown
name = "Brown letterman jacket"
category = slot_wear_suit
path = /obj/item/clothing/suit/jacket/letterman
/datum/gear/jacketlettermanred
name = "Red letterman jacket"
category = slot_wear_suit
path = /obj/item/clothing/suit/jacket/letterman_red
/datum/gear/jacketlettermanNT
name = "Nanotrasen letterman jacket"
category = slot_wear_suit
path = /obj/item/clothing/suit/jacket/letterman_nanotrasen
/datum/gear/coat
name = "Winter coat"
category = slot_wear_suit
path = /obj/item/clothing/suit/hooded/wintercoat
@@ -1,39 +1,39 @@
/datum/gear/suit
/datum/gear/suitblack
name = "Black suit"
category = slot_w_uniform
path = /obj/item/clothing/under/suit_jacket
/datum/gear/greensuit
/datum/gear/suitgreen
name = "Green suit"
category = slot_w_uniform
path = /obj/item/clothing/under/suit_jacket/green
/datum/gear/redsuit
/datum/gear/suitred
name = "Red suit"
category = slot_w_uniform
path = /obj/item/clothing/under/suit_jacket/red
/datum/gear/charcoalsuit
/datum/gear/suitcharcoal
name = "Charcoal suit"
category = slot_w_uniform
path = /obj/item/clothing/under/suit_jacket/charcoal
/datum/gear/navysuit
/datum/gear/suitnavy
name = "Navy suit"
category = slot_w_uniform
path = /obj/item/clothing/under/suit_jacket/navy
/datum/gear/burgundysuit
/datum/gear/suitburgundy
name = "Burgundy suit"
category = slot_w_uniform
path = /obj/item/clothing/under/suit_jacket/burgundy
/datum/gear/tansuit
/datum/gear/suittan
name = "Tan suit"
category = slot_w_uniform
path = /obj/item/clothing/under/suit_jacket/tan
/datum/gear/whitesuit
/datum/gear/suitwhite
name = "White suit"
category = slot_w_uniform
path = /obj/item/clothing/under/suit_jacket/white
@@ -47,3 +47,33 @@
name = "Maid costume"
category = slot_w_uniform
path = /obj/item/clothing/under/maid
/datum/gear/mailmanuniform
name = "Mailman's jumpsuit"
category = slot_w_uniform
path = /obj/item/clothing/under/rank/mailman
/datum/gear/skirtblack
name = "Black skirt"
category = slot_w_uniform
path = /obj/item/clothing/under/skirt/black
/datum/gear/skirtblue
name = "Blue skirt"
category = slot_w_uniform
path = /obj/item/clothing/under/skirt/blue
/datum/gear/skirtred
name = "Red skirt"
category = slot_w_uniform
path = /obj/item/clothing/under/skirt/red
/datum/gear/skirtpurple
name = "Purple skirt"
category = slot_w_uniform
path = /obj/item/clothing/under/skirt/purple
/datum/gear/kilt
name = "Kilt"
category = slot_w_uniform
path = /obj/item/clothing/under/kilt
@@ -3,7 +3,7 @@
#define BACKPACK_SLOT_AMT 3
/datum/preferences
var/gear_points = 5
var/gear_points = 10
var/list/gear_categories
var/list/chosen_gear
var/gear_tab
+3
View File
@@ -2499,6 +2499,8 @@
#include "modular_citadel\code\game\objects\items\melee\eutactic_blades.dm"
#include "modular_citadel\code\modules\client\preferences.dm"
#include "modular_citadel\code\modules\client\preferences_savefile.dm"
#include "modular_citadel\code\modules\client\loadout\backpack.dm"
#include "modular_citadel\code\modules\client\loadout\donator.dm"
#include "modular_citadel\code\modules\client\loadout\glasses.dm"
#include "modular_citadel\code\modules\client\loadout\hands.dm"
#include "modular_citadel\code\modules\client\loadout\head.dm"
@@ -2506,6 +2508,7 @@
#include "modular_citadel\code\modules\client\loadout\mask.dm"
#include "modular_citadel\code\modules\client\loadout\neck.dm"
#include "modular_citadel\code\modules\client\loadout\shoes.dm"
#include "modular_citadel\code\modules\client\loadout\suit.dm"
#include "modular_citadel\code\modules\client\loadout\uniform.dm"
#include "modular_citadel\code\modules\crafting\recipes.dm"
#include "modular_citadel\code\modules\mining\mine_items.dm"