Merge pull request #4190 from Ccomp5950/merge_fix

Compile fix after bad merge.
This commit is contained in:
Zuhayr
2014-01-03 09:18:49 -08:00
4 changed files with 55 additions and 339 deletions
+49 -28
View File
@@ -25,6 +25,8 @@ var/global/list/dna_activity_bounds[STRUCDNASIZE]
// Used to determine what each block means (admin hax and species stuff on /vg/, mostly)
var/global/list/assigned_blocks[STRUCDNASIZE]
var/global/list/datum/dna/gene/dna_genes[0]
// UI Indices (can change to mutblock style, if desired)
#define DNA_UI_HAIR_R 1
#define DNA_UI_HAIR_G 2
@@ -41,21 +43,13 @@ var/global/list/assigned_blocks[STRUCDNASIZE]
#define DNA_UI_HAIR_STYLE 13
#define DNA_UI_LENGTH 13 // Update this when you add something, or you WILL break shit.
/////////////////
// GENE DEFINES
/////////////////
/* Note RE: unassigned blocks
Many genes in baycode are currently sitting unused
(compare setupgame.dm to the number of *BLOCK variables).
This datum will return 0 (or equivalent) if asked about
a block 0 (which means the gene was unassigned). Setters
will silently return without performing any action.
I have code to assign these genes in a streamlined manner,
but in order to avoid breaking things, I've left the
existing setupgame.dm intact. Please let me know if you
need this behavior changed.
*/
// Skip checking if it's already active.
// Used for genes that check for value rather than a binary on/off.
#define GENE_ALWAYS_ACTIVATE 1
/datum/dna
// READ-ONLY, GETS OVERWRITTEN
@@ -77,6 +71,27 @@ var/global/list/assigned_blocks[STRUCDNASIZE]
var/b_type = "A+" // Should probably change to an integer => string map but I'm lazy.
var/mutantrace = null // The type of mutant race the player is, if applicable (i.e. potato-man)
var/real_name // Stores the real name of the person who originally got this dna datum. Used primarily for changelings,
// New stuff
var/species = "Human"
// Make a copy of this strand.
// USE THIS WHEN COPYING STUFF OR YOU'LL GET CORRUPTION!
/datum/dna/proc/Clone()
var/datum/dna/new_dna = new()
new_dna.unique_enzymes=unique_enzymes
new_dna.b_type=b_type
new_dna.mutantrace=mutantrace
new_dna.real_name=real_name
new_dna.species=species
for(var/b=1;b<=STRUCDNASIZE;b++)
new_dna.SE[b]=SE[b]
if(b<=DNA_UI_LENGTH)
new_dna.UI[b]=UI[b]
new_dna.UpdateUI()
new_dna.UpdateSE()
return new_dna
///////////////////////////////////////
// UNIQUE IDENTITY
///////////////////////////////////////
@@ -84,7 +99,11 @@ var/global/list/assigned_blocks[STRUCDNASIZE]
// Create random UI.
/datum/dna/proc/ResetUI(var/defer=0)
for(var/i=1,i<=DNA_UI_LENGTH,i++)
UI[i]=rand(0,4095)
switch(i)
if(DNA_UI_SKIN_TONE)
SetUIValueRange(DNA_UI_SKIN_TONE,rand(1,220),220,1) // Otherwise, it gets fucked
else
UI[i]=rand(0,4095)
if(!defer)
UpdateUI()
@@ -110,13 +129,13 @@ var/global/list/assigned_blocks[STRUCDNASIZE]
SetUIValueRange(DNA_UI_BEARD_G, character.g_facial, 255, 1)
SetUIValueRange(DNA_UI_BEARD_B, character.b_facial, 255, 1)
SetUIValueRange(DNA_UI_EYES_R, character.r_eyes, 255, 1)
SetUIValueRange(DNA_UI_EYES_G, character.g_eyes, 255, 1)
SetUIValueRange(DNA_UI_EYES_B, character.b_eyes, 255, 1)
SetUIValueRange(DNA_UI_EYES_R, character.r_eyes, 255, 1)
SetUIValueRange(DNA_UI_EYES_G, character.g_eyes, 255, 1)
SetUIValueRange(DNA_UI_EYES_B, character.b_eyes, 255, 1)
SetUIValueRange(DNA_UI_SKIN_TONE, -character.s_tone+35, 220, 1) // WARNING: MATH. Blame the person that setup line 944 in modules/client/preferences.dm
SetUIValueRange(DNA_UI_SKIN_TONE, 35-character.s_tone, 220, 1) // Value can be negative.
SetUIState(DNA_UI_GENDER, character.gender!=MALE, 1)
SetUIState(DNA_UI_GENDER, character.gender!=MALE, 1)
SetUIValueRange(DNA_UI_HAIR_STYLE, hair, hair_styles_list.len, 1)
SetUIValueRange(DNA_UI_BEARD_STYLE, beard, facial_hair_styles_list.len,1)
@@ -140,22 +159,18 @@ var/global/list/assigned_blocks[STRUCDNASIZE]
// Set a DNA UI block's value, given a value and a max possible value.
// Used in hair and facial styles (value being the index and maxvalue being the len of the hairstyle list)
/datum/dna/proc/SetUIValueRange(var/block,var/value,var/maxvalue,var/minvalue)
/datum/dna/proc/SetUIValueRange(var/block,var/value,var/maxvalue,var/defer=0)
if (block<=0) return
if(value < minvalue)
value=minvalue
else if(value > maxvalue)
value=maxvalue
ASSERT(maxvalue<=4095)
var/range = (4095 / maxvalue)
if(value)
SetUIValue(block,round(value * range))
SetUIValue(block,round(value * range),defer)
// Getter version of above.
/datum/dna/proc/GetUIValueRange(var/block,var/maxvalue)
if (block<=0) return 0
var/value = GetUIValue(block)
return round(1+(value / 4096)*maxvalue)
return round(1 +(value / 4096)*maxvalue)
// Is the UI gene "on" or "off"?
// For UI, this is simply a check of if the value is > 2050.
@@ -238,6 +253,12 @@ var/global/list/assigned_blocks[STRUCDNASIZE]
if(value)
SetSEValue(block, value * range - rand(1,range-1))
// Getter version of above.
/datum/dna/proc/GetSEValueRange(var/block,var/maxvalue)
if (block<=0) return 0
var/value = GetSEValue(block)
return round(1 +(value / 4096)*maxvalue)
// Is the block "on" (1) or "off" (0)? (Un-assigned genes are always off.)
/datum/dna/proc/GetSEState(var/block)
if (block<=0) return 0
@@ -253,7 +274,7 @@ var/global/list/assigned_blocks[STRUCDNASIZE]
if(on)
val=rand(BOUNDS[DNA_ON_LOWERBOUND],BOUNDS[DNA_ON_UPPERBOUND])
else
val=rand(BOUNDS[DNA_OFF_LOWERBOUND],BOUNDS[DNA_OFF_UPPERBOUND])
val=rand(1,BOUNDS[DNA_OFF_UPPERBOUND])
SetSEValue(block,val,defer)
// Get hex-encoded SE block.
+4 -1
View File
@@ -40,6 +40,9 @@
//else
// testing("[M] - Failed to activate [gene.name] - [gene_active?"+":"-"]active, [gene_prior_status?"+":"-"]prior")
// PROC CONTINUES BELOW AFTER COMMENTED CODE.
/* Old, inflexibile
/proc/domutcheck(var/mob/living/M, var/connected, var/flags)
if (!M) return
@@ -352,4 +355,4 @@
M.update_icon = 1 //queue a full icon update at next life() call
return null
/////////////////////////// DNA MISC-PROCS
*/
*/
-304
View File
@@ -172,308 +172,4 @@
/proc/probinj(var/pr, var/inj)
return prob(pr+inj*pr)
// (Re-)Apply mutations.
// TODO: Turn into a /mob proc, change inj to a bitflag for various forms of differing behavior.
// M: Mob to mess with
// connected: Machine we're in, type unchecked so I doubt it's used beyond monkeying
// inj: 1 for if we're checking this from an injector, screws with manifestation probability calc.
/proc/domutcheck(mob/living/M as mob, connected, inj)
if (!M) return
M.dna.check_integrity()
M.disabilities = 0
M.sdisabilities = 0
var/old_mutations = M.mutations
M.mutations = list()
M.pass_flags = 0
// M.see_in_dark = 2
// M.see_invisible = 0
if(PLANT in old_mutations)
M.mutations.Add(PLANT)
if(SKELETON in old_mutations)
M.mutations.Add(SKELETON)
if(FAT in old_mutations)
M.mutations.Add(FAT)
if(HUSK in old_mutations)
M.mutations.Add(HUSK)
/////////////////////////////////////
// IMPORTANT REMINDER
// IF A BLOCK IS SET TO 0 (unused)
// GetSEState(block) WILL RETURN 0
/////////////////////////////////////
if(M.dna.GetSEState(NOBREATHBLOCK))
if(probinj(45,inj) || (mNobreath in old_mutations))
M << "\blue You feel no need to breathe."
M.mutations.Add(mNobreath)
if(M.dna.GetSEState(REMOTEVIEWBLOCK))
if(probinj(45,inj) || (mRemote in old_mutations))
M << "\blue Your mind expands"
M.mutations.Add(mRemote)
M.verbs += /mob/living/carbon/human/proc/remoteobserve
if(M.dna.GetSEState(REGENERATEBLOCK))
if(probinj(45,inj) || (mRegen in old_mutations))
M << "\blue You feel better"
M.mutations.Add(mRegen)
if(M.dna.GetSEState(INCREASERUNBLOCK))
if(probinj(45,inj) || (mRun in old_mutations))
M << "\blue Your leg muscles pulsate."
M.mutations.Add(mRun)
if(M.dna.GetSEState(REMOTETALKBLOCK))
if(probinj(45,inj) || (mRemotetalk in old_mutations))
M << "\blue You expand your mind outwards"
M.mutations.Add(mRemotetalk)
M.verbs += /mob/living/carbon/human/proc/remotesay
if(M.dna.GetSEState(MORPHBLOCK))
if(probinj(45,inj) || (mMorph in old_mutations))
M.mutations.Add(mMorph)
M << "\blue Your skin feels strange"
M.verbs += /mob/living/carbon/human/proc/morph
if(M.dna.GetSEState(HALLUCINATIONBLOCK))
if(probinj(45,inj) || (mHallucination in old_mutations))
M.mutations.Add(mHallucination)
M << "\red Your mind says 'Hello'"
if(M.dna.GetSEState(NOPRINTSBLOCK))
if(probinj(45,inj) || (mFingerprints in old_mutations))
M.mutations.Add(mFingerprints)
M << "\blue Your fingers feel numb"
if(M.dna.GetSEState(SHOCKIMMUNITYBLOCK))
if(probinj(45,inj) || (mShock in old_mutations))
M.mutations.Add(mShock)
M << "\blue Your skin feels strange"
if(M.dna.GetSEState(SMALLSIZEBLOCK))
if(probinj(45,inj) || (mSmallsize in old_mutations))
M << "\blue Your skin feels rubbery"
M.mutations.Add(mSmallsize)
M.pass_flags |= 1
if (M.dna.GetSEState(HULKBLOCK))
if(probinj(5,inj) || (HULK in old_mutations))
M << "\blue Your muscles hurt."
M.mutations.Add(HULK)
if (M.dna.GetSEState(HEADACHEBLOCK))
M.disabilities |= EPILEPSY
M << "\red You get a headache."
if (M.dna.GetSEState(FAKEBLOCK))
M << "\red You feel strange."
if (prob(95))
if(prob(50))
randmutb(M)
else
randmuti(M)
else
randmutg(M)
if (M.dna.GetSEState(COUGHBLOCK))
M.disabilities |= COUGHING
M << "\red You start coughing."
if (M.dna.GetSEState(CLUMSYBLOCK))
M << "\red You feel lightheaded."
M.mutations.Add(CLUMSY)
if (M.dna.GetSEState(TWITCHBLOCK))
M.disabilities |= TOURETTES
M << "\red You twitch."
if (M.dna.GetSEState(XRAYBLOCK))
if(probinj(30,inj) || (XRAY in old_mutations))
M << "\blue The walls suddenly disappear."
// M.sight |= (SEE_MOBS|SEE_OBJS|SEE_TURFS)
// M.see_in_dark = 8
// M.see_invisible = 2
M.mutations.Add(XRAY)
if (M.dna.GetSEState(NERVOUSBLOCK))
M.disabilities |= NERVOUS
M << "\red You feel nervous."
if (M.dna.GetSEState(FIREBLOCK))
if(probinj(30,inj) || (COLD_RESISTANCE in old_mutations))
M << "\blue Your body feels warm."
M.mutations.Add(COLD_RESISTANCE)
if (M.dna.GetSEState(BLINDBLOCK))
M.sdisabilities |= BLIND
M << "\red You can't seem to see anything."
if (M.dna.GetSEState(TELEBLOCK))
if(probinj(15,inj) || (TK in old_mutations))
M << "\blue You feel smarter."
M.mutations.Add(TK)
if (M.dna.GetSEState(DEAFBLOCK))
M.sdisabilities |= DEAF
M.ear_deaf = 1
M << "\red Its kinda quiet.."
if (M.dna.GetSEState(GLASSESBLOCK))
M.disabilities |= NEARSIGHTED
M << "Your eyes feel weird..."
/* If you want the new mutations to work, UNCOMMENT THIS.
if(istype(M, /mob/living/carbon))
for (var/datum/mutations/mut in global_mutations)
mut.check_mutation(M)
*/
//////////////////////////////////////////////////////////// Monkey Block
if (M.dna.GetSEState(MONKEYBLOCK) && istype(M, /mob/living/carbon/human))
// human > monkey
var/mob/living/carbon/human/H = M
H.monkeyizing = 1
var/list/implants = list() //Try to preserve implants.
for(var/obj/item/weapon/implant/W in H)
implants += W
W.loc = null
if(!connected)
for(var/obj/item/W in (H.contents-implants))
if (W==H.w_uniform) // will be teared
continue
H.drop_from_inventory(W)
M.monkeyizing = 1
M.canmove = 0
M.icon = null
M.invisibility = 101
var/atom/movable/overlay/animation = new( M.loc )
animation.icon_state = "blank"
animation.icon = 'icons/mob/mob.dmi'
animation.master = src
flick("h2monkey", animation)
sleep(48)
del(animation)
var/mob/living/carbon/monkey/O = null
if(H.species.primitive)
O = new H.species.primitive(src)
else
H.gib() //Trying to change the species of a creature with no primitive var set is messy.
return
if(M)
if (M.dna)
O.dna = M.dna
M.dna = null
if (M.suiciding)
O.suiciding = M.suiciding
M.suiciding = null
for(var/datum/disease/D in M.viruses)
O.viruses += D
D.affected_mob = O
M.viruses -= D
for(var/obj/T in (M.contents-implants))
del(T)
O.loc = M.loc
if(M.mind)
M.mind.transfer_to(O) //transfer our mind to the cute little monkey
if (connected) //inside dna thing
var/obj/machinery/dna_scannernew/C = connected
O.loc = C
C.occupant = O
connected = null
O.real_name = text("monkey ([])",copytext(md5(M.real_name), 2, 6))
O.take_overall_damage(M.getBruteLoss() + 40, M.getFireLoss())
O.adjustToxLoss(M.getToxLoss() + 20)
O.adjustOxyLoss(M.getOxyLoss())
O.stat = M.stat
O.a_intent = "hurt"
for (var/obj/item/weapon/implant/I in implants)
I.loc = O
I.implanted = O
// O.update_icon = 1 //queue a full icon update at next life() call
del(M)
return
if (!M.dna.GetSEState(MONKEYBLOCK) && !istype(M, /mob/living/carbon/human))
// monkey > human,
var/mob/living/carbon/monkey/Mo = M
Mo.monkeyizing = 1
var/list/implants = list() //Still preserving implants
for(var/obj/item/weapon/implant/W in Mo)
implants += W
W.loc = null
if(!connected)
for(var/obj/item/W in (Mo.contents-implants))
Mo.drop_from_inventory(W)
M.monkeyizing = 1
M.canmove = 0
M.icon = null
M.invisibility = 101
var/atom/movable/overlay/animation = new( M.loc )
animation.icon_state = "blank"
animation.icon = 'icons/mob/mob.dmi'
animation.master = src
flick("monkey2h", animation)
sleep(48)
del(animation)
var/mob/living/carbon/human/O = new( src )
if(Mo.greaterform)
O.set_species(Mo.greaterform)
if (M.dna.GetUIState(DNA_UI_GENDER))
O.gender = FEMALE
else
O.gender = MALE
if (M)
if (M.dna)
O.dna = M.dna
M.dna = null
if (M.suiciding)
O.suiciding = M.suiciding
M.suiciding = null
for(var/datum/disease/D in M.viruses)
O.viruses += D
D.affected_mob = O
M.viruses -= D
//for(var/obj/T in M)
// del(T)
O.loc = M.loc
if(M.mind)
M.mind.transfer_to(O) //transfer our mind to the human
if (connected) //inside dna thing
var/obj/machinery/dna_scannernew/C = connected
O.loc = C
C.occupant = O
connected = null
var/i
while (!i)
var/randomname
if (O.gender == MALE)
randomname = capitalize(pick(first_names_male) + " " + capitalize(pick(last_names)))
else
randomname = capitalize(pick(first_names_female) + " " + capitalize(pick(last_names)))
if (findname(randomname))
continue
else
O.real_name = randomname
i++
O.UpdateAppearance()
O.take_overall_damage(M.getBruteLoss(), M.getFireLoss())
O.adjustToxLoss(M.getToxLoss())
O.adjustOxyLoss(M.getOxyLoss())
O.stat = M.stat
for (var/obj/item/weapon/implant/I in implants)
I.loc = O
I.implanted = O
// O.update_icon = 1 //queue a full icon update at next life() call
del(M)
return
//////////////////////////////////////////////////////////// Monkey Block
if(M)
M.update_icon = 1 //queue a full icon update at next life() call
return null
/////////////////////////// DNA MISC-PROCS
+2 -6
View File
@@ -296,19 +296,15 @@ text("<A href='?src=\ref[src];operation=oddbutton'>[src.oddbutton ? "Yes" : "No"
/obj/machinery/bot/cleanbot/proc/get_targets()
src.target_types = new/list()
target_types += /obj/effect/decal/cleanable/oil
target_types += /obj/effect/decal/cleanable/blood/oil
target_types += /obj/effect/decal/cleanable/vomit
target_types += /obj/effect/decal/cleanable/robot_debris
target_types += /obj/effect/decal/cleanable/crayon
target_types += /obj/effect/decal/cleanable/liquid_fuel
target_types += /obj/effect/decal/cleanable/mucus
target_types += /obj/effect/decal/cleanable/dirt
if(src.blood)
target_types += /obj/effect/decal/cleanable/xenoblood/
target_types += /obj/effect/decal/cleanable/xenoblood/xgibs
target_types += /obj/effect/decal/cleanable/blood/
target_types += /obj/effect/decal/cleanable/blood/gibs/
target_types += /obj/effect/decal/cleanable/dirt
/obj/machinery/bot/cleanbot/proc/clean(var/obj/effect/decal/cleanable/target)
src.anchored = 1