2010-10-12 10:55:23 +02:00
|
|
|
/*
|
2011-03-05 13:44:21 +01:00
|
|
|
* This software is licensed under the terms of the MIT-License
|
2017-02-11 02:24:47 +01:00
|
|
|
* See COPYING for further information.
|
2011-03-05 13:44:21 +01:00
|
|
|
* ---
|
|
|
|
* Copyright (C) 2011, Lukas Weber <laochailan@web.de>
|
2010-10-12 10:55:23 +02:00
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef PLAYER_H
|
|
|
|
#define PLAYER_H
|
|
|
|
|
2017-02-11 04:52:08 +01:00
|
|
|
#include <stdbool.h>
|
|
|
|
|
2017-02-07 19:34:55 +01:00
|
|
|
#include "tscomplex.h"
|
2011-04-26 12:04:45 +02:00
|
|
|
#include "enemy.h"
|
2012-08-15 16:36:39 +02:00
|
|
|
#include "gamepad.h"
|
2011-06-25 12:41:40 +02:00
|
|
|
#include "resource/animation.h"
|
2011-06-13 18:48:36 +02:00
|
|
|
|
2010-10-12 10:55:23 +02:00
|
|
|
enum {
|
2012-07-18 18:21:59 +02:00
|
|
|
MOVEFLAG_UP = 1,
|
|
|
|
MOVEFLAG_DOWN = 2,
|
|
|
|
MOVEFLAG_LEFT = 4,
|
|
|
|
MOVEFLAG_RIGHT = 8
|
2010-10-12 10:55:23 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
typedef enum {
|
2017-02-05 02:25:17 +01:00
|
|
|
Youmu = 0,
|
2011-04-10 11:19:44 +02:00
|
|
|
Marisa
|
2010-10-12 10:55:23 +02:00
|
|
|
} Character;
|
|
|
|
|
2011-04-10 11:19:44 +02:00
|
|
|
typedef enum {
|
2017-02-05 02:25:17 +01:00
|
|
|
YoumuOpposite = 0,
|
2011-06-24 19:16:05 +02:00
|
|
|
YoumuHoming,
|
2017-02-11 02:24:47 +01:00
|
|
|
|
2011-06-29 17:01:03 +02:00
|
|
|
MarisaLaser = YoumuOpposite,
|
2011-07-06 14:33:53 +02:00
|
|
|
MarisaStar = YoumuHoming
|
2011-04-10 11:19:44 +02:00
|
|
|
} ShotMode;
|
|
|
|
|
2010-10-12 10:55:23 +02:00
|
|
|
typedef struct {
|
2011-03-18 19:03:06 +01:00
|
|
|
complex pos;
|
2010-10-12 10:55:23 +02:00
|
|
|
short focus;
|
2017-02-11 04:52:08 +01:00
|
|
|
bool fire;
|
|
|
|
bool moving;
|
2017-02-11 02:24:47 +01:00
|
|
|
|
2010-10-12 10:55:23 +02:00
|
|
|
short dir;
|
2017-02-08 20:59:43 +01:00
|
|
|
short power;
|
2017-02-15 18:34:47 +01:00
|
|
|
|
2012-08-13 19:10:41 +02:00
|
|
|
int graze;
|
2017-02-15 18:34:47 +01:00
|
|
|
int points;
|
2017-02-11 02:24:47 +01:00
|
|
|
|
2011-04-10 10:23:24 +02:00
|
|
|
int lifes;
|
2011-03-23 12:26:30 +01:00
|
|
|
int bombs;
|
2017-02-11 02:24:47 +01:00
|
|
|
|
2011-06-29 17:01:03 +02:00
|
|
|
int recovery;
|
2017-02-11 02:24:47 +01:00
|
|
|
|
2011-06-25 12:41:40 +02:00
|
|
|
int deathtime;
|
2012-08-11 14:03:41 +02:00
|
|
|
int respawntime;
|
2017-02-11 02:24:47 +01:00
|
|
|
|
2011-07-02 11:39:36 +02:00
|
|
|
int continues;
|
2017-02-11 02:24:47 +01:00
|
|
|
|
2010-10-12 10:55:23 +02:00
|
|
|
Character cha;
|
2011-04-10 11:19:44 +02:00
|
|
|
ShotMode shot;
|
2011-04-26 12:04:45 +02:00
|
|
|
Enemy *slaves;
|
2017-02-11 02:24:47 +01:00
|
|
|
|
2012-07-14 16:37:52 +02:00
|
|
|
int moveflags;
|
2012-08-12 18:00:56 +02:00
|
|
|
int curmove;
|
|
|
|
int movetime;
|
|
|
|
int prevmove;
|
|
|
|
int prevmovetime;
|
2017-02-04 14:41:15 +01:00
|
|
|
int gamepadmove;
|
|
|
|
|
2012-08-15 16:36:39 +02:00
|
|
|
int axis_ud;
|
|
|
|
int axis_lr;
|
2017-02-11 02:24:47 +01:00
|
|
|
|
|
|
|
char iddqd;
|
2010-10-12 10:55:23 +02:00
|
|
|
} Player;
|
|
|
|
|
2011-07-04 09:14:08 +02:00
|
|
|
void init_player(Player*);
|
2017-02-15 17:09:09 +01:00
|
|
|
void prepare_player_for_next_stage(Player*);
|
|
|
|
|
2010-10-12 10:55:23 +02:00
|
|
|
void player_draw(Player*);
|
|
|
|
void player_logic(Player*);
|
2011-03-23 12:26:30 +01:00
|
|
|
|
2012-07-20 16:11:24 +02:00
|
|
|
void player_set_char(Player*, Character);
|
2017-02-08 20:59:43 +01:00
|
|
|
void player_set_power(Player *plr, short npow);
|
2011-06-29 17:01:03 +02:00
|
|
|
|
2012-07-20 16:11:24 +02:00
|
|
|
void player_move(Player*, complex delta);
|
2011-07-05 15:20:19 +02:00
|
|
|
|
2012-07-20 16:11:24 +02:00
|
|
|
void player_bomb(Player*);
|
|
|
|
void player_realdeath(Player*);
|
|
|
|
void player_death(Player*);
|
2012-08-14 16:14:53 +02:00
|
|
|
void player_graze(Player*, complex, int);
|
2012-07-14 16:37:52 +02:00
|
|
|
|
2017-02-11 04:52:08 +01:00
|
|
|
void player_setmoveflag(Player* plr, int key, bool mode);
|
|
|
|
void player_event(Player* plr, int type, int key);
|
2012-07-14 16:37:52 +02:00
|
|
|
void player_applymovement(Player* plr);
|
2012-08-17 20:58:23 +02:00
|
|
|
void player_input_workaround(Player *plr);
|
2012-07-14 16:37:52 +02:00
|
|
|
|
2011-07-02 11:39:36 +02:00
|
|
|
#endif
|