At this moment I want to replace it with stock Shotgun from Doom 2; later I will replace that weapon as another item
here is my decorate code for that monster:
Code: Select all
// TO-DO
// DROPITEM (SHOTGUN + ARMOR 1-4)
// GIBS
// ShotgunGuy Doom 2 replaced as Pig Cop
// http://doomwiki.org/wiki/Shotgun_guy
// http://dukenukem.wikia.com/wiki/Pig_Cop_(DN3D)
Class PigCop16 : Actor replaces ShotgunGuy
// Class PigCop : Actor replaces ShotgunGuy
// This will replace OG ShotgunGuy with custom 3D Pig Cop actor
//
// https://zdoom.org/wiki/Classes:Doom
// https://zdoom.org/wiki/Classes:Actor
// https://zdoom.org/wiki/DECORATE_format_specifications
{
Default
// https://zdoom.org/wiki/actor_properties
// The following properties can be set in an actor's DECORATE or ZScript's Default {} block definition.
// They control various characteristics of your actor, from appearance to behavior or the actor's physical properties.
// To use, simply specify the property and any associated values on its own line within the actor's definition and outside the state block.
{
Health 100;
// https://zdoom.org/wiki/Classes:Health
// A Health item adds a certain amount to the player's health points.
// Items of this type are always effective when picked up. They cannot be placed in the inventory;
// to have health items in inventory, use HealthPickup. Health is never used directly.
// This class is only used as a base class for predefined items (like Doom's Stimpack or for items defined in DECORATE).
Radius 20;
// Collisions and Physics
// Radius value
// Defines the radius of this actor.
// Default is 20.
// Notes:
// Using very small values can provoke glitches in collision detection.
// The total diameter is double this value, so an actor with a radius of 64 is actually 128 units in length and width,
// making it impossible for them to navigate through a corridor that's 128 units wide, for example.
Height 56;
// Height value
// Defines the height of this actor.
// Default is 16.
// Note: using very small values can provoke glitches in collision detection.
Mass 100;
// Defines the mass of this actor. The larger the mass the less an actor moves when being thrust by damage.
// If less than 10, the actor will also make small terrain splashes rather than normal ones.
// Default is 100.
// Note: Giving an actor an extremely high mass in an effort to make it unthrustable is not recommended.
// If an actor is stuck in another or in a wall and A_RadiusThrust affects the actor, the actor could be killed
// almost instantly if RTF_NOIMPACTDAMAGE isn't used. It's recommended to use the DONTTHRUST flag instead of 0x7FFFFFFF or the likes.
Speed 5;
// Defines how fast an actor moves. For projectiles this is the distance it moves per tic (1/35 seconds).
// For monsters it defines the size of one step done in A_Chase.
// Player's movement speed also depends on the Player.ForwardMove property.
// Default is 0.
PainChance 96;
// Probability of entering the pain state (256 = always, 0 = never).
// You can also specify PainChance per damage type. Sources of damage that have the FORCEPAIN flag ignore this property.
// Default is 0.
Monster;
// A monster is an actor controlled by the computer using AI routines present in their DECORATE code.
// https://zdoom.org/wiki/Monster
DropItem "Shotgun";
// Drop items when dead? -- SiN
+FLOORCLIP
// Actor's lower part is clipped when standing in a sector with a liquid texture (defined in the TERRAIN lump).
SeeSound "pig/sight";
// SeeSound soundname
// Defines the sound the actor makes when it sees the player (for monsters) or when a projectile is spawned.
AttackSound "pig/shoot";
// When enemy fires -- SiN
PainSound "pig/pain";
// PainSound soundname
// Defines the sound the actor makes when in pain. To hear this sound A_Pain has to be called.
DeathSound "pig/death";
// DeathSound soundname
// Defines the sound the actor makes when dying or when a projectile explodes.
// For non-projectiles the death sound must be explicitly played with A_Scream.
ActiveSound "pig/active";
// ActiveSound soundname
// Defines the sound the actor makes when active.
Obituary "%o was shot by a Pig Cop.";
// https://zdoom.org/wiki/actor_properties#Obituaries
// Obituary string
// Defines the obituary string for this actor.
// For weapons, this property can be used either directly on the weapon or on the puff for hitscan or rail attacks,
// but it should be on the projectile instead for missile attacks.
Tag "Duke Nukem Pig Cop";
// Tag name
// Gives the actor a name. The names are used in the key display on Strife's status bar and the default
// actor name in Strife's dialogs, as well as the name of the currently selected inventory item when
// the invquery console command is called.
}
// - ANIMATIONS -
States
// https://zdoom.org/wiki/actor_states
// An actor's states can be defined within its DECORATE definition. State sequences describe all the behavior of the actor as well as its animation.
{
Spawn:
// Defines the state that is displayed when an actor is spawned. For monsters this is normally also the idle loop.
//
// Note: An actor that has just been spawned does not run the codepointer from its first Spawn frame.
// An example of this behavior in the original games is ArchvileFire. It will be called, however, if the actor loops
// or returns to its Spawn state later. An easy workaround to have actors call a codepointer immediately after
// spawning consists in having the very first frame have a duration of 0 tics, followed by another frame in which the
// codepointer instruction is given. Another solution is to use the NoDelay keyword.
MOD1 AAAAAAAAA 4 A_Look;
// https://zdoom.org/wiki/A_Look
// Looks for players or other attackable actors in the game. If it finds a target, it enters its See state.
MOD1 A 0 A_Jump (40, "StepForward");
// https://zdoom.org/wiki/A_Jump
// Randomly advances to different frame. The chance value can range between 0 and 256.
// A chance of 0 will never jump, while a chance of 256 will always jump. If the jump does not happen,
// then the frame or instruction immediately following the A_Jump will be used as if A_Jump had not been present.
// If more than one offset or state values are present, A_Jump will choose one of them at random.
Loop;
// https://zdoom.org/wiki/Actor_states#Flow_control
// Jumps to the most recently defined state label. This is used for a looping animation.
// Do not put a loop on a state with a duration of -1, this is unnecessary and can cause problems.
StepForward:
// A custom frame sequencion name, as definied above? -- SiN
MOD1 BCDEFEDCB 4 A_Look;
goto Spawn;
See:
// Defines the walking animation for a monster.
// Note that this state must be present for actors which are able to chase and attack other actors.
MOD1 ABCDEFGHIJKLMNOPQR 2 A_Chase;
// https://zdoom.org/wiki/A_Chase
// This is the standard monster walking function which has to be used in the walking frames of a monster.
// Typically, it is used in an actor's "See" state or a custom equivalent. When called, actors usually change
// their directions to a strict 45 degree angle to give the effect of pursuit. This angle changes based on which
// direction the target is, no matter if the calling actor can see it or not.
Loop;
Missile:
// https://zdoom.org/wiki/Actor_flags#MISSILE
// Actor is a projectile. Actors with this flag set will enter their death state when hitting a solid
// and constantly move at their speed value (without the need of any actor functions).
// Actors with this flag will also be able to go through impassable linedefs.
// -- Automatically given by the Projectile combo
MOD1 R 3 A_Jump(96,"Missile2");
MOD1 S 3 A_FaceTarget;
// MOD1 T 4 Bright A_CustomBulletAttack(8.6, 8.6, 6, 2, "PigCopPuff");
MOD1 T 4 Bright A_CustomBulletAttack(8.6, 8.6, 6, 2, "BulletPuff", 0, CBAF_NORANDOM);
// https://zdoom.org/wiki/A_CustomBulletAttack
// MOD1 T 4 Bright A_SPosAttackUseAtkSound(8.6, 8.6, 6, 2);
// MOD1 T 3 Bright A_SpawnProjectile ("ShotgunFired", 32);
MOD1 T 2 A_PlaySound("pig/pump");
MOD1 VWXYZ 3;
MOD2 ABC 3;
// now he is firing second time
MOD1 S 3 A_FaceTarget;
MOD1 T 4 Bright A_CustomBulletAttack(8.6, 8.6, 6, 2, "BulletPuff", 0, CBAF_NORANDOM);
// MOD1 T 3 Bright A_SpawnProjectile ("ShotgunFired", 32);
MOD1 T 2 A_PlaySound("pig/pump");
MOD1 VWXYZ 3;
MOD2 ABC 3;
goto See;
Missile2:
// https://zdoom.org/wiki/Actor_flags#MISSILE
// Actor is a projectile. Actors with this flag set will enter their death state when hitting a solid
// and constantly move at their speed value (without the need of any actor functions).
// Actors with this flag will also be able to go through impassable linedefs.
// -- Automatically given by the Projectile combo
MOD3 C 3 A_FaceTarget;
MOD3 DEFGHIJKLM 3;
MOD3 N 4 A_FaceTarget;
MOD3 N 3 Bright A_CustomBulletAttack(8.6, 8.6, 6, 2, "BulletPuff", 0, CBAF_NORANDOM);
// MOD3 N 3 Bright A_SpawnProjectile ("ShotgunFired", 32);
MOD3 O 10 A_PlaySound("pig/pump");
MOD3 PQRST 2;
MOD3 U 8;
MOD3 N 3 A_FaceTarget;
MOD3 N 3 Bright A_CustomBulletAttack(8.6, 8.6, 6, 2, "BulletPuff", 0, CBAF_NORANDOM);
// MOD3 N 3 Bright A_SpawnProjectile ("ShotgunFired", 32);
MOD3 O 10 A_PlaySound("pig/pump");
MOD3 PQRSTU 2;
MOD3 KJIHGFEDCB 2;
// ML deleted as its reverse fire
goto See;
Pain:
// https://zdoom.org/wiki/Actor_states
// Defines the pain action. Multiple Pain states can be used depending on the type of damage inflicted. See custom damage types.
MOD2 DE 2;
MOD2 F 2 A_Pain;
// https://zdoom.org/wiki/A_Pain
// Plays the actor's pain sound.
MOD2 FDE 2;
goto See;
// https://zdoom.org/wiki/Actor_states#Flow_control
// The statement goto See jumps to the walking animation that has been overriden in the current actor class,
// or if such does not exist, to the inherited class's state. goto is however static,
// i.e. will not do virtual jumps for that, see A_Jump.
Death:
// Defines the normal death sequence. Multiple Death states can be used depending on the type of damage that kills the actor.
// See custom damage types. Also entered by projectiles when hitting a wall
// (or an actor as well if the Crash and/or XDeath states are not defined).
MOD2 G 2 A_Scream;
// https://zdoom.org/wiki/A_Scream
// Plays the actor's death sound if it has one. If the actor has the BOSS flag, the sound is heard
// at full volume regardless of distance, otherwise it diminishes by distance.
// The sound is played on the voice channel.
MOD2 H 2 A_NoBlocking;
// https://zdoom.org/wiki/A_NoBlocking
// It makes the actor visible if it is stealth.
// It makes it non-solid.
// It makes it spawn its dialogue-set and "regular" drop items.
// It clears the dialogue that is assigned to it.
MOD2 IJKLMNOPQRSTUVWXYZ 2;
MOD3 A -1;
// MOD3 B 5;
Stop;
}
}
// PIG COP PUFF
//actor PigCopPuff
//{
// damagetype "PigCop";
//}
// The projectile shot by Pig Cop using Shotgun - maybe none?
//class ShotgunFired : NormalBullet
//
//class ShotgunFired : DoomImpBall
//{
// Default
// {
// Scale 0.2;
// Speed 30;
// }
//}