import "system/wpn_waterpistol.modifier.api" for API, Modifier, APIGet, APISet, Wire, Fields, State, Op import "luxe: io" for IO import "luxe: assets" for Strings import "luxe: world" for Entity, World import "luxe.project/asset" for Asset #block = data class Data { var starting_ammo: Num = 200 var max_capacity: Num = 200 #hidden var trigger_held: Bool = false #hidden var current_ammo: Num = 200 } #api #display = "Weapon: Water Pistol" #desc = "**Weapon**. Handles behaviour for the water pistol" #icon = "luxe: image/modifier/modifier.svg" class WeaponWaterPistol is API { //add public facing API here } #system #phase(on, tick) class System is Modifier { //required atm construct new(world: World) { super(world) } init(world: World) { Log.print("init `%(This)` in world `%(world)`") } #hidden attach(entity: Entity, data: Data) { Log.print("attached to `%(Strings.get(Entity.get_name(entity)))` `%(entity)` - `%(This)`") } #hidden detach(entity: Entity, data: Data) { Log.print("detached from `%(Strings.get(Entity.get_name(entity)))` `%(entity)` - `%(This)`") } #hidden tick(delta: Num) { // each {|entity: Entity, data: Data| // } } }