Merge pull request #4225 from Zuhayr/dev

Mixed up some whitelist flags, also added alien reagent reactions.
This commit is contained in:
Ccomp5950
2014-01-07 20:12:03 -08:00
16 changed files with 103 additions and 42 deletions
+1 -1
View File
@@ -899,7 +899,7 @@ datum/preferences
if(config.usealienwhitelist)
for(var/L in all_languages)
var/datum/language/lang = all_languages[L]
if((!(lang.flags & RESTRICTED)) && (is_alien_whitelisted(user, L)||(!( lang.flags & IS_WHITELISTED ))))
if((!(lang.flags & RESTRICTED)) && (is_alien_whitelisted(user, L)||(!( lang.flags & WHITELISTED ))))
new_languages += lang
languages_available = 1
+3 -3
View File
@@ -1,5 +1,5 @@
/mob/dead/observer/say(var/message)
message = trim(copytext(sanitize(message), 1, MAX_MESSAGE_LEN))
message = trim(copytext(message, 1, MAX_MESSAGE_LEN))
if (!message)
return
@@ -18,7 +18,7 @@
/mob/dead/observer/emote(var/act, var/type, var/message)
message = trim(copytext(sanitize(message), 1, MAX_MESSAGE_LEN))
message = trim(copytext(message, 1, MAX_MESSAGE_LEN))
if(!message)
return
@@ -62,4 +62,4 @@
M.show_message("<span class='game'><i>You hear muffled speech... you can almost make out some words...</i></span>", 2)
// M.show_message("<span class='game'><i>[stutter(message)]</i></span>", 2)
playsound(src.loc, pick('sound/effects/ghost.ogg','sound/effects/ghost2.ogg'), 10, 1)
*/
*/
+5 -1
View File
@@ -36,11 +36,15 @@
M.show_message(message)
// Type 1 (Visual) emotes are sent to anyone in view of the item
if (m_type & 1)
for (var/mob/O in viewers(src, null))
O.show_message(message, m_type)
// Type 2 (Audible) emotes are sent to anyone in hear range
// of the *LOCATION* -- this is important for pAIs to be heard
else if (m_type & 2)
for (var/mob/O in hearers(src.loc, null))
for (var/mob/O in hearers(get_turf(src), null))
O.show_message(message, m_type)
/mob/proc/emote_dead(var/message)
+9 -1
View File
@@ -866,7 +866,15 @@
*/
proc/handle_chemicals_in_body()
if(reagents) reagents.metabolize(src)
if(reagents)
var/alien = 0 //Not the best way to handle it, but neater than checking this for every single reagent proc.
if(species && species.name == "Diona")
alien = 1
else if(species && species.name == "Vox")
alien = 2
reagents.metabolize(src,alien)
var/total_plasmaloss = 0
for(var/obj/item/I in src)
if(I.contaminated)
@@ -440,7 +440,7 @@
proc/handle_chemicals_in_body()
if(istype(src,/mob/living/carbon/monkey/diona)) //Filthy check. Dionaea nymphs need light or they get sad.
if(alien) //Diona nymphs are the only alien monkey currently.
var/light_amount = 0 //how much light there is in the place, affects receiving nutrition and healing
if(isturf(loc)) //else, there's considered to be no light
var/turf/T = loc
@@ -459,7 +459,7 @@
adjustToxLoss(-1)
adjustOxyLoss(-1)
if(reagents) reagents.metabolize(src)
if(reagents) reagents.metabolize(src,alien)
if (drowsyness)
drowsyness--
@@ -14,6 +14,7 @@
//var/uni_append = "12C4E2" // Small appearance modifier for different species.
var/list/uni_append = list(0x12C,0x4E2) // Same as above for DNA2.
var/update_muts = 1 // Monkey gene must be set at start.
var/alien = 0 //Used for reagent metabolism.
/mob/living/carbon/monkey/tajara
name = "farwa"
@@ -97,6 +98,7 @@
/mob/living/carbon/monkey/diona/New()
..()
alien = 1
gender = NEUTER
dna.mutantrace = "plant"
greaterform = "Diona"
+2 -1
View File
@@ -4,6 +4,7 @@
icon_state = "shadow"
robot_talk_understand = 0
emote_type = 2 // pAIs emotes are heard, not seen, so they can be seen through a container (eg. person)
var/network = "SS13"
var/obj/machinery/camera/current = null
@@ -268,4 +269,4 @@
pai.key = src.key
card.setPersonality(pai)
*/
*/
+1
View File
@@ -89,6 +89,7 @@
var/list/languages = list() // For speaking/listening.
var/list/abilities = list() // For species-derived or admin-given powers.
var/list/speak_emote = list("says") // Verbs used when speaking. Defaults to 'say' if speak_emote is null.
var/emote_type = 1 // Define emote default type, 1 for seen emotes, 2 for heard emotes
var/name_archive //For admin things like possession
+1 -1
View File
@@ -25,7 +25,7 @@
message = trim(copytext(sanitize(message), 1, MAX_MESSAGE_LEN))
if(use_me)
usr.emote("me",1,message)
usr.emote("me",usr.emote_type,message)
else
usr.emote(message)
+3 -2
View File
@@ -199,11 +199,12 @@ datum
return total_transfered
*/
metabolize(var/mob/M)
metabolize(var/mob/M,var/alien)
for(var/A in reagent_list)
var/datum/reagent/R = A
if(M && R)
R.on_mob_life(M)
R.on_mob_life(M,alien)
update_total()
conditional_update_move(var/atom/A, var/Running = 0)
+66 -23
View File
@@ -5,6 +5,10 @@
#define REAGENTS_OVERDOSE 30
#define REM REAGENTS_EFFECT_MULTIPLIER
//Some on_mob_life() procs check for alien races.
#define IS_DIONA 1
#define IS_VOX 2
//The reaction procs must ALWAYS set src = null, this detaches the proc from the object (the reagent)
//so that it can continue working when the reagent is deleted while the proc is still active.
@@ -68,7 +72,7 @@ datum
src = null
return
on_mob_life(var/mob/living/M as mob)
on_mob_life(var/mob/living/M as mob, var/alien)
if(!istype(M, /mob/living))
return //Noticed runtime errors from pacid trying to damage ghosts, this should fix. --NEO
if( (overdose > 0) && (volume >= overdose))//Overdosing, wooo
@@ -400,10 +404,15 @@ datum
color = "#C8A5DC" // rgb: 200, 165, 220
overdose = REAGENTS_OVERDOSE*2
on_mob_life(var/mob/living/M as mob)
on_mob_life(var/mob/living/M as mob, var/alien)
if(!M) M = holder.my_atom
if(M.losebreath >= 10)
M.losebreath = max(10, M.losebreath-5)
if(alien && alien == IS_VOX)
M.adjustToxLoss(REAGENTS_METABOLISM)
else
if(M.losebreath >= 10)
M.losebreath = max(10, M.losebreath-5)
holder.remove_reagent(src.id, 0.5 * REAGENTS_METABOLISM)
return
@@ -484,6 +493,14 @@ datum
custom_metabolism = 0.01
on_mob_life(var/mob/living/M as mob, var/alien)
if(M.stat == 2) return
if(alien && alien == IS_VOX)
M.adjustToxLoss(REAGENTS_METABOLISM)
holder.remove_reagent(src.id, REAGENTS_METABOLISM) //By default it slowly disappears.
return
..()
copper
name = "Copper"
id = "copper"
@@ -501,6 +518,14 @@ datum
custom_metabolism = 0.01
on_mob_life(var/mob/living/M as mob, var/alien)
if(M.stat == 2) return
if(alien && alien == IS_VOX)
M.adjustOxyLoss(-2*REM)
holder.remove_reagent(src.id, REAGENTS_METABOLISM) //By default it slowly disappears.
return
..()
hydrogen
name = "Hydrogen"
id = "hydrogen"
@@ -671,7 +696,10 @@ datum
if(prob(5))
if(prob(50))
M.radiation += 50 // curing it that way may kill you instead
M.adjustToxLoss(100)
var/mob/living/carbon/human/H
if(istype(C,/mob/living/carbon/human))
H = C
if(!H || (H.species && !(H.species.flags & RAD_ABSORB))) M.adjustToxLoss(100)
M:antibodies |= V.antigen
..()
return
@@ -983,6 +1011,7 @@ datum
if(M.stat == 2.0)
return
if(!M) M = holder.my_atom
//This needs a diona check but if one is added they won't be able to heal burn damage at all.
M.heal_organ_damage(0,2*REM)
..()
return
@@ -995,11 +1024,12 @@ datum
color = "#C8A5DC" // rgb: 200, 165, 220
overdose = REAGENTS_OVERDOSE/2
on_mob_life(var/mob/living/M as mob)
on_mob_life(var/mob/living/M as mob, var/alien)
if(M.stat == 2.0) //THE GUY IS **DEAD**! BEREFT OF ALL LIFE HE RESTS IN PEACE etc etc. He does NOT metabolise shit anymore, god DAMN
return
if(!M) M = holder.my_atom
M.heal_organ_damage(0,3*REM)
if(!alien || alien != IS_DIONA)
M.heal_organ_damage(0,3*REM)
..()
return
@@ -1011,11 +1041,16 @@ datum
color = "#C8A5DC" // rgb: 200, 165, 220
overdose = REAGENTS_OVERDOSE
on_mob_life(var/mob/living/M as mob)
on_mob_life(var/mob/living/M as mob, var/alien)
if(M.stat == 2.0)
return //See above, down and around. --Agouri
if(!M) M = holder.my_atom
M.adjustOxyLoss(-2*REM)
if(alien && alien == IS_VOX)
M.adjustToxLoss(2*REM)
else if(!alien || alien != IS_DIONA)
M.adjustOxyLoss(-2*REM)
if(holder.has_reagent("lexorin"))
holder.remove_reagent("lexorin", 2*REM)
..()
@@ -1029,11 +1064,16 @@ datum
color = "#C8A5DC" // rgb: 200, 165, 220
overdose = REAGENTS_OVERDOSE/2
on_mob_life(var/mob/living/M as mob)
on_mob_life(var/mob/living/M as mob, var/alien)
if(M.stat == 2.0)
return
if(!M) M = holder.my_atom
M.adjustOxyLoss(-M.getOxyLoss())
if(alien && alien == IS_VOX)
M.adjustOxyLoss()
else if(!alien || alien != IS_DIONA)
M.adjustOxyLoss(-M.getOxyLoss())
if(holder.has_reagent("lexorin"))
holder.remove_reagent("lexorin", 2*REM)
..()
@@ -1046,14 +1086,15 @@ datum
reagent_state = LIQUID
color = "#C8A5DC" // rgb: 200, 165, 220
on_mob_life(var/mob/living/M as mob)
on_mob_life(var/mob/living/M as mob, var/alien)
if(M.stat == 2.0)
return
if(!M) M = holder.my_atom
if(M.getOxyLoss()) M.adjustOxyLoss(-1*REM)
if(M.getBruteLoss() && prob(80)) M.heal_organ_damage(1*REM,0)
if(M.getFireLoss() && prob(80)) M.heal_organ_damage(0,1*REM)
if(M.getToxLoss() && prob(80)) M.adjustToxLoss(-1*REM)
if(!alien || alien != IS_DIONA)
if(M.getOxyLoss()) M.adjustOxyLoss(-1*REM)
if(M.getBruteLoss() && prob(80)) M.heal_organ_damage(1*REM,0)
if(M.getFireLoss() && prob(80)) M.heal_organ_damage(0,1*REM)
if(M.getToxLoss() && prob(80)) M.adjustToxLoss(-1*REM)
..()
return
@@ -1064,12 +1105,13 @@ datum
reagent_state = LIQUID
color = "#C8A5DC" // rgb: 200, 165, 220
on_mob_life(var/mob/living/M as mob)
on_mob_life(var/mob/living/M as mob, var/alien)
if(!M) M = holder.my_atom
M.reagents.remove_all_type(/datum/reagent/toxin, 1*REM, 0, 1)
M.drowsyness = max(M.drowsyness-2*REM, 0)
M.hallucination = max(0, M.hallucination - 5*REM)
M.adjustToxLoss(-2*REM)
if(!alien || alien != IS_DIONA)
M.reagents.remove_all_type(/datum/reagent/toxin, 1*REM, 0, 1)
M.drowsyness = max(M.drowsyness-2*REM, 0)
M.hallucination = max(0, M.hallucination - 5*REM)
M.adjustToxLoss(-2*REM)
..()
return
@@ -1249,11 +1291,12 @@ datum
color = "#C8A5DC" // rgb: 200, 165, 220
overdose = REAGENTS_OVERDOSE
on_mob_life(var/mob/living/M as mob)
on_mob_life(var/mob/living/M as mob, var/alien)
if(M.stat == 2.0)
return
if(!M) M = holder.my_atom
M.heal_organ_damage(2*REM,0)
if(alien != IS_DIONA)
M.heal_organ_damage(2*REM,0)
..()
return