Merge branch 'master' of https://github.com/tgstation/-tg-station into ProjectileFix1

Conflicts:
	code/modules/mob/living/carbon/carbon_defines.dm
	code/modules/mob/living/living_defines.dm
This commit is contained in:
phil235
2015-04-07 01:06:38 +02:00
140 changed files with 1822 additions and 1114 deletions
+2
View File
@@ -196,6 +196,8 @@
if(TRAITS & TRAIT_THIEVING)
slyness = 75
SSbp.insertBot(src)
/mob/living/carbon/human/interactive/attack_hand(mob/living/carbon/human/M as mob)
..()
@@ -12,6 +12,7 @@
ventcrawler = 2
languages = ALIEN
verb_say = "hisses"
lying_pixel_offset = 0
var/nightvision = 1
var/storedPlasma = 250
var/max_plasma = 500
@@ -54,6 +54,7 @@
/mob/living/carbon/alien/humanoid/hunter/proc/toggle_leap(var/message = 1)
leap_on_click = !leap_on_click
leap_icon.icon_state = "leap_[leap_on_click ? "on":"off"]"
update_icons()
if(message)
src << "<span class='noticealien'>You will now [leap_on_click ? "leap at":"slash at"] enemies!</span>"
else
@@ -4,6 +4,7 @@
var/obj/item/r_store = null
var/obj/item/l_store = null
var/caste = ""
var/alt_icon = 'icons/mob/alienleap.dmi' //used to switch between the two alien icon files.
var/leap_on_click = 0
var/pounce_cooldown = 0
var/pounce_cooldown_time = 30
@@ -19,18 +19,15 @@
//If we mostly took damage from fire
if(fireloss > 125)
icon_state = "alien[caste]_husked"
pixel_y = 0
else
icon_state = "alien[caste]_dead"
pixel_y = 0
else if(stat == UNCONSCIOUS || weakened)
else if((stat == UNCONSCIOUS && !sleeping) || weakened)
icon_state = "alien[caste]_unconscious"
pixel_y = 0
else if(leap_on_click)
icon_state = "alien[caste]_pounce"
else if(lying || resting)
else if(lying || resting || sleeping)
icon_state = "alien[caste]_sleep"
else if(m_intent == "run")
icon_state = "alien[caste]_running"
@@ -38,17 +35,21 @@
icon_state = "alien[caste]_s"
if(leaping)
icon = 'icons/mob/alienleap.dmi'
var/old_icon = icon
icon = alt_icon
alt_icon = old_icon
icon_state = "alien[caste]_leap"
pixel_x = -32
pixel_y = -32
else
icon = initial(icon)
if(alt_icon != initial(alt_icon))
var/old_icon = icon
icon = alt_icon
alt_icon = old_icon
pixel_x = initial(pixel_x)
pixel_y = initial(pixel_y)
/mob/living/carbon/alien/humanoid/regenerate_icons()
..()
if (notransform) return
@@ -63,8 +64,9 @@
/mob/living/carbon/alien/humanoid/update_transform() //The old method of updating lying/standing was update_icons(). Aliens still expect that.
if(lying > 0)
lying = 90 //Anything else looks retarded
update_icons()
..()
update_icons()
/mob/living/carbon/alien/humanoid/update_hud()
@@ -1,3 +0,0 @@
/mob/living/carbon/alien/larva/Login()
return ..()
@@ -22,5 +22,5 @@
var/co2overloadtime = null
var/temperature_resistance = T0C+75
lying_pixel_offset = -6 //offset for pixel_y when lying down.
has_limbs = 1
@@ -266,7 +266,7 @@
if(istype(user, /mob/living/carbon/human))
var/mob/living/carbon/human/H = user
var/obj/item/cybernetic_implant/eyes/hud/CIH = locate(/obj/item/cybernetic_implant/eyes/hud) in internal_organs
var/obj/item/cybernetic_implant/eyes/hud/CIH = locate(/obj/item/cybernetic_implant/eyes/hud) in H.internal_organs
if(istype(H.glasses, /obj/item/clothing/glasses/hud) || CIH)
var/perpname = get_face_name(get_id_name(""))
if(perpname)
@@ -276,6 +276,12 @@
msg += "<a href='?src=\ref[src];hud=1;photo_front=1'>\[Front photo\]</a> "
msg += "<a href='?src=\ref[src];hud=1;photo_side=1'>\[Side photo\]</a><br>"
if(istype(H.glasses, /obj/item/clothing/glasses/hud/health) || istype(CIH,/obj/item/cybernetic_implant/eyes/hud/medical))
var/implant_detect
for(var/obj/item/cybernetic_implant/CI in internal_organs)
implant_detect += "[name] is modified with a [CI.name].<br>"
if(implant_detect)
msg += "Detected cybernetic modifications:<br>"
msg += implant_detect
if(R)
var/health = R.fields["p_stat"]
msg += "<a href='?src=\ref[src];hud=m;p_stat=1'>\[[health]\]</a>"
+30 -4
View File
@@ -74,11 +74,35 @@
stat("Chemical Storage", "[mind.changeling.chem_charges]/[mind.changeling.chem_storage]")
stat("Absorbed DNA", mind.changeling.absorbedcount)
//NINJACODE
if(istype(wear_suit, /obj/item/clothing/suit/space/space_ninja))
var/obj/item/clothing/suit/space/space_ninja/SN = wear_suit
//NINJACODE
if(istype(wear_suit, /obj/item/clothing/suit/space/space_ninja)) //Only display if actually a ninja.
var/obj/item/clothing/suit/space/space_ninja/SN = wear_suit
if(statpanel("SpiderOS"))
stat("SpiderOS Status:","[SN.s_initialized ? "Initialized" : "Disabled"]")
stat("Current Time:", "[worldtime2text()]")
if(SN.s_initialized)
stat("Energy Charge", round(SN.cell.charge/100))
//Suit gear
stat("Energy Charge:", "[round(SN.cell.charge/100)]%")
stat("Smoke Bombs:", "\Roman [SN.s_bombs]")
//Ninja status
if(dna)
stat("Fingerprints:", "[md5(dna.uni_identity)]")
stat("Unique Identity:", "[dna.unique_enzymes]")
stat("Overall Status:", "[stat > 1 ? "dead" : "[health]% healthy"]")
stat("Nutrition Status:", "[nutrition]")
stat("Oxygen Loss:", "[getOxyLoss()]")
stat("Toxin Levels:", "[getToxLoss()]")
stat("Burn Severity:", "[getFireLoss()]")
stat("Brute Trauma:", "[getBruteLoss()]")
stat("Radiation Levels:","[radiation] rad")
stat("Body Temperature:","[bodytemperature-T0C] degrees C ([bodytemperature*1.8-459.67] degrees F)")
//Virsuses
if(viruses.len)
stat("Viruses:", null)
for(var/datum/disease/D in viruses)
stat("*", "[D.name], Type: [D.spread_text], Stage: [D.stage]/[D.max_stages], Possible Cure: [D.cure_text]")
/mob/living/carbon/human/ex_act(severity, ex_target)
@@ -239,6 +263,8 @@
if(istype(MB))
MB.RunOver(src)
spreadFire(AM)
//Added a safety check in case you want to shock a human mob directly through electrocute_act.
/mob/living/carbon/human/electrocute_act(var/shock_damage, var/obj/source, var/siemens_coeff = 1.0, var/safety = 0)
if(!safety)
@@ -100,17 +100,17 @@ emp_act
return 1
if(wear_suit && istype(wear_suit, /obj/item/))
var/obj/item/I = wear_suit
if(I.IsShield() && (prob(35)))
if(I.IsShield() && (prob(50)))
visible_message("<span class='danger'>The reactive teleport system flings [src] clear of [attack_text]!</span>", \
"<span class='userdanger'>The reactive teleport system flings [src] clear of [attack_text]!</span>")
var/list/turfs = new/list()
for(var/turf/T in orange(6))
for(var/turf/T in orange(6, src))
if(istype(T,/turf/space)) continue
if(T.density) continue
if(T.x>world.maxx-6 || T.x<6) continue
if(T.y>world.maxy-6 || T.y<6) continue
turfs += T
if(!turfs.len) turfs += pick(/turf in orange(6))
if(!turfs.len) turfs += pick(/turf in orange(6, src))
var/turf/picked = pick(turfs)
if(!isturf(picked)) return
if(buckled)
@@ -7,7 +7,6 @@
var/final_pixel_y = pixel_y
var/final_dir = dir
var/changed = 0
if(lying != lying_prev)
changed++
ntransform.TurnTo(lying_prev,lying)
@@ -16,7 +15,7 @@
else //if(lying != 0)
if(lying_prev == 0) //Standing to lying
pixel_y = initial(pixel_y)
final_pixel_y -= 6
final_pixel_y = lying_pixel_offset
if(dir & (EAST|WEST)) //Facing east or west
final_dir = pick(NORTH, SOUTH) //So you fall on your side rather than your face or ass
+2 -3
View File
@@ -86,9 +86,8 @@
m_type = 2
if ("flip")
if (!src.restrained())
message = "<B>[src]</B> does a flip!"
src.SpinAnimation(5,1)
if (!src.restrained() || !src.resting || !src.sleeping)
src.SpinAnimation(7,1)
m_type = 2
if ("frown")
+3 -3
View File
@@ -96,14 +96,14 @@
//this updates all special effects: stunned, sleeping, weakened, druggy, stuttering, etc..
/mob/living/proc/handle_status_effects()
if(paralysis)
AdjustParalysis(-1)
paralysis = max(paralysis-1,0)
if(stunned)
AdjustStunned(-1)
stunned = max(stunned-1,0)
if(!stunned)
update_icons()
if(weakened)
AdjustWeakened(-1)
weakened = max(weakened-1,0)
if(!weakened)
update_icons()
+23 -5
View File
@@ -70,6 +70,9 @@ Sorry Giacom. Please don't be mad :(
//Called when we bump onto a mob
/mob/living/proc/MobBump(mob/M)
//Even if we don't push/swap places, we "touched" them, so spread fire
spreadFire(M)
if(now_pushing)
return 1
@@ -323,6 +326,7 @@ Sorry Giacom. Please don't be mad :(
else
if(alert(src, "You sure you want to sleep for a while?", "Sleep", "Yes", "No") == "Yes")
usr.sleeping = 20 //Short nap
update_canmove()
/mob/proc/get_contents()
@@ -332,6 +336,7 @@ Sorry Giacom. Please don't be mad :(
resting = !resting
src << "<span class='notice'>You are now [resting ? "resting" : "getting up"].</span>"
update_canmove()
//Recursive function to find everything a mob is holding.
/mob/living/get_contents(var/obj/item/weapon/storage/Storage = null)
@@ -775,7 +780,10 @@ Sorry Giacom. Please don't be mad :(
animate(src, pixel_y = pixel_y + 2, time = 10, loop = -1)
floating = 1
else if(!on && floating)
animate(src, pixel_y = initial(pixel_y), time = 10)
var/final_pixel_y = initial(pixel_y)
if(lying && !buckled)
final_pixel_y = lying_pixel_offset
animate(src, pixel_y = final_pixel_y, time = 10)
floating = 0
//called when the mob receives a bright flash
@@ -838,9 +846,12 @@ Sorry Giacom. Please don't be mad :(
return
/atom/movable/proc/do_attack_animation(atom/A)
/atom/movable/proc/do_attack_animation(atom/A, end_pixel_y)
var/pixel_x_diff = 0
var/pixel_y_diff = 0
var/final_pixel_y = initial(pixel_y)
if(end_pixel_y)
final_pixel_y = end_pixel_y
var/direction = get_dir(src, A)
switch(direction)
if(NORTH)
@@ -863,20 +874,27 @@ Sorry Giacom. Please don't be mad :(
if(SOUTHWEST)
pixel_x_diff = -8
pixel_y_diff = -8
animate(src, pixel_x = pixel_x + pixel_x_diff, pixel_y = pixel_y + pixel_y_diff, time = 2)
animate(pixel_x = initial(pixel_x), pixel_y = initial(pixel_y), time = 2)
animate(pixel_x = initial(pixel_x), pixel_y = final_pixel_y, time = 2)
/mob/living/do_attack_animation(atom/A)
..()
var/final_pixel_y = initial(pixel_y)
if(lying && !buckled)
final_pixel_y = lying_pixel_offset
..(A, final_pixel_y)
floating = 0 // If we were without gravity, the bouncing animation got stopped, so we make sure to restart it in next life().
/mob/living/proc/do_jitter_animation(jitteriness)
var/amplitude = min(4, (jitteriness/100) + 1)
var/pixel_x_diff = rand(-amplitude, amplitude)
var/pixel_y_diff = rand(-amplitude/3, amplitude/3)
var/final_pixel_y = initial(pixel_y)
if(lying && !buckled)
final_pixel_y = lying_pixel_offset
animate(src, pixel_x = pixel_x + pixel_x_diff, pixel_y = pixel_y + pixel_y_diff , time = 2, loop = 6)
animate(pixel_x = initial(pixel_x) , pixel_y = initial(pixel_y) , time = 2)
animate(pixel_x = initial(pixel_x) , pixel_y = final_pixel_y , time = 2)
floating = 0 // If we were without gravity, the bouncing animation got stopped, so we make sure to restart it in next life().
/mob/living/proc/get_temperature(var/datum/gas_mixture/environment)
+18
View File
@@ -134,6 +134,24 @@ proc/vol_by_throwforce_and_or_w_class(var/obj/item/I)
adjust_fire_stacks(0.5)
IgniteMob()
//Share fire evenly between the two mobs
//Called in MobBump() and Crossed()
/mob/living/proc/spreadFire(var/mob/living/L)
if(!istype(L))
return
var/L_old_on_fire = L.on_fire
if(on_fire) //Only spread fire stacks if we're on fire
fire_stacks /= 2
L.fire_stacks += fire_stacks
L.IgniteMob()
if(L_old_on_fire) //Only ignite us and gain their stacks if they were onfire before we bumped them
L.fire_stacks /= 2
fire_stacks += L.fire_stacks
IgniteMob()
//Mobs on Fire end
+1 -2
View File
@@ -41,6 +41,5 @@
var/mob_size = MOB_SIZE_HUMAN
var/metabolism_efficiency = 1 //more or less efficiency to metabolize helpful/harmful reagents and regulate body temperature..
var/list/image/staticOverlays = list()
var/lying_pixel_offset = 0 //offset for pixel_y when the mob is lying down.
var/has_limbs = 0 //does the mob have distinct limbs?(arms,legs, chest,head)
@@ -4,10 +4,9 @@
var/obj/item/clothing/tie/petcollar/pcollar = null
var/image/collar = null
var/image/pettag = null
var/accept_collar = 1
/mob/living/simple_animal/pet/attackby(var/obj/item/O as obj, var/mob/user as mob, params)
if(istype(O, /obj/item/clothing/tie/petcollar) && accept_collar && !pcollar)
if(istype(O, /obj/item/clothing/tie/petcollar) && !pcollar)
var/obj/item/clothing/tie/petcollar/P = O
pcollar = P
update_collar()
@@ -24,6 +23,10 @@
pcollar = new(src)
update_collar()
/mob/living/simple_animal/pet/revive()
..()
update_collar()
/mob/living/simple_animal/pet/death(gibbed)
..(gibbed)
update_collar()
@@ -62,7 +65,6 @@
var/obj/item/inventory_head
var/obj/item/inventory_back
var/facehugger
accept_collar = 0 //corgis have their own item handling
/mob/living/simple_animal/pet/corgi/New()
..()
@@ -210,7 +212,6 @@
/obj/item/weapon/tank/internals/oxygen,
/obj/item/weapon/tank/internals/air,
/obj/item/weapon/extinguisher,
/obj/item/clothing/tie/petcollar
)
if( ! ( item_to_add.type in allowed_types ) )
@@ -526,7 +527,6 @@
density = 0
pass_flags = PASSMOB
mob_size = MOB_SIZE_SMALL
accept_collar = 1
//puppies cannot wear anything.
/mob/living/simple_animal/pet/corgi/puppy/Topic(href, href_list)
@@ -550,7 +550,6 @@
response_harm = "kicks"
var/turns_since_scan = 0
var/puppies = 0
accept_collar = 1
//Lisa already has a cute bow!
/mob/living/simple_animal/pet/corgi/Lisa/Topic(href, href_list)
@@ -35,7 +35,7 @@
/mob/living/simple_animal/hostile/carp/FindTarget()
. = ..()
if(.)
emote("me", 1, "nashes at [.]!")
emote("me", 1, "gnashes at [.]!")
/mob/living/simple_animal/hostile/carp/AttackingTarget()
..()
@@ -71,7 +71,8 @@
..()
/mob/living/simple_animal/updatehealth()
health = max(maxHealth - getBruteLoss(), 0)
..()
health = Clamp(health, 0, maxHealth)
/mob/living/simple_animal/Life()
if(..())
@@ -248,11 +249,16 @@
/mob/living/simple_animal/bullet_act(var/obj/item/projectile/Proj)
if(!Proj)
return
if((Proj.damage_type != STAMINA))
adjustBruteLoss(Proj.damage)
Proj.on_hit(src, 0)
apply_damage(Proj.damage, Proj.damage_type)
Proj.on_hit(src, 0)
return 0
/mob/living/simple_animal/adjustFireLoss(var/amount)
adjustBruteLoss(amount)
/mob/living/simple_animal/adjustStaminaLoss(var/amount)
return
/mob/living/simple_animal/attack_hand(mob/living/carbon/human/M as mob)
switch(M.a_intent)
@@ -381,7 +387,6 @@
icon_state = icon_dead
stat = DEAD
density = 0
lying = 1
if(!gibbed)
visible_message("<span class='danger'>\the [src] stops moving...</span>")
..()
@@ -426,8 +431,7 @@
/mob/living/simple_animal/revive()
health = maxHealth
icon_state = icon_living
lying = 0
density = 1
density = initial(density)
update_canmove()
..()
@@ -478,3 +482,12 @@
return
else
..()
/mob/living/simple_animal/update_canmove()
if(paralysis || stunned || weakened || stat || resting || buckled)
drop_r_hand()
drop_l_hand()
canmove = 0
else
canmove = 1
return canmove
@@ -7,7 +7,7 @@
var/list/choices = list()
for(var/mob/living/C in view(1,src))
if(C!=src && !isslime(C) && Adjacent(C))
if(C!=src && Adjacent(C))
choices += C
var/mob/living/M = input(src,"Who do you wish to feed on?") in null|choices
@@ -24,6 +24,10 @@
Feedstop()
return 0
if(isslime(M))
src << "<i>I can't latch onto another slime...</i>"
return 0
if(docile)
src << "<i>I'm not hungry anymore...</i>"
return 0
@@ -164,6 +164,10 @@
stat(null,"Power Level: [powerlevel]")
/mob/living/simple_animal/slime/adjustFireLoss(amount)
..(-abs(amount)) // Heals them
return
/mob/living/simple_animal/slime/bullet_act(var/obj/item/projectile/Proj)
if(!Proj)
return
@@ -1,4 +0,0 @@
//no special icon processing
/mob/living/simple_animal/slime/update_transform() //They're slimes, they don't lie down.
return
+1 -1
View File
@@ -771,7 +771,7 @@ var/list/slot_equipment_priority = list( \
//Updates canmove, lying and icons. Could perhaps do with a rename but I can't think of anything to describe it.
//Robots and brains have their own version so don't worry about them
//Robots, animals and brains have their own version so don't worry about them
/mob/proc/update_canmove()
var/ko = weakened || paralysis || stat || (status_flags & FAKEDEATH)
var/buckle_lying = !(buckled && !buckled.buckle_lying)