2011-08-24 14:14:44 +02:00
|
|
|
/*
|
|
|
|
Copyright (C) 2003 Parallel Realities
|
2015-03-01 21:37:32 +01:00
|
|
|
Copyright (C) 2011, 2013 Guus Sliepen
|
2016-01-04 04:39:16 +01:00
|
|
|
Copyright (C) 2015, 2016 onpon4 <onpon4@riseup.net>
|
2011-08-24 14:14:44 +02:00
|
|
|
|
|
|
|
This program is free software; you can redistribute it and/or
|
|
|
|
modify it under the terms of the GNU General Public License
|
2015-02-26 17:20:36 +01:00
|
|
|
as published by the Free Software Foundation; either version 3
|
2011-08-24 14:14:44 +02:00
|
|
|
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
|
2015-02-26 17:20:36 +01:00
|
|
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
GNU General Public License for more details.
|
2011-08-24 14:14:44 +02:00
|
|
|
|
|
|
|
You should have received a copy of the GNU General Public License
|
2015-02-26 17:20:36 +01:00
|
|
|
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
2011-08-24 14:14:44 +02:00
|
|
|
*/
|
|
|
|
|
2011-08-26 21:29:04 +02:00
|
|
|
#include "Starfighter.h"
|
|
|
|
|
2016-01-07 02:35:37 +01:00
|
|
|
object weapon[W_MAX];
|
2011-08-24 14:14:44 +02:00
|
|
|
|
|
|
|
/*
|
2013-07-11 15:29:37 +02:00
|
|
|
A list of predefined weaponary.
|
2011-08-24 14:14:44 +02:00
|
|
|
*/
|
|
|
|
void initWeapons()
|
|
|
|
{
|
|
|
|
// Player's weapon (this NEVER allocated to anything else)
|
|
|
|
weapon[W_PLAYER_WEAPON].id = WT_PLASMA;
|
|
|
|
weapon[W_PLAYER_WEAPON].ammo[0] = 1;
|
|
|
|
weapon[W_PLAYER_WEAPON].damage = 1;
|
|
|
|
weapon[W_PLAYER_WEAPON].reload[0] = 15;
|
|
|
|
weapon[W_PLAYER_WEAPON].speed = 10;
|
Fixed more magic numbers.
God, this one was definitely the biggest headache of all of the
magic number erasing. Never did I expect such cryptic problems.
The first problem was that the entirety of the player's weapon
struct was a part of the save file, *including the weapon's "image
indexes"*. Since the indexes have been changed, and the originally
used one is now unavailable when it's requested, this was causing
a segfault later on. Had to fix this by setting the image index
when the game is loaded.
The second problem was related to another bug I've been confused
about for years: the one that causes mobile rays to fire 5 green
shots. The entire reason those shots were green was because
the weapon's image indexes were undefined, and *that was causing
them to default to 0*. 0 was simply the index of green plasma.
Of course, though, now attempting to use that image causes a
segfault, so for now, I've fixed this by changing the image index
of the mobile rays to the red plasma bolts.
There are still some magic numbers left, related to the intermission
screen. But the hardest part is now done, thank God.
2016-01-06 04:12:29 +01:00
|
|
|
weapon[W_PLAYER_WEAPON].imageIndex[0] = SP_PLASMA_GREEN;
|
|
|
|
weapon[W_PLAYER_WEAPON].imageIndex[1] = SP_PLASMA_GREEN;
|
2015-04-09 02:58:21 +02:00
|
|
|
weapon[W_PLAYER_WEAPON].flags = WF_SPREAD;
|
2011-08-24 14:14:44 +02:00
|
|
|
|
|
|
|
// Single Shot
|
|
|
|
weapon[W_SINGLE_SHOT].id = WT_PLASMA;
|
|
|
|
weapon[W_SINGLE_SHOT].ammo[0] = 1;
|
|
|
|
weapon[W_SINGLE_SHOT].damage = 1;
|
|
|
|
weapon[W_SINGLE_SHOT].reload[0] = 15;
|
|
|
|
weapon[W_SINGLE_SHOT].speed = 10;
|
Fixed more magic numbers.
God, this one was definitely the biggest headache of all of the
magic number erasing. Never did I expect such cryptic problems.
The first problem was that the entirety of the player's weapon
struct was a part of the save file, *including the weapon's "image
indexes"*. Since the indexes have been changed, and the originally
used one is now unavailable when it's requested, this was causing
a segfault later on. Had to fix this by setting the image index
when the game is loaded.
The second problem was related to another bug I've been confused
about for years: the one that causes mobile rays to fire 5 green
shots. The entire reason those shots were green was because
the weapon's image indexes were undefined, and *that was causing
them to default to 0*. 0 was simply the index of green plasma.
Of course, though, now attempting to use that image causes a
segfault, so for now, I've fixed this by changing the image index
of the mobile rays to the red plasma bolts.
There are still some magic numbers left, related to the intermission
screen. But the hardest part is now done, thank God.
2016-01-06 04:12:29 +01:00
|
|
|
weapon[W_SINGLE_SHOT].imageIndex[0] = SP_PLASMA_GREEN;
|
|
|
|
weapon[W_SINGLE_SHOT].imageIndex[1] = SP_PLASMA_RED;
|
2011-09-04 18:24:54 +02:00
|
|
|
weapon[W_SINGLE_SHOT].flags = 0;
|
2011-08-24 14:14:44 +02:00
|
|
|
|
|
|
|
// Double Shot
|
|
|
|
weapon[W_DOUBLE_SHOT] = weapon[W_SINGLE_SHOT];
|
|
|
|
weapon[W_DOUBLE_SHOT].ammo[0] = 2;
|
|
|
|
|
|
|
|
// Triple Shot
|
|
|
|
weapon[W_TRIPLE_SHOT] = weapon[W_SINGLE_SHOT];
|
|
|
|
weapon[W_TRIPLE_SHOT].ammo[0] = 3;
|
|
|
|
|
|
|
|
// Rockets
|
|
|
|
weapon[W_ROCKETS].id = WT_ROCKET;
|
|
|
|
weapon[W_ROCKETS].ammo[0] = 1;
|
|
|
|
weapon[W_ROCKETS].damage = 15;
|
|
|
|
weapon[W_ROCKETS].reload[0] = 45;
|
|
|
|
weapon[W_ROCKETS].speed = 20;
|
2011-09-04 18:24:54 +02:00
|
|
|
weapon[W_ROCKETS].flags = 0;
|
Fixed more magic numbers.
God, this one was definitely the biggest headache of all of the
magic number erasing. Never did I expect such cryptic problems.
The first problem was that the entirety of the player's weapon
struct was a part of the save file, *including the weapon's "image
indexes"*. Since the indexes have been changed, and the originally
used one is now unavailable when it's requested, this was causing
a segfault later on. Had to fix this by setting the image index
when the game is loaded.
The second problem was related to another bug I've been confused
about for years: the one that causes mobile rays to fire 5 green
shots. The entire reason those shots were green was because
the weapon's image indexes were undefined, and *that was causing
them to default to 0*. 0 was simply the index of green plasma.
Of course, though, now attempting to use that image causes a
segfault, so for now, I've fixed this by changing the image index
of the mobile rays to the red plasma bolts.
There are still some magic numbers left, related to the intermission
screen. But the hardest part is now done, thank God.
2016-01-06 04:12:29 +01:00
|
|
|
weapon[W_ROCKETS].imageIndex[0] = SP_ROCKET;
|
|
|
|
weapon[W_ROCKETS].imageIndex[1] = SP_ROCKET_L;
|
2011-08-24 14:14:44 +02:00
|
|
|
|
|
|
|
// Double Rockets (uses ROCKETS as base)
|
|
|
|
weapon[W_DOUBLE_ROCKETS] = weapon[W_ROCKETS];
|
|
|
|
weapon[W_DOUBLE_ROCKETS].ammo[0] = 2;
|
|
|
|
weapon[W_DOUBLE_ROCKETS].reload[0] = 80;
|
|
|
|
|
|
|
|
// Micro Rockets
|
|
|
|
weapon[W_MICRO_ROCKETS].id = WT_ROCKET;
|
|
|
|
weapon[W_MICRO_ROCKETS].ammo[0] = 5;
|
2015-03-06 22:25:12 +01:00
|
|
|
weapon[W_MICRO_ROCKETS].damage = 6;
|
2011-08-24 14:14:44 +02:00
|
|
|
weapon[W_MICRO_ROCKETS].reload[0] = 30;
|
|
|
|
weapon[W_MICRO_ROCKETS].speed = 15;
|
2011-09-04 18:24:54 +02:00
|
|
|
weapon[W_MICRO_ROCKETS].flags = WF_VARIABLE_SPEED;
|
Fixed more magic numbers.
God, this one was definitely the biggest headache of all of the
magic number erasing. Never did I expect such cryptic problems.
The first problem was that the entirety of the player's weapon
struct was a part of the save file, *including the weapon's "image
indexes"*. Since the indexes have been changed, and the originally
used one is now unavailable when it's requested, this was causing
a segfault later on. Had to fix this by setting the image index
when the game is loaded.
The second problem was related to another bug I've been confused
about for years: the one that causes mobile rays to fire 5 green
shots. The entire reason those shots were green was because
the weapon's image indexes were undefined, and *that was causing
them to default to 0*. 0 was simply the index of green plasma.
Of course, though, now attempting to use that image causes a
segfault, so for now, I've fixed this by changing the image index
of the mobile rays to the red plasma bolts.
There are still some magic numbers left, related to the intermission
screen. But the hardest part is now done, thank God.
2016-01-06 04:12:29 +01:00
|
|
|
weapon[W_MICRO_ROCKETS].imageIndex[0] = SP_ROCKET;
|
|
|
|
weapon[W_MICRO_ROCKETS].imageIndex[1] = SP_ROCKET_L;
|
2011-08-24 14:14:44 +02:00
|
|
|
|
|
|
|
// Energy Ray
|
|
|
|
weapon[W_ENERGYRAY].id = WT_ENERGYRAY;
|
|
|
|
weapon[W_ENERGYRAY].ammo[0] = 255;
|
|
|
|
weapon[W_ENERGYRAY].damage = 1;
|
|
|
|
weapon[W_ENERGYRAY].reload[0] = 25; // reload for energy ray is never used
|
|
|
|
weapon[W_ENERGYRAY].speed = 15;
|
Fixed more magic numbers.
God, this one was definitely the biggest headache of all of the
magic number erasing. Never did I expect such cryptic problems.
The first problem was that the entirety of the player's weapon
struct was a part of the save file, *including the weapon's "image
indexes"*. Since the indexes have been changed, and the originally
used one is now unavailable when it's requested, this was causing
a segfault later on. Had to fix this by setting the image index
when the game is loaded.
The second problem was related to another bug I've been confused
about for years: the one that causes mobile rays to fire 5 green
shots. The entire reason those shots were green was because
the weapon's image indexes were undefined, and *that was causing
them to default to 0*. 0 was simply the index of green plasma.
Of course, though, now attempting to use that image causes a
segfault, so for now, I've fixed this by changing the image index
of the mobile rays to the red plasma bolts.
There are still some magic numbers left, related to the intermission
screen. But the hardest part is now done, thank God.
2016-01-06 04:12:29 +01:00
|
|
|
weapon[W_ENERGYRAY].imageIndex[0] = SP_PLASMA_RED;
|
|
|
|
weapon[W_ENERGYRAY].imageIndex[1] = SP_PLASMA_RED;
|
2011-09-04 18:24:54 +02:00
|
|
|
weapon[W_ENERGYRAY].flags = 0;
|
2011-08-24 14:14:44 +02:00
|
|
|
|
|
|
|
// Laser
|
|
|
|
weapon[W_LASER].id = WT_LASER;
|
|
|
|
weapon[W_LASER].ammo[0] = 1;
|
|
|
|
weapon[W_LASER].damage = 3;
|
|
|
|
weapon[W_LASER].reload[0] = 1;
|
|
|
|
weapon[W_LASER].speed = 10;
|
Fixed more magic numbers.
God, this one was definitely the biggest headache of all of the
magic number erasing. Never did I expect such cryptic problems.
The first problem was that the entirety of the player's weapon
struct was a part of the save file, *including the weapon's "image
indexes"*. Since the indexes have been changed, and the originally
used one is now unavailable when it's requested, this was causing
a segfault later on. Had to fix this by setting the image index
when the game is loaded.
The second problem was related to another bug I've been confused
about for years: the one that causes mobile rays to fire 5 green
shots. The entire reason those shots were green was because
the weapon's image indexes were undefined, and *that was causing
them to default to 0*. 0 was simply the index of green plasma.
Of course, though, now attempting to use that image causes a
segfault, so for now, I've fixed this by changing the image index
of the mobile rays to the red plasma bolts.
There are still some magic numbers left, related to the intermission
screen. But the hardest part is now done, thank God.
2016-01-06 04:12:29 +01:00
|
|
|
weapon[W_LASER].imageIndex[0] = SP_PLASMA_RED;
|
|
|
|
weapon[W_LASER].imageIndex[1] = SP_PLASMA_RED;
|
2011-09-04 18:24:54 +02:00
|
|
|
weapon[W_LASER].flags = 0;
|
2011-08-24 14:14:44 +02:00
|
|
|
|
|
|
|
// Beam up weapon
|
|
|
|
weapon[W_CHARGER].id = WT_CHARGER;
|
|
|
|
weapon[W_CHARGER].ammo[0] = 1;
|
|
|
|
weapon[W_CHARGER].damage = 1;
|
|
|
|
weapon[W_CHARGER].reload[0] = 0;
|
|
|
|
weapon[W_CHARGER].speed = 12;
|
2011-09-04 18:24:54 +02:00
|
|
|
weapon[W_CHARGER].flags = 0;
|
Fixed more magic numbers.
God, this one was definitely the biggest headache of all of the
magic number erasing. Never did I expect such cryptic problems.
The first problem was that the entirety of the player's weapon
struct was a part of the save file, *including the weapon's "image
indexes"*. Since the indexes have been changed, and the originally
used one is now unavailable when it's requested, this was causing
a segfault later on. Had to fix this by setting the image index
when the game is loaded.
The second problem was related to another bug I've been confused
about for years: the one that causes mobile rays to fire 5 green
shots. The entire reason those shots were green was because
the weapon's image indexes were undefined, and *that was causing
them to default to 0*. 0 was simply the index of green plasma.
Of course, though, now attempting to use that image causes a
segfault, so for now, I've fixed this by changing the image index
of the mobile rays to the red plasma bolts.
There are still some magic numbers left, related to the intermission
screen. But the hardest part is now done, thank God.
2016-01-06 04:12:29 +01:00
|
|
|
weapon[W_CHARGER].imageIndex[0] = SP_DIR_PLASMA_GREEN;
|
|
|
|
weapon[W_CHARGER].imageIndex[1] = SP_DIR_PLASMA_RED;
|
2011-08-24 14:14:44 +02:00
|
|
|
|
2011-09-04 18:24:54 +02:00
|
|
|
// Homing missile
|
2011-08-24 14:14:44 +02:00
|
|
|
weapon[W_HOMING_MISSILE].id = WT_ROCKET;
|
|
|
|
weapon[W_HOMING_MISSILE].ammo[0] = 1;
|
|
|
|
weapon[W_HOMING_MISSILE].damage = 15;
|
|
|
|
weapon[W_HOMING_MISSILE].reload[0] = 35;
|
|
|
|
weapon[W_HOMING_MISSILE].speed = 10;
|
2011-09-04 18:24:54 +02:00
|
|
|
weapon[W_HOMING_MISSILE].flags = WF_HOMING;
|
Fixed more magic numbers.
God, this one was definitely the biggest headache of all of the
magic number erasing. Never did I expect such cryptic problems.
The first problem was that the entirety of the player's weapon
struct was a part of the save file, *including the weapon's "image
indexes"*. Since the indexes have been changed, and the originally
used one is now unavailable when it's requested, this was causing
a segfault later on. Had to fix this by setting the image index
when the game is loaded.
The second problem was related to another bug I've been confused
about for years: the one that causes mobile rays to fire 5 green
shots. The entire reason those shots were green was because
the weapon's image indexes were undefined, and *that was causing
them to default to 0*. 0 was simply the index of green plasma.
Of course, though, now attempting to use that image causes a
segfault, so for now, I've fixed this by changing the image index
of the mobile rays to the red plasma bolts.
There are still some magic numbers left, related to the intermission
screen. But the hardest part is now done, thank God.
2016-01-06 04:12:29 +01:00
|
|
|
weapon[W_HOMING_MISSILE].imageIndex[0] = SP_SMALL_EXPLOSION;
|
|
|
|
weapon[W_HOMING_MISSILE].imageIndex[1] = SP_SMALL_EXPLOSION;
|
2011-08-24 14:14:44 +02:00
|
|
|
|
2011-09-04 18:24:54 +02:00
|
|
|
// Double homing missile
|
2011-08-24 14:14:44 +02:00
|
|
|
weapon[W_DOUBLE_HOMING_MISSILES] = weapon[W_HOMING_MISSILE];
|
2011-09-04 18:24:54 +02:00
|
|
|
weapon[W_DOUBLE_HOMING_MISSILES].ammo[0] = 2;
|
|
|
|
weapon[W_DOUBLE_HOMING_MISSILES].reload[0] = 65;
|
Fixed more magic numbers.
God, this one was definitely the biggest headache of all of the
magic number erasing. Never did I expect such cryptic problems.
The first problem was that the entirety of the player's weapon
struct was a part of the save file, *including the weapon's "image
indexes"*. Since the indexes have been changed, and the originally
used one is now unavailable when it's requested, this was causing
a segfault later on. Had to fix this by setting the image index
when the game is loaded.
The second problem was related to another bug I've been confused
about for years: the one that causes mobile rays to fire 5 green
shots. The entire reason those shots were green was because
the weapon's image indexes were undefined, and *that was causing
them to default to 0*. 0 was simply the index of green plasma.
Of course, though, now attempting to use that image causes a
segfault, so for now, I've fixed this by changing the image index
of the mobile rays to the red plasma bolts.
There are still some magic numbers left, related to the intermission
screen. But the hardest part is now done, thank God.
2016-01-06 04:12:29 +01:00
|
|
|
weapon[W_DOUBLE_HOMING_MISSILES].imageIndex[0] = SP_SMALL_EXPLOSION;
|
|
|
|
weapon[W_DOUBLE_HOMING_MISSILES].imageIndex[1] = SP_SMALL_EXPLOSION;
|
2011-08-24 14:14:44 +02:00
|
|
|
|
|
|
|
// Micro homing missiles
|
|
|
|
weapon[W_MICRO_HOMING_MISSILES].id = WT_ROCKET;
|
|
|
|
weapon[W_MICRO_HOMING_MISSILES].ammo[0] = 5;
|
|
|
|
weapon[W_MICRO_HOMING_MISSILES].damage = 12;
|
|
|
|
weapon[W_MICRO_HOMING_MISSILES].reload[0] = 65;
|
|
|
|
weapon[W_MICRO_HOMING_MISSILES].speed = 3;
|
2011-09-04 18:24:54 +02:00
|
|
|
weapon[W_MICRO_HOMING_MISSILES].flags = WF_HOMING;
|
Fixed more magic numbers.
God, this one was definitely the biggest headache of all of the
magic number erasing. Never did I expect such cryptic problems.
The first problem was that the entirety of the player's weapon
struct was a part of the save file, *including the weapon's "image
indexes"*. Since the indexes have been changed, and the originally
used one is now unavailable when it's requested, this was causing
a segfault later on. Had to fix this by setting the image index
when the game is loaded.
The second problem was related to another bug I've been confused
about for years: the one that causes mobile rays to fire 5 green
shots. The entire reason those shots were green was because
the weapon's image indexes were undefined, and *that was causing
them to default to 0*. 0 was simply the index of green plasma.
Of course, though, now attempting to use that image causes a
segfault, so for now, I've fixed this by changing the image index
of the mobile rays to the red plasma bolts.
There are still some magic numbers left, related to the intermission
screen. But the hardest part is now done, thank God.
2016-01-06 04:12:29 +01:00
|
|
|
weapon[W_MICRO_HOMING_MISSILES].imageIndex[0] = SP_SMALL_EXPLOSION;
|
|
|
|
weapon[W_MICRO_HOMING_MISSILES].imageIndex[1] = SP_SMALL_EXPLOSION;
|
2011-08-24 14:14:44 +02:00
|
|
|
|
2015-03-06 22:25:12 +01:00
|
|
|
// Aimed plasma bolt
|
2011-08-24 14:14:44 +02:00
|
|
|
weapon[W_AIMED_SHOT].id = WT_DIRECTIONAL;
|
|
|
|
weapon[W_AIMED_SHOT].ammo[0] = 1;
|
|
|
|
weapon[W_AIMED_SHOT].damage = 2;
|
|
|
|
weapon[W_AIMED_SHOT].reload[0] = 15;
|
|
|
|
weapon[W_AIMED_SHOT].speed = 0;
|
2011-09-04 18:24:54 +02:00
|
|
|
weapon[W_AIMED_SHOT].flags = WF_AIMED;
|
Fixed more magic numbers.
God, this one was definitely the biggest headache of all of the
magic number erasing. Never did I expect such cryptic problems.
The first problem was that the entirety of the player's weapon
struct was a part of the save file, *including the weapon's "image
indexes"*. Since the indexes have been changed, and the originally
used one is now unavailable when it's requested, this was causing
a segfault later on. Had to fix this by setting the image index
when the game is loaded.
The second problem was related to another bug I've been confused
about for years: the one that causes mobile rays to fire 5 green
shots. The entire reason those shots were green was because
the weapon's image indexes were undefined, and *that was causing
them to default to 0*. 0 was simply the index of green plasma.
Of course, though, now attempting to use that image causes a
segfault, so for now, I've fixed this by changing the image index
of the mobile rays to the red plasma bolts.
There are still some magic numbers left, related to the intermission
screen. But the hardest part is now done, thank God.
2016-01-06 04:12:29 +01:00
|
|
|
weapon[W_AIMED_SHOT].imageIndex[0] = SP_DIR_PLASMA_GREEN;
|
|
|
|
weapon[W_AIMED_SHOT].imageIndex[1] = SP_DIR_PLASMA_RED;
|
2011-08-24 14:14:44 +02:00
|
|
|
|
|
|
|
// 3 way spread weapon
|
|
|
|
weapon[W_SPREADSHOT].id = WT_SPREAD;
|
|
|
|
weapon[W_SPREADSHOT].ammo[0] = 3;
|
2015-03-06 22:25:12 +01:00
|
|
|
weapon[W_SPREADSHOT].damage = 2;
|
2011-08-24 14:14:44 +02:00
|
|
|
weapon[W_SPREADSHOT].reload[0] = 10;
|
|
|
|
weapon[W_SPREADSHOT].speed = 10;
|
2011-09-04 18:24:54 +02:00
|
|
|
weapon[W_SPREADSHOT].flags = WF_SPREAD;
|
Fixed more magic numbers.
God, this one was definitely the biggest headache of all of the
magic number erasing. Never did I expect such cryptic problems.
The first problem was that the entirety of the player's weapon
struct was a part of the save file, *including the weapon's "image
indexes"*. Since the indexes have been changed, and the originally
used one is now unavailable when it's requested, this was causing
a segfault later on. Had to fix this by setting the image index
when the game is loaded.
The second problem was related to another bug I've been confused
about for years: the one that causes mobile rays to fire 5 green
shots. The entire reason those shots were green was because
the weapon's image indexes were undefined, and *that was causing
them to default to 0*. 0 was simply the index of green plasma.
Of course, though, now attempting to use that image causes a
segfault, so for now, I've fixed this by changing the image index
of the mobile rays to the red plasma bolts.
There are still some magic numbers left, related to the intermission
screen. But the hardest part is now done, thank God.
2016-01-06 04:12:29 +01:00
|
|
|
weapon[W_SPREADSHOT].imageIndex[0] = SP_PLASMA_GREEN;
|
|
|
|
weapon[W_SPREADSHOT].imageIndex[1] = SP_PLASMA_RED;
|
2011-08-24 14:14:44 +02:00
|
|
|
|
|
|
|
// Sid's ion cannon like weapon
|
|
|
|
weapon[W_IONCANNON].id = WT_PLASMA;
|
|
|
|
weapon[W_IONCANNON].ammo[0] = 1;
|
|
|
|
weapon[W_IONCANNON].damage = 1;
|
|
|
|
weapon[W_IONCANNON].reload[0] = 2;
|
|
|
|
weapon[W_IONCANNON].speed = 10;
|
2011-09-04 18:24:54 +02:00
|
|
|
weapon[W_IONCANNON].flags = WF_DISABLE | WF_AIMED;
|
Fixed more magic numbers.
God, this one was definitely the biggest headache of all of the
magic number erasing. Never did I expect such cryptic problems.
The first problem was that the entirety of the player's weapon
struct was a part of the save file, *including the weapon's "image
indexes"*. Since the indexes have been changed, and the originally
used one is now unavailable when it's requested, this was causing
a segfault later on. Had to fix this by setting the image index
when the game is loaded.
The second problem was related to another bug I've been confused
about for years: the one that causes mobile rays to fire 5 green
shots. The entire reason those shots were green was because
the weapon's image indexes were undefined, and *that was causing
them to default to 0*. 0 was simply the index of green plasma.
Of course, though, now attempting to use that image causes a
segfault, so for now, I've fixed this by changing the image index
of the mobile rays to the red plasma bolts.
There are still some magic numbers left, related to the intermission
screen. But the hardest part is now done, thank God.
2016-01-06 04:12:29 +01:00
|
|
|
weapon[W_IONCANNON].imageIndex[0] = SP_ION;
|
|
|
|
weapon[W_IONCANNON].imageIndex[1] = SP_ION;
|
2011-08-24 14:14:44 +02:00
|
|
|
|
|
|
|
// Directional Shock Missile - Used by Kline in final battle
|
|
|
|
weapon[W_DIRSHOCKMISSILE].id = WT_ROCKET;
|
|
|
|
weapon[W_DIRSHOCKMISSILE].ammo[0] = 5;
|
|
|
|
weapon[W_DIRSHOCKMISSILE].damage = 20;
|
|
|
|
weapon[W_DIRSHOCKMISSILE].reload[0] = 60;
|
|
|
|
weapon[W_DIRSHOCKMISSILE].speed = 0;
|
2011-09-04 18:24:54 +02:00
|
|
|
weapon[W_DIRSHOCKMISSILE].flags = WF_AIMED | WF_TIMEDEXPLOSION;
|
Fixed more magic numbers.
God, this one was definitely the biggest headache of all of the
magic number erasing. Never did I expect such cryptic problems.
The first problem was that the entirety of the player's weapon
struct was a part of the save file, *including the weapon's "image
indexes"*. Since the indexes have been changed, and the originally
used one is now unavailable when it's requested, this was causing
a segfault later on. Had to fix this by setting the image index
when the game is loaded.
The second problem was related to another bug I've been confused
about for years: the one that causes mobile rays to fire 5 green
shots. The entire reason those shots were green was because
the weapon's image indexes were undefined, and *that was causing
them to default to 0*. 0 was simply the index of green plasma.
Of course, though, now attempting to use that image causes a
segfault, so for now, I've fixed this by changing the image index
of the mobile rays to the red plasma bolts.
There are still some magic numbers left, related to the intermission
screen. But the hardest part is now done, thank God.
2016-01-06 04:12:29 +01:00
|
|
|
weapon[W_DIRSHOCKMISSILE].imageIndex[0] = SP_SMALL_EXPLOSION;
|
|
|
|
weapon[W_DIRSHOCKMISSILE].imageIndex[1] = SP_SMALL_EXPLOSION;
|
2011-08-24 14:14:44 +02:00
|
|
|
}
|