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
32 changed files with 87 additions and 80 deletions
+4 -4
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)
)
+18 -18
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))
)
)
)
+4 -4
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))
)
+1 -1
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))
)
)
)
@@ -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))
)
)
)
@@ -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))
)
)
)
+1 -1
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))
)
)
)
+1 -1
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))
)
)
)
@@ -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))
)
)
)
+1 -1
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))
)
)
)
+1 -1
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))
)
)
)
+1 -1
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))
)
)
)
+1 -1
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))
)
)
)
+1 -1
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))
)
)
)
+1 -1
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))
)
)
)