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

Task aug unit #796

Merged
merged 8 commits into from
Dec 9, 2023
Merged

Task aug unit #796

merged 8 commits into from
Dec 9, 2023

Conversation

royfalk
Copy link
Contributor

@royfalk royfalk commented Aug 31, 2023

This is a near complete refactoring of the cloaking in the game.

This is also a move from refactoring using subclasses to fields.
Instead of energetic, we'll have reactor and capacitors.

Not sure why it is picking extra stuff for this PR. It should only have taken 8668683.

Code Changes:

Game Changes:

  • The game now decides if a unit is cloaked if it exceeds its minimum. Before it sometimes used an arbitrary .8. At some point, we'll want to make radars that can pierce at short range, etc. But there are much more urgent tasks.

Issues:

  • Game is still fragile. Can't buy a second ship and fly with it.
  • I was unable to make the graphics do what I wanted. I wanted cloaked ship to be black and somewhat transparent and glass cloaked ships to be nearly transparent.
  • Cloaking takes longer. If an issue, we'll need to adjust rate for ships and modules.
  • Cloak can be damaged but can't be repaired (probably). I was unable to find the code to fix modules.

@royfalk royfalk self-assigned this Aug 31, 2023
Copy link
Member

@BenjamenMeyer BenjamenMeyer left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would be good to have to some instructions for testing this.
Aside from the linting issue this looks good; please fix that. I'll be happy to test it if given some guidance - I haven't had any ships with cloak yet.

engine/src/cmd/cloak.h Show resolved Hide resolved
return 1;
}
return ((float) cloaking) / 2147483647;
cloak.Visible();
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

linter raising an issue here since it does need to return a value or be refactored to be void.
Perhaps this should be return clock.Visible();?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yep.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would be good to have to some instructions for testing this.

  1. Visual - switch to view 6. Hit c and watch the ship slowly cloak itself and decloak itself.
  2. Pick a fight and then cloak yourself and check the enemy doesn't shoot you. He may accidentally ram you...
  3. Buy a cloaking device. Sell a cloaking device. The whole upgrade issue has not been tested properly.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@royfalk where can I buy a cloaking device? I have yet to see one.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@BenjamenMeyer Try buying a cloaking device at an Aera planet or base, maybe? I seem to recall someone saying at some point that Aera bases and planets tend to have cloaking devices, even if others don't.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@stephengtuggy thanks for the suggestion...I'll have to try that out

@royfalk
Copy link
Contributor Author

royfalk commented Sep 16, 2023

I'll wait on this until #792 and #789 are both ready.

Copy link
Contributor

@stephengtuggy stephengtuggy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cool. This code is clean, well organized, well written, and seems quite straightforward. Well done, @royfalk .

I believe you also fixed the linter issue, correct?

Copy link
Member

@BenjamenMeyer BenjamenMeyer left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

agree with @stephengtuggy so approving; will still try to test it out once I can play long enough to find somewhere to buy a clock device from

@stephengtuggy stephengtuggy merged commit adc6284 into vegastrike:master Dec 9, 2023
53 checks passed
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.

3 participants