| 1 |
// |
| 2 |
// Copyright(C) 2022 by Ryan Krafnick |
| 3 |
// |
| 4 |
// This program is free software; you can redistribute it and/or |
| 5 |
// modify it under the terms of the GNU General Public License |
| 6 |
// as published by the Free Software Foundation; either version 2 |
| 7 |
// of the License, or (at your option) any later version. |
| 8 |
// |
| 9 |
// This program is distributed in the hope that it will be useful, |
| 10 |
// but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 11 |
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 12 |
// GNU General Public License for more details. |
| 13 |
// |
| 14 |
// DESCRIPTION: |
| 15 |
// DSDA Brute Force |
| 16 |
// |
| 17 |
|
| 18 |
#include "doomtype.h" |
| 19 |
|
| 20 |
typedef enum { |
| 21 |
dsda_bf_x, |
| 22 |
dsda_bf_y, |
| 23 |
dsda_bf_z, |
| 24 |
dsda_bf_momx, |
| 25 |
dsda_bf_momy, |
| 26 |
dsda_bf_speed, |
| 27 |
dsda_bf_damage, |
| 28 |
dsda_bf_rng, |
| 29 |
dsda_bf_arm, |
| 30 |
dsda_bf_hp, |
| 31 |
dsda_bf_ammo_0, |
| 32 |
dsda_bf_ammo_1, |
| 33 |
dsda_bf_ammo_2, |
| 34 |
dsda_bf_ammo_3, |
| 35 |
dsda_bf_ammo_4, |
| 36 |
dsda_bf_ammo_5, |
| 37 |
dsda_bf_bmapwidth, |
| 38 |
dsda_bf_attribute_max, |
| 39 |
|
| 40 |
dsda_bf_line_skip = 0, |
| 41 |
dsda_bf_line_activation, |
| 42 |
dsda_bf_have_item, |
| 43 |
dsda_bf_lack_item, |
| 44 |
dsda_bf_misc_max, |
| 45 |
} dsda_bf_attribute_t; |
| 46 |
|
| 47 |
typedef enum { |
| 48 |
dsda_bf_less_than, |
| 49 |
dsda_bf_less_than_or_equal_to, |
| 50 |
dsda_bf_greater_than, |
| 51 |
dsda_bf_greater_than_or_equal_to, |
| 52 |
dsda_bf_equal_to, |
| 53 |
dsda_bf_not_equal_to, |
| 54 |
dsda_bf_operator_max, |
| 55 |
|
| 56 |
dsda_bf_operator_misc, |
| 57 |
} dsda_bf_operator_t; |
| 58 |
|
| 59 |
typedef enum { |
| 60 |
dsda_bf_red_key_card, |
| 61 |
dsda_bf_yellow_key_card, |
| 62 |
dsda_bf_blue_key_card, |
| 63 |
dsda_bf_red_skull_key, |
| 64 |
dsda_bf_yellow_skull_key, |
| 65 |
dsda_bf_blue_skull_key, |
| 66 |
dsda_bf_fist, |
| 67 |
dsda_bf_pistol, |
| 68 |
dsda_bf_shotgun, |
| 69 |
dsda_bf_chaingun, |
| 70 |
dsda_bf_rocket_launcher, |
| 71 |
dsda_bf_plasma_gun, |
| 72 |
dsda_bf_bfg, |
| 73 |
dsda_bf_chainsaw, |
| 74 |
dsda_bf_super_shotgun, |
| 75 |
dsda_bf_item_max, |
| 76 |
} dsda_bf_item_t; |
| 77 |
|
| 78 |
typedef enum { |
| 79 |
dsda_bf_limit_trio_zero, |
| 80 |
dsda_bf_acap = dsda_bf_limit_trio_zero, |
| 81 |
dsda_bf_limit_trio_max, |
| 82 |
|
| 83 |
dsda_bf_limit_duo_zero = dsda_bf_limit_trio_max, |
| 84 |
dsda_bf_max = dsda_bf_limit_duo_zero, |
| 85 |
dsda_bf_min, |
| 86 |
dsda_bf_limit_duo_max, |
| 87 |
|
| 88 |
dsda_bf_limit_max = dsda_bf_limit_duo_max |
| 89 |
} dsda_bf_limit_t; |
| 90 |
|
| 91 |
extern const char* dsda_bf_attribute_names[dsda_bf_attribute_max]; |
| 92 |
extern const char* dsda_bf_operator_names[dsda_bf_operator_max]; |
| 93 |
extern const char* dsda_bf_item_names[dsda_bf_item_max]; |
| 94 |
extern const char* dsda_bf_limit_names[dsda_bf_limit_max]; |
| 95 |
|
| 96 |
dboolean dsda_BruteForce(void); |
| 97 |
dboolean dsda_BruteForceEnded(void); |
| 98 |
void dsda_ResetBruteForceConditions(void); |
| 99 |
void dsda_SetBruteForceTarget(dsda_bf_attribute_t attribute, |
| 100 |
dsda_bf_limit_t limit, fixed_t value, dboolean has_value); |
| 101 |
void dsda_AddMiscBruteForceCondition(dsda_bf_attribute_t attribute, fixed_t value); |
| 102 |
void dsda_AddBruteForceCondition(dsda_bf_attribute_t attribute, |
| 103 |
dsda_bf_operator_t operator, fixed_t value); |
| 104 |
dboolean dsda_StartBruteForce(int depth); |
| 105 |
int dsda_KeepBruteForceFrame(int i); |
| 106 |
int dsda_AddBruteForceFrame(int i, |
| 107 |
int forwardmove_min, int forwardmove_max, |
| 108 |
int sidemove_min, int sidemove_max, |
| 109 |
int angleturn_min, int angleturn_max, |
| 110 |
byte buttons); |
| 111 |
void dsda_BruteForceWithoutMonsters(void); |
| 112 |
void dsda_BruteForceWithMonsters(void); |
| 113 |
void dsda_UpdateBruteForce(void); |
| 114 |
void dsda_EvaluateBruteForce(void); |
| 115 |
void dsda_CopyBruteForceCommand(ticcmd_t* cmd); |