forked from github/server
moved flying ship functionality from move.c to flyingship.c
This commit is contained in:
parent
6e7510b7e9
commit
d93305b180
|
@ -14,15 +14,6 @@
|
||||||
/* libc includes */
|
/* libc includes */
|
||||||
#include <assert.h>
|
#include <assert.h>
|
||||||
|
|
||||||
int levitate_ship(ship * sh, unit * mage, double power, int duration)
|
|
||||||
{
|
|
||||||
curse *c = shipcurse_flyingship(sh, mage, power, duration);
|
|
||||||
if (c) {
|
|
||||||
return c->no;
|
|
||||||
}
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* ------------------------------------------------------------- */
|
/* ------------------------------------------------------------- */
|
||||||
/* Name: Luftschiff
|
/* Name: Luftschiff
|
||||||
* Stufe: 6
|
* Stufe: 6
|
||||||
|
@ -89,3 +80,21 @@ int sp_flying_ship(castorder * co)
|
||||||
msg_release(m);
|
msg_release(m);
|
||||||
return cast_level;
|
return cast_level;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
int levitate_ship(ship * sh, unit * mage, double power, int duration)
|
||||||
|
{
|
||||||
|
curse *c = shipcurse_flyingship(sh, mage, power, duration);
|
||||||
|
if (c) {
|
||||||
|
return c->no;
|
||||||
|
}
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
bool flying_ship(const ship * sh)
|
||||||
|
{
|
||||||
|
if (sh->type->flags & SFL_FLY)
|
||||||
|
return true;
|
||||||
|
if (sh->flags & SF_FLYING)
|
||||||
|
return true;
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
|
@ -5,14 +5,17 @@
|
||||||
|
|
||||||
#include "magic.h"
|
#include "magic.h"
|
||||||
|
|
||||||
|
#include <kernel/ship.h>
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
extern "C" {
|
extern "C" {
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
int sp_flying_ship(castorder * co);
|
||||||
|
|
||||||
int levitate_ship(struct ship *sh, struct unit *mage, double power,
|
int levitate_ship(struct ship *sh, struct unit *mage, double power,
|
||||||
int duration);
|
int duration);
|
||||||
|
bool flying_ship(const ship * sh);
|
||||||
int sp_flying_ship(castorder * co);
|
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
}
|
}
|
||||||
|
|
10
src/move.c
10
src/move.c
|
@ -28,6 +28,7 @@ OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
||||||
#include "monster.h"
|
#include "monster.h"
|
||||||
#include "lighthouse.h"
|
#include "lighthouse.h"
|
||||||
#include "piracy.h"
|
#include "piracy.h"
|
||||||
|
#include "flyingship.h"
|
||||||
|
|
||||||
#include <kernel/build.h>
|
#include <kernel/build.h>
|
||||||
#include <kernel/building.h>
|
#include <kernel/building.h>
|
||||||
|
@ -674,15 +675,6 @@ int check_ship_allowed(struct ship *sh, const region * r)
|
||||||
return SA_NO_COAST;
|
return SA_NO_COAST;
|
||||||
}
|
}
|
||||||
|
|
||||||
static bool flying_ship(const ship * sh)
|
|
||||||
{
|
|
||||||
if (sh->type->flags & SFL_FLY)
|
|
||||||
return true;
|
|
||||||
if (sh->flags & SF_FLYING)
|
|
||||||
return true;
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
static void set_coast(ship * sh, region * r, region * rnext)
|
static void set_coast(ship * sh, region * r, region * rnext)
|
||||||
{
|
{
|
||||||
if (sh->type->flags & SFL_NOCOAST) {
|
if (sh->type->flags & SFL_NOCOAST) {
|
||||||
|
|
Loading…
Reference in New Issue