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:
Rob Nelson
2017-02-25 15:04:06 -08:00
committed by Probe1
parent 3d70cc1a86
commit fe929e5849
24 changed files with 810 additions and 3 deletions

View 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"])

View 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