Simplified update_mutations_overlay(), we no longer rebuild the entire mutation layer with all mutations every time we get or lose a mutation. I reintroduced in on_acquiring and on_losing some code similar to the old lose_indication gain_indication procs.

Fixed lesser form changeling, when humanized via dna injector, the ling no longer keeps its Human Form power.

Simplified the racemut trick in humanize() and monkeyize().

Dna now gets qdel'd, just like reagents, when the mob gets qdel'd.

Some tiny fixes here and there.

Added a changelog.
This commit is contained in:
phil235
2015-09-22 02:14:37 +02:00
parent 069e5cdbe5
commit 2fd2f96238
10 changed files with 58 additions and 31 deletions

View File

@@ -16,7 +16,7 @@
var/text_gain_indication = ""
var/text_lose_indication = ""
var/list/visual_indicators = list()
var/above_body = 0 //wether the mutation appear above or below the body layer
var/layer_used = MUTATIONS_LAYER //which mutation layer to use
var/list/species_allowed = list() //to restrict mutation to only certain species
var/health_req //minimum health required to acquire the mutation
@@ -62,7 +62,13 @@
if(text_gain_indication)
owner << text_gain_indication
if(visual_indicators.len)
owner.update_mutations_overlay()
var/list/mut_overlay = list(get_visual_indicator(owner))
if(owner.overlays_standing[layer_used])
mut_overlay = owner.overlays_standing[layer_used]
mut_overlay |= get_visual_indicator(owner)
owner.remove_overlay(layer_used)
owner.overlays_standing[layer_used] = mut_overlay
owner.apply_overlay(layer_used)
/datum/mutation/human/proc/get_visual_indicator(mob/living/carbon/human/owner)
return
@@ -84,7 +90,13 @@
if(text_lose_indication)
owner << text_lose_indication
if(visual_indicators.len)
owner.update_mutations_overlay()
var/list/mut_overlay = list()
if(owner.overlays_standing[layer_used])
mut_overlay = owner.overlays_standing[layer_used]
owner.remove_overlay(layer_used)
mut_overlay.Remove(get_visual_indicator(owner))
owner.overlays_standing[layer_used] = mut_overlay
owner.apply_overlay(layer_used)
return 0
return 1
@@ -596,7 +608,7 @@
quality = POSITIVE
dna_block = NON_SCANNABLE
text_gain_indication = "<span class='notice'>You feel pressure building up behind your eyes.</span>"
above_body = 1
layer_used = FRONT_MUTATIONS_LAYER
/datum/mutation/human/laser_eyes/New()
..()
@@ -609,29 +621,24 @@
if(owner.a_intent == "harm")
owner.LaserEyes(target)
/mob/living/carbon/proc/update_mutations_overlay()
return
/mob/living/carbon/human/update_mutations_overlay()
remove_overlay(MUTATIONS_LAYER) //MUTATIONS_LAYER is behind the body layer
remove_overlay(FRONT_MUTATIONS_LAYER) //FRONT_MUTATIONS_LAYER is above the body layer
var/list/standing = list()
var/list/frontstanding = list()
for(var/datum/mutation/human/CM in dna.mutations)
if(CM.species_allowed.len && !CM.species_allowed.Find(dna.species.id))
CM.force_lose(src)
CM.force_lose(src) //shouldn't have that mutation at all
continue
if(CM.visual_indicators.len)
var/list/mut_overlay = list()
if(overlays_standing[CM.layer_used])
mut_overlay = overlays_standing[CM.layer_used]
var/image/V = CM.get_visual_indicator(src)
if(CM.above_body)
frontstanding += V
else
standing += V
if(standing.len)
overlays_standing[MUTATIONS_LAYER] = standing
if(frontstanding.len)
overlays_standing[FRONT_MUTATIONS_LAYER] = frontstanding
apply_overlay(MUTATIONS_LAYER)
apply_overlay(FRONT_MUTATIONS_LAYER)
if(!mut_overlay.Find(V)) //either we lack the visual indicator or we have the wrong one
remove_overlay(CM.layer_used)
for(var/image/I in CM.visual_indicators)
mut_overlay.Remove(I)
mut_overlay |= V
overlays_standing[CM.layer_used] = mut_overlay
apply_overlay(CM.layer_used)

View File

@@ -320,7 +320,7 @@ mob/living/carbon/human/updateappearance(icon_update=1, mutcolor_update=0, mutat
for(var/i=1, i<=DNA_UNI_IDENTITY_BLOCKS, i++)
if(prob(probability))
M.dna.uni_identity = setblock(M.dna.uni_identity, i, random_string(DNA_BLOCK_SIZE, hex_characters))
M.updateappearance()
M.updateappearance(mutations_overlay_update=1)
return 1
//value in range 1 to values. values must be greater than 0

View File

@@ -388,8 +388,6 @@ var/list/sting_paths
/mob/proc/remove_changeling_powers(keep_free_powers=0)
if(ishuman(src) || ismonkey(src))
if(mind && mind.changeling)
digitalcamo = 0
digitalinvis = 0
mind.changeling.changeling_speak = 0
mind.changeling.reset()
for(var/obj/effect/proc_holder/changeling/p in mind.changeling.purchasedpowers)

View File

@@ -18,3 +18,7 @@
feedback_add_details("changeling_powers","CAM")
return 1
/obj/effect/proc_holder/changeling/digitalcamo/on_refund(mob/user)
user.digitalcamo = 0
user.digitalinvis = 0

View File

@@ -38,7 +38,7 @@
M.dna.blood_type = fields["blood_type"]
if(fields["UI"]) //UI+UE
M.dna.uni_identity = merge_text(M.dna.uni_identity, fields["UI"])
M.updateappearance()
M.updateappearance(mutations_overlay_update=1)
log_attack(log_msg)
else
user << "<span class='notice'>It appears that [M] does not have compatible DNA.</span>"

View File

@@ -43,10 +43,9 @@
if(prob(25))
if(prob(75))
randmutb(H)
H.domutcheck()
else
randmutg(H)
H.domutcheck()
H.domutcheck()
else if(istype(C, /mob/living/carbon/monkey))
var/mob/living/carbon/monkey/M = C

View File

@@ -21,6 +21,7 @@
I.real_name = I.dna.real_name
I.name = I.dna.real_name
I.updateappearance(mutcolor_update=1)
I.domutcheck()
if(W.ears) I.equip_to_slot_or_del(new W.ears.type, slot_ears)
if(W.w_uniform) I.equip_to_slot_or_del(new W.w_uniform.type , slot_w_uniform)
if(W.shoes) I.equip_to_slot_or_del(new W.shoes.type, slot_shoes)

View File

@@ -22,6 +22,8 @@
for(var/atom/movable/food in stomach_contents)
qdel(food)
remove_from_all_data_huds()
if(dna)
qdel(dna)
return ..()
/mob/living/carbon/Move(NewLoc, direct)

View File

@@ -48,8 +48,8 @@
if(tr_flags & TR_KEEPSE)
O.dna.struc_enzymes = dna.struc_enzymes
var/datum/mutation/human/race/R = mutations_list[RACEMUT] //we don't want to keep the race block inactive
O.dna.struc_enzymes = setblock(O.dna.struc_enzymes, R.dna_block, random_string(DNA_BLOCK_SIZE, list("8","9","a","b","c","d","e", "f")))
var/datum/mutation/human/race/R = mutations_list[RACEMUT]
O.dna.struc_enzymes = R.set_se(O.dna.struc_enzymes, on=1)//we don't want to keep the race block inactive
if(suiciding)
O.suiciding = suiciding
@@ -166,8 +166,8 @@
if(tr_flags & TR_KEEPSE)
O.dna.struc_enzymes = dna.struc_enzymes
var/datum/mutation/human/race/R = mutations_list[RACEMUT] //we don't want to keep the race block active
O.dna.struc_enzymes = setblock(O.dna.struc_enzymes, R.dna_block, random_string(DNA_BLOCK_SIZE, list("0","1","2","3","4","5","6")))
var/datum/mutation/human/race/R = mutations_list[RACEMUT]
O.dna.struc_enzymes = R.set_se(O.dna.struc_enzymes, on=0)//we don't want to keep the race block active
O.domutcheck()
if(suiciding)
@@ -208,6 +208,10 @@
if(mind)
mind.transfer_to(O)
if(O.mind.changeling)
for(var/obj/effect/proc_holder/changeling/humanform/HF in O.mind.changeling.purchasedpowers)
mind.changeling.purchasedpowers -= HF
O.a_intent = "help"
if (tr_flags & TR_DEFAULTMSG)
O << "<B>You are now a human.</B>"

View File

@@ -0,0 +1,12 @@
author: phil235
delete-after: True
changes:
- rscdel: "Lizards and other non human species can no longer acquire the hulk mutation. Hulks no longer have red eyes"
- bugfix: "Monkeys now always have dna and a blood type (compatible with humans)."
- bugfix: "Monkey transformation no longer deletes the human's clothes."
- bugfix: "Space Retrovirus now correctly transfers dna SE to the infected human."
- bugfix: "Changeling's Anatomic Panacea removes alien embryo again."
- bugfix: "Cloning someone now correctly sets up their dna UE."
- bugfix: "Fixes the laser eyes mutation not giving glowing red eyes to the human."
- bugfix: "Using changeling readaptation now properly removes all evolutions bought (arm blade, chameleon skin, organic suit)."