-
Notifications
You must be signed in to change notification settings - Fork 84
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #413 from kraflab/abstract-skill-info
Abstract skill info
- Loading branch information
Showing
21 changed files
with
291 additions
and
84 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,139 @@ | ||
// | ||
// Copyright(C) 2023 by Ryan Krafnick | ||
// | ||
// 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 2 | ||
// 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. | ||
// | ||
// DESCRIPTION: | ||
// DSDA Skill Info | ||
// | ||
|
||
#include "doomstat.h" | ||
|
||
#include "skill_info.h" | ||
|
||
skill_info_t skill_info; | ||
|
||
const skill_info_t doom_skill_infos[5] = { | ||
{ | ||
.ammo_factor = FRACUNIT * 2, | ||
.damage_factor = FRACUNIT / 2, | ||
.spawn_filter = 1, | ||
.key = 'i', | ||
.name = "I'm too young to die.", | ||
.pic_name = "M_JKILL", | ||
.flags = SI_EASY_BOSS_BRAIN | ||
}, | ||
{ | ||
.spawn_filter = 2, | ||
.key = 'h', | ||
.name = "Hey, not too rough.", | ||
.pic_name = "M_ROUGH", | ||
.flags = SI_EASY_BOSS_BRAIN | ||
}, | ||
{ | ||
.spawn_filter = 3, | ||
.key = 'h', | ||
.name = "Hurt me plenty.", | ||
.pic_name = "M_HURT", | ||
.flags = SI_DEFAULT_SKILL | ||
}, | ||
{ | ||
.spawn_filter = 4, | ||
.key = 'u', | ||
.name = "Ultra-Violence.", | ||
.pic_name = "M_ULTRA", | ||
.flags = 0 | ||
}, | ||
{ | ||
.ammo_factor = FRACUNIT * 2, | ||
.spawn_filter = 5, | ||
.key = 'n', | ||
.name = "Nightmare!", | ||
.pic_name = "M_NMARE", | ||
.respawn_time = 12, | ||
.flags = SI_FAST_MONSTERS | SI_INSTANT_REACTION | SI_MUST_CONFIRM | ||
}, | ||
}; | ||
|
||
const skill_info_t heretic_skill_infos[5] = { | ||
{ | ||
.ammo_factor = FRACUNIT * 3 / 2, | ||
.damage_factor = FRACUNIT / 2, | ||
.spawn_filter = 1, | ||
.flags = SI_AUTO_USE_HEALTH | ||
}, | ||
{ | ||
.spawn_filter = 2, | ||
.flags = 0 | ||
}, | ||
{ | ||
.spawn_filter = 3, | ||
.flags = SI_DEFAULT_SKILL | ||
}, | ||
{ | ||
.spawn_filter = 4, | ||
.flags = 0 | ||
}, | ||
{ | ||
.ammo_factor = FRACUNIT * 3 / 2, | ||
.spawn_filter = 5, | ||
.flags = SI_FAST_MONSTERS | SI_INSTANT_REACTION | ||
}, | ||
}; | ||
|
||
const skill_info_t hexen_skill_infos[5] = { | ||
{ | ||
.ammo_factor = FRACUNIT * 3 / 2, | ||
.damage_factor = FRACUNIT / 2, | ||
.spawn_filter = 1, | ||
.flags = SI_AUTO_USE_HEALTH | ||
}, | ||
{ | ||
.spawn_filter = 2, | ||
.flags = 0 | ||
}, | ||
{ | ||
.spawn_filter = 3, | ||
.flags = SI_DEFAULT_SKILL | ||
}, | ||
{ | ||
.spawn_filter = 4, | ||
.flags = 0 | ||
}, | ||
{ | ||
.ammo_factor = FRACUNIT * 3 / 2, | ||
.spawn_filter = 5, | ||
.flags = SI_FAST_MONSTERS | SI_INSTANT_REACTION | ||
}, | ||
}; | ||
|
||
const skill_info_t* skill_infos; | ||
|
||
int num_skills = 5; | ||
|
||
void dsda_RefreshGameSkill(void) { | ||
void G_RefreshFastMonsters(void); | ||
|
||
skill_info = skill_infos[gameskill]; | ||
|
||
if (respawnparm && !skill_info.respawn_time) | ||
skill_info.respawn_time = 12; | ||
|
||
if (fastparm) | ||
skill_info.flags |= SI_FAST_MONSTERS; | ||
|
||
G_RefreshFastMonsters(); | ||
} | ||
|
||
void dsda_UpdateGameSkill(int skill) { | ||
gameskill = skill; | ||
dsda_RefreshGameSkill(); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,67 @@ | ||
// | ||
// Copyright(C) 2023 by Ryan Krafnick | ||
// | ||
// 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 2 | ||
// 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. | ||
// | ||
// DESCRIPTION: | ||
// DSDA Skill Info | ||
// | ||
|
||
#ifndef __DSDA_SKILL_INFO__ | ||
#define __DSDA_SKILL_INFO__ | ||
|
||
#include "doomdef.h" | ||
#include "m_fixed.h" | ||
|
||
#define SI_SPAWN_MULTI 0x0001 | ||
#define SI_FAST_MONSTERS 0x0002 | ||
#define SI_INSTANT_REACTION 0x0004 | ||
#define SI_DISABLE_CHEATS 0x0008 | ||
#define SI_NO_PAIN 0x0010 | ||
#define SI_DEFAULT_SKILL 0x0020 | ||
#define SI_NO_MENU 0x0040 | ||
#define SI_PLAYER_RESPAWN 0x0080 | ||
#define SI_EASY_BOSS_BRAIN 0x0100 | ||
#define SI_MUST_CONFIRM 0x0200 | ||
#define SI_AUTO_USE_HEALTH 0x0400 | ||
|
||
typedef uint16_t skill_info_flags_t; | ||
|
||
typedef struct { | ||
fixed_t ammo_factor; | ||
fixed_t damage_factor; | ||
fixed_t armor_factor; | ||
fixed_t health_factor; | ||
fixed_t monster_health_factor; | ||
fixed_t friend_health_factor; | ||
int respawn_time; | ||
int spawn_filter; | ||
char key; | ||
const char* must_confirm; | ||
const char* name; | ||
const char* pic_name; | ||
int text_color; | ||
skill_info_flags_t flags; | ||
} skill_info_t; | ||
|
||
extern skill_info_t skill_info; | ||
extern const skill_info_t* skill_infos; | ||
|
||
extern const skill_info_t doom_skill_infos[5]; | ||
extern const skill_info_t heretic_skill_infos[5]; | ||
extern const skill_info_t hexen_skill_infos[5]; | ||
|
||
extern int num_skills; | ||
|
||
void dsda_RefreshGameSkill(void); | ||
void dsda_UpdateGameSkill(int skill); | ||
|
||
#endif |
Oops, something went wrong.