Commit Graph

12 Commits

Author SHA1 Message Date
onpon4 4775b3fad4 Some code cleanup. 2015-04-07 16:09:17 -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 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 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 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