Cleaned up a few lines of unnecessary alien code.

Cleaned up mob projectile code a bit so it uses switch.
It's now much harder to play punch-out with a xeno, unless you're the hulk.
Xenos can now stick humans and monkeys into resin walls. Inside a resin wall, the person cannot escape unless the wall is destroyed (there is a 5% they will crawl out on their own). They are also paralyzed and cannot suicide.
Robots will now spark when you clobber or shoot them.

git-svn-id: http://tgstation13.googlecode.com/svn/trunk@1467 316c924e-a436-60f5-8080-3fe189b3f50e
This commit is contained in:
noisomehollow@lycos.com
2011-04-17 23:27:28 +00:00
parent b7db69b6f8
commit a95f87d6bc
9 changed files with 522 additions and 457 deletions
+1 -1
View File
@@ -38,8 +38,8 @@
density = 1
opacity = 1
anchored = 1
//Alien can now normally destroy resin walls so they are no longer targetable with acid.
var/health = 50
var/affecting = null
/obj/alien/weeds
name = "weeds"
+10 -1
View File
@@ -12,7 +12,16 @@
src.icon_state = "egg_hatched"
new /obj/alien/facehugger(src.loc)
/obj/alien/egg/bullet_act(flag)
switch(flag)
if (PROJECTILE_BULLET)
health -= 35
if (PROJECTILE_PULSE)
health -= 50
if (PROJECTILE_LASER)
health -= 10
healthcheck()
return
/obj/alien/egg/attackby(var/obj/item/weapon/W, var/mob/user)
if(health <= 0)
+9 -6
View File
@@ -86,12 +86,15 @@
..()
bullet_act(flag, A as obj)
if (flag == PROJECTILE_BULLET)
src.health -= 20
else if (flag == PROJECTILE_WEAKBULLET)
src.health -= 4
else if (flag == PROJECTILE_LASER)
src.health -= 10
switch(flag)
if (PROJECTILE_BULLET)
src.health -= 20
if (PROJECTILE_WEAKBULLET)
src.health -= 4
if (PROJECTILE_LASER)
src.health -= 10
if (PROJECTILE_PULSE)
src.health -= 35
healthcheck()
ex_act(severity)
+103 -30
View File
@@ -21,26 +21,49 @@
del(src)
*/
/obj/alien/resin/proc/healthcheck()
if(health <=0)
src.density = 0
if(affecting)
var/mob/living/carbon/M = affecting
contents.Remove(affecting)
if(ishuman(M))
M.verbs += /mob/living/carbon/human/verb/suicide
else
M.verbs += /mob/living/carbon/monkey/verb/suicide
M.loc = src.loc
M.paralysis += 10
for(var/mob/O in viewers(src, 3))
O.show_message(text("A body appeared from the dead resin!"), 1, text("You hear faint moaning somewhere about you."), 2)
del(src)
return
/obj/alien/resin/bullet_act(flag)
if (flag == PROJECTILE_BULLET)
health -= 35
if(health <=0)
src.density = 0
del(src)
switch(flag)
if (PROJECTILE_BULLET)
health -= 35
if (PROJECTILE_PULSE)
health -= 50
if (PROJECTILE_LASER)
health -= 10
healthcheck()
return
/obj/alien/resin/ex_act(severity)
switch(severity)
if(1.0)
del(src)
return
health-=50
healthcheck()
if(2.0)
del(src)
return
health-=50
healthcheck()
if(3.0)
if (prob(50))
del(src)
return
health-=50
healthcheck()
else
health-=25
healthcheck()
return
/obj/alien/resin/blob_act()
@@ -50,9 +73,8 @@
/obj/alien/resin/meteorhit()
//*****RM
//world << "glass at [x],[y],[z] Mhit"
src.health = 0
src.density = 0
del(src)
health-=50
healthcheck()
return
/obj/alien/resin/hitby(AM as mob|obj)
@@ -65,11 +87,8 @@
else
tforce = AM:throwforce
playsound(src.loc, 'attackblob.ogg', 100, 1)
src.health = max(0, src.health - tforce)
if (src.health <= 0)
src.density = 0
del(src)
return
src.health = max(0, health - tforce)
healthcheck()
..()
return
@@ -79,9 +98,8 @@
for(var/mob/O in oviewers())
if ((O.client && !( O.blinded )))
O << text("\red [] destroys the resin wall!", usr)
src.health = 0
src.density = 0
del(src)
health-=50
healthcheck()
return
/obj/alien/resin/attack_paw()
@@ -90,9 +108,8 @@
for(var/mob/O in oviewers())
if ((O.client && !( O.blinded )))
O << text("\red [] destroys the resin wall!", usr)
src.health = 0
src.density = 0
del(src)
health-=50
healthcheck()
return
/obj/alien/resin/attack_alien()
@@ -109,13 +126,31 @@
for(var/mob/O in oviewers())
if ((O.client && !( O.blinded )))
O << text("\red [] slices the resin wall apart!", usr)
src.health = 0
src.density = 0
del(src)
return
healthcheck()
return
/obj/alien/resin/attackby(obj/item/weapon/W as obj, mob/user as mob)
if (istype(W, /obj/item/weapon/grab) && get_dist(src,user)<2)
var/obj/item/weapon/grab/G = W
if(isalien(user)&&(ishuman(G.affecting)||ismonkey(G.affecting)))
//Only aliens can stick humans and monkeys into resin walls. Also, the wall must not have a person inside already.
if(!affecting)
if(G.state<2)
user << "\red You need a better grip to do that!"
return
G.affecting.loc = src.loc
G.affecting.paralysis = 10
for(var/mob/O in viewers(world.view, src))
if (O.client)
O << text("\green [] places [] in the resin wall!", G.assailant, G.affecting)
affecting=G.affecting
del(W)
spawn(0)
process()
else
user << "\red This wall is already occupied."
return
var/aforce = W.force
src.health = max(0, src.health - aforce)
playsound(src.loc, 'attackblob.ogg', 100, 1)
@@ -124,4 +159,42 @@
del(src)
return
..()
return
return
/obj/alien/resin/proc/process()
if(affecting)
var/mob/living/carbon/M = affecting
var/check = 0
if(ishuman(affecting))//So they do not suicide and kill the babby.
M.verbs -= /mob/living/carbon/human/verb/suicide
else
check = 1
M.verbs -= /mob/living/carbon/monkey/verb/suicide
contents.Add(affecting)
while(!isnull(M)&&!isnull(src))//While M and wall exist
if(prob(30))//Let's people know that someone is trapped in the resin wall.
M << "\green You feel a strange sense of calm as a flesh-like substance seems to completely envelop you."
for(var/mob/O in viewers(src, 3))
O.show_message(text("There appears to be a person stuck inside a resin wall nearby."), 1, text("You hear faint moaning somewhere about you."), 2)
if(prob(5))//MAYBE they are able to crawl out on their own. Not likely...
M << "You are able to crawl your way through the sticky mass, and out to freedom. But for how long?"
break
M.paralysis = 10//Set theis paralysis to 10 so they cannot act.
sleep(50)//To cut down on processing time
if(!isnull(src))
affecting = null
if(!isnull(M))//As long as they still exist.
if(!check)//And now they can suicide again, even if they are already dead in case they get revived.
M.verbs += /mob/living/carbon/human/verb/suicide
else
M.verbs += /mob/living/carbon/monkey/verb/suicide
for(var/mob/O in viewers(src, 3))
O.show_message(text("A body appeared from the dead resin!"), 1, text("You hear faint moaning somewhere about you."), 2)
else
for(var/mob/O in viewers(src, 3))
O.show_message(text("\red An alien larva bursts from the resin wall!"), 1, text("\red You hear a high, alien screech nearby!"), 2)
return