I have to note that the 'getPwrupDamage()' is recognized and works, so I don't understand why the 'getScale()' is ignored.
Here is the projectile code:
Code: Select all
class shadowGunPoweredupProjectile : FastProjectile
{
int getScale()
{
int scl = 0.8;
if(target && target.CountInv("pwrLevel") == 8)
{
scl = 0.8;
}
if(target && target.CountInv("pwrLevel") == 7)
{
scl = 0.8;
}
if(target && target.CountInv("pwrLevel") == 6)
{
scl = 0.6;
}
if(target && target.CountInv("pwrLevel") == 5)
{
scl = 0.6;
}
if(target && target.CountInv("pwrLevel") == 4)
{
scl = 0.4;
}
if(target && target.CountInv("pwrLevel") == 3)
{
scl = 0.4;
}
if(target && target.CountInv("pwrLevel") == 2)
{
scl = 0.2;
}
if(target && target.CountInv("pwrLevel") == 1)
{
scl = 0.2;
}
return scl;
}
int getPwrupDamage()
{
int dmg = 16; //base damage, when player is on level 0 & level 1
if(target && target.CountInv("pwrLevel") == 8)
{
dmg = 72;
}
else if(target && target.CountInv("pwrLevel") == 7)
{
dmg = 64;
}
else if(target && target.CountInv("pwrLevel") == 6)
{
dmg = 56;
}
else if(target && target.CountInv("pwrLevel") == 5)
{
dmg = 48;
}
else if(target && target.CountInv("pwrLevel") == 4)
{
dmg = 40;
}
else if(target && target.CountInv("pwrLevel") == 3)
{
dmg = 32;
}
else if(target && target.CountInv("pwrLevel") == 2)
{
dmg = 24;
}
else if(target && target.CountInv("pwrLevel") == 1)
{
dmg = 16;
}
return dmg;
}
Default
{
+RANDOMIZE
+FORCEXYBILLBOARD
+BLOODSPLATTER
+SpawnSoundsource
+NoExtremeDeath
Projectile;
DamageType "Extreme";
Radius 2;
Height 2;
Speed 184;
DamageFunction (getPwrupDamage() * random(1, 6));
Decal "redShotScorch";
Renderstyle "Add";
Alpha 0.90;
Scale (getScale());
MissileType "WCPRJ_TrailSpawner";
MissileHeight 8;
SeeSound "weapons/shdwgnPRJ";
DeathSound "weapons/shdwgnPRJD";
}
States
{
Spawn:
SKPR ABCB 1 Bright A_SpawnItem("WCPRJ_Flare",0,0); //FX99 AA 1
SKPR ABCB 1 Bright A_SpawnItem("WCPRJ_Flare",0,0); //FX99 AA 1
Loop;
Death:
TNT1 A 0;
TNT1 AAAAAAAAAAAAAAAAAAAAA 0 A_SpawnItemEx("WCPRJ_Particle2",0,0,0,frandom(-6,6),frandom(-6,6),frandom(-6,6),0,SXF_NOCHECKPOSITION);
TNT1 A 0 A_SpawnItemEx("WCPRJ_Flash", 0, 0, 0, 0);
TNT1 A 0 A_SpawnItemEx("WCPRJ_Explosion", 0, 0, 0, 0);
TNT1 A 0 A_SpawnItemEx("WCPRJ_shotDeath", 0, 0, 0, 0);
//TNT1 A 0 A_SpawnItemEx("WCPRJ_shotDeath2", 0, 0, 0, 0);
TNT1 A 2 Light("WRSTCANNONDEATHLIGHT2");
TNT1 A 2 Light("WRSTCANNONDEATHLIGHT3");
TNT1 A 2 Light("WRSTCANNONDEATHLIGHT4");
TNT1 A 2 Light("WRSTCANNONDEATHLIGHT5");
Stop;
}
}