[MIRROR] Refactors monkeys into a species (#2379)

* Refactors monkeys into a species

* aaa

Co-authored-by: Qustinnus <Floydje123@hotmail.com>
Co-authored-by: Azarak <azarak10@gmail.com>
This commit is contained in:
SkyratBot
2020-12-31 21:08:07 +01:00
committed by GitHub
co-authored by Qustinnus Azarak
parent 898121f9cd
commit d7f054b035
155 changed files with 614 additions and 1609 deletions
+8 -3
View File
@@ -77,6 +77,8 @@ have ways of interacting with a specific atom and control it. They posses a blac
/// Generates a plan and see if our existing one is still valid.
/datum/ai_controller/process(delta_time)
if(!able_to_run())
var/atom/movable/movable_pawn = pawn
walk(movable_pawn, 0) //stop moving
return //this should remove them from processing in the future through event-based stuff.
if(!current_behaviors?.len)
SelectBehaviors(delta_time)
@@ -101,10 +103,13 @@ have ways of interacting with a specific atom and control it. They posses a blac
///Move somewhere using dumb movement (byond base)
/datum/ai_controller/proc/MoveTo(delta_time)
var/current_loc = get_turf(pawn)
var/atom/movable/movable_pawn = pawn
if(!is_type_in_typecache(get_step(pawn, get_dir(pawn, current_movement_target)), GLOB.dangerous_turfs))
step_towards(pawn, current_movement_target)
if(current_loc == get_turf(pawn))
var/turf/target_turf = get_step_towards(movable_pawn, current_movement_target)
if(!is_type_in_typecache(target_turf, GLOB.dangerous_turfs))
movable_pawn.Move(target_turf, get_dir(current_loc, target_turf))
if(current_loc == get_turf(movable_pawn))
if(++pathing_attempts >= MAX_PATHING_ATTEMPTS)
CancelActions()
pathing_attempts = 0
+3 -2
View File
@@ -156,6 +156,8 @@
/datum/ai_behavior/monkey_attack_mob/finish_action(datum/ai_controller/controller, succeeded)
. = ..()
var/mob/living/living_pawn = controller.pawn
walk(living_pawn, 0)
controller.blackboard[BB_MONKEY_CURRENT_ATTACK_TARGET] = null
/// attack using a held weapon otherwise bite the enemy, then if we are angry there is a chance we might calm down a little
@@ -176,8 +178,7 @@
if(weapon)
weapon.melee_attack_chain(living_pawn, target)
else
target.attack_paw(living_pawn)
living_pawn.UnarmedAttack(target)
// no de-aggro
if(controller.blackboard[BB_MONKEY_AGRESSIVE])
return
+2 -1
View File
@@ -134,7 +134,8 @@ have ways of interacting with a specific mob and control it.
var/mob/living/living_pawn = pawn
if(DT_PROB(25, delta_time) && (living_pawn.mobility_flags & MOBILITY_MOVE) && isturf(living_pawn.loc) && !living_pawn.pulledby)
step(living_pawn, pick(GLOB.cardinals))
var/move_dir = pick(GLOB.alldirs)
living_pawn.Move(get_step(living_pawn, move_dir), move_dir)
else if(DT_PROB(5, delta_time))
INVOKE_ASYNC(living_pawn, /mob.proc/emote, pick("screech"))
else if(DT_PROB(1, delta_time))