mirror of
https://github.com/vgstation-coders/vgstation13.git
synced 2025-12-10 10:21:11 +00:00
Component Model + PoC Mob (#13866)
* Initial work on component mobs. * Revert simple_animal.dm * Fix movement. * Component signals are now #defines. * Fix magic number in atmos.dm * Added basic melee attacks. * Get rid of test spam
This commit is contained in:
26
code/modules/components/ai/controllers/mob_controller.dm
Normal file
26
code/modules/components/ai/controllers/mob_controller.dm
Normal file
@@ -0,0 +1,26 @@
|
||||
/datum/component/controller/mob
|
||||
var/walk_delay=4
|
||||
|
||||
/datum/component/controller/mob/RecieveSignal(var/message_type, var/list/args)
|
||||
if(isliving(container.holder))
|
||||
var/mob/living/M=container.holder
|
||||
//testing("Got command: \[[message_type]\]: [json_encode(args)]")
|
||||
switch(message_type)
|
||||
if(COMSIG_MOVE) // list("loc"=turf)
|
||||
// list("dir"=NORTH)
|
||||
if("loc" in args)
|
||||
//walk_to(src, target, minimum_distance, delay)
|
||||
//testing("Walking towards [args["loc"]] with walk_delay=[walk_delay]")
|
||||
walk_to(M, args["loc"], 1, walk_delay)
|
||||
if("dir" in args)
|
||||
// walk(M, get_dir(src,M), MISSILE_SPEED)
|
||||
walk(M, args["dir"], walk_delay)
|
||||
|
||||
if(COMSIG_ADJUST_BODYTEMP) // list("temp"=TEMP_IN_KELVIN)
|
||||
M.bodytemperature += args["temp"]
|
||||
|
||||
if(COMSIG_SET_BODYTEMP) // list("temp"=TEMP_IN_KELVIN)
|
||||
M.bodytemperature = args["temp"]
|
||||
|
||||
if(COMSIG_STATE) // list("state"=HOSTILE_STANCE_ATTACK)
|
||||
setState(args["state"])
|
||||
8
code/modules/components/ai/controllers/simple_animal.dm
Normal file
8
code/modules/components/ai/controllers/simple_animal.dm
Normal file
@@ -0,0 +1,8 @@
|
||||
/datum/component/controller/simple_animal
|
||||
var/disable_automove_on_busy=1
|
||||
|
||||
/datum/component/controller/simple_animal/setBusy(var/yes)
|
||||
..(yes)
|
||||
if(disable_automove_on_busy)
|
||||
var/mob/living/simple_animal/SA = holder
|
||||
SA.stop_automated_movement = yes
|
||||
Reference in New Issue
Block a user