mirror of
https://github.com/CHOMPStation2/CHOMPStation2.git
synced 2025-12-10 10:12:45 +00:00
Work on NPC clowns for the clown planet away mission.
They start peaceful, but attacking them causes them to attack you like a carp. Attacking a clown will also make all other clowns that can see the attack hostile. If a clown sees a clown attacking someone, they'll join in the attack git-svn-id: http://tgstation13.googlecode.com/svn/trunk@4711 316c924e-a436-60f5-8080-3fe189b3f50e
This commit is contained in:
167
code/modules/mob/living/simple_animal/clown.dm
Normal file
167
code/modules/mob/living/simple_animal/clown.dm
Normal file
@@ -0,0 +1,167 @@
|
||||
#define CLOWN_STANCE_IDLE 1
|
||||
#define CLOWN_STANCE_ATTACK 2
|
||||
#define CLOWN_STANCE_ATTACKING 3
|
||||
|
||||
/mob/living/simple_animal/clown
|
||||
name = "Clown"
|
||||
desc = "A denizen of clown planet"
|
||||
icon_state = "clown"
|
||||
icon_living = "clown"
|
||||
icon_dead = "clown_dead"
|
||||
icon_gib = "clown_gib"
|
||||
speak_chance = 0
|
||||
turns_per_move = 5
|
||||
response_help = "pokes the"
|
||||
response_disarm = "gently pushes aside the"
|
||||
response_harm = "hits the"
|
||||
speak = list("HONK", "Honk!", "Welcome to clown planet!")
|
||||
emote_see = list("honks")
|
||||
speak_chance = 1
|
||||
|
||||
stop_automated_movement_when_pulled = 0
|
||||
maxHealth = 75
|
||||
health = 75
|
||||
|
||||
harm_intent_damage = 8
|
||||
melee_damage_lower = 10
|
||||
melee_damage_upper = 10
|
||||
attacktext = "attacks"
|
||||
|
||||
min_oxy = 5
|
||||
max_oxy = 0
|
||||
min_tox = 0
|
||||
max_tox = 1
|
||||
min_co2 = 0
|
||||
max_co2 = 5
|
||||
min_n2 = 0
|
||||
max_n2 = 0
|
||||
minbodytemp = 0
|
||||
|
||||
var/hostile = 0
|
||||
|
||||
var/stance = CLOWN_STANCE_IDLE //Used to determine behavior
|
||||
var/stance_step = 0 //Used to delay checks depending on what stance the clown is in
|
||||
var/mob/living/target_mob
|
||||
|
||||
/mob/living/simple_animal/clown/Life()
|
||||
if(stat == DEAD)
|
||||
walk(src,0)//STOP FUCKING MOVING GODDAMN
|
||||
if(health > 0)
|
||||
icon_state = icon_living
|
||||
dead_mob_list -= src
|
||||
living_mob_list += src
|
||||
stat = CONSCIOUS
|
||||
density = 1
|
||||
return
|
||||
|
||||
|
||||
if(health < 1)
|
||||
Die()
|
||||
|
||||
if(health > maxHealth)
|
||||
health = maxHealth
|
||||
|
||||
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)
|
||||
if(!(stop_automated_movement_when_pulled && pulledby)) //Soma animals don't move when pulled
|
||||
Move(get_step(src,pick(cardinal)))
|
||||
turns_since_move = 0
|
||||
|
||||
if(!stat)
|
||||
switch(stance)
|
||||
if(CLOWN_STANCE_IDLE)
|
||||
if (src.hostile == 0) return
|
||||
stop_automated_movement = 0
|
||||
stance_step++
|
||||
if(stance_step > 5)
|
||||
stance_step = 0
|
||||
for( var/mob/living/L in viewers(7,src) )
|
||||
if(isclown(L)) continue
|
||||
if(!L.stat)
|
||||
emote("honks menacingly at [L]")
|
||||
stance = CLOWN_STANCE_ATTACK
|
||||
target_mob = L
|
||||
break
|
||||
|
||||
if(CLOWN_STANCE_ATTACK) //This one should only be active for one tick
|
||||
stop_automated_movement = 1
|
||||
if(!target_mob || target_mob.stat)
|
||||
stance = CLOWN_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 = CLOWN_STANCE_ATTACKING
|
||||
stance_step = 0
|
||||
|
||||
if(CLOWN_STANCE_ATTACKING)
|
||||
stop_automated_movement = 1
|
||||
stance_step++
|
||||
if(!target_mob || target_mob.stat)
|
||||
stance = CLOWN_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 = CLOWN_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>")
|
||||
for(var/mob/M in viewers(src, null))
|
||||
if(istype(M, /mob/living/simple_animal/clown))
|
||||
var/mob/living/simple_animal/clown/C = M
|
||||
C.hostile = 1
|
||||
|
||||
/mob/living/simple_animal/clown/bullet_act(var/obj/item/projectile/Proj)
|
||||
..()
|
||||
hostile = 1
|
||||
for(var/mob/M in viewers(src, null))
|
||||
if(istype(M, /mob/living/simple_animal/clown))
|
||||
var/mob/living/simple_animal/clown/C = M
|
||||
C.hostile = 1
|
||||
return 0
|
||||
|
||||
|
||||
/mob/living/simple_animal/clown/attackby(var/obj/item/O as obj, var/mob/user as mob)
|
||||
..()
|
||||
hostile = 1
|
||||
for(var/mob/Z in viewers(src, null))
|
||||
if(istype(Z, /mob/living/simple_animal/clown))
|
||||
var/mob/living/simple_animal/clown/C = Z
|
||||
C.hostile = 1
|
||||
return 0
|
||||
|
||||
/mob/living/simple_animal/clown/attack_alien(mob/living/carbon/alien/humanoid/M as mob)
|
||||
..()
|
||||
hostile = 1
|
||||
for(var/mob/Z in viewers(src, null))
|
||||
if(istype(Z, /mob/living/simple_animal/clown))
|
||||
var/mob/living/simple_animal/clown/C = Z
|
||||
C.hostile = 1
|
||||
return 0
|
||||
|
||||
/mob/living/simple_animal/clown/attack_hand(mob/living/carbon/human/M as mob)
|
||||
..()
|
||||
hostile = 1
|
||||
for(var/mob/Z in viewers(src, null))
|
||||
if(istype(Z, /mob/living/simple_animal/clown))
|
||||
var/mob/living/simple_animal/clown/C = Z
|
||||
C.hostile = 1
|
||||
return 0
|
||||
|
||||
/mob/living/simple_animal/clown/attack_animal(mob/living/simple_animal/M as mob)
|
||||
..()
|
||||
hostile = 1
|
||||
for(var/mob/Z in viewers(src, null))
|
||||
if(istype(Z, /mob/living/simple_animal/clown))
|
||||
var/mob/living/simple_animal/clown/C = Z
|
||||
C.hostile = 1
|
||||
return 0
|
||||
@@ -75,6 +75,11 @@
|
||||
return 1
|
||||
return 0
|
||||
|
||||
/proc/isclown(A)
|
||||
if(istype(A, /mob/living/simple_animal/clown))
|
||||
return 1
|
||||
return 0
|
||||
|
||||
/proc/isAI(A)
|
||||
if(istype(A, /mob/living/silicon/ai))
|
||||
return 1
|
||||
|
||||
Binary file not shown.
|
Before Width: | Height: | Size: 114 KiB After Width: | Height: | Size: 117 KiB |
215
tgstation.dme
215
tgstation.dme
@@ -6,6 +6,220 @@
|
||||
|
||||
// BEGIN_FILE_DIR
|
||||
#define FILE_DIR .
|
||||
#define FILE_DIR "code"
|
||||
#define FILE_DIR "code/ATMOSPHERICS"
|
||||
#define FILE_DIR "code/ATMOSPHERICS/components"
|
||||
#define FILE_DIR "code/ATMOSPHERICS/components/binary_devices"
|
||||
#define FILE_DIR "code/ATMOSPHERICS/components/trinary_devices"
|
||||
#define FILE_DIR "code/ATMOSPHERICS/components/unary"
|
||||
#define FILE_DIR "code/controllers"
|
||||
#define FILE_DIR "code/datums"
|
||||
#define FILE_DIR "code/datums/diseases"
|
||||
#define FILE_DIR "code/datums/helper_datums"
|
||||
#define FILE_DIR "code/datums/organs"
|
||||
#define FILE_DIR "code/datums/spells"
|
||||
#define FILE_DIR "code/defines"
|
||||
#define FILE_DIR "code/defines/obj"
|
||||
#define FILE_DIR "code/defines/procs"
|
||||
#define FILE_DIR "code/FEA"
|
||||
#define FILE_DIR "code/game"
|
||||
#define FILE_DIR "code/game/area"
|
||||
#define FILE_DIR "code/game/gamemodes"
|
||||
#define FILE_DIR "code/game/gamemodes/blob"
|
||||
#define FILE_DIR "code/game/gamemodes/blob/blobs"
|
||||
#define FILE_DIR "code/game/gamemodes/changeling"
|
||||
#define FILE_DIR "code/game/gamemodes/cult"
|
||||
#define FILE_DIR "code/game/gamemodes/events"
|
||||
#define FILE_DIR "code/game/gamemodes/events/holidays"
|
||||
#define FILE_DIR "code/game/gamemodes/extended"
|
||||
#define FILE_DIR "code/game/gamemodes/malfunction"
|
||||
#define FILE_DIR "code/game/gamemodes/meteor"
|
||||
#define FILE_DIR "code/game/gamemodes/nuclear"
|
||||
#define FILE_DIR "code/game/gamemodes/revolution"
|
||||
#define FILE_DIR "code/game/gamemodes/sandbox"
|
||||
#define FILE_DIR "code/game/gamemodes/traitor"
|
||||
#define FILE_DIR "code/game/gamemodes/wizard"
|
||||
#define FILE_DIR "code/game/jobs"
|
||||
#define FILE_DIR "code/game/jobs/job"
|
||||
#define FILE_DIR "code/game/machinery"
|
||||
#define FILE_DIR "code/game/machinery/atmoalter"
|
||||
#define FILE_DIR "code/game/machinery/bots"
|
||||
#define FILE_DIR "code/game/machinery/camera"
|
||||
#define FILE_DIR "code/game/machinery/computer"
|
||||
#define FILE_DIR "code/game/machinery/doors"
|
||||
#define FILE_DIR "code/game/machinery/embedded_controller"
|
||||
#define FILE_DIR "code/game/machinery/kitchen"
|
||||
#define FILE_DIR "code/game/machinery/pipe"
|
||||
#define FILE_DIR "code/game/machinery/telecomms"
|
||||
#define FILE_DIR "code/game/mecha"
|
||||
#define FILE_DIR "code/game/mecha/combat"
|
||||
#define FILE_DIR "code/game/mecha/equipment"
|
||||
#define FILE_DIR "code/game/mecha/equipment/tools"
|
||||
#define FILE_DIR "code/game/mecha/equipment/weapons"
|
||||
#define FILE_DIR "code/game/mecha/medical"
|
||||
#define FILE_DIR "code/game/mecha/working"
|
||||
#define FILE_DIR "code/game/objects"
|
||||
#define FILE_DIR "code/game/objects/effects"
|
||||
#define FILE_DIR "code/game/objects/effects/decals"
|
||||
#define FILE_DIR "code/game/objects/effects/decals/Cleanable"
|
||||
#define FILE_DIR "code/game/objects/effects/spawners"
|
||||
#define FILE_DIR "code/game/objects/items"
|
||||
#define FILE_DIR "code/game/objects/items/devices"
|
||||
#define FILE_DIR "code/game/objects/items/devices/PDA"
|
||||
#define FILE_DIR "code/game/objects/items/devices/radio"
|
||||
#define FILE_DIR "code/game/objects/items/robot"
|
||||
#define FILE_DIR "code/game/objects/items/stacks"
|
||||
#define FILE_DIR "code/game/objects/items/stacks/sheets"
|
||||
#define FILE_DIR "code/game/objects/items/stacks/tiles"
|
||||
#define FILE_DIR "code/game/objects/items/weapons"
|
||||
#define FILE_DIR "code/game/objects/items/weapons/grenades"
|
||||
#define FILE_DIR "code/game/objects/items/weapons/implants"
|
||||
#define FILE_DIR "code/game/objects/items/weapons/secstorage"
|
||||
#define FILE_DIR "code/game/objects/items/weapons/storage"
|
||||
#define FILE_DIR "code/game/objects/items/weapons/tanks"
|
||||
#define FILE_DIR "code/game/objects/structures"
|
||||
#define FILE_DIR "code/game/objects/structures/crates_lockers"
|
||||
#define FILE_DIR "code/game/objects/structures/crates_lockers/closets"
|
||||
#define FILE_DIR "code/game/objects/structures/crates_lockers/closets/secure"
|
||||
#define FILE_DIR "code/game/objects/structures/stool_bed_chair_nest"
|
||||
#define FILE_DIR "code/game/turfs"
|
||||
#define FILE_DIR "code/game/turfs/simulated"
|
||||
#define FILE_DIR "code/game/turfs/space"
|
||||
#define FILE_DIR "code/game/turfs/unsimulated"
|
||||
#define FILE_DIR "code/game/vehicles"
|
||||
#define FILE_DIR "code/game/vehicles/airtight"
|
||||
#define FILE_DIR "code/game/verbs"
|
||||
#define FILE_DIR "code/js"
|
||||
#define FILE_DIR "code/modules"
|
||||
#define FILE_DIR "code/modules/admin"
|
||||
#define FILE_DIR "code/modules/admin/DB ban"
|
||||
#define FILE_DIR "code/modules/admin/verbs"
|
||||
#define FILE_DIR "code/modules/assembly"
|
||||
#define FILE_DIR "code/modules/awaymissions"
|
||||
#define FILE_DIR "code/modules/awaymissions/maploader"
|
||||
#define FILE_DIR "code/modules/client"
|
||||
#define FILE_DIR "code/modules/clothing"
|
||||
#define FILE_DIR "code/modules/clothing/glasses"
|
||||
#define FILE_DIR "code/modules/clothing/gloves"
|
||||
#define FILE_DIR "code/modules/clothing/head"
|
||||
#define FILE_DIR "code/modules/clothing/masks"
|
||||
#define FILE_DIR "code/modules/clothing/shoes"
|
||||
#define FILE_DIR "code/modules/clothing/spacesuits"
|
||||
#define FILE_DIR "code/modules/clothing/suits"
|
||||
#define FILE_DIR "code/modules/clothing/under"
|
||||
#define FILE_DIR "code/modules/clothing/under/jobs"
|
||||
#define FILE_DIR "code/modules/critters"
|
||||
#define FILE_DIR "code/modules/critters/hivebots"
|
||||
#define FILE_DIR "code/modules/detectivework"
|
||||
#define FILE_DIR "code/modules/flufftext"
|
||||
#define FILE_DIR "code/modules/food"
|
||||
#define FILE_DIR "code/modules/library"
|
||||
#define FILE_DIR "code/modules/liquid"
|
||||
#define FILE_DIR "code/modules/mining"
|
||||
#define FILE_DIR "code/modules/mob"
|
||||
#define FILE_DIR "code/modules/mob/dead"
|
||||
#define FILE_DIR "code/modules/mob/dead/observer"
|
||||
#define FILE_DIR "code/modules/mob/living"
|
||||
#define FILE_DIR "code/modules/mob/living/blob"
|
||||
#define FILE_DIR "code/modules/mob/living/carbon"
|
||||
#define FILE_DIR "code/modules/mob/living/carbon/alien"
|
||||
#define FILE_DIR "code/modules/mob/living/carbon/alien/humanoid"
|
||||
#define FILE_DIR "code/modules/mob/living/carbon/alien/humanoid/caste"
|
||||
#define FILE_DIR "code/modules/mob/living/carbon/alien/larva"
|
||||
#define FILE_DIR "code/modules/mob/living/carbon/alien/special"
|
||||
#define FILE_DIR "code/modules/mob/living/carbon/brain"
|
||||
#define FILE_DIR "code/modules/mob/living/carbon/human"
|
||||
#define FILE_DIR "code/modules/mob/living/carbon/metroid"
|
||||
#define FILE_DIR "code/modules/mob/living/carbon/monkey"
|
||||
#define FILE_DIR "code/modules/mob/living/silicon"
|
||||
#define FILE_DIR "code/modules/mob/living/silicon/ai"
|
||||
#define FILE_DIR "code/modules/mob/living/silicon/ai/freelook"
|
||||
#define FILE_DIR "code/modules/mob/living/silicon/decoy"
|
||||
#define FILE_DIR "code/modules/mob/living/silicon/pai"
|
||||
#define FILE_DIR "code/modules/mob/living/silicon/robot"
|
||||
#define FILE_DIR "code/modules/mob/living/simple_animal"
|
||||
#define FILE_DIR "code/modules/mob/new_player"
|
||||
#define FILE_DIR "code/modules/paperwork"
|
||||
#define FILE_DIR "code/modules/power"
|
||||
#define FILE_DIR "code/modules/power/antimatter"
|
||||
#define FILE_DIR "code/modules/power/singularity"
|
||||
#define FILE_DIR "code/modules/power/singularity/particle_accelerator"
|
||||
#define FILE_DIR "code/modules/projectiles"
|
||||
#define FILE_DIR "code/modules/projectiles/ammunition"
|
||||
#define FILE_DIR "code/modules/projectiles/guns"
|
||||
#define FILE_DIR "code/modules/projectiles/guns/energy"
|
||||
#define FILE_DIR "code/modules/projectiles/guns/projectile"
|
||||
#define FILE_DIR "code/modules/projectiles/projectile"
|
||||
#define FILE_DIR "code/modules/reagents"
|
||||
#define FILE_DIR "code/modules/reagents/reagent_containers"
|
||||
#define FILE_DIR "code/modules/reagents/reagent_containers/food"
|
||||
#define FILE_DIR "code/modules/reagents/reagent_containers/food/drinks"
|
||||
#define FILE_DIR "code/modules/reagents/reagent_containers/food/drinks/bottle"
|
||||
#define FILE_DIR "code/modules/reagents/reagent_containers/food/snacks"
|
||||
#define FILE_DIR "code/modules/reagents/reagent_containers/glass"
|
||||
#define FILE_DIR "code/modules/reagents/reagent_containers/glass/bottle"
|
||||
#define FILE_DIR "code/modules/recycling"
|
||||
#define FILE_DIR "code/modules/research"
|
||||
#define FILE_DIR "code/modules/scripting"
|
||||
#define FILE_DIR "code/modules/scripting/AST"
|
||||
#define FILE_DIR "code/modules/scripting/AST/Operators"
|
||||
#define FILE_DIR "code/modules/scripting/Implementations"
|
||||
#define FILE_DIR "code/modules/scripting/Interpreter"
|
||||
#define FILE_DIR "code/modules/scripting/Parser"
|
||||
#define FILE_DIR "code/modules/scripting/Scanner"
|
||||
#define FILE_DIR "code/modules/security levels"
|
||||
#define FILE_DIR "code/unused"
|
||||
#define FILE_DIR "code/unused/beast"
|
||||
#define FILE_DIR "code/unused/computer2"
|
||||
#define FILE_DIR "code/unused/disease2"
|
||||
#define FILE_DIR "code/unused/gamemodes"
|
||||
#define FILE_DIR "code/unused/hivebot"
|
||||
#define FILE_DIR "code/unused/mining"
|
||||
#define FILE_DIR "code/unused/optics"
|
||||
#define FILE_DIR "code/unused/pda2"
|
||||
#define FILE_DIR "code/unused/powerarmor"
|
||||
#define FILE_DIR "code/unused/spacecraft"
|
||||
#define FILE_DIR "code/WorkInProgress"
|
||||
#define FILE_DIR "code/WorkInProgress/carn"
|
||||
#define FILE_DIR "code/WorkInProgress/mapload"
|
||||
#define FILE_DIR "code/WorkInProgress/organs"
|
||||
#define FILE_DIR "code/WorkInProgress/virus2"
|
||||
#define FILE_DIR "html"
|
||||
#define FILE_DIR "icons"
|
||||
#define FILE_DIR "icons/effects"
|
||||
#define FILE_DIR "icons/mecha"
|
||||
#define FILE_DIR "icons/misc"
|
||||
#define FILE_DIR "icons/mob"
|
||||
#define FILE_DIR "icons/obj"
|
||||
#define FILE_DIR "icons/obj/assemblies"
|
||||
#define FILE_DIR "icons/obj/atmospherics"
|
||||
#define FILE_DIR "icons/obj/clothing"
|
||||
#define FILE_DIR "icons/obj/doors"
|
||||
#define FILE_DIR "icons/obj/machines"
|
||||
#define FILE_DIR "icons/obj/pipes"
|
||||
#define FILE_DIR "icons/pda_icons"
|
||||
#define FILE_DIR "icons/spideros_icons"
|
||||
#define FILE_DIR "icons/Testing"
|
||||
#define FILE_DIR "icons/turf"
|
||||
#define FILE_DIR "icons/vehicles"
|
||||
#define FILE_DIR "icons/vending_icons"
|
||||
#define FILE_DIR "interface"
|
||||
#define FILE_DIR "maps"
|
||||
#define FILE_DIR "maps/RandomZLevels"
|
||||
#define FILE_DIR "sound"
|
||||
#define FILE_DIR "sound/AI"
|
||||
#define FILE_DIR "sound/ambience"
|
||||
#define FILE_DIR "sound/effects"
|
||||
#define FILE_DIR "sound/hallucinations"
|
||||
#define FILE_DIR "sound/items"
|
||||
#define FILE_DIR "sound/machines"
|
||||
#define FILE_DIR "sound/mecha"
|
||||
#define FILE_DIR "sound/misc"
|
||||
#define FILE_DIR "sound/piano"
|
||||
#define FILE_DIR "sound/voice"
|
||||
#define FILE_DIR "sound/weapons"
|
||||
#define FILE_DIR "tools"
|
||||
#define FILE_DIR "tools/Redirector"
|
||||
// END_FILE_DIR
|
||||
|
||||
// BEGIN_PREFERENCES
|
||||
@@ -872,6 +1086,7 @@
|
||||
#include "code\modules\mob\living\simple_animal\behemoth.dm"
|
||||
#include "code\modules\mob\living\simple_animal\carp.dm"
|
||||
#include "code\modules\mob\living\simple_animal\cat.dm"
|
||||
#include "code\modules\mob\living\simple_animal\clown.dm"
|
||||
#include "code\modules\mob\living\simple_animal\constructs.dm"
|
||||
#include "code\modules\mob\living\simple_animal\corgi.dm"
|
||||
#include "code\modules\mob\living\simple_animal\crab.dm"
|
||||
|
||||
Reference in New Issue
Block a user