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

View File

@@ -38,8 +38,8 @@
density = 1 density = 1
opacity = 1 opacity = 1
anchored = 1 anchored = 1
//Alien can now normally destroy resin walls so they are no longer targetable with acid.
var/health = 50 var/health = 50
var/affecting = null
/obj/alien/weeds /obj/alien/weeds
name = "weeds" name = "weeds"

View File

@@ -12,7 +12,16 @@
src.icon_state = "egg_hatched" src.icon_state = "egg_hatched"
new /obj/alien/facehugger(src.loc) 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) /obj/alien/egg/attackby(var/obj/item/weapon/W, var/mob/user)
if(health <= 0) if(health <= 0)

View File

@@ -86,12 +86,15 @@
..() ..()
bullet_act(flag, A as obj) bullet_act(flag, A as obj)
if (flag == PROJECTILE_BULLET) switch(flag)
src.health -= 20 if (PROJECTILE_BULLET)
else if (flag == PROJECTILE_WEAKBULLET) src.health -= 20
src.health -= 4 if (PROJECTILE_WEAKBULLET)
else if (flag == PROJECTILE_LASER) src.health -= 4
src.health -= 10 if (PROJECTILE_LASER)
src.health -= 10
if (PROJECTILE_PULSE)
src.health -= 35
healthcheck() healthcheck()
ex_act(severity) ex_act(severity)

View File

@@ -21,26 +21,49 @@
del(src) 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) /obj/alien/resin/bullet_act(flag)
if (flag == PROJECTILE_BULLET) switch(flag)
health -= 35 if (PROJECTILE_BULLET)
if(health <=0) health -= 35
src.density = 0 if (PROJECTILE_PULSE)
del(src) health -= 50
if (PROJECTILE_LASER)
health -= 10
healthcheck()
return return
/obj/alien/resin/ex_act(severity) /obj/alien/resin/ex_act(severity)
switch(severity) switch(severity)
if(1.0) if(1.0)
del(src) health-=50
return healthcheck()
if(2.0) if(2.0)
del(src) health-=50
return healthcheck()
if(3.0) if(3.0)
if (prob(50)) if (prob(50))
del(src) health-=50
return healthcheck()
else
health-=25
healthcheck()
return return
/obj/alien/resin/blob_act() /obj/alien/resin/blob_act()
@@ -50,9 +73,8 @@
/obj/alien/resin/meteorhit() /obj/alien/resin/meteorhit()
//*****RM //*****RM
//world << "glass at [x],[y],[z] Mhit" //world << "glass at [x],[y],[z] Mhit"
src.health = 0 health-=50
src.density = 0 healthcheck()
del(src)
return return
/obj/alien/resin/hitby(AM as mob|obj) /obj/alien/resin/hitby(AM as mob|obj)
@@ -65,11 +87,8 @@
else else
tforce = AM:throwforce tforce = AM:throwforce
playsound(src.loc, 'attackblob.ogg', 100, 1) playsound(src.loc, 'attackblob.ogg', 100, 1)
src.health = max(0, src.health - tforce) src.health = max(0, health - tforce)
if (src.health <= 0) healthcheck()
src.density = 0
del(src)
return
..() ..()
return return
@@ -79,9 +98,8 @@
for(var/mob/O in oviewers()) for(var/mob/O in oviewers())
if ((O.client && !( O.blinded ))) if ((O.client && !( O.blinded )))
O << text("\red [] destroys the resin wall!", usr) O << text("\red [] destroys the resin wall!", usr)
src.health = 0 health-=50
src.density = 0 healthcheck()
del(src)
return return
/obj/alien/resin/attack_paw() /obj/alien/resin/attack_paw()
@@ -90,9 +108,8 @@
for(var/mob/O in oviewers()) for(var/mob/O in oviewers())
if ((O.client && !( O.blinded ))) if ((O.client && !( O.blinded )))
O << text("\red [] destroys the resin wall!", usr) O << text("\red [] destroys the resin wall!", usr)
src.health = 0 health-=50
src.density = 0 healthcheck()
del(src)
return return
/obj/alien/resin/attack_alien() /obj/alien/resin/attack_alien()
@@ -109,13 +126,31 @@
for(var/mob/O in oviewers()) for(var/mob/O in oviewers())
if ((O.client && !( O.blinded ))) if ((O.client && !( O.blinded )))
O << text("\red [] slices the resin wall apart!", usr) O << text("\red [] slices the resin wall apart!", usr)
src.health = 0 healthcheck()
src.density = 0
del(src)
return
return return
/obj/alien/resin/attackby(obj/item/weapon/W as obj, mob/user as mob) /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 var/aforce = W.force
src.health = max(0, src.health - aforce) src.health = max(0, src.health - aforce)
playsound(src.loc, 'attackblob.ogg', 100, 1) playsound(src.loc, 'attackblob.ogg', 100, 1)
@@ -124,4 +159,42 @@
del(src) del(src)
return 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

View File

@@ -22,16 +22,6 @@
spawn( 0 ) spawn( 0 )
if ((!( yes ) || src.now_pushing)) if ((!( yes ) || src.now_pushing))
return return
src.now_pushing = 1
if(ismob(AM))
var/mob/tmob = AM
if(istype(tmob, /mob/living/carbon/human) && tmob.mutations & 32)
if(prob(20))
for(var/mob/M in viewers(src, null))
if(M.client)
M << M << "\red <B>[src] fails to push [tmob]'s fat ass out of the way.</B>"
src.now_pushing = 0
return
src.now_pushing = 0 src.now_pushing = 0
..() ..()
if (!istype(AM, /atom/movable)) if (!istype(AM, /atom/movable))
@@ -50,8 +40,6 @@
return return
return return
//This is fine, maybe refine it a bit so they're faster than humans
/mob/living/carbon/alien/humanoid/movement_delay() /mob/living/carbon/alien/humanoid/movement_delay()
var/tally = 0 var/tally = 0
if (istype(src, /mob/living/carbon/alien/humanoid/queen)) if (istype(src, /mob/living/carbon/alien/humanoid/queen))
@@ -74,18 +62,8 @@
stat(null, "Move Mode: [src.m_intent]") stat(null, "Move Mode: [src.m_intent]")
if (src.client.statpanel == "Status") if (src.client.statpanel == "Status")
if (src.internal)
if (!src.internal.air_contents)
del(src.internal)
else
stat("Internal Atmosphere Info", src.internal.name)
stat("Tank Pressure", src.internal.air_contents.return_pressure())
stat("Distribution Pressure", src.internal.distribute_pressure)
stat(null, "Plasma Stored: [src.toxloss]") stat(null, "Plasma Stored: [src.toxloss]")
//This is okay I guess unless we add alien shields or something. Should be cleaned up a bit.
/mob/living/carbon/alien/humanoid/bullet_act(flag, A as obj) /mob/living/carbon/alien/humanoid/bullet_act(flag, A as obj)
var/shielded = 0 var/shielded = 0
for(var/obj/item/device/shield/S in src) for(var/obj/item/device/shield/S in src)
@@ -117,46 +95,43 @@
safe = G.affecting safe = G.affecting
if (safe) if (safe)
return safe.bullet_act(flag, A) return safe.bullet_act(flag, A)
if (flag == PROJECTILE_BULLET) switch(flag)//Did these people not know that switch is a function that exists? I swear, half of the code ignores switch completely.
var/d = 51 if(PROJECTILE_BULLET)
if (src.stat != 2) var/d = 51
src.bruteloss += d if (src.stat != 2)
src.updatehealth() src.bruteloss += d
if (prob(50)) src.updatehealth()
if(src.weakened <= 5) src.weakened = 5 if (prob(50)&&weakened <= 5)
return src.weakened = 5
else if (flag == PROJECTILE_TASER) if(PROJECTILE_TASER)
if (prob(75) && src.stunned <= 10) if (prob(75) && src.stunned <= 10)
src.stunned = 10 src.stunned = 10
else else
src.weakened = 10 src.weakened = 10
if (src.stuttering < 10) if(PROJECTILE_DART)//Nothing is supposed to happen, just making sure it's listed.
src.stuttering = 10
else if (flag == PROJECTILE_DART)
return
else if(flag == PROJECTILE_LASER)
var/d = 20
// if (!src.eye_blurry) src.eye_blurry = 4 //This stuff makes no sense but lasers need a buff./ It really doesn't make any sense. /N
if (prob(25)) src.stunned++
if (src.stat != 2)
src.bruteloss += d
src.updatehealth()
if (prob(25))
src.stunned = 1
else if(flag == PROJECTILE_PULSE)
var/d = 40
if (src.stat != 2) if(PROJECTILE_LASER)
src.bruteloss += d var/d = 20
// if (!src.eye_blurry) src.eye_blurry = 4 //This stuff makes no sense but lasers need a buff./ It really doesn't make any sense. /N
if (prob(25)) src.stunned++
if (src.stat != 2)
src.bruteloss += d
src.updatehealth()
if (prob(25))
src.stunned = 1
if(PROJECTILE_PULSE)
var/d = 40
if (src.stat != 2)
src.bruteloss += d
src.updatehealth()
if (prob(50))
src.stunned = min(src.stunned, 5)
if(PROJECTILE_BOLT)
src.toxloss += 3
src.radiation += 100
src.updatehealth() src.updatehealth()
if (prob(50)) src.drowsyness += 5
src.stunned = min(src.stunned, 5)
else if(flag == PROJECTILE_BOLT)
src.toxloss += 3
src.radiation += 100
src.updatehealth()
src.stuttering += 5
src.drowsyness += 5
return return
/mob/living/carbon/alien/humanoid/emp_act(severity) /mob/living/carbon/alien/humanoid/emp_act(severity)
@@ -237,18 +212,18 @@
//unequip //unequip
/mob/living/carbon/alien/humanoid/u_equip(obj/item/W as obj) /mob/living/carbon/alien/humanoid/u_equip(obj/item/W as obj)
if (W == src.wear_suit) if (W == wear_suit)
src.wear_suit = null wear_suit = null
else if (W == src.head) else if (W == head)
src.head = null head = null
else if (W == src.r_store) else if (W == r_store)
src.r_store = null r_store = null
else if (W == src.l_store) else if (W == l_store)
src.l_store = null l_store = null
else if (W == src.r_hand) else if (W == r_hand)
src.r_hand = null r_hand = null
else if (W == src.l_hand) else if (W == l_hand)
src.l_hand = null l_hand = null
/mob/living/carbon/alien/humanoid/db_click(text, t1) /mob/living/carbon/alien/humanoid/db_click(text, t1)
var/obj/item/W = src.equipped() var/obj/item/W = src.equipped()
@@ -567,7 +542,7 @@
return return
/mob/living/carbon/alien/humanoid/attack_paw(mob/living/carbon/monkey/M as mob) /mob/living/carbon/alien/humanoid/attack_paw(mob/living/carbon/monkey/M as mob)
if(!(istype(M, /mob/living/carbon/monkey))) return//Fix for aliens receiving double messages when attacking other aliens. if(!ismonkey(M)) return//Fix for aliens receiving double messages when attacking other aliens.
if (!ticker) if (!ticker)
M << "You cannot attack people before the game has started." M << "You cannot attack people before the game has started."
@@ -660,10 +635,10 @@
if ("hurt") if ("hurt")
var/damage = rand(1, 9) var/damage = rand(1, 9)
if (prob(90)) if (prob(90))
if (M.mutations & 8) if (M.mutations & 8)//HULK SMASH
damage += 5 damage += 14
spawn(0) spawn(0)
src.paralysis += 1 src.paralysis += 5
step_away(src,M,15) step_away(src,M,15)
sleep(3) sleep(3)
step_away(src,M,15) step_away(src,M,15)
@@ -671,9 +646,9 @@
for(var/mob/O in viewers(src, null)) for(var/mob/O in viewers(src, null))
if ((O.client && !( O.blinded ))) if ((O.client && !( O.blinded )))
O.show_message(text("\red <B>[] has punched []!</B>", M, src), 1) O.show_message(text("\red <B>[] has punched []!</B>", M, src), 1)
if (damage > 4.9) if (damage > 8)//Regular humans have a very small chance of weakening an alien.
if (src.weakened < 10) if (src.weakened < 10)
src.weakened = rand(10, 15) src.weakened = rand(1,5)
for(var/mob/O in viewers(M, null)) for(var/mob/O in viewers(M, null))
if ((O.client && !( O.blinded ))) if ((O.client && !( O.blinded )))
O.show_message(text("\red <B>[] has weakened []!</B>", M, src), 1, "\red You hear someone fall.", 2) O.show_message(text("\red <B>[] has weakened []!</B>", M, src), 1, "\red You hear someone fall.", 2)
@@ -688,14 +663,14 @@
if ("disarm") if ("disarm")
if (!src.lying) if (!src.lying)
var/randn = rand(1, 100) var/randn = rand(1, 100)
if (randn <= 25) if (randn <= 5)//Very small chance to push an alien down.
src.weakened = 2 src.weakened = 2
playsound(src.loc, 'thudswoosh.ogg', 50, 1, -1) playsound(src.loc, 'thudswoosh.ogg', 50, 1, -1)
for(var/mob/O in viewers(src, null)) for(var/mob/O in viewers(src, null))
if ((O.client && !( O.blinded ))) if ((O.client && !( O.blinded )))
O.show_message(text("\red <B>[] has pushed down []!</B>", M, src), 1) O.show_message(text("\red <B>[] has pushed down []!</B>", M, src), 1)
else else
if (randn <= 60) if (randn <= 50)
src.drop_item() src.drop_item()
playsound(src.loc, 'thudswoosh.ogg', 50, 1, -1) playsound(src.loc, 'thudswoosh.ogg', 50, 1, -1)
for(var/mob/O in viewers(src, null)) for(var/mob/O in viewers(src, null))

View File

@@ -60,7 +60,6 @@
//This is okay I guess unless we add alien shields or something. Should be cleaned up a bit. //This is okay I guess unless we add alien shields or something. Should be cleaned up a bit.
/mob/living/carbon/alien/larva/bullet_act(flag, A as obj) /mob/living/carbon/alien/larva/bullet_act(flag, A as obj)
if (locate(/obj/item/weapon/grab, src)) if (locate(/obj/item/weapon/grab, src))
var/mob/safe = null var/mob/safe = null
if (istype(src.l_hand, /obj/item/weapon/grab)) if (istype(src.l_hand, /obj/item/weapon/grab))
@@ -73,52 +72,53 @@
safe = G.affecting safe = G.affecting
if (safe) if (safe)
return safe.bullet_act(flag, A) return safe.bullet_act(flag, A)
if (flag == PROJECTILE_BULLET) switch(flag)
var/d = 51 if(PROJECTILE_BULLET)
var/d = 51
if (src.stat != 2) if (src.stat != 2)
src.bruteloss += d src.bruteloss += d
src.updatehealth()
if (prob(50))
if(src.weakened <= 5) src.weakened = 5
return
if(PROJECTILE_TASER)
if (prob(75) && src.stunned <= 10)
src.stunned = 10
else
src.weakened = 10
if (src.stuttering < 10)
src.stuttering = 10
if(PROJECTILE_DART)
return
if(PROJECTILE_LASER)
var/d = 20
// if (!src.eye_blurry) src.eye_blurry = 4 //This stuff makes no sense but lasers need a buff./ It really doesn't make any sense. /N
if (prob(25)) src.stunned++
if (src.stat != 2)
src.bruteloss += d
src.updatehealth()
if (prob(25))
src.stunned = 1
if(PROJECTILE_PULSE)
var/d = 40
if (src.stat != 2)
src.bruteloss += d
src.updatehealth()
if (prob(50))
src.stunned = min(src.stunned, 5)
if(PROJECTILE_BOLT)
src.toxloss += 3
src.radiation += 100
src.updatehealth() src.updatehealth()
if (prob(50)) src.stuttering += 5
if(src.weakened <= 5) src.weakened = 5 src.drowsyness += 5
return
else if (flag == PROJECTILE_TASER)
if (prob(75) && src.stunned <= 10)
src.stunned = 10
else
src.weakened = 10
if (src.stuttering < 10)
src.stuttering = 10
else if (flag == PROJECTILE_DART)
return
else if(flag == PROJECTILE_LASER)
var/d = 20
// if (!src.eye_blurry) src.eye_blurry = 4 //This stuff makes no sense but lasers need a buff./ It really doesn't make any sense. /N
if (prob(25)) src.stunned++
if (src.stat != 2)
src.bruteloss += d
src.updatehealth()
if (prob(25))
src.stunned = 1
else if(flag == PROJECTILE_PULSE)
var/d = 40
if (src.stat != 2)
src.bruteloss += d
src.updatehealth()
if (prob(50))
src.stunned = min(src.stunned, 5)
else if(flag == PROJECTILE_BOLT)
src.toxloss += 3
src.radiation += 100
src.updatehealth()
src.stuttering += 5
src.drowsyness += 5
return return
/mob/living/carbon/alien/larva/emp_act(severity) /mob/living/carbon/alien/larva/emp_act(severity)

View File

@@ -218,184 +218,32 @@
var/armored = src.isarmored(affecting) var/armored = src.isarmored(affecting)
if (flag == PROJECTILE_BULLET) switch(flag)
var/d = 51 if(PROJECTILE_BULLET)
if (armored) var/d = 51
if (prob(70)) if (armored)
show_message("\red Your armor absorbs the hit!", 4)
return
else
if (prob(40))
show_message("\red Your armor only softens the hit!", 4)
if (prob(20))
d = d / 2
d = d / 4
/*
else
if (istype(src.wear_suit, /obj/item/clothing/suit/swat_suit))
if (prob(90))
show_message("\red Your armor absorbs the blow!", 4)
return
else
if (prob(90))
show_message("\red Your armor only softens the blow!", 4)
if (prob(60))
d = d / 2
d = d / 5*/
if (istype(src.r_hand, /obj/item/weapon/shield/riot))
if (prob(90))
show_message("\red Your shield absorbs the blow!", 4)
return
else
if (prob(40))
show_message("\red Your shield only softens the blow!", 4)
if (prob(60))
d = d / 2
d = d / 5
else
if (istype(src.l_hand, /obj/item/weapon/shield/riot))
if (prob(90))
show_message("\red Your shield absorbs the blow!", 4)
return
else
if (prob(40))
show_message("\red Your shield only softens the blow!", 4)
if (prob(60))
d = d / 2
d = d / 5
if (src.stat != 2)
affecting.take_damage(d, 0)
src.UpdateDamageIcon()
src.updatehealth()
if (prob(50))
if(src.weakened <= 5) src.weakened = 5
return
else if (flag == PROJECTILE_TASER)
if (armored)
if (prob(5))
show_message("\red Your armor absorbs the hit!", 4)
return
/*else
if (istype(src.wear_suit, /obj/item/clothing/suit/swat_suit))
if (prob(70)) if (prob(70))
show_message("\red Your armor absorbs the hit!", 4) show_message("\red Your armor absorbs the hit!", 4)
return*/
if (prob(75) && src.stunned <= 10)
src.stunned = 10
else
src.weakened = 10
if (src.stuttering < 10)
src.stuttering = 10
else if (flag == PROJECTILE_DART)
if (istype(src.l_hand, /obj/item/weapon/shield/riot)||istype(src.r_hand, /obj/item/weapon/shield/riot))
if (prob(50))
show_message("\red Your shield absorbs the hit!", 4)
else
src.weakened += 5
src.toxloss += 10
else if(flag == PROJECTILE_LASER)
var/d = 20
if (armored)
if (prob(40))
show_message("\red Your armor absorbs the hit!", 4)
return
else
if (prob(40))
show_message("\red Your armor only softens the hit!", 4)
if (prob(20))
d = d / 2
d = d / 2
/*else
if (istype(src.wear_suit, /obj/item/clothing/suit/swat_suit))
if (prob(70))
show_message("\red Your armor absorbs the blow!", 4)
return return
else else
if (prob(40))
show_message("\red Your armor only softens the hit!", 4)
if (prob(20))
d = d / 2
d = d / 4
/*
else
if (istype(src.wear_suit, /obj/item/clothing/suit/swat_suit))
if (prob(90)) if (prob(90))
show_message("\red Your armor only softens the blow!", 4) show_message("\red Your armor absorbs the blow!", 4)
if (prob(60)) return
d = d / 2 else
d = d / 2*/ if (prob(90))
show_message("\red Your armor only softens the blow!", 4)
if (!src.eye_blurry) src.eye_blurry = 4 //This stuff makes no sense but lasers need a buff. if (prob(60))
if (prob(25)) src.stunned++ d = d / 2
d = d / 5*/
if (src.stat != 2) if (istype(src.r_hand, /obj/item/weapon/shield/riot))
affecting.take_damage(0, d)
src.UpdateDamageIcon()
src.updatehealth()
if (prob(25))
src.stunned = 1
else if(flag == PROJECTILE_PULSE)
var/d = 40
if (istype(src.wear_suit, /obj/item/clothing/suit/armor))
if (prob(20))
show_message("\red Your armor absorbs the hit!", 4)
return
else
if (prob(20))
show_message("\red Your armor only softens the hit!", 4)
if (prob(20))
d = d / 2
d = d / 2
/*else
if (istype(src.wear_suit, /obj/item/clothing/suit/swat_suit))
if (prob(50))
show_message("\red Your armor absorbs the blow!", 4)
return
else
if (prob(50))
show_message("\red Your armor only softens the blow!", 4)
if (prob(50))
d = d / 2
d = d / 2*/
if (src.stat != 2)
affecting.take_damage(0, d)
src.UpdateDamageIcon()
src.updatehealth()
if (prob(50))
src.stunned = min(src.stunned, 5)
else if(flag == PROJECTILE_BOLT)
src.toxloss += 3
src.radiation += 100
src.updatehealth()
src.stuttering += 5
src.drowsyness += 5
else if(flag == PROJECTILE_WEAKBULLET)
var/d = 14
if (armored)
if (prob(70))
show_message("\red Your armor absorbs the hit!", 4)
return
else
if (prob(40))
show_message("\red Your armor only softens the hit!", 4)
if (prob(20))
d = d / 2
d = d / 4
/*else
if (istype(src.wear_suit, /obj/item/clothing/suit/swat_suit))
if (prob(90))
show_message("\red Your armor absorbs the blow!", 4)
return
else
if (prob(90))
show_message("\red Your armor only softens the blow!", 4)
if (prob(60))
d = d / 2
d = d / 5*/
if (istype(src.r_hand, /obj/item/weapon/shield/riot))
if (prob(90))
show_message("\red Your shield absorbs the blow!", 4)
return
else
if (prob(40))
show_message("\red Your shield only softens the blow!", 4)
if (prob(60))
d = d / 2
d = d / 5
else
if (istype(src.l_hand, /obj/item/weapon/shield/riot))
if (prob(90)) if (prob(90))
show_message("\red Your shield absorbs the blow!", 4) show_message("\red Your shield absorbs the blow!", 4)
return return
@@ -405,12 +253,165 @@
if (prob(60)) if (prob(60))
d = d / 2 d = d / 2
d = d / 5 d = d / 5
if (src.stat != 2) else
affecting.take_damage(d, 0) if (istype(src.l_hand, /obj/item/weapon/shield/riot))
src.UpdateDamageIcon() if (prob(90))
show_message("\red Your shield absorbs the blow!", 4)
return
else
if (prob(40))
show_message("\red Your shield only softens the blow!", 4)
if (prob(60))
d = d / 2
d = d / 5
if (src.stat != 2)
affecting.take_damage(d, 0)
src.UpdateDamageIcon()
src.updatehealth()
if (prob(50))
if(src.weakened <= 5) src.weakened = 5
return
if(PROJECTILE_TASER)
if (armored)
if (prob(5))
show_message("\red Your armor absorbs the hit!", 4)
return
/*else
if (istype(src.wear_suit, /obj/item/clothing/suit/swat_suit))
if (prob(70))
show_message("\red Your armor absorbs the hit!", 4)
return*/
if (prob(75) && src.stunned <= 10)
src.stunned = 10
else
src.weakened = 10
if (src.stuttering < 10)
src.stuttering = 10
if(PROJECTILE_DART)
if (istype(src.l_hand, /obj/item/weapon/shield/riot)||istype(src.r_hand, /obj/item/weapon/shield/riot))
if (prob(50))
show_message("\red Your shield absorbs the hit!", 4)
else
src.weakened += 5
src.toxloss += 10
if(PROJECTILE_LASER)
var/d = 20
if (armored)
if (prob(40))
show_message("\red Your armor absorbs the hit!", 4)
return
else
if (prob(40))
show_message("\red Your armor only softens the hit!", 4)
if (prob(20))
d = d / 2
d = d / 2
/*else
if (istype(src.wear_suit, /obj/item/clothing/suit/swat_suit))
if (prob(70))
show_message("\red Your armor absorbs the blow!", 4)
return
else
if (prob(90))
show_message("\red Your armor only softens the blow!", 4)
if (prob(60))
d = d / 2
d = d / 2*/
if (!src.eye_blurry) src.eye_blurry = 4 //This stuff makes no sense but lasers need a buff.
if (prob(25)) src.stunned++
if (src.stat != 2)
affecting.take_damage(0, d)
src.UpdateDamageIcon()
src.updatehealth()
if (prob(25))
src.stunned = 1
if(PROJECTILE_PULSE)
var/d = 40
if (istype(src.wear_suit, /obj/item/clothing/suit/armor))
if (prob(20))
show_message("\red Your armor absorbs the hit!", 4)
return
else
if (prob(20))
show_message("\red Your armor only softens the hit!", 4)
if (prob(20))
d = d / 2
d = d / 2
/*else
if (istype(src.wear_suit, /obj/item/clothing/suit/swat_suit))
if (prob(50))
show_message("\red Your armor absorbs the blow!", 4)
return
else
if (prob(50))
show_message("\red Your armor only softens the blow!", 4)
if (prob(50))
d = d / 2
d = d / 2*/
if (src.stat != 2)
affecting.take_damage(0, d)
src.UpdateDamageIcon()
src.updatehealth()
if (prob(50))
src.stunned = min(src.stunned, 5)
if(PROJECTILE_BOLT)
src.toxloss += 3
src.radiation += 100
src.updatehealth() src.updatehealth()
if(src.weakened <= 5) src.weakened = 5 src.stuttering += 5
return src.drowsyness += 5
if(PROJECTILE_WEAKBULLET)
var/d = 14
if (armored)
if (prob(70))
show_message("\red Your armor absorbs the hit!", 4)
return
else
if (prob(40))
show_message("\red Your armor only softens the hit!", 4)
if (prob(20))
d = d / 2
d = d / 4
/*else
if (istype(src.wear_suit, /obj/item/clothing/suit/swat_suit))
if (prob(90))
show_message("\red Your armor absorbs the blow!", 4)
return
else
if (prob(90))
show_message("\red Your armor only softens the blow!", 4)
if (prob(60))
d = d / 2
d = d / 5*/
if (istype(src.r_hand, /obj/item/weapon/shield/riot))
if (prob(90))
show_message("\red Your shield absorbs the blow!", 4)
return
else
if (prob(40))
show_message("\red Your shield only softens the blow!", 4)
if (prob(60))
d = d / 2
d = d / 5
else
if (istype(src.l_hand, /obj/item/weapon/shield/riot))
if (prob(90))
show_message("\red Your shield absorbs the blow!", 4)
return
else
if (prob(40))
show_message("\red Your shield only softens the blow!", 4)
if (prob(60))
d = d / 2
d = d / 5
if (src.stat != 2)
affecting.take_damage(d, 0)
src.UpdateDamageIcon()
src.updatehealth()
if(src.weakened <= 5) src.weakened = 5
return
return return
/mob/living/carbon/human/emp_act(severity) /mob/living/carbon/human/emp_act(severity)

View File

@@ -8,67 +8,68 @@
/mob/living/bullet_act(flag) /mob/living/bullet_act(flag)
if (flag == PROJECTILE_BULLET) switch(flag)
if (istype(src, /mob/living/carbon/human)) if(PROJECTILE_BULLET)
var/mob/living/carbon/human/H = src if (istype(src, /mob/living/carbon/human))
var/dam_zone = pick("chest", "chest", "chest", "groin", "head") var/mob/living/carbon/human/H = src
if (H.organs[text("[]", dam_zone)]) var/dam_zone = pick("chest", "chest", "chest", "groin", "head")
var/datum/organ/external/affecting = H.organs[text("[]", dam_zone)] if (H.organs[text("[]", dam_zone)])
if (affecting.take_damage(51, 0)) var/datum/organ/external/affecting = H.organs[text("[]", dam_zone)]
H.UpdateDamageIcon() if (affecting.take_damage(51, 0))
else H.UpdateDamageIcon()
H.UpdateDamage() else
else H.UpdateDamage()
src.take_organ_damage(51) else
src.updatehealth() src.take_organ_damage(51)
if (prob(80) && src.weakened <= 2) src.updatehealth()
src.weakened = 2 if (prob(80) && src.weakened <= 2)
else if (flag == PROJECTILE_TASER) src.weakened = 2
if (prob(75) && src.stunned <= 10) if(PROJECTILE_TASER)
src.stunned = 10 if (prob(75) && src.stunned <= 10)
else src.stunned = 10
src.weakened = 10 else
else if (flag == PROJECTILE_DART) src.weakened = 10
src.weakened += 5 if(PROJECTILE_DART)
src.toxloss += 10 src.weakened += 5
else if(flag == PROJECTILE_LASER) src.toxloss += 10
if (istype(src, /mob/living/carbon/human)) if(PROJECTILE_LASER)
var/mob/living/carbon/human/H = src if (istype(src, /mob/living/carbon/human))
var/dam_zone = pick("chest", "chest", "chest", "groin", "head") var/mob/living/carbon/human/H = src
if (H.organs[text("[]", dam_zone)]) var/dam_zone = pick("chest", "chest", "chest", "groin", "head")
var/datum/organ/external/affecting = H.organs[text("[]", dam_zone)] if (H.organs[text("[]", dam_zone)])
if (affecting.take_damage(20, 0)) var/datum/organ/external/affecting = H.organs[text("[]", dam_zone)]
H.UpdateDamageIcon() if (affecting.take_damage(20, 0))
else H.UpdateDamageIcon()
H.UpdateDamage() else
src.updatehealth() H.UpdateDamage()
else src.updatehealth()
src.take_organ_damage(20) else
if (prob(25) && src.stunned <= 2) src.take_organ_damage(20)
src.stunned = 2 if (prob(25) && src.stunned <= 2)
else if(flag == PROJECTILE_PULSE) src.stunned = 2
if (istype(src, /mob/living/carbon/human)) if(PROJECTILE_PULSE)
var/mob/living/carbon/human/H = src if (istype(src, /mob/living/carbon/human))
var/dam_zone = pick("chest", "chest", "chest", "groin", "head") var/mob/living/carbon/human/H = src
if (H.organs[text("[]", dam_zone)]) var/dam_zone = pick("chest", "chest", "chest", "groin", "head")
var/datum/organ/external/affecting = H.organs[text("[]", dam_zone)] if (H.organs[text("[]", dam_zone)])
if (affecting.take_damage(40, 0)) var/datum/organ/external/affecting = H.organs[text("[]", dam_zone)]
H.UpdateDamageIcon() if (affecting.take_damage(40, 0))
else H.UpdateDamageIcon()
H.UpdateDamage() else
src.updatehealth() H.UpdateDamage()
else src.updatehealth()
src.take_organ_damage(40) else
if (prob(50)) src.take_organ_damage(40)
src.stunned = min(src.stunned, 5) if (prob(50))
else if(flag == PROJECTILE_BOLT) src.stunned = min(src.stunned, 5)
src.toxloss += 3 if(PROJECTILE_BOLT)
src.radiation += 100 src.toxloss += 3
src.updatehealth() src.radiation += 100
src.stuttering += 5 src.updatehealth()
src.drowsyness += 5 src.stuttering += 5
if (prob(10)) src.drowsyness += 5
src.weakened = min(src.weakened, 2) if (prob(10))
src.weakened = min(src.weakened, 2)
return return

View File

@@ -236,65 +236,67 @@
return return
/mob/living/silicon/robot/bullet_act(flag) /mob/living/silicon/robot/bullet_act(flag)
if (flag == PROJECTILE_BULLET) switch(flag)
if (src.stat != 2) if(PROJECTILE_BULLET)
src.bruteloss += 60 if (src.stat != 2)
src.updatehealth() src.bruteloss += 60
return src.updatehealth()
/* return
else if (flag == PROJECTILE_MEDBULLET) /*
if (src.stat != 2) if(PROJECTILE_MEDBULLET)
src.bruteloss += 30 if (src.stat != 2)
src.updatehealth() src.bruteloss += 30
*/ src.updatehealth()
else if (flag == PROJECTILE_WEAKBULLET) */
if (src.stat != 2) if(PROJECTILE_WEAKBULLET)
src.bruteloss += 15 if (src.stat != 2)
src.updatehealth() src.bruteloss += 15
return src.updatehealth()
/* return
else if (flag == PROJECTILE_MPBULLET) /*
if (src.stat != 2) if(PROJECTILE_MPBULLET)
src.bruteloss += 20 if (src.stat != 2)
src.updatehealth() src.bruteloss += 20
src.updatehealth()
else if (flag == PROJECTILE_SLUG) if(PROJECTILE_SLUG)
if (src.stat != 2) if (src.stat != 2)
src.bruteloss += 40 src.bruteloss += 40
src.updatehealth() src.updatehealth()
else if (flag == PROJECTILE_BAG) if(PROJECTILE_BAG)
if (src.stat != 2) if (src.stat != 2)
src.bruteloss += 2 src.bruteloss += 2
src.updatehealth() src.updatehealth()
*/ */
else if (flag == PROJECTILE_TASER) if(PROJECTILE_TASER)
if (src.stat != 2) if (src.stat != 2)
src.fireloss += rand(0,10) src.fireloss += rand(0,10)
src.stunned += rand(0,3) src.stunned += rand(0,3)
return return
else if (flag == PROJECTILE_DART) if(PROJECTILE_DART)
if (src.stat != 2) if (src.stat != 2)
src.stunned += 5 src.stunned += 5
src.fireloss += 10 src.fireloss += 10
src.updatehealth() src.updatehealth()
return return
/* /*
else if (flag == PROJECTILE_WAVE) if(PROJECTILE_WAVE)
if (src.stat != 2) if (src.stat != 2)
src.bruteloss += 25 src.bruteloss += 25
src.updatehealth() src.updatehealth()
return return
*/ */
else if(flag == PROJECTILE_LASER) if(PROJECTILE_LASER)
if (src.stat != 2) if (src.stat != 2)
src.bruteloss += 20 src.bruteloss += 20
src.updatehealth() src.updatehealth()
else if(flag == PROJECTILE_PULSE) if(PROJECTILE_PULSE)
if (src.stat != 2) if (src.stat != 2)
src.bruteloss += 40 src.bruteloss += 40
src.updatehealth() src.updatehealth()
spark_system.start()
return return
@@ -495,6 +497,7 @@
else else
user << "You fail to [ locked ? "unlock" : "lock"] [src]'s interface." user << "You fail to [ locked ? "unlock" : "lock"] [src]'s interface."
else else
spark_system.start()
return ..() return ..()
/mob/living/silicon/robot/attack_alien(mob/living/carbon/alien/humanoid/M as mob) /mob/living/silicon/robot/attack_alien(mob/living/carbon/alien/humanoid/M as mob)