Skip to content
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

Merged
merged 8 commits into from
Sep 3, 2021
Merged

Conversation

xTVaser
Copy link
Member

@xTVaser xTVaser commented Aug 20, 2021

blocked by #754

@xTVaser xTVaser marked this pull request as ready for review August 31, 2021 23:26
Copy link
Collaborator

@water111 water111 left a 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))
Copy link
Collaborator

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
Copy link
Collaborator

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))
Copy link
Collaborator

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
Copy link
Collaborator

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)
Copy link
Collaborator

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))
Copy link
Collaborator

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!

;; Used lq/sq
(defbehavior
projectile-init-by-other projectile
((arg0 projectile) (arg1 vector) (arg2 vector) (arg3 uint) (arg4 handle))
Copy link
Collaborator

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))
Copy link
Collaborator

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?

Copy link
Member Author

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))
Copy link
Collaborator

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))
Copy link
Collaborator

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?

@xTVaser xTVaser changed the title decomp: close to finishing projectiles decomp: projectiles Sep 2, 2021
@water111 water111 merged commit 442d5ed into open-goal:master Sep 3, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants