Updated space carp, walking mushrooms and killer tomatos to use simple_animal instead of critter code.

Notify me if any issues with them, or any simple_animal arise.

Fixed a few issues with space bears.

Slightly improved teleporter code, and did a few misc runtime fixes.

git-svn-id: http://tgstation13.googlecode.com/svn/trunk@4258 316c924e-a436-60f5-8080-3fe189b3f50e
This commit is contained in:
petethegoat@gmail.com
2012-07-31 21:22:42 +00:00
parent 99354f8c71
commit f295c3ab33
26 changed files with 186 additions and 406 deletions
+8 -6
View File
@@ -457,11 +457,12 @@
for(var/mob/living/carbon/M in D.loc)
if(!istype(M,/mob/living/carbon)) continue
if(M == user) continue
//Syring gune attack logging by Yvarov
//Syringe gun attack logging by Yvarov
var/R
for(var/datum/reagent/A in D.reagents.reagent_list)
R += A.id + " ("
R += num2text(A.volume) + "),"
if(D.reagents)
for(var/datum/reagent/A in D.reagents.reagent_list)
R += A.id + " ("
R += num2text(A.volume) + "),"
if (istype(M, /mob))
M.attack_log += "\[[time_stamp()]\] <b>[user]/[user.ckey]</b> shot <b>[M]/[M.ckey]</b> with a <b>syringegun</b> ([R])"
user.attack_log += "\[[time_stamp()]\] <b>[user]/[user.ckey]</b> shot <b>[M]/[M.ckey]</b> with a <b>syringegun</b> ([R])"
@@ -469,10 +470,11 @@
else
M.attack_log += "\[[time_stamp()]\] <b>UNKNOWN SUBJECT (No longer exists)</b> shot <b>[M]/[M.ckey]</b> with a <b>syringegun</b> ([R])"
log_attack("<font color='red'>UNKNOWN shot [M] ([M.ckey]) with a <b>syringegun</b> ([R])</font>")
D.reagents.trans_to(M, 15)
if(D.reagents)
D.reagents.trans_to(M, 15)
M.take_organ_damage(5)
for(var/mob/O in viewers(world.view, D))
O.show_message(text("\red [] is hit by the syringe!", M.name), 1)
O.show_message("\red [M.name] is hit by the syringe!", 1)
del(D)
if(D)
-134
View File
@@ -40,41 +40,6 @@
..()
del(src)
/obj/effect/critter/killertomato
name = "killer tomato"
desc = "Oh shit, you're really fucked now."
icon_state = "killertomato"
health = 15
max_health = 15
aggressive = 1
defensive = 0
wanderer = 1
atkcarbon = 1
atksilicon = 1
firevuln = 2
brutevuln = 2
Harvest(var/obj/item/weapon/W, var/mob/living/user)
if(..())
var/success = 0
if(istype(W, /obj/item/weapon/butch))
new /obj/item/weapon/reagent_containers/food/snacks/tomatomeat(src)
success = 1
if(istype(W, /obj/item/weapon/kitchenknife))
new /obj/item/weapon/reagent_containers/food/snacks/tomatomeat(src)
new /obj/item/weapon/reagent_containers/food/snacks/tomatomeat(src)
success = 1
if(success)
for(var/mob/O in viewers(src, null))
O.show_message("\red [user.name] cuts apart the [src.name]!", 1)
del(src)
return 1
return 0
/obj/effect/critter/spore
name = "plasma spore"
desc = "A barely intelligent colony of organisms. Very volatile."
@@ -147,105 +112,6 @@
/obj/effect/critter/spesscarp
name = "Spess Carp"
desc = "A ferocious, fang-bearing creature that resembles a fish."
icon_state = "spesscarp"
health = 25
max_health = 25
aggressive = 1
defensive = 1
wanderer = 1
atkcarbon = 1
atksilicon = 1
atkcritter = 1
atkmech = 1
firevuln = 2
brutevuln = 1
melee_damage_lower = 5
melee_damage_upper = 15
angertext = "lunges"
attacktext = "bites"
attack_sound = 'bite.ogg'
attack_speed = 10
var/stunchance = 10 // chance to tackle things down
Harvest(var/obj/item/weapon/W, var/mob/living/user)
if(..())
var/success = 0
if(istype(W, /obj/item/weapon/butch))
new/obj/item/weapon/reagent_containers/food/snacks/carpmeat(src.loc)
new/obj/item/weapon/reagent_containers/food/snacks/carpmeat(src.loc)
success = 1
if(istype(W, /obj/item/weapon/kitchenknife))
new/obj/item/weapon/reagent_containers/food/snacks/carpmeat(src.loc)
success = 1
if(success)
for(var/mob/O in viewers(src, null))
O.show_message("\red [user.name] cuts apart the [src.name]!", 1)
del(src)
return 1
return 0
AfterAttack(var/mob/living/target)
if(prob(stunchance))
if(target.weakened <= 0)
target.Weaken(rand(10, 15))
for(var/mob/O in viewers(src, null))
O.show_message("\red <B>[src]</B> knocks down [target]!", 1)
playsound(loc, 'pierce.ogg', 25, 1, -1)
/obj/effect/critter/spesscarp/elite
desc = "Oh shit, you're really fucked now. It has an evil gleam in its eye."
health = 50
max_health = 50
melee_damage_lower = 20
melee_damage_upper = 35
stunchance = 15
attack_speed = 7
// opensdoors = 1 would give all access dono if want
/obj/effect/critter/walkingmushroom
name = "Walking Mushroom"
desc = "A...huge...mushroom...with legs!?"
icon_state = "walkingmushroom"
health = 15
max_health = 15
aggressive = 0
defensive = 0
wanderer = 1
atkcarbon = 0
atksilicon = 0
firevuln = 2
brutevuln = 1
wanderspeed = 1
Harvest(var/obj/item/weapon/W, var/mob/living/user)
if(..())
var/success = 0
if(istype(W, /obj/item/weapon/butch))
new /obj/item/weapon/reagent_containers/food/snacks/hugemushroomslice(src.loc)
new /obj/item/weapon/reagent_containers/food/snacks/hugemushroomslice(src.loc)
success = 1
if(istype(W, /obj/item/weapon/kitchenknife))
new /obj/item/weapon/reagent_containers/food/snacks/hugemushroomslice(src.loc)
success = 1
if(success)
for(var/mob/O in viewers(src, null))
O.show_message("\red [user.name] cuts apart the [src.name]!", 1)
del(src)
return 1
return 0
/obj/effect/critter/lizard
name = "Lizard"
desc = "A cute tiny lizard."
+12 -11
View File
@@ -2,16 +2,16 @@
#define BEAR_STANCE_ALERT 2
#define BEAR_STANCE_ATTACK 3
#define BEAR_STANCE_ATTACKING 4
#define BEAR_STANCE_TIRED 4
#define BEAR_STANCE_TIRED 5
//Space bears!
/mob/living/simple_animal/bear
name = "space bear"
desc = "RawrRawr!!"
icon = 'icons/mob/mob.dmi'
icon_state = "bearspace"
icon_living = "bearspace"
icon_dead = "bear_d"
icon_state = "bear"
icon_living = "bear"
icon_dead = "bear_dead"
icon_gib = "bear_gib"
speak = list("RAWR!","Rawr!","GRR!","Growl!")
speak_emote = list("growls", "roars")
emote_hear = list("rawrs","grumbles","grawls")
@@ -25,6 +25,7 @@
response_harm = "pokes the"
stop_automated_movement_when_pulled = 0
maxHealth = 60
health = 60
//Space bears aren't affected by atmos.
@@ -53,8 +54,8 @@
..()
if(!stat)
if( loc && istype(loc,/turf/space) )
icon_state = "bearspace"
if(loc && istype(loc,/turf/space))
icon_state = "bear"
else
icon_state = "bearfloor"
@@ -111,12 +112,12 @@
stance = BEAR_STANCE_ALERT
stance_step = 5 //Make it very alert, so it quickly attacks again if a mob returns
return
if( !(target_mob in viewers(7,src)) )
if(!(target_mob in viewers(7,src)))
stance = BEAR_STANCE_ALERT
stance_step = 5 //Make it very alert, so it quickly attacks again if a mob returns
target_mob = null
return
if( get_dist(src, target_mob) <= 1 ) //Attacking
if(get_dist(src, target_mob) <= 1) //Attacking
emote( pick( list("slashes at [target_mob]", "bites [target_mob]") ) )
var/damage = rand(20,30)
@@ -130,7 +131,7 @@
var/mob/living/L = target_mob
L.adjustBruteLoss(damage)
if( stance_step >= 20 ) //attacks for 20 ticks, then it gets tired and needs to rest
if(stance_step >= 20) //attacks for 20 ticks, then it gets tired and needs to rest
emote( "is worn out and needs to rest" )
stance = BEAR_STANCE_TIRED
stance_step = 0
@@ -160,5 +161,5 @@
target_mob = M
..()
/mob/living/simple_animal/bear/Process_Spacemove(var/check_drift = 0)
/mob/living/simple_animal/carp/Process_Spacemove(var/check_drift = 0)
return //No drifting in space for space bears!
@@ -0,0 +1,93 @@
#define CARP_STANCE_IDLE 1
#define CARP_STANCE_ATTACK 2
#define CARP_STANCE_ATTACKING 3
/mob/living/simple_animal/carp
name = "space carp"
desc = "A ferocious, fang-bearing creature that resembles a fish."
icon_state = "carp"
icon_living = "carp"
icon_dead = "carp_dead"
icon_gib = "carp_gib"
speak_chance = 0
turns_per_move = 5
meat_type = /obj/item/weapon/reagent_containers/food/snacks/carpmeat
response_help = "pets the"
response_disarm = "gently pushes aside the"
response_harm = "hits the"
stop_automated_movement_when_pulled = 0
maxHealth = 25
health = 25
harm_intent_damage = 8
melee_damage_lower = 5
melee_damage_upper = 15
attacktext = "bites"
attack_sound = 'bite.ogg'
//Space carp aren't affected by atmos.
min_oxy = 0
max_oxy = 0
min_tox = 0
max_tox = 0
min_co2 = 0
max_co2 = 0
min_n2 = 0
max_n2 = 0
var/stance = CARP_STANCE_IDLE //Used to determine behavior
var/stance_step = 0 //Used to delay checks depending on what stance the bear is in
var/mob/living/target_mob //Once the bear enters attack stance, it will try to chase this mob. This it to prevent it changing it's mind between multiple mobs.
/mob/living/simple_animal/carp/Life()
..()
if(!stat)
switch(stance)
if(CARP_STANCE_IDLE)
stop_automated_movement = 0
stance_step++
if(stance_step > 5)
stance_step = 0
for( var/mob/living/L in viewers(7,src) )
if(iscarp(L)) continue
if(!L.stat)
emote("gnashes at [L]")
stance = CARP_STANCE_ATTACK
target_mob = L
break
if(CARP_STANCE_ATTACK) //This one should only be active for one tick
stop_automated_movement = 1
if(!target_mob || target_mob.stat)
stance = CARP_STANCE_IDLE
stance_step = 5 //Make it very alert, so it quickly attacks again if a mob returns
if(target_mob in viewers(7,src))
walk_to(src, target_mob, 1, 3)
stance = CARP_STANCE_ATTACKING
stance_step = 0
if(CARP_STANCE_ATTACKING)
stop_automated_movement = 1
stance_step++
if(!target_mob || target_mob.stat)
stance = CARP_STANCE_IDLE
stance_step = 3 //Make it very alert, so it quickly attacks again if a mob returns
target_mob = null
return
if(!(target_mob in viewers(7,src)))
stance = CARP_STANCE_IDLE
stance_step = 1
target_mob = null
return
if(get_dist(src, target_mob) <= 1) //Attacking
if(isliving(target_mob))
var/mob/living/L = target_mob
L.attack_animal(src)
if(prob(10))
L.Weaken(5)
L.visible_message("<span class='danger'>\the [src] knocks down \the [L]!</span>")
/mob/living/simple_animal/carp/Process_Spacemove(var/check_drift = 0)
return //No drifting in space for space carp! //original comments do not steal
+1 -2
View File
@@ -2,7 +2,6 @@
/mob/living/simple_animal/cat
name = "cat"
desc = "Kitty!!"
icon = 'icons/mob/mob.dmi'
icon_state = "cat"
icon_living = "cat"
icon_dead = "cat_dead"
@@ -35,7 +34,7 @@
for(var/mob/living/simple_animal/mouse/M in view(1,src))
if(!M.stat)
M.splat()
emote("SPLATS \the [M]")
emote("splats \the [M]")
movement_target = null
stop_automated_movement = 0
break
@@ -3,7 +3,6 @@
name = "\improper corgi"
real_name = "corgi"
desc = "It's a corgi."
icon = 'icons/mob/mob.dmi'
icon_state = "corgi"
icon_living = "corgi"
icon_dead = "corgi_dead"
@@ -1,9 +1,7 @@
//Look Sir, free crabs!
/mob/living/simple_animal/crab
name = "crab"
real_name = "crab"
desc = "Free crabs!"
icon = 'icons/mob/mob.dmi'
icon_state = "crab"
icon_living = "crab"
icon_dead = "crab_dead"
+16 -5
View File
@@ -1,12 +1,14 @@
/mob/living/simple_animal
name = "animal"
icon = 'icons/mob/animal.dmi'
var/icon_living = ""
var/icon_dead = ""
var/icon_gib = null //We only try to show a gibbing animation if this exists.
maxHealth = 20
var/list/speak = list()
var/list/speak_emote = list()// Emotes while speaking IE: Ian [emote], [text] -- Ian barks, "WOOF!". Spoken text is generated from the speak variable.
var/speak_chance = 0
var/list/emote_hear = list() //EHearable emotes
var/list/emote_hear = list() //Hearable emotes
var/list/emote_see = list() //Unlike speak_emote, the list of things in this variable only show by themselves with no spoken text. IE: Ian barks, Ian yaps
health = 20
var/turns_per_move = 1
@@ -232,6 +234,8 @@
..()
/mob/living/simple_animal/gib()
if(icon_gib)
flick(icon_gib, src)
if(meat_amount && meat_type)
for(var/i = 0; i < meat_amount; i++)
new meat_type(src.loc)
@@ -272,13 +276,13 @@
switch(M.a_intent)
if ("help")
if("help")
if (health > 0)
for(var/mob/O in viewers(src, null))
if ((O.client && !( O.blinded )))
O.show_message("\blue [M] [response_help] [src]")
if ("grab")
if("grab")
if (M == src)
return
if (nopush)
@@ -297,13 +301,13 @@
if ((O.client && !( O.blinded )))
O.show_message(text("\red [] has grabbed [] passively!", M, src), 1)
if ("hurt")
if("hurt")
health -= harm_intent_damage
for(var/mob/O in viewers(src, null))
if ((O.client && !( O.blinded )))
O.show_message("\red [M] [response_harm] [src]")
if ("disarm")
if("disarm")
for(var/mob/O in viewers(src, null))
if ((O.client && !( O.blinded )))
O.show_message("\blue [M] [response_disarm] [src]")
@@ -325,6 +329,13 @@
M.show_message("\blue [user] applies the [MED] on [src]")
else
user << "\blue this [src] is dead, medical items won't bring it back to life."
if(meat_type && (stat == DEAD)) //if the animal has a meat, and if it is dead.
if(istype(O, /obj/item/weapon/kitchenknife) || istype(O, /obj/item/weapon/butch))
new meat_type (get_turf(src))
if(prob(95))
del(src)
return
gib()
else
if(O.force)
health -= O.force
@@ -1,8 +1,6 @@
//Mouse
/mob/living/simple_animal/mouse
name = "mouse"
desc = "It's a nasty, ugly, evil, disease-ridden rodent."
icon = 'icons/mob/mob.dmi'
icon_state = "mouse_gray"
icon_living = "mouse_gray"
icon_dead = "mouse_gray_dead"
@@ -0,0 +1,14 @@
/mob/living/simple_animal/mushroom
name = "walking mushroom"
desc = "It's a massive mushroom... with legs?"
icon_state = "mushroom"
icon_living = "mushroom"
icon_dead = "mushroom_dead"
speak_chance = 0
turns_per_move = 1
health = 5
meat_type = /obj/item/weapon/reagent_containers/food/snacks/hugemushroomslice
response_help = "pets the"
response_disarm = "gently pushes aside the"
response_harm = "whacks the"
harm_intent_damage = 5
@@ -0,0 +1,16 @@
/mob/living/simple_animal/tomato
name = "tomato"
desc = "It's a horrifyingly enormous beef tomato, and it's packing extra beef!"
icon_state = "tomato"
icon_living = "tomato"
icon_dead = "tomato_dead"
speak_chance = 0
turns_per_move = 5
health = 15
meat_type = /obj/item/weapon/reagent_containers/food/snacks/tomatomeat
response_help = "prods the"
response_disarm = "pushes aside the"
response_harm = "smacks the"
harm_intent_damage = 5
/mob/living/simple_animal/tomato
+5
View File
@@ -70,6 +70,11 @@
return 1
return 0
/proc/iscarp(A)
if(istype(A, /mob/living/simple_animal/carp))
return 1
return 0
/proc/isAI(A)
if(istype(A, /mob/living/silicon/ai))
return 1