Event Hooks and Modular Cannons
The first part of this update came from my reviewing
base_entity
and noticing lots of opportunities for triggered events to happen, like “entity reaches 50% health”, “entity’s shields go down”, etc. So, I created function calls for as many of these events as I could think of in the appropriate places and implemented them as empty functions in the create step. Anything that inherits frombase_entity
(ie., anything that isn’t a shot or a powerup at the moment) can override that function call with whatever the desired behaviour is, and it just works.The second part was to create mutually-exclusive powerups. The first batch of these are “cannons”, separated from other weapon powerups, so a player can’t have “dual-shot”, “spread-shot”, and “rear-shot” at the same time. Going forward, this will facilitate secondary-fire modes, I hope.
- Added rudimentary hooks to all kinds of events on enemies, and implemented a nova-ejection on the Mega Cluster at each damage stage increase. I’ve removed all splitter fragment generation, as it was making the battle way, way too hard with the new debris.
- I need to upgrade these hooks to take intelligent arguments (like
_bullet
) so that damage-level hooks can take revenge on_bullet.shooter
.
- I need to upgrade these hooks to take intelligent arguments (like
- Separated powerup cannons (dual, rear, spread) from weapon powerups and implemented a modular collection system, so now if one is collected any others in the collection that are currently equipped get spat out. Figuring out how to avoid auto-picking them up and spamming the pickup display took doing, but now ejected modules no longer seek the player, and are briefly un-gettable.
- Shield-draining beams now repair shields, making the blue and purple cores much more dangerous to shielded opponents.
- Shield-beam drains even when the recipient is full, but you can see the excess shield energy spraying out into space now. It’s fun!
- Shield capsules are guaranteed to spit out a basic shield powerup if the shooter’s shields are down
- All capsules correctly emit debris again.
Whew, I think that’s it. The dual-cannon is by far the most powerful of the set, but if the spread-cannon can be brought to the final boss, it’s very, very helpful against the swarm of gravel-style debris. The shield cores are now pretty devilish unless you intelligently wreck your shields.
Next: seeking shots? Rings?