Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- const int CMB_WAXHEADFLAME = 29047;
- ffc script Waxface{
- void run(int enemyID){
- npc ghost = Ghost_InitAutoGhost(this,enemyID);
- this->Flags[FFCF_ETHEREAL] = true;
- Ghost_Transform(this,ghost,-1,-1,3,3);
- Ghost_SetHitOffsets(ghost,3,2,5,5);
- int WaxfaceArray[4];
- //WaxfaceArray[0] = 0; InvulnModifier, the combo offset for when the boss is invuln. Set to 5 for the damaged combo offsets
- //WaxfaceArray[1] = 240; Fusetime, set to 240 if it touches fire if regrow time == 0
- //WaxfaceArray[2] = 180; VulnerableTime
- //WaxfaceArray[3] = 360; Regrow Time, set to 360 when the fusetime reaches 1
- int MaxHP = ghost->HP;
- int Defences[18];
- Ghost_StoreDefenses(ghost, Defences);
- Ghost_SetAllDefenses(ghost, NPCDT_BLOCK);
- int BaseCombo = ghost->Attributes[10];
- int ShootingCombo = ghost->Attributes[10]+1;
- int ChargeCombo = ghost->Attributes[10]+2;
- int LitCombo = ghost->Attributes[10]+3;
- int VulnerableCombo = ghost->Attributes[10]+4;
- int Movecounter = -1; int i; eweapon e;
- int Attackcounter=Rand(60,120);
- int Divisor;
- Ghost_X = 104; Ghost_Y = 56;
- Waxface_Waitframe(this, ghost, WaxfaceArray, Defences, MaxHP, 2);
- if(Screen->D[5]==0){
- Screen->D[5]=1;
- Game->PlayMIDI(5);
- Screen->Message(6);
- Waxface_Waitframe(this, ghost, WaxfaceArray, Defences, MaxHP, 2);
- Game->PlayMIDI(6);
- Screen->Message(7);
- Waxface_Waitframe(this, ghost, WaxfaceArray, Defences, MaxHP, 2);
- }
- else Game->PlayMIDI(6);
- Waxface_Waitframe(this, ghost, WaxfaceArray, Defences, MaxHP, 40);
- while(true){
- Movecounter=-1;
- Ghost_Data=BaseCombo+WaxfaceArray[0];
- while(WaxfaceArray[1]==0){
- Movecounter = Ghost_ConstantWalk8(Movecounter, ghost->Step, ghost->Rate, ghost->Homing, 0);
- Attackcounter--;
- if(Attackcounter<=0){
- int Attackchoice=0;
- if(Ghost_HP<MaxHP/2)Attackchoice=Rand(0,1);
- if(Attackchoice==0){ //Shoot fireballs
- Ghost_Data=ShootingCombo+WaxfaceArray[0];
- Divisor = 25;
- if(Ghost_HP<MaxHP/2)Divisor=15;
- for(i=0; i<=100 && WaxfaceArray[1]==0; i++){
- if(i>=30 && i%Divisor==0){
- e=FireAimedEWeapon(EW_FIREBALL, Ghost_X+16, Ghost_Y+24, DegtoRad(Rand(-5,5)), 300, ghost->WeaponDamage, 94, -1, EWF_UNBLOCKABLE);
- if(G[G_DIFFICULTY]==DIF_HARD){ //Track on hard
- SetEWeaponMovement(e, EWM_HOMING, DegtoRad(1), -1);
- }
- }
- Waxface_Waitframe(this, ghost, WaxfaceArray, Defences, MaxHP, 1);
- }
- if(WaxfaceArray[1]!=0)break;
- Ghost_Data=BaseCombo+WaxfaceArray[0];
- }
- else if(Attackchoice==1){ //Slam
- Ghost_Data=ChargeCombo+WaxfaceArray[0];
- int TAngle = Angle(CenterX(ghost), CenterY(ghost), Link->X+8, Link->Y+8);
- for(i=0; i<40 && WaxfaceArray[1]==0; i++){
- if(G[G_DIFFICULTY]==DIF_HARD && i==35){
- TAngle = Angle(CenterX(ghost), CenterY(ghost), Link->X+8, Link->Y+8);
- }
- Waxface_Waitframe(this, ghost, WaxfaceArray, Defences, MaxHP, 1);
- }
- Game->PlaySound(24);
- for(i=0; i<24 && WaxfaceArray[1]==0; i++){
- Ghost_MoveAtAngle(TAngle, 3, 3);
- Waxface_Waitframe(this, ghost, WaxfaceArray, Defences, MaxHP, 1);
- }
- if(WaxfaceArray[1]!=0)break;
- Ghost_Data=BaseCombo+WaxfaceArray[0];
- }
- Attackcounter=Rand(60,120);
- }
- if(WaxfaceArray[0]>0 && WaxfaceArray[3]==0){
- WaxfaceArray[0]=0;
- Game->PlaySound(21);
- Ghost_Data=BaseCombo+WaxfaceArray[0];
- }
- Waxface_Waitframe(this, ghost, WaxfaceArray, Defences, MaxHP, 1);
- }
- if(WaxfaceArray[1]>0){ //Shit's on fire yo
- int angle = DiagonalAngleRounding(Angle(Link->X+8, Link->Y+8, CenterX(ghost), CenterY(ghost)));
- if(Ghost_HP<=MaxHP/2)Divisor=22;
- else Divisor = 28;
- float step = ghost->Step/Divisor;
- float xStep=step*Cos(angle);
- float yStep=step*Sin(angle);
- Ghost_StartFlashing(WaxfaceArray[1]);
- Ghost_Data=LitCombo+WaxfaceArray[0];
- while(WaxfaceArray[1]>0){ //Bonk around
- if(xStep<0){
- if(!Ghost_CanMove(DIR_LEFT, -xStep, 3)){
- xStep*=-1;
- Screen->Quake=60;
- if(G[G_DIFFICULTY]==DIF_HARD){
- if(Rand(2)==1){
- e = FireEWeapon(EW_ROCK, Link->X, Link->Y, DegtoRad(Rand(360)), 30, ghost->WeaponDamage, 93, 3, EWF_UNBLOCKABLE|EWF_SHADOW);
- SetEWeaponMovement(e, EWM_FALL, 150, EWMF_DIE);
- SetEWeaponDeathEffect(e, EWD_VANISH, 0);
- }
- else{
- e = FireEWeapon(EW_ROCK, Rand(32,208), Rand(32, 128), DegtoRad(Rand(360)), 0, ghost->WeaponDamage, 93, 3, EWF_UNBLOCKABLE|EWF_SHADOW);
- SetEWeaponMovement(e, EWM_FALL, 150, EWMF_DIE);
- SetEWeaponDeathEffect(e, EWD_VANISH, 0);
- }
- }
- else{
- if(Ghost_HP<MaxHP/2 && Rand(4)==1){
- e = FireEWeapon(EW_ROCK, Link->X, Link->Y, DegtoRad(Rand(360)), 30, ghost->WeaponDamage, 93, 3, EWF_UNBLOCKABLE|EWF_SHADOW);
- SetEWeaponMovement(e, EWM_FALL, 150, EWMF_DIE);
- SetEWeaponDeathEffect(e, EWD_VANISH, 0);
- }
- else{
- e = FireEWeapon(EW_ROCK, Rand(32,208), Rand(32, 128), DegtoRad(Rand(360)), 0, ghost->WeaponDamage, 93, 3, EWF_UNBLOCKABLE|EWF_SHADOW);
- SetEWeaponMovement(e, EWM_FALL, 150, EWMF_DIE);
- SetEWeaponDeathEffect(e, EWD_VANISH, 0);
- }
- }
- }
- }
- else{
- if(!Ghost_CanMove(DIR_RIGHT, xStep, 3)){
- xStep*=-1;
- Screen->Quake=60;
- if(G[G_DIFFICULTY]==DIF_HARD){
- if(Rand(2)==1){ //I'm sure there's a better way to do these rock drops but it's 3AM and I'm lazy
- e = FireEWeapon(EW_ROCK, Link->X, Link->Y, DegtoRad(Rand(360)), 30, ghost->WeaponDamage, 93, 3, EWF_UNBLOCKABLE|EWF_SHADOW);
- SetEWeaponMovement(e, EWM_FALL, 150, EWMF_DIE);
- SetEWeaponDeathEffect(e, EWD_VANISH, 0);
- }
- else{
- e = FireEWeapon(EW_ROCK, Rand(32,208), Rand(32, 128), DegtoRad(Rand(360)), 0, ghost->WeaponDamage, 93, 3, EWF_UNBLOCKABLE|EWF_SHADOW);
- SetEWeaponMovement(e, EWM_FALL, 150, EWMF_DIE);
- SetEWeaponDeathEffect(e, EWD_VANISH, 0);
- }
- }
- else{
- if(Ghost_HP<MaxHP/2 && Rand(4)==1){
- e = FireEWeapon(EW_ROCK, Link->X, Link->Y, DegtoRad(Rand(360)), 30, ghost->WeaponDamage, 93, 3, EWF_UNBLOCKABLE|EWF_SHADOW);
- SetEWeaponMovement(e, EWM_FALL, 150, EWMF_DIE);
- SetEWeaponDeathEffect(e, EWD_VANISH, 0);
- }
- else{
- e = FireEWeapon(EW_ROCK, Rand(32,208), Rand(32, 128), DegtoRad(Rand(360)), 0, ghost->WeaponDamage, 93, 3, EWF_UNBLOCKABLE|EWF_SHADOW);
- SetEWeaponMovement(e, EWM_FALL, 150, EWMF_DIE);
- SetEWeaponDeathEffect(e, EWD_VANISH, 0);
- }
- }
- }
- }
- if(yStep<0){
- if(!Ghost_CanMove(DIR_UP, -yStep, 3)){
- yStep*=-1;
- Screen->Quake=60;
- if(G[G_DIFFICULTY]==DIF_HARD){
- if(Rand(2)==1){
- e = FireEWeapon(EW_ROCK, Link->X, Link->Y, DegtoRad(Rand(360)), 30, ghost->WeaponDamage, 93, 3, EWF_UNBLOCKABLE|EWF_SHADOW);
- SetEWeaponMovement(e, EWM_FALL, 150, EWMF_DIE);
- SetEWeaponDeathEffect(e, EWD_VANISH, 0);
- }
- else{
- e = FireEWeapon(EW_ROCK, Rand(32,208), Rand(32, 128), DegtoRad(Rand(360)), 0, ghost->WeaponDamage, 93, 3, EWF_UNBLOCKABLE|EWF_SHADOW);
- SetEWeaponMovement(e, EWM_FALL, 150, EWMF_DIE);
- SetEWeaponDeathEffect(e, EWD_VANISH, 0);
- }
- }
- else{
- if(Ghost_HP<MaxHP/2 && Rand(4)==1){
- e = FireEWeapon(EW_ROCK, Link->X, Link->Y, DegtoRad(Rand(360)), 30, ghost->WeaponDamage, 93, 3, EWF_UNBLOCKABLE|EWF_SHADOW);
- SetEWeaponMovement(e, EWM_FALL, 150, EWMF_DIE);
- SetEWeaponDeathEffect(e, EWD_VANISH, 0);
- }
- else{
- e = FireEWeapon(EW_ROCK, Rand(32,208), Rand(32, 128), DegtoRad(Rand(360)), 0, ghost->WeaponDamage, 93, 3, EWF_UNBLOCKABLE|EWF_SHADOW);
- SetEWeaponMovement(e, EWM_FALL, 150, EWMF_DIE);
- SetEWeaponDeathEffect(e, EWD_VANISH, 0);
- }
- }
- }
- }
- else{
- if(!Ghost_CanMove(DIR_DOWN, yStep, 3)){
- yStep*=-1;
- Screen->Quake=60;
- if(G[G_DIFFICULTY]==DIF_HARD){
- if(Rand(2)==1){
- e = FireEWeapon(EW_ROCK, Link->X, Link->Y, DegtoRad(Rand(360)), 30, ghost->WeaponDamage, 93, 3, EWF_UNBLOCKABLE|EWF_SHADOW);
- SetEWeaponMovement(e, EWM_FALL, 150, EWMF_DIE);
- SetEWeaponDeathEffect(e, EWD_VANISH, 0);
- }
- else{
- e = FireEWeapon(EW_ROCK, Rand(32,208), Rand(32, 128), DegtoRad(Rand(360)), 0, ghost->WeaponDamage, 93, 3, EWF_UNBLOCKABLE|EWF_SHADOW);
- SetEWeaponMovement(e, EWM_FALL, 150, EWMF_DIE);
- SetEWeaponDeathEffect(e, EWD_VANISH, 0);
- }
- }
- else{
- if(Ghost_HP<MaxHP/2 && Rand(4)==1){ //Remember kids, copypasta makes your code hideous
- e = FireEWeapon(EW_ROCK, Link->X, Link->Y, DegtoRad(Rand(360)), 30, ghost->WeaponDamage, 93, 3, EWF_UNBLOCKABLE|EWF_SHADOW);
- SetEWeaponMovement(e, EWM_FALL, 150, EWMF_DIE);
- SetEWeaponDeathEffect(e, EWD_VANISH, 0);
- }
- else{
- e = FireEWeapon(EW_ROCK, Rand(32,208), Rand(32, 128), DegtoRad(Rand(360)), 0, ghost->WeaponDamage, 93, 3, EWF_UNBLOCKABLE|EWF_SHADOW);
- SetEWeaponMovement(e, EWM_FALL, 150, EWMF_DIE);
- SetEWeaponDeathEffect(e, EWD_VANISH, 0);
- }
- }
- }
- }
- if(Ghost_HP<=MaxHP/2){
- if(WaxfaceArray[1]%4==0)FireEWeapon(EW_FIRE, CenterX(ghost)-8, CenterY(ghost)-8, DegtoRad(Rand(360)), 0, ghost->WeaponDamage, 92, -1, EWF_UNBLOCKABLE);
- }
- Ghost_MoveXY(xStep, yStep, 3);
- if(Link->HP>0)Screen->FastCombo(4, Ghost_X+16, Ghost_Y-13, CMB_WAXHEADFLAME, 8, OP_OPAQUE);
- Waxface_Waitframe(this, ghost, WaxfaceArray, Defences, MaxHP, 1);
- }
- __Ghost_FixCoords(); //I wonder if Saffith ever thought this would be used outside of Ghost's own internal functions?
- for(i=0; i<12; i++){
- e = FireEWeapon(EW_FIRE, CenterX(ghost)-8, CenterY(ghost)-8, DegtoRad(Rand(360)), Rand(40,120), ghost->WeaponDamage, 92, -1, EWF_UNBLOCKABLE|EWF_SHADOW);
- SetEWeaponMovement(e, EWM_THROW, Rand(1,4), EWMF_DIE);
- SetEWeaponDeathEffect(e, EWD_VANISH, -1);
- }
- Ghost_Data=VulnerableCombo+WaxfaceArray[0];
- Waxface_Waitframe(this, ghost, WaxfaceArray, Defences, MaxHP, WaxfaceArray[2]);
- Ghost_Data=BaseCombo+WaxfaceArray[0];
- Waxface_Waitframe(this, ghost, WaxfaceArray, Defences, MaxHP, 30);
- }
- Waxface_Waitframe(this, ghost, WaxfaceArray, Defences, MaxHP, 1);
- }
- }
- void Waxface_Waitframe(ffc this, npc ghost, int WaxfaceArray, int Defences, int MaxHP, int framecount){
- for(int frames=0; frames<framecount; frames++){
- int Modifier=MaxHP-Ghost_HP; //As he gets weaker, he becomes less vulnerable to attacks
- if(WaxfaceArray[0]==0){//If he's using his vulnerable combos
- if(WaxheadFireCheck(this, ghost)){
- WaxfaceArray[0]=5;
- WaxfaceArray[1]=200+Modifier*3;
- Game->PlaySound(11);
- Ghost_CSet=8;
- }
- }
- else if(WaxfaceArray[1]>0){ //Burning time
- WaxfaceArray[1]--;
- if(WaxfaceArray[1]==0){
- WaxfaceArray[2]=360-Modifier;
- Ghost_SetDefenses(ghost,Defences);
- ghost->Defense[NPCD_FIRE]=NPCDT_IGNORE;
- Game->PlaySound(61);
- }
- }
- else if(WaxfaceArray[2]>0){ //Hurt time
- WaxfaceArray[2]--;
- if(Ghost_GotHit())WaxfaceArray[2]-=20;
- if(WaxfaceArray[2]<=0){
- Ghost_SetAllDefenses(ghost, NPCDT_BLOCK);
- ghost->Defense[NPCD_FIRE]=NPCDT_IGNORE;
- WaxfaceArray[2]=0;
- WaxfaceArray[3]=480+Modifier*2;
- Ghost_CSet=7;
- }
- }
- else if(WaxfaceArray[3]>0){ //Regrow wick time
- WaxfaceArray[3]--;
- }
- Boss_Waitframes(this, ghost, 1);
- }
- }
- bool WaxheadFireCheck(ffc this, npc ghost){ //Waxhead is too tall to light from ground-based fire eweapons aimed at Link, so he only checks against lweapons
- for(int i=Screen->NumLWeapons(); i>0 ;i--){
- lweapon l = Screen->LoadLWeapon(i);
- if(l->ID==LW_FIRE || l->ID==LW_FIRESPARKLE){
- if(Distance(CenterX(l), CenterY(l), CenterX(ghost), CenterY(ghost)-24)<=13 && Ghost_Z<8)return true;
- }
- }
- return false;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement