#include "../sdl/sound/CSound.h" #include "../keen.h" #include "vort.h" #include "../include/game.h" #include "../include/enemyai.h" // The rope holding the stone which kills the final Vorticon (ep1) // (Oh shit, was that a spoiler? I'm sorry) // ;) void rope_movestone(int o); void killboss(int o); #define ROPE_IDLE 0 #define ROPE_DROP 1 #define STONE_WIDTH 9 #define STONE_HEIGHT 2 #define STONE_DROP_RATE 100 #define STONE_DROP_TIMES 4 #define ROPE_SPRITE 114 void rope_ai(int o) { int i; if (objects[o].needinit) { // first time initilization objects[o].ai.rope.state = ROPE_IDLE; objects[o].canbezapped = 1; objects[o].inhibitfall = 1; objects[o].sprite = ROPE_SPRITE; // find the vorticon commander for(i=0;i> CSF >> 4) - 4; objects[o].ai.rope.stoneY = (objects[o].y >> CSF >> 4) + 1; // hide the rope objects[o].sprite = BlankSprite; } break; case ROPE_DROP: if (objects[o].ai.rope.droptimer > STONE_DROP_RATE) { rope_movestone(o); objects[o].ai.rope.droptimer = 0; objects[o].ai.rope.droptimes++; if (objects[o].ai.rope.droptimes >= STONE_DROP_TIMES) { // just to make sure the boss is dead // killboss(o); objects[o].exists = 0; } } else objects[o].ai.rope.droptimer++; break; } } void rope_movestone(int o) { int xa,ya; int x,y; unsigned int xpix,ypix,vb; xa = objects[o].ai.rope.stoneX; ya = objects[o].ai.rope.stoneY; // move the stone down one space for(y=STONE_HEIGHT;y>0;y--) { for(x=0;x= objects[vb].x) { if (ypix <= objects[vb].y && ypix+(16<= objects[vb].y) { killboss(o); } } } } // clear the space at the top with black for(x=0;xplayStereofromCoord(SOUND_VORT_DIE, PLAY_NOW, objects[o].scrx); } }