159 lines
5.0 KiB
Plaintext
159 lines
5.0 KiB
Plaintext
#define HEAT_DAMAGE_LEVEL_1 2 //Amount of damage applied when your body temperature just passes the 360.15k safety point
|
|
#define HEAT_DAMAGE_LEVEL_2 3 //Amount of damage applied when your body temperature passes the 400K point
|
|
#define HEAT_DAMAGE_LEVEL_3 8 //Amount of damage applied when your body temperature passes the 460K point and you are on fire
|
|
|
|
|
|
/mob/living/carbon/alien
|
|
name = "alien"
|
|
voice_name = "alien"
|
|
icon = 'icons/mob/alien.dmi'
|
|
gender = FEMALE //All xenos are girls!!
|
|
dna = null
|
|
faction = list("alien")
|
|
ventcrawler = VENTCRAWLER_ALWAYS
|
|
sight = SEE_MOBS
|
|
see_in_dark = 4
|
|
verb_say = "hisses"
|
|
initial_language_holder = /datum/language_holder/alien
|
|
bubble_icon = "alien"
|
|
type_of_meat = /obj/item/weapon/reagent_containers/food/snacks/meat/slab/xeno
|
|
var/nightvision = 1
|
|
|
|
var/obj/item/weapon/card/id/wear_id = null // Fix for station bounced radios -- Skie
|
|
var/has_fine_manipulation = 0
|
|
var/move_delay_add = 0 // movement delay to add
|
|
|
|
status_flags = CANPARALYSE|CANPUSH
|
|
|
|
var/heat_protection = 0.5
|
|
var/leaping = 0
|
|
gib_type = /obj/effect/decal/cleanable/xenoblood/xgibs
|
|
unique_name = 1
|
|
devourable = TRUE
|
|
|
|
var/static/regex/alien_name_regex = new("alien (larva|sentinel|drone|hunter|praetorian|queen)( \\(\\d+\\))?")
|
|
|
|
/mob/living/carbon/alien/Initialize()
|
|
verbs += /mob/living/proc/mob_sleep
|
|
verbs += /mob/living/proc/lay_down
|
|
|
|
create_bodyparts() //initialize bodyparts
|
|
|
|
create_internal_organs()
|
|
|
|
..()
|
|
|
|
/mob/living/carbon/alien/create_internal_organs()
|
|
internal_organs += new /obj/item/organ/brain/alien
|
|
internal_organs += new /obj/item/organ/alien/hivenode
|
|
internal_organs += new /obj/item/organ/tongue/alien
|
|
internal_organs += new /obj/item/organ/eyes/night_vision/alien
|
|
internal_organs += new /obj/item/organ/ears
|
|
..()
|
|
|
|
/mob/living/carbon/alien/assess_threat() // beepsky won't hunt aliums
|
|
return -10
|
|
|
|
/mob/living/carbon/alien/handle_environment(datum/gas_mixture/environment)
|
|
if(!environment)
|
|
return
|
|
|
|
var/loc_temp = get_temperature(environment)
|
|
|
|
// Aliens are now weak to fire.
|
|
|
|
//After then, it reacts to the surrounding atmosphere based on your thermal protection
|
|
if(!on_fire) // If you're on fire, ignore local air temperature
|
|
if(loc_temp > bodytemperature)
|
|
//Place is hotter than we are
|
|
var/thermal_protection = heat_protection //This returns a 0 - 1 value, which corresponds to the percentage of heat protection.
|
|
if(thermal_protection < 1)
|
|
bodytemperature += (1-thermal_protection) * ((loc_temp - bodytemperature) / BODYTEMP_HEAT_DIVISOR)
|
|
else
|
|
bodytemperature += 1 * ((loc_temp - bodytemperature) / BODYTEMP_HEAT_DIVISOR)
|
|
|
|
if(bodytemperature > 360.15)
|
|
//Body temperature is too hot.
|
|
throw_alert("alien_fire", /obj/screen/alert/alien_fire)
|
|
switch(bodytemperature)
|
|
if(360 to 400)
|
|
apply_damage(HEAT_DAMAGE_LEVEL_1, BURN)
|
|
if(400 to 460)
|
|
apply_damage(HEAT_DAMAGE_LEVEL_2, BURN)
|
|
if(460 to INFINITY)
|
|
if(on_fire)
|
|
apply_damage(HEAT_DAMAGE_LEVEL_3, BURN)
|
|
else
|
|
apply_damage(HEAT_DAMAGE_LEVEL_2, BURN)
|
|
else
|
|
clear_alert("alien_fire")
|
|
|
|
/mob/living/carbon/alien/reagent_check(datum/reagent/R) //can metabolize all reagents
|
|
return 0
|
|
|
|
/mob/living/carbon/alien/IsAdvancedToolUser()
|
|
return has_fine_manipulation
|
|
|
|
/mob/living/carbon/alien/Stat()
|
|
..()
|
|
|
|
if(statpanel("Status"))
|
|
stat(null, "Intent: [a_intent]")
|
|
|
|
/mob/living/carbon/alien/getTrail()
|
|
if(getBruteLoss() < 200)
|
|
return pick (list("xltrails_1", "xltrails2"))
|
|
else
|
|
return pick (list("xttrails_1", "xttrails2"))
|
|
/*----------------------------------------
|
|
Proc: AddInfectionImages()
|
|
Des: Gives the client of the alien an image on each infected mob.
|
|
----------------------------------------*/
|
|
/mob/living/carbon/alien/proc/AddInfectionImages()
|
|
if (client)
|
|
for (var/mob/living/C in GLOB.mob_list)
|
|
if(C.status_flags & XENO_HOST)
|
|
var/obj/item/organ/body_egg/alien_embryo/A = C.getorgan(/obj/item/organ/body_egg/alien_embryo)
|
|
if(A)
|
|
var/I = image('icons/mob/alien.dmi', loc = C, icon_state = "infected[A.stage]")
|
|
client.images += I
|
|
return
|
|
|
|
|
|
/*----------------------------------------
|
|
Proc: RemoveInfectionImages()
|
|
Des: Removes all infected images from the alien.
|
|
----------------------------------------*/
|
|
/mob/living/carbon/alien/proc/RemoveInfectionImages()
|
|
if (client)
|
|
for(var/image/I in client.images)
|
|
if(dd_hasprefix_case(I.icon_state, "infected"))
|
|
qdel(I)
|
|
return
|
|
|
|
/mob/living/carbon/alien/canBeHandcuffed()
|
|
return 1
|
|
|
|
/mob/living/carbon/alien/get_standard_pixel_y_offset(lying = 0)
|
|
return initial(pixel_y)
|
|
|
|
/mob/living/carbon/alien/proc/alien_evolve(mob/living/carbon/alien/new_xeno)
|
|
to_chat(src, "<span class='noticealien'>You begin to evolve!</span>")
|
|
visible_message("<span class='alertalien'>[src] begins to twist and contort!</span>")
|
|
new_xeno.setDir(dir)
|
|
if(!alien_name_regex.Find(name))
|
|
new_xeno.name = name
|
|
new_xeno.real_name = real_name
|
|
if(mind)
|
|
mind.transfer_to(new_xeno)
|
|
qdel(src)
|
|
|
|
// TODO make orbiters orbit the new xeno, or make xenos species rather than types
|
|
|
|
#undef HEAT_DAMAGE_LEVEL_1
|
|
#undef HEAT_DAMAGE_LEVEL_2
|
|
#undef HEAT_DAMAGE_LEVEL_3
|
|
|
|
/mob/living/carbon/alien/can_hold_items()
|
|
return has_fine_manipulation
|