taisei/src/plrmodes.h
Andrei Alexeyev 3615b95f13
Add Reimu Hakurei as a playable character (#106)
* Reimu (#101)

* add the reimu

* Add Reimu story

* account for various blunders

* add reimu dialog picture

* Reimu: WIP yin-yang orbs

* reimu: fix up indents

* Reimu: swap the shotmode names to match the kanji order in her Japanese name

* Reimu: compatibility with the latest system

* WIP ReimuA crap

* ReimuA homing trails

* more ReimuA stuff

* more ReimuA adjustments + enhanced DPS stats

* Reimu: stubs for new player animation sequences

* Reimu: occupy the 0th character slot

* Reimu: tweak needle sprite

* Reimu: buff movement speed to better match Touhou

* Reimu: fixup for the recent projectile changes

* ReimuA: make homing shots a bit smaller; give them custom effect on collision

* Reimu: add intermediate frames; move some loose sprites to the atlas

* Reimu: fix compile errors

* replace DBL_MAX by INFINITY

* Don’t draw reimu orbs twice

fixes #127

* add new reimu dialog pic

* ReimuA adjustments (mostly homing); it's still OP

* wip ReimuB gaps

* still not sure where i'm going with these gaps

* meh

* Reimu: premultiplied alpha fixups after rebase

* reimuB shot pattern with basic power scaling (not balanced at all)

* reimuB: some lame-ass particle effects

* ReimuB bomb effect prototype

* reimuA bomb prototype

* fix reimu shots for the new damage system

* Reimu: use the new player_is_bomb_active() function, add placeholder BG for ReimuB

* some reimuB bomb projectiles

* ReimuB bomb bg and some framebuffer utils required to support it.

Might reuse this at least in part for ReimuA unless we come up with
something better.

* hack to fix ReimuB bomb fade; refactoring needed

* reimuA damaging bombs

* fix ub

* prevent nan when reimuA bombs without enemies present

* add a bomb_bg to reimuA

* ...

* various fantasy seal tweaks

* Reimu: placeholder bomb sounds; slight fantasy seal buff

* fix null pointer dereference

* Reimu "balance" adjustments; minor fixes

* putting bandaids over gunshot wounds

* Add aoe damage and bullet cancel to ReimuB's bomb

* more exorcism porn

* make reimu bomb bg runes better visible on dark backgrounds

* More ReimuA shot changes
2018-08-11 22:13:48 +03:00

115 lines
3.3 KiB
C

/*
* This software is licensed under the terms of the MIT-License
* See COPYING for further information.
* ---
* Copyright (c) 2011-2018, Lukas Weber <laochailan@web.de>.
* Copyright (c) 2012-2018, Andrei Alexeyev <akari@alienslab.net>.
*/
#pragma once
#include "taisei.h"
#include "enemy.h"
#include "projectile.h"
#include "player.h"
#include "ending.h"
#include "stage.h"
#include "dialog.h"
typedef enum {
// WARNING: Reordering this will break current replays, and possibly even progress files.
PLR_CHAR_REIMU = 0,
PLR_CHAR_MARISA = 1,
PLR_CHAR_YOUMU = 2,
NUM_CHARACTERS,
} CharacterID;
typedef enum {
// WARNING: Reordering this will break current replays, and possibly even progress files.
PLR_SHOT_A,
PLR_SHOT_B,
NUM_SHOT_MODES_PER_CHARACTER,
PLR_SHOT_MARISA_LASER = PLR_SHOT_A,
PLR_SHOT_MARISA_STAR = PLR_SHOT_B,
PLR_SHOT_YOUMU_MIRROR = PLR_SHOT_A,
PLR_SHOT_YOUMU_HAUNTING = PLR_SHOT_B,
PLR_SHOT_REIMU_SPIRIT = PLR_SHOT_A,
PLR_SHOT_REIMU_DREAM = PLR_SHOT_B,
} ShotModeID;
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;
typedef void (*PlrCharEndingProc)(Ending *e);
typedef struct PlayerCharacter {
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;
struct {
PlrCharEndingProc good;
PlrCharEndingProc bad;
} ending;
} PlayerCharacter;
typedef void (*PlayerModeInitProc)(Player *plr);
typedef void (*PlayerModeFreeProc)(Player *plr);
typedef void (*PlayerModeThinkProc)(Player *plr);
typedef void (*PlayerModeShotProc)(Player *plr);
typedef void (*PlayerModeBombProc)(Player *plr);
typedef void (*PlayerModeBombBgProc)(Player *plr);
typedef void (*PlayerModePowerProc)(Player *plr, short npow);
typedef void (*PlayerModePreloadProc)(void);
typedef double (*PlayerModePropertyProc)(Player *plr, PlrProperty prop);
typedef struct PlayerMode {
const char *name;
PlayerCharacter *character;
PlayerDialogProcs *dialog;
ShotModeID shot_mode;
struct {
PlayerModeInitProc init;
PlayerModeFreeProc free;
PlayerModeThinkProc think;
PlayerModeShotProc shot;
PlayerModeBombProc bomb;
ShaderRule bomb_shader;
PlayerModeBombBgProc bombbg;
PlayerModePowerProc power;
PlayerModePreloadProc preload;
PlayerModePropertyProc property;
} procs;
} PlayerMode;
enum {
NUM_PLAYER_MODES = NUM_CHARACTERS * NUM_SHOT_MODES_PER_CHARACTER,
};
PlayerCharacter* plrchar_get(CharacterID id);
void plrchar_preload(PlayerCharacter *pc);
PlayerMode* plrmode_find(CharacterID charid, ShotModeID shotid);
int plrmode_repr(char *out, size_t outsize, PlayerMode *mode);
PlayerMode* plrmode_parse(const char *name);
void plrmode_preload(PlayerMode *mode);
double player_property(Player *plr, PlrProperty prop);