Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import "std.zh"
- import "stdExtra.zh"
- import "ffcscript.zh"
- import "string.zh"
- import "ghost.zh"
- import "LW_ZH/lweapons.zh"
- import "ElegyShortCuts.z"
- int ElegyVars[65536];
- const int CURR_CHARACTER = 0;
- const int CHARACTER_OFFSET = 6;
- const int CURR_LEVEL = 6;
- const int KO_STATE = 12;
- const int MAX_HP = 18;
- const int MAX_MP = 24;
- const int CURRENT_HP = 30;
- const int CURRENT_MP = 36;
- const int IN_PARTY = 42;
- const int LEVEL_EXP = 48;
- const int CURR_STATUS = 54;
- const int MUTE_TIMER = 60;
- const int REGEN_TIMER = 66;
- const int ATK_UP_TIMER = 72;
- const int ATK_DN_TIMER = 78;
- const int DEF_UP_TIMER = 84;
- const int DEF_DN_TIMER = 90;
- const int STAT_P_ATK = 96;
- const int STAT_P_DEF = 102;
- const int STAT_M_ATK = 108;
- const int STAT_M_DEF = 114;
- const int POISON_TIMER = 120;
- const int STOP_TIMER = 126;
- const int HOVER_TIMER = 132;
- const int POISON_WORK = 138;
- const int REGEN_WORK = 144;
- global script Init{
- void run(){
- Start_HP_SetUp();
- ElegyVars[CURR_CHARACTER]= BRANDI;
- ElegyVars[IN_PARTY]= 1;
- for(int i = 0;i<=5;i++){
- ElegyVars[CURR_LEVEL+i]= 1;
- ElegyVars[KO_STATE+i]= 1;
- }
- }
- }
- //Values of array Character_State. For dead or alive.
- const int IS_DEAD = 0;
- const int IS_ALIVE = 1;
- //Indices of characters. Named after characters for easier tracking.
- const int BRANDI = 0;
- const int HENRI = 1;
- const int RHEA =2;
- const int KYLE = 3;
- const int FAYN = 4;
- const int GARY = 5;
- bool LevelUp = false;//Used to determine if character has leveled up. Not yet implemented.
- //Two variables to make HP and MP increases random.
- int HP_RANDOMIZER;
- int MP_RANDOMIZER;
- void Death(){
- int NumCharactersDead;
- if(Current_HP(Curr_Character())<=0)SetKO_State(Curr_Character(),IS_DEAD);
- for(int i=0;i<=5;i++)
- if(PartyMember(i) && KO(i))NumCharactersDead++;
- if(NumCharactersDead>=3){
- Link->CollDetection = false;//Turn off collision detction so we can't be hurt right now.
- Game->PlaySound(SFX_SPIRAL);//Play death sound.
- WaitNoAction(60);
- Link->HP=0;//Kill Link.
- Link->CollDetection = true;//Turn collision detection back on.
- Game->NumDeaths++;//Track how many times you've died.
- for(int i=0;i<=5;i++){
- if(PartyMember(i) && KO(i)){
- SetKO_State(ElegyVars[i],IS_ALIVE);
- ElegyVars[CURRENT_HP+i] = ElegyVars[MAX_HP+i];
- }
- }
- NumCharactersDead= 0;
- Game->ShowSaveQuitScreen();//End the game.
- Game->End();
- }
- }
- //Damp all inputs and prevent collision detection if character is dead.
- void KO(){
- CustomNoAction();
- Link->CollDetection = false;
- }
- //Kills all of Link's inputs
- void CustomNoAction(){
- Link->InputUp = false; Link->PressUp = false;
- Link->InputDown = false; Link->PressDown = false;
- Link->InputLeft = false; Link->PressLeft = false;
- Link->InputRight = false; Link->PressRight = false;
- Link->InputR = false; Link->PressR = false;
- Link->InputL = false; Link->PressL = false;
- Link->InputA = false; Link->PressA = false;
- Link->InputB = false; Link->PressB = false;
- Link->InputEx1 = false; Link->PressEx1 = false;
- Link->InputEx2 = false; Link->PressEx2 = false;
- Link->InputStart = false; Link->PressStart = false;
- }
- global script OnContinue{
- void run(){
- SetCurrentHP(Curr_Character(),Max_HP(Curr_Character()));
- SetKO_State(Curr_Character(),IS_ALIVE);
- }
- }
- global script OnExit{
- void run(){
- SetCurrentHP(Curr_Character(),Max_HP(Curr_Character()));
- SetKO_State(Curr_Character(),IS_ALIVE);
- }
- }
- void Counter_Set(){
- Game->Counter[CR_SCRIPT1] = Current_HP(Curr_Character());
- Game->Counter[CR_SCRIPT2] = Abs(Current_MP(Curr_Character()));
- Game->Counter[CR_SCRIPT3] = Max_HP(Curr_Character());
- Game->Counter[CR_SCRIPT4] = Max_MP(Curr_Character());
- }
- //Used to randomize HP and MP when game starts.
- void Start_HP_SetUp(){
- //Determine random factor.
- HP_RANDOMIZER= Rand(1,100);
- MP_RANDOMIZER= Rand(1,100);
- //Set Max HP and MP.
- ElegyVars[MAX_HP]= Rand(200,300)+(ElegyVars[CURR_LEVEL]*HP_RANDOMIZER);
- ElegyVars[MAX_HP+GARY]= Rand(300,500)+(ElegyVars[CURR_LEVEL+GARY]*HP_RANDOMIZER);
- ElegyVars[MAX_HP+RHEA]= Rand(250,350)+(ElegyVars[CURR_LEVEL+RHEA] *HP_RANDOMIZER);
- ElegyVars[MAX_HP+HENRI]= Rand(300,500)+(ElegyVars[CURR_LEVEL+HENRI] *HP_RANDOMIZER);
- ElegyVars[MAX_HP+KYLE]= Rand(300,500)+(ElegyVars[CURR_LEVEL+KYLE] *HP_RANDOMIZER);
- ElegyVars[MAX_HP+FAYN]= Rand(200,300)+(ElegyVars[CURR_LEVEL+FAYN] *HP_RANDOMIZER);
- ElegyVars[MAX_MP] = Rand(50,150)+(ElegyVars[CURR_LEVEL] * MP_RANDOMIZER);
- ElegyVars[MAX_MP+HENRI]= Rand(50,100)+(ElegyVars[CURR_LEVEL+HENRI] *MP_RANDOMIZER);
- ElegyVars[MAX_MP+FAYN]= Rand(50,150)+(ElegyVars[CURR_LEVEL+FAYN] *MP_RANDOMIZER);
- ElegyVars[MAX_MP+RHEA] = Rand(50,150)+(ElegyVars[CURR_LEVEL+RHEA] *MP_RANDOMIZER);
- ElegyVars[MAX_MP+KYLE]= Rand(50,100)+(ElegyVars[CURR_LEVEL+KYLE] *MP_RANDOMIZER);
- ElegyVars[MAX_MP+GARY]= Rand(50,100)+(ElegyVars[CURR_LEVEL+GARY] *MP_RANDOMIZER);
- //Set Current HP and MP to max.
- SetCurrentHP(BRANDI,ElegyVars[MAX_HP]);
- SetCurrentHP(GARY,ElegyVars[MAX_HP+GARY]);
- SetCurrentHP(RHEA,ElegyVars[MAX_HP+RHEA]);
- SetCurrentHP(HENRI,ElegyVars[MAX_HP+HENRI]);
- SetCurrentHP(FAYN,ElegyVars[MAX_HP+FAYN]);
- SetCurrentHP(KYLE,ElegyVars[MAX_HP+KYLE]);
- SetCurrentMP(BRANDI,ElegyVars[MAX_MP]);
- SetCurrentMP(KYLE,ElegyVars[MAX_MP+KYLE]);
- SetCurrentMP(FAYN,ElegyVars[MAX_MP+FAYN]);
- SetCurrentMP(HENRI,ElegyVars[MAX_MP+HENRI]);
- SetCurrentMP(GARY,ElegyVars[MAX_MP+GARY]);
- SetCurrentMP(RHEA,ElegyVars[MAX_MP+RHEA]);
- }
- //Handles Levelling up. Not yet implemented.
- void LevelUp(){
- if(Level_Exp(Curr_Character())>(Curr_Level(Curr_Character() * 100))){
- ElegyVars[CURR_LEVEL+Curr_Character()]++;
- SetMaxHP(Curr_Character(),HP_RANDOMIZER);
- SetMaxMP(Curr_Character(),MP_RANDOMIZER);
- SetLevelExp(Curr_Character(),(Curr_Level(Curr_Character()) * 100),false);
- IncreaseLevel(Curr_Character());
- }
- }
- global script Active{
- void run(){
- //Two variables to track Link's HP and MP.
- int LastHP = Link->HP;
- int LastMP = Link->MP;
- StartGhostZH();
- while(true){
- Death();
- UpdateGhostZH1();
- //Handles character appearance.
- if(!Link->Invisible){
- Character_Handler();
- Counter_Set();
- }
- LevelUp();
- //Handles character death.
- //Create numbers above enemies when they're damaged.
- EnemyDamage();
- UpdateLWZH1();
- Waitdraw();
- UpdateLWZH2();
- UpdateGhostZH2();
- //Track Link's HP and MP.
- //If it changes, affect current character's HP and MP.
- if(Link->HP!=LastHP||Link->MP!= LastMP)
- Character_HP_MP(LastHP,LastMP);
- StatusEffects();
- //Change these every frame so it is current.
- LastHP = Link->HP;
- LastMP = Link->MP;
- Waitframe();
- }
- }
- }
- //Not yet implemented.
- int PLOT_COUNTER = CR_SCRIPT5;//Counter to track progression in plot.
- int AFFECTION_COUNTER = CR_SCRIPT6;//Counter to track affection.
- //Change current character HP and MP as Link's HP and MP changes.
- void Character_HP_MP(int LastHP, int LastMP){
- //Two variables to track changes in HP and MP.
- int LostHP = LastHP-Link->HP;
- int LostMP = LastMP-Link->MP;
- //Determine which character is on screen.
- //Affect only them.
- if(Current_HP(Curr_Character())>0){
- if((Current_HP(Curr_Character())-LostHP)>1)
- ReSetCurrentHP(Curr_Character(),LostHP,false);
- else
- SetCurrentHP(Curr_Character(),0);
- if((Current_MP(Curr_Character())-LostMP)>1)
- ReSetCurrentMP(Curr_Character(),LostMP,false);
- else
- SetCurrentMP(Curr_Character(),0);
- }
- else{
- SetCurrentHP(Curr_Character(),0);
- SetKO_State(Curr_Character(),IS_DEAD);
- }
- Link->HP = LastHP;
- Link->MP = LastMP;
- }
- // Set this to the font colour you want. It is set to 1 (white) by default.
- const int DMG_FONTCOL=1;
- // Set this to three different unused slots for the npc->Misc[] values. If you don't have any other script using those, the default values are fine.
- const int DMG_MISC1=1;
- const int DMG_MISC2=2;
- const int DMG_MISC3=3;
- void EnemyDamage(){
- int offset;
- for(int i=1;i<=Screen->NumNPCs();i++){
- npc enem=Screen->LoadNPC(i);
- if(enem->Misc[DMG_MISC1]==0){
- enem->Misc[DMG_MISC1]=1;
- enem->Misc[DMG_MISC2]=enem->HP;
- enem->Misc[DMG_MISC3]=0;
- }
- if(enem->Misc[DMG_MISC1]!=0&&enem->HP<enem->Misc[DMG_MISC2]){
- enem->Misc[DMG_MISC1]=45;
- enem->Misc[DMG_MISC3]=enem->Misc[DMG_MISC2]-enem->HP;
- enem->Misc[DMG_MISC2]=enem->HP;
- }
- if(enem->Misc[DMG_MISC1]>1){
- if(enem->Misc[DMG_MISC3]>9){offset=0;}
- else{offset=4;}
- if(enem->Misc[DMG_MISC1]%3!=0)Screen->DrawInteger(6, enem->X+offset, enem->Y-18+(enem->Misc[DMG_MISC1]/5), FONT_Z1, DMG_FONTCOL, -1, -1, -1, enem->Misc[DMG_MISC3], 0, 128);
- enem->Misc[DMG_MISC1]--;
- }
- }
- }
- //Combos for normal and attacking animations.
- const int BRANDI_COMBO = 992;
- const int HENRI_COMBO = 976;
- const int RHEA_COMBO = 928;
- const int KYLE_COMBO = 960;
- const int FAYN_COMBO = 1008;
- const int GARY_COMBO = 944;
- const int RHEA_ATTACK_COMBO= 2480;
- const int BRANDI_ATTACK_COMBO = 2496;
- const int HENRI_ATTACK_COMBO = 2512;
- const int GARY_ATTACK_COMBO = 2528;
- const int KYLE_ATTACK_COMBO = 2544;
- const int FAYN_ATTACK_COMBO = 2560;
- //Items which tell game a character is in the party.
- const int BRANDI_ITEM = 144;
- const int HENRI_ITEM = 145;
- const int RHEA_ITEM = 148;
- const int FAYN_ITEM = 149;
- const int KYLE_ITEM = 146;
- const int GARY_ITEM = 147;
- //Changes appearance based on character you're playing as.
- void Character_Handler(){
- if(Curr_Character() ==BRANDI){
- //Shift to another character if they're in the party.
- if(Link->PressEx3){
- if(PartyMember(KYLE))ElegyVars[CURR_CHARACTER] = KYLE;
- else if(PartyMember(RHEA))ElegyVars[CURR_CHARACTER] = RHEA;
- else if(PartyMember(GARY))ElegyVars[CURR_CHARACTER] = GARY;
- else if(PartyMember(FAYN))ElegyVars[CURR_CHARACTER] = FAYN;
- else if(PartyMember(HENRI))ElegyVars[CURR_CHARACTER] = HENRI;
- }
- else if(Link->PressEx4){
- if(PartyMember(HENRI))ElegyVars[CURR_CHARACTER] = HENRI;
- else if(PartyMember(FAYN))ElegyVars[CURR_CHARACTER] = FAYN;
- else if(PartyMember(GARY))ElegyVars[CURR_CHARACTER] = GARY;
- else if(PartyMember(RHEA))ElegyVars[CURR_CHARACTER] = RHEA;
- else if(PartyMember(KYLE))ElegyVars[CURR_CHARACTER] = KYLE;
- }
- //If character is dead, do nothing.
- if(KO(BRANDI))
- KO();
- //Change appearance based on your actions.
- else{
- Link->CollDetection = true;
- if(Link->Action == LA_NONE||Link->Action == LA_WALKING||Link->Action ==LA_SCROLLING){
- if(Link->Dir == DIR_DOWN && !Link->InputDown && !Link->PressDown)
- Screen->DrawCombo(1, drawX, drawY-16, BRANDI_COMBO+9, 1, 2, 8, -1, -1, 0, 0, 0, -1, 0, true, 128);
- else if(Link->PressDown ||Link->InputDown)
- Screen->DrawCombo(1, drawX, drawY-16, BRANDI_COMBO+1, 1, 2, 8, -1, -1, 0, 0, 0, -1, 0, true, 128);
- else if(Link->Dir == DIR_LEFT && !Link->PressLeft && !Link->InputLeft)
- Screen->DrawCombo(1, drawX, drawY-16, BRANDI_COMBO+10, 1, 2, 8, -1, -1, 0, 0, 0, -1, 0, true, 128);
- else if(Link->PressLeft ||Link->InputLeft)
- Screen->DrawCombo(1, drawX, drawY-16, BRANDI_COMBO+2, 1, 2, 8, -1, -1, 0, 0, 0, -1, 0, true, 128);
- else if(Link->Dir == DIR_RIGHT && !Link->PressRight && !Link->InputRight)
- Screen->DrawCombo(1, drawX, drawY-16, BRANDI_COMBO+11, 1, 2, 8, -1, -1, 0, 0, 0, -1, 0, true, 128);
- else if(Link->PressRight ||Link->InputRight)
- Screen->DrawCombo(1, drawX, drawY-16, BRANDI_COMBO+3, 1, 2, 8, -1, -1, 0, 0, 0, -1, 0, true, 128);
- else if(Link->Dir == DIR_UP && !Link->PressUp && !Link->InputUp)
- Screen->DrawCombo(1, drawX, drawY-16, BRANDI_COMBO+8, 1, 2, 8, -1, -1, 0, 0, 0, -1, 0, true, 128);
- else if(Link->PressUp ||Link->InputUp)
- Screen->DrawCombo(1, drawX, drawY-16, BRANDI_COMBO, 1, 2, 8, -1, -1, 0, 0, 0, -1, 0, true, 128);
- }
- if(Link->Action == LA_ATTACKING||Link->Action ==LA_CASTING){
- if(Link->Dir == DIR_UP)
- Screen->DrawCombo(1, drawX, drawY-16, BRANDI_ATTACK_COMBO, 1, 2, 8, -1, -1, 0, 0, 0, -1, 0, true, 128);
- else if(Link->Dir== DIR_DOWN)
- Screen->DrawCombo(1, drawX, drawY-16, BRANDI_ATTACK_COMBO+1, 1, 2, 8, -1, -1, 0, 0, 0, -1, 0, true, 128);
- else if(Link->Dir==DIR_LEFT)
- Screen->DrawCombo(1, drawX, drawY-16, BRANDI_ATTACK_COMBO+2, 1, 2, 8, -1, -1, 0, 0, 0, -1, 0, true, 128);
- else if(Link->Dir==DIR_RIGHT)
- Screen->DrawCombo(1, drawX, drawY-16, BRANDI_ATTACK_COMBO+3, 1, 2, 8, -1, -1, 0, 0, 0, -1, 0, true, 128);
- }
- else if(Link->Action ==LA_HOLD1LAND)
- Screen->DrawCombo(1, drawX, drawY-16, BRANDI_ATTACK_COMBO+8, 1, 2, 8, -1, -1, 0, 0, 0, -1, 0, true, 128);
- else if(Link->Action ==LA_HOLD2LAND)
- Screen->DrawCombo(1, drawX, drawY-16, BRANDI_ATTACK_COMBO+9, 1, 2, 8, -1, -1, 0, 0, 0, -1, 0, true, 128);
- else if(Link->Action ==LA_GOTHURTLAND|| Link->Action== LA_DYING){
- Screen->DrawCombo(1, drawX, drawY-16, BRANDI_ATTACK_COMBO+10, 1, 2, 8, -1, -1, 0, 0, 0, 48, 0, true, 64);
- }
- }
- }
- else if(Curr_Character() ==HENRI){
- if(Link->PressEx3){
- if(PartyMember(BRANDI))ElegyVars[CURR_CHARACTER] = BRANDI;
- else if(PartyMember(KYLE))ElegyVars[CURR_CHARACTER] = KYLE;
- else if(PartyMember(RHEA))ElegyVars[CURR_CHARACTER] = RHEA;
- else if(PartyMember(GARY))ElegyVars[CURR_CHARACTER] = GARY;
- else if(PartyMember(FAYN))ElegyVars[CURR_CHARACTER] = FAYN;
- }
- else if(Link->PressEx4){
- if(PartyMember(FAYN))ElegyVars[CURR_CHARACTER] = FAYN;
- else if(PartyMember(GARY))ElegyVars[CURR_CHARACTER] = GARY;
- else if(PartyMember(RHEA))ElegyVars[CURR_CHARACTER] = RHEA;
- else if(PartyMember(KYLE))ElegyVars[CURR_CHARACTER] = KYLE;
- else if(PartyMember(BRANDI))ElegyVars[CURR_CHARACTER] = BRANDI;
- }
- if(KO(HENRI))
- KO();
- else{
- Link->CollDetection = true;
- if(Link->Action == LA_NONE||Link->Action == LA_WALKING||Link->Action ==LA_SCROLLING){
- if(Link->Dir == DIR_DOWN && !Link->InputDown && !Link->PressDown)
- Screen->DrawCombo(1, drawX, drawY-16, HENRI_COMBO+9, 1, 2, 8, -1, -1, 0, 0, 0, -1, 0, true, 128);
- else if(Link->PressDown ||Link->InputDown)
- Screen->DrawCombo(1, drawX, drawY-16, HENRI_COMBO+1, 1, 2, 8, -1, -1, 0, 0, 0, -1, 0, true, 128);
- else if(Link->Dir == DIR_LEFT && !Link->PressLeft && !Link->InputLeft)
- Screen->DrawCombo(1, drawX, drawY-16, HENRI_COMBO+10, 1, 2, 8, -1, -1, 0, 0, 0, -1, 0, true, 128);
- else if(Link->PressLeft ||Link->InputLeft)
- Screen->DrawCombo(1, drawX, drawY-16, HENRI_COMBO+2, 1, 2, 8, -1, -1, 0, 0, 0, -1, 0, true, 128);
- else if(Link->Dir == DIR_RIGHT && !Link->PressRight && !Link->InputRight)
- Screen->DrawCombo(1, drawX, drawY-16, HENRI_COMBO+11, 1, 2, 8, -1, -1, 0, 0, 0, -1, 0, true, 128);
- else if(Link->PressRight ||Link->InputRight)
- Screen->DrawCombo(1, drawX, drawY-16, HENRI_COMBO+3, 1, 2, 8, -1, -1, 0, 0, 0, -1, 0, true, 128);
- else if(Link->Dir == DIR_UP && !Link->PressUp && !Link->InputUp)
- Screen->DrawCombo(1, drawX, drawY-16, HENRI_COMBO+8, 1, 2, 8, -1, -1, 0, 0, 0, -1, 0, true, 128);
- else if(Link->PressUp ||Link->InputUp)
- Screen->DrawCombo(1, drawX, drawY-16, HENRI_COMBO, 1, 2, 8, -1, -1, 0, 0, 0, -1, 0, true, 128);
- }
- if(Link->Action == LA_ATTACKING||Link->Action ==LA_CASTING){
- if(Link->Dir == DIR_UP)
- Screen->DrawCombo(1, drawX, drawY-16, HENRI_ATTACK_COMBO, 1, 2, 8, -1, -1, 0, 0, 0, -1, 0, true, 128);
- else if(Link->Dir== DIR_DOWN)
- Screen->DrawCombo(1, drawX, drawY-16, HENRI_ATTACK_COMBO+1, 1, 2, 8, -1, -1, 0, 0, 0, -1, 0, true, 128);
- else if(Link->Dir==DIR_LEFT)
- Screen->DrawCombo(1, drawX, drawY-16, HENRI_ATTACK_COMBO+2, 1, 2, 8, -1, -1, 0, 0, 0, -1, 0, true, 128);
- else if(Link->Dir==DIR_RIGHT)
- Screen->DrawCombo(1, drawX, drawY-16, HENRI_ATTACK_COMBO+3, 1, 2, 8, -1, -1, 0, 0, 0, -1, 0, true, 128);
- }
- else if(Link->Action ==LA_HOLD1LAND)
- Screen->DrawCombo(1, drawX, drawY-16, HENRI_ATTACK_COMBO+8, 1, 2, 8, -1, -1, 0, 0, 0, -1, 0, true, 128);
- else if(Link->Action ==LA_HOLD2LAND)
- Screen->DrawCombo(1, drawX, drawY-16, HENRI_ATTACK_COMBO+9, 1, 2, 8, -1, -1, 0, 0, 0, -1, 0, true, 128);
- else if(Link->Action ==LA_GOTHURTLAND|| Link->Action== LA_DYING){
- Screen->DrawCombo(1, drawX, drawY-16, HENRI_ATTACK_COMBO+10, 1, 2, 8, -1, -1, 0, 0, 0, 48, 0, true, 64);
- }
- }
- }
- else if(Curr_Character() == RHEA){
- if(Link->PressEx3){
- if(PartyMember(GARY))ElegyVars[CURR_CHARACTER] = GARY;
- else if(PartyMember(FAYN))ElegyVars[CURR_CHARACTER] = FAYN;
- else if(PartyMember(HENRI))ElegyVars[CURR_CHARACTER] = HENRI;
- else if(PartyMember(BRANDI))ElegyVars[CURR_CHARACTER] = BRANDI;
- else if(PartyMember(KYLE))ElegyVars[CURR_CHARACTER] = KYLE;
- }
- else if(Link->PressEx4){
- if(PartyMember(KYLE))ElegyVars[CURR_CHARACTER] = KYLE;
- else if(PartyMember(BRANDI))ElegyVars[CURR_CHARACTER] = BRANDI;
- else if(PartyMember(HENRI))ElegyVars[CURR_CHARACTER] = HENRI;
- else if(PartyMember(FAYN))ElegyVars[CURR_CHARACTER] = FAYN;
- else if(PartyMember(GARY))ElegyVars[CURR_CHARACTER] = GARY;
- }
- if(KO(RHEA))
- KO();
- else{
- Link->CollDetection = true;
- if(Link->Action == LA_NONE||Link->Action == LA_WALKING||Link->Action ==LA_SCROLLING){
- if(Link->Dir == DIR_DOWN && !Link->InputDown && !Link->PressDown)
- Screen->DrawCombo(1, drawX, drawY-16, RHEA_COMBO+9, 1, 2, 1, -1, -1, 0, 0, 0, -1, 0, true, 128);
- else if(Link->PressDown ||Link->InputDown)
- Screen->DrawCombo(1, drawX, drawY-16, RHEA_COMBO+1, 1, 2, 1, -1, -1, 0, 0, 0, -1, 0, true, 128);
- else if(Link->Dir == DIR_LEFT && !Link->PressLeft && !Link->InputLeft)
- Screen->DrawCombo(1, drawX, drawY-16, RHEA_COMBO+10, 1, 2, 1, -1, -1, 0, 0, 0, -1, 0, true, 128);
- else if(Link->PressLeft ||Link->InputLeft)
- Screen->DrawCombo(1, drawX, drawY-16, RHEA_COMBO+2, 1, 2, 1, -1, -1, 0, 0, 0, -1, 0, true, 128);
- else if(Link->Dir == DIR_RIGHT && !Link->PressRight && !Link->InputRight)
- Screen->DrawCombo(1, drawX, drawY-16, RHEA_COMBO+11, 1, 2, 1, -1, -1, 0, 0, 0, -1, 0, true, 128);
- else if(Link->PressRight ||Link->InputRight)
- Screen->DrawCombo(1, drawX, drawY-16, RHEA_COMBO+3, 1, 2, 1, -1, -1, 0, 0, 0, -1, 0, true, 128);
- else if(Link->Dir == DIR_UP && !Link->PressUp && !Link->InputUp)
- Screen->DrawCombo(1, drawX, drawY-16, RHEA_COMBO+8, 1, 2, 1, -1, -1, 0, 0, 0, -1, 0, true, 128);
- else if(Link->PressUp ||Link->InputUp)
- Screen->DrawCombo(1, drawX, drawY-16, RHEA_COMBO, 1, 2, 1, -1, -1, 0, 0, 0, -1, 0, true, 128);
- }
- if(Link->Action == LA_ATTACKING||Link->Action ==LA_CASTING){
- if(Link->Dir == DIR_UP)
- Screen->DrawCombo(1, drawX, drawY-16, RHEA_ATTACK_COMBO, 1, 2, 1, -1, -1, 0, 0, 0, -1, 0, true, 128);
- else if(Link->Dir== DIR_DOWN)
- Screen->DrawCombo(1, drawX, drawY-16, RHEA_ATTACK_COMBO+1, 1, 2, 1, -1, -1, 0, 0, 0, -1, 0, true, 128);
- else if(Link->Dir==DIR_LEFT)
- Screen->DrawCombo(1, drawX, drawY-16, RHEA_ATTACK_COMBO+2, 1, 2, 1, -1, -1, 0, 0, 0, -1, 0, true, 128);
- else if(Link->Dir==DIR_RIGHT)
- Screen->DrawCombo(1, drawX, drawY-16, RHEA_ATTACK_COMBO+3, 1, 2, 1, -1, -1, 0, 0, 0, -1, 0, true, 128);
- }
- else if(Link->Action ==LA_HOLD1LAND)
- Screen->DrawCombo(1, drawX, drawY-16, RHEA_ATTACK_COMBO+8, 1, 2, 1, -1, -1, 0, 0, 0, -1, 0, true, 128);
- else if(Link->Action ==LA_HOLD2LAND)
- Screen->DrawCombo(1, drawX, drawY-16, RHEA_ATTACK_COMBO+9, 1, 2, 1, -1, -1, 0, 0, 0, -1, 0, true, 128);
- else if(Link->Action ==LA_GOTHURTLAND|| Link->Action== LA_DYING){
- Screen->DrawCombo(1, drawX, drawY-16, RHEA_ATTACK_COMBO+10, 1, 2, 1, -1, -1, 0, 0, 0, 48, 0, true, 64); }
- }
- }
- else if(Curr_Character() ==GARY){
- if(Link->PressEx3){
- if(PartyMember(FAYN))ElegyVars[CURR_CHARACTER] = FAYN;
- else if(PartyMember(HENRI))ElegyVars[CURR_CHARACTER] = HENRI;
- else if(PartyMember(BRANDI))ElegyVars[CURR_CHARACTER] = BRANDI;
- else if(PartyMember(KYLE))ElegyVars[CURR_CHARACTER] = KYLE;
- else if(PartyMember(RHEA))ElegyVars[CURR_CHARACTER] = RHEA;
- }
- else if(Link->PressEx4){
- if(PartyMember(RHEA))ElegyVars[CURR_CHARACTER] = RHEA;
- else if(PartyMember(KYLE))ElegyVars[CURR_CHARACTER] = KYLE;
- else if(PartyMember(BRANDI))ElegyVars[CURR_CHARACTER] = BRANDI;
- else if(PartyMember(HENRI))ElegyVars[CURR_CHARACTER] = HENRI;
- else if(PartyMember(FAYN))ElegyVars[CURR_CHARACTER] = FAYN;
- }
- if(KO(GARY))
- KO();
- else{
- Link->CollDetection = true;
- if(Link->Action == LA_NONE||Link->Action == LA_WALKING||Link->Action ==LA_SCROLLING){
- if(Link->Dir == DIR_DOWN && !Link->InputDown && !Link->PressDown)
- Screen->DrawCombo(1, drawX, drawY-16, GARY_COMBO+9, 1, 2, 6, -1, -1, 0, 0, 0, -1, 0, true, 128);
- else if(Link->PressDown ||Link->InputDown)
- Screen->DrawCombo(1, drawX, drawY-16, GARY_COMBO+1, 1, 2, 6, -1, -1, 0, 0, 0, -1, 0, true, 128);
- else if(Link->Dir == DIR_LEFT && !Link->PressLeft && !Link->InputLeft)
- Screen->DrawCombo(1, drawX, drawY-16, GARY_COMBO+10, 1, 2, 6, -1, -1, 0, 0, 0, -1, 0, true, 128);
- else if(Link->PressLeft ||Link->InputLeft)
- Screen->DrawCombo(1, drawX, drawY-16, GARY_COMBO+2, 1, 2, 6, -1, -1, 0, 0, 0, -1, 0, true, 128);
- else if(Link->Dir == DIR_RIGHT && !Link->PressRight && !Link->InputRight)
- Screen->DrawCombo(1, drawX, drawY-16, GARY_COMBO+11, 1, 2, 6, -1, -1, 0, 0, 0, -1, 0, true, 128);
- else if(Link->PressRight ||Link->InputRight)
- Screen->DrawCombo(1, drawX, drawY-16, GARY_COMBO+3, 1, 2, 6, -1, -1, 0, 0, 0, -1, 0, true, 128);
- else if(Link->Dir == DIR_UP && !Link->PressUp && !Link->InputUp)
- Screen->DrawCombo(1, drawX, drawY-16, GARY_COMBO+8, 1, 2, 6, -1, -1, 0, 0, 0, -1, 0, true, 128);
- else if(Link->PressUp ||Link->InputUp)
- Screen->DrawCombo(1, drawX, drawY-16, GARY_COMBO, 1, 2,6, -1, -1, 0, 0, 0, -1, 0, true, 128);
- }
- if(Link->Action == LA_ATTACKING||Link->Action ==LA_CASTING){
- if(Link->Dir == DIR_UP)
- Screen->DrawCombo(1, drawX, drawY-16, GARY_ATTACK_COMBO, 1, 2, 6, -1, -1, 0, 0, 0, -1, 0, true, 128);
- else if(Link->Dir== DIR_DOWN)
- Screen->DrawCombo(1, drawX, drawY-16, GARY_ATTACK_COMBO+1, 1, 2, 6, -1, -1, 0, 0, 0, -1, 0, true, 128);
- else if(Link->Dir==DIR_LEFT)
- Screen->DrawCombo(1, drawX, drawY-16, GARY_ATTACK_COMBO+2, 1, 2, 6, -1, -1, 0, 0, 0, -1, 0, true, 128);
- else if(Link->Dir==DIR_RIGHT)
- Screen->DrawCombo(1, drawX, drawY-16, GARY_ATTACK_COMBO+3, 1, 2, 6, -1, -1, 0, 0, 0, -1, 0, true, 128);
- }
- else if(Link->Action ==LA_HOLD1LAND)
- Screen->DrawCombo(1, drawX, drawY-16, GARY_ATTACK_COMBO+8, 1, 2, 6, -1, -1, 0, 0, 0, -1, 0, true, 128);
- else if(Link->Action ==LA_HOLD2LAND)
- Screen->DrawCombo(1, drawX, drawY-16, GARY_ATTACK_COMBO+9, 1, 2, 6, -1, -1, 0, 0, 0, -1, 0, true, 128);
- else if(Link->Action ==LA_GOTHURTLAND|| Link->Action== LA_DYING){
- Screen->DrawCombo(1, drawX, drawY-16, GARY_ATTACK_COMBO+10, 1, 2, 6, -1, -1, 0, 0, 0, 48, 0, true, 64);
- }
- }
- }
- else if(Curr_Character() ==FAYN){
- if(Link->PressEx3){
- if(PartyMember(HENRI))ElegyVars[CURR_CHARACTER] = HENRI;
- else if(PartyMember(BRANDI))ElegyVars[CURR_CHARACTER] = BRANDI;
- else if(PartyMember(KYLE))ElegyVars[CURR_CHARACTER] = KYLE;
- else if(PartyMember(RHEA))ElegyVars[CURR_CHARACTER] = RHEA;
- else if(PartyMember(GARY))ElegyVars[CURR_CHARACTER] = GARY;
- }
- else if(Link->PressEx4){
- if(PartyMember(GARY))ElegyVars[CURR_CHARACTER] = GARY;
- else if(PartyMember(RHEA))ElegyVars[CURR_CHARACTER] = RHEA;
- else if(PartyMember(KYLE))ElegyVars[CURR_CHARACTER] = KYLE;
- else if(PartyMember(BRANDI))ElegyVars[CURR_CHARACTER] = BRANDI;
- else if(PartyMember(HENRI))ElegyVars[CURR_CHARACTER] = HENRI;
- }
- if(KO(FAYN))
- KO();
- else{
- Link->CollDetection = true;
- if(Link->Action == LA_NONE||Link->Action == LA_WALKING||Link->Action ==LA_SCROLLING){
- if(Link->Dir == DIR_DOWN && !Link->InputDown && !Link->PressDown)
- Screen->DrawCombo(1, drawX, drawY-16, FAYN_COMBO+9, 1, 2, 8, -1, -1, 0, 0, 0, -1, 0, true, 128);
- else if(Link->PressDown ||Link->InputDown)
- Screen->DrawCombo(1, drawX, drawY-16, FAYN_COMBO+1, 1, 2, 8, -1, -1, 0, 0, 0, -1, 0, true, 128);
- else if(Link->Dir == DIR_LEFT && !Link->PressLeft && !Link->InputLeft)
- Screen->DrawCombo(1, drawX, drawY-16, FAYN_COMBO+10, 1, 2, 8, -1, -1, 0, 0, 0, -1, 0, true, 128);
- else if(Link->PressLeft ||Link->InputLeft)
- Screen->DrawCombo(1, drawX, drawY-16, FAYN_COMBO+2, 1, 2, 8, -1, -1, 0, 0, 0, -1, 0, true, 128);
- else if(Link->Dir == DIR_RIGHT && !Link->PressRight && !Link->InputRight)
- Screen->DrawCombo(1, drawX, drawY-16, FAYN_COMBO+11, 1, 2, 8, -1, -1, 0, 0, 0, -1, 0, true, 128);
- else if(Link->PressRight ||Link->InputRight)
- Screen->DrawCombo(1, drawX, drawY-16, FAYN_COMBO+3, 1, 2, 8, -1, -1, 0, 0, 0, -1, 0, true, 128);
- else if(Link->Dir == DIR_UP && !Link->PressUp && !Link->InputUp)
- Screen->DrawCombo(1, drawX, drawY-16, FAYN_COMBO+8, 1, 2, 8, -1, -1, 0, 0, 0, -1, 0, true, 128);
- else if(Link->PressUp ||Link->InputUp)
- Screen->DrawCombo(1, drawX, drawY-16, FAYN_COMBO, 1, 2, 8, -1, -1, 0, 0, 0, -1, 0, true, 128);
- }
- if(Link->Action == LA_ATTACKING||Link->Action ==LA_CASTING){
- if(Link->Dir == DIR_UP)
- Screen->DrawCombo(1, drawX, drawY-16, FAYN_ATTACK_COMBO, 1, 2, 0, -1, -1, 0, 0, 0, -1, 0, true, 128);
- else if(Link->Dir== DIR_DOWN)
- Screen->DrawCombo(1, drawX, drawY-16, FAYN_ATTACK_COMBO+1, 1, 2, 0, -1, -1, 0, 0, 0, -1, 0, true, 128);
- else if(Link->Dir==DIR_LEFT)
- Screen->DrawCombo(1, drawX, drawY-16, FAYN_ATTACK_COMBO+2, 1, 2, 0, -1, -1, 0, 0, 0, -1, 0, true, 128);
- else if(Link->Dir==DIR_RIGHT)
- Screen->DrawCombo(1, drawX, drawY-16, FAYN_ATTACK_COMBO+3, 1, 2, 0, -1, -1, 0, 0, 0, -1, 0, true, 128);
- }
- else if(Link->Action ==LA_HOLD1LAND)
- Screen->DrawCombo(1, drawX, drawY-16, FAYN_ATTACK_COMBO+8, 1, 2, 0, -1, -1, 0, 0, 0, -1, 0, true, 128);
- else if(Link->Action ==LA_HOLD2LAND)
- Screen->DrawCombo(1, drawX, drawY-16, FAYN_ATTACK_COMBO+9, 1, 2, 0, -1, -1, 0, 0, 0, -1, 0, true, 128);
- else if(Link->Action ==LA_GOTHURTLAND|| Link->Action== LA_DYING){
- Screen->DrawCombo(1, drawX, drawY-16, FAYN_ATTACK_COMBO+10, 1, 2, 0, -1, -1, 0, 0, 0, 48, 0, true, 64);
- }
- }
- }
- else if(Curr_Character() ==KYLE){
- if(Link->PressEx3){
- if(PartyMember(RHEA))ElegyVars[CURR_CHARACTER] = RHEA;
- else if(PartyMember(GARY))ElegyVars[CURR_CHARACTER] = GARY;
- else if(PartyMember(FAYN))ElegyVars[CURR_CHARACTER] = FAYN;
- else if(PartyMember(HENRI))ElegyVars[CURR_CHARACTER] = HENRI;
- else if(PartyMember(BRANDI))ElegyVars[CURR_CHARACTER] = BRANDI;
- }
- else if(Link->PressEx4){
- if(PartyMember(BRANDI))ElegyVars[CURR_CHARACTER] = BRANDI;
- else if(PartyMember(HENRI))ElegyVars[CURR_CHARACTER] = HENRI;
- else if(PartyMember(FAYN))ElegyVars[CURR_CHARACTER] = FAYN;
- else if(PartyMember(GARY))ElegyVars[CURR_CHARACTER] = GARY;
- else if(PartyMember(RHEA))ElegyVars[CURR_CHARACTER] = RHEA;
- }
- if(KO(KYLE))
- KO();
- else{
- Link->CollDetection = true;
- if(Link->Action == LA_NONE||Link->Action == LA_WALKING||Link->Action ==LA_SCROLLING){
- if(Link->Dir == DIR_DOWN && !Link->InputDown && !Link->PressDown)
- Screen->DrawCombo(1, drawX, drawY-16, KYLE_COMBO+9, 1, 2, 7, -1, -1, 0, 0, 0, -1, 0, true, 128);
- else if(Link->PressDown ||Link->InputDown)
- Screen->DrawCombo(1, drawX, drawY-16, KYLE_COMBO+1, 1, 2, 7, -1, -1, 0, 0, 0, -1, 0, true, 128);
- else if(Link->Dir == DIR_LEFT && !Link->PressLeft && !Link->InputLeft)
- Screen->DrawCombo(1, drawX, drawY-16, KYLE_COMBO+10, 1, 2, 7, -1, -1, 0, 0, 0, -1, 0, true, 128);
- else if(Link->PressLeft ||Link->InputLeft)
- Screen->DrawCombo(1, drawX, drawY-16, KYLE_COMBO+2, 1, 2, 7, -1, -1, 0, 0, 0, -1, 0, true, 128);
- else if(Link->Dir == DIR_RIGHT && !Link->PressRight && !Link->InputRight)
- Screen->DrawCombo(1, drawX, drawY-16, KYLE_COMBO+11, 1, 2, 7, -1, -1, 0, 0, 0, -1, 0, true, 128);
- else if(Link->PressRight ||Link->InputRight)
- Screen->DrawCombo(1, drawX, drawY-16, KYLE_COMBO+3, 1, 2, 7, -1, -1, 0, 0, 0, -1, 0, true, 128);
- else if(Link->Dir == DIR_UP && !Link->PressUp && !Link->InputUp)
- Screen->DrawCombo(1, drawX, drawY-16, KYLE_COMBO+8, 1, 2, 7, -1, -1, 0, 0, 0, -1, 0, true, 128);
- else if(Link->PressUp ||Link->InputUp)
- Screen->DrawCombo(1, drawX, drawY-16, KYLE_COMBO, 1, 2, 7, -1, -1, 0, 0, 0, -1, 0, true, 128);
- }
- if(Link->Action == LA_ATTACKING||Link->Action ==LA_CASTING){
- if(Link->Dir == DIR_UP)
- Screen->DrawCombo(1, drawX, drawY-16, KYLE_ATTACK_COMBO, 1, 2, 7, -1, -1, 0, 0, 0, -1, 0, true, 128);
- else if(Link->Dir== DIR_DOWN)
- Screen->DrawCombo(1, drawX, drawY-16, KYLE_ATTACK_COMBO+1, 1, 2, 7, -1, -1, 0, 0, 0, -1, 0, true, 128);
- else if(Link->Dir==DIR_LEFT)
- Screen->DrawCombo(1, drawX, drawY-16, KYLE_ATTACK_COMBO+2, 1, 2, 7, -1, -1, 0, 0, 0, -1, 0, true, 128);
- else if(Link->Dir==DIR_RIGHT)
- Screen->DrawCombo(1, drawX, drawY-16, KYLE_ATTACK_COMBO+3, 1, 2, 7, -1, -1, 0, 0, 0, -1, 0, true, 128);
- }
- else if(Link->Action ==LA_HOLD1LAND)
- Screen->DrawCombo(1, drawX, drawY-16, KYLE_ATTACK_COMBO+8, 1, 2, 7, -1, -1, 0, 0, 0, -1, 0, true, 128);
- else if(Link->Action ==LA_HOLD2LAND)
- Screen->DrawCombo(1, drawX, drawY-16, KYLE_ATTACK_COMBO+9, 1, 2, 7, -1, -1, 0, 0, 0, -1, 0, true, 128);
- else if(Link->Action ==LA_GOTHURTLAND|| Link->Action== LA_DYING){
- Screen->DrawCombo(1, drawX, drawY-16, KYLE_ATTACK_COMBO+10, 1, 2, 7, -1, -1, 0, 0, 0, 48, 0, true, 64);
- }
- }
- }
- //Tells game who is in the party.
- if(Link->Item[KYLE_ITEM])SetPartyMember(KYLE);
- if(Link->Item[RHEA_ITEM])SetPartyMember(RHEA);
- if(Link->Item[GARY_ITEM])SetPartyMember(GARY);
- if(Link->Item[FAYN_ITEM])SetPartyMember(FAYN);
- if(Link->Item[BRANDI_ITEM])SetPartyMember(BRANDI);
- if(Link->Item[HENRI_ITEM])SetPartyMember(HENRI);
- }
- item script SelfHeal{
- void run(int dummy, int HealingAmount, int healsfx, int MPCost){
- if(MPCost!=0 && Current_MP(Curr_Character())>=MPCost){
- ReSetCurrentHP(Curr_Character(),HealingAmount,true);
- if(Current_HP(Curr_Character())>=Max_HP(Curr_Character()))
- SetCurrentHP(ElegyVars[CURR_CHARACTER],Max_HP(Curr_Character()));
- ReSetCurrentMP(Curr_Character(),MPCost,false);
- Game->PlaySound(healsfx);
- }
- else if(MPCost == 0 && Virtual_Inv[I_POTION]>=1){
- ReSetCurrentHP(Curr_Character(),HealingAmount,true);
- if(Current_HP(Curr_Character())>=Max_HP(Curr_Character()))
- SetCurrentHP(ElegyVars[CURR_CHARACTER],Max_HP(Curr_Character()));
- Virtual_Inv[I_POTION]--;
- Game->PlaySound(healsfx);
- }
- else Game->PlaySound(SFX_ERROR);
- }
- }
- int Virtual_Inv[65536];
- const int I_POTION = 0;
- const int I_PARTY_HEAL = 1;
- const int I_ETHER = 2;
- const int I_PHOENIX_DN = 3;
- item script PartyHeal{
- void run(int dummy, int HealingAmount, int healsfx, int MPCost){
- if(MPCost!=0 && Current_MP(Curr_Character())>=MPCost){
- for(int i = 0;i<6;i++){
- if(PartyMember(i) && !KO(i))ReSetCurrentHP(i,HealingAmount,true);
- if(Current_HP(i)>=Max_HP(i))SetCurrentHP(i,Max_HP(i));
- }
- ReSetCurrentMP(Curr_Character(),MPCost,false);
- Game->PlaySound(healsfx);
- }
- else if(MPCost == 0 && Virtual_Inv[I_PARTY_HEAL]>=1){
- for(int i = 0;i<6;i++){
- if(PartyMember(i) && !KO(i))ReSetCurrentHP(i,HealingAmount,true);
- if(Current_HP(i)>=Max_HP(i))SetCurrentHP(i,Max_HP(i));
- }
- Virtual_Inv[I_PARTY_HEAL]--;
- Game->PlaySound(healsfx);
- }
- else Game->PlaySound(SFX_ERROR);
- }
- }
- item script SelfEther{
- void run(int dummy, int HealingAmount, int healsfx){
- if(Virtual_Inv[I_ETHER]>=1){
- ReSetCurrentHP(Curr_Character(),HealingAmount,true);
- if(Current_MP(Curr_Character())>=Max_MP(Curr_Character()))
- SetCurrentMP(Curr_Character(),Max_MP(Curr_Character()));
- Virtual_Inv[I_ETHER]--;
- Game->PlaySound(healsfx);
- }
- else Game->PlaySound(SFX_ERROR);
- }
- }
- item script PhoenixDown{
- void run(int dummy,int ReviveAmount, int ReviveSfx,int MPCost){
- if(MPCost!=0 && Current_MP(Curr_Character())>=MPCost){
- for(int i= 0;i<6;i++){
- if(PartyMember(i) && KO(i)){
- SetKO_State(i,IS_ALIVE);
- ReSetCurrentHP(i,ReviveAmount,true);
- if(Current_HP(i)>=Max_HP(i))
- SetCurrentHP(i,Max_HP(i));
- Game->PlaySound(ReviveSfx);
- }
- }
- ReSetCurrentMP(Curr_Character(),MPCost,false);
- }
- else if(MPCost == 0 && Virtual_Inv[I_PHOENIX_DN]>=1){
- for(int i= 0;i<6;i++){
- if(PartyMember(i) && KO(i)){
- SetKO_State(i,IS_ALIVE);
- ReSetCurrentHP(i,ReviveAmount,true);
- if(Current_HP(i)>=Max_HP(i))
- SetCurrentHP(i,Max_HP(i));
- Game->PlaySound(ReviveSfx);
- }
- }
- Virtual_Inv[I_PHOENIX_DN]--;
- }
- else Game->PlaySound(SFX_ERROR);
- }
- }
- item script CounterItemPickup{
- void run(int CounterToIncrease,int Amount){
- Virtual_Inv[CounterToIncrease]+=Amount;
- }
- }
- item script SimpleMessage{
- void run(int Message){
- Screen->Message(Message);
- }
- }
- item script Inventory{
- void run(int Message, int ItemToSet){
- Screen->Message(Message);
- Virtual_Inv[ItemToSet]= 1;
- }
- }
- const int LW_MISC_ELEMENTAL_TYPE = 0;
- const int LW_TYPE_NON_ELEMENTAL = 0;
- const int LW_TYPE_FIRE = 1;
- const int LW_TYPE_WATER = 2;
- const int LW_TYPE_WIND = 3;
- const int LW_TYPE_EARTH = 4;
- item script Substitute_Item{
- void run(int Message,int item_to_give){
- Screen->Message(Message);
- item TradeSeqItem;
- //Create the item and place it at Link's location.
- TradeSeqItem = Screen->CreateItem(item_to_give);
- TradeSeqItem->X = Link->X;
- TradeSeqItem->Y = Link->Y;
- TradeSeqItem->Pickup |= IP_HOLDUP;
- }
- }
- const int SFX_ERROR = 0;
- item script DirectionalMagicAttack{
- void run(int dummy, int type,int MPCost,int sprite, int damage,int element, int Sfx){
- if(Current_MP(Curr_Character())>=MPCost){
- lweapon lw = FireScriptedLWeapon(type, Link->X+FixedInFrontX(Link->Dir,2), Link->Y+FixedInFrontY(Link->Dir,2),
- sprite, 200, damage,0);
- lw->Misc[LW_MISC_ELEMENTAL_TYPE]= element;
- Game->PlaySound(Sfx);
- ReSetCurrentMP(Curr_Character(),MPCost,false);
- }
- else
- Game->PlaySound(SFX_ERROR);
- }
- }
- item script OmniDirMagicAttack{
- void run(int dummy, int type,int MPCost,int sprite, int speed, int damage,int element, int Sfx){
- if(Current_MP(Curr_Character())>=MPCost){
- for(float i = 0;i<360;i+=45){
- lweapon lw = FireIndependentLWeapon(type, (Link->X+8)+32*Cos(i*45), (Link->Y+16)+32*Sin(i*45),
- i/45,sprite, speed, damage,0);
- lw->Misc[LW_MISC_ELEMENTAL_TYPE]= element;
- }
- Game->PlaySound(Sfx);
- ReSetCurrentMP(Curr_Character(),MPCost,false);
- }
- else
- Game->PlaySound(SFX_ERROR);
- }
- }
- item script DirectionalPhysAttack{
- void run(int dummy, int type,int sprite,int speed, int damage,int element, int Sfx){
- lweapon lw = FireScriptedLWeapon(type, Link->X+FixedInFrontX(Link->Dir,2), Link->Y+FixedInFrontY(Link->Dir,2),
- sprite, speed, damage,0);
- lw->Misc[LW_MISC_ELEMENTAL_TYPE]= element;
- Game->PlaySound(Sfx);
- }
- }
- item script OmniDirPhysAttack{
- void run(int dummy,int type,int sprite, int speed, int damage,int element, int Sfx){
- int rightway;
- float angle;
- for(float i = 0;i<=315;i+=45){
- rightway = i/45;
- if(rightway==0)
- angle = 270;
- else if(rightway==1)
- angle = 90;
- else if(rightway==2)
- angle = 180;
- else if(rightway==3)
- angle = 0;
- else if(rightway==4)
- angle = 225;
- else if(rightway==5)
- angle = 315;
- else if(rightway==6)
- angle = 135;
- else
- angle = 45;
- lweapon lw = FireIndependentLWeapon(type, (Link->X+8)+32*Cos(angle), (Link->Y+16)+32*Sin(angle),
- i/45,sprite, speed, damage,0);
- lw->Misc[LW_MISC_ELEMENTAL_TYPE]= element;
- }
- Game->PlaySound(Sfx);
- }
- }
- item script StatusBuff{
- void run(int dummy, int MPCost, int Sprite, int Sfx, int Buff){
- if(Current_MP(Curr_Character())>=MPCost){
- Game->PlaySound(Sfx);
- ReSetCurrentMP(Curr_Character(),MPCost,false);
- if(!CharacterStatus(Curr_Character(),Buff))
- SetCharacterStatus(Buff);
- lweapon lw = FireIndependentLWeapon(LW_SCRIPT1, Link->X, Link->Y-16,
- 270,Sprite, 0, 0,0);
- }
- else
- Game->PlaySound(SFX_ERROR);
- }
- }
- item script StatusHeal{
- void run(int dummy, int MPCost, int Sprite, int Sfx, int Buff){
- if(Current_MP(Curr_Character())>=MPCost){
- Game->PlaySound(Sfx);
- ReSetCurrentMP(Curr_Character(),MPCost,false);
- if(CharacterStatus(Curr_Character(),Buff))
- UnSetCharacterStatus(Buff);
- lweapon lw = FireIndependentLWeapon(LW_SCRIPT1, Link->X, Link->Y-16,
- 270,Sprite, 0, 0,0);
- }
- else
- Game->PlaySound(SFX_ERROR);
- }
- }
- //Positive Status Effects
- //Buff Type Constants
- const int LB_HOVER = 00000000001b;//Hover, avoid pits and spikes.
- const int LB_DEF = 00000000010b;//Damage is reduced.
- const int LB_ATK = 00000000100b;//Attack is increased.
- const int LB_REGEN = 00000001000b;//Regen.
- //Debuff type constants.
- const int LDB_POISON = 00000010000b;//You are poisoned.
- const int LDB_STOP = 00000100000b;//You can't move.
- const int LDB_MUTE = 00001000000b;//You can't use magic.
- //Array
- void StatusEffects(){
- if(CharacterStatus(Curr_Character(),LB_HOVER))
- __UpdateLinkHover(Curr_Character());
- if(CharacterStatus(Curr_Character(),LB_DEF))
- __UpdateLinkDef(Curr_Character());
- if(CharacterStatus(Curr_Character(),LB_ATK))
- __UpdateLinkAtk(Curr_Character());
- if(CharacterStatus(Curr_Character(),LDB_POISON))
- __UpdateLinkPoison(Curr_Character());
- if(CharacterStatus(Curr_Character(),LDB_STOP))
- __UpdateLinkStop(Curr_Character());
- if(CharacterStatus(Curr_Character(),LB_REGEN))
- __UpdateLinkRegen(Curr_Character());
- if(CharacterStatus(Curr_Character(),LDB_MUTE))
- __UpdateLinkMute(Curr_Character());
- }
- void __UpdateLinkAtk(int Character){
- if(ElegyVars[ATK_UP_TIMER+Character]==0)
- ElegyVars[ATK_UP_TIMER+Character]= MAX_BUFF_TIME;
- else{
- ElegyVars[STAT_M_ATK+Character]*=2;
- ElegyVars[STAT_P_ATK+Character]*=2;
- ElegyVars[ATK_UP_TIMER+Character]--;
- if(ElegyVars[ATK_UP_TIMER+Character]<5){
- UnSetCharacterStatus(Character,LB_ATK);
- ElegyVars[STAT_M_ATK+Character]/=2;
- ElegyVars[STAT_P_ATK+Character]/=2;
- ElegyVars[ATK_UP_TIMER+Character]=0;
- }
- }
- }
- void __UpdateLinkDef(int Character){
- if(ElegyVars[DEF_UP_TIMER+Character]==0)
- ElegyVars[DEF_UP_TIMER+Character]= MAX_BUFF_TIME;
- else{
- ElegyVars[STAT_M_DEF+Character]*=2;
- ElegyVars[STAT_P_DEF+Character]*=2;
- ElegyVars[DEF_UP_TIMER+Character]--;
- if(ElegyVars[DEF_UP_TIMER+Character]<5){
- UnSetCharacterStatus(Character,LB_DEF);
- ElegyVars[STAT_M_DEF]/=2;
- ElegyVars[STAT_P_DEF]/=2;
- ElegyVars[DEF_UP_TIMER]=0;
- }
- }
- }
- const int MAX_BUFF_TIME = 300;
- void __UpdateLinkHover(int Character){
- if(ElegyVars[HOVER_TIMER]==0)ElegyVars[HOVER_TIMER]=MAX_BUFF_TIME;
- else{
- ElegyVars[HOVER_TIMER]--;
- Link->Z = 1;
- Link->Jump = 0;
- if(ElegyVars[HOVER_TIMER]<5){
- UnSetCharacterStatus(Character,LB_HOVER);
- ElegyVars[HOVER_TIMER]= 0;
- }
- }
- }
- const int POISON_INTERVAL = 30;
- void __UpdateLinkPoison(int Character){
- if(ElegyVars[POISON_TIMER+Character]==0)
- ElegyVars[POISON_TIMER+Character]=MAX_BUFF_TIME;
- else{
- ElegyVars[POISON_WORK+Character] = (ElegyVars[POISON_WORK+Character]+1)%POISON_INTERVAL;
- if(ElegyVars[POISON_WORK]==0){
- Game->PlaySound(SFX_OUCH);
- ElegyVars[POISON_TIMER+Character]--;
- ReSetCurrentHP(Character,(Max_HP(Character)/60),false);
- }
- if(ElegyVars[POISON_TIMER+Character]<5){
- UnSetCharacterStatus(Character,LDB_POISON);
- ElegyVars[POISON_TIMER+Character]=0;
- }
- }
- }
- const int SFX_HEAL = 0;//Sound made when healing.
- void __UpdateLinkRegen(int Character){
- if(ElegyVars[REGEN_TIMER+Character]==0)
- ElegyVars[REGEN_TIMER+Character]=MAX_BUFF_TIME;
- else{
- ElegyVars[REGEN_WORK+Character] = (ElegyVars[REGEN_WORK+Character]+1)%POISON_INTERVAL;
- if(ElegyVars[REGEN_WORK+Character]==0){
- Game->PlaySound(SFX_HEAL);
- ElegyVars[REGEN_TIMER+Character]--;
- if(Current_HP(Character)<Max_HP(Character))
- ReSetCurrentHP(Character,(Max_HP(Character)/60),true);
- else
- SetCurrentHP(Character,Max_HP(Character));
- }
- if(ElegyVars[REGEN_TIMER+Character]<5){
- UnSetCharacterStatus(Character,LB_REGEN);
- ElegyVars[REGEN_TIMER+Character]=0;
- }
- }
- }
- const int MAX_STOP_TIME = 180;
- void __UpdateLinkStop(int Character){
- if(ElegyVars[STOP_TIMER+Character]==0)
- ElegyVars[STOP_TIMER+Character]=MAX_STOP_TIME;
- else{
- ElegyVars[STOP_TIMER+Character]--;
- CustomNoAction();
- if(ElegyVars[STOP_TIMER+Character]<5){
- UnSetCharacterStatus(Character,LDB_STOP);
- ElegyVars[STOP_TIMER+Character]=0;
- }
- }
- }
- void __UpdateLinkMute(int Character){
- if(ElegyVars[MUTE_TIMER+Character]==0)
- ElegyVars[MUTE_TIMER+Character]=MAX_STOP_TIME;
- else{
- ElegyVars[MUTE_TIMER+Character]--;
- InvertMP(Character);
- if(ElegyVars[MUTE_TIMER+Character]<5){
- UnSetCharacterStatus(Character,LDB_MUTE);
- InvertMP(Character);
- ElegyVars[MUTE_TIMER+Character]=0;
- }
- }
- }
- // to draw while Scrolling
- int scrollDir;
- int scrollCounter;
- int drawX;
- int drawY;
- void ScrollFix(){
- //function by Saffith
- if(Link->Action==LA_SCROLLING){
- if(scrollDir==-1){
- if(Link->Y>160){
- scrollDir=DIR_UP;
- scrollCounter=45;
- }
- else if(Link->Y<0){
- scrollDir=DIR_DOWN;
- scrollCounter=45;
- }
- else if(Link->X>240){
- scrollDir=DIR_LEFT;
- scrollCounter=65;
- }
- else{
- scrollDir=DIR_RIGHT;
- scrollCounter=65;
- }
- }
- if(scrollDir==DIR_UP && scrollCounter<45 && scrollCounter>4)
- drawY+=4;
- else if(scrollDir==DIR_DOWN && scrollCounter<45 && scrollCounter>4)
- drawY-=4;
- else if(scrollDir==DIR_LEFT && scrollCounter<65 && scrollCounter>4)
- drawX+=4;
- else if(scrollDir==DIR_RIGHT && scrollCounter<65 && scrollCounter>4)
- drawX-=4;
- scrollCounter--;
- }
- else{
- drawX=Link->X;
- drawY=Link->Y;
- if(scrollDir!=-1)
- scrollDir=-1;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement