I modify my game's version of the source code to remove things I don't like, but I'm not sure where to look or what to change to remove this random "leaking" of enemy attacks through invulnerability. I know that stupidly telefrags bypass invulnerability, but none of these attacks go over that threshold. Additionally, no enemies use the FOILINVUL (or whatever) flag. If I never find it, I'll just make the game cheaply give back any damage done while super, as this is very illogical behavior.
This short video talks about and shows this oddity. I'm not sure if it's a "bug" (though it feels like it is), but in case this unwanted behavior is a bug, it occurs in the latest dev build from DRD Team, gzdoom-g3.5pre-81-ga5b4d9d9a. It also occurs if I give myself the PowerInvulnerable actor class, which also makes me invulnerable.
Here are the scripts that matter that are used for transformation:
Code: Select all
//Transformation scripts
script "Transform" (void)
{ //This script handles transforming into Magical Cutie Mary/Super Xane. It's messy because it originates from World of Kirbycraft, that bad game.
force_detransform[PlayerNumber()] = FALSE; //If a detransformation was queued, cancel that.
int o1, o2; //Store the player's current X/Y velocity in these variables. They'll be restored when transformation ends.
o1 = GetActorVelX(GetCurrentPlayerTID());
o2 = GetActorVelY(GetCurrentPlayerTID());
AmbientSound("misc/transform",64); //The "YEEEE-AAH!" background chord. It sounds better if a yell is heard over it.
ACS_NamedExecuteAlways("PlayerMovement",0,1,0,0);
SetActorProperty(GetCurrentPlayerTID(),PROP_FLY,ON);
SetActorState(GetCurrentPlayerTID(),"Transform",1);
ActivatorSound("*super_yell",127);
a[PlayerNumber()] = GetActorAngle (GetCurrentPlayerTID());
mmx[PlayerNumber()] = GetActorX (GetCurrentPlayerTID());
y[PlayerNumber()] = GetActorY (GetCurrentPlayerTID());
z[PlayerNumber()] = GetActorZ (GetCurrentPlayerTID()) + VIEW_HEIGHT;
xyr = r * cos (p) >> 16; //Below is the transformation "cutscene".
ACS_NamedExecuteAlways("SpawnCGems",0,0,0,0); //Spawn the Chaos Bridges.
SpawnForced("ChaseCam",mmx[PlayerNumber()]-cos(a[PlayerNumber()])*xyr, y[PlayerNumber()]-sin(a[PlayerNumber()])*xyr, z[PlayerNumber()], C_TID+PlayerNumber(), a[PlayerNumber()] >> 8);
ChangeCamera(C_TID+PlayerNumber(),0,0);
SetActorAngle(GetCurrentPlayerTID(),GetActorAngle(GetCurrentPlayerTID())-0.5);
int super1 = 0;
While(super1<38)
{
SetActorVelocity(GetCurrentPlayerTID(),0,0,0,0,1);
super1++;
Delay(1);
}
ActivatorSound("*super_grunt",127);
ACS_NamedExecuteAlways("Invulnerable",0,1,0,0); //Remove invulnerability.
GiveActorInventory(GetCurrentPlayerTID(),"SuperX",1);
If(PlayerClass(PlayerNumber())==CHAR_MARY)
{
TakeInventory("WandType",2);
GiveInventory("Wand_Type",2); //Select the Heart Wand.
GiveInventory("MaryWand",1); //Give Magical Cutie Mary her wand.
UseInventory("MaryWand"); //Force the wand out for every transformation.
}
While(super1<=78)
{
SetActorVelocity(GetCurrentPlayerTID(),0,0,0,0,1);
super1++;
Delay(1);
}
SetActorProperty(GetCurrentPlayerTID(),PROP_FLY,OFF);
SetActorAngle(GetCurrentPlayerTID(),GetActorAngle(GetCurrentPlayerTID())+0.5);
ChangeCamera(0,0,0);
Thing_Remove(C_TID+PlayerNumber());
ACS_NamedExecuteAlways("PlayerMovement",0,0,0,0);
If(1/*cgem_count==7*/) SetActorState(0, "Transform_Reflect",FALSE);
SetActorVelocity(GetCurrentPlayerTID(),o1,o2,0,0,1);
ACS_NamedExecuteAlways("ShowTutorial",0,28,0,0); //Display warning about high speed wall jump behavior.
}
script "CheckSuper" ENTER
{ //Checks for transformation. If the player is transformed, spawns sparkles and handles detransformation.
While(1)
{
If(CheckActorInventory(GetCurrentPlayerTID(),"SuperX")==1)
{ //If transformed, check for forced detransform requests and spawn sparkles behind the player.
Spawn("SparkleSpawner",GetActorX(GetCurrentPlayerTID()),GetActorY(GetCurrentPlayerTID()),GetActorZ(GetCurrentPlayerTID())+24,0,GetActorAngle(GetCurrentPlayerTID())>>8);
If(force_detransform[PlayerNumber()]==TRUE)
{ //Time to detransform? Fine, revert the player to their normal form.
TakeActorInventory(GetCurrentPlayerTID(),"SuperX",1);
ACS_NamedExecuteAlways("Invulnerable",0,0,0,0); //Remove invulnerability.
If(1/*cgem_count==7*/) SetActorState(0, "Revert",FALSE);
}
Delay(1);
}
Else
{ //Otherwise, await the next transformation.
Delay(35);
}
}
}
script "Invulnerable" (int enable)
{
If(enable<-1||enable>1) { Log(s:"Invalid invulnerability command ", d:enable, s:"!"); Terminate; }
If(enable==TRUE)
{ //If enabling invulnerability, no checks are necessary, just turn it on and increment the counter.
invulnerable[PlayerNumber()]++;
SetPlayerProperty(FALSE, ON, PROP_INVULNERABILITY);
}
If(enable==-1) { invulnerable[PlayerNumber()] = 1; enable = FALSE; } //-1 guarantees invulnerability is disabled.
If(enable==FALSE)
{ //If disabling invulnerability, decrement the counter then if it's zero disable the invulnerability.
If(invulnerable[PlayerNumber()]>0) invulnerable[PlayerNumber()]--;
If(invulnerable[PlayerNumber()]==0) SetPlayerProperty(FALSE, OFF, PROP_INVULNERABILITY);
}
}
Code: Select all
Transform_Reflect: //If all seven Chaos Bridges are collected (final boss/replays), Mary will reflect all projectiles automatically.
GIRL A 0 A_Log("It's working.")
GIRL A 0 A_ChangeFlag("REFLECTIVE",TRUE)
GIRL A 0 A_ChangeFlag("MIRRORREFLECT",TRUE)
Goto See
Revert: //When reverting to normal cutie Mary, she can't keep reflecting anything that tries to hit her!
SUPA A 0 A_ChangeFlag("MIRRORREFLECT",FALSE)
SUPA A 0 A_ChangeFlag("REFLECTIVE",FALSE)
Goto See