(Get ready for a very long post.)
From what I have gathered, shields and other powerups are some of the most hardcoded objects in the game. That is why I have an idea for a system that could be used to make custom powerups possible to create and fully customizable.
-----
In this case, the definition of a powerup will be an object with a new flag enabled, called MF_POWERUP, or perhaps MF_SHIELD, which will signify it as a powerup and make the game treat it in a few special ways. In order for a player to collect a custom powerup, there will be a SOC action called A_GivePowerup, which will give the target player a powerup with an object number of Var1. As long as the object has MT_POWERUP checked, the SOC action will spawn the object at the player's location.
A powerup will always exist at the location of the player that it affects, and its hitbox will be the same as theirs. When destroyed, this restriction is lifted, and the shield can move away from the player while in its DeathState.
A powerup also has some special properties that are defined by its object attributes:
--SpawnState determines the state of the powerup when it is spawned around the player. This state should usually be an infinitely long single state or part of a looping pattern of states (if the creator wants a cycle of sprites for the powerup. Green = color-changeable for powerup sprites.) If the creator does not want the powerup to be visible by itself, then the SpawnState(s) should all use SPR_DISS for their sprites. All SpawnStates should have no action unless the powerup is supposed to do something when not activated by the player.
--SpawnHealth defines the amount of hits the powerup can take before it disappears. If set to 0, the powerup will disappear in one hit but the player will still lose their rings, like with the Fire Flower. Cannot be more than 3. The powerup will lose a certain amount of opacity every time damage is taken.
--SeeState is the state the powerup goes into when the player presses spin in mid-air. If ReactionTime is set, the powerup will go into this state at the same time the player activates the second ability.
--SeeSound is likewise the sound that plays when the player presses spin in mid-air.
--ReactionTime determines if the powerup gives the player a second ability that is activated when the player presses spin in mid-air. This follows the ordinary character ability table (0 = thok, 1 = fly, etc.) except for two extra abilities added on: 8 = Armageddon blast and 9 = attract objects with A_AttractChase (which is active all the time), and two abilities taken away: Fly and Glide/Climb, because they are so powerful. (Abilities activated like this, except for the extras, put players in their falling frames.) If the creator wishes the player not to have a special ability, this should be set to 10 or higher. If RaiseState does not have 4 in it (no object trail is left when using special ability) the player's thokitem will be spawned like normal when the secondary Thok or Homing Attack is used, unless ghostthokitem = 0 (solid thokitem), in which case the default thok object will be used regardless of the player's own thokitem and will behave as if ghostthokitem = 1 (intangible thokitem.)
--AttackSound is the sound that plays when the powerup launches a projectile.
--PainState is the state that the powerup goes into when it is damaged, but not destroyed (if it has multiple hits.)
--PainChance determines if the powerup launches a projectile. If it is anything other than 0, that object number (if it has MF_MISSILE checked) is launched from the front of the player when the player presses the fire button, like with the Fire Flower.
--PainSound is the sound the powerup makes when damaged, but not destroyed.
--MeleeState does not determine an actual state, but instead determines the transparency of the powerup (if visible.) 255 = opaque, 0 = invisible.
--MissileState does not determine an actual state, but instead determines if the player is turned a color when the powerup is obtained. When the powerup is destroyed, the player changes back to their normal color. The normal table of 1-15 (1 = cyan, etc.) is used for this effect. If this is set to 15 and the powerup is obtained in Match/CTF, the player's color will not be affected. In general, the color of the player will not be affected in any gametype (like CTF) or situation where the player's color is forced.
--DeathState is the state activated when the powerup is destroyed.
--DeathSound is, likewise, the sound made upon destruction.
--XDeathState does not determine an actual state, but instead what the player is immune to when they obtain the powerup. 1 = fire (MF_FIRE or Damage (Fire) sector type), 2 = electricity (Damage (Electrical) sector type), 4 = water damage (Damage (Water) sector type), 8 = drowning, 16 = space countdown. Combining values combines effects.
--Speed determines the actionspd equivelant of the ReactionTime ability.
--Mass determines the color of the powerup, if its sprites have green in them. Like MissileState, this follows the 1-15 table of colors.
--Damage determines if the player leaves a trail of an object. If it is anything other than 0, that object number will be trailed behind the player, and the angle of the trail object will always be the same as the angle of the player when the trail was created. To prevent the player from being damaged by their own damaging trail, the powerup will prevent the trail object from being tangible until a certain number of tics after spawning.
--ActiveSound determines the sound the powerup makes when it begins to create the trail.
--RaiseState does not determine an actual state, but instead when the trail is created. 1 = when the player is moving, 2 = jumping, 4 = using special ability, 8 = spinning on the ground, 16 = using second ability that the shield gives them. Combining values combines effects. If the trail is spawned while the player is using a ReactionTime-based Thok or Homing Attack (only ReactionTime-based, RaiseState has 16 in it) it will act as the thokitem for that ability, with ghostthokitem set to 0 (non-ghostly). This will mean that is is spawned in place of the normal thok object and appears even when the player is moving at 0 speed (for example, if Speed (secondary ability actionspd) = 0.)
--If the powerup has MF_FIRE checked, it will disappear underwater, emitting a flash like the Attraction Shield.
In order to make the powerup function properly, all states should eventually lead back to the SpawnState or a point in the cycle of ordinary states, to prevent the powerup from disappearing or turning into something else. Having a powerup state lead to the DeathState will cause the powerup to self-destruct upon reaching the state, and having it lead to the PainState will cause the powerup to damage itself. If any state-determining value is set to 0, the powerup will remain in its current state, except in the case of DeathState where it will disappear. Obtaining a custom powerup will override all others.
If the creator wants to create a custom ability for ReactionTime, like Hinote's Flare Jump, the best option would be to set ReactionTime = 0 (secondary thok ability), RaiseState = 16 (causes trail to appear when using secondary ability), and set the trail to the custom ability object. If the player should be stationary when the ability object is spawned, set Speed = 0 (secondary ability actionspd = 0.)
-----
And that's my idea. Anyone think it's a good one?