[jak2] implement statistics tracker (#3288)

Currently only tracks enemy kills, and how they were killed. There is
currently no menu for this, but I've already added most of the text for
it. Also did a bunch of misc decompilation fixes and renamed some
methods.

Fixes #3277 
Fixes #3278
This commit is contained in:
ManDude 2024-01-11 22:49:41 +00:00 committed by GitHub
parent a80cff9a4c
commit 7a8aa71204
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
241 changed files with 6004 additions and 5135 deletions

View File

@ -23608,7 +23608,7 @@
(define-extern nav-enemy-turn-to-face-point (function vector float none :behavior nav-enemy))
(define-extern nav-enemy-execute-jump (function none :behavior nav-enemy))
(define-extern nav-enemy-jump-land-anim (function none :behavior nav-enemy)) ;; TODO
(define-extern nav-enemy-rnd-float-range (function float float float :behavior nav-enemy))
(define-extern nav-enemy-rnd-float-range (function float float float))
(define-extern nav-enemy-common-post (function none :behavior nav-enemy)) ;; TODO not confirmed
(define-extern nav-enemy-execute-custom-jump (function int float float none :behavior nav-enemy))
(define-extern nav-enemy-initialize-custom-jump (function vector symbol float float float none :behavior nav-enemy))

View File

@ -7425,6 +7425,45 @@
(progress-shadows-extended #x12a2)
(progress-error-no-resolutions #x12a3)
(progress-territory-auto #x12a4)
(progress-kill-stats #x12a5)
(progress-other-stats #x12a6)
(progress-ks-total-killed #x12a7)
(progress-ks-killed-by-jak #x12a8)
(progress-ks-killed-by-darkjak #x12a9)
(progress-ks-killed-by-daxter #x12aa)
(progress-ks-killed-by-others #x12ab)
(progress-ks-source-gun-yellow #x12ac)
(progress-ks-source-gun-red #x12ad)
(progress-ks-source-gun-blue #x12ae)
(progress-ks-source-gun-dark #x12af)
(progress-ks-source-board #x12b0)
(progress-ks-source-board-trick #x12b1)
(progress-ks-source-mech #x12b2)
(progress-ks-source-mech-bonk #x12b3)
(progress-ks-source-turret #x12b4)
(progress-ks-source-punch #x12b5)
(progress-ks-source-flop #x12b6)
(progress-ks-source-uppercut #x12b7)
(progress-ks-source-spin #x12b8)
(progress-ks-source-roll #x12b9)
(progress-ks-source-darkjak-punch #x12ba)
(progress-ks-source-darkjak-flop #x12bb)
(progress-ks-source-darkjak-uppercut #x12bc)
(progress-ks-source-darkjak-spin #x12bd)
(progress-ks-source-darkjak-roll #x12be)
(progress-ks-source-darkjak-bomb0 #x12bf)
(progress-ks-source-darkjak-bomb1 #x12c0)
(progress-ks-source-indax-punch #x12c1)
(progress-ks-source-indax-spin #x12c2)
(progress-ks-source-guard #x12c3)
(progress-ks-source-sig #x12c4)
(progress-ks-source-ashelin #x12c5)
(progress-ks-source-jinx #x12c6)
(progress-ks-source-grim #x12c7)
(progress-ks-source-mog #x12c8)
(progress-ks-source-metalhead #x12c9)
(progress-ks-source-other-bot #x12ca)
(progress-ks-source-other-enemy #x12cb)
(progress-input-options-auto-hide-cursor #x1300)
(progress-menu-reassign-binds #x1301)
(progress-reassign-binds-controller #x1302)
@ -15786,6 +15825,24 @@
(test 22) ;; hi 64
)
;; +++game-h:knocked-type
(defenum knocked-type
:type uint8
(knocked-type-0 0)
(knocked-type-1 1)
(knocked-type-2 2)
(knocked-type-3 3)
(knocked-type-4 4) ;; what the heck is this! (its on gator, and cant trigger it for the life of me)
(knocked-type-5 5)
(knocked-type-6 6)
(knocked-type-7 7)
(knocked-type-8 8)
(knocked-type-9 9)
(knocked-type-10 10)
)
;; ---game-h:knocked-type
(declare-type touching-shapes-entry structure)
(deftype attack-info (structure)
@ -15811,7 +15868,7 @@
(penetrate-using penetrate :offset-assert 136)
(damage float :offset-assert 144)
(shield-damage float :offset-assert 148)
(knock uint8 :offset-assert 152)
(knock knocked-type :offset-assert 152)
(test symbol :offset-assert 156)
)
:method-count-assert 12
@ -27739,7 +27796,7 @@
(define-extern dist-info-valid? (function collide-los-dist-info symbol)) ;;
(define-extern dist-info-append (function collide-los-dist-info vector none)) ;;
(define-extern dist-info-print (function collide-los-dist-info string object)) ;;
(define-extern los-cw-ccw (function (inline-array collide-cache-tri) vector vector float collide-los-result vector float symbol)) ;;
(define-extern los-cw-ccw (function (inline-array collide-cache-tri) vector vector float collide-los-result vector float symbol :behavior camera-slave)) ;;
(define-extern cam-los-spline-collide (function vector vector pat-surface float)) ;;
(define-extern cam-los-setup-lateral (function collide-los-result vector vector symbol :behavior camera-slave)) ;;
(define-extern cam-los-collide (function vector vector collide-los-result pat-surface symbol :behavior camera-slave)) ;;
@ -32812,42 +32869,42 @@
(defenum enemy-flag
:type int64
:bitfield #t
(lock-focus 0)
(death-start 1)
(enable-on-active 2)
(checking-water 3)
(check-water 4)
(spawn-gem 5)
(chase-startup 6)
(attackable-backup 7)
(look-at-focus 8)
(use-notice-distance 9)
(enable-on-notice 10)
(look-at-move-dest 11)
(notice 12)
(auto-reset-penetrate 13)
(jump-check-blocked 14)
(drawn-mirrored 15)
(multi-focus 16)
(alert 17)
(victory 18)
(dangerous-backup 19)
(actor-pause-backup 20)
(trackable 21)
(called-dying 22)
(check-water-backup 23)
(no-initial-move-to-ground 24)
(cam-attack-mode 25)
(trackable-backup 26)
(enable-on-hostile 27)
(directed-ready 28)
(use-trigger 29)
(directed 30)
(dislike-combo 31)
(recover-applied-velocity 32)
(vulnerable-backup 33)
(vulnerable 34)
(recover 35)
(look-at-focus 0)
(look-at-move-dest 1)
(vulnerable 2)
(vulnerable-backup 3)
(dangerous-backup 4)
(notice 5)
(alert 6)
(auto-reset-penetrate 7)
(victory 8)
(cam-attack-mode 9)
(use-notice-distance 10)
(attackable-backup 11)
(actor-pause-backup 12)
(enable-on-notice 13)
(enable-on-active 14)
(enable-on-hostile 15)
(dislike-combo 16)
(directed 17)
(directed-ready 18)
(chase-startup 19)
(lock-focus 20)
(multi-focus 21)
(use-trigger 22)
(trackable 23)
(trackable-backup 24)
(spawn-gem 25)
(check-water 26)
(check-water-backup 27)
(checking-water 28)
(recover 29)
(recover-applied-velocity 30)
(drawn-mirrored 31)
(called-dying 32)
(no-initial-move-to-ground 33)
(jump-check-blocked 34)
(death-start 35)
(enemy-flag36 36)
(enemy-flag37 37)
(enemy-flag38 38)
@ -32986,8 +33043,21 @@
:flag-assert #x900000018
)
(defenum enemy-jump-flags
:bitfield #t
:type uint8
(enjflag-0)
(enjflag-1)
(enjflag-2)
(enjflag-3)
(enjflag-4)
(enjflag-5)
(enjflag-6)
(enjflag-7)
)
(deftype enemy-jump-info (structure)
((flags uint8 :offset-assert 0)
((flags enemy-jump-flags :offset-assert 0)
(anim-speed float :offset-assert 4)
(hang-time time-frame :offset-assert 8)
(start-pos vector :inline :offset-assert 16)
@ -33011,27 +33081,13 @@
:flag-assert #x90000002c
)
;; +++enemy-h:knocked-type
(defenum knocked-type
:type uint8
(knocked-type-0 0)
(knocked-type-1 1)
(knocked-type-2 2)
(knocked-type-3 3)
(knocked-type-4 4) ;; what the heck is this! (its on gator, and cant trigger it for the life of me)
(knocked-type-5 5)
(knocked-type-6 6)
(knocked-type-7 7)
)
;; ---enemy-h:knocked-type
(deftype enemy-attack-info (structure)
((attack-id uint32 :offset-assert 0)
(knocked-type knocked-type :offset-assert 4)
(blue-juggle-count uint8 :offset-assert 5)
(attacker-handle handle :offset-assert 8)
(attack-time time-frame :offset-assert 16)
(penetrate-using uint64 :offset-assert 24)
(penetrate-using penetrate :offset-assert 24)
(attacker-pos vector :inline :offset-assert 32)
(attack-direction vector :inline :offset-assert 48)
)
@ -33125,7 +33181,7 @@
"TODO"
(_type_ process-focusable) symbol) ;; 53
(enemy-method-54 (_type_) enemy-flag) ;; 54
(track-target!
(common-post
"Does a lot of various things relating to interacting with the target
- tracks when the enemy was last drawn
- looks at the target and handles attacking
@ -33150,8 +33206,8 @@
(enemy-method-61 (_type_ int) int :behavior enemy) ;; 61
(enemy-method-62 (_type_) none) ;; 62
(enemy-method-63 (_type_ process-focusable enemy-aware) symbol) ;; 63
(enemy-method-64 (_type_) none) ;; 64
(enemy-method-65 (_type_) none) ;; 65
(go-dormant (_type_) object) ;; 64
(go-dormant-aware (_type_) object) ;; 65
(go-ambush (_type_) object) ;; 66
(go-stare (_type_) object) ;; 67
(go-stare2 (_type_) object) ;; 68
@ -33170,8 +33226,8 @@
(_type_ process int symbol event-message-block) object) ;; 74
(enemy-method-75 (_type_ process event-message-block) object) ;; 75
(enemy-method-76 (_type_ process event-message-block) symbol) ;; 76
(enemy-method-77 (_type_ (pointer float)) symbol) ;; 77
(enemy-method-78 (_type_ (pointer float)) symbol) ;; 78
(enemy-method-77 (_type_ enemy-knocked-info) symbol) ;; 77
(enemy-method-78 (_type_ enemy-knocked-info) symbol) ;; 78
(enemy-method-79 (_type_ int enemy-knocked-info) symbol) ;; 79
(enemy-method-80 (_type_ enemy-knocked-info) symbol) ;; 80
(enemy-method-81 (_type_) symbol) ;; 81
@ -33185,10 +33241,7 @@
(enemy-method-89 (_type_ enemy-jump-info) symbol) ;; 89
(enemy-method-90 (_type_ int enemy-jump-info) symbol) ;; 90
(enemy-method-91 (_type_ int enemy-jump-info) none) ;; 91
(enemy-method-92
"TODO - nav-poly is a guess
@abstract"
(_type_ int nav-poly) none) ;; 92
(enemy-method-92 "@abstract" (_type_ int enemy-jump-info) none) ;; 92
(enemy-method-93 (_type_) none) ;; 93
(enemy-method-94 (_type_ vector float) symbol) ;; 94
(enemy-method-95 (_type_ vector float) symbol) ;; 95
@ -33208,11 +33261,11 @@
(enemy-method-103 (_type_) collide-spec) ;; 103
(enemy-method-104 (_type_ process touching-shapes-entry uint) symbol :behavior process) ;; 104
(enemy-method-105 (_type_ process) enemy-flag) ;; 105
(enemy-method-106 (_type_ process object int attack-info) none :behavior enemy) ;; 106
(set-incoming-attack-info (_type_ process object penetrate attack-info) none :behavior enemy) ;; 106
(get-enemy-target
"@returns the [[process-focusable]] that the enemy is currently focusing on, or [[#f]] otherwise"
(_type_) process-focusable) ;; 107
(enemy-method-108 (_type_ enemy event-message-block) int) ;; 108
(enemy-method-108 (_type_ process-drawable event-message-block) int) ;; 108
(look-at-target!
"Logic for looking at the target that is locked on, sets some flags and adjusts the neck to look at the target if available
@param flag Reacts to [[enemy-flag::death-start]] and [[enemy-flag::enable-on-active]], see implementation for details"
@ -33235,33 +33288,32 @@
"Common method called to initialize the enemy, typically sets up default field values and calls ancillary helper methods"
(_type_) none) ;; 115
(go-idle (_type_) none) ;; 116
(get-rand-float
(rnd-float
"@returns the result of calling [[rand-vu]]"
(_type_) float) ;; 117
(get-rand-float-range
(rnd-float-range
"@param low The lower bound of the range (inclusive)
@param high The upper bound of the range (exclusive)
@returns A random float in the specified range"
(_type_ float float) float) ;; 118
(get-rand-int
(rnd-int-count
"@param high The upper bound of the range (exclusive)
@returns a random integer in the range 0 to `high`
@see [[rand-vu]]"
(_type_ int) int) ;; 119
(enemy-method-120 "TODO" (_type_ int int) int) ;; 120
(get-rand-int-range
(rnd-bit "TODO" (_type_ int int) int) ;; 120
(rnd-int-range
"@param low The lower bound of the range (inclusive)
@param high The upper bound of the range (exclusive)
@returns A random integer in the specified range"
(_type_ int int) int) ;; 121
(rng-hit?
"TODO - not the best name
@param chance The value to compare ([[>=]]) with the result from [[rand-vu]].
(rnd-percent?
"@param chance The value to compare ([[>=]]) with the result from [[rand-vu]].
@returns If `chance` is greater than the random draw"
(_type_ float) symbol) ;; 122
(enemy-method-123 "TODO" (_type_ float) symbol) ;; 123
(rnd-go-idle? "TODO" (_type_ float) symbol) ;; 123
(enemy-method-124 "TODO" (_type_) collide-spec) ;; 124
(enemy-method-125 (_type_ collide-query collide-spec float float float) pat-surface) ;; 125
(ground-pat-set! (_type_ collide-query collide-spec float float float) pat-surface) ;; 125
(enemy-above-ground?
"@returns if the enemy is above the ground or not
@see [[above-ground?]]"
@ -33270,12 +33322,12 @@
(enemy-method-128 (_type_ vector move-above-ground-params) none) ;; 128
(enemy-method-129 (_type_) none) ;; 129
(enemy-method-130 (_type_ float) symbol) ;; 130
(enemy-method-131 (_type_ int) uint) ;; 131
(dispose!
(penetrate-using->knocked (_type_ penetrate) knocked-type) ;; 131
(dying
"Cleans-up the enemy and any associated resources. Potentially spawns skull gems"
(_type_) none) ;; 132
(enemy-method-133 (_type_) symbol) ;; 133
(enemy-method-134 (_type_ process attack-info) process-focusable) ;; 134
(get-attacker (_type_ process attack-info) process-focusable) ;; 134
(enemy-method-135 (_type_ int) sound-id) ;; 135
(enemy-method-136 (_type_) enemy-flag) ;; 136
)
@ -34825,7 +34877,7 @@
(unknown-byte-n1k2n3 int8 :offset 636)
(unknown-byte-m2j342 int8 :offset 637)
(unknown-byte-1ji2n3 int8 :offset 638)
(unknown-byte-n123n int8 :offset 639)
(unknown-byte-n123n uint8 :offset 639)
(state-timeout2 uint64 :offset-assert 640)
(next-warn-time time-frame :offset-assert 648)
(dest vector :inline :offset-assert 656)
@ -38526,7 +38578,7 @@
charge
)
(:methods
(rhino-method-182 (_type_ process event-message-block) symbol) ;; 182
(hit-stomach? (_type_ process event-message-block) symbol) ;; 182
)
)
@ -39426,7 +39478,7 @@
(hit-by-enemy-count uint16 :offset-assert 698)
(hit-by-player-count uint16 :offset-assert 700)
(notice-enemy-dist float :offset-assert 704)
(channel uint8 :offset-assert 708)
(channel gui-channel :offset-assert 708)
(focus-mode int8 :offset-assert 709)
(nav-mesh-index int8 :offset-assert 710)
(delay-too-far-check int8 :offset-assert 711)
@ -39489,13 +39541,13 @@
(play-speech (_type_ int) none) ;; 206
(play-death-sound "Play one of our death sounds." (_type_ string) none) ;; 207
(bot-method-208 (_type_) symbol) ;; 208
(channel-active? "Is the given [[gui-channel]] active?" (_type_ uint) symbol) ;; 209
(channel-active? "Is the given [[gui-channel]] active?" (_type_ gui-channel) symbol) ;; 209
(init! "Set defaults for various fields." (_type_) none) ;; 210
(clear-speech-flags! "Clear the `playing` flag for all of our speeches." (_type_) none) ;; 211
(reset-warn-time! (_type_) none) ;; 212
(go-to-waypoint! "Start moving to the given [[bot-waypoint]]." (_type_ int symbol) object) ;; 213
(bot-method-214 (_type_) symbol) ;; 214
(skip-waypoint (_type_) none) ;; 215
(skip-waypoint (_type_) object) ;; 215
(bot-method-216 (_type_) none) ;; 216
(speech-ended? "Is the given speech active?" (_type_ int) symbol) ;; 217
(speech-playing? "Is the given speech playing?" (_type_ int) symbol) ;; 218
@ -43438,7 +43490,7 @@
(define-extern set-countdown-to-roar (function none :behavior metalkor))
(define-extern metalkor-go-next-stage (function none :behavior metalkor))
(define-extern metalkor-setup-hit-anim (function attack-info process-drawable art-element art-element float none :behavior metalkor))
(define-extern metalkor-get-gem-tracker (function process-focusable none :behavior metalkor))
(define-extern metalkor-get-gem-tracker (function process-focusable gem-tracker :behavior metalkor))
(define-extern metalkor-handler (function process int symbol event-message-block object :behavior metalkor))
(define-extern metalkor-start-egg (function symbol :behavior metalkor))
(define-extern metalkor-check-egg (function symbol :behavior metalkor))
@ -50590,13 +50642,15 @@
(
(ai-hook (function vehicle-guard none) :offset-assert 880)
(turret turret-control :inline :offset-assert 888)
(target-flags turret-flag :offset-assert 968)
(target-flags traffic-target-flag :offset-assert 968)
(target-in-sight-time time-frame :offset-assert 976)
(minimap connection-minimap :offset-assert 984)
(vehicle-guard-pad-k1jn23k1 uint32 :offset-assert 988)
(traffic-target-status traffic-target-status :offset-assert 992)
(pursuit-target handle :offset-assert 1000)
(vehicle-guard-pad-1kjh2nb3k1 uint32 16 :offset-assert 1008)
(vehicle-guard-pad-0jkfdjslf uint32 4 :offset-assert 1008)
(vehicle-guard-vector0341413 vector :inline :offset-assert 1024)
(vehicle-guard-pad-1kjh2nb3k1 uint32 8 :offset-assert 1040)
(lod2 symbol :offset-assert 1072)
)
:method-count-assert 159
@ -50627,7 +50681,7 @@
(define-extern vehicle-draw-beam (function sparticle-launcher vector vector object symbol none))
(define-extern vehicle-draw-laser-spot (function vector vector symbol none))
(define-extern vehicle-draw-laser (function vector vector none))
(define-extern vehicle-guard-choose-branch (function vehicle-controller vehicle nav-branch))
(define-extern vehicle-guard-choose-branch (function vehicle-controller vehicle-guard nav-branch))
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; transport ;;
@ -52960,7 +53014,9 @@
(deftype mechblock (process-drawable)
((root collide-shape-moving :override)
(origin vector :inline :offset-assert 208)
(drop-point vector :inline :offset 256)
(unknown-quat quaternion :inline :offset-assert 224)
(unknown-vector vector :inline :offset-assert 240)
(drop-point vector :inline :offset-assert 256)
(allow-drag? symbol :offset-assert 272)
(reset-on-land? symbol :offset-assert 276)
(hit-something? symbol :offset-assert 280)

View File

@ -1227,8 +1227,8 @@
"castle-baron": [[7, "(function collectable none)"]],
"metalkor-extras": [[65, "(function vector :behavior metalkor-shot)"]],
"metalkor-setup": [
[1, "(function gem-tracker none)"],
[2, "(function gem-tracker none)"]
[1, "(function gem-tracker symbol)"],
[2, "(function gem-tracker symbol)"]
],
"meet-brutter": [
[0, "(function none :behavior task-manager)"],

View File

@ -4309,7 +4309,8 @@
"(method 74 enemy)": [
[50, "s3", "process-drawable"],
[94, "v1", "attack-info"],
[[111, 205], "s2", "attack-info"],
[[111, 137], "s2", "attack-info"],
[204, "s2", "attack-info"],
[554, "a0", "vector"]
],
"(method 56 enemy)": [[[0, 6], "v1", "attack-info"]],
@ -4537,7 +4538,7 @@
],
"(method 23 joint-exploder)": [[26, "v1", "process-drawable"]],
"(method 28 joint-exploder)": [[[0, 250], "s5", "joint-exploder-list"]],
"joint-exploder-joint-callback": [[3, "s4", "joint-exploder"]],
"joint-exploder-joint-callback": [[[3, 25], "s4", "joint-exploder"]],
"(event idle fort-trap-door)": [[4, "v1", "attack-info"]],
"(code idle hide-light)": [[10, "v1", "art-joint-anim"]],
"(event impact turret-shot)": [[11, "s4", "process-drawable"]],
@ -7060,7 +7061,7 @@
],
"(method 9 city-level-info)": [[387, "v1", "nav-segment"]],
"(method 67 traffic-engine)": [
[[137, 183], "s0", "crimson-guard"],
[[137, 185], "s0", "crimson-guard"],
[[44, 86], "a3", "vehicle"]
],
"set-eye-draw-flag": [[20, "s5", "eye-control"]],
@ -10151,5 +10152,8 @@
"race-birth-func-texture-position-word": [
[10, "v1", "(array int32)"],
[1, "v1", "(array int32)"]
]
],
"(method 206 hal)": [[32, "a2", "bot"]],
"(method 209 hal)": [[32, "v1", "bot"]],
"(method 220 hal)": [[29, "v1", "bot"]]
}

View File

@ -4656,5 +4656,10 @@
"s5-0": "secrets",
"f30-0": "alpha"
}
},
"joint-exploder-joint-callback": {
"vars": {
"s4-0": ["exploder", "joint-exploder"]
}
}
}

View File

@ -92,7 +92,7 @@
"1251": "Enemy Health Bars",
"1252": "Vehicle Health Bars",
"1253": "Vehicle Invulnerability",
"1254": "Statistics Page",
"1254": "Statistics",
"1255": "Automatically Grab Collectables",
"1256": "Music Player",
"1257": "No Textures Mode",
@ -152,6 +152,38 @@
"12a2": "Extended",
"12a3": "No valid resolutions found.",
"12a4": "Automatic",
"12a5": "Bestiary",
"12a6": "Other Statistics",
"12a7": "Total Killed",
"12a8": "Killed by Jak",
"12a9": "Killed by Dark Jak",
"12aa": "Killed by Daxter",
"12ab": "Killed by Others",
"12ac": "Blaster",
"12ad": "Scatter Gun",
"12ae": "Vulcan Fury",
"12af": "Peacemaker",
"12b0": "JET-Board",
"12b1": "JET-Board Trick",
"12b2": "Titan Suit Punch",
"12b3": "Titan Suit Body",
"12b4": "Gunpod",
"12b5": "Punch",
"12b6": "Flop",
"12b7": "Uppercut",
"12b8": "Spin",
"12b9": "Roll",
"12bf": "Dark Bomb",
"12c0": "Dark Blast",
"12c3": "Krimzon Guard",
"12c4": "Sig",
"12c5": "Ashelin",
"12c6": "Jinx",
"12c7": "Grim",
"12c8": "Mog",
"12c9": "Metal Heads",
"12ca": "Other Friends",
"12cb": "Other Enemies",
"1300": "Auto Hide Cursor",
"1301": "Reassign Binds",
"1302": "Controller Binds",

View File

@ -134,10 +134,12 @@ s32 CalculateAngle(Vec3w* trans) {
} else {
angle = angle + 90;
}
} else if (diffZ >= 0) {
angle = angle + 270;
} else {
angle = 270 - angle;
if (diffZ >= 0) {
angle = angle + 270;
} else {
angle = 270 - angle;
}
}
}
@ -170,30 +172,22 @@ s32 CalculateFalloffVolume(Vec3w* pos, s32 volume, s32 fo_curve, s32 fo_min, s32
} else {
if (fo_curve == 1) {
return volume;
}
if (fo_curve < 9) {
xdiff = gEarTrans[0].x - pos->x;
ydiff = gEarTrans[0].y - pos->y;
zdiff = gEarTrans[0].z - pos->z;
}
if (fo_curve == 9) {
} else if (fo_curve == 9) {
xdiff = gEarTrans[1].x - pos->x;
ydiff = gEarTrans[1].y - pos->y;
zdiff = gEarTrans[1].z - pos->z;
}
if (fo_curve == 10) {
} else if (fo_curve == 10) {
xdiff = 0;
ydiff = gEarTrans[0].y - pos->y;
zdiff = 0;
}
if (fo_curve == 11) {
} else if (fo_curve == 11) {
xdiff = gEarTrans[1].x - pos->x;
ydiff = gEarTrans[1].y - pos->y;
zdiff = gEarTrans[1].z - pos->z;
} else {
xdiff = gEarTrans[0].x - pos->x;
ydiff = gEarTrans[0].y - pos->y;
zdiff = gEarTrans[0].z - pos->z;
}
}
@ -210,67 +204,58 @@ s32 CalculateFalloffVolume(Vec3w* pos, s32 volume, s32 fo_curve, s32 fo_min, s32
s32 min = fo_min << 8;
s32 max = fo_max << 8;
if (max < xdiff || max < ydiff || max < zdiff) {
return 0;
}
while (max > 0x7FFF) {
max >>= 1;
min >>= 1;
xdiff >>= 1;
ydiff >>= 1;
zdiff >>= 1;
}
u32 distance = xdiff * xdiff + ydiff * ydiff + zdiff * zdiff;
if (distance != 0) {
s32 steps = 0;
while ((distance & 0xc0000000) == 0) {
distance <<= 2;
steps++;
s32 new_vol = 0;
if (xdiff <= max && ydiff <= max && zdiff <= max) {
while (max > 0x7fff) {
max >>= 1;
min >>= 1;
xdiff >>= 1;
ydiff >>= 1;
zdiff >>= 1;
}
s32 dist_squared = xdiff * xdiff + ydiff * ydiff + zdiff * zdiff;
s32 dist_steps = 0;
if (dist_squared != 0) {
while ((dist_squared & 0xc0000000) == 0) {
dist_steps = dist_steps + 1;
dist_squared <<= 2;
}
dist_steps = sqrt_table[dist_squared >> 24] >> (dist_steps & 0x1f);
}
new_vol = volume;
if (min < dist_steps) {
s32 voldiff = dist_steps - min;
if (dist_steps < max) {
dist_steps = max - min;
while (0xffff < voldiff) {
dist_steps >>= 1;
voldiff >>= 1;
}
voldiff = (voldiff << 0x10) / dist_steps;
if (voldiff != 0x10000) {
new_vol = voldiff * voldiff >> 0x10;
new_vol = gCurves[fo_curve].unk4 * 0x10000 + gCurves[fo_curve].unk3 * voldiff +
gCurves[fo_curve].unk2 * new_vol +
gCurves[fo_curve].unk1 * ((new_vol * voldiff) >> 0x10) >>
0xc;
if (new_vol < 0) {
new_vol = 0;
} else {
if (0x10000 < new_vol) {
new_vol = 0x10000;
}
}
new_vol = (new_vol * volume) >> 0x10;
}
} else {
new_vol = 0;
}
}
distance = sqrt_table[distance >> 24] >> steps;
} else {
distance = 0;
}
if (distance <= (u32)min) {
return volume;
if (fo_curve == 11 && new_vol < 0x180) {
new_vol = 0x180;
}
if (distance >= (u32)max) {
return 0;
}
s32 start = distance - min;
s32 end = max - min;
while (start > 0xFFFF) {
start >>= 1;
end >>= 1;
}
s32 v13 = (start << 16) / end;
if (v13 == 0x10000) {
return volume;
}
s32 factor = ((gCurves[fo_curve].unk4 << 16) + gCurves[fo_curve].unk3 * v13 +
gCurves[fo_curve].unk2 * ((v13 * v13) >> 16) +
gCurves[fo_curve].unk1 * (((((v13 * v13) >> 16) * v13) >> 16) >> 16)) >>
12;
if (factor > 0x10000) {
factor = 0x10000;
}
s32 ret = (factor * volume) >> 16;
if (fo_curve == 11 && ret < 0x180) {
ret = 0x180;
}
return ret;
return new_vol;
}
s32 GetVolume(Sound* sound) {

View File

@ -49,10 +49,10 @@ void InitSound_overlord() {
StreamVoice[3] = SD_VOICE(0, 3);
for (int i = 0; i < 91; i++) {
s16 opposing_front = static_cast<s16>(((i * 0x33ff) / 0x5a) + 0xc00);
s16 opposing_front = static_cast<s16>(((i * 0x33ff) / 90) + 0xc00);
s16 rear_right = static_cast<s16>(((i * -0x2800) / 0x5a) + 0x3400);
s16 rear_left = static_cast<s16>(((i * -0xbff) / 0x5a) + 0x3fff);
s16 rear_right = static_cast<s16>(((i * -0x2800) / 90) + 0x3400);
s16 rear_left = static_cast<s16>(((i * -0xbff) / 90) + 0x3fff);
gPanTable[90 - i].left = 0x3FFF;
gPanTable[180 - i].left = opposing_front;

View File

@ -1034,6 +1034,15 @@
)
)
(defmacro string->enum (enum input default)
"return the value of an enum name"
`(case-str ,input
,@(apply (lambda (x) `((,(symbol->string (car x))) (,enum ,(car x)))) (get-enum-vals enum))
(else ,default)
)
)
(defmacro doenum (bindings &rest body)
"run body while iterating through an enum.
WARNING: enums are NOT A RUNTIME TYPE! There is an UNWOUND loop with body in it!! Use with caution."
@ -1042,11 +1051,12 @@
`(begin ,@(apply (lambda (x)
;; (fmt #t "{}\n" x)
`(let (
(,(first bindings) ,(symbol->string (car x))) ;; name
(,(second bindings) ,(cdr x)) ;; value
(,(car bindings) ,(symbol->string (car x))) ;; name
(,(cadr bindings) ,(cdr x)) ;; value
)
,@body
)) (get-enum-vals (third bindings))))
)) (get-enum-vals (caddr bindings)))
,@(cdddr bindings))
)

View File

@ -17,7 +17,7 @@
(>= arg0 (rand-vu))
)
(defbehavior nav-enemy-rnd-float-range nav-enemy ((arg0 float) (arg1 float))
(defun nav-enemy-rnd-float-range ((arg0 float) (arg1 float))
(+ arg0 (* (rand-vu) (- arg1 arg0)))
)

View File

@ -587,8 +587,8 @@
;; remember to delete this when major changes to the version number are made
(when (and (= PC_KERNEL_VER_MAJOR 1)
(= PC_KERNEL_VER_MINOR 10)
(or (!= PC_KERNEL_VER_BUILD (-> version build))
(!= PC_KERNEL_VER_REVISION (-> version revision))))
(or (> 3 (-> version build))
(and (= 3 (-> version build)) (> 1 (-> version revision)))))
;; 1.10 upgrade: turn envmap on
(set! (-> obj force-envmap?) #t)
)
@ -707,7 +707,6 @@
(("panic")
(when (file-stream-read-symbol file)
(reset obj #t)
(set-display-mode! obj #f #t)
(return #f)
)
)

View File

@ -346,7 +346,8 @@
;; get screen size and set to borderless at screen res (if retail)
(pc-get-active-display-size (&-> obj width) (&-> obj height))
(if (not *debug-segment*)
(set-display-mode! obj 'borderless call-handlers))
(set-display-mode! obj 'borderless call-handlers)
(set-display-mode! obj 'windowed call-handlers))
(set! (-> obj gfx-msaa) PC_DEFAULT_MSAA) ;; default msaa
0)

View File

@ -29,6 +29,7 @@
"dma-buffer.o"
"dma-bucket.o"
"dma-disasm.o"
"statistics-h.o" ;; added
"pckernel-h.o" ;; added
"pckernel-impl.o" ;; added
"pc-debug-common.o" ;; added
@ -434,6 +435,7 @@
"nav-enemy-h.o"
"rigid-body-h.o"
"damage-number.o" ;; added
"statistics.o" ;; added
"enemy.o"
"nav-enemy.o"
"base-plat.o"

View File

@ -16,42 +16,42 @@
(defenum enemy-flag
:type int64
:bitfield #t
(lock-focus 0)
(death-start 1)
(enable-on-active 2)
(checking-water 3)
(check-water 4)
(spawn-gem 5)
(chase-startup 6)
(attackable-backup 7)
(look-at-focus 8)
(use-notice-distance 9)
(enable-on-notice 10)
(look-at-move-dest 11)
(notice 12)
(auto-reset-penetrate 13)
(jump-check-blocked 14)
(drawn-mirrored 15)
(multi-focus 16)
(alert 17)
(victory 18)
(dangerous-backup 19)
(actor-pause-backup 20)
(trackable 21)
(called-dying 22)
(check-water-backup 23)
(no-initial-move-to-ground 24)
(cam-attack-mode 25)
(trackable-backup 26)
(enable-on-hostile 27)
(directed-ready 28)
(use-trigger 29)
(directed 30)
(dislike-combo 31)
(recover-applied-velocity 32)
(vulnerable-backup 33)
(vulnerable 34)
(recover 35)
(look-at-focus 0)
(look-at-move-dest 1)
(vulnerable 2)
(vulnerable-backup 3)
(dangerous-backup 4)
(notice 5)
(alert 6)
(auto-reset-penetrate 7)
(victory 8)
(cam-attack-mode 9)
(use-notice-distance 10)
(attackable-backup 11)
(actor-pause-backup 12)
(enable-on-notice 13)
(enable-on-active 14)
(enable-on-hostile 15)
(dislike-combo 16)
(directed 17)
(directed-ready 18)
(chase-startup 19)
(lock-focus 20)
(multi-focus 21)
(use-trigger 22)
(trackable 23)
(trackable-backup 24)
(spawn-gem 25)
(check-water 26)
(check-water-backup 27)
(checking-water 28)
(recover 29)
(recover-applied-velocity 30)
(drawn-mirrored 31)
(called-dying 32)
(no-initial-move-to-ground 33)
(jump-check-blocked 34)
(death-start 35)
(enemy-flag36 36)
(enemy-flag37 37)
(enemy-flag38 38)
@ -75,20 +75,19 @@
)
;; ---enemy-aware
;; +++knocked-type
(defenum knocked-type
(defenum enemy-jump-flags
:bitfield #t
:type uint8
(knocked-type-0 0)
(knocked-type-1 1)
(knocked-type-2 2)
(knocked-type-3 3)
(knocked-type-4 4) ;; what the heck is this! (its on gator, and cant trigger it for the life of me)
(knocked-type-5 5)
(knocked-type-6 6)
(knocked-type-7 7)
(enjflag-0)
(enjflag-1)
(enjflag-2)
(enjflag-3)
(enjflag-4)
(enjflag-5)
(enjflag-6)
(enjflag-7)
)
;; ---knocked-type
;; DECOMP BEGINS
@ -202,7 +201,7 @@
(deftype enemy-jump-info (structure)
((flags uint8)
((flags enemy-jump-flags)
(anim-speed float)
(hang-time time-frame)
(start-pos vector :inline)
@ -228,7 +227,7 @@
(blue-juggle-count uint8)
(attacker-handle handle)
(attack-time time-frame)
(penetrate-using uint64)
(penetrate-using penetrate)
(attacker-pos vector :inline)
(attack-direction vector :inline)
)
@ -313,7 +312,7 @@
(enemy-method-52 (_type_ vector) none)
(enemy-method-53 (_type_ process-focusable) symbol)
(enemy-method-54 (_type_) enemy-flag)
(track-target! (_type_) none)
(common-post (_type_) none)
(damage-amount-from-attack (_type_ process event-message-block) int)
(update-target-awareness! (_type_ process-focusable enemy-best-focus) enemy-aware)
(enemy-method-58 (_type_ process event-message-block) symbol)
@ -322,8 +321,8 @@
(enemy-method-61 (_type_ int) int :behavior enemy)
(enemy-method-62 (_type_) none)
(enemy-method-63 (_type_ process-focusable enemy-aware) symbol)
(enemy-method-64 (_type_) none)
(enemy-method-65 (_type_) none)
(go-dormant (_type_) object)
(go-dormant-aware (_type_) object)
(go-ambush (_type_) object)
(go-stare (_type_) object)
(go-stare2 (_type_) object)
@ -335,8 +334,8 @@
(general-event-handler (_type_ process int symbol event-message-block) object)
(enemy-method-75 (_type_ process event-message-block) object)
(enemy-method-76 (_type_ process event-message-block) symbol)
(enemy-method-77 (_type_ (pointer float)) symbol)
(enemy-method-78 (_type_ (pointer float)) symbol)
(enemy-method-77 (_type_ enemy-knocked-info) symbol)
(enemy-method-78 (_type_ enemy-knocked-info) symbol)
(enemy-method-79 (_type_ int enemy-knocked-info) symbol)
(enemy-method-80 (_type_ enemy-knocked-info) symbol)
(enemy-method-81 (_type_) symbol)
@ -350,7 +349,7 @@
(enemy-method-89 (_type_ enemy-jump-info) symbol)
(enemy-method-90 (_type_ int enemy-jump-info) symbol)
(enemy-method-91 (_type_ int enemy-jump-info) none)
(enemy-method-92 (_type_ int nav-poly) none)
(enemy-method-92 (_type_ int enemy-jump-info) none)
(enemy-method-93 (_type_) none)
(enemy-method-94 (_type_ vector float) symbol)
(enemy-method-95 (_type_ vector float) symbol)
@ -364,9 +363,9 @@
(enemy-method-103 (_type_) collide-spec)
(enemy-method-104 (_type_ process touching-shapes-entry uint) symbol :behavior process)
(enemy-method-105 (_type_ process) enemy-flag)
(enemy-method-106 (_type_ process object int attack-info) none :behavior enemy)
(set-incoming-attack-info (_type_ process object penetrate attack-info) none :behavior enemy)
(get-enemy-target (_type_) process-focusable)
(enemy-method-108 (_type_ enemy event-message-block) int)
(enemy-method-108 (_type_ process-drawable event-message-block) int)
(look-at-target! (_type_ enemy-flag) none)
(stop-looking-at-target! (_type_) none)
(enemy-method-111 (_type_) none :behavior enemy)
@ -375,24 +374,24 @@
(init-enemy-collision! (_type_) none)
(init-enemy! (_type_) none)
(go-idle (_type_) none)
(get-rand-float (_type_) float)
(get-rand-float-range (_type_ float float) float)
(get-rand-int (_type_ int) int)
(enemy-method-120 (_type_ int int) int)
(get-rand-int-range (_type_ int int) int)
(rng-hit? (_type_ float) symbol)
(enemy-method-123 (_type_ float) symbol)
(rnd-float (_type_) float)
(rnd-float-range (_type_ float float) float)
(rnd-int-count (_type_ int) int)
(rnd-bit (_type_ int int) int)
(rnd-int-range (_type_ int int) int)
(rnd-percent? (_type_ float) symbol)
(rnd-go-idle? (_type_ float) symbol)
(enemy-method-124 (_type_) collide-spec)
(enemy-method-125 (_type_ collide-query collide-spec float float float) pat-surface)
(ground-pat-set! (_type_ collide-query collide-spec float float float) pat-surface)
(enemy-above-ground? (_type_ collide-query vector collide-spec float float float) symbol)
(enemy-method-127 (_type_ float float symbol collide-spec) symbol)
(enemy-method-128 (_type_ vector move-above-ground-params) none)
(enemy-method-129 (_type_) none)
(enemy-method-130 (_type_ float) symbol)
(enemy-method-131 (_type_ int) uint)
(dispose! (_type_) none)
(penetrate-using->knocked (_type_ penetrate) knocked-type)
(dying (_type_) none)
(enemy-method-133 (_type_) symbol)
(enemy-method-134 (_type_ process attack-info) process-focusable)
(get-attacker (_type_ process attack-info) process-focusable)
(enemy-method-135 (_type_ int) sound-id)
(enemy-method-136 (_type_) enemy-flag)
)
@ -411,7 +410,7 @@
(s3-0 (t9-0 this arg0))
)
(when (not s3-0)
(logclear! (-> this flags) (enemy-flag lock-focus))
(logclear! (-> this flags) (enemy-flag look-at-focus))
(set! (-> this aware)
(the-as
enemy-aware
@ -429,7 +428,7 @@
)
(set! (-> this aware) arg1)
(if (not v0-0)
(logclear! (-> this flags) (enemy-flag lock-focus))
(logclear! (-> this flags) (enemy-flag look-at-focus))
)
v0-0
)
@ -441,6 +440,6 @@
(t9-0 this)
)
(set! (-> this aware) (enemy-aware enemy-aware-0))
(logclear! (-> this flags) (enemy-flag lock-focus))
(logclear! (-> this flags) (enemy-flag look-at-focus))
(none)
)

File diff suppressed because it is too large Load Diff

View File

@ -56,7 +56,7 @@
(mode 'eco-red)
(attacker-velocity (-> self root transv))
(damage 2.0)
(knock (the-as uint 2))
(knock (knocked-type knocked-type-2))
)
)
)

View File

@ -124,8 +124,8 @@
)
(defun joint-exploder-joint-callback ((arg0 draw-control) (arg1 cspace-array) (arg2 joint-control))
(let ((s4-0 (-> arg0 process)))
(let ((s3-0 (-> (the-as joint-exploder s4-0) joints)))
(let ((exploder (the-as joint-exploder (-> arg0 process))))
(let ((s3-0 (-> exploder joints)))
(countdown (s2-0 (-> s3-0 num-joints))
(let* ((v1-3 (-> s3-0 joint s2-0))
(a0-5 (-> arg1 data (-> v1-3 joint-index) bone transform))
@ -134,10 +134,10 @@
)
)
)
(let ((s4-1 (&-> s4-0 stack 96)))
(let ((s4-1 (-> exploder scale-vector)))
(countdown (s3-1 (-> arg1 length))
(let ((a2-2 (-> arg1 data s3-1 bone transform)))
(scale-matrix! a2-2 (the-as vector s4-1) a2-2)
(scale-matrix! a2-2 s4-1 a2-2)
)
)
)

View File

@ -1393,94 +1393,92 @@
)
(defun los-cw-ccw ((arg0 (inline-array collide-cache-tri))
(arg1 vector)
(arg2 vector)
(arg3 float)
(arg4 collide-los-result)
(arg5 vector)
(arg6 float)
)
(defbehavior los-cw-ccw camera-slave ((arg0 (inline-array collide-cache-tri))
(arg1 vector)
(arg2 vector)
(arg3 float)
(arg4 collide-los-result)
(arg5 vector)
(arg6 float)
)
(local-vars (sv-128 float) (sv-144 vector) (sv-160 vector) (sv-176 vector) (sv-192 vector) (sv-208 int))
(with-pp
(set! sv-128 arg3)
(let ((gp-0 arg4))
(set! sv-144 arg5)
(let ((s4-0 arg6))
(set! sv-160 (new 'stack-no-clear 'vector))
(set! sv-176 (new 'stack-no-clear 'vector))
(let ((s5-0 (new 'stack-no-clear 'matrix)))
(set! sv-192 (new 'stack-no-clear 'vector))
(let ((f30-0 0.0)
(s0-0 #f)
)
(set! sv-208 0)
(while (< sv-208 4)
(cond
((= sv-208 3)
(vector-! sv-160 sv-144 (the-as vector (&-> pp stack 432)))
(set! (-> s5-0 vector sv-208 z) 0.0)
)
(else
(vector-! sv-160 sv-144 (-> arg0 0 vertex sv-208))
(set! (-> s5-0 vector sv-208 z) (vector-dot sv-160 (-> *camera* local-down)))
(vector-! sv-160 (-> arg0 0 vertex sv-208) (the-as vector (&-> pp stack 432)))
)
)
(vector-flatten! sv-160 sv-160 (-> *camera* local-down))
(vector-cross! sv-176 sv-160 arg2)
(let ((f28-0 (vector-dot sv-176 (-> *camera* local-down))))
(cond
((< (* f28-0 f30-0) 0.0)
(set! s0-0 #t)
)
((!= f28-0 0.0)
(set! f30-0 f28-0)
)
)
(set! (-> s5-0 vector sv-208 x) (vector-dot sv-160 arg2))
(cond
((= sv-208 3)
(vector-! sv-192 sv-144 (the-as vector (&-> pp stack 432)))
(vector-flatten! sv-192 sv-192 arg1)
)
(else
(vector--float*! sv-192 sv-160 arg2 (-> s5-0 vector sv-208 x))
)
)
(if (< f28-0 0.0)
(set! (-> s5-0 vector sv-208 y) (- (vector-length sv-192)))
(set! (-> s5-0 vector sv-208 y) (vector-length sv-192))
)
)
(set! (-> s5-0 vector sv-208 x) (- sv-128 (-> s5-0 vector sv-208 x)))
(set! sv-208 (+ sv-208 1))
(set! sv-128 arg3)
(let ((gp-0 arg4))
(set! sv-144 arg5)
(let ((s4-0 arg6))
(set! sv-160 (new 'stack-no-clear 'vector))
(set! sv-176 (new 'stack-no-clear 'vector))
(let ((s5-0 (new 'stack-no-clear 'matrix)))
(set! sv-192 (new 'stack-no-clear 'vector))
(let ((f30-0 0.0)
(s0-0 #f)
)
(set! sv-208 0)
(while (< sv-208 4)
(cond
((and s0-0 (!= (the-as int s4-0) -859915232))
(dotimes (s4-1 4)
(dist-info-append (-> gp-0 straddle) (the-as vector (+ (the-as uint s5-0) (* s4-1 16))))
)
#f
)
((< (-> s5-0 trans y) 0.0)
(dotimes (s4-2 4)
(when (>= (-> s5-0 trans y) (-> s5-0 vector s4-2 y))
(set! (-> s5-0 vector s4-2 y) (- (-> s5-0 vector s4-2 y)))
(dist-info-append (-> gp-0 ccw) (the-as vector (+ (the-as uint s5-0) (* s4-2 16))))
)
)
#f
((= sv-208 3)
(vector-! sv-160 sv-144 (-> self string-trans))
(set! (-> s5-0 vector sv-208 z) 0.0)
)
(else
(dotimes (s4-3 4)
(if (>= (-> s5-0 vector s4-3 y) (-> s5-0 trans y))
(dist-info-append (-> gp-0 cw) (the-as vector (+ (the-as uint s5-0) (* s4-3 16))))
)
)
#f
(vector-! sv-160 sv-144 (-> arg0 0 vertex sv-208))
(set! (-> s5-0 vector sv-208 z) (vector-dot sv-160 (-> *camera* local-down)))
(vector-! sv-160 (-> arg0 0 vertex sv-208) (-> self string-trans))
)
)
(vector-flatten! sv-160 sv-160 (-> *camera* local-down))
(vector-cross! sv-176 sv-160 arg2)
(let ((f28-0 (vector-dot sv-176 (-> *camera* local-down))))
(cond
((< (* f28-0 f30-0) 0.0)
(set! s0-0 #t)
)
((!= f28-0 0.0)
(set! f30-0 f28-0)
)
)
(set! (-> s5-0 vector sv-208 x) (vector-dot sv-160 arg2))
(cond
((= sv-208 3)
(vector-! sv-192 sv-144 (-> self string-trans))
(vector-flatten! sv-192 sv-192 arg1)
)
(else
(vector--float*! sv-192 sv-160 arg2 (-> s5-0 vector sv-208 x))
)
)
(if (< f28-0 0.0)
(set! (-> s5-0 vector sv-208 y) (- (vector-length sv-192)))
(set! (-> s5-0 vector sv-208 y) (vector-length sv-192))
)
)
(set! (-> s5-0 vector sv-208 x) (- sv-128 (-> s5-0 vector sv-208 x)))
(set! sv-208 (+ sv-208 1))
)
(cond
((and s0-0 (!= (the-as int s4-0) -859915232))
(dotimes (s4-1 4)
(dist-info-append (-> gp-0 straddle) (the-as vector (+ (the-as uint s5-0) (* s4-1 16))))
)
#f
)
((< (-> s5-0 trans y) 0.0)
(dotimes (s4-2 4)
(when (>= (-> s5-0 trans y) (-> s5-0 vector s4-2 y))
(set! (-> s5-0 vector s4-2 y) (- (-> s5-0 vector s4-2 y)))
(dist-info-append (-> gp-0 ccw) (the-as vector (+ (the-as uint s5-0) (* s4-2 16))))
)
)
#f
)
(else
(dotimes (s4-3 4)
(if (>= (-> s5-0 vector s4-3 y) (-> s5-0 trans y))
(dist-info-append (-> gp-0 cw) (the-as vector (+ (the-as uint s5-0) (* s4-3 16))))
)
)
#f
)
)
)
)

View File

@ -85,6 +85,23 @@
(test 22) ;; hi 64
)
;; +++knocked-type
(defenum knocked-type
:type uint8
(knocked-type-0 0)
(knocked-type-1 1)
(knocked-type-2 2)
(knocked-type-3 3)
(knocked-type-4 4) ;; what the heck is this! (its on gator, and cant trigger it for the life of me)
(knocked-type-5 5)
(knocked-type-6 6)
(knocked-type-7 7)
(knocked-type-8 8)
(knocked-type-9 9)
(knocked-type-10 10)
)
;; ---knocked-type
(defmacro static-attack-info (&key (mask ()) args)
(let ((mask-actual mask))
@ -105,7 +122,7 @@
)
(defmacro new-attack-id ()
"generate a new attack-id"
"generate a new attack-id. TODO remove this, it's meant to be an inlined method"
`(1+! (-> *game-info* attack-id))
)
@ -342,7 +359,7 @@
(penetrate-using penetrate)
(damage float)
(shield-damage float)
(knock uint8)
(knock knocked-type)
(test symbol)
)
(:methods

View File

@ -69,7 +69,7 @@
(if (<= s4-0 0)
(go process-drawable-art-error "no path")
)
(let ((s2-0 (get-rand-int this s4-0))
(let ((s2-0 (rnd-int-count this s4-0))
(s5-0 (new 'stack-no-clear 'vector))
)
(countdown (s3-0 s4-0)
@ -142,7 +142,7 @@
(enemy-method-103 this)
(return (the-as symbol #f))
)
(when (not (logtest? (enemy-flag directed) (-> this enemy-flags)))
(when (not (logtest? (enemy-flag recover-applied-velocity) (-> this enemy-flags)))
(let ((s5-0 (-> this root)))
(if (focus-test? this under-water)
(enemy-method-47 this (-> s5-0 transv))
@ -163,7 +163,7 @@
)
)
)
(logclear! (-> this enemy-flags) (enemy-flag directed))
(logclear! (-> this enemy-flags) (enemy-flag recover-applied-velocity))
(if (and (enemy-method-102 this) (not (logtest? (-> this focus-status) (focus-status dead))))
(kill-prefer-falling this)
)
@ -197,7 +197,7 @@
)
)
(defmethod track-target! ((self nav-enemy))
(defmethod common-post ((self nav-enemy))
"Does a lot of various things relating to interacting with the target
- tracks when the enemy was last drawn
- looks at the target and handles attacking
@ -206,7 +206,7 @@
(set-time! (-> self last-draw-time))
)
(enemy-method-129 self)
(when (logtest? (enemy-flag use-trigger) (-> self enemy-flags))
(when (logtest? (enemy-flag recover) (-> self enemy-flags))
(if (-> self nav)
(enemy-method-100 self)
(enemy-method-103 self)
@ -221,14 +221,14 @@
)
(when (nonzero? (-> self neck))
(cond
((logtest? (-> self enemy-flags) (enemy-flag lock-focus))
((logtest? (-> self enemy-flags) (enemy-flag look-at-focus))
(let ((a0-10 (handle->process (-> self focus handle))))
(if a0-10
(target-set! (-> self neck) (get-trans (the-as process-focusable a0-10) 2))
)
)
)
((logtest? (-> self enemy-flags) (enemy-flag death-start))
((logtest? (-> self enemy-flags) (enemy-flag look-at-move-dest))
(let ((s5-1 (-> self move-dest))
(v1-47
(vector<-cspace! (new 'stack-no-clear 'vector) (-> self node-list data (-> self enemy-info neck-joint)))
@ -244,10 +244,10 @@
)
)
)
(when (and (logtest? (-> self enemy-flags) (enemy-flag attackable-backup))
(when (and (logtest? (-> self enemy-flags) (enemy-flag auto-reset-penetrate))
(time-elapsed? (-> self auto-reset-penetrate-time) (seconds 0.1))
)
(logclear! (-> self enemy-flags) (enemy-flag attackable-backup))
(logclear! (-> self enemy-flags) (enemy-flag auto-reset-penetrate))
(set! (-> self root penetrated-by) (get-penetrate-info self))
(let ((v1-62 0))
(if (logtest? (penetrate knocked) (-> self root penetrate-using))
@ -256,10 +256,10 @@
(set! (-> self root penetrate-using) (the-as penetrate v1-62))
)
)
(if (logtest? (-> self enemy-flags) (enemy-flag look-at-focus))
(if (logtest? (-> self enemy-flags) (enemy-flag victory))
(enemy-method-136 self)
)
(if (logtest? (enemy-flag trackable-backup directed-ready) (-> self enemy-flags))
(if (logtest? (enemy-flag check-water checking-water) (-> self enemy-flags))
(enemy-method-54 self)
)
(let ((v1-73 (-> self restore-nav-radius-time)))
@ -296,12 +296,14 @@
(nav-enemy-method-177 this)
(cond
((nav-enemy-method-174 this)
(logior! (-> this enemy-flags) (enemy-flag directed))
(logior! (-> this enemy-flags) (enemy-flag recover-applied-velocity))
(let ((s5-0 (-> this nav)))
(when (logtest? (-> s5-0 state flags) (nav-state-flag at-gap))
(let ((s4-0 (new 'stack-no-clear 'nav-gap-info)))
(when (plan-over-pat1-polys-using-route (-> s5-0 state) s4-0)
(set! (-> this enemy-flags) (the-as enemy-flag (logior (enemy-flag vulnerable) (-> this enemy-flags))))
(set! (-> this enemy-flags)
(the-as enemy-flag (logior (enemy-flag jump-check-blocked) (-> this enemy-flags)))
)
(send-event this 'jump 1 (-> s4-0 dest))
)
)
@ -335,7 +337,7 @@
0
)
)
(track-target! this)
(common-post this)
(update-transforms (-> this root))
0
(none)
@ -530,7 +532,7 @@
)
(set! (-> s5-0 y) 0.0)
(vector-normalize! s5-0 1.0)
;; og:preserve-this modified for PC, see comment near definition in collide-shape-h.gc
(normalized-heading-to-quaternion! (-> this root quat) s5-0)
)
@ -1066,11 +1068,11 @@
(set! (-> a0-2 param1) #f)
(set! (-> a0-2 param2) #f)
)
(set! (-> this enemy-flags) (the-as enemy-flag (logior (enemy-flag dislike-combo) (-> this enemy-flags))))
(set! (-> this enemy-flags) (the-as enemy-flag (logior (enemy-flag drawn-mirrored) (-> this enemy-flags))))
)
(logior! (-> this mask) (process-mask enemy))
(logior! (-> this mask) (process-mask actor-pause))
(logior! (-> this enemy-flags) (enemy-flag notice))
(logior! (-> this enemy-flags) (enemy-flag actor-pause-backup))
(set! (-> this nav-radius-backup) (-> this root nav-radius))
(set-enemy-info! this arg0)
(set! (-> this enemy-info callback-info) *nav-enemy-callback-info*)
@ -1180,13 +1182,13 @@
(set! (-> this on-hostile) (res-lump-struct (-> this entity) 'on-hostile pair))
(set! (-> this on-death) (res-lump-struct (-> this entity) 'on-death pair))
(if (-> this on-notice)
(logior! (-> this enemy-flags) (enemy-flag auto-reset-penetrate))
(logior! (-> this enemy-flags) (enemy-flag enable-on-notice))
)
(if (-> this on-active)
(logior! (-> this enemy-flags) (enemy-flag jump-check-blocked))
(logior! (-> this enemy-flags) (enemy-flag enable-on-active))
)
(if (-> this on-hostile)
(logior! (-> this enemy-flags) (enemy-flag drawn-mirrored))
(logior! (-> this enemy-flags) (enemy-flag enable-on-hostile))
)
(set! (-> this incoming attacker-handle) (the-as handle #f))
(let ((s4-0 (-> this root)))
@ -1196,33 +1198,27 @@
)
(set! (-> this penetrated-flinch) (-> arg0 penetrate-flinch))
(set! (-> this penetrated-knocked) (-> arg0 penetrate-knocked))
(set! (-> this reaction-time) (the-as time-frame (get-rand-int-range this 30 240)))
(set! (-> this reaction-time) (the-as time-frame (rnd-int-range this 30 240)))
(let* ((v1-113 (-> this enemy-flags))
(a0-47 (-> this fact enemy-options))
(v1-114 (logior (enemy-flag
enable-on-active
checking-water
enable-on-notice
look-at-move-dest
check-water-backup
no-initial-move-to-ground
)
v1-113
)
)
(v1-114
(logior (enemy-flag vulnerable vulnerable-backup use-notice-distance attackable-backup trackable trackable-backup)
v1-113
)
)
)
(if (logtest? (enemy-option multi-focus) a0-47)
(set! v1-114 (logior (enemy-flag trackable) v1-114))
(set! v1-114 (logior (enemy-flag multi-focus) v1-114))
)
(if (logtest? (enemy-option has-trigger) a0-47)
(set! v1-114 (logior (enemy-flag called-dying) v1-114))
(set! v1-114 (logior (enemy-flag use-trigger) v1-114))
)
(set! (-> this enemy-flags) v1-114)
)
(logior! (-> this mask) (process-mask collectable))
(do-navigation-to-destination (-> this nav state) (-> this root trans))
(if (and (-> this enemy-info move-to-ground)
(not (logtest? (enemy-flag vulnerable-backup) (-> this enemy-flags)))
(not (logtest? (enemy-flag no-initial-move-to-ground) (-> this enemy-flags)))
(not (logtest? (enemy-option ambush) (-> this fact enemy-options)))
)
(enemy-method-127 this 40960.0 40960.0 #t (the-as collide-spec (-> this gnd-collide)))
@ -1302,7 +1298,7 @@ This commonly includes things such as:
)
(defbehavior nav-enemy-simple-post nav-enemy ()
(track-target! self)
(common-post self)
(update-transforms (-> self root))
0
(none)
@ -1408,7 +1404,7 @@ This commonly includes things such as:
;; WARN: Return type mismatch int vs time-frame.
(defmethod nav-enemy-method-144 ((this nav-enemy))
(set! (-> this root nav-radius) 4.096)
(let ((s5-1 (max (-> this restore-nav-radius-time) (+ (current-time) (get-rand-int-range this 1500 2400)))))
(let ((s5-1 (max (-> this restore-nav-radius-time) (+ (current-time) (rnd-int-range this 1500 2400)))))
(set! (-> this restore-nav-radius-time) (the-as time-frame s5-1))
(the-as time-frame s5-1)
)
@ -1631,7 +1627,7 @@ This commonly includes things such as:
)
:code (behavior ()
(ja-channel-push! 1 (seconds 0.2))
(let ((f30-0 (get-rand-float-range self 0.9 1.1)))
(let ((f30-0 (rnd-float-range self 0.9 1.1)))
(until #f
(ja-no-eval :group! (-> self draw art-group data (-> self enemy-info walk-anim))
:num! (seek! max f30-0)
@ -1641,7 +1637,7 @@ This commonly includes things such as:
(suspend)
(ja :num! (seek! max f30-0))
)
(when (enemy-method-123 self 0.2)
(when (rnd-go-idle? self 0.2)
(ja-no-eval :num! (loop!))
(ja-channel-push! 1 (seconds 0.6))
(let ((v1-37 self))
@ -1659,7 +1655,7 @@ This commonly includes things such as:
(suspend)
(ja :num! (seek! max f30-0))
)
(until (not (enemy-method-123 self 0.2))
(until (not (rnd-go-idle? self 0.2))
(ja-no-eval :group! (-> self draw art-group data (-> self enemy-info idle-anim))
:num! (seek! max f30-0)
:frame-num 0.0
@ -1737,7 +1733,7 @@ This commonly includes things such as:
)
:code (behavior ()
(ja-channel-push! 1 (seconds 0.075))
(let ((f30-0 (get-rand-float-range self 0.8 1.2))
(let ((f30-0 (rnd-float-range self 0.8 1.2))
(gp-0 (new 'stack-no-clear 'vector))
)
(ja-no-eval :group! (-> self draw art-group data (-> self enemy-info notice-anim))
@ -1783,7 +1779,7 @@ This commonly includes things such as:
)
:trans (behavior ()
(nav-enemy-method-160 self)
(if (and (logtest? (-> self enemy-flags) (enemy-flag look-at-focus)) (-> self enemy-info use-victory))
(if (and (logtest? (-> self enemy-flags) (enemy-flag victory)) (-> self enemy-info use-victory))
(go-virtual victory)
)
(when (time-elapsed? (-> self state-time) (-> self reaction-time))
@ -1830,7 +1826,7 @@ This commonly includes things such as:
(set! (-> self state-timeout)
(the-as
time-frame
(the int (+ (lerp-scale 300.0 1200.0 f0-0 32768.0 122880.0) (get-rand-float-range self 0.0 30.0)))
(the int (+ (lerp-scale 300.0 1200.0 f0-0 32768.0 122880.0) (rnd-float-range self 0.0 30.0)))
)
)
)
@ -1852,7 +1848,7 @@ This commonly includes things such as:
)
:trans (behavior ()
(nav-enemy-method-160 self)
(if (and (logtest? (-> self enemy-flags) (enemy-flag look-at-focus)) (-> self enemy-info use-victory))
(if (and (logtest? (-> self enemy-flags) (enemy-flag victory)) (-> self enemy-info use-victory))
(go-virtual victory)
)
(when (time-elapsed? (-> self state-time) (seconds 0.1))
@ -1885,7 +1881,7 @@ This commonly includes things such as:
(ja-channel-push! 1 (seconds 0.1))
(ja :group! (-> self draw art-group data (-> self enemy-info walk-anim)))
(ja :num-func num-func-identity :frame-num 0.0)
(let ((f30-0 (get-rand-float-range self 0.8 1.2)))
(let ((f30-0 (rnd-float-range self 0.8 1.2)))
(until #f
(suspend)
(ja :num! (loop! f30-0))
@ -1975,7 +1971,7 @@ This commonly includes things such as:
)
:trans (behavior ()
(nav-enemy-method-160 self)
(if (and (logtest? (-> self enemy-flags) (enemy-flag look-at-focus)) (-> self enemy-info use-victory))
(if (and (logtest? (-> self enemy-flags) (enemy-flag victory)) (-> self enemy-info use-victory))
(go-virtual victory)
)
(let ((gp-0 (-> self focus aware)))
@ -2013,7 +2009,7 @@ This commonly includes things such as:
)
:code (behavior ()
(ja-channel-push! 1 (seconds 0.2))
(let ((f30-0 (get-rand-float-range self 0.9 1.1))
(let ((f30-0 (rnd-float-range self 0.9 1.1))
(gp-0 (-> self draw art-group data (-> self enemy-info idle-anim)))
)
(until #f
@ -2061,8 +2057,8 @@ This commonly includes things such as:
)
:code (behavior ()
(ja-channel-push! 1 (seconds 0.2))
(let ((f30-0 (get-rand-float-range self 0.8 1.2)))
(let ((gp-0 (get-rand-int-range self 60 210))
(let ((f30-0 (rnd-float-range self 0.8 1.2)))
(let ((gp-0 (rnd-int-range self 60 210))
(s5-0 (current-time))
(f28-0 f30-0)
)
@ -2095,8 +2091,8 @@ This commonly includes things such as:
:event enemy-event-handler
:enter (behavior ()
(set-time! (-> self state-time))
(look-at-target! self (enemy-flag lock-focus))
(logior! (-> self enemy-flags) (enemy-flag use-notice-distance))
(look-at-target! self (enemy-flag look-at-focus))
(logior! (-> self enemy-flags) (enemy-flag cam-attack-mode))
(let ((v1-6 self))
(if (not (logtest? (enemy-flag enemy-flag36) (-> v1-6 enemy-flags)))
(set! (-> v1-6 enemy-flags) (the-as enemy-flag (logior (enemy-flag enemy-flag38) (-> v1-6 enemy-flags))))
@ -2112,9 +2108,9 @@ This commonly includes things such as:
(nav-enemy-method-165 self)
(logclear! (-> self mask) (process-mask actor-pause))
(set! (-> self move-dest quad) (-> self root trans quad))
(set! (-> self state-timeout) (the-as time-frame (get-rand-int-range self 2100 3300)))
(set! (-> self state-timeout) (the-as time-frame (rnd-int-range self 2100 3300)))
(set-time! (-> self starting-time))
(if (zero? (get-rand-int self 2))
(if (zero? (rnd-int-count self 2))
(set! (-> self enemy-flags) (the-as enemy-flag (logior (enemy-flag enemy-flag40) (-> self enemy-flags))))
(set! (-> self enemy-flags) (the-as enemy-flag (logclear (-> self enemy-flags) (enemy-flag enemy-flag40))))
)
@ -2158,7 +2154,7 @@ This commonly includes things such as:
)
)
(when (>= 1024.0 (vector-vector-xz-distance (-> self root trans) (-> self move-dest)))
(when (and (time-elapsed? (-> self state-time) (-> self reaction-time)) (zero? (get-rand-int self 3)))
(when (and (time-elapsed? (-> self state-time) (-> self reaction-time)) (zero? (rnd-int-count self 3)))
(nav-enemy-method-161 self)
(go-stare2 self)
)
@ -2177,7 +2173,7 @@ This commonly includes things such as:
(set! (-> s5-0 quad) (-> self focus-pos quad))
(vector-! s4-0 (-> self root trans) s5-0)
(set! (-> s4-0 y) 0.0)
(vector-normalize! s4-0 (get-rand-float-range self 16384.0 49152.0))
(vector-normalize! s4-0 (rnd-float-range self 16384.0 49152.0))
(vector-rotate-around-y! s4-0 s4-0 f30-1)
(vector+! s5-0 s5-0 s4-0)
(if (and (cloest-point-on-mesh (-> self nav) s5-0 s5-0 (the-as nav-poly #f))
@ -2191,7 +2187,7 @@ This commonly includes things such as:
)
)
:code (behavior ()
(let ((f30-0 (get-rand-float-range self 0.9 1.1))
(let ((f30-0 (rnd-float-range self 0.9 1.1))
(gp-0 (-> self draw art-group data (-> self enemy-info walk-anim)))
)
(let ((v1-8 (ja-group)))
@ -2227,8 +2223,8 @@ This commonly includes things such as:
:event enemy-event-handler
:enter (behavior ()
(set-time! (-> self state-time))
(look-at-target! self (enemy-flag lock-focus))
(logior! (-> self enemy-flags) (enemy-flag use-notice-distance))
(look-at-target! self (enemy-flag look-at-focus))
(logior! (-> self enemy-flags) (enemy-flag cam-attack-mode))
(let ((v1-6 self))
(if (not (logtest? (enemy-flag enemy-flag36) (-> v1-6 enemy-flags)))
(set! (-> v1-6 enemy-flags) (the-as enemy-flag (logior (enemy-flag enemy-flag38) (-> v1-6 enemy-flags))))
@ -2252,8 +2248,8 @@ This commonly includes things such as:
(let ((f30-0 (-> self enemy-info circle-dist-lo))
(f28-0 (-> self enemy-info circle-dist-hi))
)
(if (zero? (get-rand-int self 4))
(set! (-> self desired-angle) (get-rand-float-range self f30-0 f28-0))
(if (zero? (rnd-int-count self 4))
(set! (-> self desired-angle) (rnd-float-range self f30-0 f28-0))
(set! (-> self desired-angle)
(fmax (fmin (vector-vector-xz-distance (-> self focus-pos) (-> self root trans)) f28-0) f30-0)
)
@ -2298,7 +2294,7 @@ This commonly includes things such as:
)
)
:code (behavior ()
(let ((f30-0 (get-rand-float-range self 0.9 1.1))
(let ((f30-0 (rnd-float-range self 0.9 1.1))
(gp-0 (-> self draw art-group data (-> self enemy-info walk-anim)))
)
(let ((v1-8 (ja-group)))
@ -2441,7 +2437,7 @@ This commonly includes things such as:
:code (behavior ()
(local-vars (v1-37 enemy-flag) (v1-45 enemy-flag))
(ja-channel-push! 1 (seconds 0.2))
(let ((f30-0 (get-rand-float-range self 0.9 1.1)))
(let ((f30-0 (rnd-float-range self 0.9 1.1)))
(ja-no-eval :group! (-> self draw art-group data (-> self enemy-info hit-anim))
:num! (seek! max f30-0)
:frame-num 0.0
@ -2451,29 +2447,29 @@ This commonly includes things such as:
(ja :num! (seek! max f30-0))
)
)
(if (logtest? (-> self enemy-flags) (enemy-flag check-water))
(if (logtest? (-> self enemy-flags) (enemy-flag dangerous-backup))
(logior! (-> self focus-status) (focus-status dangerous))
(logclear! (-> self focus-status) (focus-status dangerous))
)
(let ((v1-36 (-> self enemy-flags)))
(if (logtest? v1-36 (enemy-flag checking-water))
(set! v1-37 (logior v1-36 (enemy-flag enable-on-active)))
(set! v1-37 (logclear v1-36 (enemy-flag enable-on-active)))
(if (logtest? v1-36 (enemy-flag vulnerable-backup))
(set! v1-37 (logior v1-36 (enemy-flag vulnerable)))
(set! v1-37 (logclear v1-36 (enemy-flag vulnerable)))
)
)
(set! (-> self enemy-flags) v1-37)
(if (logtest? (-> self enemy-flags) (enemy-flag look-at-move-dest))
(if (logtest? (-> self enemy-flags) (enemy-flag attackable-backup))
(logior! (-> self mask) (process-mask collectable))
(logclear! (-> self mask) (process-mask collectable))
)
(let ((v1-44 (-> self enemy-flags)))
(if (logtest? (enemy-flag no-initial-move-to-ground) v1-44)
(set! v1-45 (logior (enemy-flag check-water-backup) v1-44))
(set! v1-45 (logclear v1-44 (enemy-flag check-water-backup)))
(if (logtest? (enemy-flag trackable-backup) v1-44)
(set! v1-45 (logior (enemy-flag trackable) v1-44))
(set! v1-45 (logclear v1-44 (enemy-flag trackable)))
)
)
(set! (-> self enemy-flags) v1-45)
(logclear! (-> self enemy-flags) (enemy-flag actor-pause-backup))
(logclear! (-> self enemy-flags) (enemy-flag lock-focus))
(logclear! (-> self focus-status) (focus-status hit))
(go-hostile self)
)
@ -2558,14 +2554,13 @@ This commonly includes things such as:
)
;; WARN: Return type mismatch quaternion vs none.
(defmethod enemy-method-92 ((this nav-enemy) (arg0 int) (arg1 nav-poly))
"TODO - nav-poly is a guess
@abstract"
(defmethod enemy-method-92 ((this nav-enemy) (arg0 int) (arg1 enemy-jump-info))
"@abstract"
(let ((v1-0 arg0))
(when (or (zero? v1-0) (= v1-0 1) (= v1-0 2) (= v1-0 3))
(let ((a1-4 this))
(if (logtest? (enemy-flag enemy-flag37) (-> a1-4 enemy-flags))
(seek-to-point-toward-point! (-> this root) (-> arg1 vertex2) (-> this nav max-rotation-rate) (seconds 0.02))
(seek-to-point-toward-point! (-> this root) (-> arg1 dest-pos) (-> this nav max-rotation-rate) (seconds 0.02))
)
)
)
@ -2610,7 +2605,7 @@ This commonly includes things such as:
(let ((s5-0 0))
(enemy-method-83 self gp-0)
(if (and (-> self enemy-info use-jump-blocked)
(logtest? (enemy-flag vulnerable) (-> self enemy-flags))
(logtest? (enemy-flag jump-check-blocked) (-> self enemy-flags))
(enemy-method-82 self gp-0)
)
(go-virtual jump-blocked)
@ -2631,13 +2626,13 @@ This commonly includes things such as:
(logior! (-> v1-18 shape nav-flags) (nav-flags has-extra-sphere))
)
0
(when (logtest? (-> gp-0 flags) 1)
(when (logtest? (-> gp-0 flags) (enemy-jump-flags enjflag-0))
(until #f
(if (enemy-method-90 self s5-0 gp-0)
(goto cfg-12)
)
(enemy-method-91 self s5-0 gp-0)
(enemy-method-92 self s5-0 (the-as nav-poly gp-0))
(enemy-method-92 self s5-0 gp-0)
(suspend)
(set! s5-0 1)
)
@ -2652,7 +2647,7 @@ This commonly includes things such as:
(+! (-> gp-0 hang-time) (- (current-time) (-> self clock old-frame-counter)))
(enemy-method-90 self s5-1 gp-0)
(enemy-method-91 self s5-1 gp-0)
(enemy-method-92 self s5-1 (the-as nav-poly gp-0))
(enemy-method-92 self s5-1 gp-0)
(suspend)
(set! s5-1 3)
)
@ -2674,14 +2669,14 @@ This commonly includes things such as:
(goto cfg-19)
)
(enemy-method-91 self s5-2 gp-0)
(enemy-method-92 self s5-2 (the-as nav-poly gp-0))
(enemy-method-92 self s5-2 gp-0)
(suspend)
(set! s5-2 5)
)
)
#f
(label cfg-19)
(if (logtest? (enemy-flag alert) (-> self enemy-flags))
(if (logtest? (enemy-flag directed) (-> self enemy-flags))
((lambda :behavior nav-enemy
((arg0 enemy-jump-info))
(send-event (ppointer->process (-> self parent)) 'child-jumped)
@ -2739,7 +2734,7 @@ This commonly includes things such as:
:virtual #t
:event enemy-event-handler
:enter (behavior ()
(logior! (-> self enemy-flags) (enemy-flag victory))
(logior! (-> self enemy-flags) (enemy-flag directed-ready))
((-> (method-of-type nav-enemy idle) enter))
)
:code (-> (method-of-type nav-enemy idle) code)

View File

@ -2955,7 +2955,7 @@
(set! (-> v1-6 invinc-time) (the-as time-frame (-> *TARGET-bank* hit-invulnerable-timeout)))
(set! (-> v1-6 speed) 1.0)
(set! (-> v1-6 damage) (-> *FACT-bank* health-default-inc))
(set! (-> v1-6 knock) (the-as uint 0))
(set! (-> v1-6 knock) (knocked-type knocked-type-0))
)
(case arg0
(('shove)
@ -3039,7 +3039,7 @@
)
)
(when (not (and (= (-> self game mode) 'play) (>= 0.0 (-> (the-as fact-info-target (-> self fact)) health))))
(when (= (-> gp-0 knock) 8)
(when (= (-> gp-0 knock) (knocked-type knocked-type-8))
(set-quaternion! (-> self control) (-> self control dir-targ))
(set-forward-vel (* -3.0 (-> gp-0 shove-back)))
(when (demo?)

View File

@ -179,12 +179,12 @@
)
(defmethod track-target! ((this grunt-mech))
(defmethod common-post ((this grunt-mech))
"Does a lot of various things relating to interacting with the target
- tracks when the enemy was last drawn
- looks at the target and handles attacking
@TODO Not extremely well understood yet"
((method-of-type grunt track-target!) this)
((method-of-type grunt common-post) this)
0
(none)
)
@ -240,7 +240,7 @@
(when (!= gp-0 -1)
(let ((s3-1 (-> s4-0 holds gp-0 lower-hold)))
(when (!= s3-1 -1)
(if (and (or (zero? (get-rand-int this 2))
(if (and (or (zero? (rnd-int-count this 2))
(>= 14336.0 (vector-vector-xz-distance-squared (-> this root trans) (target-pos 0)))
)
(grunt-mech-info-method-9 s4-0 s3-1 this #t)
@ -332,7 +332,7 @@
:virtual #t
:event enemy-event-handler
:enter (behavior ()
(logior! (-> self enemy-flags) (enemy-flag actor-pause-backup))
(logior! (-> self enemy-flags) (enemy-flag lock-focus))
(let ((v1-2 self))
(set! (-> v1-2 enemy-flags) (the-as enemy-flag (logclear (-> v1-2 enemy-flags) (enemy-flag enemy-flag37))))
)
@ -347,7 +347,7 @@
(logclear! (-> self root nav-flags) (nav-flags has-root-sphere))
)
:exit (behavior ()
(logclear! (-> self enemy-flags) (enemy-flag actor-pause-backup))
(logclear! (-> self enemy-flags) (enemy-flag lock-focus))
(logior! (-> self root nav-flags) (nav-flags has-root-sphere))
)
:trans (behavior ()
@ -490,8 +490,8 @@
(vector-normalize! s5-1 1.0)
(countdown (s4-0 3)
(let ((s3-0 (new 'stack-no-clear 'vector)))
(vector-rotate-around-y! s3-0 s5-1 (get-rand-float-range this -10922.667 10922.667))
(when (grunt-mech-method-195 this s3-0 (the-as vector (get-rand-float-range this 16384.0 24576.0)) s5-1)
(vector-rotate-around-y! s3-0 s5-1 (rnd-float-range this -10922.667 10922.667))
(when (grunt-mech-method-195 this s3-0 (the-as vector (rnd-float-range this 16384.0 24576.0)) s5-1)
#t
(goto cfg-16)
)
@ -532,14 +532,14 @@
:event enemy-event-handler
:enter (behavior ()
(set-time! (-> self state-time))
(logior! (-> self enemy-flags) (enemy-flag actor-pause-backup))
(logior! (-> self enemy-flags) (enemy-flag lock-focus))
(set! (-> self root root-prim prim-core collide-as) (collide-spec))
(stop-looking-at-target! self)
(set! (-> self state-timeout) (+ (current-time) (get-rand-int-range self 450 900)))
(set! (-> self state-timeout) (+ (current-time) (rnd-int-range self 450 900)))
(logclear! (-> self root nav-flags) (nav-flags has-root-sphere))
)
:exit (behavior ()
(logclear! (-> self enemy-flags) (enemy-flag actor-pause-backup))
(logclear! (-> self enemy-flags) (enemy-flag lock-focus))
(let ((v1-3 (-> self root root-prim)))
(set! (-> v1-3 prim-core collide-as) (-> self root backup-collide-as))
(set! (-> v1-3 prim-core collide-with) (-> self root backup-collide-with))
@ -561,12 +561,12 @@
(let ((gp-0 0))
0
(until #f
(set! gp-0 (enemy-method-120 self 3 (ash 1 gp-0)))
(set! gp-0 (rnd-bit self 3 (ash 1 gp-0)))
(let ((v1-30 gp-0))
(cond
((zero? v1-30)
(ja-channel-push! 1 (seconds 0.13))
(countdown (s5-0 (get-rand-int-range self 1 2))
(countdown (s5-0 (rnd-int-range self 1 2))
(let ((s4-0 #t))
(ja-no-eval :group! grunt-mech-head-butt-ja :num! (seek! (ja-aframe 17.0 0) 0.222) :frame-num 0.0)
(until (ja-done? 0)
@ -588,7 +588,7 @@
)
((= v1-30 1)
(ja-channel-push! 1 (seconds 0.13))
(countdown (s5-1 (get-rand-int-range self 1 3))
(countdown (s5-1 (rnd-int-range self 1 3))
(let ((s4-1 #t))
(ja-no-eval :group! grunt-mech-punch-left-ja :num! (seek! (ja-aframe 24.0 0) 0.568) :frame-num 0.0)
(until (ja-done? 0)
@ -613,7 +613,7 @@
)
(else
(ja-channel-push! 1 (seconds 0.13))
(countdown (s5-2 (get-rand-int-range self 1 3))
(countdown (s5-2 (rnd-int-range self 1 3))
(let ((s4-2 #t))
(ja-no-eval :group! grunt-mech-double-pound-ja :num! (seek! (ja-aframe 30.0 0) 0.111) :frame-num 0.0)
(until (ja-done? 0)
@ -638,7 +638,7 @@
)
)
)
(when (= (get-rand-int self 4) 3)
(when (= (rnd-int-count self 4) 3)
(ja-channel-push! 1 (seconds 0.13))
(ja-no-eval :group! grunt-mech-idle0-ja :num! (seek! max 0.090909) :frame-num 0.0)
(until (ja-done? 0)
@ -744,7 +744,7 @@
:event enemy-event-handler
:enter (behavior ()
((-> (method-of-type grunt circling) enter))
(set! (-> self state-timeout) (+ (current-time) (get-rand-int-range self 750 1200)))
(set! (-> self state-timeout) (+ (current-time) (rnd-int-range self 750 1200)))
)
:trans (behavior ()
(let ((a0-1 (handle->process (-> self focus handle))))
@ -802,7 +802,7 @@
:event enemy-event-handler
:enter (behavior ()
((-> (method-of-type grunt-mech mech-post-circling) enter))
(set! (-> self state-timeout) (+ (current-time) (get-rand-int-range self 900 1800)))
(set! (-> self state-timeout) (+ (current-time) (rnd-int-range self 900 1800)))
)
:trans (-> (method-of-type grunt-mech mech-post-circling) trans)
:code (-> (method-of-type grunt-mech mech-post-circling) code)

View File

@ -740,6 +740,45 @@
(progress-shadows-extended #x12a2)
(progress-error-no-resolutions #x12a3)
(progress-territory-auto #x12a4)
(progress-kill-stats #x12a5)
(progress-other-stats #x12a6)
(progress-ks-total-killed #x12a7)
(progress-ks-killed-by-jak #x12a8)
(progress-ks-killed-by-darkjak #x12a9)
(progress-ks-killed-by-daxter #x12aa)
(progress-ks-killed-by-others #x12ab)
(progress-ks-source-gun-yellow #x12ac)
(progress-ks-source-gun-red #x12ad)
(progress-ks-source-gun-blue #x12ae)
(progress-ks-source-gun-dark #x12af)
(progress-ks-source-board #x12b0)
(progress-ks-source-board-trick #x12b1)
(progress-ks-source-mech #x12b2)
(progress-ks-source-mech-bonk #x12b3)
(progress-ks-source-turret #x12b4)
(progress-ks-source-punch #x12b5)
(progress-ks-source-flop #x12b6)
(progress-ks-source-uppercut #x12b7)
(progress-ks-source-spin #x12b8)
(progress-ks-source-roll #x12b9)
(progress-ks-source-darkjak-punch #x12ba)
(progress-ks-source-darkjak-flop #x12bb)
(progress-ks-source-darkjak-uppercut #x12bc)
(progress-ks-source-darkjak-spin #x12bd)
(progress-ks-source-darkjak-roll #x12be)
(progress-ks-source-darkjak-bomb0 #x12bf)
(progress-ks-source-darkjak-bomb1 #x12c0)
(progress-ks-source-indax-punch #x12c1)
(progress-ks-source-indax-spin #x12c2)
(progress-ks-source-guard #x12c3)
(progress-ks-source-sig #x12c4)
(progress-ks-source-ashelin #x12c5)
(progress-ks-source-jinx #x12c6)
(progress-ks-source-grim #x12c7)
(progress-ks-source-mog #x12c8)
(progress-ks-source-metalhead #x12c9)
(progress-ks-source-other-bot #x12ca)
(progress-ks-source-other-enemy #x12cb)
(progress-input-options-auto-hide-cursor #x1300)
(progress-menu-reassign-binds #x1301)
(progress-reassign-binds-controller #x1302)

View File

@ -190,7 +190,7 @@
(set! (-> (the-as asht-wait-spot v1-24) check-done)
(lambda ((arg0 asht-wait-spot) (arg1 ashelin-battle))
(with-pp
(when (not (channel-active? arg1 (the-as uint 0)))
(when (not (channel-active? arg1 (gui-channel none)))
(cond
((and (not (speech-playing? arg1 45)) (time-elapsed? (-> arg1 waypoint-time0) (seconds 2.5)))
(play-speech arg1 45)
@ -260,8 +260,8 @@
(ashelin-method-250 arg0 #f)
(remove-setting! 'airlock)
(logclear! (-> arg0 bot-flags) (bot-flags bf10))
(when (not (channel-active? arg0 (the-as uint 0)))
(let ((v1-12 (get-rand-int arg0 3)))
(when (not (channel-active? arg0 (gui-channel none)))
(let ((v1-12 (rnd-int-count arg0 3)))
(cond
((zero? v1-12)
(play-speech arg0 42)
@ -298,7 +298,7 @@
(when (time-elapsed? (-> arg1 waypoint-time0) (seconds 1.5))
(let ((s5-0 (get-current-task-event (-> arg1 task))))
(when (and (= (-> s5-0 action) (game-task-action say))
(not (channel-active? arg1 (the-as uint 0)))
(not (channel-active? arg1 (gui-channel none)))
(scene-play arg1 (the-as string (-> s5-0 scene)) #f)
)
(ai-task-control-method-12 (-> arg1 ai-ctrl) arg1)
@ -361,7 +361,7 @@
:on-set (lambda ((arg0 ashelin-battle))
(process-entity-status! arg0 (entity-perm-status bit-4) #f)
(process-entity-status! arg0 (entity-perm-status no-kill) #f)
(logclear! (-> arg0 enemy-flags) (enemy-flag use-notice-distance))
(logclear! (-> arg0 enemy-flags) (enemy-flag cam-attack-mode))
(let ((v1-3 (get-task-by-type (-> arg0 ai-ctrl) asht-wait-spot arg0)))
(set! (-> v1-3 bytes 5) 3)
(set! (-> v1-3 bytes 6) 5)

View File

@ -677,12 +677,12 @@
(none)
)
(defmethod track-target! ((this juicer))
(defmethod common-post ((this juicer))
"Does a lot of various things relating to interacting with the target
- tracks when the enemy was last drawn
- looks at the target and handles attacking
@TODO Not extremely well understood yet"
(let ((t9-0 (method-of-type nav-enemy track-target!)))
(let ((t9-0 (method-of-type nav-enemy common-post)))
(t9-0 this)
)
(los-control-method-9 (-> this los) (the-as process-focusable #f) (the-as vector #f) 2048.0)
@ -698,7 +698,7 @@
)
)
)
(zero? (get-rand-int this 3))
(zero? (rnd-int-count this 3))
(let ((f0-0 (vector-vector-distance-squared (-> this root trans) (target-pos 0)))
(f1-0 32768.0)
)
@ -720,15 +720,15 @@
((zero? (-> this hit-points))
(logclear! (-> this mask) (process-mask actor-pause))
(logclear! (-> this focus-status) (focus-status dangerous))
(logclear! (-> this enemy-flags) (enemy-flag enable-on-notice))
(logior! (-> this enemy-flags) (enemy-flag chase-startup))
(logclear! (-> this enemy-flags) (enemy-flag use-notice-distance))
(logior! (-> this enemy-flags) (enemy-flag alert))
(logior! (-> this focus-status) (focus-status hit))
(if (zero? (-> this hit-points))
(logior! (-> this focus-status) (focus-status dead))
)
(logclear! (-> this enemy-flags) (enemy-flag actor-pause-backup))
(logclear! (-> this enemy-flags) (enemy-flag lock-focus))
(enemy-method-62 this)
(logior! (-> this enemy-flags) (enemy-flag actor-pause-backup))
(logior! (-> this enemy-flags) (enemy-flag lock-focus))
(process-contact-action arg0)
(send-event arg0 'get-attack-count 1)
(juicer-method-180 this)
@ -749,15 +749,15 @@
(('hit)
(logclear! (-> this mask) (process-mask actor-pause))
(logclear! (-> this focus-status) (focus-status dangerous))
(logclear! (-> this enemy-flags) (enemy-flag enable-on-notice))
(logior! (-> this enemy-flags) (enemy-flag chase-startup))
(logclear! (-> this enemy-flags) (enemy-flag use-notice-distance))
(logior! (-> this enemy-flags) (enemy-flag alert))
(logior! (-> this focus-status) (focus-status hit))
(if (zero? (-> this hit-points))
(logior! (-> this focus-status) (focus-status dead))
)
(logclear! (-> this enemy-flags) (enemy-flag actor-pause-backup))
(logclear! (-> this enemy-flags) (enemy-flag lock-focus))
(enemy-method-62 this)
(logior! (-> this enemy-flags) (enemy-flag actor-pause-backup))
(logior! (-> this enemy-flags) (enemy-flag lock-focus))
(process-contact-action arg0)
(send-event arg0 'get-attack-count 1)
(if (zero? (-> this hit-points))
@ -777,15 +777,15 @@
)
(logclear! (-> this mask) (process-mask actor-pause))
(logclear! (-> this focus-status) (focus-status dangerous))
(logclear! (-> this enemy-flags) (enemy-flag enable-on-notice))
(logior! (-> this enemy-flags) (enemy-flag chase-startup))
(logclear! (-> this enemy-flags) (enemy-flag use-notice-distance))
(logior! (-> this enemy-flags) (enemy-flag alert))
(logior! (-> this focus-status) (focus-status hit))
(if (zero? (-> this hit-points))
(logior! (-> this focus-status) (focus-status dead))
)
(logclear! (-> this enemy-flags) (enemy-flag actor-pause-backup))
(logclear! (-> this enemy-flags) (enemy-flag lock-focus))
(enemy-method-62 this)
(logior! (-> this enemy-flags) (enemy-flag actor-pause-backup))
(logior! (-> this enemy-flags) (enemy-flag lock-focus))
(process-contact-action arg0)
(send-event arg0 'get-attack-count 1)
(juicer-method-180 this)
@ -820,10 +820,10 @@
)
)
)
(let ((f30-0 (get-rand-float-range self 0.9 1.1)))
(let ((f30-0 (rnd-float-range self 0.9 1.1)))
(until #f
(let ((gp-0 (-> self draw art-group data (-> (&-> *juicer-global-info* patrol-anim (get-rand-int self 2)) 0)))
(s5-0 (get-rand-int-range self 1 8))
(let ((gp-0 (-> self draw art-group data (-> (&-> *juicer-global-info* patrol-anim (rnd-int-count self 2)) 0)))
(s5-0 (rnd-int-range self 1 8))
)
(let ((v1-34 (ja-group)))
(if (not (and v1-34 (= v1-34 gp-0)))
@ -838,7 +838,7 @@
)
)
)
(when (zero? (get-rand-int self 2))
(when (zero? (rnd-int-count self 2))
(let ((v1-58 self))
(set! (-> v1-58 enemy-flags) (the-as enemy-flag (logclear (-> v1-58 enemy-flags) (enemy-flag enemy-flag36))))
(set! (-> v1-58 nav callback-info) *nav-enemy-null-callback-info*)
@ -846,8 +846,8 @@
0
(ja-channel-push! 1 (seconds 0.3))
(let ((gp-1 0))
(until (not (enemy-method-123 self 0.4))
(let* ((v1-62 (enemy-method-120 self 3 gp-1))
(until (not (rnd-go-idle? self 0.4))
(let* ((v1-62 (rnd-bit self 3 gp-1))
(a1-16 (-> self draw art-group data (-> *juicer-global-info* idle-anim v1-62)))
)
(set! gp-1 (ash 1 v1-62))
@ -922,7 +922,9 @@
(until #f
(let ((gp-0 (new 'stack-no-clear 'vector)))
(get-point-in-path! (-> self intro-path) gp-0 1.0 'interp)
(set! (-> self enemy-flags) (the-as enemy-flag (logclear (-> self enemy-flags) (enemy-flag vulnerable))))
(set! (-> self enemy-flags)
(the-as enemy-flag (logclear (-> self enemy-flags) (enemy-flag jump-check-blocked)))
)
(let ((a1-1 (new 'stack-no-clear 'event-message-block)))
(let ((v1-5 (process->ppointer self)))
(set! (-> a1-1 from) v1-5)
@ -955,7 +957,9 @@
(until #f
(let ((gp-0 (new 'stack-no-clear 'vector)))
(get-point-in-path! (-> self intro-path) gp-0 (the float (-> self ambush-path-pt)) 'interp)
(set! (-> self enemy-flags) (the-as enemy-flag (logclear (-> self enemy-flags) (enemy-flag vulnerable))))
(set! (-> self enemy-flags)
(the-as enemy-flag (logclear (-> self enemy-flags) (enemy-flag jump-check-blocked)))
)
(let ((a1-1 (new 'stack-no-clear 'event-message-block)))
(let ((v1-9 (process->ppointer self)))
(set! (-> a1-1 from) v1-9)
@ -996,10 +1000,10 @@
)
)
)
(let ((f30-1 (get-rand-float-range self 0.8 1.2))
(let ((f30-1 (rnd-float-range self 0.8 1.2))
(gp-2 (new 'stack-no-clear 'vector))
)
(let* ((a0-13 (enemy-method-120 self 2 s5-0))
(let* ((a0-13 (rnd-bit self 2 s5-0))
(a1-8 (-> self draw art-group data (-> *juicer-global-info* notice-anim a0-13)))
)
(ja-no-eval :group! a1-8 :num! (seek! max f30-1) :frame-num 0.0)
@ -1022,8 +1026,8 @@
:virtual #t
:code (behavior ()
(ja-channel-push! 1 (seconds 0.15))
(let ((gp-1 (-> self draw art-group data (-> *juicer-global-info* celebrate-anim (get-rand-int self 2))))
(f30-0 (get-rand-float-range self 0.9 1.1))
(let ((gp-1 (-> self draw art-group data (-> *juicer-global-info* celebrate-anim (rnd-int-count self 2))))
(f30-0 (rnd-float-range self 0.9 1.1))
)
(ja-no-eval :group! gp-1 :num! (seek! max f30-0) :frame-num 0.0)
(until (ja-done? 0)
@ -1062,7 +1066,7 @@
)
)
)
(let* ((v1-16 (get-rand-int self 2))
(let* ((v1-16 (rnd-int-count self 2))
(gp-0 (-> self draw art-group data (-> *juicer-global-info* charge-anim v1-16)))
)
(set! (-> self charge-index) v1-16)
@ -1074,7 +1078,7 @@
(set! (-> self skel root-channel 0 frame-group) (the-as art-joint-anim gp-0))
)
(ja :num-func num-func-identity :frame-num 0.0)
(let ((f30-0 (get-rand-float-range self 0.9 1.1)))
(let ((f30-0 (rnd-float-range self 0.9 1.1)))
(until #f
(suspend)
(ja :num! (loop! f30-0))
@ -1230,7 +1234,7 @@
)
0
(set! (-> self torso-track-player) (the-as basic #t))
(logior! (-> self enemy-flags) (enemy-flag actor-pause-backup))
(logior! (-> self enemy-flags) (enemy-flag lock-focus))
(set! (-> self hit-focus) #f)
(logior! (-> self focus-status) (focus-status dangerous))
(let* ((v1-9 *game-info*)
@ -1242,10 +1246,10 @@
)
:exit (behavior ()
(set! (-> self torso-track-player) #f)
(logclear! (-> self enemy-flags) (enemy-flag actor-pause-backup))
(logclear! (-> self enemy-flags) (enemy-flag lock-focus))
(juicer-method-184 self #f)
(set-time! (-> self last-fire-time))
(if (logtest? (-> self enemy-flags) (enemy-flag check-water))
(if (logtest? (-> self enemy-flags) (enemy-flag dangerous-backup))
(logior! (-> self focus-status) (focus-status dangerous))
(logclear! (-> self focus-status) (focus-status dangerous))
)
@ -1286,7 +1290,7 @@
)
)
)
(if (and (logtest? (-> self enemy-flags) (enemy-flag look-at-focus)) (-> self enemy-info use-victory))
(if (and (logtest? (-> self enemy-flags) (enemy-flag victory)) (-> self enemy-info use-victory))
(go-virtual victory)
)
(b!
@ -1359,7 +1363,7 @@
)
0
(nav-enemy-method-166 self)
(let* ((v1-23 (get-rand-int self 2))
(let* ((v1-23 (rnd-int-count self 2))
(gp-0 (-> self draw art-group data (-> *juicer-global-info* charge-anim v1-23)))
)
(set! (-> self charge-index) v1-23)
@ -1368,8 +1372,8 @@
(ja-channel-push! 1 (seconds 0.15))
)
)
(let ((s5-0 (+ (get-rand-int self 6) 2))
(f30-0 (get-rand-float-range self 0.9 1.1))
(let ((s5-0 (+ (rnd-int-count self 6) 2))
(f30-0 (rnd-float-range self 0.9 1.1))
)
(while (nonzero? s5-0)
(+! s5-0 -1)
@ -1393,8 +1397,8 @@
0
(vector-reset! (-> self root transv))
(ja-channel-push! 1 (seconds 0.1))
(let ((gp-2 (-> self draw art-group data (-> *juicer-global-info* celebrate-anim (get-rand-int self 2))))
(f30-2 (get-rand-float-range self 0.9 1.1))
(let ((gp-2 (-> self draw art-group data (-> *juicer-global-info* celebrate-anim (rnd-int-count self 2))))
(f30-2 (rnd-float-range self 0.9 1.1))
)
(ja-no-eval :group! gp-2 :num! (seek! max f30-2) :frame-num 0.0)
(until (ja-done? 0)
@ -1413,7 +1417,7 @@
:code (behavior ()
(local-vars (v1-37 enemy-flag) (v1-45 enemy-flag))
(ja-channel-push! 1 (seconds 0.2))
(let ((f30-0 (get-rand-float-range self 0.9 1.1)))
(let ((f30-0 (rnd-float-range self 0.9 1.1)))
(ja-no-eval :group! (-> self draw art-group data (-> self enemy-info hit-anim))
:num! (seek! max f30-0)
:frame-num 0.0
@ -1423,29 +1427,29 @@
(ja :num! (seek! max f30-0))
)
)
(if (logtest? (-> self enemy-flags) (enemy-flag check-water))
(if (logtest? (-> self enemy-flags) (enemy-flag dangerous-backup))
(logior! (-> self focus-status) (focus-status dangerous))
(logclear! (-> self focus-status) (focus-status dangerous))
)
(let ((v1-36 (-> self enemy-flags)))
(if (logtest? v1-36 (enemy-flag checking-water))
(set! v1-37 (logior v1-36 (enemy-flag enable-on-active)))
(set! v1-37 (logclear v1-36 (enemy-flag enable-on-active)))
(if (logtest? v1-36 (enemy-flag vulnerable-backup))
(set! v1-37 (logior v1-36 (enemy-flag vulnerable)))
(set! v1-37 (logclear v1-36 (enemy-flag vulnerable)))
)
)
(set! (-> self enemy-flags) v1-37)
(if (logtest? (-> self enemy-flags) (enemy-flag look-at-move-dest))
(if (logtest? (-> self enemy-flags) (enemy-flag attackable-backup))
(logior! (-> self mask) (process-mask collectable))
(logclear! (-> self mask) (process-mask collectable))
)
(let ((v1-44 (-> self enemy-flags)))
(if (logtest? (enemy-flag no-initial-move-to-ground) v1-44)
(set! v1-45 (logior (enemy-flag check-water-backup) v1-44))
(set! v1-45 (logclear v1-44 (enemy-flag check-water-backup)))
(if (logtest? (enemy-flag trackable-backup) v1-44)
(set! v1-45 (logior (enemy-flag trackable) v1-44))
(set! v1-45 (logclear v1-44 (enemy-flag trackable)))
)
)
(set! (-> self enemy-flags) v1-45)
(logclear! (-> self enemy-flags) (enemy-flag actor-pause-backup))
(logclear! (-> self enemy-flags) (enemy-flag lock-focus))
(logclear! (-> self focus-status) (focus-status hit))
(go-virtual hostile)
)
@ -1455,7 +1459,7 @@
:virtual #t
:code (behavior ()
(ja-channel-push! 1 (seconds 1))
(let ((f30-0 (get-rand-float-range self 0.9 1.1))
(let ((f30-0 (rnd-float-range self 0.9 1.1))
(gp-0 (-> self draw art-group data (-> self enemy-info idle-anim)))
)
(until #f
@ -1474,8 +1478,8 @@
:virtual #t
:code (behavior ()
(ja-channel-push! 1 (seconds 0.6))
(let ((f30-0 (get-rand-float-range self 0.8 1.2)))
(let ((gp-0 (get-rand-int-range self 60 210))
(let ((f30-0 (rnd-float-range self 0.8 1.2)))
(let ((gp-0 (rnd-int-range self 60 210))
(s5-0 (current-time))
(f28-0 f30-0)
)
@ -1502,20 +1506,20 @@
)
)
(defmethod enemy-method-77 ((this juicer) (arg0 (pointer float)))
(defmethod enemy-method-77 ((this juicer) (arg0 enemy-knocked-info))
(local-vars (a2-2 int))
(case (-> this incoming knocked-type)
(((knocked-type knocked-type-4))
(ja-channel-push! 1 0)
(let* ((a2-0 (ash 1 (-> *juicer-global-info* prev-yellow-hit)))
(v1-3 (enemy-method-120 this 4 a2-0))
(v1-3 (rnd-bit this 4 a2-0))
(a1-6 (-> this draw art-group data (-> *juicer-global-info* yellow-hit-anim v1-3)))
)
(set! (-> *juicer-global-info* prev-yellow-hit) v1-3)
(let ((a0-13 (-> this skel root-channel 0)))
(set! (-> a0-13 frame-group) (the-as art-joint-anim a1-6))
(set! (-> a0-13 param 0) (the float (+ (-> (the-as art-joint-anim a1-6) frames num-frames) -1)))
(set! (-> a0-13 param 1) (-> arg0 0))
(set! (-> a0-13 param 1) (-> arg0 anim-speed))
(set! (-> a0-13 frame-num) 0.0)
(joint-control-channel-group! a0-13 (the-as art-joint-anim a1-6) num-func-seek!)
)
@ -1528,7 +1532,7 @@
(set! a2-2 (logior v1-11 7))
)
)
(let* ((v1-15 (enemy-method-120 this 6 a2-2))
(let* ((v1-15 (rnd-bit this 6 a2-2))
(s5-1 (-> this draw art-group data (-> *juicer-global-info* blue-hit-anim v1-15)))
)
(set! (-> *juicer-global-info* prev-blue-hit) v1-15)
@ -1552,12 +1556,12 @@
)
)
(else
(let ((s4-1 (-> this draw art-group data (-> *juicer-global-info* knocked-anim (get-rand-int this 2)))))
(let ((s4-1 (-> this draw art-group data (-> *juicer-global-info* knocked-anim (rnd-int-count this 2)))))
(ja-channel-push! 1 (seconds 0.17))
(let ((a0-37 (-> this skel root-channel 0)))
(set! (-> a0-37 frame-group) (the-as art-joint-anim s4-1))
(set! (-> a0-37 param 0) (the float (+ (-> (the-as art-joint-anim s4-1) frames num-frames) -1)))
(set! (-> a0-37 param 1) (-> arg0 0))
(set! (-> a0-37 param 1) (-> arg0 anim-speed))
(set! (-> a0-37 frame-num) 0.0)
(joint-control-channel-group! a0-37 (the-as art-joint-anim s4-1) num-func-seek!)
)
@ -1567,7 +1571,7 @@
#t
)
(defmethod enemy-method-78 ((this juicer) (arg0 (pointer float)))
(defmethod enemy-method-78 ((this juicer) (arg0 enemy-knocked-info))
(cond
((= (-> this incoming knocked-type) (knocked-type knocked-type-6))
(when (>= (-> this incoming blue-juggle-count) (the-as uint 2))
@ -1576,7 +1580,7 @@
(let ((a0-3 (-> this skel root-channel 0)))
(set! (-> a0-3 frame-group) (the-as art-joint-anim s4-0))
(set! (-> a0-3 param 0) (the float (+ (-> (the-as art-joint-anim s4-0) frames num-frames) -1)))
(set! (-> a0-3 param 1) (-> arg0 0))
(set! (-> a0-3 param 1) (-> arg0 anim-speed))
(set! (-> a0-3 frame-num) 0.0)
(joint-control-channel-group! a0-3 (the-as art-joint-anim s4-0) num-func-seek!)
)
@ -1599,7 +1603,7 @@
(let ((a0-10 (-> this skel root-channel 0)))
(set! (-> a0-10 frame-group) (the-as art-joint-anim s4-1))
(set! (-> a0-10 param 0) (the float (+ (-> (the-as art-joint-anim s4-1) frames num-frames) -1)))
(set! (-> a0-10 param 1) (-> arg0 0))
(set! (-> a0-10 param 1) (-> arg0 anim-speed))
(set! (-> a0-10 frame-num) 0.0)
(joint-control-channel-group! a0-10 (the-as art-joint-anim s4-1) num-func-seek!)
)

View File

@ -155,7 +155,7 @@
)
(if (and (logtest? (-> arg0 bot-task-bits) (bot-task-bits botbits-4))
(not (speech-playing? arg0 26))
(not (channel-active? arg0 (the-as uint 0)))
(not (channel-active? arg0 (gui-channel none)))
)
(play-speech arg0 26)
)
@ -166,7 +166,7 @@
(defun sig-say-waste-the-suckers-if-should ((arg0 sig-atoll))
(if (and (logtest? (-> arg0 bot-task-bits) (bot-task-bits botbits-3))
(not (speech-playing? arg0 25))
(not (channel-active? arg0 (the-as uint 0)))
(not (channel-active? arg0 (gui-channel none)))
)
(play-speech arg0 25)
)
@ -358,7 +358,7 @@
:on-update (lambda ((arg0 sig-atoll))
(if (and (logtest? (-> arg0 bot-task-bits) (bot-task-bits botbits-1))
(not (speech-playing? arg0 33))
(not (channel-active? arg0 (the-as uint 0)))
(not (channel-active? arg0 (gui-channel none)))
)
(play-speech arg0 33)
)
@ -411,7 +411,7 @@
:on-update (lambda ((arg0 sig-atoll))
(if (and (logtest? (-> arg0 bot-task-bits) (bot-task-bits botbits-1))
(not (speech-playing? arg0 33))
(not (channel-active? arg0 (the-as uint 0)))
(not (channel-active? arg0 (gui-channel none)))
)
(play-speech arg0 33)
)
@ -452,7 +452,7 @@
)
:on-update (lambda ((arg0 sig-atoll))
(if (and (not (speech-playing? arg0 1))
(not (channel-active? arg0 (the-as uint 0)))
(not (channel-active? arg0 (gui-channel none)))
(< (-> arg0 root trans z) (-> (target-pos 0) z))
)
(play-speech arg0 1)
@ -497,7 +497,7 @@
(none)
)
:on-update (lambda ((arg0 sig-atoll))
(when (not (channel-active? arg0 (the-as uint 0)))
(when (not (channel-active? arg0 (gui-channel none)))
(if (and (not (speech-playing? arg0 1)) (< (-> arg0 root trans z) (-> (target-pos 0) z)))
(play-speech arg0 1)
)
@ -596,7 +596,7 @@
(the-as
(function sigt-charge-plasma sig symbol)
(lambda ((arg0 object) (arg1 sig-atoll))
(if (and (not (channel-active? arg1 (the-as uint 0))) (sig-atoll-method-259 arg1))
(if (and (not (channel-active? arg1 (gui-channel none))) (sig-atoll-method-259 arg1))
(sig-plasma-method-9 (-> arg1 plasma))
)
(when (and (sig-plasma-method-13 (-> arg1 plasma)) (scene-play arg1 "atoll-sig-tank" #f))
@ -681,7 +681,7 @@
(else
(when (outside-spot-radius? arg1 (the-as bot-spot #f) (the-as vector #f) #f)
(if (and (not (speech-playing? arg1 5))
(not (channel-active? arg1 (the-as uint 0)))
(not (channel-active? arg1 (gui-channel none)))
(let ((f0-1 73728.0))
(>= (* f0-1 f0-1) (vector-vector-xz-distance-squared (target-pos 0) (-> arg1 root trans)))
)
@ -857,7 +857,7 @@
)
(else
(when (and (outside-spot-radius? arg0 (the-as bot-spot #f) (the-as vector #f) #f)
(not (channel-active? arg0 (the-as uint 0)))
(not (channel-active? arg0 (gui-channel none)))
)
(let ((a1-7 (new 'stack-no-clear 'event-message-block)))
(set! (-> a1-7 from) (process->ppointer pp))
@ -950,7 +950,7 @@
)
(cond
((and (< f0-2 (* f1-0 f1-0))
(not (channel-active? arg1 (the-as uint 0)))
(not (channel-active? arg1 (gui-channel none)))
(process-grab? arg1 #t)
(process-grab? *target* #t)
)
@ -1066,7 +1066,7 @@
)
a1-2
)
(not (channel-active? arg1 (the-as uint 0)))
(not (channel-active? arg1 (gui-channel none)))
(not (focus-test? s5-0 edge-grab))
(>= (- (-> s5-0 control trans y) (-> arg1 root trans y)) -4096.0)
)
@ -1207,7 +1207,7 @@
)
:on-update (lambda ((arg0 sig-atoll))
(with-pp
(b! (not (channel-active? arg0 (the-as uint 0))) cfg-2 :delay (empty-form))
(b! (not (channel-active? arg0 (gui-channel none))) cfg-2 :delay (empty-form))
(set-time! (-> arg0 waypoint-time0))
(b! #t cfg-21 :delay (nop!))
(label cfg-2)
@ -1318,7 +1318,7 @@
:on-update (lambda ((arg0 sig-atoll))
(with-pp
(if (and (not (speech-playing? arg0 13))
(not (channel-active? arg0 (the-as uint 0)))
(not (channel-active? arg0 (gui-channel none)))
(let ((a1-2 (new 'stack-no-clear 'event-message-block)))
(set! (-> a1-2 from) (process->ppointer pp))
(set! (-> a1-2 num-params) 1)
@ -1378,7 +1378,7 @@
)
(cond
((and (< f0-2 (* f1-0 f1-0))
(not (channel-active? arg1 (the-as uint 0)))
(not (channel-active? arg1 (gui-channel none)))
(process-grab? arg1 #t)
(process-grab? *target* #t)
)
@ -1494,7 +1494,7 @@
)
a1-2
)
(not (channel-active? arg1 (the-as uint 0)))
(not (channel-active? arg1 (gui-channel none)))
(let ((f0-0 102400.0))
(>= (* f0-0 f0-0) (vector-vector-xz-distance-squared (-> arg1 root trans) (target-pos 0)))
)
@ -1566,7 +1566,9 @@
(play-speech arg1 17)
(logior! (-> arg1 waypoint-bits) (waypoint-bits wabits-0))
)
(when (and (logtest? (-> arg1 waypoint-bits) (waypoint-bits wabits-0)) (not (channel-active? arg1 (the-as uint 0))))
(when (and (logtest? (-> arg1 waypoint-bits) (waypoint-bits wabits-0))
(not (channel-active? arg1 (gui-channel none)))
)
(ai-task-control-method-12 (-> arg1 ai-ctrl) arg1)
(go-to-waypoint! arg1 20 #f)
(ai-task-control-method-10 (-> arg1 ai-ctrl) arg1)
@ -1610,7 +1612,7 @@
:on-update (lambda ((arg0 sig-atoll))
(if (and (time-elapsed? (-> arg0 waypoint-time0) (seconds 1.5))
(not (speech-playing? arg0 18))
(not (channel-active? arg0 (the-as uint 0)))
(not (channel-active? arg0 (gui-channel none)))
)
(play-speech arg0 18)
)
@ -1650,7 +1652,7 @@
)
(cond
((zero? v1-6)
(when (not (channel-active? arg1 (the-as uint 0)))
(when (not (channel-active? arg1 (gui-channel none)))
(let ((s5-0 (-> arg1 root trans))
(s4-0 (-> arg1 sig-course spots))
(f0-0 163840.0)
@ -1704,7 +1706,7 @@
)
)
)
(if (and (not (speech-playing? arg1 20)) (not (channel-active? arg1 (the-as uint 0))))
(if (and (not (speech-playing? arg1 20)) (not (channel-active? arg1 (gui-channel none))))
(play-speech arg1 20)
)
(when (and (outside-spot-radius? arg1 (the-as bot-spot #f) (the-as vector #f) #f)
@ -1780,7 +1782,7 @@
)
(cond
((and (< f0-2 (* f1-0 f1-0))
(not (channel-active? arg1 (the-as uint 0)))
(not (channel-active? arg1 (gui-channel none)))
(process-grab? arg1 #t)
(process-grab? *target* #t)
)
@ -1894,7 +1896,7 @@
)
a1-2
)
(not (channel-active? arg1 (the-as uint 0)))
(not (channel-active? arg1 (gui-channel none)))
(let ((f0-0 102400.0))
(>= (* f0-0 f0-0) (vector-vector-xz-distance-squared (-> arg1 root trans) (target-pos 0)))
)
@ -2127,7 +2129,7 @@
)
(cond
((and (< f0-2 (* f1-0 f1-0))
(not (channel-active? arg1 (the-as uint 0)))
(not (channel-active? arg1 (gui-channel none)))
(process-grab? arg1 #t)
(process-grab? *target* #t)
)
@ -2248,7 +2250,7 @@
)
a1-2
)
(not (channel-active? arg1 (the-as uint 0)))
(not (channel-active? arg1 (gui-channel none)))
(let ((f0-0 102400.0))
(>= (* f0-0 f0-0) (vector-vector-xz-distance-squared (-> arg1 root trans) (target-pos 0)))
)
@ -2319,7 +2321,9 @@
(play-speech arg1 24)
(logior! (-> arg1 waypoint-bits) (waypoint-bits wabits-0))
)
(when (and (logtest? (-> arg1 waypoint-bits) (waypoint-bits wabits-0)) (not (channel-active? arg1 (the-as uint 0))))
(when (and (logtest? (-> arg1 waypoint-bits) (waypoint-bits wabits-0))
(not (channel-active? arg1 (gui-channel none)))
)
(ai-task-control-method-12 (-> arg1 ai-ctrl) arg1)
(go-to-waypoint! arg1 31 #f)
(ai-task-control-method-10 (-> arg1 ai-ctrl) arg1)
@ -2353,7 +2357,7 @@
(function sigt-wait-spot sig symbol)
(lambda ((arg0 object) (arg1 sig-atoll))
(when (and (outside-spot-radius? arg1 (the-as bot-spot #f) (the-as vector #f) #f)
(not (channel-active? arg1 (the-as uint 0)))
(not (channel-active? arg1 (gui-channel none)))
)
(ai-task-control-method-12 (-> arg1 ai-ctrl) arg1)
(go-to-waypoint! arg1 32 #f)
@ -2697,7 +2701,7 @@
(function sigt-wait-spot sig symbol)
(lambda ((arg0 object) (arg1 sig-atoll))
(when (and (outside-spot-radius? arg1 (the-as bot-spot #f) (the-as vector #f) #f)
(not (channel-active? arg1 (the-as uint 0)))
(not (channel-active? arg1 (gui-channel none)))
)
(let ((f0-0 122880.0))
(if (>= (* f0-0 f0-0) (vector-vector-xz-distance-squared (-> arg1 root trans) (target-pos 0)))
@ -2751,7 +2755,7 @@
)
(cond
((and (< f0-0 (* f1-0 f1-0))
(not (channel-active? arg1 (the-as uint 0)))
(not (channel-active? arg1 (gui-channel none)))
(process-grab? arg1 #t)
(process-grab? *target* #t)
)
@ -2881,7 +2885,7 @@
)
a1-2
)
(not (channel-active? arg1 (the-as uint 0)))
(not (channel-active? arg1 (gui-channel none)))
(let ((f0-0 102400.0))
(>= (* f0-0 f0-0) (vector-vector-xz-distance-squared (-> arg1 root trans) (target-pos 0)))
)
@ -2897,7 +2901,7 @@
)
)
(when (and (sig-plasma-method-13 (-> arg1 plasma))
(not (channel-active? arg1 (the-as uint 0)))
(not (channel-active? arg1 (gui-channel none)))
(scene-play arg1 "atoll-sniper-e" #f)
)
(ai-task-control-method-12 (-> arg1 ai-ctrl) arg1)
@ -2978,7 +2982,7 @@
:on-set (lambda ((arg0 sig-atoll))
(task-node-close! (game-task-node atoll-sig-resolution))
(process-entity-status! arg0 (entity-perm-status bit-4) #f)
(logclear! (-> arg0 enemy-flags) (enemy-flag use-notice-distance))
(logclear! (-> arg0 enemy-flags) (enemy-flag cam-attack-mode))
(logclear! (-> arg0 bot-flags) (bot-flags bf06))
(bot-method-196 arg0)
(logior! (-> arg0 bot-flags) (bot-flags bf22))

View File

@ -215,7 +215,7 @@
(if (<= s4-0 0)
(go process-drawable-art-error "no path")
)
(let ((s2-0 (get-rand-int this s4-0))
(let ((s2-0 (rnd-int-count this s4-0))
(gp-0 (new 'stack-no-clear 'vector))
)
(countdown (s3-0 s4-0)
@ -250,7 +250,7 @@
)
:code (behavior ()
(ja-channel-push! 1 (seconds 0.2))
(let ((f30-0 (get-rand-float-range self 0.9 1.1)))
(let ((f30-0 (rnd-float-range self 0.9 1.1)))
(until #f
(ja-no-eval :group! (-> self draw art-group data (-> self enemy-info walk-anim))
:num! (seek! max f30-0)
@ -271,7 +271,7 @@
)
(nav-enemy-method-156 self)
(nav-enemy-method-162 self)
(set! (-> self next-pick-time) (+ (current-time) (get-rand-int-range self 300 1050)))
(set! (-> self next-pick-time) (+ (current-time) (rnd-int-range self 300 1050)))
)
(nav-enemy-method-176 self)
)
@ -285,7 +285,7 @@
(set-enemy-info! this *sniper-nav-enemy-info*)
(logior! (-> this focus-status) (focus-status ignore))
(logclear! (-> this focus-status) (focus-status dangerous))
(logclear! (-> this enemy-flags) (enemy-flag check-water))
(logclear! (-> this enemy-flags) (enemy-flag dangerous-backup))
0
(none)
)

View File

@ -701,12 +701,12 @@ For example for an elevator pre-compute the distance between the first and last
(set! (-> *krew-boss-clone-nav-enemy-info* fact-defaults) *fact-info-enemy-defaults*)
(defmethod track-target! ((this krew-boss-clone))
(defmethod common-post ((this krew-boss-clone))
"Does a lot of various things relating to interacting with the target
- tracks when the enemy was last drawn
- looks at the target and handles attacking
@TODO Not extremely well understood yet"
(let ((t9-0 (method-of-type nav-enemy track-target!)))
(let ((t9-0 (method-of-type nav-enemy common-post)))
(t9-0 this)
)
(let ((s5-0 (new 'stack-no-clear 'vector))
@ -825,13 +825,13 @@ For example for an elevator pre-compute the distance between the first and last
(('track)
(cond
((-> arg3 param 0)
(if (logtest? (-> this enemy-flags) (enemy-flag enable-on-active))
(if (logtest? (-> this enemy-flags) (enemy-flag vulnerable))
#t
'abort
)
)
(else
(logtest? (-> this enemy-flags) (enemy-flag enable-on-active))
(logtest? (-> this enemy-flags) (enemy-flag vulnerable))
)
)
)
@ -872,7 +872,7 @@ For example for an elevator pre-compute the distance between the first and last
(go-virtual hostile)
)
:post (behavior ()
(logior! (-> self enemy-flags) (enemy-flag directed))
(logior! (-> self enemy-flags) (enemy-flag recover-applied-velocity))
(let ((gp-0 (-> self root)))
(let ((a1-0 (new-stack-vector0)))
(vector-v++! (-> gp-0 transv) (compute-acc-due-to-gravity gp-0 a1-0 (-> self enemy-info slip-factor)))
@ -887,7 +887,7 @@ For example for an elevator pre-compute the distance between the first and last
)
)
(enemy-method-111 self)
(track-target! self)
(common-post self)
)
)
@ -903,7 +903,7 @@ For example for an elevator pre-compute the distance between the first and last
)
)
(defmethod enemy-method-77 ((this krew-boss-clone) (arg0 (pointer float)))
(defmethod enemy-method-77 ((this krew-boss-clone) (arg0 enemy-knocked-info))
(with-pp
(ja-channel-push! 1 0)
(cond
@ -954,7 +954,7 @@ For example for an elevator pre-compute the distance between the first and last
)
)
(defmethod enemy-method-78 ((this krew-boss-clone) (arg0 (pointer float)))
(defmethod enemy-method-78 ((this krew-boss-clone) (arg0 enemy-knocked-info))
(when (> (-> this hit-points) 0)
(ja-channel-push! 1 (seconds 0.1))
(let ((a0-2 (-> this skel root-channel 0)))
@ -971,7 +971,7 @@ For example for an elevator pre-compute the distance between the first and last
)
)
)
(set! (-> a0-2 param 1) (* 5.0 (-> arg0 0)))
(set! (-> a0-2 param 1) (* 5.0 (-> arg0 anim-speed)))
(set! (-> a0-2 frame-num) 0.0)
(joint-control-channel-group!
a0-2
@ -988,7 +988,7 @@ For example for an elevator pre-compute the distance between the first and last
(let ((v1-0 arg0))
(cond
((zero? v1-0)
(enemy-method-77 this (the-as (pointer float) arg1))
(enemy-method-77 this arg1)
#f
)
((= v1-0 1)
@ -997,7 +997,7 @@ For example for an elevator pre-compute the distance between the first and last
s5-0
)
((= v1-0 2)
(set! s5-0 (not (enemy-method-78 this (the-as (pointer float) arg1))))
(set! s5-0 (not (enemy-method-78 this arg1)))
(set! (-> this incoming blue-juggle-count) (the-as uint 0))
s5-0
)
@ -1092,7 +1092,7 @@ For example for an elevator pre-compute the distance between the first and last
:code (behavior ()
(set! (-> self wiggle-time) (+ (current-time) (seconds -10)))
(set! (-> self wiggle-angle) 0.0)
(let ((f30-0 (get-rand-float-range self 0.9 1.1)))
(let ((f30-0 (rnd-float-range self 0.9 1.1)))
(until #f
(ja :num! (loop! f30-0))
(when (time-elapsed? (-> self wiggle-time) (seconds 1))
@ -1250,7 +1250,9 @@ For example for an elevator pre-compute the distance between the first and last
(the-as pair 0)
)
(logior! (-> this draw global-effect) (draw-control-global-effect disable-envmap))
(set! (-> this enemy-flags) (the-as enemy-flag (logior (enemy-flag vulnerable-backup) (-> this enemy-flags))))
(set! (-> this enemy-flags)
(the-as enemy-flag (logior (enemy-flag no-initial-move-to-ground) (-> this enemy-flags)))
)
(set! (-> *krew-boss-clone-nav-enemy-info* nav-mesh)
(nav-mesh-from-res-tag (-> this entity) 'nav-mesh-actor 1)
)
@ -1941,13 +1943,13 @@ For example for an elevator pre-compute the distance between the first and last
(('track)
(cond
((-> arg3 param 0)
(if (logtest? (-> this enemy-flags) (enemy-flag enable-on-active))
(if (logtest? (-> this enemy-flags) (enemy-flag vulnerable))
#t
'abort
)
)
(else
(logtest? (-> this enemy-flags) (enemy-flag enable-on-active))
(logtest? (-> this enemy-flags) (enemy-flag vulnerable))
)
)
)
@ -1974,7 +1976,7 @@ For example for an elevator pre-compute the distance between the first and last
#f
)
(defmethod enemy-method-77 ((this krew-boss) (arg0 (pointer float)))
(defmethod enemy-method-77 ((this krew-boss) (arg0 enemy-knocked-info))
(with-pp
(ja-channel-push! 1 0)
(cond
@ -2012,7 +2014,7 @@ For example for an elevator pre-compute the distance between the first and last
)
)
(defmethod enemy-method-78 ((this krew-boss) (arg0 (pointer float)))
(defmethod enemy-method-78 ((this krew-boss) (arg0 enemy-knocked-info))
(cond
((<= (-> this hit-points) 0)
#f
@ -2033,7 +2035,7 @@ For example for an elevator pre-compute the distance between the first and last
)
)
)
(set! (-> a0-2 param 1) (* 2.0 (-> arg0 0)))
(set! (-> a0-2 param 1) (* 2.0 (-> arg0 anim-speed)))
(set! (-> a0-2 frame-num) 0.0)
(joint-control-channel-group!
a0-2
@ -2059,7 +2061,7 @@ For example for an elevator pre-compute the distance between the first and last
)
)
(krew-hit-speech self)
(logclear! (-> self enemy-flags) (enemy-flag enable-on-active))
(logclear! (-> self enemy-flags) (enemy-flag vulnerable))
(logclear! (-> self nav flags) (nav-control-flag update-heading-from-facing))
)
:exit (behavior ()
@ -2071,9 +2073,9 @@ For example for an elevator pre-compute the distance between the first and last
)
(set! (-> self floating) #f)
(let ((v1-4 (-> self enemy-flags)))
(if (logtest? v1-4 (enemy-flag checking-water))
(set! v1-5 (logior v1-4 (enemy-flag enable-on-active)))
(set! v1-5 (logclear v1-4 (enemy-flag enable-on-active)))
(if (logtest? v1-4 (enemy-flag vulnerable-backup))
(set! v1-5 (logior v1-4 (enemy-flag vulnerable)))
(set! v1-5 (logclear v1-4 (enemy-flag vulnerable)))
)
)
(set! (-> self enemy-flags) v1-5)
@ -2083,7 +2085,7 @@ For example for an elevator pre-compute the distance between the first and last
)
)
:post (behavior ()
(logior! (-> self enemy-flags) (enemy-flag directed))
(logior! (-> self enemy-flags) (enemy-flag recover-applied-velocity))
(let ((gp-0 (-> self root)))
(cond
((and (>= 1449984.0 (-> gp-0 trans y)) (< (-> gp-0 transv y) 0.0))
@ -2111,7 +2113,7 @@ For example for an elevator pre-compute the distance between the first and last
)
(enemy-method-111 self)
(nav-enemy-method-142 self (-> self nav))
(track-target! self)
(common-post self)
)
)
@ -2209,7 +2211,7 @@ For example for an elevator pre-compute the distance between the first and last
(set! (-> v1-14 target-post quad) (-> a0-20 quad))
)
0
(logclear! (-> self enemy-flags) (enemy-flag enable-on-active))
(logclear! (-> self enemy-flags) (enemy-flag vulnerable))
(let ((v1-19 (-> self nav)))
(set! (-> v1-19 sphere-mask) (the-as uint #x800fa))
)
@ -2526,7 +2528,7 @@ For example for an elevator pre-compute the distance between the first and last
:code (behavior ()
(ja-channel-push! 1 (seconds 0.1))
(ja :group! (-> self draw art-group data (-> self enemy-info idle-anim)) :num! min)
(let ((f30-0 (get-rand-float-range self 0.3 0.5)))
(let ((f30-0 (rnd-float-range self 0.3 0.5)))
(until #f
(suspend)
(ja :num! (loop! f30-0))
@ -2671,8 +2673,8 @@ For example for an elevator pre-compute the distance between the first and last
)
)
)
(look-at-target! self (enemy-flag lock-focus))
(logior! (-> self enemy-flags) (enemy-flag use-notice-distance))
(look-at-target! self (enemy-flag look-at-focus))
(logior! (-> self enemy-flags) (enemy-flag cam-attack-mode))
(let ((v1-58 self))
(if (not (logtest? (enemy-flag enemy-flag36) (-> v1-58 enemy-flags)))
(set! (-> v1-58 enemy-flags) (the-as enemy-flag (logior (enemy-flag enemy-flag38) (-> v1-58 enemy-flags))))
@ -2696,8 +2698,8 @@ For example for an elevator pre-compute the distance between the first and last
(let ((f30-0 (-> self enemy-info circle-dist-lo))
(f28-0 (-> self enemy-info circle-dist-hi))
)
(if (zero? (get-rand-int self 4))
(set! (-> self desired-angle) (get-rand-float-range self f30-0 f28-0))
(if (zero? (rnd-int-count self 4))
(set! (-> self desired-angle) (rnd-float-range self f30-0 f28-0))
(set! (-> self desired-angle)
(fmax (fmin (vector-vector-xz-distance (-> self focus-pos) (-> self root trans)) f28-0) f30-0)
)
@ -2736,9 +2738,9 @@ For example for an elevator pre-compute the distance between the first and last
(set! (-> self next-shooting-frame) 0)
(ja :chan 1 :num-func num-func-identity :frame-num 0.0)
(let ((v1-24 (-> self enemy-flags)))
(if (logtest? v1-24 (enemy-flag checking-water))
(set! v1-25 (logior v1-24 (enemy-flag enable-on-active)))
(set! v1-25 (logclear v1-24 (enemy-flag enable-on-active)))
(if (logtest? v1-24 (enemy-flag vulnerable-backup))
(set! v1-25 (logior v1-24 (enemy-flag vulnerable)))
(set! v1-25 (logclear v1-24 (enemy-flag vulnerable)))
)
)
(set! (-> self enemy-flags) v1-25)
@ -2776,7 +2778,7 @@ For example for an elevator pre-compute the distance between the first and last
(ja-channel-push! 2 (seconds 0.1))
(ja :group! (-> self draw art-group data (-> self enemy-info idle-anim)) :num! min)
(ja :chan 1 :group! (-> self draw art-group data (-> self enemy-info hostile-anim)) :num! min)
(let ((f30-0 (get-rand-float-range self 0.9 1.1)))
(let ((f30-0 (rnd-float-range self 0.9 1.1)))
(until #f
(ja :num! (loop! f30-0))
(when (!= (-> self next-shooting-frame) 100)

View File

@ -341,7 +341,7 @@
(logior! (-> self flags) 4)
(logior! (-> self nav flags) (nav-control-flag output-sphere-hash))
(let ((a1-1 (new 'stack-no-clear 'collide-query)))
(enemy-method-125 self a1-1 (collide-spec backgnd) 8192.0 81920.0 1024.0)
(ground-pat-set! self a1-1 (collide-spec backgnd) 8192.0 81920.0 1024.0)
)
(let* ((v1-11 (-> self nav))
(a1-2 (-> self root gspot-pos))
@ -481,7 +481,7 @@
)
:code (behavior ()
(ja-channel-push! 1 (seconds 0.2))
(let ((f30-0 (get-rand-float-range self 0.9 1.1)))
(let ((f30-0 (rnd-float-range self 0.9 1.1)))
(until #f
(ja-no-eval :group! roboguard-idle0-ja :num! (seek! 10.0 (* 0.1 f30-0)) :frame-num 9.0)
(until (ja-done? 0)
@ -525,12 +525,12 @@
:virtual #t
:event enemy-event-handler
:enter (behavior ()
(logior! (-> self enemy-flags) (enemy-flag use-notice-distance))
(logior! (-> self enemy-flags) (enemy-flag cam-attack-mode))
(logior! (-> self flags) 4)
(logclear! (-> self enemy-flags) (enemy-flag dangerous-backup))
(logclear! (-> self enemy-flags) (enemy-flag chase-startup))
(logclear! (-> self mask) (process-mask actor-pause))
(when (logtest? (-> self enemy-flags) (enemy-flag drawn-mirrored))
(logclear! (-> self enemy-flags) (enemy-flag drawn-mirrored))
(when (logtest? (-> self enemy-flags) (enemy-flag enable-on-hostile))
(logclear! (-> self enemy-flags) (enemy-flag enable-on-hostile))
(let ((gp-0 (-> self on-hostile)))
(if gp-0
(script-eval gp-0 :vector (-> self root trans))
@ -565,7 +565,7 @@
)
:exit (behavior ()
(sound-stop (-> self roll-sound))
(if (logtest? (-> self enemy-flags) (enemy-flag check-water))
(if (logtest? (-> self enemy-flags) (enemy-flag dangerous-backup))
(logior! (-> self focus-status) (focus-status dangerous))
(logclear! (-> self focus-status) (focus-status dangerous))
)
@ -598,7 +598,7 @@
0
(nav-enemy-method-160 self)
(when (< (-> self roll-timer) (current-time))
(set! (-> self roll-timer) (+ (current-time) (the int (* 300.0 (get-rand-float-range self 3.0 5.0)))))
(set! (-> self roll-timer) (+ (current-time) (the int (* 300.0 (rnd-float-range self 3.0 5.0)))))
(let ((gp-2 (handle->process (-> self focus handle))))
(when (and gp-2
(and gp-2
@ -872,7 +872,7 @@
(none)
)
(defmethod enemy-method-77 ((this roboguard-level) (arg0 (pointer float)))
(defmethod enemy-method-77 ((this roboguard-level) (arg0 enemy-knocked-info))
(ja-channel-push! 1 0)
(case (-> this incoming knocked-type)
(((knocked-type knocked-type-0)
@ -885,7 +885,7 @@
(set! (-> a0-5 param 0)
(the float (+ (-> (the-as art-joint-anim (-> this draw art-group data 21)) frames num-frames) -1))
)
(set! (-> a0-5 param 1) (-> arg0 0))
(set! (-> a0-5 param 1) (-> arg0 anim-speed))
(set! (-> a0-5 frame-num) 0.0)
(joint-control-channel-group! a0-5 (the-as art-joint-anim (-> this draw art-group data 21)) num-func-seek!)
)
@ -896,7 +896,7 @@
(set! (-> a0-6 param 0)
(the float (+ (-> (the-as art-joint-anim (-> this draw art-group data 23)) frames num-frames) -1))
)
(set! (-> a0-6 param 1) (-> arg0 0))
(set! (-> a0-6 param 1) (-> arg0 anim-speed))
(set! (-> a0-6 frame-num) 0.0)
(joint-control-channel-group! a0-6 (the-as art-joint-anim (-> this draw art-group data 23)) num-func-seek!)
)
@ -905,7 +905,7 @@
#t
)
(defmethod enemy-method-78 ((this roboguard-level) (arg0 (pointer float)))
(defmethod enemy-method-78 ((this roboguard-level) (arg0 enemy-knocked-info))
(case (-> this incoming knocked-type)
(((knocked-type knocked-type-0)
(knocked-type knocked-type-1)
@ -917,7 +917,7 @@
(set! (-> v1-4 param 0)
(the float (+ (-> (the-as art-joint-anim (-> this draw art-group data 22)) frames num-frames) -1))
)
(set! (-> v1-4 param 1) (-> arg0 0))
(set! (-> v1-4 param 1) (-> arg0 anim-speed))
(set! (-> v1-4 frame-num) 0.0)
(joint-control-channel-group! v1-4 (the-as art-joint-anim (-> this draw art-group data 22)) num-func-seek!)
)
@ -928,7 +928,7 @@
(set! (-> v1-8 param 0)
(the float (+ (-> (the-as art-joint-anim (-> this draw art-group data 24)) frames num-frames) -1))
)
(set! (-> v1-8 param 1) (-> arg0 0))
(set! (-> v1-8 param 1) (-> arg0 anim-speed))
(set! (-> v1-8 frame-num) 0.0)
(joint-control-channel-group! v1-8 (the-as art-joint-anim (-> this draw art-group data 24)) num-func-seek!)
)
@ -1008,7 +1008,7 @@
:to this
)
)
(dispose! this)
(dying this)
(go (method-of-object this explode))
)
)
@ -1088,7 +1088,7 @@
(set! (-> v1-30 target-speed) (-> this speed))
)
0
(set! (-> this roll-timer) (+ (current-time) (the int (* 300.0 (get-rand-float-range this 3.0 5.0)))))
(set! (-> this roll-timer) (+ (current-time) (the int (* 300.0 (rnd-float-range this 3.0 5.0)))))
(set! (-> this roll-dir quad) (-> s3-1 quad))
)
)
@ -1151,17 +1151,22 @@
)
)
)
(track-target! this)
(common-post this)
(update-transforms (-> this root))
0
(none)
)
(defmethod dispose! ((this roboguard-level))
(defmethod dying ((this roboguard-level))
"Cleans-up the enemy and any associated resources. Potentially spawns skull gems"
(when (not (logtest? (enemy-flag recover-applied-velocity) (-> this enemy-flags)))
(when (not (logtest? (enemy-flag called-dying) (-> this enemy-flags)))
(send-event (ppointer->process (-> this parent)) 'roboguard-die)
((method-of-type nav-enemy dispose!) this)
((method-of-type nav-enemy dying) this)
;; og:preserve-this
;; track statistics
(#when PC_PORT
(unless (zero? (-> this hit-points))
(add-to-kill-stats this (-> this incoming))))
)
(none)
)
@ -1241,7 +1246,9 @@
(the-as skeleton-group (art-group-get-by-name *level* "skel-roboguard-level" (the-as (pointer uint32) #f)))
(the-as pair 0)
)
(set! (-> this enemy-flags) (the-as enemy-flag (logior (enemy-flag vulnerable-backup) (-> this enemy-flags))))
(set! (-> this enemy-flags)
(the-as enemy-flag (logior (enemy-flag no-initial-move-to-ground) (-> this enemy-flags)))
)
(init-enemy-behaviour-and-stats! this *roboguard-level-nav-enemy-info*)
(let ((v1-8 (-> this nav)))
(set! (-> v1-8 nav-cull-radius) 81920.0)

View File

@ -1141,13 +1141,13 @@
)
)
(defmethod track-target! ((this bombbot))
(defmethod common-post ((this bombbot))
"Does a lot of various things relating to interacting with the target
- tracks when the enemy was last drawn
- looks at the target and handles attacking
@TODO Not extremely well understood yet"
(local-vars (sv-16 sparticle-launcher) (sv-20 sparticle-launcher))
(let ((t9-0 (method-of-type nav-enemy track-target!)))
(let ((t9-0 (method-of-type nav-enemy common-post)))
(t9-0 this)
)
(cond
@ -1243,17 +1243,17 @@
(defmethod damage-amount-from-attack ((this bombbot) (arg0 process) (arg1 event-message-block))
"@returns the amount of damage taken from an attack. This can come straight off the [[attack-info]] or via [[penetrate-using->damage]]"
(-> arg1 param 1)
(let ((f0-1 (the float (penetrate-using->damage (the-as penetrate (-> this incoming penetrate-using))))))
(let ((f0-1 (the float (penetrate-using->damage (-> this incoming penetrate-using)))))
(cond
((logtest? #xc0000 (-> this incoming penetrate-using))
(if (and (logtest? #x40000 (-> this incoming penetrate-using))
(logtest? #x80000 (-> this incoming penetrate-using))
((logtest? (penetrate dark-bomb dark-giant) (-> this incoming penetrate-using))
(if (and (logtest? (penetrate dark-bomb) (-> this incoming penetrate-using))
(logtest? (penetrate dark-giant) (-> this incoming penetrate-using))
)
#x42c80000
(the int (* 1.8 f0-1))
)
)
((logtest? #x20000 (-> this incoming penetrate-using))
((logtest? (penetrate dark-punch) (-> this incoming penetrate-using))
(the int (* 2.0 f0-1))
)
(else
@ -1801,7 +1801,7 @@
(t9-0)
)
)
(logior! (-> self enemy-flags) (enemy-flag actor-pause-backup))
(logior! (-> self enemy-flags) (enemy-flag lock-focus))
(+! (-> self shield-hit-points) -1.0)
)
:exit (behavior ()
@ -1991,7 +1991,7 @@
)
)
(seek! (-> self root trans y) (-> self city-path node gp-1 position y) (* 16384.0 (seconds-per-frame)))
(track-target! self)
(common-post self)
(update-transforms (-> self root))
)
(else

View File

@ -221,7 +221,7 @@
)
)
(defmethod enemy-method-123 ((this yakow) (arg0 float))
(defmethod rnd-go-idle? ((this yakow) (arg0 float))
"TODO"
(>= arg0 (rand-vu))
)
@ -229,8 +229,8 @@
;; WARN: Function (method 156 yakow) has a return type of none, but the expression builder found a return statement.
(defmethod nav-enemy-method-156 ((this yakow))
(dotimes (s5-0 16)
(let ((f30-1 (* 4096.0 (get-rand-float-range this -10.0 10.0)))
(f0-2 (* 4096.0 (get-rand-float-range this -10.0 10.0)))
(let ((f30-1 (* 4096.0 (rnd-float-range this -10.0 10.0)))
(f0-2 (* 4096.0 (rnd-float-range this -10.0 10.0)))
(s4-0 (new 'stack-no-clear 'vector))
)
(set! (-> s4-0 quad) (-> this root trans quad))
@ -303,7 +303,7 @@
)
:code (behavior ()
(ja-channel-push! 1 (seconds 0.2))
(let ((f30-0 (get-rand-float-range self 0.9 1.1)))
(let ((f30-0 (rnd-float-range self 0.9 1.1)))
(until #f
(ja-no-eval :group! (-> self draw art-group data (-> self enemy-info walk-anim))
:num! (seek! max f30-0)
@ -313,7 +313,7 @@
(suspend)
(ja :num! (seek! max f30-0))
)
(when (enemy-method-123 self 0.2)
(when (rnd-go-idle? self 0.2)
(ja-no-eval :num! (loop!))
(ja-channel-push! 1 (seconds 0.6))
(let ((v1-37 self))
@ -339,7 +339,7 @@
)
(ja-channel-push! 1 (seconds 0.1))
)
(if (enemy-method-123 self 0.2)
(if (rnd-go-idle? self 0.2)
(goto cfg-15)
)
)

View File

@ -23,7 +23,7 @@
)
0
(vector-reset! (-> self root transv))
(look-at-target! self (enemy-flag lock-focus))
(look-at-target! self (enemy-flag look-at-focus))
(set! (-> self travel-anim-interp) 0.0)
)
:trans (behavior ()
@ -43,13 +43,13 @@
)
)
:code (behavior ()
(let ((gp-0 (get-rand-int self 4)))
(let ((gp-0 (rnd-int-count self 4)))
(until #f
(let ((a2-0 (ash 1 gp-0)))
(if (= gp-0 3)
(set! a2-0 (logior a2-0 4))
)
(set! gp-0 (enemy-method-120 self 4 a2-0))
(set! gp-0 (rnd-bit self 4 a2-0))
)
(let ((v1-7 gp-0))
(cond
@ -68,7 +68,7 @@
)
)
)
(let ((s5-0 (get-rand-int-range self 3 7)))
(let ((s5-0 (rnd-int-range self 3 7)))
(dotimes (s4-0 s5-0)
(ja-no-eval :group! crocadog-escort-idle-pant-ja :num! (seek! max 0.5) :frame-num 0.0)
(until (ja-done? 0)
@ -106,7 +106,7 @@
)
)
)
(let ((s5-4 (get-rand-int-range self 5 7)))
(let ((s5-4 (rnd-int-range self 5 7)))
(dotimes (s4-1 s5-4)
(ja-no-eval :group! crocadog-escort-idle-scratch-ja :num! (seek! max 0.5) :frame-num (ja-aframe 2.0 0))
(until (ja-done? 0)
@ -131,7 +131,7 @@
)
)
)
(let ((s5-5 (get-rand-int-range self 3 7)))
(let ((s5-5 (rnd-int-range self 3 7)))
(dotimes (s4-2 s5-5)
(ja-no-eval :group! crocadog-escort-idle-wag-ja :num! (seek!) :frame-num 0.0)
(until (ja-done? 0)
@ -165,7 +165,7 @@
(set! (-> v1-7 enemy-flags) (the-as enemy-flag (logclear (-> v1-7 enemy-flags) (enemy-flag enemy-flag37))))
)
0
(look-at-target! self (enemy-flag lock-focus))
(look-at-target! self (enemy-flag look-at-focus))
(set! (-> self travel-anim-interp) 0.0)
)
:trans (behavior ()
@ -368,7 +368,7 @@
)
)
(logior! (-> self focus-status) (focus-status pilot))
(logclear! (-> self enemy-flags) (enemy-flag enable-on-active))
(logclear! (-> self enemy-flags) (enemy-flag vulnerable))
(logior! (-> self focus-status) (focus-status disable))
(logclear! (-> self focus-status) (focus-status arrestable))
(logclear! (-> self bot-flags) (bot-flags bf15))
@ -378,9 +378,9 @@
(logior! (-> self root nav-flags) (nav-flags has-root-sphere))
(logclear! (-> self focus-status) (focus-status disable))
(let ((v1-5 (-> self enemy-flags)))
(if (logtest? v1-5 (enemy-flag checking-water))
(set! v1-6 (logior v1-5 (enemy-flag enable-on-active)))
(set! v1-6 (logclear v1-5 (enemy-flag enable-on-active)))
(if (logtest? v1-5 (enemy-flag vulnerable-backup))
(set! v1-6 (logior v1-5 (enemy-flag vulnerable)))
(set! v1-6 (logclear v1-5 (enemy-flag vulnerable)))
)
)
(set! (-> self enemy-flags) v1-6)
@ -518,7 +518,7 @@
(set! (-> v1-5 enemy-flags) (the-as enemy-flag (logclear (-> v1-5 enemy-flags) (enemy-flag enemy-flag37))))
)
0
(logclear! (-> self enemy-flags) (enemy-flag enable-on-active))
(logclear! (-> self enemy-flags) (enemy-flag vulnerable))
(logclear! (-> self root nav-flags) (nav-flags has-root-sphere))
(let ((v1-11 (-> self nav)))
(logclear! (-> v1-11 shape nav-flags) (nav-flags has-extra-sphere))
@ -531,9 +531,9 @@
(local-vars (v1-4 enemy-flag))
(logior! (-> self root nav-flags) (nav-flags has-root-sphere))
(let ((v1-3 (-> self enemy-flags)))
(if (logtest? v1-3 (enemy-flag checking-water))
(set! v1-4 (logior v1-3 (enemy-flag enable-on-active)))
(set! v1-4 (logclear v1-3 (enemy-flag enable-on-active)))
(if (logtest? v1-3 (enemy-flag vulnerable-backup))
(set! v1-4 (logior v1-3 (enemy-flag vulnerable)))
(set! v1-4 (logclear v1-3 (enemy-flag vulnerable)))
)
)
(set! (-> self enemy-flags) v1-4)
@ -591,7 +591,7 @@
(set! (-> v1-5 enemy-flags) (the-as enemy-flag (logclear (-> v1-5 enemy-flags) (enemy-flag enemy-flag37))))
)
0
(logclear! (-> self enemy-flags) (enemy-flag enable-on-active))
(logclear! (-> self enemy-flags) (enemy-flag vulnerable))
(logior! (-> self root nav-flags) (nav-flags has-root-sphere))
(logior! (-> self focus-status) (focus-status disable))
)
@ -600,8 +600,7 @@
(set! (-> self vehicle-seat-index) -1)
(set! (-> self vehicle-handle) (the-as handle #f))
(logclear! (-> self bot-flags) (bot-flags bf16))
(logclear! (-> self focus-status) (focus-status pilot-riding pilot))
;; og:preserve-this fix potential use-after-free bug
(logclear! (-> self focus-status) (focus-status pilot-riding pilot)) ;; og:preserve-this fix potential use-after-free bug
(if (-> self nav)
(let ((v1-5 (-> self nav)))
(logclear! (-> v1-5 shape nav-flags) (nav-flags has-extra-sphere))
@ -609,9 +608,9 @@
0
(logclear! (-> self focus-status) (focus-status disable))
(let ((v1-10 (-> self enemy-flags)))
(if (logtest? v1-10 (enemy-flag checking-water))
(set! v1-11 (logior v1-10 (enemy-flag enable-on-active)))
(set! v1-11 (logclear v1-10 (enemy-flag enable-on-active)))
(if (logtest? v1-10 (enemy-flag vulnerable-backup))
(set! v1-11 (logior v1-10 (enemy-flag vulnerable)))
(set! v1-11 (logclear v1-10 (enemy-flag vulnerable)))
)
)
(set! (-> self enemy-flags) v1-11)
@ -755,7 +754,7 @@
)
0
(vector-reset! (-> self root transv))
(look-at-target! self (enemy-flag lock-focus))
(look-at-target! self (enemy-flag look-at-focus))
(set! (-> self travel-anim-interp) 0.0)
)
:trans (behavior ()
@ -805,29 +804,29 @@
)
:code (behavior ()
(local-vars (v1-7 enemy-flag) (v1-15 enemy-flag))
(if (logtest? (-> self enemy-flags) (enemy-flag check-water))
(if (logtest? (-> self enemy-flags) (enemy-flag dangerous-backup))
(logior! (-> self focus-status) (focus-status dangerous))
(logclear! (-> self focus-status) (focus-status dangerous))
)
(let ((v1-6 (-> self enemy-flags)))
(if (logtest? v1-6 (enemy-flag checking-water))
(set! v1-7 (logior v1-6 (enemy-flag enable-on-active)))
(set! v1-7 (logclear v1-6 (enemy-flag enable-on-active)))
(if (logtest? v1-6 (enemy-flag vulnerable-backup))
(set! v1-7 (logior v1-6 (enemy-flag vulnerable)))
(set! v1-7 (logclear v1-6 (enemy-flag vulnerable)))
)
)
(set! (-> self enemy-flags) v1-7)
(if (logtest? (-> self enemy-flags) (enemy-flag look-at-move-dest))
(if (logtest? (-> self enemy-flags) (enemy-flag attackable-backup))
(logior! (-> self mask) (process-mask collectable))
(logclear! (-> self mask) (process-mask collectable))
)
(let ((v1-14 (-> self enemy-flags)))
(if (logtest? (enemy-flag no-initial-move-to-ground) v1-14)
(set! v1-15 (logior (enemy-flag check-water-backup) v1-14))
(set! v1-15 (logclear v1-14 (enemy-flag check-water-backup)))
(if (logtest? (enemy-flag trackable-backup) v1-14)
(set! v1-15 (logior (enemy-flag trackable) v1-14))
(set! v1-15 (logclear v1-14 (enemy-flag trackable)))
)
)
(set! (-> self enemy-flags) v1-15)
(logclear! (-> self enemy-flags) (enemy-flag actor-pause-backup))
(logclear! (-> self enemy-flags) (enemy-flag lock-focus))
(logclear! (-> self focus-status) (focus-status hit))
(react-to-focus self)
)
@ -865,7 +864,7 @@
(reset! *fail-mission-control*)
)
(cond
((zero? (get-rand-int self 3))
((zero? (rnd-int-count self 3))
(ja-channel-push! 1 (seconds 0.1))
(ja-no-eval :group! crocadog-escort-idle-bark-ja :num! (seek! (ja-aframe 3.0 0) 0.5) :frame-num 0.0)
(until (ja-done? 0)
@ -880,7 +879,7 @@
)
(else
(ja-channel-push! 1 (seconds 0.1))
(let ((f30-0 (get-rand-float-range self 0.4 0.6)))
(let ((f30-0 (rnd-float-range self 0.4 0.6)))
(ja-no-eval :group! crocadog-escort-angry-bark-ja :num! (seek! max f30-0) :frame-num 0.0)
(until (ja-done? 0)
(suspend)
@ -944,13 +943,13 @@
(vector-reset! (-> self root transv))
(stop-looking-at-target! self)
(logior! (-> self bot-flags) (bot-flags bf09))
(logclear! (-> self enemy-flags) (enemy-flag enable-on-active checking-water))
(logclear! (-> self enemy-flags) (enemy-flag vulnerable vulnerable-backup))
(logclear! (-> self focus-status) (focus-status dangerous))
(logclear! (-> self enemy-flags) (enemy-flag check-water))
(logclear! (-> self enemy-flags) (enemy-flag dangerous-backup))
(logclear! (-> self mask) (process-mask collectable))
(logclear! (-> self enemy-flags) (enemy-flag look-at-move-dest))
(logclear! (-> self enemy-flags) (enemy-flag attackable-backup))
(logclear! (-> self mask) (process-mask actor-pause))
(logclear! (-> self enemy-flags) (enemy-flag notice))
(logclear! (-> self enemy-flags) (enemy-flag actor-pause-backup))
(logclear! (-> self focus-status) (focus-status disable))
(set! (-> self travel-anim-interp) 0.0)
)

View File

@ -210,7 +210,9 @@
(let* ((t9-0 (method-of-type bot bot-method-193))
(v0-0 (t9-0 this))
)
(if (and (not v0-0) (logtest? #x1c00000 (-> this incoming penetrate-using)))
(if (and (not v0-0)
(logtest? (penetrate jak-yellow-shot jak-red-shot jak-blue-shot) (-> this incoming penetrate-using))
)
(set! v0-0 #t)
)
v0-0
@ -438,7 +440,7 @@ This commonly includes things such as:
)
(set! (-> this min-speed) 9011.2)
(set! (-> this max-speed) 28672.0)
(set! (-> this channel) (the-as uint 31))
(set! (-> this channel) (gui-channel crocadog))
(set! (-> this notice-enemy-dist) 24576.0)
(set! (-> this travel-anim-interp) 0.0)
(set! (-> this focus-info max-los-dist) 0.0)
@ -502,9 +504,9 @@ This commonly includes things such as:
(quaternion-rotate-y! s5-0 s5-0 f30-0)
)
(let ((v1-21 (-> this enemy-flags)))
(if (logtest? v1-21 (enemy-flag checking-water))
(set! v1-22 (logior v1-21 (enemy-flag enable-on-active)))
(set! v1-22 (logclear v1-21 (enemy-flag enable-on-active)))
(if (logtest? v1-21 (enemy-flag vulnerable-backup))
(set! v1-22 (logior v1-21 (enemy-flag vulnerable)))
(set! v1-22 (logclear v1-21 (enemy-flag vulnerable)))
)
)
(set! (-> this enemy-flags) v1-22)
@ -517,7 +519,9 @@ This commonly includes things such as:
this
'attack
#f
(static-attack-info ((id (new-attack-id)) (vector s5-1) (attacker-velocity s5-1) (knock (the-as uint 8))))
(static-attack-info
((id (new-attack-id)) (vector s5-1) (attacker-velocity s5-1) (knock (knocked-type knocked-type-8)))
)
)
)
)
@ -530,13 +534,13 @@ This commonly includes things such as:
(defmethod go-hostile ((this crocadog-escort))
(cond
((logtest? (bot-flags bf17) (-> this bot-flags))
(logclear! (-> this enemy-flags) (enemy-flag enable-on-active checking-water))
(logclear! (-> this enemy-flags) (enemy-flag vulnerable vulnerable-backup))
(logclear! (-> this focus-status) (focus-status dangerous))
(logclear! (-> this enemy-flags) (enemy-flag check-water))
(logclear! (-> this enemy-flags) (enemy-flag dangerous-backup))
(logclear! (-> this mask) (process-mask collectable))
(logclear! (-> this enemy-flags) (enemy-flag look-at-move-dest))
(logclear! (-> this enemy-flags) (enemy-flag attackable-backup))
(logclear! (-> this mask) (process-mask actor-pause))
(logclear! (-> this enemy-flags) (enemy-flag notice))
(logclear! (-> this enemy-flags) (enemy-flag actor-pause-backup))
(logior! (-> this focus-status) (focus-status disable))
(go (method-of-object this knocked-off-vehicle))
)
@ -633,14 +637,14 @@ This commonly includes things such as:
#t
)
(defmethod enemy-method-78 ((this crocadog-escort) (arg0 (pointer float)))
(defmethod enemy-method-78 ((this crocadog-escort) (arg0 enemy-knocked-info))
(ja-channel-push! 1 (seconds 0.1))
(let ((a1-2 (-> this draw art-group data (-> this enemy-info knocked-land-anim)))
(a0-4 (-> this skel root-channel 0))
)
(set! (-> a0-4 frame-group) (the-as art-joint-anim a1-2))
(set! (-> a0-4 param 0) (the float (+ (-> (the-as art-joint-anim a1-2) frames num-frames) -1)))
(set! (-> a0-4 param 1) (-> arg0 0))
(set! (-> a0-4 param 1) (-> arg0 anim-speed))
(set! (-> a0-4 frame-num) 0.0)
(joint-control-channel-group! a0-4 (the-as art-joint-anim a1-2) num-func-seek!)
)

View File

@ -28,7 +28,7 @@
0
(move-to-point! (-> arg0 root) (the-as vector (-> arg0 course spots 0)))
(logclear! (-> arg0 mask) (process-mask actor-pause))
(logclear! (-> arg0 enemy-flags) (enemy-flag notice))
(logclear! (-> arg0 enemy-flags) (enemy-flag actor-pause-backup))
(let ((v1-16 (get-task-by-type (-> arg0 ai-ctrl) crocesct-wait-spot arg0)))
(set! (-> v1-16 bytes 5) 1)
(set! (-> v1-16 bytes 6) 0)

View File

@ -99,7 +99,7 @@
(let ((t9-0 (method-of-type hal init-enemy!)))
(t9-0 this)
)
(set! (-> this channel) (the-as uint 20))
(set! (-> this channel) (gui-channel daxter))
0
(none)
)
@ -117,7 +117,7 @@
(set! (-> this arrestor-handle) (the-as handle #f))
)
((focus-test? (the-as process-focusable v1-3) hit)
(when (and (time-elapsed? (-> this played-defend-time) (seconds 6)) (not (channel-active? this (the-as uint 0))))
(when (and (time-elapsed? (-> this played-defend-time) (seconds 6)) (not (channel-active? this (gui-channel none))))
(let ((a1-5 (bot-speech-list-method-9
(-> this hal4-course defend-speeches)
this
@ -140,7 +140,7 @@
(if (and (not (speech-playing? this 30))
(nonzero? (-> this played-defend-time))
(time-elapsed? (-> this played-defend-time) (seconds 3))
(not (channel-active? this (the-as uint 0)))
(not (channel-active? this (gui-channel none)))
)
(play-speech this 30)
)
@ -563,7 +563,7 @@
)
(defmethod play-too-far-warn-speech ((this hal-escort))
(when (not (channel-active? this (the-as uint 0)))
(when (not (channel-active? this (gui-channel none)))
(let ((s5-0 0))
(let* ((v1-5 (-> this actor-group 0 data 1 actor))
(s4-0 (when v1-5
@ -941,7 +941,7 @@
(lambda ((arg0 object) (arg1 hal-escort))
(if (and (not (speech-playing? arg1 3))
(time-elapsed? (-> arg1 waypoint-time0) (seconds 1))
(not (channel-active? arg1 (the-as uint 0)))
(not (channel-active? arg1 (gui-channel none)))
)
(play-speech arg1 3)
)
@ -1251,7 +1251,7 @@
(not (focus-test? (the-as process-focusable s4-1) pilot-riding))
(not (logtest? (bot-flags bf17) (-> (the-as bot s4-1) bot-flags)))
s3-1
(not (channel-active? arg1 (the-as uint 0)))
(not (channel-active? arg1 (gui-channel none)))
)
(play-speech arg1 7)
)
@ -1280,10 +1280,10 @@
(if (and v1-7
(and (not (logtest? (-> (the-as vehicle v1-7) flags) (rigid-body-object-flag dead)))
(>= (vector-length (-> (the-as vehicle v1-7) root transv)) 40960.0)
(not (channel-active? arg0 (the-as uint 0)))
(not (channel-active? arg0 (gui-channel none)))
)
)
(play-speech arg0 (if (zero? (get-rand-int arg0 2))
(play-speech arg0 (if (zero? (rnd-int-count arg0 2))
32
31
)
@ -1294,7 +1294,7 @@
(when (and (zero? (-> arg0 locked-player-time))
(or (not (speech-playing? arg0 33)) (not (speech-playing? arg0 34)))
(time-elapsed? (-> arg0 played-get-in-time) (seconds 6))
(not (channel-active? arg0 (the-as uint 0)))
(not (channel-active? arg0 (gui-channel none)))
)
(let ((a0-18 (handle->process (-> arg0 vehicle-handle))))
(when a0-18
@ -1426,7 +1426,7 @@
(lambda ((arg0 object) (arg1 hal-escort))
(when (and (not (speech-playing? arg1 4))
(time-elapsed? (-> arg1 waypoint-time0) (seconds 2))
(not (channel-active? arg1 (the-as uint 0)))
(not (channel-active? arg1 (gui-channel none)))
)
(play-speech arg1 15)
(play-speech arg1 4)
@ -1565,7 +1565,7 @@
)
(when (and (process-grab? s4-1 #t)
(process-grab? s3-2 #t)
(not (channel-active? arg1 (the-as uint 0)))
(not (channel-active? arg1 (gui-channel none)))
(process-grab? s5-0 #f)
)
(ai-task-control-method-12 (-> arg1 ai-ctrl) arg1)
@ -1703,7 +1703,7 @@
)
)
(when (and (time-elapsed? (-> arg1 waypoint-time0) (seconds 3))
(not (channel-active? arg1 (the-as uint 0)))
(not (channel-active? arg1 (gui-channel none)))
(scene-play arg1 "dig-knock-down-scaffolding-intro" #t)
)
(remove-setting! 'entity-name)

View File

@ -23,7 +23,7 @@
)
0
(vector-reset! (-> self root transv))
(look-at-target! self (enemy-flag lock-focus))
(look-at-target! self (enemy-flag look-at-focus))
(set! (-> self travel-anim-interp) 0.0)
)
:trans (behavior ()
@ -97,7 +97,7 @@
(set! (-> v1-7 enemy-flags) (the-as enemy-flag (logclear (-> v1-7 enemy-flags) (enemy-flag enemy-flag37))))
)
0
(look-at-target! self (enemy-flag lock-focus))
(look-at-target! self (enemy-flag look-at-focus))
(set! (-> self travel-anim-interp) 0.0)
)
:trans (behavior ()
@ -313,7 +313,7 @@
(put-rider-in-seat (the-as vehicle gp-0) (-> self vehicle-seat-index) self)
)
(logior! (-> self focus-status) (focus-status pilot))
(logclear! (-> self enemy-flags) (enemy-flag enable-on-active))
(logclear! (-> self enemy-flags) (enemy-flag vulnerable))
(logior! (-> self focus-status) (focus-status disable))
(logclear! (-> self focus-status) (focus-status arrestable))
(logclear! (-> self bot-flags) (bot-flags bf15))
@ -323,9 +323,9 @@
(logior! (-> self root nav-flags) (nav-flags has-root-sphere))
(logclear! (-> self focus-status) (focus-status disable))
(let ((v1-5 (-> self enemy-flags)))
(if (logtest? v1-5 (enemy-flag checking-water))
(set! v1-6 (logior v1-5 (enemy-flag enable-on-active)))
(set! v1-6 (logclear v1-5 (enemy-flag enable-on-active)))
(if (logtest? v1-5 (enemy-flag vulnerable-backup))
(set! v1-6 (logior v1-5 (enemy-flag vulnerable)))
(set! v1-6 (logclear v1-5 (enemy-flag vulnerable)))
)
)
(set! (-> self enemy-flags) v1-6)
@ -453,7 +453,7 @@
(set! (-> v1-5 enemy-flags) (the-as enemy-flag (logclear (-> v1-5 enemy-flags) (enemy-flag enemy-flag37))))
)
0
(logclear! (-> self enemy-flags) (enemy-flag enable-on-active))
(logclear! (-> self enemy-flags) (enemy-flag vulnerable))
(logclear! (-> self root nav-flags) (nav-flags has-root-sphere))
(let ((v1-11 (-> self nav)))
(logclear! (-> v1-11 shape nav-flags) (nav-flags has-extra-sphere))
@ -466,9 +466,9 @@
(local-vars (v1-4 enemy-flag))
(logior! (-> self root nav-flags) (nav-flags has-root-sphere))
(let ((v1-3 (-> self enemy-flags)))
(if (logtest? v1-3 (enemy-flag checking-water))
(set! v1-4 (logior v1-3 (enemy-flag enable-on-active)))
(set! v1-4 (logclear v1-3 (enemy-flag enable-on-active)))
(if (logtest? v1-3 (enemy-flag vulnerable-backup))
(set! v1-4 (logior v1-3 (enemy-flag vulnerable)))
(set! v1-4 (logclear v1-3 (enemy-flag vulnerable)))
)
)
(set! (-> self enemy-flags) v1-4)
@ -535,7 +535,7 @@
(set! (-> v1-5 enemy-flags) (the-as enemy-flag (logclear (-> v1-5 enemy-flags) (enemy-flag enemy-flag37))))
)
0
(logclear! (-> self enemy-flags) (enemy-flag enable-on-active))
(logclear! (-> self enemy-flags) (enemy-flag vulnerable))
(logior! (-> self root nav-flags) (nav-flags has-root-sphere))
(logior! (-> self focus-status) (focus-status disable))
(logclear! (-> self focus-status) (focus-status arrestable))
@ -559,9 +559,9 @@
0
(logclear! (-> self focus-status) (focus-status disable))
(let ((v1-16 (-> self enemy-flags)))
(if (logtest? v1-16 (enemy-flag checking-water))
(set! v1-17 (logior v1-16 (enemy-flag enable-on-active)))
(set! v1-17 (logclear v1-16 (enemy-flag enable-on-active)))
(if (logtest? v1-16 (enemy-flag vulnerable-backup))
(set! v1-17 (logior v1-16 (enemy-flag vulnerable)))
(set! v1-17 (logclear v1-16 (enemy-flag vulnerable)))
)
)
(set! (-> self enemy-flags) v1-17)
@ -693,7 +693,7 @@
)
0
(vector-reset! (-> self root transv))
(look-at-target! self (enemy-flag lock-focus))
(look-at-target! self (enemy-flag look-at-focus))
(set! (-> self travel-anim-interp) 0.0)
)
:trans (behavior ()
@ -765,29 +765,29 @@
)
:code (behavior ()
(local-vars (v1-7 enemy-flag) (v1-15 enemy-flag))
(if (logtest? (-> self enemy-flags) (enemy-flag check-water))
(if (logtest? (-> self enemy-flags) (enemy-flag dangerous-backup))
(logior! (-> self focus-status) (focus-status dangerous))
(logclear! (-> self focus-status) (focus-status dangerous))
)
(let ((v1-6 (-> self enemy-flags)))
(if (logtest? v1-6 (enemy-flag checking-water))
(set! v1-7 (logior v1-6 (enemy-flag enable-on-active)))
(set! v1-7 (logclear v1-6 (enemy-flag enable-on-active)))
(if (logtest? v1-6 (enemy-flag vulnerable-backup))
(set! v1-7 (logior v1-6 (enemy-flag vulnerable)))
(set! v1-7 (logclear v1-6 (enemy-flag vulnerable)))
)
)
(set! (-> self enemy-flags) v1-7)
(if (logtest? (-> self enemy-flags) (enemy-flag look-at-move-dest))
(if (logtest? (-> self enemy-flags) (enemy-flag attackable-backup))
(logior! (-> self mask) (process-mask collectable))
(logclear! (-> self mask) (process-mask collectable))
)
(let ((v1-14 (-> self enemy-flags)))
(if (logtest? (enemy-flag no-initial-move-to-ground) v1-14)
(set! v1-15 (logior (enemy-flag check-water-backup) v1-14))
(set! v1-15 (logclear v1-14 (enemy-flag check-water-backup)))
(if (logtest? (enemy-flag trackable-backup) v1-14)
(set! v1-15 (logior (enemy-flag trackable) v1-14))
(set! v1-15 (logclear v1-14 (enemy-flag trackable)))
)
)
(set! (-> self enemy-flags) v1-15)
(logclear! (-> self enemy-flags) (enemy-flag actor-pause-backup))
(logclear! (-> self enemy-flags) (enemy-flag lock-focus))
(logclear! (-> self focus-status) (focus-status hit))
(react-to-focus self)
)
@ -826,7 +826,7 @@
(logior! (-> self focus-status) (focus-status arrestable))
(logclear! (-> self focus-status) (focus-status disable))
(if (logtest? (bot-flags bf19) (-> self bot-flags))
(logclear! (-> self enemy-flags) (enemy-flag enable-on-active checking-water))
(logclear! (-> self enemy-flags) (enemy-flag vulnerable vulnerable-backup))
)
)
:trans (behavior ()
@ -865,7 +865,7 @@
)
)
(if v1-7
(logclear! (-> (the-as crimson-guard v1-7) enemy-flags) (enemy-flag enable-on-active checking-water))
(logclear! (-> (the-as crimson-guard v1-7) enemy-flags) (enemy-flag vulnerable vulnerable-backup))
)
)
)
@ -905,7 +905,7 @@
)
)
(if v1-93
(logclear! (-> (the-as crimson-guard v1-93) enemy-flags) (enemy-flag enable-on-active checking-water))
(logclear! (-> (the-as crimson-guard v1-93) enemy-flags) (enemy-flag vulnerable vulnerable-backup))
)
)
)
@ -998,13 +998,13 @@
(vector-reset! (-> self root transv))
(stop-looking-at-target! self)
(logior! (-> self bot-flags) (bot-flags bf09))
(logclear! (-> self enemy-flags) (enemy-flag enable-on-active checking-water))
(logclear! (-> self enemy-flags) (enemy-flag vulnerable vulnerable-backup))
(logclear! (-> self focus-status) (focus-status dangerous))
(logclear! (-> self enemy-flags) (enemy-flag check-water))
(logclear! (-> self enemy-flags) (enemy-flag dangerous-backup))
(logclear! (-> self mask) (process-mask collectable))
(logclear! (-> self enemy-flags) (enemy-flag look-at-move-dest))
(logclear! (-> self enemy-flags) (enemy-flag attackable-backup))
(logclear! (-> self mask) (process-mask actor-pause))
(logclear! (-> self enemy-flags) (enemy-flag notice))
(logclear! (-> self enemy-flags) (enemy-flag actor-pause-backup))
(logior! (-> self focus-status) (focus-status arrestable))
(logior! (-> self focus-status) (focus-status disable))
(set! (-> self travel-anim-interp) 0.0)

View File

@ -211,11 +211,11 @@
(set! (-> a1-11 y) 0.0)
(forward-up->quaternion (-> this root quat) a1-11 *up-vector*)
)
(logclear! (-> this enemy-flags) (enemy-flag enable-on-active checking-water))
(logclear! (-> this enemy-flags) (enemy-flag vulnerable vulnerable-backup))
(logclear! (-> this mask) (process-mask collectable))
(logclear! (-> this enemy-flags) (enemy-flag look-at-move-dest))
(logclear! (-> this enemy-flags) (enemy-flag attackable-backup))
(logclear! (-> this mask) (process-mask actor-pause))
(logclear! (-> this enemy-flags) (enemy-flag notice))
(logclear! (-> this enemy-flags) (enemy-flag actor-pause-backup))
(send-event (handle->process (-> this master-handle)) 'notify 'arrest s5-1)
)
(go (method-of-object this arrested))
@ -460,7 +460,7 @@ This commonly includes things such as:
)
(set! (-> this min-speed) 18022.4)
(set! (-> this max-speed) 18432.0)
(set! (-> this channel) (the-as uint 26))
(set! (-> this channel) (gui-channel kid))
(set! (-> this notice-enemy-dist) 122880.0)
(set! (-> this travel-anim-interp) 0.0)
(set! (-> this focus-info max-los-dist) 0.0)
@ -582,14 +582,14 @@ This commonly includes things such as:
#t
)
(defmethod enemy-method-78 ((this kid-escort) (arg0 (pointer float)))
(defmethod enemy-method-78 ((this kid-escort) (arg0 enemy-knocked-info))
(ja-channel-push! 1 (seconds 0.1))
(let ((a1-2 (-> this draw art-group data (-> this enemy-info knocked-land-anim)))
(a0-4 (-> this skel root-channel 0))
)
(set! (-> a0-4 frame-group) (the-as art-joint-anim a1-2))
(set! (-> a0-4 param 0) (the float (+ (-> (the-as art-joint-anim a1-2) frames num-frames) -1)))
(set! (-> a0-4 param 1) (-> arg0 0))
(set! (-> a0-4 param 1) (-> arg0 anim-speed))
(set! (-> a0-4 frame-num) 0.0)
(joint-control-channel-group! a0-4 (the-as art-joint-anim a1-2) num-func-seek!)
)
@ -627,7 +627,9 @@ This commonly includes things such as:
(let* ((t9-0 (method-of-type bot bot-method-193))
(v0-0 (t9-0 this))
)
(if (and (not v0-0) (logtest? #x1c00000 (-> this incoming penetrate-using)))
(if (and (not v0-0)
(logtest? (penetrate jak-yellow-shot jak-red-shot jak-blue-shot) (-> this incoming penetrate-using))
)
(set! v0-0 #t)
)
v0-0
@ -709,9 +711,9 @@ This commonly includes things such as:
(quaternion-rotate-y! s4-0 s4-0 f30-0)
)
(let ((v1-24 (-> this enemy-flags)))
(if (logtest? v1-24 (enemy-flag checking-water))
(set! v1-25 (logior v1-24 (enemy-flag enable-on-active)))
(set! v1-25 (logclear v1-24 (enemy-flag enable-on-active)))
(if (logtest? v1-24 (enemy-flag vulnerable-backup))
(set! v1-25 (logior v1-24 (enemy-flag vulnerable)))
(set! v1-25 (logclear v1-24 (enemy-flag vulnerable)))
)
)
(set! (-> this enemy-flags) v1-25)
@ -721,7 +723,9 @@ This commonly includes things such as:
this
'attack
#f
(static-attack-info ((id (new-attack-id)) (vector s4-2) (attacker-velocity s4-2) (knock (the-as uint 8))))
(static-attack-info
((id (new-attack-id)) (vector s4-2) (attacker-velocity s4-2) (knock (knocked-type knocked-type-8)))
)
)
)
)
@ -735,13 +739,13 @@ This commonly includes things such as:
(cond
((logtest? (bot-flags bf17) (-> this bot-flags))
(logior! (-> this bot-flags) (bot-flags bf09))
(logclear! (-> this enemy-flags) (enemy-flag enable-on-active checking-water))
(logclear! (-> this enemy-flags) (enemy-flag vulnerable vulnerable-backup))
(logclear! (-> this focus-status) (focus-status dangerous))
(logclear! (-> this enemy-flags) (enemy-flag check-water))
(logclear! (-> this enemy-flags) (enemy-flag dangerous-backup))
(logclear! (-> this mask) (process-mask collectable))
(logclear! (-> this enemy-flags) (enemy-flag look-at-move-dest))
(logclear! (-> this enemy-flags) (enemy-flag attackable-backup))
(logclear! (-> this mask) (process-mask actor-pause))
(logclear! (-> this enemy-flags) (enemy-flag notice))
(logclear! (-> this enemy-flags) (enemy-flag actor-pause-backup))
(logior! (-> this focus-status) (focus-status disable))
(go (method-of-object this knocked-off-vehicle))
)

View File

@ -49,7 +49,7 @@
0
(move-to-point! (-> arg0 root) (the-as vector (-> arg0 course spots 0)))
(logclear! (-> arg0 mask) (process-mask actor-pause))
(logclear! (-> arg0 enemy-flags) (enemy-flag notice))
(logclear! (-> arg0 enemy-flags) (enemy-flag actor-pause-backup))
(let ((v1-16 (get-task-by-type (-> arg0 ai-ctrl) kidesct-wait-spot arg0)))
(set! (-> v1-16 bytes 5) 1)
(set! (-> v1-16 bytes 6) 0)

View File

@ -330,8 +330,8 @@
(task-node-close! (game-task-node city-intercept-tanker-battle))
(remove-setting! 'sound-mode)
(remove-setting! 'music)
(when (not (channel-active? arg0 (the-as uint 0)))
(let ((v1-12 (get-rand-int arg0 3)))
(when (not (channel-active? arg0 (gui-channel none)))
(let ((v1-12 (rnd-int-count arg0 3)))
(cond
((zero? v1-12)
(play-speech arg0 42)
@ -355,7 +355,7 @@
(lambda ((arg0 object) (arg1 ashelin-tanker))
(let ((s5-0 (get-current-task-event (-> arg1 task))))
(when (and (= (-> s5-0 action) (game-task-action say))
(not (channel-active? arg1 (the-as uint 0)))
(not (channel-active? arg1 (gui-channel none)))
(scene-play arg1 (the-as string (-> s5-0 scene)) #f)
)
(ai-task-control-method-12 (-> arg1 ai-ctrl) arg1)

View File

@ -875,10 +875,10 @@
(displacement-between-points-at-percent-normalized! s5-0 s4-0 f30-0)
(forward-up->quaternion (-> this root quat) s4-0 *up-vector*)
)
(logclear! (-> this enemy-flags) (enemy-flag enable-on-notice alert victory called-dying))
(logior! (-> this enemy-flags) (enemy-flag dangerous-backup))
(logclear! (-> this mask) (process-mask actor-pause))
(logclear! (-> this enemy-flags) (enemy-flag use-notice-distance directed directed-ready use-trigger))
(logior! (-> this enemy-flags) (enemy-flag chase-startup))
(logclear! (-> this mask) (process-mask actor-pause))
(logior! (-> this enemy-flags) (enemy-flag alert))
(set-vector! (-> this root scale) 1.0 1.0 1.0 1.0)
(go-hostile this)
#t
@ -973,10 +973,10 @@
(displacement-between-points-at-percent-normalized! s5-0 s4-0 f30-0)
(forward-up->quaternion (-> this root quat) s4-0 *up-vector*)
)
(logclear! (-> this enemy-flags) (enemy-flag enable-on-notice alert victory called-dying))
(logior! (-> this enemy-flags) (enemy-flag dangerous-backup))
(logclear! (-> this mask) (process-mask actor-pause))
(logclear! (-> this enemy-flags) (enemy-flag use-notice-distance directed directed-ready use-trigger))
(logior! (-> this enemy-flags) (enemy-flag chase-startup))
(logclear! (-> this mask) (process-mask actor-pause))
(logior! (-> this enemy-flags) (enemy-flag alert))
(set-vector! (-> this root scale) 1.0 1.0 1.0 1.0)
(go-hostile this)
#t
@ -1442,14 +1442,14 @@ This commonly includes things such as:
(v1-1 (new 'stack-no-clear 'vector))
)
(vector-! v1-1 (-> self root trans) (-> self prev-pos))
(send-event
proc
'attack
a2-1
(static-attack-info
((id (-> self attack-id)) (mode 'eco-red) (attacker-velocity v1-1) (damage 2.0) (knock (the-as uint 2)))
)
)
(send-event proc 'attack a2-1 (static-attack-info ((id (-> self attack-id))
(mode 'eco-red)
(attacker-velocity v1-1)
(damage 2.0)
(knock (knocked-type knocked-type-2))
)
)
)
)
)
)

View File

@ -866,7 +866,7 @@
(ja-channel-push! 1 (seconds 0.2))
(ja :group! (-> self draw art-group data (-> self enemy-info run-anim)))
(ja :num-func num-func-identity :frame-num 0.0)
(let ((f30-0 (get-rand-float-range self 0.45 0.65)))
(let ((f30-0 (rnd-float-range self 0.45 0.65)))
(until #f
(suspend)
(ja :num! (loop! f30-0))
@ -1469,7 +1469,9 @@
(set! (-> v1-22 prim-core collide-with) (collide-spec))
)
0
(set! (-> self enemy-flags) (the-as enemy-flag (logclear (-> self enemy-flags) (enemy-flag vulnerable))))
(set! (-> self enemy-flags)
(the-as enemy-flag (logclear (-> self enemy-flags) (enemy-flag jump-check-blocked)))
)
(send-event self 'jump 0 (-> self end-pos))
)
(if (and (time-elapsed? (-> self state-time) (seconds 1))
@ -1482,7 +1484,7 @@
(ja-channel-push! 1 (seconds 0.2))
(ja :group! (-> self draw art-group data (-> self enemy-info run-anim)))
(ja :num-func num-func-identity :frame-num 0.0)
(let ((f30-0 (get-rand-float-range self 0.45 0.65)))
(let ((f30-0 (rnd-float-range self 0.45 0.65)))
(until #f
(suspend)
(ja :num! (loop! f30-0))
@ -1566,7 +1568,9 @@
(set! (-> v1-27 prim-core collide-with) (collide-spec))
)
0
(set! (-> self enemy-flags) (the-as enemy-flag (logclear (-> self enemy-flags) (enemy-flag vulnerable))))
(set! (-> self enemy-flags)
(the-as enemy-flag (logclear (-> self enemy-flags) (enemy-flag jump-check-blocked)))
)
(send-event self 'jump 0 (-> self end-pos))
)
)
@ -1575,7 +1579,7 @@
(ja-channel-push! 1 (seconds 0.2))
(ja :group! (-> self draw art-group data (-> self enemy-info run-anim)))
(ja :num-func num-func-identity :frame-num 0.0)
(let ((f30-0 (get-rand-float-range self 0.45 0.65)))
(let ((f30-0 (rnd-float-range self 0.45 0.65)))
(until #f
(suspend)
(ja :num! (loop! f30-0))
@ -1808,7 +1812,12 @@
(let ((gp-0 (vector-z-quaternion! (new 'stack-no-clear 'vector) (-> self root quat))))
(set! (-> gp-0 y) 1.0)
(vector-normalize! gp-0 40960.0)
(send-event self 'attack #f (static-attack-info ((id (new-attack-id)) (vector gp-0) (knock (the-as uint 7)))))
(send-event
self
'attack
#f
(static-attack-info ((id (new-attack-id)) (vector gp-0) (knock (knocked-type knocked-type-7))))
)
)
)
)

View File

@ -691,7 +691,7 @@
(let* ((t9-0 (method-of-type nav-enemy enemy-method-58))
(v0-0 (t9-0 this arg0 arg1))
)
(if (logtest? #x4000000 (-> this incoming penetrate-using))
(if (logtest? (penetrate enemy-yellow-shot) (-> this incoming penetrate-using))
(set! v0-0 #f)
)
v0-0
@ -777,7 +777,7 @@
(-> this neck)
(set! (-> this info) *citizen-rebel-global-info*)
(set! (-> this anim-shuffle) 10)
(let ((v1-16 (get-rand-int this 3)))
(let ((v1-16 (rnd-int-count this 3)))
(cond
((zero? v1-16)
(set! (-> this anim-walk) 11)
@ -796,7 +796,7 @@
)
)
)
(let ((v1-31 (get-rand-int this 3)))
(let ((v1-31 (rnd-int-count this 3)))
(cond
((zero? v1-31)
(set! (-> this anim-panic-run) 17)
@ -810,7 +810,7 @@
)
)
(set! (-> this dist-run-anim) 28672.0)
(let ((v1-38 (get-rand-int this 3)))
(let ((v1-38 (rnd-int-count this 3)))
(cond
((zero? v1-38)
(set! (-> this anim-run) 14)
@ -828,12 +828,12 @@
(set! (-> this anim-dive) 19)
(set! (-> this anim-get-up-front) 25)
(set! (-> this anim-get-up-back) 26)
(let ((f30-0 (get-rand-float-range this 1.0 1.25))
(f0-10 (get-rand-float-range this 1.0 1.25))
(let ((f30-0 (rnd-float-range this 1.0 1.25))
(f0-10 (rnd-float-range this 1.0 1.25))
)
(set-vector! (-> this root scale) f0-10 f30-0 f0-10 1.0)
)
(let ((f0-12 (get-rand-float-range this 0.9 1.0)))
(let ((f0-12 (rnd-float-range this 0.9 1.0)))
(set-vector! (-> this draw color-mult) f0-12 f0-12 f0-12 1.0)
)
(set! (-> this water-anim) 32)
@ -920,7 +920,7 @@
(setup-masks (-> this draw) 4 0)
(setup-masks (-> this draw) 16 0)
(setup-masks (-> this draw) 64 0)
(let ((v1-14 (get-rand-int this 3)))
(let ((v1-14 (rnd-int-count this 3)))
(cond
((zero? v1-14)
(setup-masks (-> this draw) 2 0)
@ -933,7 +933,7 @@
)
)
)
(let ((v1-23 (get-rand-int this 2)))
(let ((v1-23 (rnd-int-count this 2)))
(cond
((zero? v1-23)
(setup-masks (-> this draw) 32 0)

View File

@ -8,15 +8,15 @@
;; DECOMP BEGINS
(deftype hal3-course (bot-course)
((transport handle :offset-assert 48)
((transport handle)
)
)
(deftype hal-help-kid (hal)
((nav-mesh nav-mesh :offset-assert 1024)
(alley-bbox bounding-box :inline :offset-assert 1040)
(suppress traffic-suppression-params 2 :inline :offset-assert 1072)
((nav-mesh nav-mesh)
(alley-bbox bounding-box :inline)
(suppress traffic-suppression-params 2 :inline)
)
(:methods
(hal-help-kid-method-227 (_type_) none)
@ -25,12 +25,12 @@
)
(defmethod init! ((obj hal-help-kid))
(defmethod init! ((this hal-help-kid))
"Set defaults for various fields."
(let ((t9-0 (method-of-type hal init!)))
(t9-0 obj)
(t9-0 this)
)
(let ((v1-1 (-> obj suppress)))
(let ((v1-1 (-> this suppress)))
(set! (-> v1-1 0 duration) (seconds 1))
(set! (-> v1-1 0 id) -1)
(let ((a0-4 (-> v1-1 0)))
@ -41,8 +41,8 @@
)
(set-vector! (-> v1-1 0 bbox max) 2785280.0 40960.0 20480.0 1.0)
)
(let ((v1-3 (-> obj suppress 1))
(a1-4 (-> obj alley-bbox))
(let ((v1-3 (-> this suppress 1))
(a1-4 (-> this alley-bbox))
)
(set-vector! (-> a1-4 min) 2531328.0 20480.0 -675840.0 1.0)
(set-vector! (-> a1-4 max) 2785280.0 40960.0 -233472.0 1.0)
@ -50,11 +50,11 @@
(set! (-> v1-3 id) -1)
(mem-copy! (the-as pointer (-> v1-3 bbox)) (the-as pointer a1-4) 32)
)
(set! (-> obj channel) (the-as uint 30))
(set! (-> this channel) (gui-channel guard))
(none)
)
(defmethod hal-help-kid-method-228 ((obj hal-help-kid) (arg0 vector))
(defmethod hal-help-kid-method-228 ((this hal-help-kid) (arg0 vector))
(let ((v1-0 (new 'stack-no-clear 'traffic-danger-info)))
(set! (-> v1-0 sphere quad) (-> arg0 quad))
(set! (-> v1-0 sphere r) 32768.0)
@ -69,43 +69,43 @@
(none)
)
(defmethod general-event-handler ((obj hal-help-kid) (arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block))
(defmethod general-event-handler ((this hal-help-kid) (arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block))
"Handles various events for the enemy
@TODO - unsure if there is a pattern for the events and this should have a more specific name"
(local-vars (v0-0 object))
(case arg2
(('fail)
(set! v0-0 (logior (-> obj bot-task-bits) (bot-task-bits botbits-0)))
(set! (-> obj bot-task-bits) (the-as bot-task-bits v0-0))
(set! v0-0 (logior (-> this bot-task-bits) (bot-task-bits botbits-0)))
(set! (-> this bot-task-bits) (the-as bot-task-bits v0-0))
v0-0
)
(('request)
(case (-> arg3 param 0)
(('scene-player)
(set! v0-0 (logior (-> obj bot-task-bits) (bot-task-bits botbits-3)))
(set! (-> obj bot-task-bits) (the-as bot-task-bits v0-0))
(set! v0-0 (logior (-> this bot-task-bits) (bot-task-bits botbits-3)))
(set! (-> this bot-task-bits) (the-as bot-task-bits v0-0))
v0-0
)
(else
((method-of-type hal general-event-handler) obj arg0 arg1 arg2 arg3)
((method-of-type hal general-event-handler) this arg0 arg1 arg2 arg3)
)
)
)
(else
((method-of-type hal general-event-handler) obj arg0 arg1 arg2 arg3)
((method-of-type hal general-event-handler) this arg0 arg1 arg2 arg3)
)
)
)
(defmethod hal-help-kid-method-227 ((obj hal-help-kid))
(let ((s4-0 (-> obj suppress))
(gp-0 (-> obj suppress 1))
(defmethod hal-help-kid-method-227 ((this hal-help-kid))
(let ((s4-0 (-> this suppress))
(gp-0 (-> this suppress 1))
)
((method-of-type traffic-suppression-params create-or-update-suppression-box)
(the-as traffic-suppression-params s4-0)
)
(let ((s5-0 (new 'stack-no-clear 'vector))
(s3-1 (-> obj alley-bbox))
(s3-1 (-> this alley-bbox))
)
(set! (-> s5-0 quad) (-> (target-pos 0) quad))
(mem-copy! (the-as pointer (-> gp-0 bbox)) (the-as pointer s3-1) 32)
@ -120,12 +120,12 @@
)
;; WARN: Return type mismatch nav-mesh vs none.
(defmethod init-enemy! ((obj hal-help-kid))
(defmethod init-enemy! ((this hal-help-kid))
"Common method called to initialize the enemy, typically sets up default field values and calls ancillary helper methods"
(let ((t9-0 (method-of-type hal init-enemy!)))
(t9-0 obj)
(t9-0 this)
)
(set! (-> obj nav-mesh) (nav-mesh-from-res-tag (-> obj entity) 'nav-mesh-actor 0))
(set! (-> this nav-mesh) (nav-mesh-from-res-tag (-> this entity) 'nav-mesh-actor 0))
(none)
)
@ -443,7 +443,7 @@
)
)
(when (and (not (logtest? (-> arg0 waypoint-bits) (waypoint-bits wabits-1)))
(>= (- (current-time) (-> arg0 waypoint-time0)) (seconds 3))
(time-elapsed? (-> arg0 waypoint-time0) (seconds 3))
)
(logior! (-> arg0 waypoint-bits) (waypoint-bits wabits-1))
(let ((s5-0 (new 'stack-no-clear 'transport-params)))
@ -460,7 +460,7 @@
)
(hal-help-kid-method-227 arg0)
(when (and (not (logtest? (-> arg0 waypoint-bits) (waypoint-bits wabits-0)))
(>= (- (current-time) (-> arg0 waypoint-time0)) (seconds 0.2))
(time-elapsed? (-> arg0 waypoint-time0) (seconds 0.2))
)
(logior! (-> arg0 waypoint-bits) (waypoint-bits wabits-0))
(let ((a1-7 (new 'stack-no-clear 'event-message-block)))
@ -621,7 +621,7 @@
(function halt-wait-spot hal symbol)
(lambda ((arg0 object) (arg1 hal-help-kid))
(if (and *target* (not (logtest? (-> arg1 bot-task-bits) (bot-task-bits botbits-3))))
(set! (-> arg1 waypoint-time0) (current-time))
(set-time! (-> arg1 waypoint-time0))
)
(let ((v1-7 (get-current-task-event (-> arg1 task))))
(when (and (= (-> v1-7 action) (game-task-action say)) (scene-play arg1 (the-as string (-> v1-7 scene)) #f))

View File

@ -25,7 +25,7 @@
)
0
(vector-reset! (-> self root transv))
(look-at-target! self (enemy-flag lock-focus))
(look-at-target! self (enemy-flag look-at-focus))
(set! (-> self travel-anim-interp) 0.0)
)
:trans (behavior ()
@ -94,7 +94,7 @@
(set! (-> v1-7 enemy-flags) (the-as enemy-flag (logclear (-> v1-7 enemy-flags) (enemy-flag enemy-flag37))))
)
0
(look-at-target! self (enemy-flag lock-focus))
(look-at-target! self (enemy-flag look-at-focus))
(set! (-> self travel-anim-interp) 0.0)
)
:trans (behavior ()
@ -247,7 +247,7 @@
)
0
(vector-reset! (-> self root transv))
(look-at-target! self (enemy-flag lock-focus))
(look-at-target! self (enemy-flag look-at-focus))
(set! (-> self travel-anim-interp) 0.0)
)
:trans (behavior ()
@ -380,7 +380,7 @@
)
0
(vector-reset! (-> self root transv))
(look-at-target! self (enemy-flag lock-focus))
(look-at-target! self (enemy-flag look-at-focus))
(set! (-> self travel-anim-interp) 0.0)
)
:trans (behavior ()
@ -452,29 +452,29 @@
(suspend)
(ja :num! (seek!))
)
(if (logtest? (-> self enemy-flags) (enemy-flag check-water))
(if (logtest? (-> self enemy-flags) (enemy-flag dangerous-backup))
(logior! (-> self focus-status) (focus-status dangerous))
(logclear! (-> self focus-status) (focus-status dangerous))
)
(let ((v1-30 (-> self enemy-flags)))
(if (logtest? v1-30 (enemy-flag checking-water))
(set! v1-31 (logior v1-30 (enemy-flag enable-on-active)))
(set! v1-31 (logclear v1-30 (enemy-flag enable-on-active)))
(if (logtest? v1-30 (enemy-flag vulnerable-backup))
(set! v1-31 (logior v1-30 (enemy-flag vulnerable)))
(set! v1-31 (logclear v1-30 (enemy-flag vulnerable)))
)
)
(set! (-> self enemy-flags) v1-31)
(if (logtest? (-> self enemy-flags) (enemy-flag look-at-move-dest))
(if (logtest? (-> self enemy-flags) (enemy-flag attackable-backup))
(logior! (-> self mask) (process-mask collectable))
(logclear! (-> self mask) (process-mask collectable))
)
(let ((v1-38 (-> self enemy-flags)))
(if (logtest? (enemy-flag no-initial-move-to-ground) v1-38)
(set! v1-39 (logior (enemy-flag check-water-backup) v1-38))
(set! v1-39 (logclear v1-38 (enemy-flag check-water-backup)))
(if (logtest? (enemy-flag trackable-backup) v1-38)
(set! v1-39 (logior (enemy-flag trackable) v1-38))
(set! v1-39 (logclear v1-38 (enemy-flag trackable)))
)
)
(set! (-> self enemy-flags) v1-39)
(logclear! (-> self enemy-flags) (enemy-flag actor-pause-backup))
(logclear! (-> self enemy-flags) (enemy-flag lock-focus))
(logclear! (-> self focus-status) (focus-status hit))
(react-to-focus self)
)
@ -511,7 +511,7 @@
(stop-looking-at-target! self)
(set! (-> self travel-anim-interp) 0.0)
(if (logtest? (bot-flags bf20) (-> self bot-flags))
(logclear! (-> self enemy-flags) (enemy-flag enable-on-active checking-water))
(logclear! (-> self enemy-flags) (enemy-flag vulnerable vulnerable-backup))
)
)
:trans (behavior ()
@ -556,7 +556,7 @@
)
)
(if v1-32
(logclear! (-> (the-as crimson-guard v1-32) enemy-flags) (enemy-flag enable-on-active checking-water))
(logclear! (-> (the-as crimson-guard v1-32) enemy-flags) (enemy-flag vulnerable vulnerable-backup))
)
)
(let ((v1-35 (ja-group)))

View File

@ -210,11 +210,11 @@
(forward-up->quaternion (-> this root quat) a1-8 *up-vector*)
)
)
(logclear! (-> this enemy-flags) (enemy-flag enable-on-active checking-water))
(logclear! (-> this enemy-flags) (enemy-flag vulnerable vulnerable-backup))
(logclear! (-> this mask) (process-mask collectable))
(logclear! (-> this enemy-flags) (enemy-flag look-at-move-dest))
(logclear! (-> this enemy-flags) (enemy-flag attackable-backup))
(logclear! (-> this mask) (process-mask actor-pause))
(logclear! (-> this enemy-flags) (enemy-flag notice))
(logclear! (-> this enemy-flags) (enemy-flag actor-pause-backup))
(send-event (handle->process (-> this master-handle)) 'notify 'arrest #f)
(go (method-of-object this arrested))
)
@ -438,7 +438,7 @@
)
(set! (-> this min-speed) 6144.0)
(set! (-> this max-speed) 22528.0)
(set! (-> this channel) (the-as uint 26))
(set! (-> this channel) (gui-channel kid))
(set! (-> this notice-enemy-dist) 122880.0)
(set! (-> this travel-anim-interp) 0.0)
(set! (-> this focus-info max-los-dist) 0.0)
@ -583,14 +583,14 @@
#t
)
(defmethod enemy-method-78 ((this kid) (arg0 (pointer float)))
(defmethod enemy-method-78 ((this kid) (arg0 enemy-knocked-info))
(ja-channel-push! 1 (seconds 0.1))
(let ((a1-2 (-> this draw art-group data (-> this enemy-info knocked-land-anim)))
(a0-4 (-> this skel root-channel 0))
)
(set! (-> a0-4 frame-group) (the-as art-joint-anim a1-2))
(set! (-> a0-4 param 0) (the float (+ (-> (the-as art-joint-anim a1-2) frames num-frames) -1)))
(set! (-> a0-4 param 1) (-> arg0 0))
(set! (-> a0-4 param 1) (-> arg0 anim-speed))
(set! (-> a0-4 frame-num) 0.0)
(joint-control-channel-group! a0-4 (the-as art-joint-anim a1-2) num-func-seek!)
)

View File

@ -42,7 +42,7 @@
0
(move-to-point! (-> arg0 root) (the-as vector (-> arg0 course spots 0)))
(logclear! (-> arg0 mask) (process-mask actor-pause))
(logclear! (-> arg0 enemy-flags) (enemy-flag notice))
(logclear! (-> arg0 enemy-flags) (enemy-flag actor-pause-backup))
(let ((v1-16 (get-task-by-type (-> arg0 ai-ctrl) kidt-wait-spot arg0)))
(set! (-> v1-16 bytes 5) 1)
(set! (-> v1-16 bytes 6) 0)

View File

@ -23,7 +23,7 @@
)
0
(vector-reset! (-> self root transv))
(look-at-target! self (enemy-flag lock-focus))
(look-at-target! self (enemy-flag look-at-focus))
(set! (-> self travel-anim-interp) 0.0)
)
:trans (behavior ()
@ -93,7 +93,7 @@
)
0
(vector-reset! (-> self root transv))
(look-at-target! self (enemy-flag lock-focus))
(look-at-target! self (enemy-flag look-at-focus))
(set! (-> self travel-anim-interp) 0.0)
)
:trans (behavior ()
@ -256,7 +256,7 @@
)
0
(vector-reset! (-> self root transv))
(look-at-target! self (enemy-flag lock-focus))
(look-at-target! self (enemy-flag look-at-focus))
(set! (-> self travel-anim-interp) 0.0)
)
:trans (behavior ()
@ -389,7 +389,7 @@
)
0
(vector-reset! (-> self root transv))
(look-at-target! self (enemy-flag lock-focus))
(look-at-target! self (enemy-flag look-at-focus))
(set! (-> self travel-anim-interp) 0.0)
)
:trans (behavior ()
@ -461,29 +461,29 @@
(suspend)
(ja :num! (seek!))
)
(if (logtest? (-> self enemy-flags) (enemy-flag check-water))
(if (logtest? (-> self enemy-flags) (enemy-flag dangerous-backup))
(logior! (-> self focus-status) (focus-status dangerous))
(logclear! (-> self focus-status) (focus-status dangerous))
)
(let ((v1-30 (-> self enemy-flags)))
(if (logtest? v1-30 (enemy-flag checking-water))
(set! v1-31 (logior v1-30 (enemy-flag enable-on-active)))
(set! v1-31 (logclear v1-30 (enemy-flag enable-on-active)))
(if (logtest? v1-30 (enemy-flag vulnerable-backup))
(set! v1-31 (logior v1-30 (enemy-flag vulnerable)))
(set! v1-31 (logclear v1-30 (enemy-flag vulnerable)))
)
)
(set! (-> self enemy-flags) v1-31)
(if (logtest? (-> self enemy-flags) (enemy-flag look-at-move-dest))
(if (logtest? (-> self enemy-flags) (enemy-flag attackable-backup))
(logior! (-> self mask) (process-mask collectable))
(logclear! (-> self mask) (process-mask collectable))
)
(let ((v1-38 (-> self enemy-flags)))
(if (logtest? (enemy-flag no-initial-move-to-ground) v1-38)
(set! v1-39 (logior (enemy-flag check-water-backup) v1-38))
(set! v1-39 (logclear v1-38 (enemy-flag check-water-backup)))
(if (logtest? (enemy-flag trackable-backup) v1-38)
(set! v1-39 (logior (enemy-flag trackable) v1-38))
(set! v1-39 (logclear v1-38 (enemy-flag trackable)))
)
)
(set! (-> self enemy-flags) v1-39)
(logclear! (-> self enemy-flags) (enemy-flag actor-pause-backup))
(logclear! (-> self enemy-flags) (enemy-flag lock-focus))
(logclear! (-> self focus-status) (focus-status hit))
(react-to-focus self)
)
@ -520,7 +520,7 @@
(stop-looking-at-target! self)
(set! (-> self travel-anim-interp) 0.0)
(if (logtest? (bot-flags bf20) (-> self bot-flags))
(logclear! (-> self enemy-flags) (enemy-flag enable-on-active checking-water))
(logclear! (-> self enemy-flags) (enemy-flag vulnerable vulnerable-backup))
)
)
:trans (behavior ()
@ -576,7 +576,7 @@
)
)
(if v1-49
(logclear! (-> (the-as crimson-guard v1-49) enemy-flags) (enemy-flag enable-on-active checking-water))
(logclear! (-> (the-as crimson-guard v1-49) enemy-flags) (enemy-flag vulnerable vulnerable-backup))
)
)
(ja-channel-push! 1 (seconds 0.1))

View File

@ -216,11 +216,11 @@
(forward-up->quaternion (-> this root quat) a1-8 *up-vector*)
)
)
(logclear! (-> this enemy-flags) (enemy-flag enable-on-active checking-water))
(logclear! (-> this enemy-flags) (enemy-flag vulnerable vulnerable-backup))
(logclear! (-> this mask) (process-mask collectable))
(logclear! (-> this enemy-flags) (enemy-flag look-at-move-dest))
(logclear! (-> this enemy-flags) (enemy-flag attackable-backup))
(logclear! (-> this mask) (process-mask actor-pause))
(logclear! (-> this enemy-flags) (enemy-flag notice))
(logclear! (-> this enemy-flags) (enemy-flag actor-pause-backup))
(go (method-of-object this arrested))
)
(else
@ -439,7 +439,7 @@
)
(set! (-> this min-speed) 6144.0)
(set! (-> this max-speed) 20889.6)
(set! (-> this channel) (the-as uint 27))
(set! (-> this channel) (gui-channel kor))
(set! (-> this notice-enemy-dist) 122880.0)
(set! (-> this travel-anim-interp) 0.0)
(set! (-> this focus-info max-los-dist) 0.0)
@ -581,14 +581,14 @@
#t
)
(defmethod enemy-method-78 ((this kor) (arg0 (pointer float)))
(defmethod enemy-method-78 ((this kor) (arg0 enemy-knocked-info))
(ja-channel-push! 1 (seconds 0.1))
(let ((a1-2 (-> this draw art-group data (-> this enemy-info knocked-land-anim)))
(a0-4 (-> this skel root-channel 0))
)
(set! (-> a0-4 frame-group) (the-as art-joint-anim a1-2))
(set! (-> a0-4 param 0) (the float (+ (-> (the-as art-joint-anim a1-2) frames num-frames) -1)))
(set! (-> a0-4 param 1) (-> arg0 0))
(set! (-> a0-4 param 1) (-> arg0 anim-speed))
(set! (-> a0-4 frame-num) 0.0)
(joint-control-channel-group! a0-4 (the-as art-joint-anim a1-2) num-func-seek!)
)

View File

@ -42,7 +42,7 @@
0
(move-to-point! (-> arg0 root) (the-as vector (-> arg0 course spots 0)))
(logclear! (-> arg0 mask) (process-mask actor-pause))
(logclear! (-> arg0 enemy-flags) (enemy-flag notice))
(logclear! (-> arg0 enemy-flags) (enemy-flag actor-pause-backup))
(let ((v1-16 (get-task-by-type (-> arg0 ai-ctrl) kort-wait-spot arg0)))
(set! (-> v1-16 bytes 5) 1)
(set! (-> v1-16 bytes 6) 0)

View File

@ -329,12 +329,12 @@
)
)
(defmethod enemy-method-77 ((this citizen-chick) (arg0 (pointer float)))
(defmethod enemy-method-77 ((this citizen-chick) (arg0 enemy-knocked-info))
(case (-> this incoming knocked-type)
(((knocked-type knocked-type-4))
(ja-channel-push! 1 (seconds 0.01))
(let* ((a2-0 (ash 1 (-> this info prev-yellow-hit)))
(v1-3 (enemy-method-120 this 1 a2-0))
(v1-3 (rnd-bit this 1 a2-0))
(a1-7
(-> this
draw
@ -352,7 +352,7 @@
(let ((a0-15 (-> this skel root-channel 0)))
(set! (-> a0-15 frame-group) (the-as art-joint-anim a1-7))
(set! (-> a0-15 param 0) (the float (+ (-> (the-as art-joint-anim a1-7) frames num-frames) -1)))
(set! (-> a0-15 param 1) (-> arg0 0))
(set! (-> a0-15 param 1) (-> arg0 anim-speed))
(set! (-> a0-15 frame-num) 0.0)
(joint-control-channel-group! a0-15 (the-as art-joint-anim a1-7) num-func-seek!)
)
@ -361,7 +361,7 @@
(((knocked-type knocked-type-6))
(ja-channel-push! 1 (seconds 0.01))
(let* ((a2-2 (ash 1 (-> this info prev-blue-hit)))
(v1-12 (enemy-method-120 this 3 a2-2))
(v1-12 (rnd-bit this 3 a2-2))
(a1-14
(-> this
draw
@ -396,7 +396,7 @@
(let ((a0-39 (-> this skel root-channel 0)))
(set! (-> a0-39 frame-group) (the-as art-joint-anim s4-0))
(set! (-> a0-39 param 0) (the float (+ (-> (the-as art-joint-anim s4-0) frames num-frames) -1)))
(set! (-> a0-39 param 1) (-> arg0 0))
(set! (-> a0-39 param 1) (-> arg0 anim-speed))
(set! (-> a0-39 frame-num) 0.0)
(joint-control-channel-group! a0-39 (the-as art-joint-anim s4-0) num-func-seek!)
)
@ -406,7 +406,7 @@
#t
)
(defmethod enemy-method-78 ((this citizen-chick) (arg0 (pointer float)))
(defmethod enemy-method-78 ((this citizen-chick) (arg0 enemy-knocked-info))
(ja-channel-push! 1 (seconds 0.1))
(let ((a0-2 (-> this skel root-channel 0)))
(set! (-> a0-2 frame-group)
@ -422,7 +422,7 @@
)
)
)
(set! (-> a0-2 param 1) (-> arg0 0))
(set! (-> a0-2 param 1) (-> arg0 anim-speed))
(set! (-> a0-2 frame-num) 0.0)
(joint-control-channel-group!
a0-2
@ -582,7 +582,7 @@
(try-update-focus (-> this focus) *target* this)
(set-vector! (-> this neck twist-max) 10922.667 18204.445 0.0 1.0)
(set! (-> this anim-shuffle) 26)
(let ((v1-18 (get-rand-int this 3)))
(let ((v1-18 (rnd-int-count this 3)))
(cond
((zero? v1-18)
(set! (-> this anim-walk) 4)
@ -601,7 +601,7 @@
)
)
)
(let ((v1-33 (get-rand-int this 3)))
(let ((v1-33 (rnd-int-count this 3)))
(cond
((zero? v1-33)
(set! (-> this anim-panic-run) 11)
@ -614,7 +614,7 @@
)
)
)
(let ((v1-39 (get-rand-int this 3)))
(let ((v1-39 (rnd-int-count this 3)))
(cond
((zero? v1-39)
(set! (-> this dist-run-anim) 26214.4)
@ -635,12 +635,12 @@
(set! (-> this anim-dive) 17)
(set! (-> this anim-get-up-back) 25)
(set! (-> this anim-get-up-front) 24)
(let ((f30-0 (get-rand-float-range this 1.0 1.25))
(f0-17 (get-rand-float-range this 1.0 1.25))
(let ((f30-0 (rnd-float-range this 1.0 1.25))
(f0-17 (rnd-float-range this 1.0 1.25))
)
(set-vector! (-> this root scale) f0-17 f30-0 f0-17 1.0)
)
(let ((f0-19 (get-rand-float-range this 0.9 1.0)))
(let ((f0-19 (rnd-float-range this 0.9 1.0)))
(set-vector! (-> this draw color-mult) f0-19 f0-19 f0-19 1.0)
)
(set! (-> this water-anim) 12)
@ -659,7 +659,7 @@
(setup-masks (-> this draw) 0 -1)
(setup-masks (-> this draw) 16 0)
(setup-masks (-> this draw) 8 0)
(let ((v1-11 (get-rand-int this 3)))
(let ((v1-11 (rnd-int-count this 3)))
(cond
((zero? v1-11)
(setup-masks (-> this draw) 32 0)
@ -672,7 +672,7 @@
)
)
)
(let ((v1-20 (get-rand-int this 3)))
(let ((v1-20 (rnd-int-count this 3)))
(cond
((zero? v1-20)
(setup-masks (-> this draw) 64 0)
@ -685,7 +685,7 @@
)
)
)
(let ((v1-29 (get-rand-int this 3)))
(let ((v1-29 (rnd-int-count this 3)))
(cond
((zero? v1-29)
(setup-masks (-> this draw) 4 0)
@ -698,11 +698,11 @@
)
)
)
(let ((v1-38 (get-rand-int this 3)))
(let ((v1-38 (rnd-int-count this 3)))
(cond
((zero? v1-38)
(setup-masks (-> this draw) 2 0)
(let ((v1-42 (get-rand-int this 2)))
(let ((v1-42 (rnd-int-count this 2)))
(cond
((zero? v1-42)
(setup-masks (-> this draw) 128 0)
@ -718,7 +718,7 @@
)
((= v1-38 2)
(setup-masks (-> this draw) 2048 0)
(let ((v1-54 (get-rand-int this 2)))
(let ((v1-54 (rnd-int-count this 2)))
(cond
((zero? v1-54)
(setup-masks (-> this draw) 128 0)

View File

@ -18,7 +18,7 @@
)
(defmethod track-target! ((this citizen-enemy))
(defmethod common-post ((this citizen-enemy))
"Does a lot of various things relating to interacting with the target
- tracks when the enemy was last drawn
- looks at the target and handles attacking
@ -31,7 +31,7 @@
)
(when (and (not (focus-test? this disable dead ignore inactive))
(< (-> this next-update-target) (current-time))
(not (logtest? (enemy-flag actor-pause-backup) (-> this enemy-flags)))
(not (logtest? (enemy-flag lock-focus) (-> this enemy-flags)))
(-> this next-state)
(= (-> this next-state name) 'active)
)
@ -39,7 +39,7 @@
(set! (-> this next-update-target) (+ (current-time) (seconds 0.2)))
(traffic-danger-init! this)
)
((method-of-type citizen track-target!) this)
((method-of-type citizen common-post) this)
(none)
)
@ -220,7 +220,7 @@
:virtual #t
:code (behavior ()
(ja-channel-push! 1 (seconds 0.075))
(let ((f30-0 (get-rand-float-range self 0.8 1.2)))
(let ((f30-0 (rnd-float-range self 0.8 1.2)))
(until #f
(ja-no-eval :group! (-> self draw art-group data (-> self enemy-info walk-anim))
:num! (seek! max f30-0)
@ -273,13 +273,13 @@
(set! (-> this dist-run-anim) (-> this enemy-info run-travel-speed))
(set! (-> this speed-run) (-> this enemy-info walk-travel-speed))
(set! (-> this fated-time) 0)
(logior! (-> this enemy-flags) (enemy-flag enable-on-active checking-water))
(logior! (-> this enemy-flags) (enemy-flag vulnerable vulnerable-backup))
(logior! (-> this focus-status) (focus-status dangerous))
(logior! (-> this enemy-flags) (enemy-flag check-water))
(logior! (-> this enemy-flags) (enemy-flag check-water-backup no-initial-move-to-ground))
(logior! (-> this enemy-flags) (enemy-flag dangerous-backup))
(logior! (-> this enemy-flags) (enemy-flag trackable trackable-backup))
(logclear! (-> this focus-status) (focus-status dead))
(logior! (-> this mask) (process-mask collectable))
(logior! (-> this enemy-flags) (enemy-flag look-at-move-dest))
(logior! (-> this enemy-flags) (enemy-flag attackable-backup))
(if (not (-> this minimap))
(set! (-> this minimap) (add-icon! *minimap* this (the-as uint 70) (the-as int #f) (the-as vector #t) 0))
)

View File

@ -329,12 +329,12 @@
)
)
(defmethod enemy-method-77 ((this citizen-fat) (arg0 (pointer float)))
(defmethod enemy-method-77 ((this citizen-fat) (arg0 enemy-knocked-info))
(case (-> this incoming knocked-type)
(((knocked-type knocked-type-4))
(ja-channel-push! 1 (seconds 0.01))
(let* ((a2-0 (ash 1 (-> this info prev-yellow-hit)))
(v1-3 (enemy-method-120 this 1 a2-0))
(v1-3 (rnd-bit this 1 a2-0))
(a1-7
(-> this
draw
@ -352,7 +352,7 @@
(let ((a0-15 (-> this skel root-channel 0)))
(set! (-> a0-15 frame-group) (the-as art-joint-anim a1-7))
(set! (-> a0-15 param 0) (the float (+ (-> (the-as art-joint-anim a1-7) frames num-frames) -1)))
(set! (-> a0-15 param 1) (-> arg0 0))
(set! (-> a0-15 param 1) (-> arg0 anim-speed))
(set! (-> a0-15 frame-num) 0.0)
(joint-control-channel-group! a0-15 (the-as art-joint-anim a1-7) num-func-seek!)
)
@ -361,7 +361,7 @@
(((knocked-type knocked-type-6))
(ja-channel-push! 1 (seconds 0.01))
(let* ((a2-2 (ash 1 (-> this info prev-blue-hit)))
(v1-12 (enemy-method-120 this 3 a2-2))
(v1-12 (rnd-bit this 3 a2-2))
(a1-14
(-> this
draw
@ -396,7 +396,7 @@
(let ((a0-39 (-> this skel root-channel 0)))
(set! (-> a0-39 frame-group) (the-as art-joint-anim s4-0))
(set! (-> a0-39 param 0) (the float (+ (-> (the-as art-joint-anim s4-0) frames num-frames) -1)))
(set! (-> a0-39 param 1) (-> arg0 0))
(set! (-> a0-39 param 1) (-> arg0 anim-speed))
(set! (-> a0-39 frame-num) 0.0)
(joint-control-channel-group! a0-39 (the-as art-joint-anim s4-0) num-func-seek!)
)
@ -406,7 +406,7 @@
#t
)
(defmethod enemy-method-78 ((this citizen-fat) (arg0 (pointer float)))
(defmethod enemy-method-78 ((this citizen-fat) (arg0 enemy-knocked-info))
(ja-channel-push! 1 (seconds 0.1))
(let ((a0-2 (-> this skel root-channel 0)))
(set! (-> a0-2 frame-group)
@ -422,7 +422,7 @@
)
)
)
(set! (-> a0-2 param 1) (-> arg0 0))
(set! (-> a0-2 param 1) (-> arg0 anim-speed))
(set! (-> a0-2 frame-num) 0.0)
(joint-control-channel-group!
a0-2
@ -619,7 +619,7 @@
(try-update-focus (-> this focus) *target* this)
(set-vector! (-> this neck twist-max) 10922.667 18204.445 0.0 1.0)
(set! (-> this anim-shuffle) 12)
(let ((v1-18 (get-rand-int this 3)))
(let ((v1-18 (rnd-int-count this 3)))
(cond
((zero? v1-18)
(set! (-> this anim-walk) 11)
@ -638,7 +638,7 @@
)
)
)
(let ((v1-33 (get-rand-int this 3)))
(let ((v1-33 (rnd-int-count this 3)))
(cond
((zero? v1-33)
(set! (-> this anim-panic-run) 17)
@ -652,7 +652,7 @@
)
)
(set! (-> this dist-run-anim) 20480.0)
(let ((v1-40 (get-rand-int this 3)))
(let ((v1-40 (rnd-int-count this 3)))
(cond
((zero? v1-40)
(set! (-> this anim-run) 15)
@ -670,12 +670,12 @@
(set! (-> this anim-dive) 18)
(set! (-> this anim-get-up-back) 25)
(set! (-> this anim-get-up-front) 24)
(let ((f30-0 (get-rand-float-range this 1.0 1.25))
(f0-15 (get-rand-float-range this 1.0 1.25))
(let ((f30-0 (rnd-float-range this 1.0 1.25))
(f0-15 (rnd-float-range this 1.0 1.25))
)
(set-vector! (-> this root scale) f0-15 f30-0 f0-15 1.0)
)
(let ((f0-17 (get-rand-float-range this 0.9 1.0)))
(let ((f0-17 (rnd-float-range this 0.9 1.0)))
(set-vector! (-> this draw color-mult) f0-17 f0-17 f0-17 1.0)
)
(set! (-> this water-anim) 32)
@ -691,11 +691,11 @@
(set! (-> this dive-reaction) (* 0.2 (rand-vu)))
(logclear! (-> this mask) (process-mask enemy))
(setup-masks (-> this draw) 0 -1)
(let ((v1-7 (get-rand-int this 2)))
(let ((v1-7 (rnd-int-count this 2)))
(cond
((zero? v1-7)
(setup-masks (-> this draw) 8 0)
(let ((v1-11 (get-rand-int this 3)))
(let ((v1-11 (rnd-int-count this 3)))
(cond
((zero? v1-11)
(setup-masks (-> this draw) 4 0)
@ -708,7 +708,7 @@
)
)
)
(let ((v1-20 (get-rand-int this 4)))
(let ((v1-20 (rnd-int-count this 4)))
(cond
((zero? v1-20)
(setup-masks (-> this draw) 2 0)
@ -722,7 +722,7 @@
)
)
(setup-masks (-> this draw) 512 0)
(let ((v1-31 (get-rand-int this 3)))
(let ((v1-31 (rnd-int-count this 3)))
(cond
((zero? v1-31)
(setup-masks (-> this draw) 64 0)
@ -735,7 +735,7 @@
)
)
)
(let ((v1-40 (get-rand-int this 3)))
(let ((v1-40 (rnd-int-count this 3)))
(cond
((zero? v1-40)
(setup-masks (-> this draw) 32 0)
@ -748,7 +748,7 @@
)
)
)
(let ((v1-49 (get-rand-int this 3)))
(let ((v1-49 (rnd-int-count this 3)))
(cond
((zero? v1-49)
(setup-masks (-> this draw) 16 0)
@ -765,7 +765,7 @@
((= v1-7 1)
(setup-masks (-> this draw) #x400000 0)
(setup-masks (-> this draw) #x200000 0)
(let ((v1-63 (get-rand-int this 2)))
(let ((v1-63 (rnd-int-count this 2)))
(cond
((zero? v1-63)
(setup-masks (-> this draw) 4096 0)
@ -775,7 +775,7 @@
)
)
)
(let ((v1-70 (get-rand-int this 2)))
(let ((v1-70 (rnd-int-count this 2)))
(cond
((zero? v1-70)
(setup-masks (-> this draw) 256 0)
@ -785,7 +785,7 @@
)
)
)
(let ((v1-77 (get-rand-int this 4)))
(let ((v1-77 (rnd-int-count this 4)))
(cond
((zero? v1-77)
(setup-masks (-> this draw) 2 0)
@ -798,10 +798,10 @@
)
)
)
(if (zero? (get-rand-int this 1))
(if (zero? (rnd-int-count this 1))
(setup-masks (-> this draw) #x20000 0)
)
(let ((v1-91 (get-rand-int this 3)))
(let ((v1-91 (rnd-int-count this 3)))
(cond
((zero? v1-91)
(setup-masks (-> this draw) 16 0)

View File

@ -341,7 +341,7 @@
)
)
(defmethod enemy-method-77 ((this citizen-norm) (arg0 (pointer float)))
(defmethod enemy-method-77 ((this citizen-norm) (arg0 enemy-knocked-info))
(local-vars (v1-36 knocked-type))
(cond
((logtest? (-> this flags) (citizen-flag knocked-out-car))
@ -351,7 +351,7 @@
(set! (-> a0-2 param 0)
(the float (+ (-> (the-as art-joint-anim (-> this draw art-group data 33)) frames num-frames) -1))
)
(set! (-> a0-2 param 1) (-> arg0 0))
(set! (-> a0-2 param 1) (-> arg0 anim-speed))
(set! (-> a0-2 frame-num) 0.0)
(joint-control-channel-group! a0-2 (the-as art-joint-anim (-> this draw art-group data 33)) num-func-seek!)
)
@ -364,7 +364,7 @@
(set! (-> a0-5 param 0)
(the float (+ (-> (the-as art-joint-anim (-> this draw art-group data 34)) frames num-frames) -1))
)
(set! (-> a0-5 param 1) (-> arg0 0))
(set! (-> a0-5 param 1) (-> arg0 anim-speed))
(set! (-> a0-5 frame-num) 0.0)
(joint-control-channel-group! a0-5 (the-as art-joint-anim (-> this draw art-group data 34)) num-func-seek!)
)
@ -373,7 +373,7 @@
((begin (set! v1-36 (-> this incoming knocked-type)) (= v1-36 (knocked-type knocked-type-4)))
(ja-channel-push! 1 (seconds 0.1))
(let* ((a2-2 (ash 1 (-> this info prev-yellow-hit)))
(v1-39 (enemy-method-120 this 1 a2-2))
(v1-39 (rnd-bit this 1 a2-2))
(a1-11
(-> this
draw
@ -391,7 +391,7 @@
(let ((a0-21 (-> this skel root-channel 0)))
(set! (-> a0-21 frame-group) (the-as art-joint-anim a1-11))
(set! (-> a0-21 param 0) (the float (+ (-> (the-as art-joint-anim a1-11) frames num-frames) -1)))
(set! (-> a0-21 param 1) (-> arg0 0))
(set! (-> a0-21 param 1) (-> arg0 anim-speed))
(set! (-> a0-21 frame-num) 0.0)
(joint-control-channel-group! a0-21 (the-as art-joint-anim a1-11) num-func-seek!)
)
@ -400,7 +400,7 @@
((= v1-36 (knocked-type knocked-type-6))
(ja-channel-push! 1 (seconds 0.01))
(let* ((a2-4 (ash 1 (-> this info prev-blue-hit)))
(v1-48 (enemy-method-120 this 3 a2-4))
(v1-48 (rnd-bit this 3 a2-4))
(a1-18
(-> this
draw
@ -435,12 +435,12 @@
(if (or (= (-> this incoming knocked-type) (knocked-type knocked-type-2))
(= (-> this incoming knocked-type) (knocked-type knocked-type-3))
)
(set! (-> arg0 0) (* 0.5 (-> arg0 0)))
(set! (-> arg0 anim-speed) (* 0.5 (-> arg0 anim-speed)))
)
(let ((a0-47 (-> this skel root-channel 0)))
(set! (-> a0-47 frame-group) (the-as art-joint-anim s4-0))
(set! (-> a0-47 param 0) (the float (+ (-> (the-as art-joint-anim s4-0) frames num-frames) -1)))
(set! (-> a0-47 param 1) (-> arg0 0))
(set! (-> a0-47 param 1) (-> arg0 anim-speed))
(set! (-> a0-47 frame-num) 0.0)
(joint-control-channel-group! a0-47 (the-as art-joint-anim s4-0) num-func-seek!)
)
@ -450,9 +450,9 @@
#t
)
(defmethod enemy-method-78 ((this citizen-norm) (arg0 (pointer float)))
(defmethod enemy-method-78 ((this citizen-norm) (arg0 enemy-knocked-info))
(ja-channel-push! 1 (seconds 0.1))
(set! (-> arg0 0) 1.0)
(set! (-> arg0 anim-speed) 1.0)
(let ((a0-2 (-> this skel root-channel 0)))
(set! (-> a0-2 frame-group)
(the-as art-joint-anim (-> this draw art-group data (-> this info knocked-land (-> this hit-face))))
@ -467,7 +467,7 @@
)
)
)
(set! (-> a0-2 param 1) (-> arg0 0))
(set! (-> a0-2 param 1) (-> arg0 anim-speed))
(set! (-> a0-2 frame-num) 0.0)
(joint-control-channel-group!
a0-2
@ -764,7 +764,7 @@
(-> this neck)
(set! (-> this info) *citizen-norm-global-info*)
(set! (-> this anim-shuffle) 11)
(let ((v1-18 (get-rand-int this 3)))
(let ((v1-18 (rnd-int-count this 3)))
(cond
((zero? v1-18)
(set! (-> this anim-walk) 12)
@ -783,7 +783,7 @@
)
)
)
(let ((v1-33 (get-rand-int this 3)))
(let ((v1-33 (rnd-int-count this 3)))
(cond
((zero? v1-33)
(set! (-> this anim-panic-run) 15)
@ -797,7 +797,7 @@
)
)
(set! (-> this dist-run-anim) 28672.0)
(let ((v1-40 (get-rand-int this 3)))
(let ((v1-40 (rnd-int-count this 3)))
(cond
((zero? v1-40)
(set! (-> this anim-run) 14)
@ -815,12 +815,12 @@
(set! (-> this anim-dive) 16)
(set! (-> this anim-get-up-front) 22)
(set! (-> this anim-get-up-back) 23)
(let ((f30-0 (get-rand-float-range this 1.0 1.25))
(f0-11 (get-rand-float-range this 1.0 1.25))
(let ((f30-0 (rnd-float-range this 1.0 1.25))
(f0-11 (rnd-float-range this 1.0 1.25))
)
(set-vector! (-> this root scale) f0-11 f30-0 f0-11 1.0)
)
(let ((f0-13 (get-rand-float-range this 0.9 1.0)))
(let ((f0-13 (rnd-float-range this 0.9 1.0)))
(set-vector! (-> this draw color-mult) f0-13 f0-13 f0-13 1.0)
)
(set! (-> this water-anim) 29)
@ -837,7 +837,7 @@
(logclear! (-> this mask) (process-mask enemy))
(setup-masks (-> this draw) 0 -1)
(setup-masks (-> this draw) 32 0)
(let ((v1-10 (get-rand-int this 4)))
(let ((v1-10 (rnd-int-count this 4)))
(cond
((zero? v1-10)
(setup-masks (-> this draw) 64 0)
@ -853,7 +853,7 @@
)
)
)
(let ((v1-21 (get-rand-int this 3)))
(let ((v1-21 (rnd-int-count this 3)))
(cond
((zero? v1-21)
(setup-masks (-> this draw) 2 0)
@ -866,7 +866,7 @@
)
)
)
(let ((v1-30 (get-rand-int this 4)))
(let ((v1-30 (rnd-int-count this 4)))
(cond
((zero? v1-30)
(setup-masks (-> this draw) 8 0)
@ -882,7 +882,7 @@
)
)
)
(let ((v1-41 (get-rand-int this 5)))
(let ((v1-41 (rnd-int-count this 5)))
(cond
((zero? v1-41)
(setup-masks (-> this draw) 4 0)
@ -898,7 +898,7 @@
)
)
)
(let ((v1-52 (get-rand-int this 4)))
(let ((v1-52 (rnd-int-count this 4)))
(cond
((zero? v1-52)
(setup-masks (-> this draw) 128 0)
@ -915,7 +915,7 @@
)
)
(setup-masks (-> this draw) 16 0)
(let ((v1-65 (get-rand-int this 4)))
(let ((v1-65 (rnd-int-count this 4)))
(cond
((zero? v1-65)
(setup-masks (-> this draw) 256 0)

View File

@ -52,7 +52,7 @@
(logclear! (-> this focus-status) (focus-status disable dead inactive hit))
(logclear! (-> this flags) (citizen-flag persistent in-pursuit hostile))
(clear-focused (-> this focus))
(set! (-> this enemy-flags) (the-as enemy-flag (logand (enemy-flag dislike-combo) (-> this enemy-flags))))
(set! (-> this enemy-flags) (the-as enemy-flag (logand (enemy-flag drawn-mirrored) (-> this enemy-flags))))
(logclear! (-> this draw status) (draw-control-status no-draw lod-set))
(set! (-> this draw death-timer) (the-as uint 0))
(logior! (-> this root nav-flags) (nav-flags has-root-sphere))
@ -78,12 +78,12 @@
dark-giant
)
)
(logior! (-> this enemy-flags) (enemy-flag enable-on-active checking-water))
(logior! (-> this enemy-flags) (enemy-flag vulnerable vulnerable-backup))
(logior! (-> this focus-status) (focus-status dangerous))
(logior! (-> this enemy-flags) (enemy-flag check-water))
(logior! (-> this enemy-flags) (enemy-flag check-water-backup no-initial-move-to-ground))
(logior! (-> this enemy-flags) (enemy-flag dangerous-backup))
(logior! (-> this enemy-flags) (enemy-flag trackable trackable-backup))
(logior! (-> this mask) (process-mask collectable))
(logior! (-> this enemy-flags) (enemy-flag look-at-move-dest))
(logior! (-> this enemy-flags) (enemy-flag attackable-backup))
(set! (-> this hit-points) (-> this enemy-info default-hit-points))
(set! (-> this fated-time) 0)
(set! (-> this hit-by-player-count) 0)
@ -355,7 +355,7 @@
(none)
)
(defmethod track-target! ((this citizen))
(defmethod common-post ((this citizen))
"Does a lot of various things relating to interacting with the target
- tracks when the enemy was last drawn
- looks at the target and handles attacking
@ -370,7 +370,7 @@
(set! (-> s5-0 quad) (-> this danger-pos quad))
)
(when (< (vector-vector-distance s5-0 (-> this root trans)) 122880.0)
(look-at-target! this (enemy-flag lock-focus))
(look-at-target! this (enemy-flag look-at-focus))
(target-set! (-> this neck) s5-0)
)
)
@ -378,18 +378,18 @@
)
(when (< (-> this stop-time-look-at) (current-time))
(shut-down (-> this neck))
(set! (-> this next-time-look-at) (+ (current-time) (the int (* 300.0 (get-rand-float-range this 0.0 20.0)))))
(set! (-> this next-time-look-at) (+ (current-time) (the int (* 300.0 (rnd-float-range this 0.0 20.0)))))
(set! (-> this stop-time-look-at)
(+ (-> this next-time-look-at) (the int (* 300.0 (get-rand-float-range this 5.0 10.0))))
(+ (-> this next-time-look-at) (the int (* 300.0 (rnd-float-range this 5.0 10.0))))
)
)
)
)
(let ((a0-18 (-> this enemy-flags)))
(when (and (logtest? a0-18 (enemy-flag attackable-backup))
(when (and (logtest? a0-18 (enemy-flag auto-reset-penetrate))
(time-elapsed? (-> this auto-reset-penetrate-time) (seconds 0.1))
)
(set! (-> this enemy-flags) (logclear a0-18 (enemy-flag attackable-backup)))
(set! (-> this enemy-flags) (logclear a0-18 (enemy-flag auto-reset-penetrate)))
(set! (-> this root penetrated-by) (get-penetrate-info this))
(let ((v1-50 0))
(if (logtest? (penetrate knocked) (-> this root penetrate-using))
@ -428,7 +428,7 @@
)
)
)
(when (logtest? (enemy-flag trackable-backup directed-ready) (-> this enemy-flags))
(when (logtest? (enemy-flag check-water checking-water) (-> this enemy-flags))
(enemy-method-54 this)
(when (and (focus-test? this touch-water) (< (-> this root trans y) (+ -11468.8 (-> this water-surface-height))))
(set! (-> this root trans y) (+ -11468.8 (-> this water-surface-height)))
@ -582,6 +582,7 @@
)
;; og:preserve-this modified for PC, see comment near definition in collide-shape-h.gc
(normalized-heading-to-quaternion! gp-0 s3-0)
(quaternion-normalize! gp-0)
(quaternion-pseudo-seek
s5-1
s5-1
@ -611,7 +612,7 @@
)
)
)
(track-target! this)
(common-post this)
(update-transforms (-> this root))
0
(none)
@ -629,9 +630,9 @@
(let ((t9-0 (method-of-type nav-enemy init-enemy-behaviour-and-stats!)))
(t9-0 this arg0)
)
(set! (-> this speed-scale) (get-rand-float-range this 0.9 1.1))
(set! (-> this speed-scale) (rnd-float-range this 0.9 1.1))
(logclear! (-> this mask) (process-mask actor-pause))
(logclear! (-> this enemy-flags) (enemy-flag notice))
(logclear! (-> this enemy-flags) (enemy-flag actor-pause-backup))
(vehicle-controller-method-9 (-> this controller))
(citizen-init! this)
(if (zero? (-> this draw light-index))
@ -1232,7 +1233,12 @@ This commonly includes things such as:
(vector-normalize! s5-1 32768.0)
(set! (-> s5-1 y) 71680.0)
(vector+! s5-1 s5-1 (-> (the-as vehicle s4-0) root transv))
(send-event this 'attack #f (static-attack-info ((id (new-attack-id)) (vector s5-1) (knock (the-as uint 7)))))
(send-event
this
'attack
#f
(static-attack-info ((id (new-attack-id)) (vector s5-1) (knock (knocked-type knocked-type-7))))
)
)
)
)
@ -1254,7 +1260,7 @@ This commonly includes things such as:
(set! (-> v1-5 enemy-flags) (the-as enemy-flag (logclear (-> v1-5 enemy-flags) (enemy-flag enemy-flag37))))
)
0
(set! (-> self wait-time) (the-as time-frame (get-rand-int-range self 300 1500)))
(set! (-> self wait-time) (the-as time-frame (rnd-int-range self 300 1500)))
(if (= (-> self water-anim) -1)
(go-inactive self)
)
@ -1389,7 +1395,7 @@ This commonly includes things such as:
(set! (-> v1-16 target-speed) (* (-> self speed-scale) (-> self speed-walk)))
)
0
(set! (-> self wait-time) (the-as time-frame (get-rand-int-range self 1200 9000)))
(set! (-> self wait-time) (the-as time-frame (rnd-int-range self 1200 9000)))
(when (zero? (-> self controller branch))
(format 0 "citizen has no branch in active enter state~%")
(citizen-method-195 self (vector-z-quaternion! (new 'stack-no-clear 'vector) (-> self root quat)))
@ -1412,7 +1418,7 @@ This commonly includes things such as:
0
(when (= (-> self nav state speed) 0.0)
(set! (-> self wait-return-state) (the-as (state citizen) (-> self state)))
(set! (-> self wait-time) (the-as time-frame (get-rand-int-range self 300 1500)))
(set! (-> self wait-time) (the-as time-frame (rnd-int-range self 300 1500)))
(go-virtual wait)
)
)

View File

@ -124,13 +124,13 @@
(set! (-> this hit-points) (-> this enemy-info default-hit-points))
(set! (-> this hit-points) (rand-vu-int-range 1 4))
(set! (-> this fated-time) 0)
(logior! (-> this enemy-flags) (enemy-flag enable-on-active checking-water))
(logior! (-> this enemy-flags) (enemy-flag vulnerable vulnerable-backup))
(logior! (-> this focus-status) (focus-status dangerous))
(logior! (-> this enemy-flags) (enemy-flag check-water))
(logior! (-> this enemy-flags) (enemy-flag check-water-backup no-initial-move-to-ground))
(logior! (-> this enemy-flags) (enemy-flag dangerous-backup))
(logior! (-> this enemy-flags) (enemy-flag trackable trackable-backup))
(logclear! (-> this focus-status) (focus-status dead))
(logior! (-> this mask) (process-mask collectable))
(logior! (-> this enemy-flags) (enemy-flag look-at-move-dest))
(logior! (-> this enemy-flags) (enemy-flag attackable-backup))
(if (zero? (-> this hit-face))
(go (method-of-object this get-up-front))
(go (method-of-object this get-up-back))
@ -183,7 +183,7 @@
)
)
(defmethod enemy-method-108 ((this civilian) (arg0 enemy) (arg1 event-message-block))
(defmethod enemy-method-108 ((this civilian) (arg0 process-drawable) (arg1 event-message-block))
0
)
@ -460,7 +460,7 @@
)
)
(when (< (-> self cp-next-time) (current-time))
(set! (-> self cp-next-time) (+ (current-time) (get-rand-int-range self 600 1200)))
(set! (-> self cp-next-time) (+ (current-time) (rnd-int-range self 600 1200)))
(citizen-method-190 self (-> self cp-force))
)
(add-offset-to-target! (-> self nav state) (-> self cp-force))
@ -722,7 +722,7 @@
(set! (-> v1-9 target-speed) (* (-> self speed-scale) (-> self speed-walk)))
)
0
(set! (-> self next-time) (+ (current-time) (get-rand-int-range self 300 600)))
(set! (-> self next-time) (+ (current-time) (rnd-int-range self 300 600)))
(set! (-> self last-second-pos quad) (-> self root trans quad))
(set! (-> self last-distance)
(vector-vector-xz-distance (-> self controller turn-exit-point) (-> self root trans))
@ -847,7 +847,7 @@
(citizen-method-192 self)
(when (< (-> self cp-next-time) (current-time))
(citizen-method-190 self (-> self cp-force))
(set! (-> self cp-next-time) (+ (current-time) (get-rand-int-range self 1200 2400)))
(set! (-> self cp-next-time) (+ (current-time) (rnd-int-range self 1200 2400)))
)
(let ((gp-1 (new 'stack-no-clear 'vector)))
(citizen-method-188 self gp-1)
@ -899,7 +899,7 @@
(set! (-> v1-9 target-speed) (* (-> self speed-scale) (-> self speed-walk)))
)
0
(set! (-> self cp-next-time) (+ (current-time) (get-rand-int-range self 1200 2400)))
(set! (-> self cp-next-time) (+ (current-time) (rnd-int-range self 1200 2400)))
(set! (-> self cp-force quad) (the-as uint128 0))
(if *citizen-debug*
(set-vector! (-> self draw color-mult) 0.0 1.0 0.0 1.0)
@ -1129,7 +1129,7 @@
)
0
(if (-> self dive-finished?)
(track-target! self)
(common-post self)
(nav-enemy-method-176 self)
)
)
@ -1225,7 +1225,7 @@
(set! (-> a0-0 travel quad) (-> v1-1 quad))
)
0
(track-target! self)
(common-post self)
)
)
@ -1276,7 +1276,7 @@
(set! (-> a0-1 travel quad) (-> v1-3 quad))
)
0
(track-target! self)
(common-post self)
)
)
@ -1327,12 +1327,12 @@
(set! (-> a0-1 travel quad) (-> v1-3 quad))
)
0
(track-target! self)
(common-post self)
)
)
(defbehavior civilian-falling-post civilian ()
(logior! (-> self enemy-flags) (enemy-flag directed))
(logior! (-> self enemy-flags) (enemy-flag recover-applied-velocity))
(let ((gp-0 (-> self root)))
(cond
((focus-test? self under-water)
@ -1354,7 +1354,7 @@
)
)
(enemy-method-111 self)
(track-target! self)
(common-post self)
(none)
)
@ -1803,7 +1803,7 @@
(go-virtual ride)
)
:post (behavior ()
(track-target! self)
(common-post self)
)
)
@ -1873,7 +1873,7 @@
#f
)
:post (behavior ()
(track-target! self)
(common-post self)
)
)
@ -2022,7 +2022,7 @@
(go-virtual active)
)
:post (behavior ()
(track-target! self)
(common-post self)
)
)

View File

@ -358,7 +358,7 @@
(vector-z-quaternion! (new 'stack-no-clear 'vector) (-> this root quat))
(set! (-> s0-0 quad) (-> this root trans quad))
(cond
((logtest? (enemy-flag dislike-combo) (-> this enemy-flags))
((logtest? (enemy-flag drawn-mirrored) (-> this enemy-flags))
(let ((a1-6 s0-0))
(let ((v1-14 s0-0))
(let ((a0-9 s4-0))
@ -451,12 +451,12 @@
(define *guard-min-id-hack* 255)
(defmethod track-target! ((this crimson-guard))
(defmethod common-post ((this crimson-guard))
"Does a lot of various things relating to interacting with the target
- tracks when the enemy was last drawn
- looks at the target and handles attacking
@TODO Not extremely well understood yet"
(let ((t9-0 (method-of-type citizen track-target!)))
(let ((t9-0 (method-of-type citizen common-post)))
(t9-0 this)
)
(update-transforms (-> this root))
@ -527,7 +527,7 @@
)
(('combo)
(and (not (and (-> this next-state) (= (-> this next-state name) 'inactive)))
(and (not (logtest? (enemy-flag multi-focus) (-> this enemy-flags))) (nonzero? (-> this hit-points)))
(and (not (logtest? (enemy-flag dislike-combo) (-> this enemy-flags))) (nonzero? (-> this hit-points)))
)
)
(('avoid)
@ -741,7 +741,7 @@
(set! (-> a0-1 travel quad) (-> v1-3 quad))
)
0
(track-target! self)
(common-post self)
)
)
@ -802,7 +802,7 @@
(set! (-> a0-1 travel quad) (-> v1-3 quad))
)
0
(track-target! self)
(common-post self)
)
)
@ -857,7 +857,7 @@
)
)
(defmethod enemy-method-77 ((this crimson-guard) (arg0 (pointer float)))
(defmethod enemy-method-77 ((this crimson-guard) (arg0 enemy-knocked-info))
(cond
((logtest? (-> this flags) (citizen-flag knocked-out-car))
(ja-channel-push! 1 (seconds 0.1))
@ -866,7 +866,7 @@
(set! (-> a0-2 param 0)
(the float (+ (-> (the-as art-joint-anim (-> this draw art-group data 42)) frames num-frames) -1))
)
(set! (-> a0-2 param 1) (-> arg0 0))
(set! (-> a0-2 param 1) (-> arg0 anim-speed))
(set! (-> a0-2 frame-num) 0.0)
(joint-control-channel-group! a0-2 (the-as art-joint-anim (-> this draw art-group data 42)) num-func-seek!)
)
@ -879,7 +879,7 @@
(set! (-> a0-5 param 0)
(the float (+ (-> (the-as art-joint-anim (-> this draw art-group data 43)) frames num-frames) -1))
)
(set! (-> a0-5 param 1) (-> arg0 0))
(set! (-> a0-5 param 1) (-> arg0 anim-speed))
(set! (-> a0-5 frame-num) 0.0)
(joint-control-channel-group! a0-5 (the-as art-joint-anim (-> this draw art-group data 43)) num-func-seek!)
)
@ -905,7 +905,7 @@
)
(set! (-> a0-11 frame-group) (the-as art-joint-anim a1-6))
(set! (-> a0-11 param 0) (the float (+ (-> (the-as art-joint-anim a1-6) frames num-frames) -1)))
(set! (-> a0-11 param 1) (-> arg0 0))
(set! (-> a0-11 param 1) (-> arg0 anim-speed))
(set! (-> a0-11 frame-num) 0.0)
(joint-control-channel-group! a0-11 (the-as art-joint-anim a1-6) num-func-seek!)
)
@ -916,7 +916,7 @@
(ja-channel-push! 1 (seconds 0.01))
(cond
((= (-> this small-hit) 1)
(set! (-> this yellow-anim) (the-as uint (get-rand-int this 2)))
(set! (-> this yellow-anim) (the-as uint (rnd-int-count this 2)))
(let ((a1-12 (-> this
draw
art-group
@ -935,7 +935,7 @@
)
(set! (-> a0-23 frame-group) (the-as art-joint-anim a1-12))
(set! (-> a0-23 param 0) (the float (+ (-> (the-as art-joint-anim a1-12) frames num-frames) -1)))
(set! (-> a0-23 param 1) (-> arg0 0))
(set! (-> a0-23 param 1) (-> arg0 anim-speed))
(set! (-> a0-23 frame-num) 0.0)
(joint-control-channel-group! a0-23 (the-as art-joint-anim a1-12) num-func-seek!)
)
@ -946,7 +946,7 @@
)
(set! (-> a0-27 frame-group) (the-as art-joint-anim a1-13))
(set! (-> a0-27 param 0) (the float (+ (-> (the-as art-joint-anim a1-13) frames num-frames) -1)))
(set! (-> a0-27 param 1) (-> arg0 0))
(set! (-> a0-27 param 1) (-> arg0 anim-speed))
(set! (-> a0-27 frame-num) 0.0)
(joint-control-channel-group! a0-27 (the-as art-joint-anim a1-13) num-func-seek!)
)
@ -960,7 +960,7 @@
(set! (-> a0-30 param 0)
(the float (+ (-> (the-as art-joint-anim (-> this draw art-group data 10)) frames num-frames) -1))
)
(set! (-> a0-30 param 1) (-> arg0 0))
(set! (-> a0-30 param 1) (-> arg0 anim-speed))
(set! (-> a0-30 frame-num) 0.0)
(joint-control-channel-group! a0-30 (the-as art-joint-anim (-> this draw art-group data 10)) num-func-seek!)
)
@ -968,11 +968,11 @@
(((knocked-type knocked-type-2))
(ja-channel-push! 1 (seconds 0.1))
(let ((a1-17 (-> this draw art-group data (-> this info knocked (-> this hit-face)))))
(set! (-> arg0 0) (* 0.5 (-> arg0 0)))
(set! (-> arg0 anim-speed) (* 0.5 (-> arg0 anim-speed)))
(let ((a0-36 (-> this skel root-channel 0)))
(set! (-> a0-36 frame-group) (the-as art-joint-anim a1-17))
(set! (-> a0-36 param 0) (the float (+ (-> (the-as art-joint-anim a1-17) frames num-frames) -1)))
(set! (-> a0-36 param 1) (-> arg0 0))
(set! (-> a0-36 param 1) (-> arg0 anim-speed))
(set! (-> a0-36 frame-num) 0.0)
(joint-control-channel-group! a0-36 (the-as art-joint-anim a1-17) num-func-seek!)
)
@ -985,7 +985,7 @@
)
(set! (-> a0-41 frame-group) (the-as art-joint-anim a1-19))
(set! (-> a0-41 param 0) (the float (+ (-> (the-as art-joint-anim a1-19) frames num-frames) -1)))
(set! (-> a0-41 param 1) (-> arg0 0))
(set! (-> a0-41 param 1) (-> arg0 anim-speed))
(set! (-> a0-41 frame-num) 0.0)
(joint-control-channel-group! a0-41 (the-as art-joint-anim a1-19) num-func-seek!)
)
@ -996,7 +996,7 @@
#t
)
(defmethod enemy-method-78 ((this crimson-guard) (arg0 (pointer float)))
(defmethod enemy-method-78 ((this crimson-guard) (arg0 enemy-knocked-info))
(cond
((<= (-> this hit-points) 0)
(ja-channel-push! 1 (seconds 0.1))
@ -1005,7 +1005,7 @@
)
(set! (-> a0-5 frame-group) (the-as art-joint-anim a1-2))
(set! (-> a0-5 param 0) (the float (+ (-> (the-as art-joint-anim a1-2) frames num-frames) -1)))
(set! (-> a0-5 param 1) (-> arg0 0))
(set! (-> a0-5 param 1) (-> arg0 anim-speed))
(set! (-> a0-5 frame-num) 0.0)
(joint-control-channel-group! a0-5 (the-as art-joint-anim a1-2) num-func-seek!)
)
@ -1036,7 +1036,7 @@
)
(set! (-> a0-16 frame-group) (the-as art-joint-anim a1-7))
(set! (-> a0-16 param 0) (the float (+ (-> (the-as art-joint-anim a1-7) frames num-frames) -1)))
(set! (-> a0-16 param 1) (-> arg0 0))
(set! (-> a0-16 param 1) (-> arg0 anim-speed))
(set! (-> a0-16 frame-num) 0.0)
(joint-control-channel-group! a0-16 (the-as art-joint-anim a1-7) num-func-seek!)
)
@ -1049,7 +1049,7 @@
)
(set! (-> a0-20 frame-group) (the-as art-joint-anim a1-8))
(set! (-> a0-20 param 0) (the float (+ (-> (the-as art-joint-anim a1-8) frames num-frames) -1)))
(set! (-> a0-20 param 1) (-> arg0 0))
(set! (-> a0-20 param 1) (-> arg0 anim-speed))
(set! (-> a0-20 frame-num) 0.0)
(joint-control-channel-group! a0-20 (the-as art-joint-anim a1-8) num-func-seek!)
)
@ -1064,7 +1064,7 @@
(set! (-> a0-23 param 0)
(the float (+ (-> (the-as art-joint-anim (-> this draw art-group data 11)) frames num-frames) -1))
)
(set! (-> a0-23 param 1) (-> arg0 0))
(set! (-> a0-23 param 1) (-> arg0 anim-speed))
(set! (-> a0-23 frame-num) 0.0)
(joint-control-channel-group! a0-23 (the-as art-joint-anim (-> this draw art-group data 11)) num-func-seek!)
)
@ -1074,11 +1074,11 @@
(else
(ja-channel-push! 1 (seconds 0.1))
(let ((a1-12 (-> this draw art-group data (-> this info knocked-land (-> this hit-face)))))
(set! (-> arg0 0) 1.0)
(set! (-> arg0 anim-speed) 1.0)
(let ((a0-28 (-> this skel root-channel 0)))
(set! (-> a0-28 frame-group) (the-as art-joint-anim a1-12))
(set! (-> a0-28 param 0) (the float (+ (-> (the-as art-joint-anim a1-12) frames num-frames) -1)))
(set! (-> a0-28 param 1) (-> arg0 0))
(set! (-> a0-28 param 1) (-> arg0 anim-speed))
(set! (-> a0-28 frame-num) 0.0)
(joint-control-channel-group! a0-28 (the-as art-joint-anim a1-12) num-func-seek!)
)
@ -1302,7 +1302,7 @@
(let ((v1-3 (-> (the-as collide-shape-prim-group (-> self root root-prim)) child 3)))
(logclear! (-> v1-3 prim-core action) (collide-action deadly))
)
(if (logtest? (-> self enemy-flags) (enemy-flag check-water))
(if (logtest? (-> self enemy-flags) (enemy-flag dangerous-backup))
(logior! (-> self focus-status) (focus-status dangerous))
(logclear! (-> self focus-status) (focus-status dangerous))
)
@ -1469,8 +1469,8 @@
(init-vf0-vector)
(cond
((logtest? (-> this controller traffic alert-state flags) (traffic-alert-flag guard-multi-focus))
(logior! (-> this enemy-flags) (enemy-flag trackable))
(when (not (logtest? (enemy-flag actor-pause-backup) (-> this enemy-flags)))
(logior! (-> this enemy-flags) (enemy-flag multi-focus))
(when (not (logtest? (enemy-flag lock-focus) (-> this enemy-flags)))
(let ((a0-4 (find-closest-to-with-collide-lists (-> this controller traffic) this (-> this focus collide-with))))
(if a0-4
(set! (-> this traffic-target-status handle) (process->handle a0-4))
@ -1480,8 +1480,8 @@
)
)
(else
(when (logtest? (enemy-flag trackable) (-> this enemy-flags))
(logclear! (-> this enemy-flags) (enemy-flag trackable))
(when (logtest? (enemy-flag multi-focus) (-> this enemy-flags))
(logclear! (-> this enemy-flags) (enemy-flag multi-focus))
(let* ((s5-0 (handle->process (-> this traffic-target-status handle)))
(v1-21 (if (type? s5-0 process-focusable)
s5-0
@ -1872,7 +1872,7 @@
(when (and (< (-> self target-self-xz-dist) 163840.0)
(or (< 40960.0 (-> self target-self-xz-dist)) (>= 2 (the-as int (-> self focus aware))))
)
(if (and (time-elapsed? (-> self state-time) (the int (* 300.0 (get-rand-float-range self 1.0 3.0))))
(if (and (time-elapsed? (-> self state-time) (the int (* 300.0 (rnd-float-range self 1.0 3.0))))
(logtest? (-> self flags) (citizen-flag target-in-sight))
)
(go-virtual gun-shoot)
@ -1972,7 +1972,7 @@
:virtual #t
:event enemy-event-handler
:enter (behavior ()
(logior! (-> self enemy-flags) (enemy-flag actor-pause-backup))
(logior! (-> self enemy-flags) (enemy-flag lock-focus))
(logior! (-> self focus-status) (focus-status dangerous))
(let ((v1-4 self))
(if (not (logtest? (enemy-flag enemy-flag36) (-> v1-4 enemy-flags)))
@ -2001,8 +2001,8 @@
(let ((v1-3 (-> (the-as collide-shape-prim-group (-> self root root-prim)) child 3)))
(logclear! (-> v1-3 prim-core action) (collide-action deadly))
)
(logclear! (-> self enemy-flags) (enemy-flag actor-pause-backup))
(if (logtest? (-> self enemy-flags) (enemy-flag check-water))
(logclear! (-> self enemy-flags) (enemy-flag lock-focus))
(if (logtest? (-> self enemy-flags) (enemy-flag dangerous-backup))
(logior! (-> self focus-status) (focus-status dangerous))
(logclear! (-> self focus-status) (focus-status dangerous))
)
@ -2036,7 +2036,7 @@
:virtual #t
:event enemy-event-handler
:enter (behavior ()
(logior! (-> self enemy-flags) (enemy-flag actor-pause-backup))
(logior! (-> self enemy-flags) (enemy-flag lock-focus))
(set! (-> self other-side) (if (< (rand-vu) 0.5)
#t
#f
@ -2077,7 +2077,7 @@
)
:exit (behavior ()
(set! (-> self joint-enable) #f)
(logclear! (-> self enemy-flags) (enemy-flag actor-pause-backup))
(logclear! (-> self enemy-flags) (enemy-flag lock-focus))
)
:trans (behavior ()
(crimson-guard-method-220 self)
@ -2113,7 +2113,7 @@
(local-vars (v1-35 object))
(speech-control-method-12 *speech-control* self (speech-type speech-type-9))
(ja-channel-push! 1 (seconds 0.2))
(let ((f30-0 (get-rand-float-range self 0.9 1.1)))
(let ((f30-0 (rnd-float-range self 0.9 1.1)))
(ja-no-eval :group! (-> self draw art-group data (-> self anim-shoot 0 anim-index))
:num! (seek! max f30-0)
:frame-num 0.0
@ -2180,7 +2180,7 @@
#f
)
(label cfg-40)
(let ((f30-1 (get-rand-float-range self 0.9 1.1)))
(let ((f30-1 (rnd-float-range self 0.9 1.1)))
(ja-channel-push! 1 (seconds 0.2))
(ja-no-eval :group! (-> self draw art-group data (-> self anim-shoot 2 anim-index))
:num! (seek! max f30-1)
@ -2277,7 +2277,7 @@
0
(ja-channel-push! 1 (seconds 0.1))
(cond
((logtest? (enemy-flag dislike-combo) (-> self enemy-flags))
((logtest? (enemy-flag drawn-mirrored) (-> self enemy-flags))
(ja-no-eval :group! crimson-guard-jump-right-ja :num! (seek! (ja-aframe 6.0 0)) :frame-num (ja-aframe 0.0 0))
(until (ja-done? 0)
(let ((a0-20 (handle->process (-> self focus handle))))
@ -2318,7 +2318,7 @@
)
0
(cond
((logtest? (enemy-flag dislike-combo) (-> self enemy-flags))
((logtest? (enemy-flag drawn-mirrored) (-> self enemy-flags))
(ja-no-eval :group! crimson-guard-jump-right-ja :num! (seek! (ja-aframe 11.0 0)) :frame-num (ja-aframe 6.0 0))
(until (ja-done? 0)
(suspend)
@ -2376,7 +2376,7 @@
0
(ja-channel-push! 1 (seconds 0.1))
(cond
((logtest? (enemy-flag dislike-combo) (-> self enemy-flags))
((logtest? (enemy-flag drawn-mirrored) (-> self enemy-flags))
(ja-no-eval :group! crimson-guard-jump-left-ja :num! (seek! (ja-aframe 9.0 0)) :frame-num (ja-aframe 0.0 0))
(until (ja-done? 0)
(let ((a0-20 (handle->process (-> self focus handle))))
@ -2417,7 +2417,7 @@
)
0
(cond
((logtest? (enemy-flag dislike-combo) (-> self enemy-flags))
((logtest? (enemy-flag drawn-mirrored) (-> self enemy-flags))
(ja-no-eval :group! crimson-guard-jump-left-ja :num! (seek! (ja-aframe 11.0 0)) :frame-num (ja-aframe 9.0 0))
(until (ja-done? 0)
(suspend)
@ -2441,7 +2441,7 @@
:virtual #t
:event enemy-event-handler
:enter (behavior ()
(logior! (-> self enemy-flags) (enemy-flag actor-pause-backup))
(logior! (-> self enemy-flags) (enemy-flag lock-focus))
(nav-enemy-method-167 self)
(let ((v1-4 self))
(set! (-> v1-4 enemy-flags) (the-as enemy-flag (logclear (-> v1-4 enemy-flags) (enemy-flag enemy-flag36))))
@ -2468,7 +2468,7 @@
)
:exit (behavior ()
(set! (-> self joint-enable) #f)
(logclear! (-> self enemy-flags) (enemy-flag actor-pause-backup))
(logclear! (-> self enemy-flags) (enemy-flag lock-focus))
)
:trans (behavior ()
(crimson-guard-method-220 self)
@ -2477,7 +2477,7 @@
:code (behavior ()
(speech-control-method-12 *speech-control* self (speech-type speech-type-13))
(ja-channel-push! 1 (seconds 0.2))
(let ((f30-0 (get-rand-float-range self 0.9 1.1)))
(let ((f30-0 (rnd-float-range self 0.9 1.1)))
(ja-no-eval :group! crimson-guard-idle-to-stab-idle-ja :num! (seek! max f30-0) :frame-num 0.0)
(until (ja-done? 0)
(seek-toward-heading-vec! (-> self root) (-> self target-self-xz) 65536.0 (seconds 0.02))
@ -2500,7 +2500,7 @@
)
#f
(label cfg-17)
(let ((f30-1 (get-rand-float-range self 0.9 1.1)))
(let ((f30-1 (rnd-float-range self 0.9 1.1)))
(ja-channel-push! 1 (seconds 0.2))
(ja-no-eval :group! crimson-guard-stab-idle-to-idle-ja :num! (seek! max f30-1) :frame-num 0.0)
(until (ja-done? 0)
@ -2521,7 +2521,7 @@
:virtual #t
:event enemy-event-handler
:enter (behavior ()
(logior! (-> self enemy-flags) (enemy-flag actor-pause-backup))
(logior! (-> self enemy-flags) (enemy-flag lock-focus))
(nav-enemy-method-167 self)
(let ((v1-4 self))
(set! (-> v1-4 enemy-flags) (the-as enemy-flag (logclear (-> v1-4 enemy-flags) (enemy-flag enemy-flag36))))
@ -2547,7 +2547,7 @@
)
:exit (behavior ()
(set! (-> self joint-enable) #f)
(logclear! (-> self enemy-flags) (enemy-flag actor-pause-backup))
(logclear! (-> self enemy-flags) (enemy-flag lock-focus))
)
:trans (behavior ()
(crimson-guard-method-220 self)
@ -2557,7 +2557,7 @@
)
:code (behavior ()
(ja-channel-push! 1 (seconds 0.2))
(let ((f30-0 (get-rand-float-range self 0.9 1.1)))
(let ((f30-0 (rnd-float-range self 0.9 1.1)))
(ja-no-eval :group! crimson-guard-idle-to-stab-idle-ja :num! (seek! max f30-0) :frame-num 0.0)
(until (ja-done? 0)
(suspend)
@ -2571,7 +2571,7 @@
(ja :num! (seek!))
)
)
(let ((f30-1 (get-rand-float-range self 0.9 1.1)))
(let ((f30-1 (rnd-float-range self 0.9 1.1)))
(ja-channel-push! 1 (seconds 0.2))
(ja-no-eval :group! crimson-guard-stab-idle-to-idle-ja :num! (seek! max f30-1) :frame-num 0.0)
(until (ja-done? 0)
@ -2980,7 +2980,7 @@
:virtual #t
:event enemy-event-handler
:enter (behavior ()
(logior! (-> self enemy-flags) (enemy-flag actor-pause-backup))
(logior! (-> self enemy-flags) (enemy-flag lock-focus))
(set! (-> self joint-enable) #t)
(logior! (-> self focus-status) (focus-status dangerous))
(let ((v1-5 self))
@ -3024,8 +3024,8 @@
(set! (-> v1-5 state mode) (the-as lightning-mode a0-2))
)
(set! (-> self joint-enable) #f)
(logclear! (-> self enemy-flags) (enemy-flag actor-pause-backup))
(if (logtest? (-> self enemy-flags) (enemy-flag check-water))
(logclear! (-> self enemy-flags) (enemy-flag lock-focus))
(if (logtest? (-> self enemy-flags) (enemy-flag dangerous-backup))
(logior! (-> self focus-status) (focus-status dangerous))
(logclear! (-> self focus-status) (focus-status dangerous))
)
@ -3072,7 +3072,7 @@
(if (< (the-as degrees f0-6) 0.0)
(set! f30-0 (- f30-0))
)
(if (logtest? (enemy-flag dislike-combo) (-> self enemy-flags))
(if (logtest? (enemy-flag drawn-mirrored) (-> self enemy-flags))
(set! f0-6 (- (the-as degrees f0-6)))
)
(cond
@ -3586,7 +3586,9 @@
(ja :num! (loop! f30-0))
)
)
(set! (-> self enemy-flags) (the-as enemy-flag (logclear (-> self enemy-flags) (enemy-flag vulnerable))))
(set! (-> self enemy-flags)
(the-as enemy-flag (logclear (-> self enemy-flags) (enemy-flag jump-check-blocked)))
)
(send-event self 'jump 0 (-> self event-param-point))
(until #f
(suspend)
@ -3794,7 +3796,7 @@
(set! (-> this fact pickup-amount) 10.0)
(set! (-> this fact pickup-spawn-amount) 1.0)
(set! (-> this traffic-target-status handle) (the-as handle #f))
(let ((v1-24 (get-rand-int this 2)))
(let ((v1-24 (rnd-int-count this 2)))
(cond
((zero? v1-24)
(set! (-> this anim-shoot 0 anim-index) 19)

View File

@ -201,7 +201,7 @@
)
)
(defmethod enemy-method-77 ((this metalhead-flitter) (arg0 (pointer float)))
(defmethod enemy-method-77 ((this metalhead-flitter) (arg0 enemy-knocked-info))
(case (-> this incoming knocked-type)
(((knocked-type knocked-type-4))
(let ((a0-2 (-> this skel root-channel 0)))
@ -209,7 +209,7 @@
(set! (-> a0-2 param 0)
(the float (+ (-> (the-as art-joint-anim (-> this draw art-group data 20)) frames num-frames) -1))
)
(set! (-> a0-2 param 1) (-> arg0 0))
(set! (-> a0-2 param 1) (-> arg0 anim-speed))
(set! (-> a0-2 frame-num) 0.0)
(joint-control-channel-group! a0-2 (the-as art-joint-anim (-> this draw art-group data 20)) num-func-seek!)
)
@ -243,7 +243,7 @@
)
)
(defmethod enemy-method-78 ((this metalhead-flitter) (arg0 (pointer float)))
(defmethod enemy-method-78 ((this metalhead-flitter) (arg0 enemy-knocked-info))
(case (-> this incoming knocked-type)
(((knocked-type knocked-type-6))
(when (>= (-> this incoming blue-juggle-count) (the-as uint 2))
@ -275,8 +275,8 @@
(defstate ambush (metalhead-flitter)
:virtual #t
:enter (behavior ()
(when (logtest? (-> self enemy-flags) (enemy-flag auto-reset-penetrate))
(logclear! (-> self enemy-flags) (enemy-flag auto-reset-penetrate))
(when (logtest? (-> self enemy-flags) (enemy-flag enable-on-notice))
(logclear! (-> self enemy-flags) (enemy-flag enable-on-notice))
(let ((gp-0 (-> self on-notice)))
(if gp-0
(script-eval gp-0 :vector (-> self root trans))
@ -390,7 +390,7 @@
(+! (-> self root trans y) -8192.0)
(logior! (-> self draw status) (draw-control-status no-draw))
(let ((gp-3 (current-time)))
(until (time-elapsed? gp-3 (the int (* 300.0 (get-rand-float-range self 0.0 0.6))))
(until (time-elapsed? gp-3 (the int (* 300.0 (rnd-float-range self 0.0 0.6))))
(suspend)
)
)
@ -415,11 +415,11 @@
(set! (-> v1-3 enemy-flags) (the-as enemy-flag (logior (enemy-flag enemy-flag37) (-> v1-3 enemy-flags))))
)
0
(look-at-target! self (enemy-flag lock-focus))
(look-at-target! self (enemy-flag look-at-focus))
(set-time! (-> self state-time))
(let ((gp-0 (-> self root)))
(vector-reset! (-> gp-0 transv))
(set! (-> gp-0 transv y) (* 4096.0 (get-rand-float-range self 34.0 38.0)))
(set! (-> gp-0 transv y) (* 4096.0 (rnd-float-range self 34.0 38.0)))
)
)
:code (behavior ()
@ -642,7 +642,7 @@
:virtual #t
:code (behavior ()
(ja-channel-push! 1 (seconds 0.1))
(let ((f30-0 (get-rand-float-range self 0.8 1.2)))
(let ((f30-0 (rnd-float-range self 0.8 1.2)))
(until #f
(when (not (enemy-method-96 self 2730.6667 #t))
(let ((v1-5 self))
@ -776,7 +776,7 @@
)
:exit (behavior ()
(metalhead-flitter-method-208 self #f)
(if (logtest? (-> self enemy-flags) (enemy-flag check-water))
(if (logtest? (-> self enemy-flags) (enemy-flag dangerous-backup))
(logior! (-> self focus-status) (focus-status dangerous))
(logclear! (-> self focus-status) (focus-status dangerous))
)
@ -846,11 +846,11 @@
0
(ja-channel-push! 1 (seconds 0.1))
(metalhead-flitter-method-208 self #f)
(if (logtest? (-> self enemy-flags) (enemy-flag check-water))
(if (logtest? (-> self enemy-flags) (enemy-flag dangerous-backup))
(logior! (-> self focus-status) (focus-status dangerous))
(logclear! (-> self focus-status) (focus-status dangerous))
)
(dotimes (gp-1 (get-rand-int self 3))
(dotimes (gp-1 (rnd-int-count self 3))
(ja-no-eval :group! flitter-idle-ja :num! (seek!) :frame-num 0.0)
(until (ja-done? 0)
(suspend)
@ -874,7 +874,7 @@
:virtual #t
:code (behavior ()
(ja-channel-push! 1 (seconds 0.1))
(let ((f30-0 (get-rand-float-range self 0.8 1.2)))
(let ((f30-0 (rnd-float-range self 0.8 1.2)))
(until #f
(when (not (enemy-method-96 self 2730.6667 #t))
(let ((v1-5 self))
@ -984,12 +984,12 @@
(ja-channel-push! 1 (seconds 0.2))
(until #f
(ja-no-eval :group! (-> self draw art-group data (-> self enemy-info run-anim))
:num! (seek! max (get-rand-float-range self 0.9 1.1))
:num! (seek! max (rnd-float-range self 0.9 1.1))
:frame-num 0.0
)
(until (ja-done? 0)
(suspend)
(ja :num! (seek! max (get-rand-float-range self 0.9 1.1)))
(ja :num! (seek! max (rnd-float-range self 0.9 1.1)))
)
)
#f

View File

@ -259,15 +259,15 @@
(('hit 'hit-knocked)
(logclear! (-> this mask) (process-mask actor-pause))
(logclear! (-> this focus-status) (focus-status dangerous))
(logclear! (-> this enemy-flags) (enemy-flag enable-on-notice))
(logior! (-> this enemy-flags) (enemy-flag chase-startup))
(logclear! (-> this enemy-flags) (enemy-flag use-notice-distance))
(logior! (-> this enemy-flags) (enemy-flag alert))
(logior! (-> this focus-status) (focus-status hit))
(if (zero? (-> this hit-points))
(logior! (-> this focus-status) (focus-status dead))
)
(logclear! (-> this enemy-flags) (enemy-flag actor-pause-backup))
(logclear! (-> this enemy-flags) (enemy-flag lock-focus))
(enemy-method-62 this)
(logior! (-> this enemy-flags) (enemy-flag actor-pause-backup))
(logior! (-> this enemy-flags) (enemy-flag lock-focus))
(process-contact-action arg0)
(send-event arg0 'get-attack-count 1)
(cond
@ -280,7 +280,7 @@
)
)
)
(zero? (get-rand-int this 3))
(zero? (rnd-int-count this 3))
(let ((f0-0 (vector-vector-distance-squared (-> this root trans) (target-pos 0)))
(f1-0 32768.0)
)
@ -330,8 +330,8 @@
:virtual #t
:event enemy-event-handler
:enter (behavior ()
(when (logtest? (-> self enemy-flags) (enemy-flag auto-reset-penetrate))
(logclear! (-> self enemy-flags) (enemy-flag auto-reset-penetrate))
(when (logtest? (-> self enemy-flags) (enemy-flag enable-on-notice))
(logclear! (-> self enemy-flags) (enemy-flag enable-on-notice))
(let ((gp-0 (-> self on-notice)))
(if gp-0
(script-eval gp-0 :vector (-> self root trans))
@ -405,7 +405,9 @@
(until #f
(let ((gp-0 (new 'stack-no-clear 'vector)))
(get-point-in-path! (-> self intro-path) gp-0 1.0 'interp)
(set! (-> self enemy-flags) (the-as enemy-flag (logclear (-> self enemy-flags) (enemy-flag vulnerable))))
(set! (-> self enemy-flags)
(the-as enemy-flag (logclear (-> self enemy-flags) (enemy-flag jump-check-blocked)))
)
(let ((a1-1 (new 'stack-no-clear 'event-message-block)))
(let ((v1-5 (process->ppointer self)))
(set! (-> a1-1 from) v1-5)
@ -438,7 +440,9 @@
(until #f
(let ((gp-0 (new 'stack-no-clear 'vector)))
(get-point-in-path! (-> self intro-path) gp-0 (the float (-> self jumping-ambush-path-pt)) 'interp)
(set! (-> self enemy-flags) (the-as enemy-flag (logclear (-> self enemy-flags) (enemy-flag vulnerable))))
(set! (-> self enemy-flags)
(the-as enemy-flag (logclear (-> self enemy-flags) (enemy-flag jump-check-blocked)))
)
(let ((a1-1 (new 'stack-no-clear 'event-message-block)))
(let ((v1-9 (process->ppointer self)))
(set! (-> a1-1 from) v1-9)
@ -474,15 +478,15 @@
)
)
)
(let ((f30-0 (get-rand-float-range self 0.9 1.1)))
(let ((f30-0 (rnd-float-range self 0.9 1.1)))
(until #f
(set! (-> self patrol-anim) (-> *grunt-global-info* patrol-anim (get-rand-int self 4)))
(set! (-> self patrol-anim) (-> *grunt-global-info* patrol-anim (rnd-int-count self 4)))
(let ((v1-28 (-> self nav)))
(set! (-> v1-28 target-speed) (-> self patrol-anim travel-speed))
)
0
(let ((gp-0 (-> self draw art-group data (-> self patrol-anim anim-index)))
(s5-0 (get-rand-int-range self 1 8))
(s5-0 (rnd-int-range self 1 8))
)
(let ((v1-37 (ja-group)))
(if (not (and v1-37 (= v1-37 gp-0)))
@ -506,7 +510,7 @@
)
0
(let ((gp-1 (-> self draw art-group data (-> self patrol-anim anim-index)))
(s5-1 (get-rand-int-range self 2 5))
(s5-1 (rnd-int-range self 2 5))
)
(ja-no-eval :group! gp-1 :num! (seek! max f30-0) :frame-num 0.0)
(until (ja-done? 0)
@ -523,7 +527,7 @@
)
)
)
(when (zero? (get-rand-int self 3))
(when (zero? (rnd-int-count self 3))
(let ((v1-107 self))
(set! (-> v1-107 enemy-flags)
(the-as enemy-flag (logclear (-> v1-107 enemy-flags) (enemy-flag enemy-flag36)))
@ -541,7 +545,7 @@
(suspend)
(ja :num! (seek! max f30-0))
)
(until (not (enemy-method-123 self 0.2))
(until (not (rnd-go-idle? self 0.2))
(ja-no-eval :group! (-> self draw art-group data (-> self enemy-info idle-anim))
:num! (seek! max f30-0)
:frame-num 0.0
@ -636,7 +640,7 @@
)
)
(sound-play "grunt-warn")
(set! (-> self next-warn-time) (+ gp-0 (get-rand-int-range self 300 360)))
(set! (-> self next-warn-time) (+ gp-0 (rnd-int-range self 300 360)))
)
)
)
@ -655,7 +659,7 @@
)
)
)
(let ((f30-0 (get-rand-float-range self 0.9 1.1)))
(let ((f30-0 (rnd-float-range self 0.9 1.1)))
(let ((v1-19 (-> self use-charge-anim-index)))
(cond
((>= v1-19 0)
@ -663,7 +667,7 @@
(set! (-> self use-charge-anim-index) -1)
)
(else
(set! (-> self charge-anim) (-> *grunt-global-info* charge-anim (get-rand-int self 3)))
(set! (-> self charge-anim) (-> *grunt-global-info* charge-anim (rnd-int-count self 3)))
)
)
)
@ -700,7 +704,7 @@
(set! (-> v1-1 speed) (-> self enemy-info run-travel-speed))
)
0
(logior! (-> self enemy-flags) (enemy-flag actor-pause-backup))
(logior! (-> self enemy-flags) (enemy-flag lock-focus))
(logior! (-> self focus-status) (focus-status dangerous))
(set! (-> self root penetrate-using) (penetrate generic-attack lunge))
(enemy-method-49 self)
@ -723,21 +727,21 @@
)
(t9-0 a0-0)
)
(logclear! (-> self enemy-flags) (enemy-flag actor-pause-backup))
(if (logtest? (-> self enemy-flags) (enemy-flag check-water))
(logclear! (-> self enemy-flags) (enemy-flag lock-focus))
(if (logtest? (-> self enemy-flags) (enemy-flag dangerous-backup))
(logior! (-> self focus-status) (focus-status dangerous))
(logclear! (-> self focus-status) (focus-status dangerous))
)
)
:trans (behavior ()
(enemy-method-49 self)
(when (logtest? (-> self enemy-flags) (enemy-flag look-at-focus))
(logclear! (-> self enemy-flags) (enemy-flag look-at-focus))
(when (logtest? (-> self enemy-flags) (enemy-flag victory))
(logclear! (-> self enemy-flags) (enemy-flag victory))
(sound-play "grunt-hit")
)
)
:code (behavior ()
(set! (-> self attack-anim) (-> *grunt-global-info* attack-anim (get-rand-int self 2)))
(set! (-> self attack-anim) (-> *grunt-global-info* attack-anim (rnd-int-count self 2)))
(let ((v1-5 (-> self nav)))
(set! (-> v1-5 target-speed) (-> self attack-anim travel-speed))
)
@ -747,7 +751,7 @@
)
0
(let ((gp-0 (-> self draw art-group data (-> self attack-anim anim-index)))
(f30-0 (get-rand-float-range self 0.9 1.1))
(f30-0 (rnd-float-range self 0.9 1.1))
)
(let ((v1-17 (ja-group)))
(if (not (and v1-17 (= v1-17 gp-0)))
@ -802,7 +806,7 @@
:virtual #t
:event enemy-event-handler
:enter (behavior ()
(logior! (-> self enemy-flags) (enemy-flag actor-pause-backup))
(logior! (-> self enemy-flags) (enemy-flag lock-focus))
(let ((v1-2 self))
(set! (-> v1-2 enemy-flags) (the-as enemy-flag (logclear (-> v1-2 enemy-flags) (enemy-flag enemy-flag36))))
(set! (-> v1-2 nav callback-info) *nav-enemy-null-callback-info*)
@ -839,22 +843,22 @@
)
(t9-0 a0-0)
)
(logclear! (-> self enemy-flags) (enemy-flag actor-pause-backup))
(if (logtest? (-> self enemy-flags) (enemy-flag check-water))
(logclear! (-> self enemy-flags) (enemy-flag lock-focus))
(if (logtest? (-> self enemy-flags) (enemy-flag dangerous-backup))
(logior! (-> self focus-status) (focus-status dangerous))
(logclear! (-> self focus-status) (focus-status dangerous))
)
)
:trans (behavior ()
(when (logtest? (-> self enemy-flags) (enemy-flag look-at-focus))
(logclear! (-> self enemy-flags) (enemy-flag look-at-focus))
(when (logtest? (-> self enemy-flags) (enemy-flag victory))
(logclear! (-> self enemy-flags) (enemy-flag victory))
(sound-play "grunt-hit")
)
)
:code (behavior ()
(set! (-> self attack-anim) (-> *grunt-global-info* attack-anim (get-rand-int self 2)))
(set! (-> self attack-anim) (-> *grunt-global-info* attack-anim (rnd-int-count self 2)))
(let ((gp-0 (-> self draw art-group data (-> self attack-anim anim-index)))
(f30-0 (get-rand-float-range self 0.9 1.1))
(f30-0 (rnd-float-range self 0.9 1.1))
)
(let ((v1-13 (ja-group)))
(if (not (and v1-13 (= v1-13 gp-0)))
@ -891,12 +895,12 @@
(suspend)
(ja-eval)
)
(set! (-> self patrol-anim) (-> *grunt-global-info* patrol-anim (get-rand-int self 4)))
(set! (-> self patrol-anim) (-> *grunt-global-info* patrol-anim (rnd-int-count self 4)))
(let ((v1-14 (-> self nav)))
(set! (-> v1-14 target-speed) (-> self patrol-anim travel-speed))
)
0
(let ((f30-0 (get-rand-float-range self 0.9 1.1))
(let ((f30-0 (rnd-float-range self 0.9 1.1))
(gp-0 (-> self draw art-group data (-> self patrol-anim anim-index)))
)
(let ((v1-24 (ja-group)))
@ -916,7 +920,7 @@
)
)
(defmethod enemy-method-77 ((this metalhead-grunt) (arg0 (pointer float)))
(defmethod enemy-method-77 ((this metalhead-grunt) (arg0 enemy-knocked-info))
(local-vars (v1-72 int) (a2-3 int) (a2-5 int))
(case (-> this incoming knocked-type)
(((knocked-type knocked-type-4))
@ -936,10 +940,10 @@
(set! a2-3 (logior v1-2 8))
)
)
(let ((s4-0 (enemy-method-120 this 4 a2-3)))
(let ((s4-0 (rnd-bit this 4 a2-3)))
(set! (-> *grunt-global-info* prev-yellow-hit-anim-index) s4-0)
(set! (-> this yellow-hit-anim) (-> *grunt-global-info* yellow-hit-anim s4-0))
(let ((v1-11 (get-rand-int this 3)))
(let ((v1-11 (rnd-int-count this 3)))
(if (= s4-0 3)
(set! v1-11 2)
)
@ -951,7 +955,7 @@
(let ((a0-19 (-> this skel root-channel 0)))
(set! (-> a0-19 frame-group) (the-as art-joint-anim s4-1))
(set! (-> a0-19 param 0) (the float (+ (-> (the-as art-joint-anim s4-1) frames num-frames) -1)))
(set! (-> a0-19 param 1) (-> arg0 0))
(set! (-> a0-19 param 1) (-> arg0 anim-speed))
(set! (-> a0-19 frame-num) 0.0)
(joint-control-channel-group! a0-19 (the-as art-joint-anim s4-1) num-func-seek!)
)
@ -998,7 +1002,7 @@
(set! a2-5 (logior v1-42 7))
)
)
(let ((v1-46 (enemy-method-120 this 6 a2-5)))
(let ((v1-46 (rnd-bit this 6 a2-5)))
(set! (-> *grunt-global-info* prev-blue-hit-anim-index) v1-46)
(set! (-> this blue-hit-anim) (-> *grunt-global-info* blue-hit-anim v1-46))
)
@ -1009,7 +1013,7 @@
(set! a2-6 (logior a2-6 4))
)
)
(set! (-> this use-charge-anim-index) (enemy-method-120 this 3 a2-6))
(set! (-> this use-charge-anim-index) (rnd-bit this 3 a2-6))
)
)
(let ((a1-26 (-> this draw art-group data (-> this blue-hit-anim anim-index)))
@ -1017,7 +1021,7 @@
)
(set! (-> a0-51 frame-group) (the-as art-joint-anim a1-26))
(set! (-> a0-51 param 0) (the float (+ (-> (the-as art-joint-anim a1-26) frames num-frames) -1)))
(set! (-> a0-51 param 1) (-> arg0 0))
(set! (-> a0-51 param 1) (-> arg0 anim-speed))
(set! (-> a0-51 frame-num) 0.0)
(joint-control-channel-group! a0-51 (the-as art-joint-anim a1-26) num-func-seek!)
)
@ -1038,7 +1042,7 @@
(set! s4-3 (logior s4-3 4))
)
)
(set! v1-72 (enemy-method-120 this 3 s4-3))
(set! v1-72 (rnd-bit this 3 s4-3))
)
)
)
@ -1050,7 +1054,7 @@
(let ((a0-68 (-> this skel root-channel 0)))
(set! (-> a0-68 frame-group) (the-as art-joint-anim s4-4))
(set! (-> a0-68 param 0) (the float (+ (-> (the-as art-joint-anim s4-4) frames num-frames) -1)))
(set! (-> a0-68 param 1) (-> arg0 0))
(set! (-> a0-68 param 1) (-> arg0 anim-speed))
(set! (-> a0-68 frame-num) 0.0)
(joint-control-channel-group! a0-68 (the-as art-joint-anim s4-4) num-func-seek!)
)
@ -1060,7 +1064,7 @@
)
)
(defmethod enemy-method-78 ((this metalhead-grunt) (arg0 (pointer float)))
(defmethod enemy-method-78 ((this metalhead-grunt) (arg0 enemy-knocked-info))
(cond
((= (-> this incoming knocked-type) (knocked-type knocked-type-6))
(when (or (logtest? (-> this grunt-flags) 2) (let ((v1-7 (if (> (-> this skel active-channels) 0)
@ -1082,7 +1086,7 @@
(let ((a0-16 (-> this skel root-channel 0)))
(set! (-> a0-16 frame-group) (the-as art-joint-anim s4-0))
(set! (-> a0-16 param 0) (the float (+ (-> (the-as art-joint-anim s4-0) frames num-frames) -1)))
(set! (-> a0-16 param 1) (-> arg0 0))
(set! (-> a0-16 param 1) (-> arg0 anim-speed))
(set! (-> a0-16 frame-num) 0.0)
(joint-control-channel-group! a0-16 (the-as art-joint-anim s4-0) num-func-seek!)
)
@ -1103,7 +1107,7 @@
)
(set! (-> a0-23 frame-group) (the-as art-joint-anim a1-6))
(set! (-> a0-23 param 0) (the float (+ (-> (the-as art-joint-anim a1-6) frames num-frames) -1)))
(set! (-> a0-23 param 1) (-> arg0 0))
(set! (-> a0-23 param 1) (-> arg0 anim-speed))
(set! (-> a0-23 frame-num) 0.0)
(joint-control-channel-group! a0-23 (the-as art-joint-anim a1-6) num-func-seek!)
)
@ -1120,7 +1124,7 @@
(let ((s5-0 (handle->process (-> self focus handle))))
(when s5-0
(let ((gp-0 (get-trans (the-as process-focusable s5-0) 0)))
(when (and (or (not (logtest? (-> self enemy-flags) (enemy-flag enable-on-notice)))
(when (and (or (not (logtest? (-> self enemy-flags) (enemy-flag use-notice-distance)))
(>= 163840.0 (vector-vector-distance (-> self root trans) gp-0))
)
(or (not (logtest? (-> self fact enemy-options) (enemy-option user8)))
@ -1131,7 +1135,7 @@
)
(cond
((and (logtest? (-> self fact enemy-options) (enemy-option user9))
(logtest? (-> self enemy-flags) (enemy-flag enable-on-notice))
(logtest? (-> self enemy-flags) (enemy-flag use-notice-distance))
)
(let ((s5-1 (new 'stack-no-clear 'vector)))
(vector-! s5-1 gp-0 (-> self root trans))
@ -1292,15 +1296,15 @@
0
(set-gravity-length (-> this root dynam) 573440.0)
(let ((s5-2 *grunt-global-info*))
(set! (-> this patrol-anim) (-> s5-2 patrol-anim (get-rand-int this 4)))
(set! (-> this charge-anim) (-> s5-2 charge-anim (get-rand-int this 3)))
(set! (-> this attack-anim) (-> s5-2 attack-anim (get-rand-int this 2)))
(set! (-> this patrol-anim) (-> s5-2 patrol-anim (rnd-int-count this 4)))
(set! (-> this charge-anim) (-> s5-2 charge-anim (rnd-int-count this 3)))
(set! (-> this attack-anim) (-> s5-2 attack-anim (rnd-int-count this 2)))
)
(set! (-> this use-charge-anim-index) -1)
(if (zero? (get-rand-int this 2))
(if (zero? (rnd-int-count this 2))
(logior! (-> this grunt-flags) 1)
)
(if (zero? (get-rand-int this 2))
(if (zero? (rnd-int-count this 2))
(logior! (-> this grunt-flags) 4)
)
(set! (-> this intro-path) (new 'process 'path-control this 'intro 0.0 (the-as entity #f) #t))

View File

@ -378,12 +378,12 @@
(none)
)
(defmethod track-target! ((this metalhead-predator))
(defmethod common-post ((this metalhead-predator))
"Does a lot of various things relating to interacting with the target
- tracks when the enemy was last drawn
- looks at the target and handles attacking
@TODO Not extremely well understood yet"
(let ((t9-0 (method-of-type citizen-enemy track-target!)))
(let ((t9-0 (method-of-type citizen-enemy common-post)))
(t9-0 this)
)
(metalhead-predator-method-208 this)
@ -403,7 +403,7 @@
)
(('combo)
(and (not (and (-> this next-state) (= (-> this next-state name) 'inactive)))
(and (not (logtest? (enemy-flag multi-focus) (-> this enemy-flags))) (nonzero? (-> this hit-points)))
(and (not (logtest? (enemy-flag dislike-combo) (-> this enemy-flags))) (nonzero? (-> this hit-points)))
)
)
(else
@ -412,7 +412,7 @@
)
)
(defmethod enemy-method-77 ((this metalhead-predator) (arg0 (pointer float)))
(defmethod enemy-method-77 ((this metalhead-predator) (arg0 enemy-knocked-info))
(cond
((zero? (-> this hit-points))
(case (-> this incoming knocked-type)
@ -423,7 +423,7 @@
(set! (-> a0-3 param 0)
(the float (+ (-> (the-as art-joint-anim (-> this draw art-group data 18)) frames num-frames) -1))
)
(set! (-> a0-3 param 1) (-> arg0 0))
(set! (-> a0-3 param 1) (-> arg0 anim-speed))
(set! (-> a0-3 frame-num) 0.0)
(joint-control-channel-group! a0-3 (the-as art-joint-anim (-> this draw art-group data 18)) num-func-seek!)
)
@ -435,7 +435,7 @@
(set! (-> a0-5 param 0)
(the float (+ (-> (the-as art-joint-anim (-> this draw art-group data 14)) frames num-frames) -1))
)
(set! (-> a0-5 param 1) (-> arg0 0))
(set! (-> a0-5 param 1) (-> arg0 anim-speed))
(set! (-> a0-5 frame-num) 0.0)
(joint-control-channel-group! a0-5 (the-as art-joint-anim (-> this draw art-group data 14)) num-func-seek!)
)
@ -447,7 +447,7 @@
(case (-> this incoming knocked-type)
(((knocked-type knocked-type-6))
(ja-channel-push! 1 (seconds 0.01))
(let ((v1-32 (get-rand-int this 2)))
(let ((v1-32 (rnd-int-count this 2)))
(cond
((zero? v1-32)
(let ((a0-10 (-> this skel root-channel 0)))
@ -455,7 +455,7 @@
(set! (-> a0-10 param 0)
(the float (+ (-> (the-as art-joint-anim (-> this draw art-group data 21)) frames num-frames) -1))
)
(set! (-> a0-10 param 1) (-> arg0 0))
(set! (-> a0-10 param 1) (-> arg0 anim-speed))
(set! (-> a0-10 frame-num) 0.0)
(joint-control-channel-group! a0-10 (the-as art-joint-anim (-> this draw art-group data 21)) num-func-seek!)
)
@ -466,7 +466,7 @@
(set! (-> a0-12 param 0)
(the float (+ (-> (the-as art-joint-anim (-> this draw art-group data 22)) frames num-frames) -1))
)
(set! (-> a0-12 param 1) (-> arg0 0))
(set! (-> a0-12 param 1) (-> arg0 anim-speed))
(set! (-> a0-12 frame-num) 0.0)
(joint-control-channel-group! a0-12 (the-as art-joint-anim (-> this draw art-group data 22)) num-func-seek!)
)
@ -481,7 +481,7 @@
(set! (-> a0-15 param 0)
(the float (+ (-> (the-as art-joint-anim (-> this draw art-group data 18)) frames num-frames) -1))
)
(set! (-> a0-15 param 1) (-> arg0 0))
(set! (-> a0-15 param 1) (-> arg0 anim-speed))
(set! (-> a0-15 frame-num) 0.0)
(joint-control-channel-group! a0-15 (the-as art-joint-anim (-> this draw art-group data 18)) num-func-seek!)
)
@ -493,7 +493,7 @@
(set! (-> a0-17 param 0)
(the float (+ (-> (the-as art-joint-anim (-> this draw art-group data 12)) frames num-frames) -1))
)
(set! (-> a0-17 param 1) (-> arg0 0))
(set! (-> a0-17 param 1) (-> arg0 anim-speed))
(set! (-> a0-17 frame-num) 0.0)
(joint-control-channel-group! a0-17 (the-as art-joint-anim (-> this draw art-group data 12)) num-func-seek!)
)
@ -504,7 +504,7 @@
)
)
(defmethod enemy-method-78 ((this metalhead-predator) (arg0 (pointer float)))
(defmethod enemy-method-78 ((this metalhead-predator) (arg0 enemy-knocked-info))
(cond
((zero? (-> this hit-points))
(case (-> this incoming knocked-type)
@ -515,7 +515,7 @@
(set! (-> a0-3 param 0)
(the float (+ (-> (the-as art-joint-anim (-> this draw art-group data 20)) frames num-frames) -1))
)
(set! (-> a0-3 param 1) (-> arg0 0))
(set! (-> a0-3 param 1) (-> arg0 anim-speed))
(set! (-> a0-3 frame-num) 0.0)
(joint-control-channel-group! a0-3 (the-as art-joint-anim (-> this draw art-group data 20)) num-func-seek!)
)
@ -527,7 +527,7 @@
(set! (-> a0-5 param 0)
(the float (+ (-> (the-as art-joint-anim (-> this draw art-group data 15)) frames num-frames) -1))
)
(set! (-> a0-5 param 1) (-> arg0 0))
(set! (-> a0-5 param 1) (-> arg0 anim-speed))
(set! (-> a0-5 frame-num) 0.0)
(joint-control-channel-group! a0-5 (the-as art-joint-anim (-> this draw art-group data 15)) num-func-seek!)
)
@ -544,7 +544,7 @@
(set! (-> a0-8 param 0)
(the float (+ (-> (the-as art-joint-anim (-> this draw art-group data 23)) frames num-frames) -1))
)
(set! (-> a0-8 param 1) (-> arg0 0))
(set! (-> a0-8 param 1) (-> arg0 anim-speed))
(set! (-> a0-8 frame-num) 0.0)
(joint-control-channel-group! a0-8 (the-as art-joint-anim (-> this draw art-group data 23)) num-func-seek!)
)
@ -556,7 +556,7 @@
(set! (-> a0-11 param 0)
(the float (+ (-> (the-as art-joint-anim (-> this draw art-group data 19)) frames num-frames) -1))
)
(set! (-> a0-11 param 1) (-> arg0 0))
(set! (-> a0-11 param 1) (-> arg0 anim-speed))
(set! (-> a0-11 frame-num) 0.0)
(joint-control-channel-group! a0-11 (the-as art-joint-anim (-> this draw art-group data 19)) num-func-seek!)
)
@ -568,7 +568,7 @@
(set! (-> a0-13 param 0)
(the float (+ (-> (the-as art-joint-anim (-> this draw art-group data 13)) frames num-frames) -1))
)
(set! (-> a0-13 param 1) (-> arg0 0))
(set! (-> a0-13 param 1) (-> arg0 anim-speed))
(set! (-> a0-13 frame-num) 0.0)
(joint-control-channel-group! a0-13 (the-as art-joint-anim (-> this draw art-group data 13)) num-func-seek!)
)
@ -786,7 +786,7 @@
(t9-0)
)
)
(logclear! (-> self enemy-flags) (enemy-flag actor-pause-backup))
(logclear! (-> self enemy-flags) (enemy-flag lock-focus))
)
:trans (behavior ()
(let ((t9-0 (-> (method-of-type citizen-enemy active) trans)))
@ -808,7 +808,7 @@
(set! (-> self want-stop) #f)
(set-time! (-> self state-time))
(set! (-> self next-change) (the-as int (+ (current-time) (the int (* 300.0 (rand-vu-float-range 4.0 8.0))))))
(if (zero? (get-rand-int self 3))
(if (zero? (rnd-int-count self 3))
(sound-play "pred-talk")
)
)
@ -872,10 +872,10 @@
(set! (-> self attack-id) a0-1)
)
(traffic-danger-init! self)
(logior! (-> self enemy-flags) (enemy-flag actor-pause-backup))
(logior! (-> self enemy-flags) (enemy-flag lock-focus))
)
:exit (behavior ()
(if (logtest? (-> self enemy-flags) (enemy-flag check-water))
(if (logtest? (-> self enemy-flags) (enemy-flag dangerous-backup))
(logior! (-> self focus-status) (focus-status dangerous))
(logclear! (-> self focus-status) (focus-status dangerous))
)
@ -939,7 +939,7 @@
:event enemy-event-handler
:enter (behavior ()
(traffic-danger-init! self)
(logior! (-> self enemy-flags) (enemy-flag actor-pause-backup))
(logior! (-> self enemy-flags) (enemy-flag lock-focus))
(logior! (-> self focus-status) (focus-status dangerous))
(set! (-> self root penetrate-using) (penetrate generic-attack lunge))
(enemy-method-49 self)
@ -956,8 +956,8 @@
)
:exit (behavior ()
(metalhead-predator-method-205 self #f)
(logclear! (-> self enemy-flags) (enemy-flag actor-pause-backup))
(if (logtest? (-> self enemy-flags) (enemy-flag check-water))
(logclear! (-> self enemy-flags) (enemy-flag lock-focus))
(if (logtest? (-> self enemy-flags) (enemy-flag dangerous-backup))
(logior! (-> self focus-status) (focus-status dangerous))
(logclear! (-> self focus-status) (focus-status dangerous))
)
@ -987,7 +987,7 @@
(suspend)
(ja :num! (seek!))
)
(if (zero? (get-rand-int self 3))
(if (zero? (rnd-int-count self 3))
(sound-play "pred-talk")
)
(go-hostile self)

View File

@ -2669,7 +2669,7 @@ Process is recycled and moved to reserved, if it deactivates."
)
)
)
(let ((v1-42 (-> s0-0 stack 860)))
(let ((v1-42 (-> (the-as crimson-guard s0-0) guard-type)))
(when (< v1-42 (the-as uint 6))
(+! s2-0 1)
(+! (-> this alert-state guard-type-info-array v1-42 count) 1)

View File

@ -548,13 +548,15 @@
(deftype vehicle-guard (vehicle)
((ai-hook (function vehicle-guard none))
(turret turret-control :inline)
(target-flags turret-flag)
(target-flags traffic-target-flag)
(target-in-sight-time time-frame)
(minimap connection-minimap)
(vehicle-guard-pad-k1jn23k1 uint32)
(traffic-target-status traffic-target-status)
(pursuit-target handle)
(vehicle-guard-pad-1kjh2nb3k1 uint32 16)
(vehicle-guard-pad-0jkfdjslf uint32 4)
(vehicle-guard-vector0341413 vector :inline)
(vehicle-guard-pad-1kjh2nb3k1 uint32 8)
(lod2 symbol)
)
(:state-methods
@ -696,7 +698,7 @@
(set-time! (-> this target-in-sight-time))
)
)
(set! (-> this target-flags) (the-as turret-flag (-> v1-4 flags)))
(set! (-> this target-flags) (-> v1-4 flags))
)
)
(when (not (logtest? (rigid-body-object-flag in-pursuit) (-> this flags)))
@ -893,7 +895,7 @@
(none)
)
(defun vehicle-guard-choose-branch ((arg0 vehicle-controller) (arg1 vehicle))
(defun vehicle-guard-choose-branch ((arg0 vehicle-controller) (arg1 vehicle-guard))
(let ((gp-0 (the-as nav-branch #f)))
(cond
((logtest? (rigid-body-object-flag alert) (-> arg1 flags))
@ -902,7 +904,7 @@
)
(set! (-> s4-0 4 x) -10000000000000000000000000000000000000.0)
(set! (-> s4-0 3 quad) (-> arg1 root trans quad))
(vector-! (-> s4-0 0) (-> s4-0 3) (the-as vector (&-> arg1 stack 896)))
(vector-! (-> s4-0 0) (-> s4-0 3) (-> arg1 vehicle-guard-vector0341413))
(vector-normalize! (-> s4-0 0) 1.0)
(dotimes (s3-0 (-> s5-0 branch-count))
(let ((s2-0 (-> s5-0 branch-array s3-0)))
@ -1082,7 +1084,7 @@
(vehicle-method-121 this)
(vehicle-method-106 this)
(when (not (logtest? (rigid-body-object-flag in-pursuit) (-> this flags)))
(if (not (logtest? (-> this target-flags) (turret-flag aiming)))
(if (not (logtest? (-> this target-flags) (traffic-target-flag visible-recently)))
(speech-control-method-12 *speech-control* this (speech-type speech-type-2))
)
(go (method-of-object this active))

View File

@ -22,7 +22,7 @@
(set! (-> v1-7 enemy-flags) (the-as enemy-flag (logclear (-> v1-7 enemy-flags) (enemy-flag enemy-flag37))))
)
0
(look-at-target! self (enemy-flag lock-focus))
(look-at-target! self (enemy-flag look-at-focus))
(set! (-> self travel-anim-interp) 0.0)
)
:trans (behavior ()
@ -111,7 +111,7 @@
(set! (-> v1-7 enemy-flags) (the-as enemy-flag (logclear (-> v1-7 enemy-flags) (enemy-flag enemy-flag37))))
)
0
(look-at-target! self (enemy-flag lock-focus))
(look-at-target! self (enemy-flag look-at-focus))
(set! (-> self travel-anim-interp) 0.0)
(logclear! (-> self bot-flags) (bot-flags bf21))
)
@ -250,7 +250,7 @@
(set! (-> v1-7 enemy-flags) (the-as enemy-flag (logclear (-> v1-7 enemy-flags) (enemy-flag enemy-flag37))))
)
0
(look-at-target! self (enemy-flag lock-focus))
(look-at-target! self (enemy-flag look-at-focus))
(set! (-> self travel-anim-interp) 0.0)
(logclear! (-> self bot-flags) (bot-flags bf21))
)
@ -396,7 +396,7 @@
(set! (-> v1-7 enemy-flags) (the-as enemy-flag (logclear (-> v1-7 enemy-flags) (enemy-flag enemy-flag37))))
)
0
(look-at-target! self (enemy-flag lock-focus))
(look-at-target! self (enemy-flag look-at-focus))
(set! (-> self travel-anim-interp) 0.0)
)
:trans (behavior ()
@ -455,14 +455,14 @@
)
0
(nav-enemy-method-167 self)
(logior! (-> self enemy-flags) (enemy-flag actor-pause-backup))
(logior! (-> self enemy-flags) (enemy-flag lock-focus))
(if (not (handle->process (-> self focus handle)))
(react-to-focus self)
)
(set! (-> self travel-anim-interp) 0.0)
)
:exit (behavior ()
(logclear! (-> self enemy-flags) (enemy-flag actor-pause-backup))
(logclear! (-> self enemy-flags) (enemy-flag lock-focus))
)
:code (behavior ()
(bot-method-223 self #t)
@ -488,10 +488,10 @@
)
(cond
((logtest? (-> self bot-flags) (bot-flags attacked))
(logclear! (-> self enemy-flags) (enemy-flag look-at-focus))
(logclear! (-> self enemy-flags) (enemy-flag victory))
(reset-attacker! self)
)
((logtest? (-> self enemy-flags) (enemy-flag look-at-focus))
((logtest? (-> self enemy-flags) (enemy-flag victory))
(ashelin-method-245 self)
)
)
@ -659,7 +659,7 @@
)
0
(nav-enemy-method-167 self)
(if (logtest? (-> self enemy-flags) (enemy-flag check-water))
(if (logtest? (-> self enemy-flags) (enemy-flag dangerous-backup))
(logior! (-> self focus-status) (focus-status dangerous))
(logclear! (-> self focus-status) (focus-status dangerous))
)
@ -781,7 +781,7 @@
)
0
(nav-enemy-method-167 self)
(if (logtest? (-> self enemy-flags) (enemy-flag check-water))
(if (logtest? (-> self enemy-flags) (enemy-flag dangerous-backup))
(logior! (-> self focus-status) (focus-status dangerous))
(logclear! (-> self focus-status) (focus-status dangerous))
)
@ -903,7 +903,7 @@
)
0
(nav-enemy-method-167 self)
(if (logtest? (-> self enemy-flags) (enemy-flag check-water))
(if (logtest? (-> self enemy-flags) (enemy-flag dangerous-backup))
(logior! (-> self focus-status) (focus-status dangerous))
(logclear! (-> self focus-status) (focus-status dangerous))
)
@ -941,29 +941,29 @@
)
:code (behavior ()
(local-vars (v1-7 enemy-flag) (v1-15 enemy-flag))
(if (logtest? (-> self enemy-flags) (enemy-flag check-water))
(if (logtest? (-> self enemy-flags) (enemy-flag dangerous-backup))
(logior! (-> self focus-status) (focus-status dangerous))
(logclear! (-> self focus-status) (focus-status dangerous))
)
(let ((v1-6 (-> self enemy-flags)))
(if (logtest? v1-6 (enemy-flag checking-water))
(set! v1-7 (logior v1-6 (enemy-flag enable-on-active)))
(set! v1-7 (logclear v1-6 (enemy-flag enable-on-active)))
(if (logtest? v1-6 (enemy-flag vulnerable-backup))
(set! v1-7 (logior v1-6 (enemy-flag vulnerable)))
(set! v1-7 (logclear v1-6 (enemy-flag vulnerable)))
)
)
(set! (-> self enemy-flags) v1-7)
(if (logtest? (-> self enemy-flags) (enemy-flag look-at-move-dest))
(if (logtest? (-> self enemy-flags) (enemy-flag attackable-backup))
(logior! (-> self mask) (process-mask collectable))
(logclear! (-> self mask) (process-mask collectable))
)
(let ((v1-14 (-> self enemy-flags)))
(if (logtest? (enemy-flag no-initial-move-to-ground) v1-14)
(set! v1-15 (logior (enemy-flag check-water-backup) v1-14))
(set! v1-15 (logclear v1-14 (enemy-flag check-water-backup)))
(if (logtest? (enemy-flag trackable-backup) v1-14)
(set! v1-15 (logior (enemy-flag trackable) v1-14))
(set! v1-15 (logclear v1-14 (enemy-flag trackable)))
)
)
(set! (-> self enemy-flags) v1-15)
(logclear! (-> self enemy-flags) (enemy-flag actor-pause-backup))
(logclear! (-> self enemy-flags) (enemy-flag lock-focus))
(logclear! (-> self focus-status) (focus-status hit))
(react-to-focus self)
)
@ -1011,7 +1011,7 @@
(set! (-> self travel-anim-interp) 0.0)
)
:code (behavior ()
(let ((v1-1 (get-rand-int self 3)))
(let ((v1-1 (rnd-int-count self 3)))
(cond
((zero? v1-1)
(play-death-sound self "asha057")
@ -1041,7 +1041,7 @@
)
)
)
(f30-0 (get-rand-float-range self 0.8 1.2))
(f30-0 (rnd-float-range self 0.8 1.2))
)
(ja-no-eval :group! gp-0 :num! (seek! max f30-0) :frame-num 0.0)
(until (ja-done? 0)

View File

@ -7,48 +7,46 @@
;; DECOMP BEGINS
(defmethod reset-task! asht-wait-spot ((obj asht-wait-spot))
"Virtual"
(set! (-> obj check-done) #f)
(set! (-> obj which-spot) -1)
(set! (-> obj num-spots) (the-as uint 0))
(defmethod reset-task! ((this asht-wait-spot))
(set! (-> this check-done) #f)
(set! (-> this which-spot) -1)
(set! (-> this num-spots) (the-as uint 0))
0
(none)
)
(defmethod ai-task-method-11 asht-wait-spot ((obj asht-wait-spot) (arg0 bot))
"Virtual"
(let ((s4-0 (-> obj which-spot)))
(defmethod ai-task-method-11 ((this asht-wait-spot) (arg0 bot))
(let ((s4-0 (-> this which-spot)))
(when (>= s4-0 0)
(let ((s3-0 (-> arg0 course spots (-> obj spot-indexes s4-0))))
(let ((s3-0 (-> arg0 course spots (-> this spot-indexes s4-0))))
(if (and (not (outside-spot-radius? arg0 s3-0 (the-as vector #f) #f)) (player-blocking-spot? arg0 s3-0))
(set! s4-0 -1)
)
)
)
(when (< s4-0 0)
(set! s4-0 (choose-spot arg0 (the-as int (-> obj num-spots)) (the-as (pointer uint) (-> obj spot-indexes))))
(set! (-> obj which-spot) s4-0)
(set! s4-0 (choose-spot arg0 (the-as int (-> this num-spots)) (the-as (pointer uint) (-> this spot-indexes))))
(set! (-> this which-spot) s4-0)
(mem-copy!
(the-as pointer (-> arg0 spot))
(the-as pointer (-> arg0 course spots (-> obj spot-indexes s4-0)))
(the-as pointer (-> arg0 course spots (-> this spot-indexes s4-0)))
20
)
)
(if (logtest? *display-bot-marks* (bot-marks-controls bmc16))
(bot-debug-draw-spot-sphere
arg0
(the-as int (-> obj num-spots))
(the-as (pointer uint) (-> obj spot-indexes))
(the-as int (-> obj spot-indexes s4-0))
(the-as int (-> this num-spots))
(the-as (pointer uint) (-> this spot-indexes))
(the-as int (-> this spot-indexes s4-0))
)
)
)
(when (not ((-> obj check-done) obj (the-as ashelin arg0)))
(when (not ((-> this check-done) this (the-as ashelin arg0)))
(let ((a1-10 (handle->process (-> arg0 focus handle))))
(when (and a1-10
(attacked-by-player? arg0 (the-as process-focusable a1-10))
(zero? (logand (-> arg0 focus-status) (focus-status grabbed)))
(not (logtest? (-> arg0 focus-status) (focus-status grabbed)))
)
(get-task-by-type (-> arg0 ai-ctrl) asht-fight-focus arg0)
(ai-task-control-method-10 (-> arg0 ai-ctrl) arg0)
@ -58,23 +56,22 @@
(none)
)
(defmethod ai-task-method-11 asht-fight-focus ((obj asht-fight-focus) (arg0 bot))
"Virtual"
;; WARN: Return type mismatch object vs none.
(defmethod ai-task-method-11 ((this asht-fight-focus) (arg0 bot))
(let ((a1-1 (handle->process (-> arg0 focus handle))))
(if (and a1-1
(attacked-by-player? arg0 (the-as process-focusable a1-1))
(zero? (logand (-> arg0 focus-status) (focus-status grabbed)))
(not (logtest? (-> arg0 focus-status) (focus-status grabbed)))
)
(logior! (-> arg0 bot-flags) (bot-flags bf00))
(ai-task-control-method-14 (-> arg0 ai-ctrl) obj arg0)
(ai-task-control-method-14 (-> arg0 ai-ctrl) this arg0)
)
)
(none)
)
;; WARN: Return type mismatch bot-flags vs none.
(defmethod ai-task-method-10 asht-fight-focus ((obj asht-fight-focus) (arg0 bot))
"Virtual"
(defmethod ai-task-method-10 ((this asht-fight-focus) (arg0 bot))
(logclear! (-> arg0 bot-flags) (bot-flags bf00))
(none)
)

View File

@ -230,7 +230,7 @@
(let* ((t9-0 (method-of-type bot bot-method-193))
(v0-0 (t9-0 this))
)
(when (and (not v0-0) (logtest? #x400000 (-> this incoming penetrate-using)))
(when (and (not v0-0) (logtest? (penetrate jak-yellow-shot) (-> this incoming penetrate-using)))
(if (logtest? (bot-flags bf22) (-> this bot-flags))
(set! v0-0 #t)
)
@ -240,8 +240,8 @@
)
)
(defmethod enemy-method-106 ((this ashelin) (arg0 process) (arg1 object) (arg2 int) (arg3 attack-info))
(let ((t9-0 (method-of-type bot enemy-method-106)))
(defmethod set-incoming-attack-info ((this ashelin) (arg0 process) (arg1 object) (arg2 penetrate) (arg3 attack-info))
(let ((t9-0 (method-of-type bot set-incoming-attack-info)))
(t9-0 this arg0 arg1 arg2 arg3)
)
(if (!= (-> this incoming knocked-type) (knocked-type knocked-type-6))
@ -431,7 +431,7 @@
(defmethod init-enemy! ((this ashelin))
"Common method called to initialize the enemy, typically sets up default field values and calls ancillary helper methods"
(init! this)
(set! (-> this channel) (the-as uint 22))
(set! (-> this channel) (gui-channel ashelin))
(set! (-> this travel-anim-interp) 0.0)
(set! (-> this focus-info max-los-dist) 204800.0)
(set! (-> this hit-invuln-ignore-me-delay) (the-as uint 0))
@ -541,7 +541,7 @@
)
(cond
((or (>= 8192.0 (fabs f0-5)) (>= (fabs f0-5) 24576.0))
(let ((s3-1 (zero? (get-rand-int this 2)))
(let ((s3-1 (zero? (rnd-int-count this 2)))
(s4-0 (new 'stack-no-clear 'vector))
)
(countdown (s2-0 2)
@ -582,7 +582,7 @@
(defmethod ashelin-method-242 ((this ashelin))
(let ((s5-0 0))
(cond
((zero? (get-rand-int this 2))
((zero? (rnd-int-count this 2))
(when (>= 16384.0 (fabs (-> this focus-info ry-diff)))
(let ((s4-0 (new 'stack-no-clear 'vector)))
(when (ashelin-method-236 this s4-0 (+ 16384.0 (-> this focus-info bullseye-ry)) 8192.0 40707.93 34563.93)
@ -917,7 +917,7 @@
(set! v1-36 (-> this draw art-group data 7))
(set! f28-0 (the float (sar (shl (the int (+ 32768.0 f30-0)) 48) 48)))
)
((zero? (get-rand-int this 3))
((zero? (rnd-int-count this 3))
(set! v1-36 (-> this draw art-group data 10))
)
(else
@ -935,7 +935,7 @@
)
)
(defmethod enemy-method-77 ((this ashelin) (arg0 (pointer float)))
(defmethod enemy-method-77 ((this ashelin) (arg0 enemy-knocked-info))
(local-vars (a2-0 int))
(case (-> this incoming knocked-type)
(((knocked-type knocked-type-6))
@ -957,7 +957,7 @@
)
)
)
(let* ((v1-9 (enemy-method-120 this 6 a2-0))
(let* ((v1-9 (rnd-bit this 6 a2-0))
(s5-2 (-> this draw art-group data (-> *ashelin-global-info* blue-hit-anim v1-9)))
)
(set! (-> *ashelin-global-info* prev-blue-hit) v1-9)
@ -993,7 +993,7 @@
(let ((a0-40 (-> this skel root-channel 0)))
(set! (-> a0-40 frame-group) (-> this knocked-anim))
(set! (-> a0-40 param 0) (the float (+ (-> this knocked-anim frames num-frames) -1)))
(set! (-> a0-40 param 1) (-> arg0 0))
(set! (-> a0-40 param 1) (-> arg0 anim-speed))
(set! (-> a0-40 frame-num) 0.0)
(joint-control-channel-group! a0-40 (-> this knocked-anim) num-func-seek!)
)
@ -1002,7 +1002,7 @@
)
)
(defmethod enemy-method-78 ((this ashelin) (arg0 (pointer float)))
(defmethod enemy-method-78 ((this ashelin) (arg0 enemy-knocked-info))
(case (-> this incoming knocked-type)
(((knocked-type knocked-type-6))
(let* ((v1-1 *ashelin-global-info*)
@ -1056,7 +1056,7 @@
)
)
)
((and (or (zero? (-> this hit-points)) (nonzero? (-> this fated-time))) (nonzero? (get-rand-int this 3)))
((and (or (zero? (-> this hit-points)) (nonzero? (-> this fated-time))) (nonzero? (rnd-int-count this 3)))
(ja-channel-push! 1 (seconds 0.17))
(let ((a0-20 (-> this skel root-channel 0)))
(set! (-> a0-20 frame-group) (the-as art-joint-anim (-> this draw art-group data 12)))
@ -1132,7 +1132,7 @@
(cond
((>= f0-4 22.0)
(when (focus-test? this dangerous)
(if (logtest? (-> this enemy-flags) (enemy-flag check-water))
(if (logtest? (-> this enemy-flags) (enemy-flag dangerous-backup))
(logior! (-> this focus-status) (focus-status dangerous))
(logclear! (-> this focus-status) (focus-status dangerous))
)
@ -1163,7 +1163,7 @@
(cond
((>= f0-5 32.0)
(when (focus-test? this dangerous)
(if (logtest? (-> this enemy-flags) (enemy-flag check-water))
(if (logtest? (-> this enemy-flags) (enemy-flag dangerous-backup))
(logior! (-> this focus-status) (focus-status dangerous))
(logclear! (-> this focus-status) (focus-status dangerous))
)
@ -1278,9 +1278,11 @@
(defmethod play-attacked-speech ((this ashelin))
(local-vars (v1-3 int) (a3-0 int))
(when (not (channel-active? this (the-as uint 0)))
(when (not (channel-active? this (gui-channel none)))
(let ((v1-2 0))
(if (logtest? #x3c00000 (-> this incoming penetrate-using))
(if (logtest? (penetrate jak-yellow-shot jak-red-shot jak-blue-shot jak-dark-shot)
(-> this incoming penetrate-using)
)
(set! v1-3 (logior v1-2 128))
(set! v1-3 (logior v1-2 64))
)
@ -1306,7 +1308,7 @@
)
(defmethod ashelin-method-244 ((this ashelin))
(when (not (channel-active? this (the-as uint 0)))
(when (not (channel-active? this (gui-channel none)))
(let ((a1-2 (bot-speech-list-method-9
(-> this ash-course ouch-speeches)
this
@ -1324,7 +1326,7 @@
)
(defmethod ashelin-method-245 ((this ashelin))
(when (and (not (channel-active? this (the-as uint 0))) (>= (current-time) (-> this victory-speech-time)))
(when (and (not (channel-active? this (gui-channel none))) (>= (current-time) (-> this victory-speech-time)))
(let ((s5-0 (bot-speech-list-method-9
(-> this ash-course victory-speeches)
this
@ -1334,9 +1336,7 @@
)
)
(when (>= s5-0 0)
(set! (-> this victory-speech-time)
(the-as time-frame (+ (get-rand-int-range this 1200 2100) (current-time)))
)
(set! (-> this victory-speech-time) (the-as time-frame (+ (rnd-int-range this 1200 2100) (current-time))))
(play-speech this s5-0)
)
)
@ -1346,7 +1346,7 @@
(defmethod enemy-method-136 ((this ashelin))
(when (time-elapsed? (-> this hit-focus-time) (seconds 2))
(let ((v0-0 (logclear (-> this enemy-flags) (enemy-flag look-at-focus))))
(let ((v0-0 (logclear (-> this enemy-flags) (enemy-flag victory))))
(set! (-> this enemy-flags) v0-0)
v0-0
)
@ -1358,7 +1358,7 @@
(let ((t9-0 (method-of-type bot play-speech)))
(t9-0 this arg0)
)
(logclear! (-> this enemy-flags) (enemy-flag look-at-focus))
(logclear! (-> this enemy-flags) (enemy-flag victory))
(none)
)

View File

@ -219,7 +219,7 @@
(hit-by-enemy-count uint16)
(hit-by-player-count uint16)
(notice-enemy-dist float)
(channel uint8)
(channel gui-channel)
(focus-mode int8)
(nav-mesh-index int8)
(delay-too-far-check int8)
@ -279,13 +279,13 @@
(play-speech (_type_ int) none)
(play-death-sound (_type_ string) none)
(bot-method-208 (_type_) symbol)
(channel-active? (_type_ uint) symbol)
(channel-active? (_type_ gui-channel) symbol)
(init! (_type_) none)
(clear-speech-flags! (_type_) none)
(reset-warn-time! (_type_) none)
(go-to-waypoint! (_type_ int symbol) object)
(bot-method-214 (_type_) symbol)
(skip-waypoint (_type_) none)
(skip-waypoint (_type_) object)
(bot-method-216 (_type_) none)
(speech-ended? (_type_ int) symbol)
(speech-playing? (_type_ int) symbol)
@ -588,7 +588,7 @@
)
(reset-index sp-list #f)
(if (logtest? (-> sp-list flags) 4)
(set! last-idx (+ (get-rand-int bot (-> sp-indexes length)) -1))
(set! last-idx (+ (rnd-int-count bot (-> sp-indexes length)) -1))
(set! last-idx -1)
)
)
@ -679,7 +679,7 @@
(set! history-mask 0)
)
)
(let* ((last-idx (enemy-method-120 bot (-> this speech-indexes length) history-mask))
(let* ((last-idx (rnd-bit bot (-> this speech-indexes length) history-mask))
(speech-idx (-> this speech-indexes last-idx))
(v1-47 (-> sp-info speech-idx flags))
)

View File

@ -30,7 +30,7 @@
:code (behavior ()
(local-vars (v1-37 enemy-flag) (v1-45 enemy-flag))
(ja-channel-push! 1 (seconds 0.2))
(let ((f30-0 (get-rand-float-range self 0.9 1.1)))
(let ((f30-0 (rnd-float-range self 0.9 1.1)))
(ja-no-eval :group! (-> self draw art-group data (-> self enemy-info hit-anim))
:num! (seek! max f30-0)
:frame-num 0.0
@ -40,29 +40,29 @@
(ja :num! (seek! max f30-0))
)
)
(if (logtest? (-> self enemy-flags) (enemy-flag check-water))
(if (logtest? (-> self enemy-flags) (enemy-flag dangerous-backup))
(logior! (-> self focus-status) (focus-status dangerous))
(logclear! (-> self focus-status) (focus-status dangerous))
)
(let ((v1-36 (-> self enemy-flags)))
(if (logtest? v1-36 (enemy-flag checking-water))
(set! v1-37 (logior v1-36 (enemy-flag enable-on-active)))
(set! v1-37 (logclear v1-36 (enemy-flag enable-on-active)))
(if (logtest? v1-36 (enemy-flag vulnerable-backup))
(set! v1-37 (logior v1-36 (enemy-flag vulnerable)))
(set! v1-37 (logclear v1-36 (enemy-flag vulnerable)))
)
)
(set! (-> self enemy-flags) v1-37)
(if (logtest? (-> self enemy-flags) (enemy-flag look-at-move-dest))
(if (logtest? (-> self enemy-flags) (enemy-flag attackable-backup))
(logior! (-> self mask) (process-mask collectable))
(logclear! (-> self mask) (process-mask collectable))
)
(let ((v1-44 (-> self enemy-flags)))
(if (logtest? (enemy-flag no-initial-move-to-ground) v1-44)
(set! v1-45 (logior (enemy-flag check-water-backup) v1-44))
(set! v1-45 (logclear v1-44 (enemy-flag check-water-backup)))
(if (logtest? (enemy-flag trackable-backup) v1-44)
(set! v1-45 (logior (enemy-flag trackable) v1-44))
(set! v1-45 (logclear v1-44 (enemy-flag trackable)))
)
)
(set! (-> self enemy-flags) v1-45)
(logclear! (-> self enemy-flags) (enemy-flag actor-pause-backup))
(logclear! (-> self enemy-flags) (enemy-flag lock-focus))
(logclear! (-> self focus-status) (focus-status hit))
(react-to-focus self)
)
@ -71,7 +71,7 @@
(defstate knocked (bot)
:virtual #t
:enter (behavior ()
(logclear! (-> self enemy-flags) (enemy-flag look-at-focus))
(logclear! (-> self enemy-flags) (enemy-flag victory))
(stop-speech self (the-as uint 0) #t)
(if (and (logtest? (-> self bot-flags) (bot-flags attacked))
(nonzero? (-> self hit-points))
@ -151,7 +151,7 @@
)
)
)
(f30-0 (get-rand-float-range self 0.8 1.2))
(f30-0 (rnd-float-range self 0.8 1.2))
)
(ja-no-eval :group! gp-0 :num! (seek! max f30-0) :frame-num 0.0)
(until (ja-done? 0)
@ -159,7 +159,7 @@
(ja :num! (seek! max f30-0))
)
)
(until (not (channel-active? self (the-as uint 0)))
(until (not (channel-active? self (gui-channel none)))
(suspend)
)
(until #f
@ -195,13 +195,13 @@
)
:trans (behavior ()
((-> (method-of-type bot die-falling) trans))
(if (channel-active? self (the-as uint 0))
(if (channel-active? self (gui-channel none))
(set-time! (-> self state-time))
)
)
:code (behavior ()
(ja-channel-push! 1 (seconds 0.1))
(let ((f30-0 (get-rand-float-range self 0.9 1.1))
(let ((f30-0 (rnd-float-range self 0.9 1.1))
(gp-0 (-> self draw art-group data (-> self enemy-info idle-anim)))
)
(until #f
@ -237,7 +237,7 @@
0
(logior! (-> self draw status) (draw-control-status no-draw))
(set! (-> self notice-enemy-dist) 0.0)
(logclear! (-> self enemy-flags) (enemy-flag trackable-backup))
(logclear! (-> self enemy-flags) (enemy-flag check-water))
)
:exit (behavior ()
(local-vars (v0-0 enemy-flag))
@ -248,9 +248,9 @@
(set! (-> v1-5 prim-core collide-with) (-> self root backup-collide-with))
)
(let ((v1-6 (-> self enemy-flags)))
(if (logtest? (enemy-flag enable-on-hostile) v1-6)
(set! v0-0 (logior (enemy-flag trackable-backup) v1-6))
(set! v0-0 (logclear v1-6 (enemy-flag trackable-backup)))
(if (logtest? (enemy-flag check-water-backup) v1-6)
(set! v0-0 (logior (enemy-flag check-water) v1-6))
(set! v0-0 (logclear v1-6 (enemy-flag check-water)))
)
)
(set! (-> self enemy-flags) v0-0)

View File

@ -111,7 +111,7 @@
)
)
(defmethod enemy-method-108 ((this bot) (arg0 enemy) (arg1 event-message-block))
(defmethod enemy-method-108 ((this bot) (arg0 process-drawable) (arg1 event-message-block))
0
)
@ -135,7 +135,7 @@
(let ((gp-0 #f))
(let ((v1-0 (-> this incoming penetrate-using)))
(cond
((logtest? #x800000 v1-0)
((logtest? (penetrate jak-red-shot) v1-0)
(when *target*
(let ((s5-0 (new 'stack-no-clear 'vector))
(s3-0 (-> *target* gun fire-dir-out))
@ -153,7 +153,7 @@
)
)
)
((and (logtest? #x10000 v1-0) (not (logtest? #x20000 v1-0)))
((and (logtest? (penetrate dark-skin) v1-0) (not (logtest? (penetrate dark-punch) v1-0)))
(set! gp-0 #t)
)
)
@ -295,8 +295,8 @@
)
)
(defmethod enemy-method-106 ((this bot) (arg0 process) (arg1 object) (arg2 int) (arg3 attack-info))
(let ((t9-0 (method-of-type nav-enemy enemy-method-106)))
(defmethod set-incoming-attack-info ((this bot) (arg0 process) (arg1 object) (arg2 penetrate) (arg3 attack-info))
(let ((t9-0 (method-of-type nav-enemy set-incoming-attack-info)))
(t9-0 this arg0 arg1 arg2 arg3)
)
(logclear! (-> this bot-flags) (bot-flags bf03 bf04))
@ -438,7 +438,7 @@
(local-vars (s5-1 process))
(let ((s5-0 (-> this focus)))
(cond
((logtest? (enemy-flag actor-pause-backup) (-> this enemy-flags))
((logtest? (enemy-flag lock-focus) (-> this enemy-flags))
(set! s5-1 (handle->process (-> s5-0 handle)))
)
(else
@ -760,13 +760,13 @@
(('too-far-fail)
(when (not (logtest? (-> this bot-flags) (bot-flags too-far-fail bf09)))
(logior! (-> this bot-flags) (bot-flags bf09))
(logclear! (-> this enemy-flags) (enemy-flag enable-on-active checking-water))
(logclear! (-> this enemy-flags) (enemy-flag vulnerable vulnerable-backup))
(logclear! (-> this focus-status) (focus-status dangerous))
(logclear! (-> this enemy-flags) (enemy-flag check-water))
(logclear! (-> this enemy-flags) (enemy-flag dangerous-backup))
(logclear! (-> this mask) (process-mask collectable))
(logclear! (-> this enemy-flags) (enemy-flag look-at-move-dest))
(logclear! (-> this enemy-flags) (enemy-flag attackable-backup))
(logclear! (-> this mask) (process-mask actor-pause))
(logclear! (-> this enemy-flags) (enemy-flag notice))
(logclear! (-> this enemy-flags) (enemy-flag actor-pause-backup))
(go (method-of-object this failed))
)
)
@ -838,7 +838,7 @@
(when (if (type? s5-2 process-focusable)
s5-2
)
(logior! (-> this enemy-flags) (enemy-flag look-at-focus))
(logior! (-> this enemy-flags) (enemy-flag victory))
(set-time! (-> this hit-focus-time))
)
)
@ -1023,7 +1023,7 @@
)
(defmethod play-too-far-warn-speech ((this bot))
(when (not (channel-active? this (the-as uint 0)))
(when (not (channel-active? this (gui-channel none)))
(let ((idx (bot-speech-list-method-9
(-> this course too-far-warn-speeches)
this
@ -1085,7 +1085,7 @@ If the player is too far, play a warning speech."
(if (and (>= (current-time) (-> this next-too-far-warn-time)) (play-too-far-warn-speech this))
(set! (-> this next-too-far-warn-time)
(+ (current-time)
(get-rand-int-range this (the-as int (-> this warn-min-delay)) (the-as int (-> this warn-max-delay)))
(rnd-int-range this (the-as int (-> this warn-min-delay)) (the-as int (-> this warn-max-delay)))
)
)
)
@ -1107,13 +1107,13 @@ If the player is too far, play a warning speech."
(set! (-> this started-warning-time) 0)
(set! (-> this next-too-far-warn-time)
(+ (current-time)
(get-rand-int-range this (the-as int (-> this warn-min-delay)) (the-as int (-> this warn-max-delay)))
(rnd-int-range this (the-as int (-> this warn-min-delay)) (the-as int (-> this warn-max-delay)))
)
)
(none)
)
(defmethod track-target! ((this bot))
(defmethod common-post ((this bot))
"Does a lot of various things relating to interacting with the target
- tracks when the enemy was last drawn
- looks at the target and handles attacking
@ -1146,7 +1146,7 @@ If the player is too far, play a warning speech."
)
)
)
(let ((t9-4 (method-of-type nav-enemy track-target!)))
(let ((t9-4 (method-of-type nav-enemy common-post)))
(t9-4 this)
)
(when (not (logtest? (-> this bot-flags) (bot-flags bf09)))
@ -1216,7 +1216,7 @@ If the player is too far, play a warning speech."
(add-process
*gui-control*
this
(the-as gui-channel (-> this channel))
(-> this channel)
(gui-action play)
(-> speech name)
-99.0
@ -1241,15 +1241,7 @@ If the player is too far, play a warning speech."
;; WARN: Return type mismatch sound-id vs none.
(defmethod play-death-sound ((this bot) (sound string))
"Play one of our death sounds."
(add-process
*gui-control*
this
(the-as gui-channel (-> this channel))
(gui-action play)
sound
-99.0
(seconds 0.3)
)
(add-process *gui-control* this (-> this channel) (gui-action play) sound -99.0 (seconds 0.3))
(none)
)
@ -1272,21 +1264,21 @@ If the player is too far, play a warning speech."
)
)
(defmethod channel-active? ((this bot) (channel uint))
(defmethod channel-active? ((this bot) (channel gui-channel))
"Is the given [[gui-channel]] active?"
(if (zero? channel)
(if (= channel (gui-channel none))
(set! channel (-> this channel))
)
(nonzero? (get-status
*gui-control*
(lookup-gui-connection-id *gui-control* (the-as string #f) (the-as gui-channel channel) (gui-action none))
(lookup-gui-connection-id *gui-control* (the-as string #f) channel (gui-action none))
)
)
)
(defmethod stop-speech ((this bot) (channel uint) (arg1 symbol))
(if (zero? channel)
(set! channel (-> this channel))
(set! channel (the-as uint (-> this channel)))
)
(if arg1
(set-action!
@ -1367,7 +1359,6 @@ If the player is too far, play a warning speech."
(go process-drawable-art-error "bad waypoint id")
)
;; WARN: Return type mismatch object vs none.
(defmethod skip-waypoint ((this bot))
(let ((skip-id (-> this waypoint skip-to)))
(when (>= skip-id 0)
@ -1376,7 +1367,6 @@ If the player is too far, play a warning speech."
(go-to-waypoint! this skip-id #t)
)
)
(none)
)
;; WARN: Return type mismatch nav-enemy vs bot.
@ -1434,9 +1424,9 @@ If the player is too far, play a warning speech."
(set! (-> this ai-ctrl) (new 'process 'ai-task-control *bot-task-pool*))
(logclear! (-> this mask) (process-mask enemy))
(logior! (-> this mask) (process-mask bot))
(logior! (-> this enemy-flags) (enemy-flag use-notice-distance multi-focus))
(logior! (-> this enemy-flags) (enemy-flag cam-attack-mode dislike-combo))
(logclear! (-> this mask) (process-mask collectable))
(logclear! (-> this enemy-flags) (enemy-flag look-at-move-dest))
(logclear! (-> this enemy-flags) (enemy-flag attackable-backup))
(logior! (-> this focus-status) (focus-status disable))
(let ((v1-13 (-> this nav)))
(set! (-> v1-13 sphere-mask) (the-as uint 78))
@ -1699,7 +1689,7 @@ If the player is too far, play a warning speech."
)
(defmethod play-attacked-speech ((this bot))
(when (not (channel-active? this (the-as uint 0)))
(when (not (channel-active? this (gui-channel none)))
(let ((idx (bot-speech-list-method-9
(-> this course attack-player-speeches)
this
@ -1724,11 +1714,11 @@ If the player is too far, play a warning speech."
;; WARN: Return type mismatch bot-flags vs none.
(defmethod fail-mission! ((this bot))
(logclear! (-> this enemy-flags) (enemy-flag enable-on-active checking-water))
(logclear! (-> this enemy-flags) (enemy-flag vulnerable vulnerable-backup))
(logclear! (-> this mask) (process-mask collectable))
(logclear! (-> this enemy-flags) (enemy-flag look-at-move-dest))
(logclear! (-> this enemy-flags) (enemy-flag attackable-backup))
(logclear! (-> this mask) (process-mask actor-pause))
(logclear! (-> this enemy-flags) (enemy-flag notice))
(logclear! (-> this enemy-flags) (enemy-flag actor-pause-backup))
(logior! (-> this bot-flags) (bot-flags bf09))
(let ((mission-failed? #t))
(let ((master-handle (handle->process (-> this master-handle))))
@ -1814,7 +1804,7 @@ If the player is too far, play a warning speech."
(defmethod bot-method-191 ((this bot))
(logior! (-> this bot-flags) (bot-flags bf02))
(set-time! (-> this hit-invuln-starting-time))
(logclear! (-> this enemy-flags) (enemy-flag enable-on-active))
(logclear! (-> this enemy-flags) (enemy-flag vulnerable))
(if (nonzero? (-> this hit-invuln-ignore-me-delay))
(logior! (-> this focus-status) (focus-status ignore))
)
@ -1830,13 +1820,13 @@ If the player is too far, play a warning speech."
(let ((a1-0 (-> this hit-invuln-starting-time))
(v1-0 #t)
)
(if (not (logtest? (-> this enemy-flags) (enemy-flag enable-on-active)))
(if (not (logtest? (-> this enemy-flags) (enemy-flag vulnerable)))
(set! v1-0 (cond
((time-elapsed? a1-0 (seconds 0.6))
(let ((a2-6 (-> this enemy-flags)))
(if (logtest? a2-6 (enemy-flag checking-water))
(set! a2-7 (logior a2-6 (enemy-flag enable-on-active)))
(set! a2-7 (logclear a2-6 (enemy-flag enable-on-active)))
(if (logtest? a2-6 (enemy-flag vulnerable-backup))
(set! a2-7 (logior a2-6 (enemy-flag vulnerable)))
(set! a2-7 (logclear a2-6 (enemy-flag vulnerable)))
)
)
(set! (-> this enemy-flags) a2-7)

View File

@ -140,13 +140,13 @@
(cond
((zero? arg0)
(let ((t9-0 (method-of-type bot stop-speech)))
(t9-0 this (-> this channel) arg1)
(t9-0 this (the-as uint (-> this channel)) arg1)
)
(countdown (s4-0 3)
(let ((v1-4 (handle->process (-> this slave-handle s4-0))))
(when v1-4
(let ((t9-1 (method-of-type bot stop-speech)))
(t9-1 (the-as bot v1-4) (-> v1-4 stack 580) arg1)
(t9-1 (the-as bot v1-4) (the-as uint (-> (the-as bot v1-4) channel)) arg1)
)
)
)
@ -173,7 +173,7 @@
(a1-11 (add-process
*gui-control*
a2-2
(the-as gui-channel (-> a2-2 stack 580))
(-> (the-as bot a2-2) channel)
(gui-action play)
(-> v1-2 name)
-99.0
@ -188,7 +188,7 @@
(let ((a1-14 (add-process
*gui-control*
this
(the-as gui-channel (-> this channel))
(-> this channel)
(gui-action play)
(-> v1-2 name)
-99.0
@ -205,10 +205,10 @@
(none)
)
(defmethod channel-active? ((this hal) (arg0 uint))
(defmethod channel-active? ((this hal) (arg0 gui-channel))
"Is the given [[gui-channel]] active?"
(cond
((zero? arg0)
((= arg0 (gui-channel none))
(let ((t9-0 (method-of-type bot channel-active?)))
(if (t9-0 this (-> this channel))
(return #t)
@ -218,7 +218,7 @@
(let ((v1-7 (handle->process (-> this slave-handle s5-0))))
(when v1-7
(let ((t9-1 (method-of-type bot channel-active?)))
(if (t9-1 (the-as bot v1-7) (-> v1-7 stack 580))
(if (t9-1 (the-as bot v1-7) (-> (the-as bot v1-7) channel))
(return #t)
)
)
@ -323,7 +323,7 @@
(let ((t9-4 (method-of-type bot init-enemy!)))
(t9-4 this)
)
(set! (-> this channel) (the-as uint 28))
(set! (-> this channel) (gui-channel hal))
(set! (-> this spot-color) (the-as uint #x5000ffff))
(set! (-> this notice-enemy-dist) 0.0)
(logior! (-> this focus-status) (focus-status disable))
@ -504,7 +504,7 @@
(when (and (not (logtest? (-> self bot-flags) (bot-flags too-far-fail bf09))) (bot-check-too-far self))
(let ((gp-0 0))
(countdown (s5-0 3)
(let ((s4-0 (enemy-method-120 self 3 gp-0)))
(let ((s4-0 (rnd-bit self 3 gp-0)))
(let ((a0-4 (handle->process (-> self slave-handle s4-0))))
(if (send-event a0-4 'request 'too-far-fail)
(goto cfg-24)

View File

@ -22,7 +22,7 @@
(set! (-> v1-7 enemy-flags) (the-as enemy-flag (logclear (-> v1-7 enemy-flags) (enemy-flag enemy-flag37))))
)
0
(look-at-target! self (enemy-flag lock-focus))
(look-at-target! self (enemy-flag look-at-focus))
(set! (-> self travel-anim-interp) 0.0)
)
:trans (behavior ()
@ -66,7 +66,7 @@
(set! (-> v1-7 enemy-flags) (the-as enemy-flag (logclear (-> v1-7 enemy-flags) (enemy-flag enemy-flag37))))
)
0
(look-at-target! self (enemy-flag lock-focus))
(look-at-target! self (enemy-flag look-at-focus))
(set! (-> self travel-anim-interp) 0.0)
)
:trans (behavior ()
@ -104,7 +104,7 @@
(set! (-> v1-7 enemy-flags) (the-as enemy-flag (logclear (-> v1-7 enemy-flags) (enemy-flag enemy-flag37))))
)
0
(look-at-target! self (enemy-flag lock-focus))
(look-at-target! self (enemy-flag look-at-focus))
(set! (-> self travel-anim-interp) 0.0)
)
:trans (behavior ()
@ -145,7 +145,7 @@
(set! (-> v1-7 enemy-flags) (the-as enemy-flag (logclear (-> v1-7 enemy-flags) (enemy-flag enemy-flag37))))
)
0
(look-at-target! self (enemy-flag lock-focus))
(look-at-target! self (enemy-flag look-at-focus))
(set! (-> self travel-anim-interp) 0.0)
)
:trans (behavior ()
@ -210,7 +210,7 @@
(set! (-> v1-7 enemy-flags) (the-as enemy-flag (logclear (-> v1-7 enemy-flags) (enemy-flag enemy-flag37))))
)
0
(look-at-target! self (enemy-flag lock-focus))
(look-at-target! self (enemy-flag look-at-focus))
(set! (-> self travel-anim-interp) 0.0)
)
:trans (behavior ()
@ -297,7 +297,7 @@
(set! (-> v1-7 enemy-flags) (the-as enemy-flag (logclear (-> v1-7 enemy-flags) (enemy-flag enemy-flag37))))
)
0
(look-at-target! self (enemy-flag lock-focus))
(look-at-target! self (enemy-flag look-at-focus))
(set! (-> self travel-anim-interp) 0.0)
)
:trans (behavior ()
@ -354,7 +354,7 @@
)
0
(nav-enemy-method-167 self)
(logior! (-> self enemy-flags) (enemy-flag actor-pause-backup))
(logior! (-> self enemy-flags) (enemy-flag lock-focus))
(logior! (-> self focus-status) (focus-status dangerous))
(let* ((v1-11 *game-info*)
(a0-6 (+ (-> v1-11 attack-id) 1))
@ -365,8 +365,8 @@
(set! (-> self travel-anim-interp) 0.0)
)
:exit (behavior ()
(logclear! (-> self enemy-flags) (enemy-flag actor-pause-backup))
(if (logtest? (-> self enemy-flags) (enemy-flag check-water))
(logclear! (-> self enemy-flags) (enemy-flag lock-focus))
(if (logtest? (-> self enemy-flags) (enemy-flag dangerous-backup))
(logior! (-> self focus-status) (focus-status dangerous))
(logclear! (-> self focus-status) (focus-status dangerous))
)
@ -392,14 +392,14 @@
)
0
(nav-enemy-method-167 self)
(logior! (-> self enemy-flags) (enemy-flag actor-pause-backup))
(logior! (-> self enemy-flags) (enemy-flag lock-focus))
(if (not (handle->process (-> self focus handle)))
(react-to-focus self)
)
(set! (-> self travel-anim-interp) 0.0)
)
:exit (behavior ()
(logclear! (-> self enemy-flags) (enemy-flag actor-pause-backup))
(logclear! (-> self enemy-flags) (enemy-flag lock-focus))
)
:code nothing
:post nav-enemy-simple-post

View File

@ -111,7 +111,9 @@
(set! (-> v1-9 target-speed) 0.0)
)
0
(set! (-> arg0 enemy-flags) (the-as enemy-flag (logclear (-> arg0 enemy-flags) (enemy-flag vulnerable))))
(set! (-> arg0 enemy-flags)
(the-as enemy-flag (logclear (-> arg0 enemy-flags) (enemy-flag jump-check-blocked)))
)
(when (send-event arg0 'jump 0 (-> s5-0 center))
(mem-copy! (the-as pointer (-> arg0 spot)) (the-as pointer s5-0) 20)
#t

View File

@ -7,80 +7,80 @@
;; DECOMP BEGINS
(defmethod general-event-handler ruffian ((obj ruffian) (arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block))
(defmethod general-event-handler ((this ruffian) (arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block))
"Handles various events for the enemy
@TODO - unsure if there is a pattern for the events and this should have a more specific name"
(case arg2
(('hit-knocked)
(send-event
(handle->process (-> obj master-handle))
(handle->process (-> this master-handle))
'notify
'hit-by
(handle->process (-> obj incoming attacker-handle))
(handle->process (-> this incoming attacker-handle))
)
((method-of-type bot general-event-handler) obj arg0 arg1 arg2 arg3)
((method-of-type bot general-event-handler) this arg0 arg1 arg2 arg3)
)
(('request)
(case (-> arg3 param 0)
(('too-far-fail)
(cond
((logtest? (bot-flags bf19) (-> obj bot-flags))
(send-event obj 'instant-death)
((logtest? (bot-flags bf19) (-> this bot-flags))
(send-event this 'instant-death)
#t
)
(else
(let ((v1-20 (-> obj ruf-course too-far-fail-speeches)))
(let ((v1-20 (-> this ruf-course too-far-fail-speeches)))
;; changed
;; (set! v1-20 (and (nonzero? v1-20) v1-20))
(if (and v1-20 (nonzero? v1-20))
((method-of-type bot general-event-handler) obj arg0 arg1 arg2 arg3)
((method-of-type bot general-event-handler) this arg0 arg1 arg2 arg3)
)
)
)
)
)
(('bomb-recoil)
(if (and (and (-> obj next-state) (let ((v1-25 (-> obj next-state name)))
(or (= v1-25 'alert-idle) (= v1-25 'waiting-idle) (= v1-25 'scared-idle))
)
(if (and (and (-> this next-state) (let ((v1-25 (-> this next-state name)))
(or (= v1-25 'alert-idle) (= v1-25 'waiting-idle) (= v1-25 'scared-idle))
)
)
(not (logtest? (-> obj focus-status) (focus-status grabbed)))
(not (logtest? (-> this focus-status) (focus-status grabbed)))
)
(go (method-of-object obj bomb-recoil))
(go (method-of-object this bomb-recoil))
)
)
(else
((method-of-type bot general-event-handler) obj arg0 arg1 arg2 arg3)
((method-of-type bot general-event-handler) this arg0 arg1 arg2 arg3)
)
)
)
(else
((method-of-type bot general-event-handler) obj arg0 arg1 arg2 arg3)
((method-of-type bot general-event-handler) this arg0 arg1 arg2 arg3)
)
)
)
;; WARN: Return type mismatch object vs symbol.
(defmethod attacked-by-player? ruffian ((obj ruffian) (arg0 process-focusable))
(defmethod attacked-by-player? ((this ruffian) (arg0 process-focusable))
"Were we attacked by the player?"
(the-as
symbol
(and (and arg0 (not (logtest? (-> arg0 focus-status) (focus-status disable dead ignore grabbed))))
(or (and (logtest? (process-mask enemy) (-> arg0 mask))
(>= 40960.0 (vector-vector-xz-distance (-> obj root trans) (get-trans arg0 3)))
(>= 40960.0 (vector-vector-xz-distance (-> this root trans) (get-trans arg0 3)))
)
(and (logtest? (-> arg0 mask) (process-mask target)) (logtest? (-> obj bot-flags) (bot-flags attacked)))
(and (logtest? (-> arg0 mask) (process-mask target)) (logtest? (-> this bot-flags) (bot-flags attacked)))
)
)
)
)
(defmethod ruffian-method-245 ruffian ((obj ruffian))
(-> obj root)
(defmethod ruffian-method-245 ((this ruffian))
(-> this root)
(let ((s5-0 (new 'stack-no-clear 'vector)))
(vector-! s5-0 (target-pos 0) (-> obj root trans))
(let* ((f0-1 (vector-dot (-> obj follow-dir) s5-0))
(f0-2 (- (- (-> obj follow-offset)) f0-1))
(vector-! s5-0 (target-pos 0) (-> this root trans))
(let* ((f0-1 (vector-dot (-> this follow-dir) s5-0))
(f0-2 (- (- (-> this follow-offset)) f0-1))
)
0.0
(let ((f0-5 (if (>= f0-2 0.0)
@ -88,9 +88,9 @@
(* -0.000048828126 (fmax -20480.0 f0-2))
)
)
(s5-1 (-> obj nav))
(s5-1 (-> this nav))
)
(set! (-> s5-1 target-speed) (lerp (-> obj min-speed) (-> obj max-speed) f0-5))
(set! (-> s5-1 target-speed) (lerp (-> this min-speed) (-> this max-speed) f0-5))
)
)
)
@ -98,8 +98,8 @@
(none)
)
(defmethod enemy-method-97 ruffian ((obj ruffian))
(let* ((s5-0 (handle->process (-> obj attacker-handle)))
(defmethod enemy-method-97 ((this ruffian))
(let* ((s5-0 (handle->process (-> this attacker-handle)))
(v1-3 (if (type? s5-0 process-focusable)
s5-0
)
@ -108,25 +108,25 @@
(when v1-3
(cond
((= (-> v1-3 type) target)
(when (or (not (logtest? (-> obj bot-flags) (bot-flags attacked)))
(>= (- (current-time) (-> obj attacker-time)) (seconds 1.5))
(when (or (not (logtest? (-> this bot-flags) (bot-flags attacked)))
(time-elapsed? (-> this attacker-time) (seconds 1.5))
)
(if (logtest? (-> obj bot-flags) (bot-flags attacked))
(reset-attacker! obj)
(if (logtest? (-> this bot-flags) (bot-flags attacked))
(reset-attacker! this)
)
(set! v1-3 (the-as process #f))
(set! (-> obj attacker-handle) (the-as handle #f))
(set! (-> this attacker-handle) (the-as handle #f))
)
)
(else
(when (>= (- (current-time) (-> obj attacker-time)) (seconds 6))
(when (time-elapsed? (-> this attacker-time) (seconds 6))
(set! v1-3 (the-as process #f))
(set! (-> obj attacker-handle) (the-as handle #f))
(set! (-> this attacker-handle) (the-as handle #f))
)
)
)
)
(let ((a0-21 (-> obj focus-mode))
(let ((a0-21 (-> this focus-mode))
(s5-1 (the-as process #f))
)
(cond
@ -135,11 +135,11 @@
(v1-3
(set! s5-1 v1-3)
)
((begin (set! s5-1 (select-focus! obj)) s5-1)
((begin (set! s5-1 (select-focus! this)) s5-1)
(empty)
)
(else
(let ((s4-0 (handle->process (-> obj poi-handle))))
(let ((s4-0 (handle->process (-> this poi-handle))))
(set! s5-1 (if (type? s4-0 process-focusable)
s4-0
)
@ -158,7 +158,7 @@
(set! s5-1 v1-3)
)
(else
(let ((s4-1 (handle->process (-> obj poi-handle))))
(let ((s4-1 (handle->process (-> this poi-handle))))
(set! s5-1 (if (type? s4-1 process-focusable)
s4-1
)
@ -168,7 +168,7 @@
(s5-1
(empty)
)
((begin (set! s5-1 (select-focus! obj)) s5-1)
((begin (set! s5-1 (select-focus! this)) s5-1)
(empty)
)
(else
@ -181,14 +181,14 @@
)
(cond
(s5-1
(try-update-focus (-> obj focus) (the-as process-focusable s5-1) obj)
(if (and (logtest? (-> obj bot-flags) (bot-flags attacked)) (!= (-> s5-1 type) target))
(logclear! (-> obj bot-flags) (bot-flags attacked))
(try-update-focus (-> this focus) (the-as process-focusable s5-1) this)
(if (and (logtest? (-> this bot-flags) (bot-flags attacked)) (!= (-> s5-1 type) target))
(logclear! (-> this bot-flags) (bot-flags attacked))
)
)
(else
(clear-focused (-> obj focus))
(logclear! (-> obj bot-flags) (bot-flags attacked))
(clear-focused (-> this focus))
(logclear! (-> this bot-flags) (bot-flags attacked))
)
)
s5-1
@ -197,61 +197,63 @@
)
;; WARN: Return type mismatch bot-flags vs none.
(defmethod enemy-method-106 ruffian ((obj ruffian) (arg0 process) (arg1 object) (arg2 int) (arg3 attack-info))
(let ((t9-0 (method-of-type bot enemy-method-106)))
(t9-0 obj arg0 arg1 arg2 arg3)
(defmethod set-incoming-attack-info ((this ruffian) (arg0 process) (arg1 object) (arg2 penetrate) (arg3 attack-info))
(let ((t9-0 (method-of-type bot set-incoming-attack-info)))
(t9-0 this arg0 arg1 arg2 arg3)
)
(if (= (-> arg3 mode) 'beam)
(set! (-> obj bot-flags) (logior (bot-flags bf25) (-> obj bot-flags)))
(logclear! (-> obj bot-flags) (bot-flags bf25))
(logior! (-> this bot-flags) (bot-flags bf25))
(logclear! (-> this bot-flags) (bot-flags bf25))
)
(none)
)
(defmethod ruffian-method-242 ruffian ((obj ruffian))
(defmethod ruffian-method-242 ((this ruffian))
(local-vars (a3-0 int))
(when (not (channel-active? obj (the-as uint 0)))
(when (not (channel-active? this (gui-channel none)))
(let ((v1-2 0))
(if (logtest? (bot-flags bf25) (-> obj bot-flags))
(if (logtest? (bot-flags bf25) (-> this bot-flags))
(set! a3-0 (logior v1-2 128))
(set! a3-0 (logior v1-2 64))
)
)
(let ((a1-3 (bot-speech-list-method-9
(-> obj ruf-course ouch-speeches)
obj
(-> obj ruf-course speeches)
(-> this ruf-course ouch-speeches)
this
(-> this ruf-course speeches)
(the-as speech-flags a3-0)
)
)
)
(if (>= a1-3 0)
(play-speech obj a1-3)
(play-speech this a1-3)
)
)
)
(none)
)
(defmethod play-attacked-speech ruffian ((obj ruffian))
(defmethod play-attacked-speech ((this ruffian))
(local-vars (a3-0 int))
(when (not (channel-active? obj (the-as uint 0)))
(when (not (channel-active? this (gui-channel none)))
(let ((v1-2 0))
(if (logtest? #x3c00000 (-> obj incoming penetrate-using))
(if (logtest? (penetrate jak-yellow-shot jak-red-shot jak-blue-shot jak-dark-shot)
(-> this incoming penetrate-using)
)
(set! a3-0 (logior v1-2 128))
(set! a3-0 (logior v1-2 64))
)
)
(let ((a1-3 (bot-speech-list-method-9
(-> obj ruf-course attack-player-speeches)
obj
(-> obj ruf-course speeches)
(-> this ruf-course attack-player-speeches)
this
(-> this ruf-course speeches)
(the-as speech-flags a3-0)
)
)
)
(if (>= a1-3 0)
(play-speech obj a1-3)
(play-speech this a1-3)
)
)
)
@ -259,13 +261,13 @@
)
;; WARN: Return type mismatch object vs symbol.
(defmethod alive? ruffian ((obj ruffian))
(defmethod alive? ((this ruffian))
(let ((t9-0 (method-of-type bot alive?)))
(the-as
symbol
(and (t9-0 obj)
(-> obj next-state)
(let ((v1-3 (-> obj next-state name)))
(and (t9-0 this)
(-> this next-state)
(let ((v1-3 (-> this next-state name)))
(or (= v1-3 'waiting-idle) (= v1-3 'waiting-turn) (= v1-3 'scared-idle) (= v1-3 'scared-turn))
)
)
@ -273,103 +275,101 @@
)
)
(defmethod ruffian-method-238 ruffian ((obj ruffian))
(and (!= (-> obj focus-info fproc type) target) (>= 16384.0 (-> obj focus-info bullseye-xz-dist)))
(defmethod ruffian-method-238 ((this ruffian))
(and (!= (-> this focus-info fproc type) target) (>= 16384.0 (-> this focus-info bullseye-xz-dist)))
)
(defmethod ruffian-method-237 ruffian ((obj ruffian))
(or (and (logtest? (-> obj bot-flags) (bot-flags attacked)) (= (-> obj focus-info fproc type) target))
(and (>= 40960.0 (-> obj focus-info bullseye-xz-dist))
(= (-> obj focus-info los) 1)
(>= (current-time) (-> obj next-fire-time))
(defmethod ruffian-method-237 ((this ruffian))
(or (and (logtest? (-> this bot-flags) (bot-flags attacked)) (= (-> this focus-info fproc type) target))
(and (>= 40960.0 (-> this focus-info bullseye-xz-dist))
(= (-> this focus-info los) 1)
(>= (current-time) (-> this next-fire-time))
)
)
)
(defmethod ruffian-method-243 ruffian ((obj ruffian))
(let ((v1-0 (-> obj bot-flags)))
(defmethod ruffian-method-243 ((this ruffian))
(let ((v1-0 (-> this bot-flags)))
(and (logtest? (bot-flags bf20) v1-0) (not (logtest? (bot-flags bf21) v1-0)))
)
)
(defmethod bot-method-190 ruffian ((obj ruffian))
(if (logtest? (bot-flags bf19) (-> obj bot-flags))
(defmethod bot-method-190 ((this ruffian))
(if (logtest? (bot-flags bf19) (-> this bot-flags))
#t
((method-of-type bot bot-method-190) obj)
((method-of-type bot bot-method-190) this)
)
)
(defmethod go-hostile ruffian ((obj ruffian))
(bot-method-223 obj #t)
(defmethod go-hostile ((this ruffian))
(bot-method-223 this #t)
(cond
((not (bot-method-214 obj))
(react-to-focus obj)
((not (bot-method-214 this))
(react-to-focus this)
)
((ruffian-method-238 obj)
(go (method-of-object obj kick))
((ruffian-method-238 this)
(go (method-of-object this kick))
)
((ruffian-method-237 obj)
(go (method-of-object obj blast))
((ruffian-method-237 this)
(go (method-of-object this blast))
)
(else
(go (method-of-object obj alert-idle))
(go (method-of-object this alert-idle))
)
)
(none)
)
(defmethod react-to-focus ruffian ((obj ruffian))
(defmethod react-to-focus ((this ruffian))
"@TODO - flesh out docs"
(cond
((bot-method-214 obj)
(go-hostile obj)
((bot-method-214 this)
(go-hostile this)
)
((ruffian-method-243 obj)
(go (method-of-object obj plant-bomb))
((ruffian-method-243 this)
(go (method-of-object this plant-bomb))
)
(else
(ruffian-method-240 obj)
(ruffian-method-240 this)
)
)
)
;; WARN: Return type mismatch object vs none.
(defmethod ruffian-method-241 ((this ruffian))
(cond
((bot-method-214 this)
(go (method-of-object this alert-turn))
)
((logtest? (bot-flags bf19) (-> this bot-flags))
(go (method-of-object this scared-turn))
)
(else
(go (method-of-object this waiting-turn))
)
)
(none)
)
;; WARN: Return type mismatch object vs none.
(defmethod ruffian-method-241 ruffian ((obj ruffian))
(defmethod ruffian-method-240 ((this ruffian))
(cond
((bot-method-214 obj)
(go (method-of-object obj alert-turn))
((bot-method-214 this)
(go (method-of-object this alert-idle))
)
((logtest? (bot-flags bf19) (-> obj bot-flags))
(go (method-of-object obj scared-turn))
((ruffian-method-243 this)
(go (method-of-object this plant-bomb))
)
((logtest? (bot-flags bf19) (-> this bot-flags))
(go (method-of-object this scared-idle))
)
(else
(go (method-of-object obj waiting-turn))
(go (method-of-object this waiting-idle))
)
)
(none)
)
;; WARN: Return type mismatch object vs none.
(defmethod ruffian-method-240 ruffian ((obj ruffian))
(cond
((bot-method-214 obj)
(go (method-of-object obj alert-idle))
)
((ruffian-method-243 obj)
(go (method-of-object obj plant-bomb))
)
((logtest? (bot-flags bf19) (-> obj bot-flags))
(go (method-of-object obj scared-idle))
)
(else
(go (method-of-object obj waiting-idle))
)
)
(none)
)
(defmethod go-idle ruffian ((obj ruffian))
(ruffian-method-240 obj)
(defmethod go-idle ((this ruffian))
(ruffian-method-240 this)
(none)
)

View File

@ -22,18 +22,18 @@
(set! (-> v1-7 enemy-flags) (the-as enemy-flag (logclear (-> v1-7 enemy-flags) (enemy-flag enemy-flag37))))
)
0
(look-at-target! self (enemy-flag lock-focus))
(look-at-target! self (enemy-flag look-at-focus))
(set! (-> self skel top-anim interp) 0.0)
(set! (-> self travel-anim-interp) 0.0)
(logclear! (-> self enemy-flags) (enemy-flag enable-on-active))
(logclear! (-> self enemy-flags) (enemy-flag vulnerable))
(logior! (-> self focus-status) (focus-status disable))
)
:exit (behavior ()
(local-vars (v1-1 enemy-flag))
(let ((v1-0 (-> self enemy-flags)))
(if (logtest? v1-0 (enemy-flag checking-water))
(set! v1-1 (logior v1-0 (enemy-flag enable-on-active)))
(set! v1-1 (logclear v1-0 (enemy-flag enable-on-active)))
(if (logtest? v1-0 (enemy-flag vulnerable-backup))
(set! v1-1 (logior v1-0 (enemy-flag vulnerable)))
(set! v1-1 (logclear v1-0 (enemy-flag vulnerable)))
)
)
(set! (-> self enemy-flags) v1-1)
@ -75,7 +75,7 @@
(set! (-> v1-7 enemy-flags) (the-as enemy-flag (logclear (-> v1-7 enemy-flags) (enemy-flag enemy-flag37))))
)
0
(look-at-target! self (enemy-flag lock-focus))
(look-at-target! self (enemy-flag look-at-focus))
(set! (-> self skel top-anim interp) 0.0)
(set! (-> self travel-anim-interp) 0.0)
)
@ -169,7 +169,7 @@
(set! (-> v1-7 enemy-flags) (the-as enemy-flag (logclear (-> v1-7 enemy-flags) (enemy-flag enemy-flag37))))
)
0
(look-at-target! self (enemy-flag lock-focus))
(look-at-target! self (enemy-flag look-at-focus))
(set! (-> self skel top-anim interp) 0.0)
(set! (-> self travel-anim-interp) 0.0)
)
@ -290,7 +290,7 @@
(set! (-> v1-7 enemy-flags) (the-as enemy-flag (logclear (-> v1-7 enemy-flags) (enemy-flag enemy-flag37))))
)
0
(look-at-target! self (enemy-flag lock-focus))
(look-at-target! self (enemy-flag look-at-focus))
(set! (-> self skel top-anim interp) 0.0)
(set! (-> self travel-anim-interp) 0.0)
)
@ -633,7 +633,7 @@
)
(until #f
(ja-channel-push! 1 (seconds 0.07))
(countdown (gp-0 (get-rand-int-range self 2 4))
(countdown (gp-0 (rnd-int-range self 2 4))
(ja-no-eval :group! sig-gun-fix-hit-ja :num! (seek!) :frame-num 0.0)
(until (ja-done? 0)
(suspend)
@ -706,7 +706,7 @@
(logclear! (-> self bot-flags) (bot-flags bf19 bf21))
(go-virtual waiting-close)
)
(countdown (gp-1 (get-rand-int-range self 2 3))
(countdown (gp-1 (rnd-int-range self 2 3))
(ja-channel-push! 1 (seconds 0.07))
(ja-no-eval :group! sig-gun-fix-stomp-ja :num! (seek!) :frame-num 0.0)
(until (ja-done? 0)
@ -789,7 +789,7 @@
0
(cond
((= gp-0 1)
(let ((s5-0 (get-rand-int-range self 1 2)))
(let ((s5-0 (rnd-int-range self 1 2)))
(ja-channel-push! 1 (seconds 0.13))
(while (nonzero? s5-0)
(+! s5-0 -1)
@ -802,7 +802,7 @@
)
)
(else
(let ((s5-1 (get-rand-int-range self 1 4)))
(let ((s5-1 (rnd-int-range self 1 4)))
(ja-channel-push! 1 (seconds 0.13))
(while (nonzero? s5-1)
(+! s5-1 -1)
@ -911,7 +911,7 @@
(set! (-> v1-7 enemy-flags) (the-as enemy-flag (logclear (-> v1-7 enemy-flags) (enemy-flag enemy-flag37))))
)
0
(look-at-target! self (enemy-flag lock-focus))
(look-at-target! self (enemy-flag look-at-focus))
(set! (-> self skel top-anim interp) 0.0)
(set! (-> self travel-anim-interp) 0.0)
)
@ -1066,7 +1066,7 @@
)
0
(nav-enemy-method-167 self)
(logior! (-> self enemy-flags) (enemy-flag actor-pause-backup))
(logior! (-> self enemy-flags) (enemy-flag lock-focus))
(logior! (-> self focus-status) (focus-status dangerous))
(let* ((v1-11 *game-info*)
(a0-6 (+ (-> v1-11 attack-id) 1))
@ -1078,8 +1078,8 @@
(set! (-> self travel-anim-interp) 0.0)
)
:exit (behavior ()
(logclear! (-> self enemy-flags) (enemy-flag actor-pause-backup))
(if (logtest? (-> self enemy-flags) (enemy-flag check-water))
(logclear! (-> self enemy-flags) (enemy-flag lock-focus))
(if (logtest? (-> self enemy-flags) (enemy-flag dangerous-backup))
(logior! (-> self focus-status) (focus-status dangerous))
(logclear! (-> self focus-status) (focus-status dangerous))
)
@ -1112,7 +1112,7 @@
(ja-no-eval :group! a1-2 :num! (seek!) :frame-num 0.0)
(until (ja-done? 0)
(when (and (focus-test? self dangerous) (< f30-0 (ja-aframe-num 0)))
(if (logtest? (-> self enemy-flags) (enemy-flag check-water))
(if (logtest? (-> self enemy-flags) (enemy-flag dangerous-backup))
(logior! (-> self focus-status) (focus-status dangerous))
(logclear! (-> self focus-status) (focus-status dangerous))
)
@ -1143,7 +1143,7 @@
)
0
(nav-enemy-method-167 self)
(logior! (-> self enemy-flags) (enemy-flag actor-pause-backup))
(logior! (-> self enemy-flags) (enemy-flag lock-focus))
(if (not (handle->process (-> self focus handle)))
(react-to-focus self)
)
@ -1151,7 +1151,7 @@
(set! (-> self travel-anim-interp) 0.0)
)
:exit (behavior ()
(logclear! (-> self enemy-flags) (enemy-flag actor-pause-backup))
(logclear! (-> self enemy-flags) (enemy-flag lock-focus))
)
:code (behavior ()
(local-vars (gp-0 art-element))
@ -1267,10 +1267,10 @@
(if (not (handle->process (-> self focus handle)))
(go-virtual traveling)
)
(logior! (-> self enemy-flags) (enemy-flag actor-pause-backup))
(logior! (-> self enemy-flags) (enemy-flag lock-focus))
)
:exit (behavior ()
(logclear! (-> self enemy-flags) (enemy-flag actor-pause-backup))
(logclear! (-> self enemy-flags) (enemy-flag lock-focus))
)
:code (behavior ()
(push-anim-to-targ (-> self skel top-anim) (the-as art-joint-anim sig-upper-shoot-ja) 0.0 9 9 1.0 0.0 #f)
@ -1340,29 +1340,29 @@
(suspend)
(ja :num! (seek!))
)
(if (logtest? (-> self enemy-flags) (enemy-flag check-water))
(if (logtest? (-> self enemy-flags) (enemy-flag dangerous-backup))
(logior! (-> self focus-status) (focus-status dangerous))
(logclear! (-> self focus-status) (focus-status dangerous))
)
(let ((v1-30 (-> self enemy-flags)))
(if (logtest? v1-30 (enemy-flag checking-water))
(set! v1-31 (logior v1-30 (enemy-flag enable-on-active)))
(set! v1-31 (logclear v1-30 (enemy-flag enable-on-active)))
(if (logtest? v1-30 (enemy-flag vulnerable-backup))
(set! v1-31 (logior v1-30 (enemy-flag vulnerable)))
(set! v1-31 (logclear v1-30 (enemy-flag vulnerable)))
)
)
(set! (-> self enemy-flags) v1-31)
(if (logtest? (-> self enemy-flags) (enemy-flag look-at-move-dest))
(if (logtest? (-> self enemy-flags) (enemy-flag attackable-backup))
(logior! (-> self mask) (process-mask collectable))
(logclear! (-> self mask) (process-mask collectable))
)
(let ((v1-38 (-> self enemy-flags)))
(if (logtest? (enemy-flag no-initial-move-to-ground) v1-38)
(set! v1-39 (logior (enemy-flag check-water-backup) v1-38))
(set! v1-39 (logclear v1-38 (enemy-flag check-water-backup)))
(if (logtest? (enemy-flag trackable-backup) v1-38)
(set! v1-39 (logior (enemy-flag trackable) v1-38))
(set! v1-39 (logclear v1-38 (enemy-flag trackable)))
)
)
(set! (-> self enemy-flags) v1-39)
(logclear! (-> self enemy-flags) (enemy-flag actor-pause-backup))
(logclear! (-> self enemy-flags) (enemy-flag lock-focus))
(logclear! (-> self focus-status) (focus-status hit))
(react-to-focus self)
)
@ -1459,7 +1459,7 @@
(set! (-> v1-7 enemy-flags) (the-as enemy-flag (logclear (-> v1-7 enemy-flags) (enemy-flag enemy-flag37))))
)
0
(look-at-target! self (enemy-flag lock-focus))
(look-at-target! self (enemy-flag look-at-focus))
(set! (-> self skel top-anim interp) 0.0)
(set! (-> self travel-anim-interp) 0.0)
)
@ -1518,7 +1518,7 @@
(set! (-> v1-7 enemy-flags) (the-as enemy-flag (logclear (-> v1-7 enemy-flags) (enemy-flag enemy-flag37))))
)
0
(look-at-target! self (enemy-flag lock-focus))
(look-at-target! self (enemy-flag look-at-focus))
(set! (-> self skel top-anim interp) 0.0)
(set! (-> self travel-anim-interp) 0.0)
(logior! (-> self bot-flags) (bot-flags bf24))
@ -1584,7 +1584,7 @@
(set! (-> v1-7 enemy-flags) (the-as enemy-flag (logclear (-> v1-7 enemy-flags) (enemy-flag enemy-flag37))))
)
0
(look-at-target! self (enemy-flag lock-focus))
(look-at-target! self (enemy-flag look-at-focus))
(set! (-> self skel top-anim interp) 0.0)
(set! (-> self travel-anim-interp) 0.0)
)
@ -1644,7 +1644,7 @@
(set! (-> v1-7 enemy-flags) (the-as enemy-flag (logclear (-> v1-7 enemy-flags) (enemy-flag enemy-flag37))))
)
0
(look-at-target! self (enemy-flag lock-focus))
(look-at-target! self (enemy-flag look-at-focus))
(set! (-> self skel top-anim interp) 0.0)
(set! (-> self travel-anim-interp) 0.0)
(logior! (-> self bot-flags) (bot-flags bf24))
@ -1716,7 +1716,7 @@
(set! (-> v1-7 enemy-flags) (the-as enemy-flag (logclear (-> v1-7 enemy-flags) (enemy-flag enemy-flag37))))
)
0
(look-at-target! self (enemy-flag lock-focus))
(look-at-target! self (enemy-flag look-at-focus))
(set! (-> self skel top-anim interp) 0.0)
(set! (-> self travel-anim-interp) 0.0)
)
@ -1776,7 +1776,7 @@
(set! (-> v1-7 enemy-flags) (the-as enemy-flag (logclear (-> v1-7 enemy-flags) (enemy-flag enemy-flag37))))
)
0
(look-at-target! self (enemy-flag lock-focus))
(look-at-target! self (enemy-flag look-at-focus))
(set! (-> self skel top-anim interp) 0.0)
(set! (-> self travel-anim-interp) 0.0)
(vector-reset! (-> self root transv))

View File

@ -181,13 +181,16 @@
(s4-0 (-> arg0 root))
)
(when (>= 10012.445
(fabs (deg-
(atan (- (-> v1-22 trans x) (-> s4-0 trans x)) (- (-> v1-22 trans z) (-> s4-0 trans z)))
(quaternion-y-angle (-> s4-0 quat))
)
)
(fabs
(deg-
(atan (- (-> v1-22 trans x) (-> s4-0 trans x)) (- (-> v1-22 trans z) (-> s4-0 trans z)))
(quaternion-y-angle (-> s4-0 quat))
)
)
)
(set! (-> arg0 enemy-flags) (the-as enemy-flag (logclear (-> arg0 enemy-flags) (enemy-flag vulnerable))))
(set! (-> arg0 enemy-flags)
(the-as enemy-flag (logclear (-> arg0 enemy-flags) (enemy-flag jump-check-blocked)))
)
(when (send-event arg0 'jump 4 (-> (the-as process-focusable s5-1) root trans))
(set! (-> arg0 spot center quad) (-> (the-as process-focusable s5-1) root trans quad))
(set! (-> arg0 spot center w) 10240.0)
@ -277,7 +280,9 @@
)
0
(let ((s5-1 (-> arg0 course spots (-> this spot-indexes (-> this which-spot)))))
(set! (-> arg0 enemy-flags) (the-as enemy-flag (logclear (-> arg0 enemy-flags) (enemy-flag vulnerable))))
(set! (-> arg0 enemy-flags)
(the-as enemy-flag (logclear (-> arg0 enemy-flags) (enemy-flag jump-check-blocked)))
)
(when (send-event arg0 'jump 0 (-> s5-1 center))
(mem-copy! (the-as pointer (-> arg0 spot)) (the-as pointer s5-1) 20)
(return #t)

View File

@ -366,7 +366,7 @@
)
)
(defmethod track-target! ((this sig))
(defmethod common-post ((this sig))
"Does a lot of various things relating to interacting with the target
- tracks when the enemy was last drawn
- looks at the target and handles attacking
@ -415,7 +415,7 @@
)
)
)
(let ((t9-2 (method-of-type bot track-target!)))
(let ((t9-2 (method-of-type bot common-post)))
(t9-2 this)
)
(when (logtest? (-> this bot-flags) (bot-flags too-far-fail))
@ -610,7 +610,7 @@
(defmethod init-enemy! ((this sig))
"Common method called to initialize the enemy, typically sets up default field values and calls ancillary helper methods"
(init! this)
(set! (-> this channel) (the-as uint 21))
(set! (-> this channel) (gui-channel sig))
(set! (-> this notice-enemy-dist) 122880.0)
(set! (-> this travel-anim-interp) 0.0)
(set! (-> this plasma charge-speed) 0.125)
@ -823,10 +823,10 @@
)
)
(defmethod enemy-method-77 ((this sig) (arg0 (pointer float)))
(defmethod enemy-method-77 ((this sig) (arg0 enemy-knocked-info))
(case (-> this incoming knocked-type)
(((knocked-type knocked-type-6))
(let* ((v1-3 (enemy-method-120 this 3 (ash 1 (-> *sig-global-info* prev-blue-hit))))
(let* ((v1-3 (rnd-bit this 3 (ash 1 (-> *sig-global-info* prev-blue-hit))))
(s5-1 (-> this draw art-group data (-> *sig-global-info* blue-hit-anim v1-3 anim-index)))
)
(set! (-> *sig-global-info* prev-blue-hit) v1-3)
@ -893,7 +893,7 @@
(let ((a0-25 (-> this skel root-channel 0)))
(set! (-> a0-25 frame-group) (the-as art-joint-anim s4-1))
(set! (-> a0-25 param 0) (the float (+ (-> (the-as art-joint-anim s4-1) frames num-frames) -1)))
(set! (-> a0-25 param 1) (-> arg0 0))
(set! (-> a0-25 param 1) (-> arg0 anim-speed))
(set! (-> a0-25 frame-num) 0.0)
(joint-control-channel-group! a0-25 (the-as art-joint-anim s4-1) num-func-seek!)
)
@ -905,7 +905,7 @@
)
)
(defmethod enemy-method-78 ((this sig) (arg0 (pointer float)))
(defmethod enemy-method-78 ((this sig) (arg0 enemy-knocked-info))
(case (-> this incoming knocked-type)
(((knocked-type knocked-type-6))
(when (>= (-> this incoming blue-juggle-count) (the-as uint 2))
@ -1150,7 +1150,7 @@
(set! (-> this sig-path-start-time) (-> this sig-path-clock frame-counter))
(set! (-> this sig-path-cur-time) (-> this sig-path-start-time))
(set! (-> this sig-path-prev-time) (-> this sig-path-start-time))
(logclear! (-> this enemy-flags) (enemy-flag enable-on-active checking-water))
(logclear! (-> this enemy-flags) (enemy-flag vulnerable vulnerable-backup))
(none)
)

View File

@ -1156,7 +1156,7 @@
(a2-2 (handle->process (-> a1-5 creature)))
)
(when (and a2-2 (= a2-2 v1-0))
(when (not (logtest? (enemy-flag alert) (-> (the-as nav-enemy a2-2) enemy-flags)))
(when (not (logtest? (enemy-flag directed) (-> (the-as nav-enemy a2-2) enemy-flags)))
(set! (-> a1-5 creature) (the-as handle #f))
(set! a1-5 (the-as battle-spawner #f))
)
@ -1186,7 +1186,7 @@
)
(let ((s4-0 (handle->process (-> arg0 creature))))
(when s4-0
(when (not (logtest? (enemy-flag alert) (-> (the-as enemy s4-0) enemy-flags)))
(when (not (logtest? (enemy-flag directed) (-> (the-as enemy s4-0) enemy-flags)))
(set! (-> arg0 creature) (the-as handle #f))
(return #f)
)
@ -1197,7 +1197,7 @@
0
)
((zero? v1-20)
(when (or (logtest? (enemy-flag victory) (-> (the-as enemy s4-0) enemy-flags)) (not arg1))
(when (or (logtest? (enemy-flag directed-ready) (-> (the-as enemy s4-0) enemy-flags)) (not arg1))
(cond
((spawner-in-intro? this arg0)
(if (not (spawner-try-jump this arg0 (the-as enemy s4-0)))
@ -1237,7 +1237,9 @@
(get-point-in-path! (-> arg0 intro-path) s4-0 (the float s3-0) 'exact)
(let ((s3-1 (-> arg0 mode)))
(set! (-> arg0 mode) (the-as uint 2))
(set! (-> arg1 enemy-flags) (the-as enemy-flag (logclear (-> arg1 enemy-flags) (enemy-flag vulnerable))))
(set! (-> arg1 enemy-flags)
(the-as enemy-flag (logclear (-> arg1 enemy-flags) (enemy-flag jump-check-blocked)))
)
(cond
((send-event arg1 'jump 3 s4-0)
#t

View File

@ -268,15 +268,15 @@
(('hit-knocked)
(logclear! (-> this mask) (process-mask actor-pause))
(logclear! (-> this focus-status) (focus-status dangerous))
(logclear! (-> this enemy-flags) (enemy-flag enable-on-notice))
(logior! (-> this enemy-flags) (enemy-flag chase-startup))
(logclear! (-> this enemy-flags) (enemy-flag use-notice-distance))
(logior! (-> this enemy-flags) (enemy-flag alert))
(logior! (-> this focus-status) (focus-status hit))
(if (zero? (-> this hit-points))
(logior! (-> this focus-status) (focus-status dead))
)
(logclear! (-> this enemy-flags) (enemy-flag actor-pause-backup))
(logclear! (-> this enemy-flags) (enemy-flag lock-focus))
(enemy-method-62 this)
(logior! (-> this enemy-flags) (enemy-flag actor-pause-backup))
(logior! (-> this enemy-flags) (enemy-flag lock-focus))
(process-contact-action arg0)
(send-event arg0 'get-attack-count 1)
(when (= (-> this incoming knocked-type) (knocked-type knocked-type-4))
@ -292,7 +292,7 @@
)
)
(go (method-of-object this knocked))
(if (and (logtest? (-> this incoming penetrate-using) 16)
(if (and (logtest? (-> this incoming penetrate-using) (penetrate punch))
(nonzero? (-> this hit-points))
(zero? (-> this fated-time))
)
@ -353,11 +353,11 @@
)
)
(defmethod enemy-method-106 ((this amphibian) (arg0 process) (arg1 object) (arg2 int) (arg3 attack-info))
(let ((t9-0 (method-of-type nav-enemy enemy-method-106)))
(defmethod set-incoming-attack-info ((this amphibian) (arg0 process) (arg1 object) (arg2 penetrate) (arg3 attack-info))
(let ((t9-0 (method-of-type nav-enemy set-incoming-attack-info)))
(t9-0 this arg0 arg1 arg2 arg3)
)
(let ((a0-3 (enemy-method-134 this arg0 arg3)))
(let ((a0-3 (get-attacker this arg0 arg3)))
(if a0-3
(set! (-> this attacker-handle) (process->handle a0-3))
(set! (-> this attacker-handle) (the-as handle #f))
@ -410,7 +410,7 @@
(cond
((and (nonzero? (-> this hit-points)) (zero? (-> this fated-time)) (!= (-> this incoming knocked-type) 6))
(enemy-method-50 this arg0)
(let ((f30-0 (get-rand-float-range this 0.0 1.0)))
(let ((f30-0 (rnd-float-range this 0.0 1.0)))
(vector-float*! arg0 arg0 (lerp 43417.6 58982.4 f30-0))
(set! (-> arg0 y) (lerp 114688.0 116736.0 f30-0))
)
@ -422,10 +422,10 @@
(none)
)
(defmethod enemy-method-77 ((this amphibian) (arg0 (pointer float)))
(defmethod enemy-method-77 ((this amphibian) (arg0 enemy-knocked-info))
(case (-> this incoming knocked-type)
(((knocked-type knocked-type-6))
(let* ((v1-3 (enemy-method-120 this 3 (ash 1 (-> *amphibian-global-info* prev-blue-hit))))
(let* ((v1-3 (rnd-bit this 3 (ash 1 (-> *amphibian-global-info* prev-blue-hit))))
(s5-1 (-> this draw art-group data (-> *amphibian-global-info* blue-hit-anim v1-3)))
)
(set! (-> *amphibian-global-info* prev-blue-hit) v1-3)
@ -443,7 +443,7 @@
(let ((v1-11 0))
(when (or (zero? (-> this hit-points)) (nonzero? (-> this fated-time)))
(let ((a2-5 (logior (ash 1 (-> *amphibian-global-info* prev-knocked)) 1)))
(set! v1-11 (enemy-method-120 this 3 a2-5))
(set! v1-11 (rnd-bit this 3 a2-5))
)
)
(set! (-> *amphibian-global-info* prev-knocked) v1-11)
@ -453,7 +453,7 @@
(let ((a0-25 (-> this skel root-channel 0)))
(set! (-> a0-25 frame-group) (the-as art-joint-anim s4-0))
(set! (-> a0-25 param 0) (the float (+ (-> (the-as art-joint-anim s4-0) frames num-frames) -1)))
(set! (-> a0-25 param 1) (-> arg0 0))
(set! (-> a0-25 param 1) (-> arg0 anim-speed))
(set! (-> a0-25 frame-num) 0.0)
(joint-control-channel-group! a0-25 (the-as art-joint-anim s4-0) num-func-seek!)
)
@ -464,7 +464,7 @@
#t
)
(defmethod enemy-method-78 ((this amphibian) (arg0 (pointer float)))
(defmethod enemy-method-78 ((this amphibian) (arg0 enemy-knocked-info))
(cond
((= (-> this incoming knocked-type) (knocked-type knocked-type-6))
(when (>= (-> this incoming blue-juggle-count) (the-as uint 2))
@ -474,7 +474,7 @@
(set! (-> a0-3 param 0)
(the float (+ (-> (the-as art-joint-anim (-> this draw art-group data 25)) frames num-frames) -1))
)
(set! (-> a0-3 param 1) (-> arg0 0))
(set! (-> a0-3 param 1) (-> arg0 anim-speed))
(set! (-> a0-3 frame-num) 0.0)
(joint-control-channel-group! a0-3 (the-as art-joint-anim (-> this draw art-group data 25)) num-func-seek!)
)
@ -493,7 +493,7 @@
(let ((a0-10 (-> this skel root-channel 0)))
(set! (-> a0-10 frame-group) (the-as art-joint-anim s4-0))
(set! (-> a0-10 param 0) (the float (+ (-> (the-as art-joint-anim s4-0) frames num-frames) -1)))
(set! (-> a0-10 param 1) (-> arg0 0))
(set! (-> a0-10 param 1) (-> arg0 anim-speed))
(set! (-> a0-10 frame-num) 0.0)
(joint-control-channel-group! a0-10 (the-as art-joint-anim s4-0) num-func-seek!)
)
@ -508,7 +508,7 @@
(set! (-> a0-1 param 0) 1.0)
(joint-control-channel-group! a0-1 (the-as art-joint-anim #f) num-func-loop!)
)
(let* ((v1-5 (get-rand-int this 2))
(let* ((v1-5 (rnd-int-count this 2))
(s4-0 (-> this draw art-group data (-> *amphibian-global-info* jump-wind-up-anim v1-5)))
)
(set! (-> this jump-anim-index) v1-5)
@ -857,14 +857,14 @@
(go (method-of-object this hostile))
)
(defmethod track-target! ((this amphibian))
(defmethod common-post ((this amphibian))
"Does a lot of various things relating to interacting with the target
- tracks when the enemy was last drawn
- looks at the target and handles attacking
@TODO Not extremely well understood yet"
(set! (-> this prev-ry) (-> this prev-ry1))
(set! (-> this prev-ry1) (quaternion-y-angle (-> this root quat)))
((method-of-type nav-enemy track-target!) this)
((method-of-type nav-enemy common-post) this)
(none)
)
@ -921,7 +921,7 @@
)
(cond
((and v1-29 (= v1-29 (-> this draw art-group data 26)))
(when (and s5-0 (zero? (get-rand-int this 5)))
(when (and s5-0 (zero? (rnd-int-count this 5)))
(ja-channel-push! 1 (seconds 0.15))
(let ((s5-3 (-> this skel root-channel 0)))
(set! (-> s5-3 dist) 12288.0)
@ -1021,7 +1021,7 @@
(amphibian-method-187 self)
(suspend)
)
(when (enemy-method-123 self 0.2)
(when (rnd-go-idle? self 0.2)
(ja-no-eval :num! (loop!))
(ja-channel-push! 1 (seconds 0.6))
(let ((v1-15 self))
@ -1036,7 +1036,7 @@
(suspend)
(ja :num! (seek!))
)
(until (not (enemy-method-123 self 0.2))
(until (not (rnd-go-idle? self 0.2))
(ja-no-eval :group! (-> self draw art-group data (-> self enemy-info idle-anim)) :num! (seek!) :frame-num 0.0)
(until (ja-done? 0)
(suspend)
@ -1090,8 +1090,8 @@
)
:code (behavior ()
(ja-channel-push! 1 (seconds 0.1))
(let ((f30-0 (get-rand-float-range self 0.8 1.2))
(a1-3 (-> self draw art-group data (-> *amphibian-global-info* notice-anim (get-rand-int self 2))))
(let ((f30-0 (rnd-float-range self 0.8 1.2))
(a1-3 (-> self draw art-group data (-> *amphibian-global-info* notice-anim (rnd-int-count self 2))))
(gp-1 (new 'stack-no-clear 'vector))
)
(vector-! gp-1 (-> self focus-pos) (-> self root trans))
@ -1162,7 +1162,7 @@
(set! (-> v1-4 enemy-flags) (the-as enemy-flag (logclear (-> v1-4 enemy-flags) (enemy-flag enemy-flag37))))
)
0
(logior! (-> self enemy-flags) (enemy-flag actor-pause-backup))
(logior! (-> self enemy-flags) (enemy-flag lock-focus))
(let ((v1-8 (-> self nav)))
(set! (-> v1-8 turning-acceleration) 204800.0)
)
@ -1176,8 +1176,8 @@
)
(else
(vector-z-quaternion! (-> self focus-pos) (-> self root quat))
(let ((f30-0 (get-rand-float-range self 8192.0 16384.0)))
(if (zero? (get-rand-int self 2))
(let ((f30-0 (rnd-float-range self 8192.0 16384.0)))
(if (zero? (rnd-int-count self 2))
(set! f30-0 (- f30-0))
)
(vector-rotate-around-y! (-> self focus-pos) (-> self focus-pos) f30-0)
@ -1195,11 +1195,11 @@
(t9-0)
)
)
(logclear! (-> self enemy-flags) (enemy-flag actor-pause-backup))
(logclear! (-> self enemy-flags) (enemy-flag lock-focus))
)
:trans (behavior ()
(when (logtest? (-> self enemy-flags) (enemy-flag look-at-focus))
(logclear! (-> self enemy-flags) (enemy-flag look-at-focus))
(when (logtest? (-> self enemy-flags) (enemy-flag victory))
(logclear! (-> self enemy-flags) (enemy-flag victory))
(sound-play "amphib-hit")
)
)
@ -1220,7 +1220,7 @@
)
(else
(let ((v1-22 (>= (vector-dot s5-0 gp-0) 0.0)))
(if (logtest? (enemy-flag dislike-combo) (-> self enemy-flags))
(if (logtest? (enemy-flag drawn-mirrored) (-> self enemy-flags))
(set! v1-22 (not v1-22))
)
(if v1-22
@ -1263,7 +1263,7 @@
:trans (-> (method-of-type nav-enemy stare) trans)
:code (behavior ()
(ja-channel-push! 1 (seconds 0.1))
(let ((gp-0 (get-rand-int-range self 1 3)))
(let ((gp-0 (rnd-int-range self 1 3)))
(dotimes (s5-0 gp-0)
(ja-no-eval :group! amphibian-idle-ja :num! (seek!) :frame-num 0.0)
(until (ja-done? 0)
@ -1285,8 +1285,8 @@
(t9-0)
)
)
(when (logtest? (-> self enemy-flags) (enemy-flag look-at-focus))
(logclear! (-> self enemy-flags) (enemy-flag look-at-focus))
(when (logtest? (-> self enemy-flags) (enemy-flag victory))
(logclear! (-> self enemy-flags) (enemy-flag victory))
(go-virtual attack-spin)
)
(let ((a0-2 (get-enemy-target self)))
@ -1326,7 +1326,7 @@
:virtual #t
:event enemy-event-handler
:enter (behavior ()
(logior! (-> self enemy-flags) (enemy-flag actor-pause-backup))
(logior! (-> self enemy-flags) (enemy-flag lock-focus))
(let ((v1-2 self))
(set! (-> v1-2 enemy-flags) (the-as enemy-flag (logclear (-> v1-2 enemy-flags) (enemy-flag enemy-flag36))))
(set! (-> v1-2 nav callback-info) *nav-enemy-null-callback-info*)
@ -1352,15 +1352,15 @@
)
)
:exit (behavior ()
(logclear! (-> self enemy-flags) (enemy-flag actor-pause-backup))
(if (logtest? (-> self enemy-flags) (enemy-flag check-water))
(logclear! (-> self enemy-flags) (enemy-flag lock-focus))
(if (logtest? (-> self enemy-flags) (enemy-flag dangerous-backup))
(logior! (-> self focus-status) (focus-status dangerous))
(logclear! (-> self focus-status) (focus-status dangerous))
)
)
:trans (behavior ()
(when (logtest? (-> self enemy-flags) (enemy-flag look-at-focus))
(logclear! (-> self enemy-flags) (enemy-flag look-at-focus))
(when (logtest? (-> self enemy-flags) (enemy-flag victory))
(logclear! (-> self enemy-flags) (enemy-flag victory))
(sound-play "amphib-hit")
)
)
@ -1388,7 +1388,7 @@
(set! (-> v1-3 turning-acceleration) 204800.0)
)
0
(logior! (-> self enemy-flags) (enemy-flag actor-pause-backup))
(logior! (-> self enemy-flags) (enemy-flag lock-focus))
(let ((v1-7 self))
(if (not (logtest? (enemy-flag enemy-flag36) (-> v1-7 enemy-flags)))
(set! (-> v1-7 enemy-flags) (the-as enemy-flag (logior (enemy-flag enemy-flag38) (-> v1-7 enemy-flags))))
@ -1404,15 +1404,15 @@
(logior! (-> self focus-status) (focus-status dangerous))
)
:exit (behavior ()
(logclear! (-> self enemy-flags) (enemy-flag actor-pause-backup))
(if (logtest? (-> self enemy-flags) (enemy-flag check-water))
(logclear! (-> self enemy-flags) (enemy-flag lock-focus))
(if (logtest? (-> self enemy-flags) (enemy-flag dangerous-backup))
(logior! (-> self focus-status) (focus-status dangerous))
(logclear! (-> self focus-status) (focus-status dangerous))
)
)
:trans (behavior ()
(when (logtest? (-> self enemy-flags) (enemy-flag look-at-focus))
(logclear! (-> self enemy-flags) (enemy-flag look-at-focus))
(when (logtest? (-> self enemy-flags) (enemy-flag victory))
(logclear! (-> self enemy-flags) (enemy-flag victory))
(sound-play "amphib-hit")
)
)
@ -1445,7 +1445,7 @@
:virtual #t
:event enemy-event-handler
:enter (behavior ()
(logior! (-> self enemy-flags) (enemy-flag actor-pause-backup))
(logior! (-> self enemy-flags) (enemy-flag lock-focus))
(logior! (-> self focus-status) (focus-status dangerous))
(let ((v1-4 self))
(set! (-> v1-4 enemy-flags) (the-as enemy-flag (logclear (-> v1-4 enemy-flags) (enemy-flag enemy-flag36))))
@ -1455,15 +1455,15 @@
(nav-enemy-method-167 self)
)
:exit (behavior ()
(logclear! (-> self enemy-flags) (enemy-flag actor-pause-backup))
(if (logtest? (-> self enemy-flags) (enemy-flag check-water))
(logclear! (-> self enemy-flags) (enemy-flag lock-focus))
(if (logtest? (-> self enemy-flags) (enemy-flag dangerous-backup))
(logior! (-> self focus-status) (focus-status dangerous))
(logclear! (-> self focus-status) (focus-status dangerous))
)
)
:trans (behavior ()
(when (logtest? (-> self enemy-flags) (enemy-flag look-at-focus))
(logclear! (-> self enemy-flags) (enemy-flag look-at-focus))
(when (logtest? (-> self enemy-flags) (enemy-flag victory))
(logclear! (-> self enemy-flags) (enemy-flag victory))
(sound-play "amphib-hit")
)
)
@ -1482,7 +1482,7 @@
:virtual #t
:event enemy-event-handler
:enter (behavior ()
(logior! (-> self enemy-flags) (enemy-flag actor-pause-backup))
(logior! (-> self enemy-flags) (enemy-flag lock-focus))
(let ((v1-2 self))
(set! (-> v1-2 enemy-flags) (the-as enemy-flag (logclear (-> v1-2 enemy-flags) (enemy-flag enemy-flag36))))
(set! (-> v1-2 nav callback-info) *nav-enemy-null-callback-info*)
@ -1512,15 +1512,15 @@
)
)
:exit (behavior ()
(logclear! (-> self enemy-flags) (enemy-flag actor-pause-backup))
(if (logtest? (-> self enemy-flags) (enemy-flag check-water))
(logclear! (-> self enemy-flags) (enemy-flag lock-focus))
(if (logtest? (-> self enemy-flags) (enemy-flag dangerous-backup))
(logior! (-> self focus-status) (focus-status dangerous))
(logclear! (-> self focus-status) (focus-status dangerous))
)
)
:trans (behavior ()
(when (logtest? (-> self enemy-flags) (enemy-flag look-at-focus))
(logclear! (-> self enemy-flags) (enemy-flag look-at-focus))
(when (logtest? (-> self enemy-flags) (enemy-flag victory))
(logclear! (-> self enemy-flags) (enemy-flag victory))
(sound-play "amphib-hit")
)
)
@ -1541,7 +1541,7 @@
)
(else
(let ((v1-22 (>= (vector-dot s5-0 gp-0) 0.0)))
(if (logtest? (enemy-flag dislike-combo) (-> self enemy-flags))
(if (logtest? (enemy-flag drawn-mirrored) (-> self enemy-flags))
(set! v1-22 (not v1-22))
)
(if v1-22
@ -1590,7 +1590,7 @@
(nav-enemy-method-167 self)
(set! (-> self tongue-scale) 0.0)
(set! (-> self tongue-mode) (the-as uint 0))
(logior! (-> self enemy-flags) (enemy-flag actor-pause-backup))
(logior! (-> self enemy-flags) (enemy-flag lock-focus))
(sound-play "tongue-warn")
(let ((gp-1 (new 'stack-no-clear 'amphibian-tongue-attack-info)))
(amphibian-method-185 self gp-1)
@ -1600,7 +1600,7 @@
)
:exit (behavior ()
(set! (-> self draw bounds w) 22528.0)
(logclear! (-> self enemy-flags) (enemy-flag actor-pause-backup))
(logclear! (-> self enemy-flags) (enemy-flag lock-focus))
)
:trans (behavior ()
(let ((v1-0 (-> self tongue-mode)))

View File

@ -601,7 +601,7 @@
)
:code (behavior ()
(ja-channel-push! 1 (seconds 0.075))
(let ((f30-0 (get-rand-float-range self 0.8 1.2)))
(let ((f30-0 (rnd-float-range self 0.8 1.2)))
(ja-no-eval :group! (-> self draw art-group data (-> self enemy-info victory-anim))
:num! (seek! max f30-0)
:frame-num 0.0
@ -637,7 +637,7 @@
)
:code (behavior ()
(ja-channel-push! 1 (seconds 0.2))
(let ((f30-0 (get-rand-float-range self 0.9 1.1)))
(let ((f30-0 (rnd-float-range self 0.9 1.1)))
(until #f
(ja-no-eval :group! centurion-idle-ja :num! (seek! max f30-0) :frame-num 0.0)
(until (ja-done? 0)
@ -753,7 +753,7 @@
(set! (-> self can-take-damage?) #f)
(set! (-> self root root-prim specific 0) (-> self root root-prim specific 1))
(centurion-shield-big)
(if (logtest? (-> self enemy-flags) (enemy-flag check-water))
(if (logtest? (-> self enemy-flags) (enemy-flag dangerous-backup))
(logior! (-> self focus-status) (focus-status dangerous))
(logclear! (-> self focus-status) (focus-status dangerous))
)
@ -855,7 +855,7 @@
(collide-action solid)
)
(set! (-> (the-as collide-shape-prim-group (-> self root root-prim)) child 3 local-sphere w) 5120.0)
(if (logtest? (-> self enemy-flags) (enemy-flag check-water))
(if (logtest? (-> self enemy-flags) (enemy-flag dangerous-backup))
(logior! (-> self focus-status) (focus-status dangerous))
(logclear! (-> self focus-status) (focus-status dangerous))
)
@ -872,14 +872,14 @@
:post enemy-simple-post
)
(defmethod dispose! ((this centurion))
(defmethod dying ((this centurion))
"Cleans-up the enemy and any associated resources. Potentially spawns skull gems"
(play-communicator-speech! (-> *talker-speech* 58))
(call-parent-method this)
(none)
)
(defmethod track-target! ((this centurion))
(defmethod common-post ((this centurion))
"Does a lot of various things relating to interacting with the target
- tracks when the enemy was last drawn
- looks at the target and handles attacking
@ -970,7 +970,7 @@
)
(logior! (-> this skel status) (joint-control-status sync-math))
(los-control-method-9 (-> this los) (the-as process-focusable #f) (the-as vector #f) 2048.0)
(let ((t9-12 (method-of-type nav-enemy track-target!)))
(let ((t9-12 (method-of-type nav-enemy common-post)))
(t9-12 this)
)
(when (not (logtest? (-> this draw status) (draw-control-status no-draw)))
@ -987,16 +987,16 @@
(set! (-> s5-1 trans quad) a2-11)
)
(let ((s4-1 (new 'stack-no-clear 'matrix)))
(if (logtest? (enemy-flag dislike-combo) (-> this enemy-flags))
(if (logtest? (enemy-flag drawn-mirrored) (-> this enemy-flags))
(vector-negate-in-place! (the-as vector (-> s5-1 vector)))
)
(matrix-rotate-y! s4-1 (if (logtest? (enemy-flag dislike-combo) (-> this enemy-flags))
(matrix-rotate-y! s4-1 (if (logtest? (enemy-flag drawn-mirrored) (-> this enemy-flags))
2548.6223
-2548.6223
)
)
(matrix*! s5-1 s4-1 s5-1)
(matrix-rotate-z! s4-1 (if (logtest? (enemy-flag dislike-combo) (-> this enemy-flags))
(matrix-rotate-z! s4-1 (if (logtest? (enemy-flag drawn-mirrored) (-> this enemy-flags))
691.76886
-691.76886
)
@ -1006,7 +1006,7 @@
(let ((a1-20 (-> s5-1 trans)))
(let ((v1-143 (-> s5-1 trans)))
(let ((a0-25 (-> s5-1 vector)))
(let ((a2-18 (the-as float (if (logtest? (enemy-flag dislike-combo) (-> this enemy-flags))
(let ((a2-18 (the-as float (if (logtest? (enemy-flag drawn-mirrored) (-> this enemy-flags))
-997237719
#x43a3d70a
)
@ -1157,7 +1157,7 @@
)
)
:code (behavior ()
(get-rand-float-range self 0.9 1.1)
(rnd-float-range self 0.9 1.1)
-1
0.0
1.0
@ -1169,7 +1169,7 @@
)
(let ((f30-0 24576.0))
(until #f
(set-vector! s5-0 (get-rand-float-range self -1.0 1.0) 0.0 (get-rand-float-range self -1.0 1.0) 1.0)
(set-vector! s5-0 (rnd-float-range self -1.0 1.0) 0.0 (rnd-float-range self -1.0 1.0) 1.0)
(vector-normalize! s5-0 f30-0)
(vector+! gp-0 (-> self root trans) s5-0)
(if (centurion-method-182 self gp-0)
@ -1263,7 +1263,7 @@
:post nav-enemy-travel-post
)
(defmethod enemy-method-77 ((this centurion) (arg0 (pointer float)))
(defmethod enemy-method-77 ((this centurion) (arg0 enemy-knocked-info))
(cond
((zero? (-> this hit-points))
(ja-channel-push! 1 (seconds 0.17))
@ -1272,7 +1272,7 @@
(set! (-> a0-2 param 0)
(the float (+ (-> (the-as art-joint-anim (-> this draw art-group data 5)) frames num-frames) -1))
)
(set! (-> a0-2 param 1) (-> arg0 0))
(set! (-> a0-2 param 1) (-> arg0 anim-speed))
(set! (-> a0-2 frame-num) 0.0)
(joint-control-channel-group! a0-2 (the-as art-joint-anim (-> this draw art-group data 5)) num-func-seek!)
)
@ -1283,14 +1283,14 @@
(((knocked-type knocked-type-4))
(ja-channel-push! 1 (seconds 0.1))
(let* ((a2-1 (ash 1 (-> *centurion-global-info* prev-yellow-hit)))
(v1-18 (enemy-method-120 this 1 a2-1))
(v1-18 (rnd-bit this 1 a2-1))
(a1-8 (-> this draw art-group data (-> *centurion-global-info* yellow-hit-anim v1-18)))
)
(set! (-> *centurion-global-info* prev-yellow-hit) v1-18)
(let ((a0-15 (-> this skel root-channel 0)))
(set! (-> a0-15 frame-group) (the-as art-joint-anim a1-8))
(set! (-> a0-15 param 0) (the float (+ (-> (the-as art-joint-anim a1-8) frames num-frames) -1)))
(set! (-> a0-15 param 1) (-> arg0 0))
(set! (-> a0-15 param 1) (-> arg0 anim-speed))
(set! (-> a0-15 frame-num) 0.0)
(joint-control-channel-group! a0-15 (the-as art-joint-anim a1-8) num-func-seek!)
)
@ -1298,7 +1298,7 @@
)
(((knocked-type knocked-type-6))
(let* ((a2-3 (ash 1 (-> *centurion-global-info* prev-blue-hit)))
(v1-27 (enemy-method-120 this 3 a2-3))
(v1-27 (rnd-bit this 3 a2-3))
(a1-13 (-> this draw art-group data (-> *centurion-global-info* blue-hit-anim v1-27)))
)
(set! (-> *centurion-global-info* prev-blue-hit) v1-27)
@ -1322,7 +1322,7 @@
(let ((a0-30 (-> this skel root-channel 0)))
(set! (-> a0-30 frame-group) (the-as art-joint-anim s4-0))
(set! (-> a0-30 param 0) (the float (+ (-> (the-as art-joint-anim s4-0) frames num-frames) -1)))
(set! (-> a0-30 param 1) (-> arg0 0))
(set! (-> a0-30 param 1) (-> arg0 anim-speed))
(set! (-> a0-30 frame-num) 0.0)
(joint-control-channel-group! a0-30 (the-as art-joint-anim s4-0) num-func-seek!)
)
@ -1334,7 +1334,7 @@
)
)
(defmethod enemy-method-78 ((this centurion) (arg0 (pointer float)))
(defmethod enemy-method-78 ((this centurion) (arg0 enemy-knocked-info))
(cond
((zero? (-> this hit-points))
(ja-channel-push! 1 (seconds 0.17))
@ -1343,7 +1343,7 @@
(set! (-> a0-2 param 0)
(the float (+ (-> (the-as art-joint-anim (-> this draw art-group data 33)) frames num-frames) -1))
)
(set! (-> a0-2 param 1) (-> arg0 0))
(set! (-> a0-2 param 1) (-> arg0 anim-speed))
(set! (-> a0-2 frame-num) 0.0)
(joint-control-channel-group! a0-2 (the-as art-joint-anim (-> this draw art-group data 33)) num-func-seek!)
)
@ -1358,7 +1358,7 @@
(let ((a0-5 (-> this skel root-channel 0)))
(set! (-> a0-5 frame-group) (the-as art-joint-anim s4-0))
(set! (-> a0-5 param 0) (the float (+ (-> (the-as art-joint-anim s4-0) frames num-frames) -1)))
(set! (-> a0-5 param 1) (-> arg0 0))
(set! (-> a0-5 param 1) (-> arg0 anim-speed))
(joint-control-channel-group! a0-5 (the-as art-joint-anim s4-0) num-func-seek!)
)
)
@ -1372,7 +1372,7 @@
(set! (-> a0-7 param 0)
(the float (+ (-> (the-as art-joint-anim (-> this draw art-group data 22)) frames num-frames) -1))
)
(set! (-> a0-7 param 1) (-> arg0 0))
(set! (-> a0-7 param 1) (-> arg0 anim-speed))
(joint-control-channel-group! a0-7 (the-as art-joint-anim (-> this draw art-group data 22)) num-func-seek!)
)
#t

View File

@ -543,7 +543,7 @@
)
)
(defmethod enemy-method-77 ((this flitter) (arg0 (pointer float)))
(defmethod enemy-method-77 ((this flitter) (arg0 enemy-knocked-info))
(case (-> this incoming knocked-type)
(((knocked-type knocked-type-4))
(let ((a0-2 (-> this skel root-channel 0)))
@ -551,7 +551,7 @@
(set! (-> a0-2 param 0)
(the float (+ (-> (the-as art-joint-anim (-> this draw art-group data 20)) frames num-frames) -1))
)
(set! (-> a0-2 param 1) (-> arg0 0))
(set! (-> a0-2 param 1) (-> arg0 anim-speed))
(set! (-> a0-2 frame-num) 0.0)
(joint-control-channel-group! a0-2 (the-as art-joint-anim (-> this draw art-group data 20)) num-func-seek!)
)
@ -585,7 +585,7 @@
)
)
(defmethod enemy-method-78 ((this flitter) (arg0 (pointer float)))
(defmethod enemy-method-78 ((this flitter) (arg0 enemy-knocked-info))
(case (-> this incoming knocked-type)
(((knocked-type knocked-type-6))
(when (>= (-> this incoming blue-juggle-count) (the-as uint 2))
@ -620,8 +620,8 @@
(defstate ambush (flitter)
:virtual #t
:enter (behavior ()
(when (logtest? (-> self enemy-flags) (enemy-flag auto-reset-penetrate))
(logclear! (-> self enemy-flags) (enemy-flag auto-reset-penetrate))
(when (logtest? (-> self enemy-flags) (enemy-flag enable-on-notice))
(logclear! (-> self enemy-flags) (enemy-flag enable-on-notice))
(let ((gp-0 (-> self on-notice)))
(if gp-0
(script-eval gp-0 :vector (-> self root trans))
@ -695,7 +695,7 @@
)
)
(let ((gp-3 (current-time)))
(until (time-elapsed? gp-3 (the int (* 300.0 (get-rand-float-range self 0.0 0.6))))
(until (time-elapsed? gp-3 (the int (* 300.0 (rnd-float-range self 0.0 0.6))))
(suspend)
)
)
@ -720,11 +720,11 @@
(set! (-> v1-3 enemy-flags) (the-as enemy-flag (logior (enemy-flag enemy-flag37) (-> v1-3 enemy-flags))))
)
0
(look-at-target! self (enemy-flag lock-focus))
(look-at-target! self (enemy-flag look-at-focus))
(set-time! (-> self state-time))
(let ((gp-0 (-> self root)))
(vector-reset! (-> gp-0 transv))
(set! (-> gp-0 transv y) (* 4096.0 (get-rand-float-range self 34.0 38.0)))
(set! (-> gp-0 transv y) (* 4096.0 (rnd-float-range self 34.0 38.0)))
)
)
:code (behavior ()
@ -945,7 +945,7 @@
:virtual #t
:code (behavior ()
(ja-channel-push! 1 (seconds 0.1))
(let ((f30-0 (get-rand-float-range self 0.8 1.2)))
(let ((f30-0 (rnd-float-range self 0.8 1.2)))
(until #f
(when (not (enemy-method-96 self 2730.6667 #t))
(let ((v1-5 self))
@ -1053,12 +1053,12 @@
(ja-channel-push! 1 (seconds 0.2))
(until #f
(ja-no-eval :group! (-> self draw art-group data (-> self enemy-info run-anim))
:num! (seek! max (get-rand-float-range self 0.9 1.1))
:num! (seek! max (rnd-float-range self 0.9 1.1))
:frame-num 0.0
)
(until (ja-done? 0)
(suspend)
(ja :num! (seek! max (get-rand-float-range self 0.9 1.1)))
(ja :num! (seek! max (rnd-float-range self 0.9 1.1)))
)
)
#f
@ -1148,7 +1148,7 @@
)
)
:exit (behavior ()
(if (logtest? (-> self enemy-flags) (enemy-flag check-water))
(if (logtest? (-> self enemy-flags) (enemy-flag dangerous-backup))
(logior! (-> self focus-status) (focus-status dangerous))
(logclear! (-> self focus-status) (focus-status dangerous))
)
@ -1216,11 +1216,11 @@
)
0
(ja-channel-push! 1 (seconds 0.1))
(if (logtest? (-> self enemy-flags) (enemy-flag check-water))
(if (logtest? (-> self enemy-flags) (enemy-flag dangerous-backup))
(logior! (-> self focus-status) (focus-status dangerous))
(logclear! (-> self focus-status) (focus-status dangerous))
)
(dotimes (gp-1 (get-rand-int self 3))
(dotimes (gp-1 (rnd-int-count self 3))
(ja-no-eval :group! flitter-idle-ja :num! (seek!) :frame-num 0.0)
(until (ja-done? 0)
(suspend)
@ -1240,7 +1240,7 @@
)
)
(defmethod dispose! ((this flitter))
(defmethod dying ((this flitter))
"Cleans-up the enemy and any associated resources. Potentially spawns skull gems"
(when (-> this minimap)
(logior! (-> this minimap flags) (minimap-flag fade-out))

View File

@ -315,12 +315,12 @@
)
;; WARN: Return type mismatch object vs none.
(defmethod track-target! ((this fodder))
(defmethod common-post ((this fodder))
"Does a lot of various things relating to interacting with the target
- tracks when the enemy was last drawn
- looks at the target and handles attacking
@TODO Not extremely well understood yet"
(let ((parent-method (method-of-type nav-enemy track-target!)))
(let ((parent-method (method-of-type nav-enemy common-post)))
(parent-method this)
)
(let ((proc (the-as process-drawable #f)))
@ -356,7 +356,7 @@
)
)
)
((logtest? (-> this enemy-flags) (enemy-flag lock-focus))
((logtest? (-> this enemy-flags) (enemy-flag look-at-focus))
(look-at-position! this (the-as vector #f))
)
)
@ -384,10 +384,10 @@
(func)
)
)
(logclear! (-> self enemy-flags) (enemy-flag spawn-gem chase-startup use-notice-distance))
(logclear! (-> self enemy-flags) (enemy-flag notice alert cam-attack-mode))
)
:code (behavior ()
(let ((f30-0 (get-rand-float-range self 0.9 1.1)))
(let ((f30-0 (rnd-float-range self 0.9 1.1)))
(until #f
(ja-no-eval :group! (-> self draw art-group data (-> self enemy-info walk-anim))
:num! (seek! max f30-0)
@ -397,7 +397,7 @@
(suspend)
(ja :num! (seek! max f30-0))
)
(when (enemy-method-123 self 0.8)
(when (rnd-go-idle? self 0.8)
(let ((_self self))
(set! (-> _self enemy-flags) (the-as enemy-flag (logclear (-> _self enemy-flags) (enemy-flag enemy-flag36))))
(set! (-> _self nav callback-info) *nav-enemy-null-callback-info*)
@ -454,7 +454,7 @@
:virtual #t
:code (behavior ()
(ja-channel-push! 1 (seconds 0.075))
(let ((f30-0 (get-rand-float-range self 0.8 1.2))
(let ((f30-0 (rnd-float-range self 0.8 1.2))
(gp-0 (new 'stack-no-clear 'vector))
)
(stop-looking-at-target! self)
@ -513,9 +513,9 @@
)
)
(label cfg-22)
(get-rand-float-range self 0.8 1.2)
(rnd-float-range self 0.8 1.2)
(new 'stack-no-clear 'vector)
(look-at-target! self (enemy-flag lock-focus))
(look-at-target! self (enemy-flag look-at-focus))
(stop-looking-at-target! self)
(if (nonzero? (-> self left-eye))
(shut-down (-> self left-eye))
@ -593,7 +593,7 @@
))
0
(fodder-method-181 self #f)
(if (logtest? (-> self enemy-flags) (enemy-flag check-water))
(if (logtest? (-> self enemy-flags) (enemy-flag dangerous-backup))
(logior! (-> self focus-status) (focus-status dangerous))
(logclear! (-> self focus-status) (focus-status dangerous))
)
@ -623,7 +623,7 @@
(ja-channel-push! 1 (seconds 0.08))
(ja :group! (-> self draw art-group data (-> self enemy-info idle-anim)))
(ja :num-func num-func-identity :frame-num 0.0)
(if (logtest? (-> self enemy-flags) (enemy-flag check-water))
(if (logtest? (-> self enemy-flags) (enemy-flag dangerous-backup))
(logior! (-> self focus-status) (focus-status dangerous))
(logclear! (-> self focus-status) (focus-status dangerous))
)
@ -762,7 +762,7 @@
)
:code (behavior ()
(fodder-method-182 self)
(let ((f30-0 (get-rand-float-range self 0.9 1.1)))
(let ((f30-0 (rnd-float-range self 0.9 1.1)))
(until #f
(suspend)
(ja :num! (loop! f30-0))
@ -832,8 +832,8 @@
(ja-channel-push! 1 (seconds 0.1))
)
)
(let ((s5-0 (get-rand-int self 8))
(f30-0 (get-rand-float-range self 0.9 1.1))
(let ((s5-0 (rnd-int-count self 8))
(f30-0 (rnd-float-range self 0.9 1.1))
)
(while (nonzero? s5-0)
(+! s5-0 -1)
@ -861,7 +861,7 @@
(ja-channel-push! 1 (seconds 0.1))
)
)
(let ((f30-2 (get-rand-float-range self 0.9 1.1)))
(let ((f30-2 (rnd-float-range self 0.9 1.1)))
(ja-no-eval :group! (-> self draw art-group data (-> self enemy-info victory-anim))
:num! (seek! max f30-2)
:frame-num 0.0
@ -877,11 +877,11 @@
)
)
(defmethod enemy-method-77 ((this fodder) (arg0 (pointer float)))
(defmethod enemy-method-77 ((this fodder) (arg0 enemy-knocked-info))
(case (-> this incoming knocked-type)
(((knocked-type knocked-type-6))
(let* ((a2-0 (ash 1 (-> *fodder-global-info* prev-blue-hit)))
(v1-3 (enemy-method-120 this 3 a2-0))
(v1-3 (rnd-bit this 3 a2-0))
(s5-1 (-> this draw art-group data (-> *fodder-global-info* blue-hit-anim v1-3 anim-index)))
)
(set! (-> *fodder-global-info* prev-blue-hit) v1-3)
@ -910,7 +910,7 @@
(let ((a0-20 (-> this skel root-channel 0)))
(set! (-> a0-20 frame-group) (the-as art-joint-anim s4-0))
(set! (-> a0-20 param 0) (the float (+ (-> (the-as art-joint-anim s4-0) frames num-frames) -1)))
(set! (-> a0-20 param 1) (-> arg0 0))
(set! (-> a0-20 param 1) (-> arg0 anim-speed))
(set! (-> a0-20 frame-num) 0.0)
(joint-control-channel-group! a0-20 (the-as art-joint-anim s4-0) num-func-seek!)
)
@ -920,7 +920,7 @@
#t
)
(defmethod enemy-method-78 ((this fodder) (arg0 (pointer float)))
(defmethod enemy-method-78 ((this fodder) (arg0 enemy-knocked-info))
(case (-> this incoming knocked-type)
(((knocked-type knocked-type-6))
#f
@ -931,7 +931,7 @@
)
(set! (-> a0-3 frame-group) (the-as art-joint-anim v1-5))
(set! (-> a0-3 param 0) (the float (+ (-> (the-as art-joint-anim v1-5) frames num-frames) -1)))
(set! (-> a0-3 param 1) (-> arg0 0))
(set! (-> a0-3 param 1) (-> arg0 anim-speed))
(set! (-> a0-3 frame-num) 0.0)
(joint-control-channel-group! a0-3 (the-as art-joint-anim v1-5) num-func-seek!)
)

View File

@ -407,11 +407,11 @@
:virtual #t
:code (behavior ()
(ja-channel-push! 1 (seconds 0.2))
(let* ((f30-0 (get-rand-float-range self 0.9 1.1))
(let* ((f30-0 (rnd-float-range self 0.9 1.1))
(a0-2 '((grenadier-patrol-ja) (grenadier-patrol1-ja)))
(gp-0 ((method-of-type (rtype-of a0-2) length) a0-2))
(s5-0 (new 'static 'array int64 2 9 10))
(s4-0 (-> (the-as (pointer int32) (+ (* (get-rand-int self gp-0) 8) (the-as int s5-0)))))
(s4-0 (-> (the-as (pointer int32) (+ (* (rnd-int-count self gp-0) 8) (the-as int s5-0)))))
)
(until #f
(ja-no-eval :group! (-> self draw art-group data s4-0) :num! (seek! max f30-0) :frame-num 0.0)
@ -419,7 +419,7 @@
(suspend)
(ja :num! (seek! max f30-0))
)
(when (enemy-method-123 self 0.2)
(when (rnd-go-idle? self 0.2)
(ja-no-eval :num! (loop!))
(ja-channel-push! 1 (seconds 0.6))
(let ((v1-38 self))
@ -436,7 +436,7 @@
(suspend)
(ja :num! (seek! max f30-0))
)
(until (not (enemy-method-123 self 0.2))
(until (not (rnd-go-idle? self 0.2))
(ja-no-eval :group! (-> self draw art-group data (-> self enemy-info idle-anim))
:num! (seek! max f30-0)
:frame-num 0.0
@ -455,7 +455,7 @@
)
0
(ja-no-eval :num! (loop!))
(set! s4-0 (-> (the-as (pointer int32) (+ (* (get-rand-int self gp-0) 8) (the-as int s5-0)))))
(set! s4-0 (-> (the-as (pointer int32) (+ (* (rnd-int-count self gp-0) 8) (the-as int s5-0)))))
(ja-channel-push! 1 (seconds 0.6))
(ja-no-eval :group! (-> self draw art-group data s4-0) :num! (seek! max f30-0) :frame-num 0.0)
(until (ja-done? 0)
@ -491,7 +491,7 @@
)
)
(grenadier-method-181 self)
(look-at-target! self (enemy-flag death-start))
(look-at-target! self (enemy-flag look-at-move-dest))
(logclear! (-> self status-flags) (grenadier-flags grflags-0))
)
:trans (behavior ()
@ -559,10 +559,10 @@
draw
art-group
data
(-> (the-as (pointer int32) (+ (* (get-rand-int self a1-3) 8) (the-as int gp-0))))
(-> (the-as (pointer int32) (+ (* (rnd-int-count self a1-3) 8) (the-as int gp-0))))
)
)
(f30-0 (get-rand-float-range self 0.9 1.1))
(f30-0 (rnd-float-range self 0.9 1.1))
)
(until #f
(ja-no-eval :group! gp-1 :num! (seek! max f30-0) :frame-num 0.0)
@ -667,7 +667,7 @@
(set! (-> v1-3 prim-core action) (collide-action))
(set! (-> v1-3 local-sphere w) 4096.0)
)
(if (logtest? (-> self enemy-flags) (enemy-flag check-water))
(if (logtest? (-> self enemy-flags) (enemy-flag dangerous-backup))
(logior! (-> self focus-status) (focus-status dangerous))
(logclear! (-> self focus-status) (focus-status dangerous))
)
@ -702,7 +702,7 @@
;; ERROR: function was not converted to expressions. Cannot decompile.
(defmethod enemy-method-78 ((this grenadier) (arg0 (pointer float)))
(defmethod enemy-method-78 ((this grenadier) (arg0 enemy-knocked-info))
(cond
((= (-> this incoming knocked-type) (knocked-type knocked-type-6))
(when (>= (-> this incoming blue-juggle-count) (the-as uint 2))
@ -711,7 +711,7 @@
(let ((a0-3 (-> this skel root-channel 0)))
(set! (-> a0-3 frame-group) (the-as art-joint-anim s4-0))
(set! (-> a0-3 param 0) (the float (+ (-> (the-as art-joint-anim s4-0) frames num-frames) -1)))
(set! (-> a0-3 param 1) (-> arg0 0))
(set! (-> a0-3 param 1) (-> arg0 anim-speed))
(set! (-> a0-3 frame-num) 0.0)
(joint-control-channel-group! a0-3 (the-as art-joint-anim s4-0) num-func-seek!)
)
@ -729,7 +729,7 @@
)
(set! (-> a0-9 frame-group) (the-as art-joint-anim a1-4))
(set! (-> a0-9 param 0) (the float (+ (-> (the-as art-joint-anim a1-4) frames num-frames) -1)))
(set! (-> a0-9 param 1) (-> arg0 0))
(set! (-> a0-9 param 1) (-> arg0 anim-speed))
(set! (-> a0-9 frame-num) 0.0)
(joint-control-channel-group! a0-9 (the-as art-joint-anim a1-4) num-func-seek!)
)
@ -742,7 +742,7 @@
(set! (-> a0-11 param 0)
(the float (+ (-> (the-as art-joint-anim (-> this draw art-group data 33)) frames num-frames) -1))
)
(set! (-> a0-11 param 1) (-> arg0 0))
(set! (-> a0-11 param 1) (-> arg0 anim-speed))
(set! (-> a0-11 frame-num) 0.0)
(joint-control-channel-group! a0-11 (the-as art-joint-anim (-> this draw art-group data 33)) num-func-seek!)
)
@ -831,7 +831,7 @@
(set! (-> v1-11 attack-id) a0-19)
(set! (-> self attack-id) a0-19)
)
(look-at-target! self (enemy-flag lock-focus))
(look-at-target! self (enemy-flag look-at-focus))
)
:exit (behavior ()
(if (logtest? (enemy-flag enemy-flag43) (-> self enemy-flags))
@ -839,13 +839,13 @@
(logclear! (-> self nav flags) (nav-control-flag update-heading-from-facing))
)
(logclear! (-> self status-flags) (grenadier-flags grflags-1))
(if (logtest? (-> self enemy-flags) (enemy-flag check-water))
(if (logtest? (-> self enemy-flags) (enemy-flag dangerous-backup))
(logior! (-> self focus-status) (focus-status dangerous))
(logclear! (-> self focus-status) (focus-status dangerous))
)
)
:code (behavior ()
(let ((f30-0 (get-rand-float-range self 0.9 1.1)))
(let ((f30-0 (rnd-float-range self 0.9 1.1)))
(let ((f28-0 (vector-length (-> self root transv))))
(ja-channel-push! 1 (seconds 0.2))
(when (< 4096.0 f28-0)
@ -1007,29 +1007,29 @@
(suspend)
(ja :num! (seek!))
)
(if (logtest? (-> self enemy-flags) (enemy-flag check-water))
(if (logtest? (-> self enemy-flags) (enemy-flag dangerous-backup))
(logior! (-> self focus-status) (focus-status dangerous))
(logclear! (-> self focus-status) (focus-status dangerous))
)
(let ((v1-43 (-> self enemy-flags)))
(if (logtest? v1-43 (enemy-flag checking-water))
(set! v1-44 (logior v1-43 (enemy-flag enable-on-active)))
(set! v1-44 (logclear v1-43 (enemy-flag enable-on-active)))
(if (logtest? v1-43 (enemy-flag vulnerable-backup))
(set! v1-44 (logior v1-43 (enemy-flag vulnerable)))
(set! v1-44 (logclear v1-43 (enemy-flag vulnerable)))
)
)
(set! (-> self enemy-flags) v1-44)
(if (logtest? (-> self enemy-flags) (enemy-flag look-at-move-dest))
(if (logtest? (-> self enemy-flags) (enemy-flag attackable-backup))
(logior! (-> self mask) (process-mask collectable))
(logclear! (-> self mask) (process-mask collectable))
)
(let ((v1-51 (-> self enemy-flags)))
(if (logtest? (enemy-flag no-initial-move-to-ground) v1-51)
(set! v1-52 (logior (enemy-flag check-water-backup) v1-51))
(set! v1-52 (logclear v1-51 (enemy-flag check-water-backup)))
(if (logtest? (enemy-flag trackable-backup) v1-51)
(set! v1-52 (logior (enemy-flag trackable) v1-51))
(set! v1-52 (logclear v1-51 (enemy-flag trackable)))
)
)
(set! (-> self enemy-flags) v1-52)
(logclear! (-> self enemy-flags) (enemy-flag actor-pause-backup))
(logclear! (-> self enemy-flags) (enemy-flag lock-focus))
(logclear! (-> self focus-status) (focus-status hit))
(cond
((= (-> self focus aware) (enemy-aware enemy-aware-3))
@ -1069,7 +1069,7 @@
:virtual #t
:code (behavior ()
(ja-channel-push! 1 (seconds 0.1))
(let ((f30-0 (get-rand-float-range self 0.8 1.2)))
(let ((f30-0 (rnd-float-range self 0.8 1.2)))
(cond
((zero? (rand-vu-int-range 0 1))
(ja-no-eval :group! grenadier-victory-ja :num! (seek! max f30-0) :frame-num 0.0)
@ -1139,12 +1139,12 @@
(none)
)
(defmethod track-target! ((this grenadier))
(defmethod common-post ((this grenadier))
"Does a lot of various things relating to interacting with the target
- tracks when the enemy was last drawn
- looks at the target and handles attacking
@TODO Not extremely well understood yet"
(let ((t9-0 (method-of-type nav-enemy track-target!)))
(let ((t9-0 (method-of-type nav-enemy common-post)))
(t9-0 this)
)
(let ((a1-1 (vector<-cspace! (new 'stack-no-clear 'vector) (-> this node-list data 34))))

View File

@ -52,7 +52,7 @@
(unknown-byte-n1k2n3 int8 :offset 636)
(unknown-byte-m2j342 int8 :offset 637)
(unknown-byte-1ji2n3 int8 :offset 638)
(unknown-byte-n123n int8 :offset 639)
(unknown-byte-n123n uint8 :offset 639)
(state-timeout2 uint64)
(next-warn-time time-frame)
(dest vector :inline)
@ -336,15 +336,15 @@
(('hit 'hit-knocked)
(logclear! (-> this mask) (process-mask actor-pause))
(logclear! (-> this focus-status) (focus-status dangerous))
(logclear! (-> this enemy-flags) (enemy-flag enable-on-notice))
(logior! (-> this enemy-flags) (enemy-flag chase-startup))
(logclear! (-> this enemy-flags) (enemy-flag use-notice-distance))
(logior! (-> this enemy-flags) (enemy-flag alert))
(logior! (-> this focus-status) (focus-status hit))
(if (zero? (-> this hit-points))
(logior! (-> this focus-status) (focus-status dead))
)
(logclear! (-> this enemy-flags) (enemy-flag actor-pause-backup))
(logclear! (-> this enemy-flags) (enemy-flag lock-focus))
(enemy-method-62 this)
(logior! (-> this enemy-flags) (enemy-flag actor-pause-backup))
(logior! (-> this enemy-flags) (enemy-flag lock-focus))
(process-contact-action arg0)
(send-event arg0 'get-attack-count 1)
(cond
@ -357,7 +357,7 @@
)
)
)
(zero? (get-rand-int this 3))
(zero? (rnd-int-count this 3))
(let ((f0-0 (vector-vector-distance-squared (-> this root trans) (target-pos 0)))
(f1-0 32768.0)
)
@ -407,8 +407,8 @@
:virtual #t
:event enemy-event-handler
:enter (behavior ()
(when (logtest? (-> self enemy-flags) (enemy-flag auto-reset-penetrate))
(logclear! (-> self enemy-flags) (enemy-flag auto-reset-penetrate))
(when (logtest? (-> self enemy-flags) (enemy-flag enable-on-notice))
(logclear! (-> self enemy-flags) (enemy-flag enable-on-notice))
(let ((gp-0 (-> self on-notice)))
(if gp-0
(script-eval gp-0 :vector (-> self root trans))
@ -506,7 +506,9 @@
(until #f
(let ((gp-0 (new 'stack-no-clear 'vector)))
(get-point-in-path! (-> self intro-path) gp-0 1.0 'interp)
(set! (-> self enemy-flags) (the-as enemy-flag (logclear (-> self enemy-flags) (enemy-flag vulnerable))))
(set! (-> self enemy-flags)
(the-as enemy-flag (logclear (-> self enemy-flags) (enemy-flag jump-check-blocked)))
)
(let ((a1-1 (new 'stack-no-clear 'event-message-block)))
(let ((v1-5 (process->ppointer self)))
(set! (-> a1-1 from) v1-5)
@ -539,7 +541,9 @@
(until #f
(let ((gp-0 (new 'stack-no-clear 'vector)))
(get-point-in-path! (-> self intro-path) gp-0 (the float (-> self unknown-byte-1ji2n3)) 'interp)
(set! (-> self enemy-flags) (the-as enemy-flag (logclear (-> self enemy-flags) (enemy-flag vulnerable))))
(set! (-> self enemy-flags)
(the-as enemy-flag (logclear (-> self enemy-flags) (enemy-flag jump-check-blocked)))
)
(let ((a1-1 (new 'stack-no-clear 'event-message-block)))
(let ((v1-9 (process->ppointer self)))
(set! (-> a1-1 from) v1-9)
@ -575,15 +579,15 @@
)
)
)
(let ((f30-0 (get-rand-float-range self 0.9 1.1)))
(let ((f30-0 (rnd-float-range self 0.9 1.1)))
(until #f
(set! (-> self patrol-anim) (-> *grunt-global-info* patrol-anim (get-rand-int self 4)))
(set! (-> self patrol-anim) (-> *grunt-global-info* patrol-anim (rnd-int-count self 4)))
(let ((v1-28 (-> self nav)))
(set! (-> v1-28 target-speed) (-> self patrol-anim travel-speed))
)
0
(let ((gp-0 (-> self draw art-group data (-> self patrol-anim anim-index)))
(s5-0 (get-rand-int-range self 1 8))
(s5-0 (rnd-int-range self 1 8))
)
(let ((v1-37 (ja-group)))
(if (not (and v1-37 (= v1-37 gp-0)))
@ -607,7 +611,7 @@
)
0
(let ((gp-1 (-> self draw art-group data (-> self patrol-anim anim-index)))
(s5-1 (get-rand-int-range self 2 5))
(s5-1 (rnd-int-range self 2 5))
)
(ja-no-eval :group! gp-1 :num! (seek! max f30-0) :frame-num 0.0)
(until (ja-done? 0)
@ -624,7 +628,7 @@
)
)
)
(when (zero? (get-rand-int self 3))
(when (zero? (rnd-int-count self 3))
(let ((v1-107 self))
(set! (-> v1-107 enemy-flags)
(the-as enemy-flag (logclear (-> v1-107 enemy-flags) (enemy-flag enemy-flag36)))
@ -642,7 +646,7 @@
(suspend)
(ja :num! (seek! max f30-0))
)
(until (not (enemy-method-123 self 0.2))
(until (not (rnd-go-idle? self 0.2))
(ja-no-eval :group! (-> self draw art-group data (-> self enemy-info idle-anim))
:num! (seek! max f30-0)
:frame-num 0.0
@ -737,7 +741,7 @@
)
)
(sound-play "grunt-warn")
(set! (-> self next-warn-time) (+ gp-0 (get-rand-int-range self 300 360)))
(set! (-> self next-warn-time) (+ gp-0 (rnd-int-range self 300 360)))
)
)
)
@ -756,7 +760,7 @@
)
)
)
(let ((f30-0 (get-rand-float-range self 0.9 1.1)))
(let ((f30-0 (rnd-float-range self 0.9 1.1)))
(let ((v1-19 (-> self unknown-byte-n1k2n3)))
(cond
((>= v1-19 0)
@ -764,7 +768,7 @@
(set! (-> self unknown-byte-n1k2n3) -1)
)
(else
(set! (-> self charge-anim) (-> *grunt-global-info* charge-anim (get-rand-int self 3)))
(set! (-> self charge-anim) (-> *grunt-global-info* charge-anim (rnd-int-count self 3)))
)
)
)
@ -801,7 +805,7 @@
(set! (-> v1-1 speed) (-> self enemy-info run-travel-speed))
)
0
(logior! (-> self enemy-flags) (enemy-flag actor-pause-backup))
(logior! (-> self enemy-flags) (enemy-flag lock-focus))
(logior! (-> self focus-status) (focus-status dangerous))
(set! (-> self root penetrate-using) (penetrate generic-attack lunge))
(enemy-method-49 self)
@ -813,21 +817,21 @@
)
)
:exit (behavior ()
(logclear! (-> self enemy-flags) (enemy-flag actor-pause-backup))
(if (logtest? (-> self enemy-flags) (enemy-flag check-water))
(logclear! (-> self enemy-flags) (enemy-flag lock-focus))
(if (logtest? (-> self enemy-flags) (enemy-flag dangerous-backup))
(logior! (-> self focus-status) (focus-status dangerous))
(logclear! (-> self focus-status) (focus-status dangerous))
)
)
:trans (behavior ()
(enemy-method-49 self)
(when (logtest? (-> self enemy-flags) (enemy-flag look-at-focus))
(logclear! (-> self enemy-flags) (enemy-flag look-at-focus))
(when (logtest? (-> self enemy-flags) (enemy-flag victory))
(logclear! (-> self enemy-flags) (enemy-flag victory))
(sound-play "grunt-hit")
)
)
:code (behavior ()
(set! (-> self attack-anim) (-> *grunt-global-info* attack-anim (get-rand-int self 2)))
(set! (-> self attack-anim) (-> *grunt-global-info* attack-anim (rnd-int-count self 2)))
(let ((v1-5 (-> self nav)))
(set! (-> v1-5 target-speed) (-> self attack-anim travel-speed))
)
@ -837,7 +841,7 @@
)
0
(let ((gp-0 (-> self draw art-group data (-> self attack-anim anim-index)))
(f30-0 (get-rand-float-range self 0.9 1.1))
(f30-0 (rnd-float-range self 0.9 1.1))
)
(let ((v1-17 (ja-group)))
(if (not (and v1-17 (= v1-17 gp-0)))
@ -892,7 +896,7 @@
:virtual #t
:event enemy-event-handler
:enter (behavior ()
(logior! (-> self enemy-flags) (enemy-flag actor-pause-backup))
(logior! (-> self enemy-flags) (enemy-flag lock-focus))
(let ((v1-2 self))
(set! (-> v1-2 enemy-flags) (the-as enemy-flag (logclear (-> v1-2 enemy-flags) (enemy-flag enemy-flag36))))
(set! (-> v1-2 nav callback-info) *nav-enemy-null-callback-info*)
@ -918,22 +922,22 @@
)
)
:exit (behavior ()
(logclear! (-> self enemy-flags) (enemy-flag actor-pause-backup))
(if (logtest? (-> self enemy-flags) (enemy-flag check-water))
(logclear! (-> self enemy-flags) (enemy-flag lock-focus))
(if (logtest? (-> self enemy-flags) (enemy-flag dangerous-backup))
(logior! (-> self focus-status) (focus-status dangerous))
(logclear! (-> self focus-status) (focus-status dangerous))
)
)
:trans (behavior ()
(when (logtest? (-> self enemy-flags) (enemy-flag look-at-focus))
(logclear! (-> self enemy-flags) (enemy-flag look-at-focus))
(when (logtest? (-> self enemy-flags) (enemy-flag victory))
(logclear! (-> self enemy-flags) (enemy-flag victory))
(sound-play "grunt-hit")
)
)
:code (behavior ()
(set! (-> self attack-anim) (-> *grunt-global-info* attack-anim (get-rand-int self 2)))
(set! (-> self attack-anim) (-> *grunt-global-info* attack-anim (rnd-int-count self 2)))
(let ((gp-0 (-> self draw art-group data (-> self attack-anim anim-index)))
(f30-0 (get-rand-float-range self 0.9 1.1))
(f30-0 (rnd-float-range self 0.9 1.1))
)
(let ((v1-13 (ja-group)))
(if (not (and v1-13 (= v1-13 gp-0)))
@ -979,7 +983,7 @@
)
)
(until #f
(set! (-> self charge-anim) (-> *grunt-global-info* charge-anim (get-rand-int self 3)))
(set! (-> self charge-anim) (-> *grunt-global-info* charge-anim (rnd-int-count self 3)))
(let ((v1-22 self))
(if (not (logtest? (enemy-flag enemy-flag36) (-> v1-22 enemy-flags)))
(set! (-> v1-22 enemy-flags) (the-as enemy-flag (logior (enemy-flag enemy-flag38) (-> v1-22 enemy-flags))))
@ -1010,8 +1014,8 @@
(ja-channel-push! 1 (seconds 0.1))
)
)
(let ((s5-0 (get-rand-int self 8))
(f30-0 (get-rand-float-range self 0.9 1.1))
(let ((s5-0 (rnd-int-count self 8))
(f30-0 (rnd-float-range self 0.9 1.1))
)
(while (nonzero? s5-0)
(+! s5-0 -1)
@ -1040,7 +1044,7 @@
(ja-channel-push! 1 (seconds 0.1))
)
)
(let ((f30-2 (get-rand-float-range self 0.9 1.1)))
(let ((f30-2 (rnd-float-range self 0.9 1.1)))
(ja-no-eval :group! grunt-celebrate-start-ja :num! (seek! max f30-2) :frame-num 0.0)
(until (ja-done? 0)
(suspend)
@ -1074,8 +1078,8 @@
)
)
)
(set! (-> self patrol-anim) (-> *grunt-global-info* patrol-anim (get-rand-int self 4)))
(let ((f30-0 (get-rand-float-range self 0.9 1.1))
(set! (-> self patrol-anim) (-> *grunt-global-info* patrol-anim (rnd-int-count self 4)))
(let ((f30-0 (rnd-float-range self 0.9 1.1))
(gp-0 (-> self draw art-group data (-> self patrol-anim anim-index)))
)
(let ((v1-28 self))
@ -1127,12 +1131,12 @@
(suspend)
(ja-eval)
)
(set! (-> self patrol-anim) (-> *grunt-global-info* patrol-anim (get-rand-int self 4)))
(set! (-> self patrol-anim) (-> *grunt-global-info* patrol-anim (rnd-int-count self 4)))
(let ((v1-14 (-> self nav)))
(set! (-> v1-14 target-speed) (-> self patrol-anim travel-speed))
)
0
(let ((f30-0 (get-rand-float-range self 0.9 1.1))
(let ((f30-0 (rnd-float-range self 0.9 1.1))
(gp-0 (-> self draw art-group data (-> self patrol-anim anim-index)))
)
(let ((v1-24 (ja-group)))
@ -1152,7 +1156,7 @@
)
)
(defmethod enemy-method-77 ((this grunt) (arg0 (pointer float)))
(defmethod enemy-method-77 ((this grunt) (arg0 enemy-knocked-info))
(local-vars (v1-72 int) (a2-3 int) (a2-5 int))
(case (-> this incoming knocked-type)
(((knocked-type knocked-type-4))
@ -1172,10 +1176,10 @@
(set! a2-3 (logior v1-2 8))
)
)
(let ((s4-0 (enemy-method-120 this 4 a2-3)))
(let ((s4-0 (rnd-bit this 4 a2-3)))
(set! (-> *grunt-global-info* prev-yellow-hit-anim-index) s4-0)
(set! (-> this yellow-hit-anim) (-> *grunt-global-info* yellow-hit-anim s4-0))
(let ((v1-11 (get-rand-int this 3)))
(let ((v1-11 (rnd-int-count this 3)))
(if (= s4-0 3)
(set! v1-11 2)
)
@ -1187,7 +1191,7 @@
(let ((a0-19 (-> this skel root-channel 0)))
(set! (-> a0-19 frame-group) (the-as art-joint-anim s4-1))
(set! (-> a0-19 param 0) (the float (+ (-> (the-as art-joint-anim s4-1) frames num-frames) -1)))
(set! (-> a0-19 param 1) (-> arg0 0))
(set! (-> a0-19 param 1) (-> arg0 anim-speed))
(set! (-> a0-19 frame-num) 0.0)
(joint-control-channel-group! a0-19 (the-as art-joint-anim s4-1) num-func-seek!)
)
@ -1208,10 +1212,10 @@
)
)
(if (>= (-> this incoming blue-juggle-count) (the-as uint 2))
(set! (-> this unknown-byte-n123n) (the-as int (logior (-> this stack 511) 2)))
(logior! (-> this unknown-byte-n123n) 2)
)
(cond
((and (not s4-2) (logtest? (-> this stack 511) 2))
((and (not s4-2) (logtest? (-> this unknown-byte-n123n) 2))
(set! s4-2 #t)
(ja-channel-push! 1 (seconds 0.17))
)
@ -1234,18 +1238,18 @@
(set! a2-5 (logior v1-42 7))
)
)
(let ((v1-46 (enemy-method-120 this 6 a2-5)))
(let ((v1-46 (rnd-bit this 6 a2-5)))
(set! (-> *grunt-global-info* prev-blue-hit-anim-index) v1-46)
(set! (-> this blue-hit-anim) (-> *grunt-global-info* blue-hit-anim v1-46))
)
(let ((a2-6 0))
(when (not (logtest? (-> this stack 511) 2))
(when (not (logtest? (-> this unknown-byte-n123n) 2))
(if s4-2
(set! a2-6 (logior a2-6 3))
(set! a2-6 (logior a2-6 4))
)
)
(set! (-> this unknown-byte-n1k2n3) (enemy-method-120 this 3 a2-6))
(set! (-> this unknown-byte-n1k2n3) (rnd-bit this 3 a2-6))
)
)
(let ((a1-26 (-> this draw art-group data (-> this blue-hit-anim anim-index)))
@ -1253,7 +1257,7 @@
)
(set! (-> a0-51 frame-group) (the-as art-joint-anim a1-26))
(set! (-> a0-51 param 0) (the float (+ (-> (the-as art-joint-anim a1-26) frames num-frames) -1)))
(set! (-> a0-51 param 1) (-> arg0 0))
(set! (-> a0-51 param 1) (-> arg0 anim-speed))
(set! (-> a0-51 frame-num) 0.0)
(joint-control-channel-group! a0-51 (the-as art-joint-anim a1-26) num-func-seek!)
)
@ -1274,7 +1278,7 @@
(set! s4-3 (logior s4-3 4))
)
)
(set! v1-72 (enemy-method-120 this 3 s4-3))
(set! v1-72 (rnd-bit this 3 s4-3))
)
)
)
@ -1286,7 +1290,7 @@
(let ((a0-68 (-> this skel root-channel 0)))
(set! (-> a0-68 frame-group) (the-as art-joint-anim s4-4))
(set! (-> a0-68 param 0) (the float (+ (-> (the-as art-joint-anim s4-4) frames num-frames) -1)))
(set! (-> a0-68 param 1) (-> arg0 0))
(set! (-> a0-68 param 1) (-> arg0 anim-speed))
(set! (-> a0-68 frame-num) 0.0)
(joint-control-channel-group! a0-68 (the-as art-joint-anim s4-4) num-func-seek!)
)
@ -1296,34 +1300,35 @@
)
)
(defmethod enemy-method-78 ((this grunt) (arg0 (pointer float)))
(defmethod enemy-method-78 ((this grunt) (arg0 enemy-knocked-info))
(cond
((= (-> this incoming knocked-type) (knocked-type knocked-type-6))
(when (or (logtest? (-> this stack 511) 2) (let ((v1-7 (if (> (-> this skel active-channels) 0)
(-> this skel root-channel 0 frame-group)
)
)
)
(not (and v1-7 (or (= v1-7 (-> this draw art-group data 16))
(= v1-7 (-> this draw art-group data 38))
(= v1-7 (-> this draw art-group data 39))
(= v1-7 (-> this draw art-group data 40))
)
)
)
)
(when (or (logtest? (-> this unknown-byte-n123n) 2)
(let ((v1-7 (if (> (-> this skel active-channels) 0)
(-> this skel root-channel 0 frame-group)
)
)
)
(not (and v1-7 (or (= v1-7 (-> this draw art-group data 16))
(= v1-7 (-> this draw art-group data 38))
(= v1-7 (-> this draw art-group data 39))
(= v1-7 (-> this draw art-group data 40))
)
)
)
)
)
(let ((s4-0 (-> this draw art-group data 44)))
(ja-channel-push! 1 (seconds 0.17))
(let ((a0-16 (-> this skel root-channel 0)))
(set! (-> a0-16 frame-group) (the-as art-joint-anim s4-0))
(set! (-> a0-16 param 0) (the float (+ (-> (the-as art-joint-anim s4-0) frames num-frames) -1)))
(set! (-> a0-16 param 1) (-> arg0 0))
(set! (-> a0-16 param 1) (-> arg0 anim-speed))
(set! (-> a0-16 frame-num) 0.0)
(joint-control-channel-group! a0-16 (the-as art-joint-anim s4-0) num-func-seek!)
)
)
(set! (-> this unknown-byte-n123n) (the-as int (logand -3 (-> this stack 511))))
(logand! (-> this unknown-byte-n123n) -3)
#t
)
)
@ -1339,7 +1344,7 @@
)
(set! (-> a0-23 frame-group) (the-as art-joint-anim a1-6))
(set! (-> a0-23 param 0) (the float (+ (-> (the-as art-joint-anim a1-6) frames num-frames) -1)))
(set! (-> a0-23 param 1) (-> arg0 0))
(set! (-> a0-23 param 1) (-> arg0 anim-speed))
(set! (-> a0-23 frame-num) 0.0)
(joint-control-channel-group! a0-23 (the-as art-joint-anim a1-6) num-func-seek!)
)
@ -1356,7 +1361,7 @@
(let ((s5-0 (handle->process (-> self focus handle))))
(when s5-0
(let ((gp-0 (get-trans (the-as process-focusable s5-0) 0)))
(when (and (or (not (logtest? (-> self enemy-flags) (enemy-flag enable-on-notice)))
(when (and (or (not (logtest? (-> self enemy-flags) (enemy-flag use-notice-distance)))
(>= 163840.0 (vector-vector-distance (-> self root trans) gp-0))
)
(or (not (logtest? (-> self fact enemy-options) (enemy-option user8)))
@ -1367,7 +1372,7 @@
)
(cond
((and (logtest? (-> self fact enemy-options) (enemy-option user9))
(logtest? (-> self enemy-flags) (enemy-flag enable-on-notice))
(logtest? (-> self enemy-flags) (enemy-flag use-notice-distance))
)
(let ((s5-1 (new 'stack-no-clear 'vector)))
(vector-! s5-1 gp-0 (-> self root trans))
@ -1395,7 +1400,7 @@
:post (-> (method-of-type nav-enemy idle) post)
)
(defmethod dispose! ((this grunt))
(defmethod dying ((this grunt))
"Cleans-up the enemy and any associated resources. Potentially spawns skull gems"
(when (-> this minimap)
(logior! (-> this minimap flags) (minimap-flag fade-out))
@ -1535,16 +1540,16 @@
0
(set-gravity-length (-> this root dynam) 573440.0)
(let ((s5-2 *grunt-global-info*))
(set! (-> this patrol-anim) (-> s5-2 patrol-anim (get-rand-int this 4)))
(set! (-> this charge-anim) (-> s5-2 charge-anim (get-rand-int this 3)))
(set! (-> this attack-anim) (-> s5-2 attack-anim (get-rand-int this 2)))
(set! (-> this patrol-anim) (-> s5-2 patrol-anim (rnd-int-count this 4)))
(set! (-> this charge-anim) (-> s5-2 charge-anim (rnd-int-count this 3)))
(set! (-> this attack-anim) (-> s5-2 attack-anim (rnd-int-count this 2)))
)
(set! (-> this unknown-byte-n1k2n3) -1)
(if (zero? (get-rand-int this 2))
(set! (-> this unknown-byte-n123n) (the-as int (logior (-> this stack 511) 1)))
(if (zero? (rnd-int-count this 2))
(logior! (-> this unknown-byte-n123n) 1)
)
(if (zero? (get-rand-int this 2))
(set! (-> this unknown-byte-n123n) (the-as int (logior (-> this stack 511) 4)))
(if (zero? (rnd-int-count this 2))
(logior! (-> this unknown-byte-n123n) 4)
)
(set! (-> this intro-path) (new 'process 'path-control this 'intro 0.0 (the-as entity #f) #t))
(add-connection

View File

@ -1367,7 +1367,7 @@
(vector-z-quaternion! (new 'stack-no-clear 'vector) (-> this root quat))
(set! (-> s0-0 quad) (-> this root trans quad))
(cond
((logtest? (enemy-flag dislike-combo) (-> this enemy-flags))
((logtest? (enemy-flag drawn-mirrored) (-> this enemy-flags))
(let ((a1-6 s0-0))
(let ((v1-14 s0-0))
(let ((a0-9 s4-0))
@ -1457,12 +1457,12 @@
)
;; WARN: Return type mismatch object vs none.
(defmethod track-target! ((this crimson-guard-level))
(defmethod common-post ((this crimson-guard-level))
"Does a lot of various things relating to interacting with the target
- tracks when the enemy was last drawn
- looks at the target and handles attacking
@TODO Not extremely well understood yet"
(let ((t9-0 (method-of-type nav-enemy track-target!)))
(let ((t9-0 (method-of-type nav-enemy common-post)))
(t9-0 this)
)
(if (-> this joint-enable)
@ -1545,13 +1545,13 @@
:enter (behavior ()
(talker-spawn-func (-> *talker-speech* 10) *entity-pool* (target-pos 0) (the-as region #f))
(set-time! (-> self state-time))
(let ((v1-4 (logior (-> self enemy-flags) (enemy-flag use-notice-distance))))
(set! (-> self enemy-flags) (logclear v1-4 (enemy-flag called-dying)))
(let ((v1-4 (logior (-> self enemy-flags) (enemy-flag cam-attack-mode))))
(set! (-> self enemy-flags) (logclear v1-4 (enemy-flag use-trigger)))
)
(logclear! (-> self mask) (process-mask actor-pause))
(look-at-target! self (enemy-flag lock-focus))
(when (logtest? (-> self enemy-flags) (enemy-flag auto-reset-penetrate))
(logclear! (-> self enemy-flags) (enemy-flag auto-reset-penetrate))
(look-at-target! self (enemy-flag look-at-focus))
(when (logtest? (-> self enemy-flags) (enemy-flag enable-on-notice))
(logclear! (-> self enemy-flags) (enemy-flag enable-on-notice))
(let ((gp-1 (-> self on-notice)))
(if gp-1
(script-eval gp-1 :vector (-> self root trans))
@ -1559,7 +1559,7 @@
)
)
(let ((gp-2 (-> self focus aware)))
(when (logtest? (-> self enemy-flags) (enemy-flag chase-startup))
(when (logtest? (-> self enemy-flags) (enemy-flag alert))
(cond
((and (= gp-2 (enemy-aware enemy-aware-3)) (get-enemy-target self))
(go-hostile self)
@ -1577,11 +1577,11 @@
)
)
(speech-control-method-12 *speech-control* self (speech-type speech-type-3))
(logior! (-> self enemy-flags) (enemy-flag chase-startup))
(logior! (-> self enemy-flags) (enemy-flag alert))
)
:code (behavior ()
(ja-channel-push! 1 (seconds 0.075))
(let ((f30-0 (get-rand-float-range self 0.8 1.2))
(let ((f30-0 (rnd-float-range self 0.8 1.2))
(gp-0 (new 'stack-no-clear 'vector))
)
(ja-no-eval :group! (-> self draw art-group data (-> self enemy-info notice-anim))
@ -1622,7 +1622,7 @@
(if (logtest? (-> self flags) 4)
(go-virtual gun-shoot)
)
(set! (-> self reaction-time) (the-as time-frame (the int (* 300.0 (get-rand-float-range self 1.0 3.0)))))
(set! (-> self reaction-time) (the-as time-frame (the int (* 300.0 (rnd-float-range self 1.0 3.0)))))
)
:exit (behavior ()
'()
@ -1688,7 +1688,7 @@
(ja-channel-push! 1 (seconds 0.2))
(ja :group! (-> self draw art-group data (-> self enemy-info hostile-anim)))
(ja :num-func num-func-identity :frame-num 0.0)
(let ((f30-1 (* 2.0 (get-rand-float-range self 0.9 1.1))))
(let ((f30-1 (* 2.0 (rnd-float-range self 0.9 1.1))))
(until #f
(suspend)
(ja :num! (loop! f30-1))
@ -1704,7 +1704,7 @@
:enter (behavior ()
((-> (method-of-type nav-enemy hostile) enter))
(set-time! (-> self state-time))
(set! (-> self reaction-time) (the-as time-frame (the int (* 300.0 (get-rand-float-range self 0.5 1.5)))))
(set! (-> self reaction-time) (the-as time-frame (the int (* 300.0 (rnd-float-range self 0.5 1.5)))))
)
:exit (behavior ()
'()
@ -1747,7 +1747,7 @@
(ja-channel-push! 1 (seconds 0.2))
(ja :group! (-> self draw art-group data (-> self enemy-info hostile-anim)))
(ja :num-func num-func-identity :frame-num 0.0)
(let ((f30-1 (* 2.0 (get-rand-float-range self 0.9 1.1))))
(let ((f30-1 (* 2.0 (rnd-float-range self 0.9 1.1))))
(until #f
(suspend)
(ja :num! (loop! f30-1))
@ -1821,7 +1821,7 @@
(ja-channel-push! 1 (seconds 0.2))
(ja :group! (-> self draw art-group data (-> self enemy-info hostile-anim)))
(ja :num-func num-func-identity :frame-num 0.0)
(let ((f30-1 (* 2.0 (get-rand-float-range self 0.9 1.1))))
(let ((f30-1 (* 2.0 (rnd-float-range self 0.9 1.1))))
(until #f
(suspend)
(ja :num! (loop! f30-1))
@ -1893,7 +1893,7 @@
(ja-channel-push! 1 (seconds 0.2))
(ja :group! (-> self draw art-group data (-> self enemy-info hostile-anim)))
(ja :num-func num-func-identity :frame-num 0.0)
(let ((f30-1 (* 2.0 (get-rand-float-range self 0.9 1.1))))
(let ((f30-1 (* 2.0 (rnd-float-range self 0.9 1.1))))
(until #f
(suspend)
(ja :num! (loop! f30-1))
@ -1910,7 +1910,7 @@
:virtual #t
:event enemy-event-handler
:enter (behavior ()
(logior! (-> self enemy-flags) (enemy-flag actor-pause-backup))
(logior! (-> self enemy-flags) (enemy-flag lock-focus))
(nav-enemy-method-167 self)
(let ((v1-4 self))
(set! (-> v1-4 enemy-flags) (the-as enemy-flag (logclear (-> v1-4 enemy-flags) (enemy-flag enemy-flag36))))
@ -1933,11 +1933,11 @@
(set! (-> self miss-amount) 0.0)
(set! (-> self next-shot) (the-as int (current-time)))
(set! (-> self joint-enable) #t)
(set! (-> self reaction-time) (the-as time-frame (the int (* 300.0 (get-rand-float-range self 3.0 5.0)))))
(set! (-> self reaction-time) (the-as time-frame (the int (* 300.0 (rnd-float-range self 3.0 5.0)))))
)
:exit (behavior ()
(set! (-> self joint-enable) #f)
(logclear! (-> self enemy-flags) (enemy-flag actor-pause-backup))
(logclear! (-> self enemy-flags) (enemy-flag lock-focus))
)
:trans (behavior ()
(crimson-guard-level-method-200 self)
@ -1960,7 +1960,7 @@
:code (behavior ()
(speech-control-method-12 *speech-control* self (speech-type speech-type-13))
(ja-channel-push! 1 (seconds 0.2))
(let ((f30-0 (get-rand-float-range self 0.9 1.1)))
(let ((f30-0 (rnd-float-range self 0.9 1.1)))
(ja-no-eval :group! crimson-guard-idle-to-stab-idle-ja :num! (seek! max f30-0) :frame-num 0.0)
(until (ja-done? 0)
(seek-toward-heading-vec! (-> self root) (-> self target-self-xz) 65536.0 (seconds 0.02))
@ -1982,7 +1982,7 @@
)
#f
(label cfg-13)
(let ((f30-1 (get-rand-float-range self 0.9 1.1)))
(let ((f30-1 (rnd-float-range self 0.9 1.1)))
(ja-channel-push! 1 (seconds 0.2))
(ja-no-eval :group! crimson-guard-stab-idle-to-idle-ja :num! (seek! max f30-1) :frame-num 0.0)
(until (ja-done? 0)
@ -2060,7 +2060,7 @@
:code (behavior ()
(local-vars (v1-48 object))
(ja-channel-push! 1 (seconds 0.2))
(let ((f30-0 (get-rand-float-range self 0.9 1.1)))
(let ((f30-0 (rnd-float-range self 0.9 1.1)))
(ja-no-eval :group! (-> self draw art-group data (-> self anim-shoot 0 anim-index))
:num! (seek! max f30-0)
:frame-num 0.0
@ -2149,7 +2149,7 @@
#f
)
(label cfg-57)
(let ((f30-1 (get-rand-float-range self 0.9 1.1)))
(let ((f30-1 (rnd-float-range self 0.9 1.1)))
(ja-channel-push! 1 (seconds 0.2))
(ja-no-eval :group! (-> self draw art-group data (-> self anim-shoot 2 anim-index))
:num! (seek! max f30-1)
@ -2573,7 +2573,7 @@
(let ((v1-3 (-> (the-as collide-shape-prim-group (-> self root root-prim)) child 3)))
(logior! (-> v1-3 prim-core action) (collide-action deadly))
)
(logior! (-> self enemy-flags) (enemy-flag actor-pause-backup))
(logior! (-> self enemy-flags) (enemy-flag lock-focus))
(logior! (-> self focus-status) (focus-status dangerous))
(let* ((v1-8 *game-info*)
(a0-4 (+ (-> v1-8 attack-id) 1))
@ -2590,8 +2590,8 @@
(let ((v1-3 (-> (the-as collide-shape-prim-group (-> self root root-prim)) child 3)))
(logclear! (-> v1-3 prim-core action) (collide-action deadly))
)
(logclear! (-> self enemy-flags) (enemy-flag actor-pause-backup))
(if (logtest? (-> self enemy-flags) (enemy-flag check-water))
(logclear! (-> self enemy-flags) (enemy-flag lock-focus))
(if (logtest? (-> self enemy-flags) (enemy-flag dangerous-backup))
(logior! (-> self focus-status) (focus-status dangerous))
(logclear! (-> self focus-status) (focus-status dangerous))
)
@ -2668,7 +2668,7 @@
:virtual #t
:event enemy-event-handler
:enter (behavior ()
(logior! (-> self enemy-flags) (enemy-flag actor-pause-backup))
(logior! (-> self enemy-flags) (enemy-flag lock-focus))
(logior! (-> self focus-status) (focus-status dangerous))
(let ((v1-4 self))
(set! (-> v1-4 enemy-flags) (the-as enemy-flag (logclear (-> v1-4 enemy-flags) (enemy-flag enemy-flag37))))
@ -2685,8 +2685,8 @@
0
)
:exit (behavior ()
(logclear! (-> self enemy-flags) (enemy-flag actor-pause-backup))
(if (logtest? (-> self enemy-flags) (enemy-flag check-water))
(logclear! (-> self enemy-flags) (enemy-flag lock-focus))
(if (logtest? (-> self enemy-flags) (enemy-flag dangerous-backup))
(logior! (-> self focus-status) (focus-status dangerous))
(logclear! (-> self focus-status) (focus-status dangerous))
)
@ -2751,7 +2751,7 @@
:event enemy-event-handler
:enter (behavior ()
(set! (-> self joint-enable) #t)
(logior! (-> self enemy-flags) (enemy-flag actor-pause-backup))
(logior! (-> self enemy-flags) (enemy-flag lock-focus))
(logior! (-> self focus-status) (focus-status dangerous))
(let* ((v1-5 *game-info*)
(a0-2 (+ (-> v1-5 attack-id) 1))
@ -2803,8 +2803,8 @@
(set! (-> v1-11 state mode) (the-as lightning-mode a0-5))
)
(set! (-> self joint-enable) #f)
(logclear! (-> self enemy-flags) (enemy-flag actor-pause-backup))
(if (logtest? (-> self enemy-flags) (enemy-flag check-water))
(logclear! (-> self enemy-flags) (enemy-flag lock-focus))
(if (logtest? (-> self enemy-flags) (enemy-flag dangerous-backup))
(logior! (-> self focus-status) (focus-status dangerous))
(logclear! (-> self focus-status) (focus-status dangerous))
)
@ -3022,7 +3022,7 @@
(set! (-> a0-0 travel quad) (-> v1-1 quad))
)
0
(track-target! self)
(common-post self)
)
)
@ -3072,7 +3072,7 @@
(set! (-> a0-0 travel quad) (-> v1-1 quad))
)
0
(track-target! self)
(common-post self)
)
)
@ -3150,7 +3150,7 @@
0
(ja-channel-push! 1 (seconds 0.1))
(cond
((logtest? (enemy-flag dislike-combo) (-> self enemy-flags))
((logtest? (enemy-flag drawn-mirrored) (-> self enemy-flags))
(ja-no-eval :group! crimson-guard-jump-right-ja :num! (seek! (ja-aframe 6.0 0)) :frame-num (ja-aframe 0.0 0))
(until (ja-done? 0)
(let ((a0-20 (handle->process (-> self focus handle))))
@ -3191,7 +3191,7 @@
)
0
(cond
((logtest? (enemy-flag dislike-combo) (-> self enemy-flags))
((logtest? (enemy-flag drawn-mirrored) (-> self enemy-flags))
(ja-no-eval :group! crimson-guard-jump-right-ja :num! (seek! (ja-aframe 11.0 0)) :frame-num (ja-aframe 6.0 0))
(until (ja-done? 0)
(suspend)
@ -3249,7 +3249,7 @@
0
(ja-channel-push! 1 (seconds 0.1))
(cond
((logtest? (enemy-flag dislike-combo) (-> self enemy-flags))
((logtest? (enemy-flag drawn-mirrored) (-> self enemy-flags))
(ja-no-eval :group! crimson-guard-jump-left-ja :num! (seek! (ja-aframe 9.0 0)) :frame-num (ja-aframe 0.0 0))
(until (ja-done? 0)
(let ((a0-20 (handle->process (-> self focus handle))))
@ -3290,7 +3290,7 @@
)
0
(cond
((logtest? (enemy-flag dislike-combo) (-> self enemy-flags))
((logtest? (enemy-flag drawn-mirrored) (-> self enemy-flags))
(ja-no-eval :group! crimson-guard-jump-left-ja :num! (seek! (ja-aframe 11.0 0)) :frame-num (ja-aframe 9.0 0))
(until (ja-done? 0)
(suspend)
@ -3349,7 +3349,7 @@
)
)
(defmethod enemy-method-77 ((this crimson-guard-level) (arg0 (pointer float)))
(defmethod enemy-method-77 ((this crimson-guard-level) (arg0 enemy-knocked-info))
(let ((v1-1 (-> this root transv)))
(cond
((< (sqrtf (+ (* (-> v1-1 x) (-> v1-1 x)) (* (-> v1-1 z) (-> v1-1 z)))) 57344.0)
@ -3369,7 +3369,7 @@
)
(set! (-> a0-5 frame-group) (the-as art-joint-anim a1-2))
(set! (-> a0-5 param 0) (the float (+ (-> (the-as art-joint-anim a1-2) frames num-frames) -1)))
(set! (-> a0-5 param 1) (-> arg0 0))
(set! (-> a0-5 param 1) (-> arg0 anim-speed))
(set! (-> a0-5 frame-num) 0.0)
(joint-control-channel-group! a0-5 (the-as art-joint-anim a1-2) num-func-seek!)
)
@ -3380,7 +3380,7 @@
(ja-channel-push! 1 (seconds 0.01))
(cond
((= (-> this small-hit) 1)
(set! (-> this yellow-anim anim-index-front) (get-rand-int this 2))
(set! (-> this yellow-anim anim-index-front) (rnd-int-count this 2))
(let ((a1-8
(-> this
draw
@ -3398,7 +3398,7 @@
)
(set! (-> a0-17 frame-group) (the-as art-joint-anim a1-8))
(set! (-> a0-17 param 0) (the float (+ (-> (the-as art-joint-anim a1-8) frames num-frames) -1)))
(set! (-> a0-17 param 1) (-> arg0 0))
(set! (-> a0-17 param 1) (-> arg0 anim-speed))
(set! (-> a0-17 frame-num) 0.0)
(joint-control-channel-group! a0-17 (the-as art-joint-anim a1-8) num-func-seek!)
)
@ -3409,7 +3409,7 @@
)
(set! (-> a0-21 frame-group) (the-as art-joint-anim a1-9))
(set! (-> a0-21 param 0) (the float (+ (-> (the-as art-joint-anim a1-9) frames num-frames) -1)))
(set! (-> a0-21 param 1) (-> arg0 0))
(set! (-> a0-21 param 1) (-> arg0 anim-speed))
(set! (-> a0-21 frame-num) 0.0)
(joint-control-channel-group! a0-21 (the-as art-joint-anim a1-9) num-func-seek!)
)
@ -3423,7 +3423,7 @@
(set! (-> a0-24 param 0)
(the float (+ (-> (the-as art-joint-anim (-> this draw art-group data 10)) frames num-frames) -1))
)
(set! (-> a0-24 param 1) (-> arg0 0))
(set! (-> a0-24 param 1) (-> arg0 anim-speed))
(set! (-> a0-24 frame-num) 0.0)
(joint-control-channel-group! a0-24 (the-as art-joint-anim (-> this draw art-group data 10)) num-func-seek!)
)
@ -3435,7 +3435,7 @@
)
(set! (-> a0-29 frame-group) (the-as art-joint-anim a1-13))
(set! (-> a0-29 param 0) (the float (+ (-> (the-as art-joint-anim a1-13) frames num-frames) -1)))
(set! (-> a0-29 param 1) (-> arg0 0))
(set! (-> a0-29 param 1) (-> arg0 anim-speed))
(set! (-> a0-29 frame-num) 0.0)
(joint-control-channel-group! a0-29 (the-as art-joint-anim a1-13) num-func-seek!)
)
@ -3471,7 +3471,7 @@
)
)
(defmethod enemy-method-78 ((this crimson-guard-level) (arg0 (pointer float)))
(defmethod enemy-method-78 ((this crimson-guard-level) (arg0 enemy-knocked-info))
(cond
((<= (-> this hit-points) 0)
(let ((a1-1 (-> this draw art-group data (-> this info knocked-land anim-index (-> this hit-face))))
@ -3479,7 +3479,7 @@
)
(set! (-> a0-4 frame-group) (the-as art-joint-anim a1-1))
(set! (-> a0-4 param 0) (the float (+ (-> (the-as art-joint-anim a1-1) frames num-frames) -1)))
(set! (-> a0-4 param 1) (-> arg0 0))
(set! (-> a0-4 param 1) (-> arg0 anim-speed))
(set! (-> a0-4 frame-num) 0.0)
(joint-control-channel-group! a0-4 (the-as art-joint-anim a1-1) num-func-seek!)
)
@ -3509,7 +3509,7 @@
)
(set! (-> a0-15 frame-group) (the-as art-joint-anim a1-6))
(set! (-> a0-15 param 0) (the float (+ (-> (the-as art-joint-anim a1-6) frames num-frames) -1)))
(set! (-> a0-15 param 1) (-> arg0 0))
(set! (-> a0-15 param 1) (-> arg0 anim-speed))
(set! (-> a0-15 frame-num) 0.0)
(joint-control-channel-group! a0-15 (the-as art-joint-anim a1-6) num-func-seek!)
)
@ -3522,7 +3522,7 @@
)
(set! (-> a0-19 frame-group) (the-as art-joint-anim a1-7))
(set! (-> a0-19 param 0) (the float (+ (-> (the-as art-joint-anim a1-7) frames num-frames) -1)))
(set! (-> a0-19 param 1) (-> arg0 0))
(set! (-> a0-19 param 1) (-> arg0 anim-speed))
(set! (-> a0-19 frame-num) 0.0)
(joint-control-channel-group! a0-19 (the-as art-joint-anim a1-7) num-func-seek!)
)
@ -3537,7 +3537,7 @@
(set! (-> a0-22 param 0)
(the float (+ (-> (the-as art-joint-anim (-> this draw art-group data 11)) frames num-frames) -1))
)
(set! (-> a0-22 param 1) (-> arg0 0))
(set! (-> a0-22 param 1) (-> arg0 anim-speed))
(set! (-> a0-22 frame-num) 0.0)
(joint-control-channel-group! a0-22 (the-as art-joint-anim (-> this draw art-group data 11)) num-func-seek!)
)
@ -3551,7 +3551,7 @@
)
(set! (-> a0-27 frame-group) (the-as art-joint-anim a1-11))
(set! (-> a0-27 param 0) (the float (+ (-> (the-as art-joint-anim a1-11) frames num-frames) -1)))
(set! (-> a0-27 param 1) (-> arg0 0))
(set! (-> a0-27 param 1) (-> arg0 anim-speed))
(set! (-> a0-27 frame-num) 0.0)
(joint-control-channel-group! a0-27 (the-as art-joint-anim a1-11) num-func-seek!)
)
@ -3569,7 +3569,7 @@
((enemy-method-133 self)
(ja-channel-push! 1 (seconds 0.2))
(let ((gp-0 (-> self draw art-group data (-> self enemy-info die-falling-anim)))
(f30-0 (get-rand-float-range self 0.8 1.2))
(f30-0 (rnd-float-range self 0.8 1.2))
)
(ja-no-eval :group! gp-0 :num! (seek! max f30-0) :frame-num 0.0)
(until (ja-done? 0)
@ -4026,7 +4026,9 @@
(ja :num! (loop! f30-0))
)
)
(set! (-> self enemy-flags) (the-as enemy-flag (logclear (-> self enemy-flags) (enemy-flag vulnerable))))
(set! (-> self enemy-flags)
(the-as enemy-flag (logclear (-> self enemy-flags) (enemy-flag jump-check-blocked)))
)
(send-event self 'jump 0 (-> self event-param-point))
(until #f
(suspend)
@ -4234,7 +4236,7 @@
(set! (-> this joint) (new 'process 'joint-mod (joint-mod-mode joint-set*-world) this 4))
(set! (-> this l-control) (new 'process 'lightning-control (-> *lightning-spec-id-table* 13) this 0.0))
(set! (-> this l-control state points-to-draw) 0)
(let ((v1-45 (get-rand-int this 2)))
(let ((v1-45 (rnd-int-count this 2)))
(if (logtest? (-> this flags) 4)
(set! v1-45 0)
)

View File

@ -72,11 +72,11 @@
)
)
(defmethod enemy-method-77 ((this hopper) (arg0 (pointer float)))
(defmethod enemy-method-77 ((this hopper) (arg0 enemy-knocked-info))
(case (-> this incoming knocked-type)
(((knocked-type knocked-type-6))
(let* ((a2-0 (ash 1 (-> *hopper-global-info* prev-blue-hit)))
(v1-3 (enemy-method-120 this 3 a2-0))
(v1-3 (rnd-bit this 3 a2-0))
(a1-5 (-> this draw art-group data (-> *hopper-global-info* blue-hit-anim v1-3 hit-anim-index)))
)
(set! (-> *hopper-global-info* prev-blue-hit) v1-3)
@ -92,7 +92,7 @@
(else
(ja-channel-push! 1 (seconds 0.1))
(let* ((a2-2 (ash 1 (-> *hopper-global-info* prev-yellow-hit)))
(v1-13 (enemy-method-120 this 3 a2-2))
(v1-13 (rnd-bit this 3 a2-2))
(a1-11 (-> this draw art-group data (-> *hopper-global-info* yellow-hit-anim v1-13 hit-anim-index)))
)
(set! (-> this land-anim-index) (-> *hopper-global-info* yellow-hit-anim v1-13 land-anim-index))
@ -100,7 +100,7 @@
(let ((a0-27 (-> this skel root-channel 0)))
(set! (-> a0-27 frame-group) (the-as art-joint-anim a1-11))
(set! (-> a0-27 param 0) (the float (+ (-> (the-as art-joint-anim a1-11) frames num-frames) -1)))
(set! (-> a0-27 param 1) (-> arg0 0))
(set! (-> a0-27 param 1) (-> arg0 anim-speed))
(set! (-> a0-27 frame-num) 0.0)
(joint-control-channel-group! a0-27 (the-as art-joint-anim a1-11) num-func-seek!)
)
@ -110,7 +110,7 @@
#t
)
(defmethod enemy-method-78 ((this hopper) (arg0 (pointer float)))
(defmethod enemy-method-78 ((this hopper) (arg0 enemy-knocked-info))
(cond
((= (-> this incoming knocked-type) (knocked-type knocked-type-6))
(when (>= (-> this incoming blue-juggle-count) (the-as uint 2))
@ -119,7 +119,7 @@
(let ((a0-3 (-> this skel root-channel 0)))
(set! (-> a0-3 frame-group) (the-as art-joint-anim s4-0))
(set! (-> a0-3 param 0) (the float (+ (-> (the-as art-joint-anim s4-0) frames num-frames) -1)))
(set! (-> a0-3 param 1) (-> arg0 0))
(set! (-> a0-3 param 1) (-> arg0 anim-speed))
(set! (-> a0-3 frame-num) 0.0)
(joint-control-channel-group! a0-3 (the-as art-joint-anim s4-0) num-func-seek!)
)
@ -137,7 +137,7 @@
(+ (-> (the-as art-joint-anim (-> this draw art-group data (-> this land-anim-index))) frames num-frames) -1)
)
)
(set! (-> a0-5 param 1) (-> arg0 0))
(set! (-> a0-5 param 1) (-> arg0 anim-speed))
(set! (-> a0-5 frame-num) 0.0)
(joint-control-channel-group!
a0-5
@ -641,7 +641,7 @@
0
(set! (-> self speed-y) 0.0)
(set! (-> self accel-y) 0.0)
(set! (-> self next-jump-time) (the-as int (+ (current-time) (get-rand-int-range self 0 120))))
(set! (-> self next-jump-time) (the-as int (+ (current-time) (rnd-int-range self 0 120))))
(set! (-> self step-num) 0)
(set! (-> self best-score) -2.0)
)
@ -666,7 +666,7 @@
)
)
0.0
(let ((s5-0 (get-rand-int self 2)))
(let ((s5-0 (rnd-int-count self 2)))
(set! (-> self direction y) 0.0)
(let* ((v1-12 s4-1)
(f30-0 (sqrtf (+ (* (-> v1-12 x) (-> v1-12 x)) (* (-> v1-12 z) (-> v1-12 z)))))
@ -676,8 +676,8 @@
0.0
(let ((s4-2 (new 'stack-no-clear 'vector))
(f28-0 (if (zero? s5-0)
(get-rand-float-range self 4096.0 8192.0)
(get-rand-float-range self 8192.0 (fmin 40960.0 (fmax 16384.0 (* 0.5 f30-0))))
(rnd-float-range self 4096.0 8192.0)
(rnd-float-range self 8192.0 (fmin 40960.0 (fmax 16384.0 (* 0.5 f30-0))))
)
)
)
@ -694,8 +694,6 @@
)
(set! (-> self best-score) -2.0)
(set! (-> self origin quad) (-> self root trans quad))
;; ;; og:preserve-this
; (b! #t cfg-17)
(until (not (hopper-method-178 self))
(empty)
)
@ -725,7 +723,7 @@
(set! (-> self jump-start-anim) (the-as uint 10))
)
(cond
((zero? (get-rand-int self 2))
((zero? (rnd-int-count self 2))
(set! (-> self jump-air-anim) (the-as uint 15))
(set! (-> self jump-land-anim) (the-as uint 16))
(set! (-> self jump-height-min) 12288.0)
@ -740,8 +738,10 @@
)
)
)
(set! *hopper-next-jump-time* (+ (current-time) (get-rand-int-range self 4 22)))
(set! (-> self enemy-flags) (the-as enemy-flag (logclear (-> self enemy-flags) (enemy-flag vulnerable))))
(set! *hopper-next-jump-time* (+ (current-time) (rnd-int-range self 4 22)))
(set! (-> self enemy-flags)
(the-as enemy-flag (logclear (-> self enemy-flags) (enemy-flag jump-check-blocked)))
)
(send-event self 'jump 0 (-> self best-point))
)
)
@ -770,8 +770,10 @@
(set! (-> self jump-anim-start-frame) 8.0)
)
)
(set! *hopper-next-jump-time* (+ (current-time) (get-rand-int-range self 4 22)))
(set! (-> self enemy-flags) (the-as enemy-flag (logclear (-> self enemy-flags) (enemy-flag vulnerable))))
(set! *hopper-next-jump-time* (+ (current-time) (rnd-int-range self 4 22)))
(set! (-> self enemy-flags)
(the-as enemy-flag (logclear (-> self enemy-flags) (enemy-flag jump-check-blocked)))
)
(send-event self 'jump 0 (-> self best-point))
)
)
@ -797,7 +799,7 @@
)
:code (behavior ()
(ja-channel-push! 1 (seconds 0.2))
(let ((f30-0 (get-rand-float-range self 0.9 1.1)))
(let ((f30-0 (rnd-float-range self 0.9 1.1)))
(until #f
(ja-no-eval :group! hopper-idle-ja :num! (seek! max f30-0) :frame-num 0.0)
(until (ja-done? 0)
@ -815,10 +817,10 @@
:virtual #t
:code (behavior ()
(ja-channel-push! 1 (seconds 0.075))
(let ((f30-0 (get-rand-float-range self 0.8 1.2))
(let ((f30-0 (rnd-float-range self 0.8 1.2))
(gp-0 (new 'stack-no-clear 'vector))
)
(if (zero? (get-rand-int self 2))
(if (zero? (rnd-int-count self 2))
(ja :group! hopper-notice-ja)
(ja :group! hopper-notice-alt-ja)
)
@ -839,8 +841,8 @@
(defstate ambush (hopper)
:virtual #t
:enter (behavior ()
(when (logtest? (-> self enemy-flags) (enemy-flag auto-reset-penetrate))
(logclear! (-> self enemy-flags) (enemy-flag auto-reset-penetrate))
(when (logtest? (-> self enemy-flags) (enemy-flag enable-on-notice))
(logclear! (-> self enemy-flags) (enemy-flag enable-on-notice))
(let ((gp-0 (-> self on-notice)))
(if gp-0
(script-eval gp-0 :vector (-> self root trans))
@ -896,14 +898,16 @@
(set! (-> gp-0 y) (-> s5-0 best-other-tri intersect y))
)
)
(set! (-> self enemy-flags) (the-as enemy-flag (logclear (-> self enemy-flags) (enemy-flag vulnerable))))
(set! (-> self enemy-flags)
(the-as enemy-flag (logclear (-> self enemy-flags) (enemy-flag jump-check-blocked)))
)
(send-event self 'jump 2 gp-0)
)
(go-virtual hostile)
)
)
(defmethod dispose! ((this hopper))
(defmethod dying ((this hopper))
"Cleans-up the enemy and any associated resources. Potentially spawns skull gems"
(when (-> this minimap)
(logior! (-> this minimap flags) (minimap-flag fade-out))
@ -1008,7 +1012,7 @@
(set! (-> this jump-height-min) 12288.0)
(set! (-> this jump-anim-start-frame) 8.0)
(set! (-> this land-anim-index) 26)
(set! (-> this side) (get-rand-float-range this -1.5 1.5))
(set! (-> this side) (rnd-float-range this -1.5 1.5))
(when (logtest? (enemy-option ambush) (-> this fact enemy-options))
(set! (-> this path-intro) (new 'process 'path-control this 'intro 0.0 (-> this entity) #f))
(if (-> this path-intro)

View File

@ -585,7 +585,7 @@
;; WARN: Return type mismatch int vs sound-id.
(defmethod enemy-method-135 ((this crimson-guard-hover) (arg0 int))
(if (and (zero? arg0) (logtest? #x4000000 (-> this incoming penetrate-using)))
(if (and (zero? arg0) (logtest? (penetrate enemy-yellow-shot) (-> this incoming penetrate-using)))
(sound-play "hover-take-hit")
(call-parent-method this arg0)
)
@ -600,7 +600,7 @@
(t9-0)
)
)
(set! (-> self last-fire-time) (+ (current-time) (the int (* 300.0 (get-rand-float-range self 2.0 3.0)))))
(set! (-> self last-fire-time) (+ (current-time) (the int (* 300.0 (rnd-float-range self 2.0 3.0)))))
(go-virtual ambush-fly)
)
:exit (behavior ()
@ -926,29 +926,29 @@
(ja :num! (seek!))
)
(set! (-> self restart-fly-anims) #t)
(if (logtest? (-> self enemy-flags) (enemy-flag check-water))
(if (logtest? (-> self enemy-flags) (enemy-flag dangerous-backup))
(logior! (-> self focus-status) (focus-status dangerous))
(logclear! (-> self focus-status) (focus-status dangerous))
)
(let ((v1-34 (-> self enemy-flags)))
(if (logtest? v1-34 (enemy-flag checking-water))
(set! v1-35 (logior v1-34 (enemy-flag enable-on-active)))
(set! v1-35 (logclear v1-34 (enemy-flag enable-on-active)))
(if (logtest? v1-34 (enemy-flag vulnerable-backup))
(set! v1-35 (logior v1-34 (enemy-flag vulnerable)))
(set! v1-35 (logclear v1-34 (enemy-flag vulnerable)))
)
)
(set! (-> self enemy-flags) v1-35)
(if (logtest? (-> self enemy-flags) (enemy-flag look-at-move-dest))
(if (logtest? (-> self enemy-flags) (enemy-flag attackable-backup))
(logior! (-> self mask) (process-mask collectable))
(logclear! (-> self mask) (process-mask collectable))
)
(let ((v1-42 (-> self enemy-flags)))
(if (logtest? (enemy-flag no-initial-move-to-ground) v1-42)
(set! v1-43 (logior (enemy-flag check-water-backup) v1-42))
(set! v1-43 (logclear v1-42 (enemy-flag check-water-backup)))
(if (logtest? (enemy-flag trackable-backup) v1-42)
(set! v1-43 (logior (enemy-flag trackable) v1-42))
(set! v1-43 (logclear v1-42 (enemy-flag trackable)))
)
)
(set! (-> self enemy-flags) v1-43)
(logclear! (-> self enemy-flags) (enemy-flag actor-pause-backup))
(logclear! (-> self enemy-flags) (enemy-flag lock-focus))
(logclear! (-> self focus-status) (focus-status hit))
(hover-nav-control-method-21 (-> self hover))
(go-hostile self)
@ -959,7 +959,7 @@
:virtual #t
:event enemy-event-handler
:code (behavior ()
(dispose! self)
(dying self)
(let ((v1-3 (-> self root root-prim)))
(set! (-> v1-3 prim-core collide-as) (collide-spec))
(set! (-> v1-3 prim-core collide-with) (collide-spec))
@ -1113,9 +1113,9 @@
(hover-nav-control-method-20 (-> this hover))
(hover-enemy-method-140 this #t)
(let ((v1-14 (-> this enemy-flags)))
(if (logtest? v1-14 (enemy-flag checking-water))
(set! v1-15 (logior v1-14 (enemy-flag enable-on-active)))
(set! v1-15 (logclear v1-14 (enemy-flag enable-on-active)))
(if (logtest? v1-14 (enemy-flag vulnerable-backup))
(set! v1-15 (logior v1-14 (enemy-flag vulnerable)))
(set! v1-15 (logclear v1-14 (enemy-flag vulnerable)))
)
)
(set! (-> this enemy-flags) v1-15)
@ -1247,7 +1247,7 @@
)
(vector-negate! gp-1 gp-1)
)
(let ((f30-1 (get-rand-float-range this 0.0 1.0))
(let ((f30-1 (rnd-float-range this 0.0 1.0))
(s5-1 (-> this enemy-info))
)
(vector-float*! gp-1 gp-1 (lerp (-> s5-1 knocked-hard-vxz-lo) (-> s5-1 knocked-hard-vxz-hi) f30-1))
@ -1263,7 +1263,7 @@
(none)
)
(defmethod enemy-method-77 ((this crimson-guard-hover) (arg0 (pointer float)))
(defmethod enemy-method-77 ((this crimson-guard-hover) (arg0 enemy-knocked-info))
(ja-channel-push! 1 0)
(case (-> this incoming knocked-type)
(((knocked-type knocked-type-5))
@ -1272,7 +1272,7 @@
(set! (-> a0-3 param 0)
(the float (+ (-> (the-as art-joint-anim (-> this draw art-group data 12)) frames num-frames) -1))
)
(set! (-> a0-3 param 1) (-> arg0 0))
(set! (-> a0-3 param 1) (-> arg0 anim-speed))
(set! (-> a0-3 frame-num) 0.0)
(joint-control-channel-group! a0-3 (the-as art-joint-anim (-> this draw art-group data 12)) num-func-seek!)
)
@ -1284,7 +1284,7 @@
(set! (-> a0-4 param 0)
(the float (+ (-> (the-as art-joint-anim (-> this draw art-group data 10)) frames num-frames) -1))
)
(set! (-> a0-4 param 1) (-> arg0 0))
(set! (-> a0-4 param 1) (-> arg0 anim-speed))
(set! (-> a0-4 frame-num) 0.0)
(joint-control-channel-group! a0-4 (the-as art-joint-anim (-> this draw art-group data 10)) num-func-seek!)
)
@ -1294,7 +1294,7 @@
#t
)
(defmethod enemy-method-78 ((this crimson-guard-hover) (arg0 (pointer float)))
(defmethod enemy-method-78 ((this crimson-guard-hover) (arg0 enemy-knocked-info))
(cond
((zero? (-> this hit-points))
(ja-channel-push! 1 (seconds 0.4))
@ -1303,7 +1303,7 @@
(set! (-> a0-2 param 0)
(the float (+ (-> (the-as art-joint-anim (-> this draw art-group data 19)) frames num-frames) -1))
)
(set! (-> a0-2 param 1) (-> arg0 0))
(set! (-> a0-2 param 1) (-> arg0 anim-speed))
(set! (-> a0-2 frame-num) 0.0)
(joint-control-channel-group! a0-2 (the-as art-joint-anim (-> this draw art-group data 19)) num-func-seek!)
)
@ -1315,7 +1315,7 @@
)
)
(defmethod track-target! ((this crimson-guard-hover))
(defmethod common-post ((this crimson-guard-hover))
"Does a lot of various things relating to interacting with the target
- tracks when the enemy was last drawn
- looks at the target and handles attacking
@ -1346,7 +1346,7 @@
(* 2.0 (seconds-per-frame))
)
)
(let ((t9-6 (method-of-type hover-enemy track-target!)))
(let ((t9-6 (method-of-type hover-enemy common-post)))
(t9-6 this)
)
(los-control-method-9 (-> this los) (the-as process-focusable #f) (the-as vector #f) 2048.0)
@ -1743,7 +1743,7 @@
(set! (-> this gun-x-angle-final) 0.0)
(set! (-> this hips-jmod) (the-as joint-mod (new 'process 'joint-mod-rotate-local this 18 #t)))
(logclear! (-> this mask) (process-mask actor-pause))
(logclear! (-> this enemy-flags) (enemy-flag notice))
(logclear! (-> this enemy-flags) (enemy-flag actor-pause-backup))
(set! sv-16 (new 'static 'res-tag))
(let ((v1-30 (res-lump-data (-> this entity) 'actor-groups (pointer actor-group) :tag-ptr (& sv-16))))
(if (and v1-30 (= (-> sv-16 elt-count) 1))

View File

@ -217,15 +217,15 @@
(('hit 'hit-flinch 'hit-knocked)
(logclear! (-> this mask) (process-mask actor-pause))
(logclear! (-> this focus-status) (focus-status dangerous))
(logclear! (-> this enemy-flags) (enemy-flag enable-on-notice))
(logior! (-> this enemy-flags) (enemy-flag chase-startup))
(logclear! (-> this enemy-flags) (enemy-flag use-notice-distance))
(logior! (-> this enemy-flags) (enemy-flag alert))
(logior! (-> this focus-status) (focus-status hit))
(if (zero? (-> this hit-points))
(logior! (-> this focus-status) (focus-status dead))
)
(logclear! (-> this enemy-flags) (enemy-flag actor-pause-backup))
(logclear! (-> this enemy-flags) (enemy-flag lock-focus))
(enemy-method-62 this)
(logior! (-> this enemy-flags) (enemy-flag actor-pause-backup))
(logior! (-> this enemy-flags) (enemy-flag lock-focus))
(process-contact-action arg0)
(send-event arg0 'get-attack-count 1)
(go (method-of-object this knocked))
@ -548,14 +548,14 @@
)
)
(defmethod track-target! ((this flamer))
(defmethod common-post ((this flamer))
"Does a lot of various things relating to interacting with the target
- tracks when the enemy was last drawn
- looks at the target and handles attacking
@TODO Not extremely well understood yet"
(update-vol! (-> this sound) (-> this sound-volume))
(flamer-method-191 this)
((method-of-type nav-enemy track-target!) this)
((method-of-type nav-enemy common-post) this)
(none)
)
@ -678,7 +678,7 @@
((zero? v1-0)
(let ((a1-1 (new 'stack-no-clear 'collide-query)))
(cond
((enemy-method-125 this a1-1 (collide-spec backgnd) 8192.0 26624.0 1024.0)
((ground-pat-set! this a1-1 (collide-spec backgnd) 8192.0 26624.0 1024.0)
(set! (-> this base-pos y) (+ 22528.0 (-> this root gspot-pos y)))
)
(else
@ -829,7 +829,7 @@
)
)
(logclear! (-> self mask) (process-mask actor-pause))
(logclear! (-> self enemy-flags) (enemy-flag notice))
(logclear! (-> self enemy-flags) (enemy-flag actor-pause-backup))
(if (not (-> self path))
(go-virtual notice)
)
@ -860,7 +860,7 @@
)
)
(logior! (-> self mask) (process-mask actor-pause))
(logior! (-> self enemy-flags) (enemy-flag notice))
(logior! (-> self enemy-flags) (enemy-flag actor-pause-backup))
(set! (-> self flit-joint twist-min-y) (the-as float #t))
(set! (-> self last-fire-time) (+ (current-time) (seconds -1.5)))
)
@ -896,7 +896,7 @@
:virtual #t
:enter (behavior ()
(logclear! (-> self mask) (process-mask actor-pause))
(logclear! (-> self enemy-flags) (enemy-flag notice))
(logclear! (-> self enemy-flags) (enemy-flag actor-pause-backup))
(if (not (-> self path))
(go-virtual active)
)
@ -951,7 +951,7 @@
)
:exit (behavior ()
(logior! (-> self mask) (process-mask actor-pause))
(logior! (-> self enemy-flags) (enemy-flag notice))
(logior! (-> self enemy-flags) (enemy-flag actor-pause-backup))
)
:trans (behavior ()
(set! (-> self path-pos) (- (-> self path-pos) (* 0.33333334 (seconds-per-frame))))
@ -1155,7 +1155,7 @@
;; WARN: Return type mismatch object vs symbol.
;; WARN: Using new Jak 2 rtype-of
(defmethod enemy-method-77 ((this flamer) (arg0 (pointer float)))
(defmethod enemy-method-77 ((this flamer) (arg0 enemy-knocked-info))
(let ((v1-0 (-> this incoming knocked-type)))
(the-as
symbol
@ -1166,7 +1166,7 @@
(s4-0 (new 'static 'array uint64 3 #x12 #x13 #x14))
(s3-0 (new 'static 'array int32 4 0 0 0 0))
(a2-0 (ash 1 (-> s3-0 0)))
(v1-6 (enemy-method-120 this a1-3 a2-0))
(v1-6 (rnd-bit this a1-3 a2-0))
(s4-1 (-> this draw art-group data (-> (the-as (pointer int32) (+ (* v1-6 8) (the-as int s4-0))))))
)
(set! (-> s3-0 0) v1-6)
@ -1183,7 +1183,7 @@
(let ((a0-17 (-> this skel root-channel 0)))
(set! (-> a0-17 frame-group) (the-as art-joint-anim s4-1))
(set! (-> a0-17 param 0) (the float (+ (-> (the-as art-joint-anim s4-1) frames num-frames) -1)))
(set! (-> a0-17 param 1) (-> arg0 0))
(set! (-> a0-17 param 1) (-> arg0 anim-speed))
(set! (-> a0-17 frame-num) 0.0)
(joint-control-channel-group! a0-17 (the-as art-joint-anim s4-1) num-func-seek!)
)
@ -1196,7 +1196,7 @@
)
(set! (-> a0-21 frame-group) (the-as art-joint-anim a1-10))
(set! (-> a0-21 param 0) (the float (+ (-> (the-as art-joint-anim a1-10) frames num-frames) -1)))
(set! (-> a0-21 param 1) (-> arg0 0))
(set! (-> a0-21 param 1) (-> arg0 anim-speed))
(set! (-> a0-21 frame-num) 0.0)
(joint-control-channel-group! a0-21 (the-as art-joint-anim a1-10) num-func-seek!)
)
@ -1268,7 +1268,7 @@
0
(set! (-> self hit-points) 0)
(if (logtest? (enemy-option knocked-into-water) (-> self fact enemy-options))
(logior! (-> self enemy-flags) (enemy-flag trackable-backup))
(logior! (-> self enemy-flags) (enemy-flag check-water))
)
(let ((v1-8 self))
(set! (-> v1-8 enemy-flags) (the-as enemy-flag (logior (enemy-flag enemy-flag37) (-> v1-8 enemy-flags))))
@ -1284,10 +1284,10 @@
)
)
(defmethod dispose! ((this flamer))
(defmethod dying ((this flamer))
"Cleans-up the enemy and any associated resources. Potentially spawns skull gems"
(let ((s5-1 (logtest? (enemy-flag recover-applied-velocity) (-> this enemy-flags))))
(let ((t9-0 (method-of-type nav-enemy dispose!)))
(let ((s5-1 (logtest? (enemy-flag called-dying) (-> this enemy-flags))))
(let ((t9-0 (method-of-type nav-enemy dying)))
(t9-0 this)
)
(if (not s5-1)
@ -1410,7 +1410,7 @@
(set! (-> this scale) 1.6)
(flamer-method-186 this 1.0)
(logclear! (-> this nav flags) (nav-control-flag limit-rotation-rate))
(set! (-> this sync-off) (the-as uint (get-rand-int this 600)))
(set! (-> this sync-off) (the-as uint (rnd-int-count this 600)))
(set! (-> this flit-angle) 0.0)
(set! (-> this flit-timer) 0)
(set! (-> this root dynam gravity y) 225280.0)
@ -1441,7 +1441,7 @@
(set! (-> this sound)
(new 'process 'ambient-sound (static-sound-spec "flamer-loop" :fo-max 80) (-> this root trans))
)
(logior! (-> this enemy-flags) (enemy-flag multi-focus))
(logior! (-> this enemy-flags) (enemy-flag dislike-combo))
(let ((v1-45 (-> this nav)))
(set! (-> v1-45 sphere-mask) (the-as uint 0))
)

View File

@ -21,20 +21,20 @@
(('hit 'hit-knocked 'hit-flinch)
(logclear! (-> this mask) (process-mask actor-pause))
(logclear! (-> this focus-status) (focus-status dangerous))
(logclear! (-> this enemy-flags) (enemy-flag enable-on-notice))
(logior! (-> this enemy-flags) (enemy-flag chase-startup))
(logclear! (-> this enemy-flags) (enemy-flag use-notice-distance))
(logior! (-> this enemy-flags) (enemy-flag alert))
(logior! (-> this focus-status) (focus-status hit))
(if (zero? (-> this hit-points))
(logior! (-> this focus-status) (focus-status dead))
)
(logclear! (-> this enemy-flags) (enemy-flag actor-pause-backup))
(logclear! (-> this enemy-flags) (enemy-flag lock-focus))
(enemy-method-62 this)
(logior! (-> this enemy-flags) (enemy-flag actor-pause-backup))
(logior! (-> this enemy-flags) (enemy-flag lock-focus))
(process-contact-action arg0)
(send-event arg0 'get-attack-count 1)
(cond
((zero? (-> this hit-points))
(if (rng-hit? this 0.4)
(if (rnd-percent? this 0.4)
(go (method-of-object this flying-death))
(go (method-of-object this flying-death-explode))
)
@ -290,14 +290,14 @@
(none)
)
(defmethod track-target! ((this hover-enemy))
(defmethod common-post ((this hover-enemy))
"Does a lot of various things relating to interacting with the target
- tracks when the enemy was last drawn
- looks at the target and handles attacking
@TODO Not extremely well understood yet"
(hover-enemy-method-148 this)
(enemy-method-129 this)
(let ((t9-2 (method-of-type enemy track-target!)))
(let ((t9-2 (method-of-type enemy common-post)))
(t9-2 this)
)
(hover-nav-control-method-13 (-> this hover))
@ -441,7 +441,7 @@
(defstate ambush (hover-enemy)
:virtual #t
:enter (behavior ()
(logior! (-> self enemy-flags) (enemy-flag use-notice-distance))
(logior! (-> self enemy-flags) (enemy-flag cam-attack-mode))
(hover-enemy-method-140 self #f)
(if (logtest? (-> self path flags) (path-control-flag not-found))
(go process-drawable-art-error "no path")
@ -449,7 +449,7 @@
(set! (-> self scale-timer) (the-as uint (current-time)))
(cond
((not (logtest? (-> self fact enemy-options) (enemy-option user0)))
(logclear! (-> self enemy-flags) (enemy-flag enable-on-active))
(logclear! (-> self enemy-flags) (enemy-flag vulnerable))
(hover-enemy-method-141 self 0.0)
)
(else
@ -509,9 +509,9 @@
(hover-nav-control-method-20 (-> self hover))
(hover-enemy-method-140 self #t)
(let ((v1-4 (-> self enemy-flags)))
(if (logtest? v1-4 (enemy-flag checking-water))
(set! v1-5 (logior v1-4 (enemy-flag enable-on-active)))
(set! v1-5 (logclear v1-4 (enemy-flag enable-on-active)))
(if (logtest? v1-4 (enemy-flag vulnerable-backup))
(set! v1-5 (logior v1-4 (enemy-flag vulnerable)))
(set! v1-5 (logclear v1-4 (enemy-flag vulnerable)))
)
)
(set! (-> self enemy-flags) v1-5)
@ -536,11 +536,11 @@
(when (< f0-1 f1-0)
(let ((f30-0 (fmin 1.0 (/ (+ 30.0 f0-1) f1-0))))
(hover-enemy-method-141 self f30-0)
(when (and (not (logtest? (-> self enemy-flags) (enemy-flag enable-on-active))) (>= f30-0 1.0))
(when (and (not (logtest? (-> self enemy-flags) (enemy-flag vulnerable))) (>= f30-0 1.0))
(let ((v1-18 (-> self enemy-flags)))
(if (logtest? v1-18 (enemy-flag checking-water))
(set! v1-19 (logior v1-18 (enemy-flag enable-on-active)))
(set! v1-19 (logclear v1-18 (enemy-flag enable-on-active)))
(if (logtest? v1-18 (enemy-flag vulnerable-backup))
(set! v1-19 (logior v1-18 (enemy-flag vulnerable)))
(set! v1-19 (logclear v1-18 (enemy-flag vulnerable)))
)
)
(set! (-> self enemy-flags) v1-19)
@ -655,29 +655,29 @@
(ja :num! (seek!))
)
(set! (-> self restart-fly-anims) #t)
(if (logtest? (-> self enemy-flags) (enemy-flag check-water))
(if (logtest? (-> self enemy-flags) (enemy-flag dangerous-backup))
(logior! (-> self focus-status) (focus-status dangerous))
(logclear! (-> self focus-status) (focus-status dangerous))
)
(let ((v1-37 (-> self enemy-flags)))
(if (logtest? v1-37 (enemy-flag checking-water))
(set! v1-38 (logior v1-37 (enemy-flag enable-on-active)))
(set! v1-38 (logclear v1-37 (enemy-flag enable-on-active)))
(if (logtest? v1-37 (enemy-flag vulnerable-backup))
(set! v1-38 (logior v1-37 (enemy-flag vulnerable)))
(set! v1-38 (logclear v1-37 (enemy-flag vulnerable)))
)
)
(set! (-> self enemy-flags) v1-38)
(if (logtest? (-> self enemy-flags) (enemy-flag look-at-move-dest))
(if (logtest? (-> self enemy-flags) (enemy-flag attackable-backup))
(logior! (-> self mask) (process-mask collectable))
(logclear! (-> self mask) (process-mask collectable))
)
(let ((v1-45 (-> self enemy-flags)))
(if (logtest? (enemy-flag no-initial-move-to-ground) v1-45)
(set! v1-46 (logior (enemy-flag check-water-backup) v1-45))
(set! v1-46 (logclear v1-45 (enemy-flag check-water-backup)))
(if (logtest? (enemy-flag trackable-backup) v1-45)
(set! v1-46 (logior (enemy-flag trackable) v1-45))
(set! v1-46 (logclear v1-45 (enemy-flag trackable)))
)
)
(set! (-> self enemy-flags) v1-46)
(logclear! (-> self enemy-flags) (enemy-flag actor-pause-backup))
(logclear! (-> self enemy-flags) (enemy-flag lock-focus))
(logclear! (-> self focus-status) (focus-status hit))
(hover-nav-control-method-21 (-> self hover))
(go-hostile self)
@ -698,12 +698,12 @@
)
:enter (behavior ()
(set-time! (-> self state-time))
(dispose! self)
(dying self)
(stop-looking-at-target! self)
(logior! (-> self enemy-flags) (enemy-flag actor-pause-backup))
(logior! (-> self enemy-flags) (enemy-flag lock-focus))
(logclear! (-> self mask) (process-mask actor-pause))
(logclear! (-> self focus-status) (focus-status dangerous))
(logclear! (-> self enemy-flags) (enemy-flag check-water-backup))
(logclear! (-> self enemy-flags) (enemy-flag trackable))
(set! (-> self root penetrate-using) (penetrate lunge vehicle knocked))
(let ((gp-0 (-> self flying-death-transv)))
(let ((a1-0 (handle->process (-> self incoming attacker-handle))))
@ -715,10 +715,10 @@
(set! (-> gp-0 y) 0.0)
(vector-normalize! gp-0 1.0)
(vector-rotate90-around-y! gp-0 gp-0)
(if (rng-hit? self 0.5)
(if (rnd-percent? self 0.5)
(vector-negate! gp-0 gp-0)
)
(let ((f30-0 (get-rand-float-range self 0.0 1.0)))
(let ((f30-0 (rnd-float-range self 0.0 1.0)))
(vector-float*! gp-0 gp-0 (lerp 98304.0 172032.0 f30-0))
(set! (-> gp-0 y) (lerp 8192.0 98304.0 f30-0))
)
@ -813,7 +813,7 @@
(defstate flying-death-explode (hover-enemy)
:virtual #t
:enter (behavior ()
(dispose! self)
(dying self)
(let ((v1-3 (-> self root root-prim)))
(set! (-> v1-3 prim-core collide-as) (collide-spec))
(set! (-> v1-3 prim-core collide-with) (collide-spec))
@ -881,13 +881,13 @@
(none)
)
(defmethod dispose! ((this hover-enemy))
(defmethod dying ((this hover-enemy))
"Cleans-up the enemy and any associated resources. Potentially spawns skull gems"
(when (not (logtest? (enemy-flag recover-applied-velocity) (-> this enemy-flags)))
(when (not (logtest? (enemy-flag called-dying) (-> this enemy-flags)))
(process-entity-status! this (entity-perm-status subtask-complete) #t)
(send-event (ppointer->process (-> this parent)) 'hover-die)
(hover-enemy-method-154 this)
((method-of-type enemy dispose!) this)
((method-of-type enemy dying) this)
)
(none)
)
@ -908,7 +908,7 @@
(defmethod hover-enemy-method-155 ((this hover-enemy))
(set! (-> this hover-info) (hover-enemy-method-151 this))
(set! (-> this fly-anim-speed) (get-rand-float-range this 0.8 1.2))
(set! (-> this fly-anim-speed) (rnd-float-range this 0.8 1.2))
(vector-reset! (-> this rotation-vec))
(vector-reset! (-> this dest-pos))
(vector-reset! (-> this local-dir))

View File

@ -443,15 +443,15 @@
(('hit 'hit-knocked)
(logclear! (-> this mask) (process-mask actor-pause))
(logclear! (-> this focus-status) (focus-status dangerous))
(logclear! (-> this enemy-flags) (enemy-flag enable-on-notice))
(logior! (-> this enemy-flags) (enemy-flag chase-startup))
(logclear! (-> this enemy-flags) (enemy-flag use-notice-distance))
(logior! (-> this enemy-flags) (enemy-flag alert))
(logior! (-> this focus-status) (focus-status hit))
(if (zero? (-> this hit-points))
(logior! (-> this focus-status) (focus-status dead))
)
(logclear! (-> this enemy-flags) (enemy-flag actor-pause-backup))
(logclear! (-> this enemy-flags) (enemy-flag lock-focus))
(enemy-method-62 this)
(logior! (-> this enemy-flags) (enemy-flag actor-pause-backup))
(logior! (-> this enemy-flags) (enemy-flag lock-focus))
(process-contact-action arg0)
(send-event arg0 'get-attack-count 1)
(if (zero? (-> this hit-points))
@ -487,7 +487,7 @@
)
(vector-negate! gp-1 gp-1)
)
(let ((f30-1 (get-rand-float-range this 0.0 1.0))
(let ((f30-1 (rnd-float-range this 0.0 1.0))
(s5-1 (-> this enemy-info))
)
(vector-float*! gp-1 gp-1 (lerp (-> s5-1 knocked-hard-vxz-lo) (-> s5-1 knocked-hard-vxz-hi) f30-1))
@ -537,13 +537,13 @@
(none)
)
(defmethod track-target! ((this wasp))
(defmethod common-post ((this wasp))
"Does a lot of various things relating to interacting with the target
- tracks when the enemy was last drawn
- looks at the target and handles attacking
@TODO Not extremely well understood yet"
(seek! (-> this gun-x-angle) (-> this gun-x-angle-final) (* 21845.334 (seconds-per-frame)))
((method-of-type hover-enemy track-target!) this)
((method-of-type hover-enemy common-post) this)
(none)
)
@ -597,7 +597,7 @@
)
)
:enter (behavior ()
(logior! (-> self enemy-flags) (enemy-flag use-notice-distance))
(logior! (-> self enemy-flags) (enemy-flag cam-attack-mode))
(hover-enemy-method-140 self #f)
(if (logtest? (-> self path flags) (path-control-flag not-found))
(go process-drawable-art-error "no path")
@ -616,9 +616,9 @@
(hover-nav-control-method-18 (-> self hover) (-> self path) -1 6)
(set-time! (-> self last-fire-time))
(set! (-> self bridge-index) 0)
(logclear! (-> self enemy-flags) (enemy-flag enable-on-active checking-water))
(logclear! (-> self enemy-flags) (enemy-flag vulnerable vulnerable-backup))
(logclear! (-> self mask) (process-mask collectable))
(logclear! (-> self enemy-flags) (enemy-flag look-at-move-dest))
(logclear! (-> self enemy-flags) (enemy-flag attackable-backup))
)
:exit (behavior ()
(let ((gp-0 (get-point-in-path! (-> self path) (new 'stack-no-clear 'vector) 0.0 'interp))
@ -951,29 +951,29 @@
(ja :num! (seek!))
)
(set! (-> self restart-fly-anims) #t)
(if (logtest? (-> self enemy-flags) (enemy-flag check-water))
(if (logtest? (-> self enemy-flags) (enemy-flag dangerous-backup))
(logior! (-> self focus-status) (focus-status dangerous))
(logclear! (-> self focus-status) (focus-status dangerous))
)
(let ((v1-34 (-> self enemy-flags)))
(if (logtest? v1-34 (enemy-flag checking-water))
(set! v1-35 (logior v1-34 (enemy-flag enable-on-active)))
(set! v1-35 (logclear v1-34 (enemy-flag enable-on-active)))
(if (logtest? v1-34 (enemy-flag vulnerable-backup))
(set! v1-35 (logior v1-34 (enemy-flag vulnerable)))
(set! v1-35 (logclear v1-34 (enemy-flag vulnerable)))
)
)
(set! (-> self enemy-flags) v1-35)
(if (logtest? (-> self enemy-flags) (enemy-flag look-at-move-dest))
(if (logtest? (-> self enemy-flags) (enemy-flag attackable-backup))
(logior! (-> self mask) (process-mask collectable))
(logclear! (-> self mask) (process-mask collectable))
)
(let ((v1-42 (-> self enemy-flags)))
(if (logtest? (enemy-flag no-initial-move-to-ground) v1-42)
(set! v1-43 (logior (enemy-flag check-water-backup) v1-42))
(set! v1-43 (logclear v1-42 (enemy-flag check-water-backup)))
(if (logtest? (enemy-flag trackable-backup) v1-42)
(set! v1-43 (logior (enemy-flag trackable) v1-42))
(set! v1-43 (logclear v1-42 (enemy-flag trackable)))
)
)
(set! (-> self enemy-flags) v1-43)
(logclear! (-> self enemy-flags) (enemy-flag actor-pause-backup))
(logclear! (-> self enemy-flags) (enemy-flag lock-focus))
(logclear! (-> self focus-status) (focus-status hit))
(hover-nav-control-method-21 (-> self hover))
(go-hostile self)
@ -984,7 +984,7 @@
:virtual #t
:event enemy-event-handler
:code (behavior ()
(dispose! self)
(dying self)
(set! (-> self hit-points) 0)
(let ((v1-3 (-> self root root-prim)))
(set! (-> v1-3 prim-core collide-as) (collide-spec))
@ -1045,7 +1045,7 @@
:virtual #t
:event enemy-event-handler
:code (behavior ()
(dispose! self)
(dying self)
(let ((v1-3 (-> self root root-prim)))
(set! (-> v1-3 prim-core collide-as) (collide-spec))
(set! (-> v1-3 prim-core collide-with) (collide-spec))
@ -1092,9 +1092,9 @@
)
)
(defmethod enemy-method-77 ((this wasp) (arg0 (pointer float)))
(defmethod enemy-method-77 ((this wasp) (arg0 enemy-knocked-info))
(cond
((rng-hit? this 0.5)
((rnd-percent? this 0.5)
(set! (-> this knocked-anim) 10)
(set! (-> this knocked-recover-anim) 11)
)
@ -1109,20 +1109,20 @@
)
(set! (-> a0-5 frame-group) (the-as art-joint-anim a1-3))
(set! (-> a0-5 param 0) (the float (+ (-> (the-as art-joint-anim a1-3) frames num-frames) -1)))
(set! (-> a0-5 param 1) (-> arg0 0))
(set! (-> a0-5 param 1) (-> arg0 anim-speed))
(set! (-> a0-5 frame-num) 0.0)
(joint-control-channel-group! a0-5 (the-as art-joint-anim a1-3) num-func-seek!)
)
#t
)
(defmethod enemy-method-78 ((this wasp) (arg0 (pointer float)))
(defmethod enemy-method-78 ((this wasp) (arg0 enemy-knocked-info))
(let ((v1-4 (-> this draw art-group data (-> this enemy-info knocked-land-anim)))
(a0-3 (-> this skel root-channel 0))
)
(set! (-> a0-3 frame-group) (the-as art-joint-anim v1-4))
(set! (-> a0-3 param 0) (the float (+ (-> (the-as art-joint-anim v1-4) frames num-frames) -1)))
(set! (-> a0-3 param 1) (-> arg0 0))
(set! (-> a0-3 param 1) (-> arg0 anim-speed))
(set! (-> a0-3 frame-num) 0.0)
(joint-control-channel-group! a0-3 (the-as art-joint-anim v1-4) num-func-seek!)
)
@ -1469,7 +1469,7 @@
(set! (-> this neck up) (the-as uint 1))
(set! (-> this neck nose) (the-as uint 2))
(set! (-> this neck ear) (the-as uint 0))
(set! (-> this scale) (get-rand-float-range this 0.9 1.3))
(set! (-> this scale) (rnd-float-range this 0.9 1.3))
(set! (-> this sound-id) (new-sound-id))
(set! (-> this root dynam gravity y) 327680.0)
(set! (-> this root dynam gravity-length) 327680.0)
@ -1480,7 +1480,7 @@
(set! (-> this gun-x-angle) 0.0)
(set! (-> this gun-x-angle-final) 0.0)
(logclear! (-> this mask) (process-mask actor-pause))
(logclear! (-> this enemy-flags) (enemy-flag notice))
(logclear! (-> this enemy-flags) (enemy-flag actor-pause-backup))
(set! sv-16 (new 'static 'res-tag))
(let ((v1-28 (res-lump-data (-> this entity) 'actor-groups (pointer actor-group) :tag-ptr (& sv-16))))
(if (and v1-28 (= (-> sv-16 elt-count) 1))

View File

@ -360,12 +360,12 @@
(none)
)
(defmethod track-target! ((this metalmonk))
(defmethod common-post ((this metalmonk))
"Does a lot of various things relating to interacting with the target
- tracks when the enemy was last drawn
- looks at the target and handles attacking
@TODO Not extremely well understood yet"
(let ((t9-0 (method-of-type nav-enemy track-target!)))
(let ((t9-0 (method-of-type nav-enemy common-post)))
(t9-0 this)
)
(set! (-> this old-facing quad) (-> this new-facing quad))
@ -381,15 +381,15 @@
(('hit 'hit-knocked 'hit-flinch)
(logclear! (-> this mask) (process-mask actor-pause))
(logclear! (-> this focus-status) (focus-status dangerous))
(logclear! (-> this enemy-flags) (enemy-flag enable-on-notice))
(logior! (-> this enemy-flags) (enemy-flag chase-startup))
(logclear! (-> this enemy-flags) (enemy-flag use-notice-distance))
(logior! (-> this enemy-flags) (enemy-flag alert))
(logior! (-> this focus-status) (focus-status hit))
(if (zero? (-> this hit-points))
(logior! (-> this focus-status) (focus-status dead))
)
(logclear! (-> this enemy-flags) (enemy-flag actor-pause-backup))
(logclear! (-> this enemy-flags) (enemy-flag lock-focus))
(enemy-method-62 this)
(logior! (-> this enemy-flags) (enemy-flag actor-pause-backup))
(logior! (-> this enemy-flags) (enemy-flag lock-focus))
(process-contact-action arg0)
(send-event arg0 'get-attack-count 1)
(cond
@ -402,7 +402,7 @@
)
)
)
(zero? (get-rand-int this 3))
(zero? (rnd-int-count this 3))
(let ((f0-0 (vector-vector-distance-squared (-> this root trans) (target-pos 0)))
(f1-0 32768.0)
)
@ -568,10 +568,10 @@
)
:code (behavior ()
(ja-channel-push! 1 (seconds 0.075))
(let ((f30-0 (get-rand-float-range self 0.8 1.2))
(let ((f30-0 (rnd-float-range self 0.8 1.2))
(gp-0 (new 'stack-no-clear 'vector))
)
(ja :group! (-> self draw art-group data (-> *metalmonk-global-info* notice-anim (get-rand-int self 2))))
(ja :group! (-> self draw art-group data (-> *metalmonk-global-info* notice-anim (rnd-int-count self 2))))
(ja-no-eval :group! (ja-group) :num! (seek! max f30-0) :frame-num 0.0)
(until (ja-done? 0)
(let ((a1-4 (-> self nav state)))
@ -617,7 +617,7 @@
)
:code (behavior ()
(talker-spawn-func (-> *talker-speech* 95) *entity-pool* (target-pos 0) (the-as region #f))
(let ((f30-0 (get-rand-float-range self 0.9 1.1)))
(let ((f30-0 (rnd-float-range self 0.9 1.1)))
(suspend)
(until #f
(metalmonk-method-181 self 1.2 0.1)
@ -645,10 +645,10 @@
)
)
)
(let ((f30-0 (get-rand-float-range self 0.9 1.1)))
(let ((f30-0 (rnd-float-range self 0.9 1.1)))
(until #f
(let ((gp-0 (-> self draw art-group data (-> (&-> *metalmonk-global-info* patrol-anim (get-rand-int self 2)) 0)))
(s5-0 (get-rand-int-range self 1 8))
(let ((gp-0 (-> self draw art-group data (-> (&-> *metalmonk-global-info* patrol-anim (rnd-int-count self 2)) 0)))
(s5-0 (rnd-int-range self 1 8))
)
(let ((v1-34 (ja-group)))
(if (not (and v1-34 (= v1-34 gp-0)))
@ -663,7 +663,7 @@
)
)
)
(when (zero? (get-rand-int self 2))
(when (zero? (rnd-int-count self 2))
(let ((v1-58 self))
(set! (-> v1-58 enemy-flags) (the-as enemy-flag (logclear (-> v1-58 enemy-flags) (enemy-flag enemy-flag36))))
(set! (-> v1-58 nav callback-info) *nav-enemy-null-callback-info*)
@ -671,8 +671,8 @@
0
(ja-channel-push! 1 (seconds 0.3))
(let ((gp-1 0))
(until (not (enemy-method-123 self 0.4))
(let* ((v1-62 (enemy-method-120 self 3 gp-1))
(until (not (rnd-go-idle? self 0.4))
(let* ((v1-62 (rnd-bit self 3 gp-1))
(a1-16 (-> self draw art-group data (-> *metalmonk-global-info* idle-anim v1-62)))
)
(set! gp-1 (ash 1 v1-62))
@ -704,7 +704,7 @@
:virtual #t
:event enemy-event-handler
:enter (behavior ()
(logior! (-> self enemy-flags) (enemy-flag actor-pause-backup))
(logior! (-> self enemy-flags) (enemy-flag lock-focus))
(metalmonk-method-180 self #t)
(nav-enemy-method-169 self 6144.0 #f)
(let ((v1-6 (-> self nav)))
@ -726,7 +726,7 @@
)
)
:exit (behavior ()
(logclear! (-> self enemy-flags) (enemy-flag actor-pause-backup))
(logclear! (-> self enemy-flags) (enemy-flag lock-focus))
(metalmonk-method-180 self #f)
(nav-enemy-method-168 self)
;; og:preserve-this fix potential use-after-free bug
@ -735,7 +735,7 @@
(set! (-> v1-6 target-speed) (-> self enemy-info run-travel-speed))
))
0
(if (logtest? (-> self enemy-flags) (enemy-flag check-water))
(if (logtest? (-> self enemy-flags) (enemy-flag dangerous-backup))
(logior! (-> self focus-status) (focus-status dangerous))
(logclear! (-> self focus-status) (focus-status dangerous))
)
@ -756,7 +756,7 @@
(ja-no-eval :group! s5-0 :num! (seek!) :frame-num 0.0)
)
(until (ja-done? 0)
(if (logtest? (-> self enemy-flags) (enemy-flag look-at-focus))
(if (logtest? (-> self enemy-flags) (enemy-flag victory))
(set! gp-0 #t)
)
(suspend)
@ -803,9 +803,9 @@
)
:code (behavior ()
(ja-channel-push! 1 (seconds 0.075))
(ja :group! (-> self draw art-group data (-> *metalmonk-global-info* celebrate-anim (get-rand-int self 2))))
(ja :group! (-> self draw art-group data (-> *metalmonk-global-info* celebrate-anim (rnd-int-count self 2))))
(ja :num-func num-func-identity :frame-num 0.0)
(let ((f30-0 (get-rand-float-range self 0.8 1.2)))
(let ((f30-0 (rnd-float-range self 0.8 1.2)))
(ja-no-eval :group! (ja-group) :num! (seek! max f30-0) :frame-num 0.0)
(until (ja-done? 0)
(suspend)
@ -820,7 +820,7 @@
:virtual #t
:code (behavior ()
(nav-enemy-method-166 self)
(let ((f30-0 (get-rand-float-range self 0.9 1.1)))
(let ((f30-0 (rnd-float-range self 0.9 1.1)))
(suspend)
(until #f
(metalmonk-method-181 self 1.6 1.5)
@ -849,8 +849,8 @@
)
)
(nav-enemy-method-165 self)
(let ((f30-0 (get-rand-float-range self 0.9 1.1)))
(-> self draw art-group data (-> *metalmonk-global-info* patrol-anim (get-rand-int self 2)))
(let ((f30-0 (rnd-float-range self 0.9 1.1)))
(-> self draw art-group data (-> *metalmonk-global-info* patrol-anim (rnd-int-count self 2)))
(until #f
(metalmonk-method-182 self 1.2 0.5)
(suspend)
@ -879,7 +879,9 @@
(until #f
(let ((gp-0 (new 'stack-no-clear 'vector)))
(get-point-at-percent-along-path! (-> self intro-path) gp-0 1.0 'interp)
(set! (-> self enemy-flags) (the-as enemy-flag (logclear (-> self enemy-flags) (enemy-flag vulnerable))))
(set! (-> self enemy-flags)
(the-as enemy-flag (logclear (-> self enemy-flags) (enemy-flag jump-check-blocked)))
)
(let ((a1-1 (new 'stack-no-clear 'event-message-block)))
(let ((v1-4 (process->ppointer self)))
(set! (-> a1-1 from) v1-4)
@ -897,19 +899,19 @@
)
)
(defmethod enemy-method-77 ((this metalmonk) (arg0 (pointer float)))
(defmethod enemy-method-77 ((this metalmonk) (arg0 enemy-knocked-info))
(case (-> this incoming knocked-type)
(((knocked-type knocked-type-4))
(ja-channel-push! 1 0)
(let* ((a2-0 (ash 1 (-> *metalmonk-global-info* prev-yellow-hit)))
(v1-3 (enemy-method-120 this 4 a2-0))
(v1-3 (rnd-bit this 4 a2-0))
(a1-6 (-> this draw art-group data (-> *metalmonk-global-info* yellow-hit-anim v1-3)))
)
(set! (-> *metalmonk-global-info* prev-yellow-hit) v1-3)
(let ((a0-13 (-> this skel root-channel 0)))
(set! (-> a0-13 frame-group) (the-as art-joint-anim a1-6))
(set! (-> a0-13 param 0) (the float (+ (-> (the-as art-joint-anim a1-6) frames num-frames) -1)))
(set! (-> a0-13 param 1) (-> arg0 0))
(set! (-> a0-13 param 1) (-> arg0 anim-speed))
(set! (-> a0-13 frame-num) 0.0)
(joint-control-channel-group! a0-13 (the-as art-joint-anim a1-6) num-func-seek!)
)
@ -917,7 +919,7 @@
)
(((knocked-type knocked-type-6))
(let* ((a2-2 (ash 1 (-> *metalmonk-global-info* prev-blue-hit)))
(v1-12 (enemy-method-120 this 3 a2-2))
(v1-12 (rnd-bit this 3 a2-2))
(s5-1 (-> this draw art-group data (-> *metalmonk-global-info* blue-hit-anim v1-12)))
)
(set! (-> *metalmonk-global-info* prev-blue-hit) v1-12)
@ -945,7 +947,7 @@
(if (< (vector-dot (the-as vector (metalmonk-method-179 this (new 'stack-no-clear 'vector))) (-> this root transv))
0.0
)
(-> this draw art-group data (-> *metalmonk-global-info* knocked-anim (get-rand-int this 2)))
(-> this draw art-group data (-> *metalmonk-global-info* knocked-anim (rnd-int-count this 2)))
(-> this draw art-group data 20)
)
)
@ -954,7 +956,7 @@
(let ((a0-38 (-> this skel root-channel 0)))
(set! (-> a0-38 frame-group) (the-as art-joint-anim s4-1))
(set! (-> a0-38 param 0) (the float (+ (-> (the-as art-joint-anim s4-1) frames num-frames) -1)))
(set! (-> a0-38 param 1) (-> arg0 0))
(set! (-> a0-38 param 1) (-> arg0 anim-speed))
(set! (-> a0-38 frame-num) 0.0)
(joint-control-channel-group! a0-38 (the-as art-joint-anim s4-1) num-func-seek!)
)
@ -964,7 +966,7 @@
#t
)
(defmethod enemy-method-78 ((this metalmonk) (arg0 (pointer float)))
(defmethod enemy-method-78 ((this metalmonk) (arg0 enemy-knocked-info))
(cond
((= (-> this incoming knocked-type) (knocked-type knocked-type-6))
(when (>= (-> this incoming blue-juggle-count) (the-as uint 2))
@ -973,7 +975,7 @@
(let ((a0-3 (-> this skel root-channel 0)))
(set! (-> a0-3 frame-group) (the-as art-joint-anim s4-0))
(set! (-> a0-3 param 0) (the float (+ (-> (the-as art-joint-anim s4-0) frames num-frames) -1)))
(set! (-> a0-3 param 1) (-> arg0 0))
(set! (-> a0-3 param 1) (-> arg0 anim-speed))
(set! (-> a0-3 frame-num) 0.0)
(joint-control-channel-group! a0-3 (the-as art-joint-anim s4-0) num-func-seek!)
)
@ -1009,7 +1011,7 @@
(let ((a0-14 (-> this skel root-channel 0)))
(set! (-> a0-14 frame-group) (the-as art-joint-anim s4-1))
(set! (-> a0-14 param 0) (the float (+ (-> (the-as art-joint-anim s4-1) frames num-frames) -1)))
(set! (-> a0-14 param 1) (-> arg0 0))
(set! (-> a0-14 param 1) (-> arg0 anim-speed))
(set! (-> a0-14 frame-num) 0.0)
(joint-control-channel-group! a0-14 (the-as art-joint-anim s4-1) num-func-seek!)
)

View File

@ -272,15 +272,15 @@
(('hit-knocked)
(logclear! (-> this mask) (process-mask actor-pause))
(logclear! (-> this focus-status) (focus-status dangerous))
(logclear! (-> this enemy-flags) (enemy-flag enable-on-notice))
(logior! (-> this enemy-flags) (enemy-flag chase-startup))
(logclear! (-> this enemy-flags) (enemy-flag use-notice-distance))
(logior! (-> this enemy-flags) (enemy-flag alert))
(logior! (-> this focus-status) (focus-status hit))
(if (zero? (-> this hit-points))
(logior! (-> this focus-status) (focus-status dead))
)
(logclear! (-> this enemy-flags) (enemy-flag actor-pause-backup))
(logclear! (-> this enemy-flags) (enemy-flag lock-focus))
(enemy-method-62 this)
(logior! (-> this enemy-flags) (enemy-flag actor-pause-backup))
(logior! (-> this enemy-flags) (enemy-flag lock-focus))
(process-contact-action arg0)
(send-event arg0 'get-attack-count 1)
(when (zero? (-> this hit-points))
@ -427,7 +427,7 @@
)
;; WARN: Using new Jak 2 rtype-of
(defmethod enemy-method-77 ((this spyder) (arg0 (pointer float)))
(defmethod enemy-method-77 ((this spyder) (arg0 enemy-knocked-info))
(case (-> this incoming knocked-type)
(((knocked-type knocked-type-4))
(let ((a0-2 (-> this skel root-channel 0)))
@ -435,7 +435,7 @@
(set! (-> a0-2 param 0)
(the float (+ (-> (the-as art-joint-anim (-> this draw art-group data 15)) frames num-frames) -1))
)
(set! (-> a0-2 param 1) (-> arg0 0))
(set! (-> a0-2 param 1) (-> arg0 anim-speed))
(set! (-> a0-2 frame-num) 0.0)
(joint-control-channel-group! a0-2 (the-as art-joint-anim (-> this draw art-group data 15)) num-func-seek!)
)
@ -447,7 +447,7 @@
(s5-0 (new 'static 'array uint64 3 #x11 #x12 #x13))
(s4-0 (new 'static 'array int32 4 0 0 0 0))
(a2-1 (ash 1 (-> s4-0 0)))
(v1-20 (enemy-method-120 this a1-4 a2-1))
(v1-20 (rnd-bit this a1-4 a2-1))
(s5-1 (-> this draw art-group data (-> (the-as (pointer int32) (+ (* v1-20 8) (the-as int s5-0))))))
)
(set! (-> s4-0 0) v1-20)
@ -479,7 +479,7 @@
(set! (-> a0-20 param 0)
(the float (+ (-> (the-as art-joint-anim (-> this draw art-group data 13)) frames num-frames) -1))
)
(set! (-> a0-20 param 1) (-> arg0 0))
(set! (-> a0-20 param 1) (-> arg0 anim-speed))
(set! (-> a0-20 frame-num) 0.0)
(joint-control-channel-group! a0-20 (the-as art-joint-anim (-> this draw art-group data 13)) num-func-seek!)
)
@ -496,7 +496,7 @@
)
)
(defmethod enemy-method-78 ((this spyder) (arg0 (pointer float)))
(defmethod enemy-method-78 ((this spyder) (arg0 enemy-knocked-info))
(case (-> this incoming knocked-type)
(((knocked-type knocked-type-4))
(cond
@ -659,7 +659,7 @@
(none)
)
(defmethod track-target! ((this spyder))
(defmethod common-post ((this spyder))
"Does a lot of various things relating to interacting with the target
- tracks when the enemy was last drawn
- looks at the target and handles attacking
@ -669,7 +669,7 @@
(update-trans! (-> this sound) (-> this root trans))
(update! (-> this sound))
(spyder-method-182 this)
(let ((t9-6 (method-of-type nav-enemy track-target!)))
(let ((t9-6 (method-of-type nav-enemy common-post)))
(t9-6 this)
)
(logclear! (-> this status-flags) (spyder-flags spflags-0))
@ -854,7 +854,7 @@
)
)
(spyder-method-181 self)
(look-at-target! self (enemy-flag death-start))
(look-at-target! self (enemy-flag look-at-move-dest))
(logclear! (-> self status-flags) (spyder-flags spflags-1))
(when (!= (-> self dest-fade) 128.0)
(set! (-> self shock-effect-end) (+ (current-time) (seconds 1)))
@ -869,7 +869,7 @@
)
)
(logclear! (-> self status-flags) (spyder-flags spflags-5))
(look-at-target! self (enemy-flag lock-focus))
(look-at-target! self (enemy-flag look-at-focus))
)
:trans (behavior ()
(let ((t9-0 (-> (method-of-type nav-enemy hostile) trans)))
@ -1003,11 +1003,11 @@
(set! (-> v1-4 enemy-flags) (the-as enemy-flag (logior (enemy-flag enemy-flag37) (-> v1-4 enemy-flags))))
)
0
(look-at-target! self (enemy-flag lock-focus))
(logior! (-> self enemy-flags) (enemy-flag actor-pause-backup))
(look-at-target! self (enemy-flag look-at-focus))
(logior! (-> self enemy-flags) (enemy-flag lock-focus))
)
:exit (behavior ()
(logclear! (-> self enemy-flags) (enemy-flag actor-pause-backup))
(logclear! (-> self enemy-flags) (enemy-flag lock-focus))
;; og:preserve-this fix potential use-after-free bug
(if (-> self nav)
(let ((v1-2 (-> self nav)))
@ -1016,7 +1016,7 @@
0
)
:trans (behavior ()
(if (and (logtest? (-> self enemy-flags) (enemy-flag look-at-focus)) (-> self enemy-info use-victory))
(if (and (logtest? (-> self enemy-flags) (enemy-flag victory)) (-> self enemy-info use-victory))
(go-virtual victory)
)
(if (or (>= 2 (the-as int (-> self focus aware))) (not (get-enemy-target self)))

View File

@ -584,7 +584,7 @@
)
:code (behavior ()
(ja-channel-push! 1 (seconds 0.075))
(let ((f30-0 (get-rand-float-range self 0.8 1.2)))
(let ((f30-0 (rnd-float-range self 0.8 1.2)))
(new 'stack-no-clear 'vector)
(let* ((gp-0 (handle->process (-> self focus handle)))
(a0-6 (if (type? gp-0 process-focusable)
@ -647,7 +647,7 @@
:code (behavior ()
(sound-play "buoy-guns-in")
(ja-channel-push! 1 (seconds 0.075))
(let ((f30-0 (get-rand-float-range self 0.8 1.2)))
(let ((f30-0 (rnd-float-range self 0.8 1.2)))
(ja-no-eval :group! gun-buoy-close-ja :num! (seek! max f30-0) :frame-num 0.0)
(until (ja-done? 0)
(suspend)
@ -886,7 +886,7 @@
)
)
(defmethod track-target! ((this gun-buoy))
(defmethod common-post ((this gun-buoy))
"Does a lot of various things relating to interacting with the target
- tracks when the enemy was last drawn
- looks at the target and handles attacking
@ -953,7 +953,7 @@
(water-control-method-10 (-> this water))
(update-trans! (-> this sound) (-> this root trans))
(update! (-> this sound))
((method-of-type nav-enemy track-target!) this)
((method-of-type nav-enemy common-post) this)
0
(none)
)

View File

@ -620,12 +620,12 @@
(set! (-> *spydroid-nav-enemy-info* fact-defaults) *fact-info-enemy-defaults*)
(defmethod track-target! ((this spydroid))
(defmethod common-post ((this spydroid))
"Does a lot of various things relating to interacting with the target
- tracks when the enemy was last drawn
- looks at the target and handles attacking
@TODO Not extremely well understood yet"
(let ((t9-0 (method-of-type nav-enemy track-target!)))
(let ((t9-0 (method-of-type nav-enemy common-post)))
(t9-0 this)
)
(when (< (-> this root scale x) 1.0)
@ -886,7 +886,7 @@
:event enemy-event-handler
:enter (behavior ()
(set! (-> self hit-target) #f)
(logior! (-> self enemy-flags) (enemy-flag actor-pause-backup))
(logior! (-> self enemy-flags) (enemy-flag lock-focus))
(let ((v1-2 (-> self nav)))
(set! (-> v1-2 target-speed) (+ 8192.0 (-> self enemy-info run-travel-speed)))
)
@ -912,7 +912,7 @@
(ja :group! spydroid-attack-jump-ja :num! min)
)
:exit (behavior ()
(logclear! (-> self enemy-flags) (enemy-flag actor-pause-backup))
(logclear! (-> self enemy-flags) (enemy-flag lock-focus))
(nav-enemy-method-168 self)
;; og:preserve-this fix potential use-after-free bug
(if (-> self nav)
@ -920,7 +920,7 @@
(set! (-> v1-4 target-speed) (-> self enemy-info run-travel-speed))
))
0
(if (logtest? (-> self enemy-flags) (enemy-flag check-water))
(if (logtest? (-> self enemy-flags) (enemy-flag dangerous-backup))
(logior! (-> self focus-status) (focus-status dangerous))
(logclear! (-> self focus-status) (focus-status dangerous))
)
@ -928,7 +928,7 @@
:trans (behavior ()
(enemy-method-49 self)
nav-state
(if (logtest? (-> self enemy-flags) (enemy-flag look-at-focus))
(if (logtest? (-> self enemy-flags) (enemy-flag victory))
(set! (-> self hit-target) (the-as basic #t))
)
(let ((v1-9 (ja-group)))
@ -1418,7 +1418,7 @@
(add-connection *part-engine* this 6 this 3185 (new 'static 'vector :w 163840.0))
(add-connection *part-engine* this 6 this 3186 (new 'static 'vector :w 163840.0))
(logclear! (-> this mask) (process-mask actor-pause))
(logclear! (-> this enemy-flags) (enemy-flag notice))
(logclear! (-> this enemy-flags) (enemy-flag actor-pause-backup))
0
(none)
)

View File

@ -8,20 +8,16 @@
;; DECOMP BEGINS
(deftype turret (base-turret)
((hover-battle handle :offset-assert 568)
(hover-formation hover-formation :offset-assert 576)
(use-egg-hud symbol :offset-assert 580)
(hud-egg handle :offset-assert 584)
(use-cgh-hud symbol :offset-assert 592)
(hud-cgh handle :offset-assert 600)
(hud-cgh-event symbol :offset-assert 608)
(egg-timer time-frame :offset-assert 616)
(cgh-timer time-frame :offset-assert 624)
((hover-battle handle)
(hover-formation hover-formation)
(use-egg-hud symbol)
(hud-egg handle)
(use-cgh-hud symbol)
(hud-cgh handle)
(hud-cgh-event symbol)
(egg-timer time-frame)
(cgh-timer time-frame)
)
:heap-base #x200
:method-count-assert 49
:size-assert #x278
:flag-assert #x3102000278
)
@ -363,10 +359,9 @@
)
)
)
(none)
)
:exit (behavior ()
(let ((t9-1 (-> (the-as (state base-turret) (find-parent-method turret 29)) exit)))
(let ((t9-1 (-> (find-parent-state) exit)))
(if t9-1
(t9-1)
)
@ -468,112 +463,112 @@
:virtual #t
:enter (behavior ()
(speech-control-method-12 *speech-control* self (speech-type speech-type-10))
(let ((t9-2 (-> (the-as (state base-turret) (find-parent-method turret 32)) enter)))
(let ((t9-2 (-> (find-parent-state) enter)))
(if t9-2
(t9-2)
)
)
(none)
)
)
(defmethod turret-init! turret ((obj turret) (arg0 entity-actor) (arg1 matrix))
(set! (-> obj hover-battle) (the-as handle #f))
(let ((v1-1 (res-lump-value (-> obj entity) 'extra-id uint128 :default (the-as uint128 -1) :time -1000000000.0)))
(defmethod turret-init! ((this turret) (arg0 entity-actor) (arg1 matrix))
(set! (-> this hover-battle) (the-as handle #f))
(let ((v1-1 (res-lump-value (-> this entity) 'extra-id uint128 :default (the-as uint128 -1) :time -1000000000.0)))
(cond
((zero? v1-1)
(set! (-> obj hover-battle)
(process->handle (hover-manager-spawn obj (-> obj entity) *drill-turret-10-battle*))
(set! (-> this hover-battle)
(process->handle (hover-manager-spawn this (-> this entity) *drill-turret-10-battle*))
)
(set! (-> obj use-egg-hud) #t)
(set! (-> obj use-cgh-hud) #f)
(set! (-> this use-egg-hud) #t)
(set! (-> this use-cgh-hud) #f)
)
((= (the-as uint v1-1) 1)
(set! (-> obj hover-battle)
(process->handle (hover-manager-spawn obj (-> obj entity) *drill-turret-11-battle*))
(set! (-> this hover-battle)
(process->handle (hover-manager-spawn this (-> this entity) *drill-turret-11-battle*))
)
(set! (-> obj use-egg-hud) #t)
(set! (-> obj use-cgh-hud) #f)
(set! (-> this use-egg-hud) #t)
(set! (-> this use-cgh-hud) #f)
)
((= (the-as uint v1-1) 2)
(set! (-> obj hover-battle)
(process->handle (hover-manager-spawn obj (-> obj entity) *drill-turret-12-battle*))
(set! (-> this hover-battle)
(process->handle (hover-manager-spawn this (-> this entity) *drill-turret-12-battle*))
)
(set! (-> obj use-egg-hud) #t)
(set! (-> obj use-cgh-hud) #f)
(set! (-> this use-egg-hud) #t)
(set! (-> this use-cgh-hud) #f)
)
((= (the-as uint v1-1) 3)
(set! (-> obj path-event) *turret-13-path*)
(set! (-> obj hover-battle)
(process->handle (hover-manager-spawn obj (-> obj entity) *drill-turret-13-battle*))
(set! (-> this path-event) *turret-13-path*)
(set! (-> this hover-battle)
(process->handle (hover-manager-spawn this (-> this entity) *drill-turret-13-battle*))
)
(set! (-> obj use-egg-hud) #f)
(set! (-> obj use-cgh-hud) #t)
(set! (-> this use-egg-hud) #f)
(set! (-> this use-cgh-hud) #t)
)
((= (the-as uint v1-1) 4)
(set! (-> obj path-event) *turret-14-path*)
(set! (-> obj use-egg-hud) #f)
(set! (-> obj use-cgh-hud) #f)
(set! (-> this path-event) *turret-14-path*)
(set! (-> this use-egg-hud) #f)
(set! (-> this use-cgh-hud) #f)
)
(else
(set! (-> obj path-event) *turret-15-path*)
(set! (-> obj use-egg-hud) #f)
(set! (-> obj use-cgh-hud) #f)
(set! (-> this path-event) *turret-15-path*)
(set! (-> this use-egg-hud) #f)
(set! (-> this use-cgh-hud) #f)
)
)
)
(let ((t9-5 (method-of-type base-turret turret-init!)))
(t9-5 obj arg0 arg1)
(t9-5 this arg0 arg1)
)
(set! (-> obj hud-egg) (the-as handle #f))
(set! (-> obj hud-cgh) (the-as handle #f))
(set! (-> obj hover-formation) (the-as hover-formation (entity-actor-lookup arg0 'formation-actor 0)))
(if (or (name= (-> obj name) "turret-14") (name= (-> obj name) "turret-15"))
(set! (-> obj shot-timeout) (seconds 2.667))
(set! (-> this hud-egg) (the-as handle #f))
(set! (-> this hud-cgh) (the-as handle #f))
(set! (-> this hover-formation) (the-as hover-formation (entity-actor-lookup arg0 'formation-actor 0)))
(if (or (name= (-> this name) "turret-14") (name= (-> this name) "turret-15"))
(set! (-> this shot-timeout) (seconds 2.667))
)
(none)
)
(defmethod base-turret-method-39 turret ((obj turret) (arg0 turret-path-event))
;; WARN: Return type mismatch object vs none.
(defmethod base-turret-method-39 ((this turret) (arg0 turret-path-event))
(case (-> arg0 event-type)
(('trigger-battle)
(set! (-> obj hud-cgh-event) 'force-show)
(send-event (handle->process (-> obj hover-battle)) 'trigger)
(set! (-> this hud-cgh-event) 'force-show)
(send-event (handle->process (-> this hover-battle)) 'trigger)
)
(else
((method-of-type base-turret base-turret-method-39) obj arg0)
((method-of-type base-turret base-turret-method-39) this arg0)
)
)
(none)
)
(defmethod base-turret-method-34 turret ((obj turret) (arg0 process))
(set! (-> obj hud)
(defmethod base-turret-method-34 ((this turret) (arg0 process))
(set! (-> this hud)
(ppointer->handle (process-spawn hud-drill-turret-health :init hud-init-by-other :to arg0))
)
(if (-> obj use-egg-hud)
(set! (-> obj hud-egg) (ppointer->handle (process-spawn hud-gruntegg :init hud-init-by-other :to arg0)))
(if (-> this use-egg-hud)
(set! (-> this hud-egg) (ppointer->handle (process-spawn hud-gruntegg :init hud-init-by-other :to arg0)))
)
(when (-> obj use-cgh-hud)
(set! (-> obj hud-cgh) (ppointer->handle (process-spawn hud-crimsonhover :init hud-init-by-other :to arg0)))
(set! (-> obj hud-cgh-event) 'force-hide)
(when (-> this use-cgh-hud)
(set! (-> this hud-cgh) (ppointer->handle (process-spawn hud-crimsonhover :init hud-init-by-other :to arg0)))
(set! (-> this hud-cgh-event) 'force-hide)
)
0
(none)
)
(defmethod base-turret-method-35 turret ((obj turret))
(if (-> obj use-egg-hud)
(send-event (handle->process (-> obj hud-egg)) 'force-show)
(defmethod base-turret-method-35 ((this turret))
(if (-> this use-egg-hud)
(send-event (handle->process (-> this hud-egg)) 'force-show)
)
(if (-> obj use-cgh-hud)
(send-event (handle->process (-> obj hud-cgh)) (-> obj hud-cgh-event))
(if (-> this use-cgh-hud)
(send-event (handle->process (-> this hud-cgh)) (-> this hud-cgh-event))
)
((the-as (function base-turret none) (find-parent-method turret 35)) obj)
(call-parent-method this)
(none)
)
(defmethod base-turret-method-46 turret ((obj turret) (arg0 process))
(defmethod base-turret-method-46 ((this turret) (arg0 process))
(if (type? arg0 hover-enemy)
arg0
)

View File

@ -323,7 +323,7 @@
(set! (-> s5-0 quad 2) a1-3)
(set! (-> s5-0 trans quad) a2-2)
)
(when (logtest? (enemy-flag dislike-combo) (-> this enemy-flags))
(when (logtest? (enemy-flag drawn-mirrored) (-> this enemy-flags))
(vector-negate! (the-as vector (-> s5-0 vector)) (the-as vector (-> s5-0 vector)))
(set! (-> s5-0 vector 0 w) 0.0)
)
@ -346,13 +346,13 @@
)
;; WARN: Return type mismatch symbol vs none.
(defmethod track-target! ((this ginsu))
(defmethod common-post ((this ginsu))
"Does a lot of various things relating to interacting with the target
- tracks when the enemy was last drawn
- looks at the target and handles attacking
@TODO Not extremely well understood yet"
(ginsu-method-180 this)
(let ((t9-1 (method-of-type nav-enemy track-target!)))
(let ((t9-1 (method-of-type nav-enemy common-post)))
(t9-1 this)
)
(cond
@ -429,7 +429,7 @@
)
(quaternion->matrix s4-0 (-> this root quat))
(let ((f0-1 (vector-dot s5-0 (the-as vector (-> s4-0 vector)))))
(if (logtest? (enemy-flag dislike-combo) (-> this enemy-flags))
(if (logtest? (enemy-flag drawn-mirrored) (-> this enemy-flags))
(set! f0-1 (- f0-1))
)
(cond
@ -655,7 +655,7 @@
:virtual #t
:event enemy-event-handler
:enter (behavior ()
(logior! (-> self enemy-flags) (enemy-flag actor-pause-backup))
(logior! (-> self enemy-flags) (enemy-flag lock-focus))
(logior! (-> self focus-status) (focus-status dangerous))
(let ((v1-4 (-> self nav)))
(set! (-> v1-4 target-speed) 8192.0)
@ -666,8 +666,8 @@
(ja :group! ginsu-idle-ja :num! min)
)
:exit (behavior ()
(logclear! (-> self enemy-flags) (enemy-flag actor-pause-backup))
(if (logtest? (-> self enemy-flags) (enemy-flag check-water))
(logclear! (-> self enemy-flags) (enemy-flag lock-focus))
(if (logtest? (-> self enemy-flags) (enemy-flag dangerous-backup))
(logior! (-> self focus-status) (focus-status dangerous))
(logclear! (-> self focus-status) (focus-status dangerous))
)
@ -682,7 +682,7 @@
)
(go-virtual circling)
)
(if (logtest? (-> self enemy-flags) (enemy-flag look-at-focus))
(if (logtest? (-> self enemy-flags) (enemy-flag victory))
(go-virtual circling)
)
(if (time-elapsed? (-> self state-time) (seconds 0.75))
@ -716,7 +716,7 @@
:virtual #t
:event enemy-event-handler
:enter (behavior ()
(logior! (-> self enemy-flags) (enemy-flag actor-pause-backup))
(logior! (-> self enemy-flags) (enemy-flag lock-focus))
(ginsu-method-183 self #t)
(set! (-> self root penetrate-using) (penetrate generic-attack lunge))
(enemy-method-49 self)
@ -735,8 +735,8 @@
(ja :group! ginsu-attack-ja :num! min)
)
:exit (behavior ()
(logclear! (-> self enemy-flags) (enemy-flag actor-pause-backup))
(if (logtest? (-> self enemy-flags) (enemy-flag check-water))
(logclear! (-> self enemy-flags) (enemy-flag lock-focus))
(if (logtest? (-> self enemy-flags) (enemy-flag dangerous-backup))
(logior! (-> self focus-status) (focus-status dangerous))
(logclear! (-> self focus-status) (focus-status dangerous))
)
@ -753,7 +753,7 @@
)
(go-virtual circling)
)
(if (logtest? (-> self enemy-flags) (enemy-flag look-at-focus))
(if (logtest? (-> self enemy-flags) (enemy-flag victory))
(go-virtual circling)
)
(ja :num! (seek!))
@ -774,7 +774,7 @@
)
)
(logclear! (-> self mask) (process-mask actor-pause))
(logior! (-> self enemy-flags) (enemy-flag use-notice-distance))
(logior! (-> self enemy-flags) (enemy-flag cam-attack-mode))
(ja-channel-set! 0)
(set! (-> self root scale x) 0.01)
(set! (-> self root scale y) 0.01)
@ -782,7 +782,7 @@
)
:exit (behavior ()
(logior! (-> self mask) (process-mask actor-pause))
(logior! (-> self enemy-flags) (enemy-flag notice))
(logior! (-> self enemy-flags) (enemy-flag actor-pause-backup))
)
:trans (behavior ()
(let ((t9-0 (-> (method-of-type enemy ambush) trans)))

View File

@ -208,15 +208,15 @@ For pegasus, it will call [[enemy::57]] only if the [[pegasus]] has been targett
((zero? (-> this hit-points))
(logclear! (-> this mask) (process-mask actor-pause))
(logclear! (-> this focus-status) (focus-status dangerous))
(logclear! (-> this enemy-flags) (enemy-flag enable-on-notice))
(logior! (-> this enemy-flags) (enemy-flag chase-startup))
(logclear! (-> this enemy-flags) (enemy-flag use-notice-distance))
(logior! (-> this enemy-flags) (enemy-flag alert))
(logior! (-> this focus-status) (focus-status hit))
(if (zero? (-> this hit-points))
(logior! (-> this focus-status) (focus-status dead))
)
(logclear! (-> this enemy-flags) (enemy-flag actor-pause-backup))
(logclear! (-> this enemy-flags) (enemy-flag lock-focus))
(enemy-method-62 this)
(logior! (-> this enemy-flags) (enemy-flag actor-pause-backup))
(logior! (-> this enemy-flags) (enemy-flag lock-focus))
(process-contact-action proc)
(send-event proc 'get-attack-count 1)
(kill-prefer-falling this)
@ -688,14 +688,14 @@ The faster it's moving the fast it flaps it's wings, etc
)
)
(defmethod track-target! ((this pegasus))
(defmethod common-post ((this pegasus))
"Does a lot of various things relating to interacting with the target
- tracks when the enemy was last drawn
- looks at the target and handles attacking
@TODO Not extremely well understood yet"
(track-how-long-aimed-at! this)
(pegasus-show-runs)
((method-of-type enemy track-target!) this)
((method-of-type enemy common-post) this)
(none)
)
@ -1145,7 +1145,7 @@ The faster it's moving the fast it flaps it's wings, etc
(if (pegasus-calc-speed 61440.0 122880.0 204800.0 49152.0)
(react-to-focus self)
)
(let ((anim-length (get-rand-float-range self 0.8 1.2)))
(let ((anim-length (rnd-float-range self 0.8 1.2)))
(ja-channel-push! 1 (seconds 0.2))
(ja-no-eval :group! (-> self draw art-group data (-> self enemy-info notice-anim))
:num! (seek! max anim-length)
@ -1248,7 +1248,7 @@ The faster it's moving the fast it flaps it's wings, etc
#f
)
(defmethod enemy-method-108 ((this pegasus) (arg0 enemy) (arg1 event-message-block))
(defmethod enemy-method-108 ((this pegasus) (arg0 process-drawable) (arg1 event-message-block))
0
)

View File

@ -425,7 +425,7 @@
)
)
(defmethod enemy-method-77 ((this predator) (arg0 (pointer float)))
(defmethod enemy-method-77 ((this predator) (arg0 enemy-knocked-info))
(cond
((zero? (-> this hit-points))
(case (-> this incoming knocked-type)
@ -436,7 +436,7 @@
(set! (-> a0-3 param 0)
(the float (+ (-> (the-as art-joint-anim (-> this draw art-group data 18)) frames num-frames) -1))
)
(set! (-> a0-3 param 1) (-> arg0 0))
(set! (-> a0-3 param 1) (-> arg0 anim-speed))
(set! (-> a0-3 frame-num) 0.0)
(joint-control-channel-group! a0-3 (the-as art-joint-anim (-> this draw art-group data 18)) num-func-seek!)
)
@ -448,7 +448,7 @@
(set! (-> a0-5 param 0)
(the float (+ (-> (the-as art-joint-anim (-> this draw art-group data 14)) frames num-frames) -1))
)
(set! (-> a0-5 param 1) (-> arg0 0))
(set! (-> a0-5 param 1) (-> arg0 anim-speed))
(set! (-> a0-5 frame-num) 0.0)
(joint-control-channel-group! a0-5 (the-as art-joint-anim (-> this draw art-group data 14)) num-func-seek!)
)
@ -460,7 +460,7 @@
(case (-> this incoming knocked-type)
(((knocked-type knocked-type-6))
(ja-channel-push! 1 (seconds 0.01))
(let ((v1-32 (get-rand-int this 2)))
(let ((v1-32 (rnd-int-count this 2)))
(cond
((zero? v1-32)
(let ((a0-10 (-> this skel root-channel 0)))
@ -468,7 +468,7 @@
(set! (-> a0-10 param 0)
(the float (+ (-> (the-as art-joint-anim (-> this draw art-group data 21)) frames num-frames) -1))
)
(set! (-> a0-10 param 1) (-> arg0 0))
(set! (-> a0-10 param 1) (-> arg0 anim-speed))
(set! (-> a0-10 frame-num) 0.0)
(joint-control-channel-group! a0-10 (the-as art-joint-anim (-> this draw art-group data 21)) num-func-seek!)
)
@ -479,7 +479,7 @@
(set! (-> a0-12 param 0)
(the float (+ (-> (the-as art-joint-anim (-> this draw art-group data 22)) frames num-frames) -1))
)
(set! (-> a0-12 param 1) (-> arg0 0))
(set! (-> a0-12 param 1) (-> arg0 anim-speed))
(set! (-> a0-12 frame-num) 0.0)
(joint-control-channel-group! a0-12 (the-as art-joint-anim (-> this draw art-group data 22)) num-func-seek!)
)
@ -494,7 +494,7 @@
(set! (-> a0-15 param 0)
(the float (+ (-> (the-as art-joint-anim (-> this draw art-group data 18)) frames num-frames) -1))
)
(set! (-> a0-15 param 1) (-> arg0 0))
(set! (-> a0-15 param 1) (-> arg0 anim-speed))
(set! (-> a0-15 frame-num) 0.0)
(joint-control-channel-group! a0-15 (the-as art-joint-anim (-> this draw art-group data 18)) num-func-seek!)
)
@ -506,7 +506,7 @@
(set! (-> a0-17 param 0)
(the float (+ (-> (the-as art-joint-anim (-> this draw art-group data 12)) frames num-frames) -1))
)
(set! (-> a0-17 param 1) (-> arg0 0))
(set! (-> a0-17 param 1) (-> arg0 anim-speed))
(set! (-> a0-17 frame-num) 0.0)
(joint-control-channel-group! a0-17 (the-as art-joint-anim (-> this draw art-group data 12)) num-func-seek!)
)
@ -517,7 +517,7 @@
)
)
(defmethod enemy-method-78 ((this predator) (arg0 (pointer float)))
(defmethod enemy-method-78 ((this predator) (arg0 enemy-knocked-info))
(cond
((zero? (-> this hit-points))
(case (-> this incoming knocked-type)
@ -528,7 +528,7 @@
(set! (-> a0-3 param 0)
(the float (+ (-> (the-as art-joint-anim (-> this draw art-group data 20)) frames num-frames) -1))
)
(set! (-> a0-3 param 1) (-> arg0 0))
(set! (-> a0-3 param 1) (-> arg0 anim-speed))
(set! (-> a0-3 frame-num) 0.0)
(joint-control-channel-group! a0-3 (the-as art-joint-anim (-> this draw art-group data 20)) num-func-seek!)
)
@ -540,7 +540,7 @@
(set! (-> a0-5 param 0)
(the float (+ (-> (the-as art-joint-anim (-> this draw art-group data 15)) frames num-frames) -1))
)
(set! (-> a0-5 param 1) (-> arg0 0))
(set! (-> a0-5 param 1) (-> arg0 anim-speed))
(set! (-> a0-5 frame-num) 0.0)
(joint-control-channel-group! a0-5 (the-as art-joint-anim (-> this draw art-group data 15)) num-func-seek!)
)
@ -557,7 +557,7 @@
(set! (-> a0-8 param 0)
(the float (+ (-> (the-as art-joint-anim (-> this draw art-group data 23)) frames num-frames) -1))
)
(set! (-> a0-8 param 1) (-> arg0 0))
(set! (-> a0-8 param 1) (-> arg0 anim-speed))
(set! (-> a0-8 frame-num) 0.0)
(joint-control-channel-group! a0-8 (the-as art-joint-anim (-> this draw art-group data 23)) num-func-seek!)
)
@ -569,7 +569,7 @@
(set! (-> a0-11 param 0)
(the float (+ (-> (the-as art-joint-anim (-> this draw art-group data 19)) frames num-frames) -1))
)
(set! (-> a0-11 param 1) (-> arg0 0))
(set! (-> a0-11 param 1) (-> arg0 anim-speed))
(set! (-> a0-11 frame-num) 0.0)
(joint-control-channel-group! a0-11 (the-as art-joint-anim (-> this draw art-group data 19)) num-func-seek!)
)
@ -581,7 +581,7 @@
(set! (-> a0-13 param 0)
(the float (+ (-> (the-as art-joint-anim (-> this draw art-group data 13)) frames num-frames) -1))
)
(set! (-> a0-13 param 1) (-> arg0 0))
(set! (-> a0-13 param 1) (-> arg0 anim-speed))
(set! (-> a0-13 frame-num) 0.0)
(joint-control-channel-group! a0-13 (the-as art-joint-anim (-> this draw art-group data 13)) num-func-seek!)
)
@ -868,7 +868,7 @@
)
:code (behavior ()
(ja-channel-push! 1 (seconds 0.2))
(let ((f30-0 (get-rand-float-range self 0.9 1.1)))
(let ((f30-0 (rnd-float-range self 0.9 1.1)))
(until #f
(ja-no-eval :group! predator-idle-ja :num! (seek! max f30-0) :frame-num 0.0)
(until (ja-done? 0)
@ -915,7 +915,7 @@
)
)
:exit (behavior ()
(if (logtest? (-> self enemy-flags) (enemy-flag check-water))
(if (logtest? (-> self enemy-flags) (enemy-flag dangerous-backup))
(logior! (-> self focus-status) (focus-status dangerous))
(logclear! (-> self focus-status) (focus-status dangerous))
)
@ -972,7 +972,7 @@
:event enemy-event-handler
:enter (behavior ()
(set-dangerous! self #t)
(logior! (-> self enemy-flags) (enemy-flag actor-pause-backup))
(logior! (-> self enemy-flags) (enemy-flag lock-focus))
(logior! (-> self focus-status) (focus-status dangerous))
(let* ((v1-6 *game-info*)
(a0-3 (+ (-> v1-6 attack-id) 1))
@ -987,7 +987,7 @@
)
:exit (behavior ()
(set-dangerous! self #f)
(if (logtest? (-> self enemy-flags) (enemy-flag check-water))
(if (logtest? (-> self enemy-flags) (enemy-flag dangerous-backup))
(logior! (-> self focus-status) (focus-status dangerous))
(logclear! (-> self focus-status) (focus-status dangerous))
)
@ -1008,7 +1008,7 @@
(suspend)
(ja :num! (seek!))
)
(if (zero? (get-rand-int self 3))
(if (zero? (rnd-int-count self 3))
(sound-play "pred-talk")
)
(go-virtual hostile)
@ -1159,7 +1159,7 @@
(set! (-> self next-change)
(the-as uint (+ (current-time) (the int (* 300.0 (rand-vu-float-range 4.0 8.0)))))
)
(if (zero? (get-rand-int self 3))
(if (zero? (rnd-int-count self 3))
(sound-play "pred-talk")
)
)
@ -1308,12 +1308,12 @@
#f
)
(defmethod track-target! ((this predator))
(defmethod common-post ((this predator))
"Does a lot of various things relating to interacting with the target
- tracks when the enemy was last drawn
- looks at the target and handles attacking
@TODO Not extremely well understood yet"
(let ((t9-0 (method-of-type nav-enemy track-target!)))
(let ((t9-0 (method-of-type nav-enemy common-post)))
(t9-0 this)
)
(predator-method-183 this)
@ -1466,7 +1466,7 @@ This commonly includes things such as:
(t9-0 this arg0)
)
(logclear! (-> this mask) (process-mask actor-pause))
(logclear! (-> this enemy-flags) (enemy-flag notice))
(logclear! (-> this enemy-flags) (enemy-flag actor-pause-backup))
0
(none)
)
@ -1508,7 +1508,7 @@ This commonly includes things such as:
(set! (-> this sound)
(new 'process 'ambient-sound (static-sound-spec "pred-hum" :fo-min 2 :fo-max 30) (-> this root trans))
)
(logior! (-> this enemy-flags) (enemy-flag trackable-backup enable-on-hostile))
(logior! (-> this enemy-flags) (enemy-flag check-water check-water-backup))
(add-icon! *minimap* this (the-as uint 16) (the-as int #f) (the-as vector #t) 0)
0
(none)

View File

@ -503,12 +503,12 @@
(set! (-> *fort-turret-enemy-info* fact-defaults) *fact-info-enemy-defaults*)
(defmethod track-target! ((this fort-turret))
(defmethod common-post ((this fort-turret))
"Does a lot of various things relating to interacting with the target
- tracks when the enemy was last drawn
- looks at the target and handles attacking
@TODO Not extremely well understood yet"
(let ((t9-0 (method-of-type enemy track-target!)))
(let ((t9-0 (method-of-type enemy common-post)))
(t9-0 this)
)
(let ((s5-0 (-> this root)))
@ -708,7 +708,7 @@
(set! (-> self flash-state) #f)
)
:trans (behavior ()
(if (and (logtest? (-> self enemy-flags) (enemy-flag look-at-focus)) (-> self enemy-info use-victory))
(if (and (logtest? (-> self enemy-flags) (enemy-flag victory)) (-> self enemy-info use-victory))
(go-virtual victory)
)
(when (time-elapsed? (-> self state-time) (-> self reaction-time))
@ -789,7 +789,7 @@
(set-time! (-> self state-time))
)
:trans (behavior ()
(if (and (logtest? (-> self enemy-flags) (enemy-flag look-at-focus)) (-> self enemy-info use-victory))
(if (and (logtest? (-> self enemy-flags) (enemy-flag victory)) (-> self enemy-info use-victory))
(go-virtual victory)
)
(when (time-elapsed? (-> self state-time) (-> self reaction-time))
@ -827,7 +827,7 @@
(ja :group! fort-turret-idle-ja)
)
:trans (behavior ()
(if (and (logtest? (-> self enemy-flags) (enemy-flag look-at-focus)) (-> self enemy-info use-victory))
(if (and (logtest? (-> self enemy-flags) (enemy-flag victory)) (-> self enemy-info use-victory))
(go-virtual victory)
)
(when (time-elapsed? (-> self state-time) (-> self reaction-time))
@ -892,7 +892,7 @@
(defstate die (fort-turret)
:virtual #t
:enter (behavior ()
(dispose! self)
(dying self)
(let ((v1-3 (-> self root root-prim)))
(set! (-> v1-3 prim-core collide-as) (collide-spec))
(set! (-> v1-3 prim-core collide-with) (collide-spec))
@ -936,7 +936,7 @@
(cleanup-for-death self)
)
:post (behavior ()
(track-target! self)
(common-post self)
)
)
@ -1034,7 +1034,7 @@
(set! (-> this invincible) #t)
)
(logclear! (-> this mask) (process-mask actor-pause))
(logclear! (-> this enemy-flags) (enemy-flag notice))
(logclear! (-> this enemy-flags) (enemy-flag actor-pause-backup))
(set! (-> this part) (create-launch-control (-> *part-group-id-table* 685) this))
(set! (-> this gun-tilt-jm) (new 'process 'joint-mod (joint-mod-mode joint-set*) this 4))
(set! (-> this gun-shadow-jm) (the-as joint-mod (new 'process 'joint-mod-set-local this 10 #f #f #t)))

View File

@ -134,7 +134,7 @@
charge
)
(:methods
(rhino-method-182 (_type_ process event-message-block) symbol)
(hit-stomach? (_type_ process event-message-block) symbol)
)
)
@ -320,7 +320,7 @@
(set! (-> *rhino-nav-enemy-info* fact-defaults) *fact-info-enemy-defaults*)
(defmethod rhino-method-182 ((this rhino) (arg0 process) (arg1 event-message-block))
(defmethod hit-stomach? ((this rhino) (arg0 process) (arg1 event-message-block))
(let* ((gp-0 (-> arg1 param 0))
(s5-0 arg0)
(s2-0 (if (type? s5-0 process-drawable)
@ -359,7 +359,7 @@
(let ((t9-0 (method-of-type nav-enemy enemy-method-58)))
(t9-0 this arg0 arg1)
)
(if (rhino-method-182 this arg0 arg1)
(if (hit-stomach? this arg0 arg1)
'hit
'hit-flinch
)
@ -573,7 +573,7 @@
(t9-2)
)
)
(logclear! (-> self enemy-flags) (enemy-flag enable-on-active))
(logclear! (-> self enemy-flags) (enemy-flag vulnerable))
)
:exit (behavior ()
(local-vars (v0-1 enemy-flag))
@ -583,9 +583,9 @@
)
)
(let ((v1-4 (-> self enemy-flags)))
(if (logtest? v1-4 (enemy-flag checking-water))
(set! v0-1 (logior v1-4 (enemy-flag enable-on-active)))
(set! v0-1 (logclear v1-4 (enemy-flag enable-on-active)))
(if (logtest? v1-4 (enemy-flag vulnerable-backup))
(set! v0-1 (logior v1-4 (enemy-flag vulnerable)))
(set! v0-1 (logclear v1-4 (enemy-flag vulnerable)))
)
)
(set! (-> self enemy-flags) v0-1)
@ -617,14 +617,14 @@
:virtual #t
:enter (behavior ()
(remove-setting! 'sound-mode)
(dispose! self)
(dying self)
(set! (-> self hit-points) 0)
0
)
:code (behavior ()
(set! (-> self smush-target) (the-as smush-control #t))
(ja-channel-push! 1 (seconds 0.075))
(let ((f30-0 (get-rand-float-range self 0.8 1.2))
(let ((f30-0 (rnd-float-range self 0.8 1.2))
(gp-0 #t)
)
(ja-no-eval :group! (-> self draw art-group data (-> self enemy-info die-anim))
@ -654,7 +654,7 @@
:code (behavior ()
(local-vars (v1-67 enemy-flag) (v1-75 enemy-flag))
(ja-channel-push! 1 (seconds 0.2))
(let ((f30-0 (get-rand-float-range self 0.9 1.1)))
(let ((f30-0 (rnd-float-range self 0.9 1.1)))
(ja-no-eval :group! (-> self draw art-group data (-> self enemy-info hit-anim))
:num! (seek! max f30-0)
:frame-num 0.0
@ -677,29 +677,29 @@
)
)
(ja-channel-push! 1 (seconds 0.075))
(if (logtest? (-> self enemy-flags) (enemy-flag check-water))
(if (logtest? (-> self enemy-flags) (enemy-flag dangerous-backup))
(logior! (-> self focus-status) (focus-status dangerous))
(logclear! (-> self focus-status) (focus-status dangerous))
)
(let ((v1-66 (-> self enemy-flags)))
(if (logtest? v1-66 (enemy-flag checking-water))
(set! v1-67 (logior v1-66 (enemy-flag enable-on-active)))
(set! v1-67 (logclear v1-66 (enemy-flag enable-on-active)))
(if (logtest? v1-66 (enemy-flag vulnerable-backup))
(set! v1-67 (logior v1-66 (enemy-flag vulnerable)))
(set! v1-67 (logclear v1-66 (enemy-flag vulnerable)))
)
)
(set! (-> self enemy-flags) v1-67)
(if (logtest? (-> self enemy-flags) (enemy-flag look-at-move-dest))
(if (logtest? (-> self enemy-flags) (enemy-flag attackable-backup))
(logior! (-> self mask) (process-mask collectable))
(logclear! (-> self mask) (process-mask collectable))
)
(let ((v1-74 (-> self enemy-flags)))
(if (logtest? (enemy-flag no-initial-move-to-ground) v1-74)
(set! v1-75 (logior (enemy-flag check-water-backup) v1-74))
(set! v1-75 (logclear v1-74 (enemy-flag check-water-backup)))
(if (logtest? (enemy-flag trackable-backup) v1-74)
(set! v1-75 (logior (enemy-flag trackable) v1-74))
(set! v1-75 (logclear v1-74 (enemy-flag trackable)))
)
)
(set! (-> self enemy-flags) v1-75)
(logclear! (-> self enemy-flags) (enemy-flag actor-pause-backup))
(logclear! (-> self enemy-flags) (enemy-flag lock-focus))
(logclear! (-> self focus-status) (focus-status hit))
(go-hostile self)
)
@ -708,21 +708,21 @@
(defmethod damage-amount-from-attack ((this rhino) (arg0 process) (arg1 event-message-block))
"@returns the amount of damage taken from an attack. This can come straight off the [[attack-info]] or via [[penetrate-using->damage]]"
(-> arg1 param 1)
(let ((f30-0 (the float (penetrate-using->damage (the-as penetrate (-> this incoming penetrate-using))))))
(let ((f30-0 (the float (penetrate-using->damage (-> this incoming penetrate-using)))))
(cond
((rhino-method-182 this arg0 arg1)
((hit-stomach? this arg0 arg1)
(set! (-> this stomach-touched-once?) #t)
(the int (* 4.0 f30-0))
)
((logtest? #xc0000 (-> this incoming penetrate-using))
(if (and (logtest? #x40000 (-> this incoming penetrate-using))
(logtest? #x80000 (-> this incoming penetrate-using))
((logtest? (penetrate dark-bomb dark-giant) (-> this incoming penetrate-using))
(if (and (logtest? (penetrate dark-bomb) (-> this incoming penetrate-using))
(logtest? (penetrate dark-giant) (-> this incoming penetrate-using))
)
#x420c0000
(the int (* 1.8 f30-0))
)
)
((logtest? #x20000 (-> this incoming penetrate-using))
((logtest? (penetrate dark-punch) (-> this incoming penetrate-using))
(the int (* 2.0 f30-0))
)
(else
@ -869,7 +869,7 @@
(set! (-> (the-as collide-shape-prim-group (-> self root root-prim)) child 1 prim-core collide-with)
(collide-spec)
)
(if (logtest? (-> self enemy-flags) (enemy-flag check-water))
(if (logtest? (-> self enemy-flags) (enemy-flag dangerous-backup))
(logior! (-> self focus-status) (focus-status dangerous))
(logclear! (-> self focus-status) (focus-status dangerous))
)
@ -1049,7 +1049,7 @@
(set! (-> self charge-straight) #f)
(nav-enemy-method-166 self)
(set-time! (-> self state-time))
(logclear! (-> self enemy-flags) (enemy-flag look-at-focus))
(logclear! (-> self enemy-flags) (enemy-flag victory))
)
:trans (behavior ()
(let ((t9-0 (-> (method-of-type nav-enemy hostile) trans)))
@ -1138,7 +1138,7 @@
(ja-channel-push! 1 (seconds 0.2))
(ja :group! (-> self draw art-group data (-> self enemy-info hostile-anim)))
(ja :num-func num-func-identity :frame-num 0.0)
(let ((f30-0 (get-rand-float-range self 0.9 1.1)))
(let ((f30-0 (rnd-float-range self 0.9 1.1)))
(until #f
(suspend)
(ja :num! (loop! f30-0))
@ -1163,7 +1163,7 @@
:virtual #t
:event enemy-event-handler
:enter (behavior ()
(logior! (-> self enemy-flags) (enemy-flag actor-pause-backup))
(logior! (-> self enemy-flags) (enemy-flag lock-focus))
(logior! (-> self focus-status) (focus-status dangerous))
(let* ((v1-4 *game-info*)
(a0-2 (+ (-> v1-4 attack-id) 1))
@ -1190,8 +1190,8 @@
0
)
:exit (behavior ()
(logclear! (-> self enemy-flags) (enemy-flag actor-pause-backup))
(if (logtest? (-> self enemy-flags) (enemy-flag check-water))
(logclear! (-> self enemy-flags) (enemy-flag lock-focus))
(if (logtest? (-> self enemy-flags) (enemy-flag dangerous-backup))
(logior! (-> self focus-status) (focus-status dangerous))
(logclear! (-> self focus-status) (focus-status dangerous))
)
@ -1204,7 +1204,7 @@
(ja-channel-push! 1 (seconds 0.05))
(ja-no-eval :group! rhino-attack-ja :num! (seek!) :frame-num 0.0)
(until (ja-done? 0)
(if (logtest? (-> self enemy-flags) (enemy-flag look-at-focus))
(if (logtest? (-> self enemy-flags) (enemy-flag victory))
(set! gp-0 #t)
)
(suspend)
@ -1504,8 +1504,8 @@
(ja-channel-push! 1 (seconds 0.1))
)
)
(let ((s5-0 (get-rand-int self 8))
(f30-0 (get-rand-float-range self 0.9 1.1))
(let ((s5-0 (rnd-int-count self 8))
(f30-0 (rnd-float-range self 0.9 1.1))
)
(while (nonzero? s5-0)
(+! s5-0 -1)
@ -1533,7 +1533,7 @@
(ja-channel-push! 1 (seconds 0.1))
)
)
(let ((f30-2 (get-rand-float-range self 0.9 1.1)))
(let ((f30-2 (rnd-float-range self 0.9 1.1)))
(ja-no-eval :group! (-> self draw art-group data (-> self enemy-info victory-anim))
:num! (seek! max f30-2)
:frame-num 0.0
@ -1696,7 +1696,7 @@
(set-gravity-length (-> this root dynam) 573440.0)
(logior! (-> this nav flags) (nav-control-flag momentum-ignore-heading))
(logior! (-> this focus-status) (focus-status dangerous))
(logior! (-> this enemy-flags) (enemy-flag check-water))
(logior! (-> this enemy-flags) (enemy-flag dangerous-backup))
0
(none)
)

View File

@ -1496,12 +1496,12 @@
(none)
)
(defmethod dispose! ((this metalkor-flitter))
(defmethod dying ((this metalkor-flitter))
"Cleans-up the enemy and any associated resources. Potentially spawns skull gems"
(with-pp
(when (not (logtest? (enemy-flag recover-applied-velocity) (-> this enemy-flags)))
(when (not (logtest? (enemy-flag called-dying) (-> this enemy-flags)))
(when (and (>= (-> this enemy-info gem-joint) 0)
(not (logtest? (enemy-flag cam-attack-mode) (-> this enemy-flags)))
(not (logtest? (enemy-flag spawn-gem) (-> this enemy-flags)))
(let ((a1-0 (new 'stack-no-clear 'event-message-block)))
(set! (-> a1-0 from) (process->ppointer pp))
(set! (-> a1-0 num-params) 0)
@ -1512,7 +1512,7 @@
)
)
)
(logior! (-> this enemy-flags) (enemy-flag cam-attack-mode))
(logior! (-> this enemy-flags) (enemy-flag spawn-gem))
(remove-from-process *part-engine* this)
(setup-masks
(-> this draw)
@ -1536,17 +1536,17 @@
)
)
)
((method-of-type flitter dispose!) this)
((method-of-type flitter dying) this)
(none)
)
)
(defmethod dispose! ((this metalkor-wasp))
(defmethod dying ((this metalkor-wasp))
"Cleans-up the enemy and any associated resources. Potentially spawns skull gems"
(with-pp
(when (not (logtest? (enemy-flag recover-applied-velocity) (-> this enemy-flags)))
(when (not (logtest? (enemy-flag called-dying) (-> this enemy-flags)))
(when (and (>= (-> this enemy-info gem-joint) 0)
(not (logtest? (enemy-flag cam-attack-mode) (-> this enemy-flags)))
(not (logtest? (enemy-flag spawn-gem) (-> this enemy-flags)))
(let ((a1-0 (new 'stack-no-clear 'event-message-block)))
(set! (-> a1-0 from) (process->ppointer pp))
(set! (-> a1-0 num-params) 0)
@ -1557,7 +1557,7 @@
)
)
)
(logior! (-> this enemy-flags) (enemy-flag cam-attack-mode))
(logior! (-> this enemy-flags) (enemy-flag spawn-gem))
(remove-from-process *part-engine* this)
(setup-masks
(-> this draw)
@ -1581,7 +1581,7 @@
)
)
)
((method-of-type wasp dispose!) this)
((method-of-type wasp dying) this)
(none)
)
)
@ -2160,10 +2160,7 @@ This commonly includes things such as:
(set! sv-400 (the-as symbol #f))
(set! sv-432 *launch-matrix*)
(set! sv-416 (-> sv-432 trans))
(let ((v1-27
(-> (vector<-cspace! (new 'stack-no-clear 'vector) (joint-node metalkor-explode-lod0-jg head)) quad)
)
)
(let ((v1-27 (-> (vector<-cspace! (new 'stack-no-clear 'vector) (joint-node metalkor-explode-lod0-jg head)) quad)))
(set! (-> sv-416 quad) v1-27)
)
((the-as (function object object object object object object object object none) s5-0)

View File

@ -1563,11 +1563,9 @@ This commonly includes things such as:
(let ((v1-48 (-> v1-47 0)))
(when (>= (-> v1-48 length) 1)
(let ((s5-2 (-> v1-48 data 0 actor)))
(let ((a0-52 (search-process-tree
*active-pool*
(lambda ((arg0 gem-tracker)) (= (-> arg0 type) flitter-gem-tracker) (none))
)
)
(let ((a0-52
(search-process-tree *active-pool* (lambda ((arg0 gem-tracker)) (= (-> arg0 type) flitter-gem-tracker)))
)
)
(if a0-52
(set! (-> this flitter-gem-tracker) (process->handle a0-52))
@ -1578,9 +1576,7 @@ This commonly includes things such as:
)
)
)
(let ((a0-63
(search-process-tree *active-pool* (lambda ((arg0 gem-tracker)) (= (-> arg0 type) wasp-gem-tracker) (none)))
)
(let ((a0-63 (search-process-tree *active-pool* (lambda ((arg0 gem-tracker)) (= (-> arg0 type) wasp-gem-tracker))))
)
(if a0-63
(set! (-> this wasp-gem-tracker) (process->handle a0-63))

View File

@ -523,19 +523,22 @@
(none)
)
;; WARN: Return type mismatch process vs none.
;; WARN: Return type mismatch process vs gem-tracker.
;; WARN: disable def twice: 9. This may happen when a cond (no else) is nested inside of another conditional, but it should be rare.
;; WARN: disable def twice: 26. This may happen when a cond (no else) is nested inside of another conditional, but it should be rare.
(defbehavior metalkor-get-gem-tracker metalkor ((arg0 process-focusable))
(cond
((type? arg0 metalkor-wasp)
(handle->process (-> self wasp-gem-tracker))
)
((type? arg0 metalkor-flitter)
(handle->process (-> self flitter-gem-tracker))
)
(else
)
)
(none)
(the-as gem-tracker (cond
((type? arg0 metalkor-wasp)
(handle->process (-> self wasp-gem-tracker))
)
((type? arg0 metalkor-flitter)
(handle->process (-> self flitter-gem-tracker))
)
(else
(the-as process #f)
)
)
)
)
(defbehavior metalkor-handler metalkor ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block))
@ -600,7 +603,7 @@
(set! (-> s4-0 param 3) (-> arg3 param 3))
(set! (-> s4-0 param 4) (-> arg3 param 4))
(set! (-> s4-0 param 5) (-> arg3 param 5))
(send-event-function (the-as process-tree (metalkor-get-gem-tracker (the-as process-focusable arg0))) s4-0)
(send-event-function (metalkor-get-gem-tracker (the-as process-focusable arg0)) s4-0)
)
)
(('setup-flitter-gem)

Some files were not shown because too many files have changed in this diff Show More