hakase-labs / hikari

Mega Man/Rockman game clone written by nerds for nerds.
42 stars 8 forks source link

Weapons: more robust logic/scripting #188

Open zackthehuman opened 10 years ago

zackthehuman commented 10 years ago

Add support for more advanced logic for weapon usage, possibly via scripting so different aspects of weapons can be developed. Charging, multi-stage weapons like Leaf Shield, etc.

zackthehuman commented 8 years ago

There are at least two aspects of this:

  1. Make weapons stateful and script-driven
  2. Make projectiles stateful and script-driven

Weapons should be stateful since they can have several phases -- like Leaf Shield, all Rush weapons, Pharaoh Shot, etc. With Rush weapons for example, initially the "weapon action" is to summon Rush. While Rush is summoned the weapon action functions just like the normal Mega Buster/Arm Cannon. Rush (a Projectile of sorts) has its own state and logic that interacts with the weapon state. Once Rush is despawned then the weapon state is reset.

Leaf Shield has weapon state as well. The initial weapon action is to summon a shield that stays attached to Rock's position. The projectile waits for input, once direction input is received, the projectile travels in that direction and cannot be stopped. Once despawned, the weapon state is reset.

Most shield weapons work more or less like Leaf Shield but with small tweaks.