mirror of
https://github.com/CHOMPStation2/CHOMPStation2.git
synced 2025-12-10 10:12:45 +00:00
ported over the majority of /tg's simple_animal code and changed a lot of things for simple_animals and critters
- added bears, mice (cats will chase mice, mice squeak occasionally) - removed some unique simple_animals (ian and runtime will be the only ones for now) - structure improvements, tweaks and cleanup for simple_animals and critters - space carp should work fine now
This commit is contained in:
@@ -170,6 +170,7 @@
|
||||
#define FILE_DIR "code/WorkInProgress/Apples"
|
||||
#define FILE_DIR "code/WorkInProgress/Cael_Aislinn"
|
||||
#define FILE_DIR "code/WorkInProgress/Cael_Aislinn/BirdMan"
|
||||
#define FILE_DIR "code/WorkInProgress/Cael_Aislinn/Jumper"
|
||||
#define FILE_DIR "code/WorkInProgress/Cael_Aislinn/Rust"
|
||||
#define FILE_DIR "code/WorkInProgress/Cael_Aislinn/Supermatter"
|
||||
#define FILE_DIR "code/WorkInProgress/Cael_Aislinn/Tajara"
|
||||
@@ -209,6 +210,7 @@
|
||||
#define FILE_DIR "icons/vending_icons"
|
||||
#define FILE_DIR "interface"
|
||||
#define FILE_DIR "maps"
|
||||
#define FILE_DIR "maps/backup"
|
||||
#define FILE_DIR "maps/RandomZLevels"
|
||||
#define FILE_DIR "sound"
|
||||
#define FILE_DIR "sound/AI"
|
||||
@@ -228,7 +230,6 @@
|
||||
#define DEBUG
|
||||
// END_PREFERENCES
|
||||
// BEGIN_INCLUDE
|
||||
#include "code\modules\mob\simple_animal\munchkin.dm"
|
||||
#include "code\access_defines.dm"
|
||||
#include "code\names.dm"
|
||||
#include "code\setup.dm"
|
||||
@@ -1075,14 +1076,20 @@
|
||||
#include "code\modules\mob\organ\organ_external.dm"
|
||||
#include "code\modules\mob\organ\organ_internal.dm"
|
||||
#include "code\modules\mob\organ\pain.dm"
|
||||
#include "code\modules\mob\simple_animal\bear.dm"
|
||||
#include "code\modules\mob\simple_animal\behemoth.dm"
|
||||
#include "code\modules\mob\simple_animal\carp.dm"
|
||||
#include "code\modules\mob\simple_animal\cat.dm"
|
||||
#include "code\modules\mob\simple_animal\constructs.dm"
|
||||
#include "code\modules\mob\simple_animal\corgi.dm"
|
||||
#include "code\modules\mob\simple_animal\crab.dm"
|
||||
#include "code\modules\mob\simple_animal\life.dm"
|
||||
#include "code\modules\mob\simple_animal\kobold.dm"
|
||||
#include "code\modules\mob\simple_animal\mouse.dm"
|
||||
#include "code\modules\mob\simple_animal\parrot.dm"
|
||||
#include "code\modules\mob\simple_animal\shade.dm"
|
||||
#include "code\modules\mob\simple_animal\simple_animal.dm"
|
||||
#include "code\modules\mob\simple_animal\simple_animal_life.dm"
|
||||
#include "code\modules\mob\simple_animal\simple_animal_misc.dm"
|
||||
#include "code\modules\mob\simple_animal\worm.dm"
|
||||
#include "code\modules\power\apc.dm"
|
||||
#include "code\modules\power\cable.dm"
|
||||
|
||||
@@ -23,7 +23,7 @@
|
||||
Life()
|
||||
..()
|
||||
|
||||
if(alive)
|
||||
if(stat != DEAD)
|
||||
meat_amount = round(nutrition / 50)
|
||||
|
||||
nutrition_step--
|
||||
@@ -152,7 +152,7 @@
|
||||
..()
|
||||
|
||||
// go right before cycle elapses, and if animal isn't starving
|
||||
if(alive && nutrition_step == 1 && nutrition > max_nutrition / 2)
|
||||
if(stat != DEAD && nutrition_step == 1 && nutrition > max_nutrition / 2)
|
||||
// lay an egg with probability of 5% in 5 second time period
|
||||
if(prob(33))
|
||||
new/obj/item/weapon/reagent_containers/food/snacks/egg(src.loc) // lay an egg
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
//This file was auto-corrected by findeclaration.exe on 25.5.2012 20:42:31
|
||||
|
||||
var/global/list/space_surprises = list( /obj/item/clothing/mask/facehugger/angry =4,
|
||||
// /obj/item/weapon/pickaxe/hammer =4, //Waiting on a sprite
|
||||
// /obj/item/weapon/pickaxe/hammer =4, //Waiting on a sprite
|
||||
/obj/item/weapon/pickaxe/silver =4,
|
||||
/obj/item/weapon/pickaxe/drill =4,
|
||||
/obj/item/weapon/pickaxe/jackhammer =4,
|
||||
/obj/effect/critter/spesscarp/elite =3,
|
||||
/mob/living/simple_animal/carp/elite =3,
|
||||
/obj/item/weapon/pickaxe/diamond =3,
|
||||
/obj/item/weapon/pickaxe/diamonddrill =3,
|
||||
/obj/item/weapon/pickaxe/gold =3,
|
||||
|
||||
@@ -5,9 +5,9 @@
|
||||
for(var/obj/effect/landmark/C in world)
|
||||
if(C.name == "carpspawn")
|
||||
if(prob(99))
|
||||
new /obj/effect/critter/spesscarp(C.loc)
|
||||
new /mob/living/simple_animal/carp(C.loc)
|
||||
else
|
||||
new /obj/effect/critter/spesscarp/elite(C.loc)
|
||||
new /mob/living/simple_animal/carp/elite(C.loc)
|
||||
//sleep(100)
|
||||
spawn(rand(3000, 6000)) //Delayed announcements to keep the crew on their toes.
|
||||
command_alert("Unknown biological entities have been detected near [station_name()], please stand-by.", "Lifesign Alert")
|
||||
|
||||
@@ -142,7 +142,7 @@
|
||||
if("SHADE")
|
||||
var/mob/living/simple_animal/shade/T = target
|
||||
var/obj/item/device/soulstone/C = src
|
||||
if (T.alive == 0)
|
||||
if (T.stat == DEAD)
|
||||
U << "\red <b>Capture failed!</b>: \black The shade has already been banished!"
|
||||
else
|
||||
if(C.contents.len)
|
||||
|
||||
@@ -510,15 +510,15 @@ CRITTER GRENADE
|
||||
deliveryamt = 5
|
||||
origin_tech = "materials=3;magnets=4;syndicate=4"
|
||||
|
||||
/obj/item/weapon/spawnergrenade/spesscarp
|
||||
/obj/item/weapon/spawnergrenade/carp
|
||||
name = "carp delivery grenade"
|
||||
spawner_type = /obj/effect/critter/spesscarp
|
||||
spawner_type = /mob/living/simple_animal/carp
|
||||
deliveryamt = 5
|
||||
origin_tech = "materials=3;magnets=4;syndicate=4"
|
||||
|
||||
/obj/item/weapon/spawnergrenade/elitespesscarp
|
||||
/obj/item/weapon/spawnergrenade/elitecarp
|
||||
name = "elite carp delivery grenade"
|
||||
spawner_type = /obj/effect/critter/spesscarp/elite
|
||||
spawner_type = /mob/living/simple_animal/carp/elite
|
||||
deliveryamt = 2
|
||||
origin_tech = "materials=3;magnets=4;syndicate=4"
|
||||
|
||||
|
||||
@@ -112,20 +112,12 @@ var/global/BSACooldown = 0
|
||||
M.change_mob_type( /mob/living/silicon/robot , null, null, delmob)
|
||||
if("cat")
|
||||
M.change_mob_type( /mob/living/simple_animal/cat , null, null, delmob)
|
||||
if("runtime")
|
||||
M.change_mob_type( /mob/living/simple_animal/cat/Runtime , null, null, delmob)
|
||||
if("corgi")
|
||||
M.change_mob_type( /mob/living/simple_animal/corgi , null, null, delmob)
|
||||
if("ian")
|
||||
M.change_mob_type( /mob/living/simple_animal/corgi/Ian , null, null, delmob)
|
||||
if("crab")
|
||||
M.change_mob_type( /mob/living/simple_animal/crab , null, null, delmob)
|
||||
if("coffee")
|
||||
M.change_mob_type( /mob/living/simple_animal/crab/Coffee , null, null, delmob)
|
||||
if("parrot")
|
||||
M.change_mob_type( /mob/living/simple_animal/parrot , null, null, delmob)
|
||||
if("drprofessor")
|
||||
M.change_mob_type( /mob/living/simple_animal/parrot/DrProfessor , null, null, delmob)
|
||||
if("constructarmoured")
|
||||
M.change_mob_type( /mob/living/simple_animal/constructarmoured , null, null, delmob)
|
||||
if("constructbuilder")
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
//This file was auto-corrected by findeclaration.exe on 29/05/2012 15:03:05
|
||||
|
||||
//todo: merge this with simple_animal?
|
||||
|
||||
/obj/effect/critter
|
||||
name = "Critter"
|
||||
desc = "Generic critter."
|
||||
|
||||
@@ -73,7 +73,7 @@ Contains the procs that control attacking critters
|
||||
|
||||
Die()
|
||||
if (!src.alive) return
|
||||
src.icon_state += "-dead"
|
||||
src.icon_state += "_dead"
|
||||
src.alive = 0
|
||||
src.anchored = 0
|
||||
src.density = 0
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
|
||||
/obj/effect/critter/creature
|
||||
name = "creature"
|
||||
desc = "A sanity-destroying otherthing."
|
||||
@@ -22,25 +23,6 @@
|
||||
attacktext = "chomps"
|
||||
attack_sound = 'bite.ogg'
|
||||
|
||||
|
||||
/obj/effect/critter/roach
|
||||
name = "cockroach"
|
||||
desc = "An unpleasant insect that lives in filthy places."
|
||||
icon_state = "roach"
|
||||
health = 5
|
||||
max_health = 5
|
||||
aggressive = 0
|
||||
defensive = 1
|
||||
wanderer = 1
|
||||
atkcarbon = 1
|
||||
atksilicon = 0
|
||||
attacktext = "bites"
|
||||
|
||||
Die()
|
||||
..()
|
||||
del(src)
|
||||
|
||||
|
||||
/obj/effect/critter/killertomato
|
||||
name = "killer tomato"
|
||||
desc = "Oh shit, you're really fucked now."
|
||||
@@ -55,7 +37,6 @@
|
||||
firevuln = 2
|
||||
brutevuln = 2
|
||||
|
||||
|
||||
Harvest(var/obj/item/weapon/W, var/mob/living/user)
|
||||
if(..())
|
||||
var/success = 0
|
||||
@@ -73,12 +54,11 @@
|
||||
return 1
|
||||
return 0
|
||||
|
||||
|
||||
|
||||
/obj/effect/critter/spore
|
||||
name = "plasma spore"
|
||||
desc = "A barely intelligent colony of organisms. Very volatile."
|
||||
icon_state = "spore"
|
||||
icon = 'otherthing.dmi'
|
||||
icon_state = "otherthing"
|
||||
density = 1
|
||||
health = 1
|
||||
max_health = 1
|
||||
@@ -90,7 +70,6 @@
|
||||
firevuln = 2
|
||||
brutevuln = 2
|
||||
|
||||
|
||||
Die()
|
||||
src.visible_message("<b>[src]</b> ruptures and explodes!")
|
||||
src.alive = 0
|
||||
@@ -100,11 +79,9 @@
|
||||
explosion(T, -1, -1, 2, 3)
|
||||
del src
|
||||
|
||||
|
||||
ex_act(severity)
|
||||
src.Die()
|
||||
|
||||
|
||||
/obj/effect/critter/blob
|
||||
name = "blob"
|
||||
desc = "Some blob thing."
|
||||
@@ -129,78 +106,10 @@
|
||||
..()
|
||||
del(src)
|
||||
|
||||
|
||||
|
||||
/obj/effect/critter/spesscarp
|
||||
name = "Spess Carp"
|
||||
desc = "A ferocious, fang-bearing creature that resembles a fish."
|
||||
icon_state = "spesscarp"
|
||||
health = 100
|
||||
max_health = 100
|
||||
aggressive = 1
|
||||
aggression = 20
|
||||
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
|
||||
speed = 8
|
||||
chasespeed = 8
|
||||
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 = 200
|
||||
max_health = 200
|
||||
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"
|
||||
icon_state = "mushroom"
|
||||
health = 15
|
||||
max_health = 15
|
||||
aggressive = 0
|
||||
@@ -212,7 +121,6 @@
|
||||
brutevuln = 1
|
||||
wanderspeed = 1
|
||||
|
||||
|
||||
Harvest(var/obj/item/weapon/W, var/mob/living/user)
|
||||
if(..())
|
||||
var/success = 0
|
||||
@@ -230,8 +138,6 @@
|
||||
return 1
|
||||
return 0
|
||||
|
||||
|
||||
|
||||
/obj/effect/critter/lizard
|
||||
name = "Lizard"
|
||||
desc = "A cute tiny lizard."
|
||||
@@ -246,7 +152,22 @@
|
||||
atksilicon = 1
|
||||
attacktext = "bites"
|
||||
|
||||
/obj/effect/critter/roach
|
||||
name = "cockroach"
|
||||
desc = "An unpleasant insect that lives in filthy places."
|
||||
icon_state = "roach"
|
||||
health = 5
|
||||
max_health = 5
|
||||
aggressive = 0
|
||||
defensive = 1
|
||||
wanderer = 1
|
||||
atkcarbon = 1
|
||||
atksilicon = 0
|
||||
attacktext = "bites"
|
||||
|
||||
Die()
|
||||
..()
|
||||
del(src)
|
||||
|
||||
// We can maybe make these controllable via some console or something
|
||||
/obj/effect/critter/manhack
|
||||
|
||||
160
code/modules/mob/simple_animal/bear.dm
Normal file
160
code/modules/mob/simple_animal/bear.dm
Normal file
@@ -0,0 +1,160 @@
|
||||
#define BEAR_STANCE_IDLE 1
|
||||
#define BEAR_STANCE_ALERT 2
|
||||
#define BEAR_STANCE_ATTACK 3
|
||||
#define BEAR_STANCE_ATTACKING 4
|
||||
#define BEAR_STANCE_TIRED 5
|
||||
|
||||
//Space bears!
|
||||
/mob/living/simple_animal/bear
|
||||
name = "space bear"
|
||||
desc = "RawrRawr!!"
|
||||
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")
|
||||
emote_see = list("stares ferociously", "stomps")
|
||||
speak_chance = 1
|
||||
turns_per_move = 5
|
||||
see_in_dark = 6
|
||||
meat_type = /obj/item/weapon/reagent_containers/food/snacks/meat
|
||||
response_help = "pets the"
|
||||
response_disarm = "gently pushes aside the"
|
||||
response_harm = "pokes the"
|
||||
|
||||
stop_automated_movement_when_pulled = 0
|
||||
maxHealth = 60
|
||||
health = 60
|
||||
|
||||
//Space bears 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 = BEAR_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.
|
||||
|
||||
/proc/isbear(var/mob/M)
|
||||
return istype(M, /mob/living/simple_animal/bear)
|
||||
|
||||
/mob/living/simple_animal/bear/Life()
|
||||
..()
|
||||
|
||||
if(!stat)
|
||||
if(loc && istype(loc,/turf/space))
|
||||
icon_state = "bear"
|
||||
else
|
||||
icon_state = "bearfloor"
|
||||
|
||||
switch(stance)
|
||||
if(BEAR_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(isbear(L)) continue
|
||||
if(!L.stat)
|
||||
emote("stares alertly at [L]")
|
||||
stance = BEAR_STANCE_ALERT
|
||||
break
|
||||
if(BEAR_STANCE_ALERT)
|
||||
stop_automated_movement = 1
|
||||
var/found_mob = 0
|
||||
for( var/mob/living/L in viewers(7,src) )
|
||||
if(isbear(L)) continue
|
||||
if(!L.stat)
|
||||
stance_step = max(0, stance_step) //If we have not seen a mob in a while, the stance_step will be negative, we need to reset it to 0 as soon as we see a mob again.
|
||||
stance_step++
|
||||
found_mob = 1
|
||||
target_mob = L
|
||||
src.dir = get_dir(src,target_mob) //Keep staring at the mob
|
||||
|
||||
if(stance_step in list(1,4,7)) //every 3 ticks
|
||||
var/action = pick( list( "growls at [L]", "stares angrily at [L]", "prepares to attack [L]", "closely watches [L]" ) )
|
||||
if(action)
|
||||
emote(action)
|
||||
break
|
||||
if(!found_mob)
|
||||
stance_step--
|
||||
|
||||
if(stance_step <= -20) //If we have not found a mob for 20-ish ticks, revert to idle mode
|
||||
stance = BEAR_STANCE_IDLE
|
||||
if(stance_step >= 7) //If we have been staring at a mob for 7 ticks,
|
||||
stance = BEAR_STANCE_ATTACK
|
||||
if(BEAR_STANCE_ATTACK) //This one should only be active for one tick,
|
||||
stop_automated_movement = 1
|
||||
if(!target_mob || target_mob.stat)
|
||||
stance = BEAR_STANCE_ALERT
|
||||
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 = BEAR_STANCE_ATTACKING
|
||||
stance_step = 0
|
||||
if(BEAR_STANCE_ATTACKING)
|
||||
|
||||
stop_automated_movement = 1
|
||||
stance_step++
|
||||
if(!target_mob || target_mob.stat)
|
||||
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)))
|
||||
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
|
||||
emote( pick( list("slashes at [target_mob]", "bites [target_mob]") ) )
|
||||
|
||||
var/damage = rand(20,30)
|
||||
|
||||
if(ishuman(target_mob))
|
||||
var/mob/living/carbon/human/H = target_mob
|
||||
var/dam_zone = pick("chest", "l_hand", "r_hand", "l_leg", "r_leg")
|
||||
var/datum/organ/external/affecting = H.get_organ(ran_zone(dam_zone))
|
||||
H.apply_damage(damage, BRUTE, affecting, H.run_armor_check(affecting, "melee"))
|
||||
else if(isliving(target_mob))
|
||||
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
|
||||
emote( "is worn out and needs to rest" )
|
||||
stance = BEAR_STANCE_TIRED
|
||||
stance_step = 0
|
||||
walk(src, 0) //This stops the bear's walking
|
||||
return
|
||||
if(BEAR_STANCE_TIRED)
|
||||
stop_automated_movement = 1
|
||||
stance_step++
|
||||
if(stance_step >= 10) //rests for 10 ticks
|
||||
if(target_mob && target_mob in viewers(7,src))
|
||||
stance = BEAR_STANCE_ATTACK //If the mob he was chasing is still nearby, resume the attack, otherwise go idle.
|
||||
else
|
||||
stance = BEAR_STANCE_IDLE
|
||||
|
||||
|
||||
/mob/living/simple_animal/bear/attackby(var/obj/item/O as obj, var/mob/user as mob)
|
||||
if(stance != BEAR_STANCE_ATTACK && stance != BEAR_STANCE_ATTACKING)
|
||||
stance = BEAR_STANCE_ALERT
|
||||
stance_step = 6
|
||||
target_mob = user
|
||||
..()
|
||||
|
||||
/mob/living/simple_animal/bear/attack_hand(mob/living/carbon/human/M as mob)
|
||||
if(stance != BEAR_STANCE_ATTACK && stance != BEAR_STANCE_ATTACKING)
|
||||
stance = BEAR_STANCE_ALERT
|
||||
stance_step = 6
|
||||
target_mob = M
|
||||
..()
|
||||
|
||||
/mob/living/simple_animal/bear/Process_Spacemove(var/check_drift = 0)
|
||||
return //No drifting in space for space bears!
|
||||
112
code/modules/mob/simple_animal/carp.dm
Normal file
112
code/modules/mob/simple_animal/carp.dm
Normal file
@@ -0,0 +1,112 @@
|
||||
#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/elite
|
||||
desc = "A ferocious, fang-bearing creature that resembles a fish. It has an evil gleam in its eye."
|
||||
maxHealth = 50
|
||||
health = 50
|
||||
melee_damage_lower = 10
|
||||
melee_damage_upper = 20
|
||||
|
||||
/proc/iscarp(var/mob/M)
|
||||
return istype(M, /mob/living/simple_animal/carp)
|
||||
|
||||
/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
|
||||
walk(src,0)
|
||||
return
|
||||
if(!(target_mob in viewers(7,src)))
|
||||
stance = CARP_STANCE_IDLE
|
||||
stance_step = 1
|
||||
target_mob = null
|
||||
walk(src,0)
|
||||
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/Die()
|
||||
..()
|
||||
target_mob = null
|
||||
stance = CARP_STANCE_IDLE
|
||||
walk(src,0)
|
||||
|
||||
/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,8 +1,7 @@
|
||||
//Cat
|
||||
/mob/living/simple_animal/cat
|
||||
name = "cat"
|
||||
desc = "Kitty!!"
|
||||
icon = 'mob.dmi'
|
||||
desc = "A domesticated, feline pet. Has a tendency to adopt crewmembers."
|
||||
icon_state = "cat"
|
||||
icon_living = "cat"
|
||||
icon_dead = "cat_dead"
|
||||
@@ -13,15 +12,48 @@
|
||||
speak_chance = 1
|
||||
turns_per_move = 5
|
||||
see_in_dark = 6
|
||||
meat_type = /obj/item/weapon/reagent_containers/food/snacks/sliceable/meat
|
||||
meat_type = /obj/item/weapon/reagent_containers/food/snacks/meat
|
||||
response_help = "pets the"
|
||||
response_disarm = "gently pushes aside the"
|
||||
response_harm = "kicks the"
|
||||
var/turns_since_scan = 0
|
||||
var/mob/living/simple_animal/mouse/movement_target
|
||||
|
||||
/mob/living/simple_animal/cat/Life()
|
||||
//MICE!
|
||||
if((src.loc) && isturf(src.loc))
|
||||
if(!stat && !resting && !buckled)
|
||||
for(var/mob/living/simple_animal/mouse/M in view(1,src))
|
||||
if(!M.stat)
|
||||
M.splat()
|
||||
emote("splats \the [M]")
|
||||
movement_target = null
|
||||
stop_automated_movement = 0
|
||||
break
|
||||
|
||||
..()
|
||||
|
||||
if(!stat && !resting && !buckled)
|
||||
turns_since_scan++
|
||||
if(turns_since_scan > 5)
|
||||
walk_to(src,0)
|
||||
turns_since_scan = 0
|
||||
if((movement_target) && !(isturf(movement_target.loc) || ishuman(movement_target.loc) ))
|
||||
movement_target = null
|
||||
stop_automated_movement = 0
|
||||
if( !movement_target || !(movement_target.loc in oview(src, 3)) )
|
||||
movement_target = null
|
||||
stop_automated_movement = 0
|
||||
for(var/mob/living/simple_animal/mouse/snack in oview(src,3))
|
||||
if(isturf(snack.loc) && !snack.stat)
|
||||
movement_target = snack
|
||||
break
|
||||
if(movement_target)
|
||||
stop_automated_movement = 1
|
||||
walk_to(src,movement_target,0,3)
|
||||
|
||||
//RUNTIME IS ALIVE! SQUEEEEEEEE~
|
||||
/mob/living/simple_animal/cat/Runtime
|
||||
name = "Runtime"
|
||||
desc = ""
|
||||
response_help = "pets"
|
||||
response_disarm = "gently pushes aside"
|
||||
response_harm = "kicks"
|
||||
desc = "Its fur has the look and feel of velvet, and it's tail quivers occasionally."
|
||||
|
||||
|
||||
@@ -3,7 +3,6 @@
|
||||
name = "\improper corgi"
|
||||
real_name = "corgi"
|
||||
desc = "It's a corgi."
|
||||
icon = 'mob.dmi'
|
||||
icon_state = "corgi"
|
||||
icon_living = "corgi"
|
||||
icon_dead = "corgi_dead"
|
||||
@@ -13,41 +12,16 @@
|
||||
emote_see = list("shakes its head", "shivers")
|
||||
speak_chance = 1
|
||||
turns_per_move = 10
|
||||
meat_type = /obj/item/weapon/reagent_containers/food/snacks/sliceable/meat/corgi
|
||||
meat_type = /obj/item/weapon/reagent_containers/food/snacks/meat/corgi
|
||||
meat_amount = 3
|
||||
response_help = "pets the"
|
||||
response_disarm = "gently pushes aside the"
|
||||
response_disarm = "bops the"
|
||||
response_harm = "kicks the"
|
||||
see_in_dark = 5
|
||||
var/obj/item/inventory_head
|
||||
var/obj/item/inventory_back
|
||||
var/obj/item/inventory_mouth
|
||||
|
||||
/mob/living/simple_animal/corgi/update_clothing()
|
||||
overlays = list()
|
||||
|
||||
if(inventory_head)
|
||||
var/head_icon_state = inventory_head.icon_state
|
||||
if(health <= 0)
|
||||
head_icon_state += "2"
|
||||
|
||||
var/icon/head_icon = icon('corgi_head.dmi',head_icon_state)
|
||||
if(head_icon)
|
||||
overlays += head_icon
|
||||
|
||||
if(inventory_back)
|
||||
var/back_icon_state = inventory_back.icon_state
|
||||
if(health <= 0)
|
||||
back_icon_state += "2"
|
||||
|
||||
var/icon/back_icon = icon('corgi_back.dmi',back_icon_state)
|
||||
if(back_icon)
|
||||
overlays += back_icon
|
||||
return
|
||||
|
||||
/mob/living/simple_animal/corgi/Life()
|
||||
..()
|
||||
rebuild_appearance()
|
||||
var/turns_since_scan = 0
|
||||
var/obj/movement_target
|
||||
|
||||
/mob/living/simple_animal/corgi/show_inv(mob/user as mob)
|
||||
/*
|
||||
@@ -104,7 +78,6 @@
|
||||
emote_hear = list("barks", "woofs", "yaps","pants")
|
||||
emote_see = list("shakes its head", "shivers")
|
||||
desc = "It's a corgi."
|
||||
src.ul_SetLuminosity(0)
|
||||
inventory_head.loc = src.loc
|
||||
inventory_head = null
|
||||
else
|
||||
@@ -148,7 +121,7 @@
|
||||
/obj/item/clothing/head/caphat,
|
||||
/obj/item/clothing/head/collectable/captain,
|
||||
/obj/item/clothing/head/that,
|
||||
/obj/item/clothing/head/helmet/that,
|
||||
/obj/item/clothing/head/that,
|
||||
/obj/item/clothing/head/kitty,
|
||||
/obj/item/clothing/head/collectable/kitty,
|
||||
/obj/item/clothing/head/rabbitears,
|
||||
@@ -166,13 +139,10 @@
|
||||
/obj/item/clothing/head/wizard/fake,
|
||||
/obj/item/clothing/head/wizard,
|
||||
/obj/item/clothing/head/collectable/wizard,
|
||||
/obj/item/clothing/head/helmet/hardhat,
|
||||
/obj/item/clothing/head/collectable/hardhat,
|
||||
/obj/item/clothing/head/helmet/hardhat/white,
|
||||
/obj/item/weapon/bedsheet,
|
||||
/obj/item/clothing/head/helmet/space/santahat,
|
||||
/obj/item/clothing/head/collectable/paper,
|
||||
/obj/item/clothing/head/cargosoft
|
||||
)
|
||||
|
||||
if( ! ( item_to_add.type in allowed_types ) )
|
||||
@@ -182,6 +152,7 @@
|
||||
usr.drop_item()
|
||||
item_to_add.loc = src
|
||||
src.inventory_head = item_to_add
|
||||
rebuild_appearance()
|
||||
|
||||
//Various hats and items (worn on his head) change Ian's behaviour. His attributes are reset when a HAT is removed.
|
||||
|
||||
@@ -239,11 +210,6 @@
|
||||
name = "Rudolph the Red-Nosed Corgi"
|
||||
emote_hear = list("barks christmas songs", "yaps")
|
||||
desc = "He has a very shiny nose."
|
||||
src.ul_SetLuminosity(6)
|
||||
if(/obj/item/clothing/head/cargosoft)
|
||||
name = "Corgi Tech [real_name]"
|
||||
speak = list("Needs a stamp!", "Request DENIED!", "Fill these out in triplicate!")
|
||||
desc = "The reason your yellow gloves have chew-marks."
|
||||
|
||||
if("back")
|
||||
if(inventory_back)
|
||||
@@ -269,29 +235,18 @@
|
||||
usr.drop_item()
|
||||
item_to_add.loc = src
|
||||
src.inventory_back = item_to_add
|
||||
update_clothing()
|
||||
rebuild_appearance()
|
||||
|
||||
//show_inv(usr) //Commented out because changing Ian's name and then calling up his inventory opens a new inventory...which is annoying.
|
||||
else
|
||||
..()
|
||||
|
||||
//IAN! SQUEEEEEEEEE~
|
||||
/mob/living/simple_animal/corgi/Ian
|
||||
name = "Ian"
|
||||
real_name = "Ian" //Intended to hold the name without altering it.
|
||||
gender = "male"
|
||||
desc = "It's a corgi."
|
||||
var/turns_since_scan = 0
|
||||
var/obj/movement_target
|
||||
response_help = "pets"
|
||||
response_disarm = "gently pushes aside"
|
||||
response_harm = "kicks"
|
||||
|
||||
/mob/living/simple_animal/corgi/Ian/Life()
|
||||
/mob/living/simple_animal/corgi/Life()
|
||||
..()
|
||||
rebuild_appearance()
|
||||
|
||||
//Feeding, chasing food, FOOOOODDDD
|
||||
if(alive && !resting && !buckled)
|
||||
if(!stat && !resting && !buckled)
|
||||
turns_since_scan++
|
||||
if(turns_since_scan > 5)
|
||||
turns_since_scan = 0
|
||||
@@ -338,11 +293,11 @@
|
||||
dir = i
|
||||
sleep(1)
|
||||
|
||||
/obj/item/weapon/reagent_containers/food/snacks/sliceable/meat/corgi
|
||||
/obj/item/weapon/reagent_containers/food/snacks/meat/corgi
|
||||
name = "Corgi meat"
|
||||
desc = "Tastes like... well you know..."
|
||||
|
||||
/mob/living/simple_animal/corgi/Ian/Bump(atom/movable/AM as mob|obj, yes)
|
||||
/mob/living/simple_animal/corgi/Bump(atom/movable/AM as mob|obj, yes)
|
||||
|
||||
spawn( 0 )
|
||||
if ((!( yes ) || now_pushing))
|
||||
@@ -350,11 +305,11 @@
|
||||
now_pushing = 1
|
||||
if(ismob(AM))
|
||||
var/mob/tmob = AM
|
||||
/* if(istype(tmob, /mob/living/carbon/human) && (FAT in tmob.mutations))
|
||||
if(istype(tmob, /mob/living/carbon/human) && (FAT in tmob.mutations))
|
||||
if(prob(70))
|
||||
src << "\red <B>You fail to push [tmob]'s fat ass out of the way.</B>"
|
||||
now_pushing = 0
|
||||
return*/
|
||||
return
|
||||
if(tmob.nopush)
|
||||
now_pushing = 0
|
||||
return
|
||||
@@ -388,7 +343,7 @@
|
||||
|
||||
/mob/living/simple_animal/corgi/attackby(var/obj/item/O as obj, var/mob/user as mob) //Marker -Agouri
|
||||
if(istype(O, /obj/item/weapon/newspaper))
|
||||
if(alive)
|
||||
if(!stat)
|
||||
for(var/mob/M in viewers(user, null))
|
||||
if ((M.client && !( M.blinded )))
|
||||
M.show_message("\blue [user] baps [name] on the nose with the rolled up [O]")
|
||||
@@ -397,4 +352,14 @@
|
||||
dir = i
|
||||
sleep(1)
|
||||
else
|
||||
..()
|
||||
..()
|
||||
|
||||
//IAN! SQUEEEEEEEEE~
|
||||
/mob/living/simple_animal/corgi/Ian
|
||||
name = "Ian"
|
||||
real_name = "Ian" //Intended to hold the name without altering it.
|
||||
gender = "male"
|
||||
desc = "It's a somewhat notorious corgi."
|
||||
response_help = "pets"
|
||||
response_disarm = "bops"
|
||||
response_harm = "kicks"
|
||||
|
||||
@@ -1,8 +1,7 @@
|
||||
//Look Sir, free crabs!
|
||||
/mob/living/simple_animal/crab
|
||||
name = "crab"
|
||||
desc = "Free crabs!"
|
||||
icon = 'mob.dmi'
|
||||
desc = "A hard-shelled crustacean. Seems quite content to lounge around all the time."
|
||||
icon_state = "crab"
|
||||
icon_living = "crab"
|
||||
icon_dead = "crab_dead"
|
||||
@@ -11,59 +10,22 @@
|
||||
emote_see = list("clacks")
|
||||
speak_chance = 1
|
||||
turns_per_move = 5
|
||||
meat_type = /obj/item/weapon/reagent_containers/food/snacks/sliceable/meat
|
||||
meat_type = /obj/item/weapon/reagent_containers/food/snacks/meat
|
||||
response_help = "pets the"
|
||||
response_disarm = "gently pushes aside the"
|
||||
response_harm = "stomps the"
|
||||
stop_automated_movement = 1
|
||||
friendly = "pinches"
|
||||
var/obj/item/inventory_head
|
||||
var/obj/item/inventory_mask
|
||||
|
||||
/mob/living/simple_animal/crab/Life()
|
||||
..()
|
||||
//CRAB movement
|
||||
if(!ckey && alive)
|
||||
if(!ckey && !stat)
|
||||
if(isturf(src.loc) && !resting && !buckled) //This is so it only moves if it's not inside a closet, gentics machine, etc.
|
||||
turns_since_move++
|
||||
if(turns_since_move >= turns_per_move)
|
||||
Move(get_step(src,pick(4,8)))
|
||||
turns_since_move = 0
|
||||
|
||||
//COFFEE! SQUEEEEEEEEE!
|
||||
/mob/living/simple_animal/crab/Coffee
|
||||
name = "Coffee"
|
||||
desc = "It's Coffee, the other pet!"
|
||||
response_help = "pets"
|
||||
response_disarm = "gently pushes aside"
|
||||
response_harm = "stomps"
|
||||
|
||||
//LOOK AT THIS - ..()??
|
||||
/mob/living/simple_animal/crab/attackby(var/obj/item/O as obj, var/mob/user as mob)
|
||||
if(istype(O, /obj/item/weapon/wirecutters))
|
||||
user << "\red \b This kills the crab."
|
||||
health -= 20
|
||||
Die()
|
||||
if(istype(O, /obj/item/stack/medical))
|
||||
if(alive)
|
||||
var/obj/item/stack/medical/MED = O
|
||||
if(health < maxHealth)
|
||||
if(MED.amount >= 1)
|
||||
health = min(maxHealth, health + MED.heal_brute)
|
||||
MED.amount -= 1
|
||||
if(MED.amount <= 0)
|
||||
del(MED)
|
||||
for(var/mob/M in viewers(src, null))
|
||||
if ((M.client && !( M.blinded )))
|
||||
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."
|
||||
else
|
||||
if(O.force)
|
||||
health -= O.force
|
||||
for(var/mob/M in viewers(src, null))
|
||||
if ((M.client && !( M.blinded )))
|
||||
M.show_message("\red \b [src] has been attacked with the [O] by [user]. ")
|
||||
else
|
||||
usr << "\red This weapon is ineffective, it does no damage."
|
||||
for(var/mob/M in viewers(src, null))
|
||||
if ((M.client && !( M.blinded )))
|
||||
M.show_message("\red [user] gently taps [src] with the [O]. ")
|
||||
rebuild_appearance()
|
||||
|
||||
@@ -26,6 +26,3 @@
|
||||
/mob/living/simple_animal/kobold/Move(var/dir)
|
||||
..()
|
||||
flick("kobold_walk",src)
|
||||
|
||||
/mob/living/simple_animal/kobold/munchkin
|
||||
name = "Munchkin"
|
||||
52
code/modules/mob/simple_animal/mouse.dm
Normal file
52
code/modules/mob/simple_animal/mouse.dm
Normal file
@@ -0,0 +1,52 @@
|
||||
/mob/living/simple_animal/mouse
|
||||
name = "mouse"
|
||||
desc = "It's a nasty, ugly, evil, disease-ridden rodent."
|
||||
icon_state = "mouse_gray"
|
||||
icon_living = "mouse_gray"
|
||||
icon_dead = "mouse_gray_dead"
|
||||
speak = list("Squeek!","SQUEEK!","Squeek?")
|
||||
speak_emote = list("squeeks")
|
||||
emote_hear = list("squeeks")
|
||||
emote_see = list("runs in a circle", "shakes")
|
||||
speak_chance = 1
|
||||
turns_per_move = 5
|
||||
see_in_dark = 6
|
||||
health = 5
|
||||
meat_type = /obj/item/weapon/reagent_containers/food/snacks/meat
|
||||
response_help = "pets the"
|
||||
response_disarm = "gently pushes aside the"
|
||||
response_harm = "splats the"
|
||||
density = 0
|
||||
var/color //brown, gray and white, leave blank for random
|
||||
|
||||
/mob/living/simple_animal/mouse/Life()
|
||||
..()
|
||||
if(!stat && prob(speak_chance))
|
||||
for(var/mob/M in view())
|
||||
M << "\blue \icon[src] Squeek!"
|
||||
M << 'sound/effects/mousesqueek.ogg'
|
||||
|
||||
/mob/living/simple_animal/mouse/white
|
||||
color = "white"
|
||||
icon_state = "mouse_white"
|
||||
|
||||
/mob/living/simple_animal/mouse/gray
|
||||
color = "gray"
|
||||
icon_state = "mouse_gray"
|
||||
|
||||
/mob/living/simple_animal/mouse/brown
|
||||
color = "brown"
|
||||
icon_state = "mouse_brown"
|
||||
|
||||
/mob/living/simple_animal/mouse/New()
|
||||
if(!color)
|
||||
color = pick( list("brown","gray","white") )
|
||||
icon_state = "mouse_[color]"
|
||||
icon_living = "mouse_[color]"
|
||||
icon_dead = "mouse_[color]_dead"
|
||||
|
||||
/mob/living/simple_animal/mouse/proc/splat()
|
||||
src.health = 0
|
||||
src.stat = DEAD
|
||||
src.icon_dead = "mouse_[color]_splat"
|
||||
src.icon_state = "mouse_[color]_splat"
|
||||
56
code/modules/mob/simple_animal/simple_animal.dm
Normal file
56
code/modules/mob/simple_animal/simple_animal.dm
Normal file
@@ -0,0 +1,56 @@
|
||||
/mob/living/simple_animal
|
||||
name = "animal"
|
||||
icon = '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_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
|
||||
var/turns_since_move = 0
|
||||
universal_speak = 1
|
||||
var/meat_amount = 0
|
||||
var/meat_type
|
||||
var/stop_automated_movement = 0 //Use this to temporarely stop random movement or to if you write special movement code for animals.
|
||||
var/stop_automated_movement_when_pulled = 1 //When set to 1 this stops the animal from moving when someone is pulling it.
|
||||
|
||||
//Interaction
|
||||
var/response_help = "You try to help"
|
||||
var/response_disarm = "You try to disarm"
|
||||
var/response_harm = "You try to hurt"
|
||||
var/harm_intent_damage = 3
|
||||
|
||||
//Temperature effect
|
||||
var/minbodytemp = 270
|
||||
var/maxbodytemp = 370
|
||||
var/heat_damage_per_tick = 3 //amount of damage applied if animal's body temperature is higher than maxbodytemp
|
||||
var/cold_damage_per_tick = 2 //same as heat_damage_per_tick, only if the bodytemperature it's lower than minbodytemp
|
||||
|
||||
//Atmos effect - Yes, you can make creatures that require plasma or co2 to survive. N2O is a trace gas and handled separately, hence why it isn't here. It'd be hard to add it. Hard and me don't mix (Yes, yes make all the dick jokes you want with that.) - Errorage
|
||||
var/min_oxy = 5
|
||||
var/max_oxy = 0 //Leaving something at 0 means it's off - has no maximum
|
||||
var/min_tox = 0
|
||||
var/max_tox = 1
|
||||
var/min_co2 = 0
|
||||
var/max_co2 = 5
|
||||
var/min_n2 = 0
|
||||
var/max_n2 = 0
|
||||
var/unsuitable_atoms_damage = 2 //This damage is taken when atmos doesn't fit all the requirements above
|
||||
|
||||
|
||||
//LETTING SIMPLE ANIMALS ATTACK? WHAT COULD GO WRONG. Defaults to zero so Ian can still be cuddly
|
||||
var/melee_damage_lower = 0
|
||||
var/melee_damage_upper = 0
|
||||
var/attacktext = "attacks"
|
||||
var/attack_sound = null
|
||||
var/friendly = "nuzzles" //If the mob does no damage with it's attack
|
||||
var/wall_smash = 0 //if they can smash walls
|
||||
|
||||
var/speed = 0 //LETS SEE IF I CAN SET SPEEDS FOR SIMPLE MOBS WITHOUT DESTROYING EVERYTHING. Higher speed is slower, negative speed is faster
|
||||
|
||||
var/obj/item/device/radio/headset/l_ear = null
|
||||
88
code/modules/mob/simple_animal/simple_animal_life.dm
Normal file
88
code/modules/mob/simple_animal/simple_animal_life.dm
Normal file
@@ -0,0 +1,88 @@
|
||||
|
||||
/mob/living/simple_animal/Life()
|
||||
|
||||
//Health
|
||||
if(stat == DEAD)
|
||||
if(health > 0)
|
||||
icon_state = icon_living
|
||||
stat = CONSCIOUS
|
||||
density = 1
|
||||
return
|
||||
else if(health < 1)
|
||||
Die()
|
||||
else if(health > maxHealth)
|
||||
health = maxHealth
|
||||
|
||||
//Movement
|
||||
if(!ckey && !stop_automated_movement)
|
||||
if(isturf(src.loc) && !resting && !buckled && canmove) //This is so it only moves if it's not inside a closet, gentics machine, etc.
|
||||
turns_since_move++
|
||||
if(turns_since_move >= turns_per_move)
|
||||
Move(get_step(src,pick(cardinal)))
|
||||
turns_since_move = 0
|
||||
|
||||
//Speaking
|
||||
if(prob(speak_chance))
|
||||
var/length = speak.len + emote_hear.len + emote_see.len
|
||||
if(speak.len && prob((speak.len / length) * 100))
|
||||
say(pick(speak))
|
||||
else if(emote_see.len && prob((emote_see.len / length) * 100))
|
||||
emote("auto",1,pick(emote_see))
|
||||
else if(emote_hear.len)
|
||||
emote("auto",2,pick(emote_hear))
|
||||
//var/act,var/m_type=1,var/message = null
|
||||
|
||||
//Atmos
|
||||
var/atmos_suitable = 1
|
||||
|
||||
var/atom/A = src.loc
|
||||
if(isturf(A))
|
||||
var/turf/T = A
|
||||
var/areatemp = T.temperature
|
||||
if( abs(areatemp - bodytemperature) > 50 )
|
||||
var/diff = areatemp - bodytemperature
|
||||
diff = diff / 5
|
||||
//world << "changed from [bodytemperature] by [diff] to [bodytemperature + diff]"
|
||||
bodytemperature += diff
|
||||
|
||||
if(istype(T,/turf/simulated))
|
||||
var/turf/simulated/ST = T
|
||||
if(ST.air)
|
||||
var/tox = ST.air.toxins
|
||||
var/oxy = ST.air.oxygen
|
||||
var/n2 = ST.air.nitrogen
|
||||
var/co2 = ST.air.carbon_dioxide
|
||||
|
||||
if(min_oxy)
|
||||
if(oxy < min_oxy)
|
||||
atmos_suitable = 0
|
||||
if(max_oxy)
|
||||
if(oxy > max_oxy)
|
||||
atmos_suitable = 0
|
||||
if(min_tox)
|
||||
if(tox < min_tox)
|
||||
atmos_suitable = 0
|
||||
if(max_tox)
|
||||
if(tox > max_tox)
|
||||
atmos_suitable = 0
|
||||
if(min_n2)
|
||||
if(n2 < min_n2)
|
||||
atmos_suitable = 0
|
||||
if(max_n2)
|
||||
if(n2 > max_n2)
|
||||
atmos_suitable = 0
|
||||
if(min_co2)
|
||||
if(co2 < min_co2)
|
||||
atmos_suitable = 0
|
||||
if(max_co2)
|
||||
if(co2 > max_co2)
|
||||
atmos_suitable = 0
|
||||
|
||||
//Atmos effect
|
||||
if(bodytemperature < minbodytemp)
|
||||
health -= cold_damage_per_tick
|
||||
else if(bodytemperature > maxbodytemp)
|
||||
health -= heat_damage_per_tick
|
||||
|
||||
if(!atmos_suitable)
|
||||
health -= unsuitable_atoms_damage
|
||||
@@ -1,57 +1,4 @@
|
||||
/mob/living/simple_animal
|
||||
name = "animal"
|
||||
var/icon_living = ""
|
||||
var/icon_dead = ""
|
||||
maxHealth = 20
|
||||
var/alive = 1
|
||||
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_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
|
||||
var/turns_since_move = 0
|
||||
universal_speak = 1
|
||||
var/meat_amount = 0
|
||||
var/meat_type
|
||||
var/stop_automated_movement = 0 //Use this to temporarely stop random movement or to if you write special movement code for animals.
|
||||
|
||||
//Interaction
|
||||
var/response_help = "You try to help"
|
||||
var/response_disarm = "You try to disarm"
|
||||
var/response_harm = "You try to hurt"
|
||||
var/harm_intent_damage = 3
|
||||
|
||||
//Temperature effect
|
||||
var/minbodytemp = 270
|
||||
var/maxbodytemp = 370
|
||||
var/heat_damage_per_tick = 3 //amount of damage applied if animal's body temperature is higher than maxbodytemp
|
||||
var/cold_damage_per_tick = 2 //same as heat_damage_per_tick, only if the bodytemperature it's lower than minbodytemp
|
||||
|
||||
//Atmos effect - Yes, you can make creatures that require plasma or co2 to survive. N2O is a trace gas and handled separately, hence why it isn't here. It'd be hard to add it. Hard and me don't mix (Yes, yes make all the dick jokes you want with that.) - Errorage
|
||||
var/min_oxy = 5
|
||||
var/max_oxy = 0 //Leaving something at 0 means it's off - has no maximum
|
||||
var/min_tox = 0
|
||||
var/max_tox = 1
|
||||
var/min_co2 = 0
|
||||
var/max_co2 = 5
|
||||
var/min_n2 = 0
|
||||
var/max_n2 = 0
|
||||
var/unsuitable_atoms_damage = 2 //This damage is taken when atmos doesn't fit all the requirements above
|
||||
|
||||
|
||||
//LETTING SIMPLE ANIMALS ATTACK? WHAT COULD GO WRONG. Defaults to zero so Ian can still be cuddly
|
||||
var/melee_damage_lower = 0
|
||||
var/melee_damage_upper = 0
|
||||
var/attacktext = "attacks"
|
||||
var/attack_sound = null
|
||||
var/friendly = "nuzzles" //If the mob does no damage with it's attack
|
||||
var/wall_smash = 0 //if they can smash walls
|
||||
|
||||
var/speed = 0 //LETS SEE IF I CAN SET SPEEDS FOR SIMPLE MOBS WITHOUT DESTROYING EVERYTHING. Higher speed is slower, negative speed is faster
|
||||
|
||||
var/obj/item/device/radio/headset/l_ear = null
|
||||
/mob/living/simple_animal/New()
|
||||
..()
|
||||
verbs -= /mob/verb/observe
|
||||
@@ -61,137 +8,6 @@
|
||||
src.client.screen = null
|
||||
..()
|
||||
|
||||
/mob/living/simple_animal/Life()
|
||||
|
||||
//Health
|
||||
if(!alive)
|
||||
if(health > 0)
|
||||
icon_state = icon_living
|
||||
alive = 1
|
||||
stat = CONSCIOUS
|
||||
density = 1
|
||||
return
|
||||
|
||||
|
||||
if(health < 1)
|
||||
Die()
|
||||
|
||||
if(health > maxHealth)
|
||||
health = maxHealth
|
||||
|
||||
/*
|
||||
// Stun/Weaken
|
||||
|
||||
if (paralysis || stunned || weakened) //Stunned etc.
|
||||
if (stunned > 0)
|
||||
AdjustStunned(-1)
|
||||
stat = 0
|
||||
if (weakened > 0)
|
||||
AdjustWeakened(-1)
|
||||
lying = 1
|
||||
stat = 0
|
||||
if (paralysis > 0)
|
||||
AdjustParalysis(-1)
|
||||
blinded = 1
|
||||
lying = 1
|
||||
stat = 1
|
||||
var/h = hand
|
||||
hand = 0
|
||||
drop_item()
|
||||
hand = 1
|
||||
drop_item()
|
||||
hand = h
|
||||
|
||||
else //Not stunned.
|
||||
lying = 0
|
||||
stat = 0
|
||||
|
||||
if(paralysis || stunned || weakened || buckled)
|
||||
canmove = 0
|
||||
else
|
||||
canmove = 1
|
||||
*/
|
||||
//Movement
|
||||
if(!ckey && !stop_automated_movement)
|
||||
if(isturf(src.loc) && !resting && !buckled && canmove) //This is so it only moves if it's not inside a closet, gentics machine, etc.
|
||||
turns_since_move++
|
||||
if(turns_since_move >= turns_per_move)
|
||||
Move(get_step(src,pick(cardinal)))
|
||||
turns_since_move = 0
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
//Speaking
|
||||
if(prob(speak_chance))
|
||||
var/length = speak.len + emote_hear.len + emote_see.len
|
||||
if(speak.len && prob((speak.len / length) * 100))
|
||||
say(pick(speak))
|
||||
else if(emote_see.len && prob((emote_see.len / length) * 100))
|
||||
emote("auto",1,pick(emote_see))
|
||||
else if(emote_hear.len)
|
||||
emote("auto",2,pick(emote_hear))
|
||||
//var/act,var/m_type=1,var/message = null
|
||||
|
||||
|
||||
//Atmos
|
||||
var/atmos_suitable = 1
|
||||
|
||||
var/atom/A = src.loc
|
||||
if(isturf(A))
|
||||
var/turf/T = A
|
||||
var/areatemp = T.temperature
|
||||
if( abs(areatemp - bodytemperature) > 50 )
|
||||
var/diff = areatemp - bodytemperature
|
||||
diff = diff / 5
|
||||
//world << "changed from [bodytemperature] by [diff] to [bodytemperature + diff]"
|
||||
bodytemperature += diff
|
||||
|
||||
if(istype(T,/turf/simulated))
|
||||
var/turf/simulated/ST = T
|
||||
if(ST.air)
|
||||
var/tox = ST.air.toxins
|
||||
var/oxy = ST.air.oxygen
|
||||
var/n2 = ST.air.nitrogen
|
||||
var/co2 = ST.air.carbon_dioxide
|
||||
|
||||
if(min_oxy)
|
||||
if(oxy < min_oxy)
|
||||
atmos_suitable = 0
|
||||
if(max_oxy)
|
||||
if(oxy > max_oxy)
|
||||
atmos_suitable = 0
|
||||
if(min_tox)
|
||||
if(tox < min_tox)
|
||||
atmos_suitable = 0
|
||||
if(max_tox)
|
||||
if(tox > max_tox)
|
||||
atmos_suitable = 0
|
||||
if(min_n2)
|
||||
if(n2 < min_n2)
|
||||
atmos_suitable = 0
|
||||
if(max_n2)
|
||||
if(n2 > max_n2)
|
||||
atmos_suitable = 0
|
||||
if(min_co2)
|
||||
if(co2 < min_co2)
|
||||
atmos_suitable = 0
|
||||
if(max_co2)
|
||||
if(co2 > max_co2)
|
||||
atmos_suitable = 0
|
||||
|
||||
//Atmos effect
|
||||
if(bodytemperature < minbodytemp)
|
||||
health -= cold_damage_per_tick
|
||||
else if(bodytemperature > maxbodytemp)
|
||||
health -= heat_damage_per_tick
|
||||
|
||||
if(!atmos_suitable)
|
||||
health -= unsuitable_atoms_damage
|
||||
|
||||
/mob/living/simple_animal/Bumped(AM as mob|obj)
|
||||
if(!AM) return
|
||||
if(isturf(src.loc) && !resting && !buckled)
|
||||
@@ -217,9 +33,8 @@
|
||||
|
||||
/mob/living/simple_animal/emote(var/act,var/m_type=1,var/message = null)
|
||||
switch(act)
|
||||
|
||||
if ("scream")
|
||||
message = "<B>[src]</B> screams!"
|
||||
message = "<B>[src]</B> makes a loud and pained whimper"
|
||||
m_type = 2
|
||||
|
||||
if ("custom")
|
||||
@@ -332,7 +147,7 @@
|
||||
|
||||
/mob/living/simple_animal/attackby(var/obj/item/O as obj, var/mob/user as mob) //Marker -Agouri
|
||||
if(istype(O, /obj/item/stack/medical))
|
||||
if(alive)
|
||||
if(stat != DEAD)
|
||||
var/obj/item/stack/medical/MED = O
|
||||
if(health < maxHealth)
|
||||
if(MED.amount >= 1)
|
||||
@@ -372,7 +187,6 @@
|
||||
stat(null, "Health: [round((health / maxHealth) * 100)]%")
|
||||
|
||||
/mob/living/simple_animal/proc/Die()
|
||||
alive = 0
|
||||
icon_state = icon_dead
|
||||
stat = DEAD
|
||||
density = 0
|
||||
@@ -391,4 +205,4 @@
|
||||
|
||||
|
||||
if(3.0)
|
||||
health -= 30
|
||||
health -= 30
|
||||
BIN
icons/mob/animal.dmi
Normal file
BIN
icons/mob/animal.dmi
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 66 KiB |
Binary file not shown.
|
Before Width: | Height: | Size: 80 KiB After Width: | Height: | Size: 33 KiB |
BIN
sound/effects/mousesqueek.ogg
Normal file
BIN
sound/effects/mousesqueek.ogg
Normal file
Binary file not shown.
Reference in New Issue
Block a user