File: unitfunc.h

package info (click to toggle)
freeciv 1.9.0-2.1
  • links: PTS
  • area: main
  • in suites: potato
  • size: 11,004 kB
  • ctags: 6,284
  • sloc: ansic: 65,037; makefile: 634; sh: 418; sed: 93
file content (76 lines) | stat: -rw-r--r-- 3,829 bytes parent folder | download
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
/********************************************************************** 
 Freeciv - Copyright (C) 1996 - A Kjeldberg, L Gregersen, P Unold
   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, 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 General Public License for more details.
***********************************************************************/
#ifndef FC__UNITFUNC_H
#define FC__UNITFUNC_H

#include "packets.h"
#include "unit.h"

void diplomat_investigate(struct player *pplayer, struct unit *pdiplomat, struct city *pcity);
void spy_poison(struct player *pplayer, struct unit *pdiplomat, 
		struct city *pcity);
void spy_sabotage_unit(struct player *pplayer, struct unit *pdiplomat, struct unit *pvictim);
int diplomat_infiltrate_city(struct player *pplayer, struct player *cplayer,
			     struct unit *pdiplomat, struct city *pcity);
void diplomat_leave_city(struct player *pplayer, struct unit *pdiplomat,
			 struct city *pcity);
void diplomat_bribe(struct player *pplayer, struct unit *pdiplomat, 
		    struct unit *pvictim);
void diplomat_get_tech(struct player *pplayer, struct unit *pdiplomat, 
		       struct city  *pcity, int tech);
void diplomat_incite(struct player *pplayer, struct unit *pdiplomat, 
		     struct city *pcity);
void diplomat_sabotage(struct player *pplayer, struct unit *pdiplomat, 
		       struct city *pcity, int improvement);

void player_restore_units(struct player *pplayer);
void unit_restore_hitpoints(struct player *pplayer, struct unit *punit);
void unit_restore_movepoints(struct player *pplayer, struct unit *punit);
void update_unit_activities(struct player *pplayer);
void update_unit_activity(struct player *pplayer, struct unit *punit);

void create_unit(struct player *pplayer, int x, int y, Unit_Type_id type,
		 int make_veteran, int homecity_id, int moves_left);
void create_unit_full(struct player *pplayer, int x, int y, Unit_Type_id 
		      type, int make_veteran, int homecity_id, int moves_left
		      , int hp);
void send_remove_unit(struct player *pplayer, int unit_id);
void wipe_unit(struct player *dest, struct unit *punit);
void wipe_unit_safe(struct player *dest, struct unit *punit,
		    struct genlist_iterator *iter);
void wipe_unit_spec_safe(struct player *dest, struct unit *punit,
		    struct genlist_iterator *iter, int wipe_cargo);

void kill_unit(struct unit *pkiller, struct unit *punit);
void send_unit_info(struct player *dest, struct unit *punit, int dosend);

void maybe_make_veteran(struct unit *punit);
void unit_versus_unit(struct unit *attacker, struct unit *defender);
int get_total_attack_power(struct unit *attacker, struct unit *defender);
int get_total_defense_power(struct unit *attacker, struct unit *defender);
int get_simple_defense_power(int d_type, int x, int y);
int get_virtual_defense_power(int a_type, int d_type, int x, int y);
void do_nuke_tile(int x, int y);
void do_nuclear_explosion(int x, int y);
int try_move_unit(struct unit *punit, int dest_x, int dest_y); 
int do_airline(struct unit *punit, int x, int y);
int do_paradrop(struct player *pplayer, struct unit *punit, int x, int y);
void raze_city(struct city *pcity);
void get_a_tech(struct player *pplayer, struct player *target);
void place_partisans(struct city *pcity,int count);
void make_partisans(struct city *pcity);

char *get_location_str_in(struct player *pplayer, int x, int y, char *prefix);
char *get_location_str_at(struct player *pplayer, int x, int y, char *prefix);

#endif  /* FC__UNITFUNC_H */