[go: up one dir, main page]

Menu

[r211]: / code / unitmove.h  Maximize  Restore  History

Download this file

105 lines (91 with data), 5.5 kB

  1
  2
  3
  4
  5
  6
  7
  8
  9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
/*******************************************************************************
* UNITMOVE.H *
* - Declarations and functions for unit movement *
* *
* SDLGL - SDLGLMAP_INFO *
* (c)2002 - 2017 Paul Mueller <muellerp61@bluewin.ch> *
* *
* This program is free software; you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published by *
* the Free Software Foundation; either version 2 of the License, or *
* (at your option) any later version. *
* *
* This program is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
* GNU Library General Public License for more details. *
* *
* You should have received a copy of the GNU General Public License *
* along with this program; if not, write to the Free Software *
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
*******************************************************************************/
#ifndef _FSC_UNITMOVE_H_
#define _FSC_UNITMOVE_H_
/*******************************************************************************
* INCLUDES *
*******************************************************************************/
#include "game.h" /* GAME_MAX_LIST */
/*******************************************************************************
* DEFINES *
*******************************************************************************/
#define UNITMOVE_CHOOSE_NUMBER 1 /* Choose unit with this number */
#define UNITMOVE_CHOOSE_POSITION 2 /* Choose unit at this position */
#define UNITMOVE_CHOOSE_CURRENT 3 /* Choose unit at list-cursor */
#define UNITMOVE_CHOOSE_NEXT 4 /* Choose next unit in list */
#define UNITMOVE_CHOOSE_NEXTSKIP 5 /* Choose next unit in list
and skip actual one */
/*******************************************************************************
* TYPEDEFS *
*******************************************************************************/
typedef struct
{
int unit_no; /* Number of unit to move */
int pos_x, pos_y; /* Map x/y position of chosen unit */
int map_pos;
int owner_no; /* Owner of this unit */
char name[20 + 1]; /* Name of unit */
int hp[2]; /* UI_VALUE_ACT ..._FULL Unit_HPStr */
int moves[2]; /* UI_VALUE_ACT ..._FULL */
char type; /* Type of this unit, for AI -- Unit_ClassName */
/* Number of icon for display */
int attack,
defense; /* Attack and defense values */
int ability; /* UNIT_AIROLE_* saves some func calls */
/* Class of ship */
int range_no; /* To save some call while playing */
/* The range of the ship: 0 / 1 / 2 */
/* RULES_RANGE_* */
int order; /* Actual order */
int cargo_type,
cargo_load; /* Number of settlers, pduction-points */
int level;
/* Has to be filled, if planet is chosen with unit */
char special_orders[10];
}
UNIT_MNG_T;
typedef struct
{
/* ----- The different info for the the actual unit chosen -------- */
char nation_no; /* Unit belongs to this nation */
/* --------- Info about unit in 'list[] for display --------------- */
/* ---------- Values of chosen unit itself ------------------------ */
int map_pos;
char moves_left;
char type;
char range_no;
char ability;
char order_no;
}
UNIT_MNG_T;
/*******************************************************************************
* CODE *
*******************************************************************************/
void unitmove_fill_manageinfo(UNIT_MNG_T *pmnginfo);
void unitmoveCreate(int num, int pos, int type_no);
void unitmoveGetManageInfo(char map_pos, UNIT_MNG_T *unit_mng);
int unitmoveExecuteOrder(UNIT_MNG_T *unit_mng);
int unitmove_choose(UNIT_MNG_T *unit_mng, int value, char which);
void unitmove_set_order(int unit_no, int order, int target, int build);
void unitmove_attack(int attacker_no, int defender_no);
void unitmoveEndTurn(char nation_no);
#endif /* _FSC_UNITMOVE_H_ */