-
Notifications
You must be signed in to change notification settings - Fork 173
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
decomp: projectiles
#777
decomp: projectiles
#777
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good, just one comment on types.
) | ||
(< (vector-dot s4-0 s3-0) 0.0) | ||
) | ||
(go (method-of-object arg0 projectile-dissipate)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it's cool that this works - this is grabbing a virtual state from another object.
;; definition for function find-nearest-attackable | ||
;; Used lq/sq | ||
(defun | ||
find-nearest-attackable |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I believe this function figures out what the yellow eco shots will "lock on" to.
(cos arg5) | ||
) | ||
) | ||
(iterate-process-tree *entity-pool* (lambda ((arg0 projectile)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This will iterate over all the spawned actors
;; INFO: Return type mismatch int vs none. | ||
;; Used lq/sq | ||
(defun | ||
projectile-collision-reaction |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is the function that adjusts the path of the yellow eco shots if they need to go around something (if you shoot at a thing behind a small obstacle, the yellow eco will go around that obstacle)
(set! (-> a1-3 from) pp) | ||
(set! (-> a1-3 num-params) 0) | ||
(set! (-> a1-3 message) 'die) | ||
(send-event-function (-> arg0 process) a1-3) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this handles the case where you hit a special thing that kills the shot
(new 'process 'collide-shape-moving obj (collide-list-enum hit-by-player)) | ||
) | ||
) | ||
(set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Wow, another use of the extremely rare copy
method!
goal_src/engine/game/projectiles.gc
Outdated
;; Used lq/sq | ||
(defbehavior | ||
projectile-init-by-other projectile | ||
((arg0 projectile) (arg1 vector) (arg2 vector) (arg3 uint) (arg4 handle)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
are you sure arg0 is projectile
? I think it might be entity
.
(set! (-> self target-base quad) (-> self target quad)) | ||
(dummy-27 self) | ||
(dummy-24 self) | ||
(when (not (type-type? (-> self type) projectile-blue)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I wonder what a projectile-blue
is?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i think they are blue eco related, but im not 100% sure. I've found some in the game but can't remember where. shooting yellow eco is definitely an instance of projectile-yellow
though.
(set! (-> obj target-base quad) (-> obj target quad)) | ||
(let | ||
((f30-0 | ||
(the float (sar (shl (the int (y-angle (-> obj root-override))) 48) 48)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
all these weird shifts are a cool trick to wrap angles to +/- 180 degrees
;; definition for method 27 of type projectile-blue | ||
;; INFO: Return type mismatch int vs none. | ||
;; Used lq/sq | ||
(defmethod dummy-27 projectile-blue ((obj projectile-blue)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this is interesting. This is code for some other projectile that plays the blue eco sound I guess?
blocked by #754