Files
CHOMPStation2/code/modules/mob/mob_cleanup.dm
Cael_Aislinn bdeb96b7e5 Merge branch 'incremental_tg' r5514 (11/1/2013) into bs12_with_tgport
Conflicts:
	baystation12.dme
	code/ATMOSPHERICS/components/unary/vent_pump.dm
	code/ATMOSPHERICS/components/unary/vent_scrubber.dm
	code/__HELPERS/game.dm
	code/controllers/shuttle_controller.dm
	code/datums/datumvars.dm
	code/datums/supplypacks.dm
	code/defines/obj/storage.dm
	code/defines/obj/vending.dm
	code/defines/obj/weapon.dm
	code/defines/procs/command_alert.dm
	code/game/area/Space Station 13 areas.dm
	code/game/atoms.dm
	code/game/gamemodes/changeling/modularchangling.dm
	code/game/gamemodes/cult/runes.dm
	code/game/gamemodes/events.dm
	code/game/gamemodes/events/dust.dm
	code/game/gamemodes/events/miniblob.dm
	code/game/gamemodes/events/ninja_equipment.dm
	code/game/gamemodes/factions.dm
	code/game/gamemodes/game_mode.dm
	code/game/gamemodes/gameticker.dm
	code/game/jobs/access.dm
	code/game/jobs/job/assistant.dm
	code/game/jobs/job/captain.dm
	code/game/jobs/job/civilian.dm
	code/game/jobs/job/engineering.dm
	code/game/jobs/job/medical.dm
	code/game/jobs/job/science.dm
	code/game/jobs/job/security.dm
	code/game/jobs/job_controller.dm
	code/game/machinery/alarm.dm
	code/game/machinery/atmo_control.dm
	code/game/machinery/atmoalter/area_atmos_computer.dm
	code/game/machinery/bots/medbot.dm
	code/game/machinery/computer/HolodeckControl.dm
	code/game/machinery/computer/ai_core.dm
	code/game/machinery/computer/atmos_alert.dm
	code/game/machinery/computer/card.dm
	code/game/machinery/computer/cloning.dm
	code/game/machinery/computer/computer.dm
	code/game/machinery/computer/message.dm
	code/game/machinery/computer/pod.dm
	code/game/machinery/computer/prisoner.dm
	code/game/machinery/computer/syndicate_shuttle.dm
	code/game/machinery/constructable_frame.dm
	code/game/machinery/doors/door.dm
	code/game/machinery/doors/firedoor.dm
	code/game/machinery/newscaster.dm
	code/game/machinery/recharger.dm
	code/game/machinery/spaceheater.dm
	code/game/machinery/telecomms/broadcaster.dm
	code/game/machinery/telecomms/logbrowser.dm
	code/game/machinery/telecomms/machine_interactions.dm
	code/game/machinery/teleporter.dm
	code/game/machinery/wishgranter.dm
	code/game/mecha/mech_fabricator.dm
	code/game/mecha/working/ripley.dm
	code/game/objects/items.dm
	code/game/objects/items/blueprints.dm
	code/game/objects/items/devices/flashlight.dm
	code/game/objects/items/devices/radio/encryptionkey.dm
	code/game/objects/items/devices/uplinks.dm
	code/game/objects/items/stacks/medical.dm
	code/game/objects/items/weapons/cards_ids.dm
	code/game/objects/items/weapons/gift_wrappaper.dm
	code/game/objects/items/weapons/hydroponics.dm
	code/game/objects/items/weapons/manuals.dm
	code/game/objects/items/weapons/secstorage/secstorage.dm
	code/game/objects/items/weapons/storage/backpack.dm
	code/game/objects/items/weapons/storage/firstaid.dm
	code/game/objects/items/weapons/storage/kit.dm
	code/game/objects/items/weapons/storage/storage.dm
	code/game/objects/items/weapons/storage/toolbox.dm
	code/game/objects/items/weapons/storage/uplink_kits.dm
	code/game/objects/items/weapons/stunbaton.dm
	code/game/objects/items/weapons/surgery_tools.dm
	code/game/objects/items/weapons/tools.dm
	code/game/objects/structures/crates_lockers/closets/secure/cargo.dm
	code/game/objects/structures/crates_lockers/closets/secure/hydroponics.dm
	code/game/objects/structures/crates_lockers/closets/secure/scientist.dm
	code/game/objects/structures/crates_lockers/closets/secure/security.dm
	code/game/objects/structures/electricchair.dm
	code/game/objects/structures/extinguisher.dm
	code/game/objects/structures/watercloset.dm
	code/game/objects/weapons.dm
	code/game/turfs/turf.dm
	code/game/vehicles/airtight/airtight.dm
	code/game/vehicles/vehicle.dm
	code/global.dm
	code/modules/DetectiveWork/evidence.dm
	code/modules/admin/IsBanned.dm
	code/modules/admin/player_panel.dm
	code/modules/admin/verbs/diagnostics.dm
	code/modules/admin/verbs/getlogs.dm
	code/modules/client/preferences.dm
	code/modules/clothing/masks/miscellaneous.dm
	code/modules/clothing/spacesuits/rig.dm
	code/modules/clothing/suits/miscellaneous.dm
	code/modules/critters/critter_defenses.dm
	code/modules/detectivework/scanner.dm
	code/modules/flufftext/Hallucination.dm
	code/modules/food/recipes_microwave.dm
	code/modules/mining/mine_items.dm
	code/modules/mining/mine_turfs.dm
	code/modules/mining/satchel_ore_boxdm.dm
	code/modules/mob/dead/observer/observer.dm
	code/modules/mob/living/carbon/alien/humanoid/alien_powers.dm
	code/modules/mob/living/carbon/alien/special/facehugger.dm
	code/modules/mob/living/carbon/carbon.dm
	code/modules/mob/living/carbon/carbon_defines.dm
	code/modules/mob/living/carbon/human/human.dm
	code/modules/mob/living/carbon/human/human_attackhand.dm
	code/modules/mob/living/carbon/human/life.dm
	code/modules/mob/living/carbon/human/say.dm
	code/modules/mob/living/carbon/human/update_icons.dm
	code/modules/mob/living/carbon/metroid/metroid.dm
	code/modules/mob/living/living.dm
	code/modules/mob/living/silicon/ai/life.dm
	code/modules/mob/living/silicon/robot/robot.dm
	code/modules/mob/mob_cleanup.dm
	code/modules/mob/mob_defines.dm
	code/modules/mob/mob_transformation_simple.dm
	code/modules/paperwork/clipboard.dm
	code/modules/paperwork/folders.dm
	code/modules/paperwork/paper.dm
	code/modules/paperwork/paperbin.dm
	code/modules/paperwork/pen.dm
	code/modules/power/cable.dm
	code/modules/projectiles/guns/energy/special.dm
	code/modules/projectiles/guns/projectile/revolver.dm
	code/modules/projectiles/projectile/change.dm
	code/modules/projectiles/projectile/special.dm
	code/modules/reagents/Chemistry-Reagents.dm
	code/modules/reagents/reagent_containers/glass.dm
	code/modules/reagents/reagent_containers/hypospray.dm
	code/modules/recycling/sortingmachinery.dm
	code/modules/research/designs.dm
	config/config.txt
	html/changelog.html
	icons/mob/head.dmi
	icons/mob/hud.dmi
	icons/mob/items_lefthand.dmi
	icons/mob/items_righthand.dmi
	icons/mob/mask.dmi
	icons/mob/suit.dmi
	icons/mob/ties.dmi
	icons/mob/uniform.dmi
	icons/obj/clothing/hats.dmi
	icons/obj/clothing/masks.dmi
	icons/obj/clothing/suits.dmi
	icons/obj/clothing/ties.dmi
	icons/obj/grenade.dmi
	icons/obj/projectiles.dmi

Signed-off-by: Cael_Aislinn <cael_aislinn@yahoo.com.au>
2013-01-11 22:12:31 +10:00

208 lines
5.5 KiB
Plaintext

//Methods that need to be cleaned.
/* INFORMATION
Put (mob/proc)s here that are in dire need of a code cleanup.
*/
/mob/proc/has_disease(var/datum/disease/virus)
for(var/datum/disease/D in viruses)
if(D.IsSame(virus))
//error("[D.name]/[D.type] is the same as [virus.name]/[virus.type]")
return 1
return 0
// This proc has some procs that should be extracted from it. I believe we can develop some helper procs from it - Rockdtben
/mob/proc/contract_disease(var/datum/disease/virus, var/skip_this = 0, var/force_species_check=1, var/spread_type = -5)
//world << "Contract_disease called by [src] with virus [virus]"
if(stat >=2)
//world << "He's dead jim."
return
if(istype(virus, /datum/disease/advance))
//world << "It's an advance virus."
var/datum/disease/advance/A = virus
if(A.GetDiseaseID() in resistances)
//world << "It resisted us!"
return
if(count_by_type(viruses, /datum/disease/advance) >= 3)
return
else
if(src.resistances.Find(virus.type))
//world << "Normal virus and resisted"
return
if(has_disease(virus))
return
if(force_species_check)
var/fail = 1
for(var/name in virus.affected_species)
var/mob_type = text2path("/mob/living/carbon/[lowertext(name)]")
if(mob_type && istype(src, mob_type))
fail = 0
break
if(fail) return
if(skip_this == 1)
//world << "infectin"
//if(src.virus) < -- this used to replace the current disease. Not anymore!
//src.virus.cure(0)
var/datum/disease/v = new virus.type(1, virus, 0)
src.viruses += v
v.affected_mob = src
v.strain_data = v.strain_data.Copy()
v.holder = src
if(v.can_carry && prob(5))
v.carrier = 1
return
//world << "Not skipping."
//if(src.virus) //
//return //
/*
var/list/clothing_areas = list()
var/list/covers = list(UPPER_TORSO,LOWER_TORSO,LEGS,FEET,ARMS,HANDS)
for(var/Covers in covers)
clothing_areas[Covers] = list()
for(var/obj/item/clothing/Clothing in src)
if(Clothing)
for(var/Covers in covers)
if(Clothing&Covers)
clothing_areas[Covers] += Clothing
*/
if(prob(15/virus.permeability_mod)) return //the power of immunity compels this disease! but then you forgot resistances
//world << "past prob()"
var/obj/item/clothing/Cl = null
var/passed = 1
//chances to target this zone
var/head_ch
var/body_ch
var/hands_ch
var/feet_ch
if(spread_type == -5)
spread_type = virus.spread_type
switch(spread_type)
if(CONTACT_HANDS)
head_ch = 0
body_ch = 0
hands_ch = 100
feet_ch = 0
if(CONTACT_FEET)
head_ch = 0
body_ch = 0
hands_ch = 0
feet_ch = 100
else
head_ch = 100
body_ch = 100
hands_ch = 25
feet_ch = 25
var/target_zone = pick(head_ch;1,body_ch;2,hands_ch;3,feet_ch;4)//1 - head, 2 - body, 3 - hands, 4- feet
if(istype(src, /mob/living/carbon/human))
var/mob/living/carbon/human/H = src
switch(target_zone)
if(1)
if(isobj(H.head) && !istype(H.head, /obj/item/weapon/paper))
Cl = H.head
passed = prob((Cl.permeability_coefficient*100) - 1)
if(passed && isobj(H.wear_mask))
Cl = H.wear_mask
passed = prob((Cl.permeability_coefficient*100) - 1)
if(2)//arms and legs included
if(isobj(H.wear_suit))
Cl = H.wear_suit
passed = prob((Cl.permeability_coefficient*100) - 1)
if(passed && isobj(slot_w_uniform))
Cl = slot_w_uniform
passed = prob((Cl.permeability_coefficient*100) - 1)
if(3)
if(isobj(H.wear_suit) && H.wear_suit.body_parts_covered&HANDS)
Cl = H.wear_suit
passed = prob((Cl.permeability_coefficient*100) - 1)
if(passed && isobj(H.gloves))
Cl = H.gloves
passed = prob((Cl.permeability_coefficient*100) - 1)
if(4)
if(isobj(H.wear_suit) && H.wear_suit.body_parts_covered&FEET)
Cl = H.wear_suit
passed = prob((Cl.permeability_coefficient*100) - 1)
if(passed && isobj(H.shoes))
Cl = H.shoes
passed = prob((Cl.permeability_coefficient*100) - 1)
else
src << "Something strange's going on, something's wrong."
/*if("feet")
if(H.shoes && istype(H.shoes, /obj/item/clothing/))
Cl = H.shoes
passed = prob(Cl.permeability_coefficient*100)
//
world << "Shoes pass [passed]"
*/ //
else if(istype(src, /mob/living/carbon/monkey))
var/mob/living/carbon/monkey/M = src
switch(target_zone)
if(1)
if(M.wear_mask && isobj(M.wear_mask))
Cl = M.wear_mask
passed = prob((Cl.permeability_coefficient*100) - 1)
//world << "Mask pass [passed]"
if(!passed && spread_type == AIRBORNE && !internals)
passed = (prob((50*virus.permeability_mod) - 1))
if(passed)
//world << "Infection in the mob [src]. YAY"
/*
var/score = 0
if(istype(src, /mob/living/carbon/human))
if(src:gloves) score += 5
if(istype(src:wear_suit, /obj/item/clothing/suit/space)) score += 10
if(istype(src:wear_suit, /obj/item/clothing/suit/bio_suit)) score += 10
if(istype(src:head, /obj/item/clothing/head/helmet/space)) score += 5
if(istype(src:head, /obj/item/clothing/head/bio_hood)) score += 5
if(wear_mask)
score += 5
if((istype(src:wear_mask, /obj/item/clothing/mask) || istype(src:wear_mask, /obj/item/clothing/mask/surgical)) && !internal)
score += 5
if(internal)
score += 5
if(score > 20)
return
else if(score == 20 && prob(95))
return
else if(score >= 15 && prob(75))
return
else if(score >= 10 && prob(55))
return
else if(score >= 5 && prob(35))
return
else if(prob(15))
return
else*/
var/datum/disease/v = new virus.type(1, virus, 0)
src.viruses += v
v.affected_mob = src
v.strain_data = v.strain_data.Copy()
v.holder = src
if(v.can_carry && prob(5))
v.carrier = 1
return
return