Code: Select all
// NOTE: NN stands for Non-Native because we aren't inheriting from the "Sigil" actor.
Actor NNSigil : Weapon
{
Weapon.Kickback 100
Weapon.SelectionOrder 4000
Weapon.SisterWeapon "NNSigilUpgradeHack"
+WEAPON.CHEATNOTWEAPON
Tag "$TAG_SIGIL"
States
{
Deselect:
"----" A 1 Bright A_Lower
Loop
//
Select:
TNT1 A 1 A_JumpIfInventory("NNSigilPiece", 5, "Select5")
TNT1 A 0 A_JumpIfInventory("NNSigilPiece", 5, "Select5")
TNT1 A 0 A_JumpIfInventory("NNSigilPiece", 4, "Select4")
TNT1 A 0 A_JumpIfInventory("NNSigilPiece", 3, "Select3")
TNT1 A 0 A_JumpIfInventory("NNSigilPiece", 2, "Select2")
TNT1 A 0 A_JumpIfInventory("NNSigilPiece", 1, "Select1")
TNT1 A 0 A_GiveInventory("NNSigilPiece", 1) //In case somebody messed
Select1: //around in the console
SIGH A 1 Bright A_Raise
Loop
Select2:
SIGH B 1 Bright A_Raise
Loop
Select3:
SIGH C 1 Bright A_Raise
Loop
Select4:
SIGH D 1 Bright A_Raise
Loop
Select5:
SIGH E 1 Bright A_Raise
Loop
//
Ready:
SIGH "#" 1 Bright A_JumpIfInventory("NNSigilPiece", 5, "Ready5")
TNT1 A 0 A_JumpIfInventory("NNSigilPiece", 5, "Ready5")
TNT1 A 0 A_JumpIfInventory("NNSigilPiece", 4, "Ready4")
TNT1 A 0 A_JumpIfInventory("NNSigilPiece", 3, "Ready3")
TNT1 A 0 A_JumpIfInventory("NNSigilPiece", 2, "Ready2")
TNT1 A 0 A_JumpIfInventory("NNSigilPiece", 1, "Ready1")
TNT1 A 0 A_GiveInventory("NNSigilPiece", 1)
Ready1:
SIGH A 0 A_JumpIfInventory("NNSigilPiece", 2, "GotAnotherPiece")
SIGH A 1 Bright A_WeaponReady
Loop
Ready2:
SIGH B 0 A_JumpIfInventory("NNSigilPiece", 3, "GotAnotherPiece")
SIGH B 1 Bright A_WeaponReady
Loop
Ready3:
SIGH C 0 A_JumpIfInventory("NNSigilPiece", 4, "GotAnotherPiece")
SIGH C 1 Bright A_WeaponReady
Loop
Ready4:
SIGH D 0 A_JumpIfInventory("NNSigilPiece", 5, "GotAnotherPiece")
SIGH D 1 Bright A_WeaponReady
Loop
Ready5:
SIGH E 1 Bright A_WeaponReady
Loop
//
GotAnotherPiece:
"----" A 0 A_SelectWeapon("NNSigilUpgradeHack")
Goto Deselect
//
Fire:
"----" A 0 A_JumpIfInventory("NNSigilPiece", 5, "Fire5")
"----" A 0 A_JumpIfInventory("NNSigilPiece", 4, "Fire4")
"----" A 0 A_JumpIfInventory("NNSigilPiece", 3, "Fire3")
"----" A 0 A_JumpIfInventory("NNSigilPiece", 2, "Fire2")
"----" A 0 A_JumpIfInventory("NNSigilPiece", 1, "Fire1")
"----" A 0 A_GiveInventory("NNSigilPiece", 1)
Fire1:
"----" A 0 A_PlaySound("weapons/sigilcharge", CHAN_WEAPON)
"----" A 18 Bright A_Light2
"----" A 3 Bright A_GunFlash
TNT1 A 0 A_PlaySound("weapons/sigilcharge", CHAN_WEAPON)
TNT1 A 0 ACS_NamedExecuteAlways("NNSigilDamageUser", 0, 4)
SIGH A 15 A_FireCustomMissile("NNSigilLightningSpot", 0, 0)
Goto Ready1
Fire2:
"----" A 0 A_PlaySound("weapons/sigilcharge", CHAN_WEAPON)
"----" A 18 Bright A_Light2
"----" A 3 Bright A_GunFlash
TNT1 A 0 A_PlaySound("weapons/sigilcharge", CHAN_WEAPON)
TNT1 A 0 ACS_NamedExecuteAlways("NNSigilDamageUser", 0, 8)
SIGH B 15 A_FireCustomMissile("SpectralLightningH1", 0, 0)
Goto Ready2
Fire3:
"----" A 0 A_PlaySound("weapons/sigilcharge", CHAN_WEAPON)
"----" A 18 Bright A_Light2
"----" A 3 Bright A_GunFlash
TNT1 A 0 A_PlaySound("weapons/sigilcharge", CHAN_WEAPON)
TNT1 A 0 ACS_NamedExecuteAlways("NNSigilDamageUser", 0, 12)
TNT1 A 0 A_GiveInventory("NNSigil3AttackCounter", 20)
TNT1 A 0 A_SetAngle(angle-90)
Fire3Loop:
TNT1 A 0 A_SetAngle(angle+9)
TNT1 A 0 A_FireCustomMissile("SpectralLightningBall1", 0, 0)
TNT1 A 0 A_TakeInventory("NNSigil3AttackCounter", 1)
TNT1 A 0 A_JumpIfInventory("NNSigil3AttackCounter", 1, "Fire3Loop")
SIGH C 15 A_SetAngle(angle-90)
Goto Ready3
Fire4:
"----" A 0 A_PlaySound("weapons/sigilcharge", CHAN_WEAPON)
"----" A 18 Bright A_Light2
"----" A 3 Bright A_GunFlash
TNT1 A 0 A_PlaySound("weapons/sigilcharge", CHAN_WEAPON)
TNT1 A 0 ACS_NamedExecuteAlways("NNSigilDamageUser", 0, 16)
SIGH D 15 A_FireCustomMissile("NNSigilLightningBigV", 0, 0)
Goto Ready4
Fire5:
"----" A 0 A_PlaySound("weapons/sigilcharge", CHAN_WEAPON)
"----" A 18 Bright A_Light2
"----" A 3 Bright A_GunFlash
TNT1 A 0 A_PlaySound("weapons/sigilcharge", CHAN_WEAPON)
TNT1 A 0 ACS_NamedExecuteAlways("NNSigilDamageUser", 0, 20)
SIGH E 15 A_FireCustomMissile("SpectralLightningBigBall1", 0, 0)
Goto Ready5
//
Flash:
SIGF A 4 Bright A_Light2
SIGF B 6 Bright A_LightInverse
SIGF C 4 Bright A_Light1
TNT1 A 0 A_Light0
Stop
}
}
Actor NNSigilUpgradeHack : Weapon
{
Weapon.SisterWeapon "NNSigil"
+WEAPON.CHEATNOTWEAPON
States
{
Select:
TNT1 AAAAAAAAAA 0 A_Raise
TNT1 A 1 A_Raise
Loop
Ready:
TNT1 A 0 A_SelectWeapon("NNSigil")
Deselect:
TNT1 AAAAAAAAAA 0 A_Lower
TNT1 A 1 A_Lower
Loop
//Need a valid 'Fire' state, otherwise ZDoom will complain
Fire:
TNT1 A 1
Goto Ready
}
}
Actor NNSigil3AttackCounter : Inventory
{
Inventory.MaxAmount 20
}
Actor NNSigilPiece : Inventory
{
Inventory.MaxAmount 5
}
DamageType NNSigilUse
{
NoArmor
}
Actor NNSigil1Pickup : CustomInventory replaces Sigil1
{
ConversationID 196, 190, 194
Inventory.PickupMessage "$TXT_SIGIL"
Inventory.PickupSound "weapons/sigilcharge"
+FLOORCLIP
States
{
Pickup:
TNT1 A 0 A_JumpIfInventory("NNSigil", 1, "GivePieceLoop")
TNT1 A 0 A_TakeInventory("NNSigilPiece", 5)
TNT1 A 0 A_GiveInventory("NNSigil", 1)
TNT1 A 0 A_Jump(256, "GivePieceLoop")
Stop
Drop:
TNT1 A 0 A_GiveInventory("NNSigil", 1, AAPTR_PLAYER1)
TNT1 A 0 A_GiveInventory("NNSigilPiece", 1, AAPTR_PLAYER1)
TNT1 A 0 A_GiveInventory("NNSigil", 1, AAPTR_PLAYER2)
TNT1 A 0 A_GiveInventory("NNSigilPiece", 1, AAPTR_PLAYER2)
TNT1 A 0 A_GiveInventory("NNSigil", 1, AAPTR_PLAYER3)
TNT1 A 0 A_GiveInventory("NNSigilPiece", 1, AAPTR_PLAYER3)
TNT1 A 0 A_GiveInventory("NNSigil", 1, AAPTR_PLAYER4)
TNT1 A 0 A_GiveInventory("NNSigilPiece", 1, AAPTR_PLAYER4)
TNT1 A 0 A_GiveInventory("NNSigil", 1, AAPTR_PLAYER5)
TNT1 A 0 A_GiveInventory("NNSigilPiece", 1, AAPTR_PLAYER5)
TNT1 A 0 A_GiveInventory("NNSigil", 1, AAPTR_PLAYER6)
TNT1 A 0 A_GiveInventory("NNSigilPiece", 1, AAPTR_PLAYER6)
TNT1 A 0 A_GiveInventory("NNSigil", 1, AAPTR_PLAYER7)
TNT1 A 0 A_GiveInventory("NNSigilPiece", 1, AAPTR_PLAYER7)
TNT1 A 0 A_GiveInventory("NNSigil", 1, AAPTR_PLAYER8)
TNT1 A 0 A_GiveInventory("NNSigilPiece", 1, AAPTR_PLAYER8)
Stop
//
Spawn:
SIGL A -1
Stop
GivePieceLoop:
TNT1 A 0
Stop
}
}
Actor NNSigil2Pickup : NNSigil1Pickup replaces Sigil2
{
ConversationID 197, 191, 195
States
{
Spawn:
SIGL B -1
Stop
GivePieceLoop:
TNT1 A 0 A_JumpIfInventory("NNSigilPiece", 2, 2)
TNT1 A 0 A_GiveInventory("NNSigilPiece", 1)
Loop
TNT1 A 0
Stop
}
}
Actor NNSigil3Pickup : NNSigil1Pickup replaces Sigil3
{
ConversationID 198, 192, 196
States
{
Spawn:
SIGL C -1
Stop
GivePieceLoop:
TNT1 A 0 A_JumpIfInventory("NNSigilPiece", 3, 2)
TNT1 A 0 A_GiveInventory("NNSigilPiece", 1)
Loop
TNT1 A 0
Stop
}
}
Actor NNSigil4Pickup : NNSigil1Pickup replaces Sigil4
{
ConversationID 199, 193, 197
States
{
Spawn:
SIGL D -1
Stop
GivePieceLoop:
TNT1 A 0 A_JumpIfInventory("NNSigilPiece", 4, 2)
TNT1 A 0 A_GiveInventory("NNSigilPiece", 1)
Loop
TNT1 A 0
Stop
}
}
Actor NNSigil5Pickup : NNSigil1Pickup replaces Sigil5
{
ConversationID 200, 194, 198
States
{
Spawn:
SIGL E -1
Stop
GivePieceLoop:
TNT1 A 0 A_JumpIfInventory("NNSigilPiece", 5, 2)
TNT1 A 0 A_GiveInventory("NNSigilPiece", 1)
Loop
TNT1 A 0
Stop
}
}
Actor NNSigilLightningSpot : SpectralLightningSpot
{
+SPECTRAL //This flag is needed, otherwise the SpectralLightningV1/V2
States //actors won't damage the spectres. Wierd.
{
Spawn:
TNT1 A 0
TNT1 A 0 A_TransferPointer(AAPTR_TARGET, AAPTR_DEFAULT, AAPTR_PLAYER_GETTARGET, AAPTR_TRACER)
TNT1 A 0 A_CheckFlag("SHOOTABLE", 3, AAPTR_TRACER)
TNT1 A 0 A_Warp(AAPTR_TARGET) //Try to stick to the player's feet.
ZAP5 A 4 Bright A_ChangeVelocity(28,0,0, CVF_RELATIVE|CVF_REPLACE)
Goto Super::Spawn+1
ZAP5 A 4 Bright A_Warp(AAPTR_TRACER, 0,0,0, 0, WARPF_NOCHECKPOSITION|WARPF_STOP|WARPF_TOFLOOR)
Goto Super::Spawn+1
}
}
Actor NNSigilLightningBigV : SpectralLightningBigV1
{
Decal "BaronScorch"
States
{
Spawn:
TNT1 A 0
TNT1 A 0 A_TransferPointer(AAPTR_TARGET, AAPTR_DEFAULT, AAPTR_PLAYER_GETTARGET, AAPTR_TRACER)
TNT1 A 0 A_CheckFlag("SHOOTABLE", 2, AAPTR_TRACER)
ZOT2 A 4 Bright A_ChangeVelocity(28,0,0, CVF_RELATIVE)
Goto Super::Spawn+1
ZOT2 A 4 Bright
Goto Super::Spawn+1
}
}
//Again, if you don't care for compatibility, then ignore the spectre.
Actor NNSigilSpectre5 : AlienSpectre5 replaces AlienSpectre5
{
ConversationID 73, -1, -1
States
{
Death:
AL1P A 6 Bright A_SpectreChunkSmall
AL1P B 6 Bright A_Scream
AL1P C 6 Bright A_SpectreChunkSmall
AL1P DE 6 Bright
AL1P F 6 Bright A_SpectreChunkSmall
AL1P G 6 Bright
AL1P H 6 Bright A_SpectreChunkSmall
AL1P IJK 6 Bright
AL1P LM 5 Bright
AL1P N 5 Bright A_SpectreChunkLarge
AL1P OPQ 5 Bright
TNT1 A 0 A_NoBlocking
AL1P R 5 Bright ACS_NamedExecuteAlways("NNSigilSpectre5Death")
Stop
}
}
// And lastly but not the least, the player
Actor NNSigilPlayer : StrifePlayer
{
Player.StartItem "PunchDagger"
Player.WeaponSlot 8, "NNSigil"
}
Code: Select all
#library "nnsigil"
#include "zcommon.acs"
Script "NNSigilDamageUser" (int damage)
{
Thing_Damage2(0, damage, "NNSigilUse");
}
//Ignore the rest below if you don't wish to make your sigil compatible with the stock maps.
Script "NNSigilSpectre5Death" (void)
{
if( ThingCountName("NNSigilSpectre5", 0) )
terminate;
//Find a player without messing with TIDs
bool PlayerFound = false;
//As suggested by Nightfall
for (int i = 0; i < 8; i++)
{
if ( PlayerInGame(i) )
{
SetActivator(0, AAPTR_PLAYER1 << i);
if ( GetActorProperty(0, APROP_Health) > 0)
{
PlayerFound = true;
break;
}
}
}
if( !PlayerFound )
terminate; //Either no player or (all) player(s) dead
Print(l:"TXT_KILLED_LOREMASTER");
GiveInventory("QuestItem26", 1);
if( GameType() == GAME_SINGLE_PLAYER )
{
GiveInventory("UpgradeStamina", 10);
GiveInventory("UpgradeAccuracy", 1);
}
bool HasCommUnit = CheckInventory("Communicator");
if ( !HasCommUnit )
GiveInventory("Communicator", 1);
//The main reason why this script is necessary
if( CheckInventory("NNSigil") && CheckInventory("NNSigilPiece") == 5 )
SendToCommunicator(85, 0, 0, 0); //Couldn't find another way to change the LOG (mission text)
else //and it's not a game breaker if the "incoming message"
SendToCommunicator(83, 0, 0, 0); //text is shown in the upper left corner, is it?
if ( !HasCommUnit )
TakeInventory("Communicator", 1);
Floor_LowerToLowest(666, 8);
}
//This is used to recognize the fake Sigil, It's based off of script 0.
//
//While I don't have much experience with xlat lumps,
//it seems that they don't recognize ACS_Named* specials.
Script 2000 (int type, int tag)
{
switch(type)
{
case 196:
if ( CheckInventory("NNSigil") && CheckInventory("NNSigilPiece") >= 2)
{
Floor_LowerToLowest(tag, 8);
ClearLineSpecial();
}
break;
case 197:
if ( CheckInventory("NNSigil") && CheckInventory("NNSigilPiece") >= 2)
{
Door_Close(tag, 64);
ClearLineSpecial();
}
break;
case 200:
if ( CheckInventory("NNSigil") )
{
Door_Open(tag, 16);
ClearLineSpecial();
}
break;
case 229:
SetResultValue(0);
if ( CheckInventory("NNSigil") && CheckInventory("NNSigilPiece") == 5)
SetResultValue( Door_Animated(tag, 4, 105) );
break;
case 235:
SetResultValue(0);
if ( CheckInventory("NNSigil") && CheckInventory("NNSigilPiece") == 5)
SetResultValue( Door_Open(tag, 8)|Floor_LowerToLowest(tag, 8) );
break;
}
}
//And now for some multiplayer related nonsense, bleh.
Script "NNSigilPlayerDeath" DEATH
{
if ( !(GetCVar("dmflags2") & 2) || !CheckWeapon("NNSigil") )
terminate;
//As suggested by Nightfall.
int piece = CheckInventory("NNSigilPiece");
if ( !piece ) piece = 1;
SpawnSpot( strparam(s:"NNSigil", d:piece, s:"Pickup"), 0 );
}