Commit Graph

328 Commits

Author SHA1 Message Date
onpon4 e557d9920a Removed the suggestion from the Comms screen that Phoebe's name is unknown.
I think this might partly be because of my dialog changes, but this
causes a minor continuity error, since the mission clearly states
that you're rescuing "Phoebe Lexx", and there's also the fact that
the indicator now says "Phoebe" instead of "Target". I figure just
make her name known from the start; the explanation can be that the
ship automatically transmits the name.
2016-01-08 10:37:19 -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 79bbe56849 Replaced the previous arrow positioning with a more simplistic one.
The previous one positioned the arrows based on the difference between
their X distance and Y distance; objects that were further away
would be closer to the center. However, the code was confusing, and
a major practical effect of this was it was impossible to really know
exactly where an object was.

This new, simpler method makes aiming at targets that are off-screen
feasible, and it also utilizes the diagonal arrows.
2016-01-08 09:12:07 -05:00
onpon4 33a92b2294 Removed the code that actively prevented the "Target" text from showing.
It was triggered whenever there was a message being displayed.
Thing is, there's no legitimate reason to do this. It doesn't ever
obscure the radio message, and there wasn't some technical limitation
in place. It just did it... just because.
2016-01-07 23:15:01 -05:00
onpon4 409a2efe07 Updated copyright notices.
Apparently they've all been modified this year now. The earliest
modification date is alien.h, at January 2.
2016-01-07 21:32:40 -05:00
onpon4 e71e3b8a96 Moved the "brief" data files to C code. 2016-01-07 21:18:14 -05:00
onpon4 e7abfe30a6 Fixed the bug that caused mobile rays to shoot bullets.
This was a strange cause, and I wonder why it happened. Quite simply,
there was an assumption in the code that any alien's primary weapon
was a bullet, despite the fact that the secondary weapon code could
handle any weapon, including bullets. I've fixed this by getting rid
of the special primary weapon mechanism; the one for the secondary
weapons is used on primary weapons as well.
2016-01-07 19:01:25 -05:00
onpon4 6dad38bd20 Made powerups in Classic difficulty behave the same as the original.
There are two aspects to this:

1. They now simply make sure your plasma ammo is at a minimum of
   50, rather than adding to your plasma ammo as in the other
   difficulties.

2. Added a simulation of a bug in Starfighter 1.1 which caused
   each aspect of the Supercharge to be lost when you picked up
   a different associated powerup. Even though this was a bug,
   without it, the Supercharge becomes extraordinarily more
   game-breaking, since it's the only thing that sort of limits
   its longevity.
2016-01-07 06:44:03 -05:00
onpon4 f7aab48a56 Revert "Added usage of plasma ammo by the charger cannon."
This reverts commit 05e645aeff.
2016-01-07 05:36:49 -05:00
onpon4 05e645aeff Added usage of plasma ammo by the charger cannon.
This should add some much-needed depth to the tacticality of the
weapon. It's not much: it takes 5 plasma cells to fully charge the
cannon. But it does eliminate the previous effect where the charger
was always preferable over plasma bullets; it's still preferable in
a lot of circumstances, but for smaller ships, it's now typically
better to use plain old plasma ammo. It also limits the amount of
times the charger can be used.
2016-01-06 21:56:53 -05:00
onpon4 cac29f72a2 Fixed positioning of mine explosions.
Accidentally put "x" instead of "y". Whoops! Fixed now.
2016-01-06 20:49:02 -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 05323ed1fb Added code to handle different resolutions during missions.
This is capable of handling any resolution which is at least 640x360.
Actually, resolutions a bit smaller than that can be handled. No
manual adjustment is necessary. :)

Now, the intermission screen needs to be fixed...
2016-01-03 20:30:54 -05:00
onpon4 26add18109 Repositioned the Starfighter logo and the menu.
This places the logo at 1/3 of the way down the screen, rather than
half of the way down, and the menu ends up about in the middle of
the screen now. This doesn't really matter as it is, but it should
help some with lower resolutions.
2016-01-03 18:19:20 -05:00
onpon4 a2cb637507 Added in my copyright notice to the title screen. 2016-01-03 18:00:22 -05:00
onpon4 ac7a524588 Fixed wrong event index in the Jupiter mission. 2016-01-03 17:18:24 -05:00
onpon4 6af4e67874 Added back in the annoying ships for Urusor in Classic difficulty. 2016-01-03 16:41: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 5400ce6205 Fixed displaying blank messages with non-message events.
Honestly, I don't get why the special string "@none@" was chosen
for non-message events to begin with, so I've changed it to an
empty string.
2016-01-03 15:59:17 -05:00
onpon4 7677aa24f1 Reduced the amount of extra money classic difficulty gives. 2016-01-03 15:54:26 -05:00
onpon4 02d0263f56 Renamed "original" difficulty to "classic" difficulty.
This name is better since the difficulty isn't actually *exactly*
like the original; it's just trying to be as similar to the classic
experience as possible.
2016-01-03 15:03:30 -05:00
onpon4 e5e7d6b9c4 Some cleanup. 2016-01-03 14:31:39 -05:00
onpon4 16473a715f Moved alien definitions from ".dat" files to alien.cpp.
Like "scripts", these definitions in text files make absolutely no
sense. They are completely unreadable, and Starfighter's engine is
inflexible anyway.
2016-01-03 14:14:31 -05:00
onpon4 e258921987 Moved all "script" files to C code.
I'm going to do this for all of the stuff in the "data" directory.
It was obviously an attempt to make Starfighter more flexible
somehow, but it fails at that entirely. More importantly, these
things are both unreadable and easy to make mistakes on. Simple
C code is much easier to read.

The only disadvantage is that recompiling is now needed to change
the "scripts", but considering that they had hidden limits and
no one was making custom missions to begin with, I don't consider
this to be a real loss.
2016-01-02 22:37:44 -05:00
onpon4 d911426c06 More cleanup. 2016-01-02 17:37:19 -05:00
onpon4 85de61e2cd Changed struct definitions to use typedef (C style) 2016-01-02 17:15:50 -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 1d02b3c71e More cleanup. 2015-11-20 14:11:12 -05:00
onpon4 17b5f60958 More cleanup. Also rewrote the method of frame delaying a bit.
I rewrote the method because what it was doing was so confusing, I
couldn't figure out whether it actually worked right or not. I think
it did, and it's only 2/3 of a milllisecond anyway (not noticeable
at all), but this new way of writing it is much clearer.
2015-11-06 21:35:07 -05:00
onpon4 7694d668ff More cleanup. 2015-11-06 19:43:34 -05:00
onpon4 4bdf871e66 drawString -> screen_renderString 2015-11-06 19:36:20 -05:00
onpon4 67d464433d Removed the second "drawString" function.
It wasn't very useful. All it did was offer the option to center
text and take away the option to wrap text. I've moved the text
centering option to gfx_renderString and replaced all uses of this
function with that function.
2015-11-06 10:12:57 -05:00
onpon4 7c67112a8b Some more cleanup. 2015-11-03 20:26:56 -05:00
onpon4 cce6d11510 More cleanup. 2015-11-02 17:53:05 -05:00
onpon4 9e6ff10c57 More cleanup. 2015-10-26 20:07:31 -04:00
onpon4 134a52e5f0 Some more cleanup. 2015-10-11 12:04:52 -04:00
onpon4 c68cb3f920 More cleanup. 2015-09-26 08:49:21 -04:00
onpon4 0f10c6d5c7 Converted the three "collision" functions to four differently-named ones.
The fourth is simply a duplicate of ship_collision for bullets. A
bit redundant, but I figure it's clearer of a definition. Besides,
this opens up the door to possibly making bullets a different struct
type in the future, if that turns out to be desirable.
2015-09-25 16:28:09 -04:00
onpon4 8375c36433 Added a patch by Guus Sliepen fixing mouse cursor position. 2015-07-05 00:31:36 -04:00
onpon4 9a211d773c More reorganization. 2015-06-20 11:59:09 -04:00
onpon4 1c833b1818 More reorganization.
Added colors.cpp and colors.h to contain some of the stuff in
graphics.
2015-06-20 11:31:41 -04:00
onpon4 3850f8e946 Removed "asteroid collision damage" message. 2015-06-16 10:36:42 -04:00
onpon4 e95f55565c Improvements to text display.
Starfighter uses an absurdly crude method for wrapping text which
basically fails very frequently when large words are chosen. The only
reason it got away with it is because text strings don't vary. Well,
I've been quite annoyed by having to test for this and rework my
text so much, so I've added in a secondary system: if it's really
close to the edge, and the next three characters are going to be
letters, it adds a hyphen and moves on to the next line. This still
isn't 100% fool-proof, but it should catch most problems.

Also removed the "temp fix" which shifted the letters by a pixel in
code, and just shifted them in the actual image. I don't understand
why the "temp fix" was there in the first place, to be honest.
2015-06-15 23:56:20 -04:00
onpon4 6fa0321d31 Edited dialog.
Mainly to better match Chris's new portrait.
2015-06-11 12:51:57 -04:00
onpon4 30ace4d67b Returned the obscene power of the original charger to origial difficulty.
Also made some tweaks to the code that displays the charge shots
to make it look a little better.
2015-06-09 01:06:26 -04:00
onpon4 5964066969 Sell for only half price in original difficulty. 2015-06-07 22:51:16 -04:00
onpon4 9be21cbd3a Made it possible to hit the Uranus boss via its wings.
The idea is clearly supposed to be breaking the boss in two and then
destroying the halves, so it makes no sense for the wings you break
off to also act as shields, which they did. Pretty much all this did
was cause a lot of shots to be wasted.
2015-06-02 12:43:06 -04:00
onpon4 51ae0dc659 Made *all* enemies face forward in Ellesh mission.
I don't really understand why this code was implemented only for the
boss and not for anyone else. My only guess is it was designed to make
the level harder by letting enemies fire backwards while you can't,
but mine-droppers can already effectively do that.

The primary reason I decided to make sure they all face forward is I
was finding it to be nearly impossible to get through this level in
Nightmare difficulty; those ships being able to shoot backwards is
a HUGE advantage, because it's almost impossible to position yourself
in an area that's safe.

It may be that the unfair previous behavior was put in to compensate
for the AI's frankly asinine movement pattern. The random movement is
fine most places, but here, it's blatantly obvious that it's random,
and the enemy ships pay a steep price for it. What the ships should
be doing is positioning themselves so that they end up shooting or
dropping mines at the player. But the boss itself also has such a
positioning problem anyway; that should be properly fixed in the
future, so I might as well do the same for the smaller ships when
that time comes.
2015-06-01 20:09:33 -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 e4664b9b1a Revert "Removed the game's automatic pausing when window focus is lost."
This reverts commit d4ff9213b5.
2015-05-21 18:30:23 -04:00
onpon4 46a80eb30b More reorganization. 2015-05-20 19:49:37 -04:00
onpon4 f306825636 Removed the "nomove" and "nofire" cheats.
I honestly don't understand why these cheats were here. Preventing
enemies from moving breaks some missions and doesn't do anything
useful, and preventing enemies from firing is basically no better
than the invincibility cheat (and might even be worse, if it applies
to Sid; I didn't check).
2015-05-20 19:41:43 -04:00
onpon4 3559106ff5 Allow skipping the credits with the fire and alt fire buttons. 2015-05-20 10:53:10 -04:00
onpon4 d4ff9213b5 Removed the game's automatic pausing when window focus is lost.
This feature is just annoying if for some reason you want to leave
the game to do something else while you wait for something. That
would normally be a defect, but I can't count the number of times
I've been rushing through to get to a particular area, using cheats,
and had to wait for some mission condition, and this is only made
worse by not being able to do some other work while I wait for it.
2015-05-20 10:43:04 -04:00
onpon4 1c42d07906 Made the ammo cheat work on the laser and charge cannon.
The laser never overheats with infinite ammo, and the charge cannon
fires at full blast immediately.
2015-05-20 10:39:30 -04:00
onpon4 8698125f5f In original difficulty, no moving the camera on autoscrolling missions. 2015-05-20 10:27:21 -04:00
onpon4 87685a69de Doubled the amount of money pickups give you in "original" difficulty.
This is to compensate for the loss of the money bonus that used to
be there, to make the money you get more or less the same as in
version 1.2.
2015-05-01 20:04:51 -04:00
onpon4 98a74e0d44 More code cleanup. 2015-04-30 18:51:26 -04:00
onpon4 a806de8513 Fixed failure to redden ships.
This long-standing bug was caused by using blending when trying to
copy an image, though for some reason it was inconsistent. Thanks to
everyone on the SDL mailing list for helping me solve this one!
2015-04-29 21:24:01 -04:00
onpon4 425d3a385b Some cleanup. 2015-04-26 22:38:45 -04:00
onpon4 bca1c618f0 Minor fix 2015-04-26 18:49:18 -04:00
onpon4 6ede2722a0 Pause music when pausing the game. (Untested.) 2015-04-26 07:45:58 -04:00
onpon4 60968c7b0e Some more touch-ups. 2015-04-26 07:37:30 -04:00
onpon4 95d31b8039 Removed now empty debris.cpp and debris.h. 2015-04-24 22:45:50 -04:00
onpon4 75990d42f8 Moved stuff in comms.cpp to intermission.cpp as static functions. 2015-04-24 22:40:50 -04:00
onpon4 59a15eb6f3 Removed the shock damage messages, fixed a mistake. 2015-04-24 16:37:55 -04:00
onpon4 5982fcc0d8 Some reorganization. 2015-04-24 16:27:07 -04:00
onpon4 c002b97d96 Added some fake difficulty to the Dorim level.
The way it was previously, you always knew exactly where the WEAPCO
scientist was. I don't remember if this was the case in the original
game (I don't think it was), but regardless, this makes the mission
seem incredibly short and easy, and it ends up centering on the
secondary objective rather than the primary objective. Now, you have
to search through all the asteroids until you find the right one,
and you have to pay close attention to explosions. Collecting ore is
just something you do along the way.

It may be fake difficulty, but after all, tropes are not bad.
2015-04-14 18:55:15 -04:00
onpon4 fdd780ca0f Fixed a duplicate variable.
The only effect I noticed was creating asteroid explosions in the
wrong places, but it could be that it had far more disasterous results.
2015-04-14 18:50:07 -04:00
onpon4 dd6723ffc2 Fixed division by 0 error 2015-04-14 17:15:06 -04:00
onpon4 96fb688601 Changed player's plasma weapon to spread by default. 2015-04-08 20:58:21 -04:00
onpon4 ae15b66e60 Fixed shop bug which caused loss of super charge. 2015-04-08 20:33:53 -04:00
onpon4 5a1954dd24 Revert "Implemented an old super charge bug as a feature in "original" difficulty."
This reverts commit 84978b6c6b.
2015-04-08 20:26:59 -04:00
onpon4 84978b6c6b Implemented an old super charge bug as a feature in "original" difficulty.
The bug in question caused the super charge to be stripped away when
you collected powerups; each powerup would limit that aspect of your
weapon to its maximum. This put a limit on how long you could keep the
super charge, so I've added it back in for "original" difficulty.
2015-04-08 20:09:43 -04:00
onpon4 c0f3310376 Changed plasma spread to the original version.
I don't know why it was changed, but the changed version caused
full spread rather than partial spread with the triple shot, and it
also caused the quaduple shot to be arguably worse than the triple
shot.
2015-04-07 21:14:30 -04:00
onpon4 e5ed96e1c6 More cleanup. 2015-04-07 19:16:46 -04:00
onpon4 4775b3fad4 Some code cleanup. 2015-04-07 16:09:17 -04:00
onpon4 fe96584d7f Added Y as a possible fire button (for QWERTZ layout users) 2015-04-07 15:19:14 -04:00
onpon4 3346af8299 Proper fix. 2015-04-05 17:26:37 -04:00
onpon4 970a6fda7f Fixed a formatting mistake. 2015-04-05 16:21:04 -04:00
onpon4 0e1cd4b86f Changed timeTaken from int to long int.
This guarantees that it will be able to store at least about 68 years.
2015-03-31 15:23:17 -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 08260b1d6c Minor changes 2015-03-30 07:52:44 -04:00
onpon4 826b3dfe5c Fixed controls being stuck, but still on, at the end of Venus.
Now the controls are cleared, so the intended effect always happens.
2015-03-29 16:49:33 -04:00
onpon4 0a08df38f0 Removed some odd limits on what certain aliens could drop. 2015-03-29 15:36:25 -04:00
onpon4 9f7809de1c Made the mines in Mars more sparse and numerous.
There. Together with spreading out the asteroids, this has the effect
of getting rid of the sort of boxed-in feel this mission originally
had, and preventing the mission from being beaten simply by going
up or down forever.
2015-03-29 14:27:29 -04:00
onpon4 f9da05655d In the Mars mission, create asteroids more sparsely. 2015-03-29 14:18:19 -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 b00bf9d7b2 Fixed an infinite loop. 2015-03-29 08:58:03 -04:00
onpon4 139fe8bd9e Some small tweaks/fixes. 2015-03-28 22:33:11 -04:00
onpon4 4a72111a46 Adjusted shop prices.
I noticed that in "original" difficulty, plasma upgrades are basically
prohibitively expensive, which is not at all like the original. To
fix this, I've given that difficulty the original prices for those.
I've also slightly reduced the normal cost of permanent upgrades.
2015-03-28 19:52:03 -04:00
onpon4 388ffcc9c5 Fixed shield bonus being unavailable in Original difficulty. 2015-03-28 16:50:20 -04:00
onpon4 6dd3ac1919 More added to "original" difficulty.
In particular:
* The charge cannon in that difficulty now behaves as originally.
* Cash is now rare, not nonexistent, on interceptions in that difficulty.
2015-03-28 13:59:33 -04:00
onpon4 5155a8ac68 Fixed spacing/indent problems. 2015-03-28 13:18:37 -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 7e69ee79ad Replaced the Sourceforge link in various places with a Savannah link. 2015-03-26 22:25:12 -04:00
onpon4 af11caac2b Changed the "counter" variables to the proper type (Uint32). 2015-03-24 18:55:09 -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 b28effb17d Tweaked handling of powerups.
Now, rather than powerups being replaced with ammo, their collection
effect has been changed from "make the plasma ammo at least 50" to
"add the powerup's amount to the plasma ammo" (i.e. powerups are also
treated as plasma ammo). This left the initial ammo of a powerup a
little low, so to compensate, I increased the collectValue of the
transport ship from 30 to 40.

Additionally, transport ships now show up in interceptions again,
but powerups, when collected, do *not* increase ammo. If you have
no ammo at the time, the powerup does nothing. If this happens with
the Super Charge, you get a humorous message.
2015-03-23 21:33:15 -04:00
onpon4 6ea311a046 Small tweaks 2015-03-20 13:05:14 -04:00
onpon4 4d8ceec9c4 Small tweak. 2015-03-17 22:09:00 -04:00
onpon4 f124b71310 Substantially increased the chance of the experimental fighter appearing.
It previosly spawned half of the time. Now it spawns 4/5 of the time.
This makes waiting for it to show up so you can fight it a lot less
painful, even if it doesn't make a whole lot of sense.
2015-03-17 22:04:58 -04:00
onpon4 ec7fb908a3 Fixed failure to sell double rockets when buying another special. 2015-03-17 19:20:04 -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 6610cddeac Fixed some problems with the charge cannon.
Specifically:
- When an enemy is hit, its damage is reduced, not its lifetime.
- When the shot's lifetime ends, it no longer explodes.
2015-03-17 13:03:20 -04:00
onpon4 717d56755c Moved fireRay to the ship module.
Also removed a really bad convention where a variable called "anEnemy"
was used, rather than just "aliens[i]".
2015-03-17 10:34:29 -04:00
onpon4 f58e15615b Changed "DAMAGEOWNER" flag to work when damaged, rather than destroyed.
This change in behavior has some very significant effects:

1. Damaging a child alien isn't rendered meaningless if you are
   primarily attacking the owner. This could be especially annoying
   with the miner bosses, which have tiny parts that are completely
   impractical to aim at.
2. Again, for the miner boss: previously, you couldn't see how much
   total health the ship had; the health bar only uselessly showed
   whether or not you defeated half of the ship (which you could
   already tell by looking at it). Now, the health bar tells you
   how much more damage you have to do in total.
2015-03-14 21:06:37 -04:00
onpon4 b44037f05a Fixed cash being made available on interceptions in Nightmare mode. 2015-03-13 19:11:14 -04:00
onpon4 645513cbf9 Loop the death music. 2015-03-13 19:02:28 -04:00
onpon4 2a0234c300 Added ship module, moved fireBullet to it (as ship_fireBullet).
For functions that are used by both aliens and the player.
2015-03-13 10:10:58 -04:00
onpon4 8842d7775b Removed the code that prevented transports from spawning based on player state.
Since it now gives you money if you're not able to power up, there's
no point in preventing it from spawning when you can't power up.
2015-03-12 23:12:21 -04:00
onpon4 6f768c88a6 Added some starting money for nightmare difficulty.
As a result, you're not stuck with the weakest weapon in the game
anymore. You have to choose between the double rockets, plasma
permanently upgraded in one area, plasma temporarily upgraded in
some areas, or some combination.
2015-03-12 22:14:07 -04:00
onpon4 932341f0e6 Better method of finding the user home directory. 2015-03-12 12:38:17 -04:00
onpon4 ea33be4591 Removed the "LINUX" definition.
This is silly. The libraries used have absolutely nothing to do with
"Linux". They're POSIX standard libraries, and will work just as
well on Mac OS X and BSD. The actual code might need to be replaced,
but in any case, this isn't something to limit to "Linux" systems.
2015-03-12 11:41:23 -04:00
onpon4 1834011314 Organization stuff 2015-03-11 15:36:42 -04:00
onpon4 199ee7a58b Changed horizontal location bullets are spawned.
The previous method was inconsistent between the left and right
directions; it placed the left edge of the bullet on the left edge of
the ship when going to the right, and in the center of the ship when
going left. This was barely noticeable with small ships, but more
noticeable with large ships. The method also sometimes made the backs
of bullets visible behind the smaller ships, which looked kind of
ugly.

Now, the back edge of the bullet is consistently placed in the center
of the ship.
2015-03-11 15:11:06 -04:00
onpon4 1c73a37c8e aliens.{cpp|h} -> alien.{cpp|h} 2015-03-09 19:32:03 -04:00
onpon4 d08da08f85 Moved alien_destroy to aliens module. 2015-03-09 09:36:24 -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 982d39278c Removed the dialog from the start of mission 26.
I feel it's unnecessary, and it can be an annoying wait if you're
struggling with Kline.
2015-03-08 17:56:38 -04:00
onpon4 912ff8b86c Modified script for mission 11 to better match the music. 2015-03-08 16:19:41 -04:00
onpon4 28cc1fcc6d Updated audio module. 2015-03-08 10:38:58 -04:00
onpon4 f54579a41f Reverted amount of stuff cloak fighter drops. 2015-03-07 22:41:15 -05:00
onpon4 da35b44179 Brought Kline's health in the final battle back down.
The increase worked well in mission 25, but not so much in mission
26.
2015-03-07 17:13:37 -05:00
onpon4 4b3cb9c1d3 Fixed some problems. 2015-03-07 15:34:47 -05:00
onpon4 0baa48e7ef Don't try to home in on immortal enemies.
It's annoying when this happens. There's no point in attacking an
immortal enemy.
2015-03-07 12:34:07 -05:00
onpon4 22fcdae8cc Several adjustments for difficulty purposes.
Started out adjusting prices, then ended up doing other things
while testing. Committing this now before I start doing other
random stuff!

But all of the changes are related to balancing difficulty, mostly
with prices, except for a couple bugfixes in the shop. Most notably:

* Ammo now costs $10, not $50. You no longer have to worry about
  saving ammo quite as much as a result.
* Plasma upgrades' cost is now calculated differently, and the result
  is slightly lower prices than before.
* Easy mode now grants the player more max ammo than other difficulties.
* Increasing max plasma ammo now costs less at the start, and increases
  in cost faster.
* You increase max plasma ammo by 25 at a time, not 10. (10 was just too
  small of a number.)
* Destroying enemy ships no longer gives you money. I found that, even
  in hard mode, I had *way* too much money coming in, and this cuts it
  down substantially. It also makes the shield bonus at the end of missions
  much more significant. To compensate for the loss of massive bonuses
  bosses used to give, these bosses now drop a lot more stuff.
* Kline has decreased health in his first encounter, and increased health
  in his last two encounters (the numbers have been reversed).
2015-03-07 12:19:35 -05: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 9974848ce8 Moved some things. 2015-03-06 23:18:31 -05:00
onpon4 37befa8d3c Automatically sell things that are removed when buying new things.
Previously, when you bought something that took the place of something
you already had, such as buying a new secondary weapon, the old one
was just discarded. Now, it is sold, so you get money back for it
(the same as if you had manually sold everything).
2015-03-06 19:51:25 -05:00