Files
CHOMPStation2/code/game/algorithm.dm
n3ophyt3@gmail.com c4c2215906 A new item slot now exists for discerning suit-wearers!
Look for the new slot above where you shoes go, assuming you don't hide them.
  While wearing an outer suit (basically anything other than a jumpsuit), you can store an item here.
  Allowable item(s) for the slot varies depending on what you are wearing
  IF IT IS A SUIT I DIDN'T DEFINE ITEMS FOR BECAUSE IT WASN'T IN CLOTHING.DM: Emergency oxygentank
  Biosuit/plague doctor suit: Emergency oxygentank
  Detective suit: Detectives revolver, ammo for said revolver, cigs, zippo, forensics scanner, taperecorder
  Judge robes: Cigs, space cash (not that any of our space judges would dream of accepting a bribe)
  Lab coats: bruise packs, ointment, dna injectors, droppers, syringes, hyposprays, med analyzers
  Apron: Plant-b-gone, seeds, plant scanner, nutrients, minihoes
  Wizard robes: Teleport scrolls
  Armor (all varieties, which includes HoS coat): Energy weapons, batons, handcuffs
  Captain armor: as regular armor, also emergency oxygentank
  Firesuits: Emergency oxygentank, flashlight
  Spacesuits (all varieties, including RIG): Emergency oxygentank, flashlight

git-svn-id: http://tgstation13.googlecode.com/svn/trunk@557 316c924e-a436-60f5-8080-3fe189b3f50e
2010-12-07 01:46:06 +00:00

176 lines
3.9 KiB
Plaintext

/world/New()
..()
diary = file("data/logs/[time2text(world.realtime, "YYYY/MM-Month/DD-Day")].log")
diary << ""
diary << ""
diary << "Starting up. [time2text(world.timeofday, "hh:mm.ss")]"
diary << "---------------------"
diary << ""
jobban_loadbanfile()
jobban_updatelegacybans()
goon_loadfile()
beta_tester_loadfile()
LoadBans()
spawn(30)
//EXPERIMENTAL
Optimize()
sleep_offline = 1
//EXPERIMENTAL
spawn(0)
SetupOccupationsList()
return
/// EXPERIMENTAL STUFF
var/opt_inactive = null
/world/proc/Optimize()
if(!opt_inactive) opt_inactive = world.timeofday
if(world.timeofday - opt_inactive >= 600)
KickInactiveClients()
opt_inactive = world.timeofday
spawn(100) Optimize()
/world/proc/KickInactiveClients()
for(var/client/C)
if(!C.holder && ((C.inactivity/10)/60) >= 10) // Used to be 15 -- TLE
C << "\red You have been inactive for more than 10 minutes and have been disconnected."
/*
if(C.mob)
if(!istype(C.mob, /mob/dead/))
C << "\red Your character has also been killed to save on server resources."
C.mob.death(0) // Added to lighten the load they take on the server -- TLE
del(C)
*/
/// EXPERIMENTAL STUFF
// This function counts a passed job.
proc/countJob(rank)
var/jobCount = 0
for(var/mob/H in world)
if(H.mind && H.mind.assigned_role == rank)
jobCount++
return jobCount
/mob/living/carbon/human/var/const
slot_back = 1
slot_wear_mask = 2
slot_handcuffed = 3
slot_l_hand = 4
slot_r_hand = 5
slot_belt = 6
slot_wear_id = 7
slot_ears = 8
slot_glasses = 9
slot_gloves = 10
slot_head = 11
slot_shoes = 12
slot_wear_suit = 13
slot_w_uniform = 14
slot_l_store = 15
slot_r_store = 16
slot_s_store = 17
slot_in_backpack = 18
/mob/living/carbon/human/proc/equip_if_possible(obj/item/weapon/W, slot) // since byond doesn't seem to have pointers, this seems like the best way to do this :/
//warning: icky code
var/equipped = 0
if((slot == l_store || slot == r_store || slot == belt || slot == wear_id) && !src.w_uniform)
del(W)
return
if(slot == s_store && !src.wear_suit)
del(W)
return
switch(slot)
if(slot_back)
if(!src.back)
src.back = W
equipped = 1
if(slot_wear_mask)
if(!src.wear_mask)
src.wear_mask = W
equipped = 1
if(slot_handcuffed)
if(!src.handcuffed)
src.handcuffed = W
equipped = 1
if(slot_l_hand)
if(!src.l_hand)
src.l_hand = W
equipped = 1
if(slot_r_hand)
if(!src.r_hand)
src.r_hand = W
equipped = 1
if(slot_belt)
if(!src.belt)
src.belt = W
equipped = 1
if(slot_wear_id)
if(!src.wear_id)
src.wear_id = W
equipped = 1
if(slot_ears)
if(!src.ears)
src.ears = W
equipped = 1
if(slot_glasses)
if(!src.glasses)
src.glasses = W
equipped = 1
if(slot_gloves)
if(!src.gloves)
src.gloves = W
equipped = 1
if(slot_head)
if(!src.head)
src.head = W
equipped = 1
if(slot_shoes)
if(!src.shoes)
src.shoes = W
equipped = 1
if(slot_wear_suit)
if(!src.wear_suit)
src.wear_suit = W
equipped = 1
if(slot_w_uniform)
if(!src.w_uniform)
src.w_uniform = W
equipped = 1
if(slot_l_store)
if(!src.l_store)
src.l_store = W
equipped = 1
if(slot_r_store)
if(!src.r_store)
src.r_store = W
equipped = 1
if(slot_s_store)
if(!src.s_store)
src.s_store = W
equipped = 1
if(slot_in_backpack)
if (src.back && istype(src.back, /obj/item/weapon/storage/backpack))
var/obj/item/weapon/storage/backpack/B = src.back
if(B.contents.len < 7 && W.w_class <= 3)
W.loc = B
equipped = 1
if(equipped)
W.layer = 20
else
del(W)
/proc/AutoUpdateAI(obj/subject)
if (subject!=null)
for(var/mob/living/silicon/ai/M in world)
if ((M.client && M.machine == subject))
subject.attack_ai(M)