Jump to content

Photo

Pixelmentus


  • Please log in to reply
5 replies to this topic

#1 Sans

Sans

    Hey kid wanna buy hot dogs ?

  • Members
  • Location:Judgement Hall

Posted 31 January 2018 - 04:51 PM

Hello everyone i would ask a question about a boss. You see i put normal aquamentus and when they died the Pixelmentus appears but when i defeat him no secrets triggers is trigged instead of that, secrets triggers and items is trigged when normal aquamentus defeated and the Pixelmentus was not considered as enemy. And i would like to use mp3 format instead of midi so there's a way to fix or update that problem ? here's the script file.

 

const int NPC_PIXELMENTUS = 190; //The enemy ID of the Pixelmentus
const int SFX_PIXELMENTUS_ROAR = 100; //The sound when the pixelmentus roars
const int SPR_PIXELMENTUS_FIREBALL = 88; //The sprite for the 2x2 fireball
const int SFX_PIXELMENTUS_LASER = 32; //The sound that plays when the Pixelmentus shoots its laser
const int STR_PIXELMENTUS_DEATH = 0; //The string that plays when the Pixelmentus dies

//Misc Attributes:
//Attribute 11: The first of the combos used for the enemy:
//The enemy uses two combos using 9x12 tile blocks. The first tile is for the enemy walking and the second for it opening its mouth to attack.
//Attribute 12: The slot this script is loaded into

ffc script Pixelmentus{
	void Pixelmentus_Waitframe(ffc this, npc ghost, int PixelmentusData){
		if(Link->HP>0){
			Screen->DrawCombo(2, Ghost_X, Ghost_Y, PixelmentusData, 9, 12, this->CSet, -1, -1, 0, 0, 0, -1, 0, true, 128);
		}
		if(!Ghost_Waitframe(this, ghost, true, false)){
			Pixelmentus_Explode(this, ghost, PixelmentusData);
			Quit();
		}
	}
	void Pixelmentus_Explode(ffc this, npc ghost, int PixelmentusData){
		npc deathSFXNPC=Screen->CreateNPC(ghost->ID);
		deathSFXNPC->X=ghost->X; // For panning
		deathSFXNPC->Y=176;
		deathSFXNPC->ItemSet=0;
		deathSFXNPC->HP=0;
		deathSFXNPC->Misc[__GHI_NPC_DATA]=0x10000;
		
		this->CSet=Ghost_CSet;
		this->Flags[FFCF_OVERLAY]=false;
		this->Vx=0;
		this->Vy=0;
		this->Ax=0;
		this->Ay=0;
		ghost->HP=1;
		ghost->CollDetection=false;
		ghost->SFX=0;
		
		Game->PlayMIDI(0);
		while(Ghost_X>160){
			Ghost_X -= 4;
			if(Link->HP>0){
				Screen->DrawCombo(2, Ghost_X, Ghost_Y, PixelmentusData, 9, 12, this->CSet, -1, -1, 0, 0, 0, -1, 0, true, 128);
			}
			Ghost_WaitframeLight(this, ghost);
		}
		Ghost_X = 160;
		Screen->Message(STR_PIXELMENTUS_DEATH);
		if(Link->HP>0){
			Screen->DrawCombo(2, Ghost_X, Ghost_Y, PixelmentusData, 9, 12, this->CSet, -1, -1, 0, 0, 0, -1, 0, true, 128);
		}
		Ghost_WaitframeLight(this, ghost);
		for(int i=0; i<22&&Ghost_Y<176; i++){
			lweapon l = CreateLWeaponAt(LW_BOMBBLAST, Ghost_X+Rand(0, 80), Ghost_Y+Rand(0, 80));
			l->CollDetection = false;
			for(int j=0; j<8; j++){
				Ghost_Y++;
				if(Link->HP>0){
					Screen->DrawCombo(2, Ghost_X, Ghost_Y, PixelmentusData, 9, 12, this->CSet, -1, -1, 0, 0, 0, -1, 0, true, 128);
				}
				Ghost_WaitframeLight(this, ghost);
			}
		}
		
		if(ghost->isValid())
		{
			ghost->HP=-1000;
			ghost->DrawXOffset=1000;
		}
		this->Data=0;
		Ghost_Data=0;
		Ghost_ClearCombos();
	}
	void run(int enemyid){
		npc ghost = Ghost_InitAutoGhost(this, enemyid);
		Ghost_SetFlag(GHF_MOVE_OFFSCREEN);
		Ghost_SetFlag(GHF_IGNORE_ALL_TERRAIN);
		int Combo = ghost->Attributes[10];
		Ghost_Transform(this, ghost, GH_INVISIBLE_COMBO, ghost->CSet, 4, 4);
		Ghost_SetHitOffsets(ghost, 6, -10, 6, -10);
		Ghost_X = 160;
		Ghost_Y = 176;
		int PixelmentusData = Combo;
		while(Ghost_Y>48){
			Screen->Quake = 10;
			Ghost_Y -= 1.5;
			Pixelmentus_Waitframe(this, ghost, PixelmentusData);
		}
		PixelmentusData = Combo+1;
		Game->PlaySound(SFX_PIXELMENTUS_ROAR);
		for(int i=0; i<40; i++){
			Pixelmentus_Waitframe(this, ghost, PixelmentusData);
		}
		PixelmentusData = Combo;
		while(true){
			int TargetX = Rand(160, 240);
			int TargetY = Rand(16, 96);
			while(Distance(Ghost_X, Ghost_Y, TargetX, TargetY)>1){
				Ghost_MoveAtAngle(Angle(Ghost_X, Ghost_Y, TargetX, TargetY), 1, 0);
				Pixelmentus_Waitframe(this, ghost, PixelmentusData);
			}
			if(Ghost_X<216&&Rand(0, 2)==0){
				PixelmentusData = Combo+1;
				Game->PlaySound(SFX_PIXELMENTUS_ROAR);
				for(int i=0; i<20; i++){
					Pixelmentus_Waitframe(this, ghost, PixelmentusData);
				}
				for(int i=-1; i<2; i++){
					eweapon e = FireBigEWeapon(EW_FIREBALL, Ghost_X+16, Ghost_Y+40, DegtoRad(90), 100*i, ghost->WeaponDamage, SPR_PIXELMENTUS_FIREBALL, SFX_FIREBALL, EWF_UNBLOCKABLE, 2, 2);
					SetEWeaponMovement(e, EWM_VEER, DIR_LEFT, 0.05);
					e->HitXOffset = 6;
					e->HitYOffset = 6;
					e->HitWidth = 20;
					e->HitHeight = 20;
				}
				for(int i=0; i<40; i++){
					Pixelmentus_Waitframe(this, ghost, PixelmentusData);
				}
				PixelmentusData = Combo;
			}
			else{
				int Attack = Rand(0, 4);
				if(Attack==0){
					while(Ghost_X<256){
						Ghost_X += 2;
						Pixelmentus_Waitframe(this, ghost, PixelmentusData);
					}
					PixelmentusData = Combo+1;
					Game->PlaySound(SFX_PIXELMENTUS_ROAR);
					for(int i=0; i<20; i++){
						Pixelmentus_Waitframe(this, ghost, PixelmentusData);
					}
					for(int i=0; Ghost_X>160; i++){
						if(i%2==0){
							eweapon e = FireEWeapon(EW_FIRE, Ghost_X+24, Ghost_Y+48, DegtoRad(180+Rand(-10, 10)), 500, ghost->WeaponDamage, -1, -1, EWF_UNBLOCKABLE);
						}
						Ghost_X -= 4;
						Pixelmentus_Waitframe(this, ghost, PixelmentusData);
					}
					PixelmentusData = Combo;
				}
				else if(Attack==1){
					int LaserSX = Ghost_X;
					int LaserSY = Ghost_Y;
					int LaserEX = Ghost_X;
					int LaserEY = Ghost_Y;
					int LaserTX = Link->X+8;
					int LaserTY = Link->Y+8;
					Game->PlaySound(SFX_PIXELMENTUS_LASER);
					while(Distance(LaserEX, LaserEY, LaserTX, LaserTY)>6){
						int Angle = Angle(LaserEX, LaserEY, LaserTX, LaserTY);
						LaserEX += VectorX(6, Angle);
						LaserEY += VectorY(6, Angle);
						int Length = Distance(LaserEX, LaserEY, LaserSX, LaserSY);
						Screen->Rectangle(3, LaserSX, LaserSY-1, LaserSX+Length, LaserSY+1, Ghost_CSet*16+2, 1, LaserSX, LaserSY, Angle, true, 128);
						Screen->Rectangle(3, LaserSX, LaserSY, LaserSX+Length, LaserSY, Ghost_CSet*16+3, 1, LaserSX, LaserSY, Angle, true, 128);
						Pixelmentus_Waitframe(this, ghost, PixelmentusData);
					}
					LaserEX = LaserTX;
					LaserEY = LaserTY;
					while(Distance(LaserSX, LaserSY, LaserEX, LaserEY)>6){
						int Angle = Angle(LaserSX, LaserSY, LaserEX, LaserEY);
						LaserSX += VectorX(6, Angle);
						LaserSY += VectorY(6, Angle);
						int Length = Distance(LaserEX, LaserEY, LaserSX, LaserSY);
						Screen->Rectangle(3, LaserSX, LaserSY-1, LaserSX+Length, LaserSY+1, Ghost_CSet*16+2, 1, LaserSX, LaserSY, Angle, true, 128);
						Screen->Rectangle(3, LaserSX, LaserSY, LaserSX+Length, LaserSY, Ghost_CSet*16+3, 1, LaserSX, LaserSY, Angle, true, 128);
						Pixelmentus_Waitframe(this, ghost, PixelmentusData);
					}
					for(int i=0; i<16; i++){
						eweapon e = CreateEWeaponAt(EW_BOMBBLAST, LaserTX-8+Rand(-i*3, i*3), LaserTY-8+Rand(-i*3, i*3));
						e->Damage = ghost->WeaponDamage;
						for(int i=0; i<4; i++){
							Pixelmentus_Waitframe(this, ghost, PixelmentusData);
						}
					}
				}
			}
		}
	}
}

//This script is completely optional. I used it to make the boss appear after the first two enemies are killed and break part of the screen.

const int CMB_PIXELMENTUS_VOID = 1; //The combo the last 6 columns of the screen will be replaced with
const int SPR_PIXELMENTUS_BRICK = 89; //The sprite used for the flying bricks
const int SFX_PIXELMENTUS_BRICKBREAK = 61; //The sound that plays when the bricks appear
const int MIDI_PIXELMENTUS = 1; //The midi to switch to when the enemy appears

ffc script Pixelmentus_Appear{
	void Shakeframe(){
		Screen->Quake = 10;
		WaitNoAction();
	}
	void Shakeframe(int frames){
		for(int i=0; i<frames; i++){
			Shakeframe();
		}
	}
	void run(){
		Waitframes(5);
		while(Screen->NumNPCs()>0){
			Waitframe();
		}
		Waitframes(60);
		Game->PlaySound(SFX_PIXELMENTUS_ROAR);
		Link->Jump = 2;
		while((Link->Jump>0||Link->Z>0)&&CanWalk(Link->X, Link->Y, DIR_LEFT, 4, false)){
			Link->X -= 4;
			Shakeframe();
		}
		for(int i=0; i<6; i++){
			for(int j=0; j<11; j++){
				Screen->ComboD[15-i+16*j] = CMB_PIXELMENTUS_VOID;
				Game->PlaySound(SFX_PIXELMENTUS_BRICKBREAK);
				for(int k=0; k<4; k++){
					eweapon e = FireEWeapon(EW_SCRIPT10, ComboX(15-i+16*j), ComboY(15-i+16*j), DegtoRad(45+90*k), 100, 0, SPR_PIXELMENTUS_BRICK, 0, EWF_SHADOW);
					e->CollDetection = false;
					SetEWeaponMovement(e, EWM_THROW, 1.4, EWMF_DIE);
					SetEWeaponDeathEffect(e, EWD_VANISH, 0);
				}
				if(Rand(0, 2)==0)
					Shakeframe(2);
			}
			Shakeframe(20);
		}
		Game->PlayMIDI(MIDI_PIXELMENTUS);
		npc n = CreateNPCAt(NPC_PIXELMENTUS, 256, 176);
	}
}

  • Matthew likes this

#2 Anthus

Anthus

    Lord of Liquids

  • Members
  • Location:Ohio

Posted 31 January 2018 - 10:51 PM

Uhm.. What is a Pixelmentus?



#3 Sans

Sans

    Hey kid wanna buy hot dogs ?

  • Members
  • Location:Judgement Hall

Posted 31 January 2018 - 10:56 PM

well the big dragon boss that appears in the right of the screen destroy some floors. he shoots 3 giants fireballs, he throw a laser that make an large explosion and then he throw flames sometimes.

Edited by Sans, 31 January 2018 - 10:59 PM.


#4 Sans

Sans

    Hey kid wanna buy hot dogs ?

  • Members
  • Location:Judgement Hall

Posted 01 February 2018 - 12:06 AM

the problem is that even if he's alive items appears and shutters opened, and secrets are trigged likes if i defeat all enemys but the Pixelmemtus is an enemy so i don't know why he's not considered as an enemy. If i just put the boss in the screen without ffc he appears without destroy the half of the floor making him invisible and if i put the ffc the he'll appears correctly but shutters, secrets triggers, and making items appears will be actived without having to beat the boss so players can skip easly the boss without actually fight him. and this is the problem.

#5 Avaro

Avaro

    o_o

  • Members
  • Real Name:Robin
  • Location:Germany

Posted 02 February 2018 - 01:54 PM

Uhm.. What is a Pixelmentus?

 

Here you go https://www.purezc.n...showtopic=73288

 

I think it's best to ask Moosh directly, since he made this enemy.


Edited by Avataro, 02 February 2018 - 01:55 PM.

  • Anthus likes this

#6 Sans

Sans

    Hey kid wanna buy hot dogs ?

  • Members
  • Location:Judgement Hall

Posted 02 February 2018 - 01:56 PM

ok


  • Shane, Jenny and coolgamer012345 like this


1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users