Compare commits
79 Commits
Author | SHA1 | Date |
---|---|---|
diligentcircle | d564db380d | |
The Diligent Circle 丸 | fae576e731 | |
Matthias Mailänder | 1fd8f14499 | |
Matthias Mailänder | 1d949ec051 | |
Matthias Mailänder | 4ea587dd61 | |
The Diligent Circle 丸 | 7749a795e7 | |
Matthias Mailänder | 28c4ba82f2 | |
diligentcircle | 186555d8c8 | |
diligentcircle | 8f4013e828 | |
diligentcircle | eb0bdc13cf | |
diligentcircle | 3c3cbae720 | |
diligentcircle | 5ad618da90 | |
diligentcircle | 413cc0c6a8 | |
diligentcircle | b2053e3959 | |
diligentcircle | 247d2c7bfe | |
diligentcircle | e6f679c4e2 | |
diligentcircle | 5842ff98d8 | |
diligentcircle | 5ee90df2f3 | |
diligentcircle | 7b594c9fa7 | |
diligentcircle | 48f01e4d7f | |
diligentcircle | 87fea0b2e0 | |
diligentcircle | 36e6853fe1 | |
diligentcircle | 344c5d3c82 | |
The Diligent Circle 丸 | c4decfc8b2 | |
The Diligent Circle 丸 | fd71294a2b | |
Jorge Maldonado Ventura | b3d8ee0717 | |
Jorge Maldonado Ventura | 1bd704d136 | |
The Diligent Circle 丸 | 5e65e8c7a8 | |
Jorge Maldonado Ventura | 4c5b72ba32 | |
Jorge Maldonado Ventura | 756a2ed4cb | |
The Diligent Circle 丸 | ac8f5b32e4 | |
Jorge Maldonado Ventura | c77abd6431 | |
Jorge Maldonado Ventura | bddb178ce5 | |
Layla Marchant | bc4a022db8 | |
Layla Marchant | 0d325f0726 | |
Layla Marchant | ab26edddec | |
Layla Marchant | d806f05a16 | |
Layla Marchant | e480841bec | |
Layla Marchant | 8d8f096736 | |
Jorge Maldonado Ventura | 0a64b46722 | |
Jorge Maldonado Ventura | 472261de07 | |
Jorge Maldonado Ventura | 89c1fac443 | |
Layla Marchant | bab012e310 | |
Layla Marchant | 3d0e36916d | |
The Diligent Circle 丸 | 5d654873b1 | |
Jorge Maldonado Ventura | 3642c86eaa | |
Jorge Maldonado Ventura | 76dee3a49a | |
Jorge Maldonado Ventura | f7e90253f5 | |
Layla Marchant | 50355b9489 | |
The Diligent Circle 丸 | 40033c95f2 | |
Layla Marchant | d53764dc13 | |
Layla Marchant | 5eadb91594 | |
Layla Marchant | 51cd7d9f1e | |
Layla Marchant | 82ffaebbc5 | |
Jorge Maldonado Ventura | 840c2249d5 | |
Layla Marchant | a9e98145fa | |
Layla Marchant | 50989a83e7 | |
Layla Marchant | 8241e13d77 | |
Jorge Maldonado Ventura | 551e0c2f72 | |
Jorge Maldonado Ventura | f6108d3957 | |
Layla Marchant | 1116a1a4d3 | |
Layla Marchant | d73fe2c22e | |
The Diligent Circle 丸 | a13ef7374e | |
Jorge Maldonado Ventura | a3243ad3a3 | |
Jorge Maldonado Ventura | b4d70611be | |
Jorge Maldonado Ventura | 2ad7dcbddb | |
Layla Marchant | e993034e63 | |
Jorge Maldonado Ventura | ae66d76d54 | |
Jorge Maldonado Ventura | 07f13a02be | |
Jorge Maldonado Ventura | 9c71933d5f | |
Layla Marchant | ebb76a1cd5 | |
Jorge Maldonado Ventura | 71461ddd5a | |
Jorge Maldonado Ventura | 0ef537f03c | |
Jorge Maldonado Ventura | 6dbe3d86a9 | |
Layla Marchant | e79563ecb4 | |
Layla Marchant | f6be38a5d8 | |
Layla Marchant | 5e6b23b46c | |
The Diligent Circle 丸 | cbc29c0bb8 | |
Matthias Mailänder | 59a56a1b9a |
38
LICENSES
38
LICENSES
|
@ -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.
|
||||
|
||||
------------------------------------------------------------------------
|
||||
|
||||
|
|
|
@ -13,3 +13,4 @@ nobase_dist_pkgdata_DATA = \
|
|||
data/TakaoPGothic.ttf
|
||||
|
||||
EXTRA_DIST = autogen.sh win32build.sh misc
|
||||
|
||||
|
|
|
@ -38,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], [
|
||||
|
@ -46,15 +46,15 @@ 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_WARN], [Set to 1 to enable compiler warnings])
|
||||
|
|
|
@ -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
|
||||
|
|
554
locale/en.po
554
locale/en.po
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
549
locale/ja.po
549
locale/ja.po
File diff suppressed because it is too large
Load Diff
544
locale/nl.po
544
locale/nl.po
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
|
@ -4,9 +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
|
||||
|
|
|
@ -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>
|
|
@ -6,14 +6,18 @@
|
|||
musicdir = $(pkgdatadir)/music
|
||||
|
||||
nobase_dist_music_DATA = \
|
||||
death.ogg \
|
||||
android_oppression.ogg \
|
||||
androids_last_dance.ogg \
|
||||
first_cyber_dance.ogg \
|
||||
frozen_jam.ogg \
|
||||
last_cyber_dance.ogg \
|
||||
orbital_colossus.ogg \
|
||||
railjet_short.ogg \
|
||||
RE.ogg \
|
||||
rise_of_spirit.ogg \
|
||||
sleeping_with_androids.ogg \
|
||||
sound_and_silence.ogg \
|
||||
space_dimensions.ogg \
|
||||
through_space.ogg \
|
||||
walking_among_androids.ogg
|
||||
through_space.ogg
|
||||
|
||||
EXTRA_DIST = sources
|
||||
|
||||
|
|
BIN
music/RE.ogg
BIN
music/RE.ogg
Binary file not shown.
Binary file not shown.
Binary file not shown.
BIN
music/death.ogg
BIN
music/death.ogg
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.
Binary file not shown.
51
src/alien.c
51
src/alien.c
|
@ -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()
|
||||
|
@ -1190,7 +1199,11 @@ 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();
|
||||
|
||||
|
@ -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.))
|
||||
|
@ -2067,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"
|
||||
|
@ -2173,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);
|
||||
|
@ -2254,21 +2277,31 @@ void alien_hurt(Object *alien, Object *attacker, int damage, int ion)
|
|||
else
|
||||
{
|
||||
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;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
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)
|
||||
|
|
|
@ -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);
|
||||
|
|
56
src/audio.c
56
src/audio.c
|
@ -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
|
||||
|
@ -223,7 +233,41 @@ void audio_playRandomTrack()
|
|||
{
|
||||
#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:
|
||||
|
@ -240,7 +284,7 @@ void audio_playRandomTrack()
|
|||
#ifdef OLD_MUSIC
|
||||
audio_playMusic("music/LoopsAndTings.mod", -1);
|
||||
#else
|
||||
audio_playMusic("music/RE.ogg", -1);
|
||||
audio_playMusic("music/androids_last_dance.ogg", -1);
|
||||
#endif
|
||||
break;
|
||||
default:
|
||||
|
|
|
@ -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();
|
||||
|
|
|
@ -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)
|
||||
|
|
|
@ -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)
|
||||
|
@ -555,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,
|
||||
|
|
|
@ -56,7 +56,7 @@ Engine engine;
|
|||
|
||||
void engine_init()
|
||||
{
|
||||
engine.musicVolume = 100;
|
||||
engine.musicVolume = MIX_MAX_VOLUME;
|
||||
engine.useAudio = 1;
|
||||
|
||||
engine.maxAliens = 9;
|
||||
|
|
46
src/game.c
46
src/game.c
|
@ -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;
|
||||
|
@ -897,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++)
|
||||
|
@ -2451,7 +2456,7 @@ static void game_showGameOver()
|
|||
#ifdef OLD_MUSIC
|
||||
audio_playMusic("music/Wybierak.mod", -1);
|
||||
#else
|
||||
audio_playMusic("music/death.ogg", -1);
|
||||
audio_playMusic("music/sleeping_with_androids.ogg", 0);
|
||||
#endif
|
||||
|
||||
int x = (screen->w - gameover->w) / 2;
|
||||
|
@ -2489,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
|
||||
|
@ -2519,6 +2524,7 @@ void game_getDifficultyText(char *dest, int difficulty)
|
|||
|
||||
int game_mainLoop()
|
||||
{
|
||||
int spawnedMisnTarget;
|
||||
float chance;
|
||||
|
||||
engine_resetLists();
|
||||
|
@ -2537,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);
|
||||
|
@ -2577,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];
|
||||
|
@ -2590,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];
|
||||
|
@ -2601,8 +2613,18 @@ 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)
|
||||
|
@ -2678,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;
|
||||
|
||||
|
@ -2786,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
|
||||
|
@ -2802,7 +2824,7 @@ int game_mainLoop()
|
|||
else
|
||||
{
|
||||
player_getInput();
|
||||
LIMIT_ADD(engine.musicVolume, -0.2, 0, 100);
|
||||
LIMIT_ADD(engine.musicVolume, -0.2, 0, MIX_MAX_VOLUME);
|
||||
audio_setMusicVolume(engine.musicVolume);
|
||||
if (SDL_GetTicks() >= engine.missionCompleteTimer)
|
||||
{
|
||||
|
@ -2882,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);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -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];
|
||||
|
||||
|
|
|
@ -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)
|
||||
|
@ -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)
|
||||
|
@ -1465,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(
|
||||
|
|
|
@ -1175,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();
|
||||
|
|
|
@ -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);
|
||||
|
|
23
src/title.c
23
src/title.c
|
@ -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);
|
||||
|
@ -316,7 +318,7 @@ int title_show()
|
|||
#ifdef OLD_MUSIC
|
||||
audio_playMusic("music/Platinum.mod", 1);
|
||||
#else
|
||||
audio_playMusic("music/walking_among_androids.ogg", 1);
|
||||
audio_playMusic("music/android_oppression.ogg", 1);
|
||||
#endif
|
||||
|
||||
while (!engine.done)
|
||||
|
@ -342,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;
|
||||
|
@ -517,7 +524,7 @@ int title_show()
|
|||
#ifdef OLD_MUSIC
|
||||
audio_playMusic("music/Platinum.mod", 1);
|
||||
#else
|
||||
audio_playMusic("music/walking_among_androids.ogg", 1);
|
||||
audio_playMusic("music/android_oppression.ogg", 1);
|
||||
#endif
|
||||
}
|
||||
else
|
||||
|
|
Loading…
Reference in New Issue