Using inheritance
From ZDoom Wiki
Inheritance is a mechanism that lets you take all properties defined by a previous actor and only change a few of its properties, flags or states.
Inheritance has special meaning when used with monsters. Any related monsters belong to one 'species'. Monsters within the same species cannot hurt each other with projectiles. A species is defined as all monsters that have one monster as a common ancestor. For example, if you create various variations of imps which are all derived from DoomImp they will form one species.
Inheritance is an essential means to create new inventory items. Inventory items are derived from predefined inventory classes.
Examples:
This is a Zombie with a different attack and more health. But it inherits everything else from the already existing Doom zombie:
actor PlasmaZombie : ZombieMan 9600 { health 40 dropitem Cell missiletype PlasmaBall states { Missile: POSS E 10 A_FaceTarget POSS F 5 A_MissileAttack POSS E 5 A_FaceTarget POSS F 5 A_MissileAttack POSS E 5 A_FaceTarget POSS F 5 A_MissileAttack goto See } }
This uses SKIP_SUPER to reset the actor to default values. It only uses inheritance to get access to the parent's states:
actor DeadZombieMan : ZombieMan 18 { SKIP_SUPER spawn parent Death 4 }
Note that using inheritance retains all states unless redefined. As an example, the ScriptedZombie below has an incomplete death animation because calling the Death state removes any previous inheritance from that state. This is a zombie which uses a script to perform its attack and opens a door when dying:
actor ScriptedZombie : ZombieMan 9604 { health 40 states { Missile: POSS E 10 A_FaceTarget POSS F 5 ACS_ExecuteAlways (999,0,0) goto See Death: POSS A 1 Door_Open (1337, 16) stop } }
Another possibility is to inherit from actors that have programmed capabilities. For example, Strife's LoreShot works like a grappling hook. You can easily get access to this behavior by inheriting from it and define your new actor around it:
actor GrapplingHook : LoreShot { seesound "hook/shoot" deathsound "hook/hit" states { Spawn: WS12 AB 2 bright loop Death: WS12 CDEF 6 stop } }

