mirror of
https://github.com/ParadiseSS13/Paradise.git
synced 2026-07-20 19:44:09 +01:00
Fixed a bunch of bugs regarding Metroid AI and viruses.
git-svn-id: http://tgstation13.googlecode.com/svn/trunk@1831 316c924e-a436-60f5-8080-3fe189b3f50e
This commit is contained in:
@@ -176,8 +176,7 @@ datum
|
||||
if(self.data&&method == INGEST)
|
||||
for(var/datum/disease/D in M.viruses)
|
||||
if(D.type == self.data)
|
||||
D.stage--
|
||||
if(D.stage <= 0) D.cure()
|
||||
D.cure()
|
||||
|
||||
M.resistances += self.data
|
||||
return
|
||||
|
||||
@@ -1,8 +1,10 @@
|
||||
#define NON_CONTAGIOUS -1
|
||||
#define SPECIAL 0
|
||||
#define CONTACT_GENERAL 1
|
||||
#define CONTACT_HANDS 2
|
||||
#define CONTACT_FEET 3
|
||||
#define AIRBORNE 4
|
||||
#define BLOOD 5
|
||||
|
||||
/*
|
||||
|
||||
|
||||
@@ -216,7 +216,7 @@
|
||||
|
||||
var/power = src.force
|
||||
if(!istype(M, /mob/living/carbon/human))
|
||||
if(istype(src, /mob/living/carbon/metroid))
|
||||
if(istype(M, /mob/living/carbon/metroid))
|
||||
var/mob/living/carbon/metroid/Metroid = M
|
||||
if(prob(25))
|
||||
user << "\red [src] passes right through [M]!"
|
||||
@@ -225,16 +225,13 @@
|
||||
if(power > 0)
|
||||
Metroid.attacked += 10
|
||||
|
||||
|
||||
for(var/mob/O in viewers(messagesource, null))
|
||||
O.show_message(text("\red <B>[] has been attacked with [][] </B>", M, src, (user ? text(" by [].", user) : ".")), 1)
|
||||
|
||||
|
||||
if(power >= 3)
|
||||
var/mob/living/carbon/metroid/Metroid = M
|
||||
if (istype(M))
|
||||
if(power >= 3)
|
||||
if(istype(Metroid, /mob/living/carbon/metroid/adult))
|
||||
if(prob(5 + round(power/2)))
|
||||
|
||||
if(Metroid.Victim)
|
||||
if(prob(80) && !Metroid.client)
|
||||
Metroid.Discipline++
|
||||
Metroid.Victim = null
|
||||
Metroid.anchored = 0
|
||||
|
||||
@@ -251,14 +248,17 @@
|
||||
|
||||
else
|
||||
if(prob(10 + power*2))
|
||||
|
||||
if(Metroid.Victim)
|
||||
if(prob(80) && !Metroid.client)
|
||||
Metroid.Discipline++
|
||||
|
||||
if(Metroid.Discipline == 1)
|
||||
Metroid.attacked = 0
|
||||
|
||||
Metroid.Victim = null
|
||||
Metroid.anchored = 0
|
||||
|
||||
if(prob(80) && !Metroid.client)
|
||||
Metroid.Discipline++
|
||||
|
||||
if(Metroid.Discipline == 1)
|
||||
Metroid.attacked = 0
|
||||
|
||||
spawn(0)
|
||||
step_away(Metroid, user)
|
||||
@@ -269,6 +269,10 @@
|
||||
Metroid.canmove = 1
|
||||
|
||||
|
||||
for(var/mob/O in viewers(messagesource, null))
|
||||
O.show_message(text("\red <B>[] has been attacked with [][] </B>", M, src, (user ? text(" by [].", user) : ".")), 1)
|
||||
|
||||
|
||||
|
||||
if (istype(M, /mob/living/carbon/human))
|
||||
var/mob/living/carbon/human/H = M
|
||||
|
||||
@@ -70,7 +70,9 @@
|
||||
|
||||
// DO AI STUFF HERE
|
||||
|
||||
|
||||
if(Target)
|
||||
if(attacked <= 0)
|
||||
Target = null
|
||||
|
||||
if(Victim) return // if it's eating someone already, continue eating!
|
||||
|
||||
@@ -145,7 +147,7 @@
|
||||
for(var/mob/living/carbon/alien/larva/L in targets)
|
||||
Target = L
|
||||
break
|
||||
if(prob(5))
|
||||
if(prob(5) && !Discipline)
|
||||
for(var/mob/living/carbon/alien/humanoid/H in targets)
|
||||
Target = H
|
||||
break
|
||||
@@ -193,26 +195,13 @@
|
||||
AIprocess() // the master AI process
|
||||
|
||||
AIproc = 1
|
||||
while(AIproc && stat != 2)
|
||||
while(AIproc && stat != 2 && attacked > 0)
|
||||
if(Victim) // can't eat AND have this little process at the same time
|
||||
break
|
||||
|
||||
if(attacked <= 0)
|
||||
break
|
||||
|
||||
if(Charging)
|
||||
step_to(src,Charging)
|
||||
if(Charging == loc)
|
||||
Charging = null
|
||||
sleep(15)
|
||||
|
||||
if(Target in view(1,src))
|
||||
Charging = null
|
||||
if(prob(90)) Feedon(Target)
|
||||
else
|
||||
Target.attack_metroid(src)
|
||||
sleep(5)
|
||||
|
||||
sleep(2)
|
||||
continue
|
||||
|
||||
if(Target.health <= -70 || Target.stat == 2)
|
||||
Target = null
|
||||
@@ -254,14 +243,7 @@
|
||||
|
||||
else
|
||||
if(Target in view(30, src))
|
||||
if(get_dist(Target,src) >= 5 && prob(45))
|
||||
Charging = Target.loc
|
||||
for(var/mob/O in viewers(src, null))
|
||||
O.show_message("<b>The [src.name] lunges swiftly at [Target]!</b>", 1)
|
||||
continue
|
||||
|
||||
else
|
||||
step_to(src, Target)
|
||||
step_to(src, Target)
|
||||
|
||||
else
|
||||
Target = null
|
||||
|
||||
@@ -468,9 +468,14 @@
|
||||
O.show_message("\red [M] manages to wrestle \the [name] off of [Victim]!", 1)
|
||||
playsound(loc, 'thudswoosh.ogg', 50, 1, -1)
|
||||
|
||||
if(prob(50) && !client)
|
||||
if(prob(80) && !client)
|
||||
Discipline++
|
||||
|
||||
if(!istype(src, /mob/living/carbon/metroid/adult))
|
||||
if(Discipline == 1)
|
||||
attacked = 0
|
||||
|
||||
|
||||
Victim = null
|
||||
anchored = 0
|
||||
step_away(src,M)
|
||||
@@ -620,6 +625,9 @@
|
||||
anchored = 0
|
||||
if(prob(80) && !client)
|
||||
Discipline++
|
||||
if(!istype(src, /mob/living/carbon/metroid))
|
||||
if(Discipline == 1)
|
||||
attacked = 0
|
||||
|
||||
spawn(0)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user