- Changed the contract_disease proc clothing checks with respect to permeability_coefficient.

- Spaceacillin no longer heals all viruses.
- Some diseases must be cured with two or more chemicals simultaneously.
- Tweaked magnitis disease (now affects cyborgs).
- Added wizarditis disease.
- Tweaked some item properties.
- Added leather gloves for the Botanists.
- Some suits cannot be placed into backpack.

git-svn-id: http://tgstation13.googlecode.com/svn/trunk@321 316c924e-a436-60f5-8080-3fe189b3f50e
This commit is contained in:
panurgomatic
2010-10-19 07:46:50 +00:00
parent 0540c60c49
commit 5360dc1ac5
20 changed files with 318 additions and 367 deletions

View File

@@ -3,6 +3,8 @@
var/stage = 1 //all diseases start at stage 1
var/max_stages = 0.0
var/cure = null
var/cure_id = null// reagent.id or list containing them
var/cure_chance = 8//chance for the cure to do its job
var/spread = null
var/list/affected_species = list()
var/mob/affected_mob = null
@@ -11,28 +13,47 @@
var/list/strain_data = list() //This is passed on to infectees
var/stage_prob = 5 // probability of advancing to next stage, default 5% per check
var/agent = "some microbes"//name of the disease agent
var/permeability_mod = 0//permeability modifier. Positive gives better chance, negative - worse.
/datum/disease/proc/stage_act()
if(carrier)
//world << "[affected_mob] is carrier"
return
var/cure_present = has_cure()
//world << "[cure_present]"
spread = (cure_present?"Remissive":initial(spread))
if(stage > max_stages)
stage = max_stages
if(prob(stage_prob) && stage != max_stages)
stage++
else if(prob(1) && stage != 1)
if(stage != 1 && (prob(1) || (cure_present && prob(cure_chance))))
stage--
else if(prob(1) && stage == 1 && affected_mob.virus.curable)
else if(stage == 1 && ((prob(1) && affected_mob.virus.curable) || (cure_present && prob(cure_chance))))
affected_mob.resistances += affected_mob.virus.type
affected_mob.virus = null
return
return
/datum/disease/proc/has_cure()
if(!cure_id) return 0
var/result = 1
if(istype(cure_id, /list))
for(var/C_id in cure_id)
if(!affected_mob.reagents.has_reagent(C_id))
result = 0
else if(!affected_mob.reagents.has_reagent(cure_id))
result = 0
return result
/mob/proc/contract_disease(var/datum/disease/virus, var/skip_this = 0)
var/index = src.resistances.Find(virus.type)
if(index)
if(src.resistances.Find(virus.type))
if(prob(99)) return
src.resistances[index] = null//the resistance is futile
src.resistances.Remove(virus.type)//the resistance is futile
//For alien egg and stuff
if(skip_this == 1)
@@ -41,11 +62,95 @@
if(prob(5))
src.virus.carrier = 1
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)) return
var/obj/item/clothing/Cl = null
var/passed = 1
var/target_zone = pick(1,2,50;3,50;4)//1 - head, 2 - body, 3 - hands, 4- feet
var/score
if(istype(src, /mob/living/carbon/human))
if(src:gloves)
score += 5
var/mob/living/carbon/human/H = src
switch(target_zone)
if(1)
if(H.head)
Cl = H.head
passed = prob(Cl.permeability_coefficient*100+virus.permeability_mod)
//world << "Head pass [passed]"
if(passed && H.wear_mask)
Cl = H.wear_mask
passed = prob(Cl.permeability_coefficient*100+virus.permeability_mod)
//world << "Mask pass [passed]"
if(2)//arms and legs included
if(H.wear_suit)
Cl = H.wear_suit
passed = prob(Cl.permeability_coefficient*100+virus.permeability_mod)
//world << "Suit pass [passed]"
if(passed && H.slot_w_uniform)
Cl = H.slot_w_uniform
passed = prob(Cl.permeability_coefficient*100+virus.permeability_mod)
//world << "Uniform pass [passed]"
if(3)
if(H.wear_suit && H.wear_suit.body_parts_covered&HANDS)
Cl = H.wear_suit
passed = prob(Cl.permeability_coefficient*100+virus.permeability_mod)
if(passed && H.gloves)
Cl = H.gloves
passed = prob(Cl.permeability_coefficient*100+virus.permeability_mod)
//world << "Gloves pass [passed]"
if(4)
if(H.wear_suit && H.wear_suit.body_parts_covered&FEET)
Cl = H.wear_suit
passed = prob(Cl.permeability_coefficient*100+virus.permeability_mod)
if(passed && H.shoes)
Cl = H.shoes
passed = prob(Cl.permeability_coefficient*100+virus.permeability_mod)
//world << "Shoes pass [passed]"
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)
Cl = M.wear_mask
passed = prob(Cl.permeability_coefficient*100+virus.permeability_mod)
//world << "Mask pass [passed]"
if(passed && virus.spread=="Airborne" && src.internals)
passed = prob(60)
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
@@ -60,19 +165,18 @@
return
else if(score == 20 && prob(95))
return
else if(score == 15 && prob(75))
else if(score >= 15 && prob(75))
return
else if(score == 10 && prob(55))
else if(score >= 10 && prob(55))
return
else if(score == 5 && prob(35))
else if(score >= 5 && prob(35))
return
else if(prob(15))
return
else
else*/
src.virus = virus
src.virus.affected_mob = src
if(prob(5))
src.virus.carrier = 1
return
return

View File

@@ -11,6 +11,8 @@
max_stages = 5
spread = "None"
cure = "Unknown"
cure_id = list("lexorin","toxin","gargleblaster")
cure_chance = 20
affected_species = list("Human", "Monkey")
/datum/disease/alien_embryo/stage_act()

View File

@@ -3,9 +3,11 @@
max_stages = 4
spread = "Airborne"
cure = "Spaceacillin & Alkysine"
cure_id = list("alkysine","spaceacillin")
agent = "Cryptococcus Cosmosis"
affected_species = list("Human")
curable = 0
cure_chance = 10
/datum/disease/brainrot/stage_act()
..()

View File

@@ -3,8 +3,10 @@
max_stages = 3
spread = "Airborne"
cure = "Rest"
cure = "spaceacillin"
agent = "XY-rhinovirus"
affected_species = list("Human", "Monkey")
permeability_mod = -10
/datum/disease/cold/stage_act()
..()

View File

@@ -2,7 +2,8 @@
name = "Space Retrovirus"
max_stages = 4
spread = "Airborne"
cure = "Spaceacillin"
cure = "Ryetalin"
cure = "ryetalyn"
curable = 0
agent = "S4E1 retrovirus"
affected_species = list("Human")

View File

@@ -2,7 +2,8 @@
name = "GBS"
max_stages = 5
spread = "Airborne"
cure = "Epilepsy Pills"
cure = "Synaptizine & Sulfur"
cure_id = list("synaptizine","sulfur")
agent = "Gravitokinetic Bipotential SADS-"
affected_species = list("Human")

View File

@@ -3,9 +3,11 @@
max_stages = 3
spread = "Airborne"
cure = "Spaceacillin"
cure_id = "spaceacillin"
agent = "H13N1 flu virion"
affected_species = list("Human")
curable = 0
permeability_mod = -5
/datum/disease/flu/stage_act()
..()

View File

@@ -2,10 +2,12 @@
name = "GBS"
max_stages = 5
spread = "Airborne"
cure = "Epilepsy Pills"
cure = "Synaptizine & Sulfur"
cure_id = list("synaptizine","sulfur")
agent = "Gravitokinetic Bipotential SADS+"
affected_species = list("Human")
curable = 0
permeability_mod = 1
/datum/disease/gbs/stage_act()
..()

View File

@@ -3,4 +3,5 @@
max_stages = 1
cure = "None"
spread = "Airborne"
affected_species = list("Monkey")
affected_species = list("Monkey")
curable = 0

View File

@@ -3,6 +3,7 @@
max_stages = 4
spread = "Airborne"
cure = "Iron"
cure_id = "iron"
agent = "Fukkos Miracos"
affected_species = list("Human")
curable = 0
@@ -17,6 +18,9 @@
for(var/obj/M in orange(2,affected_mob))
if(!M.anchored && (M.flags & CONDUCT))
step_towards(M,affected_mob)
for(var/mob/living/silicon/S in orange(2,affected_mob))
if(istype(S, /mob/living/silicon/ai)) continue
step_towards(S,affected_mob)
/*
if(M.x > affected_mob.x)
M.x--
@@ -39,6 +43,12 @@
var/iter = rand(1,2)
for(i=0,i<iter,i++)
step_towards(M,affected_mob)
for(var/mob/living/silicon/S in orange(4,affected_mob))
if(istype(S, /mob/living/silicon/ai)) continue
var/i
var/iter = rand(1,2)
for(i=0,i<iter,i++)
step_towards(S,affected_mob)
/*
if(M.x > affected_mob.x)
M.x-=rand(1,min(3,M.x-affected_mob.x))
@@ -61,6 +71,12 @@
var/iter = rand(1,3)
for(i=0,i<iter,i++)
step_towards(M,affected_mob)
for(var/mob/living/silicon/S in orange(6,affected_mob))
if(istype(S, /mob/living/silicon/ai)) continue
var/i
var/iter = rand(1,3)
for(i=0,i<iter,i++)
step_towards(S,affected_mob)
/*
if(M.x > affected_mob.x)
M.x-=rand(1,min(5,M.x-affected_mob.x))

View File

@@ -0,0 +1,112 @@
/datum/disease/wizarditis
name = "Wizarditis"
max_stages = 4
spread = "Airborne"
cure = "The Manly Dorf"
cure_id = "manlydorf"
agent = "Rincewindus Vulgaris"
affected_species = list("Human")
curable = 0
permeability_mod = -5
/*
BIRUZ BENNAR
SCYAR NILA - teleport
NEC CANTIO - dis techno
EI NATH - shocking grasp
AULIE OXIN FIERA - knock
TARCOL MINTI ZHERI - forcewall
STI KALY - blind
*/
/datum/disease/wizarditis/stage_act()
..()
switch(stage)
if(2)
if(prob(4))
affected_mob.say(pick("You shall not pass!", "Expeliarmus!", "By Merlins beard!", ""))
if(prob(2))
affected_mob << "\red You feel [pick("that you don't have enough mana.", "that the winds of magic are gone.", "an urge to summon familiar.")]"
if(3)
spawn_wizard_clothes(5)
if(prob(4))
affected_mob.say(pick("NEC CANTIO!","AULIE OXIN FIERA!", "STI KALY!", "TARCOL MINTI ZHERI!"))
if(prob(2))
affected_mob << "\red You feel [pick("the magic bubbling in your veins","that this location gives you a +1 to INT","an urge to summon familiar.")]."
if(4)
spawn_wizard_clothes(10)
if(prob(4))
affected_mob.say(pick("NEC CANTIO!","AULIE OXIN FIERA!","STI KALY!","EI NATH!"))
return
if(prob(2))
affected_mob << "\red You feel [pick("the tidal wave of raw power building inside","that this location gives you a +2 to INT and +1 to WIS","an urge to teleport")]."
if(prob(5))
var/list/theareas = new/list()
for(var/area/AR in world)
if(theareas.Find(AR)) continue
var/turf/picked = pick(get_area_turfs(AR.type))
if (picked.z == affected_mob.z)
theareas += AR
var/area/thearea = pick(theareas)
affected_mob.say("SCYAR NILA [uppertext(thearea.name)]")
var/datum/effects/system/harmless_smoke_spread/smoke = new /datum/effects/system/harmless_smoke_spread()
smoke.set_up(5, 0, affected_mob.loc)
smoke.attach(affected_mob)
smoke.start()
var/list/L = list()
for(var/turf/T in get_area_turfs(thearea.type))
if(T.z != affected_mob.z) continue
if(!T.density)
var/clear = 1
for(var/obj/O in T)
if(O.density)
clear = 0
break
if(clear)
L+=T
affected_mob.loc = pick(L)
smoke.start()
return
return
/datum/disease/wizarditis/proc/spawn_wizard_clothes(var/chance=5)
var/mob/living/carbon/human/H = affected_mob
if(prob(chance))
if(!istype(H.head, /obj/item/clothing/head/wizard))
if(H.head)
H.drop_from_slot(H.head)
H.head = new /obj/item/clothing/head/wizard(H)
H.head.layer = 20
return
if(prob(chance))
if(!istype(H.wear_suit, /obj/item/clothing/suit/wizrobe))
if(H.wear_suit)
H.drop_from_slot(H.wear_suit)
H.wear_suit = new /obj/item/clothing/suit/wizrobe(H)
H.wear_suit.layer = 20
return
if(prob(chance))
if(!istype(H.shoes, /obj/item/clothing/shoes/sandal))
if(H.shoes)
H.drop_from_slot(H.shoes)
H.shoes = new /obj/item/clothing/shoes/sandal(H)
H.shoes.layer = 20
return
if(prob(chance))
if(!istype(H.r_hand, /obj/item/weapon/staff))
if(H.r_hand)
H.drop_from_slot(H.r_hand)
H.r_hand = new /obj/item/weapon/staff(H)
H.r_hand.layer = 20
return
return