mirror of
https://github.com/CHOMPStation2/CHOMPStation2.git
synced 2025-12-10 18:22:39 +00:00
Ling Fixes + Various other fixes
This commit is contained in:
93
code/modules/mob/_modifiers/changeling.dm
Normal file
93
code/modules/mob/_modifiers/changeling.dm
Normal file
@@ -0,0 +1,93 @@
|
||||
/datum/modifier/changeling
|
||||
name = "changeling"
|
||||
desc = "Changeling modifier."
|
||||
|
||||
var/required_chems = 1 // Default is to require at least 1 chem unit. This does not consume it.
|
||||
|
||||
var/chem_maintenance = 1 // How many chems are expended per cycle, if we are consuming chems.
|
||||
|
||||
var/max_genetic_damage = 100
|
||||
|
||||
var/max_stat = 0
|
||||
|
||||
var/use_chems = FALSE // Do we have an upkeep cost on chems?
|
||||
|
||||
var/exterior_modifier = FALSE // Should we be checking the origin mob for chems?
|
||||
|
||||
/datum/modifier/changeling/check_if_valid()
|
||||
var/mob/living/L = null
|
||||
if(exterior_modifier)
|
||||
if(origin)
|
||||
L = origin.resolve()
|
||||
else
|
||||
expire()
|
||||
return
|
||||
|
||||
if((!exterior_modifier && !holder.changeling_power(required_chems, 0, max_genetic_damage, max_stat)) || (exterior_modifier && L && !L.changeling_power(required_chems, 0, max_genetic_damage, max_stat)))
|
||||
expire()
|
||||
else
|
||||
..()
|
||||
|
||||
/datum/modifier/changeling/tick()
|
||||
..()
|
||||
|
||||
if(use_chems)
|
||||
var/mob/living/L = null
|
||||
|
||||
if(exterior_modifier)
|
||||
L = origin.resolve()
|
||||
|
||||
else
|
||||
L = holder
|
||||
|
||||
L.mind.changeling.chem_charges = between(0, L.mind.changeling.chem_charges - chem_maintenance, L.mind.changeling.chem_storage)
|
||||
|
||||
/datum/modifier/changeling/thermal_sight
|
||||
name = "Thermal Adaptation"
|
||||
desc = "Our eyes are capable of seeing into the infrared spectrum to accurately identify prey through walls."
|
||||
vision_flags = SEE_MOBS
|
||||
|
||||
on_expired_text = "<span class='alien'>Your sight returns to what it once was.</span>"
|
||||
stacks = MODIFIER_STACK_EXTEND
|
||||
|
||||
/datum/modifier/changeling/thermal_sight/check_if_valid()
|
||||
var/mob/living/L = null
|
||||
|
||||
if(exterior_modifier)
|
||||
L = origin.resolve()
|
||||
|
||||
else
|
||||
L = holder
|
||||
|
||||
if(!L)
|
||||
expire()
|
||||
return
|
||||
|
||||
var/datum/changeling/changeling = L.changeling_power(0,0,100,CONSCIOUS)
|
||||
|
||||
if(!changeling)
|
||||
expire()
|
||||
return
|
||||
|
||||
if(!changeling.thermal_sight)
|
||||
expire()
|
||||
return
|
||||
|
||||
..()
|
||||
|
||||
/datum/modifier/changeling/thermal_sight/expire()
|
||||
var/mob/living/L = null
|
||||
|
||||
if(exterior_modifier)
|
||||
L = origin.resolve()
|
||||
|
||||
else
|
||||
L = holder
|
||||
|
||||
if(L)
|
||||
var/datum/changeling/changeling = L.changeling_power(0,0,100,CONSCIOUS)
|
||||
|
||||
if(changeling)
|
||||
changeling.thermal_sight = FALSE
|
||||
|
||||
..()
|
||||
@@ -51,6 +51,8 @@
|
||||
var/emp_modifier // Added to the EMP strength, which is an inverse scale from 1 to 4, with 1 being the strongest EMP. 5 is a nullification.
|
||||
var/explosion_modifier // Added to the bomb strength, which is an inverse scale from 1 to 3, with 1 being gibstrength. 4 is a nullification.
|
||||
|
||||
var/vision_flags // Vision flags to add to the mob. SEE_MOB, SEE_OBJ, etc.
|
||||
|
||||
/datum/modifier/New(var/new_holder, var/new_origin)
|
||||
holder = new_holder
|
||||
if(new_origin)
|
||||
|
||||
Reference in New Issue
Block a user