Use createEvilBlob and createEyeDroid functions.
This commit is contained in:
parent
dff8dee815
commit
ff74e19f12
|
@ -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");
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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)
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -28,9 +28,7 @@ Entity *initGrenadeBlob(void)
|
|||
{
|
||||
Unit *u;
|
||||
|
||||
u = createUnit();
|
||||
|
||||
initEvilBlob(u);
|
||||
u = createEvilBlob();
|
||||
|
||||
u->unitType = "GrenadeBlob";
|
||||
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -26,9 +26,7 @@ Entity *initLaserBlob(void)
|
|||
{
|
||||
Unit *u;
|
||||
|
||||
u = createUnit();
|
||||
|
||||
initEvilBlob(u);
|
||||
u = createEvilBlob();
|
||||
|
||||
u->unitType = "LaserBlob";
|
||||
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -26,9 +26,7 @@ Entity *initMachineGunBlob(void)
|
|||
{
|
||||
Unit *u;
|
||||
|
||||
u = createUnit();
|
||||
|
||||
initEvilBlob(u);
|
||||
u = createEvilBlob();
|
||||
|
||||
u->unitType = "MachineGunBlob";
|
||||
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -26,9 +26,7 @@ Entity *initPistolBlob(void)
|
|||
{
|
||||
Unit *u;
|
||||
|
||||
u = createUnit();
|
||||
|
||||
initEvilBlob(u);
|
||||
u = createEvilBlob();
|
||||
|
||||
u->unitType = "PistolBlob";
|
||||
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -26,9 +26,7 @@ Entity *initPlasmaBlob(void)
|
|||
{
|
||||
Unit *u;
|
||||
|
||||
u = createUnit();
|
||||
|
||||
initEvilBlob(u);
|
||||
u = createEvilBlob();
|
||||
|
||||
u->unitType = "PlasmaBlob";
|
||||
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -26,9 +26,7 @@ Entity *initShotgunBlob(void)
|
|||
{
|
||||
Unit *u;
|
||||
|
||||
u = createUnit();
|
||||
|
||||
initEvilBlob(u);
|
||||
u = createEvilBlob();
|
||||
|
||||
u->unitType = "ShotgunBlob";
|
||||
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -26,9 +26,7 @@ Entity *initSpreadGunBlob(void)
|
|||
{
|
||||
Unit *u;
|
||||
|
||||
u = createUnit();
|
||||
|
||||
initEvilBlob(u);
|
||||
u = createEvilBlob();
|
||||
|
||||
u->unitType = "SpreadGunBlob";
|
||||
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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)
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -28,9 +28,7 @@ Entity *initGrenadeDroid(void)
|
|||
{
|
||||
Unit *u;
|
||||
|
||||
u = createUnit();
|
||||
|
||||
initEyeDroid(u);
|
||||
u = createEyeDroid();
|
||||
|
||||
u->unitType = "GrenadeEyeDroid";
|
||||
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -26,9 +26,7 @@ Entity *initLaserDroid(void)
|
|||
{
|
||||
Unit *u;
|
||||
|
||||
u = createUnit();
|
||||
|
||||
initEyeDroid(u);
|
||||
u = createEyeDroid();
|
||||
|
||||
u->unitType = "LaserEyeDroid";
|
||||
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -26,9 +26,7 @@ Entity *initMachineGunDroid(void)
|
|||
{
|
||||
Unit *u;
|
||||
|
||||
u = createUnit();
|
||||
|
||||
initEyeDroid(u);
|
||||
u = createEyeDroid();
|
||||
|
||||
u->unitType = "MachineGunEyeDroid";
|
||||
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -26,9 +26,7 @@ Entity *initPistolDroid(void)
|
|||
{
|
||||
Unit *u;
|
||||
|
||||
u = createUnit();
|
||||
|
||||
initEyeDroid(u);
|
||||
u = createEyeDroid();
|
||||
|
||||
u->unitType = "PistolEyeDroid";
|
||||
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -26,9 +26,7 @@ Entity *initPlasmaDroid(void)
|
|||
{
|
||||
Unit *u;
|
||||
|
||||
u = createUnit();
|
||||
|
||||
initEyeDroid(u);
|
||||
u = createEyeDroid();
|
||||
|
||||
u->unitType = "PlasmaEyeDroid";
|
||||
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -26,9 +26,7 @@ Entity *initShotgunDroid(void)
|
|||
{
|
||||
Unit *u;
|
||||
|
||||
u = createUnit();
|
||||
|
||||
initEyeDroid(u);
|
||||
u = createEyeDroid();
|
||||
|
||||
u->unitType = "ShotgunEyeDroid";
|
||||
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -26,9 +26,7 @@ Entity *initSpreadGunDroid(void)
|
|||
{
|
||||
Unit *u;
|
||||
|
||||
u = createUnit();
|
||||
|
||||
initEyeDroid(u);
|
||||
u = createEyeDroid();
|
||||
|
||||
u->unitType = "SpreadGunEyeDroid";
|
||||
|
||||
|
|
|
@ -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;
|
||||
|
|
Loading…
Reference in New Issue