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)))
|
#f)))
|
||||||
(when (< 0.5 (random))
|
(when (< 0.5 (random))
|
||||||
(set-order-stance! o (pick-random '(high mid low))))
|
(set-order-stance! o (pick-random '(high mid low))))
|
||||||
(set-order-atk!
|
(when (or (< 1 (unit-health enemy-unit))
|
||||||
o
|
(< 0.5 (random)))
|
||||||
(let ((roll (random)))
|
(set-order-atk!
|
||||||
(cond
|
o
|
||||||
((> 0.6 roll) (unit-hand-pos enemy-unit))
|
(let ((roll (random)))
|
||||||
((> 0.8 roll) (rotate-pos-cc (unit-hand-pos enemy-unit)))
|
(cond
|
||||||
(else (rotate-pos (unit-hand-pos enemy-unit))))))
|
((> 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)))))))
|
||||||
o))
|
o))
|
||||||
|
|
||||||
(define (win)
|
(define (win)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue