mirror of
https://github.com/vgstation-coders/vgstation13.git
synced 2025-12-10 02:16:05 +00:00
-Cyborg Hypospray will no longer lose it's reagents when switching modes.
-Spaceacillin will now prevent the spread of diseases while it is a mob. -Moved the "Create A Disease" code into a proc. git-svn-id: http://tgstation13.googlecode.com/svn/trunk@5101 316c924e-a436-60f5-8080-3fe189b3f50e
This commit is contained in:
@@ -304,4 +304,13 @@ proc/listclearnulls(list/list)
|
||||
if(bitfield & bit)
|
||||
r += bit
|
||||
|
||||
return r
|
||||
return r
|
||||
|
||||
// Returns the key based on the index
|
||||
/proc/get_key_by_index(var/list/L, var/index)
|
||||
var/i = 1
|
||||
for(var/key in L)
|
||||
if(index == i)
|
||||
return key
|
||||
i++
|
||||
return null
|
||||
@@ -115,6 +115,9 @@ var/list/diseases = typesof(/datum/disease) - /datum/disease
|
||||
else //no source and no mob affected. Rogue disease. Break
|
||||
return
|
||||
|
||||
if(affected_mob)
|
||||
if(affected_mob.reagents.has_reagent("spaceacillin"))
|
||||
return // Don't spread if we have spaceacillin in our system.
|
||||
|
||||
var/check_range = airborne_range//defaults to airborne - range 2
|
||||
|
||||
|
||||
@@ -387,4 +387,43 @@ var/list/archive_diseases = list()
|
||||
if(preserve.len)
|
||||
R.data["viruses"] = preserve
|
||||
|
||||
/proc/AdminCreateVirus(var/mob/user)
|
||||
var/i = 5
|
||||
|
||||
var/datum/disease/advance/D = new(0, null)
|
||||
D.symptoms = list()
|
||||
|
||||
var/list/symptoms = list()
|
||||
symptoms += "Done"
|
||||
symptoms += list_symptoms.Copy()
|
||||
do
|
||||
var/symptom = input(user, "Choose a symptom to add ([i] remaining)", "Choose a Symptom") in symptoms
|
||||
if(istext(symptom))
|
||||
i = 0
|
||||
else if(ispath(symptom))
|
||||
var/datum/symptom/S = new symptom
|
||||
if(!D.HasSymptom(S))
|
||||
D.symptoms += S
|
||||
i -= 1
|
||||
while(i > 0)
|
||||
|
||||
if(D.symptoms.len > 0)
|
||||
|
||||
var/new_name = input(user, "Name your new disease.", "New Name")
|
||||
D.AssignName(new_name)
|
||||
D.Refresh()
|
||||
|
||||
for(var/datum/disease/advance/AD in active_diseases)
|
||||
AD.Refresh()
|
||||
|
||||
for(var/mob/living/carbon/human/H in shuffle(living_mob_list))
|
||||
if(!H.has_disease(D))
|
||||
H.contract_disease(D, 1)
|
||||
break
|
||||
|
||||
var/list/name_symptoms = list()
|
||||
for(var/datum/symptom/S in D.symptoms)
|
||||
name_symptoms += S.name
|
||||
message_admins("[key_name_admin(user)] has triggered a custom virus outbreak of [D.name]! It has these symptoms: [english_list(name_symptoms)]", 1)
|
||||
|
||||
#undef RANDOM_STARTING_LEVEL
|
||||
@@ -2074,43 +2074,7 @@
|
||||
viral_outbreak(V)
|
||||
message_admins("[key_name_admin(usr)] has triggered a virus outbreak of [V]", 1)
|
||||
else
|
||||
var/i = 5
|
||||
|
||||
var/datum/disease/advance/D = new(0, null)
|
||||
D.symptoms = list()
|
||||
|
||||
var/list/symptoms = list()
|
||||
symptoms += "Done"
|
||||
symptoms += list_symptoms.Copy()
|
||||
do
|
||||
var/symptom = input("Choose a symptom to add ([i] remaining)", "Choose a Symptom") in symptoms
|
||||
if(istext(symptom))
|
||||
i = 0
|
||||
else if(ispath(symptom))
|
||||
var/datum/symptom/S = new symptom
|
||||
if(!D.HasSymptom(S))
|
||||
D.symptoms += S
|
||||
i -= 1
|
||||
while(i > 0)
|
||||
|
||||
if(D.symptoms.len > 0)
|
||||
|
||||
var/new_name = input("Name your new disease.", "New Name")
|
||||
D.AssignName(new_name)
|
||||
D.Refresh()
|
||||
|
||||
for(var/datum/disease/advance/AD in active_diseases)
|
||||
AD.Refresh()
|
||||
|
||||
for(var/mob/living/carbon/human/H in shuffle(living_mob_list))
|
||||
if(!H.has_disease(D))
|
||||
H.contract_disease(D, 1)
|
||||
break
|
||||
|
||||
var/list/name_symptoms = list()
|
||||
for(var/datum/symptom/S in D.symptoms)
|
||||
name_symptoms += S.name
|
||||
message_admins("[key_name_admin(usr)] has triggered a custom virus outbreak of [D.name]! It has these symptoms: [english_list(name_symptoms)]", 1)
|
||||
AdminCreateVirus(usr)
|
||||
if("retardify")
|
||||
feedback_inc("admin_secrets_fun_used",1)
|
||||
feedback_add_details("admin_secrets_fun_used","RET")
|
||||
|
||||
@@ -706,7 +706,7 @@ datum
|
||||
on_reaction(var/datum/reagents/holder, var/created_volume)
|
||||
holder.clear_reagents()
|
||||
|
||||
var/virus = pick(/datum/disease/flu, /datum/disease/cold, \
|
||||
var/virus = pick(/datum/disease/advance/flu, /datum/disease/advance/cold, \
|
||||
/datum/disease/pierrot_throat, /datum/disease/fake_gbs, \
|
||||
/datum/disease/brainrot, /datum/disease/magnitis)
|
||||
|
||||
|
||||
@@ -15,79 +15,94 @@
|
||||
var/charge_tick = 0
|
||||
var/recharge_time = 5 //Time it takes for shots to recharge (in seconds)
|
||||
|
||||
New()
|
||||
..()
|
||||
processing_objects.Add(src)
|
||||
var/list/datum/reagents/reagent_list = list()
|
||||
var/list/reagent_ids = list("doctorsdelight", "inaprovaline", "spaceacillin")
|
||||
//var/list/reagent_ids = list("dexalin", "kelotane", "bicaridine", "anti_toxin", "inaprovaline", "spaceacillin")
|
||||
|
||||
/obj/item/weapon/reagent_containers/borghypo/New()
|
||||
..()
|
||||
for(var/R in reagent_ids)
|
||||
add_reagent(R)
|
||||
|
||||
processing_objects.Add(src)
|
||||
|
||||
|
||||
Del()
|
||||
processing_objects.Remove(src)
|
||||
..()
|
||||
/obj/item/weapon/reagent_containers/borghypo/Del()
|
||||
processing_objects.Remove(src)
|
||||
..()
|
||||
|
||||
process() //Every [recharge_time] seconds, recharge some reagents for the cyborg
|
||||
charge_tick++
|
||||
if(charge_tick < recharge_time) return 0
|
||||
charge_tick = 0
|
||||
/obj/item/weapon/reagent_containers/borghypo/process() //Every [recharge_time] seconds, recharge some reagents for the cyborg
|
||||
charge_tick++
|
||||
if(charge_tick < recharge_time) return 0
|
||||
charge_tick = 0
|
||||
|
||||
if(isrobot(src.loc))
|
||||
var/mob/living/silicon/robot/R = src.loc
|
||||
if(R && R.cell)
|
||||
if(mode == 1 && reagents.total_volume < 30) //Don't recharge reagents and drain power if the storage is full.
|
||||
R.cell.use(charge_cost) //Take power from borg...
|
||||
reagents.add_reagent("doctorsdelight",5) //And fill hypo with reagent.
|
||||
if(mode == 2 && reagents.total_volume < 30)
|
||||
R.cell.use(charge_cost)
|
||||
reagents.add_reagent("inaprovaline", 5)
|
||||
if(mode == 3 && reagents.total_volume < 30)
|
||||
R.cell.use(charge_cost)
|
||||
reagents.add_reagent("spaceacillin", 5)
|
||||
//update_icon()
|
||||
return 1
|
||||
if(isrobot(src.loc))
|
||||
var/mob/living/silicon/robot/R = src.loc
|
||||
if(R && R.cell)
|
||||
var/datum/reagents/RG = reagent_list[mode]
|
||||
if(RG.total_volume < RG.maximum_volume) //Don't recharge reagents and drain power if the storage is full.
|
||||
R.cell.use(charge_cost) //Take power from borg...
|
||||
RG.add_reagent(reagent_ids[mode], 5) //And fill hypo with reagent.
|
||||
//update_icon()
|
||||
return 1
|
||||
|
||||
// Purely for testing purposes I swear~
|
||||
/*
|
||||
/obj/item/weapon/reagent_containers/borghypo/verb/add_cyanide()
|
||||
set src in world
|
||||
add_reagent("cyanide")
|
||||
*/
|
||||
|
||||
// Use this to add more chemicals for the borghypo to produce.
|
||||
/obj/item/weapon/reagent_containers/borghypo/proc/add_reagent(var/reagent)
|
||||
reagent_ids |= reagent
|
||||
var/datum/reagents/RG = new(30)
|
||||
RG.my_atom = src
|
||||
reagent_list += RG
|
||||
|
||||
var/datum/reagents/R = reagent_list[reagent_list.len]
|
||||
R.add_reagent(reagent, 30)
|
||||
|
||||
/obj/item/weapon/reagent_containers/borghypo/attack(mob/M as mob, mob/user as mob)
|
||||
if(!reagents.total_volume)
|
||||
var/datum/reagents/R = reagent_list[mode]
|
||||
if(!R.total_volume)
|
||||
user << "\red The injector is empty."
|
||||
return
|
||||
if (!( istype(M, /mob) ))
|
||||
return
|
||||
if (reagents.total_volume)
|
||||
if (R.total_volume)
|
||||
user << "\blue You inject [M] with the injector."
|
||||
M << "\red You feel a tiny prick!"
|
||||
|
||||
src.reagents.reaction(M, INGEST)
|
||||
R.reaction(M, INGEST)
|
||||
if(M.reagents)
|
||||
var/trans = reagents.trans_to(M, amount_per_transfer_from_this)
|
||||
user << "\blue [trans] units injected. [reagents.total_volume] units remaining."
|
||||
var/trans = R.trans_to(M, amount_per_transfer_from_this)
|
||||
user << "\blue [trans] units injected. [R.total_volume] units remaining."
|
||||
return
|
||||
|
||||
/obj/item/weapon/reagent_containers/borghypo/attack_self(mob/user as mob)
|
||||
playsound(src.loc, 'sound/effects/pop.ogg', 50, 0) //Change the mode
|
||||
if(mode == 1)
|
||||
mode = 2
|
||||
charge_tick = 0 //Prevents wasted chems/cell charge if you're cycling through modes.
|
||||
reagents.clear_reagents() //Flushes whatever was in the storage previously, so you don't get chems all mixed up.
|
||||
user << "\blue Synthesizer is now producing 'Inaprovaline'."
|
||||
return
|
||||
if(mode == 2)
|
||||
mode = 3
|
||||
charge_tick = 0
|
||||
reagents.clear_reagents()
|
||||
user << "\blue Synthesizer is now producing 'Spaceacillin'."
|
||||
return
|
||||
if(mode == 3)
|
||||
mode++
|
||||
if(mode > reagent_list.len)
|
||||
mode = 1
|
||||
charge_tick = 0
|
||||
reagents.clear_reagents()
|
||||
user << "\blue Synthesizer is now producing 'Doctor's Delight'."
|
||||
return
|
||||
|
||||
charge_tick = 0 //Prevents wasted chems/cell charge if you're cycling through modes.
|
||||
var/datum/reagent/R = chemical_reagents_list[reagent_ids[mode]]
|
||||
user << "\blue Synthesizer is now producing '[R.name]'."
|
||||
return
|
||||
|
||||
/obj/item/weapon/reagent_containers/borghypo/examine()
|
||||
set src in view()
|
||||
..()
|
||||
if (!(usr in view(2)) && usr!=src.loc) return
|
||||
|
||||
if(reagents && reagents.reagent_list.len)
|
||||
for(var/datum/reagent/R in reagents.reagent_list)
|
||||
var/empty = 1
|
||||
|
||||
for(var/datum/reagents/RS in reagent_list)
|
||||
var/datum/reagent/R = locate() in RS.reagent_list
|
||||
if(R)
|
||||
usr << "\blue It currently has [R.volume] units of [R.name] stored."
|
||||
else
|
||||
empty = 0
|
||||
|
||||
if(empty)
|
||||
usr << "\blue It is currently empty. Allow some time for the internal syntheszier to produce more."
|
||||
@@ -48,12 +48,18 @@ Stuff which is in development and not yet visible to players or just code relate
|
||||
should be listed in the changelog upon commit tho. Thanks. -->
|
||||
|
||||
<!-- To take advantage of the pretty new format (well it was new when I wrote this anyway), open the "add-to-changelog.html" file in any browser and add the stuff and then generate the html code and paste it here -->
|
||||
|
||||
<div class="commit sansserif">
|
||||
<h2 class="date">17 November 2012</h2>
|
||||
<h3 class="author">Donkie updated:</h3>
|
||||
<ul class="changes bgimages16">
|
||||
<li class="rscadd">You can now deconstruct and construct Air Alarms and Fire Alarms. Read wiki on howto.</li>
|
||||
</ul>
|
||||
<h3 class="author">Giacom updated:</h3>
|
||||
<ul class="changes bgimages16">
|
||||
<li class="rscadd">Medical Cyborgs no longer lose the reagents in their hypospray when switching modes.</li>
|
||||
<li class="rscadd">Spaceacillin will now help stop the spread of diseases.</li>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
<div class="commit sansserif">
|
||||
@@ -65,7 +71,6 @@ should be listed in the changelog upon commit tho. Thanks. -->
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
<div class="commit sansserif">
|
||||
<h2 class="date">15 November 2012</h2>
|
||||
<h3 class="author">Giacom updated:</h3>
|
||||
|
||||
Reference in New Issue
Block a user