Love the concept of Windrobes? Wish they were just slightly less annoying? Wish you could rationalize filling a dungeon with 'em? Then have I got the enemy for you!
Behold, the windBlower! This nastiful enemy shoots whirlwinds that carry you away like those of the Windrobes, only they don't return you to the start of the dungeon. This little guy goes great with floor spikes and even better with bottomless pits. Whirlwinds will carry Link with them until they hit the edge of a screen or a wall. Then they just drop him.
Type: Other
Attribute 1: Max attack rate in frames (default 80)
Attribute 2: Gust step speed (default 350)
All typical enemy attributes are used.
const int WPS_WIND = 13; //Wind sprite ffc script windBlower{ void run(int enemyID){ npc ghost = Ghost_InitAutoGhost(this, enemyID); Ghost_SetFlag(GHF_FLYING_ENEMY); int attRate = Ghost_GetAttribute(ghost, 0, 80); int gustStep = Ghost_GetAttribute(ghost, 1, 350); int turnTimer = ghost->Rate*10; int attTimer = Rand(attRate/2, attRate); eweapon gust; do{ //Handle active gust if(gust->isValid()) doGust(gust); //Shoot else{ attTimer--; if(attTimer <= 0){ attTimer = Rand(attRate/2, attRate); gust = FireNonAngularEWeapon(EW_SCRIPT1, Ghost_X, Ghost_Y, Ghost_Dir, gustStep, 0, WPS_WIND, SFX_WHIRLWIND, EWF_NO_COLLISION); } } //Walk and turn turnTimer = Ghost_ConstantWalk4(turnTimer, ghost->Step, ghost->Rate*10, ghost->Homing, ghost->Hunger); }while(Ghost_Waitframe(this, ghost, true, true)); } //Blow Link away if touching gust void doGust(eweapon gust){ //If can't move there, kill gust if(!CanWalk(gust->X, gust->Y, gust->Dir, gust->Step/100, false)){ Remove(gust); return; } //If not touching, quit if(DistanceLink(gust) > 10) return; //Place Link on gust Link->X = gust->X; Link->Y = gust->Y; //Make Link float (over pits) Link->Z = 4; } }
Edited by MoscowModder, 11 April 2014 - 05:17 PM.