Compare commits

...

131 Commits
v2.3.1 ... main

Author SHA1 Message Date
diligentcircle d564db380d Corrected the version 2.0 version number. 2022-08-14 13:59:54 -04:00
The Diligent Circle 丸 fae576e731
Merge pull request #33 from Mailaender/appdata
More fixes and additions towards the AppStream metadata
2022-08-14 02:29:38 -04:00
Matthias Mailänder 1fd8f14499 Add more URLs. 2022-08-13 15:03:37 +02:00
Matthias Mailänder 1d949ec051 Fix metadata license 2022-08-13 15:03:06 +02:00
Matthias Mailänder 4ea587dd61 Add releases 2022-08-13 15:02:29 +02:00
The Diligent Circle 丸 7749a795e7
Merge pull request #32 from Mailaender/patch-1
Removed invalid stock icon from AppData
2022-08-08 11:52:19 -04:00
Matthias Mailänder 28c4ba82f2
Remove invalid stock icon 2022-08-08 10:32:30 +02:00
diligentcircle 186555d8c8 Following recommentations, change pr-starfighter to pr_starfighter for ID. 2022-06-28 22:39:44 -04:00
diligentcircle 8f4013e828 Fixed one of the translations having too many numbers. 2022-02-25 04:05:41 -05:00
diligentcircle eb0bdc13cf New, more accurate RDNS name. 2021-11-24 21:43:12 -05:00
diligentcircle 3c3cbae720 Missed a part of that correction. 2021-11-24 19:00:55 -05:00
diligentcircle 5ad618da90 Fixed naming of files. 2021-11-24 18:58:51 -05:00
diligentcircle 413cc0c6a8 Adjusted instrument balance of Android's Last Dance, added some percussion.
The quiet part at the end was nearly inaudible in the game, making
it sound like silence even though it wasn't. Insertion of a little
light percussion in that section should avoid this. Also adjusted
audio levels of the instruments so that they're better balanced, and
actually committing the changed mmpz file (I forgot to do so last
time).
2021-09-18 03:24:47 -04:00
diligentcircle b2053e3959 Updated all translation files.
Note: translations for "Super-Easy" have been set as a fuzzy
translation for "Assisted".
2021-09-18 00:19:52 -04:00
diligentcircle 247d2c7bfe Added a lighter version of the cargo ship buff to other difficulties.
Assisted difficulty multiplies the shield of the cargo ships in
Urusor by 4 so that stray shots are less likely to destroy them.
I've added a lesser version of this buff for these ships specifically
(rather than all friendly ships) on other difficulties: shield is
multiplied by 3. This is just enough to survive a stray missile, a
little stray laser fire, or a little stray plasma fire without being
destroyed (but sustained or direct fire will still destroy the ship).

Of course, this is not applied to Classic difficulty. It is also
excluded from Hard and Nightmare difficulties.
2021-09-17 23:01:19 -04:00
diligentcircle e6f679c4e2 Simplified a few statements by making them depend on easy > assisted.
Minor internal change.
2021-09-17 22:22:39 -04:00
diligentcircle 5842ff98d8 Renamed Super-Easy difficulty to Assisted difficulty.
"Super-Easy" isn't a particularly problematic name, but "Assisted"
is more descriptive of what the difficulty mode is for (to assist
players who have trouble playing on easy mode).
2021-09-17 22:07:37 -04:00
diligentcircle 5ee90df2f3 Added a new paradigm for how Kline works.
For difficulties above Easy difficulty which are not Classic difficulty,
Kline's run shield now changes depending on whether or not other
WEAPCO ships are still alive. If he's alone, the previous 100 shield
threshold was used. If any of the other ships are alive, though, he
only runs if he takes 500 damage (the same amount that you have to
inflict the first time you see him). The result of this is that he
doesn't run away real early in the battle (100 shield is so low that
you can easily make him run away with a quick laser shot); you have
to either fight real hard, or more realistically, defeat all the other
enemies first, making him feel like an actual threat rather than a
gimmick.

This is of course is excluded from Classic difficulty, and it's also
excluded from Easy and Super Easy difficulty.
2021-09-17 21:57:15 -04:00
diligentcircle 7b594c9fa7 Re-exported Last Cyber Dance to make it 50% quieter.
I noticed that this track sounded… distorted, and much louder than
the rest of the soundtrack. Re-exported to fix that.
2021-09-17 20:23:29 -04:00
diligentcircle 48f01e4d7f Substantially modified Android's Last Dance.
This makes Android's Last Dance much longer and more dynamic, with
an instrument added to improve the variety of sound in the track.
2021-09-17 03:30:05 -04:00
diligentcircle 87fea0b2e0 Added a feature to force slave ships and cloak fighters to appear.
This causes these mission targets to always appear the first time
the player enters an interception, and every time after they fail
to appear (so that you never have two time-wasting interceptions in
a row). In the case of the rescue slaves mission, this takes the
form of forcing the first ship to be a slave ship, and in the case
of the cloak fighter, it simply forces the cloak fighter to appear.
In each case, the variable controlling whether or not the condition
is forced gets set to 0 if the mission target spawned, ensuring that
time-waster interceptions can still occur as long as they both are
preceded and followed by worthwhile interceptions.

I decided this was important when I was playing and noticed that I
wasn't getting slaves to rescue several times in a row. This
situation would be confusing to new players and possibly make them
think they were doing something wrong. It can also be very annoying
to just not get any chances to make progress because of bad RNG.
Forcing them to appear the first time allows the player to be
immediately introduced to the targets, and forcing them to appear if
they didn't last time limits the frustration of bad RNG by ensuring
that even with the worst RNG, some amount of progress can be made.
2021-09-16 02:16:00 -04:00
diligentcircle 36e6853fe1 Merge branch 'main' of github.com:pr-starfighter/starfighter 2021-08-20 17:49:11 -04:00
diligentcircle 344c5d3c82 Improved the CHANCE implementation a bit.
This makes the implementation more uniform (avoiding skew caused
by %).
2021-08-20 17:48:18 -04:00
The Diligent Circle 丸 c4decfc8b2
Merge pull request #28 from jorgesumle/main
Add Spanish translation
2021-08-20 16:29:25 -04:00
The Diligent Circle 丸 fd71294a2b
Merge pull request #31 from jorgesumle/esperanto2
Fix error from Esperanto translation
2021-08-20 16:27:33 -04:00
Jorge Maldonado Ventura b3d8ee0717 Fix error from Esperanto translation 2021-08-20 17:12:05 +02:00
Jorge Maldonado Ventura 1bd704d136 Finish Spanish translation 2021-08-20 17:02:08 +02:00
The Diligent Circle 丸 5e65e8c7a8
Merge pull request #30 from jorgesumle/esperanto
Update intermission.c
2021-08-15 03:25:04 -04:00
Jorge Maldonado Ventura 4c5b72ba32
Update intermission.c
Comma after dependent clause
2021-08-13 10:54:17 +02:00
Jorge Maldonado Ventura 756a2ed4cb Spanish translation: Translated 425 of 514 (82%) 2021-08-12 20:22:43 +02:00
The Diligent Circle 丸 ac8f5b32e4
Merge pull request #29 from jorgesumle/esperanto
Fix error from Esperanto translation
2021-08-10 11:32:24 -04:00
Jorge Maldonado Ventura c77abd6431 Fix error from Esperanto translation 2021-08-10 11:14:13 +02:00
Jorge Maldonado Ventura bddb178ce5 Spanish translation: Translated 357 of 514 (69%) 2021-08-05 19:43:02 +02:00
Layla Marchant bc4a022db8
Added a new death theme: Sleeping With Androids.
This also removes RE.ogg and reremix.ogg as they are no longer needed.
2021-07-26 16:37:32 -04:00
Layla Marchant 0d325f0726
Re-exported Last Cyber Dance to fix the sound artifact at the start. 2021-07-26 01:45:14 -04:00
Layla Marchant ab26edddec
Removed the whole volume compensation thing since it caused bugs.
Also adjusted Android Oppression to match the volumes of the other
tracks.
2021-07-26 00:38:34 -04:00
Layla Marchant d806f05a16
Fixed noise in Android's Last Dance export.
There's a bug in LMMS with Zyn if the start of the track plays
sound (or at least Zyn sounds). Re-exported with a bit of a hack to
fix the problem.
2021-07-25 23:44:46 -04:00
Layla Marchant e480841bec
Make use of Android's Last Dance. 2021-07-25 17:24:28 -04:00
Layla Marchant 8d8f096736
Added Android's Last Dance. 2021-07-25 16:50:50 -04:00
Jorge Maldonado Ventura 0a64b46722 Spanish translation: Translated 309 of 514 (60%) 2021-07-18 15:37:18 +02:00
Jorge Maldonado Ventura 472261de07 Spanish translation: Translated 238 of 514 (46%) 2021-06-25 17:08:38 +02:00
Jorge Maldonado Ventura 89c1fac443 Add Spanish translation 2021-06-19 15:01:55 +02:00
Layla Marchant bab012e310
Merge branch 'main' of github.com:pr-starfighter/starfighter into main 2021-04-28 15:40:11 -04:00
Layla Marchant 3d0e36916d
Added a new original Project: Starfighter theme: Android Oppression
This is a new theme for Starfighter! This version represents mystery
and the ominous presence of WEAPCO. Other versions will be used for
other situations, and a sort of combination between this and Last
Cyber Dance will serve as the music for the final Kline battle. That's
the theory anyway.
2021-04-28 15:30:01 -04:00
The Diligent Circle 丸 5d654873b1
Merge pull request #27 from jorgesumle/main
Finish Esperanto translation
2021-04-16 11:54:05 -04:00
Jorge Maldonado Ventura 3642c86eaa Finish Esperanto translation 2021-04-16 17:13:01 +02:00
Jorge Maldonado Ventura 76dee3a49a Translated 493 of 514 (95%) 2021-04-11 12:26:43 +02:00
Jorge Maldonado Ventura f7e90253f5 Translated 482 of 514 (93%) 2021-04-10 11:26:10 +02:00
Layla Marchant 50355b9489
Added First Cyber Dance as a requirement 2021-04-03 23:50:41 -04:00
The Diligent Circle 丸 40033c95f2
Merge pull request #26 from jorgesumle/main
90% Update Esperanto translation
2021-04-03 20:07:23 -04:00
Layla Marchant d53764dc13
Added music sources as EXTRA_DIST. 2021-04-03 20:05:43 -04:00
Layla Marchant 5eadb91594
Fixed First Cyber Dance. 2021-04-03 20:01:27 -04:00
Layla Marchant 51cd7d9f1e
Added First Cyber Dance. 2021-04-03 18:50:46 -04:00
Layla Marchant 82ffaebbc5
Added use of special music when Kline or the cloak fighter shows up. 2021-04-03 12:13:44 -04:00
Jorge Maldonado Ventura 840c2249d5 Translated 476 of 514 (90%) 2021-04-03 17:18:52 +02:00
Layla Marchant a9e98145fa
Sorted music so that certain missions play certain music. 2021-04-03 11:17:04 -04:00
Layla Marchant 50989a83e7
Further adjusted amplification difference, fixed makefile problems. 2021-04-02 00:15:29 -04:00
Layla Marchant 8241e13d77
Replaced death music with a simple remix of RE.
This is meant to help connect RE to something. I figured that by
using a similar kind of music for both it and the game over screen,
it would create a bit of a connection there and musically communicate
that it's game over, except for Kline instead of you.
2021-04-02 00:08:55 -04:00
Jorge Maldonado Ventura 551e0c2f72 Translated 437 of 514 (85%) 2021-04-01 13:15:35 +02:00
Jorge Maldonado Ventura f6108d3957 Translated 411 of 514 (79%) 2021-04-01 11:53:50 +02:00
Layla Marchant 1116a1a4d3
Merge branch 'main' of github.com:pr-starfighter/starfighter into main 2021-03-19 16:07:54 -04:00
Layla Marchant d73fe2c22e
Removed attempts to colorize echos.
It caused errors. Not sure why, but I don't think it's worth
investigating.
2021-03-19 16:07:25 -04:00
The Diligent Circle 丸 a13ef7374e
Merge pull request #25 from jorgesumle/main
WIP: Add Esperanto translation
2021-02-27 17:27:59 -05:00
Jorge Maldonado Ventura a3243ad3a3 Translated 393 of 514 (76%) 2021-02-01 21:38:03 +01:00
Jorge Maldonado Ventura b4d70611be Translated 354 of 514 (68%) 2021-01-31 18:33:35 +01:00
Jorge Maldonado Ventura 2ad7dcbddb Translated 314 of 514 (61%) 2021-01-31 13:46:56 +01:00
Layla Marchant e993034e63
Made the buttons in the save screen left-aligned.
The center-alignment was based on absolute positions that assumed
English text and therefore could not be maintained for other languages.
2021-01-29 10:14:21 -05:00
Jorge Maldonado Ventura ae66d76d54 Translated 253 of 514 (49%) 2021-01-28 22:02:56 +01:00
Jorge Maldonado Ventura 07f13a02be translated 216 of 514 (42%) 2021-01-22 13:10:15 +01:00
Jorge Maldonado Ventura 9c71933d5f Some progress on the translation 2021-01-21 21:09:38 +01:00
Layla Marchant ebb76a1cd5
Made the warnings about missing libraries easier to see. 2021-01-21 14:26:01 -05:00
Jorge Maldonado Ventura 71461ddd5a Use the default font again 2021-01-21 19:48:25 +01:00
Jorge Maldonado Ventura 0ef537f03c Use Dosis font (https://fontlibrary.org/en/font/dosis) 2021-01-21 18:59:13 +01:00
Jorge Maldonado Ventura 6dbe3d86a9 Add Esperanto translation (not completed yet) 2021-01-21 17:01:48 +01:00
Layla Marchant e79563ecb4
Cleaned up and expanded appdata 2020-12-29 11:56:26 -05:00
Layla Marchant f6be38a5d8
Typo 2020-12-29 11:38:21 -05:00
Layla Marchant 5e6b23b46c
Changed the profanity definition to "moderate".
Characters say "damn" quite a lot.
2020-12-29 11:34:14 -05:00
The Diligent Circle 丸 cbc29c0bb8
Merge pull request #24 from Mailaender/appdata
Added AppStream metadata
2020-12-29 11:32:57 -05:00
Matthias Mailänder 59a56a1b9a Add project metadata. 2020-12-29 15:39:59 +01:00
Layla Marchant 958574490d
Added Dutch to the list of distributed language files. 2020-12-26 18:21:19 -05:00
Layla Marchant 7e8ec72933
Added SF_UNHARDEN option for Windows builds.
The linker supplied by MXE currently doesn't support the -x option, so this
adds a way to skip that and uses that in win32build.sh.
2020-12-26 18:05:10 -05:00
Layla Marchant bc3513e5d9
Added starfighter.sh script (for use in distribution). 2020-12-26 17:34:53 -05:00
Layla Marchant bb5f1eae92
Bumped version number 2020-12-26 17:09:18 -05:00
Layla Marchant b3252b3ea7
Corrected damage for micro rockets and spread plasma for Classic difficulty 2020-12-26 14:30:40 -05:00
Layla Marchant 69430b7a2a
Added an option to compile a binary that will use the original music.
We can't distribute the original music, but adding support for it in
as a compile-time option will enable modding the game to look and
feel like the original without having to edit the source code.
2020-12-26 13:33:15 -05:00
Layla Marchant 5b29033700
Changed our credits to "The Diligent Circle". 2020-12-26 00:10:10 -05:00
Layla Marchant 135a64e178
Reposition stars on resize 2020-12-26 00:07:51 -05:00
Layla Marchant 46ffc40592
Made Kline Venus starting position relative to screen size 2020-12-25 23:47:02 -05:00
Layla Marchant 0112d8074f
Returned Classic difficulty start positions to relative. 2020-12-25 23:43:25 -05:00
Layla Marchant f209058367
Allow switching to Concentrate mode even with Super Charge in Classic 2020-12-25 22:25:40 -05:00
Layla Marchant 6d71317514
Implemented emulation of smaller Kline health bars.
This makes it so that Kline's one health bar is displayed as many
smaller health bars, like the original, for Classic difficulty.
2020-12-25 21:46:58 -05:00
Layla Marchant 8ca1cdc42c
Made it so that the game doesn't go unresponsive, made credits recenter
There was a period of time just after the defeat of Kline that the
game wasn't responding to input, causing the OS to panic. Corrected
this, and also made it so that resizing the window adjusts the
positioning of the credits appropriately.
2020-12-25 20:06:41 -05:00
Layla Marchant 51a1b67841
Made the start of the Venus Kline fight the same as the original in Classic difficulty 2020-12-25 19:40:27 -05:00
Layla Marchant 7734959320
Edited the readme a bit 2020-12-25 19:02:37 -05:00
Layla Marchant 747d0c2af6
Version number to 2.4-alpha, updated POT file. 2020-12-25 14:07:20 -05:00
Layla Marchant a0c0edcacc
Oops! (Very bad typo)
Fixes #23
2020-12-25 13:58:42 -05:00
Layla Marchant b61e5e7a32
Don't remove FL_CIRCLES.
We're now depending on the code not caring that FL_CIRCLES is there.
2020-12-24 15:50:37 -05:00
Layla Marchant 0c24aa45c8
Adjusted the way FL_ESCAPED is added. 2020-12-24 15:47:45 -05:00
Layla Marchant 1625c54ee5
Added a check so that FL_CIRCLES doesn't take effect while leaving sector 2020-12-24 15:40:19 -05:00
Layla Marchant 139940e8b2
Made more smoke come out at critical shield 2020-12-23 21:19:33 -05:00
Layla Marchant be2cc0f1c2
Corrected the starting position of the player for Classic difficulty.
Modern Starfighter starts you in the center, but originally you started
at (200, 200). This matters particularly for boss fights, since since
the off-center start position meant you didn't start in the same vertical
position as the bosses.
2020-12-23 20:38:25 -05:00
Layla Marchant 45470bb68c
Converted the rest of trailing &&. 2020-11-22 23:33:26 -05:00
Layla Marchant 1a3e801271
Reformatted conditionals with trailing || and && 2020-11-22 23:03:38 -05:00
The Diligent Circle 丸 123087e60e
Merge pull request #22 from fmneto/main
Update configure.ac
2020-11-20 16:13:31 -05:00
fmneto 67a612309f
Update configure.ac
This adds hardening options to linking with `-Wl,-z,now`
2020-11-20 13:04:05 -03:00
Layla Marchant c38f8ea16a
Merge branch 'main' of github.com:pr-starfighter/starfighter into main 2020-10-28 10:45:46 -04:00
Layla Marchant 86f6fc597f
Whitespace 2020-10-28 10:45:35 -04:00
The Diligent Circle 丸 5449c7fc3e
Merge pull request #20 from Vistaus/main
Updated Dutch translation
2020-10-26 01:35:44 -04:00
Heimen Stoffels d18b93c661
Updated Dutch translation 2020-10-25 12:10:46 +01:00
Layla Marchant 4cd8b15d8f
Adjusted shop stuff to make better use of space.
This has involved:

* Enlarging the bottom three panels and squeezing them closer together
* Adjusting the way the item description shows
2020-10-24 15:45:07 -04:00
Layla Marchant b9d64bb21c
Removed an unnecessary trailing newline.
Should be harmless since empty strings are ignored in
radio_getRandomMessage, but it's still supposed to be in a form
that uses \n only as necessary; the trailing newline was a mistake.
2020-10-24 14:49:15 -04:00
The Diligent Circle 丸 da3515fae4
Merge pull request #19 from Vistaus/main
Added Dutch translation
2020-10-24 14:31:20 -04:00
Heimen Stoffels 1189e4ea5e
Added Dutch translation 2020-10-24 17:25:08 +02:00
Layla Marchant d129793583
Starfighter 2.3.3 version number bump, slight readme tweak. 2020-09-20 12:14:06 -04:00
Layla Marchant 8c0df9b310
Removed use of wildcards so that Autotools will be happy. 2020-09-15 23:04:17 -04:00
Layla Marchant 0e666b2d20
Fixed some remaining ableism. 2020-09-15 13:13:58 -04:00
Layla Marchant c516cd7bb4
Replaced the SF_NOWARN flag with an SF_WARN flag which does the inverse.
Fixes #18
2020-09-09 03:03:22 -04:00
Layla Marchant 000905e6af
Liberapay 2020-09-07 22:21:36 -04:00
Layla Marchant fc0c8bedc6
Some tweaks to manpage (mostly just an excuse to use git commit -S) 2020-09-05 18:29:16 -04:00
Layla Marchant df066d4ad4 Fixed nongnu.org links. 2020-09-05 18:21:26 -04:00
Layla Marchant d48a35d15c Updated the manfile so that it gets installed and has some info. 2020-09-05 18:17:34 -04:00
Layla Marchant e5666251c3 Added Keywords entry to starfighter.desktop. 2020-08-27 10:20:40 -04:00
Layla Marchant 3e2795a231 Fixed spelling errors. 2020-08-27 10:14:45 -04:00
Layla Marchant b25efb8595 "stupid" -> "foolish" 2020-08-26 12:06:34 -04:00
Layla Marchant 8d136e4cea Merge branch 'main' of github.com:pr-starfighter/starfighter into main 2020-08-04 12:24:33 -04:00
Layla Marchant b547ec5989 Replaced AUDIO_S16 witht AUDIO_S16SYS. 2020-08-04 12:23:54 -04:00
The Diligent Circle 丸 d7406d58d8
Merge pull request #10 from psypherium/main
spelling fix: persuit -> pursuit
2020-07-31 17:13:25 -04:00
Alistair Findlay f6cd2e9300
spelling fix: persuit -> pursuit 2020-08-01 05:50:51 +10:00
Alistair Findlay 8e0ab7d4ed
spelling fix: persuit -> pursuit 2020-08-01 05:50:10 +10:00
Alistair Findlay 7b7966bcf2
spelling fix: persuit -> pursuit 2020-08-01 05:49:28 +10:00
Alistair Findlay 2448a043e1
spelling fix: persuit -> pursuit 2020-08-01 05:48:31 +10:00
90 changed files with 12390 additions and 1698 deletions

2
.github/FUNDING.yml vendored
View File

@ -1 +1,3 @@
github: onpon4
patreon: diligentcircle
liberapay: diligentcircle

View File

@ -598,11 +598,21 @@ Details: Tuned down 5 half-notes.
------------------------------------------------------------------------
music/walking_among_androids.ogg
music/android_oppression.ogg
music/sleeping_with_androids.ogg
Author: Zander Noriega <https://soundcloud.com/zander-noriega>
License: CC BY 3.0 <http://creativecommons.org/licenses/by/3.0/>
Source: http://opengameart.org/content/walking-among-androids-20
Author: The Diligent Circle <https://onpon4.github.io>
License: CC0 <http://creativecommons.org/publicdomain/zero/1.0/>
------------------------------------------------------------------------
music/androids_last_dance.ogg
Author: The Diligent Circle <https://onpon4.github.io>
License: CC0 <http://creativecommons.org/publicdomain/zero/1.0/>
Notes:
Partly inspired by, and using the same instruments as, Last Cyber
Dance, which was composed by neocrey <https://twitter.com/artnocy>.
------------------------------------------------------------------------
@ -666,20 +676,14 @@ Source: http://opengameart.org/content/last-cyber-dance
------------------------------------------------------------------------
music/RE.ogg
music/first_cyber_dance.ogg
Author: WeskerHunter <http://redeclipse.net/forum/viewtopic.php?f=5&t=26>
License: CC BY-SA 3.0 <http://creativecommons.org/licenses/by-sa/3.0/>
Source: http://opengameart.org/content/fast-high-music
Changes: Amplified -1 dB and slowed down 5% with Audacity
------------------------------------------------------------------------
music/death.ogg
Author: Jan125 <http://opengameart.org/users/jan125>
License: CC BY 3.0 <http://creativecommons.org/licenses/by/3.0/>
Source: http://opengameart.org/content/stereotypical-90s-space-shooter-music
Authors:
The Diligent Circle <https://onpon4.github.io>
Sweetpea
License: CC BY 4.0 <https://creativecommons.org/licenses/by/4.0/>
Details:
Remix of Last Cyber Dance. Last Cyber Dance is by neocrey.
------------------------------------------------------------------------

View File

@ -3,20 +3,14 @@
# http://creativecommons.org/publicdomain/zero/1.0/ for more
# information. This file is offered as-is, without any warranty.
SUBDIRS = src misc
SUBDIRS = gfx locale misc music sound src
dist_doc_DATA = README.txt COPYING LICENSES
# WHEN ADDING TRANSLATIONS: Please append all new gettext file names
# here (both the .po file and the .mo file). This insures the
# translation is both distributed and installed properly.
nobase_dist_pkgdata_DATA = data/* gfx/* music/* sound/* \
locale/build.py \
locale/genpot.sh \
locale/pr-starfighter.pot \
locale/en.po \
locale/en/LC_MESSAGES/pr-starfighter.mo \
locale/ja.po \
locale/ja/LC_MESSAGES/pr-starfighter.mo
nobase_dist_pkgdata_DATA = \
data/credits.txt \
data/ipa_font_license.txt \
data/TakaoPGothic.ttf
EXTRA_DIST = autogen.sh win32build.sh misc

View File

@ -24,25 +24,22 @@ compared to the original:
project completed that work by adding music and replacing one
non-libre graphic that got into version 1.2 by mistake.
* There are several gameplay changes. These changes were mostly done to
balance the game better. However, if you want the original experience,
"Classic" difficulty emulates it as closely as possible.
* Much of the dialog has been changed. There are various reasons for
this; some of these include fixing bad writing, making the dialog
match new music queues, and giving the characters more personality.
* In many places, the interface has been considerably improved. As an
example, the simplistic target arrow of the original has been replaced
with a system of several arrows, one for each ship.
* Unicode and gettext translation support have been added.
* There are several gameplay changes. These changes were mostly done to
balance the game better. The original game is contained in the Classic
difficulty option, which is nearly identical to the original
experience. A few small differences (mainly old bugs that were not
left in) do exist, and they are explained on the following page:
https://pr-starfighter.github.io/old.html
* Typing "humansdoitbetter" in the title screen no longer enables
cheats. This is actually because the switch to SDL2 broke the original
feature, and rather than fixing it, I just replaced it with something
else. I'll let you figure out what the new method to access the cheat
menu is. :)
feature, and rather than fixing it, we just replaced it with something
else. We'll let you figure out what the new method to access the cheat
menu is. 😉
------------------------------------------------------------------------
@ -109,6 +106,17 @@ final step (moving the Starfighter binary out from the src directory) is
required; in particular, failure to do so under MacOS leads to a failure
to load data (images, sounds, fonts) needed by Starfighter.
On Linux and most other POSIX systems, you can instead build a run in
place build with the following commands:
./configure SF_RUN_IN_PLACE=1
make
mv misc/starfighter.sh .
For Linux, this method is preferred as the binary itself often cannot be
run by double-clicking, and the starfighter.sh script also automatically
sets the current working directory, making it suitable for launchers.
Run "./configure --help" to see all options for compiling.
------------------------------------------------------------------------

View File

@ -7,7 +7,7 @@
# information. This file is offered as-is, without any warranty.
AC_PREREQ([2.69])
AC_INIT([Project: Starfighter], [2.3.1], [diligentcircle@riseup.net], [starfighter])
AC_INIT([Project: Starfighter], [2.4], [diligentcircle@riseup.net], [starfighter])
AM_INIT_AUTOMAKE([foreign -Wall -Werror])
AC_CONFIG_SRCDIR([src/Starfighter.c])
AC_CONFIG_HEADERS([config.h])
@ -18,7 +18,6 @@ AC_PROG_CC
AC_PROG_INSTALL
STARFIGHTER_CPPFLAGS="-DVERSION=\\\"$PACKAGE_VERSION\\\""
STARFIGHTER_LDADD=""
# Detect MacOS
AC_CANONICAL_HOST
@ -39,7 +38,7 @@ PKG_CHECK_EXISTS([SDL2_mixer], [
], [
PKG_CHECK_MODULES([SDL], [sdl2 SDL2_image SDL2_mixer])
STARFIGHTER_CPPFLAGS="$STARFIGHTER_CPPFLAGS -DNOFONT"
echo "Note: SDL_ttf not found; Unicode will not be supported."
echo "WARNING: SDL_ttf not found; Unicode will not be supported."
])
], [
PKG_CHECK_EXISTS([SDL2_ttf], [
@ -47,27 +46,32 @@ PKG_CHECK_EXISTS([SDL2_mixer], [
], [
PKG_CHECK_MODULES([SDL], [sdl2 SDL2_image])
STARFIGHTER_CPPFLAGS="$STARFIGHTER_CPPFLAGS -DNOFONT"
echo "Note: SDL_ttf not found; Unicode will not be supported."
echo "WARNING: SDL_ttf not found; Unicode will not be supported."
])
STARFIGHTER_CPPFLAGS="$STARFIGHTER_CPPFLAGS -DNOSOUND"
echo "Note: SDL_mixer not found; audio will not be supported."
echo "WARNING: SDL_mixer not found; audio will not be supported."
])
PKG_CHECK_MODULES([PANGO], [pango], [
], [
STARFIGHTER_CPPFLAGS="$STARFIGHTER_CPPFLAGS -DNOFONT"
echo "Note: Pango not found; Unicode will not be supported."
echo "WARNING: Pango not found; Unicode will not be supported."
])
AC_ARG_VAR([SF_NOWARN], [Set to 1 to disable compiler warnings (useful for older GCC versions)])
AC_ARG_VAR([SF_WARN], [Set to 1 to enable compiler warnings])
AC_ARG_VAR([SF_UNHARDEN], [Set to 1 to disable hardening flags (for compatibility)])
AC_ARG_VAR([SF_SCREEN_WIDTH], [The width of the game window in pixels])
AC_ARG_VAR([SF_SCREEN_HEIGHT], [The height of the game window in pixels])
AC_ARG_VAR([SF_NOFONT], [Set to 1 to manually force the compiler not to include font/Unicode support])
AC_ARG_VAR([SF_OLD_MUSIC], [Set to 1 to compile for use with the MOD-based music originally packaged with the game by Parallel Realities (note: you must supply said music if you use this option; all files must have the same name and format as distributed with Project: Starfighter 1.1)])
AC_ARG_VAR([SF_RUN_IN_PLACE], [Set to 1 to compile Starfighter to run in-place (instead of installing)])
AS_IF([test -n "$SF_NOWARN"], [
echo "Disabling compiler warnings"
], [
AS_IF([test -n "$SF_WARN"], [
STARFIGHTER_CPPFLAGS="$STARFIGHTER_CPPFLAGS -Wall -Wformat-truncation=0"
])
AS_IF([test -n "$SF_UNHARDEN"], [
echo "Building without hardening flags"
], [
STARFIGHTER_LDADD="-Wl,-z,now"
])
AS_IF([test -n "$SF_SCREEN_WIDTH"], [
STARFIGHTER_CPPFLAGS="$STARFIGHTER_CPPFLAGS -DSCREEN_WIDTH=$SF_SCREEN_WIDTH"
echo "Using default screen width of $SF_SCREEN_WIDTH"
@ -86,6 +90,11 @@ AS_IF([test -n "$SF_NOFONT"], [
echo "Font/Unicode support manually disabled"
])
AS_IF([test -n "$SF_OLD_MUSIC"], [
STARFIGHTER_CPPFLAGS="$STARFIGHTER_CPPFLAGS -DOLD_MUSIC"
echo "Building for use with old music"
])
AS_IF([test -n "$SF_RUN_IN_PLACE"], [
echo "Preparing a run-in-place build"
])
@ -111,7 +120,11 @@ AC_CHECK_FUNCS([atexit mkdir])
AC_CONFIG_FILES([
Makefile
src/Makefile
gfx/Makefile
locale/Makefile
misc/Makefile
music/Makefile
sound/Makefile
src/Makefile
])
AC_OUTPUT

View File

@ -10,7 +10,7 @@
030 +++ ADDITIONAL PROGRAMMING +++
020 Richard Sweeney
020 Guus Sliepen
020 Layla Marchant
020 The Diligent Circle
050 +++ QUALITY ASSURANCE AND ADVICE +++
030 Sam Lantinga Ian Bissett
020 Chris Taylor Xan Christoph Reichenbach
@ -45,15 +45,14 @@
020 p0ss
020 Berklee
050 +++ MUSIC +++
030 Zander Noriega
020 maxstack
020 Deceased Superior Technician
020 matthew.pablo
020 tgfcoder
020 JunglistMilitia
020 neocrey
020 WeskerHunter
020 Jan125
020 The Diligent Circle
020 Sweetpea
020 Alexandr Zhelanov
050 +++ SPECIAL THANKS +++
030 Wes Whitmore Ceri Done
@ -65,5 +64,5 @@
350 Project: Starfighter
020 Copyright 2003 Parallel Realities
020 Copyright 2012 Guus Sliepen, Astrid S. de Wijn and others
020 Copyright 2015-2020 Layla Marchant
020 Copyright 2015-2020 The Diligent Circle
120 pr-starfighter.github.io

198
gfx/Makefile.am Normal file
View File

@ -0,0 +1,198 @@
# This file has been dedicated to the public domain, to the extent
# possible under applicable law, via CC0. See
# http://creativecommons.org/publicdomain/zero/1.0/ for more
# information. This file is offered as-is, without any warranty.
gfxdir = $(pkgdatadir)/gfx
nobase_dist_gfx_DATA = \
aimFighter1.png \
aimFighter2.png \
alienDevice.png \
arrowEast.png \
arrowNorth.png \
arrowNorthEast.png \
arrowNorthWest.png \
arrowSouth.png \
arrowSouthEast.png \
arrowSouthWest.png \
arrowWest.png \
asteroid1.png \
asteroid2.png \
asteroid3.png \
barrier.png \
buyIcon.png \
cargo1.png \
chainLink.png \
cloakShip1.png \
cloakShip2.png \
credits.jpg \
cursor.png \
dollar.png \
drone1.png \
drone2.png \
dualFighter1.png \
dualFighter2.png \
elec1.png \
elec2.png \
elec3.png \
elec4.png \
eliteFighter1.png \
eliteFighter2.png \
escort1.png \
escort2.png \
evilUrsula1.png \
evilUrsula2.png \
execTrans1.png \
execTrans2.png \
explode05.png \
explode06.png \
explode07.png \
explode08.png \
explode1.png \
explode10.png \
explode11.png \
explode12.png \
explode13.png \
explode14.png \
explode15.png \
explode16.png \
explode2.png \
explode3.png \
explode4.png \
explode9.png \
eyananth.jpg \
face_chris.png \
face_crew.png \
face_kline.png \
face_krass.png \
face_phoebe.png \
face_sid.png \
face_ursula.png \
firefly-big.png \
firefly1.png \
firefly2.png \
friendArrowEast.png \
friendArrowNorth.png \
friendArrowNorthEast.png \
friendArrowNorthWest.png \
friendArrowSouth.png \
friendArrowSouthEast.png \
friendArrowSouthWest.png \
friendArrowWest.png \
frigateBody1.png \
frigateBody2.png \
frigateGun11.png \
frigateGun12.png \
frigateGun21.png \
frigateGun22.png \
gameover.png \
goodTrans1.png \
goodTrans2.png \
greenDir.png \
heart.png \
icon1.png \
icon10.png \
icon11.png \
icon12.png \
icon13.png \
icon14.png \
icon15.png \
icon16.png \
icon17.png \
icon18.png \
icon19.png \
icon2.png \
icon20.png \
icon21.png \
icon22.png \
icon23.png \
icon24.png \
icon25.png \
icon26.png \
icon3.png \
icon4.png \
icon5.png \
icon6.png \
icon7.png \
icon8.png \
icon9.png \
iconBase.png \
kline11.png \
kline12.png \
klineText.png \
merc1.png \
merc2.png \
mine.png \
mineBoss1.png \
mineBoss2.png \
mineBossWing11.png \
mineBossWing12.png \
mineBossWing21.png \
mineBossWing22.png \
mineBossWing31.png \
mineBossWing32.png \
mineBossWing41.png \
mineBossWing42.png \
miner1.png \
miner2.png \
missileBoat1.png \
missileBoat2.png \
mobileCannon1.png \
mobileCannon2.png \
mobileShield1.png \
mobileShield2.png \
mordor.jpg \
ore1.png \
ore2.png \
ore3.png \
phoebeText.png \
planet_blue.png \
planet_green.png \
planet_orange.png \
planet_red.png \
planet_sun.png \
plasmaAmmo.png \
plasmaDamage.png \
plasmaGreen.png \
plasmaRate.png \
plasmaRed.png \
plutoBoss1.png \
plutoBoss2.png \
pod.png \
prlogo.png \
rebelCarrier1.png \
rebelCarrier2.png \
redDir.png \
rocket.png \
rocket1.png \
rocket2.png \
rocketAmmo.png \
sellIcon.png \
sflogo.png \
sid1.png \
sid2.png \
sidText.png \
slaveTrans1.png \
slaveTrans2.png \
smallFont.png \
sol.jpg \
spirit.jpg \
splitBoss11.png \
splitBoss12.png \
splitBoss21.png \
splitBoss22.png \
splitBoss31.png \
splitBoss32.png \
startUp.jpg \
stunBolt.png \
superCharge.png \
targetText.png \
transport1.png \
transport2.png \
tug1.png \
tug2.png \
ursulaText.png \
wingmate1.png \
wingmate2.png

20
locale/Makefile.am Normal file
View File

@ -0,0 +1,20 @@
# This file has been dedicated to the public domain, to the extent
# possible under applicable law, via CC0. See
# http://creativecommons.org/publicdomain/zero/1.0/ for more
# information. This file is offered as-is, without any warranty.
locdir = $(pkgdatadir)/locale
# WHEN ADDING TRANSLATIONS: Please append all new gettext file names
# here (both the .po file and the .mo file). This ensures the
# translation is both distributed and installed properly.
nobase_dist_loc_DATA = \
build.py \
genpot.sh \
pr-starfighter.pot \
en.po \
ja.po \
nl.po \
en/LC_MESSAGES/pr-starfighter.mo \
ja/LC_MESSAGES/pr-starfighter.mo \
nl/LC_MESSAGES/pr-starfighter.mo

File diff suppressed because it is too large Load Diff

3255
locale/eo.po Normal file

File diff suppressed because it is too large Load Diff

3270
locale/es_ES.po Normal file

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

3269
locale/nl.po Normal file

File diff suppressed because it is too large Load Diff

25
locale/po-update.py Executable file
View File

@ -0,0 +1,25 @@
#!/usr/bin/env python3
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
import os
import shutil
import subprocess
if __name__ == "__main__":
for fname in os.listdir():
root, ext = os.path.splitext(fname)
if ext == ".po":
subprocess.call(["msgmerge", "-U", fname, "pr-starfighter.pot"])

File diff suppressed because it is too large Load Diff

View File

@ -4,8 +4,12 @@
# information. This file is offered as-is, without any warranty.
desktopdir = $(datarootdir)/applications
desktop_DATA = starfighter.desktop
desktop_DATA = io.github.pr_starfighter.starfighter.desktop
icondir = $(datarootdir)/pixmaps
icon_DATA = starfighter.png
dist_man6_MANS = starfighter.6
appdatadir = $(datarootdir)/metainfo
appdata_DATA = io.github.pr_starfighter.starfighter.metainfo.xml

View File

@ -8,3 +8,4 @@ Icon=starfighter
Categories=Game;ActionGame;ArcadeGame;
Terminal=false
StartupNotify=false
Keywords=Games

View File

@ -0,0 +1,113 @@
<?xml version="1.0" encoding="UTF-8"?>
<component type="desktop-application">
<id>io.github.pr_starfighter.starfighter</id>
<metadata_license>CC-BY-SA-4.0</metadata_license>
<project_license>GPL-3.0-or-later</project_license>
<name>Project: Starfighter</name>
<summary>Space shoot 'em up game.</summary>
<recommends>
<control>keyboard</control>
<control>gamepad</control>
</recommends>
<description>
<p>
Project: Starfighter is a space shoot 'em up game originally developed
by Parallel Realities in 2002, and released in 2003. You assume the role
of Chris Bainfield in his quest to put an end to WEAPCO, the weapons
corporation which has enslaved the galaxy.
</p>
</description>
<launchable type="desktop-id">io.github.pr_starfighter.starfighter.desktop</launchable>
<screenshots>
<screenshot type="default">
<image>https://pr-starfighter.github.io/images/screenshot1.png</image>
<caption>Explosions</caption>
</screenshot>
<screenshot>
<image>https://pr-starfighter.github.io/images/screenshot2.png</image>
<caption>Main Menu</caption>
</screenshot>
<screenshot>
<image>https://pr-starfighter.github.io/images/screenshot3.png</image>
<caption>Boss Fight</caption>
</screenshot>
<screenshot>
<image>https://pr-starfighter.github.io/images/screenshot4.png</image>
<caption>Mines and Asteroids</caption>
</screenshot>
</screenshots>
<releases>
<release version="v2.4" date="2020-12-27" type="stable">
<url>https://github.com/pr-starfighter/starfighter/releases/tag/v2.4</url>
</release>
<release version="v2.3.3" date="2020-09-20" type="stable">
<url>https://github.com/pr-starfighter/starfighter/releases/tag/v2.3.3</url>
</release>
<release version="v2.3.2" date="2020-09-05" type="stable">
<url>https://github.com/pr-starfighter/starfighter/releases/tag/v2.3.2</url>
</release>
<release version="v2.3.1" date="2020-07-27" type="stable">
<url>https://github.com/pr-starfighter/starfighter/releases/tag/v2.3.1</url>
</release>
<release version="v2.3" date="2020-07-16" type="stable">
<url>https://github.com/pr-starfighter/starfighter/releases/tag/v2.3</url>
</release>
<release version="v2.2.1" date="2020-06-22" type="stable">
<url>https://github.com/pr-starfighter/starfighter/releases/tag/v2.2.1</url>
</release>
<release version="v2.2" date="2020-05-27" type="stable">
<url>https://github.com/pr-starfighter/starfighter/releases/tag/v2.2</url>
</release>
<release version="v2.1.1" date="2020-05-24" type="stable">
<url>https://github.com/pr-starfighter/starfighter/releases/tag/v2.1.1</url>
</release>
<release version="v2.1" date="2020-04-02" type="stable">
<url>https://github.com/pr-starfighter/starfighter/releases/tag/v2.1</url>
</release>
<release version="v2.0" date="2019-07-04" type="stable">
<url>https://github.com/pr-starfighter/starfighter/releases/tag/v2.0.0.3</url>
</release>
</releases>
<url type="homepage">https://pr-starfighter.github.io/</url>
<url type="bugtracker">https://github.com/pr-starfighter/starfighter/issues</url>
<url type="donation">https://liberapay.com/diligentcircle</url>
<categories>
<category>Game</category>
<category>ActionGame</category>
<category>ArcadeGame</category>
</categories>
<provides>
<binary>starfighter</binary>
</provides>
<update_contact>diligentcircle@riseup.net</update_contact>
<content_rating type="oars-1.0">
<content_attribute id="violence-cartoon">none</content_attribute>
<content_attribute id="violence-fantasy">none</content_attribute>
<content_attribute id="violence-realistic">moderate</content_attribute>
<content_attribute id="violence-bloodshed">none</content_attribute>
<content_attribute id="violence-sexual">none</content_attribute>
<content_attribute id="drugs-alcohol">none</content_attribute>
<content_attribute id="drugs-narcotics">none</content_attribute>
<content_attribute id="drugs-tobacco">none</content_attribute>
<content_attribute id="sex-nudity">none</content_attribute>
<content_attribute id="sex-themes">none</content_attribute>
<content_attribute id="language-profanity">moderate</content_attribute>
<content_attribute id="language-humor">none</content_attribute>
<content_attribute id="language-discrimination">none</content_attribute>
<content_attribute id="social-chat">none</content_attribute>
<content_attribute id="social-info">none</content_attribute>
<content_attribute id="social-audio">none</content_attribute>
<content_attribute id="social-location">none</content_attribute>
<content_attribute id="social-contacts">none</content_attribute>
<content_attribute id="money-purchasing">none</content_attribute>
<content_attribute id="money-gambling">none</content_attribute>
</content_rating>
</component>

51
misc/starfighter.6 Normal file
View File

@ -0,0 +1,51 @@
.\" Hey, EMACS: -*- nroff -*-
.\" First parameter, NAME, should be all caps
.\" Second parameter, SECTION, should be 1-8, maybe w/ subsection
.\" other parameters are allowed: see man(7), man(1)
.TH STARFIGHTER 6 "September 5, 2020"
.\" Please adjust this date whenever revising the manpage.
.\"
.\" Some roff macros, for reference:
.\" .nh disable hyphenation
.\" .hy enable hyphenation
.\" .ad l left justify
.\" .ad b justify to both left and right margins
.\" .nf disable filling
.\" .fi enable filling
.\" .br insert line break
.\" .sp <n> insert n+1 empty lines
.\" for manpage-specific macros, see man(7)
.SH NAME
starfighter \- 2D shoot em up
.SH SYNOPSIS
.B starfighter
.RI [ options ]
.SH DESCRIPTION
This manual page briefly documents
.B Project: Starfighter.
In the year 2579, the intergalactic weapons corporation, WEAPCO, has
dominated the galaxy. Guide Chris Bainfield and his friend Sid Wilson on
their quest to liberate the galaxy from the clutches of WEAPCO. Along
the way, you will encounter new foes, make new allies, and assist local
rebels in strikes against the evil corporation.
Originally developed by Parallel Realities in 2003, Project: Starfighter
is a side-scrolling shoot 'em up space game, released under the GNU GPL.
Consisting of 26 engaging levels spanning four planetary systems, this
classic game will entertain for hours.
https://pr-starfighter.gitub.io
.SH OPTIONS
A summary of options is included below.
.TP
.B \-noaudio
Disables sound and music.
.TP
.B \-mono
Mono sound output (best for headphones).
.SH AUTHOR
This manual page was written by Bartosz Fenski <fenio@debian.org>,
for the Debian project (but may be used by others). Modified by The
Diligent Circle <diligentcircle@riseup.net> for official use by Project:
Starfighter.

13
misc/starfighter.sh Executable file
View File

@ -0,0 +1,13 @@
#!/bin/sh
# This file has been dedicated to the public domain, to the extent
# possible under applicable law, via CC0. See
# http://creativecommons.org/publicdomain/zero/1.0/ for more
# information. This file is offered as-is, without any warranty.
#
# Script which can be used to easily run Starfighter in-place without
# installing on POSIX systems, but not on MacOS.
SCRIPT=$(readlink -f "$0")
SCRIPTPATH=$(dirname "$SCRIPT")
cd $SCRIPTPATH
./src/starfighter "$@"

23
music/Makefile.am Normal file
View File

@ -0,0 +1,23 @@
# This file has been dedicated to the public domain, to the extent
# possible under applicable law, via CC0. See
# http://creativecommons.org/publicdomain/zero/1.0/ for more
# information. This file is offered as-is, without any warranty.
musicdir = $(pkgdatadir)/music
nobase_dist_music_DATA = \
android_oppression.ogg \
androids_last_dance.ogg \
first_cyber_dance.ogg \
frozen_jam.ogg \
last_cyber_dance.ogg \
orbital_colossus.ogg \
railjet_short.ogg \
rise_of_spirit.ogg \
sleeping_with_androids.ogg \
sound_and_silence.ogg \
space_dimensions.ogg \
through_space.ogg
EXTRA_DIST = sources

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

BIN
music/first_cyber_dance.ogg Normal file

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

27
sound/Makefile.am Normal file
View File

@ -0,0 +1,27 @@
# This file has been dedicated to the public domain, to the extent
# possible under applicable law, via CC0. See
# http://creativecommons.org/publicdomain/zero/1.0/ for more
# information. This file is offered as-is, without any warranty.
sounddir = $(pkgdatadir)/sound
nobase_dist_sound_DATA = \
beamLaser.ogg \
cloak.ogg \
clock.ogg \
explode.ogg \
explode2.ogg \
explode3.ogg \
explode4.ogg \
flyby.ogg \
hyperSpace.ogg \
item.ogg \
laser.ogg \
maledeath.ogg \
missile.ogg \
missile2.ogg \
plasma.ogg \
plasma2.ogg \
plasma3.ogg \
shield.ogg

View File

@ -2,7 +2,7 @@
Project: Starfighter
Copyright (C) 2003 Parallel Realities
Copyright (C) 2011, 2012 Guus Sliepen
Copyright (C) 2015-2020 Layla Marchant <diligentcircle@riseup.net>
Copyright (C) 2015-2020 The Diligent Circle <diligentcircle@riseup.net>
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
@ -93,7 +93,7 @@ int main(int argc, char **argv)
printf("Additional Commands\n");
printf("\t-noaudio Disables sound and music\n");
printf("\t-mono Mono sound output (best for headphones)\n\n");
printf("http://starfighter.nongnu.org\n");
printf("https://pr-starfighter.github.io\n");
printf("\n");
exit(0);
}
@ -114,8 +114,8 @@ int main(int argc, char **argv)
cheatCount = 2;
if ((strcmp(argv[i], "it") == 0) && (cheatCount == 2))
cheatCount = 3;
if (((strcmp(argv[i], "better") == 0) && (cheatCount == 3)) ||
(strcmp(argv[i], "humansdoitbetter") == 0))
if (((strcmp(argv[i], "better") == 0) && (cheatCount == 3))
|| (strcmp(argv[i], "humansdoitbetter") == 0))
{
printf("Humans do it better! Cheats enabled.\n");
engine.cheat = 1;

View File

@ -1,7 +1,7 @@
/*
Copyright (C) 2003 Parallel Realities
Copyright (C) 2011, 2012 Guus Sliepen
Copyright (C) 2012, 2015-2020 Layla Marchant <diligentcircle@riseup.net>
Copyright (C) 2012, 2015-2020 The Diligent Circle <diligentcircle@riseup.net>
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
@ -84,6 +84,15 @@ void alien_nerf(int index)
aliens[index].maxShield /= 2;
}
}
else if ((game.difficulty != DIFFICULTY_ORIGINAL)
&& (game.difficulty < DIFFICULTY_HARD)
&& (game.area == MISN_URUSOR)
&& (aliens[index].classDef == CD_CARGOSHIP))
{
// Lighter version of the Urusor cargo ship shield buff.
aliens[index].shield *= 3;
aliens[index].maxShield *= 3;
}
}
void alien_defs_init()
@ -1110,8 +1119,8 @@ void aliens_init()
barrierSpeed++;
}
if ((game.area == MISN_POSWIC) &&
(aliens[i].classDef == CD_BOSS))
if ((game.area == MISN_POSWIC)
&& (aliens[i].classDef == CD_BOSS))
{
aliens[i].flags |= FL_IMMORTAL;
}
@ -1144,8 +1153,8 @@ void aliens_init()
aliens[ALIEN_BOSS_PART2].dx = -20;
aliens[ALIEN_BOSS_PART2].dy = 37;
}
else if ((game.area == MISN_ELAMALE) ||
(game.area == MISN_FELLON))
else if ((game.area == MISN_ELAMALE)
|| (game.area == MISN_FELLON))
{
aliens[ALIEN_BOSS].target = &player;
aliens[ALIEN_BOSS].x = -screen->w / 2;
@ -1190,12 +1199,16 @@ void aliens_init()
}
}
int alien_add()
/* Adds an alien. If spawnedMisnTarget is non-NULL, it is set to 1 if
* a mission target which can be forced with game.forceMisnTarget was
* spawned (or otherwise left unchanged).
*/
int alien_add(int *spawnedMisnTarget)
{
int index = alien_getFreeIndex();
if ((index == -1) || (game.area == MISN_JUPITER) ||
(game.area == MISN_VENUS))
if ((index == -1) || (game.area == MISN_JUPITER)
|| (game.area == MISN_VENUS))
return 0;
int *alienArray;
@ -1315,10 +1328,19 @@ int alien_add()
&& (game.area != MISN_SIVEDI)
&& (game.area != MISN_MARS))
{
if ((game.system == SYSTEM_EYANANTH) && (game.area == MISN_INTERCEPTION))
if ((game.system == SYSTEM_EYANANTH)
&& (game.area == MISN_INTERCEPTION))
{
if (CHANCE(1. / 5.))
if (CHANCE(1. / 5.)
|| (game.difficulty != DIFFICULTY_ORIGINAL
&& game.forceMisnTarget))
{
randEnemy = CD_SLAVETRANSPORT;
game.forceMisnTarget = 0;
if (spawnedMisnTarget != NULL)
*spawnedMisnTarget = 1;
}
}
if (CHANCE(1. / 6.))
@ -1663,8 +1685,8 @@ void alien_setKlineAI(Object *alien)
switch(RANDRANGE(0, 9))
{
case 0:
if ((alien->weaponType[0] != W_DIRSHOCKMISSILE) &&
(alien->weaponType[1] != W_MICRO_HOMING_MISSILES))
if ((alien->weaponType[0] != W_DIRSHOCKMISSILE)
&& (alien->weaponType[1] != W_MICRO_HOMING_MISSILES))
alien->flags |= FL_CONTINUOUS_FIRE;
alien->dx = ((alien->x - alien->target->x) /
((300 / alien->speed) + RANDRANGE(0, 100)));
@ -1674,9 +1696,9 @@ void alien_setKlineAI(Object *alien)
case 1:
case 2:
// Kline only attacks when he is ready!
if ((!(alien->flags & FL_NOFIRE)) &&
((game.area == MISN_ELAMALE) ||
game.difficulty != DIFFICULTY_ORIGINAL))
if ((!(alien->flags & FL_NOFIRE))
&& ((game.area == MISN_ELAMALE)
|| game.difficulty != DIFFICULTY_ORIGINAL))
alien->flags |= FL_DROPMINES;
break;
case 3:
@ -1726,8 +1748,8 @@ void alien_searchForTarget(Object *alien)
}
else
{
if ((targetEnemy->classDef != CD_CARGOSHIP) &&
(targetEnemy->classDef != CD_BOSS))
if ((targetEnemy->classDef != CD_CARGOSHIP)
&& (targetEnemy->classDef != CD_BOSS))
{
badTarget = 1;
}
@ -1743,8 +1765,8 @@ void alien_searchForTarget(Object *alien)
if (targetEnemy->classDef == CD_BOSS)
return;
if ((targetEnemy->flags & FL_DISABLED) ||
(targetEnemy->flags & FL_NOFIRE))
if ((targetEnemy->flags & FL_DISABLED)
|| (targetEnemy->flags & FL_NOFIRE))
badTarget = 1;
}
}
@ -1815,8 +1837,8 @@ int alien_checkTarget(Object *alien)
return 1;
// Not at the correct vertical height
if ((alien->y < alien->target->y - 15) ||
(alien->y > alien->target->y + alien->target->image[0]->h + 15))
if ((alien->y < alien->target->y - 15)
|| (alien->y > alien->target->y + alien->target->image[0]->h + 15))
return 0;
return 1;
@ -1830,11 +1852,11 @@ int alien_enemiesInFront(Object *alien)
{
for (int i = 0 ; i < ALIEN_MAX ; i++)
{
if ((alien != &aliens[i]) && (aliens[i].flags & FL_WEAPCO) &&
(aliens[i].shield > 0))
if ((alien != &aliens[i]) && (aliens[i].flags & FL_WEAPCO)
&& (aliens[i].shield > 0))
{
if ((alien->y > aliens[i].y - 15) &&
(alien->y < aliens[i].y + aliens[i].image[0]->h + 15))
if ((alien->y > aliens[i].y - 15)
&& (alien->y < aliens[i].y + aliens[i].image[0]->h + 15))
{
if ((alien->face == 1) && (aliens[i].x < alien->x))
return 1;
@ -1859,7 +1881,7 @@ void alien_move(Object *alien)
if (alien->owner == alien)
{
if (alien->flags & FL_CIRCLES)
if ((alien->flags & FL_CIRCLES) && (!(alien->flags & FL_LEAVESECTOR)))
{
if (alien->face == 0)
{
@ -1886,14 +1908,18 @@ void alien_move(Object *alien)
{
for (int i = 0 ; i < ALIEN_MAX ; i++)
{
if ((aliens[i].owner != alien) && (aliens[i].active) &&
(aliens[i].shield > 0) && (!(aliens[i].flags & FL_LEAVESECTOR)) &&
(alien->classDef != CD_BARRIER) &&
ship_collision(alien, &aliens[i]))
if ((aliens[i].owner != alien) && (aliens[i].active)
&& (aliens[i].shield > 0)
&& (!(aliens[i].flags & FL_LEAVESECTOR))
&& (alien->classDef != CD_BARRIER)
&& ship_collision(alien, &aliens[i]))
{
if ((game.difficulty == DIFFICULTY_ORIGINAL) && (alien->classDef != CD_DRONE) &&
(alien->classDef != CD_ASTEROID) && (alien->classDef != CD_ASTEROID2) &&
(alien->owner == alien) && (game.area != MISN_ELLESH))
if ((game.difficulty == DIFFICULTY_ORIGINAL)
&& (alien->classDef != CD_DRONE)
&& (alien->classDef != CD_ASTEROID)
&& (alien->classDef != CD_ASTEROID2)
&& (alien->owner == alien)
&& (game.area != MISN_ELLESH))
{
collided = 1;
}
@ -1978,8 +2004,8 @@ void alien_destroy(Object *alien, Object *attacker)
audio_playSound(SFX_EXPLOSION, alien->x, alien->y);
// Chain reaction damage if needed (Classic Difficulty version)
if ((game.difficulty == DIFFICULTY_ORIGINAL) &&
(alien->owner != alien) && (alien->flags & FL_DAMAGEOWNER))
if ((game.difficulty == DIFFICULTY_ORIGINAL)
&& (alien->owner != alien) && (alien->flags & FL_DAMAGEOWNER))
{
alien_hurt(alien->owner, attacker, alien->maxShield, 0);
}
@ -2015,8 +2041,8 @@ void alien_destroy(Object *alien, Object *attacker)
}
}
if (CHANCE(1 / 16.) && (alien->flags & FL_WEAPCO) &&
(!(alien->flags & FL_NOBANTER)))
if (CHANCE(1 / 16.) && (alien->flags & FL_WEAPCO)
&& (!(alien->flags & FL_NOBANTER)))
{
radio_getRandomMessage(msg, _(
/// Chris brag messages
@ -2048,8 +2074,8 @@ void alien_destroy(Object *alien, Object *attacker)
else if (attacker->classDef == CD_PHOEBE)
{
game.wingMate1Kills++;
if (CHANCE(1 / 8.) && (alien-> flags & FL_WEAPCO) &&
(!(alien->flags & FL_NOBANTER)))
if (CHANCE(1 / 8.) && (alien-> flags & FL_WEAPCO)
&& (!(alien->flags & FL_NOBANTER)))
{
radio_getRandomMessage(msg, _(
/// Phoebe brag messages
@ -2063,7 +2089,7 @@ void alien_destroy(Object *alien, Object *attacker)
"Target destroyed!\n"
"One more for me!\n"
"Yes! Did you see that, Chris?\n"
"Hey Chris, remind me to check my kill count later!\n"
"Hey, Chris, remind me to check my kill count later!\n"
"Bring it on, WEAPCO!\n"
"Take that, WEAPCO!\n"
"My kill count is going up!\n"
@ -2077,8 +2103,8 @@ void alien_destroy(Object *alien, Object *attacker)
else if (attacker->classDef == CD_URSULA)
{
game.wingMate2Kills++;
if (CHANCE(1 / 8.) && (alien-> flags & FL_WEAPCO) &&
(!(alien->flags & FL_NOBANTER)))
if (CHANCE(1 / 8.) && (alien-> flags & FL_WEAPCO)
&& (!(alien->flags & FL_NOBANTER)))
{
radio_getRandomMessage(msg, _(
/// Ursula brag messages
@ -2169,6 +2195,7 @@ void alien_hurt(Object *alien, Object *attacker, int damage, int ion)
int ai_type;
double run_chance;
int stage1_shield, stage2_shield, stage3_shield;
int i;
ai_type = ((game.difficulty == DIFFICULTY_ORIGINAL) ?
alien->AITypeOriginal : alien->AIType);
@ -2190,15 +2217,14 @@ void alien_hurt(Object *alien, Object *attacker, int damage, int ion)
if (game.area == MISN_ELAMALE)
{
if (game.difficulty == DIFFICULTY_ORIGINAL)
stage1_shield = alien->maxShield * 3 / 8;
stage1_shield = KLINE_SHIELD_MEDIUM;
else
stage1_shield = alien->maxShield / 4;
stage1_shield = KLINE_SHIELD_SMALL;
if ((alien->shield <= alien->maxShield - stage1_shield)
&& !(alien->flags & FL_LEAVESECTOR))
{
alien->flags |= FL_LEAVESECTOR;
alien->flags &= ~FL_CIRCLES;
/// Dialog (Kline Kethlan)
/// Used when Kline is beaten in the Elamale mission.
radio_setMessage(FS_KLINE, _("Seems I underestimated you, Bainfield. We'll meet again!"), 1);
@ -2207,15 +2233,14 @@ void alien_hurt(Object *alien, Object *attacker, int damage, int ion)
else if (game.area == MISN_EARTH)
{
if (game.difficulty == DIFFICULTY_ORIGINAL)
stage1_shield = alien->maxShield / 4;
stage1_shield = KLINE_SHIELD_SMALL;
else
stage1_shield = alien->maxShield * 3 / 8;
stage1_shield = KLINE_SHIELD_MEDIUM;
if ((alien->shield <= alien->maxShield - stage1_shield)
&& !(alien->flags & FL_LEAVESECTOR))
{
alien->flags |= FL_LEAVESECTOR;
alien->flags &= ~FL_CIRCLES;
/// Dialog (Sid Wilson)
/// Used when Kline is beaten in the Earth mission.
radio_setMessage(FS_SID, _("Chris, Kethlan is getting away!"), 1);
@ -2223,9 +2248,9 @@ void alien_hurt(Object *alien, Object *attacker, int damage, int ion)
}
else if (game.area == MISN_VENUS)
{
stage1_shield = alien->maxShield * 3 / 4;
stage2_shield = alien->maxShield / 2;
stage3_shield = alien->maxShield / 4;
stage1_shield = KLINE_STAGE1_SHIELD;
stage2_shield = KLINE_STAGE2_SHIELD;
stage3_shield = KLINE_STAGE3_SHIELD;
if (alien->shield + damage > stage1_shield
&& alien->shield <= stage1_shield)
@ -2251,23 +2276,32 @@ void alien_hurt(Object *alien, Object *attacker, int damage, int ion)
}
else
{
stage1_shield = alien->maxShield / 20;
stage1_shield = KLINE_SHIELD_TINY;
if ((game.difficulty != DIFFICULTY_ORIGINAL)
&& (game.difficulty > DIFFICULTY_EASY))
{
for (int i = 0 ; i < ALIEN_MAX ; i++)
{
if (aliens[i].active && (i != ALIEN_KLINE)
&& (aliens[i].flags & FL_WEAPCO)
&& (aliens[i].shield > 0))
{
stage1_shield = KLINE_SHIELD_SMALL;
break;
}
}
}
if ((alien->shield <= alien->maxShield - stage1_shield)
&& !(alien->flags & FL_LEAVESECTOR))
{
&& !(alien->flags & FL_LEAVESECTOR))
alien->flags |= FL_LEAVESECTOR;
alien->flags &= ~FL_CIRCLES;
}
}
}
run_chance = (game.difficulty == DIFFICULTY_ORIGINAL) ? 0.02 : damage / 50.;
if ((alien->flags & FL_RUNSAWAY) && CHANCE(run_chance))
{
alien->flags |= FL_LEAVESECTOR;
}
audio_playSound(SFX_HIT, alien->x, alien->y);
if (ai_type == AI_EVASIVE)

View File

@ -1,7 +1,7 @@
/*
Copyright (C) 2003 Parallel Realities
Copyright (C) 2011 Guus Sliepen
Copyright (C) 2015-2020 Layla Marchant <diligentcircle@riseup.net>
Copyright (C) 2015-2020 The Diligent Circle <diligentcircle@riseup.net>
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
@ -29,7 +29,7 @@ extern Object aliens[ALIEN_MAX];
void alien_nerf(int index);
void alien_defs_init();
void aliens_init();
int alien_add();
int alien_add(int *spawnedMisnTarget);
void alien_addDrone(Object *hostAlien);
void alien_addSmallAsteroid(Object *hostAlien);
void alien_addFriendly(int type);

View File

@ -1,7 +1,7 @@
/*
Copyright (C) 2003 Parallel Realities
Copyright (C) 2011, 2012 Guus Sliepen
Copyright (C) 2015-2020 Layla Marchant <diligentcircle@riseup.net>
Copyright (C) 2015-2020 The Diligent Circle <diligentcircle@riseup.net>
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
@ -26,6 +26,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
#include "defs.h"
#include "structs.h"
#include "alien.h"
#include "game.h"
#include "engine.h"
#include "screen.h"
@ -66,7 +67,8 @@ void audio_playSound(int sid, float x, float y)
int angle = atanf((x - (screen->w / 2)) / (screen->w / 2)) * 180 / M_PI;
int attenuation = fabsf(x - (screen->w / 2)) / (screen->w / 20);
float distance = sqrtf(powf(fabsf(x - (screen->w / 2)), 2) + powf(fabsf(y - (screen->h / 2)), 2));
int volume = MIX_MAX_VOLUME - (MIX_MAX_VOLUME * distance / (3 * screen->w));
const int max_volume = MIX_MAX_VOLUME;
int volume = max_volume - (max_volume * distance / (3 * screen->w));
if ((!engine.useSound) || (!engine.useAudio) || (volume <= 0))
return;
@ -109,8 +111,8 @@ void audio_playSound(int sid, float x, float y)
}
else
{
if (Mix_Playing(channel) && (volume <= MIX_MAX_VOLUME / 4) &&
(channelVolume[channel] >= MIX_MAX_VOLUME * 3 / 4))
if (Mix_Playing(channel) && (volume <= max_volume / 4)
&& (channelVolume[channel] >= max_volume * 3 / 4))
return;
else
channelVolume[channel] = volume;
@ -169,6 +171,14 @@ void audio_setMusicVolume(int volume)
#endif
}
void audio_setMusicPosition(double position)
{
#ifndef NOSOUND
if (engine.useMusic && engine.useAudio)
Mix_SetMusicPosition(position);
#endif
}
void audio_playMusic(const char *filename, int loops)
{
#ifndef NOSOUND
@ -176,7 +186,7 @@ void audio_playMusic(const char *filename, int loops)
{
audio_haltMusic();
music = Mix_LoadMUS(filename);
audio_setMusicVolume(100);
audio_setMusicVolume(MIX_MAX_VOLUME);
Mix_PlayMusic(music, loops);
}
#endif
@ -188,25 +198,94 @@ void audio_playRandomTrack()
if ((!engine.useMusic) || (!engine.useAudio))
return;
#ifdef OLD_MUSIC
int tracks = 0;
char track[][PATH_MAX] = {
"music/Frantic.mod", "music/Artificial.mod", "music/Lunatic.mod",
"music/ToxicFriend.mod", "music/DigitalInferno.mod",
"music/TempoTrance.mod", "music/IntoTheMachine.mod"
};
switch (game.system)
{
case SYSTEM_SPIRIT:
tracks = 3;
break;
case SYSTEM_EYANANTH:
tracks = 5;
break;
case SYSTEM_MORDOR:
case SYSTEM_SOL:
tracks = 7;
break;
default:
tracks = 3;
}
#else
int tracks = 4;
char track[][64] = {
char track[][PATH_MAX] = {
"music/railjet_short.ogg", "music/space_dimensions.ogg",
"music/frozen_jam.ogg", "music/sound_and_silence.ogg"
};
#endif
switch(game.area)
switch (game.area)
{
#ifndef OLD_MUSIC
case MISN_START:
audio_playMusic("music/railjet_short.ogg", -1);
case MISN_INTERCEPTION:
if ((aliens[ALIEN_KLINE].classDef == CD_KLINE)
&& aliens[ALIEN_KLINE].active)
audio_playMusic("music/last_cyber_dance.ogg", -1);
else if ((game.system == SYSTEM_MORDOR)
&& (aliens[ALIEN_BOSS].classDef == CD_CLOAKFIGHTER)
&& aliens[ALIEN_BOSS].active)
audio_playMusic("music/space_dimensions.ogg", -1);
else
audio_playMusic("music/railjet_short.ogg", -1);
break;
case MISN_HAIL:
case MISN_JOLDAR:
case MISN_DORIM:
case MISN_SIVEDI:
case MISN_NEPTUNE:
case MISN_SATURN:
audio_playMusic("music/frozen_jam.ogg", -1);
break;
case MISN_CERADSE:
case MISN_ALLEZ:
case MISN_URUSOR:
case MISN_FELLON:
case MISN_POSWIC:
case MISN_MARS:
audio_playMusic("music/sound_and_silence.ogg", -1);
break;
case MISN_HINSTAG:
case MISN_NEROD:
case MISN_ODEON:
case MISN_ALMARTHA:
case MISN_PLUTO:
case MISN_URANUS:
case MISN_JUPITER:
audio_playMusic("music/space_dimensions.ogg", -1);
break;
#endif
case MISN_MOEBO:
case MISN_ELAMALE:
case MISN_ELLESH:
case MISN_EARTH:
#ifdef OLD_MUSIC
audio_playMusic("music/HardTranceDub.mod", -1);
#else
audio_playMusic("music/orbital_colossus.ogg", -1);
#endif
break;
case MISN_VENUS:
audio_playMusic("music/RE.ogg", -1);
#ifdef OLD_MUSIC
audio_playMusic("music/LoopsAndTings.mod", -1);
#else
audio_playMusic("music/androids_last_dance.ogg", -1);
#endif
break;
default:
audio_playMusic(track[rand() % tracks], -1);

View File

@ -1,7 +1,7 @@
/*
Copyright (C) 2003 Parallel Realities
Copyright (C) 2011, 2012 Guus Sliepen
Copyright (C) 2015-2020 Layla Marchant <diligentcircle@riseup.net>
Copyright (C) 2015-2020 The Diligent Circle <diligentcircle@riseup.net>
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
@ -29,6 +29,7 @@ void audio_haltMusic();
void audio_pauseMusic();
void audio_resumeMusic();
void audio_setMusicVolume(int volume);
void audio_setMusicPosition(double position);
void audio_playMusic(const char *filename, int loops);
void audio_playRandomTrack();
void audio_free();

View File

@ -1,7 +1,7 @@
/*
Copyright (C) 2003 Parallel Realities
Copyright (C) 2011, 2012 Guus Sliepen
Copyright (C) 2015-2020 Layla Marchant <diligentcircle@riseup.net>
Copyright (C) 2015-2020 The Diligent Circle <diligentcircle@riseup.net>
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
@ -94,6 +94,15 @@ void bullet_add(Object *theWeapon, Object *attacker, int y, int dy)
bullet->damage = theWeapon->damage;
// Adjustments to damage for Classic difficulty (to match original)
if (game.difficulty == DIFFICULTY_ORIGINAL)
{
if (bullet->id == WT_MICROROCKET)
bullet->damage = 3;
else if (bullet->id == WT_SPREAD)
bullet->damage = 1;
}
if (bullet->id == WT_CHARGER)
{
if (game.difficulty == DIFFICULTY_ORIGINAL)

View File

@ -1,7 +1,7 @@
/*
Copyright (C) 2003 Parallel Realities
Copyright (C) 2011 Guus Sliepen
Copyright (C) 2015-2020 Layla Marchant <diligentcircle@riseup.net>
Copyright (C) 2015-2020 The Diligent Circle <diligentcircle@riseup.net>
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License

View File

@ -1,7 +1,7 @@
/*
Copyright (C) 2003 Parallel Realities
Copyright (C) 2011 Guus Sliepen
Copyright (C) 2015-2020 Layla Marchant <diligentcircle@riseup.net>
Copyright (C) 2015-2020 The Diligent Circle <diligentcircle@riseup.net>
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License

View File

@ -1,7 +1,7 @@
/*
Copyright (C) 2003 Parallel Realities
Copyright (C) 2011 Guus Sliepen
Copyright (C) 2015-2020 Layla Marchant <diligentcircle@riseup.net>
Copyright (C) 2015-2020 The Diligent Circle <diligentcircle@riseup.net>
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License

View File

@ -1,7 +1,7 @@
/*
Copyright (C) 2003 Parallel Realities
Copyright (C) 2011, 2012 Guus Sliepen
Copyright (C) 2015-2020 Layla Marchant <diligentcircle@riseup.net>
Copyright (C) 2015-2020 The Diligent Circle <diligentcircle@riseup.net>
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
@ -45,8 +45,8 @@ void collectable_add(float x, float y, int type, int value, int life)
&& (weapons[W_PLAYER_WEAPON].damage <= game.minPlasmaDamage))
|| (player.ammo[0] >= game.maxPlasmaAmmo));
shield_useless = ((game.difficulty == DIFFICULTY_NIGHTMARE) ||
(player.shield >= player.maxShield));
shield_useless = ((game.difficulty == DIFFICULTY_NIGHTMARE)
|| (player.shield >= player.maxShield));
rockets_useless = ((player.weaponType[1] == W_CHARGER)
|| (player.weaponType[1] == W_LASER)
@ -124,8 +124,7 @@ void collectable_add(float x, float y, int type, int value, int life)
type = P_PLASMA_RATE;
if ((game.difficulty == DIFFICULTY_NIGHTMARE)
|| ((game.difficulty != DIFFICULTY_SUPEREASY)
&& (game.difficulty != DIFFICULTY_EASY)
|| ((game.difficulty > DIFFICULTY_EASY)
&& (game.difficulty != DIFFICULTY_ORIGINAL)
&& ((game.area == MISN_MOEBO)
|| (game.area == MISN_ELAMALE)
@ -187,8 +186,8 @@ void collectable_add(float x, float y, int type, int value, int life)
// Shield bonus is useless if you can't heal; give cash instead.
if ((type == P_SHIELD) && (game.difficulty != DIFFICULTY_ORIGINAL))
{
if ((game.difficulty == DIFFICULTY_NIGHTMARE) ||
(player.shield >= player.maxShield))
if ((game.difficulty == DIFFICULTY_NIGHTMARE)
|| (player.shield >= player.maxShield))
{
type = P_CASH;
}
@ -338,24 +337,27 @@ int collectable_numGood()
while (col != NULL)
{
if ((col->type != P_MINE) && (col->type != P_ORE) &&
((col->type != P_SHIELD) || (player.shield < player.maxShield)) &&
((col->type != P_ROCKET) || (player.ammo[1] < game.maxRocketAmmo)) &&
((col->type != P_PLASMA_AMMO) || (player.ammo[0] < game.maxPlasmaAmmo)) &&
((col->type != P_PLASMA_SHOT) ||
(player.ammo[0] < game.maxPlasmaAmmo) ||
(weapons[W_PLAYER_WEAPON].ammo[0] < game.maxPlasmaOutput)) &&
((col->type != P_PLASMA_DAMAGE) ||
(player.ammo[0] < game.maxPlasmaAmmo) ||
(weapons[W_PLAYER_WEAPON].damage < game.maxPlasmaDamage)) &&
((col->type != P_PLASMA_RATE) ||
(player.ammo[0] < game.maxPlasmaAmmo) ||
(weapons[W_PLAYER_WEAPON].reload[0] > rate2reload[game.maxPlasmaRate])) &&
((col->type != P_SUPER) ||
(player.ammo[0] < game.maxPlasmaAmmo) ||
(weapons[W_PLAYER_WEAPON].ammo[0] < game.maxPlasmaOutput) ||
(weapons[W_PLAYER_WEAPON].damage < game.maxPlasmaDamage) ||
(weapons[W_PLAYER_WEAPON].reload[0] > rate2reload[game.maxPlasmaRate])))
if ((col->type != P_MINE) && (col->type != P_ORE)
&& ((col->type != P_SHIELD)
|| (player.shield < player.maxShield))
&& ((col->type != P_ROCKET)
|| (player.ammo[1] < game.maxRocketAmmo))
&& ((col->type != P_PLASMA_AMMO)
|| (player.ammo[0] < game.maxPlasmaAmmo))
&& ((col->type != P_PLASMA_SHOT)
|| (player.ammo[0] < game.maxPlasmaAmmo)
|| (weapons[W_PLAYER_WEAPON].ammo[0] < game.maxPlasmaOutput))
&& ((col->type != P_PLASMA_DAMAGE)
|| (player.ammo[0] < game.maxPlasmaAmmo)
|| (weapons[W_PLAYER_WEAPON].damage < game.maxPlasmaDamage))
&& ((col->type != P_PLASMA_RATE)
|| (player.ammo[0] < game.maxPlasmaAmmo)
|| (weapons[W_PLAYER_WEAPON].reload[0] > rate2reload[game.maxPlasmaRate]))
&& ((col->type != P_SUPER)
|| (player.ammo[0] < game.maxPlasmaAmmo)
|| (weapons[W_PLAYER_WEAPON].ammo[0] < game.maxPlasmaOutput)
|| (weapons[W_PLAYER_WEAPON].damage < game.maxPlasmaDamage)
|| (weapons[W_PLAYER_WEAPON].reload[0] > rate2reload[game.maxPlasmaRate])))
{
n++;
}

View File

@ -1,7 +1,7 @@
/*
Copyright (C) 2003 Parallel Realities
Copyright (C) 2011 Guus Sliepen
Copyright (C) 2015-2020 Layla Marchant <diligentcircle@riseup.net>
Copyright (C) 2015-2020 The Diligent Circle <diligentcircle@riseup.net>
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License

View File

@ -1,7 +1,7 @@
/*
Copyright (C) 2003 Parallel Realities
Copyright (C) 2011, 2012, 2013 Guus Sliepen
Copyright (C) 2015-2020 Layla Marchant <diligentcircle@riseup.net>
Copyright (C) 2015-2020 The Diligent Circle <diligentcircle@riseup.net>
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License

View File

@ -1,7 +1,7 @@
/*
Copyright (C) 2003 Parallel Realities
Copyright (C) 2011 Guus Sliepen
Copyright (C) 2015-2020 Layla Marchant <diligentcircle@riseup.net>
Copyright (C) 2015-2020 The Diligent Circle <diligentcircle@riseup.net>
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License

View File

@ -1,7 +1,7 @@
/*
Copyright (C) 2003 Parallel Realities
Copyright (C) 2011, 2012, 2013 Guus Sliepen
Copyright (C) 2012, 2015-2020 Layla Marchant <diligentcircle@riseup.net>
Copyright (C) 2012, 2015-2020 The Diligent Circle <diligentcircle@riseup.net>
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License

View File

@ -1,7 +1,7 @@
/*
Copyright (C) 2003 Parallel Realities
Copyright (C) 2011 Guus Sliepen
Copyright (C) 2015-2020 Layla Marchant <diligentcircle@riseup.net>
Copyright (C) 2015-2020 The Diligent Circle <diligentcircle@riseup.net>
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License

View File

@ -1,7 +1,7 @@
/*
Copyright (C) 2003 Parallel Realities
Copyright (C) 2011, 2012 Guus Sliepen
Copyright (C) 2012, 2015-2020 Layla Marchant <diligentcircle@riseup.net>
Copyright (C) 2012, 2015-2020 The Diligent Circle <diligentcircle@riseup.net>
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License

View File

@ -1,7 +1,7 @@
/*
Copyright (C) 2003 Parallel Realities
Copyright (C) 2011, 2012 Guus Sliepen
Copyright (C) 2012, 2015-2020 Layla Marchant <diligentcircle@riseup.net>
Copyright (C) 2012, 2015-2020 The Diligent Circle <diligentcircle@riseup.net>
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
@ -29,8 +29,9 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
#define WRAP_ADD(x, y, a, b) x = (((x) + (y)) + \
((x) + (y) < (a) ? ((b) - (a)) : 0) + \
((x) + (y) > (b) ? ((a) - (b)) : 0))
#define CHANCE(x) ((rand() % RAND_MAX) < ((x) * RAND_MAX))
#define RANDRANGE(x, y) (((x) < (y)) ? ((x) + (rand() % (long)(1 + (y) - (x)))) : (x))
#define CHANCE(x) (((double)rand() / ((double)RAND_MAX+1)) < (x))
#define RANDRANGE(x, y) (((x) < (y)) ? \
((x) + (rand() % (long)(1 + (y) - (x)))) : (x))
#define DRAND ((double)rand() / RAND_MAX)
#define _(s) gettext(s)
#define CSDLP(x) (((x) == SDL_PRESSED) ? 1 : 0)
@ -107,6 +108,13 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
#define JS_DEADZONE 0.05
#define JS_MAX (32767 - JS_DEADZONE*32767)
#define KLINE_STAGE1_SHIELD (aliens[ALIEN_KLINE].maxShield * 3 / 4)
#define KLINE_STAGE2_SHIELD (aliens[ALIEN_KLINE].maxShield / 2)
#define KLINE_STAGE3_SHIELD (aliens[ALIEN_KLINE].maxShield / 4)
#define KLINE_SHIELD_TINY (aliens[ALIEN_KLINE].maxShield / 20)
#define KLINE_SHIELD_SMALL (aliens[ALIEN_KLINE].maxShield / 4)
#define KLINE_SHIELD_MEDIUM (aliens[ALIEN_KLINE].maxShield * 3 / 8)
// Radio life/speed
#define RADIO_LIFE_INSTANT 60
#define RADIO_LIFE_FAST 120
@ -548,8 +556,10 @@ enum {
// Text sprites
enum {
// Main menu
TS_PRESENTS = MAX_INFOLINES,
TS_DILIGENTCIRCLE = MAX_INFOLINES,
TS_PRESENTS,
TS_AN_SDL_GAME,
TS_ORIGINALLY_BY,
TS_START_NEW_GAME,
TS_LOAD_GAME,
TS_CONTINUE_CURRENT_GAME,

View File

@ -1,7 +1,7 @@
/*
Copyright (C) 2003 Parallel Realities
Copyright (C) 2011, 2012, 2013 Guus Sliepen
Copyright (C) 2015-2020 Layla Marchant <diligentcircle@riseup.net>
Copyright (C) 2015-2020 The Diligent Circle <diligentcircle@riseup.net>
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
@ -56,7 +56,7 @@ Engine engine;
void engine_init()
{
engine.musicVolume = 100;
engine.musicVolume = MIX_MAX_VOLUME;
engine.useAudio = 1;
engine.maxAliens = 9;
@ -319,7 +319,7 @@ void engine_setMode()
#ifndef NOSOUND
if (engine.useAudio)
{
if (Mix_OpenAudio(44100, AUDIO_S16, 2, 1024) < 0)
if (Mix_OpenAudio(44100, AUDIO_S16SYS, 2, 1024) < 0)
{
printf("Warning: Couldn't set 44100 Hz 16-bit stereo audio - Reason:\n%s\n", Mix_GetError());
printf("Sound and Music will be disabled\n");
@ -376,7 +376,7 @@ void engine_resetLists()
LinkedRect *r1, *r2;
ob = engine.bulletHead->next;
while(ob != NULL)
while (ob != NULL)
{
ob2 = ob;
ob = ob->next;
@ -386,7 +386,7 @@ void engine_resetLists()
engine.bulletTail = engine.bulletHead;
ob = engine.explosionHead->next;
while(ob != NULL)
while (ob != NULL)
{
ob2 = ob;
ob = ob->next;
@ -418,7 +418,7 @@ void engine_resetLists()
screen_bufferTail = screen_bufferHead;
ob = engine.debrisHead->next;
while(ob != NULL)
while (ob != NULL)
{
ob2 = ob;
ob = ob->next;

View File

@ -1,7 +1,7 @@
/*
Copyright (C) 2003 Parallel Realities
Copyright (C) 2011 Guus Sliepen
Copyright (C) 2015-2020 Layla Marchant <diligentcircle@riseup.net>
Copyright (C) 2015-2020 The Diligent Circle <diligentcircle@riseup.net>
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License

View File

@ -1,7 +1,7 @@
/*
Copyright (C) 2003 Parallel Realities
Copyright (C) 2011, 2012, 2013 Guus Sliepen
Copyright (C) 2012, 2015-2020 Layla Marchant <diligentcircle@riseup.net>
Copyright (C) 2012, 2015-2020 The Diligent Circle <diligentcircle@riseup.net>
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
@ -48,8 +48,8 @@ void events_init()
switch (game.area)
{
case MISN_INTERCEPTION:
if ((aliens[ALIEN_KLINE].classDef == CD_KLINE) &&
(aliens[ALIEN_KLINE].active))
if ((aliens[ALIEN_KLINE].classDef == CD_KLINE)
&& (aliens[ALIEN_KLINE].active))
{
events[0].time = 2;
events[0].face = FS_KLINE;
@ -73,7 +73,7 @@ void events_init()
events[0].time = 2;
events[0].face = FS_SID;
/// Dialog (Sid Wilson)
strcpy(events[0].message, _("You should try and destroy some of the frigate's weaponary, it'll help!"));
strcpy(events[0].message, _("You should try and destroy some of the frigate's weaponry, it'll help!"));
events[1].time = 120;
events[1].face = FS_SID;
@ -399,6 +399,10 @@ void events_init()
events[1].face = FS_KLINE;
/// Dialog (Kline Kethlan)
strcpy(events[1].message, _("You underestimate me, Bainfield."));
if (game.difficulty == DIFFICULTY_ORIGINAL) {
events[1].entity = ALIEN_KLINE;
events[1].flag = -(FL_IMMORTAL | FL_NOMOVE | FL_NOFIRE);
}
break;
}

View File

@ -1,7 +1,7 @@
/*
Copyright (C) 2003 Parallel Realities
Copyright (C) 2011 Guus Sliepen
Copyright (C) 2015-2020 Layla Marchant <diligentcircle@riseup.net>
Copyright (C) 2015-2020 The Diligent Circle <diligentcircle@riseup.net>
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License

View File

@ -1,7 +1,7 @@
/*
Copyright (C) 2003 Parallel Realities
Copyright (C) 2011 Guus Sliepen
Copyright (C) 2015-2020 Layla Marchant <diligentcircle@riseup.net>
Copyright (C) 2015-2020 The Diligent Circle <diligentcircle@riseup.net>
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License

View File

@ -1,7 +1,7 @@
/*
Copyright (C) 2003 Parallel Realities
Copyright (C) 2011 Guus Sliepen
Copyright (C) 2015-2020 Layla Marchant <diligentcircle@riseup.net>
Copyright (C) 2015-2020 The Diligent Circle <diligentcircle@riseup.net>
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License

View File

@ -1,7 +1,7 @@
/*
Copyright (C) 2003 Parallel Realities
Copyright (C) 2011, 2012, 2013 Guus Sliepen
Copyright (C) 2012, 2014-2020 Layla Marchant <diligentcircle@riseup.net>
Copyright (C) 2012, 2014-2020 The Diligent Circle <diligentcircle@riseup.net>
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
@ -24,6 +24,10 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
#include "SDL.h"
#ifndef NOSOUND
#include "SDL_mixer.h"
#endif
#include "colors.h"
#include "defs.h"
#include "structs.h"
@ -100,6 +104,8 @@ void game_init()
game.slavesRescued = 0;
game.experimentalShield = 1000;
game.forceMisnTarget = 1;
game.timeTaken = 0;
game.stationedPlanet = -1;
@ -175,12 +181,7 @@ void game_init()
player.weaponType[0] = W_PLAYER_WEAPON;
player.weaponType[1] = W_ROCKETS;
for (int i = 0 ; i < STARS_NUM ; i++)
{
stars[i].x = rand() % screen->w;
stars[i].y = rand() % screen->h;
stars[i].speed = 1 + (rand() % 3);
}
game_setStars();
weapons_init();
mission_init();
@ -228,6 +229,19 @@ static void game_addDebris(int x, int y, int amount)
}
}
/*
Sets star positions. Must do this any time the window size changes.
*/
void game_setStars()
{
for (int i = 0 ; i < STARS_NUM ; i++)
{
stars[i].x = rand() % screen->w;
stars[i].y = rand() % screen->h;
stars[i].speed = 1 + (rand() % 3);
}
}
/*
Simply draws the stars in their positions on screen and moves
them around.
@ -294,10 +308,10 @@ static void game_doCollectables()
if (collectable->active)
{
if ((collectable->x + collectable->image->w > 0) &&
(collectable->x < screen->w) &&
(collectable->y + collectable->image->h > 0) &&
(collectable->y < screen->h))
if ((collectable->x + collectable->image->w > 0)
&& (collectable->x < screen->w)
&& (collectable->y + collectable->image->h > 0)
&& (collectable->y < screen->h))
screen_blit(collectable->image, (int)collectable->x, (int)collectable->y);
collectable->x += engine.ssx + engine.smx;
@ -567,9 +581,9 @@ static void game_doCollectables()
if (collectable->life < 1)
{
collectable->active = 0;
if ((collectable->type == P_CARGO) ||
(collectable->type == P_ESCAPEPOD) ||
(collectable->type == P_SLAVES))
if ((collectable->type == P_CARGO)
|| (collectable->type == P_ESCAPEPOD)
|| (collectable->type == P_SLAVES))
mission_updateRequirements(M_PROTECT_PICKUP, collectable->type, 1);
}
@ -580,9 +594,9 @@ static void game_doCollectables()
}
else
{
if ((collectable->type == P_MINE) && (collectable->x >= 0) &&
(collectable->x <= screen->w) && (collectable->y >= 0) &&
(collectable->y <= screen->h))
if ((collectable->type == P_MINE) && (collectable->x >= 0)
&& (collectable->x <= screen->w) && (collectable->y >= 0)
&& (collectable->y <= screen->h))
collectable_explode(collectable);
prevCollectable->next = collectable->next;
free(collectable);
@ -708,8 +722,8 @@ static void game_doBullets()
okayToHit = 1;
if ((bullet->flags & WF_WEAPCO) && (aliens[i].flags & FL_FRIEND))
okayToHit = 1;
if ((bullet->id == WT_ROCKET) || (bullet->id == WT_LASER) ||
(bullet->id == WT_CHARGER))
if ((bullet->id == WT_ROCKET) || (bullet->id == WT_LASER)
|| (bullet->id == WT_CHARGER))
okayToHit = 1;
if (bullet->owner == aliens[i].owner)
@ -753,8 +767,7 @@ static void game_doBullets()
"I am NOT your enemy!\n"
"Hey! Watch it!\n"
"What are you doing?! Shoot THEM!\n"
"Open your eyes!\n"
"Are you blind?!"
"Pay some damn attention!"
));
radio_setMessage(FS_URSULA, msg, 0);
}
@ -816,11 +829,12 @@ static void game_doBullets()
}
// Check for bullets hitting player
if ((bullet->flags & WF_WEAPCO) || (bullet->id == WT_ROCKET) ||
(bullet->id == WT_LASER) || (bullet->id == WT_CHARGER))
if ((bullet->flags & WF_WEAPCO) || (bullet->id == WT_ROCKET)
|| (bullet->id == WT_LASER) || (bullet->id == WT_CHARGER))
{
if (bullet->active && (player.shield > 0) &&
(bullet->owner != &player) && bullet_collision(bullet, &player))
if (bullet->active && (player.shield > 0)
&& (bullet->owner != &player)
&& bullet_collision(bullet, &player))
{
old_shield = player.shield;
@ -889,8 +903,7 @@ static void game_doBullets()
}
}
if ((game.difficulty != DIFFICULTY_SUPEREASY)
&& (game.difficulty != DIFFICULTY_EASY)
if ((game.difficulty > DIFFICULTY_EASY)
&& ((bullet->owner == &player) || (bullet->id == WT_ROCKET)))
{
for (int j = 0 ; j < 20 ; j++)
@ -1025,14 +1038,16 @@ static void game_doAliens()
if (aliens[i].face == 0)
aliens[i].x = aliens[i].owner->x - aliens[i].dx;
else
aliens[i].x = aliens[i].owner->x + aliens[i].owner->image[0]->w + aliens[i].dx - aliens[i].image[0]->w;
aliens[i].x = (aliens[i].owner->x + aliens[i].dx
+ aliens[i].owner->image[0]->w
- aliens[i].image[0]->w);
aliens[i].y = (aliens[i].owner->y + aliens[i].dy);
if (aliens[i].owner->shield < 1)
{
if ((aliens[i].classDef != CD_URANUSBOSSWING1) &&
(aliens[i].classDef != CD_URANUSBOSSWING2))
if ((aliens[i].classDef != CD_URANUSBOSSWING1)
&& (aliens[i].classDef != CD_URANUSBOSSWING2))
{
aliens[i].shield = 0;
}
@ -1053,8 +1068,8 @@ static void game_doAliens()
aliens[i].target = &aliens[i];
// Specific to Sid to stop him pissing about(!)
if ((aliens[i].classDef == CD_SID) &&
(aliens[i].target->flags & FL_DISABLED))
if ((aliens[i].classDef == CD_SID)
&& (aliens[i].target->flags & FL_DISABLED))
aliens[i].target = &aliens[i];
if (aliens[i].target == &aliens[i])
@ -1073,9 +1088,9 @@ static void game_doAliens()
}
}
if ((!(aliens[i].flags & FL_DISABLED)) &&
(aliens[i].thinktime == 0) && (aliens[i].target != &aliens[i]) &&
(aliens[i].owner == &aliens[i]))
if ((!(aliens[i].flags & FL_DISABLED))
&& (aliens[i].thinktime == 0) && (aliens[i].target != &aliens[i])
&& (aliens[i].owner == &aliens[i]))
{
if (aliens[i].classDef == CD_KLINE)
alien_setKlineAI(&aliens[i]);
@ -1102,9 +1117,9 @@ static void game_doAliens()
if (aliens[i].x > aliens[i].target->x) aliens[i].face = 1;
}
if ((game.area == MISN_ELLESH) &&
((aliens[i].classDef == CD_BOSS) ||
(game.difficulty != DIFFICULTY_ORIGINAL)))
if ((game.area == MISN_ELLESH)
&& ((aliens[i].classDef == CD_BOSS)
|| (game.difficulty != DIFFICULTY_ORIGINAL)))
aliens[i].face = 0;
if ((aliens[i].flags & FL_DEPLOYDRONES) && ((rand() % 300) == 0))
@ -1123,8 +1138,8 @@ static void game_doAliens()
if (aliens[i].x >= 5000)
{
aliens[i].flags -= FL_LEAVESECTOR;
aliens[i].flags += FL_ESCAPED;
aliens[i].flags &= ~FL_LEAVESECTOR;
aliens[i].flags |= FL_ESCAPED;
aliens[i].active = 0;
if (aliens[i].classDef == CD_CLOAKFIGHTER)
@ -1164,9 +1179,9 @@ static void game_doAliens()
aliens[i].dy = 20 + (cosf(barrierLoop + aliens[i].speed) * 40);
}
if ((aliens[i].classDef == CD_MOBILESHIELD) &&
(aliens[ALIEN_BOSS].active) &&
(aliens[ALIEN_BOSS].shield > 0))
if ((aliens[i].classDef == CD_MOBILESHIELD)
&& (aliens[ALIEN_BOSS].active)
&& (aliens[ALIEN_BOSS].shield > 0))
{
LIMIT_ADD(aliens[ALIEN_BOSS].shield, 1, 0,
aliens[ALIEN_BOSS].maxShield);
@ -1175,14 +1190,14 @@ static void game_doAliens()
LIMIT_ADD(aliens[i].reload[0], -1, 0, 999);
LIMIT_ADD(aliens[i].reload[1], -1, 0, 999);
if ((!(aliens[i].flags & FL_DISABLED)) &&
(!(aliens[i].flags & FL_NOFIRE)))
if ((!(aliens[i].flags & FL_DISABLED))
&& (!(aliens[i].flags & FL_NOFIRE)))
{
if ((aliens[i].target->shield > 0))
canFire = alien_checkTarget(&aliens[i]);
if (((aliens[i].thinktime % 2) == 0) &&
(aliens[i].flags & FL_FRIEND))
if (((aliens[i].thinktime % 2) == 0)
&& (aliens[i].flags & FL_FRIEND))
canFire = alien_enemiesInFront(&aliens[i]);
}
else
@ -1194,12 +1209,12 @@ static void game_doAliens()
{
for (int j = 0 ; j < 2 ; j++)
{
if ((aliens[i].reload[j] == 0) &&
((rand() % 1000 < aliens[i].chance[j]) ||
(aliens[i].flags & FL_CONTINUOUS_FIRE)))
if ((aliens[i].reload[j] == 0)
&& ((rand() % 1000 < aliens[i].chance[j])
|| (aliens[i].flags & FL_CONTINUOUS_FIRE)))
{
if ((aliens[i].weaponType[j] != W_ENERGYRAY) &&
(aliens[i].weaponType[j] != W_LASER))
if ((aliens[i].weaponType[j] != W_ENERGYRAY)
&& (aliens[i].weaponType[j] != W_LASER))
{
if (aliens[i].weaponType[j] == W_CHARGER)
aliens[i].ammo[j] = 50 + rand() % 150;
@ -1212,8 +1227,8 @@ static void game_doAliens()
// Note: ammo[0] is required whether the ray is primary
// or secondary because futher below, ammo[0] increases on
// any alien that isn't currently firing a ray.
else if ((aliens[i].weaponType[j] == W_ENERGYRAY) &&
(aliens[i].ammo[0] >= RAY_INTERVAL))
else if ((aliens[i].weaponType[j] == W_ENERGYRAY)
&& (aliens[i].ammo[0] >= RAY_INTERVAL))
{
aliens[i].flags += FL_FIRERAY;
audio_playSound(SFX_ENERGYRAY, aliens[i].x, aliens[i].y);
@ -1260,16 +1275,17 @@ static void game_doAliens()
LIMIT_ADD(aliens[i].hit, -1, 0, 100);
if ((aliens[i].x + aliens[i].image[0]->w > 0) &&
(aliens[i].x < screen->w) &&
(aliens[i].y + aliens[i].image[0]->h > 0) &&
(aliens[i].y < screen->h))
if ((aliens[i].x + aliens[i].image[0]->w > 0)
&& (aliens[i].x < screen->w)
&& (aliens[i].y + aliens[i].image[0]->h > 0)
&& (aliens[i].y < screen->h))
{
if ((!(aliens[i].flags & FL_DISABLED)) &&
(aliens[i].classDef != CD_ASTEROID) &&
(aliens[i].classDef != CD_ASTEROID2))
if ((!(aliens[i].flags & FL_DISABLED))
&& (aliens[i].classDef != CD_ASTEROID)
&& (aliens[i].classDef != CD_ASTEROID2))
explosion_addEngine(&aliens[i]);
if ((!(aliens[i].flags & FL_ISCLOAKED)) || (aliens[i].hit > 0))
if ((!(aliens[i].flags & FL_ISCLOAKED))
|| (aliens[i].hit > 0))
screen_blit(gfx_shipSprites[shapeToUse], (int)aliens[i].x,
(int)aliens[i].y);
if (aliens[i].flags & FL_DISABLED)
@ -1321,8 +1337,8 @@ static void game_doAliens()
}
// Adjust the movement even whilst exploding
if ((!(aliens[i].flags & FL_NOMOVE)) &&
(!(aliens[i].flags & FL_DISABLED)))
if ((!(aliens[i].flags & FL_NOMOVE))
&& (!(aliens[i].flags & FL_DISABLED)))
alien_move(&aliens[i]);
if ((game.area != MISN_ELLESH) || (aliens[i].shield < 0))
@ -1361,8 +1377,9 @@ static void game_doPlayer()
if ((engine.keyState[KEY_ALTFIRE]) && (player.weaponType[1] != W_NONE))
{
if ((player.weaponType[1] != W_CHARGER) &&
(player.weaponType[1] != W_LASER) && (player.ammo[1] > 0))
if ((player.weaponType[1] != W_CHARGER)
&& (player.weaponType[1] != W_LASER)
&& (player.ammo[1] > 0))
{
ship_fireBullet(&player, 1);
}
@ -1387,9 +1404,9 @@ static void game_doPlayer()
if (player.weaponType[1] == W_CHARGER)
{
if (engine.keyState[KEY_ALTFIRE] &&
((game.difficulty == DIFFICULTY_ORIGINAL) ||
!(engine.keyState[KEY_FIRE])))
if (engine.keyState[KEY_ALTFIRE]
&& ((game.difficulty == DIFFICULTY_ORIGINAL)
|| !(engine.keyState[KEY_FIRE])))
{
if (!player_chargerFired)
{
@ -1425,8 +1442,9 @@ static void game_doPlayer()
if ((engine.keyState[KEY_SWITCH]))
{
if ((weapons[W_PLAYER_WEAPON].ammo[0] >= 3) &&
(weapons[W_PLAYER_WEAPON].ammo[0] <= game.maxPlasmaOutput))
if ((weapons[W_PLAYER_WEAPON].ammo[0] >= 3)
&& ((weapons[W_PLAYER_WEAPON].ammo[0] <= game.maxPlasmaOutput)
|| (game.difficulty == DIFFICULTY_ORIGINAL)))
{
weapons[W_PLAYER_WEAPON].flags ^= WF_SPREAD;
@ -1471,9 +1489,9 @@ static void game_doPlayer()
if (engine.keyState[KEY_ESCAPE])
{
if ((engine.done == ENGINE_RUNNING) &&
(engine.gameSection == SECTION_GAME) &&
(mission.remainingObjectives1 == 0))
if ((engine.done == ENGINE_RUNNING)
&& (engine.gameSection == SECTION_GAME)
&& (mission.remainingObjectives1 == 0))
{
audio_playSound(SFX_FLY, screen->w / 2, screen->h / 2);
engine.done = ENGINE_SYSEXIT;
@ -1487,8 +1505,8 @@ static void game_doPlayer()
engine.keyState[KEY_PAUSE] = 0;
}
if ((game.area == MISN_ELLESH) ||
(game.area == MISN_MARS))
if ((game.area == MISN_ELLESH)
|| (game.area == MISN_MARS))
{
player.face = 0;
xmoved = 1;
@ -1576,8 +1594,8 @@ static void game_doPlayer()
LIMIT_ADD(player.hit, -1, 0, 100);
screen_blit(gfx_shipSprites[shapeToUse], (int)player.x, (int)player.y);
if ((player.maxShield > 1) && (player.shield <= engine.lowShield) &&
CHANCE(1. / 10))
if ((player.maxShield > 1) && (player.shield <= engine.lowShield)
&& CHANCE(player.shield > 1 ? 1. / 10 : 3. / 10))
explosion_add(player.x + RANDRANGE(-10, 10),
player.y + RANDRANGE(-10, 20), SP_SMOKE);
}
@ -1602,7 +1620,7 @@ static void game_doPlayer()
/// following the English version only as a general guideline. Any
/// number of insults is permitted.
"Fool.\n"
"And now you're nothing but a DEAD hero.\n"
"And now you're nothing but a DEAD hero."
));
radio_setMessage(FS_KLINE, msg, 1);
}
@ -1618,7 +1636,7 @@ static void game_doPlayer()
/// number of insults is permitted.
"Pathetic.\n"
"How very disappointing...\n"
"Heroic. And stupid."
"Heroic. And foolish."
));
radio_setMessage(FS_KLINE, msg, 1);
}
@ -1659,8 +1677,8 @@ static void game_doPlayer()
LIMIT(engine.ssy, -CAMERA_MAX_SPEED, CAMERA_MAX_SPEED);
// Specific for the mission were you have to chase the Executive Transport
if (((game.area == MISN_ELLESH) && (player.shield > 0)) ||
(game.area == MISN_MARS))
if (((game.area == MISN_ELLESH) && (player.shield > 0))
|| (game.area == MISN_MARS))
{
engine.ssx = -6;
engine.ssy = 0;
@ -1817,41 +1835,41 @@ static void game_doArrow(int i)
if (aliens[i].x + aliens[i].image[0]->w < 0)
{
if (aliens[i].y + aliens[i].image[0]->h < 0)
arrow = (((game.difficulty != DIFFICULTY_ORIGINAL) &&
(aliens[i].flags & FL_FRIEND)) ?
SP_ARROW_FRIEND_NORTHWEST : SP_ARROW_NORTHWEST);
arrow = (((game.difficulty != DIFFICULTY_ORIGINAL)
&& (aliens[i].flags & FL_FRIEND)) ?
SP_ARROW_FRIEND_NORTHWEST : SP_ARROW_NORTHWEST);
else if (aliens[i].y > screen->h)
arrow = (((game.difficulty != DIFFICULTY_ORIGINAL) &&
(aliens[i].flags & FL_FRIEND)) ?
SP_ARROW_FRIEND_SOUTHWEST : SP_ARROW_SOUTHWEST);
arrow = (((game.difficulty != DIFFICULTY_ORIGINAL)
&& (aliens[i].flags & FL_FRIEND)) ?
SP_ARROW_FRIEND_SOUTHWEST : SP_ARROW_SOUTHWEST);
else
arrow = (((game.difficulty != DIFFICULTY_ORIGINAL) &&
(aliens[i].flags & FL_FRIEND)) ?
SP_ARROW_FRIEND_WEST : SP_ARROW_WEST);
arrow = (((game.difficulty != DIFFICULTY_ORIGINAL)
&& (aliens[i].flags & FL_FRIEND)) ?
SP_ARROW_FRIEND_WEST : SP_ARROW_WEST);
}
else if (aliens[i].x > screen->w)
{
if (aliens[i].y + aliens[i].image[0]->h < 0)
arrow = (((game.difficulty != DIFFICULTY_ORIGINAL) &&
(aliens[i].flags & FL_FRIEND)) ?
SP_ARROW_FRIEND_NORTHEAST : SP_ARROW_NORTHEAST);
arrow = (((game.difficulty != DIFFICULTY_ORIGINAL)
&& (aliens[i].flags & FL_FRIEND)) ?
SP_ARROW_FRIEND_NORTHEAST : SP_ARROW_NORTHEAST);
else if (aliens[i].y > screen->h)
arrow = (((game.difficulty != DIFFICULTY_ORIGINAL) &&
(aliens[i].flags & FL_FRIEND)) ?
SP_ARROW_FRIEND_SOUTHEAST : SP_ARROW_SOUTHEAST);
arrow = (((game.difficulty != DIFFICULTY_ORIGINAL)
&& (aliens[i].flags & FL_FRIEND)) ?
SP_ARROW_FRIEND_SOUTHEAST : SP_ARROW_SOUTHEAST);
else
arrow = (((game.difficulty != DIFFICULTY_ORIGINAL) &&
(aliens[i].flags & FL_FRIEND)) ?
SP_ARROW_FRIEND_EAST : SP_ARROW_EAST);
arrow = (((game.difficulty != DIFFICULTY_ORIGINAL)
&& (aliens[i].flags & FL_FRIEND)) ?
SP_ARROW_FRIEND_EAST : SP_ARROW_EAST);
}
else if (aliens[i].y + aliens[i].image[0]->h < 0)
arrow = (((game.difficulty != DIFFICULTY_ORIGINAL) &&
(aliens[i].flags & FL_FRIEND)) ?
SP_ARROW_FRIEND_NORTH : SP_ARROW_NORTH);
arrow = (((game.difficulty != DIFFICULTY_ORIGINAL)
&& (aliens[i].flags & FL_FRIEND)) ?
SP_ARROW_FRIEND_NORTH : SP_ARROW_NORTH);
else if (aliens[i].y > screen->h)
arrow = (((game.difficulty != DIFFICULTY_ORIGINAL) &&
(aliens[i].flags & FL_FRIEND)) ?
SP_ARROW_FRIEND_SOUTH : SP_ARROW_SOUTH);
arrow = (((game.difficulty != DIFFICULTY_ORIGINAL)
&& (aliens[i].flags & FL_FRIEND)) ?
SP_ARROW_FRIEND_SOUTH : SP_ARROW_SOUTH);
if (arrow != -1)
{
@ -1909,6 +1927,7 @@ static void game_doHud()
int tTextIndex;
char text[STRMAX_SHORT];
float nbars; // A float for the sake of float division
float min_shield, max_shield;
float shield_pct;
int i;
int c;
@ -2039,8 +2058,8 @@ static void game_doHud()
events_check();
}
if ((engine.timeMission) && (player.shield > 0) &&
((!engine.cheatTime) || (game.area == MISN_MARS)))
if ((engine.timeMission) && (player.shield > 0)
&& ((!engine.cheatTime) || (game.area == MISN_MARS)))
{
if (SDL_GetTicks() >= engine.counter)
{
@ -2114,8 +2133,8 @@ static void game_doHud()
// Do the target's remaining shield (if required)
if (game.area != MISN_DORIM)
{
if ((engine.targetIndex > -1) && (aliens[engine.targetIndex].shield > 0) &&
(engine.targetIndex > engine.maxAliens))
if ((engine.targetIndex > -1) && (aliens[engine.targetIndex].shield > 0)
&& (engine.targetIndex > engine.maxAliens))
{
if (game.difficulty == DIFFICULTY_ORIGINAL)
{
@ -2140,8 +2159,62 @@ static void game_doHud()
bar.x = screen->w * 11 / 16 + gfx_textSprites[tTextIndex].image->w + 10;
bar.y = screen->h - 50;
nbars = 85.;
shield_pct = ((float)aliens[engine.targetIndex].shield
/ (float)aliens[engine.targetIndex].maxShield);
if (engine.targetIndex == ALIEN_KLINE
&& game.difficulty == DIFFICULTY_ORIGINAL)
{
if (game.area == MISN_ELAMALE)
{
max_shield = aliens[engine.targetIndex].maxShield;
min_shield = max_shield - KLINE_SHIELD_MEDIUM;
}
else if (game.area == MISN_EARTH)
{
max_shield = aliens[engine.targetIndex].maxShield;
min_shield = max_shield - KLINE_SHIELD_SMALL;
}
else if (game.area == MISN_VENUS)
{
if (aliens[ALIEN_KLINE].shield > KLINE_STAGE1_SHIELD)
{
max_shield = aliens[engine.targetIndex].maxShield;
min_shield = KLINE_STAGE1_SHIELD;
}
else if (aliens[ALIEN_KLINE].shield > KLINE_STAGE2_SHIELD)
{
max_shield = KLINE_STAGE1_SHIELD;
min_shield = KLINE_STAGE2_SHIELD;
}
else if (aliens[ALIEN_KLINE].shield > KLINE_STAGE3_SHIELD)
{
max_shield = KLINE_STAGE2_SHIELD;
min_shield = KLINE_STAGE3_SHIELD;
}
else
{
max_shield = KLINE_STAGE3_SHIELD;
min_shield = 0;
}
}
else
{
max_shield = aliens[engine.targetIndex].maxShield;
min_shield = max_shield - KLINE_SHIELD_TINY;
}
if (min_shield > 0)
shield_pct = (
MAX((float)aliens[engine.targetIndex].shield - min_shield, 1.)
/ (max_shield-min_shield));
else
shield_pct = (
((float)aliens[engine.targetIndex].shield - min_shield)
/ (max_shield-min_shield));
}
else
{
shield_pct = ((float)aliens[engine.targetIndex].shield
/ (float)aliens[engine.targetIndex].maxShield);
}
for (i = 0 ; i < nbars ; i++)
{
@ -2380,7 +2453,11 @@ static void game_showGameOver()
screen_clear(black);
SDL_Delay(1000);
audio_playMusic("music/death.ogg", -1);
#ifdef OLD_MUSIC
audio_playMusic("music/Wybierak.mod", -1);
#else
audio_playMusic("music/sleeping_with_androids.ogg", 0);
#endif
int x = (screen->w - gameover->w) / 2;
int y = (screen->h - gameover->h) / 2;
@ -2417,8 +2494,8 @@ void game_getDifficultyText(char *dest, int difficulty)
switch (difficulty)
{
case DIFFICULTY_SUPEREASY:
/// DIFFICULTY_SUPEREASY
strcpy(dest, _("Super-Easy"));
/// DIFFICULTY_SUPEREASY (Assisted)
strcpy(dest, _("Assisted"));
break;
case DIFFICULTY_EASY:
/// DIFFICULTY_EASY
@ -2447,6 +2524,7 @@ void game_getDifficultyText(char *dest, int difficulty)
int game_mainLoop()
{
int spawnedMisnTarget;
float chance;
engine_resetLists();
@ -2465,8 +2543,12 @@ int game_mainLoop()
if (game.area == MISN_ELAMALE)
aliens[ALIEN_KLINE].active = 0;
spawnedMisnTarget = 0;
for (int i = 0 ; i < engine.maxAliens ; i++)
alien_add();
alien_add(&spawnedMisnTarget);
if (!spawnedMisnTarget)
game.forceMisnTarget = 1;
if (game.hasWingMate1)
alien_addFriendly(ALIEN_PHOEBE);
@ -2474,9 +2556,9 @@ int game_mainLoop()
if (game.hasWingMate2)
alien_addFriendly(ALIEN_URSULA);
if ((game.area == MISN_URUSOR) ||
(game.area == MISN_POSWIC) ||
(game.area == MISN_EARTH))
if ((game.area == MISN_URUSOR)
|| (game.area == MISN_POSWIC)
|| (game.area == MISN_EARTH))
alien_addFriendly(ALIEN_SID);
// Disable Wingmates for certain missions
@ -2505,7 +2587,7 @@ int game_mainLoop()
// Some specifics for interception missions
if (game.area == MISN_INTERCEPTION)
{
if ((game.system > SYSTEM_EYANANTH) && ((rand() % 5) == 0))
if ((game.system > SYSTEM_EYANANTH) && CHANCE(1. / 5.))
{
aliens[ALIEN_KLINE] = alien_defs[CD_KLINE];
aliens[ALIEN_KLINE].owner = &aliens[ALIEN_KLINE];
@ -2518,7 +2600,9 @@ int game_mainLoop()
if ((game.system == SYSTEM_MORDOR) && (game.experimentalShield > 0))
{
if ((rand() % 5) > 0)
if (CHANCE(4. / 5.)
|| (game.difficulty != DIFFICULTY_ORIGINAL
&& game.forceMisnTarget))
{
aliens[ALIEN_BOSS] = alien_defs[CD_CLOAKFIGHTER];
aliens[ALIEN_BOSS].owner = &aliens[ALIEN_BOSS];
@ -2529,14 +2613,33 @@ int game_mainLoop()
aliens[ALIEN_BOSS].y = player.y;
player_setTarget(ALIEN_BOSS);
aliens[ALIEN_BOSS].shield = game.experimentalShield;
game.forceMisnTarget = 0;
}
else
game.forceMisnTarget = 1;
}
// Note: music is started here only for interceptions. For
// regular missions, it is instead started by
// mission_showStartScreen(). This is necessary to ensure the
// proper music can be played when Kline or the cloak fighter
// are active.
audio_playRandomTrack();
}
if (game.area == MISN_VENUS)
{
aliens[ALIEN_KLINE].x = player.x + 1000;
aliens[ALIEN_KLINE].y = player.y;
if (game.difficulty == DIFFICULTY_ORIGINAL)
{
aliens[ALIEN_KLINE].flags |= FL_IMMORTAL | FL_NOFIRE | FL_NOMOVE;
aliens[ALIEN_KLINE].x = screen->w * 3 / 4;
aliens[ALIEN_KLINE].y = screen->h / 2;
}
else
{
aliens[ALIEN_KLINE].x = player.x + 1000;
aliens[ALIEN_KLINE].y = player.y;
}
}
for (int i = 0 ; i < ALIEN_MAX ; i++)
@ -2597,7 +2700,7 @@ int game_mainLoop()
engine.counter2 = (SDL_GetTicks() + 1000);
engine.missionCompleteTimer = 0;
engine.musicVolume = 100;
engine.musicVolume = MIX_MAX_VOLUME;
int rtn = 0;
@ -2605,8 +2708,8 @@ int game_mainLoop()
for (int i = 0 ; i < 3 ; i++)
{
if ((mission.primaryType[i] == M_DESTROY_TARGET_TYPE) &&
(mission.target1[i] == CD_ANY))
if ((mission.primaryType[i] == M_DESTROY_TARGET_TYPE)
&& (mission.target1[i] == CD_ANY))
allowableAliens = mission.targetValue1[i];
if (mission.primaryType[i] == M_DESTROY_ALL_TARGETS)
@ -2651,41 +2754,41 @@ int game_mainLoop()
engine.gameSection = SECTION_INTERMISSION;
if (player.shield > 0)
{
if ((SDL_GetTicks() >= engine.missionCompleteTimer) &&
((game.difficulty == DIFFICULTY_ORIGINAL) ||
(game.difficulty == DIFFICULTY_NIGHTMARE) ||
(game.area == MISN_INTERCEPTION) ||
(game.area == MISN_ELLESH) ||
(game.area == MISN_MARS) ||
(mission_checkFailed()) ||
(collectable_numGood() <= 0) ||
(engine.done == ENGINE_SYSEXIT)))
if ((SDL_GetTicks() >= engine.missionCompleteTimer)
&& ((game.difficulty == DIFFICULTY_ORIGINAL)
|| (game.difficulty == DIFFICULTY_NIGHTMARE)
|| (game.area == MISN_INTERCEPTION)
|| (game.area == MISN_ELLESH)
|| (game.area == MISN_MARS)
|| (mission_checkFailed())
|| (collectable_numGood() <= 0)
|| (engine.done == ENGINE_SYSEXIT)))
{
if ((!mission_checkFailed()) && (game.area != MISN_VENUS))
{
player_leaveSector();
if ((engine.done == ENGINE_SYSEXIT) &&
(game.area != MISN_DORIM) &&
(game.area != MISN_SIVEDI))
if ((engine.done == ENGINE_SYSEXIT)
&& (game.area != MISN_DORIM)
&& (game.area != MISN_SIVEDI))
{
if ((aliens[ALIEN_PHOEBE].shield > 0) &&
(game.area != MISN_EARTH))
if ((aliens[ALIEN_PHOEBE].shield > 0)
&& (game.area != MISN_EARTH))
{
aliens[ALIEN_PHOEBE].x = player.x - 40;
aliens[ALIEN_PHOEBE].y = player.y - 35;
aliens[ALIEN_PHOEBE].face = 0;
}
if ((aliens[ALIEN_URSULA].shield > 0) &&
(game.area != MISN_EARTH))
if ((aliens[ALIEN_URSULA].shield > 0)
&& (game.area != MISN_EARTH))
{
aliens[ALIEN_URSULA].x = player.x - 40;
aliens[ALIEN_URSULA].y = player.y + 45;
aliens[ALIEN_URSULA].face = 0;
}
if ((game.area == MISN_URUSOR) ||
(game.area == MISN_POSWIC))
if ((game.area == MISN_URUSOR)
|| (game.area == MISN_POSWIC))
{
aliens[ALIEN_SID].x = player.x - 100;
aliens[ALIEN_SID].y = player.y;
@ -2693,9 +2796,10 @@ int game_mainLoop()
}
}
}
else if ((game.area == MISN_VENUS) &&
(engine.musicVolume > 0))
else if ((game.area == MISN_VENUS)
&& (engine.musicVolume > 0))
{
player_getInput();
engine.keyState[KEY_UP] = 0;
engine.keyState[KEY_DOWN] = 0;
engine.keyState[KEY_LEFT] = 0;
@ -2704,7 +2808,7 @@ int game_mainLoop()
engine.keyState[KEY_ALTFIRE] = 0;
engine.xaxis = 0;
engine.yaxis = 0;
LIMIT_ADD(engine.musicVolume, -0.2, 0, 100);
LIMIT_ADD(engine.musicVolume, -0.2, 0, MIX_MAX_VOLUME);
audio_setMusicVolume(engine.musicVolume);
}
else
@ -2719,7 +2823,8 @@ int game_mainLoop()
}
else
{
LIMIT_ADD(engine.musicVolume, -0.2, 0, 100);
player_getInput();
LIMIT_ADD(engine.musicVolume, -0.2, 0, MIX_MAX_VOLUME);
audio_setMusicVolume(engine.musicVolume);
if (SDL_GetTicks() >= engine.missionCompleteTimer)
{
@ -2799,7 +2904,7 @@ int game_mainLoop()
WRAP_ADD(engine.addAliens, -1, 0, mission.addAliens);
if ((engine.addAliens == 0) && (allowableAliens > 0))
{
allowableAliens -= alien_add();
allowableAliens -= alien_add(NULL);
}
}
@ -2807,8 +2912,8 @@ int game_mainLoop()
engine.missionCompleteTimer = SDL_GetTicks() + 7000;
// specific to Boss 1
if ((game.area == MISN_MOEBO) &&
(aliens[ALIEN_BOSS].flags & FL_ESCAPED))
if ((game.area == MISN_MOEBO)
&& (aliens[ALIEN_BOSS].flags & FL_ESCAPED))
{
audio_playSound(SFX_DEATH, aliens[ALIEN_BOSS].x, aliens[ALIEN_BOSS].y);
screen_clear(white);

View File

@ -1,7 +1,7 @@
/*
Copyright (C) 2003 Parallel Realities
Copyright (C) 2011 Guus Sliepen
Copyright (C) 2015-2020 Layla Marchant <diligentcircle@riseup.net>
Copyright (C) 2015-2020 The Diligent Circle <diligentcircle@riseup.net>
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
@ -64,6 +64,9 @@ typedef struct Game_ {
// remaining shield for experimental fighter
int experimentalShield;
// Whether to force interception targets to appear
int forceMisnTarget;
Uint32 timeTaken; // In seconds
int missionCompleted[MAX_PLANETS];
@ -99,6 +102,7 @@ extern Game game;
extern char game_systemNames[SYSTEM_MAX][STRMAX_SHORT];
void game_init();
void game_setStars();
void game_doStars();
void game_doExplosions();
void game_delayFrame();

View File

@ -1,7 +1,7 @@
/*
Copyright (C) 2003 Parallel Realities
Copyright (C) 2011, 2012, 2013 Guus Sliepen
Copyright (C) 2015-2020 Layla Marchant <diligentcircle@riseup.net>
Copyright (C) 2015-2020 The Diligent Circle <diligentcircle@riseup.net>
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
@ -646,9 +646,11 @@ void gfx_createTextObject(int index, const char *inString, int x, int y, int fon
gfx_textSprites[index].life = 0;
/* Shortcut: if we already rendered the same string in the same color, don't render it again. */
if (gfx_textSprites[index].text && gfx_textSprites[index].image &&
gfx_textSprites[index].fontColor == fontColor &&
!strcmp(gfx_textSprites[index].text, inString))
// TODO: Double-check this, I think it's trying to test if gfx_textSprites[index].image is NULL.
// Also, check what `text` will be when "empty".
if (gfx_textSprites[index].text && gfx_textSprites[index].image
&& (gfx_textSprites[index].fontColor == fontColor)
&& (strcmp(gfx_textSprites[index].text, inString) == 0))
{
gfx_textSprites[index].x = x;
gfx_textSprites[index].y = y;

View File

@ -1,7 +1,7 @@
/*
Copyright (C) 2003 Parallel Realities
Copyright (C) 2011 Guus Sliepen
Copyright (C) 2015-2020 Layla Marchant <diligentcircle@riseup.net>
Copyright (C) 2015-2020 The Diligent Circle <diligentcircle@riseup.net>
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License

View File

@ -1,7 +1,7 @@
/*
Copyright (C) 2003 Parallel Realities
Copyright (C) 2011, 2012, 2013 Guus Sliepen
Copyright (C) 2015-2020 Layla Marchant <diligentcircle@riseup.net>
Copyright (C) 2015-2020 The Diligent Circle <diligentcircle@riseup.net>
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License

View File

@ -1,7 +1,7 @@
/*
Copyright (C) 2003 Parallel Realities
Copyright (C) 2011 Guus Sliepen
Copyright (C) 2015-2020 Layla Marchant <diligentcircle@riseup.net>
Copyright (C) 2015-2020 The Diligent Circle <diligentcircle@riseup.net>
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License

View File

@ -1,7 +1,7 @@
/*
Copyright (C) 2003 Parallel Realities
Copyright (C) 2011, 2012, 2013 Guus Sliepen
Copyright (C) 2012, 2015-2020 Layla Marchant <diligentcircle@riseup.net>
Copyright (C) 2012, 2015-2020 The Diligent Circle <diligentcircle@riseup.net>
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
@ -179,6 +179,7 @@ void intermission_updateSystemStatus()
game.stationedPlanet = 0;
game.system = 1;
game.area = MISN_RESCUESLAVES;
game.forceMisnTarget = 1;
intermission_initPlanets(game.system);
if (game.difficulty == DIFFICULTY_ORIGINAL)
@ -189,6 +190,7 @@ void intermission_updateSystemStatus()
game.stationedPlanet = 0;
game.system = 2;
game.area = MISN_CLOAKFIGHTER;
game.forceMisnTarget = 1;
intermission_initPlanets(game.system);
if (game.difficulty == DIFFICULTY_ORIGINAL)
@ -693,10 +695,10 @@ static int intermission_showSystem(float pos, int selectable)
r.y -= (intermission_planets[planet].image->h / 2);
screen_blit(intermission_planets[planet].image, r.x, r.y);
if (selectable &&
game_collision(engine.cursor_x + 13, engine.cursor_y + 13, 6, 6,
r.x, r.y, intermission_planets[planet].image->w,
intermission_planets[planet].image->h))
if (selectable
&& game_collision(engine.cursor_x + 13, engine.cursor_y + 13,
6, 6, r.x, r.y, intermission_planets[planet].image->w,
intermission_planets[planet].image->h))
{
if (!printedName)
{
@ -754,8 +756,8 @@ static void intermission_showStatus(SDL_Surface *infoSurface)
for (int i = TS_STATUS_HEADER + 1 ; i < TS_STATUS_FOOTER ; i++)
{
y += 20;
if ((i == TS_CHRIS_HEADER) || (i == TS_PHOEBE_HEADER) ||
(i == TS_URSULA_HEADER))
if ((i == TS_CHRIS_HEADER) || (i == TS_PHOEBE_HEADER)
|| (i == TS_URSULA_HEADER))
y += 25;
gfx_textSprites[i].y = y;
@ -1057,7 +1059,7 @@ static void intermission_createMissionDetailSurface(SDL_Surface *comms, int miss
case MISN_FELLON:
/// Mission dialog: Mordor, Fellon (Sid Wilson)
strcpy(string, _("A rebel group has organized a counter strike. If we can help them secure a victory it will be a real boost to morale."));
strcpy(string, _("A rebel group has organized a counter strike. If we can help them secure a victory, it will be a real boost to morale."));
y = intermission_renderDialog(comms, y, FS_SID, string);
/// Mission dialog: Mordor, Fellon (Chris Bainfield)
@ -1226,7 +1228,7 @@ static void intermission_createMissionDetailSurface(SDL_Surface *comms, int miss
strcpy(string, "Hey, why am I talking to myself? This shouldn't happen! Clearly, this must be a bug.");
y = intermission_renderDialog(comms, y, FS_CHRIS, string);
snprintf(string, STRMAX, "I should go to starfighter.nongnu.org and report this bug there. In that report, I should mention that the mission number is %d.", misn);
snprintf(string, STRMAX, "I should go to pr-starfighter.github.io and report this bug there. In that report, I should mention that the mission number is %d.", misn);
y = intermission_renderDialog(comms, y, FS_CHRIS, string);
strcpy(string, "Wait, what am I still talking into empty space for? It's not like anyone can hear me...");
@ -1318,7 +1320,11 @@ static void intermission_doOptions(SDL_Surface *optionsSurface, int x, int y)
if (game_collision(engine.cursor_x + 13, engine.cursor_y + 13, 6, 6, x + 187, y + 92, 45, 22))
{
engine.useMusic = 1;
#ifdef OLD_MUSIC
audio_playMusic("music/3DParadise.mod", -1);
#else
audio_playMusic("music/through_space.ogg", -1);
#endif
}
if (game_collision(engine.cursor_x + 13, engine.cursor_y + 13, 6, 6, x + 248, y + 92, 45, 22))
@ -1461,8 +1467,7 @@ int intermission()
intermission_createCommsSurface(commsSurface);
// Remove the Supercharge, if it is there
if ((game.difficulty != DIFFICULTY_SUPEREASY)
&& (game.difficulty != DIFFICULTY_EASY)
if ((game.difficulty > DIFFICULTY_EASY)
&& (game.difficulty != DIFFICULTY_ORIGINAL))
{
weapons[W_PLAYER_WEAPON].reload[0] = MAX(
@ -1500,7 +1505,11 @@ int intermission()
}
if ((engine.useAudio) && (engine.useMusic))
#ifdef OLD_MUSIC
audio_playMusic("music/3DParadise.mod", -1);
#else
audio_playMusic("music/through_space.ogg", -1);
#endif
/// Retain "%s" as-is. It is replaced with the current system name.
snprintf(string, STRMAX_SHORT, _("System : %s"), game_systemNames[game.system]);
@ -1729,8 +1738,8 @@ int intermission()
x = screen->w / 16;
y = screen->h - 80;
w = screen->w - 2 * x - 32;
if ((game.stationedPlanet == game.destinationPlanet) &&
(!intermission_planets[game.stationedPlanet].missionCompleted))
if ((game.stationedPlanet == game.destinationPlanet)
&& (!intermission_planets[game.stationedPlanet].missionCompleted))
screen_blit(gfx_sprites[SP_START_MISSION], x, y);
else if (game.stationedPlanet != game.destinationPlanet)
screen_blit(gfx_sprites[SP_GOTO], x, y);
@ -1743,9 +1752,9 @@ int intermission()
screen_blit(gfx_sprites[SP_OPTIONS], x + 6 * w / 7, y);
screen_blit(gfx_sprites[SP_EXIT], x + w, y);
if (game_collision(engine.cursor_x + 13, engine.cursor_y + 13, 6, 6, x, y, 32, 32) &&
((game.stationedPlanet != game.destinationPlanet) ||
(!intermission_planets[game.stationedPlanet].missionCompleted)))
if (game_collision(engine.cursor_x + 13, engine.cursor_y + 13, 6, 6, x, y, 32, 32)
&& ((game.stationedPlanet != game.destinationPlanet)
|| (!intermission_planets[game.stationedPlanet].missionCompleted)))
{
if (game.stationedPlanet == game.destinationPlanet)
screen_blitText(TS_INFO_START_MISSION, -1, screen->h - 25);

View File

@ -1,7 +1,7 @@
/*
Copyright (C) 2003 Parallel Realities
Copyright (C) 2011 Guus Sliepen
Copyright (C) 2015-2020 Layla Marchant <diligentcircle@riseup.net>
Copyright (C) 2015-2020 The Diligent Circle <diligentcircle@riseup.net>
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License

View File

@ -1,7 +1,7 @@
/*
Copyright (C) 2003 Parallel Realities
Copyright (C) 2011, 2012, 2013 Guus Sliepen
Copyright (C) 2012, 2015-2020 Layla Marchant <diligentcircle@riseup.net>
Copyright (C) 2012, 2015-2020 The Diligent Circle <diligentcircle@riseup.net>
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
@ -98,7 +98,7 @@ void mission_init()
mission_clearAll();
/// Mission objective (start)
strcpy(missions[MISN_START].primaryObjective[0], _("Escape from WEAPCO Persuit"));
strcpy(missions[MISN_START].primaryObjective[0], _("Escape from WEAPCO Pursuit"));
missions[MISN_START].primaryType[0] = M_DESTROY_ALL_TARGETS;
missions[MISN_START].completed1[0] = OB_INCOMPLETE;
@ -565,8 +565,8 @@ static void mission_killAllEnemies()
{
for (int i = 0 ; i < ALIEN_MAX ; i++)
{
if ((aliens[i].flags & FL_WEAPCO) && (aliens[i].active) &&
(aliens[i].shield > 0))
if ((aliens[i].flags & FL_WEAPCO) && (aliens[i].active)
&& (aliens[i].shield > 0))
aliens[i].shield = 0;
}
}
@ -596,13 +596,13 @@ void mission_checkTimer()
}
// specific to Spirit Boss
if ((game.area == MISN_MOEBO) &&
(mission.completed1[0] < OB_INCOMPLETE))
if ((game.area == MISN_MOEBO)
&& (mission.completed1[0] < OB_INCOMPLETE))
engine.timeMission = 1;
// specific to the Asteroid belt
if ((game.area == MISN_MARS) &&
(mission.completed1[0] < OB_INCOMPLETE))
if ((game.area == MISN_MARS)
&& (mission.completed1[0] < OB_INCOMPLETE))
{
mission.completed1[0] = OB_COMPLETED;
mission_killAllEnemies();
@ -616,8 +616,8 @@ static void mission_evaluate(int type, int id, int *completed, int *targetValue,
char message[STRMAX_SHORT];
char fmt[STRMAX_SHORT];
if ((*targetValue <= 0) && (type != M_PROTECT_TARGET) &&
(type != M_PROTECT_PICKUP))
if ((*targetValue <= 0) && (type != M_PROTECT_TARGET)
&& (type != M_PROTECT_PICKUP))
{
*completed = OB_JUST_COMPLETED;
mission_checkTimer();
@ -814,9 +814,9 @@ void mission_updateRequirements(int type, int id, int value)
{
if ((mission.completed1[i] == OB_INCOMPLETE) || (mission.completed1[i] == OB_CONDITION))
{
if ((mission.primaryType[i] == type) &&
((mission.target1[i] == id) ||
(mission.target1[i] == CD_ANY)))
if ((mission.primaryType[i] == type)
&& ((mission.target1[i] == id)
|| (mission.target1[i] == CD_ANY)))
{
matched = 1;
mission.targetValue1[i] -= value;
@ -833,9 +833,9 @@ void mission_updateRequirements(int type, int id, int value)
{
if ((mission.completed2[i] == OB_INCOMPLETE) || (mission.completed2[i] == OB_CONDITION))
{
if ((mission.secondaryType[i] == type) &&
((mission.target2[i] == id) ||
(mission.target2[i] == CD_ANY)))
if ((mission.secondaryType[i] == type)
&& ((mission.target2[i] == id)
|| (mission.target2[i] == CD_ANY)))
{
mission.targetValue2[i] -= value;
mission_evaluate(type, id, &mission.completed2[i], &mission.targetValue2[i], FONT_YELLOW);
@ -889,7 +889,7 @@ void mission_updateRequirements(int type, int id, int value)
intermission_planets[PLANET_CLOAKFIGHTER].missionCompleted = 1;
/// Dialog (Chris Bainfield)
/// Used when the Mordor cloak ship is destroyed.
radio_setMessage(FS_CHRIS, _("That's one less suprise that WEAPCO can spring on us!"), 1);
radio_setMessage(FS_CHRIS, _("That's one less surprise that WEAPCO can spring on us!"), 1);
game.experimentalShield = 0;
}
}
@ -924,7 +924,11 @@ static int mission_revealObjectives()
aliens[ALIEN_KLINE].y = player.y;
aliens[ALIEN_KLINE].flags |= FL_IMMORTAL | FL_NOFIRE;
player_setTarget(ALIEN_KLINE);
#ifdef OLD_MUSIC
audio_playMusic("music/TranceGeneration.mod", -1);
#else
audio_playMusic("music/last_cyber_dance.ogg", -1);
#endif
}
}
@ -937,7 +941,9 @@ int mission_checkCompleted()
{
if (mission.completed1[i] == OB_INCOMPLETE)
{
if ((mission.primaryType[i] == M_DESTROY_ALL_TARGETS) && (engine.allAliensDead) && (mission.remainingObjectives1 + mission.remainingObjectives2 == 1))
if ((mission.primaryType[i] == M_DESTROY_ALL_TARGETS)
&& (engine.allAliensDead)
&& (mission.remainingObjectives1 + mission.remainingObjectives2 == 1))
{
mission.completed1[i] = OB_JUST_COMPLETED;
mission_checkTimer();
@ -949,7 +955,9 @@ int mission_checkCompleted()
{
if (mission.completed2[i] == OB_INCOMPLETE)
{
if ((mission.secondaryType[i] == M_DESTROY_ALL_TARGETS) && (engine.allAliensDead) && (mission.remainingObjectives1 + mission.remainingObjectives2 == 1))
if ((mission.secondaryType[i] == M_DESTROY_ALL_TARGETS)
&& (engine.allAliensDead)
&& (mission.remainingObjectives1 + mission.remainingObjectives2 == 1))
{
mission.completed2[i] = OB_JUST_COMPLETED;
mission_checkTimer();
@ -983,10 +991,10 @@ int mission_checkCompleted()
mission.completed1[i] = OB_COMPLETED;
// do some area specific things
if ((game.area == MISN_MOEBO) ||
(game.area == MISN_DORIM) ||
(game.area == MISN_ELLESH) ||
(game.area == MISN_MARS))
if ((game.area == MISN_MOEBO)
|| (game.area == MISN_DORIM)
|| (game.area == MISN_ELLESH)
|| (game.area == MISN_MARS))
{
if (mission.remainingObjectives2 == 0)
{
@ -1017,8 +1025,8 @@ int mission_checkCompleted()
mission.completed2[i] = OB_COMPLETED;
// do some area specific things
if ((game.area == MISN_DORIM) &&
(mission.remainingObjectives1 == 0))
if ((game.area == MISN_DORIM)
&& (mission.remainingObjectives1 == 0))
{
mission_killAllEnemies();
engine.addAliens = -1;
@ -1167,10 +1175,12 @@ void mission_showStartScreen()
gfx_createTextObject(TS_POWER, "Power", 0, 0, FONT_WHITE);
gfx_createTextObject(TS_OUTPUT, "Output", 0, 0, FONT_WHITE);
gfx_createTextObject(TS_COOLER, "Cooler", 0, 0, FONT_WHITE);
audio_playRandomTrack();
if (game.area != MISN_INTERCEPTION)
{
// Note: music is started here only for regular missions. For
// interceptions, it is instead started by game_mainLoop().
audio_playRandomTrack();
renderer_update();
player_flushInput();
@ -1222,17 +1232,17 @@ void mission_showStartScreen()
break;
}
if ((game.area == MISN_URUSOR) ||
(game.area == MISN_POSWIC) ||
(game.area == MISN_EARTH))
if ((game.area == MISN_URUSOR)
|| (game.area == MISN_POSWIC)
|| (game.area == MISN_EARTH))
screen_renderUnicode(_("Sid Wilson will join you on this mission"), screen->w / 2 - BRIEFING_WIDTH / 2 + 20, screen->h / 2 + 175, FONT_WHITE);
renderer_update();
game_delayFrame();
player_getInput();
if ((engine.keyState[KEY_FIRE]) || (engine.keyState[KEY_ALTFIRE]) ||
(engine.keyState[KEY_ESCAPE]))
if ((engine.keyState[KEY_FIRE]) || (engine.keyState[KEY_ALTFIRE])
|| (engine.keyState[KEY_ESCAPE]))
break;
}

View File

@ -1,7 +1,7 @@
/*
Copyright (C) 2003 Parallel Realities
Copyright (C) 2011 Guus Sliepen
Copyright (C) 2015-2020 Layla Marchant <diligentcircle@riseup.net>
Copyright (C) 2015-2020 The Diligent Circle <diligentcircle@riseup.net>
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License

View File

@ -1,7 +1,7 @@
/*
Copyright (C) 2003 Parallel Realities
Copyright (C) 2011, 2012, 2013 Guus Sliepen
Copyright (C) 2012, 2015-2020 Layla Marchant <diligentcircle@riseup.net>
Copyright (C) 2012, 2015-2020 The Diligent Circle <diligentcircle@riseup.net>
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
@ -49,8 +49,14 @@ Initialises the player for a new game.
void player_init()
{
player.active = 1;
player.x = screen->w / 2;
player.y = screen->h / 2;
if (game.difficulty == DIFFICULTY_ORIGINAL) {
player.x = screen->w / 4;
player.y = screen->h / 3;
}
else {
player.x = screen->w / 2;
player.y = screen->h / 2;
}
player.speed = 2;
player.systemPower = player.maxShield;
player.face = 0;
@ -99,14 +105,14 @@ void player_damage(int amount, int delay)
player_resetDamageDelay = 0;
if ((!engine.cheatShield) && (engine.missionCompleteTimer == 0) &&
((!player.hit) ||
(game.difficulty == DIFFICULTY_ORIGINAL) ||
((player.shield != engine.lowShield) &&
(player.shield != 1))))
if ((!engine.cheatShield) && (engine.missionCompleteTimer == 0)
&& ((!player.hit)
|| (game.difficulty == DIFFICULTY_ORIGINAL)
|| ((player.shield != engine.lowShield)
&& (player.shield != 1))))
{
if ((game.difficulty == DIFFICULTY_ORIGINAL) ||
(player_damageDelay >= delay))
if ((game.difficulty == DIFFICULTY_ORIGINAL)
|| (player_damageDelay >= delay))
{
player.shield -= amount;
@ -115,8 +121,8 @@ void player_damage(int amount, int delay)
audio_playSound(SFX_HIT, player.x, player.y);
// Damage tiers (not in Classic mode)
if ((oldshield > engine.lowShield) &&
(player.shield <= engine.lowShield))
if ((oldshield > engine.lowShield)
&& (player.shield <= engine.lowShield))
{
info_setLine("!!! WARNING: SHIELD LOW !!!", FONT_RED);
if (game.difficulty != DIFFICULTY_ORIGINAL)
@ -452,6 +458,7 @@ void player_getInput()
if (engine.event.window.event == SDL_WINDOWEVENT_SIZE_CHANGED)
{
screen_adjustDimensions(engine.event.window.data1, engine.event.window.data2);
game_setStars();
renderer_reset();
gfx_scaleBackground();
screen_clear(black);
@ -460,8 +467,8 @@ void player_getInput()
screen_addBuffer(0, 0, screen->w, screen->h);
}
if (engine.autoPause &&
(engine.event.window.event == SDL_WINDOWEVENT_FOCUS_LOST))
if (engine.autoPause
&& (engine.event.window.event == SDL_WINDOWEVENT_FOCUS_LOST))
engine.paused = 1;
break;
}

View File

@ -1,7 +1,7 @@
/*
Copyright (C) 2003 Parallel Realities
Copyright (C) 2011 Guus Sliepen
Copyright (C) 2015-2020 Layla Marchant <diligentcircle@riseup.net>
Copyright (C) 2015-2020 The Diligent Circle <diligentcircle@riseup.net>
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License

View File

@ -1,7 +1,7 @@
/*
Copyright (C) 2003 Parallel Realities
Copyright (C) 2011, 2012, 2013 Guus Sliepen
Copyright (C) 2015-2020 Layla Marchant <diligentcircle@riseup.net>
Copyright (C) 2015-2020 The Diligent Circle <diligentcircle@riseup.net>
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License

View File

@ -1,7 +1,7 @@
/*
Copyright (C) 2003 Parallel Realities
Copyright (C) 2011 Guus Sliepen
Copyright (C) 2015-2020 Layla Marchant <diligentcircle@riseup.net>
Copyright (C) 2015-2020 The Diligent Circle <diligentcircle@riseup.net>
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License

View File

@ -1,7 +1,7 @@
/*
Copyright (C) 2003 Parallel Realities
Copyright (C) 2011, 2012, 2013 Guus Sliepen
Copyright (C) 2015-2020 Layla Marchant <diligentcircle@riseup.net>
Copyright (C) 2015-2020 The Diligent Circle <diligentcircle@riseup.net>
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License

View File

@ -1,7 +1,7 @@
/*
Copyright (C) 2003 Parallel Realities
Copyright (C) 2011 Guus Sliepen
Copyright (C) 2015-2020 Layla Marchant <diligentcircle@riseup.net>
Copyright (C) 2015-2020 The Diligent Circle <diligentcircle@riseup.net>
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License

View File

@ -1,7 +1,7 @@
/*
Copyright (C) 2003 Parallel Realities
Copyright (C) 2011, 2012, 2013 Guus Sliepen
Copyright (C) 2015-2020 Layla Marchant <diligentcircle@riseup.net>
Copyright (C) 2015-2020 The Diligent Circle <diligentcircle@riseup.net>
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
@ -160,42 +160,42 @@ int save_load(int slot)
{
case 4:
case 5:
if ((fscanf(fp, "%d%*c", &game.difficulty) < 1) ||
(fscanf(fp, "%d %d %d %d %d %d %d %d%*c",
if ((fscanf(fp, "%d%*c", &game.difficulty) < 1)
|| (fscanf(fp, "%d %d %d %d %d %d %d %d%*c",
&game.minPlasmaRateLimit, &game.minPlasmaDamageLimit,
&game.minPlasmaOutputLimit, &game.maxPlasmaRateLimit,
&game.maxPlasmaDamageLimit, &game.maxPlasmaOutputLimit,
&game.maxPlasmaAmmoLimit, &game.maxRocketAmmoLimit) < 8) ||
(fscanf(fp, "%d %d %d%*c%*[^\n]%*c", &game.system, &game.area,
&game.stationedPlanet) < 3) ||
(fscanf(fp, "%d %d%*c", &game.hasWingMate1, &game.hasWingMate2) < 2) ||
(fscanf(fp, "%d %d %d %d%*c", &player.maxShield,
&player.ammo[0], &player.ammo[1], &player.weaponType[1]) < 4) ||
(fscanf(fp, "%d %d %d%*c",
&game.maxPlasmaAmmoLimit, &game.maxRocketAmmoLimit) < 8)
|| (fscanf(fp, "%d %d %d%*c%*[^\n]%*c", &game.system, &game.area,
&game.stationedPlanet) < 3)
|| (fscanf(fp, "%d %d%*c", &game.hasWingMate1, &game.hasWingMate2) < 2)
|| (fscanf(fp, "%d %d %d %d%*c", &player.maxShield,
&player.ammo[0], &player.ammo[1], &player.weaponType[1]) < 4)
|| (fscanf(fp, "%d %d %d%*c",
&weapons[W_PLAYER_WEAPON].ammo[0],
&weapons[W_PLAYER_WEAPON].damage,
&weapons[W_PLAYER_WEAPON].reload[0]) < 3) ||
(fscanf(fp, "%d %d %d %d %d %d %d %d%*c",
&weapons[W_PLAYER_WEAPON].reload[0]) < 3)
|| (fscanf(fp, "%d %d %d %d %d %d %d %d%*c",
&game.minPlasmaRate, &game.minPlasmaDamage,
&game.minPlasmaOutput, &game.maxPlasmaRate,
&game.maxPlasmaDamage, &game.maxPlasmaOutput,
&game.maxPlasmaAmmo, &game.maxRocketAmmo) < 8) ||
(fscanf(fp, "%d %d %d %d %d %d %d %d %d %d %*d %*d %*d %*d %*d %*d %*d %*d %*d %*d%*c",
&game.maxPlasmaAmmo, &game.maxRocketAmmo) < 8)
|| (fscanf(fp, "%d %d %d %d %d %d %d %d %d %d %*d %*d %*d %*d %*d %*d %*d %*d %*d %*d%*c",
&game.missionCompleted[0], &game.missionCompleted[1],
&game.missionCompleted[2], &game.missionCompleted[3],
&game.missionCompleted[4], &game.missionCompleted[5],
&game.missionCompleted[6], &game.missionCompleted[7],
&game.missionCompleted[8], &game.missionCompleted[9]) < 10) ||
(fscanf(fp, "%d%*c", &game.experimentalShield) < 1) ||
(fscanf(fp, "%d %d%*c", &game.cash, &game.cashEarned) < 2) ||
(fscanf(fp, "%d %d %d %d %d %d %d %d %d %d %d %d %d %d %d%*c",
&game.missionCompleted[8], &game.missionCompleted[9]) < 10)
|| (fscanf(fp, "%d%*c", &game.experimentalShield) < 1)
|| (fscanf(fp, "%d %d%*c", &game.cash, &game.cashEarned) < 2)
|| (fscanf(fp, "%d %d %d %d %d %d %d %d %d %d %d %d %d %d %d%*c",
&game.shots, &game.hits, &game.accuracy, &game.totalKills,
&game.wingMate1Kills, &game.wingMate2Kills,
&game.wingMate1Ejects, &game.wingMate2Ejects,
&game.totalOtherKills, &game.shieldPickups,
&game.rocketPickups, &game.cellPickups, &game.powerups,
&game.minesKilled, &game.slavesRescued) < 15) ||
(fscanf(fp, "%lu%*c", &timeTaken) < 1))
&game.minesKilled, &game.slavesRescued) < 15)
|| (fscanf(fp, "%lu%*c", &timeTaken) < 1))
{
printf("Warning: Save data is not correctly formatted. Some data may be lost.\n");
}
@ -352,9 +352,9 @@ void save_createSurface(SDL_Surface *savesSurface, int clickedSlot)
gfx_drawRect(savesSurface, 5, 265, 100, 25, 0x00, 0x99, 0x00);
gfx_drawRect(savesSurface, 125, 265, 100, 25, 0x99, 0x99, 0x00);
gfx_drawRect(savesSurface, 243, 265, 100, 25, 0x99, 0x00, 0x00);
gfx_renderUnicode(_("SAVE"), 40, 270, FONT_WHITE, 0, savesSurface);
gfx_renderUnicode(_("CANCEL"), 150, 270, FONT_WHITE, 0, savesSurface);
gfx_renderUnicode(_("DELETE"), 270, 270, FONT_WHITE, 0, savesSurface);
gfx_renderUnicode(_("SAVE"), 10, 270, FONT_WHITE, 0, savesSurface);
gfx_renderUnicode(_("CANCEL"), 130, 270, FONT_WHITE, 0, savesSurface);
gfx_renderUnicode(_("DELETE"), 248, 270, FONT_WHITE, 0, savesSurface);
gfx_renderUnicode(_("SAVE will save the game"), 17, 200, FONT_WHITE, 0, savesSurface);
gfx_renderUnicode(_("CANCEL will unselect that slot"), 17, 220, FONT_WHITE, 0, savesSurface);
gfx_renderUnicode(_("DELETE will remove the save"), 17, 240, FONT_WHITE, 0, savesSurface);

View File

@ -1,7 +1,7 @@
/*
Copyright (C) 2003 Parallel Realities
Copyright (C) 2011 Guus Sliepen
Copyright (C) 2015-2020 Layla Marchant <diligentcircle@riseup.net>
Copyright (C) 2015-2020 The Diligent Circle <diligentcircle@riseup.net>
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License

View File

@ -1,7 +1,7 @@
/*
Copyright (C) 2003 Parallel Realities
Copyright (C) 2011, 2012, 2013 Guus Sliepen
Copyright (C) 2015-2020 Layla Marchant <diligentcircle@riseup.net>
Copyright (C) 2015-2020 The Diligent Circle <diligentcircle@riseup.net>
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License

View File

@ -1,7 +1,7 @@
/*
Copyright (C) 2003 Parallel Realities
Copyright (C) 2011 Guus Sliepen
Copyright (C) 2015-2020 Layla Marchant <diligentcircle@riseup.net>
Copyright (C) 2015-2020 The Diligent Circle <diligentcircle@riseup.net>
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License

View File

@ -1,7 +1,7 @@
/*
Copyright (C) 2003 Parallel Realities
Copyright (C) 2011, 2012 Guus Sliepen
Copyright (C) 2015-2020 Layla Marchant <diligentcircle@riseup.net>
Copyright (C) 2015-2020 The Diligent Circle <diligentcircle@riseup.net>
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
@ -68,8 +68,8 @@ void ship_fireBullet(Object *ship, int weaponIndex)
return;
// Remove some ammo from the player
if ((ship == &player) && (player.weaponType[weaponIndex] != W_LASER) &&
(player.ammo[weaponIndex] > 0) && (!engine.cheatAmmo))
if ((ship == &player) && (player.weaponType[weaponIndex] != W_LASER)
&& (player.ammo[weaponIndex] > 0) && (!engine.cheatAmmo))
player.ammo[weaponIndex]--;
switch(theWeapon->id)
@ -130,8 +130,8 @@ void ship_fireBullet(Object *ship, int weaponIndex)
// Reset the weapon reload time. Double it if it is not friendly or
// a boss or Kline
ship->reload[weaponIndex] = theWeapon->reload[0];
if ((ship->flags & FL_WEAPCO) && (ship != &aliens[ALIEN_BOSS]) &&
(ship != &aliens[ALIEN_KLINE]) && (theWeapon->id != W_LASER))
if ((ship->flags & FL_WEAPCO) && (ship != &aliens[ALIEN_BOSS])
&& (ship != &aliens[ALIEN_KLINE]) && (theWeapon->id != W_LASER))
ship->reload[weaponIndex] *= 2;
if ((ship == &player) && (weaponIndex == 0))
@ -173,8 +173,9 @@ void ship_fireRay(Object *ship)
if (player.shield > 0)
{
if (game_collision(player.x, player.y, player.image[0]->w,
player.image[0]->h, ray.x, ray.y, ray.w, ray.h) &&
(!engine.cheatShield) && (engine.missionCompleteTimer == 0))
player.image[0]->h, ray.x, ray.y, ray.w, ray.h)
&& (!engine.cheatShield)
&& (engine.missionCompleteTimer == 0))
{
player_damage(1, RAY_DAMAGE_DELAY);
explosion_add(player.x, player.y, SP_SMALL_EXPLOSION);
@ -187,8 +188,8 @@ void ship_fireRay(Object *ship)
if (aliens[i].flags & FL_IMMORTAL)
continue;
if ((aliens[i].shield > 0) && (ship != &aliens[i]) &&
(ship->classDef != aliens[i].classDef))
if ((aliens[i].shield > 0) && (ship != &aliens[i])
&& (ship->classDef != aliens[i].classDef))
{
if (game_collision(aliens[i].x, aliens[i].y, aliens[i].image[0]->w,
aliens[i].image[0]->h, ray.x, ray.y, ray.w, ray.h))

View File

@ -1,5 +1,5 @@
/*
Copyright (C) 2015-2020 Layla Marchant <diligentcircle@riseup.net>
Copyright (C) 2015-2020 The Diligent Circle <diligentcircle@riseup.net>
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License

View File

@ -1,7 +1,7 @@
/*
Copyright (C) 2003 Parallel Realities
Copyright (C) 2011, 2012, 2013 Guus Sliepen
Copyright (C) 2015-2020 Layla Marchant <diligentcircle@riseup.net>
Copyright (C) 2015-2020 The Diligent Circle <diligentcircle@riseup.net>
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
@ -97,8 +97,9 @@ static void drawSecondaryWeaponSurface()
}
gfx_renderUnicode(description, 10, 22, FONT_WHITE, 0, gfx_shopSprites[SHOP_S_SECONDARY]);
if ((player.weaponType[1] != W_LASER) &&
(player.weaponType[1] != W_CHARGER) && (player.weaponType[1] != W_NONE))
if ((player.weaponType[1] != W_LASER)
&& (player.weaponType[1] != W_CHARGER)
&& (player.weaponType[1] != W_NONE))
{
/// Retain "%d" as-is. It is replaced with the rocket capacity of the Firefly.
snprintf(description, STRMAX_SHORT, _("Capacity : %d"), game.maxRocketAmmo);
@ -234,16 +235,16 @@ static void drawShop()
}
}
gfx_shopSprites[SHOP_S_PRIMARY] = gfx_createSurface(190, 91);
gfx_shopSprites[SHOP_S_POWERUP] = gfx_createSurface(190, 91);
gfx_shopSprites[SHOP_S_SECONDARY] = gfx_createSurface(190, 91);
gfx_shopSprites[SHOP_S_PRIMARY] = gfx_createSurface(194, 91);
gfx_shopSprites[SHOP_S_POWERUP] = gfx_createSurface(203, 91);
gfx_shopSprites[SHOP_S_SECONDARY] = gfx_createSurface(194, 91);
gfx_drawRect(gfx_shopSprites[SHOP_S_PRIMARY], 0, 0, 189, 90, 0x00, 0x00, 0x55);
gfx_drawRect(gfx_shopSprites[SHOP_S_PRIMARY], 0, 0, 189, 20, 0x00, 0x00, 0x99);
gfx_drawRect(gfx_shopSprites[SHOP_S_POWERUP], 0, 0, 189, 90, 0x00, 0x00, 0x55);
gfx_drawRect(gfx_shopSprites[SHOP_S_POWERUP], 0, 0, 189, 20, 0x00, 0x00, 0x99);
gfx_drawRect(gfx_shopSprites[SHOP_S_SECONDARY], 0, 0, 189, 90, 0x00, 0x00, 0x55);
gfx_drawRect(gfx_shopSprites[SHOP_S_SECONDARY], 0, 0, 189, 20, 0x00, 0x00, 0x99);
gfx_drawRect(gfx_shopSprites[SHOP_S_PRIMARY], 0, 0, 193, 90, 0x00, 0x00, 0x55);
gfx_drawRect(gfx_shopSprites[SHOP_S_PRIMARY], 0, 0, 193, 20, 0x00, 0x00, 0x99);
gfx_drawRect(gfx_shopSprites[SHOP_S_POWERUP], 0, 0, 202, 90, 0x00, 0x00, 0x55);
gfx_drawRect(gfx_shopSprites[SHOP_S_POWERUP], 0, 0, 202, 20, 0x00, 0x00, 0x99);
gfx_drawRect(gfx_shopSprites[SHOP_S_SECONDARY], 0, 0, 193, 90, 0x00, 0x00, 0x55);
gfx_drawRect(gfx_shopSprites[SHOP_S_SECONDARY], 0, 0, 193, 20, 0x00, 0x00, 0x99);
gfx_shopSprites[SHOP_S_SHIP_INFO] = gfx_createAlphaRect(SHOP_WIDTH + 1, 41, 0x00, 0x00, 0x00);
gfx_drawRect(gfx_shopSprites[SHOP_S_SHIP_INFO], 0, 0, SHOP_WIDTH, 40, 0x00, 0x00, 0x33);
@ -261,22 +262,22 @@ static void drawShop()
case SHOP_PLASMA_MAX_DAMAGE:
case SHOP_PLASMA_MAX_RATE:
case SHOP_PLASMA_MAX_AMMO:
gfx_drawRect(gfx_shopSprites[SHOP_S_POWERUP], 0, 0, 189, 90, 0x55, 0x00, 0x00);
gfx_drawRect(gfx_shopSprites[SHOP_S_POWERUP], 0, 0, 189, 20, 0x99, 0x00, 0x00);
gfx_drawRect(gfx_shopSprites[SHOP_S_POWERUP], 0, 0, 202, 90, 0x55, 0x00, 0x00);
gfx_drawRect(gfx_shopSprites[SHOP_S_POWERUP], 0, 0, 202, 20, 0x99, 0x00, 0x00);
break;
case SHOP_PLASMA_MIN_OUTPUT:
case SHOP_PLASMA_MIN_DAMAGE:
case SHOP_PLASMA_MIN_RATE:
gfx_drawRect(gfx_shopSprites[SHOP_S_PRIMARY], 0, 0, 189, 90, 0x55, 0x00, 0x00);
gfx_drawRect(gfx_shopSprites[SHOP_S_PRIMARY], 0, 0, 189, 20, 0x99, 0x00, 0x00);
gfx_drawRect(gfx_shopSprites[SHOP_S_PRIMARY], 0, 0, 193, 90, 0x55, 0x00, 0x00);
gfx_drawRect(gfx_shopSprites[SHOP_S_PRIMARY], 0, 0, 193, 20, 0x99, 0x00, 0x00);
break;
case SHOP_PLASMA_AMMO:
case SHOP_ROCKET_AMMO:
gfx_drawRect(gfx_shopSprites[SHOP_S_SHIP_INFO], 0, 0, SHOP_WIDTH, 40, 0x33, 0x00, 0x00);
break;
default:
gfx_drawRect(gfx_shopSprites[SHOP_S_SECONDARY], 0, 0, 189, 90, 0x55, 0x00, 0x00);
gfx_drawRect(gfx_shopSprites[SHOP_S_SECONDARY], 0, 0, 189, 20, 0x99, 0x00, 0x00);
gfx_drawRect(gfx_shopSprites[SHOP_S_SECONDARY], 0, 0, 193, 90, 0x55, 0x00, 0x00);
gfx_drawRect(gfx_shopSprites[SHOP_S_SECONDARY], 0, 0, 193, 20, 0x99, 0x00, 0x00);
break;
}
@ -365,7 +366,7 @@ static void drawShop()
gfx_shopSprites[SHOP_S_ITEM_INFO] = gfx_createSurface(SHOP_WIDTH + 1, 56);
gfx_drawRect(gfx_shopSprites[SHOP_S_ITEM_INFO], 0, 0, SHOP_WIDTH, 35, 0x00, 0x99, 0x00);
gfx_drawRect(gfx_shopSprites[SHOP_S_ITEM_INFO], 0, 20, SHOP_WIDTH, 35, 0x00, 0x33, 0x00);
gfx_renderUnicode(_("Information"), 5, 4, FONT_WHITE, 0, gfx_shopSprites[SHOP_S_ITEM_INFO]);
gfx_renderUnicode(_("Information"), 10, 4, FONT_WHITE, 0, gfx_shopSprites[SHOP_S_ITEM_INFO]);
switch (shopSelectedItem)
{
@ -373,40 +374,40 @@ static void drawShop()
break;
case SHOP_ERROR_INSUFFICIENT_FUNDS:
/// For when the player attempts to buy something they can't afford.
gfx_renderUnicode(_("You don't have enough money"), 20, 30, FONT_WHITE, 0, gfx_shopSprites[SHOP_S_ITEM_INFO]);
gfx_renderUnicode(_("You don't have enough money"), 10, 30, FONT_WHITE, 0, gfx_shopSprites[SHOP_S_ITEM_INFO]);
break;
case SHOP_ERROR_CANNOT_UPGRADE:
/// For when the player attempts an upgrade beyond the maximum (line 1 of 2).
gfx_renderUnicode(_("Cannot upgrade ship"), 5, 22, FONT_WHITE, 0, gfx_shopSprites[SHOP_S_ITEM_INFO]);
gfx_renderUnicode(_("Cannot upgrade ship"), 10, 22, FONT_WHITE, 0, gfx_shopSprites[SHOP_S_ITEM_INFO]);
/// For when the player attempts an upgrade beyond the maximum (line 2 of 2).
gfx_renderUnicode(_("Hardware capacity has been reached"), 20, 38, FONT_CYAN, 0, gfx_shopSprites[SHOP_S_ITEM_INFO]);
gfx_renderUnicode(_("Hardware capacity has been reached"), 10, 38, FONT_CYAN, 0, gfx_shopSprites[SHOP_S_ITEM_INFO]);
break;
case SHOP_ERROR_AMMO_LIMIT:
/// For when the player attempts to buy more ammo than the ship can hold.
gfx_renderUnicode(_("Ammunition limit reached"), 20, 30, FONT_WHITE, 0, gfx_shopSprites[SHOP_S_ITEM_INFO]);
gfx_renderUnicode(_("Ammunition limit reached"), 10, 30, FONT_WHITE, 0, gfx_shopSprites[SHOP_S_ITEM_INFO]);
break;
case SHOP_ERROR_CANNOT_SELL:
/// For when the player attempts to sell an item they aren't allowed to sell.
gfx_renderUnicode(_("You cannot sell that item"), 20, 30, FONT_WHITE, 0, gfx_shopSprites[SHOP_S_ITEM_INFO]);
gfx_renderUnicode(_("You cannot sell that item"), 10, 30, FONT_WHITE, 0, gfx_shopSprites[SHOP_S_ITEM_INFO]);
break;
case SHOP_ERROR_NOTHING_TO_SELL:
/// For when the player attempts to sell an item they don't have any of.
gfx_renderUnicode(_("Nothing to sell"), 20, 30, FONT_WHITE, 0, gfx_shopSprites[SHOP_S_ITEM_INFO]);
gfx_renderUnicode(_("Nothing to sell"), 10, 30, FONT_WHITE, 0, gfx_shopSprites[SHOP_S_ITEM_INFO]);
break;
case SHOP_ERROR_IS_NOT_ROCKETS:
/// For when the player attempts to buy rockets or rocket capacity
/// while secondary weapon is either laser or charge cannon.
gfx_renderUnicode(_("Rockets cannot be bought for Laser or Charger Cannon"), 5, 30, FONT_WHITE, 0, gfx_shopSprites[SHOP_S_ITEM_INFO]);
gfx_renderUnicode(_("Rockets cannot be bought for Laser or Charger Cannon"), 10, 30, FONT_WHITE, 0, gfx_shopSprites[SHOP_S_ITEM_INFO]);
break;
case SHOP_ERROR_ALREADY_OWNED:
/// For when the player attempts to buy a weapon they already have.
gfx_renderUnicode(_("You already have that weapon"), 20, 30, FONT_WHITE, 0, gfx_shopSprites[SHOP_S_ITEM_INFO]);
gfx_renderUnicode(_("You already have that weapon"), 10, 30, FONT_WHITE, 0, gfx_shopSprites[SHOP_S_ITEM_INFO]);
break;
case SHOP_ERROR_WEAPON_CAPACITY:
/// For when the player attempts to increase rocket capacity beyond
/// what is allowed for the weapon (used for homing missiles).
gfx_renderUnicode(_("This weapon's ammo limit has been reached"), 20, 30, FONT_WHITE, 0, gfx_shopSprites[SHOP_S_ITEM_INFO]);
gfx_renderUnicode(_("This weapon's ammo limit has been reached"), 10, 30, FONT_WHITE, 0, gfx_shopSprites[SHOP_S_ITEM_INFO]);
break;
default:
if (shopItems[shopSelectedItem].price != 0)
@ -425,9 +426,9 @@ static void drawShop()
snprintf(description, STRMAX, _("%s (N/A)"),
shopItems[shopSelectedItem].description);
}
gfx_renderUnicode(shopItems[shopSelectedItem].name, 5, 22,
gfx_renderUnicode(shopItems[shopSelectedItem].name, 20, 22,
FONT_WHITE, 0, gfx_shopSprites[SHOP_S_ITEM_INFO]);
gfx_renderUnicode(description, 20, 38, FONT_CYAN, 0, gfx_shopSprites[SHOP_S_ITEM_INFO]);
gfx_renderUnicode(description, 10, 38, FONT_CYAN, 0, gfx_shopSprites[SHOP_S_ITEM_INFO]);
break;
}
}
@ -645,8 +646,8 @@ static void buy(int i)
break;
case SHOP_ROCKET_AMMO:
if ((player.weaponType[1] == W_CHARGER) ||
(player.weaponType[1] == W_LASER))
if ((player.weaponType[1] == W_CHARGER)
|| (player.weaponType[1] == W_LASER))
{
shopSelectedItem = SHOP_ERROR_IS_NOT_ROCKETS;
return;
@ -656,20 +657,20 @@ static void buy(int i)
shopSelectedItem = SHOP_ERROR_AMMO_LIMIT;
return;
}
if ((player.weaponType[1] == W_HOMING_MISSILE) &&
(player.ammo[1] >= MAX_HOMING))
if ((player.weaponType[1] == W_HOMING_MISSILE)
&& (player.ammo[1] >= MAX_HOMING))
{
shopSelectedItem = SHOP_ERROR_WEAPON_CAPACITY;
return;
}
if ((player.weaponType[1] == W_DOUBLE_HOMING_MISSILES) &&
(player.ammo[1] >= MAX_DOUBLE_HOMING))
if ((player.weaponType[1] == W_DOUBLE_HOMING_MISSILES)
&& (player.ammo[1] >= MAX_DOUBLE_HOMING))
{
shopSelectedItem = SHOP_ERROR_WEAPON_CAPACITY;
return;
}
if ((player.weaponType[1] == W_MICRO_HOMING_MISSILES) &&
(player.ammo[1] >= MAX_MICRO_HOMING))
if ((player.weaponType[1] == W_MICRO_HOMING_MISSILES)
&& (player.ammo[1] >= MAX_MICRO_HOMING))
{
shopSelectedItem = SHOP_ERROR_WEAPON_CAPACITY;
return;
@ -723,26 +724,26 @@ static void buy(int i)
break;
case SHOP_ROCKET_MAX_AMMO:
if ((player.weaponType[1] == W_CHARGER) ||
(player.weaponType[1] == W_LASER))
if ((player.weaponType[1] == W_CHARGER)
|| (player.weaponType[1] == W_LASER))
{
shopSelectedItem = SHOP_ERROR_IS_NOT_ROCKETS;
return;
}
if ((player.weaponType[1] == W_HOMING_MISSILE) &&
(game.maxRocketAmmo >= MAX_HOMING))
if ((player.weaponType[1] == W_HOMING_MISSILE)
&& (game.maxRocketAmmo >= MAX_HOMING))
{
shopSelectedItem = SHOP_ERROR_WEAPON_CAPACITY;
return;
}
if ((player.weaponType[1] == W_DOUBLE_HOMING_MISSILES) &&
(game.maxRocketAmmo >= MAX_DOUBLE_HOMING))
if ((player.weaponType[1] == W_DOUBLE_HOMING_MISSILES)
&& (game.maxRocketAmmo >= MAX_DOUBLE_HOMING))
{
shopSelectedItem = SHOP_ERROR_WEAPON_CAPACITY;
return;
}
if ((player.weaponType[1] == W_MICRO_HOMING_MISSILES) &&
(game.maxRocketAmmo >= MAX_MICRO_HOMING))
if ((player.weaponType[1] == W_MICRO_HOMING_MISSILES)
&& (game.maxRocketAmmo >= MAX_MICRO_HOMING))
{
shopSelectedItem = SHOP_ERROR_WEAPON_CAPACITY;
return;
@ -1113,8 +1114,8 @@ void shop_show()
screen_blit(gfx_shopSprites[SHOP_S_CATALOG], SHOP_X, SHOP_Y + 50);
screen_blit(gfx_shopSprites[SHOP_S_ITEM_INFO], SHOP_X, SHOP_Y + 180);
screen_blit(gfx_shopSprites[SHOP_S_PRIMARY], SHOP_X, SHOP_Y + 245);
screen_blit(gfx_shopSprites[SHOP_S_POWERUP], SHOP_X + 203, SHOP_Y + 245);
screen_blit(gfx_shopSprites[SHOP_S_SECONDARY], SHOP_X + 406, SHOP_Y + 245);
screen_blit(gfx_shopSprites[SHOP_S_POWERUP], SHOP_X + 199, SHOP_Y + 245);
screen_blit(gfx_shopSprites[SHOP_S_SECONDARY], SHOP_X + 407, SHOP_Y + 245);
if (shopSelectedItem > SHOP_NOTHING)
{

View File

@ -1,7 +1,7 @@
/*
Copyright (C) 2003 Parallel Realities
Copyright (C) 2011 Guus Sliepen
Copyright (C) 2015-2020 Layla Marchant <diligentcircle@riseup.net>
Copyright (C) 2015-2020 The Diligent Circle <diligentcircle@riseup.net>
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License

View File

@ -1,7 +1,7 @@
/*
Copyright (C) 2003 Parallel Realities
Copyright (C) 2011, 2012, 2013 Guus Sliepen
Copyright (C) 2015-2020 Layla Marchant <diligentcircle@riseup.net>
Copyright (C) 2015-2020 The Diligent Circle <diligentcircle@riseup.net>
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License

View File

@ -1,7 +1,7 @@
/*
Copyright (C) 2003 Parallel Realities
Copyright (C) 2011, 2012, 2013 Guus Sliepen
Copyright (C) 2012, 2015-2020 Layla Marchant <diligentcircle@riseup.net>
Copyright (C) 2012, 2015-2020 The Diligent Circle <diligentcircle@riseup.net>
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
@ -245,8 +245,10 @@ int title_show()
prlogo = gfx_loadImage("gfx/prlogo.png");
sflogo = gfx_loadImage("gfx/sflogo.png");
gfx_createTextObject(TS_DILIGENTCIRCLE, "THE DILIGENT CIRCLE", 0, 0, FONT_WHITE);
gfx_createTextObject(TS_PRESENTS, "PRESENTS", 0, 0, FONT_WHITE);
gfx_createTextObject(TS_AN_SDL_GAME, "AN SDL GAME", 0, 0, FONT_WHITE);
gfx_createTextObject(TS_ORIGINALLY_BY, "ORIGINALLY BY", 0, 0, FONT_WHITE);
gfx_createTextObject(TS_START_NEW_GAME, _("START NEW GAME"), 0, 0, FONT_WHITE);
gfx_createTextObject(TS_LOAD_GAME, _("LOAD GAME"), 0, 0, FONT_WHITE);
gfx_createTextObject(TS_CONTINUE_CURRENT_GAME, _("CONTINUE CURRENT GAME"), 0, 0, FONT_WHITE);
@ -266,7 +268,7 @@ int title_show()
5, 0, FONT_WHITE, 0, copyrightText);
gfx_renderString("Copyright Guus Sliepen, Astrid S. de Wijn and others 2012",
5, MENU_SPACING, FONT_WHITE, 0, copyrightText);
gfx_renderString("Copyright 2015-2020 Layla Marchant",
gfx_renderString("Copyright 2015-2020 The Diligent Circle",
5, 2 * MENU_SPACING, FONT_WHITE, 0, copyrightText);
snprintf(buildVersion, STRMAX_SHORT, "Version %s", VERSION );
@ -313,7 +315,11 @@ int title_show()
player_flushInput();
engine.keyState[KEY_FIRE] = engine.keyState[KEY_ALTFIRE] = 0;
audio_playMusic("music/walking_among_androids.ogg", 1);
#ifdef OLD_MUSIC
audio_playMusic("music/Platinum.mod", 1);
#else
audio_playMusic("music/android_oppression.ogg", 1);
#endif
while (!engine.done)
{
@ -338,23 +344,28 @@ int title_show()
}
}
if ((now - then > 2000) && (now - then < 8000) && (!skip))
if ((now - then > 2000) && (now - then < 7000) && (!skip))
{
screen_blit(prlogo, ((screen->w - prlogo->w) / 2), ((screen->h - prlogo->h) / 2));
screen_blitText(TS_DILIGENTCIRCLE, -1, screen->h / 2);
}
else if ((now - then > 9000) && (now - then < 15000) && (!skip))
else if ((now - then > 7500) && (now - then < 14250) && (!skip))
{
screen_blitText(TS_PRESENTS, -1, screen->h / 2);
}
else if ((now - then > 16000) && (now - then < 21000) && (!skip))
else if ((now - then > 14750) && (now - then < 21500) && (!skip))
{
screen_blitText(TS_AN_SDL_GAME, -1, screen->h / 2);
}
else if ((now - then > 25500) || (skip))
else if ((now - then > 22000) && (now - then < 29000) && (!skip))
{
screen_blitText(TS_ORIGINALLY_BY, -1, screen->h / 2 - MENU_SPACING);
screen_blit(prlogo, ((screen->w - prlogo->w) / 2), screen->h / 2);
}
else if ((now - then > 29500) || (skip))
{
screen_blit(sflogo, ((screen->w - sflogo->w) / 2), ((screen->h - sflogo->h) / 3));
if ((now - then >= 27500) || (skip))
if ((now - then >= 33250) || (skip))
{
optionRec.x = screen->w / 2 - optionRec.w / 2;
optionRec.y = (MENU_Y - 4 - MENU_SPACING) + MENU_SPACING * selectedOption;
@ -510,7 +521,11 @@ int title_show()
if (engine.useMusic)
{
audio_playMusic("music/walking_among_androids.ogg", 1);
#ifdef OLD_MUSIC
audio_playMusic("music/Platinum.mod", 1);
#else
audio_playMusic("music/android_oppression.ogg", 1);
#endif
}
else
{
@ -643,7 +658,11 @@ void title_showCredits()
screen_drawBackground();
#ifdef OLD_MUSIC
audio_playMusic("music/Solace.s3m", 1);
#else
audio_playMusic("music/rise_of_spirit.ogg", 1);
#endif
fp = fopen("data/credits.txt", "rb");
@ -695,9 +714,16 @@ void title_showCredits()
screen_unBuffer();
player_getInput();
if (engine.keyState[KEY_ESCAPE] || engine.keyState[KEY_FIRE] ||
engine.keyState[KEY_ALTFIRE])
if (engine.keyState[KEY_ESCAPE] || engine.keyState[KEY_FIRE]
|| engine.keyState[KEY_ALTFIRE])
break;
// Check to see if we need to reposition credits
if (credit[0].x != (screen->w - credit[0].image->w) / 2) {
for (i=0; i< nCredit; i++) {
credit[i].x = (screen->w - credit[i].image->w) / 2;
}
}
float speed = 0.5;
if (engine.keyState[KEY_DOWN])

View File

@ -1,7 +1,7 @@
/*
Copyright (C) 2003 Parallel Realities
Copyright (C) 2011 Guus Sliepen
Copyright (C) 2015-2020 Layla Marchant <diligentcircle@riseup.net>
Copyright (C) 2015-2020 The Diligent Circle <diligentcircle@riseup.net>
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License

View File

@ -1,7 +1,7 @@
/*
Copyright (C) 2003 Parallel Realities
Copyright (C) 2011, 2013 Guus Sliepen
Copyright (C) 2015-2020 Layla Marchant <diligentcircle@riseup.net>
Copyright (C) 2015-2020 The Diligent Circle <diligentcircle@riseup.net>
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
@ -23,7 +23,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
Object weapons[W_MAX];
/*
A list of predefined weaponary.
A list of predefined weaponry.
*/
void weapons_init()
{

View File

@ -1,7 +1,7 @@
/*
Copyright (C) 2003 Parallel Realities
Copyright (C) 2011 Guus Sliepen
Copyright (C) 2015-2020 Layla Marchant <diligentcircle@riseup.net>
Copyright (C) 2015-2020 The Diligent Circle <diligentcircle@riseup.net>
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License

View File

@ -1,7 +1,7 @@
/*
Copyright (C) 2003 Parallel Realities
Copyright (C) 2011, 2012, 2013 Guus Sliepen
Copyright (C) 2015-2020 Layla Marchant <diligentcircle@riseup.net>
Copyright (C) 2015-2020 The Diligent Circle <diligentcircle@riseup.net>
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License

View File

@ -1,7 +1,7 @@
/*
Copyright (C) 2003 Parallel Realities
Copyright (C) 2011 Guus Sliepen
Copyright (C) 2015-2020 Layla Marchant <diligentcircle@riseup.net>
Copyright (C) 2015-2020 The Diligent Circle <diligentcircle@riseup.net>
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License

View File

@ -7,6 +7,6 @@
# Helper script to cross-compile for Windows with MXE.
# Note: Before running, be sure to add the MXE usr/bin location to PATH.
./configure --host=i686-w64-mingw32.static SF_RUN_IN_PLACE=1 SF_NOWARN=1
./configure --host=i686-w64-mingw32.static SF_RUN_IN_PLACE=1 SF_UNHARDEN=1
make
mv src/starfighter.exe .