Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ffc script Dimitri{
- void run(int enemyID){
- npc ghost = Ghost_InitAutoGhost(this,enemyID);
- bool MovingLeft;
- bool MovingDown;
- int Direction;
- int combo= ghost->Attributes[10];
- if((Ghost_CanMove(DIR_DOWN,1,0))){
- Ghost_Data = combo+1;
- Ghost_SetSize(this,ghost,1,2);
- MovingDown = true;
- MovingLeft = false;
- }
- else{
- Ghost_SetSize(this,ghost,2,1);
- Ghost_Data = combo+3;
- MovingDown= true;
- MovingLeft = true;
- }
- bool Cornered = false;
- eweapon fireball;
- Ghost_SetFlag(GHF_STUN);
- int SPR = ghost->Attributes[0];
- int SFX = ghost->Attributes[1];
- bool attackCond;
- int attackCooldown = Rand(100,200);
- float angle;
- float Speed = ghost->Step/100;
- float Step= Speed;
- int MaxHP = Ghost_HP;
- Gen_Explode_Waitframes(this,ghost,32);
- while(true){
- if(!Cornered){
- if(MovingDown && !MovingLeft){
- Ghost_Data = combo+1;
- Ghost_SetSize(this,ghost,1,2);
- Ghost_ForceDir(DIR_DOWN);
- if(Ghost_CanMove(DIR_DOWN,1,0))
- Ghost_Move(DIR_DOWN, Speed, 0);
- else
- Cornered = true;
- }
- else if(!MovingDown && MovingLeft){
- Ghost_Data = combo+2;
- Ghost_SetSize(this,ghost,2,1);
- Ghost_ForceDir(DIR_LEFT);
- if(Ghost_CanMove(DIR_LEFT,1,0))
- Ghost_Move(DIR_LEFT, Speed, 0);
- else
- Cornered = true;
- }
- else if(!MovingDown && !MovingLeft){
- Ghost_Data = combo;
- Ghost_SetSize(this,ghost,1,2);
- Ghost_ForceDir(DIR_UP);
- if(Ghost_CanMove(DIR_UP,1,0))
- Ghost_Move(DIR_UP, Speed, 0);
- else
- Cornered = true;
- }
- else if(MovingDown && MovingLeft){
- Ghost_Data = combo+3;
- Ghost_SetSize(this,ghost,2,1);
- Ghost_ForceDir(DIR_RIGHT);
- if(Ghost_CanMove(DIR_RIGHT,1,0))
- Ghost_Move(DIR_RIGHT, Speed, 0);
- else
- Cornered = true;
- }
- Direction = Ghost_Dir;
- }
- else{
- if(Direction == DIR_DOWN){
- if(Screen->isSolid(ghost->X-1,ghost->Y+24)
- && !Screen->isSolid(ghost->X+17,ghost->Y+24)){
- Ghost_Data = combo+3;
- Ghost_SetSize(this,ghost,2,1);
- Ghost_ForceDir(DIR_RIGHT);
- Ghost_Y+=16;
- MovingDown = true;
- MovingLeft = true;
- Cornered = false;
- }
- else if(!Screen->isSolid(ghost->X-1,ghost->Y+24)
- && Screen->isSolid(ghost->X+17,ghost->Y+24)){
- Ghost_Data = combo+2;
- Ghost_SetSize(this,ghost,2,1);
- Ghost_ForceDir(DIR_LEFT);
- Ghost_Y+=16;
- Ghost_X-=16;
- MovingDown = false;
- MovingLeft = true;
- Cornered = false;
- }
- else if(!Screen->isSolid(ghost->X-1,ghost->Y+24)
- && !Screen->isSolid(ghost->X+17,ghost->Y+24)){
- Direction = Choose(DIR_LEFT,DIR_RIGHT);
- Ghost_SetSize(this,ghost,2,1);
- Ghost_Y+=16;
- if(Direction==DIR_LEFT){
- Ghost_Data = combo+2;
- Ghost_ForceDir(DIR_LEFT);
- Ghost_X-=16;
- MovingDown = false;
- MovingLeft = true;
- }
- else{
- Ghost_Data = combo+3;
- Ghost_ForceDir(DIR_RIGHT);
- MovingDown = true;
- MovingLeft = true;
- }
- Cornered = false;
- }
- else{
- Ghost_Data = combo;
- Ghost_ForceDir(DIR_UP);
- MovingDown = false;
- MovingLeft = false;
- Cornered = false;
- }
- }
- else if(Direction == DIR_UP){
- if(Screen->isSolid(ghost->X-1,ghost->Y+8)
- && !Screen->isSolid(ghost->X+17,ghost->Y+8)){
- Ghost_Data = combo+3;
- Ghost_SetSize(this,ghost,2,1);
- Ghost_ForceDir(DIR_RIGHT);
- MovingDown = true;
- MovingLeft = true;
- Cornered = false;
- }
- else if(!Screen->isSolid(ghost->X-1,ghost->Y+8)
- && Screen->isSolid(ghost->X+17,ghost->Y+8)){
- Ghost_Data = combo+2;
- Ghost_SetSize(this,ghost,2,1);
- Ghost_ForceDir(DIR_LEFT);
- Ghost_X-=16;
- MovingDown = false;
- MovingLeft = true;
- Cornered = false;
- }
- else if(!Screen->isSolid(ghost->X-1,ghost->Y+8)
- && !Screen->isSolid(ghost->X+17,ghost->Y+8)){
- Direction = Choose(DIR_LEFT,DIR_RIGHT);
- Ghost_SetSize(this,ghost,2,1);
- if(Direction==DIR_LEFT){
- Ghost_Data = combo+2;
- Ghost_ForceDir(DIR_LEFT);
- Ghost_X-=16;
- MovingDown = false;
- MovingLeft = true;
- }
- else{
- Ghost_Data = combo+3;
- Ghost_ForceDir(DIR_RIGHT);
- MovingDown = true;
- MovingLeft = true;
- }
- Cornered = false;
- }
- else{
- Ghost_Data = combo+1;
- Ghost_ForceDir(DIR_DOWN);
- MovingDown = true;
- MovingLeft = false;
- Cornered = false;
- }
- }
- else if(Direction == DIR_LEFT){
- if(Screen->isSolid(ghost->X+8,ghost->Y+17)
- && !Screen->isSolid(ghost->X+8,ghost->Y-1)){
- Ghost_Data = combo;
- Ghost_SetSize(this,ghost,1,2);
- Ghost_ForceDir(DIR_UP);
- Ghost_Y-=16;
- MovingDown = false;
- MovingLeft = false;
- Cornered = false;
- }
- else if(!Screen->isSolid(ghost->X+8,ghost->Y+17)
- && Screen->isSolid(ghost->X+8,ghost->Y-1)){
- Ghost_Data = combo+1;
- Ghost_SetSize(this,ghost,1,2);
- Ghost_ForceDir(DIR_DOWN);
- MovingDown = true;
- MovingLeft = false;
- Cornered = false;
- }
- else if(!Screen->isSolid(ghost->X+8,ghost->Y+17)
- && !Screen->isSolid(ghost->X+8,ghost->Y-1)){
- Direction = Choose(DIR_UP,DIR_DOWN);
- Ghost_SetSize(this,ghost,1,2);
- if(Direction==DIR_UP){
- Ghost_Data = combo;
- Ghost_ForceDir(DIR_UP);
- Ghost_Y-=16;
- MovingDown = false;
- MovingLeft = false;
- }
- else{
- Ghost_Data = combo+1;
- Ghost_ForceDir(DIR_DOWN);
- MovingDown = true;
- MovingLeft = false;
- }
- Cornered = false;
- }
- else{
- Ghost_Data = combo+3;
- MovingDown = true;
- MovingLeft = true;
- Cornered = false;
- }
- }
- else if(Direction == DIR_RIGHT){
- if(Screen->isSolid(ghost->X+24,ghost->Y+17)
- && !Screen->isSolid(ghost->X+24,ghost->Y-1)){
- Ghost_Data = combo;
- Ghost_SetSize(this,ghost,1,2);
- Ghost_X+=16;
- Ghost_Y-=16;
- Ghost_ForceDir(DIR_UP);
- MovingDown = false;
- MovingLeft = false;
- Cornered = false;
- }
- else if(!Screen->isSolid(ghost->X+24,ghost->Y+17)
- && Screen->isSolid(ghost->X+24,ghost->Y-1)){
- Ghost_Data = combo+1;
- Ghost_SetSize(this,ghost,1,2);
- Ghost_ForceDir(DIR_DOWN);
- Ghost_X+=16;
- MovingDown = true;
- MovingLeft = false;
- Cornered = false;
- }
- else if(!Screen->isSolid(ghost->X+24,ghost->Y+17)
- && !Screen->isSolid(ghost->X+24,ghost->Y-1)){
- Direction = Choose(DIR_UP,DIR_DOWN);
- Ghost_SetSize(this,ghost,1,2);
- Ghost_X+=16;
- if(Direction==DIR_UP){
- Ghost_Data = combo;
- Ghost_ForceDir(DIR_UP);
- Ghost_Y-=16;
- MovingDown = false;
- MovingLeft = false;
- }
- else{
- Ghost_Data = combo+1;
- Ghost_ForceDir(DIR_DOWN);
- MovingDown = true;
- MovingLeft = false;
- }
- Cornered = false;
- }
- else{
- Ghost_Data = combo+2;
- MovingDown = false;
- MovingLeft = true;
- Cornered = false;
- }
- }
- }
- if(attackCooldown>0)
- attackCooldown--;
- else if(attackCooldown<=0)
- attackCond = true;
- if(attackCond){
- for(int i=0; i<24; i++){
- angle = DirAngle(Ghost_Dir);
- if(Ghost_Dir==DIR_UP)
- fireball = FireEWeapon(EW_SCRIPT1,Ghost_X, Ghost_Y,
- DegtoRad(angle+Rand(-25,25)), 250, ghost->WeaponDamage, SPR, SFX,EWF_ROTATE_360);
- else if(Ghost_Dir==DIR_DOWN)
- fireball = FireEWeapon(EW_SCRIPT1,Ghost_X, Ghost_Y+32,
- DegtoRad(angle+Rand(-25,25)), 250, ghost->WeaponDamage, SPR, SFX,EWF_ROTATE_360);
- else if(Ghost_Dir==DIR_LEFT)
- fireball = FireEWeapon(EW_SCRIPT1,Ghost_X, Ghost_Y,
- DegtoRad(angle+Rand(-25,25)), 250, ghost->WeaponDamage, SPR, SFX,EWF_ROTATE_360);
- else if(Ghost_Dir==DIR_RIGHT)
- fireball = FireEWeapon(EW_SCRIPT1,Ghost_X+32, Ghost_Y,
- DegtoRad(angle+Rand(-25,25)), 250, ghost->WeaponDamage, SPR, SFX,EWF_ROTATE_360);
- Gen_Explode_Waitframes(this,ghost,4);
- }
- attackCond = false;
- attackCooldown = Rand(100,200);
- }
- if(Ghost_HP<=(MaxHP/2))
- Speed = Step*2;
- Gen_Explode_Waitframe(this,ghost);
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement