2011-04-10 10:23:24 +02:00
|
|
|
/*
|
|
|
|
* This software is licensed under the terms of the MIT-License
|
2017-02-11 04:52:08 +01:00
|
|
|
* See COPYING for further information.
|
2011-04-10 10:23:24 +02:00
|
|
|
* ---
|
2019-01-23 21:10:43 +01:00
|
|
|
* Copyright (c) 2011-2019, Lukas Weber <laochailan@web.de>.
|
|
|
|
* Copyright (c) 2012-2019, Andrei Alexeyev <akari@alienslab.net>.
|
2011-04-10 10:23:24 +02:00
|
|
|
*/
|
|
|
|
|
2019-01-23 21:10:43 +01:00
|
|
|
#ifndef IGUARD_plrmodes_h
|
|
|
|
#define IGUARD_plrmodes_h
|
|
|
|
|
2017-11-25 20:45:11 +01:00
|
|
|
#include "taisei.h"
|
2011-04-10 10:23:24 +02:00
|
|
|
|
2011-04-26 12:04:45 +02:00
|
|
|
#include "enemy.h"
|
2011-05-06 17:09:43 +02:00
|
|
|
#include "projectile.h"
|
2011-06-25 12:41:40 +02:00
|
|
|
#include "player.h"
|
2017-10-08 13:30:51 +02:00
|
|
|
#include "ending.h"
|
2017-11-26 14:06:35 +01:00
|
|
|
#include "stage.h"
|
2018-07-15 17:48:22 +02:00
|
|
|
#include "dialog.h"
|
2011-06-25 12:41:40 +02:00
|
|
|
|
2017-10-08 13:30:51 +02:00
|
|
|
typedef enum {
|
2018-08-11 21:13:48 +02:00
|
|
|
// WARNING: Reordering this will break current replays, and possibly even progress files.
|
2011-06-25 12:41:40 +02:00
|
|
|
|
2018-08-11 21:13:48 +02:00
|
|
|
PLR_CHAR_REIMU = 0,
|
|
|
|
PLR_CHAR_MARISA = 1,
|
|
|
|
PLR_CHAR_YOUMU = 2,
|
2011-04-10 10:23:24 +02:00
|
|
|
|
2018-01-12 19:26:07 +01:00
|
|
|
NUM_CHARACTERS,
|
2017-10-08 13:30:51 +02:00
|
|
|
} CharacterID;
|
2011-04-29 10:26:37 +02:00
|
|
|
|
2017-10-08 13:30:51 +02:00
|
|
|
typedef enum {
|
2018-08-11 21:13:48 +02:00
|
|
|
// WARNING: Reordering this will break current replays, and possibly even progress files.
|
2011-06-29 17:01:03 +02:00
|
|
|
|
2018-05-02 08:08:32 +02:00
|
|
|
PLR_SHOT_A,
|
|
|
|
PLR_SHOT_B,
|
|
|
|
NUM_SHOT_MODES_PER_CHARACTER,
|
2011-06-25 12:41:40 +02:00
|
|
|
|
2018-05-02 08:08:32 +02:00
|
|
|
PLR_SHOT_MARISA_LASER = PLR_SHOT_A,
|
|
|
|
PLR_SHOT_MARISA_STAR = PLR_SHOT_B,
|
2011-11-04 18:54:53 +01:00
|
|
|
|
2018-05-02 08:08:32 +02:00
|
|
|
PLR_SHOT_YOUMU_MIRROR = PLR_SHOT_A,
|
|
|
|
PLR_SHOT_YOUMU_HAUNTING = PLR_SHOT_B,
|
2018-08-11 21:13:48 +02:00
|
|
|
|
|
|
|
PLR_SHOT_REIMU_SPIRIT = PLR_SHOT_A,
|
|
|
|
PLR_SHOT_REIMU_DREAM = PLR_SHOT_B,
|
2017-10-08 13:30:51 +02:00
|
|
|
} ShotModeID;
|
2012-07-16 17:47:06 +02:00
|
|
|
|
2018-05-02 08:08:32 +02:00
|
|
|
typedef enum {
|
|
|
|
// vpu = viewport units
|
|
|
|
|
|
|
|
PLR_PROP_SPEED, // current player movement speed (vpu/frame)
|
|
|
|
PLR_PROP_POC, // "point of collection" boundary: all items are auto-collected when player is above this (vpu)
|
|
|
|
PLR_PROP_COLLECT_RADIUS, // how near the player has to be to an item before it's auto-collected (vpu)
|
|
|
|
PLR_PROP_BOMB_TIME, // how long a bomb should last if it were to activate this frame; 0 prevents activation (frames)
|
|
|
|
PLR_PROP_DEATHBOMB_WINDOW, // how much time the player has to recover with a bomb if they died in this frame (frames)
|
|
|
|
} PlrProperty;
|
|
|
|
|
2017-10-08 13:30:51 +02:00
|
|
|
typedef void (*PlrCharEndingProc)(Ending *e);
|
2017-09-27 14:14:53 +02:00
|
|
|
|
2017-10-08 13:30:51 +02:00
|
|
|
typedef struct PlayerCharacter {
|
2018-01-12 19:26:07 +01:00
|
|
|
char id;
|
|
|
|
const char *lower_name;
|
|
|
|
const char *proper_name;
|
|
|
|
const char *full_name;
|
|
|
|
const char *title;
|
|
|
|
const char *dialog_sprite_name;
|
|
|
|
const char *player_sprite_name;
|
2019-04-22 14:29:44 +02:00
|
|
|
const char *menu_texture_name;
|
2018-01-12 19:26:07 +01:00
|
|
|
|
|
|
|
struct {
|
|
|
|
PlrCharEndingProc good;
|
|
|
|
PlrCharEndingProc bad;
|
|
|
|
} ending;
|
2017-10-08 13:30:51 +02:00
|
|
|
} PlayerCharacter;
|
|
|
|
|
2017-10-24 04:57:14 +02:00
|
|
|
typedef void (*PlayerModeInitProc)(Player *plr);
|
2017-11-25 16:51:43 +01:00
|
|
|
typedef void (*PlayerModeFreeProc)(Player *plr);
|
2017-10-08 13:30:51 +02:00
|
|
|
typedef void (*PlayerModeThinkProc)(Player *plr);
|
|
|
|
typedef void (*PlayerModeShotProc)(Player *plr);
|
|
|
|
typedef void (*PlayerModeBombProc)(Player *plr);
|
2017-11-12 16:15:12 +01:00
|
|
|
typedef void (*PlayerModeBombBgProc)(Player *plr);
|
2017-10-08 13:30:51 +02:00
|
|
|
typedef void (*PlayerModePowerProc)(Player *plr, short npow);
|
2017-10-08 23:12:38 +02:00
|
|
|
typedef void (*PlayerModePreloadProc)(void);
|
2018-05-02 08:08:32 +02:00
|
|
|
typedef double (*PlayerModePropertyProc)(Player *plr, PlrProperty prop);
|
2017-10-08 13:30:51 +02:00
|
|
|
|
|
|
|
typedef struct PlayerMode {
|
2018-01-12 19:26:07 +01:00
|
|
|
const char *name;
|
2019-04-21 10:37:50 +02:00
|
|
|
const char *description;
|
2018-01-12 19:26:07 +01:00
|
|
|
PlayerCharacter *character;
|
2018-07-15 17:48:22 +02:00
|
|
|
PlayerDialogProcs *dialog;
|
2018-01-12 19:26:07 +01:00
|
|
|
ShotModeID shot_mode;
|
|
|
|
|
|
|
|
struct {
|
|
|
|
PlayerModeInitProc init;
|
|
|
|
PlayerModeFreeProc free;
|
|
|
|
PlayerModeThinkProc think;
|
|
|
|
PlayerModeShotProc shot;
|
|
|
|
PlayerModeBombProc bomb;
|
2018-01-12 21:05:04 +01:00
|
|
|
ShaderRule bomb_shader;
|
2018-01-12 19:26:07 +01:00
|
|
|
PlayerModeBombBgProc bombbg;
|
|
|
|
PlayerModePowerProc power;
|
|
|
|
PlayerModePreloadProc preload;
|
2018-05-02 08:08:32 +02:00
|
|
|
PlayerModePropertyProc property;
|
2018-01-12 19:26:07 +01:00
|
|
|
} procs;
|
2017-10-08 13:30:51 +02:00
|
|
|
} PlayerMode;
|
|
|
|
|
|
|
|
enum {
|
2018-01-12 19:26:07 +01:00
|
|
|
NUM_PLAYER_MODES = NUM_CHARACTERS * NUM_SHOT_MODES_PER_CHARACTER,
|
2017-10-08 13:30:51 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
PlayerCharacter* plrchar_get(CharacterID id);
|
|
|
|
void plrchar_preload(PlayerCharacter *pc);
|
|
|
|
|
|
|
|
PlayerMode* plrmode_find(CharacterID charid, ShotModeID shotid);
|
2019-04-16 07:30:45 +02:00
|
|
|
int plrmode_repr(char *out, size_t outsize, PlayerMode *mode, bool internal);
|
2017-10-08 13:30:51 +02:00
|
|
|
PlayerMode* plrmode_parse(const char *name);
|
2017-10-08 23:12:38 +02:00
|
|
|
void plrmode_preload(PlayerMode *mode);
|
2018-05-02 08:08:32 +02:00
|
|
|
|
|
|
|
double player_property(Player *plr, PlrProperty prop);
|
2019-01-23 21:10:43 +01:00
|
|
|
|
|
|
|
#endif // IGUARD_plrmodes_h
|