Make AI prioritize fleeing at low health
This commit is contained in:
parent
57ec098b10
commit
d4d0806abb
1 changed files with 9 additions and 7 deletions
|
|
@ -90,13 +90,15 @@
|
|||
#f)))
|
||||
(when (< 0.5 (random))
|
||||
(set-order-stance! o (pick-random '(high mid low))))
|
||||
(when (or (< 1 (unit-health enemy-unit))
|
||||
(< 0.5 (random)))
|
||||
(set-order-atk!
|
||||
o
|
||||
(let ((roll (random)))
|
||||
(cond
|
||||
((> 0.6 roll) (unit-hand-pos enemy-unit))
|
||||
((> 0.8 roll) (rotate-pos-cc (unit-hand-pos enemy-unit)))
|
||||
(else (rotate-pos (unit-hand-pos enemy-unit))))))
|
||||
(else (rotate-pos (unit-hand-pos enemy-unit)))))))
|
||||
o))
|
||||
|
||||
(define (win)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue