Debian Codegraph @

src/shots.h

raw symbols SCIP
1 /*
2 * OpenTyrian: A modern cross-platform port of Tyrian
3 * Copyright (C) 2007-2013 The OpenTyrian Development Team
4 *
5 * This program is free software; you can redistribute it and/or
6 * modify it under the terms of the GNU General Public License
7 * as published by the Free Software Foundation; either version 2
8 * of the License, or (at your option) any later version.
9 *
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
14 *
15 * You should have received a copy of the GNU General Public License
16 * along with this program; if not, write to the Free Software
17 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
18 */
19 #ifndef SHOTS_H
20 #define SHOTS_H
21 #include "opentyr.h"
22
23 typedef struct {
24 JE_integer shotX, shotY, shotXM, shotYM, shotXC, shotYC;
25 JE_boolean shotComplicated;
26 JE_integer shotDevX, shotDirX, shotDevY, shotDirY, shotCirSizeX, shotCirSizeY;
27 JE_byte shotTrail;
28 JE_word shotGr, shotAni, shotAniMax;
29 Uint8 shotDmg;
30 JE_byte shotBlastFilter, chainReaction, playerNumber, aimAtEnemy, aimDelay, aimDelayMax;
31 } PlayerShotDataType;
32
33 #define MAX_PWEAPON 81 /* 81*/
34 extern PlayerShotDataType playerShotData[MAX_PWEAPON + 1];
35 extern JE_byte shotAvail[MAX_PWEAPON];
36
37 /** Used in the shop to show weapon previews. */
38 void simulate_player_shots(void);
39
40 /** Points shot movement in the specified direction. Used for the turret gun. */
41 void player_shot_set_direction(JE_integer shot_id, uint weapon_id, JE_real direction);
42
43 /** Moves and draws a shot. Does \b not collide it with enemies.
44 * \return False if the shot went off-screen, true otherwise.
45 */
46 bool player_shot_move_and_draw(
47 int shot_id, bool *out_is_special,
48 int *out_shotx, int *out_shoty,
49 JE_integer *out_shot_damage, JE_byte *out_blast_filter,
50 JE_byte *out_chain, JE_byte *out_playerNum,
51 JE_word *out_special_radiusw, JE_word *out_special_radiush);
52
53 /** Creates a player shot. */
54 JE_integer player_shot_create(
55 JE_word portnum, uint shot_i, JE_word px, JE_word py,
56 JE_word mousex, JE_word mousey,
57 JE_word wpnum, JE_byte playernum);
58
59 #endif // SHOTS_H