-
-
Notifications
You must be signed in to change notification settings - Fork 444
/
Copy pathalien.dm
154 lines (128 loc) · 5.08 KB
/
alien.dm
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
/mob/living/carbon/alien
name = "alien"
icon = 'icons/mob/alien.dmi'
gender = FEMALE //All xenos are girls!!
dna = null
faction = list(ROLE_ALIEN)
ventcrawler = VENTCRAWLER_ALWAYS
sight = SEE_MOBS
verb_say = "hisses"
initial_language_holder = /datum/language_holder/alien
bubble_icon = BUBBLE_ALIEN
weather_immunities = WEATHER_STORM
type_of_meat = /obj/item/reagent_containers/food/snacks/meat/slab/xeno
blocks_emissive = EMISSIVE_BLOCK_UNIQUE
var/obj/item/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 = CANUNCONSCIOUS|CANPUSH
var/heat_protection = 0.5
var/leaping = 0
gib_type = /obj/effect/decal/cleanable/xenoblood/xgibs
unique_name = 1
var/static/regex/alien_name_regex = new("alien (larva|sentinel|drone|hunter|praetorian|queen)( \\(\\d+\\))?")
blood_volume = BLOOD_VOLUME_XENO //Yogs -- Makes monkeys/xenos have different amounts of blood from normal carbonbois
var/datum/techweb/linked_techweb
/mob/living/carbon/alien/Initialize(mapload)
add_verb(src, /mob/living/proc/mob_sleep)
add_verb(src, /mob/living/proc/lay_down)
create_bodyparts() //initialize bodyparts
create_internal_organs()
if(!linked_techweb)
linked_techweb = SSresearch.science_tech
. = ..()
/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/alien
internal_organs += new /obj/item/organ/liver/alien
internal_organs += new /obj/item/organ/ears
..()
/mob/living/carbon/alien/assess_threat(judgement_criteria, lasercolor = "", datum/callback/weaponcheck=null) // 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)
var/heat_capacity_factor = min(1, environment.heat_capacity() / environment.return_volume())
// 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)
adjust_bodytemperature((1-thermal_protection) * ((loc_temp - bodytemperature) / BODYTEMP_HEAT_DIVISOR) * heat_capacity_factor)
else
adjust_bodytemperature(heat_capacity_factor * ((loc_temp - bodytemperature) / BODYTEMP_HEAT_DIVISOR))
if(bodytemperature > BODYTEMP_HEAT_DAMAGE_LIMIT)
//Body temperature is too hot.
throw_alert("alien_fire", /atom/movable/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/get_status_tab_items()
. = ..()
. += "Combat mode: [combat_mode ? "On" : "Off"]"
/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/i in GLOB.mob_living_list)
var/mob/living/L = i
if(HAS_TRAIT(L, TRAIT_XENO_HOST))
var/obj/item/organ/body_egg/alien_embryo/A = L.getorgan(/obj/item/organ/body_egg/alien_embryo)
if(A)
var/I = image('icons/mob/alien.dmi', loc = L, icon_state = "infected[A.current_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)
var/searchfor = "infected"
if(findtext(I.icon_state, searchfor, 1, length(searchfor) + 1))
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)
visible_message(
span_alertalien("[src] begins to twist and contort!"),
span_noticealien("You begin to evolve!"),
)
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)
/mob/living/carbon/alien/can_hold_items()
return has_fine_manipulation