moved flying ship functionality from move.c to flyingship.c

This commit is contained in:
Philipp Dreher 2015-11-02 00:35:32 +01:00
parent 6e7510b7e9
commit d93305b180
3 changed files with 24 additions and 20 deletions

View File

@ -14,15 +14,6 @@
/* libc includes */
#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
* Stufe: 6
@ -89,3 +80,21 @@ int sp_flying_ship(castorder * co)
msg_release(m);
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;
}

View File

@ -5,14 +5,17 @@
#include "magic.h"
#include <kernel/ship.h>
#ifdef __cplusplus
extern "C" {
#endif
int sp_flying_ship(castorder * co);
int levitate_ship(struct ship *sh, struct unit *mage, double power,
int duration);
int sp_flying_ship(castorder * co);
bool flying_ship(const ship * sh);
#ifdef __cplusplus
}

View File

@ -28,6 +28,7 @@ OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
#include "monster.h"
#include "lighthouse.h"
#include "piracy.h"
#include "flyingship.h"
#include <kernel/build.h>
#include <kernel/building.h>
@ -674,15 +675,6 @@ int check_ship_allowed(struct ship *sh, const region * r)
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)
{
if (sh->type->flags & SFL_NOCOAST) {