Commit Graph

57 Commits

Author SHA1 Message Date
onpon4 9dedf500c8 Adjusted the status screen.
Several pointless lines have been removed, and I've added a workaround
to fix a segfault that was happening when Phoebe or Ursula were not
wingmates yet.
2016-01-09 22:15:28 -05:00
onpon4 ac844d8d54 Removed the "planets" data files.
This is the last of the data files I wanted to remove.

This commit also includes some dialog changes.

I copied some of this code into a comment elsewhere, because I want
to use it as a reference when creating a new save format.
2016-01-08 21:33:40 -05:00
onpon4 14a9dace7e Let Kline switch weapons on Venus (except in Classic difficulty).
It's a modified version of the weapon switching: if Kline's health
is less than 1500, the spread shot replaces the concentrated triple
shot.

This also keeps Kline with bullet weapons during the third phase.

The main purpose of this change is to make Kline consistent. He now
switches his secondary weapon, and that's about it. The way it was
in the original, it started out much easier than previous encounters,
then it went to slightly easier than previous encounters, then
something completely unlike previous encounters, and finally
something noticeably harder than previous encounters. Now, it starts
out exactly the same as previous encounters, and then gets
progressively harder.
2016-01-08 18:09:35 -05:00
onpon4 a889d43296 Fixed drones and small asteroids being given special alien slots.
This could cause small asteroids and drones to be given labels that
said "Sid", "Phoebe", "Ursula", or "Kline".
2016-01-08 12:10:50 -05:00
onpon4 62d14c57f0 Added special target text for Kline. 2016-01-08 11:09:13 -05:00
onpon4 f8e23ab061 Added special target text when Sid or Phoebe is the target.
This is because it may not be obvious that Sid or Phoebe is the
target now that the indicator for them says their names.
2016-01-08 10:52:34 -05:00
onpon4 efc2311f7a Added special indicators for Sid, Phoebe, and Ursula. 2016-01-08 10:31:01 -05:00
onpon4 401a306793 Added green versions of arrows for friendly ships. 2016-01-08 09:39:12 -05:00
onpon4 822ff849e4 Removed the very last of the image-related magic numbers (in source code).
The only magic numbers left now are related to positioning, image
sizing, and the remaining "data" files (the "planets" and "brief" ones).
At least, I'm pretty sure that's the case.
2016-01-06 20:35:37 -05:00
onpon4 4be080225b Fixed more magic numbers.
God, this one was definitely the biggest headache of all of the
magic number erasing. Never did I expect such cryptic problems.

The first problem was that the entirety of the player's weapon
struct was a part of the save file, *including the weapon's "image
indexes"*. Since the indexes have been changed, and the originally
used one is now unavailable when it's requested, this was causing
a segfault later on. Had to fix this by setting the image index
when the game is loaded.

The second problem was related to another bug I've been confused
about for years: the one that causes mobile rays to fire 5 green
shots. The entire reason those shots were green was because
the weapon's image indexes were undefined, and *that was causing
them to default to 0*. 0 was simply the index of green plasma.
Of course, though, now attempting to use that image causes a
segfault, so for now, I've fixed this by changing the image index
of the mobile rays to the red plasma bolts.

There are still some magic numbers left, related to the intermission
screen. But the hardest part is now done, thank God.
2016-01-05 22:12:29 -05:00
onpon4 4a921947c1 NONE -> M_NONE 2016-01-05 07:07:04 -05:00
onpon4 6189a66866 Added CHANCE macro to replace difficult-to-read special rand() uses.
I found myself confused by the interception chances, because it looked
like the chance of interceptions was decreasing slowly over time.
Turns out, it was the denominator in a fraction; a "chance" of 300
meant that there was a 1 / 300 chance.
2016-01-05 06:59:37 -05:00
onpon4 97f1f441c2 Removed more magic numbers. 2016-01-05 06:44:26 -05:00
onpon4 73af622c54 Started getting rid of magic numbers on the intermission screen. 2016-01-04 22:25:00 -05:00
onpon4 5acc9f37f3 Moved cutscenes to C. 2016-01-04 20:17:06 -05:00
onpon4 0da184f424 Moved the ship image definitions to C code.
Now, this has an unfortunate effect of screwing up cutscenes. I'll
fix that by moving cutscene definitions to C as well.
2016-01-04 16:34:29 -05:00
onpon4 c07f5678aa Fixed a memory leak, more cleanup.
Forgot to free the face surfaces. Whoops!
2016-01-04 12:41:19 -05:00
onpon4 aad7b550a9 Renamed "FACE_" enum values to "FS_". 2016-01-04 09:07:30 -05:00
onpon4 ab53fac4a8 Moved face sprites to their own array.
Man, that was really difficult. Every time something wrong happened,
segfault. Ugh... Anyway, that's done.
2016-01-04 09:01:54 -05:00
onpon4 697a302fc6 Some cleanup I forgot to do in gfx.cpp. 2016-01-03 22:39:16 -05:00
onpon4 e4633652f9 Fixed the compile option names.
Whoops, "SCREEN_H" is the definition screen.h checks.
2016-01-03 21:36:34 -05:00
onpon4 4f02865256 Added SCREEN_W and SCREEN_H definitions.
These are just there so that you can define these at compile time
without modifying the source code. In the future, I would like this
to only be the *default* screen width and height, because I'll want
to add an option in the menu to change the resolution from 640x480
up to whatever your monitor's resolution is.
2016-01-03 20:44:26 -05:00
onpon4 56240606e9 Changed all the magic number ship indexes to named ship indexes.
Also, now that the magic numbers are gone, I was able to get rid of
all the hardsetting of numbers for the special ship indexes (which
was only in place to avoid breaking the magic numbers).
2016-01-03 16:20:22 -05:00
onpon4 e5e7d6b9c4 Some cleanup. 2016-01-03 14:31:39 -05:00
onpon4 d911426c06 More cleanup. 2016-01-02 17:37:19 -05:00
onpon4 ce94477b70 More cleanup. 2016-01-02 16:59:48 -05:00
onpon4 651a7f55fb Did some more cleanup, removing more "shape" magic numbers. 2015-12-31 10:47:27 -05:00
onpon4 9a211d773c More reorganization. 2015-06-20 11:59:09 -04:00
onpon4 c6735cd88b More cleanup 2015-05-28 06:51:45 -04:00
onpon4 533d74447f Made auto-pausing an option. 2015-05-21 18:49:04 -04:00
onpon4 60968c7b0e Some more touch-ups. 2015-04-26 07:37:30 -04:00
onpon4 47fb2dc82a One more flag that has to be long 2015-03-31 13:15:08 -04:00
onpon4 e0809c02b0 Fixed a potential compatibility problem.
The plain int type is only guaranteed to be at least 16 bits, and
yet the flags variable was expecting at least 22 bits. This turns
out to be true for x86 and x86-64 systems, but to ensure compatibility,
the variable has been changed to an unsigned long int. Also added
the "L" suffix to flags that were more than 16 bits.
2015-03-31 13:02:09 -04:00
onpon4 5019244da1 Added an enum for missions/areas.
Eliminating another set of magic numbers, and God, that was tedious.
2015-03-29 13:11:12 -04:00
onpon4 576d254e4a Replaced rrand function with RANDRANGE macro. 2015-03-29 10:19:53 -04:00
onpon4 e105d6a1cc Added a new "original" difficulty.
This difficulty is meant to imitate the original Project: Starfighter
as closely as possible, for purists.
2015-03-28 09:51:49 -04:00
onpon4 1567595def Changed all the various unnecessarily specifically defined types to "int".
Most of these were defining various integers as char types, probably
in the naive belief that this is necessarily good because it uses less
RAM. There were also several unnecessary unsigned ints, though.
These have all been changed to just "int", so the compiler can decide
exactly what type to use.
2015-03-24 18:51:12 -04:00
onpon4 ad8a2f2ad9 Replaced various "limit" functions with LIMIT and LIMIT_ADD macros.
This is mainly because the old "limit" functions were all restricted
to certain types, which is incredibly silly given how simple they are.
Macros are much simpler, and a warning gets raised if they're used
improperly with multiple types, anyway.

In the process, I also found and fixed a bug: it seems the original
author intended for escaping enemies to gradually accelerate to
fleeing speed, but the low value was indicated as the max value, and
the way limitFloat was written, that caused the max value to be used
(it was supposed to reduce the speed to a minimum of -15, but it
instead effectively assigned the speed to -15). It might be a good
idea to re-implement the old buggy behavior intentionally; depends
on whether the acceleration of jumping looks better or worse than
just immediately going to jump speed.
2015-03-17 19:00:13 -04:00
onpon4 05c370feb4 Capitalized "max" and "min" macros. 2015-03-17 16:54:00 -04:00
onpon4 ce5df0013d Some tweaks.
Mostly to the charge cannon, but also to Kline.
2015-03-08 22:01:37 -04:00
onpon4 31a8383f90 Changed the way Kline works.
Kline previously had a maximum of 500 or 750 health, and uses some
hacks to cause it to flee just as it was destroyed, and to advance
to new stages in the final battle.

I've replaced this with a much larger amount of health, and progression
being based on how much health he has.

Also some other stuff.
2015-03-08 20:59:33 -04:00
onpon4 28cc1fcc6d Updated audio module. 2015-03-08 10:38:58 -04:00
onpon4 a3efbc06cc Substantially increased the cost of plasma upgrades.
I feel these were extremely underpriced. $1000 for triple bullets?
That's dirt-cheap! Even in hard mode, I have no trouble getting that.
2015-03-07 09:42:24 -05:00
onpon4 09e1f1f72e Some adjustments to weapons.
* Modified the upgrade limits, to both be uniform and allow upgrades for
  every factor. (In fact, each one can be upgraded exactly once now.)
* Gave triple-spread weapon double damage.
* Micro rocket damage down from 7 to 6. Total damage is now equal to
  double rockets.
2015-03-06 16:25:12 -05:00
onpon4 dad8a41114 Improved shop code. 2015-03-06 15:22:10 -05:00
onpon4 aa187ef5f7 Prevent inclusion of headers multiple times, on an individual level.
Previously, Starfighter depended on a single check in Starfighter.h
to prevent this. Now, the proper code is in all header files.
2015-03-04 09:11:04 -05:00
onpon4 cc6989328d Fixed the ammo limit of double missiles. 2015-03-03 09:25:32 -05:00
onpon4 1f2ef8ac50 Dedicated autosave slot + much improved menu code.
I found it kind of odd to be able to manually save to the autosave
slot, *and* have no reliable way to even know what the autosave
slot is. I noticed that it's an actual problem when my brothers
played Starfighter; one of them used an autosave slot, and the
other unwittingly ended up erasing the first one's save because of
this. To fix this, I have replaced the behavior of allowing the
player to define a slot as autosave, with a dedicated autosave
slot.

While I was there, I had no choice but to vastly improve on this
game's *atrocious* menu system. Granted, I didn't do much more
than replace the magic numbers with enums, but it makes the code
much more clear and more easy to edit.
2015-03-02 23:32:48 -05:00
onpon4 9959c47f98 Updated copyright notices on all files based on git-blame. 2015-03-01 15:37:32 -05:00
onpon4 23d95f99b6 Fixed a problem. 2015-03-01 04:48:47 -05:00