Fixing owner not being set in mutation/on_aquiring.
This commit is contained in:
@@ -51,45 +51,46 @@
|
||||
if(copymut && istype(copymut, /datum/mutation/human))
|
||||
copy_mutation(copymut)
|
||||
|
||||
/datum/mutation/human/proc/on_acquiring(mob/living/carbon/human/owner)
|
||||
if(!owner || !istype(owner) || owner.stat == DEAD || (src in owner.dna.mutations))
|
||||
/datum/mutation/human/proc/on_acquiring(mob/living/carbon/human/H)
|
||||
if(!H || !istype(H) || H.stat == DEAD || (src in H.dna.mutations))
|
||||
return TRUE
|
||||
if(species_allowed.len && !species_allowed.Find(owner.dna.species.id))
|
||||
if(species_allowed.len && !species_allowed.Find(H.dna.species.id))
|
||||
return TRUE
|
||||
if(health_req && owner.health < health_req)
|
||||
if(health_req && H.health < health_req)
|
||||
return TRUE
|
||||
if(limb_req && !owner.get_bodypart(limb_req))
|
||||
if(limb_req && !H.get_bodypart(limb_req))
|
||||
return TRUE
|
||||
dna = owner.dna
|
||||
owner = H
|
||||
dna = H.dna
|
||||
dna.mutations += src
|
||||
if(text_gain_indication)
|
||||
to_chat(owner, text_gain_indication)
|
||||
to_chat(H, text_gain_indication)
|
||||
if(visual_indicators.len)
|
||||
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)
|
||||
var/list/mut_overlay = list(get_visual_indicator())
|
||||
if(H.overlays_standing[layer_used])
|
||||
mut_overlay = H.overlays_standing[layer_used]
|
||||
mut_overlay |= get_visual_indicator()
|
||||
H.remove_overlay(layer_used)
|
||||
H.overlays_standing[layer_used] = mut_overlay
|
||||
H.apply_overlay(layer_used)
|
||||
|
||||
grant_spell(owner)
|
||||
grant_spell()
|
||||
if(!modified)
|
||||
addtimer(CALLBACK(src, .proc/modify, 5)) //gonna want children calling ..() to run first
|
||||
|
||||
/datum/mutation/human/proc/get_visual_indicator(mob/living/carbon/human/owner)
|
||||
/datum/mutation/human/proc/get_visual_indicator()
|
||||
return
|
||||
|
||||
/datum/mutation/human/proc/on_attack_hand(mob/living/carbon/human/owner, atom/target, proximity)
|
||||
/datum/mutation/human/proc/on_attack_hand(atom/target, proximity)
|
||||
return
|
||||
|
||||
/datum/mutation/human/proc/on_ranged_attack(mob/living/carbon/human/owner, atom/target)
|
||||
/datum/mutation/human/proc/on_ranged_attack(atom/target, mouseparams)
|
||||
return
|
||||
|
||||
/datum/mutation/human/proc/on_move(mob/living/carbon/human/owner, new_loc)
|
||||
/datum/mutation/human/proc/on_move(atom/new_loc)
|
||||
return
|
||||
|
||||
/datum/mutation/human/proc/on_life(mob/living/carbon/human/owner)
|
||||
/datum/mutation/human/proc/on_life()
|
||||
return
|
||||
|
||||
/datum/mutation/human/proc/on_losing(mob/living/carbon/human/owner)
|
||||
@@ -172,7 +173,7 @@
|
||||
else
|
||||
qdel(src)
|
||||
|
||||
/datum/mutation/human/proc/grant_spell(mob/living/carbon/human/owner)
|
||||
/datum/mutation/human/proc/grant_spell()
|
||||
if(!ispath(power) || !owner)
|
||||
return FALSE
|
||||
|
||||
@@ -180,4 +181,4 @@
|
||||
power.action_background_icon_state = "bg_tech_blue_on"
|
||||
power.panel = "Genetic"
|
||||
owner.AddSpell(power)
|
||||
return TRUE
|
||||
return TRUE
|
||||
@@ -111,7 +111,7 @@
|
||||
energy_coeff = 1
|
||||
synchronizer_coeff = 1
|
||||
|
||||
/datum/mutation/human/void/on_life(mob/living/carbon/human/owner)
|
||||
/datum/mutation/human/void/on_life()
|
||||
if(!isturf(owner.loc))
|
||||
return
|
||||
if(prob((0.5+((100-dna.stability)/20))) * GET_MUTATION_SYNCHRONIZER(src)) //very rare, but enough to annoy you hopefully. +0.5 probability for every 10 points lost in stability
|
||||
|
||||
@@ -36,7 +36,7 @@
|
||||
if(!(type in visual_indicators))
|
||||
visual_indicators[type] = list(mutable_appearance('icons/effects/genetics.dmi', "antenna", -FRONT_MUTATIONS_LAYER+1))//-MUTATIONS_LAYER+1
|
||||
|
||||
/datum/mutation/human/antenna/get_visual_indicator(mob/living/carbon/human/owner)
|
||||
/datum/mutation/human/antenna/get_visual_indicator()
|
||||
return visual_indicators[type][1]
|
||||
|
||||
/datum/mutation/human/mindreader
|
||||
@@ -104,5 +104,5 @@
|
||||
if(!(type in visual_indicators))
|
||||
visual_indicators[type] = list(mutable_appearance('icons/effects/genetics.dmi', "antenna", -FRONT_MUTATIONS_LAYER+1))
|
||||
|
||||
/datum/mutation/human/mindreader/get_visual_indicator(mob/living/carbon/human/owner)
|
||||
/datum/mutation/human/mindreader/get_visual_indicator()
|
||||
return visual_indicators[type][1]
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
synchronizer_coeff = 1
|
||||
power_coeff = 1
|
||||
|
||||
/datum/mutation/human/epilepsy/on_life(mob/living/carbon/human/owner)
|
||||
/datum/mutation/human/epilepsy/on_life()
|
||||
if(prob(1 * GET_MUTATION_SYNCHRONIZER(src)) && owner.stat == CONSCIOUS)
|
||||
owner.visible_message("<span class='danger'>[owner] starts having a seizure!</span>", "<span class='userdanger'>You have a seizure!</span>")
|
||||
owner.Unconscious(200 * GET_MUTATION_POWER(src))
|
||||
@@ -57,7 +57,7 @@
|
||||
synchronizer_coeff = 1
|
||||
power_coeff = 1
|
||||
|
||||
/datum/mutation/human/cough/on_life(mob/living/carbon/human/owner)
|
||||
/datum/mutation/human/cough/on_life()
|
||||
if(prob(5 * GET_MUTATION_SYNCHRONIZER(src)) && owner.stat == CONSCIOUS)
|
||||
owner.drop_all_held_items()
|
||||
owner.emote("cough")
|
||||
@@ -118,7 +118,7 @@
|
||||
text_gain_indication = "<span class='danger'>You twitch.</span>"
|
||||
synchronizer_coeff = 1
|
||||
|
||||
/datum/mutation/human/tourettes/on_life(mob/living/carbon/human/owner)
|
||||
/datum/mutation/human/tourettes/on_life()
|
||||
if(prob(10 * GET_MUTATION_SYNCHRONIZER(src)) && owner.stat == CONSCIOUS && !owner.IsStun())
|
||||
owner.Stun(200)
|
||||
switch(rand(1, 3))
|
||||
@@ -212,7 +212,7 @@
|
||||
synchronizer_coeff = 1
|
||||
power_coeff = 1
|
||||
|
||||
/datum/mutation/human/fire/on_life(mob/living/carbon/human/owner)
|
||||
/datum/mutation/human/fire/on_life()
|
||||
if(prob((1+(100-dna.stability)/10)) * GET_MUTATION_SYNCHRONIZER(src))
|
||||
owner.adjust_fire_stacks(2 * GET_MUTATION_POWER(src))
|
||||
owner.IgniteMob()
|
||||
@@ -268,7 +268,7 @@
|
||||
text_gain_indication = "<span class='danger'>You feel screams echo through your mind...</span>"
|
||||
text_lose_indication = "<span class'notice'>The screaming in your mind fades.</span>"
|
||||
|
||||
/datum/mutation/human/paranoia/on_life(mob/living/carbon/human/owner)
|
||||
/datum/mutation/human/paranoia/on_life()
|
||||
if(prob(5) && owner.stat == CONSCIOUS)
|
||||
owner.emote("scream")
|
||||
owner.jitteriness = min(max(0, owner.jitteriness + 5), 30)
|
||||
|
||||
@@ -14,13 +14,13 @@
|
||||
return
|
||||
owner.alpha = CHAMELEON_MUTATION_DEFAULT_TRANSPARENCY
|
||||
|
||||
/datum/mutation/human/chameleon/on_life(mob/living/carbon/human/owner)
|
||||
/datum/mutation/human/chameleon/on_life()
|
||||
owner.alpha = max(0, owner.alpha - 25)
|
||||
|
||||
/datum/mutation/human/chameleon/on_move(mob/living/carbon/human/owner)
|
||||
/datum/mutation/human/chameleon/on_move(atom/new_loc)
|
||||
owner.alpha = CHAMELEON_MUTATION_DEFAULT_TRANSPARENCY
|
||||
|
||||
/datum/mutation/human/chameleon/on_attack_hand(mob/living/carbon/human/owner, atom/target, proximity)
|
||||
/datum/mutation/human/chameleon/on_attack_hand(atom/target, proximity)
|
||||
if(proximity) //stops tk from breaking chameleon
|
||||
owner.alpha = CHAMELEON_MUTATION_DEFAULT_TRANSPARENCY
|
||||
return
|
||||
|
||||
@@ -19,11 +19,11 @@
|
||||
SEND_SIGNAL(owner, COMSIG_ADD_MOOD_EVENT, "hulk", /datum/mood_event/hulk)
|
||||
RegisterSignal(owner, COMSIG_MOB_SAY, .proc/handle_speech)
|
||||
|
||||
/datum/mutation/human/hulk/on_attack_hand(mob/living/carbon/human/owner,atom/target, proximity)
|
||||
/datum/mutation/human/hulk/on_attack_hand(atom/target, proximity)
|
||||
if(proximity) //no telekinetic hulk attack
|
||||
return target.attack_hulk(owner)
|
||||
|
||||
/datum/mutation/human/hulk/on_life(mob/living/carbon/human/owner)
|
||||
/datum/mutation/human/hulk/on_life()
|
||||
if(owner.health < 0)
|
||||
on_losing(owner)
|
||||
to_chat(owner, "<span class='danger'>You suddenly feel very weak.</span>")
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
instability = 5
|
||||
difficulty = 8
|
||||
|
||||
/datum/mutation/human/radioactive/on_life(mob/living/carbon/human/owner)
|
||||
/datum/mutation/human/radioactive/on_life()
|
||||
radiation_pulse(owner, 20)
|
||||
|
||||
/datum/mutation/human/radioactive/New(class_ = MUT_OTHER, timer, datum/mutation/human/copymut)
|
||||
|
||||
@@ -13,7 +13,7 @@
|
||||
if(!(type in visual_indicators))
|
||||
visual_indicators[type] = list(mutable_appearance('icons/effects/genetics.dmi', "fire", -MUTATIONS_LAYER))
|
||||
|
||||
/datum/mutation/human/space_adaptation/get_visual_indicator(mob/living/carbon/human/owner)
|
||||
/datum/mutation/human/space_adaptation/get_visual_indicator()
|
||||
return visual_indicators[type][1]
|
||||
|
||||
/datum/mutation/human/space_adaptation/on_acquiring(mob/living/carbon/human/owner)
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
quality = MINOR_NEGATIVE
|
||||
text_gain_indication = "<span class='danger'>You feel nervous.</span>"
|
||||
|
||||
/datum/mutation/human/nervousness/on_life(mob/living/carbon/human/owner)
|
||||
/datum/mutation/human/nervousness/on_life()
|
||||
if(prob(10))
|
||||
owner.stuttering = max(10, owner.stuttering)
|
||||
|
||||
|
||||
@@ -13,8 +13,8 @@
|
||||
if(!(type in visual_indicators))
|
||||
visual_indicators[type] = list(mutable_appearance('icons/effects/genetics.dmi', "telekinesishead", -MUTATIONS_LAYER))
|
||||
|
||||
/datum/mutation/human/telekinesis/get_visual_indicator(mob/living/carbon/human/owner)
|
||||
/datum/mutation/human/telekinesis/get_visual_indicator()
|
||||
return visual_indicators[type][1]
|
||||
|
||||
/datum/mutation/human/telekinesis/on_ranged_attack(mob/living/carbon/human/owner, atom/target)
|
||||
target.attack_tk(owner)
|
||||
/datum/mutation/human/telekinesis/on_ranged_attack(atom/target, mouseparams)
|
||||
target.attack_tk(owner)
|
||||
|
||||
Reference in New Issue
Block a user