TG: Some work on aliens. I'll finish this up soon.

Gave riot shields a 99% chance of blocking pushers from pushing their wielders
(given their wielder is not on the help intent).

Added a projectile reflection mechanic. Ablative Armor will often, when the
groin or torso is struck, deflect projectiles back to the tile they came from
(not back the original shooter). Deflected projectiles aren't 100% accurate, so
ablative armor can result in friendly fire.

Hopefully stopped humans from waking up 1 second after they fall asleep.
Revision: r3286
Author: 	 vageyenaman
This commit is contained in:
Ren Erthilo
2012-04-26 23:27:16 +01:00
parent 471907d21d
commit 925d0fee2f
9 changed files with 42 additions and 4 deletions
@@ -10,6 +10,7 @@
src.verbs -= /mob/living/carbon/alien/humanoid/verb/ActivateHuggers
src.stand_icon = new /icon('alien.dmi', "aliend_s")
src.lying_icon = new /icon('alien.dmi', "aliend_l")
src.resting_icon = new /icon('alien.dmi', "aliend_sleep")
src.icon = src.stand_icon
update_clothing()
src << "\blue Your icons have been generated!"
@@ -9,6 +9,7 @@
src.verbs -= /mob/living/carbon/alien/humanoid/verb/corrode
src.stand_icon = new /icon('alien.dmi', "alienh_s")
src.lying_icon = new /icon('alien.dmi', "alienh_l")
src.resting_icon = new /icon('alien.dmi', "alienh_sleep")
src.icon = src.stand_icon
update_clothing()
src << "\blue Your icons have been generated!"
@@ -9,6 +9,7 @@
src.verbs += /mob/living/carbon/alien/humanoid/proc/corrode_target
src.stand_icon = new /icon('alien.dmi', "aliens_s")
src.lying_icon = new /icon('alien.dmi', "aliens_l")
src.resting_icon = new /icon('alien.dmi', "aliens_sleep")
src.icon = src.stand_icon
update_clothing()
src << "\blue Your icons have been generated!"
@@ -10,6 +10,7 @@
if(!istype(src, /mob/living/carbon/alien/humanoid/queen))
stand_icon = new /icon('alien.dmi', "alien_s")
lying_icon = new /icon('alien.dmi', "alien_l")
resting_icon = new /icon('alien.dmi', "alienh_sleep")
icon = stand_icon
update_clothing()
src << "\blue Your icons have been generated!"
@@ -330,7 +331,10 @@
if (lying)
if(update_icon)
icon = lying_icon
if(!resting)
icon = lying_icon
else
icon = resting_icon
overlays += body_lying
@@ -9,6 +9,31 @@ emp_act
*/
/mob/living/carbon/human/bullet_act(var/obj/item/projectile/P, var/def_zone)
if(wear_suit && istype(wear_suit, /obj/item/clothing/suit/armor/laserproof))
if(istype(P, /obj/item/projectile/energy) || istype(P, /obj/item/projectile/beam))
var/reflectchance = 40 - round(P.damage/3)
if(!(def_zone in list("chest", "groin")))
reflectchance /= 2
if(prob(reflectchance))
visible_message("\red <B>The [P.name] gets reflected by [src]'s [wear_suit.name]!</B>")
// Find a turf near or on the original location to bounce to
if(P.starting)
var/new_x = P.starting.x + pick(0, 0, 0, 0, 0, -1, 1, -2, 2)
var/new_y = P.starting.y + pick(0, 0, 0, 0, 0, -1, 1, -2, 2)
var/turf/curloc = get_turf(src)
// redirect the projectile
P.original = locate(new_x, new_y, P.z)
P.starting = curloc
P.current = curloc
P.firer = src
P.yo = new_y - curloc.y
P.xo = new_x - curloc.x
return -1 // complete projectile permutation
if(check_shields(P.damage, "the [P.name]"))
P.on_hit(src, 2)
return 2
@@ -96,14 +121,17 @@ emp_act
var/datum/organ/external/affecting = get_organ(ran_zone(user.zone_sel.selecting))
var/hit_area = affecting.display_name
if((user != src) && check_shields(I.force, "the [I.name]"))
return 0
if(!affecting.destroyed)
visible_message("\red <B>[src] has been attacked in the [hit_area] with [I.name] by [user]!</B>")
else
user << "What [affecting]?"
return
if((user != src) && check_shields(I.force, "the [I.name]"))
return 0
var/armor = run_armor_check(affecting, "melee", "Your armor has protected you from a hit to the [hit_area].", "Your armor has softened hit to your [hit_area].")
if(armor >= 2) return 0
if(!I.force) return 0
+1
View File
@@ -189,6 +189,7 @@
in_chamber.original = targloc
in_chamber.loc = get_turf(user)
in_chamber.starting = get_turf(user)
user.next_move = world.time + 4
in_chamber.silenced = silenced
in_chamber.current = curloc
+2 -1
View File
@@ -27,7 +27,8 @@
yo = null
xo = null
current = null
turf/original = null
turf/original = null // the original turf clicked
turf/starting = null // the projectile's starting turf
p_x = 16
p_y = 16 // the pixel location of the tile that the player clicked. Default is the center