Use createEvilBlob and createEyeDroid functions.

This commit is contained in:
Steve 2018-02-12 18:26:18 +00:00
parent dff8dee815
commit ff74e19f12
34 changed files with 55 additions and 78 deletions

View File

@ -26,9 +26,7 @@ Entity *initAquaBlob(void)
{
Unit *u;
u = createUnit();
initEvilBlob(u);
u = createEvilBlob();
u->sprite[FACING_LEFT] = getSprite("AquaBlobLeft");
u->sprite[FACING_RIGHT] = getSprite("AquaBlobRight");

View File

@ -20,6 +20,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#include "../../common.h"
extern Unit *createUnit(void);
extern void initEvilBlob(Unit *u);
extern Unit *createEvilBlob(void);
extern Sprite *getSprite(char *name);
extern Entity *self;

View File

@ -27,8 +27,12 @@ static void returnToStart(void);
static void lookForPlayer(void);
static void animate(void);
void initEvilBlob(Unit *u)
Unit *createEvilBlob(void)
{
Unit *u;
u = createUnit();
u->reload = 0;
u->returnToStartTimer = 0;
@ -41,6 +45,8 @@ void initEvilBlob(Unit *u)
u->walk = lookForPlayer;
u->animate = animate;
u->die = die;
return u;
}
static void die2(void)

View File

@ -34,6 +34,7 @@ extern void addDefeatedTarget(char *name);
extern void fireTriggers(char *name);
extern void addRandomItems(float x, float y);
extern int rrnd(int low, int high);
extern Unit *createUnit(void);
extern Dev dev;
extern Entity *self;

View File

@ -28,9 +28,7 @@ Entity *initGrenadeBlob(void)
{
Unit *u;
u = createUnit();
initEvilBlob(u);
u = createEvilBlob();
u->unitType = "GrenadeBlob";

View File

@ -20,8 +20,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#include "../../common.h"
extern Unit *createUnit(void);
extern void initEvilBlob(Unit *u);
extern Unit *createEvilBlob(void);
extern Sprite *getSprite(char *name);
extern Entity *self;

View File

@ -26,9 +26,7 @@ Entity *initLaserBlob(void)
{
Unit *u;
u = createUnit();
initEvilBlob(u);
u = createEvilBlob();
u->unitType = "LaserBlob";

View File

@ -20,8 +20,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#include "../../common.h"
extern Unit *createUnit(void);
extern void initEvilBlob(Unit *u);
extern Unit *createEvilBlob(void);
extern Sprite *getSprite(char *name);
extern Entity *self;

View File

@ -26,9 +26,7 @@ Entity *initMachineGunBlob(void)
{
Unit *u;
u = createUnit();
initEvilBlob(u);
u = createEvilBlob();
u->unitType = "MachineGunBlob";

View File

@ -20,8 +20,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#include "../../common.h"
extern Unit *createUnit(void);
extern void initEvilBlob(Unit *u);
extern Unit *createEvilBlob(void);
extern Sprite *getSprite(char *name);
extern Entity *self;

View File

@ -26,9 +26,7 @@ Entity *initPistolBlob(void)
{
Unit *u;
u = createUnit();
initEvilBlob(u);
u = createEvilBlob();
u->unitType = "PistolBlob";

View File

@ -19,8 +19,8 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
#include "../../common.h"
#include "../../json/cJSON.h"
extern Unit *createUnit(void);
extern void initEvilBlob(Unit *u);
extern Unit *createEvilBlob(void);
extern Sprite *getSprite(char *name);
extern Entity *self;

View File

@ -26,9 +26,7 @@ Entity *initPlasmaBlob(void)
{
Unit *u;
u = createUnit();
initEvilBlob(u);
u = createEvilBlob();
u->unitType = "PlasmaBlob";

View File

@ -20,8 +20,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#include "../../common.h"
extern Unit *createUnit(void);
extern void initEvilBlob(Unit *u);
extern Unit *createEvilBlob(void);
extern Sprite *getSprite(char *name);
extern Entity *self;

View File

@ -26,9 +26,7 @@ Entity *initShotgunBlob(void)
{
Unit *u;
u = createUnit();
initEvilBlob(u);
u = createEvilBlob();
u->unitType = "ShotgunBlob";

View File

@ -20,7 +20,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#include "../../common.h"
extern Unit *createUnit(void);
extern void initEvilBlob(Unit *u);
extern Unit *createEvilBlob(void);
extern Sprite *getSprite(char *name);
extern Entity *self;

View File

@ -26,9 +26,7 @@ Entity *initSpreadGunBlob(void)
{
Unit *u;
u = createUnit();
initEvilBlob(u);
u = createEvilBlob();
u->unitType = "SpreadGunBlob";

View File

@ -20,8 +20,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#include "../../common.h"
extern Unit *createUnit(void);
extern void initEvilBlob(Unit *u);
extern Unit *createEvilBlob(void);
extern Sprite *getSprite(char *name);
extern Entity *self;

View File

@ -27,8 +27,12 @@ static void touch(Entity *other);
static void (*superTick)(void);
static void (*superTouch)(Entity *other);
void initEyeDroid(Unit *u)
Unit *createEyeDroid(void)
{
Unit *u;
u = createUnit();
u->flags |= EF_WEIGHTLESS | EF_HALT_AT_EDGE | EF_EXPLODES;
superTick = u->tick;
@ -39,6 +43,8 @@ void initEyeDroid(Unit *u)
u->tick = tick;
u->touch = touch;
u->die = die;
return u;
}
static void tick(void)

View File

@ -36,6 +36,7 @@ extern void addExplosion(float x, float y, int radius, Entity *owner);
extern void throwDebris(float x, float y, int amount);
extern void addSmokeParticles(float x, float y);
extern void addScorchDecal(int x, int y);
extern Unit *createUnit(void);
extern Dev dev;
extern Entity *self;

View File

@ -28,9 +28,7 @@ Entity *initGrenadeDroid(void)
{
Unit *u;
u = createUnit();
initEyeDroid(u);
u = createEyeDroid();
u->unitType = "GrenadeEyeDroid";

View File

@ -20,8 +20,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#include "../../common.h"
extern Unit *createUnit(void);
extern void initEyeDroid(Unit *u);
extern Unit *createEyeDroid(void);
extern Sprite *getSprite(char *name);
extern Entity *self;

View File

@ -26,9 +26,7 @@ Entity *initLaserDroid(void)
{
Unit *u;
u = createUnit();
initEyeDroid(u);
u = createEyeDroid();
u->unitType = "LaserEyeDroid";

View File

@ -20,8 +20,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#include "../../common.h"
extern Unit *createUnit(void);
extern void initEyeDroid(Unit *u);
extern Unit *createEyeDroid(void);
extern Sprite *getSprite(char *name);
extern Entity *self;

View File

@ -26,9 +26,7 @@ Entity *initMachineGunDroid(void)
{
Unit *u;
u = createUnit();
initEyeDroid(u);
u = createEyeDroid();
u->unitType = "MachineGunEyeDroid";

View File

@ -20,8 +20,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#include "../../common.h"
extern Unit *createUnit(void);
extern void initEyeDroid(Unit *u);
extern Unit *createEyeDroid(void);
extern Sprite *getSprite(char *name);
extern Entity *self;

View File

@ -26,9 +26,7 @@ Entity *initPistolDroid(void)
{
Unit *u;
u = createUnit();
initEyeDroid(u);
u = createEyeDroid();
u->unitType = "PistolEyeDroid";

View File

@ -20,6 +20,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#include "../../common.h"
extern Unit *createUnit(void);
extern void initEyeDroid(Unit *u);
extern Unit *createEyeDroid(void);
extern Sprite *getSprite(char *name);
extern Entity *self;

View File

@ -26,9 +26,7 @@ Entity *initPlasmaDroid(void)
{
Unit *u;
u = createUnit();
initEyeDroid(u);
u = createEyeDroid();
u->unitType = "PlasmaEyeDroid";

View File

@ -20,8 +20,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#include "../../common.h"
extern Unit *createUnit(void);
extern void initEyeDroid(Unit *u);
extern Unit *createEyeDroid(void);
extern Sprite *getSprite(char *name);
extern Entity *self;

View File

@ -26,9 +26,7 @@ Entity *initShotgunDroid(void)
{
Unit *u;
u = createUnit();
initEyeDroid(u);
u = createEyeDroid();
u->unitType = "ShotgunEyeDroid";

View File

@ -20,6 +20,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#include "../../common.h"
extern Unit *createUnit(void);
extern void initEyeDroid(Unit *u);
extern Unit *createEyeDroid(void);
extern Sprite *getSprite(char *name);
extern Entity *self;

View File

@ -26,9 +26,7 @@ Entity *initSpreadGunDroid(void)
{
Unit *u;
u = createUnit();
initEyeDroid(u);
u = createEyeDroid();
u->unitType = "SpreadGunEyeDroid";

View File

@ -20,8 +20,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#include "../../common.h"
extern Unit *createUnit(void);
extern void initEyeDroid(Unit *u);
extern Unit *createEyeDroid(void);
extern Sprite *getSprite(char *name);
extern Entity *self;