simon987 / Much-Assembly-Required

Assembly programming game
https://muchassemblyrequired.com
GNU General Public License v3.0
925 stars 87 forks source link

(WIP) Radiation Detector Hardware #224

Closed btmeadows closed 3 years ago

btmeadows commented 4 years ago

Added radiation detector hardware to the radioactive cloud plugin. This is not complete and still a work in progress.

Relates to Issue #136

(This is my first pull request so I wanted to keep it small with just a basic outline for the hardware so I know if I'm doing everything correctly. Please tell me if I need to change anything or what more I could do!)

simon987 commented 4 years ago

Hi, thanks a lot for the contribution, for the next steps you need to

  1. Create a method that returns a list of tiles or (x,y) coordinates in a line segment between two points.

image

  1. Create a method that calculates the Euclidean distance between two points

  2. Classes that implement the Radioactive interface must have a getAlphaCounts(distance), which returns the total counts of alpha particles based on the distance. The formula right now is not that important but it should follow inverse square law

  3. The radiation detection hardware iterates every Entity in the current World, if the entity is Radioactive, get the path between the Cubot and the entity (1), subtract a constant from the getAlphaCounts(distance) value for each blocked tile in the path. Finally, return the total value (same thing for beta and gamma)

Don't hesitate if you have questions

simon987 commented 3 years ago

Superseeded by #235