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

Super Star Trek - Ship class does not work correctly #795

Open
posguy99 opened this issue Sep 3, 2022 · 2 comments
Open

Super Star Trek - Ship class does not work correctly #795

posguy99 opened this issue Sep 3, 2022 · 2 comments

Comments

@posguy99
Copy link
Contributor

posguy99 commented Sep 3, 2022

Commit 972ee4073742c13648687583193af1ad71e4da6 breaks both shield energy and total energy available.

I've sprinkled print()'s through the code, you end up with things like this:

YOUR MISSION BEGINS WITH YOUR STARSHIP LOCATED
IN THE GALACTIC QUADRANT, 'PROCYON I'.

---------------------------------
                             <*>        STARDATE           2800.0
                                        CONDITION          GREEN
                                        QUADRANT           3 , 1
                                        SECTOR             1 , 8
      *                                 PHOTON TORPEDOES   10
                                        TOTAL ENERGY       3000
      *                                 SHIELDS            0
  *                                     KLINGONS REMAINING 11
---------------------------------
shields are 0
energy is 3000
COMMAND? she
ENERGY AVAILABLE = 3000 NUMBER OF UNITS TO SHIELDS? 500
shields were 0
energy was 3000
delta 500
shields are 500
energy is 2500
DEFLECTOR CONTROL ROOM REPORT:
  'SHIELDS NOW AT 500 UNITS PER YOUR COMMAND.'
shields are 500
energy is 2500
COMMAND? srs
---------------------------------
                             <*>        STARDATE           2800.0
                                        CONDITION          GREEN
                                        QUADRANT           3 , 1
                                        SECTOR             1 , 8
      *                                 PHOTON TORPEDOES   10
                                        TOTAL ENERGY       3000
      *                                 SHIELDS            0
  *                                     KLINGONS REMAINING 11
---------------------------------
shields are 500
energy is 2500
COMMAND? 

Huh? Short range scan says shields are zero, and they apparently are, despite the contents of ship.shields, since when I navigate to a hostile quadrant, I'm warned...

COMMAND? nav
COURSE (1-9)? 7
WARP FACTOR (0-8)? 1

NOW ENTERING VEGA I QUADRANT . . .

COMBAT AREA      CONDITION RED
   SHIELDS DANGEROUSLY LOW
---------------------------------
     +K+                     <*>        STARDATE           2801.0
                                        CONDITION          *RED*
                             +K+        QUADRANT           4 , 1
                                        SECTOR             1 , 8
                                        PHOTON TORPEDOES   10
                          *             TOTAL ENERGY       2982
                                        SHIELDS            0
                                        KLINGONS REMAINING 11
---------------------------------
---------------------------------
     +K+                     <*>        STARDATE           2802.0
                                        CONDITION          *RED*
                             +K+        QUADRANT           4 , 1
                                        SECTOR             1 , 8
                                        PHOTON TORPEDOES   10
                          *             TOTAL ENERGY       2982
                                        SHIELDS            0
                                        KLINGONS REMAINING 11
---------------------------------
shields are 500
energy is 2500
COMMAND? 

And the Total Energy fields isn't right either.

Let's shoot at them...

COMMAND? pha
PHASERS LOCKED ON TARGET;  ENERGY AVAILABLE = 2982 UNITS
NUMBER OF UNITS TO FIRE? 500
 272 UNIT HIT ON KLINGON AT SECTOR 3 , 8
*** KLINGON DESTROYED ***
 102 UNIT HIT ON KLINGON AT SECTOR 1 , 2
   (SENSORS SHOW 185.988183 UNITS REMAINING)
 78 UNIT HIT ON ENTERPRISE FROM SECTOR 1 , 2 

THE ENTERPRISE HAS BEEN DESTROYED. THE FEDERATION WILL BE CONQUERED.
IT IS STARDATE 2802
THERE WERE 10 KLINGON BATTLE CRUISERS LEFT AT
THE END OF YOUR MISSION.

But ship.shields was 500 the whole time.

@posguy99 posguy99 changed the title Super Star Trek - Shields and Engery do not work Super Star Trek - Ship class does not work correctly Sep 3, 2022
@drewjcooper
Copy link
Contributor

Which implementation is this?

@posguy99
Copy link
Contributor Author

Python. The commit I referenced is the one that broke it.

steveglumify added a commit to steveglumify/basic-computer-games that referenced this issue Aug 13, 2023
Fixes issue coding-horror#795- Ship class does not work correctly
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

No branches or pull requests

2 participants