Brutal Doom V20 Plasma Rifle VM Exception (Possibe Fix)

Discuss anything ZDoom-related that doesn't fall into one of the other categories.
Post Reply
User avatar
Lexus Alyus
Posts: 4220
Joined: Tue Jul 15, 2003 5:07 pm
Location: Nottingham, UK
Contact:

Brutal Doom V20 Plasma Rifle VM Exception (Possibe Fix)

Post by Lexus Alyus »

Greetings,

I've been modifying and tinkering around with Brutal Doom V20 and I noticed the VM Exception Plasma Rifle bug using newer versions of GZDoom. I came across this bug report:

viewtopic.php?t=63162

And the issue seems to be the way the Brutal Doom plasma rifle is coded and not a GZDoom bug.

I think I've found a solution to this. I think the issue has something to do with Dual Plasma Rifles. In my mod I've removed all reference to the Dual Plasma rifles and now the Plasma Rifle no longer crashes GZDoom with a VM Exception. This works for the purist version too (my mod only uses the purist weapons, except for the chaingun and the rifle). Here's my altered plasma rifle code - I also removed the DualPlasma rifle decorate lump and the refernce to it in the main decorate lump:

Code: Select all

ACTOR PlasmaAmmo : Ammo
{
   Inventory.Amount 0
   Inventory.MaxAmount 50
   Ammo.BackpackAmount 0
   Ammo.BackpackMaxAmount 50
   Inventory.Icon "PLASA0"
}

Actor HasPlasmaWeapon: Inventory
{
inventory.maxamount 1
}

// --------------------------------------------------------------------------
//
// Plasma rifle
//
// --------------------------------------------------------------------------

ACTOR Plasma_Gun : Doomweapon Replaces PlasmaRifle
{
	Weapon.SelectionOrder 100
	Weapon.AmmoUse1 0
	Weapon.AmmoGive1 40
	Weapon.AmmoUse2 0
	Weapon.AmmoGive2 0
    Inventory.PickupSound "PLSDRAW"
	Weapon.AmmoType1 "Cell"
	Weapon.AmmoType2 "PlasmaAmmo"
    +WEAPON.NOAUTOAIM
	+FORCEXYBILLBOARD
	+WEAPON.NO_AUTO_SWITCH
	Inventory.PickupMessage "Plasma Gun"
	States
	{
	
	Flash:
	TNT1 A 0
	TNT1 A 0 A_JumpIfInventory("FlashlightAction", 1, "CheckFlashlight")
	TNT1 A 1
	TNT1 A 0 A_JumpIfInventory("IsFlashlightOn", 1, "FlashOn")
	Goto Flash
	FlashOn:
	TNT1 A 0 A_FireCustomMissile("FlashlightProjectile", 0, 0, 0, 0, 0, 0)
	TNT1 A 0 A_FireCustomMissile("FlashlightSource", 0, 0, 0, 0, 0, 0)
	Goto Flash 
	CheckFlashLight:
	TNT1 A 1
	TNT1 A 0 A_TakeInventory("FlashlightAction")
	TNT1 A 0 A_JumpIfInventory("IsFlashlightOn", 1, "TurnOffFlashlight")
	TNT1 A 0 A_GiveInventory("IsFlashlightOn", 1)
	Goto Flash
	TurnOffFlashlight:
	TNT1 A 0 A_TakeInventory("IsFlashlightOn", 1)
	Goto Flash
	
	Steady:
	TNT1 A 1
	Goto Ready
	Ready:
	    TNT1 A 0 A_JumpIfInventory("IsPlayingAsPurist", 1, "PuristGun")
		TNT1 A 0 A_GunFlash
        PLS9 ABC 1 A_JumpIfInventory("GoFatality", 1, "Steady")
        TNT1 A 0 A_PlaySound("PLSDRAW")
        TNT1 AA 0
        TNT1 A 0 A_JumpIfInventory("Kicking",1,"DoKick")
        TNT1 A 0 A_JumpIfInventory("Taunting",1,"Taunt")
		TNT1 A 0 A_JumpIfInventory("Salute1", 1, "Salute")
		TNT1 A 0 A_JumpIfInventory("Salute2", 1, "Salute")
        TNT1 A 0 A_JumpIfInventory("Reloading",1,"Reload")
		TNT1 A 0 A_JumpIfInventory("TossGrenade",1,"TossGrenade")
		PLSG A 1 A_WeaponReady
		Goto Ready+6
		
	DontNeedToReload:
	Goto Ready+6
	Deselect:
		TNT1 A 0 A_Takeinventory("Reloading",1)
		TNT1 A 0 A_Takeinventory("HasPlasmaWeapon",1)
		TNT1 A 0 A_TakeInventory("TossGrenade", 1)
        PLS9 CBA 1
		TNT1 AAAAAAAAAAAAAAAAAAAAAA 0 A_Lower
		TNT1 A 1
		Wait
	Select:
	    TNT1 A 0 A_JumpIfInventory("IsPlayingAsPurist", 1, "PuristGun")
	    TNT1 A 0 A_Giveinventory("HasPlasmaWeapon",1)
		TNT1 A 0 A_Takeinventory("FistsSelected",1)
	TNT1 A 0 A_Takeinventory("SawSelected",1)
	TNT1 A 0 A_Takeinventory("ShotgunSelected",1)
	TNT1 A 0 A_Takeinventory("SSGSelected",1)
	TNT1 A 0 A_Takeinventory("MinigunSelected",1)
	TNT1 A 0 A_Giveinventory("PlasmaGunSelected",1)
	TNT1 A 0 A_Takeinventory("RocketLauncherSelected",1)
    TNT1 A 0 A_Takeinventory("GrenadeLauncherSelected",1)
	TNT1 A 0 A_Takeinventory("BFGSelected",1)
	TNT1 A 0 A_Takeinventory("BFG10kSelected",1)
	TNT1 A 0 A_Takeinventory("RailGunSelected",1)
	TNT1 A 0 A_Takeinventory("SubMachineGunSelected",1)
	TNT1 A 0 A_Takeinventory("RevenantLauncherSelected",1)
	TNT1 A 0 A_Takeinventory("LostSoulSelected",1)
	TNT1 A 0 A_Takeinventory("FlameCannonSelected",1)
	TNT1 A 0 A_Takeinventory("HasBarrel",1)
	TNT1 A 0 A_TakeInventory("TossGrenade", 1)
	
		TNT1 A 0 A_Raise
		Wait
	Fire:
	TNT1 A 0 A_CheckReload
        TNT1 A 0 A_JumpIfInventory("Reloading",1,"Reload")
        TNT1 A 0 A_JumpIfInventory("PlasmaAmmo",1,2)
        Goto Reload
        TNT1 AAAA 0
        TNT1 A 0 A_PlaySound("PLSM9", CHAN_WEAPON)
		TNT1 A 0 A_FireCustomMissile("PlasmaFlareSpawn", 0, 0, 0, 0)
		RIFF A 0 A_FireCustomMissile("GunFireSmoke", 0, 0, 0, 0, 0, 0)
		PLSF A 1 BRIGHT A_FireCustomMissile("PlasmaBall", 0, 1, 0, 0)

		PLSA B 1 BRIGHT A_FireCustomMissile("Shakeyourassminor", 0, 0, 0, 0)
		PLSA C 1 BRIGHT
		PLSF B 1 BRIGHT


		TNT1 A 0 A_Takeinventory("PlasmaAmmo",1)
		TNT1 A 0 A_ReFire
        TNT1 A 0 A_PlaySound("PLSCOOL", 0)
        PLSG BCD 1
		PLSG EEEEEE 3 A_FireCustomMissile("SmokeSpawner",0,0,10,2)
		PLSG DCB 1
        TNT1 A 0 A_PlaySound("BEPBEP")
		Goto Ready+6

// Charging up secondary ------------------------------------------------------------

	AltFire:
        TNT1 A 0 A_JumpIfInventory("Reloading",1,"Reload")
        TNT1 A 0 A_JumpIfInventory("PlasmaAmmo",10,2)
        Goto Reload
        TNT1 AAA 0
		
	TNT1 A 0 A_PlaySound("PLSCHARG")
		PLSA A 1 BRIGHT A_FireCustomMissile("PlasmaFlareSpawn",0,0,0,0)
		PLSA B 1 BRIGHT A_Takeinventory("PlasmaAmmo",1)
		PLSA C 1 BRIGHT A_FireCustomMissile("PlasmaFlareSpawn",0,0,0,0)
		PLSA D 1 BRIGHT 
		PLSA A 1 BRIGHT A_FireCustomMissile("PlasmaFlareSpawn",0,0,0,0)
		PLSA B 1 BRIGHT A_Takeinventory("PlasmaAmmo",1)
		PLSA C 1 BRIGHT A_FireCustomMissile("PlasmaFlareSpawn",0,0,0,0)
		PLSA D 1 BRIGHT 
		PLSA A 1 BRIGHT A_FireCustomMissile("PlasmaFlareSpawn",0,0,0,0)
		PLSA B 1 BRIGHT A_Takeinventory("PlasmaAmmo",1)
		PLSA C 1 BRIGHT A_FireCustomMissile("PlasmaFlareSpawn",0,0,0,0)
		PLSA D 1 BRIGHT 
		PLSA A 1 BRIGHT A_FireCustomMissile("PlasmaFlareSpawn",0,0,0,0)
		PLSA B 1 BRIGHT A_Takeinventory("PlasmaAmmo",1)
		PLSA C 1 BRIGHT A_FireCustomMissile("PlasmaFlareSpawn",0,0,0,0)
		PLSA D 1 BRIGHT 
		PLSA A 1 BRIGHT A_FireCustomMissile("PlasmaFlareSpawn",0,0,0,0)
		PLSA B 1 BRIGHT A_Takeinventory("PlasmaAmmo",1)
		PLSA C 1 BRIGHT A_FireCustomMissile("PlasmaFlareSpawn",0,0,0,0)
		PLSA D 1 BRIGHT 
		PLSA A 1 BRIGHT A_FireCustomMissile("PlasmaFlareSpawn",0,0,0,0)
		PLSA B 1 BRIGHT A_Takeinventory("PlasmaAmmo",1)
		PLSA C 1 BRIGHT A_FireCustomMissile("PlasmaFlareSpawn",0,0,0,0)
		PLSA D 1 BRIGHT
		PLSA A 1 BRIGHT A_FireCustomMissile("PlasmaFlareSpawn",0,0,0,0)
		PLSA B 1 BRIGHT A_Takeinventory("PlasmaAmmo",1)
		PLSA C 1 BRIGHT A_FireCustomMissile("PlasmaFlareSpawn",0,0,0,0)
		PLSA D 1 BRIGHT
		PLSA A 1 BRIGHT A_FireCustomMissile("PlasmaFlareSpawn",0,0,0,0)
		PLSA B 1 BRIGHT A_Takeinventory("PlasmaAmmo",1)
		PLSA C 1 BRIGHT A_FireCustomMissile("PlasmaFlareSpawn",0,0,0,0)
		PLSA D 1 BRIGHT
		PLSA A 1 BRIGHT A_FireCustomMissile("PlasmaFlareSpawn",0,0,0,0)
		PLSA B 1 BRIGHT A_Takeinventory("PlasmaAmmo",1)
		PLSA C 1 BRIGHT A_FireCustomMissile("PlasmaFlareSpawn",0,0,0,0)
		PLSA D 1 BRIGHT
		PLSA A 1 BRIGHT A_FireCustomMissile("PlasmaFlareSpawn",0,0,0,0)
		PLSA B 1 BRIGHT A_Takeinventory("PlasmaAmmo",1)
		PLSA C 1 BRIGHT A_FireCustomMissile("PlasmaFlareSpawn",0,0,0,0)
		PLSA D 1 BRIGHT

	TNT1 A 0 A_PlaySound("PLSFULL", 6, 0.8, 1)
	TNT1 A 0 A_ReFire

// Holding Charge ------------------------------------------------------------

AltHold:
	
	TNT1 A 0 A_FireCustomMissile("PlasmaFlareSpawn",0,0,0,0)
	TNT1 A 0 A_JumpIfInventory("Reloading",1,"Cancel")
	PLFA A 1 BRIGHT offset (0, 32)
	
	TNT1 A 0 A_FireCustomMissile("PlasmaFlareSpawn",0,0,0,0)
	TNT1 A 0 A_JumpIfInventory("Reloading",1,"Cancel")
	PLFA C 1 BRIGHT offset (0, 33)
	
	TNT1 A 0 A_FireCustomMissile("PlasmaFlareSpawn",0,0,0,0)
	TNT1 A 0 A_JumpIfInventory("Reloading",1,"Cancel")
	PLFA A 1 BRIGHT offset (1, 32)
	
	TNT1 A 0 A_FireCustomMissile("PlasmaFlareSpawn",0,0,0,0)
	TNT1 A 0 A_JumpIfInventory("Reloading",1,"Cancel")
	PLFA C 1 BRIGHT offset (-1, 32)
    
	TNT1 A 0 A_ReFire

// Let Fly --------------------------------------------------------------------------

	TNT1 A 0 A_StopSound(6)
	PLSF A 1 A_PlaySound("PLSALTFR")
	PLSF B 2 BRIGHT A_Recoil(3)
	RIFF A 0 A_FireCustomMissile("GunFireSmoke", 0, 0, 0, 0, 0, 0)
	TNT1 AAAAAAAAAAAAA 0 A_FireCustomMissile("GunFireSmoke", random(-6,6), 0, -1, 0, 0, random(-4,4))
	TNT1 AAAAAAAAAAAAA 0 A_FireCustomMissile("PlasmaBall75", random(-6,6), 0, -1, 0, 0, random(-4,4))
		TNT1 A 0 A_FireCustomMissile("PlasmaFlareSpawn",-5,0,0,0)
        PLSG J 1 A_FireCustomMissile("ShakeYourAssQuad", 0, 0, 0, 0)
        PLSG KLKJ 1
	TNT1 A 0 A_SetPitch(pitch - 8.0)
        PLSG BCD 1
		PLSG EEEEEEEEEEEE 3 A_FireCustomMissile("SmokeSpawner",0,0,10,5)
		PLSG DCB 1
        TNT1 A 0 A_JumpIfInventory("PlasmaAmmo",1,2)
        Goto Reload
        TNT1 AAAA 0
        TNT1 A 0 A_PlaySound("BEPBEP")
		Goto Ready+6

// Cancel Charge --------------------------------------------------------------------------------------------

	Cancel:

			TNT1 A 0 A_TakeInventory("Reloading",1)
			TNT1 A 0 A_StopSound(6)
			TNT1 A 0 A_PlaySound("decharg", 5)

		PLSA A 1 BRIGHT A_FireCustomMissile("PlasmaFlareSpawn",0,0,0,0)
		PLSA B 1 BRIGHT A_Giveinventory("PlasmaAmmo",1)
		PLSA C 1 BRIGHT A_FireCustomMissile("PlasmaFlareSpawn",0,0,0,0)
		PLSA D 1 BRIGHT 
		PLSA A 1 BRIGHT A_FireCustomMissile("PlasmaFlareSpawn",0,0,0,0)
		PLSA B 1 BRIGHT A_Giveinventory("PlasmaAmmo",1)
		PLSA C 1 BRIGHT A_FireCustomMissile("PlasmaFlareSpawn",0,0,0,0)
		PLSA D 1 BRIGHT 
		PLSA A 1 BRIGHT A_FireCustomMissile("PlasmaFlareSpawn",0,0,0,0)
		PLSA B 1 BRIGHT A_Giveinventory("PlasmaAmmo",1)
		PLSA C 1 BRIGHT A_FireCustomMissile("PlasmaFlareSpawn",0,0,0,0)
		PLSA D 1 BRIGHT 
		PLSA A 1 BRIGHT A_FireCustomMissile("PlasmaFlareSpawn",0,0,0,0)
		PLSA B 1 BRIGHT A_Giveinventory("PlasmaAmmo",1)
		PLSA C 1 BRIGHT A_FireCustomMissile("PlasmaFlareSpawn",0,0,0,0)
		PLSA D 1 BRIGHT 
		PLSA A 1 BRIGHT A_FireCustomMissile("PlasmaFlareSpawn",0,0,0,0)
		PLSA B 1 BRIGHT A_Giveinventory("PlasmaAmmo",1)
		PLSA C 1 BRIGHT A_FireCustomMissile("PlasmaFlareSpawn",0,0,0,0)
		PLSA D 1 BRIGHT 
		PLSA A 1 BRIGHT A_FireCustomMissile("PlasmaFlareSpawn",0,0,0,0)
		PLSA B 1 BRIGHT A_Giveinventory("PlasmaAmmo",1)
		PLSA C 1 BRIGHT A_FireCustomMissile("PlasmaFlareSpawn",0,0,0,0)
		PLSA D 1 BRIGHT A_PlaySound("plscool", 7)
		PLSA A 1 BRIGHT A_FireCustomMissile("PlasmaFlareSpawn",0,0,0,0)
		PLSA B 1 BRIGHT A_Giveinventory("PlasmaAmmo",1)
		PLSA C 1 BRIGHT A_FireCustomMissile("PlasmaFlareSpawn",0,0,0,0)
		PLSA D 1 BRIGHT
		PLSA A 1 BRIGHT A_FireCustomMissile("PlasmaFlareSpawn",0,0,0,0)
		PLSA B 1 BRIGHT A_Giveinventory("PlasmaAmmo",1)
		PLSA C 1 BRIGHT A_FireCustomMissile("PlasmaFlareSpawn",0,0,0,0)
		PLSA D 1 BRIGHT
		PLSA A 1 BRIGHT A_FireCustomMissile("PlasmaFlareSpawn",0,0,0,0)
		PLSA B 1 BRIGHT A_Giveinventory("PlasmaAmmo",1)
		PLSA C 1 BRIGHT A_FireCustomMissile("PlasmaFlareSpawn",0,0,0,0)
		PLSA D 1 BRIGHT
		PLSA A 1 BRIGHT A_FireCustomMissile("PlasmaFlareSpawn",0,0,0,0)
		PLSA B 1 BRIGHT A_Giveinventory("PlasmaAmmo",1)
		PLSA C 1 BRIGHT A_FireCustomMissile("PlasmaFlareSpawn",0,0,0,0)
		PLSA D 1 BRIGHT

			TNT1 A 0 A_TakeInventory("Reloading",1)
			TNT1 A 0 A_PlaySound("BEPBEP", 5, 1.2)
			TNT1 A 0 A_ClearReFire

		Goto Ready+6

//  ------------------------------------------------------------------------------

	Flash:
		TNT1 A 4
        Goto LightDone
	Spawn:
	    //TNT1 A 0
		//TNT1 A 0 A_ChangeFLag("THRUACTORS", 1)
		PLAS A -1
		//TNT1 A 0 A_SpawnItem("DropedPlasmaGun")
		Stop

    Reload:

	TNT1 A 0 A_Takeinventory("Reloading",1)
	TNT1 A 0 A_ClearReFire
	TNT1 A 0 A_JumpIfInventory("PlasmaAmmo",50,"DontNeedToReload")
	TNT1 A 0 A_JumpIfInventory("Cell",1,7)

	TNT1 A 0 A_PlaySound("BEP")
	PLSR A 4 A_WeaponReady(WRF_NOFIRE)
	TNT1 A 0 A_PlaySound("BEP")
	PLSR A 4 A_WeaponReady(WRF_NOFIRE)
	TNT1 A 0 A_CheckReload
        Goto Ready+6
        TNT1 AAAA 0
        TNT1 A 0 A_PlaySound("PLREADY")

        PLSR AB 1
		TNT1 A 0 A_FireCustomMissile("PlasmaCaseSpawn",-210,0,20,-20)
		PLSR CDEEEEEEEEEEEEEEEF 1
        PLSR GHHIIIJJJJJJJJIKLBAAAAA 1
		
		ReloadingSequence:
		TNT1 AAAAAAAAAA 0
		TNT1 A 0 A_JumpIfInventory("PlasmaAmmo",50,15)
		TNT1 A 0 A_JumpIfInventory("Cell",1,3)
		Goto Ready+6
        TNT1 AAAAAA 0
		TNT1 A 0 A_Giveinventory("PlasmaAmmo",1)
		TNT1 A 0 A_Takeinventory("Cell",1)
		Goto ReloadingSequence
		TNT1 AAAAAAAA 0
		
		TNT1 A 0 A_Takeinventory("Reloading",1)
        Goto Ready+6

 	DoKick:
	    TNT1 A 0
		TNT1 A 0 A_Takeinventory("Zoomed",1)
        TNT1 A 0 A_ZoomFactor(1.0)
		TNT1 A 0 A_Takeinventory("ADSmode",1)
		NULL A 0 A_JumpIf (momZ > 0, "AirKick")
		NULL A 0 A_JumpIf (momZ < 0, "AirKick")
		NULL A 0 A_JumpIf (pitch > 32, "LowKickChecker1")
		Goto InitializeNormalKick
		
		LowKickChecker1:
		TNT1 A 0
	    NULL A 0 A_JumpIf (pitch > 90, "InitializeNormalKick")
		RIFF A 0 A_FireCustomMissile("KickAttackDetectDowned", 0, 0, 0, 0)
		
		InitializeNOrmalKick:
        TNT1 A 0 A_jumpifinventory("PowerStrength",1,"BerserkerKick")
		TNT1 A 0 A_PlaySound("KICK")
		TNT1 A 0 SetPlayerProperty(0,1,0)
		PLKI BCD 1
		RIFF A 0 A_FireCustomMissile("KickAttack", 0, 0, 0, -7)
        PLKI H 5
		KICK A 0 A_Takeinventory("Kicking",1)
		PLKI I 1
		PLKI GFEDCBA 1 
		TNT1 A 0 SetPlayerProperty(0,0,0)
		TNT1 A 0 A_JumpIfInventory("GoFatality", 1, "Steady")
		Goto Ready+6
    BerserkerKick:
		TNT1 A 0 A_PlaySound("KICK")
		TNT1 A 0 SetPlayerProperty(0,1,0)
		PLKI BCD 1
        RIFF A 0 A_FireCustomMissile("SuperKickAttack", 0, 0, 0, -7)
        PLKI H 5
		KICK A 0 A_Takeinventory("Kicking",1)
		PLKI I 1
		PLKI GFEDCBA 1 
		TNT1 A 0 SetPlayerProperty(0,0,0)
		TNT1 A 0 A_JumpIfInventory("GoFatality", 1, "Steady")
		Goto Ready+6
	
	AirKick:
	    TNT1 A 0 A_jumpifinventory("PowerStrength",1,"SuperAirKick")
		TNT1 A 0 A_PlaySound("KICK")
		TNT1 A 0 A_Recoil (-6)
		KICK JKLMN 1
        RIFF A 0 A_FireCustomMissile("AirKickAttack", 0, 0, 0, -31)
        KICK O 3
		KICK A 0 A_Takeinventory("Kicking",1)
		KICK PQRST 2
		TNT1 A 0 A_JumpIfInventory("GoFatality", 1, "Steady")
		Goto Ready+6
		
	SuperAirKick:
		TNT1 A 0 A_PlaySound("KICK")
		TNT1 A 0 A_Recoil (-6)
		KICK JKLMN 1
        RIFF A 0 A_FireCustomMissile("SuperAirKickAttack", 0, 0, 0, -31)
        KICK O 3
		KICK A 0 A_Takeinventory("Kicking",1)
		KICK PQRST 2
		TNT1 A 0 A_JumpIfInventory("GoFatality", 1, "Steady")
		Goto Ready+6
	
	Taunt:
		TNT1 A 0 A_Takeinventory("Zoomed",1)
        TNT1 A 0 A_ZoomFactor(1.0)
		TNT1 A 0 A_Takeinventory("Taunting",1)
		TNT1 A 0 A_JumpIfInventory("RealismMode", 1, "CheckGrab")
        TNT1 A 10
		FUCK A 1
		TNT1 A 0 BRIGHT A_FireCustomMissile("Taunter", 0, 0, -1, 0)
		TNT1 A 0 BRIGHT A_FireCustomMissile("Taunter", -9, 0, -1, 0)
		TNT1 A 0 BRIGHT A_FireCustomMissile("Taunter", 9, 0, -1, 0)
        FUCK B 1 A_PlaySound("FUCK", 2)
        FUCK CD 1 A_AlertMonsters
		FUCK E 15 A_Takeinventory("Taunting",1)
        FUCK DCBA 1
        TNT1 A 10
		Goto Ready
	Salute:
	    TNT1 A 0 SetPlayerProperty(0,1,0)
		TNT1 A 0 A_ALertMonsters
		SALU ABCDEDCDEDCDEDCBA 4
		TNT1 A 0 A_TakeInventory("Salute1",1)
		TNT1 A 0 A_TakeInventory("Salute2",1)
		TNT1 A 0 SetPlayerProperty(0,0,0)
		Goto Ready
		
	CheckGrab:
	    TNT1 A 0 
		TNT1 A 0 A_JumpIfTargetInLOS("CheckDistanceGrab")
		Goto Ready+6
	CheckDistanceGrab:
	    TNT1 A 0 
		TNT1 A 0 A_JumpIfCloser(100, "Grab")
		Goto Ready+6
	CheckIfCanGrab:
	    TNT1 A 0 
		TNT1 A 0 A_JumpIfInTargetInventory("CanGrab", 1, "Grab")
		Goto Ready+6	
	Grab:
	    PKUP ABC 2
		TNT1 A 0 A_CustomMissile("PickupProjectile")
		PKUP DEF 2
		Goto Ready
		
	PuristGun:
		TNT1 A 1
		TNT1 A 0 A_GiveInventory("ClassicPlasmaRifle", 1)
		TNT1 A 0 A_TakeInventory("Plasma_Gun", 1)
		TNT1 A 10
		Goto Ready	
	TossGrenade:	
		TNT1 A 0
		TNT1 A 0 A_TakeInventory("TossGrenade", 1)
		TNT1 A 0 A_JumpIfInventory("GrenadeAmmo", 1, 1)
		Goto NoGrenade
		GRTH ABCD 1
		TNT1 A 0 A_GiveInventory("FiredGrenade", 1)
		TNT1 A 0 A_PLaySound ("GRNPIN")
		GRTH EEFG 1
		TNT1 A 0 A_PLaySound ("GRNTOSS")
		GRTH HI 1
		TNT1 A 0 A_TakeInventory("GrenadeAmmo", 1)
		TNT1 A 0 A_FireCustomMissile("HandGrenade", random(-2,2), 0, 0, 0, 0, 0)
	    TNT1 A 0 A_TakeInventory("FiredGrenade", 1)
		GRTH JKLM 1
		TNT1 A 1 
		TNT1 A 0 A_TakeInventory("TossGrenade", 1)
		Goto Ready	
	NoGrenade:
		TNT1 A 0
		TNT1 A 0 A_Print("No Grenades Left.")
		Goto REady+6	
	}
}



ACTOR Plasma_Ball: FastProjectile Replaces PlasmaBall
{
	Radius 10
	Height 2
	Speed 60
	Damage 8
    DamageType Plasma
	Decal "SmallerScorch"
	Projectile
	+RANDOMIZE
	
	//+SHOOTABLE
	-NOBLOCKMAP
	+NOBLOOD
	+NORADIUSDMG
	+THRUSPECIES
	+MTHRUSPECIES
	Species "Marines"
	damagefactor "Blood", 0.0 damagefactor "BlueBlood", 0.0 damagefactor "GreenBlood", 0.0 damagefactor "Taunt", 0.0 damagefactor "KillMe", 0.0 damagefactor "Shrapnel", 0.0
	Health 5
	Scale 1.0
	
renderstyle ADD
alpha 0.90
Scale 0.10
	DeathSound "weapons/plasmax"
	//SeeSound "PLSM9"
    SeeSound "None"
	Obituary "$OB_MPPLASMARIFLE"
	States
	{
	DM:
		TNT1 A 0
		TNT1 A 0 A_ChangeFLag("THRUSPECIES", 0)
		TNT1 A 0 A_ChangeFLag("MTHRUSPECIES", 0)
		Goto Spawn1
	
	Spawn:
		TNT1 A 0
		TNT1 A 0 ACS_ExecuteAlways(719, 0, 0, 0, 0)//Check if Coop

	Spawn1:
        PBAL C 1 BRIGHT A_SpawnItem("PlasmaFlare",0,0)
		TNT1 A 0 A_CheckFloor("Death")
		Loop

Xdeath:
    //TNT1 A 0 A_SpawnItem ("PlasmaPuff", 0)
    //TNT1 A 0 A_SpawnItem ("RailPuff", 0)
	TNT1 A 0 A_CustomMissile ("BluePlasmaFire", 0, 0, random (0, 360), 2, random (0, 360))
	//TNT1 A 0 A_SpawnItem("BluePlasmaRife")
	TNT1 AAAAA 0 A_CustomMissile ("BluePlasmaParticle", 0, 0, random (0, 360), 2, random (0, 360))
    TNT1 B 1 A_Explode(6,50,0)
	TNT1 B 4
	TNT2 AA 9 A_CustomMissile ("PlasmaSmoke", 1, 0, random (0, 360), 2, random (0, 160))
		
		Stop

	Death:
    //TNT1 A 0 A_SpawnItem ("PlasmaPuff", 0)
    //TNT1 A 0 A_SpawnItem ("RailPuff", 0)
	TNT1 B 1 A_Explode(6,50,1)
	TNT1 A 0 A_SpawnItemEx ("DetectFloorCraterSmall",0,0,0,0,0,0,0,SXF_NOCHECKPOSITION,0)
	TNT1 A 0 A_SpawnItemEx ("DetectCeilCraterSmall",0,0,0,0,0,0,0,SXF_NOCHECKPOSITION,0)
	TNT1 A 0 A_CustomMissile ("BluePlasmaFire", 0, 0, random (0, 360), 2, random (0, 360))
	TNT1 AAAAA 0 A_CustomMissile ("BluePlasmaParticle", 0, 0, random (0, 360), 2, random (0, 360))
		TNT1 B 4	
    TNT2 AAAAAAAAA 9 A_CustomMissile ("PlasmaSmoke", 1, 0, random (0, 360), 2, random (0, 160))
		Stop
	}
}


ACTOR PlasmaBall75: Plasma_Ball
{
	Damage 9
	SeeSound "PLSM9"
}
ACTOR PlasmaBall99: Plasma_Ball
{
	Damage 20
	SeeSound "PLSM9"
}









/*
ACTOR PlasmagunOnTheFloor: CustomInventory Replaces PlasmaRifle
{
 scale 1.0
 radius 16
 height 4
 damage 0
   Mass 1
   Inventory.PickupMessage "You got the Plasma Rifle!"
    States
    {

	 Spawn:
	    TNT1 A 0
		TNT1 A 0 A_SpawnItem("InvisiblePlasmaAmmo")
		PLAS A -1
		Stop
		
	Pickup:
	    TNT1 A 0
		TNT1 A 0 A_JumpIfInventory("Plasma_Gun", 1, "Pickup2")
		TNT1 A 0 A_GiveInventory("Plasma_Gun", 1)
		Stop
	Pickup2:
	    TNT1 A 0 A_GiveInventory("DualPlasmaRifles", 1)
		Stop
    }
}


ACTOR DropedPlasmaGun: PlasmagunOnTheFloor
{
    States
    {

	 Spawn:
	    TNT1 A 0
		PLAS A -1
		Stop
    }
}
*/


ACTOR InvisiblePLasmaAmmo: CustomInventory
{
 scale 1.0
 radius 16
 height 4
 damage 0
   Mass 1
   Inventory.PickupMessage "Plasma Cells."
    States
    {

	 Spawn:
		CELL D -1
		Stop
	Pickup:
	    TNT1 A 0
		TNT1 A 0 A_GiveInventory("Cell", 50)
		Stop
}}
The only real difference is this plasma rifle now replaces the original Doom one, and the pickup state is normal doom behaviour (the Brital Doom one had a more complex pickup state that spawned multiple items to give you dual plasma rifels if you alreay had a plasma rifle - but it would leave the plasma rifle pickup sprite permenantly on the floor after pickup, which I hated :D)

Maybe this might help some people out?

PS: Dual Plasma Rifles aren't very doom IMO :lol:

:twisted:
Post Reply

Return to “General”