Okay, I'm having some problems here. Really annoying ones. Okay, technically one single problem, but still...
script_enemy_main
{
#include_function "lib\SHOT_REPLACE\shot_replace.dnh"
let BossImage = GetCurrentScriptDirectory ~ "boss_remilia.png";
let BossCutIn = GetCurrentScriptDirectory ~ "Remilia.png";
let frame = -100;
let frame2 = -90;
let frame3 = -90;
let frame4 = -90;
let frame5 = -90;
let frame6 = -90;
let move = -240;
let anim_frame = 0;
let Angle = 90;
let Angle2 = 90;
//let ShotSFX = "script\sfx\shot.wav";
//let LaserSFX = "script\sfx\laser.wav";
let Movecount = 0;
let BAT = [0, 0, 0, 0, 0];
@Initialize
{
shotinit;
LoadGraphic(BossImage);
SetLife(2120);
SetTimer(32);
SetInvincibility(30);
SetEnemyMarker(true);
MagicCircle(false);
SetMovePosition02(GetCenterX, 90, 30);
}
@MainLoop
{
anim_frame++;
AddLife(GetCommonDataDefault("Life", 0));
SetCollisionA(GetX(),GetY(),32);
SetCollisionB(GetX(),GetY(),24);
if(move == 0)
{
if(Movecount == 0)
{
SetMovePosition02(120, 126, 30);
Movecount = 1;
}
else if(Movecount == 1)
{
SetMovePosition02(GetCenterX - 53, 105, 30);
Movecount = 2;
}
else if(Movecount == 2)
{
SetMovePosition02(GetCenterX, 90, 30);
Movecount = 0;
}
move = -160;
}
if(frame == 0)
{
if(Movecount == 0)
{
loop(20)
{
CreateShotA(0, GetX, GetY, 20);
CreateShotA(1, GetX, GetY, 20);
CreateShotA(2, GetX, GetY, 20);
SetShotDataA(0, 0, 3, Angle, 0, 0, 0, RED02);
SetShotDataA(1, 0, 3, Angle, 0, 0, 0, RED02);
SetShotDataA(2, 0, 3, Angle, 0, 0, 0, RED02);
SetShotDirectionType(PLAYER);
SetShotDataA(0, 20, 0, 0, 0, 0, 0, WHITE02);
SetShotDataA(1, 40, 0, 0, 0, 0, 0, WHITE02);
SetShotDataA(2, 60, 0, 0, 0, 0, 0, WHITE02);
SetShotDataA(0, 180, NULL, NULL, 0, 0.2, 5, RED02);
SetShotDataA(1, 140, NULL, NULL, 0, 0.2, 5, RED02);
SetShotDataA(2, 100, NULL, NULL, 0, 0.2, 5, RED02);
FireShot(0);
FireShot(1);
FireShot(2);
SetShotDirectionType(ABSOLUTE);
Angle += 18;
}
}
else if(Movecount == 1)
{
}
else if(Movecount == 2)
{
}
frame = -120;
}
if(frame2 == 0)
{
let array = [0, 40, 0];
BAT[0] = 1;
CreateEnemyFromFile(GetCurrentScriptDirectory ~ "Bat1.txt", GetX, GetY + 40, 0, 90, array);
frame2 = -90;
}
if(frame3 == 0)
{
BAT[1] = 1;
let array = [-25, 35, 1];
CreateEnemyFromFile(GetCurrentScriptDirectory ~ "Bat1.txt", GetX - 25, GetY + 35, 0, 90, array);
frame3 = -90;
}
if(frame4 == 0)
{
BAT[2] = 1;
let array = [25, 35, 2];
CreateEnemyFromFile(GetCurrentScriptDirectory ~ "Bat1.txt", GetX + 25, GetY + 35, 0, 90, array);
frame4 = -90;
}
if(frame5 == 0)
{
BAT[3] = 1;
let array = [-35, 20, 3];
CreateEnemyFromFile(GetCurrentScriptDirectory ~ "Bat1.txt", GetX - 35, GetY + 20, 0, 90, array);
frame5 = -90;
}
if(frame6 == 0)
{
BAT[4] = 1;
let array = [35, 20, 4];
CreateEnemyFromFile(GetCurrentScriptDirectory ~ "Bat1.txt", GetX + 35, GetY + 20, 0, 90, array);
frame6 = -90;
}
frame++;
move++;
if(BAT[0] == 0)
{
if(frame2 == -30)
{
CreateShotA(255, GetX, GetY + 40, 30);
SetShotDataA(255, 0, 0, 0, 0, 0, 0, WHITE02);
SetShotKillTime(255, 0);
FireShot(255);
}
frame2++;
}
if(BAT[1] == 0)
{
if(frame3 == -30)
{
CreateShotA(255, GetX - 25, GetY + 35, 30);
SetShotDataA(255, 0, 0, 0, 0, 0, 0, WHITE02);
SetShotKillTime(255, 0);
FireShot(255);
}
frame3++;
}
if(BAT[2] == 0)
{
if(frame4 == -30)
{
CreateShotA(255, GetX + 25, GetY + 35, 30);
SetShotDataA(255, 0, 0, 0, 0, 0, 0, WHITE02);
SetShotKillTime(255, 0);
FireShot(255);
}
frame4++;
}
if(BAT[3] == 0)
{
if(frame5 == -30)
{
CreateShotA(255, GetX - 35, GetY + 20, 30);
SetShotDataA(255, 0, 0, 0, 0, 0, 0, WHITE02);
SetShotKillTime(255, 0);
FireShot(255);
}
frame5++;
}
if(BAT[4] == 0)
{
if(frame6 == -30)
{
CreateShotA(255, GetX + 35, GetY + 20, 30);
SetShotDataA(255, 0, 0, 0, 0, 0, 0, WHITE02);
SetShotKillTime(255, 0);
FireShot(255);
}
frame6++;
}
if(GetCommonDataDefault("Fami1", 0) == 1)
{
BAT[0] = 0;
SetCommonData("Fami1", 0);
}
if(GetCommonDataDefault("Fami2", 0) == 1)
{
BAT[1] = 0;
SetCommonData("Fami2", 0);
}
if(GetCommonDataDefault("Fami3", 0) == 1)
{
BAT[2] = 0;
SetCommonData("Fami3", 0);
}
if(GetCommonDataDefault("Fami4", 0) == 1)
{
BAT[3] = 0;
SetCommonData("Fami4", 0);
}
if(GetCommonDataDefault("Fami5", 0) == 1)
{
BAT[4] = 0;
SetCommonData("Fami5", 0);
}
}
@DrawLoop
{
SetTexture(BossImage);
if(anim_frame >= 0 && anim_frame < 8)
{
if(GetSpeedX()==0)
{
SetGraphicRect(31,31,95,94);
}
else if(GetSpeedX()>0)
{
SetGraphicRect(286,415,352,478);
}
else if(GetSpeedX()<0)
{
SetGraphicRect(286,159,348,222);
}
}
if(anim_frame >= 8 && anim_frame < 16)
{
if(GetSpeedX()==0)
{
SetGraphicRect(31,159,95,222);
}
else if(GetSpeedX()>0)
{
SetGraphicRect(286,415,352,478);
}
else if(GetSpeedX()<0)
{
SetGraphicRect(286,159,348,222);
}
}
if(anim_frame >= 16 && anim_frame < 24)
{
if(GetSpeedX()==0)
{
SetGraphicRect(31,287,95,350);
}
else if(GetSpeedX()>0)
{
SetGraphicRect(286,415,352,478);
}
else if(GetSpeedX()<0)
{
SetGraphicRect(286,159,348,222);
}
}
if(anim_frame >= 24 && anim_frame < 32)
{
if(GetSpeedX()==0)
{
SetGraphicRect(31,415,95,478);
}
else if(GetSpeedX()>0)
{
SetGraphicRect(286,415,352,478);
}
else if(GetSpeedX()<0)
{
SetGraphicRect(286,159,348,222);
}
}
if(anim_frame >= 32)
{
anim_frame = 0;
}
DrawGraphic(GetX, GetY);
}
@Finalize
{
DeleteGraphic(BossImage);
}
}
script_enemy_main
{
#include_function "lib\SHOT_REPLACE\shot_replace.dnh"
let BossImage = GetCurrentScriptDirectory ~ "servant.png";
let frame = -30;
let frame2 = -30;
let anim_frame = 0;
let Angle = 0;
let Angle2 = 0;
let ShotSFX = "script\sfx\shot.wav";
let LaserSFX = "script\sfx\laser.wav";
let PrevLife = 200;
@Initialize
{
shotinit;
LoadGraphic(BossImage);
SetLife(200);
SetDamageRate(100, 100);
//SetDamageRateEx(100,100,100,40);
}
@MainLoop
{
SetCommonData("Life", GetLife() - PrevLife);
SetX(GetEnemyX + GetArgument[0]);
SetY(GetEnemyY + GetArgument[1]);
anim_frame++;
SetCollisionA(GetX(),GetY(),32);
SetCollisionB(GetX(),GetY(),24);
PrevLife = GetLife();
if(frame == 0)
{
if(GetArgument[2] == 0)
{
CreateShot01(GetX, GetY, 5, 90, RED05, 5);
}
if(GetArgument[2] == 1)
{
CreateShot01(GetX, GetY, 5, 87, RED11, 5);
CreateShot01(GetX, GetY, 5, 100, RED11, 5);
CreateShot01(GetX, GetY, 5, 115, RED11, 5);
}
if(GetArgument[2] == 2)
{
CreateShot01(GetX, GetY, 5, 93, RED11, 5);
CreateShot01(GetX, GetY, 5, 80, RED11, 5);
CreateShot01(GetX, GetY, 5, 65, RED11, 5);
}
if(GetArgument[2] == 3)
{
CreateShot01(GetX, GetY, 5, 115, RED11, 5);
CreateShot01(GetX, GetY, 5, 135, RED11, 5);
CreateShot01(GetX, GetY, 5, 157, RED11, 5);
}
if(GetArgument[2] == 4)
{
CreateShot01(GetX, GetY, 5, 65, RED11, 5);
CreateShot01(GetX, GetY, 5, 45, RED11, 5);
CreateShot01(GetX, GetY, 5, 22, RED11, 5);
}
frame = -10;
}
if(frame2 == 0)
{
if(GetArgument[2] == 0)
{
loop(6)
{
CreateShotA(0, GetX, GetY, 5);
SetShotDataA(0, 0, 5, Angle, 1, 0, 0, RED01);
SetShotDirectionType(PLAYER);
SetShotDataA(0, 30, 5, 0, 0, 0, 0, RED01);
FireShot(0);
SetShotDirectionType(ABSOLUTE);
Angle += 60;
}
}
frame2 = -30;
}
frame++;
frame2++;
}
@DrawLoop
{
SetTexture(BossImage);
if(anim_frame >= 0 && anim_frame < 8)
{
SetGraphicRect(1,40,31,56);
}
if(anim_frame >= 8 && anim_frame < 16)
{
SetGraphicRect(33,40,63,57);
}
if(anim_frame >= 16 && anim_frame < 24)
{
SetGraphicRect(65,40,95,57);
}
if(anim_frame >= 24 && anim_frame < 32)
{
SetGraphicRect(97,40,127,57);
}
if(anim_frame >= 32)
{
anim_frame = 0;
}
DrawGraphic(GetX, GetY);
}
@Finalize
{
if(GetArgument[2] == 0)
{
SetCommonData("Fami1", 1);
}
if(GetArgument[2] == 1)
{
SetCommonData("Fami2", 1);
}
if(GetArgument[2] == 2)
{
SetCommonData("Fami3", 1);
}
if(GetArgument[2] == 3)
{
SetCommonData("Fami4", 1);
}
if(GetArgument[2] == 4)
{
SetCommonData("Fami5", 1);
}
DeleteGraphic(BossImage);
}
}
(For the picture files, get them from CtC, as that's where the ones I'm using are from.)
Okay, so the problem is, no matter what I do, shooting the bats will NOT damage the boss. I started with SetDamageRateEx, as that worked with an enemy spawned by a spellcard I made, but that didn't do anything, so I decided to fall back to my old method of AddLife and Common Data, but THAT doesn't do anything, either! Like despite setting it, it's ALWAYS zero. I KNOW that it works, because it worked on that other enemy I previously mentioned, before I realized exactly what SetDamageRateEx did, but why is it not working for THIS enemy? I don't want the player to have to destroy the bats before they can hit Remilia, because that would pretty much MAKE them run out of time, because the bats are blocking your attacks on Remilia...thus, it takes far too long to be able to slightly hurt her. Help, please? (Also, there's a reason the life is 2120- it's a bit of a joke. Kudos to you if you can actually figure out its meaning. Without help.)
EDIT: I just realized why the AddLife method isn't working: Because I'm spawning five Bats! Each is returning 0 on life difference when not being attacked, so if you're not attacking all at once, you're not hurting Remilia! Easy fix! But I doubt that's why SetDamageRateEx is failing...