// --------- 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
Set up an enemy as follows:
Type: Other
Animation: 2-Frame, 3-Frame, 4-Frame, Flip, or (None)
Spawn animation: Instant
Step speed is used
Attribute 1: Sound played when coming to life
Attribute 2: Sound played when jumping
Attribute 11: GH_INVISIBLE_COMBO or GH_INVISIBLE_ALT (normally -1)
Attribute 12: Script slot
The enemy should also have the "Spawned By 'Armos' Combo Type" flag checked.
Resources
Requires ghost.zh, std.zh, and string.zh.
Sounds can be found here. In LttP, the sound LTTP_Link_Push is used when an Armos activates.
Type: Other
Animation: 2-Frame, 3-Frame, 4-Frame, Flip, or (None)
Spawn animation: Instant
Step speed is used
Attribute 1: Sound played when coming to life
Attribute 2: Sound played when jumping
Attribute 11: GH_INVISIBLE_COMBO or GH_INVISIBLE_ALT (normally -1)
Attribute 12: Script slot
The enemy should also have the "Spawned By 'Armos' Combo Type" flag checked.
Resources
Requires ghost.zh, std.zh, and string.zh.
Sounds can be found here. In LttP, the sound LTTP_Link_Push is used when an Armos activates.