PseudoCode Weapons - Milowan/WarChildPort GitHub Wiki
- WeaponStats* stats
- BulletPool* pool
- bool active
- bool reloading
- float reloadTimer
- int currentClip
- float cooldown
- float cdTimer
- bool unlocked (Post Port)
initialize attributes
to be overriden
if reloading reload
get bullet from pool initialize and activate bullet decrement currentClip
if currentClip > 0 fire at firerate else reloading = true
if reloadTimer >= reloadTime reloaded else keep reloading
return stats
return currentClip
unlock the weapon
return unlocked
stats = new BasicRifleStats()
stats = new AdvancedRifleStats()
stats = new MachinePistolStats()
float flightSpeed float movFraction float damage Vector3D forward float lifespan float age
disable object and set lifespan
if younger than lifespan move forward else despawn
initialize bullet using provided variables
hide the Actor
TArray<Bullet*> pool
initialize the pool
return inactive bullet