Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- const int MAX_ICE_TIME = 600;//Time ice platform exists
- const int ICEBLOCK_CSET = 2;//Cset for ice block.
- ffc script IceRodFFC{
- void run(int Weapon_ID){
- this->Data = GH_INVISIBLE_COMBO;
- npc current_enemy;
- bool Stop = false;
- bool impact = false;//Tests whether an enemy or freezable combo has been hit.
- //Two variables used to save location of ffc upon impact.
- int impactX;
- int impactY;
- //Increase size of platform for larger enemies.
- int BlockWidth=1;
- int BlockHeight=1;
- int Ice_Timer;//Used internally by ffc to track how long ice combo has existed.
- int i;
- int j;
- lweapon beam = FindMiscLWeapon(Weapon_ID);//Find previously saved lweapon.
- //Position ffc.
- if(beam->isValid()){
- this->X = beam->X;
- this->Y = beam->Y;
- }
- else{
- this->Data = 0;
- Quit();
- }
- while(!Stop){
- while(!impact && this->X>0 && this->Y>0 && this->X<256 && this->Y<170){
- //Adjust the position of the ffc every frame, based on the direction Link was facing when he fired it.
- if(beam->isValid()){
- this->X = beam->X;
- this->Y = beam->Y;
- }
- else{
- this->Data = 0;
- Quit();
- }
- //Update current number of enemies.
- for(i=Screen->NumNPCs();i>0;i--){
- current_enemy = Screen->LoadNPC(i);
- if(current_enemy->HP<=0)break;
- if (Collision(beam,current_enemy)){
- if(current_enemy->Defense[NPCD_SCRIPT]!=NPCDT_IGNORE
- && (current_enemy->Misc[GEN_MISC_FLAGS]&NPC_F_FREEZE)==0){
- impactX = current_enemy->X;
- impactY = current_enemy->Y;
- if(current_enemy->TileWidth>1)BlockWidth = current_enemy->TileWidth;
- if(current_enemy->TileHeight>1)BlockHeight = current_enemy->TileHeight;
- //Stun the enemy.
- current_enemy->Stun = MAX_ICE_TIME;
- current_enemy->Misc[GEN_MISC_FLAGS]|=NPC_F_FREEZE;
- impact = true;
- this->Flags[FFCF_OVERLAY]= true;
- this->Flags[FFCF_TRANS] = true;
- if(beam->isValid())
- KillLWeapon(beam);
- }
- else{
- if(beam->isValid())
- KillLWeapon(beam);
- }
- }
- }
- Waitframe();
- }
- //You've hit an enemy.
- if(impact){
- //Position the ffc.
- this->X = impactX;
- this->Y = impactY;
- //Set up timer.
- Ice_Timer = MAX_ICE_TIME;
- }
- while(Ice_Timer>0){
- Ice_Timer--;
- if(BlockWidth>1){
- for(i=impactX;i<(impactX+BlockWidth*16);i+=16)
- Screen->FastCombo(3,i,impactY,ICE_BLOCK_COMBO,ICEBLOCK_CSET,64);
- }
- else
- Screen->FastCombo(3,impactX,impactY,ICE_BLOCK_COMBO,ICEBLOCK_CSET,64);
- if(BlockHeight >1){
- for(j= impactY;j<=impactY+(BlockHeight*16);j+=16){
- for(i=impactX;i<(impactX+BlockWidth*16);i+=16)
- Screen->FastCombo(3,i,j,ICE_BLOCK_COMBO,ICEBLOCK_CSET,64);
- }
- }
- else
- Screen->FastCombo(3,impactX,impactY,ICE_BLOCK_COMBO,ICEBLOCK_CSET,64);
- if(Ice_Timer<5){
- if(current_enemy->isValid())
- current_enemy->Misc[GEN_MISC_FLAGS]&=~NPC_F_FREEZE;
- Stop = true;
- break;
- }
- Waitframe();
- }
- Waitframe();
- }
- this->Data = 0;
- Quit();
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement