j2: fix enemy-method-135 (#3206)

Co-authored-by: Hat Kid <6624576+Hat-Kid@users.noreply.github.com>
This commit is contained in:
Ziemas 2023-11-15 22:29:51 +01:00 committed by GitHub
parent 6abfc9d129
commit cca829aecd
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
32 changed files with 87 additions and 80 deletions

View file

@ -33068,10 +33068,10 @@
(actor-group (pointer actor-group) :offset-assert 480)
(actor-group-count int32 :offset-assert 484)
(neck joint-mod :offset-assert 488)
(on-notice symbol :offset-assert 492)
(on-active symbol :offset-assert 496)
(on-hostile symbol :offset-assert 500)
(on-death symbol :offset-assert 504)
(on-notice pair :offset-assert 492)
(on-active pair :offset-assert 496)
(on-hostile pair :offset-assert 500)
(on-death pair :offset-assert 504)
(idle-anim-player idle-control :inline :offset-assert 512)
(rand-gen symbol :offset-assert 528)
)

View file

@ -4625,5 +4625,12 @@
"vars": {
"s5-0": "play-sound?"
}
},
"(method 135 enemy)": {
"args": ["this", "sound"],
"vars": {
"gp-0": ["name", "sound-name"],
"v1-0": "sound-type"
}
}
}

View file

@ -275,10 +275,10 @@
(actor-group (pointer actor-group))
(actor-group-count int32)
(neck joint-mod)
(on-notice symbol)
(on-active symbol)
(on-hostile symbol)
(on-death symbol)
(on-notice pair)
(on-active pair)
(on-hostile pair)
(on-death pair)
(idle-anim-player idle-control :inline)
(rand-gen symbol)
)

View file

@ -552,20 +552,20 @@
)
)
(defmethod enemy-method-135 ((this enemy) (arg0 int))
(let ((gp-0 (make-u128 0 0)))
(let ((v1-0 arg0))
(defmethod enemy-method-135 ((this enemy) (sound int))
(let ((name (static-sound-name "")))
(let ((sound-type sound))
(cond
((zero? v1-0)
(set! gp-0 (the-as uint (-> this enemy-info sound-hit)))
((zero? sound-type)
(set! name (-> this enemy-info sound-hit))
)
((= v1-0 1)
(set! gp-0 (the-as uint (-> this enemy-info sound-die)))
((= sound-type 1)
(set! name (-> this enemy-info sound-die))
)
)
)
(if (nonzero? gp-0)
(sound-play-by-name (the-as sound-name gp-0) (new-sound-id) 1024 0 0 (sound-group sfx) #t)
(if (nonzero? (the-as uint name))
(sound-play-by-name (the-as sound-name name) (new-sound-id) 1024 0 0 (sound-group sfx) #t)
)
)
)
@ -1090,10 +1090,10 @@
)
)
)
(set! (-> this on-notice) (res-lump-struct (-> this entity) 'on-notice symbol))
(set! (-> this on-active) (res-lump-struct (-> this entity) 'on-active symbol))
(set! (-> this on-hostile) (res-lump-struct (-> this entity) 'on-hostile symbol))
(set! (-> this on-death) (res-lump-struct (-> this entity) 'on-death symbol))
(set! (-> this on-notice) (res-lump-struct (-> this entity) 'on-notice pair))
(set! (-> this on-active) (res-lump-struct (-> this entity) 'on-active pair))
(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))
)
@ -1841,7 +1841,7 @@ This commonly includes things such as:
(drop-pickup (-> this fact) #t *entity-pool* (-> this fact) 0)
(let ((s5-1 (-> this on-death)))
(if s5-1
(script-eval (the-as pair s5-1) :vector (-> this root trans))
(script-eval s5-1 :vector (-> this root trans))
)
)
)
@ -1883,7 +1883,7 @@ This commonly includes things such as:
(send-event (ppointer->process (-> this parent)) 'child-die)
(let ((s5-3 (-> this on-death)))
(if s5-3
(script-eval (the-as pair s5-3) :vector (-> this root trans))
(script-eval s5-3 :vector (-> this root trans))
)
)
(cleanup-for-death this)
@ -2282,7 +2282,7 @@ This commonly includes things such as:
(logclear! (-> self enemy-flags) (enemy-flag jump-check-blocked))
(let ((gp-0 (-> self on-active)))
(if gp-0
(script-eval (the-as pair gp-0) :vector (-> self root trans))
(script-eval gp-0 :vector (-> self root trans))
)
)
)
@ -2331,7 +2331,7 @@ This commonly includes things such as:
(logclear! (-> self enemy-flags) (enemy-flag auto-reset-penetrate))
(let ((gp-0 (-> self on-notice)))
(if gp-0
(script-eval (the-as pair gp-0) :vector (-> self root trans))
(script-eval gp-0 :vector (-> self root trans))
)
)
)
@ -2386,7 +2386,7 @@ This commonly includes things such as:
(logclear! (-> self enemy-flags) (enemy-flag drawn-mirrored))
(let ((gp-0 (-> self on-hostile)))
(if gp-0
(script-eval (the-as pair gp-0) :vector (-> self root trans))
(script-eval gp-0 :vector (-> self root trans))
)
)
)

View file

@ -1175,10 +1175,10 @@
)
)
)
(set! (-> this on-notice) (res-lump-struct (-> this entity) 'on-notice symbol))
(set! (-> this on-active) (res-lump-struct (-> this entity) 'on-active symbol))
(set! (-> this on-hostile) (res-lump-struct (-> this entity) 'on-hostile symbol))
(set! (-> this on-death) (res-lump-struct (-> this entity) 'on-death symbol))
(set! (-> this on-notice) (res-lump-struct (-> this entity) 'on-notice pair))
(set! (-> this on-active) (res-lump-struct (-> this entity) 'on-active pair))
(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))
)

View file

@ -531,7 +531,7 @@
(logclear! (-> self enemy-flags) (enemy-flag drawn-mirrored))
(let ((gp-0 (-> self on-hostile)))
(if gp-0
(script-eval (the-as pair gp-0) :vector (-> self root trans))
(script-eval gp-0 :vector (-> self root trans))
)
)
)

View file

@ -279,7 +279,7 @@
(logclear! (-> self enemy-flags) (enemy-flag auto-reset-penetrate))
(let ((gp-0 (-> self on-notice)))
(if gp-0
(script-eval (the-as pair gp-0) :vector (-> self root trans))
(script-eval gp-0 :vector (-> self root trans))
)
)
)

View file

@ -334,7 +334,7 @@
(logclear! (-> self enemy-flags) (enemy-flag auto-reset-penetrate))
(let ((gp-0 (-> self on-notice)))
(if gp-0
(script-eval (the-as pair gp-0) :vector (-> self root trans))
(script-eval gp-0 :vector (-> self root trans))
)
)
)

View file

@ -624,7 +624,7 @@
(logclear! (-> self enemy-flags) (enemy-flag auto-reset-penetrate))
(let ((gp-0 (-> self on-notice)))
(if gp-0
(script-eval (the-as pair gp-0) :vector (-> self root trans))
(script-eval gp-0 :vector (-> self root trans))
)
)
)

View file

@ -411,7 +411,7 @@
(logclear! (-> self enemy-flags) (enemy-flag auto-reset-penetrate))
(let ((gp-0 (-> self on-notice)))
(if gp-0
(script-eval (the-as pair gp-0) :vector (-> self root trans))
(script-eval gp-0 :vector (-> self root trans))
)
)
)

View file

@ -1554,7 +1554,7 @@
(logclear! (-> self enemy-flags) (enemy-flag auto-reset-penetrate))
(let ((gp-1 (-> self on-notice)))
(if gp-1
(script-eval (the-as pair gp-1) :vector (-> self root trans))
(script-eval gp-1 :vector (-> self root trans))
)
)
)

View file

@ -843,7 +843,7 @@
(logclear! (-> self enemy-flags) (enemy-flag auto-reset-penetrate))
(let ((gp-0 (-> self on-notice)))
(if gp-0
(script-eval (the-as pair gp-0) :vector (-> self root trans))
(script-eval gp-0 :vector (-> self root trans))
)
)
)

View file

@ -178,7 +178,7 @@
(logclear! (-> self enemy-flags) (enemy-flag auto-reset-penetrate))
(let ((gp-0 (-> self on-notice)))
(if gp-0
(script-eval (the-as pair gp-0) :vector (-> self root trans))
(script-eval gp-0 :vector (-> self root trans))
)
)
)

View file

@ -452,7 +452,7 @@
(logclear! (-> self enemy-flags) (enemy-flag auto-reset-penetrate))
(let ((gp-0 (-> self on-notice)))
(if gp-0
(script-eval (the-as pair gp-0) :vector (-> self root trans))
(script-eval gp-0 :vector (-> self root trans))
)
)
)

View file

@ -609,7 +609,7 @@
(logclear! (-> self enemy-flags) (enemy-flag auto-reset-penetrate))
(let ((gp-0 (-> self on-notice)))
(if gp-0
(script-eval (the-as pair gp-0) :vector (-> self root trans))
(script-eval gp-0 :vector (-> self root trans))
)
)
)

View file

@ -1266,7 +1266,7 @@
(logclear! (-> self enemy-flags) (enemy-flag auto-reset-penetrate))
(let ((gp-0 (-> self on-notice)))
(if gp-0
(script-eval (the-as pair gp-0) :vector (-> self root trans))
(script-eval gp-0 :vector (-> self root trans))
)
)
)

View file

@ -267,7 +267,7 @@
(logclear! (-> self enemy-flags) (enemy-flag auto-reset-penetrate))
(let ((gp-0 (-> self on-notice)))
(if gp-0
(script-eval (the-as pair gp-0) :vector (-> self root trans))
(script-eval gp-0 :vector (-> self root trans))
)
)
)

View file

@ -374,10 +374,10 @@
(actor-group (pointer actor-group))
(actor-group-count int32)
(neck joint-mod)
(on-notice symbol)
(on-active symbol)
(on-hostile symbol)
(on-death symbol)
(on-notice pair)
(on-active pair)
(on-hostile pair)
(on-death pair)
(idle-anim-player idle-control :inline)
(rand-gen symbol)
)

View file

@ -593,20 +593,20 @@
;; definition for method 135 of type enemy
;; INFO: Used lq/sq
(defmethod enemy-method-135 ((this enemy) (arg0 int))
(let ((gp-0 (make-u128 0 0)))
(let ((v1-0 arg0))
(defmethod enemy-method-135 ((this enemy) (sound int))
(let ((name (static-sound-name "")))
(let ((sound-type sound))
(cond
((zero? v1-0)
(set! gp-0 (the-as uint (-> this enemy-info sound-hit)))
((zero? sound-type)
(set! name (-> this enemy-info sound-hit))
)
((= v1-0 1)
(set! gp-0 (the-as uint (-> this enemy-info sound-die)))
((= sound-type 1)
(set! name (-> this enemy-info sound-die))
)
)
)
(if (nonzero? gp-0)
(sound-play-by-name (the-as sound-name gp-0) (new-sound-id) 1024 0 0 (sound-group sfx) #t)
(if (nonzero? (the-as uint name))
(sound-play-by-name (the-as sound-name name) (new-sound-id) 1024 0 0 (sound-group sfx) #t)
)
)
)
@ -1167,10 +1167,10 @@
)
)
)
(set! (-> this on-notice) (res-lump-struct (-> this entity) 'on-notice symbol))
(set! (-> this on-active) (res-lump-struct (-> this entity) 'on-active symbol))
(set! (-> this on-hostile) (res-lump-struct (-> this entity) 'on-hostile symbol))
(set! (-> this on-death) (res-lump-struct (-> this entity) 'on-death symbol))
(set! (-> this on-notice) (res-lump-struct (-> this entity) 'on-notice pair))
(set! (-> this on-active) (res-lump-struct (-> this entity) 'on-active pair))
(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))
)
@ -1916,7 +1916,7 @@ This commonly includes things such as:
(drop-pickup (-> this fact) #t *entity-pool* (-> this fact) 0)
(let ((s5-1 (-> this on-death)))
(if s5-1
(script-eval (the-as pair s5-1) :vector (-> this root trans))
(script-eval s5-1 :vector (-> this root trans))
)
)
)
@ -1958,7 +1958,7 @@ This commonly includes things such as:
(send-event (ppointer->process (-> this parent)) 'child-die)
(let ((s5-3 (-> this on-death)))
(if s5-3
(script-eval (the-as pair s5-3) :vector (-> this root trans))
(script-eval s5-3 :vector (-> this root trans))
)
)
(cleanup-for-death this)
@ -2377,7 +2377,7 @@ This commonly includes things such as:
(logclear! (-> self enemy-flags) (enemy-flag jump-check-blocked))
(let ((gp-0 (-> self on-active)))
(if gp-0
(script-eval (the-as pair gp-0) :vector (-> self root trans))
(script-eval gp-0 :vector (-> self root trans))
)
)
)
@ -2427,7 +2427,7 @@ This commonly includes things such as:
(logclear! (-> self enemy-flags) (enemy-flag auto-reset-penetrate))
(let ((gp-0 (-> self on-notice)))
(if gp-0
(script-eval (the-as pair gp-0) :vector (-> self root trans))
(script-eval gp-0 :vector (-> self root trans))
)
)
)
@ -2483,7 +2483,7 @@ This commonly includes things such as:
(logclear! (-> self enemy-flags) (enemy-flag drawn-mirrored))
(let ((gp-0 (-> self on-hostile)))
(if gp-0
(script-eval (the-as pair gp-0) :vector (-> self root trans))
(script-eval gp-0 :vector (-> self root trans))
)
)
)

View file

@ -1256,10 +1256,10 @@
)
)
)
(set! (-> this on-notice) (res-lump-struct (-> this entity) 'on-notice symbol))
(set! (-> this on-active) (res-lump-struct (-> this entity) 'on-active symbol))
(set! (-> this on-hostile) (res-lump-struct (-> this entity) 'on-hostile symbol))
(set! (-> this on-death) (res-lump-struct (-> this entity) 'on-death symbol))
(set! (-> this on-notice) (res-lump-struct (-> this entity) 'on-notice pair))
(set! (-> this on-active) (res-lump-struct (-> this entity) 'on-active pair))
(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))
)

View file

@ -563,7 +563,7 @@
(logclear! (-> self enemy-flags) (enemy-flag drawn-mirrored))
(let ((gp-0 (-> self on-hostile)))
(if gp-0
(script-eval (the-as pair gp-0) :vector (-> self root trans))
(script-eval gp-0 :vector (-> self root trans))
)
)
)

View file

@ -303,7 +303,7 @@
(logclear! (-> self enemy-flags) (enemy-flag auto-reset-penetrate))
(let ((gp-0 (-> self on-notice)))
(if gp-0
(script-eval (the-as pair gp-0) :vector (-> self root trans))
(script-eval gp-0 :vector (-> self root trans))
)
)
)

View file

@ -362,7 +362,7 @@
(logclear! (-> self enemy-flags) (enemy-flag auto-reset-penetrate))
(let ((gp-0 (-> self on-notice)))
(if gp-0
(script-eval (the-as pair gp-0) :vector (-> self root trans))
(script-eval gp-0 :vector (-> self root trans))
)
)
)

View file

@ -664,7 +664,7 @@
(logclear! (-> self enemy-flags) (enemy-flag auto-reset-penetrate))
(let ((gp-0 (-> self on-notice)))
(if gp-0
(script-eval (the-as pair gp-0) :vector (-> self root trans))
(script-eval gp-0 :vector (-> self root trans))
)
)
)

View file

@ -476,7 +476,7 @@
(logclear! (-> self enemy-flags) (enemy-flag auto-reset-penetrate))
(let ((gp-0 (-> self on-notice)))
(if gp-0
(script-eval (the-as pair gp-0) :vector (-> self root trans))
(script-eval gp-0 :vector (-> self root trans))
)
)
)

View file

@ -1678,7 +1678,7 @@
(logclear! (-> self enemy-flags) (enemy-flag auto-reset-penetrate))
(let ((gp-1 (-> self on-notice)))
(if gp-1
(script-eval (the-as pair gp-1) :vector (-> self root trans))
(script-eval gp-1 :vector (-> self root trans))
)
)
)

View file

@ -787,7 +787,7 @@
(logclear! (-> self enemy-flags) (enemy-flag auto-reset-penetrate))
(let ((gp-0 (-> self on-notice)))
(if gp-0
(script-eval (the-as pair gp-0) :vector (-> self root trans))
(script-eval gp-0 :vector (-> self root trans))
)
)
)

View file

@ -210,7 +210,7 @@
(logclear! (-> self enemy-flags) (enemy-flag auto-reset-penetrate))
(let ((gp-0 (-> self on-notice)))
(if gp-0
(script-eval (the-as pair gp-0) :vector (-> self root trans))
(script-eval gp-0 :vector (-> self root trans))
)
)
)

View file

@ -497,7 +497,7 @@
(logclear! (-> self enemy-flags) (enemy-flag auto-reset-penetrate))
(let ((gp-0 (-> self on-notice)))
(if gp-0
(script-eval (the-as pair gp-0) :vector (-> self root trans))
(script-eval gp-0 :vector (-> self root trans))
)
)
)

View file

@ -647,7 +647,7 @@
(logclear! (-> self enemy-flags) (enemy-flag auto-reset-penetrate))
(let ((gp-0 (-> self on-notice)))
(if gp-0
(script-eval (the-as pair gp-0) :vector (-> self root trans))
(script-eval gp-0 :vector (-> self root trans))
)
)
)

View file

@ -1381,7 +1381,7 @@
(logclear! (-> self enemy-flags) (enemy-flag auto-reset-penetrate))
(let ((gp-0 (-> self on-notice)))
(if gp-0
(script-eval (the-as pair gp-0) :vector (-> self root trans))
(script-eval gp-0 :vector (-> self root trans))
)
)
)

View file

@ -280,7 +280,7 @@
(logclear! (-> self enemy-flags) (enemy-flag auto-reset-penetrate))
(let ((gp-0 (-> self on-notice)))
(if gp-0
(script-eval (the-as pair gp-0) :vector (-> self root trans))
(script-eval gp-0 :vector (-> self root trans))
)
)
)