// --------- Armos (LTTP) --------- const int ARMOS_JUMP_HEIGHT = 1.5; // npc->Attribute[] indices const int ARMOS_ATTR_START_SOUND = 0; const int ARMOS_ATTR_JUMP_SOUND = 1; ffc script Armos_LttP { void run(int enemyID) { npc ghost; float step; int jumpSound; // Initialize - come to life and set the combo ghost=Ghost_InitAutoGhost(this, enemyID); Ghost_SetFlag(GHF_NORMAL); Ghost_SetFlag(GHF_KNOCKBACK_4WAY); Ghost_SetFlag(GHF_FAKE_Z); Game->PlaySound(ghost->Attributes[ARMOS_ATTR_START_SOUND]); SpawnAnimation(this, ghost); step=ghost->Step/100; jumpSound=ghost->Attributes[ARMOS_ATTR_JUMP_SOUND]; // Just jump toward Link forever while(true) { if(Ghost_Z==0 && Ghost_Jump<=0) { Ghost_Jump=ARMOS_JUMP_HEIGHT; Game->PlaySound(jumpSound); } Ghost_MoveTowardLink(step, 3); Ghost_Waitframe(this, ghost, true, true); } } // A modified version of Ghost_SpawnAnimationFlicker(). This removes the // Armos combo near the end of the animation. void SpawnAnimation(ffc this, npc ghost) { int combo=this->Data; bool collDet=ghost->CollDetection; int xOffset=ghost->DrawXOffset; item ArmosItem; Ghost_SetPosition(this, ghost); ghost->CollDetection=false; // Alternate drawing offscreen and in place for 64 frames for(int i=0; i<32; i++) { this->Data=0; ghost->DrawXOffset=32768; Ghost_SetPosition(this, ghost); Ghost_WaitframeLight(this, ghost); this->Data=combo; ghost->DrawXOffset=xOffset; Ghost_SetPosition(this, ghost); Ghost_WaitframeLight(this, ghost); // The combo has to be removed shortly before the animation // finishes; otherwise, it's possible to spawn two of them. if(i==29) { Screen->ComboD[ComboAt(this->X, this->Y)]=Screen->UnderCombo; Screen->ComboC[ComboAt(this->X, this->Y)]=Screen->UnderCSet; if(Screen->ComboF[ComboAt(this->X, this->Y)]==CF_ARMOSITEM&&Screen->RoomType==RT_SPECIALITEM&&Screen->State[ST_SPECIALITEM]==false) { ArmosItem=Screen->CreateItem(Screen->RoomData); ArmosItem->X=this->X; ArmosItem->Y=this->Y; ArmosItem->DrawStyle=DS_NORMAL; ArmosItem->Pickup=(IP_HOLDUP|IP_ST_SPECIALITEM); } } } this->Data=combo; ghost->CollDetection=collDet; ghost->DrawXOffset=xOffset; } }//!End ffc script Armos_LttPThis works well. Just set the flag, room type and catch all as normal, and the item will spawn where the Armos was. Also, once the item is picked up it will not spawn again.
Armos (LttP)
Overview
Creator:
Saffith
Added: 29 Apr 2014
Tags:
Enemy,
FFC
Downloads: 75
|
View Script
Download Example (1.62 MB) |
Information
This is a recreation of LttP's Armos. When activated, it simply jumps directly toward Link. It is designed to be spawned by Armos combos.
Description Setup Reviews Comments
This is a recreation of LttP's Armos. When activated, it simply jumps directly toward Link. It is designed to be spawned by Armos combos.